@codingame/monaco-vscode-api 6.0.3 → 7.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/README.md +93 -73
- 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
|
@@ -7,11 +7,13 @@ import { constObservable } from '../../../../base/common/observableInternal/util
|
|
|
7
7
|
import '../../../../base/common/cancellation.js';
|
|
8
8
|
import { MouseTargetType } from '../../../browser/editorBrowser.js';
|
|
9
9
|
import { EditorOption } from '../../../common/config/editorOptions.js';
|
|
10
|
-
import { HoverForeignElementAnchor, HoverAnchorType } from '../../hover/browser/hoverTypes.js';
|
|
10
|
+
import { HoverForeignElementAnchor, RenderedHoverParts, HoverAnchorType } from '../../hover/browser/hoverTypes.js';
|
|
11
11
|
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
|
|
12
12
|
import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.service.js';
|
|
13
13
|
import { InlineEditController } from './inlineEditController.js';
|
|
14
14
|
import { InlineEditHintsContentWidget } from './inlineEditHintsWidget.js';
|
|
15
|
+
import { localizeWithPath } from '../../../../nls.js';
|
|
16
|
+
const _moduleId = "vs/editor/contrib/inlineEdit/browser/hoverParticipant";
|
|
15
17
|
class InlineEditHover {
|
|
16
18
|
constructor(owner, range, controller) {
|
|
17
19
|
this.owner = owner;
|
|
@@ -41,32 +43,38 @@ let InlineEditHoverParticipant = class InlineEditHoverParticipant {
|
|
|
41
43
|
const viewZoneData = target.detail;
|
|
42
44
|
if (controller.shouldShowHoverAtViewZone(viewZoneData.viewZoneId)) {
|
|
43
45
|
const range = target.range;
|
|
44
|
-
return (
|
|
46
|
+
return (
|
|
47
|
+
(new HoverForeignElementAnchor(1000, this, range, mouseEvent.event.posx, mouseEvent.event.posy, false))
|
|
48
|
+
);
|
|
45
49
|
}
|
|
46
50
|
}
|
|
47
51
|
if (target.type === MouseTargetType.CONTENT_EMPTY) {
|
|
48
52
|
if (controller.shouldShowHoverAt(target.range)) {
|
|
49
|
-
return (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
return (
|
|
54
|
+
(new HoverForeignElementAnchor(
|
|
55
|
+
1000,
|
|
56
|
+
this,
|
|
57
|
+
target.range,
|
|
58
|
+
mouseEvent.event.posx,
|
|
59
|
+
mouseEvent.event.posy,
|
|
60
|
+
false
|
|
61
|
+
))
|
|
62
|
+
);
|
|
57
63
|
}
|
|
58
64
|
}
|
|
59
65
|
if (target.type === MouseTargetType.CONTENT_TEXT) {
|
|
60
66
|
const mightBeForeignElement = target.detail.mightBeForeignElement;
|
|
61
67
|
if (mightBeForeignElement && controller.shouldShowHoverAt(target.range)) {
|
|
62
|
-
return (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
return (
|
|
69
|
+
(new HoverForeignElementAnchor(
|
|
70
|
+
1000,
|
|
71
|
+
this,
|
|
72
|
+
target.range,
|
|
73
|
+
mouseEvent.event.posx,
|
|
74
|
+
mouseEvent.event.posy,
|
|
75
|
+
false
|
|
76
|
+
))
|
|
77
|
+
);
|
|
70
78
|
}
|
|
71
79
|
}
|
|
72
80
|
return null;
|
|
@@ -77,21 +85,31 @@ let InlineEditHoverParticipant = class InlineEditHoverParticipant {
|
|
|
77
85
|
}
|
|
78
86
|
const controller = InlineEditController.get(this._editor);
|
|
79
87
|
if (controller && controller.shouldShowHoverAt(anchor.range)) {
|
|
80
|
-
return [( new InlineEditHover(this, anchor.range, controller))];
|
|
88
|
+
return [( (new InlineEditHover(this, anchor.range, controller)))];
|
|
81
89
|
}
|
|
82
90
|
return [];
|
|
83
91
|
}
|
|
84
92
|
renderHoverParts(context, hoverParts) {
|
|
85
|
-
const
|
|
93
|
+
const disposables = ( (new DisposableStore()));
|
|
86
94
|
this._telemetryService.publicLog2('inlineEditHover.shown');
|
|
87
95
|
const w = this._instantiationService.createInstance(InlineEditHintsContentWidget, this._editor, false, constObservable(null));
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
96
|
+
disposables.add(w);
|
|
97
|
+
const widgetNode = w.getDomNode();
|
|
98
|
+
const renderedHoverPart = {
|
|
99
|
+
hoverPart: hoverParts[0],
|
|
100
|
+
hoverElement: widgetNode,
|
|
101
|
+
dispose: () => disposables.dispose()
|
|
102
|
+
};
|
|
103
|
+
return (
|
|
104
|
+
(new RenderedHoverParts([renderedHoverPart]))
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
getAccessibleContent(hoverPart) {
|
|
108
|
+
return ( localizeWithPath(_moduleId, 0, 'There are inline edits here.'));
|
|
91
109
|
}
|
|
92
110
|
};
|
|
93
|
-
InlineEditHoverParticipant = ( __decorate([
|
|
94
|
-
( __param(1, IInstantiationService)),
|
|
95
|
-
( __param(2, ITelemetryService))
|
|
96
|
-
], InlineEditHoverParticipant));
|
|
111
|
+
InlineEditHoverParticipant = ( (__decorate([
|
|
112
|
+
( (__param(1, IInstantiationService))),
|
|
113
|
+
( (__param(2, ITelemetryService)))
|
|
114
|
+
], InlineEditHoverParticipant)));
|
|
97
115
|
export { InlineEditHover, InlineEditHoverParticipant };
|
|
@@ -54,9 +54,9 @@ let InlineEditController = class InlineEditController extends Disposable {
|
|
|
54
54
|
this._isCursorAtInlineEditContext = InlineEditController_1.cursorAtInlineEditContext.bindTo(this.contextKeyService);
|
|
55
55
|
this._currentEdit = this._register(disposableObservableValue(this, undefined));
|
|
56
56
|
this._isAccepting = observableValue(this, false);
|
|
57
|
-
this._enabled = observableFromEvent(this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineEdit).enabled);
|
|
58
|
-
this._fontFamily = observableFromEvent(this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineEdit).fontFamily);
|
|
59
|
-
this._backgroundColoring = observableFromEvent(this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineEdit).backgroundColoring);
|
|
57
|
+
this._enabled = observableFromEvent(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineEdit).enabled);
|
|
58
|
+
this._fontFamily = observableFromEvent(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineEdit).fontFamily);
|
|
59
|
+
this._backgroundColoring = observableFromEvent(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineEdit).backgroundColoring);
|
|
60
60
|
const modelChangedSignal = observableSignalFromEvent('InlineEditController.modelContentChangedSignal', editor.onDidChangeModelContent);
|
|
61
61
|
this._register(autorun(reader => {
|
|
62
62
|
if (!this._enabled.read(reader)) {
|
|
@@ -68,7 +68,7 @@ let InlineEditController = class InlineEditController extends Disposable {
|
|
|
68
68
|
}
|
|
69
69
|
this.getInlineEdit(editor, true);
|
|
70
70
|
}));
|
|
71
|
-
const cursorPosition = observableFromEvent(editor.onDidChangeCursorPosition, () => editor.getPosition());
|
|
71
|
+
const cursorPosition = observableFromEvent(this, editor.onDidChangeCursorPosition, () => editor.getPosition());
|
|
72
72
|
this._register(autorun(reader => {
|
|
73
73
|
if (!this._enabled.read(reader)) {
|
|
74
74
|
return;
|
|
@@ -31,7 +31,7 @@ let InlineEditHintsWidget = class InlineEditHintsWidget extends Disposable {
|
|
|
31
31
|
this.editor = editor;
|
|
32
32
|
this.model = model;
|
|
33
33
|
this.instantiationService = instantiationService;
|
|
34
|
-
this.alwaysShowToolbar = observableFromEvent(this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineEdit).showToolbar === 'always');
|
|
34
|
+
this.alwaysShowToolbar = observableFromEvent(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineEdit).showToolbar === 'always');
|
|
35
35
|
this.sessionPosition = undefined;
|
|
36
36
|
this.position = derived(this, reader => {
|
|
37
37
|
const ghostText = this.model.read(reader)?.widget.model.ghostText.read(reader);
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Codicon } from '../../../../base/common/codicons.js';
|
|
2
|
+
import { KeyMod as KeyMod$1, KeyCode } from '../../../../base/common/keyCodes.js';
|
|
3
|
+
import { transaction, asyncTransaction } from '../../../../base/common/observableInternal/base.js';
|
|
4
|
+
import '../../../../base/common/observableInternal/derived.js';
|
|
5
|
+
import '../../../../base/common/observableInternal/autorun.js';
|
|
6
|
+
import '../../../../base/common/observableInternal/utils.js';
|
|
7
|
+
import '../../../../base/common/cancellation.js';
|
|
8
|
+
import '../../../../base/common/arrays.js';
|
|
9
|
+
import { EditorAction } from '../../../browser/editorExtensions.js';
|
|
10
|
+
import { EmbeddedCodeEditorWidget } from '../../../browser/widget/codeEditor/embeddedCodeEditorWidget.js';
|
|
11
|
+
import { EditorContextKeys } from '../../../common/editorContextKeys.js';
|
|
12
|
+
import { showNextInlineEditActionId, inlineEditVisible, showPreviousInlineEditActionId, inlineEditAcceptId } from './consts.js';
|
|
13
|
+
import { InlineEditsController } from './inlineEditsController.js';
|
|
14
|
+
import { localize2WithPath, localizeWithPath } from '../../../../nls.js';
|
|
15
|
+
import { MenuId } from '../../../../platform/actions/common/actions.js';
|
|
16
|
+
import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js';
|
|
17
|
+
const _moduleId = "vs/editor/contrib/inlineEdits/browser/commands";
|
|
18
|
+
function labelAndAlias(str) {
|
|
19
|
+
return {
|
|
20
|
+
label: str.value,
|
|
21
|
+
alias: str.original,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
class ShowNextInlineEditAction extends EditorAction {
|
|
25
|
+
static { this.ID = showNextInlineEditActionId; }
|
|
26
|
+
constructor() {
|
|
27
|
+
super({
|
|
28
|
+
id: ShowNextInlineEditAction.ID,
|
|
29
|
+
...labelAndAlias(( localize2WithPath(_moduleId, 0, "Show Next Inline Edit"))),
|
|
30
|
+
precondition: ( (ContextKeyExpr.and(EditorContextKeys.writable, inlineEditVisible))),
|
|
31
|
+
kbOpts: {
|
|
32
|
+
weight: 100,
|
|
33
|
+
primary: KeyMod$1.Alt | KeyCode.BracketRight,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
async run(accessor, editor) {
|
|
38
|
+
const controller = InlineEditsController.get(editor);
|
|
39
|
+
controller?.model.get()?.next();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
class ShowPreviousInlineEditAction extends EditorAction {
|
|
43
|
+
static { this.ID = showPreviousInlineEditActionId; }
|
|
44
|
+
constructor() {
|
|
45
|
+
super({
|
|
46
|
+
id: ShowPreviousInlineEditAction.ID,
|
|
47
|
+
...labelAndAlias(( localize2WithPath(_moduleId, 1, "Show Previous Inline Edit"))),
|
|
48
|
+
precondition: ( (ContextKeyExpr.and(EditorContextKeys.writable, inlineEditVisible))),
|
|
49
|
+
kbOpts: {
|
|
50
|
+
weight: 100,
|
|
51
|
+
primary: KeyMod$1.Alt | KeyCode.BracketLeft,
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
async run(accessor, editor) {
|
|
56
|
+
const controller = InlineEditsController.get(editor);
|
|
57
|
+
controller?.model.get()?.previous();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
class TriggerInlineEditAction extends EditorAction {
|
|
61
|
+
constructor() {
|
|
62
|
+
super({
|
|
63
|
+
id: 'editor.action.inlineEdits.trigger',
|
|
64
|
+
...labelAndAlias(( localize2WithPath(_moduleId, 2, "Trigger Inline Edit"))),
|
|
65
|
+
precondition: EditorContextKeys.writable
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
async run(accessor, editor) {
|
|
69
|
+
const controller = InlineEditsController.get(editor);
|
|
70
|
+
await asyncTransaction(async (tx) => {
|
|
71
|
+
await controller?.model.get()?.triggerExplicitly(tx);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
class AcceptInlineEdit extends EditorAction {
|
|
76
|
+
constructor() {
|
|
77
|
+
super({
|
|
78
|
+
id: inlineEditAcceptId,
|
|
79
|
+
...labelAndAlias(( localize2WithPath(_moduleId, 3, "Accept Inline Edit"))),
|
|
80
|
+
precondition: inlineEditVisible,
|
|
81
|
+
menuOpts: {
|
|
82
|
+
menuId: MenuId.InlineEditsActions,
|
|
83
|
+
title: ( localizeWithPath(_moduleId, 4, "Accept Inline Edit")),
|
|
84
|
+
group: 'primary',
|
|
85
|
+
order: 1,
|
|
86
|
+
icon: Codicon.check,
|
|
87
|
+
},
|
|
88
|
+
kbOpts: {
|
|
89
|
+
primary: KeyMod$1.CtrlCmd | KeyCode.Space,
|
|
90
|
+
weight: 20000,
|
|
91
|
+
kbExpr: inlineEditVisible,
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
async run(accessor, editor) {
|
|
96
|
+
if (editor instanceof EmbeddedCodeEditorWidget) {
|
|
97
|
+
editor = editor.getParentEditor();
|
|
98
|
+
}
|
|
99
|
+
const controller = InlineEditsController.get(editor);
|
|
100
|
+
if (controller) {
|
|
101
|
+
controller.model.get()?.accept(controller.editor);
|
|
102
|
+
controller.editor.focus();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
class HideInlineEdit extends EditorAction {
|
|
107
|
+
static { this.ID = 'editor.action.inlineEdits.hide'; }
|
|
108
|
+
constructor() {
|
|
109
|
+
super({
|
|
110
|
+
id: HideInlineEdit.ID,
|
|
111
|
+
...labelAndAlias(( localize2WithPath(_moduleId, 5, "Hide Inline Edit"))),
|
|
112
|
+
precondition: inlineEditVisible,
|
|
113
|
+
kbOpts: {
|
|
114
|
+
weight: 100,
|
|
115
|
+
primary: KeyCode.Escape,
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
async run(accessor, editor) {
|
|
120
|
+
const controller = InlineEditsController.get(editor);
|
|
121
|
+
transaction(tx => {
|
|
122
|
+
controller?.model.get()?.stop(tx);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
export { AcceptInlineEdit, HideInlineEdit, ShowNextInlineEditAction, ShowPreviousInlineEditAction, TriggerInlineEditAction };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { localizeWithPath } from '../../../../nls.js';
|
|
2
|
+
import { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';
|
|
3
|
+
const _moduleId = "vs/editor/contrib/inlineEdits/browser/consts";
|
|
4
|
+
const inlineEditAcceptId = 'editor.action.inlineEdits.accept';
|
|
5
|
+
const showPreviousInlineEditActionId = 'editor.action.inlineEdits.showPrevious';
|
|
6
|
+
const showNextInlineEditActionId = 'editor.action.inlineEdits.showNext';
|
|
7
|
+
const inlineEditVisible = ( (new RawContextKey('inlineEditsVisible', false, ( localizeWithPath(_moduleId, 0, "Whether an inline edit is visible")))));
|
|
8
|
+
const isPinnedContextKey = ( (new RawContextKey('inlineEditsIsPinned', false, ( localizeWithPath(_moduleId, 1, "Whether an inline edit is visible")))));
|
|
9
|
+
export { inlineEditAcceptId, inlineEditVisible, isPinnedContextKey, showNextInlineEditActionId, showPreviousInlineEditActionId };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { registerEditorContribution, registerEditorAction, EditorContributionInstantiation } from '../../../browser/editorExtensions.js';
|
|
2
|
+
import { TriggerInlineEditAction, ShowNextInlineEditAction, ShowPreviousInlineEditAction, AcceptInlineEdit, HideInlineEdit } from './commands.js';
|
|
3
|
+
import { InlineEditsController } from './inlineEditsController.js';
|
|
4
|
+
registerEditorContribution(InlineEditsController.ID, InlineEditsController, EditorContributionInstantiation.Eventually);
|
|
5
|
+
registerEditorAction(TriggerInlineEditAction);
|
|
6
|
+
registerEditorAction(ShowNextInlineEditAction);
|
|
7
|
+
registerEditorAction(ShowPreviousInlineEditAction);
|
|
8
|
+
registerEditorAction(AcceptInlineEdit);
|
|
9
|
+
registerEditorAction(HideInlineEdit);
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Disposable } from '../../../../base/common/lifecycle.js';
|
|
3
|
+
import { observableValue } from '../../../../base/common/observableInternal/base.js';
|
|
4
|
+
import { derived, derivedDisposable, derivedWithSetter } from '../../../../base/common/observableInternal/derived.js';
|
|
5
|
+
import '../../../../base/common/observableInternal/autorun.js';
|
|
6
|
+
import { derivedObservableWithCache } from '../../../../base/common/observableInternal/utils.js';
|
|
7
|
+
import '../../../../base/common/cancellation.js';
|
|
8
|
+
import '../../../../base/common/arrays.js';
|
|
9
|
+
import { observableCodeEditor } from '../../../browser/observableCodeEditor.js';
|
|
10
|
+
import { readHotReloadableExport } from '../../../browser/widget/diffEditor/utils.js';
|
|
11
|
+
import { Selection } from '../../../common/core/selection.js';
|
|
12
|
+
import { ILanguageFeatureDebounceService } from '../../../common/services/languageFeatureDebounce.js';
|
|
13
|
+
import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';
|
|
14
|
+
import { inlineEditVisible, isPinnedContextKey } from './consts.js';
|
|
15
|
+
import { InlineEditsModel } from './inlineEditsModel.js';
|
|
16
|
+
import { InlineEditsWidget } from './inlineEditsWidget.js';
|
|
17
|
+
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.service.js';
|
|
18
|
+
import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.service.js';
|
|
19
|
+
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
|
|
20
|
+
import { observableConfigValue, bindContextKey } from '../../../../platform/observable/common/platformObservableUtils.js';
|
|
21
|
+
var InlineEditsController_1;
|
|
22
|
+
let InlineEditsController = class InlineEditsController extends Disposable {
|
|
23
|
+
static { InlineEditsController_1 = this; }
|
|
24
|
+
static { this.ID = 'editor.contrib.inlineEditsController'; }
|
|
25
|
+
static get(editor) {
|
|
26
|
+
return editor.getContribution(InlineEditsController_1.ID);
|
|
27
|
+
}
|
|
28
|
+
constructor(editor, _instantiationService, _contextKeyService, _debounceService, _languageFeaturesService, _configurationService) {
|
|
29
|
+
super();
|
|
30
|
+
this.editor = editor;
|
|
31
|
+
this._instantiationService = _instantiationService;
|
|
32
|
+
this._contextKeyService = _contextKeyService;
|
|
33
|
+
this._debounceService = _debounceService;
|
|
34
|
+
this._languageFeaturesService = _languageFeaturesService;
|
|
35
|
+
this._configurationService = _configurationService;
|
|
36
|
+
this._enabled = observableConfigValue('editor.inlineEdits.enabled', false, this._configurationService);
|
|
37
|
+
this._editorObs = observableCodeEditor(this.editor);
|
|
38
|
+
this._selection = derived(this, reader => this._editorObs.cursorSelection.read(reader) ?? ( new Selection(1, 1, 1, 1)));
|
|
39
|
+
this._debounceValue = this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider, 'InlineEditsDebounce', { min: 50, max: 50 });
|
|
40
|
+
this.model = derivedDisposable(this, reader => {
|
|
41
|
+
if (!this._enabled.read(reader)) {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
if (this._editorObs.isReadonly.read(reader)) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
const textModel = this._editorObs.model.read(reader);
|
|
48
|
+
if (!textModel) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
const model = this._instantiationService.createInstance(readHotReloadableExport(InlineEditsModel, reader), textModel, this._editorObs.versionId, this._selection, this._debounceValue);
|
|
52
|
+
return model;
|
|
53
|
+
});
|
|
54
|
+
this._hadInlineEdit = derivedObservableWithCache(this, (reader, lastValue) => lastValue || this.model.read(reader)?.inlineEdit.read(reader) !== undefined);
|
|
55
|
+
this._widget = derivedDisposable(this, reader => {
|
|
56
|
+
if (!this._hadInlineEdit.read(reader)) {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
return this._instantiationService.createInstance(readHotReloadableExport(InlineEditsWidget, reader), this.editor, ( this.model.map((m, reader) => m?.inlineEdit.read(reader))), flattenSettableObservable((reader) => this.model.read(reader)?.userPrompt ?? observableValue('empty', '')));
|
|
60
|
+
});
|
|
61
|
+
this._register(bindContextKey(inlineEditVisible, this._contextKeyService, r => !!this.model.read(r)?.inlineEdit.read(r)));
|
|
62
|
+
this._register(bindContextKey(isPinnedContextKey, this._contextKeyService, r => !!this.model.read(r)?.isPinned.read(r)));
|
|
63
|
+
this.model.recomputeInitiallyAndOnChange(this._store);
|
|
64
|
+
this._widget.recomputeInitiallyAndOnChange(this._store);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
InlineEditsController = InlineEditsController_1 = ( __decorate([
|
|
68
|
+
( __param(1, IInstantiationService)),
|
|
69
|
+
( __param(2, IContextKeyService)),
|
|
70
|
+
( __param(3, ILanguageFeatureDebounceService)),
|
|
71
|
+
( __param(4, ILanguageFeaturesService)),
|
|
72
|
+
( __param(5, IConfigurationService))
|
|
73
|
+
], InlineEditsController));
|
|
74
|
+
function flattenSettableObservable(fn) {
|
|
75
|
+
return derivedWithSetter(undefined, reader => {
|
|
76
|
+
const obs = fn(reader);
|
|
77
|
+
return obs.read(reader);
|
|
78
|
+
}, (value, tx) => {
|
|
79
|
+
fn(undefined).set(value, tx);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
export { InlineEditsController };
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { timeout } from '../../../../base/common/async.js';
|
|
3
|
+
import { CancellationToken, cancelOnDispose } from '../../../../base/common/cancellation.js';
|
|
4
|
+
import { structuralEquals, itemsEquals } from '../../../../base/common/equals.js';
|
|
5
|
+
import { BugIndicatingError } from '../../../../base/common/errors.js';
|
|
6
|
+
import { Disposable, DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js';
|
|
7
|
+
import { observableValue, disposableObservableValue, subtransaction } from '../../../../base/common/observableInternal/base.js';
|
|
8
|
+
import { derivedDisposable, derived, derivedOpts, derivedHandleChanges } from '../../../../base/common/observableInternal/derived.js';
|
|
9
|
+
import '../../../../base/common/observableInternal/autorun.js';
|
|
10
|
+
import { observableSignal, recomputeInitiallyAndOnChange } from '../../../../base/common/observableInternal/utils.js';
|
|
11
|
+
import { ObservablePromise } from '../../../../base/common/observableInternal/promise.js';
|
|
12
|
+
import { URI } from '../../../../base/common/uri.js';
|
|
13
|
+
import { IDiffProviderFactoryService } from '../../../browser/widget/diffEditor/diffProviderFactoryService.js';
|
|
14
|
+
import { LineRange } from '../../../common/core/lineRange.js';
|
|
15
|
+
import { InlineCompletionTriggerKind } from '../../../common/languages.js';
|
|
16
|
+
import { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';
|
|
17
|
+
import { IModelService } from '../../../common/services/model.js';
|
|
18
|
+
import { provideInlineCompletions } from '../../inlineCompletions/browser/provideInlineCompletions.js';
|
|
19
|
+
import { InlineEdit } from './inlineEditsWidget.js';
|
|
20
|
+
var InlineEditsModel_1;
|
|
21
|
+
let InlineEditsModel = class InlineEditsModel extends Disposable {
|
|
22
|
+
static { InlineEditsModel_1 = this; }
|
|
23
|
+
static { this._modelId = 0; }
|
|
24
|
+
static _createUniqueUri() {
|
|
25
|
+
return ( URI.from({ scheme: 'inline-edits', path: ( ( new Date()).toString()) + String(InlineEditsModel_1._modelId++) }));
|
|
26
|
+
}
|
|
27
|
+
constructor(textModel, _textModelVersionId, _selection, _debounceValue, languageFeaturesService, _diffProviderFactoryService, _modelService) {
|
|
28
|
+
super();
|
|
29
|
+
this.textModel = textModel;
|
|
30
|
+
this._textModelVersionId = _textModelVersionId;
|
|
31
|
+
this._selection = _selection;
|
|
32
|
+
this._debounceValue = _debounceValue;
|
|
33
|
+
this.languageFeaturesService = languageFeaturesService;
|
|
34
|
+
this._diffProviderFactoryService = _diffProviderFactoryService;
|
|
35
|
+
this._modelService = _modelService;
|
|
36
|
+
this._forceUpdateExplicitlySignal = observableSignal(this);
|
|
37
|
+
this._selectedInlineCompletionId = observableValue(this, undefined);
|
|
38
|
+
this._isActive = observableValue(this, false);
|
|
39
|
+
this._originalModel = derivedDisposable(() => this._modelService.createModel('', null, InlineEditsModel_1._createUniqueUri())).keepObserved(this._store);
|
|
40
|
+
this._modifiedModel = derivedDisposable(() => this._modelService.createModel('', null, InlineEditsModel_1._createUniqueUri())).keepObserved(this._store);
|
|
41
|
+
this._pinnedRange = ( new TrackedRange(this.textModel, this._textModelVersionId));
|
|
42
|
+
this.isPinned = ( this._pinnedRange.range.map(range => !!range));
|
|
43
|
+
this.userPrompt = observableValue(this, undefined);
|
|
44
|
+
this.inlineEdit = derived(this, reader => {
|
|
45
|
+
return this._inlineEdit.read(reader)?.promiseResult.read(reader)?.data;
|
|
46
|
+
});
|
|
47
|
+
this._inlineEdit = derived(this, reader => {
|
|
48
|
+
const edit = this.selectedInlineEdit.read(reader);
|
|
49
|
+
if (!edit) {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
const range = edit.inlineCompletion.range;
|
|
53
|
+
if (edit.inlineCompletion.insertText.trim() === '') {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
let newLines = edit.inlineCompletion.insertText.split(/\r\n|\r|\n/);
|
|
57
|
+
function removeIndentation(lines) {
|
|
58
|
+
const indentation = lines[0].match(/^\s*/)?.[0] ?? '';
|
|
59
|
+
return ( lines.map(l => l.replace(( new RegExp('^' + indentation)), '')));
|
|
60
|
+
}
|
|
61
|
+
newLines = removeIndentation(newLines);
|
|
62
|
+
const existing = this.textModel.getValueInRange(range);
|
|
63
|
+
let existingLines = existing.split(/\r\n|\r|\n/);
|
|
64
|
+
existingLines = removeIndentation(existingLines);
|
|
65
|
+
this._originalModel.get().setValue(existingLines.join('\n'));
|
|
66
|
+
this._modifiedModel.get().setValue(newLines.join('\n'));
|
|
67
|
+
const d = this._diffProviderFactoryService.createDiffProvider({ diffAlgorithm: 'advanced' });
|
|
68
|
+
return ObservablePromise.fromFn(async () => {
|
|
69
|
+
const result = await d.computeDiff(this._originalModel.get(), this._modifiedModel.get(), {
|
|
70
|
+
computeMoves: false,
|
|
71
|
+
ignoreTrimWhitespace: false,
|
|
72
|
+
maxComputationTimeMs: 1000,
|
|
73
|
+
}, CancellationToken.None);
|
|
74
|
+
if (result.identical) {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
return ( new InlineEdit(
|
|
78
|
+
LineRange.fromRangeInclusive(range),
|
|
79
|
+
removeIndentation(newLines),
|
|
80
|
+
result.changes
|
|
81
|
+
));
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
this._fetchStore = this._register(( new DisposableStore()));
|
|
85
|
+
this._inlineEditsFetchResult = disposableObservableValue(this, undefined);
|
|
86
|
+
this._inlineEdits = derivedOpts({ owner: this, equalsFn: structuralEquals }, reader => {
|
|
87
|
+
return this._inlineEditsFetchResult.read(reader)?.completions.map(c => ( new InlineEditData(c))) ?? [];
|
|
88
|
+
});
|
|
89
|
+
this._fetchInlineEditsPromise = derivedHandleChanges({
|
|
90
|
+
owner: this,
|
|
91
|
+
createEmptyChangeSummary: () => ({
|
|
92
|
+
inlineCompletionTriggerKind: InlineCompletionTriggerKind.Automatic
|
|
93
|
+
}),
|
|
94
|
+
handleChange: (ctx, changeSummary) => {
|
|
95
|
+
if (ctx.didChange(this._forceUpdateExplicitlySignal)) {
|
|
96
|
+
changeSummary.inlineCompletionTriggerKind = InlineCompletionTriggerKind.Explicit;
|
|
97
|
+
}
|
|
98
|
+
return true;
|
|
99
|
+
},
|
|
100
|
+
}, async (reader, changeSummary) => {
|
|
101
|
+
this._fetchStore.clear();
|
|
102
|
+
this._forceUpdateExplicitlySignal.read(reader);
|
|
103
|
+
this._textModelVersionId.read(reader);
|
|
104
|
+
function mapValue(value, fn) {
|
|
105
|
+
return fn(value);
|
|
106
|
+
}
|
|
107
|
+
const selection = this._pinnedRange.range.read(reader) ?? mapValue(this._selection.read(reader), v => v.isEmpty() ? undefined : v);
|
|
108
|
+
if (!selection) {
|
|
109
|
+
this._inlineEditsFetchResult.set(undefined, undefined);
|
|
110
|
+
this.userPrompt.set(undefined, undefined);
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
const context = {
|
|
114
|
+
triggerKind: changeSummary.inlineCompletionTriggerKind,
|
|
115
|
+
selectedSuggestionInfo: undefined,
|
|
116
|
+
userPrompt: this.userPrompt.read(reader),
|
|
117
|
+
};
|
|
118
|
+
const token = cancelOnDispose(this._fetchStore);
|
|
119
|
+
await timeout(200, token);
|
|
120
|
+
const result = await provideInlineCompletions(this.languageFeaturesService.inlineCompletionsProvider, selection, this.textModel, context, token);
|
|
121
|
+
if (token.isCancellationRequested) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
this._inlineEditsFetchResult.set(result, undefined);
|
|
125
|
+
});
|
|
126
|
+
this._filteredInlineEditItems = derivedOpts({ owner: this, equalsFn: itemsEquals() }, reader => {
|
|
127
|
+
return this._inlineEdits.read(reader);
|
|
128
|
+
});
|
|
129
|
+
this.selectedInlineCompletionIndex = derived(this, (reader) => {
|
|
130
|
+
const selectedInlineCompletionId = this._selectedInlineCompletionId.read(reader);
|
|
131
|
+
const filteredCompletions = this._filteredInlineEditItems.read(reader);
|
|
132
|
+
const idx = this._selectedInlineCompletionId === undefined ? -1
|
|
133
|
+
: filteredCompletions.findIndex(v => v.semanticId === selectedInlineCompletionId);
|
|
134
|
+
if (idx === -1) {
|
|
135
|
+
this._selectedInlineCompletionId.set(undefined, undefined);
|
|
136
|
+
return 0;
|
|
137
|
+
}
|
|
138
|
+
return idx;
|
|
139
|
+
});
|
|
140
|
+
this.selectedInlineEdit = derived(this, (reader) => {
|
|
141
|
+
const filteredCompletions = this._filteredInlineEditItems.read(reader);
|
|
142
|
+
const idx = this.selectedInlineCompletionIndex.read(reader);
|
|
143
|
+
return filteredCompletions[idx];
|
|
144
|
+
});
|
|
145
|
+
this.activeCommands = derivedOpts({ owner: this, equalsFn: itemsEquals() }, r => this.selectedInlineEdit.read(r)?.inlineCompletion.source.inlineCompletions.commands ?? []);
|
|
146
|
+
this._register(recomputeInitiallyAndOnChange(this._fetchInlineEditsPromise));
|
|
147
|
+
}
|
|
148
|
+
async trigger(tx) {
|
|
149
|
+
this._isActive.set(true, tx);
|
|
150
|
+
await this._fetchInlineEditsPromise.get();
|
|
151
|
+
}
|
|
152
|
+
async triggerExplicitly(tx) {
|
|
153
|
+
subtransaction(tx, tx => {
|
|
154
|
+
this._isActive.set(true, tx);
|
|
155
|
+
this._forceUpdateExplicitlySignal.trigger(tx);
|
|
156
|
+
});
|
|
157
|
+
await this._fetchInlineEditsPromise.get();
|
|
158
|
+
}
|
|
159
|
+
stop(tx) {
|
|
160
|
+
subtransaction(tx, tx => {
|
|
161
|
+
this.userPrompt.set(undefined, tx);
|
|
162
|
+
this._isActive.set(false, tx);
|
|
163
|
+
this._inlineEditsFetchResult.set(undefined, tx);
|
|
164
|
+
this._pinnedRange.setRange(undefined, tx);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
async _deltaSelectedInlineCompletionIndex(delta) {
|
|
168
|
+
await this.triggerExplicitly();
|
|
169
|
+
const completions = this._filteredInlineEditItems.get() || [];
|
|
170
|
+
if (completions.length > 0) {
|
|
171
|
+
const newIdx = (this.selectedInlineCompletionIndex.get() + delta + completions.length) % completions.length;
|
|
172
|
+
this._selectedInlineCompletionId.set(completions[newIdx].semanticId, undefined);
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
this._selectedInlineCompletionId.set(undefined, undefined);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
async next() {
|
|
179
|
+
await this._deltaSelectedInlineCompletionIndex(1);
|
|
180
|
+
}
|
|
181
|
+
async previous() {
|
|
182
|
+
await this._deltaSelectedInlineCompletionIndex(-1);
|
|
183
|
+
}
|
|
184
|
+
togglePin() {
|
|
185
|
+
if (this.isPinned.get()) {
|
|
186
|
+
this._pinnedRange.setRange(undefined, undefined);
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
this._pinnedRange.setRange(this._selection.get(), undefined);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
async accept(editor) {
|
|
193
|
+
if (editor.getModel() !== this.textModel) {
|
|
194
|
+
throw ( new BugIndicatingError());
|
|
195
|
+
}
|
|
196
|
+
const edit = this.selectedInlineEdit.get();
|
|
197
|
+
if (!edit) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
editor.pushUndoStop();
|
|
201
|
+
editor.executeEdits('inlineSuggestion.accept', [
|
|
202
|
+
edit.inlineCompletion.toSingleTextEdit().toSingleEditOperation()
|
|
203
|
+
]);
|
|
204
|
+
this.stop();
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
InlineEditsModel = InlineEditsModel_1 = ( __decorate([
|
|
208
|
+
( __param(4, ILanguageFeaturesService)),
|
|
209
|
+
( __param(5, IDiffProviderFactoryService)),
|
|
210
|
+
( __param(6, IModelService))
|
|
211
|
+
], InlineEditsModel));
|
|
212
|
+
class InlineEditData {
|
|
213
|
+
constructor(inlineCompletion) {
|
|
214
|
+
this.inlineCompletion = inlineCompletion;
|
|
215
|
+
this.semanticId = this.inlineCompletion.hash();
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
class TrackedRange extends Disposable {
|
|
219
|
+
constructor(_textModel, _versionId) {
|
|
220
|
+
super();
|
|
221
|
+
this._textModel = _textModel;
|
|
222
|
+
this._versionId = _versionId;
|
|
223
|
+
this._decorations = observableValue(this, []);
|
|
224
|
+
this.range = derived(this, reader => {
|
|
225
|
+
this._versionId.read(reader);
|
|
226
|
+
const deco = this._decorations.read(reader)[0];
|
|
227
|
+
if (!deco) {
|
|
228
|
+
return null;
|
|
229
|
+
}
|
|
230
|
+
return this._textModel.getDecorationRange(deco) ?? null;
|
|
231
|
+
});
|
|
232
|
+
this._register(toDisposable(() => {
|
|
233
|
+
this._textModel.deltaDecorations(this._decorations.get(), []);
|
|
234
|
+
}));
|
|
235
|
+
}
|
|
236
|
+
setRange(range, tx) {
|
|
237
|
+
this._decorations.set(this._textModel.deltaDecorations(this._decorations.get(), range ? [{ range, options: { description: 'trackedRange' } }] : []), tx);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
export { InlineEditsModel };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import n from '../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
|
|
2
|
+
var css = ".monaco-editor div.inline-edits-widget{--widget-color:var(--vscode-notifications-background);.promptEditor .monaco-editor{--vscode-editor-placeholder-foreground:var(--vscode-editorGhostText-foreground)}.promptEditor,.toolbar{opacity:0;transition:opacity .2s ease-in-out}&.focused,&:hover{.promptEditor,.toolbar{opacity:1}}.preview .monaco-editor{--vscode-editor-background:var(--widget-color);.mtk1{color:var(--vscode-editorGhostText-foreground)}.current-line-margin,.view-overlays .current-line-exact{border:none}}svg{.gradient-start{stop-color:var(--vscode-editor-background)}.gradient-stop{stop-color:var(--widget-color)}}}";
|
|
3
|
+
n(css,{});
|
|
4
|
+
export { css, css as default };
|