monaco-editor-core 0.55.0-dev-20251020 → 0.55.0-dev-20251022
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 +17 -5
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/iconLabel/iconlabel.css +2 -3
- package/esm/vs/base/common/actions.js +5 -0
- package/esm/vs/base/common/actions.js.map +1 -1
- package/esm/vs/base/common/async.js +5 -5
- package/esm/vs/base/common/async.js.map +1 -1
- package/esm/vs/base/common/codiconsLibrary.js +1 -0
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/base/common/policy.js +40 -1
- package/esm/vs/base/common/policy.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +20 -12
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +1 -1
- package/esm/vs/editor/browser/controller/editContext/screenReaderUtils.js +4 -4
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +1 -1
- package/esm/vs/editor/browser/coreCommands.js +3 -3
- package/esm/vs/editor/browser/editorExtensions.js +9 -9
- package/esm/vs/editor/browser/gpu/viewGpuContext.js +1 -1
- package/esm/vs/editor/browser/services/hoverService/hoverWidget.js +1 -3
- package/esm/vs/editor/browser/services/hoverService/hoverWidget.js.map +1 -1
- package/esm/vs/editor/browser/services/hoverService/updatableHoverWidget.js +1 -1
- package/esm/vs/editor/browser/services/inlineCompletionsService.js +4 -4
- package/esm/vs/editor/browser/services/inlineCompletionsService.js.map +1 -1
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/commands.js +12 -12
- package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +14 -14
- package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/copySelection.js +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +7 -7
- package/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +5 -5
- package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +6 -0
- package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +7 -7
- package/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/registrations.contribution.js +5 -5
- package/esm/vs/editor/browser/widget/multiDiffEditor/colors.js +3 -3
- package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +1 -0
- package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +2 -2
- package/esm/vs/editor/common/config/editorConfigurationSchema.js +54 -54
- package/esm/vs/editor/common/config/editorOptions.js +406 -406
- package/esm/vs/editor/common/core/editorColorRegistry.js +68 -68
- package/esm/vs/editor/common/editorContextKeys.js +46 -46
- 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 +10 -10
- 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 +6 -6
- 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/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/folding/browser/foldingDecorations.js.map +1 -1
- 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/glyphHoverWidget.js +22 -2
- package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js.map +1 -1
- 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/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 +18 -51
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +12 -12
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js +2 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +0 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/telemetry.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
- 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 +35 -28
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js.map +1 -1
- 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 +8 -11
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js.map +1 -1
- 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 +8 -8
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +10 -10
- 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 +1 -1
- 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/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 +7 -7
- package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
- package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
- package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
- 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/theme/common/colorUtils.js +2 -2
- package/esm/vs/platform/theme/common/colors/baseColors.js +17 -17
- 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 +15 -15
- 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
- package/version.txt +1 -1
|
@@ -330,7 +330,6 @@ let InlineCompletionsSource = class InlineCompletionsSource extends Disposable {
|
|
|
330
330
|
return;
|
|
331
331
|
}
|
|
332
332
|
const emptyEndOfLifeEvent = {
|
|
333
|
-
id: requestResponseInfo.requestUuid,
|
|
334
333
|
opportunityId: requestResponseInfo.requestUuid,
|
|
335
334
|
noSuggestionReason: requestResponseInfo.noSuggestionReason ?? 'unknown',
|
|
336
335
|
extensionId: 'vscode-core',
|
package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.ts","vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;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AC;CACD;AAED,kDAAkD;AAClD,SAAS,aAAa,CAAI,KAAU,EAAE,GAAyB;IAC9D,MAAM,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;IACvB,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QAC1B,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;QACpB,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YACjB,OAAO,KAAK,CAAC;QACd,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACZ,OAAO,IAAI,CAAC;IACb,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAI,IAAO,EAAE,KAAU;IAC1C,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC;QAChB,OAAO,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC","file":"inlineCompletionsSource.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 { booleanComparator, compareBy, compareUndefinedSmallest, numberComparator } from '../../../../../base/common/arrays.js';\nimport { findLastMax } from '../../../../../base/common/arraysFind.js';\nimport { RunOnceScheduler } from '../../../../../base/common/async.js';\nimport { CancellationTokenSource } from '../../../../../base/common/cancellation.js';\nimport { equalsIfDefined, itemEquals } from '../../../../../base/common/equals.js';\nimport { Disposable, DisposableStore, IDisposable, MutableDisposable, toDisposable } from '../../../../../base/common/lifecycle.js';\nimport { derived, IObservable, IObservableWithChange, ITransaction, observableValue, recordChangesLazy, transaction } from '../../../../../base/common/observable.js';\n// eslint-disable-next-line local/code-no-deep-import-of-internal\nimport { observableReducerSettable } from '../../../../../base/common/observableInternal/experimental/reducer.js';\nimport { isDefined, isObject } from '../../../../../base/common/types.js';\nimport { IConfigurationService } from '../../../../../platform/configuration/common/configuration.js';\nimport { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js';\nimport { DataChannelForwardingTelemetryService, forwardToChannelIf, isCopilotLikeExtension } from '../../../../../platform/dataChannel/browser/forwardingTelemetryService.js';\nimport { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';\nimport { ILogService } from '../../../../../platform/log/common/log.js';\nimport { observableConfigValue } from '../../../../../platform/observable/common/platformObservableUtils.js';\nimport product from '../../../../../platform/product/common/product.js';\nimport { StringEdit } from '../../../../common/core/edits/stringEdit.js';\nimport { Position } from '../../../../common/core/position.js';\nimport { InlineCompletionEndOfLifeReasonKind, InlineCompletionTriggerKind, InlineCompletionsProvider } from '../../../../common/languages.js';\nimport { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js';\nimport { ITextModel } from '../../../../common/model.js';\nimport { offsetEditFromContentChanges } from '../../../../common/model/textModelStringEdit.js';\nimport { IFeatureDebounceInformation } from '../../../../common/services/languageFeatureDebounce.js';\nimport { IModelContentChangedEvent } from '../../../../common/textModelEvents.js';\nimport { formatRecordableLogEntry, IRecordableEditorLogEntry, IRecordableLogEntry, StructuredLogger } from '../structuredLogger.js';\nimport { InlineCompletionEndOfLifeEvent, sendInlineCompletionsEndOfLifeTelemetry } from '../telemetry.js';\nimport { wait } from '../utils.js';\nimport { InlineSuggestionIdentity, InlineSuggestionItem } from './inlineSuggestionItem.js';\nimport { InlineCompletionContextWithoutUuid, InlineSuggestRequestInfo, provideInlineCompletions, runWhenCancelled } from './provideInlineCompletions.js';\n\nexport class InlineCompletionsSource extends Disposable {\n\tprivate static _requestId = 0;\n\n\tprivate readonly _updateOperation = this._register(new MutableDisposable<UpdateOperation>());\n\n\tprivate readonly _loggingEnabled;\n\tprivate readonly _sendRequestData;\n\n\tprivate readonly _structuredFetchLogger;\n\n\tprivate readonly _state = observableReducerSettable(this, {\n\t\tinitial: () => ({\n\t\t\tinlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t\tsuggestWidgetInlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t}),\n\t\tdisposeFinal: (values) => {\n\t\t\tvalues.inlineCompletions.dispose();\n\t\t\tvalues.suggestWidgetInlineCompletions.dispose();\n\t\t},\n\t\tchangeTracker: recordChangesLazy(() => ({ versionId: this._versionId })),\n\t\tupdate: (reader, previousValue, changes) => {\n\t\t\tconst edit = StringEdit.compose(changes.changes.map(c => c.change ? offsetEditFromContentChanges(c.change.changes) : StringEdit.empty).filter(isDefined));\n\n\t\t\tif (edit.isEmpty()) {\n\t\t\t\treturn previousValue;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn {\n\t\t\t\t\tinlineCompletions: previousValue.inlineCompletions.createStateWithAppliedEdit(edit, this._textModel),\n\t\t\t\t\tsuggestWidgetInlineCompletions: previousValue.suggestWidgetInlineCompletions.createStateWithAppliedEdit(edit, this._textModel),\n\t\t\t\t};\n\t\t\t} finally {\n\t\t\t\tpreviousValue.inlineCompletions.dispose();\n\t\t\t\tpreviousValue.suggestWidgetInlineCompletions.dispose();\n\t\t\t}\n\t\t}\n\t});\n\n\tpublic readonly inlineCompletions = this._state.map(this, v => v.inlineCompletions);\n\tpublic readonly suggestWidgetInlineCompletions = this._state.map(this, v => v.suggestWidgetInlineCompletions);\n\n\tprivate _completionsEnabled: Record<string, boolean> | undefined = undefined;\n\n\tconstructor(\n\t\tprivate readonly _textModel: ITextModel,\n\t\tprivate readonly _versionId: IObservableWithChange<number | null, IModelContentChangedEvent | undefined>,\n\t\tprivate readonly _debounceValue: IFeatureDebounceInformation,\n\t\tprivate readonly _cursorPosition: IObservable<Position>,\n\t\t@ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService,\n\t\t@ILogService private readonly _logService: ILogService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t) {\n\t\tsuper();\n\t\tthis._loggingEnabled = observableConfigValue('editor.inlineSuggest.logFetch', false, this._configurationService).recomputeInitiallyAndOnChange(this._store);\n\t\tthis._sendRequestData = observableConfigValue('editor.inlineSuggest.emptyResponseInformation', true, this._configurationService).recomputeInitiallyAndOnChange(this._store);\n\t\tthis._structuredFetchLogger = this._register(this._instantiationService.createInstance(StructuredLogger.cast<\n\t\t\t{ kind: 'start'; requestId: number; context: unknown } & IRecordableEditorLogEntry\n\t\t\t| { kind: 'end'; error: unknown; durationMs: number; result: unknown; requestId: number } & IRecordableLogEntry\n\t\t>(),\n\t\t\t'editor.inlineSuggest.logFetch.commandId'\n\t\t));\n\n\t\tthis.clearOperationOnTextModelChange.recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst enablementSetting = product.defaultChatAgent?.completionsEnablementSetting ?? undefined;\n\t\tif (enablementSetting) {\n\t\t\tthis._updateCompletionsEnablement(enablementSetting);\n\t\t\tthis._register(this._configurationService.onDidChangeConfiguration(e => {\n\t\t\t\tif (e.affectsConfiguration(enablementSetting)) {\n\t\t\t\t\tthis._updateCompletionsEnablement(enablementSetting);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\t}\n\n\tprivate _updateCompletionsEnablement(enalementSetting: string) {\n\t\tconst result = this._configurationService.getValue<Record<string, boolean>>(enalementSetting);\n\t\tif (!isObject(result)) {\n\t\t\tthis._completionsEnabled = undefined;\n\t\t} else {\n\t\t\tthis._completionsEnabled = result;\n\t\t}\n\t}\n\n\tpublic readonly clearOperationOnTextModelChange = derived(this, reader => {\n\t\tthis._versionId.read(reader);\n\t\tthis._updateOperation.clear();\n\t\treturn undefined; // always constant\n\t});\n\n\tprivate _log(entry:\n\t\t{ sourceId: string; kind: 'start'; requestId: number; context: unknown; provider: string | undefined } & IRecordableEditorLogEntry\n\t\t| { sourceId: string; kind: 'end'; error: unknown; durationMs: number; result: unknown; requestId: number; didAllProvidersReturn: boolean } & IRecordableLogEntry\n\t) {\n\t\tif (this._loggingEnabled.get()) {\n\t\t\tthis._logService.info(formatRecordableLogEntry(entry));\n\t\t}\n\t\tthis._structuredFetchLogger.log(entry);\n\t}\n\n\tprivate readonly _loadingCount = observableValue(this, 0);\n\n\tpublic fetch(\n\t\tproviders: InlineCompletionsProvider[],\n\t\tprovidersLabel: string | undefined,\n\t\tcontext: InlineCompletionContextWithoutUuid,\n\t\tactiveInlineCompletion: InlineSuggestionIdentity | undefined,\n\t\twithDebounce: boolean,\n\t\tuserJumpedToActiveCompletion: IObservable<boolean>,\n\t\trequestInfo: InlineSuggestRequestInfo\n\t): Promise<boolean> {\n\t\tconst position = this._cursorPosition.get();\n\t\tconst request = new UpdateRequest(position, context, this._textModel.getVersionId(), new Set(providers));\n\n\t\tconst target = context.selectedSuggestionInfo ? this.suggestWidgetInlineCompletions.get() : this.inlineCompletions.get();\n\n\t\tif (this._updateOperation.value?.request.satisfies(request)) {\n\t\t\treturn this._updateOperation.value.promise;\n\t\t} else if (target?.request?.satisfies(request)) {\n\t\t\treturn Promise.resolve(true);\n\t\t}\n\n\t\tconst updateOngoing = !!this._updateOperation.value;\n\t\tthis._updateOperation.clear();\n\n\t\tconst source = new CancellationTokenSource();\n\n\t\tconst promise = (async () => {\n\t\t\tconst store = new DisposableStore();\n\n\t\t\tthis._loadingCount.set(this._loadingCount.get() + 1, undefined);\n\t\t\tlet didDecrease = false;\n\t\t\tconst decreaseLoadingCount = () => {\n\t\t\t\tif (!didDecrease) {\n\t\t\t\t\tdidDecrease = true;\n\t\t\t\t\tthis._loadingCount.set(this._loadingCount.get() - 1, undefined);\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst loadingReset = store.add(new RunOnceScheduler(() => decreaseLoadingCount(), 10 * 1000));\n\t\t\tloadingReset.schedule();\n\n\t\t\tconst inlineSuggestionsProviders = providers.filter(p => p.providerId);\n\t\t\tconst requestResponseInfo = new RequestResponseData(context, requestInfo, inlineSuggestionsProviders);\n\n\n\t\t\ttry {\n\t\t\t\tconst recommendedDebounceValue = this._debounceValue.get(this._textModel);\n\t\t\t\tconst debounceValue = findLastMax(\n\t\t\t\t\tproviders.map(p => p.debounceDelayMs),\n\t\t\t\t\tcompareUndefinedSmallest(numberComparator)\n\t\t\t\t) ?? recommendedDebounceValue;\n\n\t\t\t\t// Debounce in any case if update is ongoing\n\t\t\t\tconst shouldDebounce = updateOngoing || (withDebounce && context.triggerKind === InlineCompletionTriggerKind.Automatic);\n\t\t\t\tif (shouldDebounce) {\n\t\t\t\t\t// This debounces the operation\n\t\t\t\t\tawait wait(debounceValue, source.token);\n\t\t\t\t}\n\n\t\t\t\tif (source.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== request.versionId) {\n\t\t\t\t\trequestResponseInfo.setNoSuggestionReasonIfNotSet('canceled:beforeFetch');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tconst requestId = InlineCompletionsSource._requestId++;\n\t\t\t\tif (this._loggingEnabled.get() || this._structuredFetchLogger.isEnabled.get()) {\n\t\t\t\t\tthis._log({\n\t\t\t\t\t\tsourceId: 'InlineCompletions.fetch',\n\t\t\t\t\t\tkind: 'start',\n\t\t\t\t\t\trequestId,\n\t\t\t\t\t\tmodelUri: this._textModel.uri,\n\t\t\t\t\t\tmodelVersion: this._textModel.getVersionId(),\n\t\t\t\t\t\tcontext: { triggerKind: context.triggerKind, suggestInfo: context.selectedSuggestionInfo ? true : undefined },\n\t\t\t\t\t\ttime: Date.now(),\n\t\t\t\t\t\tprovider: providersLabel,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tconst startTime = new Date();\n\t\t\t\tconst providerResult = provideInlineCompletions(providers, this._cursorPosition.get(), this._textModel, context, requestInfo, this._languageConfigurationService);\n\n\t\t\t\trunWhenCancelled(source.token, () => providerResult.cancelAndDispose({ kind: 'tokenCancellation' }));\n\n\t\t\t\tlet shouldStopEarly = false;\n\t\t\t\tlet producedSuggestion = false;\n\n\t\t\t\tconst suggestions: InlineSuggestionItem[] = [];\n\t\t\t\tfor await (const list of providerResult.lists) {\n\t\t\t\t\tif (!list) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tlist.addRef();\n\t\t\t\t\tstore.add(toDisposable(() => list.removeRef(list.inlineSuggestionsData.length === 0 ? { kind: 'empty' } : { kind: 'notTaken' })));\n\n\t\t\t\t\tfor (const item of list.inlineSuggestionsData) {\n\t\t\t\t\t\tproducedSuggestion = true;\n\t\t\t\t\t\tif (!context.includeInlineEdits && (item.isInlineEdit || item.showInlineEditMenu)) {\n\t\t\t\t\t\t\titem.setNotShownReason('notInlineEditRequested');\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!context.includeInlineCompletions && !(item.isInlineEdit || item.showInlineEditMenu)) {\n\t\t\t\t\t\t\titem.setNotShownReason('notInlineCompletionRequested');\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst i = InlineSuggestionItem.create(item, this._textModel);\n\t\t\t\t\t\tsuggestions.push(i);\n\t\t\t\t\t\t// Stop after first visible inline completion\n\t\t\t\t\t\tif (!i.isInlineEdit && !i.showInlineEditMenu && context.triggerKind === InlineCompletionTriggerKind.Automatic) {\n\t\t\t\t\t\t\tif (i.isVisible(this._textModel, this._cursorPosition.get())) {\n\t\t\t\t\t\t\t\tshouldStopEarly = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (shouldStopEarly) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tproviderResult.cancelAndDispose({ kind: 'lostRace' });\n\n\t\t\t\tif (this._loggingEnabled.get() || this._structuredFetchLogger.isEnabled.get()) {\n\t\t\t\t\tconst didAllProvidersReturn = providerResult.didAllProvidersReturn;\n\t\t\t\t\tlet error: string | undefined = undefined;\n\t\t\t\t\tif (source.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== request.versionId) {\n\t\t\t\t\t\terror = 'canceled';\n\t\t\t\t\t}\n\t\t\t\t\tconst result = suggestions.map(c => ({\n\t\t\t\t\t\trange: c.editRange.toString(),\n\t\t\t\t\t\ttext: c.insertText,\n\t\t\t\t\t\tisInlineEdit: !!c.isInlineEdit,\n\t\t\t\t\t\tsource: c.source.provider.groupId,\n\t\t\t\t\t}));\n\t\t\t\t\tthis._log({ sourceId: 'InlineCompletions.fetch', kind: 'end', requestId, durationMs: (Date.now() - startTime.getTime()), error, result, time: Date.now(), didAllProvidersReturn });\n\t\t\t\t}\n\n\t\t\t\trequestResponseInfo.setRequestUuid(providerResult.contextWithUuid.requestUuid);\n\t\t\t\tif (producedSuggestion) {\n\t\t\t\t\trequestResponseInfo.setHasProducedSuggestion();\n\t\t\t\t\tif (suggestions.length > 0 && source.token.isCancellationRequested) {\n\t\t\t\t\t\tsuggestions.forEach(s => s.setNotShownReasonIfNotSet('canceled:whileAwaitingOtherProviders'));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (source.token.isCancellationRequested) {\n\t\t\t\t\t\trequestResponseInfo.setNoSuggestionReasonIfNotSet('canceled:whileFetching');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst completionsQuotaExceeded = this._contextKeyService.getContextKeyValue<boolean>('completionsQuotaExceeded');\n\t\t\t\t\t\trequestResponseInfo.setNoSuggestionReasonIfNotSet(completionsQuotaExceeded ? 'completionsQuotaExceeded' : 'noSuggestion');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst remainingTimeToWait = context.earliestShownDateTime - Date.now();\n\t\t\t\tif (remainingTimeToWait > 0) {\n\t\t\t\t\tawait wait(remainingTimeToWait, source.token);\n\t\t\t\t}\n\n\t\t\t\tif (source.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== request.versionId\n\t\t\t\t\t|| userJumpedToActiveCompletion.get() /* In the meantime the user showed interest for the active completion so dont hide it */) {\n\t\t\t\t\tconst notShownReason =\n\t\t\t\t\t\tsource.token.isCancellationRequested ? 'canceled:afterMinShowDelay' :\n\t\t\t\t\t\t\tthis._store.isDisposed ? 'canceled:disposed' :\n\t\t\t\t\t\t\t\tthis._textModel.getVersionId() !== request.versionId ? 'canceled:documentChanged' :\n\t\t\t\t\t\t\t\t\tuserJumpedToActiveCompletion.get() ? 'canceled:userJumped' :\n\t\t\t\t\t\t\t\t\t\t'unknown';\n\t\t\t\t\tsuggestions.forEach(s => s.setNotShownReasonIfNotSet(notShownReason));\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tconst endTime = new Date();\n\t\t\t\tthis._debounceValue.update(this._textModel, endTime.getTime() - startTime.getTime());\n\n\t\t\t\tconst cursorPosition = this._cursorPosition.get();\n\t\t\t\tthis._updateOperation.clear();\n\t\t\t\ttransaction(tx => {\n\t\t\t\t\t/** @description Update completions with provider result */\n\t\t\t\t\tconst v = this._state.get();\n\n\t\t\t\t\tif (context.selectedSuggestionInfo) {\n\t\t\t\t\t\tthis._state.set({\n\t\t\t\t\t\t\tinlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t\t\t\t\t\tsuggestWidgetInlineCompletions: v.suggestWidgetInlineCompletions.createStateWithAppliedResults(suggestions, request, this._textModel, cursorPosition, activeInlineCompletion),\n\t\t\t\t\t\t}, tx);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._state.set({\n\t\t\t\t\t\t\tinlineCompletions: v.inlineCompletions.createStateWithAppliedResults(suggestions, request, this._textModel, cursorPosition, activeInlineCompletion),\n\t\t\t\t\t\t\tsuggestWidgetInlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t\t\t\t\t}, tx);\n\t\t\t\t\t}\n\n\t\t\t\t\tv.inlineCompletions.dispose();\n\t\t\t\t\tv.suggestWidgetInlineCompletions.dispose();\n\t\t\t\t});\n\t\t\t} finally {\n\t\t\t\tstore.dispose();\n\t\t\t\tdecreaseLoadingCount();\n\t\t\t\tthis.sendInlineCompletionsRequestTelemetry(requestResponseInfo);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t})();\n\n\t\tconst updateOperation = new UpdateOperation(request, source, promise);\n\t\tthis._updateOperation.value = updateOperation;\n\n\t\treturn promise;\n\t}\n\n\tpublic clear(tx: ITransaction): void {\n\t\tthis._updateOperation.clear();\n\t\tconst v = this._state.get();\n\t\tthis._state.set({\n\t\t\tinlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t\tsuggestWidgetInlineCompletions: InlineCompletionsState.createEmpty()\n\t\t}, tx);\n\t\tv.inlineCompletions.dispose();\n\t\tv.suggestWidgetInlineCompletions.dispose();\n\t}\n\n\tpublic seedInlineCompletionsWithSuggestWidget(): void {\n\t\tconst inlineCompletions = this.inlineCompletions.get();\n\t\tconst suggestWidgetInlineCompletions = this.suggestWidgetInlineCompletions.get();\n\t\tif (!suggestWidgetInlineCompletions) {\n\t\t\treturn;\n\t\t}\n\t\ttransaction(tx => {\n\t\t\t/** @description Seed inline completions with (newer) suggest widget inline completions */\n\t\t\tif (!inlineCompletions || (suggestWidgetInlineCompletions.request?.versionId ?? -1) > (inlineCompletions.request?.versionId ?? -1)) {\n\t\t\t\tinlineCompletions?.dispose();\n\t\t\t\tconst s = this._state.get();\n\t\t\t\tthis._state.set({\n\t\t\t\t\tinlineCompletions: suggestWidgetInlineCompletions.clone(),\n\t\t\t\t\tsuggestWidgetInlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t\t\t}, tx);\n\t\t\t\ts.inlineCompletions.dispose();\n\t\t\t\ts.suggestWidgetInlineCompletions.dispose();\n\t\t\t}\n\t\t\tthis.clearSuggestWidgetInlineCompletions(tx);\n\t\t});\n\t}\n\n\tprivate sendInlineCompletionsRequestTelemetry(\n\t\trequestResponseInfo: RequestResponseData\n\t): void {\n\t\tif (!this._sendRequestData.get() && !this._contextKeyService.getContextKeyValue<boolean>('isRunningUnificationExperiment')) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (requestResponseInfo.requestUuid === undefined || requestResponseInfo.hasProducedSuggestion) {\n\t\t\treturn;\n\t\t}\n\n\n\t\tif (!isCompletionsEnabled(this._completionsEnabled, this._textModel.getLanguageId())) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!requestResponseInfo.providers.some(p => isCopilotLikeExtension(p.providerId?.extensionId))) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst emptyEndOfLifeEvent: InlineCompletionEndOfLifeEvent = {\n\t\t\tid: requestResponseInfo.requestUuid,\n\t\t\topportunityId: requestResponseInfo.requestUuid,\n\t\t\tnoSuggestionReason: requestResponseInfo.noSuggestionReason ?? 'unknown',\n\t\t\textensionId: 'vscode-core',\n\t\t\textensionVersion: '0.0.0',\n\t\t\tgroupId: 'empty',\n\t\t\tshown: false,\n\t\t\teditorType: requestResponseInfo.requestInfo.editorType,\n\t\t\trequestReason: requestResponseInfo.requestInfo.reason,\n\t\t\ttypingInterval: requestResponseInfo.requestInfo.typingInterval,\n\t\t\ttypingIntervalCharacterCount: requestResponseInfo.requestInfo.typingIntervalCharacterCount,\n\t\t\tlanguageId: requestResponseInfo.requestInfo.languageId,\n\t\t\tselectedSuggestionInfo: !!requestResponseInfo.context.selectedSuggestionInfo,\n\t\t\tavailableProviders: requestResponseInfo.providers.map(p => p.providerId?.toString()).filter(isDefined).join(','),\n\t\t\t...forwardToChannelIf(requestResponseInfo.providers.some(p => isCopilotLikeExtension(p.providerId?.extensionId))),\n\t\t\ttimeUntilProviderRequest: undefined,\n\t\t\ttimeUntilProviderResponse: undefined,\n\t\t\tviewKind: undefined,\n\t\t\tpreceeded: undefined,\n\t\t\terror: undefined,\n\t\t\tsuperseded: undefined,\n\t\t\treason: undefined,\n\t\t\tcorrelationId: undefined,\n\t\t\tshownDuration: undefined,\n\t\t\tshownDurationUncollapsed: undefined,\n\t\t\ttimeUntilShown: undefined,\n\t\t\tpartiallyAccepted: undefined,\n\t\t\tpartiallyAcceptedCountSinceOriginal: undefined,\n\t\t\tpartiallyAcceptedRatioSinceOriginal: undefined,\n\t\t\tpartiallyAcceptedCharactersSinceOriginal: undefined,\n\t\t\tcursorColumnDistance: undefined,\n\t\t\tcursorLineDistance: undefined,\n\t\t\tlineCountOriginal: undefined,\n\t\t\tlineCountModified: undefined,\n\t\t\tcharacterCountOriginal: undefined,\n\t\t\tcharacterCountModified: undefined,\n\t\t\tdisjointReplacements: undefined,\n\t\t\tsameShapeReplacements: undefined,\n\t\t\tnotShownReason: undefined,\n\t\t};\n\n\t\tconst dataChannel = this._instantiationService.createInstance(DataChannelForwardingTelemetryService);\n\t\tsendInlineCompletionsEndOfLifeTelemetry(dataChannel, emptyEndOfLifeEvent);\n\t}\n\n\tpublic clearSuggestWidgetInlineCompletions(tx: ITransaction): void {\n\t\tif (this._updateOperation.value?.request.context.selectedSuggestionInfo) {\n\t\t\tthis._updateOperation.clear();\n\t\t}\n\t}\n\n\tpublic cancelUpdate(): void {\n\t\tthis._updateOperation.clear();\n\t}\n}\n\nclass UpdateRequest {\n\tconstructor(\n\t\tpublic readonly position: Position,\n\t\tpublic readonly context: InlineCompletionContextWithoutUuid,\n\t\tpublic readonly versionId: number,\n\t\tpublic readonly providers: Set<InlineCompletionsProvider>,\n\t) {\n\t}\n\n\tpublic satisfies(other: UpdateRequest): boolean {\n\t\treturn this.position.equals(other.position)\n\t\t\t&& equalsIfDefined(this.context.selectedSuggestionInfo, other.context.selectedSuggestionInfo, itemEquals())\n\t\t\t&& (other.context.triggerKind === InlineCompletionTriggerKind.Automatic\n\t\t\t\t|| this.context.triggerKind === InlineCompletionTriggerKind.Explicit)\n\t\t\t&& this.versionId === other.versionId\n\t\t\t&& isSubset(other.providers, this.providers);\n\t}\n}\n\nclass RequestResponseData {\n\tpublic requestUuid: string | undefined;\n\tpublic noSuggestionReason: string | undefined;\n\tpublic hasProducedSuggestion = false;\n\n\tconstructor(\n\t\tpublic readonly context: InlineCompletionContextWithoutUuid,\n\t\tpublic readonly requestInfo: InlineSuggestRequestInfo,\n\t\tpublic readonly providers: InlineCompletionsProvider[],\n\t) { }\n\n\tsetRequestUuid(uuid: string) {\n\t\tthis.requestUuid = uuid;\n\t}\n\n\tsetNoSuggestionReasonIfNotSet(type: string) {\n\t\tthis.noSuggestionReason ??= type;\n\t}\n\n\tsetHasProducedSuggestion() {\n\t\tthis.hasProducedSuggestion = true;\n\t}\n}\n\nfunction isSubset<T>(set1: Set<T>, set2: Set<T>): boolean {\n\treturn [...set1].every(item => set2.has(item));\n}\n\nfunction isCompletionsEnabled(completionsEnablementObject: Record<string, boolean> | undefined, modeId: string = '*'): boolean {\n\tif (completionsEnablementObject === undefined) {\n\t\treturn false; // default to disabled if setting is not available\n\t}\n\n\tif (typeof completionsEnablementObject[modeId] !== 'undefined') {\n\t\treturn Boolean(completionsEnablementObject[modeId]); // go with setting if explicitly defined\n\t}\n\n\treturn Boolean(completionsEnablementObject['*']); // fallback to global setting otherwise\n}\n\nclass UpdateOperation implements IDisposable {\n\tconstructor(\n\t\tpublic readonly request: UpdateRequest,\n\t\tpublic readonly cancellationTokenSource: CancellationTokenSource,\n\t\tpublic readonly promise: Promise<boolean>,\n\t) {\n\t}\n\n\tdispose() {\n\t\tthis.cancellationTokenSource.cancel();\n\t}\n}\n\nclass InlineCompletionsState extends Disposable {\n\tpublic static createEmpty(): InlineCompletionsState {\n\t\treturn new InlineCompletionsState([], undefined);\n\t}\n\n\tconstructor(\n\t\tpublic readonly inlineCompletions: readonly InlineSuggestionItem[],\n\t\tpublic readonly request: UpdateRequest | undefined,\n\t) {\n\t\tfor (const inlineCompletion of inlineCompletions) {\n\t\t\tinlineCompletion.addRef();\n\t\t}\n\n\t\tsuper();\n\n\t\tthis._register({\n\t\t\tdispose: () => {\n\t\t\t\tfor (const inlineCompletion of this.inlineCompletions) {\n\t\t\t\t\tinlineCompletion.removeRef();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _findById(id: InlineSuggestionIdentity): InlineSuggestionItem | undefined {\n\t\treturn this.inlineCompletions.find(i => i.identity === id);\n\t}\n\n\tprivate _findByHash(hash: string): InlineSuggestionItem | undefined {\n\t\treturn this.inlineCompletions.find(i => i.hash === hash);\n\t}\n\n\t/**\n\t * Applies the edit on the state.\n\t*/\n\tpublic createStateWithAppliedEdit(edit: StringEdit, textModel: ITextModel): InlineCompletionsState {\n\t\tconst newInlineCompletions = this.inlineCompletions.map(i => i.withEdit(edit, textModel)).filter(isDefined);\n\t\treturn new InlineCompletionsState(newInlineCompletions, this.request);\n\t}\n\n\tpublic createStateWithAppliedResults(updatedSuggestions: InlineSuggestionItem[], request: UpdateRequest, textModel: ITextModel, cursorPosition: Position, itemIdToPreserveAtTop: InlineSuggestionIdentity | undefined): InlineCompletionsState {\n\t\tlet itemToPreserve: InlineSuggestionItem | undefined = undefined;\n\t\tif (itemIdToPreserveAtTop) {\n\t\t\tconst itemToPreserveCandidate = this._findById(itemIdToPreserveAtTop);\n\t\t\tif (itemToPreserveCandidate && itemToPreserveCandidate.canBeReused(textModel, request.position)) {\n\t\t\t\titemToPreserve = itemToPreserveCandidate;\n\n\t\t\t\tconst updatedItemToPreserve = updatedSuggestions.find(i => i.hash === itemToPreserveCandidate.hash);\n\t\t\t\tif (updatedItemToPreserve) {\n\t\t\t\t\tupdatedSuggestions = moveToFront(updatedItemToPreserve, updatedSuggestions);\n\t\t\t\t} else {\n\t\t\t\t\tupdatedSuggestions = [itemToPreserveCandidate, ...updatedSuggestions];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst preferInlineCompletions = itemToPreserve\n\t\t\t// itemToPreserve has precedence\n\t\t\t? !itemToPreserve.isInlineEdit\n\t\t\t// Otherwise: prefer inline completion if there is a visible one\n\t\t\t: updatedSuggestions.some(i => !i.isInlineEdit && i.isVisible(textModel, cursorPosition));\n\n\t\tlet updatedItems: InlineSuggestionItem[] = [];\n\t\tfor (const i of updatedSuggestions) {\n\t\t\tconst oldItem = this._findByHash(i.hash);\n\t\t\tlet item;\n\t\t\tif (oldItem && oldItem !== i) {\n\t\t\t\titem = i.withIdentity(oldItem.identity);\n\t\t\t\ti.setIsPreceeded(oldItem);\n\t\t\t\toldItem.setEndOfLifeReason({ kind: InlineCompletionEndOfLifeReasonKind.Ignored, userTypingDisagreed: false, supersededBy: i.getSourceCompletion() });\n\t\t\t} else {\n\t\t\t\titem = i;\n\t\t\t}\n\t\t\tif (preferInlineCompletions !== item.isInlineEdit) {\n\t\t\t\tupdatedItems.push(item);\n\t\t\t}\n\t\t}\n\n\t\tupdatedItems.sort(compareBy(i => i.showInlineEditMenu, booleanComparator));\n\t\tupdatedItems = distinctByKey(updatedItems, i => i.semanticId);\n\n\t\treturn new InlineCompletionsState(updatedItems, request);\n\t}\n\n\tpublic clone(): InlineCompletionsState {\n\t\treturn new InlineCompletionsState(this.inlineCompletions, this.request);\n\t}\n}\n\n/** Keeps the first item in case of duplicates. */\nfunction distinctByKey<T>(items: T[], key: (item: T) => unknown): T[] {\n\tconst seen = new Set();\n\treturn items.filter(item => {\n\t\tconst k = key(item);\n\t\tif (seen.has(k)) {\n\t\t\treturn false;\n\t\t}\n\t\tseen.add(k);\n\t\treturn true;\n\t});\n}\n\nfunction moveToFront<T>(item: T, items: T[]): T[] {\n\tconst index = items.indexOf(item);\n\tif (index > -1) {\n\t\treturn [item, ...items.slice(0, index), ...items.slice(index + 1)];\n\t}\n\treturn items;\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 { booleanComparator, compareBy, compareUndefinedSmallest, numberComparator } from '../../../../../base/common/arrays.js';\nimport { findLastMax } from '../../../../../base/common/arraysFind.js';\nimport { RunOnceScheduler } from '../../../../../base/common/async.js';\nimport { CancellationTokenSource } from '../../../../../base/common/cancellation.js';\nimport { equalsIfDefined, itemEquals } from '../../../../../base/common/equals.js';\nimport { Disposable, DisposableStore, IDisposable, MutableDisposable, toDisposable } from '../../../../../base/common/lifecycle.js';\nimport { derived, IObservable, IObservableWithChange, ITransaction, observableValue, recordChangesLazy, transaction } from '../../../../../base/common/observable.js';\n// eslint-disable-next-line local/code-no-deep-import-of-internal\nimport { observableReducerSettable } from '../../../../../base/common/observableInternal/experimental/reducer.js';\nimport { isDefined, isObject } from '../../../../../base/common/types.js';\nimport { IConfigurationService } from '../../../../../platform/configuration/common/configuration.js';\nimport { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js';\nimport { DataChannelForwardingTelemetryService, forwardToChannelIf, isCopilotLikeExtension } from '../../../../../platform/dataChannel/browser/forwardingTelemetryService.js';\nimport { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';\nimport { ILogService } from '../../../../../platform/log/common/log.js';\nimport { observableConfigValue } from '../../../../../platform/observable/common/platformObservableUtils.js';\nimport product from '../../../../../platform/product/common/product.js';\nimport { StringEdit } from '../../../../common/core/edits/stringEdit.js';\nimport { Position } from '../../../../common/core/position.js';\nimport { InlineCompletionEndOfLifeReasonKind, InlineCompletionTriggerKind, InlineCompletionsProvider } from '../../../../common/languages.js';\nimport { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js';\nimport { ITextModel } from '../../../../common/model.js';\nimport { offsetEditFromContentChanges } from '../../../../common/model/textModelStringEdit.js';\nimport { IFeatureDebounceInformation } from '../../../../common/services/languageFeatureDebounce.js';\nimport { IModelContentChangedEvent } from '../../../../common/textModelEvents.js';\nimport { formatRecordableLogEntry, IRecordableEditorLogEntry, IRecordableLogEntry, StructuredLogger } from '../structuredLogger.js';\nimport { InlineCompletionEndOfLifeEvent, sendInlineCompletionsEndOfLifeTelemetry } from '../telemetry.js';\nimport { wait } from '../utils.js';\nimport { InlineSuggestionIdentity, InlineSuggestionItem } from './inlineSuggestionItem.js';\nimport { InlineCompletionContextWithoutUuid, InlineSuggestRequestInfo, provideInlineCompletions, runWhenCancelled } from './provideInlineCompletions.js';\n\nexport class InlineCompletionsSource extends Disposable {\n\tprivate static _requestId = 0;\n\n\tprivate readonly _updateOperation = this._register(new MutableDisposable<UpdateOperation>());\n\n\tprivate readonly _loggingEnabled;\n\tprivate readonly _sendRequestData;\n\n\tprivate readonly _structuredFetchLogger;\n\n\tprivate readonly _state = observableReducerSettable(this, {\n\t\tinitial: () => ({\n\t\t\tinlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t\tsuggestWidgetInlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t}),\n\t\tdisposeFinal: (values) => {\n\t\t\tvalues.inlineCompletions.dispose();\n\t\t\tvalues.suggestWidgetInlineCompletions.dispose();\n\t\t},\n\t\tchangeTracker: recordChangesLazy(() => ({ versionId: this._versionId })),\n\t\tupdate: (reader, previousValue, changes) => {\n\t\t\tconst edit = StringEdit.compose(changes.changes.map(c => c.change ? offsetEditFromContentChanges(c.change.changes) : StringEdit.empty).filter(isDefined));\n\n\t\t\tif (edit.isEmpty()) {\n\t\t\t\treturn previousValue;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn {\n\t\t\t\t\tinlineCompletions: previousValue.inlineCompletions.createStateWithAppliedEdit(edit, this._textModel),\n\t\t\t\t\tsuggestWidgetInlineCompletions: previousValue.suggestWidgetInlineCompletions.createStateWithAppliedEdit(edit, this._textModel),\n\t\t\t\t};\n\t\t\t} finally {\n\t\t\t\tpreviousValue.inlineCompletions.dispose();\n\t\t\t\tpreviousValue.suggestWidgetInlineCompletions.dispose();\n\t\t\t}\n\t\t}\n\t});\n\n\tpublic readonly inlineCompletions = this._state.map(this, v => v.inlineCompletions);\n\tpublic readonly suggestWidgetInlineCompletions = this._state.map(this, v => v.suggestWidgetInlineCompletions);\n\n\tprivate _completionsEnabled: Record<string, boolean> | undefined = undefined;\n\n\tconstructor(\n\t\tprivate readonly _textModel: ITextModel,\n\t\tprivate readonly _versionId: IObservableWithChange<number | null, IModelContentChangedEvent | undefined>,\n\t\tprivate readonly _debounceValue: IFeatureDebounceInformation,\n\t\tprivate readonly _cursorPosition: IObservable<Position>,\n\t\t@ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService,\n\t\t@ILogService private readonly _logService: ILogService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t) {\n\t\tsuper();\n\t\tthis._loggingEnabled = observableConfigValue('editor.inlineSuggest.logFetch', false, this._configurationService).recomputeInitiallyAndOnChange(this._store);\n\t\tthis._sendRequestData = observableConfigValue('editor.inlineSuggest.emptyResponseInformation', true, this._configurationService).recomputeInitiallyAndOnChange(this._store);\n\t\tthis._structuredFetchLogger = this._register(this._instantiationService.createInstance(StructuredLogger.cast<\n\t\t\t{ kind: 'start'; requestId: number; context: unknown } & IRecordableEditorLogEntry\n\t\t\t| { kind: 'end'; error: unknown; durationMs: number; result: unknown; requestId: number } & IRecordableLogEntry\n\t\t>(),\n\t\t\t'editor.inlineSuggest.logFetch.commandId'\n\t\t));\n\n\t\tthis.clearOperationOnTextModelChange.recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst enablementSetting = product.defaultChatAgent?.completionsEnablementSetting ?? undefined;\n\t\tif (enablementSetting) {\n\t\t\tthis._updateCompletionsEnablement(enablementSetting);\n\t\t\tthis._register(this._configurationService.onDidChangeConfiguration(e => {\n\t\t\t\tif (e.affectsConfiguration(enablementSetting)) {\n\t\t\t\t\tthis._updateCompletionsEnablement(enablementSetting);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\t}\n\n\tprivate _updateCompletionsEnablement(enalementSetting: string) {\n\t\tconst result = this._configurationService.getValue<Record<string, boolean>>(enalementSetting);\n\t\tif (!isObject(result)) {\n\t\t\tthis._completionsEnabled = undefined;\n\t\t} else {\n\t\t\tthis._completionsEnabled = result;\n\t\t}\n\t}\n\n\tpublic readonly clearOperationOnTextModelChange = derived(this, reader => {\n\t\tthis._versionId.read(reader);\n\t\tthis._updateOperation.clear();\n\t\treturn undefined; // always constant\n\t});\n\n\tprivate _log(entry:\n\t\t{ sourceId: string; kind: 'start'; requestId: number; context: unknown; provider: string | undefined } & IRecordableEditorLogEntry\n\t\t| { sourceId: string; kind: 'end'; error: unknown; durationMs: number; result: unknown; requestId: number; didAllProvidersReturn: boolean } & IRecordableLogEntry\n\t) {\n\t\tif (this._loggingEnabled.get()) {\n\t\t\tthis._logService.info(formatRecordableLogEntry(entry));\n\t\t}\n\t\tthis._structuredFetchLogger.log(entry);\n\t}\n\n\tprivate readonly _loadingCount = observableValue(this, 0);\n\n\tpublic fetch(\n\t\tproviders: InlineCompletionsProvider[],\n\t\tprovidersLabel: string | undefined,\n\t\tcontext: InlineCompletionContextWithoutUuid,\n\t\tactiveInlineCompletion: InlineSuggestionIdentity | undefined,\n\t\twithDebounce: boolean,\n\t\tuserJumpedToActiveCompletion: IObservable<boolean>,\n\t\trequestInfo: InlineSuggestRequestInfo\n\t): Promise<boolean> {\n\t\tconst position = this._cursorPosition.get();\n\t\tconst request = new UpdateRequest(position, context, this._textModel.getVersionId(), new Set(providers));\n\n\t\tconst target = context.selectedSuggestionInfo ? this.suggestWidgetInlineCompletions.get() : this.inlineCompletions.get();\n\n\t\tif (this._updateOperation.value?.request.satisfies(request)) {\n\t\t\treturn this._updateOperation.value.promise;\n\t\t} else if (target?.request?.satisfies(request)) {\n\t\t\treturn Promise.resolve(true);\n\t\t}\n\n\t\tconst updateOngoing = !!this._updateOperation.value;\n\t\tthis._updateOperation.clear();\n\n\t\tconst source = new CancellationTokenSource();\n\n\t\tconst promise = (async () => {\n\t\t\tconst store = new DisposableStore();\n\n\t\t\tthis._loadingCount.set(this._loadingCount.get() + 1, undefined);\n\t\t\tlet didDecrease = false;\n\t\t\tconst decreaseLoadingCount = () => {\n\t\t\t\tif (!didDecrease) {\n\t\t\t\t\tdidDecrease = true;\n\t\t\t\t\tthis._loadingCount.set(this._loadingCount.get() - 1, undefined);\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst loadingReset = store.add(new RunOnceScheduler(() => decreaseLoadingCount(), 10 * 1000));\n\t\t\tloadingReset.schedule();\n\n\t\t\tconst inlineSuggestionsProviders = providers.filter(p => p.providerId);\n\t\t\tconst requestResponseInfo = new RequestResponseData(context, requestInfo, inlineSuggestionsProviders);\n\n\n\t\t\ttry {\n\t\t\t\tconst recommendedDebounceValue = this._debounceValue.get(this._textModel);\n\t\t\t\tconst debounceValue = findLastMax(\n\t\t\t\t\tproviders.map(p => p.debounceDelayMs),\n\t\t\t\t\tcompareUndefinedSmallest(numberComparator)\n\t\t\t\t) ?? recommendedDebounceValue;\n\n\t\t\t\t// Debounce in any case if update is ongoing\n\t\t\t\tconst shouldDebounce = updateOngoing || (withDebounce && context.triggerKind === InlineCompletionTriggerKind.Automatic);\n\t\t\t\tif (shouldDebounce) {\n\t\t\t\t\t// This debounces the operation\n\t\t\t\t\tawait wait(debounceValue, source.token);\n\t\t\t\t}\n\n\t\t\t\tif (source.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== request.versionId) {\n\t\t\t\t\trequestResponseInfo.setNoSuggestionReasonIfNotSet('canceled:beforeFetch');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tconst requestId = InlineCompletionsSource._requestId++;\n\t\t\t\tif (this._loggingEnabled.get() || this._structuredFetchLogger.isEnabled.get()) {\n\t\t\t\t\tthis._log({\n\t\t\t\t\t\tsourceId: 'InlineCompletions.fetch',\n\t\t\t\t\t\tkind: 'start',\n\t\t\t\t\t\trequestId,\n\t\t\t\t\t\tmodelUri: this._textModel.uri,\n\t\t\t\t\t\tmodelVersion: this._textModel.getVersionId(),\n\t\t\t\t\t\tcontext: { triggerKind: context.triggerKind, suggestInfo: context.selectedSuggestionInfo ? true : undefined },\n\t\t\t\t\t\ttime: Date.now(),\n\t\t\t\t\t\tprovider: providersLabel,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tconst startTime = new Date();\n\t\t\t\tconst providerResult = provideInlineCompletions(providers, this._cursorPosition.get(), this._textModel, context, requestInfo, this._languageConfigurationService);\n\n\t\t\t\trunWhenCancelled(source.token, () => providerResult.cancelAndDispose({ kind: 'tokenCancellation' }));\n\n\t\t\t\tlet shouldStopEarly = false;\n\t\t\t\tlet producedSuggestion = false;\n\n\t\t\t\tconst suggestions: InlineSuggestionItem[] = [];\n\t\t\t\tfor await (const list of providerResult.lists) {\n\t\t\t\t\tif (!list) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tlist.addRef();\n\t\t\t\t\tstore.add(toDisposable(() => list.removeRef(list.inlineSuggestionsData.length === 0 ? { kind: 'empty' } : { kind: 'notTaken' })));\n\n\t\t\t\t\tfor (const item of list.inlineSuggestionsData) {\n\t\t\t\t\t\tproducedSuggestion = true;\n\t\t\t\t\t\tif (!context.includeInlineEdits && (item.isInlineEdit || item.showInlineEditMenu)) {\n\t\t\t\t\t\t\titem.setNotShownReason('notInlineEditRequested');\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!context.includeInlineCompletions && !(item.isInlineEdit || item.showInlineEditMenu)) {\n\t\t\t\t\t\t\titem.setNotShownReason('notInlineCompletionRequested');\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst i = InlineSuggestionItem.create(item, this._textModel);\n\t\t\t\t\t\tsuggestions.push(i);\n\t\t\t\t\t\t// Stop after first visible inline completion\n\t\t\t\t\t\tif (!i.isInlineEdit && !i.showInlineEditMenu && context.triggerKind === InlineCompletionTriggerKind.Automatic) {\n\t\t\t\t\t\t\tif (i.isVisible(this._textModel, this._cursorPosition.get())) {\n\t\t\t\t\t\t\t\tshouldStopEarly = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (shouldStopEarly) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tproviderResult.cancelAndDispose({ kind: 'lostRace' });\n\n\t\t\t\tif (this._loggingEnabled.get() || this._structuredFetchLogger.isEnabled.get()) {\n\t\t\t\t\tconst didAllProvidersReturn = providerResult.didAllProvidersReturn;\n\t\t\t\t\tlet error: string | undefined = undefined;\n\t\t\t\t\tif (source.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== request.versionId) {\n\t\t\t\t\t\terror = 'canceled';\n\t\t\t\t\t}\n\t\t\t\t\tconst result = suggestions.map(c => ({\n\t\t\t\t\t\trange: c.editRange.toString(),\n\t\t\t\t\t\ttext: c.insertText,\n\t\t\t\t\t\tisInlineEdit: !!c.isInlineEdit,\n\t\t\t\t\t\tsource: c.source.provider.groupId,\n\t\t\t\t\t}));\n\t\t\t\t\tthis._log({ sourceId: 'InlineCompletions.fetch', kind: 'end', requestId, durationMs: (Date.now() - startTime.getTime()), error, result, time: Date.now(), didAllProvidersReturn });\n\t\t\t\t}\n\n\t\t\t\trequestResponseInfo.setRequestUuid(providerResult.contextWithUuid.requestUuid);\n\t\t\t\tif (producedSuggestion) {\n\t\t\t\t\trequestResponseInfo.setHasProducedSuggestion();\n\t\t\t\t\tif (suggestions.length > 0 && source.token.isCancellationRequested) {\n\t\t\t\t\t\tsuggestions.forEach(s => s.setNotShownReasonIfNotSet('canceled:whileAwaitingOtherProviders'));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (source.token.isCancellationRequested) {\n\t\t\t\t\t\trequestResponseInfo.setNoSuggestionReasonIfNotSet('canceled:whileFetching');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst completionsQuotaExceeded = this._contextKeyService.getContextKeyValue<boolean>('completionsQuotaExceeded');\n\t\t\t\t\t\trequestResponseInfo.setNoSuggestionReasonIfNotSet(completionsQuotaExceeded ? 'completionsQuotaExceeded' : 'noSuggestion');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst remainingTimeToWait = context.earliestShownDateTime - Date.now();\n\t\t\t\tif (remainingTimeToWait > 0) {\n\t\t\t\t\tawait wait(remainingTimeToWait, source.token);\n\t\t\t\t}\n\n\t\t\t\tif (source.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== request.versionId\n\t\t\t\t\t|| userJumpedToActiveCompletion.get() /* In the meantime the user showed interest for the active completion so dont hide it */) {\n\t\t\t\t\tconst notShownReason =\n\t\t\t\t\t\tsource.token.isCancellationRequested ? 'canceled:afterMinShowDelay' :\n\t\t\t\t\t\t\tthis._store.isDisposed ? 'canceled:disposed' :\n\t\t\t\t\t\t\t\tthis._textModel.getVersionId() !== request.versionId ? 'canceled:documentChanged' :\n\t\t\t\t\t\t\t\t\tuserJumpedToActiveCompletion.get() ? 'canceled:userJumped' :\n\t\t\t\t\t\t\t\t\t\t'unknown';\n\t\t\t\t\tsuggestions.forEach(s => s.setNotShownReasonIfNotSet(notShownReason));\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tconst endTime = new Date();\n\t\t\t\tthis._debounceValue.update(this._textModel, endTime.getTime() - startTime.getTime());\n\n\t\t\t\tconst cursorPosition = this._cursorPosition.get();\n\t\t\t\tthis._updateOperation.clear();\n\t\t\t\ttransaction(tx => {\n\t\t\t\t\t/** @description Update completions with provider result */\n\t\t\t\t\tconst v = this._state.get();\n\n\t\t\t\t\tif (context.selectedSuggestionInfo) {\n\t\t\t\t\t\tthis._state.set({\n\t\t\t\t\t\t\tinlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t\t\t\t\t\tsuggestWidgetInlineCompletions: v.suggestWidgetInlineCompletions.createStateWithAppliedResults(suggestions, request, this._textModel, cursorPosition, activeInlineCompletion),\n\t\t\t\t\t\t}, tx);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._state.set({\n\t\t\t\t\t\t\tinlineCompletions: v.inlineCompletions.createStateWithAppliedResults(suggestions, request, this._textModel, cursorPosition, activeInlineCompletion),\n\t\t\t\t\t\t\tsuggestWidgetInlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t\t\t\t\t}, tx);\n\t\t\t\t\t}\n\n\t\t\t\t\tv.inlineCompletions.dispose();\n\t\t\t\t\tv.suggestWidgetInlineCompletions.dispose();\n\t\t\t\t});\n\t\t\t} finally {\n\t\t\t\tstore.dispose();\n\t\t\t\tdecreaseLoadingCount();\n\t\t\t\tthis.sendInlineCompletionsRequestTelemetry(requestResponseInfo);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t})();\n\n\t\tconst updateOperation = new UpdateOperation(request, source, promise);\n\t\tthis._updateOperation.value = updateOperation;\n\n\t\treturn promise;\n\t}\n\n\tpublic clear(tx: ITransaction): void {\n\t\tthis._updateOperation.clear();\n\t\tconst v = this._state.get();\n\t\tthis._state.set({\n\t\t\tinlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t\tsuggestWidgetInlineCompletions: InlineCompletionsState.createEmpty()\n\t\t}, tx);\n\t\tv.inlineCompletions.dispose();\n\t\tv.suggestWidgetInlineCompletions.dispose();\n\t}\n\n\tpublic seedInlineCompletionsWithSuggestWidget(): void {\n\t\tconst inlineCompletions = this.inlineCompletions.get();\n\t\tconst suggestWidgetInlineCompletions = this.suggestWidgetInlineCompletions.get();\n\t\tif (!suggestWidgetInlineCompletions) {\n\t\t\treturn;\n\t\t}\n\t\ttransaction(tx => {\n\t\t\t/** @description Seed inline completions with (newer) suggest widget inline completions */\n\t\t\tif (!inlineCompletions || (suggestWidgetInlineCompletions.request?.versionId ?? -1) > (inlineCompletions.request?.versionId ?? -1)) {\n\t\t\t\tinlineCompletions?.dispose();\n\t\t\t\tconst s = this._state.get();\n\t\t\t\tthis._state.set({\n\t\t\t\t\tinlineCompletions: suggestWidgetInlineCompletions.clone(),\n\t\t\t\t\tsuggestWidgetInlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t\t\t}, tx);\n\t\t\t\ts.inlineCompletions.dispose();\n\t\t\t\ts.suggestWidgetInlineCompletions.dispose();\n\t\t\t}\n\t\t\tthis.clearSuggestWidgetInlineCompletions(tx);\n\t\t});\n\t}\n\n\tprivate sendInlineCompletionsRequestTelemetry(\n\t\trequestResponseInfo: RequestResponseData\n\t): void {\n\t\tif (!this._sendRequestData.get() && !this._contextKeyService.getContextKeyValue<boolean>('isRunningUnificationExperiment')) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (requestResponseInfo.requestUuid === undefined || requestResponseInfo.hasProducedSuggestion) {\n\t\t\treturn;\n\t\t}\n\n\n\t\tif (!isCompletionsEnabled(this._completionsEnabled, this._textModel.getLanguageId())) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!requestResponseInfo.providers.some(p => isCopilotLikeExtension(p.providerId?.extensionId))) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst emptyEndOfLifeEvent: InlineCompletionEndOfLifeEvent = {\n\t\t\tid: requestResponseInfo.requestUuid,\n\t\t\topportunityId: requestResponseInfo.requestUuid,\n\t\t\tnoSuggestionReason: requestResponseInfo.noSuggestionReason ?? 'unknown',\n\t\t\textensionId: 'vscode-core',\n\t\t\textensionVersion: '0.0.0',\n\t\t\tgroupId: 'empty',\n\t\t\tshown: false,\n\t\t\teditorType: requestResponseInfo.requestInfo.editorType,\n\t\t\trequestReason: requestResponseInfo.requestInfo.reason,\n\t\t\ttypingInterval: requestResponseInfo.requestInfo.typingInterval,\n\t\t\ttypingIntervalCharacterCount: requestResponseInfo.requestInfo.typingIntervalCharacterCount,\n\t\t\tlanguageId: requestResponseInfo.requestInfo.languageId,\n\t\t\tselectedSuggestionInfo: !!requestResponseInfo.context.selectedSuggestionInfo,\n\t\t\tavailableProviders: requestResponseInfo.providers.map(p => p.providerId?.toString()).filter(isDefined).join(','),\n\t\t\t...forwardToChannelIf(requestResponseInfo.providers.some(p => isCopilotLikeExtension(p.providerId?.extensionId))),\n\t\t\ttimeUntilProviderRequest: undefined,\n\t\t\ttimeUntilProviderResponse: undefined,\n\t\t\tviewKind: undefined,\n\t\t\tpreceeded: undefined,\n\t\t\terror: undefined,\n\t\t\tsuperseded: undefined,\n\t\t\treason: undefined,\n\t\t\tcorrelationId: undefined,\n\t\t\tshownDuration: undefined,\n\t\t\tshownDurationUncollapsed: undefined,\n\t\t\ttimeUntilShown: undefined,\n\t\t\tpartiallyAccepted: undefined,\n\t\t\tpartiallyAcceptedCountSinceOriginal: undefined,\n\t\t\tpartiallyAcceptedRatioSinceOriginal: undefined,\n\t\t\tpartiallyAcceptedCharactersSinceOriginal: undefined,\n\t\t\tcursorColumnDistance: undefined,\n\t\t\tcursorLineDistance: undefined,\n\t\t\tlineCountOriginal: undefined,\n\t\t\tlineCountModified: undefined,\n\t\t\tcharacterCountOriginal: undefined,\n\t\t\tcharacterCountModified: undefined,\n\t\t\tdisjointReplacements: undefined,\n\t\t\tsameShapeReplacements: undefined,\n\t\t\tnotShownReason: undefined,\n\t\t};\n\n\t\tconst dataChannel = this._instantiationService.createInstance(DataChannelForwardingTelemetryService);\n\t\tsendInlineCompletionsEndOfLifeTelemetry(dataChannel, emptyEndOfLifeEvent);\n\t}\n\n\tpublic clearSuggestWidgetInlineCompletions(tx: ITransaction): void {\n\t\tif (this._updateOperation.value?.request.context.selectedSuggestionInfo) {\n\t\t\tthis._updateOperation.clear();\n\t\t}\n\t}\n\n\tpublic cancelUpdate(): void {\n\t\tthis._updateOperation.clear();\n\t}\n}\n\nclass UpdateRequest {\n\tconstructor(\n\t\tpublic readonly position: Position,\n\t\tpublic readonly context: InlineCompletionContextWithoutUuid,\n\t\tpublic readonly versionId: number,\n\t\tpublic readonly providers: Set<InlineCompletionsProvider>,\n\t) {\n\t}\n\n\tpublic satisfies(other: UpdateRequest): boolean {\n\t\treturn this.position.equals(other.position)\n\t\t\t&& equalsIfDefined(this.context.selectedSuggestionInfo, other.context.selectedSuggestionInfo, itemEquals())\n\t\t\t&& (other.context.triggerKind === InlineCompletionTriggerKind.Automatic\n\t\t\t\t|| this.context.triggerKind === InlineCompletionTriggerKind.Explicit)\n\t\t\t&& this.versionId === other.versionId\n\t\t\t&& isSubset(other.providers, this.providers);\n\t}\n}\n\nclass RequestResponseData {\n\tpublic requestUuid: string | undefined;\n\tpublic noSuggestionReason: string | undefined;\n\tpublic hasProducedSuggestion = false;\n\n\tconstructor(\n\t\tpublic readonly context: InlineCompletionContextWithoutUuid,\n\t\tpublic readonly requestInfo: InlineSuggestRequestInfo,\n\t\tpublic readonly providers: InlineCompletionsProvider[],\n\t) { }\n\n\tsetRequestUuid(uuid: string) {\n\t\tthis.requestUuid = uuid;\n\t}\n\n\tsetNoSuggestionReasonIfNotSet(type: string) {\n\t\tthis.noSuggestionReason ??= type;\n\t}\n\n\tsetHasProducedSuggestion() {\n\t\tthis.hasProducedSuggestion = true;\n\t}\n}\n\nfunction isSubset<T>(set1: Set<T>, set2: Set<T>): boolean {\n\treturn [...set1].every(item => set2.has(item));\n}\n\nfunction isCompletionsEnabled(completionsEnablementObject: Record<string, boolean> | undefined, modeId: string = '*'): boolean {\n\tif (completionsEnablementObject === undefined) {\n\t\treturn false; // default to disabled if setting is not available\n\t}\n\n\tif (typeof completionsEnablementObject[modeId] !== 'undefined') {\n\t\treturn Boolean(completionsEnablementObject[modeId]); // go with setting if explicitly defined\n\t}\n\n\treturn Boolean(completionsEnablementObject['*']); // fallback to global setting otherwise\n}\n\nclass UpdateOperation implements IDisposable {\n\tconstructor(\n\t\tpublic readonly request: UpdateRequest,\n\t\tpublic readonly cancellationTokenSource: CancellationTokenSource,\n\t\tpublic readonly promise: Promise<boolean>,\n\t) {\n\t}\n\n\tdispose() {\n\t\tthis.cancellationTokenSource.cancel();\n\t}\n}\n\nclass InlineCompletionsState extends Disposable {\n\tpublic static createEmpty(): InlineCompletionsState {\n\t\treturn new InlineCompletionsState([], undefined);\n\t}\n\n\tconstructor(\n\t\tpublic readonly inlineCompletions: readonly InlineSuggestionItem[],\n\t\tpublic readonly request: UpdateRequest | undefined,\n\t) {\n\t\tfor (const inlineCompletion of inlineCompletions) {\n\t\t\tinlineCompletion.addRef();\n\t\t}\n\n\t\tsuper();\n\n\t\tthis._register({\n\t\t\tdispose: () => {\n\t\t\t\tfor (const inlineCompletion of this.inlineCompletions) {\n\t\t\t\t\tinlineCompletion.removeRef();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _findById(id: InlineSuggestionIdentity): InlineSuggestionItem | undefined {\n\t\treturn this.inlineCompletions.find(i => i.identity === id);\n\t}\n\n\tprivate _findByHash(hash: string): InlineSuggestionItem | undefined {\n\t\treturn this.inlineCompletions.find(i => i.hash === hash);\n\t}\n\n\t/**\n\t * Applies the edit on the state.\n\t*/\n\tpublic createStateWithAppliedEdit(edit: StringEdit, textModel: ITextModel): InlineCompletionsState {\n\t\tconst newInlineCompletions = this.inlineCompletions.map(i => i.withEdit(edit, textModel)).filter(isDefined);\n\t\treturn new InlineCompletionsState(newInlineCompletions, this.request);\n\t}\n\n\tpublic createStateWithAppliedResults(updatedSuggestions: InlineSuggestionItem[], request: UpdateRequest, textModel: ITextModel, cursorPosition: Position, itemIdToPreserveAtTop: InlineSuggestionIdentity | undefined): InlineCompletionsState {\n\t\tlet itemToPreserve: InlineSuggestionItem | undefined = undefined;\n\t\tif (itemIdToPreserveAtTop) {\n\t\t\tconst itemToPreserveCandidate = this._findById(itemIdToPreserveAtTop);\n\t\t\tif (itemToPreserveCandidate && itemToPreserveCandidate.canBeReused(textModel, request.position)) {\n\t\t\t\titemToPreserve = itemToPreserveCandidate;\n\n\t\t\t\tconst updatedItemToPreserve = updatedSuggestions.find(i => i.hash === itemToPreserveCandidate.hash);\n\t\t\t\tif (updatedItemToPreserve) {\n\t\t\t\t\tupdatedSuggestions = moveToFront(updatedItemToPreserve, updatedSuggestions);\n\t\t\t\t} else {\n\t\t\t\t\tupdatedSuggestions = [itemToPreserveCandidate, ...updatedSuggestions];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst preferInlineCompletions = itemToPreserve\n\t\t\t// itemToPreserve has precedence\n\t\t\t? !itemToPreserve.isInlineEdit\n\t\t\t// Otherwise: prefer inline completion if there is a visible one\n\t\t\t: updatedSuggestions.some(i => !i.isInlineEdit && i.isVisible(textModel, cursorPosition));\n\n\t\tlet updatedItems: InlineSuggestionItem[] = [];\n\t\tfor (const i of updatedSuggestions) {\n\t\t\tconst oldItem = this._findByHash(i.hash);\n\t\t\tlet item;\n\t\t\tif (oldItem && oldItem !== i) {\n\t\t\t\titem = i.withIdentity(oldItem.identity);\n\t\t\t\ti.setIsPreceeded(oldItem);\n\t\t\t\toldItem.setEndOfLifeReason({ kind: InlineCompletionEndOfLifeReasonKind.Ignored, userTypingDisagreed: false, supersededBy: i.getSourceCompletion() });\n\t\t\t} else {\n\t\t\t\titem = i;\n\t\t\t}\n\t\t\tif (preferInlineCompletions !== item.isInlineEdit) {\n\t\t\t\tupdatedItems.push(item);\n\t\t\t}\n\t\t}\n\n\t\tupdatedItems.sort(compareBy(i => i.showInlineEditMenu, booleanComparator));\n\t\tupdatedItems = distinctByKey(updatedItems, i => i.semanticId);\n\n\t\treturn new InlineCompletionsState(updatedItems, request);\n\t}\n\n\tpublic clone(): InlineCompletionsState {\n\t\treturn new InlineCompletionsState(this.inlineCompletions, this.request);\n\t}\n}\n\n/** Keeps the first item in case of duplicates. */\nfunction distinctByKey<T>(items: T[], key: (item: T) => unknown): T[] {\n\tconst seen = new Set();\n\treturn items.filter(item => {\n\t\tconst k = key(item);\n\t\tif (seen.has(k)) {\n\t\t\treturn false;\n\t\t}\n\t\tseen.add(k);\n\t\treturn true;\n\t});\n}\n\nfunction moveToFront<T>(item: T, items: T[]): T[] {\n\tconst index = items.indexOf(item);\n\tif (index > -1) {\n\t\treturn [item, ...items.slice(0, index), ...items.slice(index + 1)];\n\t}\n\treturn items;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.ts","vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAChI,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,eAAe,EAAe,iBAAiB,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACpI,OAAO,EAAE,OAAO,EAAoD,eAAe,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AACtK,iEAAiE;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uEAAuE,CAAC;AAClH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,+DAA+D,CAAC;AACtG,OAAO,EAAE,kBAAkB,EAAE,MAAM,yDAAyD,CAAC;AAC7F,OAAO,EAAE,qCAAqC,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,2EAA2E,CAAC;AAC9K,OAAO,EAAE,qBAAqB,EAAE,MAAM,+DAA+D,CAAC;AACtG,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sEAAsE,CAAC;AAC7G,OAA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CAAC,CAAC;QAE9D,OAAO,IAAI,sBAAsB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAEM,KAAK;QACX,OAAO,IAAI,sBAAsB,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACzE,CAAC;CACD;AAED,kDAAkD;AAClD,SAAS,aAAa,CAAI,KAAU,EAAE,GAAyB;IAC9D,MAAM,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;IACvB,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QAC1B,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;QACpB,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YACjB,OAAO,KAAK,CAAC;QACd,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACZ,OAAO,IAAI,CAAC;IACb,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAI,IAAO,EAAE,KAAU;IAC1C,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC;QAChB,OAAO,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC","file":"inlineCompletionsSource.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 { booleanComparator, compareBy, compareUndefinedSmallest, numberComparator } from '../../../../../base/common/arrays.js';\nimport { findLastMax } from '../../../../../base/common/arraysFind.js';\nimport { RunOnceScheduler } from '../../../../../base/common/async.js';\nimport { CancellationTokenSource } from '../../../../../base/common/cancellation.js';\nimport { equalsIfDefined, itemEquals } from '../../../../../base/common/equals.js';\nimport { Disposable, DisposableStore, IDisposable, MutableDisposable, toDisposable } from '../../../../../base/common/lifecycle.js';\nimport { derived, IObservable, IObservableWithChange, ITransaction, observableValue, recordChangesLazy, transaction } from '../../../../../base/common/observable.js';\n// eslint-disable-next-line local/code-no-deep-import-of-internal\nimport { observableReducerSettable } from '../../../../../base/common/observableInternal/experimental/reducer.js';\nimport { isDefined, isObject } from '../../../../../base/common/types.js';\nimport { IConfigurationService } from '../../../../../platform/configuration/common/configuration.js';\nimport { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js';\nimport { DataChannelForwardingTelemetryService, forwardToChannelIf, isCopilotLikeExtension } from '../../../../../platform/dataChannel/browser/forwardingTelemetryService.js';\nimport { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';\nimport { ILogService } from '../../../../../platform/log/common/log.js';\nimport { observableConfigValue } from '../../../../../platform/observable/common/platformObservableUtils.js';\nimport product from '../../../../../platform/product/common/product.js';\nimport { StringEdit } from '../../../../common/core/edits/stringEdit.js';\nimport { Position } from '../../../../common/core/position.js';\nimport { InlineCompletionEndOfLifeReasonKind, InlineCompletionTriggerKind, InlineCompletionsProvider } from '../../../../common/languages.js';\nimport { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js';\nimport { ITextModel } from '../../../../common/model.js';\nimport { offsetEditFromContentChanges } from '../../../../common/model/textModelStringEdit.js';\nimport { IFeatureDebounceInformation } from '../../../../common/services/languageFeatureDebounce.js';\nimport { IModelContentChangedEvent } from '../../../../common/textModelEvents.js';\nimport { formatRecordableLogEntry, IRecordableEditorLogEntry, IRecordableLogEntry, StructuredLogger } from '../structuredLogger.js';\nimport { InlineCompletionEndOfLifeEvent, sendInlineCompletionsEndOfLifeTelemetry } from '../telemetry.js';\nimport { wait } from '../utils.js';\nimport { InlineSuggestionIdentity, InlineSuggestionItem } from './inlineSuggestionItem.js';\nimport { InlineCompletionContextWithoutUuid, InlineSuggestRequestInfo, provideInlineCompletions, runWhenCancelled } from './provideInlineCompletions.js';\n\nexport class InlineCompletionsSource extends Disposable {\n\tprivate static _requestId = 0;\n\n\tprivate readonly _updateOperation = this._register(new MutableDisposable<UpdateOperation>());\n\n\tprivate readonly _loggingEnabled;\n\tprivate readonly _sendRequestData;\n\n\tprivate readonly _structuredFetchLogger;\n\n\tprivate readonly _state = observableReducerSettable(this, {\n\t\tinitial: () => ({\n\t\t\tinlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t\tsuggestWidgetInlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t}),\n\t\tdisposeFinal: (values) => {\n\t\t\tvalues.inlineCompletions.dispose();\n\t\t\tvalues.suggestWidgetInlineCompletions.dispose();\n\t\t},\n\t\tchangeTracker: recordChangesLazy(() => ({ versionId: this._versionId })),\n\t\tupdate: (reader, previousValue, changes) => {\n\t\t\tconst edit = StringEdit.compose(changes.changes.map(c => c.change ? offsetEditFromContentChanges(c.change.changes) : StringEdit.empty).filter(isDefined));\n\n\t\t\tif (edit.isEmpty()) {\n\t\t\t\treturn previousValue;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn {\n\t\t\t\t\tinlineCompletions: previousValue.inlineCompletions.createStateWithAppliedEdit(edit, this._textModel),\n\t\t\t\t\tsuggestWidgetInlineCompletions: previousValue.suggestWidgetInlineCompletions.createStateWithAppliedEdit(edit, this._textModel),\n\t\t\t\t};\n\t\t\t} finally {\n\t\t\t\tpreviousValue.inlineCompletions.dispose();\n\t\t\t\tpreviousValue.suggestWidgetInlineCompletions.dispose();\n\t\t\t}\n\t\t}\n\t});\n\n\tpublic readonly inlineCompletions = this._state.map(this, v => v.inlineCompletions);\n\tpublic readonly suggestWidgetInlineCompletions = this._state.map(this, v => v.suggestWidgetInlineCompletions);\n\n\tprivate _completionsEnabled: Record<string, boolean> | undefined = undefined;\n\n\tconstructor(\n\t\tprivate readonly _textModel: ITextModel,\n\t\tprivate readonly _versionId: IObservableWithChange<number | null, IModelContentChangedEvent | undefined>,\n\t\tprivate readonly _debounceValue: IFeatureDebounceInformation,\n\t\tprivate readonly _cursorPosition: IObservable<Position>,\n\t\t@ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService,\n\t\t@ILogService private readonly _logService: ILogService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t) {\n\t\tsuper();\n\t\tthis._loggingEnabled = observableConfigValue('editor.inlineSuggest.logFetch', false, this._configurationService).recomputeInitiallyAndOnChange(this._store);\n\t\tthis._sendRequestData = observableConfigValue('editor.inlineSuggest.emptyResponseInformation', true, this._configurationService).recomputeInitiallyAndOnChange(this._store);\n\t\tthis._structuredFetchLogger = this._register(this._instantiationService.createInstance(StructuredLogger.cast<\n\t\t\t{ kind: 'start'; requestId: number; context: unknown } & IRecordableEditorLogEntry\n\t\t\t| { kind: 'end'; error: unknown; durationMs: number; result: unknown; requestId: number } & IRecordableLogEntry\n\t\t>(),\n\t\t\t'editor.inlineSuggest.logFetch.commandId'\n\t\t));\n\n\t\tthis.clearOperationOnTextModelChange.recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst enablementSetting = product.defaultChatAgent?.completionsEnablementSetting ?? undefined;\n\t\tif (enablementSetting) {\n\t\t\tthis._updateCompletionsEnablement(enablementSetting);\n\t\t\tthis._register(this._configurationService.onDidChangeConfiguration(e => {\n\t\t\t\tif (e.affectsConfiguration(enablementSetting)) {\n\t\t\t\t\tthis._updateCompletionsEnablement(enablementSetting);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\t}\n\n\tprivate _updateCompletionsEnablement(enalementSetting: string) {\n\t\tconst result = this._configurationService.getValue<Record<string, boolean>>(enalementSetting);\n\t\tif (!isObject(result)) {\n\t\t\tthis._completionsEnabled = undefined;\n\t\t} else {\n\t\t\tthis._completionsEnabled = result;\n\t\t}\n\t}\n\n\tpublic readonly clearOperationOnTextModelChange = derived(this, reader => {\n\t\tthis._versionId.read(reader);\n\t\tthis._updateOperation.clear();\n\t\treturn undefined; // always constant\n\t});\n\n\tprivate _log(entry:\n\t\t{ sourceId: string; kind: 'start'; requestId: number; context: unknown; provider: string | undefined } & IRecordableEditorLogEntry\n\t\t| { sourceId: string; kind: 'end'; error: unknown; durationMs: number; result: unknown; requestId: number; didAllProvidersReturn: boolean } & IRecordableLogEntry\n\t) {\n\t\tif (this._loggingEnabled.get()) {\n\t\t\tthis._logService.info(formatRecordableLogEntry(entry));\n\t\t}\n\t\tthis._structuredFetchLogger.log(entry);\n\t}\n\n\tprivate readonly _loadingCount = observableValue(this, 0);\n\n\tpublic fetch(\n\t\tproviders: InlineCompletionsProvider[],\n\t\tprovidersLabel: string | undefined,\n\t\tcontext: InlineCompletionContextWithoutUuid,\n\t\tactiveInlineCompletion: InlineSuggestionIdentity | undefined,\n\t\twithDebounce: boolean,\n\t\tuserJumpedToActiveCompletion: IObservable<boolean>,\n\t\trequestInfo: InlineSuggestRequestInfo\n\t): Promise<boolean> {\n\t\tconst position = this._cursorPosition.get();\n\t\tconst request = new UpdateRequest(position, context, this._textModel.getVersionId(), new Set(providers));\n\n\t\tconst target = context.selectedSuggestionInfo ? this.suggestWidgetInlineCompletions.get() : this.inlineCompletions.get();\n\n\t\tif (this._updateOperation.value?.request.satisfies(request)) {\n\t\t\treturn this._updateOperation.value.promise;\n\t\t} else if (target?.request?.satisfies(request)) {\n\t\t\treturn Promise.resolve(true);\n\t\t}\n\n\t\tconst updateOngoing = !!this._updateOperation.value;\n\t\tthis._updateOperation.clear();\n\n\t\tconst source = new CancellationTokenSource();\n\n\t\tconst promise = (async () => {\n\t\t\tconst store = new DisposableStore();\n\n\t\t\tthis._loadingCount.set(this._loadingCount.get() + 1, undefined);\n\t\t\tlet didDecrease = false;\n\t\t\tconst decreaseLoadingCount = () => {\n\t\t\t\tif (!didDecrease) {\n\t\t\t\t\tdidDecrease = true;\n\t\t\t\t\tthis._loadingCount.set(this._loadingCount.get() - 1, undefined);\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst loadingReset = store.add(new RunOnceScheduler(() => decreaseLoadingCount(), 10 * 1000));\n\t\t\tloadingReset.schedule();\n\n\t\t\tconst inlineSuggestionsProviders = providers.filter(p => p.providerId);\n\t\t\tconst requestResponseInfo = new RequestResponseData(context, requestInfo, inlineSuggestionsProviders);\n\n\n\t\t\ttry {\n\t\t\t\tconst recommendedDebounceValue = this._debounceValue.get(this._textModel);\n\t\t\t\tconst debounceValue = findLastMax(\n\t\t\t\t\tproviders.map(p => p.debounceDelayMs),\n\t\t\t\t\tcompareUndefinedSmallest(numberComparator)\n\t\t\t\t) ?? recommendedDebounceValue;\n\n\t\t\t\t// Debounce in any case if update is ongoing\n\t\t\t\tconst shouldDebounce = updateOngoing || (withDebounce && context.triggerKind === InlineCompletionTriggerKind.Automatic);\n\t\t\t\tif (shouldDebounce) {\n\t\t\t\t\t// This debounces the operation\n\t\t\t\t\tawait wait(debounceValue, source.token);\n\t\t\t\t}\n\n\t\t\t\tif (source.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== request.versionId) {\n\t\t\t\t\trequestResponseInfo.setNoSuggestionReasonIfNotSet('canceled:beforeFetch');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tconst requestId = InlineCompletionsSource._requestId++;\n\t\t\t\tif (this._loggingEnabled.get() || this._structuredFetchLogger.isEnabled.get()) {\n\t\t\t\t\tthis._log({\n\t\t\t\t\t\tsourceId: 'InlineCompletions.fetch',\n\t\t\t\t\t\tkind: 'start',\n\t\t\t\t\t\trequestId,\n\t\t\t\t\t\tmodelUri: this._textModel.uri,\n\t\t\t\t\t\tmodelVersion: this._textModel.getVersionId(),\n\t\t\t\t\t\tcontext: { triggerKind: context.triggerKind, suggestInfo: context.selectedSuggestionInfo ? true : undefined },\n\t\t\t\t\t\ttime: Date.now(),\n\t\t\t\t\t\tprovider: providersLabel,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tconst startTime = new Date();\n\t\t\t\tconst providerResult = provideInlineCompletions(providers, this._cursorPosition.get(), this._textModel, context, requestInfo, this._languageConfigurationService);\n\n\t\t\t\trunWhenCancelled(source.token, () => providerResult.cancelAndDispose({ kind: 'tokenCancellation' }));\n\n\t\t\t\tlet shouldStopEarly = false;\n\t\t\t\tlet producedSuggestion = false;\n\n\t\t\t\tconst suggestions: InlineSuggestionItem[] = [];\n\t\t\t\tfor await (const list of providerResult.lists) {\n\t\t\t\t\tif (!list) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tlist.addRef();\n\t\t\t\t\tstore.add(toDisposable(() => list.removeRef(list.inlineSuggestionsData.length === 0 ? { kind: 'empty' } : { kind: 'notTaken' })));\n\n\t\t\t\t\tfor (const item of list.inlineSuggestionsData) {\n\t\t\t\t\t\tproducedSuggestion = true;\n\t\t\t\t\t\tif (!context.includeInlineEdits && (item.isInlineEdit || item.showInlineEditMenu)) {\n\t\t\t\t\t\t\titem.setNotShownReason('notInlineEditRequested');\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!context.includeInlineCompletions && !(item.isInlineEdit || item.showInlineEditMenu)) {\n\t\t\t\t\t\t\titem.setNotShownReason('notInlineCompletionRequested');\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst i = InlineSuggestionItem.create(item, this._textModel);\n\t\t\t\t\t\tsuggestions.push(i);\n\t\t\t\t\t\t// Stop after first visible inline completion\n\t\t\t\t\t\tif (!i.isInlineEdit && !i.showInlineEditMenu && context.triggerKind === InlineCompletionTriggerKind.Automatic) {\n\t\t\t\t\t\t\tif (i.isVisible(this._textModel, this._cursorPosition.get())) {\n\t\t\t\t\t\t\t\tshouldStopEarly = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (shouldStopEarly) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tproviderResult.cancelAndDispose({ kind: 'lostRace' });\n\n\t\t\t\tif (this._loggingEnabled.get() || this._structuredFetchLogger.isEnabled.get()) {\n\t\t\t\t\tconst didAllProvidersReturn = providerResult.didAllProvidersReturn;\n\t\t\t\t\tlet error: string | undefined = undefined;\n\t\t\t\t\tif (source.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== request.versionId) {\n\t\t\t\t\t\terror = 'canceled';\n\t\t\t\t\t}\n\t\t\t\t\tconst result = suggestions.map(c => ({\n\t\t\t\t\t\trange: c.editRange.toString(),\n\t\t\t\t\t\ttext: c.insertText,\n\t\t\t\t\t\tisInlineEdit: !!c.isInlineEdit,\n\t\t\t\t\t\tsource: c.source.provider.groupId,\n\t\t\t\t\t}));\n\t\t\t\t\tthis._log({ sourceId: 'InlineCompletions.fetch', kind: 'end', requestId, durationMs: (Date.now() - startTime.getTime()), error, result, time: Date.now(), didAllProvidersReturn });\n\t\t\t\t}\n\n\t\t\t\trequestResponseInfo.setRequestUuid(providerResult.contextWithUuid.requestUuid);\n\t\t\t\tif (producedSuggestion) {\n\t\t\t\t\trequestResponseInfo.setHasProducedSuggestion();\n\t\t\t\t\tif (suggestions.length > 0 && source.token.isCancellationRequested) {\n\t\t\t\t\t\tsuggestions.forEach(s => s.setNotShownReasonIfNotSet('canceled:whileAwaitingOtherProviders'));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (source.token.isCancellationRequested) {\n\t\t\t\t\t\trequestResponseInfo.setNoSuggestionReasonIfNotSet('canceled:whileFetching');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst completionsQuotaExceeded = this._contextKeyService.getContextKeyValue<boolean>('completionsQuotaExceeded');\n\t\t\t\t\t\trequestResponseInfo.setNoSuggestionReasonIfNotSet(completionsQuotaExceeded ? 'completionsQuotaExceeded' : 'noSuggestion');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst remainingTimeToWait = context.earliestShownDateTime - Date.now();\n\t\t\t\tif (remainingTimeToWait > 0) {\n\t\t\t\t\tawait wait(remainingTimeToWait, source.token);\n\t\t\t\t}\n\n\t\t\t\tif (source.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== request.versionId\n\t\t\t\t\t|| userJumpedToActiveCompletion.get() /* In the meantime the user showed interest for the active completion so dont hide it */) {\n\t\t\t\t\tconst notShownReason =\n\t\t\t\t\t\tsource.token.isCancellationRequested ? 'canceled:afterMinShowDelay' :\n\t\t\t\t\t\t\tthis._store.isDisposed ? 'canceled:disposed' :\n\t\t\t\t\t\t\t\tthis._textModel.getVersionId() !== request.versionId ? 'canceled:documentChanged' :\n\t\t\t\t\t\t\t\t\tuserJumpedToActiveCompletion.get() ? 'canceled:userJumped' :\n\t\t\t\t\t\t\t\t\t\t'unknown';\n\t\t\t\t\tsuggestions.forEach(s => s.setNotShownReasonIfNotSet(notShownReason));\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tconst endTime = new Date();\n\t\t\t\tthis._debounceValue.update(this._textModel, endTime.getTime() - startTime.getTime());\n\n\t\t\t\tconst cursorPosition = this._cursorPosition.get();\n\t\t\t\tthis._updateOperation.clear();\n\t\t\t\ttransaction(tx => {\n\t\t\t\t\t/** @description Update completions with provider result */\n\t\t\t\t\tconst v = this._state.get();\n\n\t\t\t\t\tif (context.selectedSuggestionInfo) {\n\t\t\t\t\t\tthis._state.set({\n\t\t\t\t\t\t\tinlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t\t\t\t\t\tsuggestWidgetInlineCompletions: v.suggestWidgetInlineCompletions.createStateWithAppliedResults(suggestions, request, this._textModel, cursorPosition, activeInlineCompletion),\n\t\t\t\t\t\t}, tx);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._state.set({\n\t\t\t\t\t\t\tinlineCompletions: v.inlineCompletions.createStateWithAppliedResults(suggestions, request, this._textModel, cursorPosition, activeInlineCompletion),\n\t\t\t\t\t\t\tsuggestWidgetInlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t\t\t\t\t}, tx);\n\t\t\t\t\t}\n\n\t\t\t\t\tv.inlineCompletions.dispose();\n\t\t\t\t\tv.suggestWidgetInlineCompletions.dispose();\n\t\t\t\t});\n\t\t\t} finally {\n\t\t\t\tstore.dispose();\n\t\t\t\tdecreaseLoadingCount();\n\t\t\t\tthis.sendInlineCompletionsRequestTelemetry(requestResponseInfo);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t})();\n\n\t\tconst updateOperation = new UpdateOperation(request, source, promise);\n\t\tthis._updateOperation.value = updateOperation;\n\n\t\treturn promise;\n\t}\n\n\tpublic clear(tx: ITransaction): void {\n\t\tthis._updateOperation.clear();\n\t\tconst v = this._state.get();\n\t\tthis._state.set({\n\t\t\tinlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t\tsuggestWidgetInlineCompletions: InlineCompletionsState.createEmpty()\n\t\t}, tx);\n\t\tv.inlineCompletions.dispose();\n\t\tv.suggestWidgetInlineCompletions.dispose();\n\t}\n\n\tpublic seedInlineCompletionsWithSuggestWidget(): void {\n\t\tconst inlineCompletions = this.inlineCompletions.get();\n\t\tconst suggestWidgetInlineCompletions = this.suggestWidgetInlineCompletions.get();\n\t\tif (!suggestWidgetInlineCompletions) {\n\t\t\treturn;\n\t\t}\n\t\ttransaction(tx => {\n\t\t\t/** @description Seed inline completions with (newer) suggest widget inline completions */\n\t\t\tif (!inlineCompletions || (suggestWidgetInlineCompletions.request?.versionId ?? -1) > (inlineCompletions.request?.versionId ?? -1)) {\n\t\t\t\tinlineCompletions?.dispose();\n\t\t\t\tconst s = this._state.get();\n\t\t\t\tthis._state.set({\n\t\t\t\t\tinlineCompletions: suggestWidgetInlineCompletions.clone(),\n\t\t\t\t\tsuggestWidgetInlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t\t\t}, tx);\n\t\t\t\ts.inlineCompletions.dispose();\n\t\t\t\ts.suggestWidgetInlineCompletions.dispose();\n\t\t\t}\n\t\t\tthis.clearSuggestWidgetInlineCompletions(tx);\n\t\t});\n\t}\n\n\tprivate sendInlineCompletionsRequestTelemetry(\n\t\trequestResponseInfo: RequestResponseData\n\t): void {\n\t\tif (!this._sendRequestData.get() && !this._contextKeyService.getContextKeyValue<boolean>('isRunningUnificationExperiment')) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (requestResponseInfo.requestUuid === undefined || requestResponseInfo.hasProducedSuggestion) {\n\t\t\treturn;\n\t\t}\n\n\n\t\tif (!isCompletionsEnabled(this._completionsEnabled, this._textModel.getLanguageId())) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!requestResponseInfo.providers.some(p => isCopilotLikeExtension(p.providerId?.extensionId))) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst emptyEndOfLifeEvent: InlineCompletionEndOfLifeEvent = {\n\t\t\topportunityId: requestResponseInfo.requestUuid,\n\t\t\tnoSuggestionReason: requestResponseInfo.noSuggestionReason ?? 'unknown',\n\t\t\textensionId: 'vscode-core',\n\t\t\textensionVersion: '0.0.0',\n\t\t\tgroupId: 'empty',\n\t\t\tshown: false,\n\t\t\teditorType: requestResponseInfo.requestInfo.editorType,\n\t\t\trequestReason: requestResponseInfo.requestInfo.reason,\n\t\t\ttypingInterval: requestResponseInfo.requestInfo.typingInterval,\n\t\t\ttypingIntervalCharacterCount: requestResponseInfo.requestInfo.typingIntervalCharacterCount,\n\t\t\tlanguageId: requestResponseInfo.requestInfo.languageId,\n\t\t\tselectedSuggestionInfo: !!requestResponseInfo.context.selectedSuggestionInfo,\n\t\t\tavailableProviders: requestResponseInfo.providers.map(p => p.providerId?.toString()).filter(isDefined).join(','),\n\t\t\t...forwardToChannelIf(requestResponseInfo.providers.some(p => isCopilotLikeExtension(p.providerId?.extensionId))),\n\t\t\ttimeUntilProviderRequest: undefined,\n\t\t\ttimeUntilProviderResponse: undefined,\n\t\t\tviewKind: undefined,\n\t\t\tpreceeded: undefined,\n\t\t\terror: undefined,\n\t\t\tsuperseded: undefined,\n\t\t\treason: undefined,\n\t\t\tcorrelationId: undefined,\n\t\t\tshownDuration: undefined,\n\t\t\tshownDurationUncollapsed: undefined,\n\t\t\ttimeUntilShown: undefined,\n\t\t\tpartiallyAccepted: undefined,\n\t\t\tpartiallyAcceptedCountSinceOriginal: undefined,\n\t\t\tpartiallyAcceptedRatioSinceOriginal: undefined,\n\t\t\tpartiallyAcceptedCharactersSinceOriginal: undefined,\n\t\t\tcursorColumnDistance: undefined,\n\t\t\tcursorLineDistance: undefined,\n\t\t\tlineCountOriginal: undefined,\n\t\t\tlineCountModified: undefined,\n\t\t\tcharacterCountOriginal: undefined,\n\t\t\tcharacterCountModified: undefined,\n\t\t\tdisjointReplacements: undefined,\n\t\t\tsameShapeReplacements: undefined,\n\t\t\tnotShownReason: undefined,\n\t\t};\n\n\t\tconst dataChannel = this._instantiationService.createInstance(DataChannelForwardingTelemetryService);\n\t\tsendInlineCompletionsEndOfLifeTelemetry(dataChannel, emptyEndOfLifeEvent);\n\t}\n\n\tpublic clearSuggestWidgetInlineCompletions(tx: ITransaction): void {\n\t\tif (this._updateOperation.value?.request.context.selectedSuggestionInfo) {\n\t\t\tthis._updateOperation.clear();\n\t\t}\n\t}\n\n\tpublic cancelUpdate(): void {\n\t\tthis._updateOperation.clear();\n\t}\n}\n\nclass UpdateRequest {\n\tconstructor(\n\t\tpublic readonly position: Position,\n\t\tpublic readonly context: InlineCompletionContextWithoutUuid,\n\t\tpublic readonly versionId: number,\n\t\tpublic readonly providers: Set<InlineCompletionsProvider>,\n\t) {\n\t}\n\n\tpublic satisfies(other: UpdateRequest): boolean {\n\t\treturn this.position.equals(other.position)\n\t\t\t&& equalsIfDefined(this.context.selectedSuggestionInfo, other.context.selectedSuggestionInfo, itemEquals())\n\t\t\t&& (other.context.triggerKind === InlineCompletionTriggerKind.Automatic\n\t\t\t\t|| this.context.triggerKind === InlineCompletionTriggerKind.Explicit)\n\t\t\t&& this.versionId === other.versionId\n\t\t\t&& isSubset(other.providers, this.providers);\n\t}\n}\n\nclass RequestResponseData {\n\tpublic requestUuid: string | undefined;\n\tpublic noSuggestionReason: string | undefined;\n\tpublic hasProducedSuggestion = false;\n\n\tconstructor(\n\t\tpublic readonly context: InlineCompletionContextWithoutUuid,\n\t\tpublic readonly requestInfo: InlineSuggestRequestInfo,\n\t\tpublic readonly providers: InlineCompletionsProvider[],\n\t) { }\n\n\tsetRequestUuid(uuid: string) {\n\t\tthis.requestUuid = uuid;\n\t}\n\n\tsetNoSuggestionReasonIfNotSet(type: string) {\n\t\tthis.noSuggestionReason ??= type;\n\t}\n\n\tsetHasProducedSuggestion() {\n\t\tthis.hasProducedSuggestion = true;\n\t}\n}\n\nfunction isSubset<T>(set1: Set<T>, set2: Set<T>): boolean {\n\treturn [...set1].every(item => set2.has(item));\n}\n\nfunction isCompletionsEnabled(completionsEnablementObject: Record<string, boolean> | undefined, modeId: string = '*'): boolean {\n\tif (completionsEnablementObject === undefined) {\n\t\treturn false; // default to disabled if setting is not available\n\t}\n\n\tif (typeof completionsEnablementObject[modeId] !== 'undefined') {\n\t\treturn Boolean(completionsEnablementObject[modeId]); // go with setting if explicitly defined\n\t}\n\n\treturn Boolean(completionsEnablementObject['*']); // fallback to global setting otherwise\n}\n\nclass UpdateOperation implements IDisposable {\n\tconstructor(\n\t\tpublic readonly request: UpdateRequest,\n\t\tpublic readonly cancellationTokenSource: CancellationTokenSource,\n\t\tpublic readonly promise: Promise<boolean>,\n\t) {\n\t}\n\n\tdispose() {\n\t\tthis.cancellationTokenSource.cancel();\n\t}\n}\n\nclass InlineCompletionsState extends Disposable {\n\tpublic static createEmpty(): InlineCompletionsState {\n\t\treturn new InlineCompletionsState([], undefined);\n\t}\n\n\tconstructor(\n\t\tpublic readonly inlineCompletions: readonly InlineSuggestionItem[],\n\t\tpublic readonly request: UpdateRequest | undefined,\n\t) {\n\t\tfor (const inlineCompletion of inlineCompletions) {\n\t\t\tinlineCompletion.addRef();\n\t\t}\n\n\t\tsuper();\n\n\t\tthis._register({\n\t\t\tdispose: () => {\n\t\t\t\tfor (const inlineCompletion of this.inlineCompletions) {\n\t\t\t\t\tinlineCompletion.removeRef();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _findById(id: InlineSuggestionIdentity): InlineSuggestionItem | undefined {\n\t\treturn this.inlineCompletions.find(i => i.identity === id);\n\t}\n\n\tprivate _findByHash(hash: string): InlineSuggestionItem | undefined {\n\t\treturn this.inlineCompletions.find(i => i.hash === hash);\n\t}\n\n\t/**\n\t * Applies the edit on the state.\n\t*/\n\tpublic createStateWithAppliedEdit(edit: StringEdit, textModel: ITextModel): InlineCompletionsState {\n\t\tconst newInlineCompletions = this.inlineCompletions.map(i => i.withEdit(edit, textModel)).filter(isDefined);\n\t\treturn new InlineCompletionsState(newInlineCompletions, this.request);\n\t}\n\n\tpublic createStateWithAppliedResults(updatedSuggestions: InlineSuggestionItem[], request: UpdateRequest, textModel: ITextModel, cursorPosition: Position, itemIdToPreserveAtTop: InlineSuggestionIdentity | undefined): InlineCompletionsState {\n\t\tlet itemToPreserve: InlineSuggestionItem | undefined = undefined;\n\t\tif (itemIdToPreserveAtTop) {\n\t\t\tconst itemToPreserveCandidate = this._findById(itemIdToPreserveAtTop);\n\t\t\tif (itemToPreserveCandidate && itemToPreserveCandidate.canBeReused(textModel, request.position)) {\n\t\t\t\titemToPreserve = itemToPreserveCandidate;\n\n\t\t\t\tconst updatedItemToPreserve = updatedSuggestions.find(i => i.hash === itemToPreserveCandidate.hash);\n\t\t\t\tif (updatedItemToPreserve) {\n\t\t\t\t\tupdatedSuggestions = moveToFront(updatedItemToPreserve, updatedSuggestions);\n\t\t\t\t} else {\n\t\t\t\t\tupdatedSuggestions = [itemToPreserveCandidate, ...updatedSuggestions];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst preferInlineCompletions = itemToPreserve\n\t\t\t// itemToPreserve has precedence\n\t\t\t? !itemToPreserve.isInlineEdit\n\t\t\t// Otherwise: prefer inline completion if there is a visible one\n\t\t\t: updatedSuggestions.some(i => !i.isInlineEdit && i.isVisible(textModel, cursorPosition));\n\n\t\tlet updatedItems: InlineSuggestionItem[] = [];\n\t\tfor (const i of updatedSuggestions) {\n\t\t\tconst oldItem = this._findByHash(i.hash);\n\t\t\tlet item;\n\t\t\tif (oldItem && oldItem !== i) {\n\t\t\t\titem = i.withIdentity(oldItem.identity);\n\t\t\t\ti.setIsPreceeded(oldItem);\n\t\t\t\toldItem.setEndOfLifeReason({ kind: InlineCompletionEndOfLifeReasonKind.Ignored, userTypingDisagreed: false, supersededBy: i.getSourceCompletion() });\n\t\t\t} else {\n\t\t\t\titem = i;\n\t\t\t}\n\t\t\tif (preferInlineCompletions !== item.isInlineEdit) {\n\t\t\t\tupdatedItems.push(item);\n\t\t\t}\n\t\t}\n\n\t\tupdatedItems.sort(compareBy(i => i.showInlineEditMenu, booleanComparator));\n\t\tupdatedItems = distinctByKey(updatedItems, i => i.semanticId);\n\n\t\treturn new InlineCompletionsState(updatedItems, request);\n\t}\n\n\tpublic clone(): InlineCompletionsState {\n\t\treturn new InlineCompletionsState(this.inlineCompletions, this.request);\n\t}\n}\n\n/** Keeps the first item in case of duplicates. */\nfunction distinctByKey<T>(items: T[], key: (item: T) => unknown): T[] {\n\tconst seen = new Set();\n\treturn items.filter(item => {\n\t\tconst k = key(item);\n\t\tif (seen.has(k)) {\n\t\t\treturn false;\n\t\t}\n\t\tseen.add(k);\n\t\treturn true;\n\t});\n}\n\nfunction moveToFront<T>(item: T, items: T[]): T[] {\n\tconst index = items.indexOf(item);\n\tif (index > -1) {\n\t\treturn [item, ...items.slice(0, index), ...items.slice(index + 1)];\n\t}\n\treturn items;\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 { booleanComparator, compareBy, compareUndefinedSmallest, numberComparator } from '../../../../../base/common/arrays.js';\nimport { findLastMax } from '../../../../../base/common/arraysFind.js';\nimport { RunOnceScheduler } from '../../../../../base/common/async.js';\nimport { CancellationTokenSource } from '../../../../../base/common/cancellation.js';\nimport { equalsIfDefined, itemEquals } from '../../../../../base/common/equals.js';\nimport { Disposable, DisposableStore, IDisposable, MutableDisposable, toDisposable } from '../../../../../base/common/lifecycle.js';\nimport { derived, IObservable, IObservableWithChange, ITransaction, observableValue, recordChangesLazy, transaction } from '../../../../../base/common/observable.js';\n// eslint-disable-next-line local/code-no-deep-import-of-internal\nimport { observableReducerSettable } from '../../../../../base/common/observableInternal/experimental/reducer.js';\nimport { isDefined, isObject } from '../../../../../base/common/types.js';\nimport { IConfigurationService } from '../../../../../platform/configuration/common/configuration.js';\nimport { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js';\nimport { DataChannelForwardingTelemetryService, forwardToChannelIf, isCopilotLikeExtension } from '../../../../../platform/dataChannel/browser/forwardingTelemetryService.js';\nimport { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';\nimport { ILogService } from '../../../../../platform/log/common/log.js';\nimport { observableConfigValue } from '../../../../../platform/observable/common/platformObservableUtils.js';\nimport product from '../../../../../platform/product/common/product.js';\nimport { StringEdit } from '../../../../common/core/edits/stringEdit.js';\nimport { Position } from '../../../../common/core/position.js';\nimport { InlineCompletionEndOfLifeReasonKind, InlineCompletionTriggerKind, InlineCompletionsProvider } from '../../../../common/languages.js';\nimport { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.js';\nimport { ITextModel } from '../../../../common/model.js';\nimport { offsetEditFromContentChanges } from '../../../../common/model/textModelStringEdit.js';\nimport { IFeatureDebounceInformation } from '../../../../common/services/languageFeatureDebounce.js';\nimport { IModelContentChangedEvent } from '../../../../common/textModelEvents.js';\nimport { formatRecordableLogEntry, IRecordableEditorLogEntry, IRecordableLogEntry, StructuredLogger } from '../structuredLogger.js';\nimport { InlineCompletionEndOfLifeEvent, sendInlineCompletionsEndOfLifeTelemetry } from '../telemetry.js';\nimport { wait } from '../utils.js';\nimport { InlineSuggestionIdentity, InlineSuggestionItem } from './inlineSuggestionItem.js';\nimport { InlineCompletionContextWithoutUuid, InlineSuggestRequestInfo, provideInlineCompletions, runWhenCancelled } from './provideInlineCompletions.js';\n\nexport class InlineCompletionsSource extends Disposable {\n\tprivate static _requestId = 0;\n\n\tprivate readonly _updateOperation = this._register(new MutableDisposable<UpdateOperation>());\n\n\tprivate readonly _loggingEnabled;\n\tprivate readonly _sendRequestData;\n\n\tprivate readonly _structuredFetchLogger;\n\n\tprivate readonly _state = observableReducerSettable(this, {\n\t\tinitial: () => ({\n\t\t\tinlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t\tsuggestWidgetInlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t}),\n\t\tdisposeFinal: (values) => {\n\t\t\tvalues.inlineCompletions.dispose();\n\t\t\tvalues.suggestWidgetInlineCompletions.dispose();\n\t\t},\n\t\tchangeTracker: recordChangesLazy(() => ({ versionId: this._versionId })),\n\t\tupdate: (reader, previousValue, changes) => {\n\t\t\tconst edit = StringEdit.compose(changes.changes.map(c => c.change ? offsetEditFromContentChanges(c.change.changes) : StringEdit.empty).filter(isDefined));\n\n\t\t\tif (edit.isEmpty()) {\n\t\t\t\treturn previousValue;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn {\n\t\t\t\t\tinlineCompletions: previousValue.inlineCompletions.createStateWithAppliedEdit(edit, this._textModel),\n\t\t\t\t\tsuggestWidgetInlineCompletions: previousValue.suggestWidgetInlineCompletions.createStateWithAppliedEdit(edit, this._textModel),\n\t\t\t\t};\n\t\t\t} finally {\n\t\t\t\tpreviousValue.inlineCompletions.dispose();\n\t\t\t\tpreviousValue.suggestWidgetInlineCompletions.dispose();\n\t\t\t}\n\t\t}\n\t});\n\n\tpublic readonly inlineCompletions = this._state.map(this, v => v.inlineCompletions);\n\tpublic readonly suggestWidgetInlineCompletions = this._state.map(this, v => v.suggestWidgetInlineCompletions);\n\n\tprivate _completionsEnabled: Record<string, boolean> | undefined = undefined;\n\n\tconstructor(\n\t\tprivate readonly _textModel: ITextModel,\n\t\tprivate readonly _versionId: IObservableWithChange<number | null, IModelContentChangedEvent | undefined>,\n\t\tprivate readonly _debounceValue: IFeatureDebounceInformation,\n\t\tprivate readonly _cursorPosition: IObservable<Position>,\n\t\t@ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService,\n\t\t@ILogService private readonly _logService: ILogService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t) {\n\t\tsuper();\n\t\tthis._loggingEnabled = observableConfigValue('editor.inlineSuggest.logFetch', false, this._configurationService).recomputeInitiallyAndOnChange(this._store);\n\t\tthis._sendRequestData = observableConfigValue('editor.inlineSuggest.emptyResponseInformation', true, this._configurationService).recomputeInitiallyAndOnChange(this._store);\n\t\tthis._structuredFetchLogger = this._register(this._instantiationService.createInstance(StructuredLogger.cast<\n\t\t\t{ kind: 'start'; requestId: number; context: unknown } & IRecordableEditorLogEntry\n\t\t\t| { kind: 'end'; error: unknown; durationMs: number; result: unknown; requestId: number } & IRecordableLogEntry\n\t\t>(),\n\t\t\t'editor.inlineSuggest.logFetch.commandId'\n\t\t));\n\n\t\tthis.clearOperationOnTextModelChange.recomputeInitiallyAndOnChange(this._store);\n\n\t\tconst enablementSetting = product.defaultChatAgent?.completionsEnablementSetting ?? undefined;\n\t\tif (enablementSetting) {\n\t\t\tthis._updateCompletionsEnablement(enablementSetting);\n\t\t\tthis._register(this._configurationService.onDidChangeConfiguration(e => {\n\t\t\t\tif (e.affectsConfiguration(enablementSetting)) {\n\t\t\t\t\tthis._updateCompletionsEnablement(enablementSetting);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\t}\n\n\tprivate _updateCompletionsEnablement(enalementSetting: string) {\n\t\tconst result = this._configurationService.getValue<Record<string, boolean>>(enalementSetting);\n\t\tif (!isObject(result)) {\n\t\t\tthis._completionsEnabled = undefined;\n\t\t} else {\n\t\t\tthis._completionsEnabled = result;\n\t\t}\n\t}\n\n\tpublic readonly clearOperationOnTextModelChange = derived(this, reader => {\n\t\tthis._versionId.read(reader);\n\t\tthis._updateOperation.clear();\n\t\treturn undefined; // always constant\n\t});\n\n\tprivate _log(entry:\n\t\t{ sourceId: string; kind: 'start'; requestId: number; context: unknown; provider: string | undefined } & IRecordableEditorLogEntry\n\t\t| { sourceId: string; kind: 'end'; error: unknown; durationMs: number; result: unknown; requestId: number; didAllProvidersReturn: boolean } & IRecordableLogEntry\n\t) {\n\t\tif (this._loggingEnabled.get()) {\n\t\t\tthis._logService.info(formatRecordableLogEntry(entry));\n\t\t}\n\t\tthis._structuredFetchLogger.log(entry);\n\t}\n\n\tprivate readonly _loadingCount = observableValue(this, 0);\n\n\tpublic fetch(\n\t\tproviders: InlineCompletionsProvider[],\n\t\tprovidersLabel: string | undefined,\n\t\tcontext: InlineCompletionContextWithoutUuid,\n\t\tactiveInlineCompletion: InlineSuggestionIdentity | undefined,\n\t\twithDebounce: boolean,\n\t\tuserJumpedToActiveCompletion: IObservable<boolean>,\n\t\trequestInfo: InlineSuggestRequestInfo\n\t): Promise<boolean> {\n\t\tconst position = this._cursorPosition.get();\n\t\tconst request = new UpdateRequest(position, context, this._textModel.getVersionId(), new Set(providers));\n\n\t\tconst target = context.selectedSuggestionInfo ? this.suggestWidgetInlineCompletions.get() : this.inlineCompletions.get();\n\n\t\tif (this._updateOperation.value?.request.satisfies(request)) {\n\t\t\treturn this._updateOperation.value.promise;\n\t\t} else if (target?.request?.satisfies(request)) {\n\t\t\treturn Promise.resolve(true);\n\t\t}\n\n\t\tconst updateOngoing = !!this._updateOperation.value;\n\t\tthis._updateOperation.clear();\n\n\t\tconst source = new CancellationTokenSource();\n\n\t\tconst promise = (async () => {\n\t\t\tconst store = new DisposableStore();\n\n\t\t\tthis._loadingCount.set(this._loadingCount.get() + 1, undefined);\n\t\t\tlet didDecrease = false;\n\t\t\tconst decreaseLoadingCount = () => {\n\t\t\t\tif (!didDecrease) {\n\t\t\t\t\tdidDecrease = true;\n\t\t\t\t\tthis._loadingCount.set(this._loadingCount.get() - 1, undefined);\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst loadingReset = store.add(new RunOnceScheduler(() => decreaseLoadingCount(), 10 * 1000));\n\t\t\tloadingReset.schedule();\n\n\t\t\tconst inlineSuggestionsProviders = providers.filter(p => p.providerId);\n\t\t\tconst requestResponseInfo = new RequestResponseData(context, requestInfo, inlineSuggestionsProviders);\n\n\n\t\t\ttry {\n\t\t\t\tconst recommendedDebounceValue = this._debounceValue.get(this._textModel);\n\t\t\t\tconst debounceValue = findLastMax(\n\t\t\t\t\tproviders.map(p => p.debounceDelayMs),\n\t\t\t\t\tcompareUndefinedSmallest(numberComparator)\n\t\t\t\t) ?? recommendedDebounceValue;\n\n\t\t\t\t// Debounce in any case if update is ongoing\n\t\t\t\tconst shouldDebounce = updateOngoing || (withDebounce && context.triggerKind === InlineCompletionTriggerKind.Automatic);\n\t\t\t\tif (shouldDebounce) {\n\t\t\t\t\t// This debounces the operation\n\t\t\t\t\tawait wait(debounceValue, source.token);\n\t\t\t\t}\n\n\t\t\t\tif (source.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== request.versionId) {\n\t\t\t\t\trequestResponseInfo.setNoSuggestionReasonIfNotSet('canceled:beforeFetch');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tconst requestId = InlineCompletionsSource._requestId++;\n\t\t\t\tif (this._loggingEnabled.get() || this._structuredFetchLogger.isEnabled.get()) {\n\t\t\t\t\tthis._log({\n\t\t\t\t\t\tsourceId: 'InlineCompletions.fetch',\n\t\t\t\t\t\tkind: 'start',\n\t\t\t\t\t\trequestId,\n\t\t\t\t\t\tmodelUri: this._textModel.uri,\n\t\t\t\t\t\tmodelVersion: this._textModel.getVersionId(),\n\t\t\t\t\t\tcontext: { triggerKind: context.triggerKind, suggestInfo: context.selectedSuggestionInfo ? true : undefined },\n\t\t\t\t\t\ttime: Date.now(),\n\t\t\t\t\t\tprovider: providersLabel,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tconst startTime = new Date();\n\t\t\t\tconst providerResult = provideInlineCompletions(providers, this._cursorPosition.get(), this._textModel, context, requestInfo, this._languageConfigurationService);\n\n\t\t\t\trunWhenCancelled(source.token, () => providerResult.cancelAndDispose({ kind: 'tokenCancellation' }));\n\n\t\t\t\tlet shouldStopEarly = false;\n\t\t\t\tlet producedSuggestion = false;\n\n\t\t\t\tconst suggestions: InlineSuggestionItem[] = [];\n\t\t\t\tfor await (const list of providerResult.lists) {\n\t\t\t\t\tif (!list) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tlist.addRef();\n\t\t\t\t\tstore.add(toDisposable(() => list.removeRef(list.inlineSuggestionsData.length === 0 ? { kind: 'empty' } : { kind: 'notTaken' })));\n\n\t\t\t\t\tfor (const item of list.inlineSuggestionsData) {\n\t\t\t\t\t\tproducedSuggestion = true;\n\t\t\t\t\t\tif (!context.includeInlineEdits && (item.isInlineEdit || item.showInlineEditMenu)) {\n\t\t\t\t\t\t\titem.setNotShownReason('notInlineEditRequested');\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!context.includeInlineCompletions && !(item.isInlineEdit || item.showInlineEditMenu)) {\n\t\t\t\t\t\t\titem.setNotShownReason('notInlineCompletionRequested');\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst i = InlineSuggestionItem.create(item, this._textModel);\n\t\t\t\t\t\tsuggestions.push(i);\n\t\t\t\t\t\t// Stop after first visible inline completion\n\t\t\t\t\t\tif (!i.isInlineEdit && !i.showInlineEditMenu && context.triggerKind === InlineCompletionTriggerKind.Automatic) {\n\t\t\t\t\t\t\tif (i.isVisible(this._textModel, this._cursorPosition.get())) {\n\t\t\t\t\t\t\t\tshouldStopEarly = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (shouldStopEarly) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tproviderResult.cancelAndDispose({ kind: 'lostRace' });\n\n\t\t\t\tif (this._loggingEnabled.get() || this._structuredFetchLogger.isEnabled.get()) {\n\t\t\t\t\tconst didAllProvidersReturn = providerResult.didAllProvidersReturn;\n\t\t\t\t\tlet error: string | undefined = undefined;\n\t\t\t\t\tif (source.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== request.versionId) {\n\t\t\t\t\t\terror = 'canceled';\n\t\t\t\t\t}\n\t\t\t\t\tconst result = suggestions.map(c => ({\n\t\t\t\t\t\trange: c.editRange.toString(),\n\t\t\t\t\t\ttext: c.insertText,\n\t\t\t\t\t\tisInlineEdit: !!c.isInlineEdit,\n\t\t\t\t\t\tsource: c.source.provider.groupId,\n\t\t\t\t\t}));\n\t\t\t\t\tthis._log({ sourceId: 'InlineCompletions.fetch', kind: 'end', requestId, durationMs: (Date.now() - startTime.getTime()), error, result, time: Date.now(), didAllProvidersReturn });\n\t\t\t\t}\n\n\t\t\t\trequestResponseInfo.setRequestUuid(providerResult.contextWithUuid.requestUuid);\n\t\t\t\tif (producedSuggestion) {\n\t\t\t\t\trequestResponseInfo.setHasProducedSuggestion();\n\t\t\t\t\tif (suggestions.length > 0 && source.token.isCancellationRequested) {\n\t\t\t\t\t\tsuggestions.forEach(s => s.setNotShownReasonIfNotSet('canceled:whileAwaitingOtherProviders'));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (source.token.isCancellationRequested) {\n\t\t\t\t\t\trequestResponseInfo.setNoSuggestionReasonIfNotSet('canceled:whileFetching');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst completionsQuotaExceeded = this._contextKeyService.getContextKeyValue<boolean>('completionsQuotaExceeded');\n\t\t\t\t\t\trequestResponseInfo.setNoSuggestionReasonIfNotSet(completionsQuotaExceeded ? 'completionsQuotaExceeded' : 'noSuggestion');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst remainingTimeToWait = context.earliestShownDateTime - Date.now();\n\t\t\t\tif (remainingTimeToWait > 0) {\n\t\t\t\t\tawait wait(remainingTimeToWait, source.token);\n\t\t\t\t}\n\n\t\t\t\tif (source.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== request.versionId\n\t\t\t\t\t|| userJumpedToActiveCompletion.get() /* In the meantime the user showed interest for the active completion so dont hide it */) {\n\t\t\t\t\tconst notShownReason =\n\t\t\t\t\t\tsource.token.isCancellationRequested ? 'canceled:afterMinShowDelay' :\n\t\t\t\t\t\t\tthis._store.isDisposed ? 'canceled:disposed' :\n\t\t\t\t\t\t\t\tthis._textModel.getVersionId() !== request.versionId ? 'canceled:documentChanged' :\n\t\t\t\t\t\t\t\t\tuserJumpedToActiveCompletion.get() ? 'canceled:userJumped' :\n\t\t\t\t\t\t\t\t\t\t'unknown';\n\t\t\t\t\tsuggestions.forEach(s => s.setNotShownReasonIfNotSet(notShownReason));\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tconst endTime = new Date();\n\t\t\t\tthis._debounceValue.update(this._textModel, endTime.getTime() - startTime.getTime());\n\n\t\t\t\tconst cursorPosition = this._cursorPosition.get();\n\t\t\t\tthis._updateOperation.clear();\n\t\t\t\ttransaction(tx => {\n\t\t\t\t\t/** @description Update completions with provider result */\n\t\t\t\t\tconst v = this._state.get();\n\n\t\t\t\t\tif (context.selectedSuggestionInfo) {\n\t\t\t\t\t\tthis._state.set({\n\t\t\t\t\t\t\tinlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t\t\t\t\t\tsuggestWidgetInlineCompletions: v.suggestWidgetInlineCompletions.createStateWithAppliedResults(suggestions, request, this._textModel, cursorPosition, activeInlineCompletion),\n\t\t\t\t\t\t}, tx);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._state.set({\n\t\t\t\t\t\t\tinlineCompletions: v.inlineCompletions.createStateWithAppliedResults(suggestions, request, this._textModel, cursorPosition, activeInlineCompletion),\n\t\t\t\t\t\t\tsuggestWidgetInlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t\t\t\t\t}, tx);\n\t\t\t\t\t}\n\n\t\t\t\t\tv.inlineCompletions.dispose();\n\t\t\t\t\tv.suggestWidgetInlineCompletions.dispose();\n\t\t\t\t});\n\t\t\t} finally {\n\t\t\t\tstore.dispose();\n\t\t\t\tdecreaseLoadingCount();\n\t\t\t\tthis.sendInlineCompletionsRequestTelemetry(requestResponseInfo);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t})();\n\n\t\tconst updateOperation = new UpdateOperation(request, source, promise);\n\t\tthis._updateOperation.value = updateOperation;\n\n\t\treturn promise;\n\t}\n\n\tpublic clear(tx: ITransaction): void {\n\t\tthis._updateOperation.clear();\n\t\tconst v = this._state.get();\n\t\tthis._state.set({\n\t\t\tinlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t\tsuggestWidgetInlineCompletions: InlineCompletionsState.createEmpty()\n\t\t}, tx);\n\t\tv.inlineCompletions.dispose();\n\t\tv.suggestWidgetInlineCompletions.dispose();\n\t}\n\n\tpublic seedInlineCompletionsWithSuggestWidget(): void {\n\t\tconst inlineCompletions = this.inlineCompletions.get();\n\t\tconst suggestWidgetInlineCompletions = this.suggestWidgetInlineCompletions.get();\n\t\tif (!suggestWidgetInlineCompletions) {\n\t\t\treturn;\n\t\t}\n\t\ttransaction(tx => {\n\t\t\t/** @description Seed inline completions with (newer) suggest widget inline completions */\n\t\t\tif (!inlineCompletions || (suggestWidgetInlineCompletions.request?.versionId ?? -1) > (inlineCompletions.request?.versionId ?? -1)) {\n\t\t\t\tinlineCompletions?.dispose();\n\t\t\t\tconst s = this._state.get();\n\t\t\t\tthis._state.set({\n\t\t\t\t\tinlineCompletions: suggestWidgetInlineCompletions.clone(),\n\t\t\t\t\tsuggestWidgetInlineCompletions: InlineCompletionsState.createEmpty(),\n\t\t\t\t}, tx);\n\t\t\t\ts.inlineCompletions.dispose();\n\t\t\t\ts.suggestWidgetInlineCompletions.dispose();\n\t\t\t}\n\t\t\tthis.clearSuggestWidgetInlineCompletions(tx);\n\t\t});\n\t}\n\n\tprivate sendInlineCompletionsRequestTelemetry(\n\t\trequestResponseInfo: RequestResponseData\n\t): void {\n\t\tif (!this._sendRequestData.get() && !this._contextKeyService.getContextKeyValue<boolean>('isRunningUnificationExperiment')) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (requestResponseInfo.requestUuid === undefined || requestResponseInfo.hasProducedSuggestion) {\n\t\t\treturn;\n\t\t}\n\n\n\t\tif (!isCompletionsEnabled(this._completionsEnabled, this._textModel.getLanguageId())) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!requestResponseInfo.providers.some(p => isCopilotLikeExtension(p.providerId?.extensionId))) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst emptyEndOfLifeEvent: InlineCompletionEndOfLifeEvent = {\n\t\t\topportunityId: requestResponseInfo.requestUuid,\n\t\t\tnoSuggestionReason: requestResponseInfo.noSuggestionReason ?? 'unknown',\n\t\t\textensionId: 'vscode-core',\n\t\t\textensionVersion: '0.0.0',\n\t\t\tgroupId: 'empty',\n\t\t\tshown: false,\n\t\t\teditorType: requestResponseInfo.requestInfo.editorType,\n\t\t\trequestReason: requestResponseInfo.requestInfo.reason,\n\t\t\ttypingInterval: requestResponseInfo.requestInfo.typingInterval,\n\t\t\ttypingIntervalCharacterCount: requestResponseInfo.requestInfo.typingIntervalCharacterCount,\n\t\t\tlanguageId: requestResponseInfo.requestInfo.languageId,\n\t\t\tselectedSuggestionInfo: !!requestResponseInfo.context.selectedSuggestionInfo,\n\t\t\tavailableProviders: requestResponseInfo.providers.map(p => p.providerId?.toString()).filter(isDefined).join(','),\n\t\t\t...forwardToChannelIf(requestResponseInfo.providers.some(p => isCopilotLikeExtension(p.providerId?.extensionId))),\n\t\t\ttimeUntilProviderRequest: undefined,\n\t\t\ttimeUntilProviderResponse: undefined,\n\t\t\tviewKind: undefined,\n\t\t\tpreceeded: undefined,\n\t\t\terror: undefined,\n\t\t\tsuperseded: undefined,\n\t\t\treason: undefined,\n\t\t\tcorrelationId: undefined,\n\t\t\tshownDuration: undefined,\n\t\t\tshownDurationUncollapsed: undefined,\n\t\t\ttimeUntilShown: undefined,\n\t\t\tpartiallyAccepted: undefined,\n\t\t\tpartiallyAcceptedCountSinceOriginal: undefined,\n\t\t\tpartiallyAcceptedRatioSinceOriginal: undefined,\n\t\t\tpartiallyAcceptedCharactersSinceOriginal: undefined,\n\t\t\tcursorColumnDistance: undefined,\n\t\t\tcursorLineDistance: undefined,\n\t\t\tlineCountOriginal: undefined,\n\t\t\tlineCountModified: undefined,\n\t\t\tcharacterCountOriginal: undefined,\n\t\t\tcharacterCountModified: undefined,\n\t\t\tdisjointReplacements: undefined,\n\t\t\tsameShapeReplacements: undefined,\n\t\t\tnotShownReason: undefined,\n\t\t};\n\n\t\tconst dataChannel = this._instantiationService.createInstance(DataChannelForwardingTelemetryService);\n\t\tsendInlineCompletionsEndOfLifeTelemetry(dataChannel, emptyEndOfLifeEvent);\n\t}\n\n\tpublic clearSuggestWidgetInlineCompletions(tx: ITransaction): void {\n\t\tif (this._updateOperation.value?.request.context.selectedSuggestionInfo) {\n\t\t\tthis._updateOperation.clear();\n\t\t}\n\t}\n\n\tpublic cancelUpdate(): void {\n\t\tthis._updateOperation.clear();\n\t}\n}\n\nclass UpdateRequest {\n\tconstructor(\n\t\tpublic readonly position: Position,\n\t\tpublic readonly context: InlineCompletionContextWithoutUuid,\n\t\tpublic readonly versionId: number,\n\t\tpublic readonly providers: Set<InlineCompletionsProvider>,\n\t) {\n\t}\n\n\tpublic satisfies(other: UpdateRequest): boolean {\n\t\treturn this.position.equals(other.position)\n\t\t\t&& equalsIfDefined(this.context.selectedSuggestionInfo, other.context.selectedSuggestionInfo, itemEquals())\n\t\t\t&& (other.context.triggerKind === InlineCompletionTriggerKind.Automatic\n\t\t\t\t|| this.context.triggerKind === InlineCompletionTriggerKind.Explicit)\n\t\t\t&& this.versionId === other.versionId\n\t\t\t&& isSubset(other.providers, this.providers);\n\t}\n}\n\nclass RequestResponseData {\n\tpublic requestUuid: string | undefined;\n\tpublic noSuggestionReason: string | undefined;\n\tpublic hasProducedSuggestion = false;\n\n\tconstructor(\n\t\tpublic readonly context: InlineCompletionContextWithoutUuid,\n\t\tpublic readonly requestInfo: InlineSuggestRequestInfo,\n\t\tpublic readonly providers: InlineCompletionsProvider[],\n\t) { }\n\n\tsetRequestUuid(uuid: string) {\n\t\tthis.requestUuid = uuid;\n\t}\n\n\tsetNoSuggestionReasonIfNotSet(type: string) {\n\t\tthis.noSuggestionReason ??= type;\n\t}\n\n\tsetHasProducedSuggestion() {\n\t\tthis.hasProducedSuggestion = true;\n\t}\n}\n\nfunction isSubset<T>(set1: Set<T>, set2: Set<T>): boolean {\n\treturn [...set1].every(item => set2.has(item));\n}\n\nfunction isCompletionsEnabled(completionsEnablementObject: Record<string, boolean> | undefined, modeId: string = '*'): boolean {\n\tif (completionsEnablementObject === undefined) {\n\t\treturn false; // default to disabled if setting is not available\n\t}\n\n\tif (typeof completionsEnablementObject[modeId] !== 'undefined') {\n\t\treturn Boolean(completionsEnablementObject[modeId]); // go with setting if explicitly defined\n\t}\n\n\treturn Boolean(completionsEnablementObject['*']); // fallback to global setting otherwise\n}\n\nclass UpdateOperation implements IDisposable {\n\tconstructor(\n\t\tpublic readonly request: UpdateRequest,\n\t\tpublic readonly cancellationTokenSource: CancellationTokenSource,\n\t\tpublic readonly promise: Promise<boolean>,\n\t) {\n\t}\n\n\tdispose() {\n\t\tthis.cancellationTokenSource.cancel();\n\t}\n}\n\nclass InlineCompletionsState extends Disposable {\n\tpublic static createEmpty(): InlineCompletionsState {\n\t\treturn new InlineCompletionsState([], undefined);\n\t}\n\n\tconstructor(\n\t\tpublic readonly inlineCompletions: readonly InlineSuggestionItem[],\n\t\tpublic readonly request: UpdateRequest | undefined,\n\t) {\n\t\tfor (const inlineCompletion of inlineCompletions) {\n\t\t\tinlineCompletion.addRef();\n\t\t}\n\n\t\tsuper();\n\n\t\tthis._register({\n\t\t\tdispose: () => {\n\t\t\t\tfor (const inlineCompletion of this.inlineCompletions) {\n\t\t\t\t\tinlineCompletion.removeRef();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _findById(id: InlineSuggestionIdentity): InlineSuggestionItem | undefined {\n\t\treturn this.inlineCompletions.find(i => i.identity === id);\n\t}\n\n\tprivate _findByHash(hash: string): InlineSuggestionItem | undefined {\n\t\treturn this.inlineCompletions.find(i => i.hash === hash);\n\t}\n\n\t/**\n\t * Applies the edit on the state.\n\t*/\n\tpublic createStateWithAppliedEdit(edit: StringEdit, textModel: ITextModel): InlineCompletionsState {\n\t\tconst newInlineCompletions = this.inlineCompletions.map(i => i.withEdit(edit, textModel)).filter(isDefined);\n\t\treturn new InlineCompletionsState(newInlineCompletions, this.request);\n\t}\n\n\tpublic createStateWithAppliedResults(updatedSuggestions: InlineSuggestionItem[], request: UpdateRequest, textModel: ITextModel, cursorPosition: Position, itemIdToPreserveAtTop: InlineSuggestionIdentity | undefined): InlineCompletionsState {\n\t\tlet itemToPreserve: InlineSuggestionItem | undefined = undefined;\n\t\tif (itemIdToPreserveAtTop) {\n\t\t\tconst itemToPreserveCandidate = this._findById(itemIdToPreserveAtTop);\n\t\t\tif (itemToPreserveCandidate && itemToPreserveCandidate.canBeReused(textModel, request.position)) {\n\t\t\t\titemToPreserve = itemToPreserveCandidate;\n\n\t\t\t\tconst updatedItemToPreserve = updatedSuggestions.find(i => i.hash === itemToPreserveCandidate.hash);\n\t\t\t\tif (updatedItemToPreserve) {\n\t\t\t\t\tupdatedSuggestions = moveToFront(updatedItemToPreserve, updatedSuggestions);\n\t\t\t\t} else {\n\t\t\t\t\tupdatedSuggestions = [itemToPreserveCandidate, ...updatedSuggestions];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst preferInlineCompletions = itemToPreserve\n\t\t\t// itemToPreserve has precedence\n\t\t\t? !itemToPreserve.isInlineEdit\n\t\t\t// Otherwise: prefer inline completion if there is a visible one\n\t\t\t: updatedSuggestions.some(i => !i.isInlineEdit && i.isVisible(textModel, cursorPosition));\n\n\t\tlet updatedItems: InlineSuggestionItem[] = [];\n\t\tfor (const i of updatedSuggestions) {\n\t\t\tconst oldItem = this._findByHash(i.hash);\n\t\t\tlet item;\n\t\t\tif (oldItem && oldItem !== i) {\n\t\t\t\titem = i.withIdentity(oldItem.identity);\n\t\t\t\ti.setIsPreceeded(oldItem);\n\t\t\t\toldItem.setEndOfLifeReason({ kind: InlineCompletionEndOfLifeReasonKind.Ignored, userTypingDisagreed: false, supersededBy: i.getSourceCompletion() });\n\t\t\t} else {\n\t\t\t\titem = i;\n\t\t\t}\n\t\t\tif (preferInlineCompletions !== item.isInlineEdit) {\n\t\t\t\tupdatedItems.push(item);\n\t\t\t}\n\t\t}\n\n\t\tupdatedItems.sort(compareBy(i => i.showInlineEditMenu, booleanComparator));\n\t\tupdatedItems = distinctByKey(updatedItems, i => i.semanticId);\n\n\t\treturn new InlineCompletionsState(updatedItems, request);\n\t}\n\n\tpublic clone(): InlineCompletionsState {\n\t\treturn new InlineCompletionsState(this.inlineCompletions, this.request);\n\t}\n}\n\n/** Keeps the first item in case of duplicates. */\nfunction distinctByKey<T>(items: T[], key: (item: T) => unknown): T[] {\n\tconst seen = new Set();\n\treturn items.filter(item => {\n\t\tconst k = key(item);\n\t\tif (seen.has(k)) {\n\t\t\treturn false;\n\t\t}\n\t\tseen.add(k);\n\t\treturn true;\n\t});\n}\n\nfunction moveToFront<T>(item: T, items: T[]): T[] {\n\tconst index = items.indexOf(item);\n\tif (index > -1) {\n\t\treturn [item, ...items.slice(0, index), ...items.slice(index + 1)];\n\t}\n\treturn items;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/telemetry.ts","vs/editor/contrib/inlineCompletions/browser/telemetry.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAIhG,MAAM,UAAU,uCAAuC,CAAC,WAAkD,EAAE,gBAAgD;IAC3J,WAAW,CAAC,UAAU,CAA2E,4BAA4B,EAAE,gBAAgB,CAAC,CAAC;AAClJ,CAAC","file":"telemetry.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 { DataChannelForwardingTelemetryService } from '../../../../platform/dataChannel/browser/forwardingTelemetryService.js';\n\nexport function sendInlineCompletionsEndOfLifeTelemetry(dataChannel: DataChannelForwardingTelemetryService, endOfLifeSummary: InlineCompletionEndOfLifeEvent) {\n\tdataChannel.publicLog2<InlineCompletionEndOfLifeEvent, InlineCompletionsEndOfLifeClassification>('inlineCompletion.endOfLife', endOfLifeSummary);\n}\n\nexport type InlineCompletionEndOfLifeEvent = {\n\t// request\n\t/**\n\t * @deprecated To be removed at one point in favor of opportunityId\n\t */\n\tid: string;\n\topportunityId: string;\n\trequestReason: string;\n\teditorType: string;\n\tlanguageId: string;\n\ttypingInterval: number;\n\ttypingIntervalCharacterCount: number;\n\tselectedSuggestionInfo: boolean;\n\tavailableProviders: string;\n\t// response\n\tcorrelationId: string | undefined;\n\textensionId: string;\n\textensionVersion: string;\n\tgroupId: string | undefined;\n\t// behavior\n\tshown: boolean;\n\tshownDuration: number | undefined;\n\tshownDurationUncollapsed: number | undefined;\n\ttimeUntilShown: number | undefined;\n\ttimeUntilProviderRequest: number | undefined;\n\ttimeUntilProviderResponse: number | undefined;\n\treason: 'accepted' | 'rejected' | 'ignored' | undefined;\n\tpartiallyAccepted: number | undefined;\n\tpartiallyAcceptedCountSinceOriginal: number | undefined;\n\tpartiallyAcceptedRatioSinceOriginal: number | undefined;\n\tpartiallyAcceptedCharactersSinceOriginal: number | undefined;\n\tpreceeded: boolean | undefined;\n\tsuperseded: boolean | undefined;\n\terror: string | undefined;\n\tnotShownReason: string | undefined;\n\t// rendering\n\tviewKind: string | undefined;\n\tcursorColumnDistance: number | undefined;\n\tcursorLineDistance: number | undefined;\n\tlineCountOriginal: number | undefined;\n\tlineCountModified: number | undefined;\n\tcharacterCountOriginal: number | undefined;\n\tcharacterCountModified: number | undefined;\n\tdisjointReplacements: number | undefined;\n\tsameShapeReplacements: boolean | undefined;\n\t// empty\n\tnoSuggestionReason: string | undefined;\n};\n\ntype InlineCompletionsEndOfLifeClassification = {\n\towner: 'benibenj';\n\tcomment: 'Inline completions ended';\n\tid: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The identifier for the inline completion request' };\n\topportunityId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Unique identifier for an opportunity to show an inline completion or NES' };\n\tcorrelationId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The correlation identifier for the inline completion' };\n\textensionId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The identifier for the extension that contributed the inline completion' };\n\textensionVersion: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The version of the extension that contributed the inline completion' };\n\tgroupId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The group ID of the extension that contributed the inline completion' };\n\tavailableProviders: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The list of available inline completion providers at the time of the request' };\n\tshown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was shown to the user' };\n\tshownDuration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown' };\n\tshownDurationUncollapsed: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown without collapsing' };\n\ttimeUntilShown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\ttimeUntilProviderRequest: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be requested from the provider' };\n\ttimeUntilProviderResponse: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\treason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion ending' };\n\tselectedSuggestionInfo: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was requested with a selected suggestion' };\n\tpartiallyAccepted: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted by the user' };\n\tpartiallyAcceptedCountSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted since the original request' };\n\tpartiallyAcceptedRatioSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The percentage of characters accepted since the original request' };\n\tpartiallyAcceptedCharactersSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count accepted since the original request' };\n\tpreceeded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was preceeded by another one' };\n\tlanguageId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The language ID of the document where the inline completion was shown' };\n\trequestReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion request' };\n\terror: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The error message if the inline completion failed' };\n\ttypingInterval: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The average typing interval of the user at the moment the inline completion was requested' };\n\ttypingIntervalCharacterCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count involved in the typing interval calculation' };\n\tsuperseded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was superseded by another one' };\n\teditorType: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The type of the editor where the inline completion was shown' };\n\tviewKind: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The kind of the view where the inline completion was shown' };\n\tcursorColumnDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in columns from the cursor to the inline suggestion' };\n\tcursorLineDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in lines from the cursor to the inline suggestion' };\n\tlineCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the original text' };\n\tlineCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the modified text' };\n\tcharacterCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the original text' };\n\tcharacterCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the modified text' };\n\tdisjointReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of inner replacements made by the inline completion' };\n\tsameShapeReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether all inner replacements are the same shape' };\n\tnoSuggestionReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why no inline completion was provided' };\n\tnotShownReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why the inline completion was not shown' };\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 { DataChannelForwardingTelemetryService } from '../../../../platform/dataChannel/browser/forwardingTelemetryService.js';\n\nexport function sendInlineCompletionsEndOfLifeTelemetry(dataChannel: DataChannelForwardingTelemetryService, endOfLifeSummary: InlineCompletionEndOfLifeEvent) {\n\tdataChannel.publicLog2<InlineCompletionEndOfLifeEvent, InlineCompletionsEndOfLifeClassification>('inlineCompletion.endOfLife', endOfLifeSummary);\n}\n\nexport type InlineCompletionEndOfLifeEvent = {\n\t// request\n\t/**\n\t * @deprecated To be removed at one point in favor of opportunityId\n\t */\n\tid: string;\n\topportunityId: string;\n\trequestReason: string;\n\teditorType: string;\n\tlanguageId: string;\n\ttypingInterval: number;\n\ttypingIntervalCharacterCount: number;\n\tselectedSuggestionInfo: boolean;\n\tavailableProviders: string;\n\t// response\n\tcorrelationId: string | undefined;\n\textensionId: string;\n\textensionVersion: string;\n\tgroupId: string | undefined;\n\t// behavior\n\tshown: boolean;\n\tshownDuration: number | undefined;\n\tshownDurationUncollapsed: number | undefined;\n\ttimeUntilShown: number | undefined;\n\ttimeUntilProviderRequest: number | undefined;\n\ttimeUntilProviderResponse: number | undefined;\n\treason: 'accepted' | 'rejected' | 'ignored' | undefined;\n\tpartiallyAccepted: number | undefined;\n\tpartiallyAcceptedCountSinceOriginal: number | undefined;\n\tpartiallyAcceptedRatioSinceOriginal: number | undefined;\n\tpartiallyAcceptedCharactersSinceOriginal: number | undefined;\n\tpreceeded: boolean | undefined;\n\tsuperseded: boolean | undefined;\n\terror: string | undefined;\n\tnotShownReason: string | undefined;\n\t// rendering\n\tviewKind: string | undefined;\n\tcursorColumnDistance: number | undefined;\n\tcursorLineDistance: number | undefined;\n\tlineCountOriginal: number | undefined;\n\tlineCountModified: number | undefined;\n\tcharacterCountOriginal: number | undefined;\n\tcharacterCountModified: number | undefined;\n\tdisjointReplacements: number | undefined;\n\tsameShapeReplacements: boolean | undefined;\n\t// empty\n\tnoSuggestionReason: string | undefined;\n};\n\ntype InlineCompletionsEndOfLifeClassification = {\n\towner: 'benibenj';\n\tcomment: 'Inline completions ended';\n\tid: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The identifier for the inline completion request' };\n\topportunityId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Unique identifier for an opportunity to show an inline completion or NES' };\n\tcorrelationId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The correlation identifier for the inline completion' };\n\textensionId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The identifier for the extension that contributed the inline completion' };\n\textensionVersion: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The version of the extension that contributed the inline completion' };\n\tgroupId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The group ID of the extension that contributed the inline completion' };\n\tavailableProviders: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The list of available inline completion providers at the time of the request' };\n\tshown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was shown to the user' };\n\tshownDuration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown' };\n\tshownDurationUncollapsed: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown without collapsing' };\n\ttimeUntilShown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\ttimeUntilProviderRequest: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be requested from the provider' };\n\ttimeUntilProviderResponse: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\treason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion ending' };\n\tselectedSuggestionInfo: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was requested with a selected suggestion' };\n\tpartiallyAccepted: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted by the user' };\n\tpartiallyAcceptedCountSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted since the original request' };\n\tpartiallyAcceptedRatioSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The percentage of characters accepted since the original request' };\n\tpartiallyAcceptedCharactersSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count accepted since the original request' };\n\tpreceeded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was preceeded by another one' };\n\tlanguageId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The language ID of the document where the inline completion was shown' };\n\trequestReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion request' };\n\terror: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The error message if the inline completion failed' };\n\ttypingInterval: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The average typing interval of the user at the moment the inline completion was requested' };\n\ttypingIntervalCharacterCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count involved in the typing interval calculation' };\n\tsuperseded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was superseded by another one' };\n\teditorType: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The type of the editor where the inline completion was shown' };\n\tviewKind: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The kind of the view where the inline completion was shown' };\n\tcursorColumnDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in columns from the cursor to the inline suggestion' };\n\tcursorLineDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in lines from the cursor to the inline suggestion' };\n\tlineCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the original text' };\n\tlineCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the modified text' };\n\tcharacterCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the original text' };\n\tcharacterCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the modified text' };\n\tdisjointReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of inner replacements made by the inline completion' };\n\tsameShapeReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether all inner replacements are the same shape' };\n\tnoSuggestionReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why no inline completion was provided' };\n\tnotShownReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why the inline completion was not shown' };\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/telemetry.ts","vs/editor/contrib/inlineCompletions/browser/telemetry.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAIhG,MAAM,UAAU,uCAAuC,CAAC,WAAkD,EAAE,gBAAgD;IAC3J,WAAW,CAAC,UAAU,CAA2E,4BAA4B,EAAE,gBAAgB,CAAC,CAAC;AAClJ,CAAC","file":"telemetry.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 { DataChannelForwardingTelemetryService } from '../../../../platform/dataChannel/browser/forwardingTelemetryService.js';\n\nexport function sendInlineCompletionsEndOfLifeTelemetry(dataChannel: DataChannelForwardingTelemetryService, endOfLifeSummary: InlineCompletionEndOfLifeEvent) {\n\tdataChannel.publicLog2<InlineCompletionEndOfLifeEvent, InlineCompletionsEndOfLifeClassification>('inlineCompletion.endOfLife', endOfLifeSummary);\n}\n\nexport type InlineCompletionEndOfLifeEvent = {\n\t// request\n\topportunityId: string;\n\trequestReason: string;\n\teditorType: string;\n\tlanguageId: string;\n\ttypingInterval: number;\n\ttypingIntervalCharacterCount: number;\n\tselectedSuggestionInfo: boolean;\n\tavailableProviders: string;\n\t// response\n\tcorrelationId: string | undefined;\n\textensionId: string;\n\textensionVersion: string;\n\tgroupId: string | undefined;\n\t// behavior\n\tshown: boolean;\n\tshownDuration: number | undefined;\n\tshownDurationUncollapsed: number | undefined;\n\ttimeUntilShown: number | undefined;\n\ttimeUntilProviderRequest: number | undefined;\n\ttimeUntilProviderResponse: number | undefined;\n\treason: 'accepted' | 'rejected' | 'ignored' | undefined;\n\tpartiallyAccepted: number | undefined;\n\tpartiallyAcceptedCountSinceOriginal: number | undefined;\n\tpartiallyAcceptedRatioSinceOriginal: number | undefined;\n\tpartiallyAcceptedCharactersSinceOriginal: number | undefined;\n\tpreceeded: boolean | undefined;\n\tsuperseded: boolean | undefined;\n\terror: string | undefined;\n\tnotShownReason: string | undefined;\n\t// rendering\n\tviewKind: string | undefined;\n\tcursorColumnDistance: number | undefined;\n\tcursorLineDistance: number | undefined;\n\tlineCountOriginal: number | undefined;\n\tlineCountModified: number | undefined;\n\tcharacterCountOriginal: number | undefined;\n\tcharacterCountModified: number | undefined;\n\tdisjointReplacements: number | undefined;\n\tsameShapeReplacements: boolean | undefined;\n\t// empty\n\tnoSuggestionReason: string | undefined;\n};\n\ntype InlineCompletionsEndOfLifeClassification = {\n\towner: 'benibenj';\n\tcomment: 'Inline completions ended. @sentToGitHub';\n\topportunityId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Unique identifier for an opportunity to show an inline completion or NES' };\n\tcorrelationId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The correlation identifier for the inline completion' };\n\textensionId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The identifier for the extension that contributed the inline completion' };\n\textensionVersion: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The version of the extension that contributed the inline completion' };\n\tgroupId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The group ID of the extension that contributed the inline completion' };\n\tavailableProviders: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The list of available inline completion providers at the time of the request' };\n\tshown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was shown to the user' };\n\tshownDuration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown' };\n\tshownDurationUncollapsed: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown without collapsing' };\n\ttimeUntilShown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\ttimeUntilProviderRequest: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be requested from the provider' };\n\ttimeUntilProviderResponse: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\treason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion ending' };\n\tselectedSuggestionInfo: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was requested with a selected suggestion' };\n\tpartiallyAccepted: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted by the user' };\n\tpartiallyAcceptedCountSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted since the original request' };\n\tpartiallyAcceptedRatioSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The percentage of characters accepted since the original request' };\n\tpartiallyAcceptedCharactersSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count accepted since the original request' };\n\tpreceeded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was preceeded by another one' };\n\tlanguageId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The language ID of the document where the inline completion was shown' };\n\trequestReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion request' };\n\terror: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The error message if the inline completion failed' };\n\ttypingInterval: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The average typing interval of the user at the moment the inline completion was requested' };\n\ttypingIntervalCharacterCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count involved in the typing interval calculation' };\n\tsuperseded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was superseded by another one' };\n\teditorType: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The type of the editor where the inline completion was shown' };\n\tviewKind: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The kind of the view where the inline completion was shown' };\n\tcursorColumnDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in columns from the cursor to the inline suggestion' };\n\tcursorLineDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in lines from the cursor to the inline suggestion' };\n\tlineCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the original text' };\n\tlineCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the modified text' };\n\tcharacterCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the original text' };\n\tcharacterCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the modified text' };\n\tdisjointReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of inner replacements made by the inline completion' };\n\tsameShapeReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether all inner replacements are the same shape' };\n\tnoSuggestionReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why no inline completion was provided' };\n\tnotShownReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why the inline completion was not shown' };\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 { DataChannelForwardingTelemetryService } from '../../../../platform/dataChannel/browser/forwardingTelemetryService.js';\n\nexport function sendInlineCompletionsEndOfLifeTelemetry(dataChannel: DataChannelForwardingTelemetryService, endOfLifeSummary: InlineCompletionEndOfLifeEvent) {\n\tdataChannel.publicLog2<InlineCompletionEndOfLifeEvent, InlineCompletionsEndOfLifeClassification>('inlineCompletion.endOfLife', endOfLifeSummary);\n}\n\nexport type InlineCompletionEndOfLifeEvent = {\n\t// request\n\topportunityId: string;\n\trequestReason: string;\n\teditorType: string;\n\tlanguageId: string;\n\ttypingInterval: number;\n\ttypingIntervalCharacterCount: number;\n\tselectedSuggestionInfo: boolean;\n\tavailableProviders: string;\n\t// response\n\tcorrelationId: string | undefined;\n\textensionId: string;\n\textensionVersion: string;\n\tgroupId: string | undefined;\n\t// behavior\n\tshown: boolean;\n\tshownDuration: number | undefined;\n\tshownDurationUncollapsed: number | undefined;\n\ttimeUntilShown: number | undefined;\n\ttimeUntilProviderRequest: number | undefined;\n\ttimeUntilProviderResponse: number | undefined;\n\treason: 'accepted' | 'rejected' | 'ignored' | undefined;\n\tpartiallyAccepted: number | undefined;\n\tpartiallyAcceptedCountSinceOriginal: number | undefined;\n\tpartiallyAcceptedRatioSinceOriginal: number | undefined;\n\tpartiallyAcceptedCharactersSinceOriginal: number | undefined;\n\tpreceeded: boolean | undefined;\n\tsuperseded: boolean | undefined;\n\terror: string | undefined;\n\tnotShownReason: string | undefined;\n\t// rendering\n\tviewKind: string | undefined;\n\tcursorColumnDistance: number | undefined;\n\tcursorLineDistance: number | undefined;\n\tlineCountOriginal: number | undefined;\n\tlineCountModified: number | undefined;\n\tcharacterCountOriginal: number | undefined;\n\tcharacterCountModified: number | undefined;\n\tdisjointReplacements: number | undefined;\n\tsameShapeReplacements: boolean | undefined;\n\t// empty\n\tnoSuggestionReason: string | undefined;\n};\n\ntype InlineCompletionsEndOfLifeClassification = {\n\towner: 'benibenj';\n\tcomment: 'Inline completions ended. @sentToGitHub';\n\topportunityId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Unique identifier for an opportunity to show an inline completion or NES' };\n\tcorrelationId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The correlation identifier for the inline completion' };\n\textensionId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The identifier for the extension that contributed the inline completion' };\n\textensionVersion: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The version of the extension that contributed the inline completion' };\n\tgroupId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The group ID of the extension that contributed the inline completion' };\n\tavailableProviders: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The list of available inline completion providers at the time of the request' };\n\tshown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was shown to the user' };\n\tshownDuration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown' };\n\tshownDurationUncollapsed: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The duration for which the inline completion was shown without collapsing' };\n\ttimeUntilShown: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\ttimeUntilProviderRequest: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be requested from the provider' };\n\ttimeUntilProviderResponse: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The time it took for the inline completion to be shown after the request' };\n\treason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion ending' };\n\tselectedSuggestionInfo: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was requested with a selected suggestion' };\n\tpartiallyAccepted: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted by the user' };\n\tpartiallyAcceptedCountSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'How often the inline completion was partially accepted since the original request' };\n\tpartiallyAcceptedRatioSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The percentage of characters accepted since the original request' };\n\tpartiallyAcceptedCharactersSinceOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count accepted since the original request' };\n\tpreceeded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was preceeded by another one' };\n\tlanguageId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The language ID of the document where the inline completion was shown' };\n\trequestReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason for the inline completion request' };\n\terror: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The error message if the inline completion failed' };\n\ttypingInterval: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The average typing interval of the user at the moment the inline completion was requested' };\n\ttypingIntervalCharacterCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The character count involved in the typing interval calculation' };\n\tsuperseded: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the inline completion was superseded by another one' };\n\teditorType: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The type of the editor where the inline completion was shown' };\n\tviewKind: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The kind of the view where the inline completion was shown' };\n\tcursorColumnDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in columns from the cursor to the inline suggestion' };\n\tcursorLineDistance: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The distance in lines from the cursor to the inline suggestion' };\n\tlineCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the original text' };\n\tlineCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of lines in the modified text' };\n\tcharacterCountOriginal: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the original text' };\n\tcharacterCountModified: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of characters in the modified text' };\n\tdisjointReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The number of inner replacements made by the inline completion' };\n\tsameShapeReplacements: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether all inner replacements are the same shape' };\n\tnoSuggestionReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why no inline completion was provided' };\n\tnotShownReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason why the inline completion was not shown' };\n};\n"]}
|
|
@@ -62,13 +62,13 @@ let GutterIndicatorMenuContent = class GutterIndicatorMenuContent {
|
|
|
62
62
|
const title = header(this._model.displayName);
|
|
63
63
|
const gotoAndAccept = option(createOptionArgs({
|
|
64
64
|
id: 'gotoAndAccept',
|
|
65
|
-
title: `${localize(
|
|
65
|
+
title: `${localize(1207, "Go To")} / ${localize(1208, "Accept")}`,
|
|
66
66
|
icon: Codicon.check,
|
|
67
67
|
commandId: inlineSuggestCommitId
|
|
68
68
|
}));
|
|
69
69
|
const reject = option(createOptionArgs({
|
|
70
70
|
id: 'reject',
|
|
71
|
-
title: localize(
|
|
71
|
+
title: localize(1209, "Reject"),
|
|
72
72
|
icon: Codicon.close,
|
|
73
73
|
commandId: hideInlineCompletionId
|
|
74
74
|
}));
|
|
@@ -82,25 +82,25 @@ let GutterIndicatorMenuContent = class GutterIndicatorMenuContent {
|
|
|
82
82
|
const toggleCollapsedMode = this._inlineEditsShowCollapsed.map(showCollapsed => showCollapsed ?
|
|
83
83
|
option(createOptionArgs({
|
|
84
84
|
id: 'showExpanded',
|
|
85
|
-
title: localize(
|
|
85
|
+
title: localize(1210, "Show Expanded"),
|
|
86
86
|
icon: Codicon.expandAll,
|
|
87
87
|
commandId: toggleShowCollapsedId
|
|
88
88
|
}))
|
|
89
89
|
: option(createOptionArgs({
|
|
90
90
|
id: 'showCollapsed',
|
|
91
|
-
title: localize(
|
|
91
|
+
title: localize(1211, "Show Collapsed"),
|
|
92
92
|
icon: Codicon.collapseAll,
|
|
93
93
|
commandId: toggleShowCollapsedId
|
|
94
94
|
})));
|
|
95
95
|
const snooze = option(createOptionArgs({
|
|
96
96
|
id: 'snooze',
|
|
97
|
-
title: localize(
|
|
97
|
+
title: localize(1212, "Snooze"),
|
|
98
98
|
icon: Codicon.bellSlash,
|
|
99
99
|
commandId: 'editor.action.inlineSuggest.snooze'
|
|
100
100
|
}));
|
|
101
101
|
const settings = option(createOptionArgs({
|
|
102
102
|
id: 'settings',
|
|
103
|
-
title: localize(
|
|
103
|
+
title: localize(1213, "Settings"),
|
|
104
104
|
icon: Codicon.gear,
|
|
105
105
|
commandId: 'workbench.action.openSettings',
|
|
106
106
|
commandArgs: ['@tag:nextEditSuggestions']
|
package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js
CHANGED
|
@@ -15,7 +15,7 @@ export class InlineEditModel {
|
|
|
15
15
|
this.inlineEdit = inlineEdit;
|
|
16
16
|
this.tabAction = tabAction;
|
|
17
17
|
this.action = this.inlineEdit.inlineCompletion.action;
|
|
18
|
-
this.displayName = this.inlineEdit.inlineCompletion.source.provider.displayName ?? localize(
|
|
18
|
+
this.displayName = this.inlineEdit.inlineCompletion.source.provider.displayName ?? localize(1214, "Inline Edit");
|
|
19
19
|
this.extensionCommands = this.inlineEdit.inlineCompletion.source.inlineSuggestions.commands ?? [];
|
|
20
20
|
this.isInDiffEditor = this._model.isInDiffEditor;
|
|
21
21
|
this.displayLocation = this.inlineEdit.inlineCompletion.displayLocation;
|