@codingame/monaco-vscode-api 4.5.2 → 5.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/api.js +1 -1
- package/extensions.d.ts +2 -3
- package/lifecycle.js +6 -0
- package/localExtensionHost.d.ts +4 -1
- package/missing-services.js +41 -25
- package/package.json +8 -8
- package/service-override/tools/editor.js +31 -8
- package/service-override/tools/views.d.ts +1 -1
- package/service-override/tools/views.js +2 -3
- package/service-override/views.d.ts +0 -1
- package/services.d.ts +3 -3
- package/services.js +3 -3
- package/vscode/src/vs/base/browser/markdownRenderer.js +9 -3
- package/vscode/src/vs/base/browser/ui/actionbar/actionViewItems.js +2 -2
- package/vscode/src/vs/base/browser/ui/button/button.js +3 -3
- package/vscode/src/vs/base/browser/ui/codicons/codicon/codicon.css.js +1 -1
- package/vscode/src/vs/base/browser/ui/contextview/contextview.js +1 -1
- package/vscode/src/vs/base/browser/ui/dropdown/dropdown.js +2 -2
- package/vscode/src/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +2 -2
- package/vscode/src/vs/base/browser/ui/highlightedlabel/highlightedLabel.js +2 -2
- package/vscode/src/vs/{platform/hover/browser → base/browser/ui/hover}/hover.d.ts +64 -4
- package/vscode/src/vs/base/browser/ui/hover/hoverDelegate.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/hover/hoverDelegate2.js +13 -0
- package/vscode/src/vs/base/browser/ui/hover/hoverWidget.css.js +1 -1
- package/vscode/src/vs/base/browser/ui/hover/hoverWidget.js +30 -14
- package/vscode/src/vs/base/browser/ui/iconLabel/iconLabel.js +15 -2
- package/vscode/src/vs/base/browser/ui/iconLabel/simpleIconLabel.js +2 -2
- package/vscode/src/vs/base/browser/ui/icons/iconSelectBox.css.js +4 -0
- package/vscode/src/vs/base/browser/ui/icons/iconSelectBox.js +239 -0
- package/vscode/src/vs/base/browser/ui/inputbox/inputBox.js +2 -2
- package/vscode/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.js +2 -2
- package/vscode/src/vs/base/browser/ui/list/listView.js +5 -3
- package/vscode/src/vs/base/browser/ui/list/listWidget.d.ts +33 -0
- package/vscode/src/vs/base/browser/ui/list/listWidget.js +4 -1
- package/vscode/src/vs/base/browser/ui/menu/menu.js +1 -0
- package/vscode/src/vs/base/browser/ui/menu/menubar.css.js +1 -1
- package/vscode/src/vs/base/browser/ui/progressbar/progressAccessibilitySignal.js +13 -0
- package/vscode/src/vs/base/browser/ui/progressbar/progressbar.js +7 -1
- package/vscode/src/vs/base/browser/ui/selectBox/selectBoxCustom.js +2 -2
- package/vscode/src/vs/base/browser/ui/table/tableWidget.js +2 -2
- package/vscode/src/vs/base/browser/ui/toggle/toggle.js +8 -2
- package/vscode/src/vs/base/browser/ui/toolbar/toolbar.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/tree/abstractTree.js +11 -4
- package/vscode/src/vs/base/browser/ui/tree/media/tree.css.js +1 -1
- package/vscode/src/vs/base/browser/ui/tree/objectTree.js +6 -4
- package/vscode/src/vs/base/common/arraysFind.js +7 -7
- package/vscode/src/vs/base/common/async.js +8 -3
- package/vscode/src/vs/base/common/cache.js +29 -10
- package/vscode/src/vs/base/common/cancellation.js +6 -1
- package/vscode/src/vs/base/common/codicons.d.ts +3 -0
- package/vscode/src/vs/base/common/codiconsLibrary.js +3 -0
- package/vscode/src/vs/base/common/controlFlow.js +48 -0
- package/vscode/src/vs/base/common/equals.js +44 -0
- package/vscode/src/vs/base/common/event.d.ts +11 -1
- package/vscode/src/vs/base/common/event.js +26 -1
- package/vscode/src/vs/base/common/jsonEdit.js +1 -1
- package/vscode/src/vs/base/common/lifecycle.js +1 -1
- package/vscode/src/vs/base/common/map.js +53 -4
- package/vscode/src/vs/base/common/network.js +2 -0
- package/vscode/src/vs/base/common/objects.js +3 -0
- package/vscode/src/vs/base/common/observableInternal/autorun.js +1 -10
- package/vscode/src/vs/base/common/observableInternal/base.js +22 -10
- package/vscode/src/vs/base/common/observableInternal/derived.js +8 -8
- package/vscode/src/vs/base/common/observableInternal/promise.js +19 -1
- package/vscode/src/vs/base/common/observableInternal/utils.js +30 -52
- package/vscode/src/vs/base/common/product.d.ts +1 -0
- package/vscode/src/vs/base/common/strings.js +1 -1
- package/vscode/src/vs/base/common/types.d.ts +5 -1
- package/vscode/src/vs/editor/browser/config/editorConfiguration.js +3 -2
- package/vscode/src/vs/editor/browser/observableUtilities.js +58 -0
- package/vscode/src/vs/editor/browser/services/hoverService/hoverService.js +121 -2
- package/vscode/src/vs/editor/browser/services/hoverService/updatableHoverWidget.js +80 -0
- package/vscode/src/vs/editor/browser/stableEditorScroll.js +37 -1
- package/vscode/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +10 -3
- package/vscode/src/vs/editor/browser/widget/codeEditor/editor.css.js +1 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorDecorations.js +1 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +7 -5
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorSash.js +1 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorOptions.js +1 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorViewModel.js +3 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +3 -10
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js +8 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +6 -6
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +1 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/overviewRulerFeature.js +1 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +1 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/utils/editorGutter.js +1 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/utils.js +1 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +3 -2
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorViewModel.js +17 -8
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidget.js +1 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +27 -19
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/style.css.js +1 -1
- package/vscode/src/vs/editor/common/core/editorColorRegistry.js +4 -4
- package/vscode/src/vs/editor/common/core/lineRange.d.ts +12 -0
- package/vscode/src/vs/editor/common/core/lineRange.js +28 -0
- package/vscode/src/vs/editor/common/core/textEdit.d.ts +21 -0
- package/vscode/src/vs/editor/common/core/textEdit.js +13 -1
- package/vscode/src/vs/editor/common/core/textLength.d.ts +29 -0
- package/vscode/src/vs/editor/common/core/textLength.js +6 -0
- package/vscode/src/vs/editor/common/cursor/cursorCollection.js +3 -3
- package/vscode/src/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js +11 -1
- package/vscode/src/vs/editor/common/diff/rangeMapping.d.ts +11 -0
- package/vscode/src/vs/editor/common/diff/rangeMapping.js +34 -3
- package/vscode/src/vs/editor/common/languages.d.ts +50 -10
- package/vscode/src/vs/editor/common/languages.js +11 -1
- package/vscode/src/vs/editor/common/services/languageFeatureDebounce.js +1 -1
- package/vscode/src/vs/editor/common/services/languageFeatures.d.ts +2 -2
- package/vscode/src/vs/editor/common/services/languageFeaturesService.js +1 -1
- package/vscode/src/vs/editor/common/standalone/standaloneEnums.js +11 -1
- package/vscode/src/vs/editor/common/viewModel/viewModelImpl.js +3 -0
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionController.js +22 -6
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionModel.js +5 -0
- package/vscode/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +1 -0
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorContributions.js +1 -1
- package/vscode/src/vs/editor/contrib/colorPicker/browser/standaloneColorPickerActions.js +20 -3
- package/vscode/src/vs/editor/contrib/colorPicker/browser/standaloneColorPickerWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/contextmenu/browser/contextmenu.js +2 -2
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +4 -4
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +2 -2
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +7 -0
- package/vscode/src/vs/editor/contrib/find/browser/findController.js +11 -6
- package/vscode/src/vs/editor/contrib/find/browser/findWidget.js +10 -10
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverComputer.js +74 -0
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverController.js +332 -0
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverStatusBar.js +34 -0
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverTypes.js +39 -0
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverWidget.js +355 -0
- package/vscode/src/vs/editor/contrib/hover/browser/getHover.js +11 -14
- package/vscode/src/vs/editor/contrib/hover/browser/hover.css.js +1 -1
- package/vscode/src/vs/editor/contrib/hover/browser/hoverActionIds.js +13 -0
- package/vscode/src/vs/editor/contrib/hover/browser/hoverActions.js +354 -0
- package/vscode/src/vs/editor/contrib/hover/browser/hoverContribution.js +42 -0
- package/vscode/src/vs/editor/contrib/hover/browser/hoverController.js +320 -0
- package/vscode/src/vs/editor/contrib/hover/browser/marginHoverComputer.js +48 -0
- package/vscode/src/vs/editor/contrib/hover/browser/{marginHover.js → marginHoverWidget.js} +14 -48
- package/vscode/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +250 -41
- package/vscode/src/vs/editor/contrib/hover/browser/markerHoverParticipant.js +1 -0
- package/vscode/src/vs/editor/contrib/indentation/browser/indentation.js +44 -20
- package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +11 -7
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/commands.js +1 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.js +1 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hoverParticipant.js +2 -3
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionContextKeys.js +1 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController.js +26 -13
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHintsWidget.js +5 -11
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel.js +24 -22
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsSource.js +39 -70
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/suggestWidgetInlineCompletionProvider.js +3 -3
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/utils.js +1 -0
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/ghostTextWidget.js +1 -0
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/hoverParticipant.js +1 -0
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/inlineEditController.js +4 -2
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/inlineEditHintsWidget.js +5 -3
- package/vscode/src/vs/editor/contrib/inlineProgress/browser/inlineProgressWidget.css.js +1 -1
- package/vscode/src/vs/editor/contrib/rename/browser/rename.js +18 -6
- package/vscode/src/vs/editor/contrib/rename/browser/renameWidget.css.js +1 -1
- package/vscode/src/vs/editor/contrib/rename/browser/renameWidget.js +165 -40
- package/vscode/src/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js +5 -0
- package/vscode/src/vs/editor/contrib/snippet/browser/snippetController2.js +3 -3
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +15 -8
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +13 -6
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.js +0 -2
- package/vscode/src/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +9 -2
- package/vscode/src/vs/editor/standalone/browser/standaloneCodeEditor.js +23 -18
- package/vscode/src/vs/editor/standalone/browser/standaloneServices.js +33 -11
- package/vscode/src/vs/platform/accessibility/common/accessibility.d.ts +1 -9
- package/vscode/src/vs/platform/accessibility/common/accessibility.js +2 -1
- package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.d.ts +15 -9
- package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +133 -132
- package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service.d.ts +12 -5
- package/vscode/src/vs/platform/accessibilitySignal/browser/progressAccessibilitySignalScheduler.js +25 -0
- package/vscode/src/vs/platform/actionWidget/browser/actionWidget.js +4 -4
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +10 -7
- package/vscode/src/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem.js +1 -1
- package/vscode/src/vs/platform/actions/browser/toolbar.d.ts +4 -1
- package/vscode/src/vs/platform/actions/browser/toolbar.js +53 -36
- package/vscode/src/vs/platform/actions/common/actions.d.ts +3 -1
- package/vscode/src/vs/platform/actions/common/actions.js +14 -4
- package/vscode/src/vs/platform/actions/common/menuService.js +30 -8
- package/vscode/src/vs/platform/configuration/common/configuration.js +4 -0
- package/vscode/src/vs/platform/configuration/common/configurationModels.js +43 -32
- package/vscode/src/vs/platform/configuration/common/configurations.js +12 -10
- package/vscode/src/vs/platform/contextview/browser/contextView.d.ts +4 -1
- package/vscode/src/vs/platform/contextview/browser/contextView.service.d.ts +2 -3
- package/vscode/src/vs/platform/contextview/browser/contextViewService.js +10 -8
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.d.ts +0 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +1 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionsScannerService.js +1 -0
- package/vscode/src/vs/platform/extensions/common/extensions.d.ts +5 -0
- package/vscode/src/vs/platform/files/common/files.d.ts +14 -1
- package/vscode/src/vs/platform/hover/browser/hover.service.d.ts +2 -31
- package/vscode/src/vs/platform/instantiation/common/instantiation.d.ts +9 -0
- package/vscode/src/vs/platform/instantiation/common/instantiationService.js +42 -8
- package/vscode/src/vs/platform/log/common/log.js +3 -1
- package/vscode/src/vs/platform/markers/common/markerService.js +7 -3
- package/vscode/src/vs/platform/opener/browser/link.js +6 -4
- package/vscode/src/vs/platform/quickinput/browser/quickInput.js +2 -2
- package/vscode/src/vs/platform/quickinput/browser/quickInputTree.js +15 -7
- package/vscode/src/vs/platform/telemetry/common/gdprTypings.d.ts +0 -1
- package/vscode/src/vs/platform/telemetry/common/telemetryUtils.js +1 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/capabilities.d.ts +5 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetection/promptInputModel.d.ts +30 -0
- package/vscode/src/vs/platform/theme/browser/defaultStyles.js +6 -0
- package/vscode/src/vs/platform/theme/browser/iconsStyleSheet.js +13 -11
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +28 -28
- package/vscode/src/vs/workbench/api/common/extHost.protocol.js +2 -6
- package/vscode/src/vs/workbench/api/common/extHostBulkEdits.js +2 -1
- package/vscode/src/vs/workbench/api/common/extHostChatAgents2.js +104 -96
- package/vscode/src/vs/workbench/api/common/extHostChatVariables.js +4 -4
- package/vscode/src/vs/workbench/api/common/extHostConfiguration.js +9 -3
- package/vscode/src/vs/workbench/api/common/extHostDebugService.js +3 -3
- package/vscode/src/vs/workbench/api/common/extHostDocumentSaveParticipant.js +2 -1
- package/vscode/src/vs/workbench/api/common/extHostEditorTabs.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostFileSystemEventService.js +19 -1
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +87 -17
- package/vscode/src/vs/workbench/api/common/extHostLanguageModels.js +39 -2
- package/vscode/src/vs/workbench/api/common/extHostNotebookDocumentSaveParticipant.js +2 -1
- package/vscode/src/vs/workbench/api/common/extHostTerminalShellIntegration.js +52 -36
- package/vscode/src/vs/workbench/api/common/extHostTesting.js +10 -28
- package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +6 -1
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +132 -136
- package/vscode/src/vs/workbench/api/common/extHostTypes.js +72 -18
- package/vscode/src/vs/workbench/api/common/extHostWindow.js +3 -5
- package/vscode/src/vs/workbench/browser/actions/layoutActions.js +86 -76
- package/vscode/src/vs/workbench/browser/actions/media/actions.css.js +1 -1
- package/vscode/src/vs/workbench/browser/actions/widgetNavigationCommands.js +30 -6
- package/vscode/src/vs/workbench/browser/labels.js +4 -1
- package/vscode/src/vs/workbench/browser/parts/compositePart.d.ts +3 -1
- package/vscode/src/vs/workbench/browser/parts/editor/diffEditorCommands.js +19 -7
- package/vscode/src/vs/workbench/browser/parts/editor/editorGroupView.js +16 -3
- package/vscode/src/vs/workbench/browser/parts/editor/media/editorquickaccess.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/media/multieditortabscontrol.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.js +14 -33
- package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +33 -13
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.js +7 -5
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.d.ts +4 -3
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.d.ts +2 -1
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.d.ts +3 -1
- package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +3 -3
- package/vscode/src/vs/workbench/browser/parts/views/media/views.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/views/treeView.js +182 -63
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.d.ts +14 -3
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +61 -34
- package/vscode/src/vs/workbench/browser/workbench.contribution.js +16 -10
- package/vscode/src/vs/workbench/common/theme.js +144 -98
- package/vscode/src/vs/workbench/common/views.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +190 -138
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleView.js +876 -0
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewActions.js +59 -7
- package/vscode/src/vs/workbench/contrib/accessibility/browser/{accessibilityContributions.js → accessibleViewContributions.js} +160 -6
- package/vscode/src/vs/workbench/contrib/accessibility/browser/editorAccessibilityHelp.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +66 -150
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +75 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +21 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.js +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAgentHover.js +101 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorInput.js +6 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +30 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +201 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +42 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +13 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +366 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +35 -2
- 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 +4 -0
- package/vscode/src/vs/workbench/contrib/chat/common/annotations.js +4 -9
- package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.js +95 -5
- package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.service.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatColors.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +11 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +94 -79
- package/vscode/src/vs/workbench/contrib/chat/common/chatParserTypes.js +0 -13
- package/vscode/src/vs/workbench/contrib/chat/common/chatParticipantContribTypes.js +2 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatViewModel.js +7 -9
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelStats.service.js +3 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/dictation/editorDictation.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +1 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +4 -4
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +30 -26
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +30 -29
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +4 -4
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +5 -4
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +13 -13
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +26 -16
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +107 -26
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/simpleCommentEditor.js +23 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +2 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +39 -11
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +53 -33
- package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +967 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSessionPicker.js +101 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debug.js +4 -1
- package/vscode/src/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +82 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +10 -9
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +79 -45
- package/vscode/src/vs/workbench/contrib/files/browser/{fileCommands.save.js → fileCommands._save.js} +4 -4
- package/vscode/src/vs/workbench/contrib/files/browser/{files.configuration.contribution.js → files.contribution._configuration.js} +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/{files.editorPane.contribution.js → files.contribution._editorPane.js} +18 -18
- package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +5 -3
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerView.js +19 -14
- package/vscode/src/vs/workbench/contrib/files/browser/views/media/openeditors.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +8 -8
- package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +15 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +29 -112
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatContentWidget.js +10 -7
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +99 -91
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +9 -31
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +345 -104
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +62 -69
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +63 -46
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +18 -10
- 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/browser/utils.js +1 -31
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +7 -3
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +5 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +1 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +1 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +1 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +4 -4
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +2 -48
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput.js +28 -23
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.js +5 -9
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver.js +112 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +18 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +7 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.js +4 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +8 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.js +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +36 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +9 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +17 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.js +6 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +5 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +2 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.js +2 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +22 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +34 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +15 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.js +6 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProviderFactory.service.js +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +17 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +2 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.js +52 -16
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +3 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookContextKeys.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +25 -12
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.js +6 -4
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +0 -2
- package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +6 -4
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +24 -2
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +38 -8
- package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +0 -1
- package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +1 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.d.ts +7 -14
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.service.d.ts +24 -6
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.service.js +2 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +8 -9
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm-private.d.ts +2 -20
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +2 -2
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +1 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testItemCollection.js +10 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +15 -3
- package/vscode/src/vs/workbench/services/accessibility/common/accessibleViewInformationService.service.d.ts +9 -0
- package/vscode/src/vs/workbench/services/accessibility/common/accessibleViewInformationService.service.js +3 -0
- package/vscode/src/vs/workbench/services/editor/common/customEditorLabelService.js +30 -16
- package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.d.ts +15 -4
- package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.service.d.ts +20 -1
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.service.d.ts +0 -1
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +4 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManagers.d.ts +4 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocation.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensions.d.ts +8 -2
- package/vscode/src/vs/workbench/services/extensions/common/extensions.js +2 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensions.service.d.ts +4 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsApiProposals.js +3 -3
- package/vscode/src/vs/workbench/services/language/common/languageService.js +23 -18
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +6 -4
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +50 -9
- package/vscode/src/vs/workbench/services/themes/common/workbenchThemeService.js +1 -0
- package/vscode/src/vs/workbench/services/userDataProfile/browser/iconSelectBox.js +97 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopy.d.ts +7 -2
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.js +2 -2
- package/vscode-dts/vscode.proposed.chatParticipant.d.ts +23 -45
- package/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts +65 -91
- package/vscode-dts/vscode.proposed.chatProvider.d.ts +9 -0
- package/vscode-dts/vscode.proposed.chatTab.d.ts +1 -5
- package/vscode-dts/vscode.proposed.contribAccessibilityHelpContent.d.ts +15 -0
- package/vscode-dts/vscode.proposed.debugFocus.d.ts +4 -4
- package/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts +2 -2
- package/vscode-dts/vscode.proposed.documentPaste.d.ts +144 -43
- package/vscode-dts/vscode.proposed.editorHoverVerbosityLevel.d.ts +76 -0
- package/vscode-dts/vscode.proposed.interactive.d.ts +1 -17
- package/vscode-dts/vscode.proposed.languageModels.d.ts +56 -11
- package/vscode-dts/vscode.proposed.newSymbolNamesProvider.d.ts +12 -1
- package/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts +4 -4
- package/vscode-dts/vscode.proposed.speech.d.ts +2 -1
- package/vscode-dts/vscode.proposed.terminalShellIntegration.d.ts +144 -38
- package/vscode-dts/vscode.proposed.testPreserveFocus.d.ts +28 -0
- package/vscode/src/vs/base/browser/ui/hover/updatableHoverWidget.d.ts +0 -21
- package/vscode/src/vs/base/browser/ui/hover/updatableHoverWidget.js +0 -214
- package/vscode/src/vs/editor/browser/services/hoverService/hoverService.d.ts +0 -32
- package/vscode/src/vs/editor/contrib/hover/browser/contentHover.js +0 -838
- package/vscode/src/vs/editor/contrib/hover/browser/hover.js +0 -621
- package/vscode/src/vs/platform/accessibility/common/accessibility.service.d.ts +0 -19
- package/vscode/src/vs/workbench/api/common/extHostChat.js +0 -54
- package/vscode/src/vs/workbench/api/common/extHostIssueReporter.js +0 -70
- package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/accessibilitySignal.contribution.js +0 -237
- package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/accessibilitySignalDebuggerContribution.js +0 -49
- package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/accessibilitySignalLineFeatureContribution.js +0 -178
- package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/commands.js +0 -141
- package/vscode/src/vs/workbench/contrib/chat/common/chatContributionService.service.js +0 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatFileCreationWidget.js +0 -212
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/OutlineEntry.js +0 -95
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +0 -110
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProvider.js +0 -224
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.d.ts +0 -48
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEvents.js +0 -47
- package/vscode-dts/vscode.proposed.dropMetadata.d.ts +0 -65
- package/vscode-dts/vscode.proposed.handleIssueUri.d.ts +0 -57
- package/vscode-dts/vscode.proposed.windowActivity.d.ts +0 -17
- /package/vscode/src/vs/workbench/browser/parts/editor/{editor.autosave.contribution.js → editor.contribution._autosave.js} +0 -0
- /package/vscode/src/vs/workbench/contrib/files/browser/{files.fileEditorFactory.contribution.js → files.contribution._fileEditorFactory.js} +0 -0
package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { createStyleSheet2 } from '../../../../base/browser/dom.js';
|
|
3
3
|
import { alert } from '../../../../base/browser/ui/aria/aria.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { timeout } from '../../../../base/common/async.js';
|
|
5
|
+
import { cancelOnDispose } from '../../../../base/common/cancellation.js';
|
|
6
|
+
import { itemsEquals, itemEquals } from '../../../../base/common/equals.js';
|
|
7
|
+
import { Disposable, toDisposable, DisposableStore } from '../../../../base/common/lifecycle.js';
|
|
8
|
+
import { disposableObservableValue, observableValue, observableValueOpts, transaction } from '../../../../base/common/observableInternal/base.js';
|
|
6
9
|
import { derived } from '../../../../base/common/observableInternal/derived.js';
|
|
7
10
|
import { autorun, autorunHandleChanges } from '../../../../base/common/observableInternal/autorun.js';
|
|
8
11
|
import { observableFromEvent, mapObservableArrayCached, observableSignal, constObservable } from '../../../../base/common/observableInternal/utils.js';
|
|
9
|
-
import '../../../../base/common/
|
|
12
|
+
import { waitForState } from '../../../../base/common/observableInternal/promise.js';
|
|
13
|
+
import { isUndefined } from '../../../../base/common/types.js';
|
|
10
14
|
import { CoreEditingCommands } from '../../../browser/coreCommands.js';
|
|
11
15
|
import { Position } from '../../../common/core/position.js';
|
|
12
16
|
import { ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';
|
|
@@ -18,6 +22,7 @@ import { InlineSuggestionHintsContentWidget, InlineCompletionsHintsWidget } from
|
|
|
18
22
|
import { VersionIdChangeReason, InlineCompletionsModel } from './inlineCompletionsModel.js';
|
|
19
23
|
import { SuggestWidgetAdaptor } from './suggestWidgetInlineCompletionProvider.js';
|
|
20
24
|
import { localizeWithPath } from '../../../../nls.js';
|
|
25
|
+
import { IAccessibilityService } from '../../../../platform/accessibility/common/accessibility.service.js';
|
|
21
26
|
import { AccessibilitySignal } from '../../../../platform/accessibilitySignal/browser/accessibilitySignalService.js';
|
|
22
27
|
import { IAccessibilitySignalService } from '../../../../platform/accessibilitySignal/browser/accessibilitySignalService.service.js';
|
|
23
28
|
import { ICommandService } from '../../../../platform/commands/common/commands.service.js';
|
|
@@ -33,7 +38,7 @@ let InlineCompletionsController = class InlineCompletionsController extends Disp
|
|
|
33
38
|
static get(editor) {
|
|
34
39
|
return editor.getContribution(InlineCompletionsController_1.ID);
|
|
35
40
|
}
|
|
36
|
-
constructor(editor, _instantiationService, _contextKeyService, _configurationService, _commandService, _debounceService, _languageFeaturesService, _accessibilitySignalService, _keybindingService) {
|
|
41
|
+
constructor(editor, _instantiationService, _contextKeyService, _configurationService, _commandService, _debounceService, _languageFeaturesService, _accessibilitySignalService, _keybindingService, _accessibilityService) {
|
|
37
42
|
super();
|
|
38
43
|
this.editor = editor;
|
|
39
44
|
this._instantiationService = _instantiationService;
|
|
@@ -44,9 +49,10 @@ let InlineCompletionsController = class InlineCompletionsController extends Disp
|
|
|
44
49
|
this._languageFeaturesService = _languageFeaturesService;
|
|
45
50
|
this._accessibilitySignalService = _accessibilitySignalService;
|
|
46
51
|
this._keybindingService = _keybindingService;
|
|
52
|
+
this._accessibilityService = _accessibilityService;
|
|
47
53
|
this.model = this._register(disposableObservableValue('inlineCompletionModel', undefined));
|
|
48
54
|
this._textModelVersionId = observableValue(this, -1);
|
|
49
|
-
this._positions =
|
|
55
|
+
this._positions = observableValueOpts({ owner: this, equalsFn: itemsEquals(itemEquals()) }, [( (new Position(1, 1)))]);
|
|
50
56
|
this._suggestWidgetAdaptor = this._register(( (new SuggestWidgetAdaptor(
|
|
51
57
|
this.editor,
|
|
52
58
|
() => this.model.get()?.selectedInlineCompletion.get()?.toSingleTextEdit(undefined),
|
|
@@ -58,7 +64,10 @@ let InlineCompletionsController = class InlineCompletionsController extends Disp
|
|
|
58
64
|
});
|
|
59
65
|
}
|
|
60
66
|
))));
|
|
61
|
-
this.
|
|
67
|
+
this._enabledInConfig = observableFromEvent(this.editor.onDidChangeConfiguration, () => this.editor.getOption(62 ).enabled);
|
|
68
|
+
this._isScreenReaderEnabled = observableFromEvent(this._accessibilityService.onDidChangeScreenReaderOptimized, () => this._accessibilityService.isScreenReaderOptimized());
|
|
69
|
+
this._editorDictationInProgress = observableFromEvent(this._contextKeyService.onDidChangeContext, () => this._contextKeyService.getContext(this.editor.getDomNode()).getValue('editorDictation.inProgress') === true);
|
|
70
|
+
this._enabled = derived(this, reader => this._enabledInConfig.read(reader) && (!this._isScreenReaderEnabled.read(reader) || !this._editorDictationInProgress.read(reader)));
|
|
62
71
|
this._fontFamily = observableFromEvent(this.editor.onDidChangeConfiguration, () => this.editor.getOption(62 ).fontFamily);
|
|
63
72
|
this._ghostTexts = derived(this, (reader) => {
|
|
64
73
|
const model = this.model.read(reader);
|
|
@@ -165,6 +174,7 @@ let InlineCompletionsController = class InlineCompletionsController extends Disp
|
|
|
165
174
|
this._register(toDisposable(() => {
|
|
166
175
|
this._suggestWidgetAdaptor.stopForceRenderingAbove();
|
|
167
176
|
}));
|
|
177
|
+
const cancellationStore = this._register(( (new DisposableStore())));
|
|
168
178
|
let lastInlineCompletionId = undefined;
|
|
169
179
|
this._register(autorunHandleChanges({
|
|
170
180
|
handleChange: (context, changeSummary) => {
|
|
@@ -173,7 +183,7 @@ let InlineCompletionsController = class InlineCompletionsController extends Disp
|
|
|
173
183
|
}
|
|
174
184
|
return true;
|
|
175
185
|
},
|
|
176
|
-
}, async (reader) => {
|
|
186
|
+
}, async (reader, _) => {
|
|
177
187
|
this._playAccessibilitySignal.read(reader);
|
|
178
188
|
const model = this.model.read(reader);
|
|
179
189
|
const state = model?.state.read(reader);
|
|
@@ -182,13 +192,15 @@ let InlineCompletionsController = class InlineCompletionsController extends Disp
|
|
|
182
192
|
return;
|
|
183
193
|
}
|
|
184
194
|
if (state.inlineCompletion.semanticId !== lastInlineCompletionId) {
|
|
195
|
+
cancellationStore.clear();
|
|
185
196
|
lastInlineCompletionId = state.inlineCompletion.semanticId;
|
|
186
197
|
const lineText = model.textModel.getLineContent(state.primaryGhostText.lineNumber);
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
198
|
+
await timeout(50, cancelOnDispose(cancellationStore));
|
|
199
|
+
await waitForState(this._suggestWidgetAdaptor.selectedItem, isUndefined, () => false, cancelOnDispose(cancellationStore));
|
|
200
|
+
await this._accessibilitySignalService.playSignal(AccessibilitySignal.inlineSuggestion);
|
|
201
|
+
if (this.editor.getOption(8 )) {
|
|
202
|
+
this.provideScreenReaderUpdate(state.primaryGhostText.renderForScreenReader(lineText));
|
|
203
|
+
}
|
|
192
204
|
}
|
|
193
205
|
}));
|
|
194
206
|
this._register(( (new InlineCompletionsHintsWidget(this.editor, this.model, this._instantiationService))));
|
|
@@ -249,7 +261,8 @@ InlineCompletionsController = InlineCompletionsController_1 = ( (__decorate([
|
|
|
249
261
|
( (__param(5, ILanguageFeatureDebounceService))),
|
|
250
262
|
( (__param(6, ILanguageFeaturesService))),
|
|
251
263
|
( (__param(7, IAccessibilitySignalService))),
|
|
252
|
-
( (__param(8, IKeybindingService)))
|
|
264
|
+
( (__param(8, IKeybindingService))),
|
|
265
|
+
( (__param(9, IAccessibilityService)))
|
|
253
266
|
], InlineCompletionsController)));
|
|
254
267
|
function convertItemsToStableObservables(items, store) {
|
|
255
268
|
const result = observableValue('result', []);
|
package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHintsWidget.js
CHANGED
|
@@ -61,9 +61,7 @@ let InlineCompletionsHintsWidget = class InlineCompletionsHintsWidget extends Di
|
|
|
61
61
|
if (!model || !this.alwaysShowToolbar.read(reader)) {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
-
const contentWidget = store.add(this.instantiationService.createInstance(InlineSuggestionHintsContentWidget, this.editor, true, this.position, model.selectedInlineCompletionIndex, model.inlineCompletionsCount,
|
|
65
|
-
v => v?.inlineCompletion.source.inlineCompletions.commands ?? []
|
|
66
|
-
)))));
|
|
64
|
+
const contentWidget = store.add(this.instantiationService.createInstance(InlineSuggestionHintsContentWidget, this.editor, true, this.position, model.selectedInlineCompletionIndex, model.inlineCompletionsCount, model.activeCommands));
|
|
67
65
|
editor.addContentWidget(contentWidget);
|
|
68
66
|
store.add(toDisposable(() => editor.removeContentWidget(contentWidget)));
|
|
69
67
|
store.add(autorun(reader => {
|
|
@@ -132,7 +130,6 @@ let InlineSuggestionHintsContentWidget = class InlineSuggestionHintsContentWidge
|
|
|
132
130
|
this.disableButtonsDebounced = this._register(( (new RunOnceScheduler(() => {
|
|
133
131
|
this.previousAction.enabled = this.nextAction.enabled = false;
|
|
134
132
|
}, 100))));
|
|
135
|
-
this.lastCommands = [];
|
|
136
133
|
this.toolBar = this._register(instantiationService.createInstance(CustomizedMenuWorkbenchToolBar, this.nodes.toolBar, MenuId.InlineSuggestionToolbar, {
|
|
137
134
|
menuOptions: { renderShortTitle: true },
|
|
138
135
|
toolbarOptions: { primaryGroup: g => g.startsWith('primary') },
|
|
@@ -181,10 +178,6 @@ let InlineSuggestionHintsContentWidget = class InlineSuggestionHintsContentWidge
|
|
|
181
178
|
}));
|
|
182
179
|
this._register(autorun(reader => {
|
|
183
180
|
const extraCommands = this._extraCommands.read(reader);
|
|
184
|
-
if (equals(this.lastCommands, extraCommands)) {
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
this.lastCommands = extraCommands;
|
|
188
181
|
const extraActions = ( (extraCommands.map(c => ({
|
|
189
182
|
class: undefined,
|
|
190
183
|
id: c.id,
|
|
@@ -263,8 +256,8 @@ class StatusBarViewItem extends MenuEntryActionViewItem {
|
|
|
263
256
|
}
|
|
264
257
|
}
|
|
265
258
|
let CustomizedMenuWorkbenchToolBar = class CustomizedMenuWorkbenchToolBar extends WorkbenchToolBar {
|
|
266
|
-
constructor(container, menuId, options2, menuService, contextKeyService, contextMenuService, keybindingService, telemetryService) {
|
|
267
|
-
super(container, { resetMenu: menuId, ...options2 }, menuService, contextKeyService, contextMenuService, keybindingService, telemetryService);
|
|
259
|
+
constructor(container, menuId, options2, menuService, contextKeyService, contextMenuService, keybindingService, commandService, telemetryService) {
|
|
260
|
+
super(container, { resetMenu: menuId, ...options2 }, menuService, contextKeyService, contextMenuService, keybindingService, commandService, telemetryService);
|
|
268
261
|
this.menuId = menuId;
|
|
269
262
|
this.options2 = options2;
|
|
270
263
|
this.menuService = menuService;
|
|
@@ -303,6 +296,7 @@ CustomizedMenuWorkbenchToolBar = ( (__decorate([
|
|
|
303
296
|
( (__param(4, IContextKeyService))),
|
|
304
297
|
( (__param(5, IContextMenuService))),
|
|
305
298
|
( (__param(6, IKeybindingService))),
|
|
306
|
-
( (__param(7,
|
|
299
|
+
( (__param(7, ICommandService))),
|
|
300
|
+
( (__param(8, ITelemetryService)))
|
|
307
301
|
], CustomizedMenuWorkbenchToolBar)));
|
|
308
302
|
export { CustomizedMenuWorkbenchToolBar, InlineCompletionsHintsWidget, InlineSuggestionHintsContentWidget };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { Permutation } from '../../../../base/common/arrays.js';
|
|
3
3
|
import { mapFindFirst } from '../../../../base/common/arraysFind.js';
|
|
4
|
+
import { itemsEquals } from '../../../../base/common/equals.js';
|
|
4
5
|
import { BugIndicatingError, onUnexpectedExternalError, onUnexpectedError } from '../../../../base/common/errors.js';
|
|
5
6
|
import { Disposable } from '../../../../base/common/lifecycle.js';
|
|
6
7
|
import { observableValue, subtransaction, transaction } from '../../../../base/common/observableInternal/base.js';
|
|
@@ -14,17 +15,17 @@ import { EditOperation } from '../../../common/core/editOperation.js';
|
|
|
14
15
|
import { Position } from '../../../common/core/position.js';
|
|
15
16
|
import { Range } from '../../../common/core/range.js';
|
|
16
17
|
import { Selection } from '../../../common/core/selection.js';
|
|
18
|
+
import { SingleTextEdit, TextEdit } from '../../../common/core/textEdit.js';
|
|
19
|
+
import { TextLength } from '../../../common/core/textLength.js';
|
|
17
20
|
import { InlineCompletionTriggerKind } from '../../../common/languages.js';
|
|
18
21
|
import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js';
|
|
19
22
|
import { GhostText, ghostTextsOrReplacementsEqual, ghostTextOrReplacementEquals } from './ghostText.js';
|
|
20
23
|
import { InlineCompletionsSource } from './inlineCompletionsSource.js';
|
|
21
|
-
import {
|
|
24
|
+
import { singleTextRemoveCommonPrefix, computeGhostText, singleTextEditAugments } from './singleTextEdit.js';
|
|
22
25
|
import { subtractPositions, addPositions } from './utils.js';
|
|
23
26
|
import { SnippetController2 } from '../../snippet/browser/snippetController2.js';
|
|
24
27
|
import { ICommandService } from '../../../../platform/commands/common/commands.service.js';
|
|
25
28
|
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
|
|
26
|
-
import { singleTextRemoveCommonPrefix, computeGhostText, singleTextEditAugments } from './singleTextEdit.js';
|
|
27
|
-
import { TextLength } from '../../../common/core/textLength.js';
|
|
28
29
|
var VersionIdChangeReason;
|
|
29
30
|
( (function(VersionIdChangeReason) {
|
|
30
31
|
VersionIdChangeReason[VersionIdChangeReason["Undo"] = 0] = "Undo";
|
|
@@ -50,7 +51,7 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
50
51
|
this._languageConfigurationService = _languageConfigurationService;
|
|
51
52
|
this._source = this._register(this._instantiationService.createInstance(InlineCompletionsSource, this.textModel, this.textModelVersionId, this._debounceValue));
|
|
52
53
|
this._isActive = observableValue(this, false);
|
|
53
|
-
this.
|
|
54
|
+
this._forceUpdateExplicitlySignal = observableSignal(this);
|
|
54
55
|
this._selectedInlineCompletionId = observableValue(this, undefined);
|
|
55
56
|
this._primaryPosition = derived(this, reader => this._positions.read(reader)[0] ?? ( new Position(1, 1)));
|
|
56
57
|
this._isAcceptingPartially = false;
|
|
@@ -59,7 +60,7 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
59
60
|
VersionIdChangeReason.Undo,
|
|
60
61
|
VersionIdChangeReason.AcceptWord,
|
|
61
62
|
]));
|
|
62
|
-
this.
|
|
63
|
+
this._fetchInlineCompletionsPromise = derivedHandleChanges({
|
|
63
64
|
owner: this,
|
|
64
65
|
createEmptyChangeSummary: () => ({
|
|
65
66
|
preserveCurrentCompletion: false,
|
|
@@ -69,22 +70,19 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
69
70
|
if (ctx.didChange(this.textModelVersionId) && ( this._preserveCurrentCompletionReasons.has(ctx.change))) {
|
|
70
71
|
changeSummary.preserveCurrentCompletion = true;
|
|
71
72
|
}
|
|
72
|
-
else if (ctx.didChange(this.
|
|
73
|
-
changeSummary.inlineCompletionTriggerKind =
|
|
73
|
+
else if (ctx.didChange(this._forceUpdateExplicitlySignal)) {
|
|
74
|
+
changeSummary.inlineCompletionTriggerKind = InlineCompletionTriggerKind.Explicit;
|
|
74
75
|
}
|
|
75
76
|
return true;
|
|
76
77
|
},
|
|
77
78
|
}, (reader, changeSummary) => {
|
|
78
|
-
this.
|
|
79
|
+
this._forceUpdateExplicitlySignal.read(reader);
|
|
79
80
|
const shouldUpdate = (this._enabled.read(reader) && this.selectedSuggestItem.read(reader)) || this._isActive.read(reader);
|
|
80
81
|
if (!shouldUpdate) {
|
|
81
82
|
this._source.cancelUpdate();
|
|
82
83
|
return undefined;
|
|
83
84
|
}
|
|
84
85
|
this.textModelVersionId.read(reader);
|
|
85
|
-
const itemToPreserveCandidate = this.selectedInlineCompletion.get();
|
|
86
|
-
const itemToPreserve = changeSummary.preserveCurrentCompletion || itemToPreserveCandidate?.forwardStable
|
|
87
|
-
? itemToPreserveCandidate : undefined;
|
|
88
86
|
const suggestWidgetInlineCompletions = this._source.suggestWidgetInlineCompletions.get();
|
|
89
87
|
const suggestItem = this.selectedSuggestItem.read(reader);
|
|
90
88
|
if (suggestWidgetInlineCompletions && !suggestItem) {
|
|
@@ -101,9 +99,12 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
101
99
|
triggerKind: changeSummary.inlineCompletionTriggerKind,
|
|
102
100
|
selectedSuggestionInfo: suggestItem?.toSelectedSuggestionInfo(),
|
|
103
101
|
};
|
|
102
|
+
const itemToPreserveCandidate = this.selectedInlineCompletion.get();
|
|
103
|
+
const itemToPreserve = changeSummary.preserveCurrentCompletion || itemToPreserveCandidate?.forwardStable
|
|
104
|
+
? itemToPreserveCandidate : undefined;
|
|
104
105
|
return this._source.fetch(cursorPosition, context, itemToPreserve);
|
|
105
106
|
});
|
|
106
|
-
this._filteredInlineCompletionItems =
|
|
107
|
+
this._filteredInlineCompletionItems = derivedOpts({ owner: this, equalsFn: itemsEquals() }, reader => {
|
|
107
108
|
const c = this._source.inlineCompletions.read(reader);
|
|
108
109
|
if (!c) {
|
|
109
110
|
return [];
|
|
@@ -128,6 +129,7 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
128
129
|
const idx = this.selectedInlineCompletionIndex.read(reader);
|
|
129
130
|
return filteredCompletions[idx];
|
|
130
131
|
});
|
|
132
|
+
this.activeCommands = derivedOpts({ owner: this, equalsFn: itemsEquals() }, r => this.selectedInlineCompletion.read(r)?.inlineCompletion.source.inlineCompletions.commands ?? []);
|
|
131
133
|
this.lastTriggerKind = ( this._source.inlineCompletions.map(this, v => v?.request.context.triggerKind));
|
|
132
134
|
this.inlineCompletionsCount = derived(this, reader => {
|
|
133
135
|
if (this.lastTriggerKind.read(reader) === InlineCompletionTriggerKind.Explicit) {
|
|
@@ -139,7 +141,7 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
139
141
|
});
|
|
140
142
|
this.state = derivedOpts({
|
|
141
143
|
owner: this,
|
|
142
|
-
|
|
144
|
+
equalsFn: (a, b) => {
|
|
143
145
|
if (!a || !b) {
|
|
144
146
|
return a === b;
|
|
145
147
|
}
|
|
@@ -193,7 +195,7 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
193
195
|
});
|
|
194
196
|
this.ghostTexts = derivedOpts({
|
|
195
197
|
owner: this,
|
|
196
|
-
|
|
198
|
+
equalsFn: ghostTextsOrReplacementsEqual
|
|
197
199
|
}, reader => {
|
|
198
200
|
const v = this.state.read(reader);
|
|
199
201
|
if (!v) {
|
|
@@ -203,7 +205,7 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
203
205
|
});
|
|
204
206
|
this.primaryGhostText = derivedOpts({
|
|
205
207
|
owner: this,
|
|
206
|
-
|
|
208
|
+
equalsFn: ghostTextOrReplacementEquals
|
|
207
209
|
}, reader => {
|
|
208
210
|
const v = this.state.read(reader);
|
|
209
211
|
if (!v) {
|
|
@@ -211,7 +213,7 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
211
213
|
}
|
|
212
214
|
return v?.primaryGhostText;
|
|
213
215
|
});
|
|
214
|
-
this._register(recomputeInitiallyAndOnChange(this.
|
|
216
|
+
this._register(recomputeInitiallyAndOnChange(this._fetchInlineCompletionsPromise));
|
|
215
217
|
let lastItem = undefined;
|
|
216
218
|
this._register(autorun(reader => {
|
|
217
219
|
const item = this.state.read(reader);
|
|
@@ -228,14 +230,14 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
228
230
|
}
|
|
229
231
|
async trigger(tx) {
|
|
230
232
|
this._isActive.set(true, tx);
|
|
231
|
-
await this.
|
|
233
|
+
await this._fetchInlineCompletionsPromise.get();
|
|
232
234
|
}
|
|
233
235
|
async triggerExplicitly(tx) {
|
|
234
236
|
subtransaction(tx, tx => {
|
|
235
237
|
this._isActive.set(true, tx);
|
|
236
|
-
this.
|
|
238
|
+
this._forceUpdateExplicitlySignal.trigger(tx);
|
|
237
239
|
});
|
|
238
|
-
await this.
|
|
240
|
+
await this._fetchInlineCompletionsPromise.get();
|
|
239
241
|
}
|
|
240
242
|
stop(tx) {
|
|
241
243
|
subtransaction(tx, tx => {
|
|
@@ -285,7 +287,7 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
285
287
|
editor.pushUndoStop();
|
|
286
288
|
if (completion.snippetInfo) {
|
|
287
289
|
editor.executeEdits('inlineSuggestion.accept', [
|
|
288
|
-
EditOperation.
|
|
290
|
+
EditOperation.replace(completion.range, ''),
|
|
289
291
|
...completion.additionalTextEdits
|
|
290
292
|
]);
|
|
291
293
|
editor.setPosition(completion.snippetInfo.range.getStartPosition(), 'inlineCompletionAccept');
|
|
@@ -295,7 +297,7 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
295
297
|
const edits = state.edits;
|
|
296
298
|
const selections = ( getEndPositionsAfterApplying(edits).map(p => Selection.fromPositions(p)));
|
|
297
299
|
editor.executeEdits('inlineSuggestion.accept', [
|
|
298
|
-
...( edits.map(edit => EditOperation.
|
|
300
|
+
...( edits.map(edit => EditOperation.replace(edit.range, edit.text))),
|
|
299
301
|
...completion.additionalTextEdits
|
|
300
302
|
]);
|
|
301
303
|
editor.setSelections(selections, 'inlineCompletionAccept');
|
|
@@ -386,7 +388,7 @@ let InlineCompletionsModel = class InlineCompletionsModel extends Disposable {
|
|
|
386
388
|
const primaryEdit = ( new SingleTextEdit(replaceRange, newText));
|
|
387
389
|
const edits = [primaryEdit, ...getSecondaryEdits(this.textModel, positions, primaryEdit)];
|
|
388
390
|
const selections = ( getEndPositionsAfterApplying(edits).map(p => Selection.fromPositions(p)));
|
|
389
|
-
editor.executeEdits('inlineSuggestion.accept', ( edits.map(edit => EditOperation.
|
|
391
|
+
editor.executeEdits('inlineSuggestion.accept', ( edits.map(edit => EditOperation.replace(edit.range, edit.text))));
|
|
390
392
|
editor.setSelections(selections, 'inlineCompletionPartialAccept');
|
|
391
393
|
}
|
|
392
394
|
finally {
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { CancellationTokenSource } from '../../../../base/common/cancellation.js';
|
|
3
|
+
import { equalsIfDefined, itemEquals } from '../../../../base/common/equals.js';
|
|
3
4
|
import { matchesSubString } from '../../../../base/common/filters.js';
|
|
4
5
|
import { Disposable, MutableDisposable } from '../../../../base/common/lifecycle.js';
|
|
5
6
|
import { disposableObservableValue, transaction } from '../../../../base/common/observableInternal/base.js';
|
|
6
|
-
import {
|
|
7
|
+
import { derivedOpts } from '../../../../base/common/observableInternal/derived.js';
|
|
7
8
|
import '../../../../base/common/observableInternal/autorun.js';
|
|
8
9
|
import '../../../../base/common/observableInternal/utils.js';
|
|
9
|
-
import {
|
|
10
|
+
import { Range } from '../../../common/core/range.js';
|
|
11
|
+
import { SingleTextEdit } from '../../../common/core/textEdit.js';
|
|
12
|
+
import { TextLength } from '../../../common/core/textLength.js';
|
|
10
13
|
import { InlineCompletionTriggerKind } from '../../../common/languages.js';
|
|
11
14
|
import { ILanguageConfigurationService } from '../../../common/languages/languageConfigurationRegistry.js';
|
|
12
15
|
import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';
|
|
13
16
|
import { provideInlineCompletions } from './provideInlineCompletions.js';
|
|
14
|
-
import { SingleTextEdit } from '../../../common/core/textEdit.js';
|
|
15
17
|
import { singleTextRemoveCommonPrefix } from './singleTextEdit.js';
|
|
16
18
|
let InlineCompletionsSource = class InlineCompletionsSource extends Disposable {
|
|
17
19
|
constructor(textModel, versionId, _debounceValue, languageFeaturesService, languageConfigurationService) {
|
|
@@ -119,18 +121,12 @@ class UpdateRequest {
|
|
|
119
121
|
}
|
|
120
122
|
satisfies(other) {
|
|
121
123
|
return this.position.equals(other.position)
|
|
122
|
-
&&
|
|
124
|
+
&& equalsIfDefined(this.context.selectedSuggestionInfo, other.context.selectedSuggestionInfo, itemEquals())
|
|
123
125
|
&& (other.context.triggerKind === InlineCompletionTriggerKind.Automatic
|
|
124
126
|
|| this.context.triggerKind === InlineCompletionTriggerKind.Explicit)
|
|
125
127
|
&& this.versionId === other.versionId;
|
|
126
128
|
}
|
|
127
129
|
}
|
|
128
|
-
function equals(v1, v2, equals) {
|
|
129
|
-
if (!v1 || !v2) {
|
|
130
|
-
return v1 === v2;
|
|
131
|
-
}
|
|
132
|
-
return equals(v1, v2);
|
|
133
|
-
}
|
|
134
130
|
class UpdateOperation {
|
|
135
131
|
constructor(request, cancellationTokenSource, promise) {
|
|
136
132
|
this.request = request;
|
|
@@ -143,32 +139,20 @@ class UpdateOperation {
|
|
|
143
139
|
}
|
|
144
140
|
class UpToDateInlineCompletions {
|
|
145
141
|
get inlineCompletions() { return this._inlineCompletions; }
|
|
146
|
-
constructor(inlineCompletionProviderResult, request,
|
|
142
|
+
constructor(inlineCompletionProviderResult, request, _textModel, _versionId) {
|
|
147
143
|
this.inlineCompletionProviderResult = inlineCompletionProviderResult;
|
|
148
144
|
this.request = request;
|
|
149
|
-
this.
|
|
150
|
-
this.
|
|
145
|
+
this._textModel = _textModel;
|
|
146
|
+
this._versionId = _versionId;
|
|
151
147
|
this._refCount = 1;
|
|
152
148
|
this._prependedInlineCompletionItems = [];
|
|
153
|
-
|
|
154
|
-
this._rangeVersionId = derived(this, reader => {
|
|
155
|
-
this.versionId.read(reader);
|
|
156
|
-
let changed = false;
|
|
157
|
-
for (const i of this._inlineCompletions) {
|
|
158
|
-
changed = changed || i._updateRange(this.textModel);
|
|
159
|
-
}
|
|
160
|
-
if (changed) {
|
|
161
|
-
this._rangeVersionIdValue++;
|
|
162
|
-
}
|
|
163
|
-
return this._rangeVersionIdValue;
|
|
164
|
-
});
|
|
165
|
-
const ids = textModel.deltaDecorations([], ( inlineCompletionProviderResult.completions.map(i => ({
|
|
149
|
+
const ids = _textModel.deltaDecorations([], ( inlineCompletionProviderResult.completions.map(i => ({
|
|
166
150
|
range: i.range,
|
|
167
151
|
options: {
|
|
168
152
|
description: 'inline-completion-tracking-range'
|
|
169
153
|
},
|
|
170
154
|
}))));
|
|
171
|
-
this._inlineCompletions = ( inlineCompletionProviderResult.completions.map((i, index) => ( new InlineCompletionWithUpdatedRange(i, ids[index], this.
|
|
155
|
+
this._inlineCompletions = ( inlineCompletionProviderResult.completions.map((i, index) => ( new InlineCompletionWithUpdatedRange(i, ids[index], this._textModel, this._versionId))));
|
|
172
156
|
}
|
|
173
157
|
clone() {
|
|
174
158
|
this._refCount++;
|
|
@@ -178,8 +162,8 @@ class UpToDateInlineCompletions {
|
|
|
178
162
|
this._refCount--;
|
|
179
163
|
if (this._refCount === 0) {
|
|
180
164
|
setTimeout(() => {
|
|
181
|
-
if (!this.
|
|
182
|
-
this.
|
|
165
|
+
if (!this._textModel.isDisposed()) {
|
|
166
|
+
this._textModel.deltaDecorations(( this._inlineCompletions.map(i => i.decorationId)), []);
|
|
183
167
|
}
|
|
184
168
|
}, 0);
|
|
185
169
|
this.inlineCompletionProviderResult.dispose();
|
|
@@ -192,13 +176,13 @@ class UpToDateInlineCompletions {
|
|
|
192
176
|
if (addRefToSource) {
|
|
193
177
|
inlineCompletion.source.addRef();
|
|
194
178
|
}
|
|
195
|
-
const id = this.
|
|
179
|
+
const id = this._textModel.deltaDecorations([], [{
|
|
196
180
|
range,
|
|
197
181
|
options: {
|
|
198
182
|
description: 'inline-completion-tracking-range'
|
|
199
183
|
},
|
|
200
184
|
}])[0];
|
|
201
|
-
this._inlineCompletions.unshift(( new InlineCompletionWithUpdatedRange(inlineCompletion, id, this.
|
|
185
|
+
this._inlineCompletions.unshift(( new InlineCompletionWithUpdatedRange(inlineCompletion, id, this._textModel, this._versionId)));
|
|
202
186
|
this._prependedInlineCompletionItems.push(inlineCompletion);
|
|
203
187
|
}
|
|
204
188
|
}
|
|
@@ -206,28 +190,35 @@ class InlineCompletionWithUpdatedRange {
|
|
|
206
190
|
get forwardStable() {
|
|
207
191
|
return this.inlineCompletion.source.inlineCompletions.enableForwardStability ?? false;
|
|
208
192
|
}
|
|
209
|
-
constructor(inlineCompletion, decorationId,
|
|
193
|
+
constructor(inlineCompletion, decorationId, _textModel, _modelVersion) {
|
|
210
194
|
this.inlineCompletion = inlineCompletion;
|
|
211
195
|
this.decorationId = decorationId;
|
|
212
|
-
this.
|
|
196
|
+
this._textModel = _textModel;
|
|
197
|
+
this._modelVersion = _modelVersion;
|
|
213
198
|
this.semanticId = JSON.stringify([
|
|
214
199
|
this.inlineCompletion.filterText,
|
|
215
200
|
this.inlineCompletion.insertText,
|
|
216
201
|
( this.inlineCompletion.range.getStartPosition().toString())
|
|
217
202
|
]);
|
|
218
|
-
this.
|
|
219
|
-
|
|
203
|
+
this._updatedRange = derivedOpts({ owner: this, equalsFn: Range.equalsRange }, reader => {
|
|
204
|
+
this._modelVersion.read(reader);
|
|
205
|
+
return this._textModel.getDecorationRange(this.decorationId);
|
|
206
|
+
});
|
|
220
207
|
}
|
|
221
208
|
toInlineCompletion(reader) {
|
|
222
|
-
return this.inlineCompletion.withRange(this.
|
|
209
|
+
return this.inlineCompletion.withRange(this._updatedRange.read(reader) ?? emptyRange);
|
|
223
210
|
}
|
|
224
211
|
toSingleTextEdit(reader) {
|
|
225
|
-
return ( new SingleTextEdit(
|
|
212
|
+
return ( new SingleTextEdit(
|
|
213
|
+
this._updatedRange.read(reader) ?? emptyRange,
|
|
214
|
+
this.inlineCompletion.insertText
|
|
215
|
+
));
|
|
226
216
|
}
|
|
227
217
|
isVisible(model, cursorPosition, reader) {
|
|
228
218
|
const minimizedReplacement = singleTextRemoveCommonPrefix(this._toFilterTextReplacement(reader), model);
|
|
229
|
-
|
|
230
|
-
|
|
219
|
+
const updatedRange = this._updatedRange.read(reader);
|
|
220
|
+
if (!updatedRange
|
|
221
|
+
|| !this.inlineCompletion.range.getStartPosition().equals(updatedRange.getStartPosition())
|
|
231
222
|
|| cursorPosition.lineNumber !== minimizedReplacement.range.startLineNumber) {
|
|
232
223
|
return false;
|
|
233
224
|
}
|
|
@@ -253,41 +244,19 @@ class InlineCompletionWithUpdatedRange {
|
|
|
253
244
|
&& !!matchesSubString(originalValueAfter, filterTextAfter);
|
|
254
245
|
}
|
|
255
246
|
canBeReused(model, position) {
|
|
256
|
-
const
|
|
257
|
-
|
|
247
|
+
const updatedRange = this._updatedRange.read(undefined);
|
|
248
|
+
const result = !!updatedRange
|
|
249
|
+
&& updatedRange.containsPosition(position)
|
|
258
250
|
&& this.isVisible(model, position, undefined)
|
|
259
|
-
&&
|
|
251
|
+
&& TextLength.ofRange(updatedRange).isGreaterThanOrEqualTo(TextLength.ofRange(this.inlineCompletion.range));
|
|
260
252
|
return result;
|
|
261
253
|
}
|
|
262
254
|
_toFilterTextReplacement(reader) {
|
|
263
|
-
return ( new SingleTextEdit(
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}
|
|
268
|
-
_getUpdatedRange(reader) {
|
|
269
|
-
this.rangeVersion.read(reader);
|
|
270
|
-
return this._updatedRange;
|
|
271
|
-
}
|
|
272
|
-
_updateRange(textModel) {
|
|
273
|
-
const range = textModel.getDecorationRange(this.decorationId);
|
|
274
|
-
if (!range) {
|
|
275
|
-
this._isValid = false;
|
|
276
|
-
return true;
|
|
277
|
-
}
|
|
278
|
-
if (!this._updatedRange.equalsRange(range)) {
|
|
279
|
-
this._updatedRange = range;
|
|
280
|
-
return true;
|
|
281
|
-
}
|
|
282
|
-
return false;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
function length(range) {
|
|
286
|
-
if (range.startLineNumber === range.endLineNumber) {
|
|
287
|
-
return ( new Position(1, 1 + range.endColumn - range.startColumn));
|
|
288
|
-
}
|
|
289
|
-
else {
|
|
290
|
-
return ( new Position(1 + range.endLineNumber - range.startLineNumber, range.endColumn));
|
|
255
|
+
return ( new SingleTextEdit(
|
|
256
|
+
this._updatedRange.read(reader) ?? emptyRange,
|
|
257
|
+
this.inlineCompletion.filterText
|
|
258
|
+
));
|
|
291
259
|
}
|
|
292
260
|
}
|
|
261
|
+
const emptyRange = ( new Range(1, 1, 1, 1));
|
|
293
262
|
export { InlineCompletionWithUpdatedRange, InlineCompletionsSource, UpToDateInlineCompletions };
|
|
@@ -11,9 +11,9 @@ import '../../../../base/common/observableInternal/derived.js';
|
|
|
11
11
|
import '../../../../base/common/observableInternal/autorun.js';
|
|
12
12
|
import '../../../../base/common/observableInternal/utils.js';
|
|
13
13
|
import '../../../../base/common/cancellation.js';
|
|
14
|
-
import { SingleTextEdit } from '../../../common/core/textEdit.js';
|
|
15
14
|
import { compareBy, numberComparator } from '../../../../base/common/arrays.js';
|
|
16
|
-
import {
|
|
15
|
+
import { SingleTextEdit } from '../../../common/core/textEdit.js';
|
|
16
|
+
import { findFirstMax } from '../../../../base/common/arraysFind.js';
|
|
17
17
|
import { singleTextRemoveCommonPrefix, singleTextEditAugments } from './singleTextEdit.js';
|
|
18
18
|
class SuggestWidgetAdaptor extends Disposable {
|
|
19
19
|
get selectedItem() {
|
|
@@ -66,7 +66,7 @@ class SuggestWidgetAdaptor extends Disposable {
|
|
|
66
66
|
return { index, valid, prefixLength: suggestItemTextEdit.text.length, suggestItem };
|
|
67
67
|
}))
|
|
68
68
|
.filter(item => item && item.valid && item.prefixLength > 0);
|
|
69
|
-
const result =
|
|
69
|
+
const result = findFirstMax(candidates, compareBy(s => s.prefixLength, numberComparator));
|
|
70
70
|
return result ? result.index : -1;
|
|
71
71
|
}
|
|
72
72
|
}));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BugIndicatingError } from '../../../../base/common/errors.js';
|
|
2
2
|
import { DisposableStore } from '../../../../base/common/lifecycle.js';
|
|
3
|
+
import '../../../../base/common/arrays.js';
|
|
3
4
|
import '../../../../base/common/observableInternal/derived.js';
|
|
4
5
|
import { autorunOpts } from '../../../../base/common/observableInternal/autorun.js';
|
|
5
6
|
import '../../../../base/common/observableInternal/utils.js';
|
|
@@ -5,6 +5,7 @@ import { derived } from '../../../../base/common/observableInternal/derived.js';
|
|
|
5
5
|
import '../../../../base/common/observableInternal/autorun.js';
|
|
6
6
|
import { observableFromEvent } from '../../../../base/common/observableInternal/utils.js';
|
|
7
7
|
import '../../../../base/common/cancellation.js';
|
|
8
|
+
import '../../../../base/common/arrays.js';
|
|
8
9
|
import './inlineEdit.css.js';
|
|
9
10
|
import { Position } from '../../../common/core/position.js';
|
|
10
11
|
import { Range } from '../../../common/core/range.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { DisposableStore } from '../../../../base/common/lifecycle.js';
|
|
3
|
+
import '../../../../base/common/arrays.js';
|
|
3
4
|
import '../../../../base/common/observableInternal/derived.js';
|
|
4
5
|
import '../../../../base/common/observableInternal/autorun.js';
|
|
5
6
|
import { constObservable } from '../../../../base/common/observableInternal/utils.js';
|
|
@@ -5,6 +5,8 @@ import '../../../../base/common/observableInternal/derived.js';
|
|
|
5
5
|
import { autorun } from '../../../../base/common/observableInternal/autorun.js';
|
|
6
6
|
import { observableFromEvent, constObservable, observableSignalFromEvent } from '../../../../base/common/observableInternal/utils.js';
|
|
7
7
|
import { CancellationTokenSource } from '../../../../base/common/cancellation.js';
|
|
8
|
+
import '../../../../base/common/arrays.js';
|
|
9
|
+
import { onUnexpectedExternalError } from '../../../../base/common/errors.js';
|
|
8
10
|
import { EditOperation } from '../../../common/core/editOperation.js';
|
|
9
11
|
import { Position } from '../../../common/core/position.js';
|
|
10
12
|
import { Range } from '../../../common/core/range.js';
|
|
@@ -19,7 +21,6 @@ import { ICommandService } from '../../../../platform/commands/common/commands.s
|
|
|
19
21
|
import { InlineEditHintsWidget } from './inlineEditHintsWidget.js';
|
|
20
22
|
import { createStyleSheet2 } from '../../../../base/browser/dom.js';
|
|
21
23
|
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.service.js';
|
|
22
|
-
import { onUnexpectedExternalError } from '../../../../base/common/errors.js';
|
|
23
24
|
var InlineEditController_1;
|
|
24
25
|
class InlineEditWidget {
|
|
25
26
|
constructor(widget, edit) {
|
|
@@ -194,7 +195,8 @@ let InlineEditController = class InlineEditController extends Disposable {
|
|
|
194
195
|
}
|
|
195
196
|
const line = edit.range.endLineNumber;
|
|
196
197
|
const column = edit.range.endColumn;
|
|
197
|
-
const
|
|
198
|
+
const textToDisplay = edit.text.endsWith('\n') && !(edit.range.startLineNumber === edit.range.endLineNumber && edit.range.startColumn === edit.range.endColumn) ? edit.text.slice(0, -1) : edit.text;
|
|
199
|
+
const ghostText = ( new GhostText(line, [( new GhostTextPart(column, textToDisplay, false))]));
|
|
198
200
|
const instance = this.instantiationService.createInstance(GhostTextWidget, this.editor, {
|
|
199
201
|
ghostText: constObservable(ghostText),
|
|
200
202
|
minReservedLineCount: constObservable(0),
|