monaco-editor-core 0.56.0-dev-20251219 → 0.56.0-dev-20251220
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/nls.keys.json +1 -1
- package/esm/nls.messages.cs.js +2 -2
- package/esm/nls.messages.de.js +2 -2
- package/esm/nls.messages.es.js +2 -2
- package/esm/nls.messages.fr.js +2 -2
- package/esm/nls.messages.it.js +2 -2
- package/esm/nls.messages.ja.js +2 -2
- package/esm/nls.messages.js +1 -1
- package/esm/nls.messages.json +1 -1
- package/esm/nls.messages.ko.js +2 -2
- package/esm/nls.messages.pl.js +2 -2
- package/esm/nls.messages.pt-br.js +2 -2
- package/esm/nls.messages.ru.js +2 -2
- package/esm/nls.messages.tr.js +2 -2
- package/esm/nls.messages.zh-cn.js +2 -2
- package/esm/nls.messages.zh-tw.js +2 -2
- package/esm/nls.metadata.json +0 -2
- package/esm/vs/editor/common/core/editorColorRegistry.js +33 -34
- package/esm/vs/editor/common/core/editorColorRegistry.js.map +1 -1
- package/esm/vs/editor/common/editorContextKeys.js +47 -47
- package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
- package/esm/vs/editor/common/languages.js +56 -56
- package/esm/vs/editor/common/model/editStack.js +1 -1
- package/esm/vs/editor/common/standaloneStrings.js +11 -11
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
- package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
- package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +9 -18
- package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js.map +1 -1
- package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
- package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +17 -17
- package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
- package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
- package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
- package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
- package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +10 -10
- package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +9 -9
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
- package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
- package/esm/vs/editor/contrib/find/browser/findController.js +16 -16
- package/esm/vs/editor/contrib/find/browser/findWidget.js +26 -26
- package/esm/vs/editor/contrib/folding/browser/folding.js +20 -20
- package/esm/vs/editor/contrib/folding/browser/folding.js.map +1 -1
- package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
- package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
- package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
- package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
- package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
- package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
- package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
- package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
- package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
- package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +9 -9
- package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
- package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +21 -21
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -13
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +2 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +7 -7
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +13 -11
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js +5 -7
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js +6 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js +6 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js +9 -7
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js +14 -9
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +12 -10
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js +5 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js +2 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +40 -21
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js.map +1 -1
- package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
- package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +31 -31
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
- package/esm/vs/editor/contrib/links/browser/links.js +10 -10
- package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
- package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
- package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +11 -11
- package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
- package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
- package/esm/vs/editor/contrib/rename/browser/rename.js +11 -11
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
- package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -9
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +11 -11
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +17 -17
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
- package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
- package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
- package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
- package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
- package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +3 -3
- package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
- package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
- package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
- package/esm/vs/platform/actions/browser/toolbar.js +2 -2
- package/esm/vs/platform/actions/common/menuService.js +2 -2
- package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
- package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
- package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
- package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
- package/esm/vs/platform/contextkey/common/scanner.js +5 -5
- package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
- package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
- package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
- package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
- package/esm/vs/platform/list/browser/listService.js +27 -27
- package/esm/vs/platform/markers/common/markerService.js +2 -2
- package/esm/vs/platform/markers/common/markers.js +6 -6
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
- package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInput.js +13 -47
- package/esm/vs/platform/quickinput/browser/quickInput.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
- package/esm/vs/platform/quickinput/browser/quickInputController.js +7 -6
- package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
- package/esm/vs/platform/quickinput/common/quickInput.js.map +1 -1
- package/esm/vs/platform/theme/common/colorUtils.js +2 -2
- package/esm/vs/platform/theme/common/colors/baseColors.js +18 -18
- package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
- package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
- package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
- package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
- package/esm/vs/platform/theme/common/colors/minimapColors.js +11 -11
- package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
- package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
- package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
- package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
- package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
- package/esm/vs/platform/workspace/common/workspace.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts","vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACrG,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAmB,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAA6D,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,eAAe,EAAE,6BAA6B,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AACzU,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,qBAAqB,EA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AC;IACF,OAAO,aAAa,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,cAAc,CAAC,OAA+B;IACtD,IAAI,OAAO,EAAE,eAAe,IAAI,OAAO,EAAE,YAAY,EAAE,CAAC;QACvD,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,eAAe,EAAE,IAAI,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC;IACtE,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,MAAM,kBAAkB;IAGvB,YAAY,EAAkB;QAQrB,YAAO,GAAG,CAAC,GAAM,EAAE,EAAE;YAC7B,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC,CAAC;QATD,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;IACf,CAAC;IAED,OAAO;QACN,IAAI,CAAC,GAAG,GAAG,SAAS,CAAC;IACtB,CAAC;CAKD;AAED,SAAS,kBAAkB,CAAI,EAAkB,EAAE,KAAsB;IACxE,MAAM,GAAG,GAAG,IAAI,kBAAkB,CAAC,EAAE,CAAC,CAAC;IACvC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACf,OAAO,GAAG,CAAC,OAAO,CAAC;AACpB,CAAC","file":"inlineCompletionsModel.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { mapFindFirst } from '../../../../../base/common/arraysFind.js';\nimport { arrayEqualsC } from '../../../../../base/common/equals.js';\nimport { BugIndicatingError, onUnexpectedExternalError } from '../../../../../base/common/errors.js';\nimport { Emitter } from '../../../../../base/common/event.js';\nimport { Disposable, DisposableStore } from '../../../../../base/common/lifecycle.js';\nimport { IObservable, IObservableWithChange, IReader, ITransaction, autorun, constObservable, derived, derivedHandleChanges, derivedOpts, mapObservableArrayCached, observableFromEvent, observableSignal, observableValue, recomputeInitiallyAndOnChange, subtransaction, transaction } from '../../../../../base/common/observable.js';\nimport { firstNonWhitespaceIndex } from '../../../../../base/common/strings.js';\nimport { isDefined } from '../../../../../base/common/types.js';\nimport { IAccessibilityService } from '../../../../../platform/accessibility/common/accessibility.js';\nimport { ICommandService } from '../../../../../platform/commands/common/commands.js';\nimport { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';\nimport { ICodeEditor } from '../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../browser/observableCodeEditor.js';\nimport { EditorOption } from '../../../../common/config/editorOptions.js';\nimport { CursorColumns } from '../../../../common/core/cursorColumns.js';\nimport { LineRange } from '../../../../common/core/ranges/lineRange.js';\nimport { Position } from '../../../../common/core/position.js';\nimport { Range } from '../../../../common/core/range.js';\nimport { Selection } from '../../../../common/core/selection.js';\nimport { TextReplacement, TextEdit } from '../../../../common/core/edits/textEdit.js';\nimport { TextLength } from '../../../../common/core/text/textLength.js';\nimport { ScrollType } from '../../../../common/editorCommon.js';\nimport { InlineCompletionEndOfLifeReasonKind, InlineCompletion, InlineCompletionTriggerKind, PartialAcceptTriggerKind, InlineCompletionsProvider, InlineCompletionCommand } from '../../../../common/languages.js';\nimport { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js';\nimport { EndOfLinePreference, IModelDeltaDecoration, ITextModel } from '../../../../common/model.js';\nimport { TextModelText } from '../../../../common/model/textModelText.js';\nimport { IFeatureDebounceInformation } from '../../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js';\nimport { IModelContentChangedEvent } from '../../../../common/textModelEvents.js';\nimport { SnippetController2 } from '../../../snippet/browser/snippetController2.js';\nimport { getEndPositionsAfterApplying, removeTextReplacementCommonSuffixPrefix } from '../utils.js';\nimport { AnimatedValue, easeOutCubic, ObservableAnimatedValue } from './animation.js';\nimport { computeGhostText } from './computeGhostText.js';\nimport { GhostText, GhostTextOrReplacement, ghostTextOrReplacementEquals, ghostTextsOrReplacementsEqual } from './ghostText.js';\nimport { InlineCompletionsSource } from './inlineCompletionsSource.js';\nimport { InlineCompletionItem, InlineEditItem, InlineSuggestionItem } from './inlineSuggestionItem.js';\nimport { InlineCompletionContextWithoutUuid, InlineCompletionEditorType, InlineSuggestRequestInfo, InlineSuggestSku } from './provideInlineCompletions.js';\nimport { singleTextEditAugments, singleTextRemoveCommonPrefix } from './singleTextEditHelpers.js';\nimport { SuggestItemInfo } from './suggestWidgetAdapter.js';\nimport { TextModelEditSource, EditSources } from '../../../../common/textModelEditSource.js';\nimport { ICodeEditorService } from '../../../../browser/services/codeEditorService.js';\nimport { InlineCompletionViewData, InlineCompletionViewKind } from '../view/inlineEdits/inlineEditsViewInterface.js';\nimport { IInlineCompletionsService } from '../../../../browser/services/inlineCompletionsService.js';\nimport { TypingInterval } from './typingSpeed.js';\nimport { StringReplacement } from '../../../../common/core/edits/stringEdit.js';\nimport { OffsetRange } from '../../../../common/core/ranges/offsetRange.js';\nimport { URI } from '../../../../../base/common/uri.js';\nimport { IDefaultAccountService } from '../../../../../platform/defaultAccount/common/defaultAccount.js';\nimport { IDefaultAccount } from '../../../../../base/common/defaultAccount.js';\n\nexport class InlineCompletionsModel extends Disposable {\n\tprivate readonly _source;\n\tprivate readonly _isActive = observableValue<boolean>(this, false);\n\tprivate readonly _onlyRequestInlineEditsSignal = observableSignal(this);\n\tprivate readonly _forceUpdateExplicitlySignal = observableSignal(this);\n\tprivate readonly _noDelaySignal = observableSignal(this);\n\n\tprivate readonly _fetchSpecificProviderSignal = observableSignal<InlineCompletionsProvider | undefined>(this);\n\n\t// We use a semantic id to keep the same inline completion selected even if the provider reorders the completions.\n\tprivate readonly _selectedInlineCompletionId = observableValue<string | undefined>(this, undefined);\n\tpublic readonly primaryPosition = derived(this, reader => this._positions.read(reader)[0] ?? new Position(1, 1));\n\tpublic readonly allPositions = derived(this, reader => this._positions.read(reader));\n\n\tprivate readonly sku = observableValue<InlineSuggestSku | undefined>(this, undefined);\n\n\tprivate _isAcceptingPartially = false;\n\tprivate readonly _appearedInsideViewport = derived<boolean>(this, reader => {\n\t\tconst state = this.state.read(reader);\n\t\tif (!state || !state.inlineSuggestion) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn isSuggestionInViewport(this._editor, state.inlineSuggestion);\n\t});\n\tpublic get isAcceptingPartially() { return this._isAcceptingPartially; }\n\n\tprivate readonly _onDidAccept = new Emitter<void>();\n\tpublic readonly onDidAccept = this._onDidAccept.event;\n\n\tprivate readonly _editorObs;\n\n\tprivate readonly _typing: TypingInterval;\n\n\tprivate readonly _suggestPreviewEnabled;\n\tprivate readonly _suggestPreviewMode;\n\tprivate readonly _inlineSuggestMode;\n\tprivate readonly _suppressedInlineCompletionGroupIds;\n\tprivate readonly _inlineEditsEnabled;\n\tprivate readonly _inlineEditsShowCollapsedEnabled;\n\tprivate readonly _triggerCommandOnProviderChange;\n\tprivate readonly _minShowDelay;\n\tprivate readonly _showOnSuggestConflict;\n\tprivate readonly _suppressInSnippetMode;\n\tprivate readonly _isInSnippetMode;\n\n\tget editor() {\n\t\treturn this._editor;\n\t}\n\n\tconstructor(\n\t\tpublic readonly textModel: ITextModel,\n\t\tprivate readonly _selectedSuggestItem: IObservable<SuggestItemInfo | undefined>,\n\t\tpublic readonly _textModelVersionId: IObservableWithChange<number | null, IModelContentChangedEvent | undefined>,\n\t\tprivate readonly _positions: IObservable<readonly Position[]>,\n\t\tprivate readonly _debounceValue: IFeatureDebounceInformation,\n\t\tprivate readonly _enabled: IObservable<boolean>,\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ICodeEditorService private readonly _codeEditorService: ICodeEditorService,\n\t\t@IInlineCompletionsService private readonly _inlineCompletionsService: IInlineCompletionsService,\n\t\t@IDefaultAccountService defaultAccountService: IDefaultAccountService,\n\t) {\n\t\tsuper();\n\t\tthis._source = this._register(this._instantiationService.createInstance(InlineCompletionsSource, this.textModel, this._textModelVersionId, this._debounceValue, this.primaryPosition));\n\t\tthis.lastTriggerKind = this._source.inlineCompletions.map(this, v => v?.request?.context.triggerKind);\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tconst suggest = this._editorObs.getOption(EditorOption.suggest);\n\t\tthis._suggestPreviewEnabled = suggest.map(v => v.preview);\n\t\tthis._suggestPreviewMode = suggest.map(v => v.previewMode);\n\n\t\tconst inlineSuggest = this._editorObs.getOption(EditorOption.inlineSuggest);\n\t\tthis._inlineSuggestMode = inlineSuggest.map(v => v.mode);\n\t\tthis._suppressedInlineCompletionGroupIds = inlineSuggest.map(v => new Set(v.experimental.suppressInlineSuggestions.split(',')));\n\t\tthis._inlineEditsEnabled = inlineSuggest.map(v => !!v.edits.enabled);\n\t\tthis._inlineEditsShowCollapsedEnabled = inlineSuggest.map(s => s.edits.showCollapsed);\n\t\tthis._triggerCommandOnProviderChange = inlineSuggest.map(s => s.triggerCommandOnProviderChange);\n\t\tthis._minShowDelay = inlineSuggest.map(s => s.minShowDelay);\n\t\tthis._showOnSuggestConflict = inlineSuggest.map(s => s.experimental.showOnSuggestConflict);\n\t\tthis._suppressInSnippetMode = inlineSuggest.map(s => s.suppressInSnippetMode);\n\n\t\tconst snippetController = SnippetController2.get(this._editor);\n\t\tthis._isInSnippetMode = snippetController?.isInSnippetObservable ?? constObservable(false);\n\n\t\tdefaultAccountService.getDefaultAccount().then(createDisposableCb(account => this.sku.set(skuFromAccount(account), undefined), this._store));\n\t\tthis._register(defaultAccountService.onDidChangeDefaultAccount(account => this.sku.set(skuFromAccount(account), undefined)));\n\n\t\tthis._typing = this._register(new TypingInterval(this.textModel));\n\n\t\tthis._register(this._inlineCompletionsService.onDidChangeIsSnoozing((isSnoozing) => {\n\t\t\tif (isSnoozing) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t}));\n\n\t\t{ // Determine editor type\n\t\t\tconst isNotebook = this.textModel.uri.scheme === 'vscode-notebook-cell';\n\t\t\tconst [diffEditor] = this._codeEditorService.listDiffEditors()\n\t\t\t\t.filter(d =>\n\t\t\t\t\td.getOriginalEditor().getId() === this._editor.getId() ||\n\t\t\t\t\td.getModifiedEditor().getId() === this._editor.getId());\n\n\t\t\tthis.isInDiffEditor = !!diffEditor;\n\t\t\tthis.editorType = isNotebook ? InlineCompletionEditorType.Notebook\n\t\t\t\t: this.isInDiffEditor ? InlineCompletionEditorType.DiffEditor\n\t\t\t\t\t: InlineCompletionEditorType.TextEditor;\n\t\t}\n\n\t\tthis._register(recomputeInitiallyAndOnChange(this.state, (s) => {\n\t\t\tif (s && s.inlineSuggestion) {\n\t\t\t\tthis._inlineCompletionsService.reportNewCompletion(s.inlineSuggestion.requestUuid);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(recomputeInitiallyAndOnChange(this._fetchInlineCompletionsPromise));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tthis._editorObs.versionId.read(reader);\n\t\t\tthis._inAcceptFlow.set(false, undefined);\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst jumpToReset = this.state.map((s, reader) => !s || s.kind === 'inlineEdit' && !s.cursorAtInlineEdit.read(reader)).read(reader);\n\t\t\tif (jumpToReset) {\n\t\t\t\tthis._jumpedToId.set(undefined, undefined);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst inlineSuggestion = this.state.map(s => s?.inlineSuggestion).read(reader);\n\t\t\tif (inlineSuggestion) {\n\t\t\t\tinlineSuggestion.addPerformanceMarker('activeSuggestion');\n\t\t\t}\n\t\t}));\n\n\t\tconst inlineEditSemanticId = this.inlineEditState.map(s => s?.inlineSuggestion.semanticId);\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst id = inlineEditSemanticId.read(reader);\n\t\t\tif (id) {\n\t\t\t\tthis._editor.pushUndoStop();\n\t\t\t\tthis._lastShownInlineCompletionInfo = {\n\t\t\t\t\talternateTextModelVersionId: this.textModel.getAlternativeVersionId(),\n\t\t\t\t\tinlineCompletion: this.state.get()!.inlineSuggestion!,\n\t\t\t\t};\n\t\t\t}\n\t\t}));\n\n\t\t// TODO: should use getAvailableProviders and update on _suppressedInlineCompletionGroupIds change\n\t\tconst inlineCompletionProviders = observableFromEvent(this._languageFeaturesService.inlineCompletionsProvider.onDidChange, () => this._languageFeaturesService.inlineCompletionsProvider.all(textModel));\n\t\tmapObservableArrayCached(this, inlineCompletionProviders, (provider, store) => {\n\t\t\tif (!provider.onDidChangeInlineCompletions) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tstore.add(provider.onDidChangeInlineCompletions(() => {\n\t\t\t\tif (!this._enabled.get()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Only update the active editor\n\t\t\t\tconst activeEditor = this._codeEditorService.getFocusedCodeEditor() || this._codeEditorService.getActiveCodeEditor();\n\t\t\t\tif (activeEditor !== this._editor) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (this._triggerCommandOnProviderChange.get()) {\n\t\t\t\t\t// TODO@hediet remove this and always do the else branch.\n\t\t\t\t\tthis.trigger(undefined, { onlyFetchInlineEdits: true });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\n\t\t\t\t// If there is an active suggestion from a different provider, we ignore the update\n\t\t\t\tconst activeState = this.state.get();\n\t\t\t\tif (activeState && (activeState.inlineSuggestion || activeState.edits) && activeState.inlineSuggestion?.source.provider !== provider) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\ttransaction(tx => {\n\t\t\t\t\tthis._fetchSpecificProviderSignal.trigger(tx, provider);\n\t\t\t\t\tthis.trigger(tx);\n\t\t\t\t});\n\n\t\t\t}));\n\t\t}).recomputeInitiallyAndOnChange(this._store);\n\n\t\tthis._didUndoInlineEdits.recomputeInitiallyAndOnChange(this._store);\n\t}\n\n\tprivate _lastShownInlineCompletionInfo: { alternateTextModelVersionId: number; /* already freed! */ inlineCompletion: InlineSuggestionItem } | undefined = undefined;\n\tprivate _lastAcceptedInlineCompletionInfo: { textModelVersionIdAfter: number; /* already freed! */ inlineCompletion: InlineSuggestionItem } | undefined = undefined;\n\tprivate readonly _didUndoInlineEdits = derivedHandleChanges({\n\t\towner: this,\n\t\tchangeTracker: {\n\t\t\tcreateChangeSummary: () => ({ didUndo: false }),\n\t\t\thandleChange: (ctx, changeSummary) => {\n\t\t\t\tchangeSummary.didUndo = ctx.didChange(this._textModelVersionId) && !!ctx.change?.isUndoing;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}, (reader, changeSummary) => {\n\t\tconst versionId = this._textModelVersionId.read(reader);\n\t\tif (versionId !== null\n\t\t\t&& this._lastAcceptedInlineCompletionInfo\n\t\t\t&& this._lastAcceptedInlineCompletionInfo.textModelVersionIdAfter === versionId - 1\n\t\t\t&& this._lastAcceptedInlineCompletionInfo.inlineCompletion.isInlineEdit\n\t\t\t&& changeSummary.didUndo\n\t\t) {\n\t\t\tthis._lastAcceptedInlineCompletionInfo = undefined;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t});\n\n\tpublic getIndentationInfo(reader: IReader) {\n\t\tlet startsWithIndentation = false;\n\t\tlet startsWithIndentationLessThanTabSize = true;\n\t\tconst ghostText = this?.primaryGhostText.read(reader);\n\t\tif (!!this?._selectedSuggestItem && ghostText && ghostText.parts.length > 0) {\n\t\t\tconst { column, lines } = ghostText.parts[0];\n\n\t\t\tconst firstLine = lines[0].line;\n\n\t\t\tconst indentationEndColumn = this.textModel.getLineIndentColumn(ghostText.lineNumber);\n\t\t\tconst inIndentation = column <= indentationEndColumn;\n\n\t\t\tif (inIndentation) {\n\t\t\t\tlet firstNonWsIdx = firstNonWhitespaceIndex(firstLine);\n\t\t\t\tif (firstNonWsIdx === -1) {\n\t\t\t\t\tfirstNonWsIdx = firstLine.length - 1;\n\t\t\t\t}\n\t\t\t\tstartsWithIndentation = firstNonWsIdx > 0;\n\n\t\t\t\tconst tabSize = this.textModel.getOptions().tabSize;\n\t\t\t\tconst visibleColumnIndentation = CursorColumns.visibleColumnFromColumn(firstLine, firstNonWsIdx + 1, tabSize);\n\t\t\t\tstartsWithIndentationLessThanTabSize = visibleColumnIndentation < tabSize;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tstartsWithIndentation,\n\t\t\tstartsWithIndentationLessThanTabSize,\n\t\t};\n\t}\n\n\tprivate readonly _preserveCurrentCompletionReasons = new Set([\n\t\tVersionIdChangeReason.Redo,\n\t\tVersionIdChangeReason.Undo,\n\t\tVersionIdChangeReason.AcceptWord,\n\t]);\n\n\tprivate _getReason(e: IModelContentChangedEvent | undefined): VersionIdChangeReason {\n\t\tif (e?.isUndoing) { return VersionIdChangeReason.Undo; }\n\t\tif (e?.isRedoing) { return VersionIdChangeReason.Redo; }\n\t\tif (this.isAcceptingPartially) { return VersionIdChangeReason.AcceptWord; }\n\t\treturn VersionIdChangeReason.Other;\n\t}\n\n\tpublic readonly dontRefetchSignal = observableSignal(this);\n\n\tprivate readonly _fetchInlineCompletionsPromise = derivedHandleChanges({\n\t\towner: this,\n\t\tchangeTracker: {\n\t\t\tcreateChangeSummary: () => ({\n\t\t\t\tdontRefetch: false,\n\t\t\t\tpreserveCurrentCompletion: false,\n\t\t\t\tinlineCompletionTriggerKind: InlineCompletionTriggerKind.Automatic,\n\t\t\t\tonlyRequestInlineEdits: false,\n\t\t\t\tshouldDebounce: true,\n\t\t\t\tprovider: undefined as InlineCompletionsProvider | undefined,\n\t\t\t\ttextChange: false,\n\t\t\t\tchangeReason: '',\n\t\t\t}),\n\t\t\thandleChange: (ctx, changeSummary) => {\n\t\t\t\t/** @description fetch inline completions */\n\t\t\t\tif (ctx.didChange(this._textModelVersionId)) {\n\t\t\t\t\tif (this._preserveCurrentCompletionReasons.has(this._getReason(ctx.change))) {\n\t\t\t\t\t\tchangeSummary.preserveCurrentCompletion = true;\n\t\t\t\t\t}\n\t\t\t\t\tconst detailedReasons = ctx.change?.detailedReasons ?? [];\n\t\t\t\t\tchangeSummary.changeReason = detailedReasons.length > 0 ? detailedReasons[0].getType() : '';\n\t\t\t\t\tchangeSummary.textChange = true;\n\t\t\t\t} else if (ctx.didChange(this._forceUpdateExplicitlySignal)) {\n\t\t\t\t\tchangeSummary.preserveCurrentCompletion = true;\n\t\t\t\t\tchangeSummary.inlineCompletionTriggerKind = InlineCompletionTriggerKind.Explicit;\n\t\t\t\t} else if (ctx.didChange(this.dontRefetchSignal)) {\n\t\t\t\t\tchangeSummary.dontRefetch = true;\n\t\t\t\t} else if (ctx.didChange(this._onlyRequestInlineEditsSignal)) {\n\t\t\t\t\tchangeSummary.onlyRequestInlineEdits = true;\n\t\t\t\t} else if (ctx.didChange(this._fetchSpecificProviderSignal)) {\n\t\t\t\t\tchangeSummary.provider = ctx.change;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t},\n\t\t},\n\t}, (reader, changeSummary) => {\n\t\tthis._source.clearOperationOnTextModelChange.read(reader); // Make sure the clear operation runs before the fetch operation\n\t\tthis._noDelaySignal.read(reader);\n\t\tthis.dontRefetchSignal.read(reader);\n\t\tthis._onlyRequestInlineEditsSignal.read(reader);\n\t\tthis._forceUpdateExplicitlySignal.read(reader);\n\t\tthis._fetchSpecificProviderSignal.read(reader);\n\t\tconst shouldUpdate = ((this._enabled.read(reader) && this._selectedSuggestItem.read(reader)) || this._isActive.read(reader))\n\t\t\t&& (!this._inlineCompletionsService.isSnoozing() || changeSummary.inlineCompletionTriggerKind === InlineCompletionTriggerKind.Explicit);\n\t\tif (!shouldUpdate) {\n\t\t\tthis._source.cancelUpdate();\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthis._textModelVersionId.read(reader); // Refetch on text change\n\n\t\tconst suggestWidgetInlineCompletions = this._source.suggestWidgetInlineCompletions.read(undefined);\n\t\tlet suggestItem = this._selectedSuggestItem.read(reader);\n\t\tif (this._shouldShowOnSuggestConflict.read(undefined)) {\n\t\t\tsuggestItem = undefined;\n\t\t}\n\t\tif (suggestWidgetInlineCompletions && !suggestItem) {\n\t\t\tthis._source.seedInlineCompletionsWithSuggestWidget();\n\t\t}\n\n\t\tif (changeSummary.dontRefetch) {\n\t\t\treturn Promise.resolve(true);\n\t\t}\n\n\t\tif (this._didUndoInlineEdits.read(reader) && changeSummary.inlineCompletionTriggerKind !== InlineCompletionTriggerKind.Explicit) {\n\t\t\ttransaction(tx => {\n\t\t\t\tthis._source.clear(tx);\n\t\t\t});\n\t\t\treturn undefined;\n\t\t}\n\n\t\tlet reason: string = '';\n\t\tif (changeSummary.provider) {\n\t\t\treason += 'providerOnDidChange';\n\t\t} else if (changeSummary.inlineCompletionTriggerKind === InlineCompletionTriggerKind.Explicit) {\n\t\t\treason += 'explicit';\n\t\t}\n\t\tif (changeSummary.changeReason) {\n\t\t\treason += reason.length > 0 ? `:${changeSummary.changeReason}` : changeSummary.changeReason;\n\t\t}\n\n\t\tconst typingInterval = this._typing.getTypingInterval();\n\t\tconst requestInfo: InlineSuggestRequestInfo = {\n\t\t\teditorType: this.editorType,\n\t\t\tstartTime: Date.now(),\n\t\t\tlanguageId: this.textModel.getLanguageId(),\n\t\t\treason,\n\t\t\ttypingInterval: typingInterval.averageInterval,\n\t\t\ttypingIntervalCharacterCount: typingInterval.characterCount,\n\t\t\tavailableProviders: [],\n\t\t\tsku: this.sku.read(undefined),\n\t\t};\n\n\t\tlet context: InlineCompletionContextWithoutUuid = {\n\t\t\ttriggerKind: changeSummary.inlineCompletionTriggerKind,\n\t\t\tselectedSuggestionInfo: suggestItem?.toSelectedSuggestionInfo(),\n\t\t\tincludeInlineCompletions: !changeSummary.onlyRequestInlineEdits,\n\t\t\tincludeInlineEdits: this._inlineEditsEnabled.read(reader),\n\t\t\trequestIssuedDateTime: requestInfo.startTime,\n\t\t\tearliestShownDateTime: requestInfo.startTime + (changeSummary.inlineCompletionTriggerKind === InlineCompletionTriggerKind.Explicit || this.inAcceptFlow.read(undefined) ? 0 : this._minShowDelay.read(undefined)),\n\t\t};\n\n\t\tif (context.triggerKind === InlineCompletionTriggerKind.Automatic && changeSummary.textChange) {\n\t\t\tif (this.textModel.getAlternativeVersionId() === this._lastShownInlineCompletionInfo?.alternateTextModelVersionId) {\n\t\t\t\t// When undoing back to a version where an inline edit/completion was shown,\n\t\t\t\t// we want to show an inline edit (or completion) again if it was originally an inline edit (or completion).\n\t\t\t\tcontext = {\n\t\t\t\t\t...context,\n\t\t\t\t\tincludeInlineCompletions: !this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit,\n\t\t\t\t\tincludeInlineEdits: this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tconst itemToPreserveCandidate = this.selectedInlineCompletion.read(undefined) ?? this._inlineCompletionItems.read(undefined)?.inlineEdit;\n\t\tconst itemToPreserve = changeSummary.preserveCurrentCompletion || itemToPreserveCandidate?.forwardStable\n\t\t\t? itemToPreserveCandidate : undefined;\n\t\tconst userJumpedToActiveCompletion = this._jumpedToId.map(jumpedTo => !!jumpedTo && jumpedTo === this._inlineCompletionItems.read(undefined)?.inlineEdit?.semanticId);\n\n\t\tconst providers = changeSummary.provider\n\t\t\t? { providers: [changeSummary.provider], label: 'single:' + changeSummary.provider.providerId?.toString() }\n\t\t\t: { providers: this._languageFeaturesService.inlineCompletionsProvider.all(this.textModel), label: undefined }; // TODO: should use inlineCompletionProviders\n\t\tconst availableProviders = this.getAvailableProviders(providers.providers);\n\t\trequestInfo.availableProviders = availableProviders.map(p => p.providerId).filter(isDefined);\n\n\t\treturn this._source.fetch(availableProviders, providers.label, context, itemToPreserve?.identity, changeSummary.shouldDebounce, userJumpedToActiveCompletion, requestInfo);\n\t});\n\n\t// TODO: This is not an ideal implementation of excludesGroupIds, however as this is currently still behind proposed API\n\t// and due to the time constraints, we are using a simplified approach\n\tprivate getAvailableProviders(providers: InlineCompletionsProvider[]): InlineCompletionsProvider[] {\n\t\tconst suppressedProviderGroupIds = this._suppressedInlineCompletionGroupIds.get();\n\t\tconst unsuppressedProviders = providers.filter(provider => !(provider.groupId && suppressedProviderGroupIds.has(provider.groupId)));\n\n\t\tconst excludedGroupIds = new Set<string>();\n\t\tfor (const provider of unsuppressedProviders) {\n\t\t\tprovider.excludesGroupIds?.forEach(p => excludedGroupIds.add(p));\n\t\t}\n\n\t\tconst availableProviders: InlineCompletionsProvider[] = [];\n\t\tfor (const provider of unsuppressedProviders) {\n\t\t\tif (provider.groupId && excludedGroupIds.has(provider.groupId)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tavailableProviders.push(provider);\n\t\t}\n\n\t\treturn availableProviders;\n\t}\n\n\tpublic async trigger(tx?: ITransaction, options: { onlyFetchInlineEdits?: boolean; noDelay?: boolean; provider?: InlineCompletionsProvider; explicit?: boolean } = {}): Promise<void> {\n\t\tsubtransaction(tx, tx => {\n\t\t\tif (options.onlyFetchInlineEdits) {\n\t\t\t\tthis._onlyRequestInlineEditsSignal.trigger(tx);\n\t\t\t}\n\t\t\tif (options.noDelay) {\n\t\t\t\tthis._noDelaySignal.trigger(tx);\n\t\t\t}\n\t\t\tthis._isActive.set(true, tx);\n\n\t\t\tif (options.explicit) {\n\t\t\t\tthis._inAcceptFlow.set(true, tx);\n\t\t\t\tthis._forceUpdateExplicitlySignal.trigger(tx);\n\t\t\t}\n\t\t\tif (options.provider) {\n\t\t\t\tthis._fetchSpecificProviderSignal.trigger(tx, options.provider);\n\t\t\t}\n\t\t});\n\t\tawait this._fetchInlineCompletionsPromise.get();\n\t}\n\n\tpublic async triggerExplicitly(tx?: ITransaction, onlyFetchInlineEdits: boolean = false): Promise<void> {\n\t\treturn this.trigger(tx, { onlyFetchInlineEdits, explicit: true });\n\t}\n\n\tpublic stop(stopReason: 'explicitCancel' | 'automatic' = 'automatic', tx?: ITransaction): void {\n\t\tsubtransaction(tx, tx => {\n\t\t\tif (stopReason === 'explicitCancel') {\n\t\t\t\tconst inlineCompletion = this.state.get()?.inlineSuggestion;\n\t\t\t\tif (inlineCompletion) {\n\t\t\t\t\tinlineCompletion.reportEndOfLife({ kind: InlineCompletionEndOfLifeReasonKind.Rejected });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._isActive.set(false, tx);\n\t\t\tthis._source.clear(tx);\n\t\t});\n\t}\n\n\tprivate readonly _inlineCompletionItems = derivedOpts({ owner: this }, reader => {\n\t\tconst c = this._source.inlineCompletions.read(reader);\n\t\tif (!c) { return undefined; }\n\t\tconst cursorPosition = this.primaryPosition.read(reader);\n\t\tlet inlineEdit: InlineEditItem | undefined = undefined;\n\t\tconst visibleCompletions: InlineCompletionItem[] = [];\n\t\tfor (const completion of c.inlineCompletions) {\n\t\t\tif (!completion.isInlineEdit) {\n\t\t\t\tif (completion.isVisible(this.textModel, cursorPosition)) {\n\t\t\t\t\tvisibleCompletions.push(completion);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tinlineEdit = completion;\n\t\t\t}\n\t\t}\n\n\t\tif (visibleCompletions.length !== 0) {\n\t\t\t// Don't show the inline edit if there is a visible completion\n\t\t\tinlineEdit = undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tinlineCompletions: visibleCompletions,\n\t\t\tinlineEdit,\n\t\t};\n\t});\n\n\tprivate readonly _filteredInlineCompletionItems = derivedOpts({ owner: this, equalsFn: arrayEqualsC() }, reader => {\n\t\tconst c = this._inlineCompletionItems.read(reader);\n\t\treturn c?.inlineCompletions ?? [];\n\t});\n\n\tpublic readonly selectedInlineCompletionIndex = derived<number>(this, (reader) => {\n\t\tconst selectedInlineCompletionId = this._selectedInlineCompletionId.read(reader);\n\t\tconst filteredCompletions = this._filteredInlineCompletionItems.read(reader);\n\t\tconst idx = this._selectedInlineCompletionId === undefined ? -1\n\t\t\t: filteredCompletions.findIndex(v => v.semanticId === selectedInlineCompletionId);\n\t\tif (idx === -1) {\n\t\t\t// Reset the selection so that the selection does not jump back when it appears again\n\t\t\tthis._selectedInlineCompletionId.set(undefined, undefined);\n\t\t\treturn 0;\n\t\t}\n\t\treturn idx;\n\t});\n\n\tpublic readonly selectedInlineCompletion = derived<InlineCompletionItem | undefined>(this, (reader) => {\n\t\tconst filteredCompletions = this._filteredInlineCompletionItems.read(reader);\n\t\tconst idx = this.selectedInlineCompletionIndex.read(reader);\n\t\treturn filteredCompletions[idx];\n\t});\n\n\tpublic readonly activeCommands = derivedOpts<InlineCompletionCommand[]>({ owner: this, equalsFn: arrayEqualsC() },\n\t\tr => this.selectedInlineCompletion.read(r)?.source.inlineSuggestions.commands ?? []\n\t);\n\n\tpublic readonly lastTriggerKind: IObservable<InlineCompletionTriggerKind | undefined>;\n\n\tpublic readonly inlineCompletionsCount = derived<number | undefined>(this, reader => {\n\t\tif (this.lastTriggerKind.read(reader) === InlineCompletionTriggerKind.Explicit) {\n\t\t\treturn this._filteredInlineCompletionItems.read(reader).length;\n\t\t} else {\n\t\t\treturn undefined;\n\t\t}\n\t});\n\n\tprivate readonly _hasVisiblePeekWidgets = derived(this, reader => this._editorObs.openedPeekWidgets.read(reader) > 0);\n\n\tprivate readonly _shouldShowOnSuggestConflict = derived(this, reader => {\n\t\tconst showOnSuggestConflict = this._showOnSuggestConflict.read(reader);\n\t\tif (showOnSuggestConflict !== 'never') {\n\t\t\tconst hasInlineCompletion = !!this.selectedInlineCompletion.read(reader);\n\t\t\tif (hasInlineCompletion) {\n\t\t\t\tconst item = this._selectedSuggestItem.read(reader);\n\t\t\t\tif (!item) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (showOnSuggestConflict === 'whenSuggestListIsIncomplete') {\n\t\t\t\t\treturn item.listIncomplete;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t});\n\n\tpublic readonly state = derivedOpts<{\n\t\tkind: 'ghostText';\n\t\tedits: readonly TextReplacement[];\n\t\tprimaryGhostText: GhostTextOrReplacement;\n\t\tghostTexts: readonly GhostTextOrReplacement[];\n\t\tsuggestItem: SuggestItemInfo | undefined;\n\t\tinlineSuggestion: InlineCompletionItem | undefined;\n\t} | {\n\t\tkind: 'inlineEdit';\n\t\tedits: readonly TextReplacement[];\n\t\tinlineSuggestion: InlineEditItem;\n\t\tcursorAtInlineEdit: IObservable<boolean>;\n\t\tnextEditUri: URI | undefined;\n\t} | undefined>({\n\t\towner: this,\n\t\tequalsFn: (a, b) => {\n\t\t\tif (!a || !b) { return a === b; }\n\n\t\t\tif (a.kind === 'ghostText' && b.kind === 'ghostText') {\n\t\t\t\treturn ghostTextsOrReplacementsEqual(a.ghostTexts, b.ghostTexts)\n\t\t\t\t\t&& a.inlineSuggestion === b.inlineSuggestion\n\t\t\t\t\t&& a.suggestItem === b.suggestItem;\n\t\t\t} else if (a.kind === 'inlineEdit' && b.kind === 'inlineEdit') {\n\t\t\t\treturn a.inlineSuggestion === b.inlineSuggestion;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}, (reader) => {\n\t\tconst model = this.textModel;\n\n\t\tif (this._suppressInSnippetMode.read(reader) && this._isInSnippetMode.read(reader)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst item = this._inlineCompletionItems.read(reader);\n\t\tconst inlineEditResult = item?.inlineEdit;\n\t\tif (inlineEditResult) {\n\t\t\tif (this._hasVisiblePeekWidgets.read(reader)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst cursorAtInlineEdit = this.primaryPosition.map(cursorPos => LineRange.fromRangeInclusive(inlineEditResult.targetRange).addMargin(1, 1).contains(cursorPos.lineNumber));\n\t\t\tconst stringEdit = inlineEditResult.action?.kind === 'edit' ? inlineEditResult.action.stringEdit : undefined;\n\t\t\tconst replacements = stringEdit ? TextEdit.fromStringEdit(stringEdit, new TextModelText(this.textModel)).replacements : [];\n\n\t\t\tconst nextEditUri = (item.inlineEdit?.command?.id === 'vscode.open' || item.inlineEdit?.command?.id === '_workbench.open') &&\n\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\titem.inlineEdit?.command.arguments?.length ? URI.from(<any>item.inlineEdit?.command.arguments[0]) : undefined;\n\t\t\treturn { kind: 'inlineEdit', inlineSuggestion: inlineEditResult, edits: replacements, cursorAtInlineEdit, nextEditUri };\n\t\t}\n\n\t\tconst suggestItem = this._selectedSuggestItem.read(reader);\n\t\tif (!this._shouldShowOnSuggestConflict.read(reader) && suggestItem) {\n\t\t\tconst suggestCompletionEdit = singleTextRemoveCommonPrefix(suggestItem.getSingleTextEdit(), model);\n\t\t\tconst augmentation = this._computeAugmentation(suggestCompletionEdit, reader);\n\n\t\t\tconst isSuggestionPreviewEnabled = this._suggestPreviewEnabled.read(reader);\n\t\t\tif (!isSuggestionPreviewEnabled && !augmentation) { return undefined; }\n\n\t\t\tconst fullEdit = augmentation?.edit ?? suggestCompletionEdit;\n\t\t\tconst fullEditPreviewLength = augmentation ? augmentation.edit.text.length - suggestCompletionEdit.text.length : 0;\n\n\t\t\tconst mode = this._suggestPreviewMode.read(reader);\n\t\t\tconst positions = this._positions.read(reader);\n\t\t\tconst allPotentialEdits = [fullEdit, ...getSecondaryEdits(this.textModel, positions, fullEdit)];\n\t\t\tconst validEditsAndGhostTexts = allPotentialEdits\n\t\t\t\t.map((edit, idx) => ({ edit, ghostText: edit ? computeGhostText(edit, model, mode, positions[idx], fullEditPreviewLength) : undefined }))\n\t\t\t\t.filter(({ edit, ghostText }) => edit !== undefined && ghostText !== undefined);\n\t\t\tconst edits = validEditsAndGhostTexts.map(({ edit }) => edit!);\n\t\t\tconst ghostTexts = validEditsAndGhostTexts.map(({ ghostText }) => ghostText!);\n\t\t\tconst primaryGhostText = ghostTexts[0] ?? new GhostText(fullEdit.range.endLineNumber, []);\n\t\t\treturn { kind: 'ghostText', edits, primaryGhostText, ghostTexts, inlineSuggestion: augmentation?.completion, suggestItem };\n\t\t} else {\n\t\t\tif (!this._isActive.read(reader)) { return undefined; }\n\t\t\tconst inlineSuggestion = this.selectedInlineCompletion.read(reader);\n\t\t\tif (!inlineSuggestion) { return undefined; }\n\n\t\t\tconst replacement = inlineSuggestion.getSingleTextEdit();\n\t\t\tconst mode = this._inlineSuggestMode.read(reader);\n\t\t\tconst positions = this._positions.read(reader);\n\t\t\tconst allPotentialEdits = [replacement, ...getSecondaryEdits(this.textModel, positions, replacement)];\n\t\t\tconst validEditsAndGhostTexts = allPotentialEdits\n\t\t\t\t.map((edit, idx) => ({ edit, ghostText: edit ? computeGhostText(edit, model, mode, positions[idx], 0) : undefined }))\n\t\t\t\t.filter(({ edit, ghostText }) => edit !== undefined && ghostText !== undefined);\n\t\t\tconst edits = validEditsAndGhostTexts.map(({ edit }) => edit!);\n\t\t\tconst ghostTexts = validEditsAndGhostTexts.map(({ ghostText }) => ghostText!);\n\t\t\tif (!ghostTexts[0]) { return undefined; }\n\t\t\treturn { kind: 'ghostText', edits, primaryGhostText: ghostTexts[0], ghostTexts, inlineSuggestion, suggestItem: undefined };\n\t\t}\n\t});\n\n\tpublic readonly inlineCompletionState = derived(this, reader => {\n\t\tconst s = this.state.read(reader);\n\t\tif (!s || s.kind !== 'ghostText') {\n\t\t\treturn undefined;\n\t\t}\n\t\tif (this._editorObs.inComposition.read(reader)) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn s;\n\t});\n\n\tpublic readonly inlineEditState = derived(this, reader => {\n\t\tconst s = this.state.read(reader);\n\t\tif (!s || s.kind !== 'inlineEdit') {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn s;\n\t});\n\n\tpublic readonly inlineEditAvailable = derived(this, reader => {\n\t\tconst s = this.inlineEditState.read(reader);\n\t\treturn !!s;\n\t});\n\n\tprivate _computeAugmentation(suggestCompletion: TextReplacement, reader: IReader | undefined) {\n\t\tconst model = this.textModel;\n\t\tconst suggestWidgetInlineCompletions = this._source.suggestWidgetInlineCompletions.read(reader);\n\t\tconst candidateInlineCompletions = suggestWidgetInlineCompletions\n\t\t\t? suggestWidgetInlineCompletions.inlineCompletions.filter(c => !c.isInlineEdit)\n\t\t\t: [this.selectedInlineCompletion.read(reader)].filter(isDefined);\n\n\t\tconst augmentedCompletion = mapFindFirst(candidateInlineCompletions, completion => {\n\t\t\tlet r = completion.getSingleTextEdit();\n\t\t\tr = singleTextRemoveCommonPrefix(\n\t\t\t\tr,\n\t\t\t\tmodel,\n\t\t\t\tRange.fromPositions(r.range.getStartPosition(), suggestCompletion.range.getEndPosition())\n\t\t\t);\n\t\t\treturn singleTextEditAugments(r, suggestCompletion) ? { completion, edit: r } : undefined;\n\t\t});\n\n\t\treturn augmentedCompletion;\n\t}\n\n\tpublic readonly warning = derived(this, reader => {\n\t\treturn this.inlineCompletionState.read(reader)?.inlineSuggestion?.warning;\n\t});\n\n\tpublic readonly ghostTexts = derivedOpts({ owner: this, equalsFn: ghostTextsOrReplacementsEqual }, reader => {\n\t\tconst v = this.inlineCompletionState.read(reader);\n\t\tif (!v) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn v.ghostTexts;\n\t});\n\n\tpublic readonly primaryGhostText = derivedOpts({ owner: this, equalsFn: ghostTextOrReplacementEquals }, reader => {\n\t\tconst v = this.inlineCompletionState.read(reader);\n\t\tif (!v) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn v?.primaryGhostText;\n\t});\n\n\tpublic readonly showCollapsed = derived<boolean>(this, reader => {\n\t\tconst state = this.state.read(reader);\n\t\tif (!state || state.kind !== 'inlineEdit') {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (state.inlineSuggestion.hint || state.inlineSuggestion.action?.kind === 'jumpTo') {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst isCurrentModelVersion = state.inlineSuggestion.updatedEditModelVersion === this._textModelVersionId.read(reader);\n\t\treturn (this._inlineEditsShowCollapsedEnabled.read(reader) || !isCurrentModelVersion)\n\t\t\t&& this._jumpedToId.read(reader) !== state.inlineSuggestion.semanticId\n\t\t\t&& !this._inAcceptFlow.read(reader);\n\t});\n\n\tprivate readonly _tabShouldIndent = derived(this, reader => {\n\t\tif (this._inAcceptFlow.read(reader)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction isMultiLine(range: Range): boolean {\n\t\t\treturn range.startLineNumber !== range.endLineNumber;\n\t\t}\n\n\t\tfunction getNonIndentationRange(model: ITextModel, lineNumber: number): Range {\n\t\t\tconst columnStart = model.getLineIndentColumn(lineNumber);\n\t\t\tconst lastNonWsColumn = model.getLineLastNonWhitespaceColumn(lineNumber);\n\t\t\tconst columnEnd = Math.max(lastNonWsColumn, columnStart);\n\t\t\treturn new Range(lineNumber, columnStart, lineNumber, columnEnd);\n\t\t}\n\n\t\tconst selections = this._editorObs.selections.read(reader);\n\t\treturn selections?.some(s => {\n\t\t\tif (s.isEmpty()) {\n\t\t\t\treturn this.textModel.getLineLength(s.startLineNumber) === 0;\n\t\t\t} else {\n\t\t\t\treturn isMultiLine(s) || s.containsRange(getNonIndentationRange(this.textModel, s.startLineNumber));\n\t\t\t}\n\t\t});\n\t});\n\n\tpublic readonly tabShouldJumpToInlineEdit = derived(this, reader => {\n\t\tif (this._tabShouldIndent.read(reader)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst s = this.inlineEditState.read(reader);\n\t\tif (!s) {\n\t\t\treturn false;\n\t\t}\n\n\n\t\tif (s.inlineSuggestion.action?.kind === 'jumpTo') {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (this.showCollapsed.read(reader)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (this._inAcceptFlow.read(reader) && this._appearedInsideViewport.read(reader)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn !s.cursorAtInlineEdit.read(reader);\n\t});\n\n\tpublic readonly tabShouldAcceptInlineEdit = derived(this, reader => {\n\t\tconst s = this.inlineEditState.read(reader);\n\t\tif (!s) {\n\t\t\treturn false;\n\t\t}\n\t\tif (s.inlineSuggestion.action?.kind === 'jumpTo') {\n\t\t\treturn false;\n\t\t}\n\t\tif (this.showCollapsed.read(reader)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this._tabShouldIndent.read(reader)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this._inAcceptFlow.read(reader) && this._appearedInsideViewport.read(reader)) {\n\t\t\treturn true;\n\t\t}\n\t\tif (s.inlineSuggestion.targetRange.startLineNumber === this._editorObs.cursorLineNumber.read(reader)) {\n\t\t\treturn true;\n\t\t}\n\t\tif (this._jumpedToId.read(reader) === s.inlineSuggestion.semanticId) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn s.cursorAtInlineEdit.read(reader);\n\t});\n\n\tpublic readonly isInDiffEditor;\n\n\tpublic readonly editorType: InlineCompletionEditorType;\n\n\tprivate async _deltaSelectedInlineCompletionIndex(delta: 1 | -1): Promise<void> {\n\t\tawait this.triggerExplicitly();\n\n\t\tconst completions = this._filteredInlineCompletionItems.get() || [];\n\t\tif (completions.length > 0) {\n\t\t\tconst newIdx = (this.selectedInlineCompletionIndex.get() + delta + completions.length) % completions.length;\n\t\t\tthis._selectedInlineCompletionId.set(completions[newIdx].semanticId, undefined);\n\t\t} else {\n\t\t\tthis._selectedInlineCompletionId.set(undefined, undefined);\n\t\t}\n\t}\n\n\tpublic async next(): Promise<void> { await this._deltaSelectedInlineCompletionIndex(1); }\n\n\tpublic async previous(): Promise<void> { await this._deltaSelectedInlineCompletionIndex(-1); }\n\n\tprivate _getMetadata(completion: InlineSuggestionItem, languageId: string, type: 'word' | 'line' | undefined = undefined): TextModelEditSource {\n\t\tif (type) {\n\t\t\treturn EditSources.inlineCompletionPartialAccept({\n\t\t\t\tnes: completion.isInlineEdit,\n\t\t\t\trequestUuid: completion.requestUuid,\n\t\t\t\tproviderId: completion.source.provider.providerId,\n\t\t\t\tlanguageId,\n\t\t\t\ttype,\n\t\t\t\tcorrelationId: completion.getSourceCompletion().correlationId,\n\t\t\t});\n\t\t} else {\n\t\t\treturn EditSources.inlineCompletionAccept({\n\t\t\t\tnes: completion.isInlineEdit,\n\t\t\t\trequestUuid: completion.requestUuid,\n\t\t\t\tcorrelationId: completion.getSourceCompletion().correlationId,\n\t\t\t\tproviderId: completion.source.provider.providerId,\n\t\t\t\tlanguageId\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic async accept(editor: ICodeEditor = this._editor, alternativeAction: boolean = false): Promise<void> {\n\t\tif (editor.getModel() !== this.textModel) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\n\t\tlet completion: InlineSuggestionItem;\n\t\tlet isNextEditUri = false;\n\t\tconst state = this.state.get();\n\t\tif (state?.kind === 'ghostText') {\n\t\t\tif (!state || state.primaryGhostText.isEmpty() || !state.inlineSuggestion) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcompletion = state.inlineSuggestion;\n\t\t} else if (state?.kind === 'inlineEdit') {\n\t\t\tcompletion = state.inlineSuggestion;\n\t\t\tisNextEditUri = !!state.nextEditUri;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure the completion list will not be disposed before the text change is sent.\n\t\tcompletion.addRef();\n\n\t\ttry {\n\t\t\tlet followUpTrigger = false;\n\t\t\teditor.pushUndoStop();\n\t\t\tif (isNextEditUri) {\n\t\t\t\t// Do nothing\n\t\t\t} else if (completion.action?.kind === 'edit') {\n\t\t\t\tconst action = completion.action;\n\t\t\t\tif (alternativeAction && action.alternativeAction) {\n\t\t\t\t\tfollowUpTrigger = true;\n\t\t\t\t\tconst altCommand = action.alternativeAction.command;\n\t\t\t\t\tawait this._commandService\n\t\t\t\t\t\t.executeCommand(altCommand.id, ...(altCommand.arguments || []))\n\t\t\t\t\t\t.then(undefined, onUnexpectedExternalError);\n\t\t\t\t} else if (action.snippetInfo) {\n\t\t\t\t\tconst mainEdit = TextReplacement.delete(action.textReplacement.range);\n\t\t\t\t\tconst additionalEdits = completion.additionalTextEdits.map(e => new TextReplacement(Range.lift(e.range), e.text ?? ''));\n\t\t\t\t\tconst edit = TextEdit.fromParallelReplacementsUnsorted([mainEdit, ...additionalEdits]);\n\t\t\t\t\teditor.edit(edit, this._getMetadata(completion, this.textModel.getLanguageId()));\n\n\t\t\t\t\teditor.setPosition(action.snippetInfo.range.getStartPosition(), 'inlineCompletionAccept');\n\t\t\t\t\tSnippetController2.get(editor)?.insert(action.snippetInfo.snippet, { undoStopBefore: false });\n\t\t\t\t} else {\n\t\t\t\t\tconst edits = state.edits;\n\n\t\t\t\t\t// The cursor should move to the end of the edit, not the end of the range provided by the extension\n\t\t\t\t\t// Inline Edit diffs (human readable) the suggestion from the extension so it already removes common suffix/prefix\n\t\t\t\t\t// Inline Completions does diff the suggestion so it may contain common suffix\n\t\t\t\t\tlet minimalEdits = edits;\n\t\t\t\t\tif (state.kind === 'ghostText') {\n\t\t\t\t\t\tminimalEdits = removeTextReplacementCommonSuffixPrefix(edits, this.textModel);\n\t\t\t\t\t}\n\t\t\t\t\tconst selections = getEndPositionsAfterApplying(minimalEdits).map(p => Selection.fromPositions(p));\n\n\t\t\t\t\tconst additionalEdits = completion.additionalTextEdits.map(e => new TextReplacement(Range.lift(e.range), e.text ?? ''));\n\t\t\t\t\tconst edit = TextEdit.fromParallelReplacementsUnsorted([...edits, ...additionalEdits]);\n\n\t\t\t\t\teditor.edit(edit, this._getMetadata(completion, this.textModel.getLanguageId()));\n\n\t\t\t\t\tif (completion.hint === undefined) {\n\t\t\t\t\t\t// do not move the cursor when the completion is displayed in a different location\n\t\t\t\t\t\teditor.setSelections(state.kind === 'inlineEdit' ? selections.slice(-1) : selections, 'inlineCompletionAccept');\n\t\t\t\t\t}\n\n\t\t\t\t\tif (state.kind === 'inlineEdit' && !this._accessibilityService.isMotionReduced()) {\n\t\t\t\t\t\tconst editRanges = edit.getNewRanges();\n\t\t\t\t\t\tconst dec = this._store.add(new FadeoutDecoration(editor, editRanges, () => {\n\t\t\t\t\t\t\tthis._store.delete(dec);\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._onDidAccept.fire();\n\n\t\t\t// Reset before invoking the command, as the command might cause a follow up trigger (which we don't want to reset).\n\t\t\tthis.stop();\n\n\t\t\tif (completion.command) {\n\t\t\t\tawait this._commandService\n\t\t\t\t\t.executeCommand(completion.command.id, ...(completion.command.arguments || []))\n\t\t\t\t\t.then(undefined, onUnexpectedExternalError);\n\t\t\t}\n\n\t\t\t// TODO: how can we make alternative actions to retrigger?\n\t\t\tif (followUpTrigger) {\n\t\t\t\tthis.trigger(undefined);\n\t\t\t}\n\n\t\t\tcompletion.reportEndOfLife({ kind: InlineCompletionEndOfLifeReasonKind.Accepted, alternativeAction });\n\t\t} finally {\n\t\t\tcompletion.removeRef();\n\t\t\tthis._inAcceptFlow.set(true, undefined);\n\t\t\tthis._lastAcceptedInlineCompletionInfo = { textModelVersionIdAfter: this.textModel.getVersionId(), inlineCompletion: completion };\n\t\t}\n\t}\n\n\tpublic async acceptNextWord(): Promise<void> {\n\t\tawait this._acceptNext(this._editor, 'word', (pos, text) => {\n\t\t\tconst langId = this.textModel.getLanguageIdAtPosition(pos.lineNumber, pos.column);\n\t\t\tconst config = this._languageConfigurationService.getLanguageConfiguration(langId);\n\t\t\tconst wordRegExp = new RegExp(config.wordDefinition.source, config.wordDefinition.flags.replace('g', ''));\n\n\t\t\tconst m1 = text.match(wordRegExp);\n\t\t\tlet acceptUntilIndexExclusive = 0;\n\t\t\tif (m1 && m1.index !== undefined) {\n\t\t\t\tif (m1.index === 0) {\n\t\t\t\t\tacceptUntilIndexExclusive = m1[0].length;\n\t\t\t\t} else {\n\t\t\t\t\tacceptUntilIndexExclusive = m1.index;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tacceptUntilIndexExclusive = text.length;\n\t\t\t}\n\n\t\t\tconst wsRegExp = /\\s+/g;\n\t\t\tconst m2 = wsRegExp.exec(text);\n\t\t\tif (m2 && m2.index !== undefined) {\n\t\t\t\tif (m2.index + m2[0].length < acceptUntilIndexExclusive) {\n\t\t\t\t\tacceptUntilIndexExclusive = m2.index + m2[0].length;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acceptUntilIndexExclusive;\n\t\t}, PartialAcceptTriggerKind.Word);\n\t}\n\n\tpublic async acceptNextLine(): Promise<void> {\n\t\tawait this._acceptNext(this._editor, 'line', (pos, text) => {\n\t\t\tconst m = text.match(/\\n/);\n\t\t\tif (m && m.index !== undefined) {\n\t\t\t\treturn m.index + 1;\n\t\t\t}\n\t\t\treturn text.length;\n\t\t}, PartialAcceptTriggerKind.Line);\n\t}\n\n\tprivate async _acceptNext(editor: ICodeEditor, type: 'word' | 'line', getAcceptUntilIndex: (position: Position, text: string) => number, kind: PartialAcceptTriggerKind): Promise<void> {\n\t\tif (editor.getModel() !== this.textModel) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\n\t\tconst state = this.inlineCompletionState.get();\n\t\tif (!state || state.primaryGhostText.isEmpty() || !state.inlineSuggestion) {\n\t\t\treturn;\n\t\t}\n\t\tconst ghostText = state.primaryGhostText;\n\t\tconst completion = state.inlineSuggestion;\n\n\t\tif (completion.snippetInfo) {\n\t\t\t// not in WYSIWYG mode, partial commit might change completion, thus it is not supported\n\t\t\tawait this.accept(editor);\n\t\t\treturn;\n\t\t}\n\n\t\tconst firstPart = ghostText.parts[0];\n\t\tconst ghostTextPos = new Position(ghostText.lineNumber, firstPart.column);\n\t\tconst ghostTextVal = firstPart.text;\n\t\tconst acceptUntilIndexExclusive = getAcceptUntilIndex(ghostTextPos, ghostTextVal);\n\t\tif (acceptUntilIndexExclusive === ghostTextVal.length && ghostText.parts.length === 1) {\n\t\t\tthis.accept(editor);\n\t\t\treturn;\n\t\t}\n\t\tconst partialGhostTextVal = ghostTextVal.substring(0, acceptUntilIndexExclusive);\n\n\t\tconst positions = this._positions.get();\n\t\tconst cursorPosition = positions[0];\n\n\t\t// Executing the edit might free the completion, so we have to hold a reference on it.\n\t\tcompletion.addRef();\n\t\ttry {\n\t\t\tthis._isAcceptingPartially = true;\n\t\t\ttry {\n\t\t\t\teditor.pushUndoStop();\n\t\t\t\tconst replaceRange = Range.fromPositions(cursorPosition, ghostTextPos);\n\t\t\t\tconst newText = editor.getModel()!.getValueInRange(replaceRange) + partialGhostTextVal;\n\t\t\t\tconst primaryEdit = new TextReplacement(replaceRange, newText);\n\t\t\t\tconst edits = [primaryEdit, ...getSecondaryEdits(this.textModel, positions, primaryEdit)].filter(isDefined);\n\t\t\t\tconst selections = getEndPositionsAfterApplying(edits).map(p => Selection.fromPositions(p));\n\n\t\t\t\teditor.edit(TextEdit.fromParallelReplacementsUnsorted(edits), this._getMetadata(completion, type));\n\t\t\t\teditor.setSelections(selections, 'inlineCompletionPartialAccept');\n\t\t\t\teditor.revealPositionInCenterIfOutsideViewport(editor.getPosition()!, ScrollType.Smooth);\n\t\t\t} finally {\n\t\t\t\tthis._isAcceptingPartially = false;\n\t\t\t}\n\n\t\t\tconst acceptedRange = Range.fromPositions(completion.editRange.getStartPosition(), TextLength.ofText(partialGhostTextVal).addToPosition(ghostTextPos));\n\t\t\t// This assumes that the inline completion and the model use the same EOL style.\n\t\t\tconst text = editor.getModel()!.getValueInRange(acceptedRange, EndOfLinePreference.LF);\n\t\t\tconst acceptedLength = text.length;\n\t\t\tcompletion.reportPartialAccept(\n\t\t\t\tacceptedLength,\n\t\t\t\t{ kind, acceptedLength: acceptedLength },\n\t\t\t\t{ characters: acceptUntilIndexExclusive, ratio: acceptUntilIndexExclusive / ghostTextVal.length, count: 1 }\n\t\t\t);\n\n\t\t} finally {\n\t\t\tcompletion.removeRef();\n\t\t}\n\t}\n\n\tpublic handleSuggestAccepted(item: SuggestItemInfo) {\n\t\tconst itemEdit = singleTextRemoveCommonPrefix(item.getSingleTextEdit(), this.textModel);\n\t\tconst augmentedCompletion = this._computeAugmentation(itemEdit, undefined);\n\t\tif (!augmentedCompletion) { return; }\n\n\t\t// This assumes that the inline completion and the model use the same EOL style.\n\t\tconst alreadyAcceptedLength = this.textModel.getValueInRange(augmentedCompletion.completion.editRange, EndOfLinePreference.LF).length;\n\t\tconst acceptedLength = alreadyAcceptedLength + itemEdit.text.length;\n\n\t\taugmentedCompletion.completion.reportPartialAccept(itemEdit.text.length, {\n\t\t\tkind: PartialAcceptTriggerKind.Suggest,\n\t\t\tacceptedLength,\n\t\t}, {\n\t\t\tcharacters: itemEdit.text.length,\n\t\t\tcount: 1,\n\t\t\tratio: 1\n\t\t});\n\t}\n\n\tpublic extractReproSample(): Repro {\n\t\tconst value = this.textModel.getValue();\n\t\tconst item = this.state.get()?.inlineSuggestion;\n\t\treturn {\n\t\t\tdocumentValue: value,\n\t\t\tinlineCompletion: item?.getSourceCompletion(),\n\t\t};\n\t}\n\n\tprivate readonly _jumpedToId = observableValue<undefined | string>(this, undefined);\n\tprivate readonly _inAcceptFlow = observableValue(this, false);\n\tpublic readonly inAcceptFlow: IObservable<boolean> = this._inAcceptFlow;\n\n\tpublic jump(): void {\n\t\tconst s = this.inlineEditState.get();\n\t\tif (!s) { return; }\n\n\t\tconst suggestion = s.inlineSuggestion;\n\t\tsuggestion.addRef();\n\t\ttry {\n\t\t\ttransaction(tx => {\n\t\t\t\tif (suggestion.action?.kind === 'jumpTo') {\n\t\t\t\t\tthis.stop(undefined, tx);\n\t\t\t\t\tsuggestion.reportEndOfLife({ kind: InlineCompletionEndOfLifeReasonKind.Accepted, alternativeAction: false });\n\t\t\t\t}\n\n\t\t\t\tthis._jumpedToId.set(s.inlineSuggestion.semanticId, tx);\n\t\t\t\tthis.dontRefetchSignal.trigger(tx);\n\t\t\t\tconst targetRange = s.inlineSuggestion.targetRange;\n\t\t\t\tconst targetPosition = targetRange.getStartPosition();\n\t\t\t\tthis._editor.setPosition(targetPosition, 'inlineCompletions.jump');\n\n\t\t\t\t// TODO: consider using view information to reveal it\n\t\t\t\tconst isSingleLineChange = targetRange.isSingleLine() && (s.inlineSuggestion.hint || (s.inlineSuggestion.action?.kind === 'edit' && !s.inlineSuggestion.action.textReplacement.text.includes('\\n')));\n\t\t\t\tif (isSingleLineChange || s.inlineSuggestion.action?.kind === 'jumpTo') {\n\t\t\t\t\tthis._editor.revealPosition(targetPosition, ScrollType.Smooth);\n\t\t\t\t} else {\n\t\t\t\t\tconst revealRange = new Range(targetRange.startLineNumber - 1, 1, targetRange.endLineNumber + 1, 1);\n\t\t\t\t\tthis._editor.revealRange(revealRange, ScrollType.Smooth);\n\t\t\t\t}\n\n\t\t\t\ts.inlineSuggestion.identity.setJumpTo(tx);\n\n\t\t\t\tthis._editor.focus();\n\t\t\t});\n\t\t} finally {\n\t\t\tsuggestion.removeRef();\n\t\t}\n\t}\n\n\tpublic async handleInlineSuggestionShown(inlineCompletion: InlineSuggestionItem, viewKind: InlineCompletionViewKind, viewData: InlineCompletionViewData, timeWhenShown: number): Promise<void> {\n\t\tawait inlineCompletion.reportInlineEditShown(this._commandService, viewKind, viewData, this.textModel, timeWhenShown);\n\t}\n}\n\ninterface Repro {\n\tdocumentValue: string;\n\tinlineCompletion: InlineCompletion | undefined;\n}\n\nexport enum VersionIdChangeReason {\n\tUndo,\n\tRedo,\n\tAcceptWord,\n\tOther,\n}\n\nexport function getSecondaryEdits(textModel: ITextModel, positions: readonly Position[], primaryTextRepl: TextReplacement): (TextReplacement | undefined)[] {\n\tif (positions.length === 1) {\n\t\t// No secondary cursor positions\n\t\treturn [];\n\t}\n\tconst text = new TextModelText(textModel);\n\tconst textTransformer = text.getTransformer();\n\tconst primaryOffset = textTransformer.getOffset(positions[0]);\n\tconst secondaryOffsets = positions.slice(1).map(pos => textTransformer.getOffset(pos));\n\n\tprimaryTextRepl = primaryTextRepl.removeCommonPrefixAndSuffix(text);\n\tconst primaryStringRepl = textTransformer.getStringReplacement(primaryTextRepl);\n\n\tconst deltaFromOffsetToRangeStart = primaryStringRepl.replaceRange.start - primaryOffset;\n\tconst primaryContextRange = primaryStringRepl.replaceRange.join(OffsetRange.emptyAt(primaryOffset));\n\tconst primaryContextValue = text.getValueOfOffsetRange(primaryContextRange);\n\n\tconst replacements = secondaryOffsets.map(secondaryOffset => {\n\t\tconst newRangeStart = secondaryOffset + deltaFromOffsetToRangeStart;\n\t\tconst newRangeEnd = newRangeStart + primaryStringRepl.replaceRange.length;\n\t\tconst range = new OffsetRange(newRangeStart, newRangeEnd);\n\n\t\tconst contextRange = range.join(OffsetRange.emptyAt(secondaryOffset));\n\t\tconst contextValue = text.getValueOfOffsetRange(contextRange);\n\t\tif (contextValue !== primaryContextValue) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst stringRepl = new StringReplacement(range, primaryStringRepl.newText);\n\t\tconst repl = textTransformer.getTextReplacement(stringRepl);\n\t\treturn repl;\n\t}).filter(isDefined);\n\n\treturn replacements;\n}\n\nclass FadeoutDecoration extends Disposable {\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tranges: Range[],\n\t\tonDispose?: () => void,\n\t) {\n\t\tsuper();\n\n\t\tif (onDispose) {\n\t\t\tthis._register({ dispose: () => onDispose() });\n\t\t}\n\n\t\tthis._register(observableCodeEditor(editor).setDecorations(constObservable(ranges.map<IModelDeltaDecoration>(range => ({\n\t\t\trange: range,\n\t\t\toptions: {\n\t\t\t\tdescription: 'animation',\n\t\t\t\tclassName: 'edits-fadeout-decoration',\n\t\t\t\tzIndex: 1,\n\t\t\t}\n\t\t})))));\n\n\t\tconst animation = new AnimatedValue(1, 0, 1000, easeOutCubic);\n\t\tconst val = new ObservableAnimatedValue(animation);\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst opacity = val.getValue(reader);\n\t\t\teditor.getContainerDomNode().style.setProperty('--animation-opacity', opacity.toString());\n\t\t\tif (animation.isFinished()) {\n\t\t\t\tthis.dispose();\n\t\t\t}\n\t\t}));\n\t}\n}\n\nexport function isSuggestionInViewport(editor: ICodeEditor, suggestion: InlineSuggestionItem, reader: IReader | undefined = undefined): boolean {\n\tconst targetRange = suggestion.targetRange;\n\n\t// TODO make getVisibleRanges reactive!\n\tobservableCodeEditor(editor).scrollTop.read(reader);\n\tconst visibleRanges = editor.getVisibleRanges();\n\n\tif (visibleRanges.length < 1) {\n\t\treturn false;\n\t}\n\n\tconst viewportRange = new Range(\n\t\tvisibleRanges[0].startLineNumber,\n\t\tvisibleRanges[0].startColumn,\n\t\tvisibleRanges[visibleRanges.length - 1].endLineNumber,\n\t\tvisibleRanges[visibleRanges.length - 1].endColumn\n\t);\n\treturn viewportRange.containsRange(targetRange);\n}\n\nfunction skuFromAccount(account: IDefaultAccount | null): InlineSuggestSku | undefined {\n\tif (account?.access_type_sku && account?.copilot_plan) {\n\t\treturn { type: account.access_type_sku, plan: account.copilot_plan };\n\t}\n\treturn undefined;\n}\n\nclass DisposableCallback<T> {\n\tprivate _cb: ((e: T) => void) | undefined;\n\n\tconstructor(cb: (e: T) => void) {\n\t\tthis._cb = cb;\n\t}\n\n\tdispose(): void {\n\t\tthis._cb = undefined;\n\t}\n\n\treadonly handler = (val: T) => {\n\t\treturn this._cb?.(val);\n\t};\n}\n\nfunction createDisposableCb<T>(cb: (e: T) => void, store: DisposableStore): (e: T) => void {\n\tconst dcb = new DisposableCallback(cb);\n\tstore.add(dcb);\n\treturn dcb.handler;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { mapFindFirst } from '../../../../../base/common/arraysFind.js';\nimport { arrayEqualsC } from '../../../../../base/common/equals.js';\nimport { BugIndicatingError, onUnexpectedExternalError } from '../../../../../base/common/errors.js';\nimport { Emitter } from '../../../../../base/common/event.js';\nimport { Disposable, DisposableStore } from '../../../../../base/common/lifecycle.js';\nimport { IObservable, IObservableWithChange, IReader, ITransaction, autorun, constObservable, derived, derivedHandleChanges, derivedOpts, mapObservableArrayCached, observableFromEvent, observableSignal, observableValue, recomputeInitiallyAndOnChange, subtransaction, transaction } from '../../../../../base/common/observable.js';\nimport { firstNonWhitespaceIndex } from '../../../../../base/common/strings.js';\nimport { isDefined } from '../../../../../base/common/types.js';\nimport { IAccessibilityService } from '../../../../../platform/accessibility/common/accessibility.js';\nimport { ICommandService } from '../../../../../platform/commands/common/commands.js';\nimport { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';\nimport { ICodeEditor } from '../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../browser/observableCodeEditor.js';\nimport { EditorOption } from '../../../../common/config/editorOptions.js';\nimport { CursorColumns } from '../../../../common/core/cursorColumns.js';\nimport { LineRange } from '../../../../common/core/ranges/lineRange.js';\nimport { Position } from '../../../../common/core/position.js';\nimport { Range } from '../../../../common/core/range.js';\nimport { Selection } from '../../../../common/core/selection.js';\nimport { TextReplacement, TextEdit } from '../../../../common/core/edits/textEdit.js';\nimport { TextLength } from '../../../../common/core/text/textLength.js';\nimport { ScrollType } from '../../../../common/editorCommon.js';\nimport { InlineCompletionEndOfLifeReasonKind, InlineCompletion, InlineCompletionTriggerKind, PartialAcceptTriggerKind, InlineCompletionsProvider, InlineCompletionCommand } from '../../../../common/languages.js';\nimport { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js';\nimport { EndOfLinePreference, IModelDeltaDecoration, ITextModel } from '../../../../common/model.js';\nimport { TextModelText } from '../../../../common/model/textModelText.js';\nimport { IFeatureDebounceInformation } from '../../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js';\nimport { IModelContentChangedEvent } from '../../../../common/textModelEvents.js';\nimport { SnippetController2 } from '../../../snippet/browser/snippetController2.js';\nimport { getEndPositionsAfterApplying, removeTextReplacementCommonSuffixPrefix } from '../utils.js';\nimport { AnimatedValue, easeOutCubic, ObservableAnimatedValue } from './animation.js';\nimport { computeGhostText } from './computeGhostText.js';\nimport { GhostText, GhostTextOrReplacement, ghostTextOrReplacementEquals, ghostTextsOrReplacementsEqual } from './ghostText.js';\nimport { InlineCompletionsSource } from './inlineCompletionsSource.js';\nimport { InlineCompletionItem, InlineEditItem, InlineSuggestionItem } from './inlineSuggestionItem.js';\nimport { InlineCompletionContextWithoutUuid, InlineCompletionEditorType, InlineSuggestRequestInfo, InlineSuggestSku } from './provideInlineCompletions.js';\nimport { singleTextEditAugments, singleTextRemoveCommonPrefix } from './singleTextEditHelpers.js';\nimport { SuggestItemInfo } from './suggestWidgetAdapter.js';\nimport { TextModelEditSource, EditSources } from '../../../../common/textModelEditSource.js';\nimport { ICodeEditorService } from '../../../../browser/services/codeEditorService.js';\nimport { InlineCompletionViewData, InlineCompletionViewKind } from '../view/inlineEdits/inlineEditsViewInterface.js';\nimport { IInlineCompletionsService } from '../../../../browser/services/inlineCompletionsService.js';\nimport { TypingInterval } from './typingSpeed.js';\nimport { StringReplacement } from '../../../../common/core/edits/stringEdit.js';\nimport { OffsetRange } from '../../../../common/core/ranges/offsetRange.js';\nimport { URI } from '../../../../../base/common/uri.js';\nimport { IDefaultAccountService } from '../../../../../platform/defaultAccount/common/defaultAccount.js';\nimport { IDefaultAccount } from '../../../../../base/common/defaultAccount.js';\n\nexport class InlineCompletionsModel extends Disposable {\n\tprivate readonly _source;\n\tprivate readonly _isActive = observableValue<boolean>(this, false);\n\tprivate readonly _onlyRequestInlineEditsSignal = observableSignal(this);\n\tprivate readonly _forceUpdateExplicitlySignal = observableSignal(this);\n\tprivate readonly _noDelaySignal = observableSignal(this);\n\n\tprivate readonly _fetchSpecificProviderSignal = observableSignal<InlineCompletionsProvider | undefined>(this);\n\n\t// We use a semantic id to keep the same inline completion selected even if the provider reorders the completions.\n\tprivate readonly _selectedInlineCompletionId = observableValue<string | undefined>(this, undefined);\n\tpublic readonly primaryPosition = derived(this, reader => this._positions.read(reader)[0] ?? new Position(1, 1));\n\tpublic readonly allPositions = derived(this, reader => this._positions.read(reader));\n\n\tprivate readonly sku = observableValue<InlineSuggestSku | undefined>(this, undefined);\n\n\tprivate _isAcceptingPartially = false;\n\tprivate readonly _appearedInsideViewport = derived<boolean>(this, reader => {\n\t\tconst state = this.state.read(reader);\n\t\tif (!state || !state.inlineSuggestion) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn isSuggestionInViewport(this._editor, state.inlineSuggestion);\n\t});\n\tpublic get isAcceptingPartially() { return this._isAcceptingPartially; }\n\n\tprivate readonly _onDidAccept = new Emitter<void>();\n\tpublic readonly onDidAccept = this._onDidAccept.event;\n\n\tprivate readonly _editorObs;\n\n\tprivate readonly _typing: TypingInterval;\n\n\tprivate readonly _suggestPreviewEnabled;\n\tprivate readonly _suggestPreviewMode;\n\tprivate readonly _inlineSuggestMode;\n\tprivate readonly _suppressedInlineCompletionGroupIds;\n\tprivate readonly _inlineEditsEnabled;\n\tprivate readonly _inlineEditsShowCollapsedEnabled;\n\tprivate readonly _triggerCommandOnProviderChange;\n\tprivate readonly _minShowDelay;\n\tprivate readonly _showOnSuggestConflict;\n\tprivate readonly _suppressInSnippetMode;\n\tprivate readonly _isInSnippetMode;\n\n\tget editor() {\n\t\treturn this._editor;\n\t}\n\n\tconstructor(\n\t\tpublic readonly textModel: ITextModel,\n\t\tprivate readonly _selectedSuggestItem: IObservable<SuggestItemInfo | undefined>,\n\t\tpublic readonly _textModelVersionId: IObservableWithChange<number | null, IModelContentChangedEvent | undefined>,\n\t\tprivate readonly _positions: IObservable<readonly Position[]>,\n\t\tprivate readonly _debounceValue: IFeatureDebounceInformation,\n\t\tprivate readonly _enabled: IObservable<boolean>,\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ICodeEditorService private readonly _codeEditorService: ICodeEditorService,\n\t\t@IInlineCompletionsService private readonly _inlineCompletionsService: IInlineCompletionsService,\n\t\t@IDefaultAccountService defaultAccountService: IDefaultAccountService,\n\t) {\n\t\tsuper();\n\t\tthis._source = this._register(this._instantiationService.createInstance(InlineCompletionsSource, this.textModel, this._textModelVersionId, this._debounceValue, this.primaryPosition));\n\t\tthis.lastTriggerKind = this._source.inlineCompletions.map(this, v => v?.request?.context.triggerKind);\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tconst suggest = this._editorObs.getOption(EditorOption.suggest);\n\t\tthis._suggestPreviewEnabled = suggest.map(v => v.preview);\n\t\tthis._suggestPreviewMode = suggest.map(v => v.previewMode);\n\n\t\tconst inlineSuggest = this._editorObs.getOption(EditorOption.inlineSuggest);\n\t\tthis._inlineSuggestMode = inlineSuggest.map(v => v.mode);\n\t\tthis._suppressedInlineCompletionGroupIds = inlineSuggest.map(v => new Set(v.experimental.suppressInlineSuggestions.split(',')));\n\t\tthis._inlineEditsEnabled = inlineSuggest.map(v => !!v.edits.enabled);\n\t\tthis._inlineEditsShowCollapsedEnabled = inlineSuggest.map(s => s.edits.showCollapsed);\n\t\tthis._triggerCommandOnProviderChange = inlineSuggest.map(s => s.triggerCommandOnProviderChange);\n\t\tthis._minShowDelay = inlineSuggest.map(s => s.minShowDelay);\n\t\tthis._showOnSuggestConflict = inlineSuggest.map(s => s.experimental.showOnSuggestConflict);\n\t\tthis._suppressInSnippetMode = inlineSuggest.map(s => s.suppressInSnippetMode);\n\n\t\tconst snippetController = SnippetController2.get(this._editor);\n\t\tthis._isInSnippetMode = snippetController?.isInSnippetObservable ?? constObservable(false);\n\n\t\tdefaultAccountService.getDefaultAccount().then(createDisposableCb(account => this.sku.set(skuFromAccount(account), undefined), this._store));\n\t\tthis._register(defaultAccountService.onDidChangeDefaultAccount(account => this.sku.set(skuFromAccount(account), undefined)));\n\n\t\tthis._typing = this._register(new TypingInterval(this.textModel));\n\n\t\tthis._register(this._inlineCompletionsService.onDidChangeIsSnoozing((isSnoozing) => {\n\t\t\tif (isSnoozing) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t}));\n\n\t\t{ // Determine editor type\n\t\t\tconst isNotebook = this.textModel.uri.scheme === 'vscode-notebook-cell';\n\t\t\tconst [diffEditor] = this._codeEditorService.listDiffEditors()\n\t\t\t\t.filter(d =>\n\t\t\t\t\td.getOriginalEditor().getId() === this._editor.getId() ||\n\t\t\t\t\td.getModifiedEditor().getId() === this._editor.getId());\n\n\t\t\tthis.isInDiffEditor = !!diffEditor;\n\t\t\tthis.editorType = isNotebook ? InlineCompletionEditorType.Notebook\n\t\t\t\t: this.isInDiffEditor ? InlineCompletionEditorType.DiffEditor\n\t\t\t\t\t: InlineCompletionEditorType.TextEditor;\n\t\t}\n\n\t\tthis._register(recomputeInitiallyAndOnChange(this.state, (s) => {\n\t\t\tif (s && s.inlineSuggestion) {\n\t\t\t\tthis._inlineCompletionsService.reportNewCompletion(s.inlineSuggestion.requestUuid);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(recomputeInitiallyAndOnChange(this._fetchInlineCompletionsPromise));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tthis._editorObs.versionId.read(reader);\n\t\t\tthis._inAcceptFlow.set(false, undefined);\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst jumpToReset = this.state.map((s, reader) => !s || s.kind === 'inlineEdit' && !s.cursorAtInlineEdit.read(reader)).read(reader);\n\t\t\tif (jumpToReset) {\n\t\t\t\tthis._jumpedToId.set(undefined, undefined);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst inlineSuggestion = this.state.map(s => s?.inlineSuggestion).read(reader);\n\t\t\tif (inlineSuggestion) {\n\t\t\t\tinlineSuggestion.addPerformanceMarker('activeSuggestion');\n\t\t\t}\n\t\t}));\n\n\t\tconst inlineEditSemanticId = this.inlineEditState.map(s => s?.inlineSuggestion.semanticId);\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst id = inlineEditSemanticId.read(reader);\n\t\t\tif (id) {\n\t\t\t\tthis._editor.pushUndoStop();\n\t\t\t\tthis._lastShownInlineCompletionInfo = {\n\t\t\t\t\talternateTextModelVersionId: this.textModel.getAlternativeVersionId(),\n\t\t\t\t\tinlineCompletion: this.state.get()!.inlineSuggestion!,\n\t\t\t\t};\n\t\t\t}\n\t\t}));\n\n\t\t// TODO: should use getAvailableProviders and update on _suppressedInlineCompletionGroupIds change\n\t\tconst inlineCompletionProviders = observableFromEvent(this._languageFeaturesService.inlineCompletionsProvider.onDidChange, () => this._languageFeaturesService.inlineCompletionsProvider.all(textModel));\n\t\tmapObservableArrayCached(this, inlineCompletionProviders, (provider, store) => {\n\t\t\tif (!provider.onDidChangeInlineCompletions) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tstore.add(provider.onDidChangeInlineCompletions(() => {\n\t\t\t\tif (!this._enabled.get()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Only update the active editor\n\t\t\t\tconst activeEditor = this._codeEditorService.getFocusedCodeEditor() || this._codeEditorService.getActiveCodeEditor();\n\t\t\t\tif (activeEditor !== this._editor) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (this._triggerCommandOnProviderChange.get()) {\n\t\t\t\t\t// TODO@hediet remove this and always do the else branch.\n\t\t\t\t\tthis.trigger(undefined, { onlyFetchInlineEdits: true });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\n\t\t\t\t// If there is an active suggestion from a different provider, we ignore the update\n\t\t\t\tconst activeState = this.state.get();\n\t\t\t\tif (activeState && (activeState.inlineSuggestion || activeState.edits) && activeState.inlineSuggestion?.source.provider !== provider) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\ttransaction(tx => {\n\t\t\t\t\tthis._fetchSpecificProviderSignal.trigger(tx, provider);\n\t\t\t\t\tthis.trigger(tx);\n\t\t\t\t});\n\n\t\t\t}));\n\t\t}).recomputeInitiallyAndOnChange(this._store);\n\n\t\tthis._didUndoInlineEdits.recomputeInitiallyAndOnChange(this._store);\n\t}\n\n\tprivate _lastShownInlineCompletionInfo: { alternateTextModelVersionId: number; /* already freed! */ inlineCompletion: InlineSuggestionItem } | undefined = undefined;\n\tprivate _lastAcceptedInlineCompletionInfo: { textModelVersionIdAfter: number; /* already freed! */ inlineCompletion: InlineSuggestionItem } | undefined = undefined;\n\tprivate readonly _didUndoInlineEdits = derivedHandleChanges({\n\t\towner: this,\n\t\tchangeTracker: {\n\t\t\tcreateChangeSummary: () => ({ didUndo: false }),\n\t\t\thandleChange: (ctx, changeSummary) => {\n\t\t\t\tchangeSummary.didUndo = ctx.didChange(this._textModelVersionId) && !!ctx.change?.isUndoing;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}, (reader, changeSummary) => {\n\t\tconst versionId = this._textModelVersionId.read(reader);\n\t\tif (versionId !== null\n\t\t\t&& this._lastAcceptedInlineCompletionInfo\n\t\t\t&& this._lastAcceptedInlineCompletionInfo.textModelVersionIdAfter === versionId - 1\n\t\t\t&& this._lastAcceptedInlineCompletionInfo.inlineCompletion.isInlineEdit\n\t\t\t&& changeSummary.didUndo\n\t\t) {\n\t\t\tthis._lastAcceptedInlineCompletionInfo = undefined;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t});\n\n\tpublic getIndentationInfo(reader: IReader) {\n\t\tlet startsWithIndentation = false;\n\t\tlet startsWithIndentationLessThanTabSize = true;\n\t\tconst ghostText = this?.primaryGhostText.read(reader);\n\t\tif (!!this?._selectedSuggestItem && ghostText && ghostText.parts.length > 0) {\n\t\t\tconst { column, lines } = ghostText.parts[0];\n\n\t\t\tconst firstLine = lines[0].line;\n\n\t\t\tconst indentationEndColumn = this.textModel.getLineIndentColumn(ghostText.lineNumber);\n\t\t\tconst inIndentation = column <= indentationEndColumn;\n\n\t\t\tif (inIndentation) {\n\t\t\t\tlet firstNonWsIdx = firstNonWhitespaceIndex(firstLine);\n\t\t\t\tif (firstNonWsIdx === -1) {\n\t\t\t\t\tfirstNonWsIdx = firstLine.length - 1;\n\t\t\t\t}\n\t\t\t\tstartsWithIndentation = firstNonWsIdx > 0;\n\n\t\t\t\tconst tabSize = this.textModel.getOptions().tabSize;\n\t\t\t\tconst visibleColumnIndentation = CursorColumns.visibleColumnFromColumn(firstLine, firstNonWsIdx + 1, tabSize);\n\t\t\t\tstartsWithIndentationLessThanTabSize = visibleColumnIndentation < tabSize;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tstartsWithIndentation,\n\t\t\tstartsWithIndentationLessThanTabSize,\n\t\t};\n\t}\n\n\tprivate readonly _preserveCurrentCompletionReasons = new Set([\n\t\tVersionIdChangeReason.Redo,\n\t\tVersionIdChangeReason.Undo,\n\t\tVersionIdChangeReason.AcceptWord,\n\t]);\n\n\tprivate _getReason(e: IModelContentChangedEvent | undefined): VersionIdChangeReason {\n\t\tif (e?.isUndoing) { return VersionIdChangeReason.Undo; }\n\t\tif (e?.isRedoing) { return VersionIdChangeReason.Redo; }\n\t\tif (this.isAcceptingPartially) { return VersionIdChangeReason.AcceptWord; }\n\t\treturn VersionIdChangeReason.Other;\n\t}\n\n\tpublic readonly dontRefetchSignal = observableSignal(this);\n\n\tprivate readonly _fetchInlineCompletionsPromise = derivedHandleChanges({\n\t\towner: this,\n\t\tchangeTracker: {\n\t\t\tcreateChangeSummary: () => ({\n\t\t\t\tdontRefetch: false,\n\t\t\t\tpreserveCurrentCompletion: false,\n\t\t\t\tinlineCompletionTriggerKind: InlineCompletionTriggerKind.Automatic,\n\t\t\t\tonlyRequestInlineEdits: false,\n\t\t\t\tshouldDebounce: true,\n\t\t\t\tprovider: undefined as InlineCompletionsProvider | undefined,\n\t\t\t\ttextChange: false,\n\t\t\t\tchangeReason: '',\n\t\t\t}),\n\t\t\thandleChange: (ctx, changeSummary) => {\n\t\t\t\t/** @description fetch inline completions */\n\t\t\t\tif (ctx.didChange(this._textModelVersionId)) {\n\t\t\t\t\tif (this._preserveCurrentCompletionReasons.has(this._getReason(ctx.change))) {\n\t\t\t\t\t\tchangeSummary.preserveCurrentCompletion = true;\n\t\t\t\t\t}\n\t\t\t\t\tconst detailedReasons = ctx.change?.detailedReasons ?? [];\n\t\t\t\t\tchangeSummary.changeReason = detailedReasons.length > 0 ? detailedReasons[0].getType() : '';\n\t\t\t\t\tchangeSummary.textChange = true;\n\t\t\t\t} else if (ctx.didChange(this._forceUpdateExplicitlySignal)) {\n\t\t\t\t\tchangeSummary.preserveCurrentCompletion = true;\n\t\t\t\t\tchangeSummary.inlineCompletionTriggerKind = InlineCompletionTriggerKind.Explicit;\n\t\t\t\t} else if (ctx.didChange(this.dontRefetchSignal)) {\n\t\t\t\t\tchangeSummary.dontRefetch = true;\n\t\t\t\t} else if (ctx.didChange(this._onlyRequestInlineEditsSignal)) {\n\t\t\t\t\tchangeSummary.onlyRequestInlineEdits = true;\n\t\t\t\t} else if (ctx.didChange(this._fetchSpecificProviderSignal)) {\n\t\t\t\t\tchangeSummary.provider = ctx.change;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t},\n\t\t},\n\t}, (reader, changeSummary) => {\n\t\tthis._source.clearOperationOnTextModelChange.read(reader); // Make sure the clear operation runs before the fetch operation\n\t\tthis._noDelaySignal.read(reader);\n\t\tthis.dontRefetchSignal.read(reader);\n\t\tthis._onlyRequestInlineEditsSignal.read(reader);\n\t\tthis._forceUpdateExplicitlySignal.read(reader);\n\t\tthis._fetchSpecificProviderSignal.read(reader);\n\t\tconst shouldUpdate = ((this._enabled.read(reader) && this._selectedSuggestItem.read(reader)) || this._isActive.read(reader))\n\t\t\t&& (!this._inlineCompletionsService.isSnoozing() || changeSummary.inlineCompletionTriggerKind === InlineCompletionTriggerKind.Explicit);\n\t\tif (!shouldUpdate) {\n\t\t\tthis._source.cancelUpdate();\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthis._textModelVersionId.read(reader); // Refetch on text change\n\n\t\tconst suggestWidgetInlineCompletions = this._source.suggestWidgetInlineCompletions.read(undefined);\n\t\tlet suggestItem = this._selectedSuggestItem.read(reader);\n\t\tif (this._shouldShowOnSuggestConflict.read(undefined)) {\n\t\t\tsuggestItem = undefined;\n\t\t}\n\t\tif (suggestWidgetInlineCompletions && !suggestItem) {\n\t\t\tthis._source.seedInlineCompletionsWithSuggestWidget();\n\t\t}\n\n\t\tif (changeSummary.dontRefetch) {\n\t\t\treturn Promise.resolve(true);\n\t\t}\n\n\t\tif (this._didUndoInlineEdits.read(reader) && changeSummary.inlineCompletionTriggerKind !== InlineCompletionTriggerKind.Explicit) {\n\t\t\ttransaction(tx => {\n\t\t\t\tthis._source.clear(tx);\n\t\t\t});\n\t\t\treturn undefined;\n\t\t}\n\n\t\tlet reason: string = '';\n\t\tif (changeSummary.provider) {\n\t\t\treason += 'providerOnDidChange';\n\t\t} else if (changeSummary.inlineCompletionTriggerKind === InlineCompletionTriggerKind.Explicit) {\n\t\t\treason += 'explicit';\n\t\t}\n\t\tif (changeSummary.changeReason) {\n\t\t\treason += reason.length > 0 ? `:${changeSummary.changeReason}` : changeSummary.changeReason;\n\t\t}\n\n\t\tconst typingInterval = this._typing.getTypingInterval();\n\t\tconst requestInfo: InlineSuggestRequestInfo = {\n\t\t\teditorType: this.editorType,\n\t\t\tstartTime: Date.now(),\n\t\t\tlanguageId: this.textModel.getLanguageId(),\n\t\t\treason,\n\t\t\ttypingInterval: typingInterval.averageInterval,\n\t\t\ttypingIntervalCharacterCount: typingInterval.characterCount,\n\t\t\tavailableProviders: [],\n\t\t\tsku: this.sku.read(undefined),\n\t\t};\n\n\t\tlet context: InlineCompletionContextWithoutUuid = {\n\t\t\ttriggerKind: changeSummary.inlineCompletionTriggerKind,\n\t\t\tselectedSuggestionInfo: suggestItem?.toSelectedSuggestionInfo(),\n\t\t\tincludeInlineCompletions: !changeSummary.onlyRequestInlineEdits,\n\t\t\tincludeInlineEdits: this._inlineEditsEnabled.read(reader),\n\t\t\trequestIssuedDateTime: requestInfo.startTime,\n\t\t\tearliestShownDateTime: requestInfo.startTime + (changeSummary.inlineCompletionTriggerKind === InlineCompletionTriggerKind.Explicit || this.inAcceptFlow.read(undefined) ? 0 : this._minShowDelay.read(undefined)),\n\t\t};\n\n\t\tif (context.triggerKind === InlineCompletionTriggerKind.Automatic && changeSummary.textChange) {\n\t\t\tif (this.textModel.getAlternativeVersionId() === this._lastShownInlineCompletionInfo?.alternateTextModelVersionId) {\n\t\t\t\t// When undoing back to a version where an inline edit/completion was shown,\n\t\t\t\t// we want to show an inline edit (or completion) again if it was originally an inline edit (or completion).\n\t\t\t\tcontext = {\n\t\t\t\t\t...context,\n\t\t\t\t\tincludeInlineCompletions: !this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit,\n\t\t\t\t\tincludeInlineEdits: this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tconst itemToPreserveCandidate = this.selectedInlineCompletion.read(undefined) ?? this._inlineCompletionItems.read(undefined)?.inlineEdit;\n\t\tconst itemToPreserve = changeSummary.preserveCurrentCompletion || itemToPreserveCandidate?.forwardStable\n\t\t\t? itemToPreserveCandidate : undefined;\n\t\tconst userJumpedToActiveCompletion = this._jumpedToId.map(jumpedTo => !!jumpedTo && jumpedTo === this._inlineCompletionItems.read(undefined)?.inlineEdit?.semanticId);\n\n\t\tconst providers = changeSummary.provider\n\t\t\t? { providers: [changeSummary.provider], label: 'single:' + changeSummary.provider.providerId?.toString() }\n\t\t\t: { providers: this._languageFeaturesService.inlineCompletionsProvider.all(this.textModel), label: undefined }; // TODO: should use inlineCompletionProviders\n\t\tconst availableProviders = this.getAvailableProviders(providers.providers);\n\t\trequestInfo.availableProviders = availableProviders.map(p => p.providerId).filter(isDefined);\n\n\t\treturn this._source.fetch(availableProviders, providers.label, context, itemToPreserve?.identity, changeSummary.shouldDebounce, userJumpedToActiveCompletion, requestInfo);\n\t});\n\n\t// TODO: This is not an ideal implementation of excludesGroupIds, however as this is currently still behind proposed API\n\t// and due to the time constraints, we are using a simplified approach\n\tprivate getAvailableProviders(providers: InlineCompletionsProvider[]): InlineCompletionsProvider[] {\n\t\tconst suppressedProviderGroupIds = this._suppressedInlineCompletionGroupIds.get();\n\t\tconst unsuppressedProviders = providers.filter(provider => !(provider.groupId && suppressedProviderGroupIds.has(provider.groupId)));\n\n\t\tconst excludedGroupIds = new Set<string>();\n\t\tfor (const provider of unsuppressedProviders) {\n\t\t\tprovider.excludesGroupIds?.forEach(p => excludedGroupIds.add(p));\n\t\t}\n\n\t\tconst availableProviders: InlineCompletionsProvider[] = [];\n\t\tfor (const provider of unsuppressedProviders) {\n\t\t\tif (provider.groupId && excludedGroupIds.has(provider.groupId)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tavailableProviders.push(provider);\n\t\t}\n\n\t\treturn availableProviders;\n\t}\n\n\tpublic async trigger(tx?: ITransaction, options: { onlyFetchInlineEdits?: boolean; noDelay?: boolean; provider?: InlineCompletionsProvider; explicit?: boolean } = {}): Promise<void> {\n\t\tsubtransaction(tx, tx => {\n\t\t\tif (options.onlyFetchInlineEdits) {\n\t\t\t\tthis._onlyRequestInlineEditsSignal.trigger(tx);\n\t\t\t}\n\t\t\tif (options.noDelay) {\n\t\t\t\tthis._noDelaySignal.trigger(tx);\n\t\t\t}\n\t\t\tthis._isActive.set(true, tx);\n\n\t\t\tif (options.explicit) {\n\t\t\t\tthis._inAcceptFlow.set(true, tx);\n\t\t\t\tthis._forceUpdateExplicitlySignal.trigger(tx);\n\t\t\t}\n\t\t\tif (options.provider) {\n\t\t\t\tthis._fetchSpecificProviderSignal.trigger(tx, options.provider);\n\t\t\t}\n\t\t});\n\t\tawait this._fetchInlineCompletionsPromise.get();\n\t}\n\n\tpublic async triggerExplicitly(tx?: ITransaction, onlyFetchInlineEdits: boolean = false): Promise<void> {\n\t\treturn this.trigger(tx, { onlyFetchInlineEdits, explicit: true });\n\t}\n\n\tpublic stop(stopReason: 'explicitCancel' | 'automatic' = 'automatic', tx?: ITransaction): void {\n\t\tsubtransaction(tx, tx => {\n\t\t\tif (stopReason === 'explicitCancel') {\n\t\t\t\tconst inlineCompletion = this.state.get()?.inlineSuggestion;\n\t\t\t\tif (inlineCompletion) {\n\t\t\t\t\tinlineCompletion.reportEndOfLife({ kind: InlineCompletionEndOfLifeReasonKind.Rejected });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._isActive.set(false, tx);\n\t\t\tthis._source.clear(tx);\n\t\t});\n\t}\n\n\tprivate readonly _inlineCompletionItems = derivedOpts({ owner: this }, reader => {\n\t\tconst c = this._source.inlineCompletions.read(reader);\n\t\tif (!c) { return undefined; }\n\t\tconst cursorPosition = this.primaryPosition.read(reader);\n\t\tlet inlineEdit: InlineEditItem | undefined = undefined;\n\t\tconst visibleCompletions: InlineCompletionItem[] = [];\n\t\tfor (const completion of c.inlineCompletions) {\n\t\t\tif (!completion.isInlineEdit) {\n\t\t\t\tif (completion.isVisible(this.textModel, cursorPosition)) {\n\t\t\t\t\tvisibleCompletions.push(completion);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tinlineEdit = completion;\n\t\t\t}\n\t\t}\n\n\t\tif (visibleCompletions.length !== 0) {\n\t\t\t// Don't show the inline edit if there is a visible completion\n\t\t\tinlineEdit = undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tinlineCompletions: visibleCompletions,\n\t\t\tinlineEdit,\n\t\t};\n\t});\n\n\tprivate readonly _filteredInlineCompletionItems = derivedOpts({ owner: this, equalsFn: arrayEqualsC() }, reader => {\n\t\tconst c = this._inlineCompletionItems.read(reader);\n\t\treturn c?.inlineCompletions ?? [];\n\t});\n\n\tpublic readonly selectedInlineCompletionIndex = derived<number>(this, (reader) => {\n\t\tconst selectedInlineCompletionId = this._selectedInlineCompletionId.read(reader);\n\t\tconst filteredCompletions = this._filteredInlineCompletionItems.read(reader);\n\t\tconst idx = this._selectedInlineCompletionId === undefined ? -1\n\t\t\t: filteredCompletions.findIndex(v => v.semanticId === selectedInlineCompletionId);\n\t\tif (idx === -1) {\n\t\t\t// Reset the selection so that the selection does not jump back when it appears again\n\t\t\tthis._selectedInlineCompletionId.set(undefined, undefined);\n\t\t\treturn 0;\n\t\t}\n\t\treturn idx;\n\t});\n\n\tpublic readonly selectedInlineCompletion = derived<InlineCompletionItem | undefined>(this, (reader) => {\n\t\tconst filteredCompletions = this._filteredInlineCompletionItems.read(reader);\n\t\tconst idx = this.selectedInlineCompletionIndex.read(reader);\n\t\treturn filteredCompletions[idx];\n\t});\n\n\tpublic readonly activeCommands = derivedOpts<InlineCompletionCommand[]>({ owner: this, equalsFn: arrayEqualsC() },\n\t\tr => this.selectedInlineCompletion.read(r)?.source.inlineSuggestions.commands ?? []\n\t);\n\n\tpublic readonly lastTriggerKind: IObservable<InlineCompletionTriggerKind | undefined>;\n\n\tpublic readonly inlineCompletionsCount = derived<number | undefined>(this, reader => {\n\t\tif (this.lastTriggerKind.read(reader) === InlineCompletionTriggerKind.Explicit) {\n\t\t\treturn this._filteredInlineCompletionItems.read(reader).length;\n\t\t} else {\n\t\t\treturn undefined;\n\t\t}\n\t});\n\n\tprivate readonly _hasVisiblePeekWidgets = derived(this, reader => this._editorObs.openedPeekWidgets.read(reader) > 0);\n\n\tprivate readonly _shouldShowOnSuggestConflict = derived(this, reader => {\n\t\tconst showOnSuggestConflict = this._showOnSuggestConflict.read(reader);\n\t\tif (showOnSuggestConflict !== 'never') {\n\t\t\tconst hasInlineCompletion = !!this.selectedInlineCompletion.read(reader);\n\t\t\tif (hasInlineCompletion) {\n\t\t\t\tconst item = this._selectedSuggestItem.read(reader);\n\t\t\t\tif (!item) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (showOnSuggestConflict === 'whenSuggestListIsIncomplete') {\n\t\t\t\t\treturn item.listIncomplete;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t});\n\n\tpublic readonly state = derivedOpts<{\n\t\tkind: 'ghostText';\n\t\tedits: readonly TextReplacement[];\n\t\tprimaryGhostText: GhostTextOrReplacement;\n\t\tghostTexts: readonly GhostTextOrReplacement[];\n\t\tsuggestItem: SuggestItemInfo | undefined;\n\t\tinlineSuggestion: InlineCompletionItem | undefined;\n\t} | {\n\t\tkind: 'inlineEdit';\n\t\tedits: readonly TextReplacement[];\n\t\tinlineSuggestion: InlineEditItem;\n\t\tcursorAtInlineEdit: IObservable<boolean>;\n\t\tnextEditUri: URI | undefined;\n\t} | undefined>({\n\t\towner: this,\n\t\tequalsFn: (a, b) => {\n\t\t\tif (!a || !b) { return a === b; }\n\n\t\t\tif (a.kind === 'ghostText' && b.kind === 'ghostText') {\n\t\t\t\treturn ghostTextsOrReplacementsEqual(a.ghostTexts, b.ghostTexts)\n\t\t\t\t\t&& a.inlineSuggestion === b.inlineSuggestion\n\t\t\t\t\t&& a.suggestItem === b.suggestItem;\n\t\t\t} else if (a.kind === 'inlineEdit' && b.kind === 'inlineEdit') {\n\t\t\t\treturn a.inlineSuggestion === b.inlineSuggestion;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}, (reader) => {\n\t\tconst model = this.textModel;\n\n\t\tif (this._suppressInSnippetMode.read(reader) && this._isInSnippetMode.read(reader)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst item = this._inlineCompletionItems.read(reader);\n\t\tconst inlineEditResult = item?.inlineEdit;\n\t\tif (inlineEditResult) {\n\t\t\tif (this._hasVisiblePeekWidgets.read(reader)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst cursorAtInlineEdit = this.primaryPosition.map(cursorPos => LineRange.fromRangeInclusive(inlineEditResult.targetRange).addMargin(1, 1).contains(cursorPos.lineNumber));\n\t\t\tconst stringEdit = inlineEditResult.action?.kind === 'edit' ? inlineEditResult.action.stringEdit : undefined;\n\t\t\tconst replacements = stringEdit ? TextEdit.fromStringEdit(stringEdit, new TextModelText(this.textModel)).replacements : [];\n\n\t\t\tconst nextEditUri = (item.inlineEdit?.command?.id === 'vscode.open' || item.inlineEdit?.command?.id === '_workbench.open') &&\n\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\titem.inlineEdit?.command.arguments?.length ? URI.from(<any>item.inlineEdit?.command.arguments[0]) : undefined;\n\t\t\treturn { kind: 'inlineEdit', inlineSuggestion: inlineEditResult, edits: replacements, cursorAtInlineEdit, nextEditUri };\n\t\t}\n\n\t\tconst suggestItem = this._selectedSuggestItem.read(reader);\n\t\tif (!this._shouldShowOnSuggestConflict.read(reader) && suggestItem) {\n\t\t\tconst suggestCompletionEdit = singleTextRemoveCommonPrefix(suggestItem.getSingleTextEdit(), model);\n\t\t\tconst augmentation = this._computeAugmentation(suggestCompletionEdit, reader);\n\n\t\t\tconst isSuggestionPreviewEnabled = this._suggestPreviewEnabled.read(reader);\n\t\t\tif (!isSuggestionPreviewEnabled && !augmentation) { return undefined; }\n\n\t\t\tconst fullEdit = augmentation?.edit ?? suggestCompletionEdit;\n\t\t\tconst fullEditPreviewLength = augmentation ? augmentation.edit.text.length - suggestCompletionEdit.text.length : 0;\n\n\t\t\tconst mode = this._suggestPreviewMode.read(reader);\n\t\t\tconst positions = this._positions.read(reader);\n\t\t\tconst allPotentialEdits = [fullEdit, ...getSecondaryEdits(this.textModel, positions, fullEdit)];\n\t\t\tconst validEditsAndGhostTexts = allPotentialEdits\n\t\t\t\t.map((edit, idx) => ({ edit, ghostText: edit ? computeGhostText(edit, model, mode, positions[idx], fullEditPreviewLength) : undefined }))\n\t\t\t\t.filter(({ edit, ghostText }) => edit !== undefined && ghostText !== undefined);\n\t\t\tconst edits = validEditsAndGhostTexts.map(({ edit }) => edit!);\n\t\t\tconst ghostTexts = validEditsAndGhostTexts.map(({ ghostText }) => ghostText!);\n\t\t\tconst primaryGhostText = ghostTexts[0] ?? new GhostText(fullEdit.range.endLineNumber, []);\n\t\t\treturn { kind: 'ghostText', edits, primaryGhostText, ghostTexts, inlineSuggestion: augmentation?.completion, suggestItem };\n\t\t} else {\n\t\t\tif (!this._isActive.read(reader)) { return undefined; }\n\t\t\tconst inlineSuggestion = this.selectedInlineCompletion.read(reader);\n\t\t\tif (!inlineSuggestion) { return undefined; }\n\n\t\t\tconst replacement = inlineSuggestion.getSingleTextEdit();\n\t\t\tconst mode = this._inlineSuggestMode.read(reader);\n\t\t\tconst positions = this._positions.read(reader);\n\t\t\tconst allPotentialEdits = [replacement, ...getSecondaryEdits(this.textModel, positions, replacement)];\n\t\t\tconst validEditsAndGhostTexts = allPotentialEdits\n\t\t\t\t.map((edit, idx) => ({ edit, ghostText: edit ? computeGhostText(edit, model, mode, positions[idx], 0) : undefined }))\n\t\t\t\t.filter(({ edit, ghostText }) => edit !== undefined && ghostText !== undefined);\n\t\t\tconst edits = validEditsAndGhostTexts.map(({ edit }) => edit!);\n\t\t\tconst ghostTexts = validEditsAndGhostTexts.map(({ ghostText }) => ghostText!);\n\t\t\tif (!ghostTexts[0]) { return undefined; }\n\t\t\treturn { kind: 'ghostText', edits, primaryGhostText: ghostTexts[0], ghostTexts, inlineSuggestion, suggestItem: undefined };\n\t\t}\n\t});\n\n\tpublic readonly inlineCompletionState = derived(this, reader => {\n\t\tconst s = this.state.read(reader);\n\t\tif (!s || s.kind !== 'ghostText') {\n\t\t\treturn undefined;\n\t\t}\n\t\tif (this._editorObs.inComposition.read(reader)) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn s;\n\t});\n\n\tpublic readonly inlineEditState = derived(this, reader => {\n\t\tconst s = this.state.read(reader);\n\t\tif (!s || s.kind !== 'inlineEdit') {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn s;\n\t});\n\n\tpublic readonly inlineEditAvailable = derived(this, reader => {\n\t\tconst s = this.inlineEditState.read(reader);\n\t\treturn !!s;\n\t});\n\n\tprivate _computeAugmentation(suggestCompletion: TextReplacement, reader: IReader | undefined) {\n\t\tconst model = this.textModel;\n\t\tconst suggestWidgetInlineCompletions = this._source.suggestWidgetInlineCompletions.read(reader);\n\t\tconst candidateInlineCompletions = suggestWidgetInlineCompletions\n\t\t\t? suggestWidgetInlineCompletions.inlineCompletions.filter(c => !c.isInlineEdit)\n\t\t\t: [this.selectedInlineCompletion.read(reader)].filter(isDefined);\n\n\t\tconst augmentedCompletion = mapFindFirst(candidateInlineCompletions, completion => {\n\t\t\tlet r = completion.getSingleTextEdit();\n\t\t\tr = singleTextRemoveCommonPrefix(\n\t\t\t\tr,\n\t\t\t\tmodel,\n\t\t\t\tRange.fromPositions(r.range.getStartPosition(), suggestCompletion.range.getEndPosition())\n\t\t\t);\n\t\t\treturn singleTextEditAugments(r, suggestCompletion) ? { completion, edit: r } : undefined;\n\t\t});\n\n\t\treturn augmentedCompletion;\n\t}\n\n\tpublic readonly warning = derived(this, reader => {\n\t\treturn this.inlineCompletionState.read(reader)?.inlineSuggestion?.warning;\n\t});\n\n\tpublic readonly ghostTexts = derivedOpts({ owner: this, equalsFn: ghostTextsOrReplacementsEqual }, reader => {\n\t\tconst v = this.inlineCompletionState.read(reader);\n\t\tif (!v) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn v.ghostTexts;\n\t});\n\n\tpublic readonly primaryGhostText = derivedOpts({ owner: this, equalsFn: ghostTextOrReplacementEquals }, reader => {\n\t\tconst v = this.inlineCompletionState.read(reader);\n\t\tif (!v) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn v?.primaryGhostText;\n\t});\n\n\tpublic readonly showCollapsed = derived<boolean>(this, reader => {\n\t\tconst state = this.state.read(reader);\n\t\tif (!state || state.kind !== 'inlineEdit') {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (state.inlineSuggestion.hint || state.inlineSuggestion.action?.kind === 'jumpTo') {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst isCurrentModelVersion = state.inlineSuggestion.updatedEditModelVersion === this._textModelVersionId.read(reader);\n\t\treturn (this._inlineEditsShowCollapsedEnabled.read(reader) || !isCurrentModelVersion)\n\t\t\t&& this._jumpedToId.read(reader) !== state.inlineSuggestion.semanticId\n\t\t\t&& !this._inAcceptFlow.read(reader);\n\t});\n\n\tprivate readonly _tabShouldIndent = derived(this, reader => {\n\t\tif (this._inAcceptFlow.read(reader)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction isMultiLine(range: Range): boolean {\n\t\t\treturn range.startLineNumber !== range.endLineNumber;\n\t\t}\n\n\t\tfunction getNonIndentationRange(model: ITextModel, lineNumber: number): Range {\n\t\t\tconst columnStart = model.getLineIndentColumn(lineNumber);\n\t\t\tconst lastNonWsColumn = model.getLineLastNonWhitespaceColumn(lineNumber);\n\t\t\tconst columnEnd = Math.max(lastNonWsColumn, columnStart);\n\t\t\treturn new Range(lineNumber, columnStart, lineNumber, columnEnd);\n\t\t}\n\n\t\tconst selections = this._editorObs.selections.read(reader);\n\t\treturn selections?.some(s => {\n\t\t\tif (s.isEmpty()) {\n\t\t\t\treturn this.textModel.getLineLength(s.startLineNumber) === 0;\n\t\t\t} else {\n\t\t\t\treturn isMultiLine(s) || s.containsRange(getNonIndentationRange(this.textModel, s.startLineNumber));\n\t\t\t}\n\t\t});\n\t});\n\n\tpublic readonly tabShouldJumpToInlineEdit = derived(this, reader => {\n\t\tif (this._tabShouldIndent.read(reader)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst s = this.inlineEditState.read(reader);\n\t\tif (!s) {\n\t\t\treturn false;\n\t\t}\n\n\n\t\tif (s.inlineSuggestion.action?.kind === 'jumpTo') {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (this.showCollapsed.read(reader)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (this._inAcceptFlow.read(reader) && this._appearedInsideViewport.read(reader)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn !s.cursorAtInlineEdit.read(reader);\n\t});\n\n\tpublic readonly tabShouldAcceptInlineEdit = derived(this, reader => {\n\t\tconst s = this.inlineEditState.read(reader);\n\t\tif (!s) {\n\t\t\treturn false;\n\t\t}\n\t\tif (s.inlineSuggestion.action?.kind === 'jumpTo') {\n\t\t\treturn false;\n\t\t}\n\t\tif (this.showCollapsed.read(reader)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this._tabShouldIndent.read(reader)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this._inAcceptFlow.read(reader) && this._appearedInsideViewport.read(reader)) {\n\t\t\treturn true;\n\t\t}\n\t\tif (s.inlineSuggestion.targetRange.startLineNumber === this._editorObs.cursorLineNumber.read(reader)) {\n\t\t\treturn true;\n\t\t}\n\t\tif (this._jumpedToId.read(reader) === s.inlineSuggestion.semanticId) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn s.cursorAtInlineEdit.read(reader);\n\t});\n\n\tpublic readonly isInDiffEditor;\n\n\tpublic readonly editorType: InlineCompletionEditorType;\n\n\tprivate async _deltaSelectedInlineCompletionIndex(delta: 1 | -1): Promise<void> {\n\t\tawait this.triggerExplicitly();\n\n\t\tconst completions = this._filteredInlineCompletionItems.get() || [];\n\t\tif (completions.length > 0) {\n\t\t\tconst newIdx = (this.selectedInlineCompletionIndex.get() + delta + completions.length) % completions.length;\n\t\t\tthis._selectedInlineCompletionId.set(completions[newIdx].semanticId, undefined);\n\t\t} else {\n\t\t\tthis._selectedInlineCompletionId.set(undefined, undefined);\n\t\t}\n\t}\n\n\tpublic async next(): Promise<void> { await this._deltaSelectedInlineCompletionIndex(1); }\n\n\tpublic async previous(): Promise<void> { await this._deltaSelectedInlineCompletionIndex(-1); }\n\n\tprivate _getMetadata(completion: InlineSuggestionItem, languageId: string, type: 'word' | 'line' | undefined = undefined): TextModelEditSource {\n\t\tif (type) {\n\t\t\treturn EditSources.inlineCompletionPartialAccept({\n\t\t\t\tnes: completion.isInlineEdit,\n\t\t\t\trequestUuid: completion.requestUuid,\n\t\t\t\tproviderId: completion.source.provider.providerId,\n\t\t\t\tlanguageId,\n\t\t\t\ttype,\n\t\t\t\tcorrelationId: completion.getSourceCompletion().correlationId,\n\t\t\t});\n\t\t} else {\n\t\t\treturn EditSources.inlineCompletionAccept({\n\t\t\t\tnes: completion.isInlineEdit,\n\t\t\t\trequestUuid: completion.requestUuid,\n\t\t\t\tcorrelationId: completion.getSourceCompletion().correlationId,\n\t\t\t\tproviderId: completion.source.provider.providerId,\n\t\t\t\tlanguageId\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic async accept(editor: ICodeEditor = this._editor, alternativeAction: boolean = false): Promise<void> {\n\t\tif (editor.getModel() !== this.textModel) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\n\t\tlet completion: InlineSuggestionItem;\n\t\tlet isNextEditUri = false;\n\t\tconst state = this.state.get();\n\t\tif (state?.kind === 'ghostText') {\n\t\t\tif (!state || state.primaryGhostText.isEmpty() || !state.inlineSuggestion) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcompletion = state.inlineSuggestion;\n\t\t} else if (state?.kind === 'inlineEdit') {\n\t\t\tcompletion = state.inlineSuggestion;\n\t\t\tisNextEditUri = !!state.nextEditUri;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure the completion list will not be disposed before the text change is sent.\n\t\tcompletion.addRef();\n\n\t\ttry {\n\t\t\tlet followUpTrigger = false;\n\t\t\teditor.pushUndoStop();\n\t\t\tif (isNextEditUri) {\n\t\t\t\t// Do nothing\n\t\t\t} else if (completion.action?.kind === 'edit') {\n\t\t\t\tconst action = completion.action;\n\t\t\t\tif (alternativeAction && action.alternativeAction) {\n\t\t\t\t\tfollowUpTrigger = true;\n\t\t\t\t\tconst altCommand = action.alternativeAction.command;\n\t\t\t\t\tawait this._commandService\n\t\t\t\t\t\t.executeCommand(altCommand.id, ...(altCommand.arguments || []))\n\t\t\t\t\t\t.then(undefined, onUnexpectedExternalError);\n\t\t\t\t} else if (action.snippetInfo) {\n\t\t\t\t\tconst mainEdit = TextReplacement.delete(action.textReplacement.range);\n\t\t\t\t\tconst additionalEdits = completion.additionalTextEdits.map(e => new TextReplacement(Range.lift(e.range), e.text ?? ''));\n\t\t\t\t\tconst edit = TextEdit.fromParallelReplacementsUnsorted([mainEdit, ...additionalEdits]);\n\t\t\t\t\teditor.edit(edit, this._getMetadata(completion, this.textModel.getLanguageId()));\n\n\t\t\t\t\teditor.setPosition(action.snippetInfo.range.getStartPosition(), 'inlineCompletionAccept');\n\t\t\t\t\tSnippetController2.get(editor)?.insert(action.snippetInfo.snippet, { undoStopBefore: false });\n\t\t\t\t} else {\n\t\t\t\t\tconst edits = state.edits;\n\n\t\t\t\t\t// The cursor should move to the end of the edit, not the end of the range provided by the extension\n\t\t\t\t\t// Inline Edit diffs (human readable) the suggestion from the extension so it already removes common suffix/prefix\n\t\t\t\t\t// Inline Completions does diff the suggestion so it may contain common suffix\n\t\t\t\t\tlet minimalEdits = edits;\n\t\t\t\t\tif (state.kind === 'ghostText') {\n\t\t\t\t\t\tminimalEdits = removeTextReplacementCommonSuffixPrefix(edits, this.textModel);\n\t\t\t\t\t}\n\t\t\t\t\tconst selections = getEndPositionsAfterApplying(minimalEdits).map(p => Selection.fromPositions(p));\n\n\t\t\t\t\tconst additionalEdits = completion.additionalTextEdits.map(e => new TextReplacement(Range.lift(e.range), e.text ?? ''));\n\t\t\t\t\tconst edit = TextEdit.fromParallelReplacementsUnsorted([...edits, ...additionalEdits]);\n\n\t\t\t\t\teditor.edit(edit, this._getMetadata(completion, this.textModel.getLanguageId()));\n\n\t\t\t\t\tif (completion.hint === undefined) {\n\t\t\t\t\t\t// do not move the cursor when the completion is displayed in a different location\n\t\t\t\t\t\teditor.setSelections(state.kind === 'inlineEdit' ? selections.slice(-1) : selections, 'inlineCompletionAccept');\n\t\t\t\t\t}\n\n\t\t\t\t\tif (state.kind === 'inlineEdit' && !this._accessibilityService.isMotionReduced()) {\n\t\t\t\t\t\tconst editRanges = edit.getNewRanges();\n\t\t\t\t\t\tconst dec = this._store.add(new FadeoutDecoration(editor, editRanges, () => {\n\t\t\t\t\t\t\tthis._store.delete(dec);\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._onDidAccept.fire();\n\n\t\t\t// Reset before invoking the command, as the command might cause a follow up trigger (which we don't want to reset).\n\t\t\tthis.stop();\n\n\t\t\tif (completion.command) {\n\t\t\t\tawait this._commandService\n\t\t\t\t\t.executeCommand(completion.command.id, ...(completion.command.arguments || []))\n\t\t\t\t\t.then(undefined, onUnexpectedExternalError);\n\t\t\t}\n\n\t\t\t// TODO: how can we make alternative actions to retrigger?\n\t\t\tif (followUpTrigger) {\n\t\t\t\tthis.trigger(undefined);\n\t\t\t}\n\n\t\t\tcompletion.reportEndOfLife({ kind: InlineCompletionEndOfLifeReasonKind.Accepted, alternativeAction });\n\t\t} finally {\n\t\t\tcompletion.removeRef();\n\t\t\tthis._inAcceptFlow.set(true, undefined);\n\t\t\tthis._lastAcceptedInlineCompletionInfo = { textModelVersionIdAfter: this.textModel.getVersionId(), inlineCompletion: completion };\n\t\t}\n\t}\n\n\tpublic async acceptNextWord(): Promise<void> {\n\t\tawait this._acceptNext(this._editor, 'word', (pos, text) => {\n\t\t\tconst langId = this.textModel.getLanguageIdAtPosition(pos.lineNumber, pos.column);\n\t\t\tconst config = this._languageConfigurationService.getLanguageConfiguration(langId);\n\t\t\tconst wordRegExp = new RegExp(config.wordDefinition.source, config.wordDefinition.flags.replace('g', ''));\n\n\t\t\tconst m1 = text.match(wordRegExp);\n\t\t\tlet acceptUntilIndexExclusive = 0;\n\t\t\tif (m1 && m1.index !== undefined) {\n\t\t\t\tif (m1.index === 0) {\n\t\t\t\t\tacceptUntilIndexExclusive = m1[0].length;\n\t\t\t\t} else {\n\t\t\t\t\tacceptUntilIndexExclusive = m1.index;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tacceptUntilIndexExclusive = text.length;\n\t\t\t}\n\n\t\t\tconst wsRegExp = /\\s+/g;\n\t\t\tconst m2 = wsRegExp.exec(text);\n\t\t\tif (m2 && m2.index !== undefined) {\n\t\t\t\tif (m2.index + m2[0].length < acceptUntilIndexExclusive) {\n\t\t\t\t\tacceptUntilIndexExclusive = m2.index + m2[0].length;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acceptUntilIndexExclusive;\n\t\t}, PartialAcceptTriggerKind.Word);\n\t}\n\n\tpublic async acceptNextLine(): Promise<void> {\n\t\tawait this._acceptNext(this._editor, 'line', (pos, text) => {\n\t\t\tconst m = text.match(/\\n/);\n\t\t\tif (m && m.index !== undefined) {\n\t\t\t\treturn m.index + 1;\n\t\t\t}\n\t\t\treturn text.length;\n\t\t}, PartialAcceptTriggerKind.Line);\n\t}\n\n\tprivate async _acceptNext(editor: ICodeEditor, type: 'word' | 'line', getAcceptUntilIndex: (position: Position, text: string) => number, kind: PartialAcceptTriggerKind): Promise<void> {\n\t\tif (editor.getModel() !== this.textModel) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\n\t\tconst state = this.inlineCompletionState.get();\n\t\tif (!state || state.primaryGhostText.isEmpty() || !state.inlineSuggestion) {\n\t\t\treturn;\n\t\t}\n\t\tconst ghostText = state.primaryGhostText;\n\t\tconst completion = state.inlineSuggestion;\n\n\t\tif (completion.snippetInfo) {\n\t\t\t// not in WYSIWYG mode, partial commit might change completion, thus it is not supported\n\t\t\tawait this.accept(editor);\n\t\t\treturn;\n\t\t}\n\n\t\tconst firstPart = ghostText.parts[0];\n\t\tconst ghostTextPos = new Position(ghostText.lineNumber, firstPart.column);\n\t\tconst ghostTextVal = firstPart.text;\n\t\tconst acceptUntilIndexExclusive = getAcceptUntilIndex(ghostTextPos, ghostTextVal);\n\t\tif (acceptUntilIndexExclusive === ghostTextVal.length && ghostText.parts.length === 1) {\n\t\t\tthis.accept(editor);\n\t\t\treturn;\n\t\t}\n\t\tconst partialGhostTextVal = ghostTextVal.substring(0, acceptUntilIndexExclusive);\n\n\t\tconst positions = this._positions.get();\n\t\tconst cursorPosition = positions[0];\n\n\t\t// Executing the edit might free the completion, so we have to hold a reference on it.\n\t\tcompletion.addRef();\n\t\ttry {\n\t\t\tthis._isAcceptingPartially = true;\n\t\t\ttry {\n\t\t\t\teditor.pushUndoStop();\n\t\t\t\tconst replaceRange = Range.fromPositions(cursorPosition, ghostTextPos);\n\t\t\t\tconst newText = editor.getModel()!.getValueInRange(replaceRange) + partialGhostTextVal;\n\t\t\t\tconst primaryEdit = new TextReplacement(replaceRange, newText);\n\t\t\t\tconst edits = [primaryEdit, ...getSecondaryEdits(this.textModel, positions, primaryEdit)].filter(isDefined);\n\t\t\t\tconst selections = getEndPositionsAfterApplying(edits).map(p => Selection.fromPositions(p));\n\n\t\t\t\teditor.edit(TextEdit.fromParallelReplacementsUnsorted(edits), this._getMetadata(completion, type));\n\t\t\t\teditor.setSelections(selections, 'inlineCompletionPartialAccept');\n\t\t\t\teditor.revealPositionInCenterIfOutsideViewport(editor.getPosition()!, ScrollType.Smooth);\n\t\t\t} finally {\n\t\t\t\tthis._isAcceptingPartially = false;\n\t\t\t}\n\n\t\t\tconst acceptedRange = Range.fromPositions(completion.editRange.getStartPosition(), TextLength.ofText(partialGhostTextVal).addToPosition(ghostTextPos));\n\t\t\t// This assumes that the inline completion and the model use the same EOL style.\n\t\t\tconst text = editor.getModel()!.getValueInRange(acceptedRange, EndOfLinePreference.LF);\n\t\t\tconst acceptedLength = text.length;\n\t\t\tcompletion.reportPartialAccept(\n\t\t\t\tacceptedLength,\n\t\t\t\t{ kind, acceptedLength: acceptedLength },\n\t\t\t\t{ characters: acceptUntilIndexExclusive, ratio: acceptUntilIndexExclusive / ghostTextVal.length, count: 1 }\n\t\t\t);\n\n\t\t} finally {\n\t\t\tcompletion.removeRef();\n\t\t}\n\t}\n\n\tpublic handleSuggestAccepted(item: SuggestItemInfo) {\n\t\tconst itemEdit = singleTextRemoveCommonPrefix(item.getSingleTextEdit(), this.textModel);\n\t\tconst augmentedCompletion = this._computeAugmentation(itemEdit, undefined);\n\t\tif (!augmentedCompletion) { return; }\n\n\t\t// This assumes that the inline completion and the model use the same EOL style.\n\t\tconst alreadyAcceptedLength = this.textModel.getValueInRange(augmentedCompletion.completion.editRange, EndOfLinePreference.LF).length;\n\t\tconst acceptedLength = alreadyAcceptedLength + itemEdit.text.length;\n\n\t\taugmentedCompletion.completion.reportPartialAccept(itemEdit.text.length, {\n\t\t\tkind: PartialAcceptTriggerKind.Suggest,\n\t\t\tacceptedLength,\n\t\t}, {\n\t\t\tcharacters: itemEdit.text.length,\n\t\t\tcount: 1,\n\t\t\tratio: 1\n\t\t});\n\t}\n\n\tpublic extractReproSample(): Repro {\n\t\tconst value = this.textModel.getValue();\n\t\tconst item = this.state.get()?.inlineSuggestion;\n\t\treturn {\n\t\t\tdocumentValue: value,\n\t\t\tinlineCompletion: item?.getSourceCompletion(),\n\t\t};\n\t}\n\n\tprivate readonly _jumpedToId = observableValue<undefined | string>(this, undefined);\n\tprivate readonly _inAcceptFlow = observableValue(this, false);\n\tpublic readonly inAcceptFlow: IObservable<boolean> = this._inAcceptFlow;\n\n\tpublic jump(): void {\n\t\tconst s = this.inlineEditState.get();\n\t\tif (!s) { return; }\n\n\t\tconst suggestion = s.inlineSuggestion;\n\t\tsuggestion.addRef();\n\t\ttry {\n\t\t\ttransaction(tx => {\n\t\t\t\tif (suggestion.action?.kind === 'jumpTo') {\n\t\t\t\t\tthis.stop(undefined, tx);\n\t\t\t\t\tsuggestion.reportEndOfLife({ kind: InlineCompletionEndOfLifeReasonKind.Accepted, alternativeAction: false });\n\t\t\t\t}\n\n\t\t\t\tthis._jumpedToId.set(s.inlineSuggestion.semanticId, tx);\n\t\t\t\tthis.dontRefetchSignal.trigger(tx);\n\t\t\t\tconst targetRange = s.inlineSuggestion.targetRange;\n\t\t\t\tconst targetPosition = targetRange.getStartPosition();\n\t\t\t\tthis._editor.setPosition(targetPosition, 'inlineCompletions.jump');\n\n\t\t\t\t// TODO: consider using view information to reveal it\n\t\t\t\tconst isSingleLineChange = targetRange.isSingleLine() && (s.inlineSuggestion.hint || (s.inlineSuggestion.action?.kind === 'edit' && !s.inlineSuggestion.action.textReplacement.text.includes('\\n')));\n\t\t\t\tif (isSingleLineChange || s.inlineSuggestion.action?.kind === 'jumpTo') {\n\t\t\t\t\tthis._editor.revealPosition(targetPosition, ScrollType.Smooth);\n\t\t\t\t} else {\n\t\t\t\t\tconst revealRange = new Range(targetRange.startLineNumber - 1, 1, targetRange.endLineNumber + 1, 1);\n\t\t\t\t\tthis._editor.revealRange(revealRange, ScrollType.Smooth);\n\t\t\t\t}\n\n\t\t\t\ts.inlineSuggestion.identity.setJumpTo(tx);\n\n\t\t\t\tthis._editor.focus();\n\t\t\t});\n\t\t} finally {\n\t\t\tsuggestion.removeRef();\n\t\t}\n\t}\n\n\tpublic async handleInlineSuggestionShown(inlineCompletion: InlineSuggestionItem, viewKind: InlineCompletionViewKind, viewData: InlineCompletionViewData, timeWhenShown: number): Promise<void> {\n\t\tawait inlineCompletion.reportInlineEditShown(this._commandService, viewKind, viewData, this.textModel, timeWhenShown);\n\t}\n}\n\ninterface Repro {\n\tdocumentValue: string;\n\tinlineCompletion: InlineCompletion | undefined;\n}\n\nexport enum VersionIdChangeReason {\n\tUndo,\n\tRedo,\n\tAcceptWord,\n\tOther,\n}\n\nexport function getSecondaryEdits(textModel: ITextModel, positions: readonly Position[], primaryTextRepl: TextReplacement): (TextReplacement | undefined)[] {\n\tif (positions.length === 1) {\n\t\t// No secondary cursor positions\n\t\treturn [];\n\t}\n\tconst text = new TextModelText(textModel);\n\tconst textTransformer = text.getTransformer();\n\tconst primaryOffset = textTransformer.getOffset(positions[0]);\n\tconst secondaryOffsets = positions.slice(1).map(pos => textTransformer.getOffset(pos));\n\n\tprimaryTextRepl = primaryTextRepl.removeCommonPrefixAndSuffix(text);\n\tconst primaryStringRepl = textTransformer.getStringReplacement(primaryTextRepl);\n\n\tconst deltaFromOffsetToRangeStart = primaryStringRepl.replaceRange.start - primaryOffset;\n\tconst primaryContextRange = primaryStringRepl.replaceRange.join(OffsetRange.emptyAt(primaryOffset));\n\tconst primaryContextValue = text.getValueOfOffsetRange(primaryContextRange);\n\n\tconst replacements = secondaryOffsets.map(secondaryOffset => {\n\t\tconst newRangeStart = secondaryOffset + deltaFromOffsetToRangeStart;\n\t\tconst newRangeEnd = newRangeStart + primaryStringRepl.replaceRange.length;\n\t\tconst range = new OffsetRange(newRangeStart, newRangeEnd);\n\n\t\tconst contextRange = range.join(OffsetRange.emptyAt(secondaryOffset));\n\t\tconst contextValue = text.getValueOfOffsetRange(contextRange);\n\t\tif (contextValue !== primaryContextValue) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst stringRepl = new StringReplacement(range, primaryStringRepl.newText);\n\t\tconst repl = textTransformer.getTextReplacement(stringRepl);\n\t\treturn repl;\n\t}).filter(isDefined);\n\n\treturn replacements;\n}\n\nclass FadeoutDecoration extends Disposable {\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tranges: Range[],\n\t\tonDispose?: () => void,\n\t) {\n\t\tsuper();\n\n\t\tif (onDispose) {\n\t\t\tthis._register({ dispose: () => onDispose() });\n\t\t}\n\n\t\tthis._register(observableCodeEditor(editor).setDecorations(constObservable(ranges.map<IModelDeltaDecoration>(range => ({\n\t\t\trange: range,\n\t\t\toptions: {\n\t\t\t\tdescription: 'animation',\n\t\t\t\tclassName: 'edits-fadeout-decoration',\n\t\t\t\tzIndex: 1,\n\t\t\t}\n\t\t})))));\n\n\t\tconst animation = new AnimatedValue(1, 0, 1000, easeOutCubic);\n\t\tconst val = new ObservableAnimatedValue(animation);\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst opacity = val.getValue(reader);\n\t\t\teditor.getContainerDomNode().style.setProperty('--animation-opacity', opacity.toString());\n\t\t\tif (animation.isFinished()) {\n\t\t\t\tthis.dispose();\n\t\t\t}\n\t\t}));\n\t}\n}\n\nexport function isSuggestionInViewport(editor: ICodeEditor, suggestion: InlineSuggestionItem, reader: IReader | undefined = undefined): boolean {\n\tconst targetRange = suggestion.targetRange;\n\n\t// TODO make getVisibleRanges reactive!\n\tobservableCodeEditor(editor).scrollTop.read(reader);\n\tconst visibleRanges = editor.getVisibleRanges();\n\n\tif (visibleRanges.length < 1) {\n\t\treturn false;\n\t}\n\n\tconst viewportRange = new Range(\n\t\tvisibleRanges[0].startLineNumber,\n\t\tvisibleRanges[0].startColumn,\n\t\tvisibleRanges[visibleRanges.length - 1].endLineNumber,\n\t\tvisibleRanges[visibleRanges.length - 1].endColumn\n\t);\n\treturn viewportRange.containsRange(targetRange);\n}\n\nfunction skuFromAccount(account: IDefaultAccount | null): InlineSuggestSku | undefined {\n\tif (account?.access_type_sku && account?.copilot_plan) {\n\t\treturn { type: account.access_type_sku, plan: account.copilot_plan };\n\t}\n\treturn undefined;\n}\n\nclass DisposableCallback<T> {\n\tprivate _cb: ((e: T) => void) | undefined;\n\n\tconstructor(cb: (e: T) => void) {\n\t\tthis._cb = cb;\n\t}\n\n\tdispose(): void {\n\t\tthis._cb = undefined;\n\t}\n\n\treadonly handler = (val: T) => {\n\t\treturn this._cb?.(val);\n\t};\n}\n\nfunction createDisposableCb<T>(cb: (e: T) => void, store: DisposableStore): (e: T) => void {\n\tconst dcb = new DisposableCallback(cb);\n\tstore.add(dcb);\n\treturn dcb.handler;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts","vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACrG,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAmB,MAAM,y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:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { mapFindFirst } from '../../../../../base/common/arraysFind.js';\nimport { arrayEqualsC } from '../../../../../base/common/equals.js';\nimport { BugIndicatingError, onUnexpectedExternalError } from '../../../../../base/common/errors.js';\nimport { Emitter } from '../../../../../base/common/event.js';\nimport { Disposable, DisposableStore } from '../../../../../base/common/lifecycle.js';\nimport { IObservable, IObservableWithChange, IReader, ITransaction, autorun, constObservable, derived, derivedHandleChanges, derivedOpts, mapObservableArrayCached, observableFromEvent, observableSignal, observableValue, recomputeInitiallyAndOnChange, subtransaction, transaction } from '../../../../../base/common/observable.js';\nimport { firstNonWhitespaceIndex } from '../../../../../base/common/strings.js';\nimport { isDefined } from '../../../../../base/common/types.js';\nimport { IAccessibilityService } from '../../../../../platform/accessibility/common/accessibility.js';\nimport { ICommandService } from '../../../../../platform/commands/common/commands.js';\nimport { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';\nimport { ICodeEditor } from '../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../browser/observableCodeEditor.js';\nimport { EditorOption } from '../../../../common/config/editorOptions.js';\nimport { CursorColumns } from '../../../../common/core/cursorColumns.js';\nimport { LineRange } from '../../../../common/core/ranges/lineRange.js';\nimport { Position } from '../../../../common/core/position.js';\nimport { Range } from '../../../../common/core/range.js';\nimport { Selection } from '../../../../common/core/selection.js';\nimport { TextReplacement, TextEdit } from '../../../../common/core/edits/textEdit.js';\nimport { TextLength } from '../../../../common/core/text/textLength.js';\nimport { ScrollType } from '../../../../common/editorCommon.js';\nimport { InlineCompletionEndOfLifeReasonKind, InlineCompletion, InlineCompletionTriggerKind, PartialAcceptTriggerKind, InlineCompletionsProvider, InlineCompletionCommand } from '../../../../common/languages.js';\nimport { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js';\nimport { EndOfLinePreference, IModelDeltaDecoration, ITextModel } from '../../../../common/model.js';\nimport { TextModelText } from '../../../../common/model/textModelText.js';\nimport { IFeatureDebounceInformation } from '../../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js';\nimport { IModelContentChangedEvent } from '../../../../common/textModelEvents.js';\nimport { SnippetController2 } from '../../../snippet/browser/snippetController2.js';\nimport { getEndPositionsAfterApplying, removeTextReplacementCommonSuffixPrefix } from '../utils.js';\nimport { AnimatedValue, easeOutCubic, ObservableAnimatedValue } from './animation.js';\nimport { computeGhostText } from './computeGhostText.js';\nimport { GhostText, GhostTextOrReplacement, ghostTextOrReplacementEquals, ghostTextsOrReplacementsEqual } from './ghostText.js';\nimport { InlineCompletionsSource } from './inlineCompletionsSource.js';\nimport { InlineCompletionItem, InlineEditItem, InlineSuggestionItem } from './inlineSuggestionItem.js';\nimport { InlineCompletionContextWithoutUuid, InlineCompletionEditorType, InlineSuggestRequestInfo, InlineSuggestSku } from './provideInlineCompletions.js';\nimport { singleTextEditAugments, singleTextRemoveCommonPrefix } from './singleTextEditHelpers.js';\nimport { SuggestItemInfo } from './suggestWidgetAdapter.js';\nimport { TextModelEditSource, EditSources } from '../../../../common/textModelEditSource.js';\nimport { ICodeEditorService } from '../../../../browser/services/codeEditorService.js';\nimport { InlineCompletionViewData, InlineCompletionViewKind } from '../view/inlineEdits/inlineEditsViewInterface.js';\nimport { IInlineCompletionsService } from '../../../../browser/services/inlineCompletionsService.js';\nimport { TypingInterval } from './typingSpeed.js';\nimport { StringReplacement } from '../../../../common/core/edits/stringEdit.js';\nimport { OffsetRange } from '../../../../common/core/ranges/offsetRange.js';\nimport { URI } from '../../../../../base/common/uri.js';\nimport { IDefaultAccountService } from '../../../../../platform/defaultAccount/common/defaultAccount.js';\nimport { IDefaultAccount } from '../../../../../base/common/defaultAccount.js';\nimport { Schemas } from '../../../../../base/common/network.js';\n\nexport class InlineCompletionsModel extends Disposable {\n\tprivate readonly _source;\n\tprivate readonly _isActive = observableValue<boolean>(this, false);\n\tprivate readonly _onlyRequestInlineEditsSignal = observableSignal(this);\n\tprivate readonly _forceUpdateExplicitlySignal = observableSignal(this);\n\tprivate readonly _noDelaySignal = observableSignal(this);\n\n\tprivate readonly _fetchSpecificProviderSignal = observableSignal<InlineCompletionsProvider | undefined>(this);\n\n\t// We use a semantic id to keep the same inline completion selected even if the provider reorders the completions.\n\tprivate readonly _selectedInlineCompletionId = observableValue<string | undefined>(this, undefined);\n\tpublic readonly primaryPosition = derived(this, reader => this._positions.read(reader)[0] ?? new Position(1, 1));\n\tpublic readonly allPositions = derived(this, reader => this._positions.read(reader));\n\n\tprivate readonly sku = observableValue<InlineSuggestSku | undefined>(this, undefined);\n\n\tprivate _isAcceptingPartially = false;\n\tprivate readonly _appearedInsideViewport = derived<boolean>(this, reader => {\n\t\tconst state = this.state.read(reader);\n\t\tif (!state || !state.inlineSuggestion) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn isSuggestionInViewport(this._editor, state.inlineSuggestion);\n\t});\n\tpublic get isAcceptingPartially() { return this._isAcceptingPartially; }\n\n\tprivate readonly _onDidAccept = new Emitter<void>();\n\tpublic readonly onDidAccept = this._onDidAccept.event;\n\n\tprivate readonly _editorObs;\n\n\tprivate readonly _typing: TypingInterval;\n\n\tprivate readonly _suggestPreviewEnabled;\n\tprivate readonly _suggestPreviewMode;\n\tprivate readonly _inlineSuggestMode;\n\tprivate readonly _suppressedInlineCompletionGroupIds;\n\tprivate readonly _inlineEditsEnabled;\n\tprivate readonly _inlineEditsShowCollapsedEnabled;\n\tprivate readonly _triggerCommandOnProviderChange;\n\tprivate readonly _minShowDelay;\n\tprivate readonly _showOnSuggestConflict;\n\tprivate readonly _suppressInSnippetMode;\n\tprivate readonly _isInSnippetMode;\n\n\tget editor() {\n\t\treturn this._editor;\n\t}\n\n\tconstructor(\n\t\tpublic readonly textModel: ITextModel,\n\t\tprivate readonly _selectedSuggestItem: IObservable<SuggestItemInfo | undefined>,\n\t\tpublic readonly _textModelVersionId: IObservableWithChange<number | null, IModelContentChangedEvent | undefined>,\n\t\tprivate readonly _positions: IObservable<readonly Position[]>,\n\t\tprivate readonly _debounceValue: IFeatureDebounceInformation,\n\t\tprivate readonly _enabled: IObservable<boolean>,\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ICodeEditorService private readonly _codeEditorService: ICodeEditorService,\n\t\t@IInlineCompletionsService private readonly _inlineCompletionsService: IInlineCompletionsService,\n\t\t@IDefaultAccountService defaultAccountService: IDefaultAccountService,\n\t) {\n\t\tsuper();\n\t\tthis._source = this._register(this._instantiationService.createInstance(InlineCompletionsSource, this.textModel, this._textModelVersionId, this._debounceValue, this.primaryPosition));\n\t\tthis.lastTriggerKind = this._source.inlineCompletions.map(this, v => v?.request?.context.triggerKind);\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tconst suggest = this._editorObs.getOption(EditorOption.suggest);\n\t\tthis._suggestPreviewEnabled = suggest.map(v => v.preview);\n\t\tthis._suggestPreviewMode = suggest.map(v => v.previewMode);\n\n\t\tconst inlineSuggest = this._editorObs.getOption(EditorOption.inlineSuggest);\n\t\tthis._inlineSuggestMode = inlineSuggest.map(v => v.mode);\n\t\tthis._suppressedInlineCompletionGroupIds = inlineSuggest.map(v => new Set(v.experimental.suppressInlineSuggestions.split(',')));\n\t\tthis._inlineEditsEnabled = inlineSuggest.map(v => !!v.edits.enabled);\n\t\tthis._inlineEditsShowCollapsedEnabled = inlineSuggest.map(s => s.edits.showCollapsed);\n\t\tthis._triggerCommandOnProviderChange = inlineSuggest.map(s => s.triggerCommandOnProviderChange);\n\t\tthis._minShowDelay = inlineSuggest.map(s => s.minShowDelay);\n\t\tthis._showOnSuggestConflict = inlineSuggest.map(s => s.experimental.showOnSuggestConflict);\n\t\tthis._suppressInSnippetMode = inlineSuggest.map(s => s.suppressInSnippetMode);\n\n\t\tconst snippetController = SnippetController2.get(this._editor);\n\t\tthis._isInSnippetMode = snippetController?.isInSnippetObservable ?? constObservable(false);\n\n\t\tdefaultAccountService.getDefaultAccount().then(createDisposableCb(account => this.sku.set(skuFromAccount(account), undefined), this._store));\n\t\tthis._register(defaultAccountService.onDidChangeDefaultAccount(account => this.sku.set(skuFromAccount(account), undefined)));\n\n\t\tthis._typing = this._register(new TypingInterval(this.textModel));\n\n\t\tthis._register(this._inlineCompletionsService.onDidChangeIsSnoozing((isSnoozing) => {\n\t\t\tif (isSnoozing) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t}));\n\n\t\t{ // Determine editor type\n\t\t\tconst isNotebook = this.textModel.uri.scheme === Schemas.vscodeNotebookCell;\n\t\t\tconst [diffEditor] = this._codeEditorService.listDiffEditors()\n\t\t\t\t.filter(d =>\n\t\t\t\t\td.getOriginalEditor().getId() === this._editor.getId() ||\n\t\t\t\t\td.getModifiedEditor().getId() === this._editor.getId());\n\n\t\t\tthis.isInDiffEditor = !!diffEditor;\n\t\t\tthis.editorType = isNotebook ? InlineCompletionEditorType.Notebook\n\t\t\t\t: this.isInDiffEditor ? InlineCompletionEditorType.DiffEditor\n\t\t\t\t\t: InlineCompletionEditorType.TextEditor;\n\t\t}\n\n\t\tthis._register(recomputeInitiallyAndOnChange(this.state, (s) => {\n\t\t\tif (s && s.inlineSuggestion) {\n\t\t\t\tthis._inlineCompletionsService.reportNewCompletion(s.inlineSuggestion.requestUuid);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(recomputeInitiallyAndOnChange(this._fetchInlineCompletionsPromise));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tthis._editorObs.versionId.read(reader);\n\t\t\tthis._inAcceptFlow.set(false, undefined);\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst jumpToReset = this.state.map((s, reader) => !s || s.kind === 'inlineEdit' && !s.cursorAtInlineEdit.read(reader)).read(reader);\n\t\t\tif (jumpToReset) {\n\t\t\t\tthis._jumpedToId.set(undefined, undefined);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst inlineSuggestion = this.state.map(s => s?.inlineSuggestion).read(reader);\n\t\t\tif (inlineSuggestion) {\n\t\t\t\tinlineSuggestion.addPerformanceMarker('activeSuggestion');\n\t\t\t}\n\t\t}));\n\n\t\tconst inlineEditSemanticId = this.inlineEditState.map(s => s?.inlineSuggestion.semanticId);\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst id = inlineEditSemanticId.read(reader);\n\t\t\tif (id) {\n\t\t\t\tthis._editor.pushUndoStop();\n\t\t\t\tthis._lastShownInlineCompletionInfo = {\n\t\t\t\t\talternateTextModelVersionId: this.textModel.getAlternativeVersionId(),\n\t\t\t\t\tinlineCompletion: this.state.get()!.inlineSuggestion!,\n\t\t\t\t};\n\t\t\t}\n\t\t}));\n\n\t\t// TODO: should use getAvailableProviders and update on _suppressedInlineCompletionGroupIds change\n\t\tconst inlineCompletionProviders = observableFromEvent(this._languageFeaturesService.inlineCompletionsProvider.onDidChange, () => this._languageFeaturesService.inlineCompletionsProvider.all(textModel));\n\t\tmapObservableArrayCached(this, inlineCompletionProviders, (provider, store) => {\n\t\t\tif (!provider.onDidChangeInlineCompletions) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tstore.add(provider.onDidChangeInlineCompletions(() => {\n\t\t\t\tif (!this._enabled.get()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Only update the active editor\n\t\t\t\tconst activeEditor = this._codeEditorService.getFocusedCodeEditor() || this._codeEditorService.getActiveCodeEditor();\n\t\t\t\tif (activeEditor !== this._editor) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (this._triggerCommandOnProviderChange.get()) {\n\t\t\t\t\t// TODO@hediet remove this and always do the else branch.\n\t\t\t\t\tthis.trigger(undefined, { onlyFetchInlineEdits: true });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\n\t\t\t\t// If there is an active suggestion from a different provider, we ignore the update\n\t\t\t\tconst activeState = this.state.get();\n\t\t\t\tif (activeState && (activeState.inlineSuggestion || activeState.edits) && activeState.inlineSuggestion?.source.provider !== provider) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\ttransaction(tx => {\n\t\t\t\t\tthis._fetchSpecificProviderSignal.trigger(tx, provider);\n\t\t\t\t\tthis.trigger(tx);\n\t\t\t\t});\n\n\t\t\t}));\n\t\t}).recomputeInitiallyAndOnChange(this._store);\n\n\t\tthis._didUndoInlineEdits.recomputeInitiallyAndOnChange(this._store);\n\t}\n\n\tprivate _lastShownInlineCompletionInfo: { alternateTextModelVersionId: number; /* already freed! */ inlineCompletion: InlineSuggestionItem } | undefined = undefined;\n\tprivate _lastAcceptedInlineCompletionInfo: { textModelVersionIdAfter: number; /* already freed! */ inlineCompletion: InlineSuggestionItem } | undefined = undefined;\n\tprivate readonly _didUndoInlineEdits = derivedHandleChanges({\n\t\towner: this,\n\t\tchangeTracker: {\n\t\t\tcreateChangeSummary: () => ({ didUndo: false }),\n\t\t\thandleChange: (ctx, changeSummary) => {\n\t\t\t\tchangeSummary.didUndo = ctx.didChange(this._textModelVersionId) && !!ctx.change?.isUndoing;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}, (reader, changeSummary) => {\n\t\tconst versionId = this._textModelVersionId.read(reader);\n\t\tif (versionId !== null\n\t\t\t&& this._lastAcceptedInlineCompletionInfo\n\t\t\t&& this._lastAcceptedInlineCompletionInfo.textModelVersionIdAfter === versionId - 1\n\t\t\t&& this._lastAcceptedInlineCompletionInfo.inlineCompletion.isInlineEdit\n\t\t\t&& changeSummary.didUndo\n\t\t) {\n\t\t\tthis._lastAcceptedInlineCompletionInfo = undefined;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t});\n\n\tpublic getIndentationInfo(reader: IReader) {\n\t\tlet startsWithIndentation = false;\n\t\tlet startsWithIndentationLessThanTabSize = true;\n\t\tconst ghostText = this?.primaryGhostText.read(reader);\n\t\tif (!!this?._selectedSuggestItem && ghostText && ghostText.parts.length > 0) {\n\t\t\tconst { column, lines } = ghostText.parts[0];\n\n\t\t\tconst firstLine = lines[0].line;\n\n\t\t\tconst indentationEndColumn = this.textModel.getLineIndentColumn(ghostText.lineNumber);\n\t\t\tconst inIndentation = column <= indentationEndColumn;\n\n\t\t\tif (inIndentation) {\n\t\t\t\tlet firstNonWsIdx = firstNonWhitespaceIndex(firstLine);\n\t\t\t\tif (firstNonWsIdx === -1) {\n\t\t\t\t\tfirstNonWsIdx = firstLine.length - 1;\n\t\t\t\t}\n\t\t\t\tstartsWithIndentation = firstNonWsIdx > 0;\n\n\t\t\t\tconst tabSize = this.textModel.getOptions().tabSize;\n\t\t\t\tconst visibleColumnIndentation = CursorColumns.visibleColumnFromColumn(firstLine, firstNonWsIdx + 1, tabSize);\n\t\t\t\tstartsWithIndentationLessThanTabSize = visibleColumnIndentation < tabSize;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tstartsWithIndentation,\n\t\t\tstartsWithIndentationLessThanTabSize,\n\t\t};\n\t}\n\n\tprivate readonly _preserveCurrentCompletionReasons = new Set([\n\t\tVersionIdChangeReason.Redo,\n\t\tVersionIdChangeReason.Undo,\n\t\tVersionIdChangeReason.AcceptWord,\n\t]);\n\n\tprivate _getReason(e: IModelContentChangedEvent | undefined): VersionIdChangeReason {\n\t\tif (e?.isUndoing) { return VersionIdChangeReason.Undo; }\n\t\tif (e?.isRedoing) { return VersionIdChangeReason.Redo; }\n\t\tif (this.isAcceptingPartially) { return VersionIdChangeReason.AcceptWord; }\n\t\treturn VersionIdChangeReason.Other;\n\t}\n\n\tpublic readonly dontRefetchSignal = observableSignal(this);\n\n\tprivate readonly _fetchInlineCompletionsPromise = derivedHandleChanges({\n\t\towner: this,\n\t\tchangeTracker: {\n\t\t\tcreateChangeSummary: () => ({\n\t\t\t\tdontRefetch: false,\n\t\t\t\tpreserveCurrentCompletion: false,\n\t\t\t\tinlineCompletionTriggerKind: InlineCompletionTriggerKind.Automatic,\n\t\t\t\tonlyRequestInlineEdits: false,\n\t\t\t\tshouldDebounce: true,\n\t\t\t\tprovider: undefined as InlineCompletionsProvider | undefined,\n\t\t\t\ttextChange: false,\n\t\t\t\tchangeReason: '',\n\t\t\t}),\n\t\t\thandleChange: (ctx, changeSummary) => {\n\t\t\t\t/** @description fetch inline completions */\n\t\t\t\tif (ctx.didChange(this._textModelVersionId)) {\n\t\t\t\t\tif (this._preserveCurrentCompletionReasons.has(this._getReason(ctx.change))) {\n\t\t\t\t\t\tchangeSummary.preserveCurrentCompletion = true;\n\t\t\t\t\t}\n\t\t\t\t\tconst detailedReasons = ctx.change?.detailedReasons ?? [];\n\t\t\t\t\tchangeSummary.changeReason = detailedReasons.length > 0 ? detailedReasons[0].getType() : '';\n\t\t\t\t\tchangeSummary.textChange = true;\n\t\t\t\t} else if (ctx.didChange(this._forceUpdateExplicitlySignal)) {\n\t\t\t\t\tchangeSummary.preserveCurrentCompletion = true;\n\t\t\t\t\tchangeSummary.inlineCompletionTriggerKind = InlineCompletionTriggerKind.Explicit;\n\t\t\t\t} else if (ctx.didChange(this.dontRefetchSignal)) {\n\t\t\t\t\tchangeSummary.dontRefetch = true;\n\t\t\t\t} else if (ctx.didChange(this._onlyRequestInlineEditsSignal)) {\n\t\t\t\t\tchangeSummary.onlyRequestInlineEdits = true;\n\t\t\t\t} else if (ctx.didChange(this._fetchSpecificProviderSignal)) {\n\t\t\t\t\tchangeSummary.provider = ctx.change;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t},\n\t\t},\n\t}, (reader, changeSummary) => {\n\t\tthis._source.clearOperationOnTextModelChange.read(reader); // Make sure the clear operation runs before the fetch operation\n\t\tthis._noDelaySignal.read(reader);\n\t\tthis.dontRefetchSignal.read(reader);\n\t\tthis._onlyRequestInlineEditsSignal.read(reader);\n\t\tthis._forceUpdateExplicitlySignal.read(reader);\n\t\tthis._fetchSpecificProviderSignal.read(reader);\n\t\tconst shouldUpdate = ((this._enabled.read(reader) && this._selectedSuggestItem.read(reader)) || this._isActive.read(reader))\n\t\t\t&& (!this._inlineCompletionsService.isSnoozing() || changeSummary.inlineCompletionTriggerKind === InlineCompletionTriggerKind.Explicit);\n\t\tif (!shouldUpdate) {\n\t\t\tthis._source.cancelUpdate();\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthis._textModelVersionId.read(reader); // Refetch on text change\n\n\t\tconst suggestWidgetInlineCompletions = this._source.suggestWidgetInlineCompletions.read(undefined);\n\t\tlet suggestItem = this._selectedSuggestItem.read(reader);\n\t\tif (this._shouldShowOnSuggestConflict.read(undefined)) {\n\t\t\tsuggestItem = undefined;\n\t\t}\n\t\tif (suggestWidgetInlineCompletions && !suggestItem) {\n\t\t\tthis._source.seedInlineCompletionsWithSuggestWidget();\n\t\t}\n\n\t\tif (changeSummary.dontRefetch) {\n\t\t\treturn Promise.resolve(true);\n\t\t}\n\n\t\tif (this._didUndoInlineEdits.read(reader) && changeSummary.inlineCompletionTriggerKind !== InlineCompletionTriggerKind.Explicit) {\n\t\t\ttransaction(tx => {\n\t\t\t\tthis._source.clear(tx);\n\t\t\t});\n\t\t\treturn undefined;\n\t\t}\n\n\t\tlet reason: string = '';\n\t\tif (changeSummary.provider) {\n\t\t\treason += 'providerOnDidChange';\n\t\t} else if (changeSummary.inlineCompletionTriggerKind === InlineCompletionTriggerKind.Explicit) {\n\t\t\treason += 'explicit';\n\t\t}\n\t\tif (changeSummary.changeReason) {\n\t\t\treason += reason.length > 0 ? `:${changeSummary.changeReason}` : changeSummary.changeReason;\n\t\t}\n\n\t\tconst typingInterval = this._typing.getTypingInterval();\n\t\tconst requestInfo: InlineSuggestRequestInfo = {\n\t\t\teditorType: this.editorType,\n\t\t\tstartTime: Date.now(),\n\t\t\tlanguageId: this.textModel.getLanguageId(),\n\t\t\treason,\n\t\t\ttypingInterval: typingInterval.averageInterval,\n\t\t\ttypingIntervalCharacterCount: typingInterval.characterCount,\n\t\t\tavailableProviders: [],\n\t\t\tsku: this.sku.read(undefined),\n\t\t};\n\n\t\tlet context: InlineCompletionContextWithoutUuid = {\n\t\t\ttriggerKind: changeSummary.inlineCompletionTriggerKind,\n\t\t\tselectedSuggestionInfo: suggestItem?.toSelectedSuggestionInfo(),\n\t\t\tincludeInlineCompletions: !changeSummary.onlyRequestInlineEdits,\n\t\t\tincludeInlineEdits: this._inlineEditsEnabled.read(reader),\n\t\t\trequestIssuedDateTime: requestInfo.startTime,\n\t\t\tearliestShownDateTime: requestInfo.startTime + (changeSummary.inlineCompletionTriggerKind === InlineCompletionTriggerKind.Explicit || this.inAcceptFlow.read(undefined) ? 0 : this._minShowDelay.read(undefined)),\n\t\t};\n\n\t\tif (context.triggerKind === InlineCompletionTriggerKind.Automatic && changeSummary.textChange) {\n\t\t\tif (this.textModel.getAlternativeVersionId() === this._lastShownInlineCompletionInfo?.alternateTextModelVersionId) {\n\t\t\t\t// When undoing back to a version where an inline edit/completion was shown,\n\t\t\t\t// we want to show an inline edit (or completion) again if it was originally an inline edit (or completion).\n\t\t\t\tcontext = {\n\t\t\t\t\t...context,\n\t\t\t\t\tincludeInlineCompletions: !this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit,\n\t\t\t\t\tincludeInlineEdits: this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tconst itemToPreserveCandidate = this.selectedInlineCompletion.read(undefined) ?? this._inlineCompletionItems.read(undefined)?.inlineEdit;\n\t\tconst itemToPreserve = changeSummary.preserveCurrentCompletion || itemToPreserveCandidate?.forwardStable\n\t\t\t? itemToPreserveCandidate : undefined;\n\t\tconst userJumpedToActiveCompletion = this._jumpedToId.map(jumpedTo => !!jumpedTo && jumpedTo === this._inlineCompletionItems.read(undefined)?.inlineEdit?.semanticId);\n\n\t\tconst providers = changeSummary.provider\n\t\t\t? { providers: [changeSummary.provider], label: 'single:' + changeSummary.provider.providerId?.toString() }\n\t\t\t: { providers: this._languageFeaturesService.inlineCompletionsProvider.all(this.textModel), label: undefined }; // TODO: should use inlineCompletionProviders\n\t\tconst availableProviders = this.getAvailableProviders(providers.providers);\n\t\trequestInfo.availableProviders = availableProviders.map(p => p.providerId).filter(isDefined);\n\n\t\treturn this._source.fetch(availableProviders, providers.label, context, itemToPreserve?.identity, changeSummary.shouldDebounce, userJumpedToActiveCompletion, requestInfo);\n\t});\n\n\t// TODO: This is not an ideal implementation of excludesGroupIds, however as this is currently still behind proposed API\n\t// and due to the time constraints, we are using a simplified approach\n\tprivate getAvailableProviders(providers: InlineCompletionsProvider[]): InlineCompletionsProvider[] {\n\t\tconst suppressedProviderGroupIds = this._suppressedInlineCompletionGroupIds.get();\n\t\tconst unsuppressedProviders = providers.filter(provider => !(provider.groupId && suppressedProviderGroupIds.has(provider.groupId)));\n\n\t\tconst excludedGroupIds = new Set<string>();\n\t\tfor (const provider of unsuppressedProviders) {\n\t\t\tprovider.excludesGroupIds?.forEach(p => excludedGroupIds.add(p));\n\t\t}\n\n\t\tconst availableProviders: InlineCompletionsProvider[] = [];\n\t\tfor (const provider of unsuppressedProviders) {\n\t\t\tif (provider.groupId && excludedGroupIds.has(provider.groupId)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tavailableProviders.push(provider);\n\t\t}\n\n\t\treturn availableProviders;\n\t}\n\n\tpublic async trigger(tx?: ITransaction, options: { onlyFetchInlineEdits?: boolean; noDelay?: boolean; provider?: InlineCompletionsProvider; explicit?: boolean } = {}): Promise<void> {\n\t\tsubtransaction(tx, tx => {\n\t\t\tif (options.onlyFetchInlineEdits) {\n\t\t\t\tthis._onlyRequestInlineEditsSignal.trigger(tx);\n\t\t\t}\n\t\t\tif (options.noDelay) {\n\t\t\t\tthis._noDelaySignal.trigger(tx);\n\t\t\t}\n\t\t\tthis._isActive.set(true, tx);\n\n\t\t\tif (options.explicit) {\n\t\t\t\tthis._inAcceptFlow.set(true, tx);\n\t\t\t\tthis._forceUpdateExplicitlySignal.trigger(tx);\n\t\t\t}\n\t\t\tif (options.provider) {\n\t\t\t\tthis._fetchSpecificProviderSignal.trigger(tx, options.provider);\n\t\t\t}\n\t\t});\n\t\tawait this._fetchInlineCompletionsPromise.get();\n\t}\n\n\tpublic async triggerExplicitly(tx?: ITransaction, onlyFetchInlineEdits: boolean = false): Promise<void> {\n\t\treturn this.trigger(tx, { onlyFetchInlineEdits, explicit: true });\n\t}\n\n\tpublic stop(stopReason: 'explicitCancel' | 'automatic' = 'automatic', tx?: ITransaction): void {\n\t\tsubtransaction(tx, tx => {\n\t\t\tif (stopReason === 'explicitCancel') {\n\t\t\t\tconst inlineCompletion = this.state.get()?.inlineSuggestion;\n\t\t\t\tif (inlineCompletion) {\n\t\t\t\t\tinlineCompletion.reportEndOfLife({ kind: InlineCompletionEndOfLifeReasonKind.Rejected });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._isActive.set(false, tx);\n\t\t\tthis._source.clear(tx);\n\t\t});\n\t}\n\n\tprivate readonly _inlineCompletionItems = derivedOpts({ owner: this }, reader => {\n\t\tconst c = this._source.inlineCompletions.read(reader);\n\t\tif (!c) { return undefined; }\n\t\tconst cursorPosition = this.primaryPosition.read(reader);\n\t\tlet inlineEdit: InlineEditItem | undefined = undefined;\n\t\tconst visibleCompletions: InlineCompletionItem[] = [];\n\t\tfor (const completion of c.inlineCompletions) {\n\t\t\tif (!completion.isInlineEdit) {\n\t\t\t\tif (completion.isVisible(this.textModel, cursorPosition)) {\n\t\t\t\t\tvisibleCompletions.push(completion);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tinlineEdit = completion;\n\t\t\t}\n\t\t}\n\n\t\tif (visibleCompletions.length !== 0) {\n\t\t\t// Don't show the inline edit if there is a visible completion\n\t\t\tinlineEdit = undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tinlineCompletions: visibleCompletions,\n\t\t\tinlineEdit,\n\t\t};\n\t});\n\n\tprivate readonly _filteredInlineCompletionItems = derivedOpts({ owner: this, equalsFn: arrayEqualsC() }, reader => {\n\t\tconst c = this._inlineCompletionItems.read(reader);\n\t\treturn c?.inlineCompletions ?? [];\n\t});\n\n\tpublic readonly selectedInlineCompletionIndex = derived<number>(this, (reader) => {\n\t\tconst selectedInlineCompletionId = this._selectedInlineCompletionId.read(reader);\n\t\tconst filteredCompletions = this._filteredInlineCompletionItems.read(reader);\n\t\tconst idx = this._selectedInlineCompletionId === undefined ? -1\n\t\t\t: filteredCompletions.findIndex(v => v.semanticId === selectedInlineCompletionId);\n\t\tif (idx === -1) {\n\t\t\t// Reset the selection so that the selection does not jump back when it appears again\n\t\t\tthis._selectedInlineCompletionId.set(undefined, undefined);\n\t\t\treturn 0;\n\t\t}\n\t\treturn idx;\n\t});\n\n\tpublic readonly selectedInlineCompletion = derived<InlineCompletionItem | undefined>(this, (reader) => {\n\t\tconst filteredCompletions = this._filteredInlineCompletionItems.read(reader);\n\t\tconst idx = this.selectedInlineCompletionIndex.read(reader);\n\t\treturn filteredCompletions[idx];\n\t});\n\n\tpublic readonly activeCommands = derivedOpts<InlineCompletionCommand[]>({ owner: this, equalsFn: arrayEqualsC() },\n\t\tr => this.selectedInlineCompletion.read(r)?.source.inlineSuggestions.commands ?? []\n\t);\n\n\tpublic readonly lastTriggerKind: IObservable<InlineCompletionTriggerKind | undefined>;\n\n\tpublic readonly inlineCompletionsCount = derived<number | undefined>(this, reader => {\n\t\tif (this.lastTriggerKind.read(reader) === InlineCompletionTriggerKind.Explicit) {\n\t\t\treturn this._filteredInlineCompletionItems.read(reader).length;\n\t\t} else {\n\t\t\treturn undefined;\n\t\t}\n\t});\n\n\tprivate readonly _hasVisiblePeekWidgets = derived(this, reader => this._editorObs.openedPeekWidgets.read(reader) > 0);\n\n\tprivate readonly _shouldShowOnSuggestConflict = derived(this, reader => {\n\t\tconst showOnSuggestConflict = this._showOnSuggestConflict.read(reader);\n\t\tif (showOnSuggestConflict !== 'never') {\n\t\t\tconst hasInlineCompletion = !!this.selectedInlineCompletion.read(reader);\n\t\t\tif (hasInlineCompletion) {\n\t\t\t\tconst item = this._selectedSuggestItem.read(reader);\n\t\t\t\tif (!item) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (showOnSuggestConflict === 'whenSuggestListIsIncomplete') {\n\t\t\t\t\treturn item.listIncomplete;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t});\n\n\tpublic readonly state = derivedOpts<{\n\t\tkind: 'ghostText';\n\t\tedits: readonly TextReplacement[];\n\t\tprimaryGhostText: GhostTextOrReplacement;\n\t\tghostTexts: readonly GhostTextOrReplacement[];\n\t\tsuggestItem: SuggestItemInfo | undefined;\n\t\tinlineSuggestion: InlineCompletionItem | undefined;\n\t} | {\n\t\tkind: 'inlineEdit';\n\t\tedits: readonly TextReplacement[];\n\t\tinlineSuggestion: InlineEditItem;\n\t\tcursorAtInlineEdit: IObservable<boolean>;\n\t\tnextEditUri: URI | undefined;\n\t} | undefined>({\n\t\towner: this,\n\t\tequalsFn: (a, b) => {\n\t\t\tif (!a || !b) { return a === b; }\n\n\t\t\tif (a.kind === 'ghostText' && b.kind === 'ghostText') {\n\t\t\t\treturn ghostTextsOrReplacementsEqual(a.ghostTexts, b.ghostTexts)\n\t\t\t\t\t&& a.inlineSuggestion === b.inlineSuggestion\n\t\t\t\t\t&& a.suggestItem === b.suggestItem;\n\t\t\t} else if (a.kind === 'inlineEdit' && b.kind === 'inlineEdit') {\n\t\t\t\treturn a.inlineSuggestion === b.inlineSuggestion;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}, (reader) => {\n\t\tconst model = this.textModel;\n\n\t\tif (this._suppressInSnippetMode.read(reader) && this._isInSnippetMode.read(reader)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst item = this._inlineCompletionItems.read(reader);\n\t\tconst inlineEditResult = item?.inlineEdit;\n\t\tif (inlineEditResult) {\n\t\t\tif (this._hasVisiblePeekWidgets.read(reader)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst cursorAtInlineEdit = this.primaryPosition.map(cursorPos => LineRange.fromRangeInclusive(inlineEditResult.targetRange).addMargin(1, 1).contains(cursorPos.lineNumber));\n\t\t\tconst stringEdit = inlineEditResult.action?.kind === 'edit' ? inlineEditResult.action.stringEdit : undefined;\n\t\t\tconst replacements = stringEdit ? TextEdit.fromStringEdit(stringEdit, new TextModelText(this.textModel)).replacements : [];\n\n\t\t\tconst nextEditUri = (item.inlineEdit?.command?.id === 'vscode.open' || item.inlineEdit?.command?.id === '_workbench.open') &&\n\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\titem.inlineEdit?.command.arguments?.length ? URI.from(<any>item.inlineEdit?.command.arguments[0]) : undefined;\n\t\t\treturn { kind: 'inlineEdit', inlineSuggestion: inlineEditResult, edits: replacements, cursorAtInlineEdit, nextEditUri };\n\t\t}\n\n\t\tconst suggestItem = this._selectedSuggestItem.read(reader);\n\t\tif (!this._shouldShowOnSuggestConflict.read(reader) && suggestItem) {\n\t\t\tconst suggestCompletionEdit = singleTextRemoveCommonPrefix(suggestItem.getSingleTextEdit(), model);\n\t\t\tconst augmentation = this._computeAugmentation(suggestCompletionEdit, reader);\n\n\t\t\tconst isSuggestionPreviewEnabled = this._suggestPreviewEnabled.read(reader);\n\t\t\tif (!isSuggestionPreviewEnabled && !augmentation) { return undefined; }\n\n\t\t\tconst fullEdit = augmentation?.edit ?? suggestCompletionEdit;\n\t\t\tconst fullEditPreviewLength = augmentation ? augmentation.edit.text.length - suggestCompletionEdit.text.length : 0;\n\n\t\t\tconst mode = this._suggestPreviewMode.read(reader);\n\t\t\tconst positions = this._positions.read(reader);\n\t\t\tconst allPotentialEdits = [fullEdit, ...getSecondaryEdits(this.textModel, positions, fullEdit)];\n\t\t\tconst validEditsAndGhostTexts = allPotentialEdits\n\t\t\t\t.map((edit, idx) => ({ edit, ghostText: edit ? computeGhostText(edit, model, mode, positions[idx], fullEditPreviewLength) : undefined }))\n\t\t\t\t.filter(({ edit, ghostText }) => edit !== undefined && ghostText !== undefined);\n\t\t\tconst edits = validEditsAndGhostTexts.map(({ edit }) => edit!);\n\t\t\tconst ghostTexts = validEditsAndGhostTexts.map(({ ghostText }) => ghostText!);\n\t\t\tconst primaryGhostText = ghostTexts[0] ?? new GhostText(fullEdit.range.endLineNumber, []);\n\t\t\treturn { kind: 'ghostText', edits, primaryGhostText, ghostTexts, inlineSuggestion: augmentation?.completion, suggestItem };\n\t\t} else {\n\t\t\tif (!this._isActive.read(reader)) { return undefined; }\n\t\t\tconst inlineSuggestion = this.selectedInlineCompletion.read(reader);\n\t\t\tif (!inlineSuggestion) { return undefined; }\n\n\t\t\tconst replacement = inlineSuggestion.getSingleTextEdit();\n\t\t\tconst mode = this._inlineSuggestMode.read(reader);\n\t\t\tconst positions = this._positions.read(reader);\n\t\t\tconst allPotentialEdits = [replacement, ...getSecondaryEdits(this.textModel, positions, replacement)];\n\t\t\tconst validEditsAndGhostTexts = allPotentialEdits\n\t\t\t\t.map((edit, idx) => ({ edit, ghostText: edit ? computeGhostText(edit, model, mode, positions[idx], 0) : undefined }))\n\t\t\t\t.filter(({ edit, ghostText }) => edit !== undefined && ghostText !== undefined);\n\t\t\tconst edits = validEditsAndGhostTexts.map(({ edit }) => edit!);\n\t\t\tconst ghostTexts = validEditsAndGhostTexts.map(({ ghostText }) => ghostText!);\n\t\t\tif (!ghostTexts[0]) { return undefined; }\n\t\t\treturn { kind: 'ghostText', edits, primaryGhostText: ghostTexts[0], ghostTexts, inlineSuggestion, suggestItem: undefined };\n\t\t}\n\t});\n\n\tpublic readonly inlineCompletionState = derived(this, reader => {\n\t\tconst s = this.state.read(reader);\n\t\tif (!s || s.kind !== 'ghostText') {\n\t\t\treturn undefined;\n\t\t}\n\t\tif (this._editorObs.inComposition.read(reader)) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn s;\n\t});\n\n\tpublic readonly inlineEditState = derived(this, reader => {\n\t\tconst s = this.state.read(reader);\n\t\tif (!s || s.kind !== 'inlineEdit') {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn s;\n\t});\n\n\tpublic readonly inlineEditAvailable = derived(this, reader => {\n\t\tconst s = this.inlineEditState.read(reader);\n\t\treturn !!s;\n\t});\n\n\tprivate _computeAugmentation(suggestCompletion: TextReplacement, reader: IReader | undefined) {\n\t\tconst model = this.textModel;\n\t\tconst suggestWidgetInlineCompletions = this._source.suggestWidgetInlineCompletions.read(reader);\n\t\tconst candidateInlineCompletions = suggestWidgetInlineCompletions\n\t\t\t? suggestWidgetInlineCompletions.inlineCompletions.filter(c => !c.isInlineEdit)\n\t\t\t: [this.selectedInlineCompletion.read(reader)].filter(isDefined);\n\n\t\tconst augmentedCompletion = mapFindFirst(candidateInlineCompletions, completion => {\n\t\t\tlet r = completion.getSingleTextEdit();\n\t\t\tr = singleTextRemoveCommonPrefix(\n\t\t\t\tr,\n\t\t\t\tmodel,\n\t\t\t\tRange.fromPositions(r.range.getStartPosition(), suggestCompletion.range.getEndPosition())\n\t\t\t);\n\t\t\treturn singleTextEditAugments(r, suggestCompletion) ? { completion, edit: r } : undefined;\n\t\t});\n\n\t\treturn augmentedCompletion;\n\t}\n\n\tpublic readonly warning = derived(this, reader => {\n\t\treturn this.inlineCompletionState.read(reader)?.inlineSuggestion?.warning;\n\t});\n\n\tpublic readonly ghostTexts = derivedOpts({ owner: this, equalsFn: ghostTextsOrReplacementsEqual }, reader => {\n\t\tconst v = this.inlineCompletionState.read(reader);\n\t\tif (!v) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn v.ghostTexts;\n\t});\n\n\tpublic readonly primaryGhostText = derivedOpts({ owner: this, equalsFn: ghostTextOrReplacementEquals }, reader => {\n\t\tconst v = this.inlineCompletionState.read(reader);\n\t\tif (!v) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn v?.primaryGhostText;\n\t});\n\n\tpublic readonly showCollapsed = derived<boolean>(this, reader => {\n\t\tconst state = this.state.read(reader);\n\t\tif (!state || state.kind !== 'inlineEdit') {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (state.inlineSuggestion.hint || state.inlineSuggestion.action?.kind === 'jumpTo') {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst isCurrentModelVersion = state.inlineSuggestion.updatedEditModelVersion === this._textModelVersionId.read(reader);\n\t\treturn (this._inlineEditsShowCollapsedEnabled.read(reader) || !isCurrentModelVersion)\n\t\t\t&& this._jumpedToId.read(reader) !== state.inlineSuggestion.semanticId\n\t\t\t&& !this._inAcceptFlow.read(reader);\n\t});\n\n\tprivate readonly _tabShouldIndent = derived(this, reader => {\n\t\tif (this._inAcceptFlow.read(reader)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction isMultiLine(range: Range): boolean {\n\t\t\treturn range.startLineNumber !== range.endLineNumber;\n\t\t}\n\n\t\tfunction getNonIndentationRange(model: ITextModel, lineNumber: number): Range {\n\t\t\tconst columnStart = model.getLineIndentColumn(lineNumber);\n\t\t\tconst lastNonWsColumn = model.getLineLastNonWhitespaceColumn(lineNumber);\n\t\t\tconst columnEnd = Math.max(lastNonWsColumn, columnStart);\n\t\t\treturn new Range(lineNumber, columnStart, lineNumber, columnEnd);\n\t\t}\n\n\t\tconst selections = this._editorObs.selections.read(reader);\n\t\treturn selections?.some(s => {\n\t\t\tif (s.isEmpty()) {\n\t\t\t\treturn this.textModel.getLineLength(s.startLineNumber) === 0;\n\t\t\t} else {\n\t\t\t\treturn isMultiLine(s) || s.containsRange(getNonIndentationRange(this.textModel, s.startLineNumber));\n\t\t\t}\n\t\t});\n\t});\n\n\tpublic readonly tabShouldJumpToInlineEdit = derived(this, reader => {\n\t\tif (this._tabShouldIndent.read(reader)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst s = this.inlineEditState.read(reader);\n\t\tif (!s) {\n\t\t\treturn false;\n\t\t}\n\n\n\t\tif (s.inlineSuggestion.action?.kind === 'jumpTo') {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (this.showCollapsed.read(reader)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (this._inAcceptFlow.read(reader) && this._appearedInsideViewport.read(reader)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn !s.cursorAtInlineEdit.read(reader);\n\t});\n\n\tpublic readonly tabShouldAcceptInlineEdit = derived(this, reader => {\n\t\tconst s = this.inlineEditState.read(reader);\n\t\tif (!s) {\n\t\t\treturn false;\n\t\t}\n\t\tif (s.inlineSuggestion.action?.kind === 'jumpTo') {\n\t\t\treturn false;\n\t\t}\n\t\tif (this.showCollapsed.read(reader)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this._tabShouldIndent.read(reader)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this._inAcceptFlow.read(reader) && this._appearedInsideViewport.read(reader)) {\n\t\t\treturn true;\n\t\t}\n\t\tif (s.inlineSuggestion.targetRange.startLineNumber === this._editorObs.cursorLineNumber.read(reader)) {\n\t\t\treturn true;\n\t\t}\n\t\tif (this._jumpedToId.read(reader) === s.inlineSuggestion.semanticId) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn s.cursorAtInlineEdit.read(reader);\n\t});\n\n\tpublic readonly isInDiffEditor;\n\n\tpublic readonly editorType: InlineCompletionEditorType;\n\n\tprivate async _deltaSelectedInlineCompletionIndex(delta: 1 | -1): Promise<void> {\n\t\tawait this.triggerExplicitly();\n\n\t\tconst completions = this._filteredInlineCompletionItems.get() || [];\n\t\tif (completions.length > 0) {\n\t\t\tconst newIdx = (this.selectedInlineCompletionIndex.get() + delta + completions.length) % completions.length;\n\t\t\tthis._selectedInlineCompletionId.set(completions[newIdx].semanticId, undefined);\n\t\t} else {\n\t\t\tthis._selectedInlineCompletionId.set(undefined, undefined);\n\t\t}\n\t}\n\n\tpublic async next(): Promise<void> { await this._deltaSelectedInlineCompletionIndex(1); }\n\n\tpublic async previous(): Promise<void> { await this._deltaSelectedInlineCompletionIndex(-1); }\n\n\tprivate _getMetadata(completion: InlineSuggestionItem, languageId: string, type: 'word' | 'line' | undefined = undefined): TextModelEditSource {\n\t\tif (type) {\n\t\t\treturn EditSources.inlineCompletionPartialAccept({\n\t\t\t\tnes: completion.isInlineEdit,\n\t\t\t\trequestUuid: completion.requestUuid,\n\t\t\t\tproviderId: completion.source.provider.providerId,\n\t\t\t\tlanguageId,\n\t\t\t\ttype,\n\t\t\t\tcorrelationId: completion.getSourceCompletion().correlationId,\n\t\t\t});\n\t\t} else {\n\t\t\treturn EditSources.inlineCompletionAccept({\n\t\t\t\tnes: completion.isInlineEdit,\n\t\t\t\trequestUuid: completion.requestUuid,\n\t\t\t\tcorrelationId: completion.getSourceCompletion().correlationId,\n\t\t\t\tproviderId: completion.source.provider.providerId,\n\t\t\t\tlanguageId\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic async accept(editor: ICodeEditor = this._editor, alternativeAction: boolean = false): Promise<void> {\n\t\tif (editor.getModel() !== this.textModel) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\n\t\tlet completion: InlineSuggestionItem;\n\t\tlet isNextEditUri = false;\n\t\tconst state = this.state.get();\n\t\tif (state?.kind === 'ghostText') {\n\t\t\tif (!state || state.primaryGhostText.isEmpty() || !state.inlineSuggestion) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcompletion = state.inlineSuggestion;\n\t\t} else if (state?.kind === 'inlineEdit') {\n\t\t\tcompletion = state.inlineSuggestion;\n\t\t\tisNextEditUri = !!state.nextEditUri;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure the completion list will not be disposed before the text change is sent.\n\t\tcompletion.addRef();\n\n\t\ttry {\n\t\t\tlet followUpTrigger = false;\n\t\t\teditor.pushUndoStop();\n\t\t\tif (isNextEditUri) {\n\t\t\t\t// Do nothing\n\t\t\t} else if (completion.action?.kind === 'edit') {\n\t\t\t\tconst action = completion.action;\n\t\t\t\tif (alternativeAction && action.alternativeAction) {\n\t\t\t\t\tfollowUpTrigger = true;\n\t\t\t\t\tconst altCommand = action.alternativeAction.command;\n\t\t\t\t\tawait this._commandService\n\t\t\t\t\t\t.executeCommand(altCommand.id, ...(altCommand.arguments || []))\n\t\t\t\t\t\t.then(undefined, onUnexpectedExternalError);\n\t\t\t\t} else if (action.snippetInfo) {\n\t\t\t\t\tconst mainEdit = TextReplacement.delete(action.textReplacement.range);\n\t\t\t\t\tconst additionalEdits = completion.additionalTextEdits.map(e => new TextReplacement(Range.lift(e.range), e.text ?? ''));\n\t\t\t\t\tconst edit = TextEdit.fromParallelReplacementsUnsorted([mainEdit, ...additionalEdits]);\n\t\t\t\t\teditor.edit(edit, this._getMetadata(completion, this.textModel.getLanguageId()));\n\n\t\t\t\t\teditor.setPosition(action.snippetInfo.range.getStartPosition(), 'inlineCompletionAccept');\n\t\t\t\t\tSnippetController2.get(editor)?.insert(action.snippetInfo.snippet, { undoStopBefore: false });\n\t\t\t\t} else {\n\t\t\t\t\tconst edits = state.edits;\n\n\t\t\t\t\t// The cursor should move to the end of the edit, not the end of the range provided by the extension\n\t\t\t\t\t// Inline Edit diffs (human readable) the suggestion from the extension so it already removes common suffix/prefix\n\t\t\t\t\t// Inline Completions does diff the suggestion so it may contain common suffix\n\t\t\t\t\tlet minimalEdits = edits;\n\t\t\t\t\tif (state.kind === 'ghostText') {\n\t\t\t\t\t\tminimalEdits = removeTextReplacementCommonSuffixPrefix(edits, this.textModel);\n\t\t\t\t\t}\n\t\t\t\t\tconst selections = getEndPositionsAfterApplying(minimalEdits).map(p => Selection.fromPositions(p));\n\n\t\t\t\t\tconst additionalEdits = completion.additionalTextEdits.map(e => new TextReplacement(Range.lift(e.range), e.text ?? ''));\n\t\t\t\t\tconst edit = TextEdit.fromParallelReplacementsUnsorted([...edits, ...additionalEdits]);\n\n\t\t\t\t\teditor.edit(edit, this._getMetadata(completion, this.textModel.getLanguageId()));\n\n\t\t\t\t\tif (completion.hint === undefined) {\n\t\t\t\t\t\t// do not move the cursor when the completion is displayed in a different location\n\t\t\t\t\t\teditor.setSelections(state.kind === 'inlineEdit' ? selections.slice(-1) : selections, 'inlineCompletionAccept');\n\t\t\t\t\t}\n\n\t\t\t\t\tif (state.kind === 'inlineEdit' && !this._accessibilityService.isMotionReduced()) {\n\t\t\t\t\t\tconst editRanges = edit.getNewRanges();\n\t\t\t\t\t\tconst dec = this._store.add(new FadeoutDecoration(editor, editRanges, () => {\n\t\t\t\t\t\t\tthis._store.delete(dec);\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._onDidAccept.fire();\n\n\t\t\t// Reset before invoking the command, as the command might cause a follow up trigger (which we don't want to reset).\n\t\t\tthis.stop();\n\n\t\t\tif (completion.command) {\n\t\t\t\tawait this._commandService\n\t\t\t\t\t.executeCommand(completion.command.id, ...(completion.command.arguments || []))\n\t\t\t\t\t.then(undefined, onUnexpectedExternalError);\n\t\t\t}\n\n\t\t\t// TODO: how can we make alternative actions to retrigger?\n\t\t\tif (followUpTrigger) {\n\t\t\t\tthis.trigger(undefined);\n\t\t\t}\n\n\t\t\tcompletion.reportEndOfLife({ kind: InlineCompletionEndOfLifeReasonKind.Accepted, alternativeAction });\n\t\t} finally {\n\t\t\tcompletion.removeRef();\n\t\t\tthis._inAcceptFlow.set(true, undefined);\n\t\t\tthis._lastAcceptedInlineCompletionInfo = { textModelVersionIdAfter: this.textModel.getVersionId(), inlineCompletion: completion };\n\t\t}\n\t}\n\n\tpublic async acceptNextWord(): Promise<void> {\n\t\tawait this._acceptNext(this._editor, 'word', (pos, text) => {\n\t\t\tconst langId = this.textModel.getLanguageIdAtPosition(pos.lineNumber, pos.column);\n\t\t\tconst config = this._languageConfigurationService.getLanguageConfiguration(langId);\n\t\t\tconst wordRegExp = new RegExp(config.wordDefinition.source, config.wordDefinition.flags.replace('g', ''));\n\n\t\t\tconst m1 = text.match(wordRegExp);\n\t\t\tlet acceptUntilIndexExclusive = 0;\n\t\t\tif (m1 && m1.index !== undefined) {\n\t\t\t\tif (m1.index === 0) {\n\t\t\t\t\tacceptUntilIndexExclusive = m1[0].length;\n\t\t\t\t} else {\n\t\t\t\t\tacceptUntilIndexExclusive = m1.index;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tacceptUntilIndexExclusive = text.length;\n\t\t\t}\n\n\t\t\tconst wsRegExp = /\\s+/g;\n\t\t\tconst m2 = wsRegExp.exec(text);\n\t\t\tif (m2 && m2.index !== undefined) {\n\t\t\t\tif (m2.index + m2[0].length < acceptUntilIndexExclusive) {\n\t\t\t\t\tacceptUntilIndexExclusive = m2.index + m2[0].length;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acceptUntilIndexExclusive;\n\t\t}, PartialAcceptTriggerKind.Word);\n\t}\n\n\tpublic async acceptNextLine(): Promise<void> {\n\t\tawait this._acceptNext(this._editor, 'line', (pos, text) => {\n\t\t\tconst m = text.match(/\\n/);\n\t\t\tif (m && m.index !== undefined) {\n\t\t\t\treturn m.index + 1;\n\t\t\t}\n\t\t\treturn text.length;\n\t\t}, PartialAcceptTriggerKind.Line);\n\t}\n\n\tprivate async _acceptNext(editor: ICodeEditor, type: 'word' | 'line', getAcceptUntilIndex: (position: Position, text: string) => number, kind: PartialAcceptTriggerKind): Promise<void> {\n\t\tif (editor.getModel() !== this.textModel) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\n\t\tconst state = this.inlineCompletionState.get();\n\t\tif (!state || state.primaryGhostText.isEmpty() || !state.inlineSuggestion) {\n\t\t\treturn;\n\t\t}\n\t\tconst ghostText = state.primaryGhostText;\n\t\tconst completion = state.inlineSuggestion;\n\n\t\tif (completion.snippetInfo) {\n\t\t\t// not in WYSIWYG mode, partial commit might change completion, thus it is not supported\n\t\t\tawait this.accept(editor);\n\t\t\treturn;\n\t\t}\n\n\t\tconst firstPart = ghostText.parts[0];\n\t\tconst ghostTextPos = new Position(ghostText.lineNumber, firstPart.column);\n\t\tconst ghostTextVal = firstPart.text;\n\t\tconst acceptUntilIndexExclusive = getAcceptUntilIndex(ghostTextPos, ghostTextVal);\n\t\tif (acceptUntilIndexExclusive === ghostTextVal.length && ghostText.parts.length === 1) {\n\t\t\tthis.accept(editor);\n\t\t\treturn;\n\t\t}\n\t\tconst partialGhostTextVal = ghostTextVal.substring(0, acceptUntilIndexExclusive);\n\n\t\tconst positions = this._positions.get();\n\t\tconst cursorPosition = positions[0];\n\n\t\t// Executing the edit might free the completion, so we have to hold a reference on it.\n\t\tcompletion.addRef();\n\t\ttry {\n\t\t\tthis._isAcceptingPartially = true;\n\t\t\ttry {\n\t\t\t\teditor.pushUndoStop();\n\t\t\t\tconst replaceRange = Range.fromPositions(cursorPosition, ghostTextPos);\n\t\t\t\tconst newText = editor.getModel()!.getValueInRange(replaceRange) + partialGhostTextVal;\n\t\t\t\tconst primaryEdit = new TextReplacement(replaceRange, newText);\n\t\t\t\tconst edits = [primaryEdit, ...getSecondaryEdits(this.textModel, positions, primaryEdit)].filter(isDefined);\n\t\t\t\tconst selections = getEndPositionsAfterApplying(edits).map(p => Selection.fromPositions(p));\n\n\t\t\t\teditor.edit(TextEdit.fromParallelReplacementsUnsorted(edits), this._getMetadata(completion, type));\n\t\t\t\teditor.setSelections(selections, 'inlineCompletionPartialAccept');\n\t\t\t\teditor.revealPositionInCenterIfOutsideViewport(editor.getPosition()!, ScrollType.Smooth);\n\t\t\t} finally {\n\t\t\t\tthis._isAcceptingPartially = false;\n\t\t\t}\n\n\t\t\tconst acceptedRange = Range.fromPositions(completion.editRange.getStartPosition(), TextLength.ofText(partialGhostTextVal).addToPosition(ghostTextPos));\n\t\t\t// This assumes that the inline completion and the model use the same EOL style.\n\t\t\tconst text = editor.getModel()!.getValueInRange(acceptedRange, EndOfLinePreference.LF);\n\t\t\tconst acceptedLength = text.length;\n\t\t\tcompletion.reportPartialAccept(\n\t\t\t\tacceptedLength,\n\t\t\t\t{ kind, acceptedLength: acceptedLength },\n\t\t\t\t{ characters: acceptUntilIndexExclusive, ratio: acceptUntilIndexExclusive / ghostTextVal.length, count: 1 }\n\t\t\t);\n\n\t\t} finally {\n\t\t\tcompletion.removeRef();\n\t\t}\n\t}\n\n\tpublic handleSuggestAccepted(item: SuggestItemInfo) {\n\t\tconst itemEdit = singleTextRemoveCommonPrefix(item.getSingleTextEdit(), this.textModel);\n\t\tconst augmentedCompletion = this._computeAugmentation(itemEdit, undefined);\n\t\tif (!augmentedCompletion) { return; }\n\n\t\t// This assumes that the inline completion and the model use the same EOL style.\n\t\tconst alreadyAcceptedLength = this.textModel.getValueInRange(augmentedCompletion.completion.editRange, EndOfLinePreference.LF).length;\n\t\tconst acceptedLength = alreadyAcceptedLength + itemEdit.text.length;\n\n\t\taugmentedCompletion.completion.reportPartialAccept(itemEdit.text.length, {\n\t\t\tkind: PartialAcceptTriggerKind.Suggest,\n\t\t\tacceptedLength,\n\t\t}, {\n\t\t\tcharacters: itemEdit.text.length,\n\t\t\tcount: 1,\n\t\t\tratio: 1\n\t\t});\n\t}\n\n\tpublic extractReproSample(): Repro {\n\t\tconst value = this.textModel.getValue();\n\t\tconst item = this.state.get()?.inlineSuggestion;\n\t\treturn {\n\t\t\tdocumentValue: value,\n\t\t\tinlineCompletion: item?.getSourceCompletion(),\n\t\t};\n\t}\n\n\tprivate readonly _jumpedToId = observableValue<undefined | string>(this, undefined);\n\tprivate readonly _inAcceptFlow = observableValue(this, false);\n\tpublic readonly inAcceptFlow: IObservable<boolean> = this._inAcceptFlow;\n\n\tpublic jump(): void {\n\t\tconst s = this.inlineEditState.get();\n\t\tif (!s) { return; }\n\n\t\tconst suggestion = s.inlineSuggestion;\n\t\tsuggestion.addRef();\n\t\ttry {\n\t\t\ttransaction(tx => {\n\t\t\t\tif (suggestion.action?.kind === 'jumpTo') {\n\t\t\t\t\tthis.stop(undefined, tx);\n\t\t\t\t\tsuggestion.reportEndOfLife({ kind: InlineCompletionEndOfLifeReasonKind.Accepted, alternativeAction: false });\n\t\t\t\t}\n\n\t\t\t\tthis._jumpedToId.set(s.inlineSuggestion.semanticId, tx);\n\t\t\t\tthis.dontRefetchSignal.trigger(tx);\n\t\t\t\tconst targetRange = s.inlineSuggestion.targetRange;\n\t\t\t\tconst targetPosition = targetRange.getStartPosition();\n\t\t\t\tthis._editor.setPosition(targetPosition, 'inlineCompletions.jump');\n\n\t\t\t\t// TODO: consider using view information to reveal it\n\t\t\t\tconst isSingleLineChange = targetRange.isSingleLine() && (s.inlineSuggestion.hint || (s.inlineSuggestion.action?.kind === 'edit' && !s.inlineSuggestion.action.textReplacement.text.includes('\\n')));\n\t\t\t\tif (isSingleLineChange || s.inlineSuggestion.action?.kind === 'jumpTo') {\n\t\t\t\t\tthis._editor.revealPosition(targetPosition, ScrollType.Smooth);\n\t\t\t\t} else {\n\t\t\t\t\tconst revealRange = new Range(targetRange.startLineNumber - 1, 1, targetRange.endLineNumber + 1, 1);\n\t\t\t\t\tthis._editor.revealRange(revealRange, ScrollType.Smooth);\n\t\t\t\t}\n\n\t\t\t\ts.inlineSuggestion.identity.setJumpTo(tx);\n\n\t\t\t\tthis._editor.focus();\n\t\t\t});\n\t\t} finally {\n\t\t\tsuggestion.removeRef();\n\t\t}\n\t}\n\n\tpublic async handleInlineSuggestionShown(inlineCompletion: InlineSuggestionItem, viewKind: InlineCompletionViewKind, viewData: InlineCompletionViewData, timeWhenShown: number): Promise<void> {\n\t\tawait inlineCompletion.reportInlineEditShown(this._commandService, viewKind, viewData, this.textModel, timeWhenShown);\n\t}\n}\n\ninterface Repro {\n\tdocumentValue: string;\n\tinlineCompletion: InlineCompletion | undefined;\n}\n\nexport enum VersionIdChangeReason {\n\tUndo,\n\tRedo,\n\tAcceptWord,\n\tOther,\n}\n\nexport function getSecondaryEdits(textModel: ITextModel, positions: readonly Position[], primaryTextRepl: TextReplacement): (TextReplacement | undefined)[] {\n\tif (positions.length === 1) {\n\t\t// No secondary cursor positions\n\t\treturn [];\n\t}\n\tconst text = new TextModelText(textModel);\n\tconst textTransformer = text.getTransformer();\n\tconst primaryOffset = textTransformer.getOffset(positions[0]);\n\tconst secondaryOffsets = positions.slice(1).map(pos => textTransformer.getOffset(pos));\n\n\tprimaryTextRepl = primaryTextRepl.removeCommonPrefixAndSuffix(text);\n\tconst primaryStringRepl = textTransformer.getStringReplacement(primaryTextRepl);\n\n\tconst deltaFromOffsetToRangeStart = primaryStringRepl.replaceRange.start - primaryOffset;\n\tconst primaryContextRange = primaryStringRepl.replaceRange.join(OffsetRange.emptyAt(primaryOffset));\n\tconst primaryContextValue = text.getValueOfOffsetRange(primaryContextRange);\n\n\tconst replacements = secondaryOffsets.map(secondaryOffset => {\n\t\tconst newRangeStart = secondaryOffset + deltaFromOffsetToRangeStart;\n\t\tconst newRangeEnd = newRangeStart + primaryStringRepl.replaceRange.length;\n\t\tconst range = new OffsetRange(newRangeStart, newRangeEnd);\n\n\t\tconst contextRange = range.join(OffsetRange.emptyAt(secondaryOffset));\n\t\tconst contextValue = text.getValueOfOffsetRange(contextRange);\n\t\tif (contextValue !== primaryContextValue) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst stringRepl = new StringReplacement(range, primaryStringRepl.newText);\n\t\tconst repl = textTransformer.getTextReplacement(stringRepl);\n\t\treturn repl;\n\t}).filter(isDefined);\n\n\treturn replacements;\n}\n\nclass FadeoutDecoration extends Disposable {\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tranges: Range[],\n\t\tonDispose?: () => void,\n\t) {\n\t\tsuper();\n\n\t\tif (onDispose) {\n\t\t\tthis._register({ dispose: () => onDispose() });\n\t\t}\n\n\t\tthis._register(observableCodeEditor(editor).setDecorations(constObservable(ranges.map<IModelDeltaDecoration>(range => ({\n\t\t\trange: range,\n\t\t\toptions: {\n\t\t\t\tdescription: 'animation',\n\t\t\t\tclassName: 'edits-fadeout-decoration',\n\t\t\t\tzIndex: 1,\n\t\t\t}\n\t\t})))));\n\n\t\tconst animation = new AnimatedValue(1, 0, 1000, easeOutCubic);\n\t\tconst val = new ObservableAnimatedValue(animation);\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst opacity = val.getValue(reader);\n\t\t\teditor.getContainerDomNode().style.setProperty('--animation-opacity', opacity.toString());\n\t\t\tif (animation.isFinished()) {\n\t\t\t\tthis.dispose();\n\t\t\t}\n\t\t}));\n\t}\n}\n\nexport function isSuggestionInViewport(editor: ICodeEditor, suggestion: InlineSuggestionItem, reader: IReader | undefined = undefined): boolean {\n\tconst targetRange = suggestion.targetRange;\n\n\t// TODO make getVisibleRanges reactive!\n\tobservableCodeEditor(editor).scrollTop.read(reader);\n\tconst visibleRanges = editor.getVisibleRanges();\n\n\tif (visibleRanges.length < 1) {\n\t\treturn false;\n\t}\n\n\tconst viewportRange = new Range(\n\t\tvisibleRanges[0].startLineNumber,\n\t\tvisibleRanges[0].startColumn,\n\t\tvisibleRanges[visibleRanges.length - 1].endLineNumber,\n\t\tvisibleRanges[visibleRanges.length - 1].endColumn\n\t);\n\treturn viewportRange.containsRange(targetRange);\n}\n\nfunction skuFromAccount(account: IDefaultAccount | null): InlineSuggestSku | undefined {\n\tif (account?.access_type_sku && account?.copilot_plan) {\n\t\treturn { type: account.access_type_sku, plan: account.copilot_plan };\n\t}\n\treturn undefined;\n}\n\nclass DisposableCallback<T> {\n\tprivate _cb: ((e: T) => void) | undefined;\n\n\tconstructor(cb: (e: T) => void) {\n\t\tthis._cb = cb;\n\t}\n\n\tdispose(): void {\n\t\tthis._cb = undefined;\n\t}\n\n\treadonly handler = (val: T) => {\n\t\treturn this._cb?.(val);\n\t};\n}\n\nfunction createDisposableCb<T>(cb: (e: T) => void, store: DisposableStore): (e: T) => void {\n\tconst dcb = new DisposableCallback(cb);\n\tstore.add(dcb);\n\treturn dcb.handler;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { mapFindFirst } from '../../../../../base/common/arraysFind.js';\nimport { arrayEqualsC } from '../../../../../base/common/equals.js';\nimport { BugIndicatingError, onUnexpectedExternalError } from '../../../../../base/common/errors.js';\nimport { Emitter } from '../../../../../base/common/event.js';\nimport { Disposable, DisposableStore } from '../../../../../base/common/lifecycle.js';\nimport { IObservable, IObservableWithChange, IReader, ITransaction, autorun, constObservable, derived, derivedHandleChanges, derivedOpts, mapObservableArrayCached, observableFromEvent, observableSignal, observableValue, recomputeInitiallyAndOnChange, subtransaction, transaction } from '../../../../../base/common/observable.js';\nimport { firstNonWhitespaceIndex } from '../../../../../base/common/strings.js';\nimport { isDefined } from '../../../../../base/common/types.js';\nimport { IAccessibilityService } from '../../../../../platform/accessibility/common/accessibility.js';\nimport { ICommandService } from '../../../../../platform/commands/common/commands.js';\nimport { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';\nimport { ICodeEditor } from '../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../browser/observableCodeEditor.js';\nimport { EditorOption } from '../../../../common/config/editorOptions.js';\nimport { CursorColumns } from '../../../../common/core/cursorColumns.js';\nimport { LineRange } from '../../../../common/core/ranges/lineRange.js';\nimport { Position } from '../../../../common/core/position.js';\nimport { Range } from '../../../../common/core/range.js';\nimport { Selection } from '../../../../common/core/selection.js';\nimport { TextReplacement, TextEdit } from '../../../../common/core/edits/textEdit.js';\nimport { TextLength } from '../../../../common/core/text/textLength.js';\nimport { ScrollType } from '../../../../common/editorCommon.js';\nimport { InlineCompletionEndOfLifeReasonKind, InlineCompletion, InlineCompletionTriggerKind, PartialAcceptTriggerKind, InlineCompletionsProvider, InlineCompletionCommand } from '../../../../common/languages.js';\nimport { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js';\nimport { EndOfLinePreference, IModelDeltaDecoration, ITextModel } from '../../../../common/model.js';\nimport { TextModelText } from '../../../../common/model/textModelText.js';\nimport { IFeatureDebounceInformation } from '../../../../common/services/languageFeatureDebounce.js';\nimport { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.js';\nimport { IModelContentChangedEvent } from '../../../../common/textModelEvents.js';\nimport { SnippetController2 } from '../../../snippet/browser/snippetController2.js';\nimport { getEndPositionsAfterApplying, removeTextReplacementCommonSuffixPrefix } from '../utils.js';\nimport { AnimatedValue, easeOutCubic, ObservableAnimatedValue } from './animation.js';\nimport { computeGhostText } from './computeGhostText.js';\nimport { GhostText, GhostTextOrReplacement, ghostTextOrReplacementEquals, ghostTextsOrReplacementsEqual } from './ghostText.js';\nimport { InlineCompletionsSource } from './inlineCompletionsSource.js';\nimport { InlineCompletionItem, InlineEditItem, InlineSuggestionItem } from './inlineSuggestionItem.js';\nimport { InlineCompletionContextWithoutUuid, InlineCompletionEditorType, InlineSuggestRequestInfo, InlineSuggestSku } from './provideInlineCompletions.js';\nimport { singleTextEditAugments, singleTextRemoveCommonPrefix } from './singleTextEditHelpers.js';\nimport { SuggestItemInfo } from './suggestWidgetAdapter.js';\nimport { TextModelEditSource, EditSources } from '../../../../common/textModelEditSource.js';\nimport { ICodeEditorService } from '../../../../browser/services/codeEditorService.js';\nimport { InlineCompletionViewData, InlineCompletionViewKind } from '../view/inlineEdits/inlineEditsViewInterface.js';\nimport { IInlineCompletionsService } from '../../../../browser/services/inlineCompletionsService.js';\nimport { TypingInterval } from './typingSpeed.js';\nimport { StringReplacement } from '../../../../common/core/edits/stringEdit.js';\nimport { OffsetRange } from '../../../../common/core/ranges/offsetRange.js';\nimport { URI } from '../../../../../base/common/uri.js';\nimport { IDefaultAccountService } from '../../../../../platform/defaultAccount/common/defaultAccount.js';\nimport { IDefaultAccount } from '../../../../../base/common/defaultAccount.js';\nimport { Schemas } from '../../../../../base/common/network.js';\n\nexport class InlineCompletionsModel extends Disposable {\n\tprivate readonly _source;\n\tprivate readonly _isActive = observableValue<boolean>(this, false);\n\tprivate readonly _onlyRequestInlineEditsSignal = observableSignal(this);\n\tprivate readonly _forceUpdateExplicitlySignal = observableSignal(this);\n\tprivate readonly _noDelaySignal = observableSignal(this);\n\n\tprivate readonly _fetchSpecificProviderSignal = observableSignal<InlineCompletionsProvider | undefined>(this);\n\n\t// We use a semantic id to keep the same inline completion selected even if the provider reorders the completions.\n\tprivate readonly _selectedInlineCompletionId = observableValue<string | undefined>(this, undefined);\n\tpublic readonly primaryPosition = derived(this, reader => this._positions.read(reader)[0] ?? new Position(1, 1));\n\tpublic readonly allPositions = derived(this, reader => this._positions.read(reader));\n\n\tprivate readonly sku = observableValue<InlineSuggestSku | undefined>(this, undefined);\n\n\tprivate _isAcceptingPartially = false;\n\tprivate readonly _appearedInsideViewport = derived<boolean>(this, reader => {\n\t\tconst state = this.state.read(reader);\n\t\tif (!state || !state.inlineSuggestion) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn isSuggestionInViewport(this._editor, state.inlineSuggestion);\n\t});\n\tpublic get isAcceptingPartially() { return this._isAcceptingPartially; }\n\n\tprivate readonly _onDidAccept = new Emitter<void>();\n\tpublic readonly onDidAccept = this._onDidAccept.event;\n\n\tprivate readonly _editorObs;\n\n\tprivate readonly _typing: TypingInterval;\n\n\tprivate readonly _suggestPreviewEnabled;\n\tprivate readonly _suggestPreviewMode;\n\tprivate readonly _inlineSuggestMode;\n\tprivate readonly _suppressedInlineCompletionGroupIds;\n\tprivate readonly _inlineEditsEnabled;\n\tprivate readonly _inlineEditsShowCollapsedEnabled;\n\tprivate readonly _triggerCommandOnProviderChange;\n\tprivate readonly _minShowDelay;\n\tprivate readonly _showOnSuggestConflict;\n\tprivate readonly _suppressInSnippetMode;\n\tprivate readonly _isInSnippetMode;\n\n\tget editor() {\n\t\treturn this._editor;\n\t}\n\n\tconstructor(\n\t\tpublic readonly textModel: ITextModel,\n\t\tprivate readonly _selectedSuggestItem: IObservable<SuggestItemInfo | undefined>,\n\t\tpublic readonly _textModelVersionId: IObservableWithChange<number | null, IModelContentChangedEvent | undefined>,\n\t\tprivate readonly _positions: IObservable<readonly Position[]>,\n\t\tprivate readonly _debounceValue: IFeatureDebounceInformation,\n\t\tprivate readonly _enabled: IObservable<boolean>,\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService,\n\t\t@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,\n\t\t@ICodeEditorService private readonly _codeEditorService: ICodeEditorService,\n\t\t@IInlineCompletionsService private readonly _inlineCompletionsService: IInlineCompletionsService,\n\t\t@IDefaultAccountService defaultAccountService: IDefaultAccountService,\n\t) {\n\t\tsuper();\n\t\tthis._source = this._register(this._instantiationService.createInstance(InlineCompletionsSource, this.textModel, this._textModelVersionId, this._debounceValue, this.primaryPosition));\n\t\tthis.lastTriggerKind = this._source.inlineCompletions.map(this, v => v?.request?.context.triggerKind);\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tconst suggest = this._editorObs.getOption(EditorOption.suggest);\n\t\tthis._suggestPreviewEnabled = suggest.map(v => v.preview);\n\t\tthis._suggestPreviewMode = suggest.map(v => v.previewMode);\n\n\t\tconst inlineSuggest = this._editorObs.getOption(EditorOption.inlineSuggest);\n\t\tthis._inlineSuggestMode = inlineSuggest.map(v => v.mode);\n\t\tthis._suppressedInlineCompletionGroupIds = inlineSuggest.map(v => new Set(v.experimental.suppressInlineSuggestions.split(',')));\n\t\tthis._inlineEditsEnabled = inlineSuggest.map(v => !!v.edits.enabled);\n\t\tthis._inlineEditsShowCollapsedEnabled = inlineSuggest.map(s => s.edits.showCollapsed);\n\t\tthis._triggerCommandOnProviderChange = inlineSuggest.map(s => s.triggerCommandOnProviderChange);\n\t\tthis._minShowDelay = inlineSuggest.map(s => s.minShowDelay);\n\t\tthis._showOnSuggestConflict = inlineSuggest.map(s => s.experimental.showOnSuggestConflict);\n\t\tthis._suppressInSnippetMode = inlineSuggest.map(s => s.suppressInSnippetMode);\n\n\t\tconst snippetController = SnippetController2.get(this._editor);\n\t\tthis._isInSnippetMode = snippetController?.isInSnippetObservable ?? constObservable(false);\n\n\t\tdefaultAccountService.getDefaultAccount().then(createDisposableCb(account => this.sku.set(skuFromAccount(account), undefined), this._store));\n\t\tthis._register(defaultAccountService.onDidChangeDefaultAccount(account => this.sku.set(skuFromAccount(account), undefined)));\n\n\t\tthis._typing = this._register(new TypingInterval(this.textModel));\n\n\t\tthis._register(this._inlineCompletionsService.onDidChangeIsSnoozing((isSnoozing) => {\n\t\t\tif (isSnoozing) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t}));\n\n\t\t{ // Determine editor type\n\t\t\tconst isNotebook = this.textModel.uri.scheme === Schemas.vscodeNotebookCell;\n\t\t\tconst [diffEditor] = this._codeEditorService.listDiffEditors()\n\t\t\t\t.filter(d =>\n\t\t\t\t\td.getOriginalEditor().getId() === this._editor.getId() ||\n\t\t\t\t\td.getModifiedEditor().getId() === this._editor.getId());\n\n\t\t\tthis.isInDiffEditor = !!diffEditor;\n\t\t\tthis.editorType = isNotebook ? InlineCompletionEditorType.Notebook\n\t\t\t\t: this.isInDiffEditor ? InlineCompletionEditorType.DiffEditor\n\t\t\t\t\t: InlineCompletionEditorType.TextEditor;\n\t\t}\n\n\t\tthis._register(recomputeInitiallyAndOnChange(this.state, (s) => {\n\t\t\tif (s && s.inlineSuggestion) {\n\t\t\t\tthis._inlineCompletionsService.reportNewCompletion(s.inlineSuggestion.requestUuid);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(recomputeInitiallyAndOnChange(this._fetchInlineCompletionsPromise));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tthis._editorObs.versionId.read(reader);\n\t\t\tthis._inAcceptFlow.set(false, undefined);\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst jumpToReset = this.state.map((s, reader) => !s || s.kind === 'inlineEdit' && !s.cursorAtInlineEdit.read(reader)).read(reader);\n\t\t\tif (jumpToReset) {\n\t\t\t\tthis._jumpedToId.set(undefined, undefined);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst inlineSuggestion = this.state.map(s => s?.inlineSuggestion).read(reader);\n\t\t\tif (inlineSuggestion) {\n\t\t\t\tinlineSuggestion.addPerformanceMarker('activeSuggestion');\n\t\t\t}\n\t\t}));\n\n\t\tconst inlineEditSemanticId = this.inlineEditState.map(s => s?.inlineSuggestion.semanticId);\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst id = inlineEditSemanticId.read(reader);\n\t\t\tif (id) {\n\t\t\t\tthis._editor.pushUndoStop();\n\t\t\t\tthis._lastShownInlineCompletionInfo = {\n\t\t\t\t\talternateTextModelVersionId: this.textModel.getAlternativeVersionId(),\n\t\t\t\t\tinlineCompletion: this.state.get()!.inlineSuggestion!,\n\t\t\t\t};\n\t\t\t}\n\t\t}));\n\n\t\t// TODO: should use getAvailableProviders and update on _suppressedInlineCompletionGroupIds change\n\t\tconst inlineCompletionProviders = observableFromEvent(this._languageFeaturesService.inlineCompletionsProvider.onDidChange, () => this._languageFeaturesService.inlineCompletionsProvider.all(textModel));\n\t\tmapObservableArrayCached(this, inlineCompletionProviders, (provider, store) => {\n\t\t\tif (!provider.onDidChangeInlineCompletions) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tstore.add(provider.onDidChangeInlineCompletions(() => {\n\t\t\t\tif (!this._enabled.get()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Only update the active editor\n\t\t\t\tconst activeEditor = this._codeEditorService.getFocusedCodeEditor() || this._codeEditorService.getActiveCodeEditor();\n\t\t\t\tif (activeEditor !== this._editor) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (this._triggerCommandOnProviderChange.get()) {\n\t\t\t\t\t// TODO@hediet remove this and always do the else branch.\n\t\t\t\t\tthis.trigger(undefined, { onlyFetchInlineEdits: true });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\n\t\t\t\t// If there is an active suggestion from a different provider, we ignore the update\n\t\t\t\tconst activeState = this.state.get();\n\t\t\t\tif (activeState && (activeState.inlineSuggestion || activeState.edits) && activeState.inlineSuggestion?.source.provider !== provider) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\ttransaction(tx => {\n\t\t\t\t\tthis._fetchSpecificProviderSignal.trigger(tx, provider);\n\t\t\t\t\tthis.trigger(tx);\n\t\t\t\t});\n\n\t\t\t}));\n\t\t}).recomputeInitiallyAndOnChange(this._store);\n\n\t\tthis._didUndoInlineEdits.recomputeInitiallyAndOnChange(this._store);\n\t}\n\n\tprivate _lastShownInlineCompletionInfo: { alternateTextModelVersionId: number; /* already freed! */ inlineCompletion: InlineSuggestionItem } | undefined = undefined;\n\tprivate _lastAcceptedInlineCompletionInfo: { textModelVersionIdAfter: number; /* already freed! */ inlineCompletion: InlineSuggestionItem } | undefined = undefined;\n\tprivate readonly _didUndoInlineEdits = derivedHandleChanges({\n\t\towner: this,\n\t\tchangeTracker: {\n\t\t\tcreateChangeSummary: () => ({ didUndo: false }),\n\t\t\thandleChange: (ctx, changeSummary) => {\n\t\t\t\tchangeSummary.didUndo = ctx.didChange(this._textModelVersionId) && !!ctx.change?.isUndoing;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}, (reader, changeSummary) => {\n\t\tconst versionId = this._textModelVersionId.read(reader);\n\t\tif (versionId !== null\n\t\t\t&& this._lastAcceptedInlineCompletionInfo\n\t\t\t&& this._lastAcceptedInlineCompletionInfo.textModelVersionIdAfter === versionId - 1\n\t\t\t&& this._lastAcceptedInlineCompletionInfo.inlineCompletion.isInlineEdit\n\t\t\t&& changeSummary.didUndo\n\t\t) {\n\t\t\tthis._lastAcceptedInlineCompletionInfo = undefined;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t});\n\n\tpublic getIndentationInfo(reader: IReader) {\n\t\tlet startsWithIndentation = false;\n\t\tlet startsWithIndentationLessThanTabSize = true;\n\t\tconst ghostText = this?.primaryGhostText.read(reader);\n\t\tif (!!this?._selectedSuggestItem && ghostText && ghostText.parts.length > 0) {\n\t\t\tconst { column, lines } = ghostText.parts[0];\n\n\t\t\tconst firstLine = lines[0].line;\n\n\t\t\tconst indentationEndColumn = this.textModel.getLineIndentColumn(ghostText.lineNumber);\n\t\t\tconst inIndentation = column <= indentationEndColumn;\n\n\t\t\tif (inIndentation) {\n\t\t\t\tlet firstNonWsIdx = firstNonWhitespaceIndex(firstLine);\n\t\t\t\tif (firstNonWsIdx === -1) {\n\t\t\t\t\tfirstNonWsIdx = firstLine.length - 1;\n\t\t\t\t}\n\t\t\t\tstartsWithIndentation = firstNonWsIdx > 0;\n\n\t\t\t\tconst tabSize = this.textModel.getOptions().tabSize;\n\t\t\t\tconst visibleColumnIndentation = CursorColumns.visibleColumnFromColumn(firstLine, firstNonWsIdx + 1, tabSize);\n\t\t\t\tstartsWithIndentationLessThanTabSize = visibleColumnIndentation < tabSize;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tstartsWithIndentation,\n\t\t\tstartsWithIndentationLessThanTabSize,\n\t\t};\n\t}\n\n\tprivate readonly _preserveCurrentCompletionReasons = new Set([\n\t\tVersionIdChangeReason.Redo,\n\t\tVersionIdChangeReason.Undo,\n\t\tVersionIdChangeReason.AcceptWord,\n\t]);\n\n\tprivate _getReason(e: IModelContentChangedEvent | undefined): VersionIdChangeReason {\n\t\tif (e?.isUndoing) { return VersionIdChangeReason.Undo; }\n\t\tif (e?.isRedoing) { return VersionIdChangeReason.Redo; }\n\t\tif (this.isAcceptingPartially) { return VersionIdChangeReason.AcceptWord; }\n\t\treturn VersionIdChangeReason.Other;\n\t}\n\n\tpublic readonly dontRefetchSignal = observableSignal(this);\n\n\tprivate readonly _fetchInlineCompletionsPromise = derivedHandleChanges({\n\t\towner: this,\n\t\tchangeTracker: {\n\t\t\tcreateChangeSummary: () => ({\n\t\t\t\tdontRefetch: false,\n\t\t\t\tpreserveCurrentCompletion: false,\n\t\t\t\tinlineCompletionTriggerKind: InlineCompletionTriggerKind.Automatic,\n\t\t\t\tonlyRequestInlineEdits: false,\n\t\t\t\tshouldDebounce: true,\n\t\t\t\tprovider: undefined as InlineCompletionsProvider | undefined,\n\t\t\t\ttextChange: false,\n\t\t\t\tchangeReason: '',\n\t\t\t}),\n\t\t\thandleChange: (ctx, changeSummary) => {\n\t\t\t\t/** @description fetch inline completions */\n\t\t\t\tif (ctx.didChange(this._textModelVersionId)) {\n\t\t\t\t\tif (this._preserveCurrentCompletionReasons.has(this._getReason(ctx.change))) {\n\t\t\t\t\t\tchangeSummary.preserveCurrentCompletion = true;\n\t\t\t\t\t}\n\t\t\t\t\tconst detailedReasons = ctx.change?.detailedReasons ?? [];\n\t\t\t\t\tchangeSummary.changeReason = detailedReasons.length > 0 ? detailedReasons[0].getType() : '';\n\t\t\t\t\tchangeSummary.textChange = true;\n\t\t\t\t} else if (ctx.didChange(this._forceUpdateExplicitlySignal)) {\n\t\t\t\t\tchangeSummary.preserveCurrentCompletion = true;\n\t\t\t\t\tchangeSummary.inlineCompletionTriggerKind = InlineCompletionTriggerKind.Explicit;\n\t\t\t\t} else if (ctx.didChange(this.dontRefetchSignal)) {\n\t\t\t\t\tchangeSummary.dontRefetch = true;\n\t\t\t\t} else if (ctx.didChange(this._onlyRequestInlineEditsSignal)) {\n\t\t\t\t\tchangeSummary.onlyRequestInlineEdits = true;\n\t\t\t\t} else if (ctx.didChange(this._fetchSpecificProviderSignal)) {\n\t\t\t\t\tchangeSummary.provider = ctx.change;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t},\n\t\t},\n\t}, (reader, changeSummary) => {\n\t\tthis._source.clearOperationOnTextModelChange.read(reader); // Make sure the clear operation runs before the fetch operation\n\t\tthis._noDelaySignal.read(reader);\n\t\tthis.dontRefetchSignal.read(reader);\n\t\tthis._onlyRequestInlineEditsSignal.read(reader);\n\t\tthis._forceUpdateExplicitlySignal.read(reader);\n\t\tthis._fetchSpecificProviderSignal.read(reader);\n\t\tconst shouldUpdate = ((this._enabled.read(reader) && this._selectedSuggestItem.read(reader)) || this._isActive.read(reader))\n\t\t\t&& (!this._inlineCompletionsService.isSnoozing() || changeSummary.inlineCompletionTriggerKind === InlineCompletionTriggerKind.Explicit);\n\t\tif (!shouldUpdate) {\n\t\t\tthis._source.cancelUpdate();\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthis._textModelVersionId.read(reader); // Refetch on text change\n\n\t\tconst suggestWidgetInlineCompletions = this._source.suggestWidgetInlineCompletions.read(undefined);\n\t\tlet suggestItem = this._selectedSuggestItem.read(reader);\n\t\tif (this._shouldShowOnSuggestConflict.read(undefined)) {\n\t\t\tsuggestItem = undefined;\n\t\t}\n\t\tif (suggestWidgetInlineCompletions && !suggestItem) {\n\t\t\tthis._source.seedInlineCompletionsWithSuggestWidget();\n\t\t}\n\n\t\tif (changeSummary.dontRefetch) {\n\t\t\treturn Promise.resolve(true);\n\t\t}\n\n\t\tif (this._didUndoInlineEdits.read(reader) && changeSummary.inlineCompletionTriggerKind !== InlineCompletionTriggerKind.Explicit) {\n\t\t\ttransaction(tx => {\n\t\t\t\tthis._source.clear(tx);\n\t\t\t});\n\t\t\treturn undefined;\n\t\t}\n\n\t\tlet reason: string = '';\n\t\tif (changeSummary.provider) {\n\t\t\treason += 'providerOnDidChange';\n\t\t} else if (changeSummary.inlineCompletionTriggerKind === InlineCompletionTriggerKind.Explicit) {\n\t\t\treason += 'explicit';\n\t\t}\n\t\tif (changeSummary.changeReason) {\n\t\t\treason += reason.length > 0 ? `:${changeSummary.changeReason}` : changeSummary.changeReason;\n\t\t}\n\n\t\tconst typingInterval = this._typing.getTypingInterval();\n\t\tconst requestInfo: InlineSuggestRequestInfo = {\n\t\t\teditorType: this.editorType,\n\t\t\tstartTime: Date.now(),\n\t\t\tlanguageId: this.textModel.getLanguageId(),\n\t\t\treason,\n\t\t\ttypingInterval: typingInterval.averageInterval,\n\t\t\ttypingIntervalCharacterCount: typingInterval.characterCount,\n\t\t\tavailableProviders: [],\n\t\t\tsku: this.sku.read(undefined),\n\t\t};\n\n\t\tlet context: InlineCompletionContextWithoutUuid = {\n\t\t\ttriggerKind: changeSummary.inlineCompletionTriggerKind,\n\t\t\tselectedSuggestionInfo: suggestItem?.toSelectedSuggestionInfo(),\n\t\t\tincludeInlineCompletions: !changeSummary.onlyRequestInlineEdits,\n\t\t\tincludeInlineEdits: this._inlineEditsEnabled.read(reader),\n\t\t\trequestIssuedDateTime: requestInfo.startTime,\n\t\t\tearliestShownDateTime: requestInfo.startTime + (changeSummary.inlineCompletionTriggerKind === InlineCompletionTriggerKind.Explicit || this.inAcceptFlow.read(undefined) ? 0 : this._minShowDelay.read(undefined)),\n\t\t};\n\n\t\tif (context.triggerKind === InlineCompletionTriggerKind.Automatic && changeSummary.textChange) {\n\t\t\tif (this.textModel.getAlternativeVersionId() === this._lastShownInlineCompletionInfo?.alternateTextModelVersionId) {\n\t\t\t\t// When undoing back to a version where an inline edit/completion was shown,\n\t\t\t\t// we want to show an inline edit (or completion) again if it was originally an inline edit (or completion).\n\t\t\t\tcontext = {\n\t\t\t\t\t...context,\n\t\t\t\t\tincludeInlineCompletions: !this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit,\n\t\t\t\t\tincludeInlineEdits: this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tconst itemToPreserveCandidate = this.selectedInlineCompletion.read(undefined) ?? this._inlineCompletionItems.read(undefined)?.inlineEdit;\n\t\tconst itemToPreserve = changeSummary.preserveCurrentCompletion || itemToPreserveCandidate?.forwardStable\n\t\t\t? itemToPreserveCandidate : undefined;\n\t\tconst userJumpedToActiveCompletion = this._jumpedToId.map(jumpedTo => !!jumpedTo && jumpedTo === this._inlineCompletionItems.read(undefined)?.inlineEdit?.semanticId);\n\n\t\tconst providers = changeSummary.provider\n\t\t\t? { providers: [changeSummary.provider], label: 'single:' + changeSummary.provider.providerId?.toString() }\n\t\t\t: { providers: this._languageFeaturesService.inlineCompletionsProvider.all(this.textModel), label: undefined }; // TODO: should use inlineCompletionProviders\n\t\tconst availableProviders = this.getAvailableProviders(providers.providers);\n\t\trequestInfo.availableProviders = availableProviders.map(p => p.providerId).filter(isDefined);\n\n\t\treturn this._source.fetch(availableProviders, providers.label, context, itemToPreserve?.identity, changeSummary.shouldDebounce, userJumpedToActiveCompletion, requestInfo);\n\t});\n\n\t// TODO: This is not an ideal implementation of excludesGroupIds, however as this is currently still behind proposed API\n\t// and due to the time constraints, we are using a simplified approach\n\tprivate getAvailableProviders(providers: InlineCompletionsProvider[]): InlineCompletionsProvider[] {\n\t\tconst suppressedProviderGroupIds = this._suppressedInlineCompletionGroupIds.get();\n\t\tconst unsuppressedProviders = providers.filter(provider => !(provider.groupId && suppressedProviderGroupIds.has(provider.groupId)));\n\n\t\tconst excludedGroupIds = new Set<string>();\n\t\tfor (const provider of unsuppressedProviders) {\n\t\t\tprovider.excludesGroupIds?.forEach(p => excludedGroupIds.add(p));\n\t\t}\n\n\t\tconst availableProviders: InlineCompletionsProvider[] = [];\n\t\tfor (const provider of unsuppressedProviders) {\n\t\t\tif (provider.groupId && excludedGroupIds.has(provider.groupId)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tavailableProviders.push(provider);\n\t\t}\n\n\t\treturn availableProviders;\n\t}\n\n\tpublic async trigger(tx?: ITransaction, options: { onlyFetchInlineEdits?: boolean; noDelay?: boolean; provider?: InlineCompletionsProvider; explicit?: boolean } = {}): Promise<void> {\n\t\tsubtransaction(tx, tx => {\n\t\t\tif (options.onlyFetchInlineEdits) {\n\t\t\t\tthis._onlyRequestInlineEditsSignal.trigger(tx);\n\t\t\t}\n\t\t\tif (options.noDelay) {\n\t\t\t\tthis._noDelaySignal.trigger(tx);\n\t\t\t}\n\t\t\tthis._isActive.set(true, tx);\n\n\t\t\tif (options.explicit) {\n\t\t\t\tthis._inAcceptFlow.set(true, tx);\n\t\t\t\tthis._forceUpdateExplicitlySignal.trigger(tx);\n\t\t\t}\n\t\t\tif (options.provider) {\n\t\t\t\tthis._fetchSpecificProviderSignal.trigger(tx, options.provider);\n\t\t\t}\n\t\t});\n\t\tawait this._fetchInlineCompletionsPromise.get();\n\t}\n\n\tpublic async triggerExplicitly(tx?: ITransaction, onlyFetchInlineEdits: boolean = false): Promise<void> {\n\t\treturn this.trigger(tx, { onlyFetchInlineEdits, explicit: true });\n\t}\n\n\tpublic stop(stopReason: 'explicitCancel' | 'automatic' = 'automatic', tx?: ITransaction): void {\n\t\tsubtransaction(tx, tx => {\n\t\t\tif (stopReason === 'explicitCancel') {\n\t\t\t\tconst inlineCompletion = this.state.get()?.inlineSuggestion;\n\t\t\t\tif (inlineCompletion) {\n\t\t\t\t\tinlineCompletion.reportEndOfLife({ kind: InlineCompletionEndOfLifeReasonKind.Rejected });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._isActive.set(false, tx);\n\t\t\tthis._source.clear(tx);\n\t\t});\n\t}\n\n\tprivate readonly _inlineCompletionItems = derivedOpts({ owner: this }, reader => {\n\t\tconst c = this._source.inlineCompletions.read(reader);\n\t\tif (!c) { return undefined; }\n\t\tconst cursorPosition = this.primaryPosition.read(reader);\n\t\tlet inlineEdit: InlineEditItem | undefined = undefined;\n\t\tconst visibleCompletions: InlineCompletionItem[] = [];\n\t\tfor (const completion of c.inlineCompletions) {\n\t\t\tif (!completion.isInlineEdit) {\n\t\t\t\tif (completion.isVisible(this.textModel, cursorPosition)) {\n\t\t\t\t\tvisibleCompletions.push(completion);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tinlineEdit = completion;\n\t\t\t}\n\t\t}\n\n\t\tif (visibleCompletions.length !== 0) {\n\t\t\t// Don't show the inline edit if there is a visible completion\n\t\t\tinlineEdit = undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tinlineCompletions: visibleCompletions,\n\t\t\tinlineEdit,\n\t\t};\n\t});\n\n\tprivate readonly _filteredInlineCompletionItems = derivedOpts({ owner: this, equalsFn: arrayEqualsC() }, reader => {\n\t\tconst c = this._inlineCompletionItems.read(reader);\n\t\treturn c?.inlineCompletions ?? [];\n\t});\n\n\tpublic readonly selectedInlineCompletionIndex = derived<number>(this, (reader) => {\n\t\tconst selectedInlineCompletionId = this._selectedInlineCompletionId.read(reader);\n\t\tconst filteredCompletions = this._filteredInlineCompletionItems.read(reader);\n\t\tconst idx = this._selectedInlineCompletionId === undefined ? -1\n\t\t\t: filteredCompletions.findIndex(v => v.semanticId === selectedInlineCompletionId);\n\t\tif (idx === -1) {\n\t\t\t// Reset the selection so that the selection does not jump back when it appears again\n\t\t\tthis._selectedInlineCompletionId.set(undefined, undefined);\n\t\t\treturn 0;\n\t\t}\n\t\treturn idx;\n\t});\n\n\tpublic readonly selectedInlineCompletion = derived<InlineCompletionItem | undefined>(this, (reader) => {\n\t\tconst filteredCompletions = this._filteredInlineCompletionItems.read(reader);\n\t\tconst idx = this.selectedInlineCompletionIndex.read(reader);\n\t\treturn filteredCompletions[idx];\n\t});\n\n\tpublic readonly activeCommands = derivedOpts<InlineCompletionCommand[]>({ owner: this, equalsFn: arrayEqualsC() },\n\t\tr => this.selectedInlineCompletion.read(r)?.source.inlineSuggestions.commands ?? []\n\t);\n\n\tpublic readonly lastTriggerKind: IObservable<InlineCompletionTriggerKind | undefined>;\n\n\tpublic readonly inlineCompletionsCount = derived<number | undefined>(this, reader => {\n\t\tif (this.lastTriggerKind.read(reader) === InlineCompletionTriggerKind.Explicit) {\n\t\t\treturn this._filteredInlineCompletionItems.read(reader).length;\n\t\t} else {\n\t\t\treturn undefined;\n\t\t}\n\t});\n\n\tprivate readonly _hasVisiblePeekWidgets = derived(this, reader => this._editorObs.openedPeekWidgets.read(reader) > 0);\n\n\tprivate readonly _shouldShowOnSuggestConflict = derived(this, reader => {\n\t\tconst showOnSuggestConflict = this._showOnSuggestConflict.read(reader);\n\t\tif (showOnSuggestConflict !== 'never') {\n\t\t\tconst hasInlineCompletion = !!this.selectedInlineCompletion.read(reader);\n\t\t\tif (hasInlineCompletion) {\n\t\t\t\tconst item = this._selectedSuggestItem.read(reader);\n\t\t\t\tif (!item) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (showOnSuggestConflict === 'whenSuggestListIsIncomplete') {\n\t\t\t\t\treturn item.listIncomplete;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t});\n\n\tpublic readonly state = derivedOpts<{\n\t\tkind: 'ghostText';\n\t\tedits: readonly TextReplacement[];\n\t\tprimaryGhostText: GhostTextOrReplacement;\n\t\tghostTexts: readonly GhostTextOrReplacement[];\n\t\tsuggestItem: SuggestItemInfo | undefined;\n\t\tinlineSuggestion: InlineCompletionItem | undefined;\n\t} | {\n\t\tkind: 'inlineEdit';\n\t\tedits: readonly TextReplacement[];\n\t\tinlineSuggestion: InlineEditItem;\n\t\tcursorAtInlineEdit: IObservable<boolean>;\n\t\tnextEditUri: URI | undefined;\n\t} | undefined>({\n\t\towner: this,\n\t\tequalsFn: (a, b) => {\n\t\t\tif (!a || !b) { return a === b; }\n\n\t\t\tif (a.kind === 'ghostText' && b.kind === 'ghostText') {\n\t\t\t\treturn ghostTextsOrReplacementsEqual(a.ghostTexts, b.ghostTexts)\n\t\t\t\t\t&& a.inlineSuggestion === b.inlineSuggestion\n\t\t\t\t\t&& a.suggestItem === b.suggestItem;\n\t\t\t} else if (a.kind === 'inlineEdit' && b.kind === 'inlineEdit') {\n\t\t\t\treturn a.inlineSuggestion === b.inlineSuggestion;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}, (reader) => {\n\t\tconst model = this.textModel;\n\n\t\tif (this._suppressInSnippetMode.read(reader) && this._isInSnippetMode.read(reader)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst item = this._inlineCompletionItems.read(reader);\n\t\tconst inlineEditResult = item?.inlineEdit;\n\t\tif (inlineEditResult) {\n\t\t\tif (this._hasVisiblePeekWidgets.read(reader)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst cursorAtInlineEdit = this.primaryPosition.map(cursorPos => LineRange.fromRangeInclusive(inlineEditResult.targetRange).addMargin(1, 1).contains(cursorPos.lineNumber));\n\t\t\tconst stringEdit = inlineEditResult.action?.kind === 'edit' ? inlineEditResult.action.stringEdit : undefined;\n\t\t\tconst replacements = stringEdit ? TextEdit.fromStringEdit(stringEdit, new TextModelText(this.textModel)).replacements : [];\n\n\t\t\tconst nextEditUri = (item.inlineEdit?.command?.id === 'vscode.open' || item.inlineEdit?.command?.id === '_workbench.open') &&\n\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\titem.inlineEdit?.command.arguments?.length ? URI.from(<any>item.inlineEdit?.command.arguments[0]) : undefined;\n\t\t\treturn { kind: 'inlineEdit', inlineSuggestion: inlineEditResult, edits: replacements, cursorAtInlineEdit, nextEditUri };\n\t\t}\n\n\t\tconst suggestItem = this._selectedSuggestItem.read(reader);\n\t\tif (!this._shouldShowOnSuggestConflict.read(reader) && suggestItem) {\n\t\t\tconst suggestCompletionEdit = singleTextRemoveCommonPrefix(suggestItem.getSingleTextEdit(), model);\n\t\t\tconst augmentation = this._computeAugmentation(suggestCompletionEdit, reader);\n\n\t\t\tconst isSuggestionPreviewEnabled = this._suggestPreviewEnabled.read(reader);\n\t\t\tif (!isSuggestionPreviewEnabled && !augmentation) { return undefined; }\n\n\t\t\tconst fullEdit = augmentation?.edit ?? suggestCompletionEdit;\n\t\t\tconst fullEditPreviewLength = augmentation ? augmentation.edit.text.length - suggestCompletionEdit.text.length : 0;\n\n\t\t\tconst mode = this._suggestPreviewMode.read(reader);\n\t\t\tconst positions = this._positions.read(reader);\n\t\t\tconst allPotentialEdits = [fullEdit, ...getSecondaryEdits(this.textModel, positions, fullEdit)];\n\t\t\tconst validEditsAndGhostTexts = allPotentialEdits\n\t\t\t\t.map((edit, idx) => ({ edit, ghostText: edit ? computeGhostText(edit, model, mode, positions[idx], fullEditPreviewLength) : undefined }))\n\t\t\t\t.filter(({ edit, ghostText }) => edit !== undefined && ghostText !== undefined);\n\t\t\tconst edits = validEditsAndGhostTexts.map(({ edit }) => edit!);\n\t\t\tconst ghostTexts = validEditsAndGhostTexts.map(({ ghostText }) => ghostText!);\n\t\t\tconst primaryGhostText = ghostTexts[0] ?? new GhostText(fullEdit.range.endLineNumber, []);\n\t\t\treturn { kind: 'ghostText', edits, primaryGhostText, ghostTexts, inlineSuggestion: augmentation?.completion, suggestItem };\n\t\t} else {\n\t\t\tif (!this._isActive.read(reader)) { return undefined; }\n\t\t\tconst inlineSuggestion = this.selectedInlineCompletion.read(reader);\n\t\t\tif (!inlineSuggestion) { return undefined; }\n\n\t\t\tconst replacement = inlineSuggestion.getSingleTextEdit();\n\t\t\tconst mode = this._inlineSuggestMode.read(reader);\n\t\t\tconst positions = this._positions.read(reader);\n\t\t\tconst allPotentialEdits = [replacement, ...getSecondaryEdits(this.textModel, positions, replacement)];\n\t\t\tconst validEditsAndGhostTexts = allPotentialEdits\n\t\t\t\t.map((edit, idx) => ({ edit, ghostText: edit ? computeGhostText(edit, model, mode, positions[idx], 0) : undefined }))\n\t\t\t\t.filter(({ edit, ghostText }) => edit !== undefined && ghostText !== undefined);\n\t\t\tconst edits = validEditsAndGhostTexts.map(({ edit }) => edit!);\n\t\t\tconst ghostTexts = validEditsAndGhostTexts.map(({ ghostText }) => ghostText!);\n\t\t\tif (!ghostTexts[0]) { return undefined; }\n\t\t\treturn { kind: 'ghostText', edits, primaryGhostText: ghostTexts[0], ghostTexts, inlineSuggestion, suggestItem: undefined };\n\t\t}\n\t});\n\n\tpublic readonly inlineCompletionState = derived(this, reader => {\n\t\tconst s = this.state.read(reader);\n\t\tif (!s || s.kind !== 'ghostText') {\n\t\t\treturn undefined;\n\t\t}\n\t\tif (this._editorObs.inComposition.read(reader)) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn s;\n\t});\n\n\tpublic readonly inlineEditState = derived(this, reader => {\n\t\tconst s = this.state.read(reader);\n\t\tif (!s || s.kind !== 'inlineEdit') {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn s;\n\t});\n\n\tpublic readonly inlineEditAvailable = derived(this, reader => {\n\t\tconst s = this.inlineEditState.read(reader);\n\t\treturn !!s;\n\t});\n\n\tprivate _computeAugmentation(suggestCompletion: TextReplacement, reader: IReader | undefined) {\n\t\tconst model = this.textModel;\n\t\tconst suggestWidgetInlineCompletions = this._source.suggestWidgetInlineCompletions.read(reader);\n\t\tconst candidateInlineCompletions = suggestWidgetInlineCompletions\n\t\t\t? suggestWidgetInlineCompletions.inlineCompletions.filter(c => !c.isInlineEdit)\n\t\t\t: [this.selectedInlineCompletion.read(reader)].filter(isDefined);\n\n\t\tconst augmentedCompletion = mapFindFirst(candidateInlineCompletions, completion => {\n\t\t\tlet r = completion.getSingleTextEdit();\n\t\t\tr = singleTextRemoveCommonPrefix(\n\t\t\t\tr,\n\t\t\t\tmodel,\n\t\t\t\tRange.fromPositions(r.range.getStartPosition(), suggestCompletion.range.getEndPosition())\n\t\t\t);\n\t\t\treturn singleTextEditAugments(r, suggestCompletion) ? { completion, edit: r } : undefined;\n\t\t});\n\n\t\treturn augmentedCompletion;\n\t}\n\n\tpublic readonly warning = derived(this, reader => {\n\t\treturn this.inlineCompletionState.read(reader)?.inlineSuggestion?.warning;\n\t});\n\n\tpublic readonly ghostTexts = derivedOpts({ owner: this, equalsFn: ghostTextsOrReplacementsEqual }, reader => {\n\t\tconst v = this.inlineCompletionState.read(reader);\n\t\tif (!v) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn v.ghostTexts;\n\t});\n\n\tpublic readonly primaryGhostText = derivedOpts({ owner: this, equalsFn: ghostTextOrReplacementEquals }, reader => {\n\t\tconst v = this.inlineCompletionState.read(reader);\n\t\tif (!v) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn v?.primaryGhostText;\n\t});\n\n\tpublic readonly showCollapsed = derived<boolean>(this, reader => {\n\t\tconst state = this.state.read(reader);\n\t\tif (!state || state.kind !== 'inlineEdit') {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (state.inlineSuggestion.hint || state.inlineSuggestion.action?.kind === 'jumpTo') {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst isCurrentModelVersion = state.inlineSuggestion.updatedEditModelVersion === this._textModelVersionId.read(reader);\n\t\treturn (this._inlineEditsShowCollapsedEnabled.read(reader) || !isCurrentModelVersion)\n\t\t\t&& this._jumpedToId.read(reader) !== state.inlineSuggestion.semanticId\n\t\t\t&& !this._inAcceptFlow.read(reader);\n\t});\n\n\tprivate readonly _tabShouldIndent = derived(this, reader => {\n\t\tif (this._inAcceptFlow.read(reader)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction isMultiLine(range: Range): boolean {\n\t\t\treturn range.startLineNumber !== range.endLineNumber;\n\t\t}\n\n\t\tfunction getNonIndentationRange(model: ITextModel, lineNumber: number): Range {\n\t\t\tconst columnStart = model.getLineIndentColumn(lineNumber);\n\t\t\tconst lastNonWsColumn = model.getLineLastNonWhitespaceColumn(lineNumber);\n\t\t\tconst columnEnd = Math.max(lastNonWsColumn, columnStart);\n\t\t\treturn new Range(lineNumber, columnStart, lineNumber, columnEnd);\n\t\t}\n\n\t\tconst selections = this._editorObs.selections.read(reader);\n\t\treturn selections?.some(s => {\n\t\t\tif (s.isEmpty()) {\n\t\t\t\treturn this.textModel.getLineLength(s.startLineNumber) === 0;\n\t\t\t} else {\n\t\t\t\treturn isMultiLine(s) || s.containsRange(getNonIndentationRange(this.textModel, s.startLineNumber));\n\t\t\t}\n\t\t});\n\t});\n\n\tpublic readonly tabShouldJumpToInlineEdit = derived(this, reader => {\n\t\tif (this._tabShouldIndent.read(reader)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst s = this.inlineEditState.read(reader);\n\t\tif (!s) {\n\t\t\treturn false;\n\t\t}\n\n\n\t\tif (s.inlineSuggestion.action?.kind === 'jumpTo') {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (this.showCollapsed.read(reader)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (this._inAcceptFlow.read(reader) && this._appearedInsideViewport.read(reader)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn !s.cursorAtInlineEdit.read(reader);\n\t});\n\n\tpublic readonly tabShouldAcceptInlineEdit = derived(this, reader => {\n\t\tconst s = this.inlineEditState.read(reader);\n\t\tif (!s) {\n\t\t\treturn false;\n\t\t}\n\t\tif (s.inlineSuggestion.action?.kind === 'jumpTo') {\n\t\t\treturn false;\n\t\t}\n\t\tif (this.showCollapsed.read(reader)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this._tabShouldIndent.read(reader)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this._inAcceptFlow.read(reader) && this._appearedInsideViewport.read(reader)) {\n\t\t\treturn true;\n\t\t}\n\t\tif (s.inlineSuggestion.targetRange.startLineNumber === this._editorObs.cursorLineNumber.read(reader)) {\n\t\t\treturn true;\n\t\t}\n\t\tif (this._jumpedToId.read(reader) === s.inlineSuggestion.semanticId) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn s.cursorAtInlineEdit.read(reader);\n\t});\n\n\tpublic readonly isInDiffEditor;\n\n\tpublic readonly editorType: InlineCompletionEditorType;\n\n\tprivate async _deltaSelectedInlineCompletionIndex(delta: 1 | -1): Promise<void> {\n\t\tawait this.triggerExplicitly();\n\n\t\tconst completions = this._filteredInlineCompletionItems.get() || [];\n\t\tif (completions.length > 0) {\n\t\t\tconst newIdx = (this.selectedInlineCompletionIndex.get() + delta + completions.length) % completions.length;\n\t\t\tthis._selectedInlineCompletionId.set(completions[newIdx].semanticId, undefined);\n\t\t} else {\n\t\t\tthis._selectedInlineCompletionId.set(undefined, undefined);\n\t\t}\n\t}\n\n\tpublic async next(): Promise<void> { await this._deltaSelectedInlineCompletionIndex(1); }\n\n\tpublic async previous(): Promise<void> { await this._deltaSelectedInlineCompletionIndex(-1); }\n\n\tprivate _getMetadata(completion: InlineSuggestionItem, languageId: string, type: 'word' | 'line' | undefined = undefined): TextModelEditSource {\n\t\tif (type) {\n\t\t\treturn EditSources.inlineCompletionPartialAccept({\n\t\t\t\tnes: completion.isInlineEdit,\n\t\t\t\trequestUuid: completion.requestUuid,\n\t\t\t\tproviderId: completion.source.provider.providerId,\n\t\t\t\tlanguageId,\n\t\t\t\ttype,\n\t\t\t\tcorrelationId: completion.getSourceCompletion().correlationId,\n\t\t\t});\n\t\t} else {\n\t\t\treturn EditSources.inlineCompletionAccept({\n\t\t\t\tnes: completion.isInlineEdit,\n\t\t\t\trequestUuid: completion.requestUuid,\n\t\t\t\tcorrelationId: completion.getSourceCompletion().correlationId,\n\t\t\t\tproviderId: completion.source.provider.providerId,\n\t\t\t\tlanguageId\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic async accept(editor: ICodeEditor = this._editor, alternativeAction: boolean = false): Promise<void> {\n\t\tif (editor.getModel() !== this.textModel) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\n\t\tlet completion: InlineSuggestionItem;\n\t\tlet isNextEditUri = false;\n\t\tconst state = this.state.get();\n\t\tif (state?.kind === 'ghostText') {\n\t\t\tif (!state || state.primaryGhostText.isEmpty() || !state.inlineSuggestion) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcompletion = state.inlineSuggestion;\n\t\t} else if (state?.kind === 'inlineEdit') {\n\t\t\tcompletion = state.inlineSuggestion;\n\t\t\tisNextEditUri = !!state.nextEditUri;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure the completion list will not be disposed before the text change is sent.\n\t\tcompletion.addRef();\n\n\t\ttry {\n\t\t\tlet followUpTrigger = false;\n\t\t\teditor.pushUndoStop();\n\t\t\tif (isNextEditUri) {\n\t\t\t\t// Do nothing\n\t\t\t} else if (completion.action?.kind === 'edit') {\n\t\t\t\tconst action = completion.action;\n\t\t\t\tif (alternativeAction && action.alternativeAction) {\n\t\t\t\t\tfollowUpTrigger = true;\n\t\t\t\t\tconst altCommand = action.alternativeAction.command;\n\t\t\t\t\tawait this._commandService\n\t\t\t\t\t\t.executeCommand(altCommand.id, ...(altCommand.arguments || []))\n\t\t\t\t\t\t.then(undefined, onUnexpectedExternalError);\n\t\t\t\t} else if (action.snippetInfo) {\n\t\t\t\t\tconst mainEdit = TextReplacement.delete(action.textReplacement.range);\n\t\t\t\t\tconst additionalEdits = completion.additionalTextEdits.map(e => new TextReplacement(Range.lift(e.range), e.text ?? ''));\n\t\t\t\t\tconst edit = TextEdit.fromParallelReplacementsUnsorted([mainEdit, ...additionalEdits]);\n\t\t\t\t\teditor.edit(edit, this._getMetadata(completion, this.textModel.getLanguageId()));\n\n\t\t\t\t\teditor.setPosition(action.snippetInfo.range.getStartPosition(), 'inlineCompletionAccept');\n\t\t\t\t\tSnippetController2.get(editor)?.insert(action.snippetInfo.snippet, { undoStopBefore: false });\n\t\t\t\t} else {\n\t\t\t\t\tconst edits = state.edits;\n\n\t\t\t\t\t// The cursor should move to the end of the edit, not the end of the range provided by the extension\n\t\t\t\t\t// Inline Edit diffs (human readable) the suggestion from the extension so it already removes common suffix/prefix\n\t\t\t\t\t// Inline Completions does diff the suggestion so it may contain common suffix\n\t\t\t\t\tlet minimalEdits = edits;\n\t\t\t\t\tif (state.kind === 'ghostText') {\n\t\t\t\t\t\tminimalEdits = removeTextReplacementCommonSuffixPrefix(edits, this.textModel);\n\t\t\t\t\t}\n\t\t\t\t\tconst selections = getEndPositionsAfterApplying(minimalEdits).map(p => Selection.fromPositions(p));\n\n\t\t\t\t\tconst additionalEdits = completion.additionalTextEdits.map(e => new TextReplacement(Range.lift(e.range), e.text ?? ''));\n\t\t\t\t\tconst edit = TextEdit.fromParallelReplacementsUnsorted([...edits, ...additionalEdits]);\n\n\t\t\t\t\teditor.edit(edit, this._getMetadata(completion, this.textModel.getLanguageId()));\n\n\t\t\t\t\tif (completion.hint === undefined) {\n\t\t\t\t\t\t// do not move the cursor when the completion is displayed in a different location\n\t\t\t\t\t\teditor.setSelections(state.kind === 'inlineEdit' ? selections.slice(-1) : selections, 'inlineCompletionAccept');\n\t\t\t\t\t}\n\n\t\t\t\t\tif (state.kind === 'inlineEdit' && !this._accessibilityService.isMotionReduced()) {\n\t\t\t\t\t\tconst editRanges = edit.getNewRanges();\n\t\t\t\t\t\tconst dec = this._store.add(new FadeoutDecoration(editor, editRanges, () => {\n\t\t\t\t\t\t\tthis._store.delete(dec);\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._onDidAccept.fire();\n\n\t\t\t// Reset before invoking the command, as the command might cause a follow up trigger (which we don't want to reset).\n\t\t\tthis.stop();\n\n\t\t\tif (completion.command) {\n\t\t\t\tawait this._commandService\n\t\t\t\t\t.executeCommand(completion.command.id, ...(completion.command.arguments || []))\n\t\t\t\t\t.then(undefined, onUnexpectedExternalError);\n\t\t\t}\n\n\t\t\t// TODO: how can we make alternative actions to retrigger?\n\t\t\tif (followUpTrigger) {\n\t\t\t\tthis.trigger(undefined);\n\t\t\t}\n\n\t\t\tcompletion.reportEndOfLife({ kind: InlineCompletionEndOfLifeReasonKind.Accepted, alternativeAction });\n\t\t} finally {\n\t\t\tcompletion.removeRef();\n\t\t\tthis._inAcceptFlow.set(true, undefined);\n\t\t\tthis._lastAcceptedInlineCompletionInfo = { textModelVersionIdAfter: this.textModel.getVersionId(), inlineCompletion: completion };\n\t\t}\n\t}\n\n\tpublic async acceptNextWord(): Promise<void> {\n\t\tawait this._acceptNext(this._editor, 'word', (pos, text) => {\n\t\t\tconst langId = this.textModel.getLanguageIdAtPosition(pos.lineNumber, pos.column);\n\t\t\tconst config = this._languageConfigurationService.getLanguageConfiguration(langId);\n\t\t\tconst wordRegExp = new RegExp(config.wordDefinition.source, config.wordDefinition.flags.replace('g', ''));\n\n\t\t\tconst m1 = text.match(wordRegExp);\n\t\t\tlet acceptUntilIndexExclusive = 0;\n\t\t\tif (m1 && m1.index !== undefined) {\n\t\t\t\tif (m1.index === 0) {\n\t\t\t\t\tacceptUntilIndexExclusive = m1[0].length;\n\t\t\t\t} else {\n\t\t\t\t\tacceptUntilIndexExclusive = m1.index;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tacceptUntilIndexExclusive = text.length;\n\t\t\t}\n\n\t\t\tconst wsRegExp = /\\s+/g;\n\t\t\tconst m2 = wsRegExp.exec(text);\n\t\t\tif (m2 && m2.index !== undefined) {\n\t\t\t\tif (m2.index + m2[0].length < acceptUntilIndexExclusive) {\n\t\t\t\t\tacceptUntilIndexExclusive = m2.index + m2[0].length;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acceptUntilIndexExclusive;\n\t\t}, PartialAcceptTriggerKind.Word);\n\t}\n\n\tpublic async acceptNextLine(): Promise<void> {\n\t\tawait this._acceptNext(this._editor, 'line', (pos, text) => {\n\t\t\tconst m = text.match(/\\n/);\n\t\t\tif (m && m.index !== undefined) {\n\t\t\t\treturn m.index + 1;\n\t\t\t}\n\t\t\treturn text.length;\n\t\t}, PartialAcceptTriggerKind.Line);\n\t}\n\n\tprivate async _acceptNext(editor: ICodeEditor, type: 'word' | 'line', getAcceptUntilIndex: (position: Position, text: string) => number, kind: PartialAcceptTriggerKind): Promise<void> {\n\t\tif (editor.getModel() !== this.textModel) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\n\t\tconst state = this.inlineCompletionState.get();\n\t\tif (!state || state.primaryGhostText.isEmpty() || !state.inlineSuggestion) {\n\t\t\treturn;\n\t\t}\n\t\tconst ghostText = state.primaryGhostText;\n\t\tconst completion = state.inlineSuggestion;\n\n\t\tif (completion.snippetInfo) {\n\t\t\t// not in WYSIWYG mode, partial commit might change completion, thus it is not supported\n\t\t\tawait this.accept(editor);\n\t\t\treturn;\n\t\t}\n\n\t\tconst firstPart = ghostText.parts[0];\n\t\tconst ghostTextPos = new Position(ghostText.lineNumber, firstPart.column);\n\t\tconst ghostTextVal = firstPart.text;\n\t\tconst acceptUntilIndexExclusive = getAcceptUntilIndex(ghostTextPos, ghostTextVal);\n\t\tif (acceptUntilIndexExclusive === ghostTextVal.length && ghostText.parts.length === 1) {\n\t\t\tthis.accept(editor);\n\t\t\treturn;\n\t\t}\n\t\tconst partialGhostTextVal = ghostTextVal.substring(0, acceptUntilIndexExclusive);\n\n\t\tconst positions = this._positions.get();\n\t\tconst cursorPosition = positions[0];\n\n\t\t// Executing the edit might free the completion, so we have to hold a reference on it.\n\t\tcompletion.addRef();\n\t\ttry {\n\t\t\tthis._isAcceptingPartially = true;\n\t\t\ttry {\n\t\t\t\teditor.pushUndoStop();\n\t\t\t\tconst replaceRange = Range.fromPositions(cursorPosition, ghostTextPos);\n\t\t\t\tconst newText = editor.getModel()!.getValueInRange(replaceRange) + partialGhostTextVal;\n\t\t\t\tconst primaryEdit = new TextReplacement(replaceRange, newText);\n\t\t\t\tconst edits = [primaryEdit, ...getSecondaryEdits(this.textModel, positions, primaryEdit)].filter(isDefined);\n\t\t\t\tconst selections = getEndPositionsAfterApplying(edits).map(p => Selection.fromPositions(p));\n\n\t\t\t\teditor.edit(TextEdit.fromParallelReplacementsUnsorted(edits), this._getMetadata(completion, type));\n\t\t\t\teditor.setSelections(selections, 'inlineCompletionPartialAccept');\n\t\t\t\teditor.revealPositionInCenterIfOutsideViewport(editor.getPosition()!, ScrollType.Smooth);\n\t\t\t} finally {\n\t\t\t\tthis._isAcceptingPartially = false;\n\t\t\t}\n\n\t\t\tconst acceptedRange = Range.fromPositions(completion.editRange.getStartPosition(), TextLength.ofText(partialGhostTextVal).addToPosition(ghostTextPos));\n\t\t\t// This assumes that the inline completion and the model use the same EOL style.\n\t\t\tconst text = editor.getModel()!.getValueInRange(acceptedRange, EndOfLinePreference.LF);\n\t\t\tconst acceptedLength = text.length;\n\t\t\tcompletion.reportPartialAccept(\n\t\t\t\tacceptedLength,\n\t\t\t\t{ kind, acceptedLength: acceptedLength },\n\t\t\t\t{ characters: acceptUntilIndexExclusive, ratio: acceptUntilIndexExclusive / ghostTextVal.length, count: 1 }\n\t\t\t);\n\n\t\t} finally {\n\t\t\tcompletion.removeRef();\n\t\t}\n\t}\n\n\tpublic handleSuggestAccepted(item: SuggestItemInfo) {\n\t\tconst itemEdit = singleTextRemoveCommonPrefix(item.getSingleTextEdit(), this.textModel);\n\t\tconst augmentedCompletion = this._computeAugmentation(itemEdit, undefined);\n\t\tif (!augmentedCompletion) { return; }\n\n\t\t// This assumes that the inline completion and the model use the same EOL style.\n\t\tconst alreadyAcceptedLength = this.textModel.getValueInRange(augmentedCompletion.completion.editRange, EndOfLinePreference.LF).length;\n\t\tconst acceptedLength = alreadyAcceptedLength + itemEdit.text.length;\n\n\t\taugmentedCompletion.completion.reportPartialAccept(itemEdit.text.length, {\n\t\t\tkind: PartialAcceptTriggerKind.Suggest,\n\t\t\tacceptedLength,\n\t\t}, {\n\t\t\tcharacters: itemEdit.text.length,\n\t\t\tcount: 1,\n\t\t\tratio: 1\n\t\t});\n\t}\n\n\tpublic extractReproSample(): Repro {\n\t\tconst value = this.textModel.getValue();\n\t\tconst item = this.state.get()?.inlineSuggestion;\n\t\treturn {\n\t\t\tdocumentValue: value,\n\t\t\tinlineCompletion: item?.getSourceCompletion(),\n\t\t};\n\t}\n\n\tprivate readonly _jumpedToId = observableValue<undefined | string>(this, undefined);\n\tprivate readonly _inAcceptFlow = observableValue(this, false);\n\tpublic readonly inAcceptFlow: IObservable<boolean> = this._inAcceptFlow;\n\n\tpublic jump(): void {\n\t\tconst s = this.inlineEditState.get();\n\t\tif (!s) { return; }\n\n\t\tconst suggestion = s.inlineSuggestion;\n\t\tsuggestion.addRef();\n\t\ttry {\n\t\t\ttransaction(tx => {\n\t\t\t\tif (suggestion.action?.kind === 'jumpTo') {\n\t\t\t\t\tthis.stop(undefined, tx);\n\t\t\t\t\tsuggestion.reportEndOfLife({ kind: InlineCompletionEndOfLifeReasonKind.Accepted, alternativeAction: false });\n\t\t\t\t}\n\n\t\t\t\tthis._jumpedToId.set(s.inlineSuggestion.semanticId, tx);\n\t\t\t\tthis.dontRefetchSignal.trigger(tx);\n\t\t\t\tconst targetRange = s.inlineSuggestion.targetRange;\n\t\t\t\tconst targetPosition = targetRange.getStartPosition();\n\t\t\t\tthis._editor.setPosition(targetPosition, 'inlineCompletions.jump');\n\n\t\t\t\t// TODO: consider using view information to reveal it\n\t\t\t\tconst isSingleLineChange = targetRange.isSingleLine() && (s.inlineSuggestion.hint || (s.inlineSuggestion.action?.kind === 'edit' && !s.inlineSuggestion.action.textReplacement.text.includes('\\n')));\n\t\t\t\tif (isSingleLineChange || s.inlineSuggestion.action?.kind === 'jumpTo') {\n\t\t\t\t\tthis._editor.revealPosition(targetPosition, ScrollType.Smooth);\n\t\t\t\t} else {\n\t\t\t\t\tconst revealRange = new Range(targetRange.startLineNumber - 1, 1, targetRange.endLineNumber + 1, 1);\n\t\t\t\t\tthis._editor.revealRange(revealRange, ScrollType.Smooth);\n\t\t\t\t}\n\n\t\t\t\ts.inlineSuggestion.identity.setJumpTo(tx);\n\n\t\t\t\tthis._editor.focus();\n\t\t\t});\n\t\t} finally {\n\t\t\tsuggestion.removeRef();\n\t\t}\n\t}\n\n\tpublic async handleInlineSuggestionShown(inlineCompletion: InlineSuggestionItem, viewKind: InlineCompletionViewKind, viewData: InlineCompletionViewData, timeWhenShown: number): Promise<void> {\n\t\tawait inlineCompletion.reportInlineEditShown(this._commandService, viewKind, viewData, this.textModel, timeWhenShown);\n\t}\n}\n\ninterface Repro {\n\tdocumentValue: string;\n\tinlineCompletion: InlineCompletion | undefined;\n}\n\nexport enum VersionIdChangeReason {\n\tUndo,\n\tRedo,\n\tAcceptWord,\n\tOther,\n}\n\nexport function getSecondaryEdits(textModel: ITextModel, positions: readonly Position[], primaryTextRepl: TextReplacement): (TextReplacement | undefined)[] {\n\tif (positions.length === 1) {\n\t\t// No secondary cursor positions\n\t\treturn [];\n\t}\n\tconst text = new TextModelText(textModel);\n\tconst textTransformer = text.getTransformer();\n\tconst primaryOffset = textTransformer.getOffset(positions[0]);\n\tconst secondaryOffsets = positions.slice(1).map(pos => textTransformer.getOffset(pos));\n\n\tprimaryTextRepl = primaryTextRepl.removeCommonPrefixAndSuffix(text);\n\tconst primaryStringRepl = textTransformer.getStringReplacement(primaryTextRepl);\n\n\tconst deltaFromOffsetToRangeStart = primaryStringRepl.replaceRange.start - primaryOffset;\n\tconst primaryContextRange = primaryStringRepl.replaceRange.join(OffsetRange.emptyAt(primaryOffset));\n\tconst primaryContextValue = text.getValueOfOffsetRange(primaryContextRange);\n\n\tconst replacements = secondaryOffsets.map(secondaryOffset => {\n\t\tconst newRangeStart = secondaryOffset + deltaFromOffsetToRangeStart;\n\t\tconst newRangeEnd = newRangeStart + primaryStringRepl.replaceRange.length;\n\t\tconst range = new OffsetRange(newRangeStart, newRangeEnd);\n\n\t\tconst contextRange = range.join(OffsetRange.emptyAt(secondaryOffset));\n\t\tconst contextValue = text.getValueOfOffsetRange(contextRange);\n\t\tif (contextValue !== primaryContextValue) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst stringRepl = new StringReplacement(range, primaryStringRepl.newText);\n\t\tconst repl = textTransformer.getTextReplacement(stringRepl);\n\t\treturn repl;\n\t}).filter(isDefined);\n\n\treturn replacements;\n}\n\nclass FadeoutDecoration extends Disposable {\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tranges: Range[],\n\t\tonDispose?: () => void,\n\t) {\n\t\tsuper();\n\n\t\tif (onDispose) {\n\t\t\tthis._register({ dispose: () => onDispose() });\n\t\t}\n\n\t\tthis._register(observableCodeEditor(editor).setDecorations(constObservable(ranges.map<IModelDeltaDecoration>(range => ({\n\t\t\trange: range,\n\t\t\toptions: {\n\t\t\t\tdescription: 'animation',\n\t\t\t\tclassName: 'edits-fadeout-decoration',\n\t\t\t\tzIndex: 1,\n\t\t\t}\n\t\t})))));\n\n\t\tconst animation = new AnimatedValue(1, 0, 1000, easeOutCubic);\n\t\tconst val = new ObservableAnimatedValue(animation);\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst opacity = val.getValue(reader);\n\t\t\teditor.getContainerDomNode().style.setProperty('--animation-opacity', opacity.toString());\n\t\t\tif (animation.isFinished()) {\n\t\t\t\tthis.dispose();\n\t\t\t}\n\t\t}));\n\t}\n}\n\nexport function isSuggestionInViewport(editor: ICodeEditor, suggestion: InlineSuggestionItem, reader: IReader | undefined = undefined): boolean {\n\tconst targetRange = suggestion.targetRange;\n\n\t// TODO make getVisibleRanges reactive!\n\tobservableCodeEditor(editor).scrollTop.read(reader);\n\tconst visibleRanges = editor.getVisibleRanges();\n\n\tif (visibleRanges.length < 1) {\n\t\treturn false;\n\t}\n\n\tconst viewportRange = new Range(\n\t\tvisibleRanges[0].startLineNumber,\n\t\tvisibleRanges[0].startColumn,\n\t\tvisibleRanges[visibleRanges.length - 1].endLineNumber,\n\t\tvisibleRanges[visibleRanges.length - 1].endColumn\n\t);\n\treturn viewportRange.containsRange(targetRange);\n}\n\nfunction skuFromAccount(account: IDefaultAccount | null): InlineSuggestSku | undefined {\n\tif (account?.access_type_sku && account?.copilot_plan) {\n\t\treturn { type: account.access_type_sku, plan: account.copilot_plan };\n\t}\n\treturn undefined;\n}\n\nclass DisposableCallback<T> {\n\tprivate _cb: ((e: T) => void) | undefined;\n\n\tconstructor(cb: (e: T) => void) {\n\t\tthis._cb = cb;\n\t}\n\n\tdispose(): void {\n\t\tthis._cb = undefined;\n\t}\n\n\treadonly handler = (val: T) => {\n\t\treturn this._cb?.(val);\n\t};\n}\n\nfunction createDisposableCb<T>(cb: (e: T) => void, store: DisposableStore): (e: T) => void {\n\tconst dcb = new DisposableCallback(cb);\n\tstore.add(dcb);\n\treturn dcb.handler;\n}\n"]}
|