@codingame/monaco-vscode-api 6.0.3 → 7.0.1
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/README.md +150 -117
- package/api.js +1 -1
- package/debugProtocol.d.ts +10 -1
- package/extensions.d.ts +2 -0
- package/missing-services.js +21 -2
- package/package.json +9 -9
- package/service-override/extensions.d.ts +1 -2
- package/services.js +4 -2
- package/vscode/src/vs/base/browser/dnd.js +1 -1
- package/vscode/src/vs/base/browser/dom.js +116 -5
- package/vscode/src/vs/base/browser/domObservable.js +16 -0
- package/vscode/src/vs/base/browser/markdownRenderer.js +5 -3
- package/vscode/src/vs/base/browser/trustedTypes.js +1 -2
- package/vscode/src/vs/base/browser/ui/actionbar/actionViewItems.js +1 -1
- package/vscode/src/vs/base/browser/ui/actionbar/actionbar.js +1 -1
- package/vscode/src/vs/base/browser/ui/button/button.js +2 -2
- package/vscode/src/vs/base/browser/ui/contextview/contextview.js +1 -4
- package/vscode/src/vs/base/browser/ui/dropdown/dropdown.js +1 -1
- package/vscode/src/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +1 -1
- package/vscode/src/vs/base/browser/ui/highlightedlabel/highlightedLabel.js +1 -1
- package/vscode/src/vs/base/browser/ui/hover/hover.d.ts +32 -16
- package/vscode/src/vs/base/browser/ui/hover/hoverDelegate.d.ts +2 -2
- package/vscode/src/vs/base/browser/ui/hover/hoverDelegate2.js +2 -2
- package/vscode/src/vs/base/browser/ui/hover/hoverWidget.css.js +1 -1
- package/vscode/src/vs/base/browser/ui/hover/hoverWidget.js +2 -0
- package/vscode/src/vs/base/browser/ui/iconLabel/iconLabel.js +1 -1
- package/vscode/src/vs/base/browser/ui/iconLabel/simpleIconLabel.js +1 -1
- package/vscode/src/vs/base/browser/ui/inputbox/inputBox.js +1 -1
- package/vscode/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.js +1 -1
- package/vscode/src/vs/base/browser/ui/list/listView.js +3 -5
- package/vscode/src/vs/base/browser/ui/list/rowCache.js +1 -8
- package/vscode/src/vs/base/browser/ui/sash/sash.js +1 -1
- package/vscode/src/vs/base/browser/ui/selectBox/selectBoxCustom.js +7 -11
- package/vscode/src/vs/base/browser/ui/splitview/paneview.js +1 -1
- package/vscode/src/vs/base/browser/ui/splitview/splitview.js +1 -1
- package/vscode/src/vs/base/browser/ui/table/tableWidget.js +1 -1
- package/vscode/src/vs/base/browser/ui/toggle/toggle.js +1 -1
- package/vscode/src/vs/base/browser/ui/toolbar/toolbar.d.ts +8 -1
- package/vscode/src/vs/base/browser/ui/toolbar/toolbar.js +2 -3
- package/vscode/src/vs/base/browser/ui/tree/abstractTree.js +1 -1
- package/vscode/src/vs/base/browser/ui/tree/asyncDataTree.js +0 -3
- package/vscode/src/vs/base/common/assert.js +1 -1
- package/vscode/src/vs/base/common/collections.js +49 -1
- package/vscode/src/vs/base/common/equals.js +55 -5
- package/vscode/src/vs/base/common/errors.js +14 -1
- package/vscode/src/vs/base/common/event.js +2 -1
- package/vscode/src/vs/base/common/history.js +7 -4
- package/vscode/src/vs/base/common/iterator.js +9 -1
- package/vscode/src/vs/base/common/map.d.ts +41 -0
- package/vscode/src/vs/base/common/numbers.js +18 -1
- package/vscode/src/vs/base/common/observableInternal/api.js +11 -0
- package/vscode/src/vs/base/common/observableInternal/autorun.js +18 -1
- package/vscode/src/vs/base/common/observableInternal/base.d.ts +8 -1
- package/vscode/src/vs/base/common/observableInternal/base.js +2 -5
- package/vscode/src/vs/base/common/observableInternal/derived.js +13 -3
- package/vscode/src/vs/base/common/observableInternal/lazyObservableValue.js +109 -0
- package/vscode/src/vs/base/common/observableInternal/promise.js +3 -0
- package/vscode/src/vs/base/common/observableInternal/utils.d.ts +7 -0
- package/vscode/src/vs/base/common/observableInternal/utils.js +64 -12
- package/vscode/src/vs/base/common/prefixTree.d.ts +52 -0
- package/vscode/src/vs/base/common/product.d.ts +1 -0
- package/vscode/src/vs/base/parts/ipc/common/ipc.js +1 -1
- package/vscode/src/vs/editor/browser/config/charWidthReader.js +1 -1
- package/vscode/src/vs/editor/browser/controller/textAreaHandler.js +1 -1
- package/vscode/src/vs/editor/browser/coreCommands.js +2 -1
- package/vscode/src/vs/editor/browser/observableCodeEditor.js +230 -0
- package/vscode/src/vs/editor/browser/services/abstractCodeEditorService.js +1 -1
- package/vscode/src/vs/editor/browser/services/hoverService/hoverService.js +26 -26
- package/vscode/src/vs/editor/browser/services/hoverService/updatableHoverWidget.js +2 -2
- package/vscode/src/vs/editor/browser/view/domLineBreaksComputer.js +1 -1
- package/vscode/src/vs/editor/browser/view/viewLayer.js +4 -12
- package/vscode/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +1 -1
- package/vscode/src/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +1 -1
- package/vscode/src/vs/editor/browser/viewParts/viewZones/viewZones.js +2 -2
- package/vscode/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +15 -4
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +8 -8
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +4 -4
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorOptions.js +1 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorViewModel.js +1 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +14 -2
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +1 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
- package/vscode/src/vs/editor/browser/widget/diffEditor/registrations.contribution.js +2 -2
- package/vscode/src/vs/editor/browser/widget/diffEditor/utils/editorGutter.js +3 -3
- package/vscode/src/vs/editor/browser/widget/diffEditor/utils.js +2 -2
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/colors.js +1 -1
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +2 -2
- package/vscode/src/vs/editor/common/config/editorOptions.d.ts +5 -0
- package/vscode/src/vs/editor/common/config/editorOptions.js +83 -65
- package/vscode/src/vs/editor/common/core/editorColorRegistry.js +43 -43
- package/vscode/src/vs/editor/common/cursor/cursor.js +3 -2
- package/vscode/src/vs/editor/common/cursor/cursorTypeEditOperations.js +911 -0
- package/vscode/src/vs/editor/common/cursor/cursorTypeOperations.js +36 -799
- package/vscode/src/vs/editor/common/cursor/cursorWordOperations.js +6 -5
- package/vscode/src/vs/editor/common/languageFeatureRegistry.d.ts +1 -0
- package/vscode/src/vs/editor/common/languageFeatureRegistry.js +3 -0
- package/vscode/src/vs/editor/common/languages/autoIndent.js +23 -1
- package/vscode/src/vs/editor/common/languages.d.ts +20 -3
- package/vscode/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsImpl.js +6 -6
- package/vscode/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.js +19 -0
- package/vscode/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.js +3 -0
- package/vscode/src/vs/editor/common/model/textModel.js +6 -2
- package/vscode/src/vs/editor/common/model/tokenizationTextModelPart.js +5 -5
- package/vscode/src/vs/editor/common/model.d.ts +4 -0
- package/vscode/src/vs/editor/common/services/getIconClasses.js +1 -1
- package/vscode/src/vs/editor/common/services/semanticTokensProviderStyling.js +2 -15
- package/vscode/src/vs/editor/common/standalone/standaloneEnums.js +63 -62
- package/vscode/src/vs/editor/common/viewModel/viewModelImpl.js +11 -8
- package/vscode/src/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +1 -1
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionController.js +2 -17
- package/vscode/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.css.js +1 -1
- package/vscode/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +18 -5
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorHoverParticipant.js +55 -27
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerWidget.js +7 -4
- package/vscode/src/vs/editor/contrib/colorPicker/browser/standaloneColorPickerWidget.js +9 -9
- package/vscode/src/vs/editor/contrib/contextmenu/browser/contextmenu.js +1 -1
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +103 -47
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -2
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +18 -10
- package/vscode/src/vs/editor/contrib/find/browser/findWidget.js +2 -4
- package/vscode/src/vs/editor/contrib/folding/browser/folding.css.js +1 -1
- package/vscode/src/vs/editor/contrib/folding/browser/folding.js +33 -13
- package/vscode/src/vs/editor/contrib/folding/browser/foldingDecorations.js +12 -7
- package/vscode/src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +2 -2
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverController.js +161 -185
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverRendered.js +321 -0
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverStatusBar.js +4 -1
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverTypes.js +6 -21
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverWidget.js +39 -40
- package/vscode/src/vs/editor/contrib/hover/browser/hoverAccessibleViews.js +55 -46
- package/vscode/src/vs/editor/contrib/hover/browser/hoverActions.js +12 -2
- package/vscode/src/vs/editor/contrib/hover/browser/hoverController.js +15 -9
- package/vscode/src/vs/editor/contrib/hover/browser/hoverTypes.js +11 -1
- package/vscode/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +141 -93
- package/vscode/src/vs/editor/contrib/hover/browser/markerHoverParticipant.js +24 -7
- package/vscode/src/vs/editor/contrib/indentation/browser/indentation.js +36 -1
- package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +5 -3
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hoverParticipant.js +25 -12
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController.js +88 -118
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHintsWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel.js +34 -33
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsSource.js +2 -2
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/provideInlineCompletions.js +11 -4
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/suggestWidgetInlineCompletionProvider.js +10 -19
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/ghostTextWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/hoverParticipant.js +45 -27
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/inlineEditController.js +4 -4
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/inlineEditHintsWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/commands.js +126 -0
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/consts.js +9 -0
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/inlineEdits.contribution.js +9 -0
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/inlineEditsController.js +82 -0
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/inlineEditsModel.js +240 -0
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/inlineEditsWidget.css.js +4 -0
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/inlineEditsWidget.js +322 -0
- package/vscode/src/vs/editor/contrib/inlineProgress/browser/inlineProgress.js +8 -4
- package/vscode/src/vs/editor/contrib/linesOperations/browser/linesOperations.js +3 -2
- package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/peekView/browser/peekView.js +2 -2
- package/vscode/src/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +60 -0
- package/vscode/src/vs/editor/contrib/placeholderText/browser/placeholderText.css.js +4 -0
- package/vscode/src/vs/editor/contrib/rename/browser/renameWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.css.js +1 -1
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +38 -20
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +3 -0
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidget.js +9 -9
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetStatus.js +10 -32
- package/vscode/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +23 -138
- package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +3 -0
- package/vscode/src/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +5 -5
- package/vscode/src/vs/editor/contrib/wordOperations/browser/wordOperations.js +13 -12
- package/vscode/src/vs/editor/contrib/wordPartOperations/browser/wordPartOperations.js +3 -3
- package/vscode/src/vs/platform/accessibility/browser/accessibilityService.js +21 -0
- package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +5 -6
- package/vscode/src/vs/platform/actionWidget/browser/actionWidget.js +1 -1
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +27 -6
- package/vscode/src/vs/platform/actions/browser/floatingMenu.js +1 -1
- package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.css.js +1 -1
- package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.js +33 -3
- package/vscode/src/vs/platform/actions/browser/toolbar.js +2 -1
- package/vscode/src/vs/platform/actions/common/actions.d.ts +3 -0
- package/vscode/src/vs/platform/actions/common/actions.js +3 -0
- package/vscode/src/vs/platform/actions/common/menuService.js +3 -2
- package/vscode/src/vs/platform/clipboard/browser/clipboardService.js +1 -1
- package/vscode/src/vs/platform/configuration/common/configurationRegistry.d.ts +7 -5
- package/vscode/src/vs/platform/configuration/common/configurationRegistry.js +109 -13
- package/vscode/src/vs/platform/diagnostics/common/diagnostics.d.ts +2 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.d.ts +12 -6
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +2 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.service.d.ts +3 -3
- package/vscode/src/vs/platform/extensionManagement/common/extensionsScannerService.js +20 -10
- package/vscode/src/vs/platform/extensions/common/extensionValidator.js +46 -8
- package/vscode/src/vs/platform/extensions/common/extensions.d.ts +1 -1
- package/vscode/src/vs/platform/extensions/common/extensions.js +12 -3
- package/vscode/src/vs/platform/extensions/common/extensionsApiProposals.js +368 -0
- package/vscode/src/vs/platform/files/common/watcher.js +21 -24
- package/vscode/src/vs/platform/list/browser/listService.js +2 -1
- package/vscode/src/vs/platform/observable/common/platformObservableUtils.js +2 -2
- package/vscode/src/vs/platform/opener/browser/link.js +1 -1
- package/vscode/src/vs/platform/product/common/product.js +1 -1
- package/vscode/src/vs/platform/quickinput/browser/quickInputTree.js +1 -1
- package/vscode/src/vs/platform/remote/common/remoteExtensionsScanner.service.d.ts +0 -2
- package/vscode/src/vs/platform/request/common/request.js +18 -8
- package/vscode/src/vs/platform/terminal/common/capabilities/capabilities.d.ts +2 -6
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetection/promptInputModel.d.ts +8 -1
- package/vscode/src/vs/platform/theme/common/colorUtils.d.ts +1 -1
- package/vscode/src/vs/platform/theme/common/colorUtils.js +25 -5
- package/vscode/src/vs/platform/theme/common/colors/baseColors.js +1 -1
- package/vscode/src/vs/platform/theme/common/colors/chartsColors.js +6 -6
- package/vscode/src/vs/platform/theme/common/colors/editorColors.js +35 -35
- package/vscode/src/vs/platform/theme/common/colors/inputColors.js +9 -9
- package/vscode/src/vs/platform/theme/common/colors/listColors.js +11 -11
- package/vscode/src/vs/platform/theme/common/colors/menuColors.js +4 -4
- package/vscode/src/vs/platform/theme/common/colors/minimapColors.js +5 -5
- package/vscode/src/vs/platform/theme/common/colors/miscColors.js +1 -1
- package/vscode/src/vs/platform/theme/common/colors/quickpickColors.js +5 -5
- package/vscode/src/vs/platform/tunnel/common/tunnel.js +4 -1
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.js +75 -19
- package/vscode/src/vs/platform/window/common/window.d.ts +2 -2
- package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +32 -25
- package/vscode/src/vs/workbench/api/common/extHost.common.services.js +2 -0
- package/vscode/src/vs/workbench/api/common/extHost.protocol.js +2 -0
- package/vscode/src/vs/workbench/api/common/extHostAuthentication.js +5 -11
- package/vscode/src/vs/workbench/api/common/extHostChatAgents2.js +5 -15
- package/vscode/src/vs/workbench/api/common/extHostChatVariables.js +2 -5
- package/vscode/src/vs/workbench/api/common/extHostComments.js +9 -3
- package/vscode/src/vs/workbench/api/common/extHostDebugService.js +32 -22
- package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +3 -3
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +109 -40
- package/vscode/src/vs/workbench/api/common/extHostLanguageModelTools.js +46 -0
- package/vscode/src/vs/workbench/api/common/extHostLanguageModels.js +84 -35
- package/vscode/src/vs/workbench/api/common/extHostNotebook.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostSCM.js +50 -41
- package/vscode/src/vs/workbench/api/common/extHostSearch.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostSecrets.js +11 -8
- package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +7 -6
- package/vscode/src/vs/workbench/api/common/extHostTesting.js +63 -70
- package/vscode/src/vs/workbench/api/common/extHostTextEditors.js +5 -3
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +75 -16
- package/vscode/src/vs/workbench/api/common/extHostTypes.js +29 -4
- package/vscode/src/vs/workbench/api/common/extHostWorkspace.js +1 -1
- package/vscode/src/vs/workbench/browser/actions/developerActions.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorActions.js +127 -107
- package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/editor/editorPanes.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorStatus.js +33 -21
- package/vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +5 -5
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsToasts.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/views/treeView.js +23 -6
- package/vscode/src/vs/workbench/browser/parts/views/viewFilter.js +3 -1
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +3 -3
- package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +1 -1
- package/vscode/src/vs/workbench/browser/web.api.js +8 -0
- package/vscode/src/vs/workbench/browser/workbench.contribution.js +199 -194
- package/vscode/src/vs/workbench/common/configuration.js +1 -1
- package/vscode/src/vs/workbench/common/contributions.js +8 -1
- package/vscode/src/vs/workbench/common/editor.js +5 -1
- package/vscode/src/vs/workbench/common/theme.js +79 -454
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +221 -239
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +17 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAgentHover.js +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollections.js +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCommandContentPart.js +35 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationContentPart.js +51 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/{chatConfirmationWidget.js → chatContentParts/chatConfirmationWidget.js} +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownContentPart.js +131 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatProgressContentPart.js +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.js +263 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTaskContentPart.js +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.js +160 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTreeContentPart.js +171 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatWarningContentPart.js +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/{media → chatContentParts/media}/chatConfirmationWidget.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +91 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +292 -1019
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownRenderer.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +22 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +61 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +23 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatAgentHover.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.js +8 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatColors.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatWordCounter.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/common/codeBlockModelCollection.js +16 -0
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelToolsService.service.js +3 -0
- package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +43 -16
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +1 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.js +7 -5
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +7 -7
- package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +3 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +2 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +2 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +2 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +8 -5
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +1 -1
- package/vscode/src/vs/workbench/contrib/contextmenu/browser/contextmenu.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +14 -7
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +8 -7
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +19 -16
- package/vscode/src/vs/workbench/contrib/debug/browser/debugColors.js +13 -12
- package/vscode/src/vs/workbench/contrib/debug/common/debug.d.ts +19 -2
- package/vscode/src/vs/workbench/contrib/debug/common/debug.js +9 -4
- package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +10 -5
- package/vscode/src/vs/workbench/contrib/debug/common/replModel.js +4 -4
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +235 -173
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionActions.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/common/extensions.js +2 -1
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +17 -5
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._configuration.js +62 -44
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._editorPane.js +2 -2
- package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +114 -107
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatContentWidget.js +33 -25
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +71 -101
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +38 -43
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +11 -33
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +3 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +49 -86
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +60 -71
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatContentWidget.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +116 -113
- package/vscode/src/vs/workbench/contrib/markdown/browser/markdownDocumentRenderer.js +6 -10
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput.js +1 -0
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findFilters.js +12 -23
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +0 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findModel.js +7 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +88 -61
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +1 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +39 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +2 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.js +12 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookBrowser.js +3 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +40 -105
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +27 -26
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +14 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +43 -46
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +12 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +19 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +9 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +5 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +16 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.js +8 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineDataSourceFactory.service.js +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +11 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +12 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.js +5 -3
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +9 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +37 -36
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +18 -8
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.js +1 -1
- package/vscode/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.js +14 -5
- package/vscode/src/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +17 -22
- package/vscode/src/vs/workbench/contrib/remote/browser/media/tunnelView.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +7 -10
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +7 -27
- package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +3 -4
- package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchService.js +2 -2
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +4 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +13 -37
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.d.ts +88 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +48 -31
- package/vscode/src/vs/workbench/contrib/testing/common/testId.d.ts +115 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.d.ts +226 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testTypes.d.ts +319 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testTypes.js +2 -3
- package/vscode/src/vs/workbench/contrib/testing/common/testingStates.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewWindowDragMonitor.js +21 -2
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewIconManager.js +7 -8
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +3 -3
- package/vscode/src/vs/workbench/services/authentication/common/authentication.d.ts +10 -5
- package/vscode/src/vs/workbench/services/editor/common/customEditorLabelService.js +54 -21
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.service.d.ts +1 -0
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.d.ts +1 -2
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +2 -4
- package/vscode/src/vs/workbench/services/extensions/common/extensions.js +5 -3
- package/vscode/src/vs/workbench/services/extensions/common/extensions.service.d.ts +3 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsRegistry.js +59 -41
- package/vscode/src/vs/workbench/services/extensions/common/rpcProtocol.js +1 -1
- package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +3 -2
- package/vscode/src/vs/workbench/services/host/browser/host.service.d.ts +1 -0
- package/vscode/src/vs/workbench/services/language/common/languageService.js +7 -0
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +1 -1
- package/vscode/src/vs/workbench/services/preferences/common/preferences.d.ts +2 -2
- package/vscode/src/vs/workbench/services/search/common/search.js +2 -1
- package/vscode/src/vs/workbench/services/search/common/textSearchManager.js +2 -2
- package/vscode/src/vs/workbench/services/statusbar/browser/statusbar.d.ts +2 -2
- package/vscode/src/vs/workbench/services/textfile/common/encoding.js +69 -26
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +23 -4
- package/vscode/src/vs/workbench/services/textfile/common/textfiles.d.ts +5 -1
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +1 -1
- package/vscode/src/vs/workbench/services/views/browser/viewsService.js +12 -5
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.js +38 -19
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyFileService.service.d.ts +2 -1
- package/vscode-dts/vscode.proposed.aiTextSearchProvider.d.ts +0 -196
- package/vscode-dts/vscode.proposed.attributableCoverage.d.ts +28 -10
- package/vscode-dts/vscode.proposed.authGetSessions.d.ts +30 -22
- package/vscode-dts/vscode.proposed.chatProvider.d.ts +17 -8
- package/vscode-dts/vscode.proposed.chatVariableResolver.d.ts +0 -9
- package/vscode-dts/vscode.proposed.commentReveal.d.ts +32 -0
- package/vscode-dts/vscode.proposed.commentThreadApplicability.d.ts +10 -0
- package/vscode-dts/vscode.proposed.createFileSystemWatcher.d.ts +1 -1
- package/vscode-dts/vscode.proposed.fileComments.d.ts +12 -53
- package/vscode-dts/vscode.proposed.fileSearchProvider.d.ts +6 -0
- package/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts +6 -0
- package/vscode-dts/vscode.proposed.lmTools.d.ts +91 -0
- package/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts +1 -1
- package/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts +10 -6
- package/vscode-dts/vscode.proposed.terminalShellIntegration.d.ts +38 -13
- package/vscode/src/vs/editor/browser/observableUtilities.js +0 -58
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProviderFactory.service.js +0 -3
- package/vscode/src/vs/workbench/services/extensions/common/extensionsApiProposals.js +0 -122
package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import {
|
|
2
|
+
import { createStyleSheetFromObservable } from '../../../../base/browser/domObservable.js';
|
|
3
3
|
import { alert } from '../../../../base/browser/ui/aria/aria.js';
|
|
4
4
|
import { timeout } from '../../../../base/common/async.js';
|
|
5
5
|
import { cancelOnDispose } from '../../../../base/common/cancellation.js';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { observableFromEvent, mapObservableArrayCached, observableSignal, constObservable } from '../../../../base/common/observableInternal/utils.js';
|
|
6
|
+
import { Disposable, toDisposable } from '../../../../base/common/lifecycle.js';
|
|
7
|
+
import { transaction, observableValue } from '../../../../base/common/observableInternal/base.js';
|
|
8
|
+
import { derived, derivedDisposable } from '../../../../base/common/observableInternal/derived.js';
|
|
9
|
+
import { autorun } from '../../../../base/common/observableInternal/autorun.js';
|
|
10
|
+
import { observableFromEvent, mapObservableArrayCached, observableSignal, constObservable, derivedObservableWithCache } from '../../../../base/common/observableInternal/utils.js';
|
|
12
11
|
import { waitForState } from '../../../../base/common/observableInternal/promise.js';
|
|
12
|
+
import '../../../../base/common/arrays.js';
|
|
13
13
|
import { isUndefined } from '../../../../base/common/types.js';
|
|
14
14
|
import { CoreEditingCommands } from '../../../browser/coreCommands.js';
|
|
15
|
+
import { observableCodeEditor, reactToChange, reactToChangeWithStore } from '../../../browser/observableCodeEditor.js';
|
|
15
16
|
import { EditorOption } from '../../../common/config/editorOptions.js';
|
|
16
17
|
import { Position } from '../../../common/core/position.js';
|
|
17
18
|
import { CursorChangeReason } from '../../../common/cursorEvents.js';
|
|
@@ -21,7 +22,7 @@ import { inlineSuggestCommitId } from './commandIds.js';
|
|
|
21
22
|
import { GhostTextWidget } from './ghostTextWidget.js';
|
|
22
23
|
import { InlineCompletionContextKeys } from './inlineCompletionContextKeys.js';
|
|
23
24
|
import { InlineSuggestionHintsContentWidget, InlineCompletionsHintsWidget } from './inlineCompletionsHintsWidget.js';
|
|
24
|
-
import {
|
|
25
|
+
import { InlineCompletionsModel } from './inlineCompletionsModel.js';
|
|
25
26
|
import { SuggestWidgetAdaptor } from './suggestWidgetInlineCompletionProvider.js';
|
|
26
27
|
import { localizeWithPath } from '../../../../nls.js';
|
|
27
28
|
import { IAccessibilityService } from '../../../../platform/accessibility/common/accessibility.service.js';
|
|
@@ -52,90 +53,51 @@ let InlineCompletionsController = class InlineCompletionsController extends Disp
|
|
|
52
53
|
this._accessibilitySignalService = _accessibilitySignalService;
|
|
53
54
|
this._keybindingService = _keybindingService;
|
|
54
55
|
this._accessibilityService = _accessibilityService;
|
|
55
|
-
this.
|
|
56
|
-
this.
|
|
57
|
-
this.
|
|
58
|
-
|
|
59
|
-
this.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
))));
|
|
69
|
-
this._enabledInConfig = observableFromEvent(this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineSuggest).enabled);
|
|
70
|
-
this._isScreenReaderEnabled = observableFromEvent(this._accessibilityService.onDidChangeScreenReaderOptimized, () => this._accessibilityService.isScreenReaderOptimized());
|
|
71
|
-
this._editorDictationInProgress = observableFromEvent(this._contextKeyService.onDidChangeContext, () => this._contextKeyService.getContext(this.editor.getDomNode()).getValue('editorDictation.inProgress') === true);
|
|
56
|
+
this._editorObs = observableCodeEditor(this.editor);
|
|
57
|
+
this._positions = derived(this, reader => this._editorObs.selections.read(reader)?.map(s => s.getEndPosition()) ?? [( (new Position(1, 1)))]);
|
|
58
|
+
this._suggestWidgetAdaptor = this._register(( (new SuggestWidgetAdaptor(this.editor, () => {
|
|
59
|
+
this._editorObs.forceUpdate();
|
|
60
|
+
return this.model.get()?.selectedInlineCompletion.get()?.toSingleTextEdit(undefined);
|
|
61
|
+
}, (item) => this._editorObs.forceUpdate(_tx => {
|
|
62
|
+
this.model.get()?.handleSuggestAccepted(item);
|
|
63
|
+
})))));
|
|
64
|
+
this._suggestWidgetSelectedItem = observableFromEvent(this, cb => this._suggestWidgetAdaptor.onDidSelectedItemChange(() => {
|
|
65
|
+
this._editorObs.forceUpdate(_tx => cb(undefined));
|
|
66
|
+
}), () => this._suggestWidgetAdaptor.selectedItem);
|
|
67
|
+
this._enabledInConfig = observableFromEvent(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineSuggest).enabled);
|
|
68
|
+
this._isScreenReaderEnabled = observableFromEvent(this, this._accessibilityService.onDidChangeScreenReaderOptimized, () => this._accessibilityService.isScreenReaderOptimized());
|
|
69
|
+
this._editorDictationInProgress = observableFromEvent(this, this._contextKeyService.onDidChangeContext, () => this._contextKeyService.getContext(this.editor.getDomNode()).getValue('editorDictation.inProgress') === true);
|
|
72
70
|
this._enabled = derived(this, reader => this._enabledInConfig.read(reader) && (!this._isScreenReaderEnabled.read(reader) || !this._editorDictationInProgress.read(reader)));
|
|
73
|
-
this.
|
|
71
|
+
this._debounceValue = this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider, 'InlineCompletionsDebounce', { min: 50, max: 50 });
|
|
72
|
+
this.model = derivedDisposable(this, reader => {
|
|
73
|
+
if (this._editorObs.isReadonly.read(reader)) {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
const textModel = this._editorObs.model.read(reader);
|
|
77
|
+
if (!textModel) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
const model = this._instantiationService.createInstance(InlineCompletionsModel, textModel, this._suggestWidgetSelectedItem, this._editorObs.versionId, this._positions, this._debounceValue, observableFromEvent(this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.suggest).preview), observableFromEvent(this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.suggest).previewMode), observableFromEvent(this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineSuggest).mode), this._enabled);
|
|
81
|
+
return model;
|
|
82
|
+
}).recomputeInitiallyAndOnChange(this._store);
|
|
74
83
|
this._ghostTexts = derived(this, (reader) => {
|
|
75
84
|
const model = this.model.read(reader);
|
|
76
85
|
return model?.ghostTexts.read(reader) ?? [];
|
|
77
86
|
});
|
|
78
87
|
this._stablizedGhostTexts = convertItemsToStableObservables(this._ghostTexts, this._store);
|
|
79
|
-
this._ghostTextWidgets = mapObservableArrayCached(this, this._stablizedGhostTexts, (ghostText, store) => {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}));
|
|
85
|
-
}).recomputeInitiallyAndOnChange(this._store);
|
|
86
|
-
this._debounceValue = this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider, 'InlineCompletionsDebounce', { min: 50, max: 50 });
|
|
88
|
+
this._ghostTextWidgets = mapObservableArrayCached(this, this._stablizedGhostTexts, (ghostText, store) => store.add(this._instantiationService.createInstance(GhostTextWidget, this.editor, {
|
|
89
|
+
ghostText: ghostText,
|
|
90
|
+
minReservedLineCount: constObservable(0),
|
|
91
|
+
targetTextModel: ( (this.model.map(v => v?.textModel))),
|
|
92
|
+
}))).recomputeInitiallyAndOnChange(this._store);
|
|
87
93
|
this._playAccessibilitySignal = observableSignal(this);
|
|
88
|
-
this.
|
|
89
|
-
this._textModel = observableFromEvent(this.editor.onDidChangeModel, () => this.editor.getModel());
|
|
90
|
-
this._textModelIfWritable = derived(reader => this._isReadonly.read(reader) ? undefined : this._textModel.read(reader));
|
|
94
|
+
this._fontFamily = observableFromEvent(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineSuggest).fontFamily);
|
|
91
95
|
this._register(( (new InlineCompletionContextKeys(this._contextKeyService, this.model))));
|
|
92
|
-
this._register(
|
|
93
|
-
const textModel = this._textModelIfWritable.read(reader);
|
|
94
|
-
transaction(tx => {
|
|
95
|
-
this.model.set(undefined, tx);
|
|
96
|
-
this.updateObservables(tx, VersionIdChangeReason.Other);
|
|
97
|
-
if (textModel) {
|
|
98
|
-
const model = _instantiationService.createInstance(InlineCompletionsModel, textModel, this._suggestWidgetAdaptor.selectedItem, this._textModelVersionId, this._positions, this._debounceValue, observableFromEvent(editor.onDidChangeConfiguration, () => editor.getOption(EditorOption.suggest).preview), observableFromEvent(editor.onDidChangeConfiguration, () => editor.getOption(EditorOption.suggest).previewMode), observableFromEvent(editor.onDidChangeConfiguration, () => editor.getOption(EditorOption.inlineSuggest).mode), this._enabled);
|
|
99
|
-
this.model.set(model, tx);
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
}));
|
|
103
|
-
const styleElement = this._register(createStyleSheet2());
|
|
104
|
-
this._register(autorun(reader => {
|
|
105
|
-
const fontFamily = this._fontFamily.read(reader);
|
|
106
|
-
styleElement.setStyle(fontFamily === '' || fontFamily === 'default' ? `` : `
|
|
107
|
-
.monaco-editor .ghost-text-decoration,
|
|
108
|
-
.monaco-editor .ghost-text-decoration-preview,
|
|
109
|
-
.monaco-editor .ghost-text {
|
|
110
|
-
font-family: ${fontFamily};
|
|
111
|
-
}`);
|
|
112
|
-
}));
|
|
113
|
-
const getReason = (e) => {
|
|
114
|
-
if (e.isUndoing) {
|
|
115
|
-
return VersionIdChangeReason.Undo;
|
|
116
|
-
}
|
|
117
|
-
if (e.isRedoing) {
|
|
118
|
-
return VersionIdChangeReason.Redo;
|
|
119
|
-
}
|
|
120
|
-
if (this.model.get()?.isAcceptingPartially) {
|
|
121
|
-
return VersionIdChangeReason.AcceptWord;
|
|
122
|
-
}
|
|
123
|
-
return VersionIdChangeReason.Other;
|
|
124
|
-
};
|
|
125
|
-
this._register(editor.onDidChangeModelContent((e) => transaction(tx =>
|
|
126
|
-
this.updateObservables(tx, getReason(e)))));
|
|
127
|
-
this._register(editor.onDidChangeCursorPosition(e => transaction(tx => {
|
|
128
|
-
this.updateObservables(tx, VersionIdChangeReason.Other);
|
|
129
|
-
if (e.reason === CursorChangeReason.Explicit || e.source === 'api') {
|
|
130
|
-
this.model.get()?.stop(tx);
|
|
131
|
-
}
|
|
132
|
-
})));
|
|
133
|
-
this._register(editor.onDidType(() => transaction(tx => {
|
|
134
|
-
this.updateObservables(tx, VersionIdChangeReason.Other);
|
|
96
|
+
this._register(reactToChange(this._editorObs.onDidType, (_value, _changes) => {
|
|
135
97
|
if (this._enabled.get()) {
|
|
136
|
-
this.model.get()?.trigger(
|
|
98
|
+
this.model.get()?.trigger();
|
|
137
99
|
}
|
|
138
|
-
}))
|
|
100
|
+
}));
|
|
139
101
|
this._register(this._commandService.onDidExecuteCommand((e) => {
|
|
140
102
|
const commands = ( (new Set([
|
|
141
103
|
CoreEditingCommands.Tab.id,
|
|
@@ -145,17 +107,21 @@ let InlineCompletionsController = class InlineCompletionsController extends Disp
|
|
|
145
107
|
'acceptSelectedSuggestion',
|
|
146
108
|
])));
|
|
147
109
|
if (( (commands.has(e.commandId))) && editor.hasTextFocus() && this._enabled.get()) {
|
|
148
|
-
|
|
110
|
+
this._editorObs.forceUpdate(tx => {
|
|
149
111
|
this.model.get()?.trigger(tx);
|
|
150
112
|
});
|
|
151
113
|
}
|
|
152
114
|
}));
|
|
153
|
-
this._register(this.
|
|
154
|
-
if (
|
|
155
|
-
|
|
156
|
-
return;
|
|
115
|
+
this._register(reactToChange(this._editorObs.selections, (_value, changes) => {
|
|
116
|
+
if (( (changes.some(e => e.reason === CursorChangeReason.Explicit || e.source === 'api')))) {
|
|
117
|
+
this.model.get()?.stop();
|
|
157
118
|
}
|
|
158
|
-
|
|
119
|
+
}));
|
|
120
|
+
this._register(this.editor.onDidBlurEditorWidget(() => {
|
|
121
|
+
if (this._contextKeyService.getContextKeyValue('accessibleViewIsShown')
|
|
122
|
+
|| this._configurationService.getValue('editor.inlineSuggest.keepOnBlur')
|
|
123
|
+
|| editor.getOption(EditorOption.inlineSuggest).keepOnBlur
|
|
124
|
+
|| InlineSuggestionHintsContentWidget.dropDownVisible) {
|
|
159
125
|
return;
|
|
160
126
|
}
|
|
161
127
|
transaction(tx => {
|
|
@@ -176,36 +142,45 @@ let InlineCompletionsController = class InlineCompletionsController extends Disp
|
|
|
176
142
|
this._register(toDisposable(() => {
|
|
177
143
|
this._suggestWidgetAdaptor.stopForceRenderingAbove();
|
|
178
144
|
}));
|
|
179
|
-
const
|
|
180
|
-
let lastInlineCompletionId = undefined;
|
|
181
|
-
this._register(autorunHandleChanges({
|
|
182
|
-
handleChange: (context, changeSummary) => {
|
|
183
|
-
if (context.didChange(this._playAccessibilitySignal)) {
|
|
184
|
-
lastInlineCompletionId = undefined;
|
|
185
|
-
}
|
|
186
|
-
return true;
|
|
187
|
-
},
|
|
188
|
-
}, async (reader, _) => {
|
|
189
|
-
this._playAccessibilitySignal.read(reader);
|
|
145
|
+
const currentInlineCompletionBySemanticId = derivedObservableWithCache(this, (reader, last) => {
|
|
190
146
|
const model = this.model.read(reader);
|
|
191
147
|
const state = model?.state.read(reader);
|
|
192
|
-
if (
|
|
193
|
-
|
|
148
|
+
if (this._suggestWidgetSelectedItem.get()) {
|
|
149
|
+
return last;
|
|
150
|
+
}
|
|
151
|
+
return state?.inlineCompletion?.semanticId;
|
|
152
|
+
});
|
|
153
|
+
this._register(reactToChangeWithStore(derived(reader => {
|
|
154
|
+
this._playAccessibilitySignal.read(reader);
|
|
155
|
+
currentInlineCompletionBySemanticId.read(reader);
|
|
156
|
+
return {};
|
|
157
|
+
}), async (_value, _deltas, store) => {
|
|
158
|
+
const model = this.model.get();
|
|
159
|
+
const state = model?.state.get();
|
|
160
|
+
if (!state || !model) {
|
|
194
161
|
return;
|
|
195
162
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
await this._accessibilitySignalService.playSignal(AccessibilitySignal.inlineSuggestion);
|
|
203
|
-
if (this.editor.getOption(EditorOption.screenReaderAnnounceInlineSuggestion)) {
|
|
204
|
-
this.provideScreenReaderUpdate(state.primaryGhostText.renderForScreenReader(lineText));
|
|
205
|
-
}
|
|
163
|
+
const lineText = model.textModel.getLineContent(state.primaryGhostText.lineNumber);
|
|
164
|
+
await timeout(50, cancelOnDispose(store));
|
|
165
|
+
await waitForState(this._suggestWidgetSelectedItem, isUndefined, () => false, cancelOnDispose(store));
|
|
166
|
+
await this._accessibilitySignalService.playSignal(AccessibilitySignal.inlineSuggestion);
|
|
167
|
+
if (this.editor.getOption(EditorOption.screenReaderAnnounceInlineSuggestion)) {
|
|
168
|
+
this._provideScreenReaderUpdate(state.primaryGhostText.renderForScreenReader(lineText));
|
|
206
169
|
}
|
|
207
170
|
}));
|
|
208
171
|
this._register(( (new InlineCompletionsHintsWidget(this.editor, this.model, this._instantiationService))));
|
|
172
|
+
this._register(createStyleSheetFromObservable(derived(reader => {
|
|
173
|
+
const fontFamily = this._fontFamily.read(reader);
|
|
174
|
+
if (fontFamily === '' || fontFamily === 'default') {
|
|
175
|
+
return '';
|
|
176
|
+
}
|
|
177
|
+
return `
|
|
178
|
+
.monaco-editor .ghost-text-decoration,
|
|
179
|
+
.monaco-editor .ghost-text-decoration-preview,
|
|
180
|
+
.monaco-editor .ghost-text {
|
|
181
|
+
font-family: ${fontFamily};
|
|
182
|
+
}`;
|
|
183
|
+
})));
|
|
209
184
|
this._register(this._configurationService.onDidChangeConfiguration(e => {
|
|
210
185
|
if (e.affectsConfiguration('accessibility.verbosity.inlineCompletions')) {
|
|
211
186
|
this.editor.updateOptions({ inlineCompletionsAccessibilityVerbose: this._configurationService.getValue('accessibility.verbosity.inlineCompletions') });
|
|
@@ -216,7 +191,7 @@ let InlineCompletionsController = class InlineCompletionsController extends Disp
|
|
|
216
191
|
playAccessibilitySignal(tx) {
|
|
217
192
|
this._playAccessibilitySignal.trigger(tx);
|
|
218
193
|
}
|
|
219
|
-
|
|
194
|
+
_provideScreenReaderUpdate(content) {
|
|
220
195
|
const accessibleViewShowing = this._contextKeyService.getContextKeyValue('accessibleViewIsShown');
|
|
221
196
|
const accessibleViewKeybinding = this._keybindingService.lookupKeybinding('editor.action.accessibleView');
|
|
222
197
|
let hint;
|
|
@@ -228,12 +203,7 @@ let InlineCompletionsController = class InlineCompletionsController extends Disp
|
|
|
228
203
|
accessibleViewKeybinding.getAriaLabel()
|
|
229
204
|
));
|
|
230
205
|
}
|
|
231
|
-
hint ?
|
|
232
|
-
}
|
|
233
|
-
updateObservables(tx, changeReason) {
|
|
234
|
-
const newModel = this.editor.getModel();
|
|
235
|
-
this._textModelVersionId.set(newModel?.getVersionId() ?? -1, tx, changeReason);
|
|
236
|
-
this._positions.set(this.editor.getSelections()?.map(selection => selection.getPosition()) ?? [( (new Position(1, 1)))], tx);
|
|
206
|
+
alert(hint ? content + ', ' + hint : content);
|
|
237
207
|
}
|
|
238
208
|
shouldShowHoverAt(range) {
|
|
239
209
|
const ghostText = this.model.get()?.primaryGhostText.get();
|
package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHintsWidget.js
CHANGED
|
@@ -40,7 +40,7 @@ let InlineCompletionsHintsWidget = class InlineCompletionsHintsWidget extends Di
|
|
|
40
40
|
this.editor = editor;
|
|
41
41
|
this.model = model;
|
|
42
42
|
this.instantiationService = instantiationService;
|
|
43
|
-
this.alwaysShowToolbar = observableFromEvent(this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineSuggest).showToolbar === 'always');
|
|
43
|
+
this.alwaysShowToolbar = observableFromEvent(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineSuggest).showToolbar === 'always');
|
|
44
44
|
this.sessionPosition = undefined;
|
|
45
45
|
this.position = derived(this, reader => {
|
|
46
46
|
const ghostText = this.model.read(reader)?.primaryGhostText.read(reader);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { Permutation } from '../../../../base/common/arrays.js';
|
|
2
|
+
import { Permutation, compareBy } from '../../../../base/common/arrays.js';
|
|
3
3
|
import { mapFindFirst } from '../../../../base/common/arraysFind.js';
|
|
4
4
|
import { itemsEquals } from '../../../../base/common/equals.js';
|
|
5
5
|
import { BugIndicatingError, onUnexpectedExternalError, onUnexpectedError } from '../../../../base/common/errors.js';
|
|
6
6
|
import { Disposable } from '../../../../base/common/lifecycle.js';
|
|
7
|
-
import { observableValue,
|
|
7
|
+
import { observableValue, transaction, subtransaction } from '../../../../base/common/observableInternal/base.js';
|
|
8
8
|
import { derived, derivedHandleChanges, derivedOpts } from '../../../../base/common/observableInternal/derived.js';
|
|
9
9
|
import { autorun } from '../../../../base/common/observableInternal/autorun.js';
|
|
10
10
|
import { observableSignal, recomputeInitiallyAndOnChange } from '../../../../base/common/observableInternal/utils.js';
|
|
@@ -28,20 +28,13 @@ import { subtractPositions, addPositions } from './utils.js';
|
|
|
28
28
|
import { SnippetController2 } from '../../snippet/browser/snippetController2.js';
|
|
29
29
|
import { ICommandService } from '../../../../platform/commands/common/commands.service.js';
|
|
30
30
|
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
|
|
31
|
-
var VersionIdChangeReason;
|
|
32
|
-
( (function(VersionIdChangeReason) {
|
|
33
|
-
VersionIdChangeReason[VersionIdChangeReason["Undo"] = 0] = "Undo";
|
|
34
|
-
VersionIdChangeReason[VersionIdChangeReason["Redo"] = 1] = "Redo";
|
|
35
|
-
VersionIdChangeReason[VersionIdChangeReason["AcceptWord"] = 2] = "AcceptWord";
|
|
36
|
-
VersionIdChangeReason[VersionIdChangeReason["Other"] = 3] = "Other";
|
|
37
|
-
})(VersionIdChangeReason || (VersionIdChangeReason = {})));
|
|
38
31
|
let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
39
32
|
get isAcceptingPartially() { return this._isAcceptingPartially; }
|
|
40
|
-
constructor(textModel, selectedSuggestItem,
|
|
33
|
+
constructor(textModel, selectedSuggestItem, _textModelVersionId, _positions, _debounceValue, _suggestPreviewEnabled, _suggestPreviewMode, _inlineSuggestMode, _enabled, _instantiationService, _commandService, _languageConfigurationService) {
|
|
41
34
|
super();
|
|
42
35
|
this.textModel = textModel;
|
|
43
36
|
this.selectedSuggestItem = selectedSuggestItem;
|
|
44
|
-
this.
|
|
37
|
+
this._textModelVersionId = _textModelVersionId;
|
|
45
38
|
this._positions = _positions;
|
|
46
39
|
this._debounceValue = _debounceValue;
|
|
47
40
|
this._suggestPreviewEnabled = _suggestPreviewEnabled;
|
|
@@ -51,7 +44,7 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
51
44
|
this._instantiationService = _instantiationService;
|
|
52
45
|
this._commandService = _commandService;
|
|
53
46
|
this._languageConfigurationService = _languageConfigurationService;
|
|
54
|
-
this._source = this._register(this._instantiationService.createInstance(InlineCompletionsSource, this.textModel, this.
|
|
47
|
+
this._source = this._register(this._instantiationService.createInstance(InlineCompletionsSource, this.textModel, this._textModelVersionId, this._debounceValue));
|
|
55
48
|
this._isActive = observableValue(this, false);
|
|
56
49
|
this._forceUpdateExplicitlySignal = observableSignal(this);
|
|
57
50
|
this._selectedInlineCompletionId = observableValue(this, undefined);
|
|
@@ -69,7 +62,7 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
69
62
|
inlineCompletionTriggerKind: InlineCompletionTriggerKind.Automatic
|
|
70
63
|
}),
|
|
71
64
|
handleChange: (ctx, changeSummary) => {
|
|
72
|
-
if (ctx.didChange(this.
|
|
65
|
+
if (ctx.didChange(this._textModelVersionId) && ( this._preserveCurrentCompletionReasons.has(this._getReason(ctx.change)))) {
|
|
73
66
|
changeSummary.preserveCurrentCompletion = true;
|
|
74
67
|
}
|
|
75
68
|
else if (ctx.didChange(this._forceUpdateExplicitlySignal)) {
|
|
@@ -84,7 +77,7 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
84
77
|
this._source.cancelUpdate();
|
|
85
78
|
return undefined;
|
|
86
79
|
}
|
|
87
|
-
this.
|
|
80
|
+
this._textModelVersionId.read(reader);
|
|
88
81
|
const suggestWidgetInlineCompletions = this._source.suggestWidgetInlineCompletions.get();
|
|
89
82
|
const suggestItem = this.selectedSuggestItem.read(reader);
|
|
90
83
|
if (suggestWidgetInlineCompletions && !suggestItem) {
|
|
@@ -195,20 +188,14 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
195
188
|
return { edits, primaryGhostText: ghostTexts[0], ghostTexts, inlineCompletion, suggestItem: undefined };
|
|
196
189
|
}
|
|
197
190
|
});
|
|
198
|
-
this.ghostTexts = derivedOpts({
|
|
199
|
-
owner: this,
|
|
200
|
-
equalsFn: ghostTextsOrReplacementsEqual
|
|
201
|
-
}, reader => {
|
|
191
|
+
this.ghostTexts = derivedOpts({ owner: this, equalsFn: ghostTextsOrReplacementsEqual }, reader => {
|
|
202
192
|
const v = this.state.read(reader);
|
|
203
193
|
if (!v) {
|
|
204
194
|
return undefined;
|
|
205
195
|
}
|
|
206
196
|
return v.ghostTexts;
|
|
207
197
|
});
|
|
208
|
-
this.primaryGhostText = derivedOpts({
|
|
209
|
-
owner: this,
|
|
210
|
-
equalsFn: ghostTextOrReplacementEquals
|
|
211
|
-
}, reader => {
|
|
198
|
+
this.primaryGhostText = derivedOpts({ owner: this, equalsFn: ghostTextOrReplacementEquals }, reader => {
|
|
212
199
|
const v = this.state.read(reader);
|
|
213
200
|
if (!v) {
|
|
214
201
|
return undefined;
|
|
@@ -230,6 +217,18 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
230
217
|
}
|
|
231
218
|
}));
|
|
232
219
|
}
|
|
220
|
+
_getReason(e) {
|
|
221
|
+
if (e?.isUndoing) {
|
|
222
|
+
return VersionIdChangeReason.Undo;
|
|
223
|
+
}
|
|
224
|
+
if (e?.isRedoing) {
|
|
225
|
+
return VersionIdChangeReason.Redo;
|
|
226
|
+
}
|
|
227
|
+
if (this.isAcceptingPartially) {
|
|
228
|
+
return VersionIdChangeReason.AcceptWord;
|
|
229
|
+
}
|
|
230
|
+
return VersionIdChangeReason.Other;
|
|
231
|
+
}
|
|
233
232
|
async trigger(tx) {
|
|
234
233
|
this._isActive.set(true, tx);
|
|
235
234
|
await this._fetchInlineCompletionsPromise.get();
|
|
@@ -286,6 +285,9 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
286
285
|
return;
|
|
287
286
|
}
|
|
288
287
|
const completion = state.inlineCompletion.toInlineCompletion(undefined);
|
|
288
|
+
if (completion.command) {
|
|
289
|
+
completion.source.addRef();
|
|
290
|
+
}
|
|
289
291
|
editor.pushUndoStop();
|
|
290
292
|
if (completion.snippetInfo) {
|
|
291
293
|
editor.executeEdits('inlineSuggestion.accept', [
|
|
@@ -304,13 +306,7 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
304
306
|
]);
|
|
305
307
|
editor.setSelections(selections, 'inlineCompletionAccept');
|
|
306
308
|
}
|
|
307
|
-
|
|
308
|
-
completion.source.addRef();
|
|
309
|
-
}
|
|
310
|
-
transaction(tx => {
|
|
311
|
-
this._source.clear(tx);
|
|
312
|
-
this._isActive.set(false, tx);
|
|
313
|
-
});
|
|
309
|
+
this.stop();
|
|
314
310
|
if (completion.command) {
|
|
315
311
|
await this._commandService
|
|
316
312
|
.executeCommand(completion.command.id, ...(completion.command.arguments || []))
|
|
@@ -400,9 +396,7 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
400
396
|
if (completion.source.provider.handlePartialAccept) {
|
|
401
397
|
const acceptedRange = Range.fromPositions(completion.range.getStartPosition(), TextLength.ofText(partialGhostTextVal).addToPosition(ghostTextPos));
|
|
402
398
|
const text = editor.getModel().getValueInRange(acceptedRange, EndOfLinePreference.LF);
|
|
403
|
-
completion.source.provider.handlePartialAccept(completion.source.inlineCompletions, completion.sourceInlineCompletion, text.length, {
|
|
404
|
-
kind,
|
|
405
|
-
});
|
|
399
|
+
completion.source.provider.handlePartialAccept(completion.source.inlineCompletions, completion.sourceInlineCompletion, text.length, { kind, });
|
|
406
400
|
}
|
|
407
401
|
}
|
|
408
402
|
finally {
|
|
@@ -426,6 +420,13 @@ InlineCompletionsModel = ( __decorate([
|
|
|
426
420
|
( __param(10, ICommandService)),
|
|
427
421
|
( __param(11, ILanguageConfigurationService))
|
|
428
422
|
], InlineCompletionsModel));
|
|
423
|
+
var VersionIdChangeReason;
|
|
424
|
+
( (function(VersionIdChangeReason) {
|
|
425
|
+
VersionIdChangeReason[VersionIdChangeReason["Undo"] = 0] = "Undo";
|
|
426
|
+
VersionIdChangeReason[VersionIdChangeReason["Redo"] = 1] = "Redo";
|
|
427
|
+
VersionIdChangeReason[VersionIdChangeReason["AcceptWord"] = 2] = "AcceptWord";
|
|
428
|
+
VersionIdChangeReason[VersionIdChangeReason["Other"] = 3] = "Other";
|
|
429
|
+
})(VersionIdChangeReason || (VersionIdChangeReason = {})));
|
|
429
430
|
function getSecondaryEdits(textModel, positions, primaryEdit) {
|
|
430
431
|
if (positions.length === 1) {
|
|
431
432
|
return [];
|
|
@@ -459,7 +460,7 @@ function substringPos(text, pos) {
|
|
|
459
460
|
return subtext;
|
|
460
461
|
}
|
|
461
462
|
function getEndPositionsAfterApplying(edits) {
|
|
462
|
-
const sortPerm = Permutation.createSortPermutation(edits, (
|
|
463
|
+
const sortPerm = Permutation.createSortPermutation(edits, compareBy(e => e.range, Range.compareRangesUsingStarts));
|
|
463
464
|
const edit = ( new TextEdit(sortPerm.apply(edits)));
|
|
464
465
|
const sortedNewRanges = edit.getNewRanges();
|
|
465
466
|
const newRanges = sortPerm.inverse().apply(sortedNewRanges);
|
|
@@ -48,12 +48,12 @@ let InlineCompletionsSource = class InlineCompletionsSource extends Disposable {
|
|
|
48
48
|
if (shouldDebounce) {
|
|
49
49
|
await wait(this._debounceValue.get(this.textModel), source.token);
|
|
50
50
|
}
|
|
51
|
-
if (source.token.isCancellationRequested || this.textModel.getVersionId() !== request.versionId) {
|
|
51
|
+
if (source.token.isCancellationRequested || this._store.isDisposed || this.textModel.getVersionId() !== request.versionId) {
|
|
52
52
|
return false;
|
|
53
53
|
}
|
|
54
54
|
const startTime = ( new Date());
|
|
55
55
|
const updatedCompletions = await provideInlineCompletions(this.languageFeaturesService.inlineCompletionsProvider, position, this.textModel, context, source.token, this.languageConfigurationService);
|
|
56
|
-
if (source.token.isCancellationRequested || this.textModel.getVersionId() !== request.versionId) {
|
|
56
|
+
if (source.token.isCancellationRequested || this._store.isDisposed || this.textModel.getVersionId() !== request.versionId) {
|
|
57
57
|
return false;
|
|
58
58
|
}
|
|
59
59
|
const endTime = ( new Date());
|
|
@@ -3,13 +3,14 @@ import { DeferredPromise } from '../../../../base/common/async.js';
|
|
|
3
3
|
import { CancellationToken } from '../../../../base/common/cancellation.js';
|
|
4
4
|
import { SetMap } from '../../../../base/common/map.js';
|
|
5
5
|
import { onUnexpectedExternalError } from '../../../../base/common/errors.js';
|
|
6
|
+
import { Position } from '../../../common/core/position.js';
|
|
6
7
|
import { Range } from '../../../common/core/range.js';
|
|
7
8
|
import { fixBracketsInLine } from '../../../common/model/bracketPairsTextModelPart/fixBrackets.js';
|
|
8
9
|
import { SingleTextEdit } from '../../../common/core/textEdit.js';
|
|
9
10
|
import { getReadonlyEmptyArray } from './utils.js';
|
|
10
11
|
import { SnippetParser, Text } from '../../snippet/browser/snippetParser.js';
|
|
11
|
-
async function provideInlineCompletions(registry,
|
|
12
|
-
const defaultReplaceRange = getDefaultRange(
|
|
12
|
+
async function provideInlineCompletions(registry, positionOrRange, model, context, token = CancellationToken.None, languageConfigurationService) {
|
|
13
|
+
const defaultReplaceRange = positionOrRange instanceof Position ? getDefaultRange(positionOrRange, model) : positionOrRange;
|
|
13
14
|
const providers = registry.all(model);
|
|
14
15
|
const multiMap = ( new SetMap());
|
|
15
16
|
for (const provider of providers) {
|
|
@@ -76,8 +77,14 @@ async function provideInlineCompletions(registry, position, model, context, toke
|
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
try {
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
if (positionOrRange instanceof Position) {
|
|
81
|
+
const completions = await provider.provideInlineCompletions(model, positionOrRange, context, token);
|
|
82
|
+
return completions;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
const completions = await provider.provideInlineEdits?.(model, positionOrRange, context, token);
|
|
86
|
+
return completions;
|
|
87
|
+
}
|
|
81
88
|
}
|
|
82
89
|
catch (e) {
|
|
83
90
|
onUnexpectedExternalError(e);
|
|
@@ -1,35 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { compareBy, numberComparator } from '../../../../base/common/arrays.js';
|
|
2
|
+
import { findFirstMax } from '../../../../base/common/arraysFind.js';
|
|
3
|
+
import { Emitter, Event } from '../../../../base/common/event.js';
|
|
2
4
|
import { Disposable } from '../../../../base/common/lifecycle.js';
|
|
3
5
|
import { Position } from '../../../common/core/position.js';
|
|
4
6
|
import { Range } from '../../../common/core/range.js';
|
|
7
|
+
import { SingleTextEdit } from '../../../common/core/textEdit.js';
|
|
5
8
|
import { CompletionItemInsertTextRule, SelectedSuggestionInfo } from '../../../common/languages.js';
|
|
9
|
+
import { singleTextRemoveCommonPrefix, singleTextEditAugments } from './singleTextEdit.js';
|
|
6
10
|
import { SnippetParser } from '../../snippet/browser/snippetParser.js';
|
|
7
11
|
import { SnippetSession } from '../../snippet/browser/snippetSession.js';
|
|
8
12
|
import { SuggestController } from '../../suggest/browser/suggestController.js';
|
|
9
|
-
import { observableValue, transaction } from '../../../../base/common/observableInternal/base.js';
|
|
10
|
-
import '../../../../base/common/observableInternal/derived.js';
|
|
11
|
-
import '../../../../base/common/observableInternal/autorun.js';
|
|
12
|
-
import '../../../../base/common/observableInternal/utils.js';
|
|
13
|
-
import '../../../../base/common/cancellation.js';
|
|
14
|
-
import { compareBy, numberComparator } from '../../../../base/common/arrays.js';
|
|
15
|
-
import { SingleTextEdit } from '../../../common/core/textEdit.js';
|
|
16
|
-
import { findFirstMax } from '../../../../base/common/arraysFind.js';
|
|
17
|
-
import { singleTextRemoveCommonPrefix, singleTextEditAugments } from './singleTextEdit.js';
|
|
18
13
|
class SuggestWidgetAdaptor extends Disposable {
|
|
19
14
|
get selectedItem() {
|
|
20
|
-
return this.
|
|
15
|
+
return this._currentSuggestItemInfo;
|
|
21
16
|
}
|
|
22
|
-
constructor(editor, suggestControllerPreselector,
|
|
17
|
+
constructor(editor, suggestControllerPreselector, onWillAccept) {
|
|
23
18
|
super();
|
|
24
19
|
this.editor = editor;
|
|
25
20
|
this.suggestControllerPreselector = suggestControllerPreselector;
|
|
26
|
-
this.checkModelVersion = checkModelVersion;
|
|
27
21
|
this.onWillAccept = onWillAccept;
|
|
28
22
|
this.isSuggestWidgetVisible = false;
|
|
29
23
|
this.isShiftKeyPressed = false;
|
|
30
24
|
this._isActive = false;
|
|
31
25
|
this._currentSuggestItemInfo = undefined;
|
|
32
|
-
this.
|
|
26
|
+
this._onDidSelectedItemChange = this._register(( new Emitter()));
|
|
27
|
+
this.onDidSelectedItemChange = this._onDidSelectedItemChange.event;
|
|
33
28
|
this._register(editor.onKeyDown(e => {
|
|
34
29
|
if (e.shiftKey && !this.isShiftKeyPressed) {
|
|
35
30
|
this.isShiftKeyPressed = true;
|
|
@@ -47,7 +42,6 @@ class SuggestWidgetAdaptor extends Disposable {
|
|
|
47
42
|
this._register(suggestController.registerSelector({
|
|
48
43
|
priority: 100,
|
|
49
44
|
select: (model, pos, suggestItems) => {
|
|
50
|
-
transaction(tx => this.checkModelVersion(tx));
|
|
51
45
|
const textModel = this.editor.getModel();
|
|
52
46
|
if (!textModel) {
|
|
53
47
|
return -1;
|
|
@@ -109,10 +103,7 @@ class SuggestWidgetAdaptor extends Disposable {
|
|
|
109
103
|
if (this._isActive !== newActive || !suggestItemInfoEquals(this._currentSuggestItemInfo, newInlineCompletion)) {
|
|
110
104
|
this._isActive = newActive;
|
|
111
105
|
this._currentSuggestItemInfo = newInlineCompletion;
|
|
112
|
-
|
|
113
|
-
this.checkModelVersion(tx);
|
|
114
|
-
this._selectedItem.set(this._isActive ? this._currentSuggestItemInfo : undefined, tx);
|
|
115
|
-
});
|
|
106
|
+
this._onDidSelectedItemChange.fire();
|
|
116
107
|
}
|
|
117
108
|
}
|
|
118
109
|
getSuggestItemInfo() {
|
|
@@ -23,7 +23,7 @@ let GhostTextWidget = class GhostTextWidget extends Disposable {
|
|
|
23
23
|
this.model = model;
|
|
24
24
|
this.languageService = languageService;
|
|
25
25
|
this.isDisposed = observableValue(this, false);
|
|
26
|
-
this.currentTextModel = observableFromEvent(this.editor.onDidChangeModel, () => this.editor.getModel());
|
|
26
|
+
this.currentTextModel = observableFromEvent(this, this.editor.onDidChangeModel, () => this.editor.getModel());
|
|
27
27
|
this.uiState = derived(this, reader => {
|
|
28
28
|
if (this.isDisposed.read(reader)) {
|
|
29
29
|
return undefined;
|