@codingame/monaco-vscode-api 16.1.0 → 17.0.0
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/missing-services.js +107 -2
- package/monaco.d.ts +2 -2
- package/package.json +10 -9
- package/services.d.ts +4 -4
- package/services.js +7 -18
- package/vscode/src/vs/base/browser/dom.d.ts +1 -0
- package/vscode/src/vs/base/browser/dom.js +6 -1
- package/vscode/src/vs/base/browser/mouseEvent.d.ts +2 -0
- package/vscode/src/vs/base/browser/mouseEvent.js +1 -0
- package/vscode/src/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/vscode/src/vs/base/browser/ui/dropdown/dropdown.d.ts +2 -3
- package/vscode/src/vs/base/browser/ui/dropdown/dropdown.js +1 -1
- package/vscode/src/vs/base/browser/ui/hover/hover.d.ts +1 -0
- package/vscode/src/vs/base/browser/ui/hover/hoverDelegate2.js +6 -1
- package/vscode/src/vs/base/browser/ui/list/listPaging.d.ts +2 -1
- package/vscode/src/vs/base/browser/ui/severityIcon/media/severityIcon.css +1 -3
- package/vscode/src/vs/base/browser/ui/toggle/toggle.d.ts +5 -1
- package/vscode/src/vs/base/browser/ui/toggle/toggle.js +17 -4
- package/vscode/src/vs/base/common/arrays.d.ts +1 -0
- package/vscode/src/vs/base/common/arrays.js +5 -2
- package/vscode/src/vs/base/common/async.js +9 -2
- package/vscode/src/vs/base/common/codicons.d.ts +5 -0
- package/vscode/src/vs/base/common/codiconsLibrary.d.ts +5 -0
- package/vscode/src/vs/base/common/codiconsLibrary.js +5 -0
- package/vscode/src/vs/base/common/color.d.ts +1 -0
- package/vscode/src/vs/base/common/color.js +10 -0
- package/vscode/src/vs/base/common/comparers.d.ts +2 -2
- package/vscode/src/vs/base/common/decorators.d.ts +1 -1
- package/vscode/src/vs/base/common/glob.d.ts +3 -0
- package/vscode/src/vs/base/common/glob.js +10 -1
- package/vscode/src/vs/base/common/marshallingIds.d.ts +2 -1
- package/vscode/src/vs/base/common/marshallingIds.js +1 -0
- package/vscode/src/vs/base/common/observableInternal/autorun.d.ts +6 -8
- package/vscode/src/vs/base/common/observableInternal/autorun.js +15 -11
- package/vscode/src/vs/base/common/observableInternal/base.d.ts +0 -10
- package/vscode/src/vs/base/common/observableInternal/changeTracker.d.ts +23 -0
- package/vscode/src/vs/base/common/observableInternal/changeTracker.js +30 -0
- package/vscode/src/vs/base/common/observableInternal/derived.d.ts +18 -13
- package/vscode/src/vs/base/common/observableInternal/derived.js +47 -18
- package/vscode/src/vs/base/common/observableInternal/index.d.ts +6 -5
- package/vscode/src/vs/base/common/observableInternal/index.js +2 -2
- package/vscode/src/vs/base/common/observableInternal/logging/logging.d.ts +2 -2
- package/vscode/src/vs/base/common/observableInternal/promise.d.ts +28 -0
- package/vscode/src/vs/base/common/observableInternal/promise.js +65 -0
- package/vscode/src/vs/base/common/observableInternal/reducer.d.ts +16 -0
- package/vscode/src/vs/base/common/observableInternal/reducer.js +36 -0
- package/vscode/src/vs/base/common/observableInternal/utils.d.ts +2 -0
- package/vscode/src/vs/base/common/observableInternal/utils.js +19 -11
- package/vscode/src/vs/base/common/product.d.ts +5 -0
- package/vscode/src/vs/base/common/sseParser.d.ts +26 -0
- package/vscode/src/vs/base/common/sseParser.js +134 -0
- package/vscode/src/vs/base/common/stopwatch.js +2 -2
- package/vscode/src/vs/base/common/strings.d.ts +1 -0
- package/vscode/src/vs/base/common/strings.js +8 -19
- package/vscode/src/vs/base/common/ternarySearchTree.d.ts +1 -0
- package/vscode/src/vs/base/common/ternarySearchTree.js +55 -13
- package/vscode/src/vs/editor/browser/config/editorConfiguration.d.ts +1 -0
- package/vscode/src/vs/editor/browser/config/editorConfiguration.js +3 -1
- package/vscode/src/vs/editor/browser/controller/editContext/native/nativeEditContext.css +1 -1
- package/vscode/src/vs/editor/browser/controller/editContext/native/nativeEditContext.d.ts +6 -3
- package/vscode/src/vs/editor/browser/controller/editContext/native/nativeEditContext.js +86 -54
- package/vscode/src/vs/editor/browser/controller/editContext/native/screenReaderSupport.d.ts +0 -1
- package/vscode/src/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +12 -8
- package/vscode/src/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.d.ts +0 -1
- package/vscode/src/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +9 -6
- package/vscode/src/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js +3 -3
- package/vscode/src/vs/editor/browser/controller/mouseTarget.js +2 -2
- package/vscode/src/vs/editor/browser/editorBrowser.d.ts +1 -1
- package/vscode/src/vs/editor/browser/gpu/objectCollectionBuffer.d.ts +1 -1
- package/vscode/src/vs/editor/browser/services/abstractCodeEditorService.js +2 -0
- package/vscode/src/vs/editor/browser/services/hoverService/hover.css +8 -0
- package/vscode/src/vs/editor/browser/services/hoverService/hoverWidget.d.ts +1 -0
- package/vscode/src/vs/editor/browser/services/hoverService/hoverWidget.js +6 -1
- package/vscode/src/vs/editor/browser/view/renderingContext.d.ts +1 -0
- package/vscode/src/vs/editor/browser/view/renderingContext.js +3 -0
- package/vscode/src/vs/editor/browser/view/viewLayer.d.ts +3 -1
- package/vscode/src/vs/editor/browser/view/viewLayer.js +13 -6
- package/vscode/src/vs/editor/browser/view/viewOverlays.js +4 -1
- package/vscode/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +4 -5
- package/vscode/src/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +4 -2
- package/vscode/src/vs/editor/browser/viewParts/viewCursors/viewCursor.d.ts +0 -1
- package/vscode/src/vs/editor/browser/viewParts/viewCursors/viewCursor.js +6 -6
- package/vscode/src/vs/editor/browser/viewParts/viewLines/viewLine.js +3 -0
- package/vscode/src/vs/editor/browser/viewParts/viewLines/viewLines.js +2 -2
- package/vscode/src/vs/editor/browser/viewParts/viewLinesGpu/viewLinesGpu.js +1 -1
- package/vscode/src/vs/editor/browser/viewParts/whitespace/whitespace.js +1 -1
- package/vscode/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.d.ts +5 -2
- package/vscode/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +15 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +7 -5
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorOptions.d.ts +1 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +10 -8
- package/vscode/src/vs/editor/browser/widget/diffEditor/utils.js +19 -15
- package/vscode/src/vs/editor/common/codecs/frontMatterCodec/tokens/index.d.ts +5 -0
- package/vscode/src/vs/editor/common/codecs/simpleCodec/tokens/index.d.ts +20 -0
- package/vscode/src/vs/editor/common/config/editorOptions.d.ts +24 -23
- package/vscode/src/vs/editor/common/config/editorOptions.js +3 -4
- package/vscode/src/vs/editor/common/core/columnRange.d.ts +11 -0
- package/vscode/src/vs/editor/common/core/columnRange.js +32 -0
- package/vscode/src/vs/editor/common/core/offsetEdit.d.ts +1 -0
- package/vscode/src/vs/editor/common/core/offsetEdit.js +10 -0
- package/vscode/src/vs/editor/common/core/offsetRange.d.ts +1 -0
- package/vscode/src/vs/editor/common/core/offsetRange.js +3 -0
- package/vscode/src/vs/editor/common/core/positionToOffset.d.ts +15 -3
- package/vscode/src/vs/editor/common/core/positionToOffset.js +45 -11
- package/vscode/src/vs/editor/common/core/rangeSingleLine.d.ts +9 -0
- package/vscode/src/vs/editor/common/core/rangeSingleLine.js +27 -0
- package/vscode/src/vs/editor/common/core/textEdit.d.ts +1 -0
- package/vscode/src/vs/editor/common/core/textEdit.js +41 -0
- package/vscode/src/vs/editor/common/editorCommon.d.ts +1 -0
- package/vscode/src/vs/editor/common/languages/modesRegistry.d.ts +2 -2
- package/vscode/src/vs/editor/common/languages/modesRegistry.js +4 -2
- package/vscode/src/vs/editor/common/languages.d.ts +22 -1
- package/vscode/src/vs/editor/common/languages.js +7 -1
- package/vscode/src/vs/editor/common/model/textModel.d.ts +5 -1
- package/vscode/src/vs/editor/common/model/textModel.js +80 -18
- package/vscode/src/vs/editor/common/model/tokenizationTextModelPart.js +1 -1
- package/vscode/src/vs/editor/common/model.d.ts +2 -1
- package/vscode/src/vs/editor/common/standalone/standaloneEnums.d.ts +5 -0
- package/vscode/src/vs/editor/common/standalone/standaloneEnums.js +7 -1
- package/vscode/src/vs/editor/common/textModelEvents.d.ts +11 -0
- package/vscode/src/vs/editor/common/textModelEvents.js +14 -1
- package/vscode/src/vs/editor/common/tokens/common.d.ts +7 -0
- package/vscode/src/vs/editor/common/tokens/common.js +18 -0
- package/vscode/src/vs/editor/common/tokens/contiguousTokensEditing.d.ts +1 -1
- package/vscode/src/vs/editor/common/tokens/lineTokens.d.ts +1 -0
- package/vscode/src/vs/editor/common/tokens/lineTokens.js +3 -0
- package/vscode/src/vs/editor/common/tokens/sparseMultilineTokens.d.ts +2 -0
- package/vscode/src/vs/editor/common/tokens/sparseMultilineTokens.js +20 -0
- package/vscode/src/vs/editor/common/tokens/sparseTokensStore.d.ts +2 -1
- package/vscode/src/vs/editor/common/tokens/sparseTokensStore.js +9 -4
- package/vscode/src/vs/editor/common/tokens/tokenArray.d.ts +1 -0
- package/vscode/src/vs/editor/common/tokens/tokenArray.js +4 -0
- package/vscode/src/vs/editor/common/tokens/tokenWithTextArray.d.ts +25 -0
- package/vscode/src/vs/editor/common/tokens/tokenWithTextArray.js +73 -0
- package/vscode/src/vs/editor/common/viewLayout/lineHeights.d.ts +35 -0
- package/vscode/src/vs/editor/common/viewLayout/lineHeights.js +339 -0
- package/vscode/src/vs/editor/common/viewLayout/linesLayout.d.ts +8 -6
- package/vscode/src/vs/editor/common/viewLayout/linesLayout.js +42 -49
- package/vscode/src/vs/editor/common/viewLayout/viewLayout.d.ts +6 -3
- package/vscode/src/vs/editor/common/viewLayout/viewLayout.js +16 -5
- package/vscode/src/vs/editor/common/viewModel/viewModelImpl.d.ts +1 -0
- package/vscode/src/vs/editor/common/viewModel/viewModelImpl.js +44 -7
- package/vscode/src/vs/editor/common/viewModel.d.ts +5 -0
- package/vscode/src/vs/editor/common/viewModelEventDispatcher.d.ts +11 -3
- package/vscode/src/vs/editor/common/viewModelEventDispatcher.js +14 -1
- package/vscode/src/vs/editor/contrib/clipboard/browser/clipboard.js +20 -14
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeAction.js +3 -1
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionModel.js +3 -1
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorDetector.d.ts +1 -1
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorDetector.js +4 -3
- package/vscode/src/vs/editor/contrib/find/browser/findController.d.ts +1 -3
- package/vscode/src/vs/editor/contrib/find/browser/findController.js +5 -11
- package/vscode/src/vs/editor/contrib/find/browser/findWidget.d.ts +1 -7
- package/vscode/src/vs/editor/contrib/find/browser/findWidget.js +2 -15
- package/vscode/src/vs/editor/contrib/folding/browser/folding.d.ts +1 -1
- package/vscode/src/vs/editor/contrib/folding/browser/folding.js +24 -23
- package/vscode/src/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
- package/vscode/src/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
- package/vscode/src/vs/editor/contrib/format/browser/formatActions.js +2 -2
- package/vscode/src/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
- package/vscode/src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +5 -5
- package/vscode/src/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverRendered.js +3 -3
- package/vscode/src/vs/editor/contrib/hover/browser/hoverAccessibleViews.js +2 -2
- package/vscode/src/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
- package/vscode/src/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
- package/vscode/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +14 -12
- package/vscode/src/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
- package/vscode/src/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/vscode/src/vs/editor/contrib/indentation/browser/indentation.js +21 -21
- package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/commands.d.ts +0 -4
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +29 -41
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +11 -11
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.d.ts +1 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +11 -6
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +6 -6
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js +1 -2
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsAccessibleView.d.ts +4 -4
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsAccessibleView.js +1 -2
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/changeRecorder.d.ts +10 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/changeRecorder.js +31 -2
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/ghostText.d.ts +1 -1
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.d.ts +16 -16
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +156 -202
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.d.ts +21 -49
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +135 -431
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.d.ts +3 -3
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.d.ts +98 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +487 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.d.ts +34 -32
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +141 -132
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/suggestWidgetAdapter.d.ts +1 -1
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/suggestWidgetAdapter.js +2 -2
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/structuredLogger.d.ts +26 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/utils.d.ts +2 -7
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/utils.js +21 -20
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +19 -7
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineCompletionsView.js +1 -1
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +17 -9
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.d.ts +5 -13
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +139 -188
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.d.ts +8 -6
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js +9 -3
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.d.ts +4 -4
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +6 -6
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsNewUsers.d.ts +23 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsNewUsers.js +157 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.d.ts +2 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +37 -20
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.d.ts +3 -2
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +3 -4
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.d.ts +6 -1
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.js +28 -5
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.d.ts +21 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js +215 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js +0 -1
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js +0 -1
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js +2 -2
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.d.ts +1 -3
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js +3 -4
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +22 -21
- package/vscode/src/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
- package/vscode/src/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
- package/vscode/src/vs/editor/contrib/linesOperations/browser/linesOperations.js +30 -30
- package/vscode/src/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
- package/vscode/src/vs/editor/contrib/links/browser/links.js +10 -10
- package/vscode/src/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/vscode/src/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
- package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
- package/vscode/src/vs/editor/contrib/peekView/browser/peekView.js +17 -17
- package/vscode/src/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
- package/vscode/src/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
- package/vscode/src/vs/editor/contrib/rename/browser/rename.js +23 -49
- package/vscode/src/vs/editor/contrib/rename/browser/renameWidget.js +6 -6
- package/vscode/src/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
- package/vscode/src/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
- package/vscode/src/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +8 -0
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.js +1 -1
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.js +2 -2
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.d.ts +1 -0
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +24 -14
- package/vscode/src/vs/editor/contrib/suggest/browser/suggest.js +8 -8
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestController.js +10 -10
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidget.js +19 -18
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
- package/vscode/src/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
- package/vscode/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
- package/vscode/src/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
- package/vscode/src/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
- package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +5 -10
- package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
- package/vscode/src/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
- package/vscode/src/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/vscode/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
- package/vscode/src/vs/editor/contrib/wordOperations/browser/wordOperations.js +1 -1
- package/vscode/src/vs/editor/contrib/zoneWidget/browser/zoneWidget.js +1 -1
- package/vscode/src/vs/editor/standalone/browser/standaloneServices.d.ts +2 -2
- package/vscode/src/vs/editor/standalone/browser/standaloneServices.js +2 -2
- package/vscode/src/vs/platform/accessibility/browser/accessibleView.d.ts +1 -1
- package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.d.ts +3 -0
- package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +23 -14
- package/vscode/src/vs/platform/actionWidget/browser/actionList.d.ts +2 -0
- package/vscode/src/vs/platform/actionWidget/browser/actionList.js +17 -3
- package/vscode/src/vs/platform/actionWidget/browser/actionWidget.css +6 -1
- package/vscode/src/vs/platform/actionWidget/browser/actionWidget.d.ts +2 -1
- package/vscode/src/vs/platform/actionWidget/browser/actionWidget.service.d.ts +2 -1
- package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
- package/vscode/src/vs/platform/actions/browser/toolbar.js +2 -2
- package/vscode/src/vs/platform/actions/common/actions.d.ts +3 -1
- package/vscode/src/vs/platform/actions/common/actions.js +2 -0
- package/vscode/src/vs/platform/actions/common/menuResetAction.js +1 -1
- package/vscode/src/vs/platform/actions/common/menuService.js +2 -2
- package/vscode/src/vs/platform/clipboard/browser/clipboardService.d.ts +1 -0
- package/vscode/src/vs/platform/clipboard/browser/clipboardService.js +3 -0
- package/vscode/src/vs/platform/clipboard/common/clipboardService.service.d.ts +1 -0
- package/vscode/src/vs/platform/configuration/common/configurationRegistry.js +15 -13
- package/vscode/src/vs/platform/configuration/common/configurations.js +1 -1
- package/vscode/src/vs/platform/contextkey/browser/contextKeyService.js +1 -1
- package/vscode/src/vs/platform/contextkey/common/contextkey.js +11 -11
- package/vscode/src/vs/platform/contextkey/common/contextkeys.js +9 -9
- package/vscode/src/vs/platform/contextkey/common/scanner.js +5 -5
- package/vscode/src/vs/platform/dialogs/common/dialogs.service.d.ts +1 -1
- package/vscode/src/vs/platform/dnd/browser/dnd.d.ts +5 -0
- package/vscode/src/vs/platform/dnd/browser/dnd.js +6 -2
- package/vscode/src/vs/platform/editor/common/editor.d.ts +1 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.d.ts +8 -2
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +94 -4
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.service.d.ts +3 -2
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementUtil.d.ts +3 -2
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementUtil.js +10 -7
- package/vscode/src/vs/platform/extensionManagement/common/extensionNls.js +1 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionsProfileScannerService.js +1 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionsScannerService.d.ts +0 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionsScannerService.js +10 -11
- package/vscode/src/vs/platform/extensions/common/extensionValidator.js +20 -20
- package/vscode/src/vs/platform/extensions/common/extensions.d.ts +1 -0
- package/vscode/src/vs/platform/extensions/common/extensionsApiProposals.d.ts +7 -6
- package/vscode/src/vs/platform/extensions/common/extensionsApiProposals.js +9 -8
- package/vscode/src/vs/platform/files/browser/htmlFileSystemProvider.js +2 -2
- package/vscode/src/vs/platform/files/common/files.js +6 -6
- package/vscode/src/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
- package/vscode/src/vs/platform/jsonschemas/common/jsonContributionRegistry.js +5 -4
- package/vscode/src/vs/platform/keybinding/common/abstractKeybindingService.js +5 -5
- package/vscode/src/vs/platform/label/common/label.service.d.ts +1 -1
- package/vscode/src/vs/platform/languagePacks/common/languagePacks.service.d.ts +1 -1
- package/vscode/src/vs/platform/list/browser/listService.d.ts +1 -1
- package/vscode/src/vs/platform/list/browser/listService.js +27 -27
- package/vscode/src/vs/platform/log/common/log.js +6 -6
- package/vscode/src/vs/platform/markers/common/markerService.d.ts +2 -7
- package/vscode/src/vs/platform/markers/common/markerService.js +5 -5
- package/vscode/src/vs/platform/markers/common/markers.d.ts +7 -0
- package/vscode/src/vs/platform/markers/common/markers.js +6 -6
- package/vscode/src/vs/platform/markers/common/markers.service.d.ts +2 -7
- package/vscode/src/vs/platform/native/common/native.d.ts +168 -0
- package/vscode/src/vs/platform/notification/common/notification.d.ts +6 -2
- package/vscode/src/vs/platform/notification/common/notification.js +3 -2
- package/vscode/src/vs/platform/notification/common/notification.service.d.ts +2 -3
- package/vscode/src/vs/platform/product/common/product.js +93 -48
- package/vscode/src/vs/platform/quickinput/browser/media/quickInput.css +4 -19
- package/vscode/src/vs/platform/quickinput/browser/quickInput.d.ts +6 -3
- package/vscode/src/vs/platform/quickinput/browser/quickInput.js +33 -10
- package/vscode/src/vs/platform/quickinput/browser/quickInputActions.js +3 -3
- package/vscode/src/vs/platform/quickinput/browser/quickInputBox.d.ts +2 -0
- package/vscode/src/vs/platform/quickinput/browser/quickInputBox.js +6 -0
- package/vscode/src/vs/platform/quickinput/browser/quickInputController.js +25 -18
- package/vscode/src/vs/platform/quickinput/browser/quickInputTree.d.ts +5 -5
- package/vscode/src/vs/platform/quickinput/browser/quickInputTree.js +58 -43
- package/vscode/src/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
- package/vscode/src/vs/platform/quickinput/common/quickInput.d.ts +1 -1
- package/vscode/src/vs/platform/registry/common/platform.js +9 -1
- package/vscode/src/vs/platform/request/common/request.d.ts +1 -1
- package/vscode/src/vs/platform/request/common/request.js +18 -18
- package/vscode/src/vs/platform/request/common/request.service.d.ts +1 -1
- package/vscode/src/vs/platform/telemetry/common/telemetryUtils.js +1 -1
- package/vscode/src/vs/platform/terminal/common/terminal.d.ts +14 -1
- package/vscode/src/vs/platform/terminal/common/terminal.js +14 -1
- package/vscode/src/vs/platform/theme/browser/defaultStyles.d.ts +1 -2
- package/vscode/src/vs/platform/theme/browser/defaultStyles.js +4 -2
- package/vscode/src/vs/platform/theme/common/colorUtils.d.ts +7 -1
- package/vscode/src/vs/platform/theme/common/colorUtils.js +12 -4
- package/vscode/src/vs/platform/theme/common/colors/baseColors.js +17 -17
- package/vscode/src/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/vscode/src/vs/platform/theme/common/colors/editorColors.js +94 -94
- package/vscode/src/vs/platform/theme/common/colors/inputColors.d.ts +2 -0
- package/vscode/src/vs/platform/theme/common/colors/inputColors.js +49 -47
- package/vscode/src/vs/platform/theme/common/colors/listColors.js +36 -36
- package/vscode/src/vs/platform/theme/common/colors/menuColors.js +7 -7
- package/vscode/src/vs/platform/theme/common/colors/minimapColors.js +11 -11
- package/vscode/src/vs/platform/theme/common/colors/miscColors.js +15 -15
- package/vscode/src/vs/platform/theme/common/colors/quickpickColors.js +9 -9
- package/vscode/src/vs/platform/theme/common/colors/searchColors.js +3 -3
- package/vscode/src/vs/platform/theme/common/iconRegistry.js +10 -8
- package/vscode/src/vs/platform/theme/common/themeService.d.ts +0 -8
- package/vscode/src/vs/platform/theme/common/themeService.js +4 -3
- package/vscode/src/vs/platform/undoRedo/common/undoRedoService.js +20 -20
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.js +1 -1
- package/vscode/src/vs/platform/userDataSync/common/userDataSync.d.ts +1 -1
- package/vscode/src/vs/platform/userDataSync/common/userDataSync.js +5 -5
- package/vscode/src/vs/platform/userDataSync/common/userDataSync.service.d.ts +2 -2
- package/vscode/src/vs/platform/window/common/window.d.ts +4 -0
- package/vscode/src/vs/platform/window/common/window.js +2 -1
- package/vscode/src/vs/platform/workspace/common/workspace.js +1 -1
- package/vscode/src/vs/platform/workspaces/common/workspaces.service.d.ts +2 -2
- package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +27 -20
- package/vscode/src/vs/workbench/api/common/extHost.protocol.d.ts +54 -19
- package/vscode/src/vs/workbench/api/common/extHost.protocol.js +2 -0
- package/vscode/src/vs/workbench/api/common/extHostAiSettingsSearch.d.ts +14 -0
- package/vscode/src/vs/workbench/api/common/extHostAiSettingsSearch.js +38 -0
- package/vscode/src/vs/workbench/api/common/extHostApiCommands.js +1 -0
- package/vscode/src/vs/workbench/api/common/extHostChatAgents2.d.ts +2 -1
- package/vscode/src/vs/workbench/api/common/extHostChatAgents2.js +30 -17
- package/vscode/src/vs/workbench/api/common/extHostCodeMapper.js +2 -0
- package/vscode/src/vs/workbench/api/common/extHostCommands.d.ts +0 -1
- package/vscode/src/vs/workbench/api/common/extHostCommands.js +4 -2
- package/vscode/src/vs/workbench/api/common/extHostCustomEditors.d.ts +1 -1
- package/vscode/src/vs/workbench/api/common/extHostDiagnostics.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostExtensionService.d.ts +2 -0
- package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +15 -4
- package/vscode/src/vs/workbench/api/common/extHostLabelService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.d.ts +4 -0
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +31 -6
- package/vscode/src/vs/workbench/api/common/extHostLanguageModelTools.d.ts +2 -3
- package/vscode/src/vs/workbench/api/common/extHostLanguageModelTools.js +60 -14
- package/vscode/src/vs/workbench/api/common/extHostLanguageModels.d.ts +1 -1
- package/vscode/src/vs/workbench/api/common/extHostLanguageModels.js +15 -9
- package/vscode/src/vs/workbench/api/common/extHostLogService.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostMcp.d.ts +4 -3
- package/vscode/src/vs/workbench/api/common/extHostMcp.js +279 -82
- package/vscode/src/vs/workbench/api/common/extHostNotebook.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostNotebookKernels.js +3 -0
- package/vscode/src/vs/workbench/api/common/extHostQuickDiff.d.ts +2 -1
- package/vscode/src/vs/workbench/api/common/extHostQuickDiff.js +4 -2
- package/vscode/src/vs/workbench/api/common/extHostRequireInterceptor.d.ts +1 -1
- package/vscode/src/vs/workbench/api/common/extHostSCM.d.ts +1 -0
- package/vscode/src/vs/workbench/api/common/extHostSCM.js +21 -0
- package/vscode/src/vs/workbench/api/common/extHostSearch.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostStatusBar.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostTelemetry.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostTunnelService.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.d.ts +27 -9
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +201 -29
- package/vscode/src/vs/workbench/api/common/extHostTypes.d.ts +67 -27
- package/vscode/src/vs/workbench/api/common/extHostTypes.js +79 -28
- package/vscode/src/vs/workbench/api/common/extHostWebviewPanels.d.ts +1 -1
- package/vscode/src/vs/workbench/api/common/extHostWorkspace.d.ts +7 -4
- package/vscode/src/vs/workbench/api/common/extHostWorkspace.js +34 -9
- package/vscode/src/vs/workbench/api/common/jsonValidationExtensionPoint.js +12 -12
- package/vscode/src/vs/workbench/api/worker/extHostExtensionService.d.ts +1 -0
- package/vscode/src/vs/workbench/api/worker/extHostExtensionService.js +3 -0
- package/vscode/src/vs/workbench/browser/actions/developerActions.js +33 -33
- package/vscode/src/vs/workbench/browser/actions/textInputActions.js +6 -6
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbs.service.d.ts +1 -1
- package/vscode/src/vs/workbench/common/configuration.js +10 -16
- package/vscode/src/vs/workbench/common/contextkeys.d.ts +3 -0
- package/vscode/src/vs/workbench/common/contextkeys.js +73 -71
- package/vscode/src/vs/workbench/common/editor/editorInput.d.ts +1 -1
- package/vscode/src/vs/workbench/common/editor.d.ts +13 -9
- package/vscode/src/vs/workbench/common/editor.js +4 -4
- package/vscode/src/vs/workbench/common/theme.js +160 -160
- package/vscode/src/vs/workbench/common/views.js +4 -4
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +164 -147
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewActions.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.service.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatContentParts.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownAnchorService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorContextKeys.js +15 -14
- package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.d.ts +245 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.js +435 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.d.ts +6 -9
- package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +51 -49
- package/vscode/src/vs/workbench/contrib/chat/common/chatEditingService.d.ts +19 -26
- package/vscode/src/vs/workbench/contrib/chat/common/chatEditingService.js +16 -23
- package/vscode/src/vs/workbench/contrib/chat/common/chatEditingService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatEntitlementService.service.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.d.ts +585 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +1179 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatParserTypes.d.ts +116 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatParserTypes.js +211 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService.d.ts +19 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatService.service.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/chatTransferService.service.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatVariables.d.ts +1 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatVariables.service.d.ts +2 -7
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/constants.d.ts +2 -3
- package/vscode/src/vs/workbench/contrib/chat/common/constants.js +12 -4
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelToolsService.d.ts +33 -5
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelToolsService.js +14 -3
- package/vscode/src/vs/workbench/contrib/chat/common/languageModels.d.ts +18 -3
- package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/modelPicker/modelPickerWidget.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/common/modelPicker/modelPickerWidget.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/types.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/index.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/types.d.ts +14 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/types.d.ts +28 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/types.service.d.ts +10 -4
- package/vscode/src/vs/workbench/contrib/chat/common/tools/editFileTool.d.ts +8 -25
- package/vscode/src/vs/workbench/contrib/chat/common/tools/editFileTool.js +11 -97
- package/vscode/src/vs/workbench/contrib/chat/common/tools/tools.d.ts +0 -3
- package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/dictation/editorDictation.js +4 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorAccessibilityHelp.js +5 -5
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +3 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.js +3 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.js +4 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.js +4 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +5 -5
- package/vscode/src/vs/workbench/contrib/comments/browser/commentService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsAccessibility.js +12 -12
- package/vscode/src/vs/workbench/contrib/comments/common/commentContextKeys.js +11 -11
- package/vscode/src/vs/workbench/contrib/debug/common/abstractDebugAdapter.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debug.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debug.js +64 -64
- package/vscode/src/vs/workbench/contrib/extensions/common/extensions.d.ts +171 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/extensions.js +85 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/extensions.service.d.ts +2 -3
- package/vscode/src/vs/workbench/contrib/extensions/common/searchExtensionsTool.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/searchExtensionsTool.js +127 -0
- package/vscode/src/vs/workbench/contrib/files/browser/fileConstants.js +6 -6
- package/vscode/src/vs/workbench/contrib/files/browser/files.service.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/folding/browser/folding.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/format/browser/formatActionsMultiple.js +20 -20
- package/vscode/src/vs/workbench/contrib/format/browser/formatActionsNone.js +4 -4
- package/vscode/src/vs/workbench/contrib/format/browser/formatModified.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty.js +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.service.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/list/browser/listResizeColumnAction.js +2 -2
- package/vscode/src/vs/workbench/contrib/list/browser/tableColumnResizeQuickPick.js +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpTypes.d.ts +19 -8
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpTypes.js +12 -10
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.d.ts +8 -4
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +16 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionStateService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookService.service.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/scm/common/quickDiff.service.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/scm/common/quickDiffService.d.ts +11 -3
- package/vscode/src/vs/workbench/contrib/scm/common/quickDiffService.js +77 -16
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetCompletionProvider.js +3 -3
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsFile.js +3 -3
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsService.js +9 -9
- package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +29 -29
- package/vscode/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +5 -5
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/testing/common/constants.js +11 -11
- package/vscode/src/vs/workbench/contrib/testing/common/testTypes.js +3 -3
- package/vscode/src/vs/workbench/contrib/webview/browser/webview.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService.service.d.ts +2 -2
- package/vscode/src/vs/workbench/services/accounts/common/defaultAccount.js +1 -1
- package/vscode/src/vs/workbench/services/aiRelatedInformation/common/aiRelatedInformation.service.d.ts +1 -1
- package/vscode/src/vs/workbench/services/aiSettingsSearch/common/aiSettingsSearch.d.ts +17 -0
- package/vscode/src/vs/workbench/services/aiSettingsSearch/common/aiSettingsSearch.js +10 -0
- package/vscode/src/vs/workbench/services/aiSettingsSearch/common/aiSettingsSearch.service.d.ts +13 -0
- package/vscode/src/vs/workbench/services/aiSettingsSearch/common/aiSettingsSearch.service.js +6 -0
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverExpression.d.ts +2 -0
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverExpression.js +61 -12
- package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.d.ts +3 -2
- package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +25 -29
- package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.d.ts +4 -1
- package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.service.d.ts +1 -0
- package/vscode/src/vs/workbench/services/editor/common/editorResolverService.js +1 -1
- package/vscode/src/vs/workbench/services/editor/common/editorService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/editor/common/editorService.service.d.ts +2 -2
- package/vscode/src/vs/workbench/services/extensionRecommendations/common/extensionRecommendations.service.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.service.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.js +3 -2
- package/vscode/src/vs/workbench/services/extensions/common/extensionsRegistry.js +84 -84
- package/vscode/src/vs/workbench/services/host/browser/host.service.d.ts +4 -1
- package/vscode/src/vs/workbench/services/language/common/languageService.js +28 -28
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.service.d.ts +2 -4
- package/vscode/src/vs/workbench/services/localization/common/locale.service.d.ts +1 -1
- package/vscode/src/vs/workbench/services/log/common/logConstants.js +1 -1
- package/vscode/src/vs/workbench/services/notebook/common/notebookDocumentService.d.ts +1 -0
- package/vscode/src/vs/workbench/services/notebook/common/notebookDocumentService.js +2 -0
- package/vscode/src/vs/workbench/services/outline/browser/outline.service.d.ts +1 -1
- package/vscode/src/vs/workbench/services/output/common/output.js +6 -4
- package/vscode/src/vs/workbench/services/preferences/common/preferences.service.d.ts +1 -1
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.js +8 -8
- package/vscode/src/vs/workbench/services/remote/common/tunnelModel.js +6 -6
- package/vscode/src/vs/workbench/services/search/common/queryBuilder.js +1 -1
- package/vscode/src/vs/workbench/services/search/common/search.d.ts +2 -1
- package/vscode/src/vs/workbench/services/search/common/searchExtTypes.d.ts +5 -0
- package/vscode/src/vs/workbench/services/search/common/searchExtTypes.js +6 -1
- package/vscode/src/vs/workbench/services/search/common/textSearchManager.d.ts +2 -2
- package/vscode/src/vs/workbench/services/search/common/textSearchManager.js +31 -23
- package/vscode/src/vs/workbench/services/textfile/common/encoding.d.ts +64 -0
- package/vscode/src/vs/workbench/services/textfile/common/encoding.js +560 -0
- package/vscode/src/vs/workbench/services/textfile/common/textfiles.d.ts +165 -0
- package/vscode/src/vs/workbench/services/textfile/common/textfiles.js +74 -0
- package/vscode/src/vs/workbench/services/textfile/common/textfiles.service.d.ts +12 -2
- package/vscode/src/vs/workbench/services/themes/common/colorExtensionPoint.js +22 -22
- package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +13 -13
- package/vscode/src/vs/workbench/services/userDataSync/common/userDataSync.js +12 -12
- package/vscode/src/vs/workbench/services/workspaces/common/workspaceEditing.service.d.ts +1 -1
- package/vscode-dts/vscode.d.ts +204 -9
- package/vscode-dts/vscode.proposed.aiSettingsSearch.d.ts +30 -0
- package/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts +18 -16
- package/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts +84 -5
- package/vscode-dts/vscode.proposed.chatProvider.d.ts +18 -16
- package/vscode-dts/vscode.proposed.chatStatusItem.d.ts +1 -1
- package/vscode-dts/vscode.proposed.commentThreadApplicability.d.ts +1 -1
- package/vscode-dts/vscode.proposed.contribDebugCreateConfiguration.d.ts +1 -1
- package/vscode-dts/vscode.proposed.d.ts +2 -2
- package/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts +2 -2
- package/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts +46 -8
- package/vscode-dts/vscode.proposed.languageModelDataPart.d.ts +106 -16
- package/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts +2 -0
- package/vscode-dts/vscode.proposed.mcpConfigurationProvider.d.ts +115 -21
- package/vscode-dts/vscode.proposed.quickDiffProvider.d.ts +7 -3
- package/vscode-dts/vscode.proposed.textSearchProvider2.d.ts +23 -1
- package/vscode-dts/vscode.proposed.toolProgress.d.ts +25 -0
- package/vscode-dts/vscode.proposed.tunnelFactory.d.ts +1 -1
- package/workbench.d.ts +1 -1
- package/vscode-dts/vscode.proposed.languageModelToolsForAgent.d.ts +0 -8
- package/vscode-dts/vscode.proposed.textDocumentEncoding.d.ts +0 -170
package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js
CHANGED
|
@@ -4,51 +4,73 @@ import { compareUndefinedSmallest, numberComparator } from '../../../../../base/
|
|
|
4
4
|
import { findLastMax } from '../../../../../base/common/arraysFind.js';
|
|
5
5
|
import { CancellationTokenSource } from '../../../../../base/common/cancellation.js';
|
|
6
6
|
import { equalsIfDefined, itemEquals } from '../../../../../base/common/equals.js';
|
|
7
|
-
import { BugIndicatingError } from '../../../../../base/common/errors.js';
|
|
8
|
-
import { matchesSubString } from '../../../../../base/common/filters.js';
|
|
9
7
|
import { Disposable, MutableDisposable } from '../../../../../base/common/lifecycle.js';
|
|
10
8
|
import '../../../../../base/common/observableInternal/index.js';
|
|
11
|
-
import {
|
|
9
|
+
import { observableReducerSettable } from '../../../../../base/common/observableInternal/reducer.js';
|
|
10
|
+
import { isDefined } from '../../../../../base/common/types.js';
|
|
12
11
|
import { IConfigurationService } from '../../../../../platform/configuration/common/configuration.service.js';
|
|
13
12
|
import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';
|
|
14
13
|
import { ILogService } from '../../../../../platform/log/common/log.service.js';
|
|
15
14
|
import { observableConfigValue } from '../../../../../platform/observable/common/platformObservableUtils.js';
|
|
16
|
-
import { OffsetEdit
|
|
17
|
-
import {
|
|
18
|
-
import { Range } from '../../../../common/core/range.js';
|
|
19
|
-
import { SingleTextEdit, StringText } from '../../../../common/core/textEdit.js';
|
|
20
|
-
import { TextLength } from '../../../../common/core/textLength.js';
|
|
21
|
-
import { linesDiffComputers } from '../../../../common/diff/linesDiffComputers.js';
|
|
22
|
-
import { InlineCompletionTriggerKind } from '../../../../common/languages.js';
|
|
15
|
+
import { OffsetEdit } from '../../../../common/core/offsetEdit.js';
|
|
16
|
+
import { InlineCompletionTriggerKind, InlineCompletionEndOfLifeReasonKind } from '../../../../common/languages.js';
|
|
23
17
|
import { ILanguageConfigurationService } from '../../../../common/languages/languageConfigurationRegistry.service.js';
|
|
24
|
-
import { EndOfLinePreference } from '../../../../common/model.js';
|
|
25
18
|
import { OffsetEdits } from '../../../../common/model/textModelOffsetEdit.js';
|
|
26
|
-
import { ILanguageFeaturesService } from '../../../../common/services/languageFeatures.service.js';
|
|
27
|
-
import { provideInlineCompletions } from './provideInlineCompletions.js';
|
|
28
|
-
import { singleTextRemoveCommonPrefix } from './singleTextEditHelpers.js';
|
|
29
19
|
import { StructuredLogger, formatRecordableLogEntry } from '../structuredLogger.js';
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
20
|
+
import { wait } from '../utils.js';
|
|
21
|
+
import { InlineSuggestionItem } from './inlineSuggestionItem.js';
|
|
22
|
+
import { provideInlineCompletions } from './provideInlineCompletions.js';
|
|
23
|
+
import { recordChanges } from '../../../../../base/common/observableInternal/changeTracker.js';
|
|
24
|
+
import { derived } from '../../../../../base/common/observableInternal/derived.js';
|
|
25
|
+
import { observableValue, transaction } from '../../../../../base/common/observableInternal/base.js';
|
|
32
26
|
|
|
33
27
|
var InlineCompletionsSource_1;
|
|
34
28
|
let InlineCompletionsSource = class InlineCompletionsSource extends Disposable {
|
|
35
29
|
static { InlineCompletionsSource_1 = this; }
|
|
36
30
|
static { this._requestId = 0; }
|
|
37
|
-
constructor(_textModel, _versionId, _debounceValue,
|
|
31
|
+
constructor(_textModel, _versionId, _debounceValue, _languageConfigurationService, _logService, _configurationService, _instantiationService) {
|
|
38
32
|
super();
|
|
39
33
|
this._textModel = _textModel;
|
|
40
34
|
this._versionId = _versionId;
|
|
41
35
|
this._debounceValue = _debounceValue;
|
|
42
|
-
this._languageFeaturesService = _languageFeaturesService;
|
|
43
36
|
this._languageConfigurationService = _languageConfigurationService;
|
|
44
37
|
this._logService = _logService;
|
|
45
38
|
this._configurationService = _configurationService;
|
|
46
39
|
this._instantiationService = _instantiationService;
|
|
47
40
|
this._updateOperation = this._register(( new MutableDisposable()));
|
|
48
|
-
this.inlineCompletions = this._register(disposableObservableValue('inlineCompletions', undefined));
|
|
49
|
-
this.suggestWidgetInlineCompletions = this._register(disposableObservableValue('suggestWidgetInlineCompletions', undefined));
|
|
50
41
|
this._loggingEnabled = observableConfigValue('editor.inlineSuggest.logFetch', false, this._configurationService).recomputeInitiallyAndOnChange(this._store);
|
|
51
42
|
this._structuredFetchLogger = this._register(this._instantiationService.createInstance(StructuredLogger.cast(), 'editor.inlineSuggest.logFetch.commandId'));
|
|
43
|
+
this._state = observableReducerSettable(this, {
|
|
44
|
+
initial: () => ({
|
|
45
|
+
inlineCompletions: InlineCompletionsState.createEmpty(),
|
|
46
|
+
suggestWidgetInlineCompletions: InlineCompletionsState.createEmpty(),
|
|
47
|
+
}),
|
|
48
|
+
disposeFinal: (values) => {
|
|
49
|
+
values.inlineCompletions.dispose();
|
|
50
|
+
values.suggestWidgetInlineCompletions.dispose();
|
|
51
|
+
},
|
|
52
|
+
changeTracker: recordChanges({ versionId: this._versionId }),
|
|
53
|
+
update: (reader, previousValue, changes) => {
|
|
54
|
+
const edit = OffsetEdit.join(( changes.changes.map(
|
|
55
|
+
c => c.change ? OffsetEdits.fromContentChanges(c.change.changes) : OffsetEdit.empty
|
|
56
|
+
)).filter(isDefined));
|
|
57
|
+
if (edit.isEmpty) {
|
|
58
|
+
return previousValue;
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
return {
|
|
62
|
+
inlineCompletions: previousValue.inlineCompletions.createStateWithAppliedEdit(edit, this._textModel),
|
|
63
|
+
suggestWidgetInlineCompletions: previousValue.suggestWidgetInlineCompletions.createStateWithAppliedEdit(edit, this._textModel),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
finally {
|
|
67
|
+
previousValue.inlineCompletions.dispose();
|
|
68
|
+
previousValue.suggestWidgetInlineCompletions.dispose();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
this.inlineCompletions = ( this._state.map(this, v => v.inlineCompletions));
|
|
73
|
+
this.suggestWidgetInlineCompletions = ( this._state.map(this, v => v.suggestWidgetInlineCompletions));
|
|
52
74
|
this.clearOperationOnTextModelChange = derived(this, reader => {
|
|
53
75
|
this._versionId.read(reader);
|
|
54
76
|
this._updateOperation.clear();
|
|
@@ -64,13 +86,13 @@ let InlineCompletionsSource = class InlineCompletionsSource extends Disposable {
|
|
|
64
86
|
}
|
|
65
87
|
this._structuredFetchLogger.log(entry);
|
|
66
88
|
}
|
|
67
|
-
fetch(position, context, activeInlineCompletion, withDebounce, userJumpedToActiveCompletion) {
|
|
89
|
+
fetch(providers, position, context, activeInlineCompletion, withDebounce, userJumpedToActiveCompletion, providerhasChangedCompletion) {
|
|
68
90
|
const request = ( new UpdateRequest(position, context, this._textModel.getVersionId()));
|
|
69
|
-
const target = context.selectedSuggestionInfo ? this.suggestWidgetInlineCompletions : this.inlineCompletions;
|
|
70
|
-
if (this._updateOperation.value?.request.satisfies(request)) {
|
|
91
|
+
const target = context.selectedSuggestionInfo ? this.suggestWidgetInlineCompletions.get() : this.inlineCompletions.get();
|
|
92
|
+
if (!providerhasChangedCompletion && this._updateOperation.value?.request.satisfies(request)) {
|
|
71
93
|
return this._updateOperation.value.promise;
|
|
72
94
|
}
|
|
73
|
-
else if (target
|
|
95
|
+
else if (target?.request?.satisfies(request)) {
|
|
74
96
|
return Promise.resolve(true);
|
|
75
97
|
}
|
|
76
98
|
const updateOngoing = !!this._updateOperation.value;
|
|
@@ -80,7 +102,7 @@ let InlineCompletionsSource = class InlineCompletionsSource extends Disposable {
|
|
|
80
102
|
this._loadingCount.set(this._loadingCount.get() + 1, undefined);
|
|
81
103
|
try {
|
|
82
104
|
const recommendedDebounceValue = this._debounceValue.get(this._textModel);
|
|
83
|
-
const debounceValue = findLastMax((
|
|
105
|
+
const debounceValue = findLastMax(( providers.map(p => p.debounceDelayMs)), compareUndefinedSmallest(numberComparator)) ?? recommendedDebounceValue;
|
|
84
106
|
const shouldDebounce = updateOngoing || (withDebounce && context.triggerKind === InlineCompletionTriggerKind.Automatic);
|
|
85
107
|
if (shouldDebounce) {
|
|
86
108
|
await wait(debounceValue, source.token);
|
|
@@ -93,10 +115,10 @@ let InlineCompletionsSource = class InlineCompletionsSource extends Disposable {
|
|
|
93
115
|
this._log({ sourceId: 'InlineCompletions.fetch', kind: 'start', requestId, modelUri: ( this._textModel.uri.toString()), modelVersion: this._textModel.getVersionId(), context: { triggerKind: context.triggerKind }, time: Date.now() });
|
|
94
116
|
}
|
|
95
117
|
const startTime = ( new Date());
|
|
96
|
-
let
|
|
118
|
+
let providerResult = undefined;
|
|
97
119
|
let error = undefined;
|
|
98
120
|
try {
|
|
99
|
-
|
|
121
|
+
providerResult = await provideInlineCompletions(providers, position, this._textModel, context, source.token, this._languageConfigurationService);
|
|
100
122
|
}
|
|
101
123
|
catch (e) {
|
|
102
124
|
error = e;
|
|
@@ -107,7 +129,7 @@ let InlineCompletionsSource = class InlineCompletionsSource extends Disposable {
|
|
|
107
129
|
if (source.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== request.versionId) {
|
|
108
130
|
error = 'canceled';
|
|
109
131
|
}
|
|
110
|
-
const result =
|
|
132
|
+
const result = providerResult?.completions.map(c => ({
|
|
111
133
|
range: ( c.range.toString()),
|
|
112
134
|
text: c.insertText,
|
|
113
135
|
isInlineEdit: !!c.isInlineEdit,
|
|
@@ -117,27 +139,29 @@ let InlineCompletionsSource = class InlineCompletionsSource extends Disposable {
|
|
|
117
139
|
}
|
|
118
140
|
}
|
|
119
141
|
if (source.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== request.versionId || userJumpedToActiveCompletion.get() ) {
|
|
120
|
-
|
|
121
|
-
return false;
|
|
122
|
-
}
|
|
123
|
-
if (activeInlineCompletion && activeInlineCompletion.isInlineEdit && activeInlineCompletion.updatedEditModelVersion === this._textModel.getVersionId() && ((activeInlineCompletion.canBeReused(this._textModel, position)
|
|
124
|
-
|| ( updatedCompletions.has(activeInlineCompletion.inlineCompletion)) || updatedCompletions.isEmpty()) )) {
|
|
125
|
-
activeInlineCompletion.reuse();
|
|
126
|
-
updatedCompletions.dispose();
|
|
142
|
+
providerResult.dispose();
|
|
127
143
|
return false;
|
|
128
144
|
}
|
|
129
145
|
const endTime = ( new Date());
|
|
130
146
|
this._debounceValue.update(this._textModel, endTime.getTime() - startTime.getTime());
|
|
131
|
-
const completions = ( new UpToDateInlineCompletions(updatedCompletions, request, this._textModel, this._versionId));
|
|
132
|
-
if (activeInlineCompletion && !activeInlineCompletion.isInlineEdit && activeInlineCompletion.canBeReused(this._textModel, position)) {
|
|
133
|
-
const asInlineCompletion = activeInlineCompletion.toInlineCompletion(undefined);
|
|
134
|
-
if (!( updatedCompletions.has(asInlineCompletion))) {
|
|
135
|
-
completions.prepend(activeInlineCompletion.inlineCompletion, asInlineCompletion.range, true);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
147
|
this._updateOperation.clear();
|
|
139
148
|
transaction(tx => {
|
|
140
|
-
|
|
149
|
+
const v = this._state.get();
|
|
150
|
+
if (context.selectedSuggestionInfo) {
|
|
151
|
+
this._state.set({
|
|
152
|
+
inlineCompletions: InlineCompletionsState.createEmpty(),
|
|
153
|
+
suggestWidgetInlineCompletions: v.suggestWidgetInlineCompletions.createStateWithAppliedResults(providerResult, request, this._textModel, activeInlineCompletion),
|
|
154
|
+
}, tx);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
this._state.set({
|
|
158
|
+
inlineCompletions: v.inlineCompletions.createStateWithAppliedResults(providerResult, request, this._textModel, activeInlineCompletion),
|
|
159
|
+
suggestWidgetInlineCompletions: InlineCompletionsState.createEmpty(),
|
|
160
|
+
}, tx);
|
|
161
|
+
}
|
|
162
|
+
providerResult.dispose();
|
|
163
|
+
v.inlineCompletions.dispose();
|
|
164
|
+
v.suggestWidgetInlineCompletions.dispose();
|
|
141
165
|
});
|
|
142
166
|
}
|
|
143
167
|
finally {
|
|
@@ -151,46 +175,49 @@ let InlineCompletionsSource = class InlineCompletionsSource extends Disposable {
|
|
|
151
175
|
}
|
|
152
176
|
clear(tx) {
|
|
153
177
|
this._updateOperation.clear();
|
|
154
|
-
this.
|
|
155
|
-
this.
|
|
178
|
+
const v = this._state.get();
|
|
179
|
+
this._state.set({
|
|
180
|
+
inlineCompletions: InlineCompletionsState.createEmpty(),
|
|
181
|
+
suggestWidgetInlineCompletions: InlineCompletionsState.createEmpty()
|
|
182
|
+
}, tx);
|
|
183
|
+
v.inlineCompletions.dispose();
|
|
184
|
+
v.suggestWidgetInlineCompletions.dispose();
|
|
185
|
+
}
|
|
186
|
+
seedInlineCompletionsWithSuggestWidget() {
|
|
187
|
+
const inlineCompletions = this.inlineCompletions.get();
|
|
188
|
+
const suggestWidgetInlineCompletions = this.suggestWidgetInlineCompletions.get();
|
|
189
|
+
if (!suggestWidgetInlineCompletions) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
transaction(tx => {
|
|
193
|
+
if (!inlineCompletions || (suggestWidgetInlineCompletions.request?.versionId ?? -1) > (inlineCompletions.request?.versionId ?? -1)) {
|
|
194
|
+
inlineCompletions?.dispose();
|
|
195
|
+
const s = this._state.get();
|
|
196
|
+
this._state.set({
|
|
197
|
+
inlineCompletions: suggestWidgetInlineCompletions.clone(),
|
|
198
|
+
suggestWidgetInlineCompletions: InlineCompletionsState.createEmpty(),
|
|
199
|
+
}, tx);
|
|
200
|
+
s.inlineCompletions.dispose();
|
|
201
|
+
s.suggestWidgetInlineCompletions.dispose();
|
|
202
|
+
}
|
|
203
|
+
this.clearSuggestWidgetInlineCompletions(tx);
|
|
204
|
+
});
|
|
156
205
|
}
|
|
157
206
|
clearSuggestWidgetInlineCompletions(tx) {
|
|
158
207
|
if (this._updateOperation.value?.request.context.selectedSuggestionInfo) {
|
|
159
208
|
this._updateOperation.clear();
|
|
160
209
|
}
|
|
161
|
-
this.suggestWidgetInlineCompletions.set(undefined, tx);
|
|
162
210
|
}
|
|
163
211
|
cancelUpdate() {
|
|
164
212
|
this._updateOperation.clear();
|
|
165
213
|
}
|
|
166
214
|
};
|
|
167
215
|
InlineCompletionsSource = InlineCompletionsSource_1 = ( __decorate([
|
|
168
|
-
( __param(3,
|
|
169
|
-
( __param(4,
|
|
170
|
-
( __param(5,
|
|
171
|
-
( __param(6,
|
|
172
|
-
( __param(7, IInstantiationService))
|
|
216
|
+
( __param(3, ILanguageConfigurationService)),
|
|
217
|
+
( __param(4, ILogService)),
|
|
218
|
+
( __param(5, IConfigurationService)),
|
|
219
|
+
( __param(6, IInstantiationService))
|
|
173
220
|
], InlineCompletionsSource));
|
|
174
|
-
function wait(ms, cancellationToken) {
|
|
175
|
-
return ( new Promise(resolve => {
|
|
176
|
-
let d = undefined;
|
|
177
|
-
const handle = setTimeout(() => {
|
|
178
|
-
if (d) {
|
|
179
|
-
d.dispose();
|
|
180
|
-
}
|
|
181
|
-
resolve();
|
|
182
|
-
}, ms);
|
|
183
|
-
if (cancellationToken) {
|
|
184
|
-
d = cancellationToken.onCancellationRequested(() => {
|
|
185
|
-
clearTimeout(handle);
|
|
186
|
-
if (d) {
|
|
187
|
-
d.dispose();
|
|
188
|
-
}
|
|
189
|
-
resolve();
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
}));
|
|
193
|
-
}
|
|
194
221
|
class UpdateRequest {
|
|
195
222
|
constructor(position, context, versionId) {
|
|
196
223
|
this.position = position;
|
|
@@ -218,382 +245,59 @@ class UpdateOperation {
|
|
|
218
245
|
this.cancellationTokenSource.cancel();
|
|
219
246
|
}
|
|
220
247
|
}
|
|
221
|
-
class
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
this.inlineCompletionProviderResult = inlineCompletionProviderResult;
|
|
225
|
-
this.request = request;
|
|
226
|
-
this._textModel = _textModel;
|
|
227
|
-
this._versionId = _versionId;
|
|
228
|
-
this._refCount = 1;
|
|
229
|
-
this._prependedInlineCompletionItems = [];
|
|
230
|
-
this._inlineCompletions = ( inlineCompletionProviderResult.completions.map(completion => ( new InlineCompletionWithUpdatedRange(completion, undefined, this._textModel, this._versionId, this.request))));
|
|
231
|
-
}
|
|
232
|
-
clone() {
|
|
233
|
-
this._refCount++;
|
|
234
|
-
return this;
|
|
235
|
-
}
|
|
236
|
-
dispose() {
|
|
237
|
-
this._refCount--;
|
|
238
|
-
if (this._refCount === 0) {
|
|
239
|
-
this.inlineCompletionProviderResult.dispose();
|
|
240
|
-
for (const i of this._prependedInlineCompletionItems) {
|
|
241
|
-
i.source.removeRef();
|
|
242
|
-
}
|
|
243
|
-
this._inlineCompletions.forEach(i => i.dispose());
|
|
244
|
-
}
|
|
248
|
+
class InlineCompletionsState extends Disposable {
|
|
249
|
+
static createEmpty() {
|
|
250
|
+
return ( new InlineCompletionsState([], undefined));
|
|
245
251
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
inlineCompletion.
|
|
252
|
+
constructor(inlineCompletions, request) {
|
|
253
|
+
for (const inlineCompletion of inlineCompletions) {
|
|
254
|
+
inlineCompletion.addRef();
|
|
249
255
|
}
|
|
250
|
-
this._inlineCompletions.unshift(( new InlineCompletionWithUpdatedRange(inlineCompletion, range, this._textModel, this._versionId, this.request)));
|
|
251
|
-
this._prependedInlineCompletionItems.push(inlineCompletion);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
class InlineCompletionWithUpdatedRange extends Disposable {
|
|
255
|
-
get forwardStable() {
|
|
256
|
-
return this.source.inlineCompletions.enableForwardStability ?? false;
|
|
257
|
-
}
|
|
258
|
-
get updatedEdit() { return this._updatedEditObj.offsetEdit; }
|
|
259
|
-
get updatedEditModelVersion() { return this._updatedEditObj.modelVersion; }
|
|
260
|
-
get source() { return this.inlineCompletion.source; }
|
|
261
|
-
get sourceInlineCompletion() { return this.inlineCompletion.sourceInlineCompletion; }
|
|
262
|
-
get isInlineEdit() { return this.inlineCompletion.isInlineEdit; }
|
|
263
|
-
constructor(inlineCompletion, updatedRange, _textModel, _modelVersion, request) {
|
|
264
256
|
super();
|
|
265
|
-
this.
|
|
266
|
-
this._textModel = _textModel;
|
|
267
|
-
this._modelVersion = _modelVersion;
|
|
257
|
+
this.inlineCompletions = inlineCompletions;
|
|
268
258
|
this.request = request;
|
|
269
|
-
this.
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
]);
|
|
274
|
-
this._updatedRange = derived(reader => {
|
|
275
|
-
const edit = this.updatedEdit.read(reader);
|
|
276
|
-
if (!edit || edit.edits.length === 0) {
|
|
277
|
-
return undefined;
|
|
278
|
-
}
|
|
279
|
-
return Range.fromPositions(this._textModel.getPositionAt(edit.edits[0].replaceRange.start), this._textModel.getPositionAt(edit.edits[edit.edits.length - 1].replaceRange.endExclusive));
|
|
280
|
-
});
|
|
281
|
-
this._updatedEditObj = this._register(this._toUpdatedEdit(updatedRange ?? this.inlineCompletion.range, this.inlineCompletion.insertText));
|
|
282
|
-
}
|
|
283
|
-
toInlineCompletion(reader) {
|
|
284
|
-
const singleTextEdit = this.toSingleTextEdit(reader);
|
|
285
|
-
return this.inlineCompletion.withRangeInsertTextAndFilterText(singleTextEdit.range, singleTextEdit.text, singleTextEdit.text);
|
|
286
|
-
}
|
|
287
|
-
toSingleTextEdit(reader) {
|
|
288
|
-
this._modelVersion.read(reader);
|
|
289
|
-
const offsetEdit = this.updatedEdit.read(reader);
|
|
290
|
-
if (!offsetEdit) {
|
|
291
|
-
return ( new SingleTextEdit(
|
|
292
|
-
this._updatedRange.read(reader) ?? emptyRange,
|
|
293
|
-
this.inlineCompletion.insertText
|
|
294
|
-
));
|
|
295
|
-
}
|
|
296
|
-
const startOffset = offsetEdit.edits[0].replaceRange.start;
|
|
297
|
-
const endOffset = offsetEdit.edits[offsetEdit.edits.length - 1].replaceRange.endExclusive;
|
|
298
|
-
const overallOffsetRange = ( new OffsetRange(startOffset, endOffset));
|
|
299
|
-
const overallLnColRange = Range.fromPositions(this._textModel.getPositionAt(overallOffsetRange.start), this._textModel.getPositionAt(overallOffsetRange.endExclusive));
|
|
300
|
-
let text = this._textModel.getValueInRange(overallLnColRange);
|
|
301
|
-
for (let i = offsetEdit.edits.length - 1; i >= 0; i--) {
|
|
302
|
-
const edit = offsetEdit.edits[i];
|
|
303
|
-
const relativeStartOffset = edit.replaceRange.start - startOffset;
|
|
304
|
-
const relativeEndOffset = edit.replaceRange.endExclusive - startOffset;
|
|
305
|
-
text = text.substring(0, relativeStartOffset) + edit.newText + text.substring(relativeEndOffset);
|
|
306
|
-
}
|
|
307
|
-
return ( new SingleTextEdit(overallLnColRange, text));
|
|
308
|
-
}
|
|
309
|
-
isVisible(model, cursorPosition, reader) {
|
|
310
|
-
const minimizedReplacement = singleTextRemoveCommonPrefix(this.toSingleTextEdit(reader), model);
|
|
311
|
-
const updatedRange = this._updatedRange.read(reader);
|
|
312
|
-
if (!updatedRange
|
|
313
|
-
|| !this.inlineCompletion.range.getStartPosition().equals(updatedRange.getStartPosition())
|
|
314
|
-
|| cursorPosition.lineNumber !== minimizedReplacement.range.startLineNumber
|
|
315
|
-
|| minimizedReplacement.isEmpty
|
|
316
|
-
) {
|
|
317
|
-
return false;
|
|
318
|
-
}
|
|
319
|
-
const originalValue = model.getValueInRange(minimizedReplacement.range, EndOfLinePreference.LF);
|
|
320
|
-
const filterText = minimizedReplacement.text;
|
|
321
|
-
const cursorPosIndex = Math.max(0, cursorPosition.column - minimizedReplacement.range.startColumn);
|
|
322
|
-
let filterTextBefore = filterText.substring(0, cursorPosIndex);
|
|
323
|
-
let filterTextAfter = filterText.substring(cursorPosIndex);
|
|
324
|
-
let originalValueBefore = originalValue.substring(0, cursorPosIndex);
|
|
325
|
-
let originalValueAfter = originalValue.substring(cursorPosIndex);
|
|
326
|
-
const originalValueIndent = model.getLineIndentColumn(minimizedReplacement.range.startLineNumber);
|
|
327
|
-
if (minimizedReplacement.range.startColumn <= originalValueIndent) {
|
|
328
|
-
originalValueBefore = originalValueBefore.trimStart();
|
|
329
|
-
if (originalValueBefore.length === 0) {
|
|
330
|
-
originalValueAfter = originalValueAfter.trimStart();
|
|
331
|
-
}
|
|
332
|
-
filterTextBefore = filterTextBefore.trimStart();
|
|
333
|
-
if (filterTextBefore.length === 0) {
|
|
334
|
-
filterTextAfter = filterTextAfter.trimStart();
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
return filterTextBefore.startsWith(originalValueBefore)
|
|
338
|
-
&& !!matchesSubString(originalValueAfter, filterTextAfter);
|
|
339
|
-
}
|
|
340
|
-
reuse() {
|
|
341
|
-
this._updatedEditObj.reuse();
|
|
342
|
-
}
|
|
343
|
-
canBeReused(model, position) {
|
|
344
|
-
if (!this.updatedEdit.get()) {
|
|
345
|
-
return false;
|
|
346
|
-
}
|
|
347
|
-
if (this.sourceInlineCompletion.isInlineEdit) {
|
|
348
|
-
return this._updatedEditObj.lastChangePartOfInlineEdit;
|
|
349
|
-
}
|
|
350
|
-
const updatedRange = this._updatedRange.read(undefined);
|
|
351
|
-
const result = !!updatedRange
|
|
352
|
-
&& updatedRange.containsPosition(position)
|
|
353
|
-
&& this.isVisible(model, position, undefined)
|
|
354
|
-
&& TextLength.ofRange(updatedRange).isGreaterThanOrEqualTo(TextLength.ofRange(this.inlineCompletion.range));
|
|
355
|
-
return result;
|
|
356
|
-
}
|
|
357
|
-
_toUpdatedEdit(editRange, replaceText) {
|
|
358
|
-
return this.isInlineEdit
|
|
359
|
-
? this._toInlineEditEdit(editRange, replaceText)
|
|
360
|
-
: this._toInlineCompletionEdit(editRange, replaceText);
|
|
361
|
-
}
|
|
362
|
-
_toInlineCompletionEdit(editRange, replaceText) {
|
|
363
|
-
const startOffset = this._textModel.getOffsetAt(editRange.getStartPosition());
|
|
364
|
-
const endOffset = this._textModel.getOffsetAt(editRange.getEndPosition());
|
|
365
|
-
const originalRange = OffsetRange.ofStartAndLength(startOffset, endOffset - startOffset);
|
|
366
|
-
const offsetEdit = ( new OffsetEdit([( new SingleOffsetEdit(originalRange, replaceText))]));
|
|
367
|
-
return ( new UpdatedEdit(offsetEdit, this._textModel, this._modelVersion, false));
|
|
368
|
-
}
|
|
369
|
-
_toInlineEditEdit(editRange, replaceText) {
|
|
370
|
-
const eol = this._textModel.getEOL();
|
|
371
|
-
const editOriginalText = this._textModel.getValueInRange(editRange);
|
|
372
|
-
const editReplaceText = replaceText.replace(/\r\n|\r|\n/g, eol);
|
|
373
|
-
const diffAlgorithm = linesDiffComputers.getDefault();
|
|
374
|
-
const lineDiffs = diffAlgorithm.computeDiff(splitLines(editOriginalText), splitLines(editReplaceText), {
|
|
375
|
-
ignoreTrimWhitespace: false,
|
|
376
|
-
computeMoves: false,
|
|
377
|
-
extendToSubwords: true,
|
|
378
|
-
maxComputationTimeMs: 500,
|
|
379
|
-
});
|
|
380
|
-
const innerChanges = lineDiffs.changes.flatMap(c => c.innerChanges ?? []);
|
|
381
|
-
function addRangeToPos(pos, range) {
|
|
382
|
-
const start = TextLength.fromPosition(range.getStartPosition());
|
|
383
|
-
return TextLength.ofRange(range).createRange(start.addToPosition(pos));
|
|
384
|
-
}
|
|
385
|
-
const modifiedText = ( new StringText(editReplaceText));
|
|
386
|
-
const offsetEdit = ( new OffsetEdit(( innerChanges.map(c => {
|
|
387
|
-
const range = addRangeToPos(editRange.getStartPosition(), c.originalRange);
|
|
388
|
-
const startOffset = this._textModel.getOffsetAt(range.getStartPosition());
|
|
389
|
-
const endOffset = this._textModel.getOffsetAt(range.getEndPosition());
|
|
390
|
-
const originalRange = OffsetRange.ofStartAndLength(startOffset, endOffset - startOffset);
|
|
391
|
-
const replaceText = modifiedText.getValueOfRange(c.modifiedRange);
|
|
392
|
-
const originalText = this._textModel.getValueInRange(range);
|
|
393
|
-
const edit = ( new SingleOffsetEdit(originalRange, replaceText));
|
|
394
|
-
return reshapeEdit(edit, originalText, innerChanges.length, this._textModel);
|
|
395
|
-
}))));
|
|
396
|
-
return ( new UpdatedEdit(offsetEdit, this._textModel, this._modelVersion, true));
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
class UpdatedEdit extends Disposable {
|
|
400
|
-
get modelVersion() { return this._inlineEditModelVersion; }
|
|
401
|
-
get lastChangePartOfInlineEdit() { return this._lastChangePartOfInlineEdit; }
|
|
402
|
-
get offsetEdit() { return ( this._updatedEdit.map(e => e ?? undefined)); }
|
|
403
|
-
constructor(offsetEdit, _textModel, _modelVersion, isInlineEdit) {
|
|
404
|
-
super();
|
|
405
|
-
this._textModel = _textModel;
|
|
406
|
-
this._modelVersion = _modelVersion;
|
|
407
|
-
this._lastChangePartOfInlineEdit = false;
|
|
408
|
-
this._updatedEdit = derivedHandleChanges({
|
|
409
|
-
owner: this,
|
|
410
|
-
equalityComparer: equalsIfDefined((a, b) => a?.equals(b)),
|
|
411
|
-
createEmptyChangeSummary: () => [],
|
|
412
|
-
handleChange: (context, changeSummary) => {
|
|
413
|
-
if (context.didChange(this._modelVersion) && context.change) {
|
|
414
|
-
changeSummary.push(OffsetEdits.fromContentChanges(context.change.changes));
|
|
259
|
+
this._register({
|
|
260
|
+
dispose: () => {
|
|
261
|
+
for (const inlineCompletion of this.inlineCompletions) {
|
|
262
|
+
inlineCompletion.removeRef();
|
|
415
263
|
}
|
|
416
|
-
return true;
|
|
417
264
|
}
|
|
418
|
-
}, (reader, changeSummary) => {
|
|
419
|
-
this._modelVersion.read(reader);
|
|
420
|
-
for (const change of changeSummary) {
|
|
421
|
-
this._innerEdits = this._applyTextModelChanges(change, this._innerEdits);
|
|
422
|
-
}
|
|
423
|
-
if (this._innerEdits.length === 0) {
|
|
424
|
-
return undefined;
|
|
425
|
-
}
|
|
426
|
-
if (( this._innerEdits.some(e => e.edit === undefined))) {
|
|
427
|
-
throw ( new BugIndicatingError('UpdatedEdit: Invalid state'));
|
|
428
|
-
}
|
|
429
|
-
return ( new OffsetEdit(( this._innerEdits.map(edit => edit.edit))));
|
|
430
265
|
});
|
|
431
|
-
this._inlineEditModelVersion = this._modelVersion.get() ?? -1;
|
|
432
|
-
this._innerEdits = ( offsetEdit.edits.map(edit => {
|
|
433
|
-
if (isInlineEdit) {
|
|
434
|
-
const replacedRange = Range.fromPositions(this._textModel.getPositionAt(edit.replaceRange.start), this._textModel.getPositionAt(edit.replaceRange.endExclusive));
|
|
435
|
-
const replacedText = this._textModel.getValueInRange(replacedRange);
|
|
436
|
-
return ( new SingleUpdatedNextEdit(edit, replacedText));
|
|
437
|
-
}
|
|
438
|
-
return ( new SingleUpdatedCompletion(edit));
|
|
439
|
-
}));
|
|
440
|
-
this._updatedEdit.recomputeInitiallyAndOnChange(this._store);
|
|
441
266
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
innerEdit.applyTextModelChanges(textModelChanges);
|
|
445
|
-
}
|
|
446
|
-
if (( edits.some(edit => edit.edit === undefined))) {
|
|
447
|
-
return [];
|
|
448
|
-
}
|
|
449
|
-
const currentModelVersion = this._modelVersion.get();
|
|
450
|
-
this._lastChangePartOfInlineEdit = ( edits.some(edit => edit.lastChangeUpdatedEdit));
|
|
451
|
-
if (this._lastChangePartOfInlineEdit) {
|
|
452
|
-
this._inlineEditModelVersion = currentModelVersion ?? -1;
|
|
453
|
-
}
|
|
454
|
-
if (currentModelVersion === null || this._inlineEditModelVersion + 20 < currentModelVersion) {
|
|
455
|
-
return [];
|
|
456
|
-
}
|
|
457
|
-
edits = edits.filter(innerEdit => !innerEdit.edit.isEmpty);
|
|
458
|
-
if (edits.length === 0) {
|
|
459
|
-
return [];
|
|
460
|
-
}
|
|
461
|
-
return edits;
|
|
267
|
+
_findById(id) {
|
|
268
|
+
return this.inlineCompletions.find(i => i.identity === id);
|
|
462
269
|
}
|
|
463
|
-
|
|
464
|
-
|
|
270
|
+
_findByHash(hash) {
|
|
271
|
+
return this.inlineCompletions.find(i => i.hash === hash);
|
|
465
272
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
get lastChangeUpdatedEdit() { return this._lastChangeUpdatedEdit; }
|
|
470
|
-
constructor(edit) {
|
|
471
|
-
this._lastChangeUpdatedEdit = false;
|
|
472
|
-
this._edit = edit;
|
|
273
|
+
createStateWithAppliedEdit(edit, textModel) {
|
|
274
|
+
const newInlineCompletions = ( this.inlineCompletions.map(i => i.withEdit(edit, textModel))).filter(isDefined);
|
|
275
|
+
return ( new InlineCompletionsState(newInlineCompletions, this.request));
|
|
473
276
|
}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
return;
|
|
483
|
-
}
|
|
484
|
-
this._edit = result.edit;
|
|
485
|
-
this._lastChangeUpdatedEdit = result.editHasChanged;
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
class SingleUpdatedCompletion extends SingleUpdatedEdit {
|
|
489
|
-
constructor(edit) {
|
|
490
|
-
super(edit);
|
|
491
|
-
}
|
|
492
|
-
applyChanges(edit, textModelChanges) {
|
|
493
|
-
const newEditRange = applyEditsToRanges([edit.replaceRange], textModelChanges)[0];
|
|
494
|
-
return { edit: ( new SingleOffsetEdit(newEditRange, edit.newText)), editHasChanged: !newEditRange.equals(edit.replaceRange) };
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
class SingleUpdatedNextEdit extends SingleUpdatedEdit {
|
|
498
|
-
constructor(edit, replacedText) {
|
|
499
|
-
super(edit);
|
|
500
|
-
this._prefixLength = commonPrefixLength(edit.newText, replacedText);
|
|
501
|
-
this._suffixLength = commonSuffixLength(edit.newText, replacedText);
|
|
502
|
-
this._trimmedNewText = edit.newText.substring(this._prefixLength, edit.newText.length - this._suffixLength);
|
|
503
|
-
}
|
|
504
|
-
applyChanges(edit, textModelChanges) {
|
|
505
|
-
let editStart = edit.replaceRange.start;
|
|
506
|
-
let editEnd = edit.replaceRange.endExclusive;
|
|
507
|
-
let editReplaceText = edit.newText;
|
|
508
|
-
let editHasChanged = false;
|
|
509
|
-
const shouldPreserveEditShape = this._prefixLength > 0 || this._suffixLength > 0;
|
|
510
|
-
for (let i = textModelChanges.edits.length - 1; i >= 0; i--) {
|
|
511
|
-
const change = textModelChanges.edits[i];
|
|
512
|
-
const isInsertion = change.newText.length > 0 && change.replaceRange.isEmpty;
|
|
513
|
-
if (isInsertion && !shouldPreserveEditShape && change.replaceRange.start === editStart && editReplaceText.startsWith(change.newText)) {
|
|
514
|
-
editStart += change.newText.length;
|
|
515
|
-
editReplaceText = editReplaceText.substring(change.newText.length);
|
|
516
|
-
editEnd = Math.max(editStart, editEnd);
|
|
517
|
-
editHasChanged = true;
|
|
518
|
-
continue;
|
|
519
|
-
}
|
|
520
|
-
if (isInsertion && shouldPreserveEditShape && change.replaceRange.start === editStart + this._prefixLength && this._trimmedNewText.startsWith(change.newText)) {
|
|
521
|
-
editEnd += change.newText.length;
|
|
522
|
-
editHasChanged = true;
|
|
523
|
-
this._prefixLength += change.newText.length;
|
|
524
|
-
this._trimmedNewText = this._trimmedNewText.substring(change.newText.length);
|
|
525
|
-
continue;
|
|
526
|
-
}
|
|
527
|
-
const isDeletion = change.newText.length === 0 && change.replaceRange.length > 0;
|
|
528
|
-
if (isDeletion && change.replaceRange.start >= editStart + this._prefixLength && change.replaceRange.endExclusive <= editEnd - this._suffixLength) {
|
|
529
|
-
editEnd -= change.replaceRange.length;
|
|
530
|
-
editHasChanged = true;
|
|
531
|
-
continue;
|
|
277
|
+
createStateWithAppliedResults(update, request, textModel, itemToPreserve) {
|
|
278
|
+
const items = [];
|
|
279
|
+
for (const item of update.completions) {
|
|
280
|
+
const i = InlineSuggestionItem.create(item, textModel);
|
|
281
|
+
const oldItem = this._findByHash(i.hash);
|
|
282
|
+
if (oldItem) {
|
|
283
|
+
items.push(i.withIdentity(oldItem.identity));
|
|
284
|
+
oldItem.setEndOfLifeReason({ kind: InlineCompletionEndOfLifeReasonKind.Ignored, userTypingDisagreed: false, supersededBy: i.getSourceCompletion() });
|
|
532
285
|
}
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
editStart = change.replaceRange.endExclusive;
|
|
536
|
-
editReplaceText = '';
|
|
537
|
-
continue;
|
|
286
|
+
else {
|
|
287
|
+
items.push(i);
|
|
538
288
|
}
|
|
539
|
-
if (change.replaceRange.start > editEnd) {
|
|
540
|
-
continue;
|
|
541
|
-
}
|
|
542
|
-
if (change.replaceRange.endExclusive < editStart) {
|
|
543
|
-
editStart += change.newText.length - change.replaceRange.length;
|
|
544
|
-
editEnd += change.newText.length - change.replaceRange.length;
|
|
545
|
-
continue;
|
|
546
|
-
}
|
|
547
|
-
return undefined;
|
|
548
289
|
}
|
|
549
|
-
if (
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
}
|
|
555
|
-
const emptyRange = ( new Range(1, 1, 1, 1));
|
|
556
|
-
function reshapeEdit(edit, originalText, totalInnerEdits, textModel) {
|
|
557
|
-
const eol = textModel.getEOL();
|
|
558
|
-
if (edit.newText.endsWith(eol) && originalText.endsWith(eol)) {
|
|
559
|
-
edit = ( new SingleOffsetEdit(
|
|
560
|
-
edit.replaceRange.deltaEnd(-eol.length),
|
|
561
|
-
edit.newText.slice(0, -eol.length)
|
|
562
|
-
));
|
|
563
|
-
}
|
|
564
|
-
if (totalInnerEdits === 1 && edit.replaceRange.isEmpty && edit.newText.includes(eol)) {
|
|
565
|
-
edit = reshapeMultiLineInsertion(edit, textModel);
|
|
566
|
-
}
|
|
567
|
-
if (totalInnerEdits === 1) {
|
|
568
|
-
const prefixLength = commonPrefixLength(originalText, edit.newText);
|
|
569
|
-
const suffixLength = commonSuffixLength(originalText.slice(prefixLength), edit.newText.slice(prefixLength));
|
|
570
|
-
if (prefixLength + suffixLength === originalText.length) {
|
|
571
|
-
return ( new SingleOffsetEdit(
|
|
572
|
-
edit.replaceRange.deltaStart(prefixLength).deltaEnd(-suffixLength),
|
|
573
|
-
edit.newText.substring(prefixLength, edit.newText.length - suffixLength)
|
|
574
|
-
));
|
|
575
|
-
}
|
|
576
|
-
if (prefixLength + suffixLength === edit.newText.length) {
|
|
577
|
-
return ( new SingleOffsetEdit(edit.replaceRange.deltaStart(prefixLength).deltaEnd(-suffixLength), ''));
|
|
290
|
+
if (itemToPreserve) {
|
|
291
|
+
const item = this._findById(itemToPreserve);
|
|
292
|
+
if (item && !( update.has(item.getSingleTextEdit())) && item.canBeReused(textModel, request.position)) {
|
|
293
|
+
items.unshift(item);
|
|
294
|
+
}
|
|
578
295
|
}
|
|
296
|
+
return ( new InlineCompletionsState(items, request));
|
|
579
297
|
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
function reshapeMultiLineInsertion(edit, textModel) {
|
|
583
|
-
if (!edit.replaceRange.isEmpty) {
|
|
584
|
-
throw ( new BugIndicatingError('Unexpected original range'));
|
|
585
|
-
}
|
|
586
|
-
if (edit.replaceRange.start === 0) {
|
|
587
|
-
return edit;
|
|
588
|
-
}
|
|
589
|
-
const eol = textModel.getEOL();
|
|
590
|
-
const startPosition = textModel.getPositionAt(edit.replaceRange.start);
|
|
591
|
-
const startColumn = startPosition.column;
|
|
592
|
-
const startLineNumber = startPosition.lineNumber;
|
|
593
|
-
if (startColumn === 1 && startLineNumber > 1 && textModel.getLineLength(startLineNumber) !== 0 && edit.newText.endsWith(eol) && !edit.newText.startsWith(eol)) {
|
|
594
|
-
return ( new SingleOffsetEdit(edit.replaceRange.delta(-1), eol + edit.newText.slice(0, -eol.length)));
|
|
298
|
+
clone() {
|
|
299
|
+
return ( new InlineCompletionsState(this.inlineCompletions, this.request));
|
|
595
300
|
}
|
|
596
|
-
return edit;
|
|
597
301
|
}
|
|
598
302
|
|
|
599
|
-
export {
|
|
303
|
+
export { InlineCompletionsSource };
|