@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import {
|
|
2
|
+
import { append, scheduleAtNextAnimationFrame, getWindow, Dimension, $ as $$1 } from '../../../../base/browser/dom.js';
|
|
3
3
|
import { timeout, disposableTimeout } from '../../../../base/common/async.js';
|
|
4
4
|
import { toErrorMessage } from '../../../../base/common/errorMessage.js';
|
|
5
5
|
import { Emitter, Event } from '../../../../base/common/event.js';
|
|
@@ -8,6 +8,7 @@ import { Schemas } from '../../../../base/common/network.js';
|
|
|
8
8
|
import { isEqual } from '../../../../base/common/resources.js';
|
|
9
9
|
import { isDefined } from '../../../../base/common/types.js';
|
|
10
10
|
import './media/chat.css.js';
|
|
11
|
+
import './media/chatAgentHover.css.js';
|
|
11
12
|
import { ICodeEditorService } from '../../../../editor/browser/services/codeEditorService.js';
|
|
12
13
|
import { MenuId } from '../../../../platform/actions/common/actions.js';
|
|
13
14
|
import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.service.js';
|
|
@@ -24,7 +25,6 @@ import { ChatListDelegate, ChatListItemRenderer } from './chatListRenderer.js';
|
|
|
24
25
|
import { ChatEditorOptions } from './chatOptions.js';
|
|
25
26
|
import { IChatAgentService } from '../common/chatAgents.service.js';
|
|
26
27
|
import { CONTEXT_IN_CHAT_SESSION, CONTEXT_CHAT_LOCATION, CONTEXT_CHAT_INPUT_HAS_AGENT, CONTEXT_CHAT_REQUEST_IN_PROGRESS, CONTEXT_RESPONSE_FILTERED } from '../common/chatContextKeys.js';
|
|
27
|
-
import { IChatContributionService } from '../common/chatContributionService.service.js';
|
|
28
28
|
import { ChatModelInitState } from '../common/chatModel.js';
|
|
29
29
|
import { ChatRequestAgentPart, extractAgentAndCommand, chatAgentLeader, chatSubcommandLeader } from '../common/chatParserTypes.js';
|
|
30
30
|
import { ChatRequestParser } from '../common/chatRequestParser.js';
|
|
@@ -32,7 +32,6 @@ import { IChatService } from '../common/chatService.service.js';
|
|
|
32
32
|
import { IChatSlashCommandService } from '../common/chatSlashCommands.service.js';
|
|
33
33
|
import { isResponseVM, isRequestVM, isWelcomeVM, ChatViewModel } from '../common/chatViewModel.js';
|
|
34
34
|
import { CodeBlockModelCollection } from '../common/codeBlockModelCollection.js';
|
|
35
|
-
import { IViewsService } from '../../../services/views/common/viewsService.service.js';
|
|
36
35
|
var ChatWidget_1;
|
|
37
36
|
const $ = $$1;
|
|
38
37
|
function revealLastElement(list) {
|
|
@@ -151,9 +150,6 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
151
150
|
get supportsFileReferences() {
|
|
152
151
|
return !!this.viewOptions.supportsFileReferences;
|
|
153
152
|
}
|
|
154
|
-
get providerId() {
|
|
155
|
-
return this.viewModel?.providerId || '';
|
|
156
|
-
}
|
|
157
153
|
get input() {
|
|
158
154
|
return this.inputPart;
|
|
159
155
|
}
|
|
@@ -164,23 +160,24 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
164
160
|
return this.inputPart.inputUri;
|
|
165
161
|
}
|
|
166
162
|
get contentHeight() {
|
|
167
|
-
return
|
|
163
|
+
return this.inputPart.contentHeight + this.tree.contentHeight;
|
|
168
164
|
}
|
|
169
165
|
render(parent) {
|
|
170
166
|
const viewId = 'viewId' in this.viewContext ? this.viewContext.viewId : undefined;
|
|
171
167
|
this.editorOptions = this._register(this.instantiationService.createInstance(ChatEditorOptions, viewId, this.styles.listForeground, this.styles.inputEditorBackground, this.styles.resultEditorBackground));
|
|
172
168
|
const renderInputOnTop = this.viewOptions.renderInputOnTop ?? false;
|
|
169
|
+
const renderFollowups = this.viewOptions.renderFollowups ?? !renderInputOnTop;
|
|
173
170
|
const renderStyle = this.viewOptions.renderStyle;
|
|
174
171
|
this.container = append(parent, $('.interactive-session'));
|
|
175
172
|
if (renderInputOnTop) {
|
|
176
|
-
this.createInput(this.container, { renderFollowups
|
|
173
|
+
this.createInput(this.container, { renderFollowups, renderStyle });
|
|
177
174
|
this.listContainer = append(this.container, $(`.interactive-list`));
|
|
178
175
|
}
|
|
179
176
|
else {
|
|
180
177
|
this.listContainer = append(this.container, $(`.interactive-list`));
|
|
181
|
-
this.createInput(this.container, { renderFollowups
|
|
178
|
+
this.createInput(this.container, { renderFollowups, renderStyle });
|
|
182
179
|
}
|
|
183
|
-
this.createList(this.listContainer, {
|
|
180
|
+
this.createList(this.listContainer, { ...this.viewOptions.rendererOptions, renderStyle });
|
|
184
181
|
this._register(this.editorOptions.onDidChange(() => this.onDidStyleChange()));
|
|
185
182
|
this.onDidStyleChange();
|
|
186
183
|
if (this.viewModel) {
|
|
@@ -406,7 +403,6 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
406
403
|
return;
|
|
407
404
|
}
|
|
408
405
|
this.chatService.notifyUserAction({
|
|
409
|
-
providerId: this.viewModel.providerId,
|
|
410
406
|
sessionId: this.viewModel.sessionId,
|
|
411
407
|
requestId: e.response.requestId,
|
|
412
408
|
agentId: e.response.agent?.id,
|
|
@@ -463,7 +459,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
463
459
|
}
|
|
464
460
|
this.requestInProgress.set(this.viewModel.requestInProgress);
|
|
465
461
|
this.onDidChangeItems();
|
|
466
|
-
if (( events.some(e => e?.kind === 'addRequest'))) {
|
|
462
|
+
if (( events.some(e => e?.kind === 'addRequest')) && this.visible) {
|
|
467
463
|
revealLastElement(this.tree);
|
|
468
464
|
this.focusInput();
|
|
469
465
|
}
|
|
@@ -473,7 +469,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
473
469
|
this.viewModel = undefined;
|
|
474
470
|
this.onDidChangeItems();
|
|
475
471
|
}));
|
|
476
|
-
this.inputPart.setState(
|
|
472
|
+
this.inputPart.setState(viewState.inputValue);
|
|
477
473
|
this.contribs.forEach(c => {
|
|
478
474
|
if (c.setInputState && viewState.inputState?.[c.id]) {
|
|
479
475
|
c.setInputState(viewState.inputState?.[c.id]);
|
|
@@ -539,7 +535,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
539
535
|
'query' in opts ? opts.query :
|
|
540
536
|
`${opts.prefix} ${editorValue}`;
|
|
541
537
|
const isUserQuery = !opts || 'prefix' in opts;
|
|
542
|
-
const result = await this.chatService.sendRequest(this.viewModel.sessionId, input, this.inputPart.implicitContextEnabled, this.location, { selectedAgent: this._lastSelectedAgent });
|
|
538
|
+
const result = await this.chatService.sendRequest(this.viewModel.sessionId, input, { implicitVariablesEnabled: this.inputPart.implicitContextEnabled, location: this.location, parserContext: { selectedAgent: this._lastSelectedAgent } });
|
|
543
539
|
if (result) {
|
|
544
540
|
const inputState = this.collectInputState();
|
|
545
541
|
this.inputPart.acceptInput(isUserQuery ? input : undefined, isUserQuery ? inputState : undefined);
|
|
@@ -685,13 +681,11 @@ ChatWidget = ChatWidget_1 = ( __decorate([
|
|
|
685
681
|
( __param(13, IThemeService)),
|
|
686
682
|
( __param(14, IChatSlashCommandService))
|
|
687
683
|
], ChatWidget));
|
|
688
|
-
|
|
684
|
+
class ChatWidgetService {
|
|
689
685
|
get lastFocusedWidget() {
|
|
690
686
|
return this._lastFocusedWidget;
|
|
691
687
|
}
|
|
692
|
-
constructor(
|
|
693
|
-
this.viewsService = viewsService;
|
|
694
|
-
this.chatContributionService = chatContributionService;
|
|
688
|
+
constructor() {
|
|
695
689
|
this._widgets = [];
|
|
696
690
|
this._lastFocusedWidget = undefined;
|
|
697
691
|
}
|
|
@@ -701,11 +695,6 @@ let ChatWidgetService = class ChatWidgetService {
|
|
|
701
695
|
getWidgetBySessionId(sessionId) {
|
|
702
696
|
return this._widgets.find(w => w.viewModel?.sessionId === sessionId);
|
|
703
697
|
}
|
|
704
|
-
async revealViewForProvider(providerId) {
|
|
705
|
-
const viewId = this.chatContributionService.getViewIdForProvider(providerId);
|
|
706
|
-
const view = await this.viewsService.openView(viewId);
|
|
707
|
-
return view?.widget;
|
|
708
|
-
}
|
|
709
698
|
setLastFocusedWidget(widget) {
|
|
710
699
|
if (widget === this._lastFocusedWidget) {
|
|
711
700
|
return;
|
|
@@ -719,9 +708,5 @@ let ChatWidgetService = class ChatWidgetService {
|
|
|
719
708
|
this._widgets.push(newWidget);
|
|
720
709
|
return combinedDisposable(newWidget.onDidFocus(() => this.setLastFocusedWidget(newWidget)), toDisposable(() => this._widgets.splice(this._widgets.indexOf(newWidget), 1)));
|
|
721
710
|
}
|
|
722
|
-
}
|
|
723
|
-
ChatWidgetService = ( __decorate([
|
|
724
|
-
( __param(0, IViewsService)),
|
|
725
|
-
( __param(1, IChatContributionService))
|
|
726
|
-
], ChatWidgetService));
|
|
711
|
+
}
|
|
727
712
|
export { ChatWidget, ChatWidgetService };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import n from '../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
|
|
2
|
-
var css = ".interactive-result-code-block{position:relative}.interactive-result-code-block .monaco-toolbar{background-color:var(--vscode-interactive-result-editor-background-color,var(--vscode-editor-background));border:1px solid var(--vscode-chat-requestBorder);display:none;height:26px;position:absolute;right:10px;top:-13px;z-index:100}.interactive-result-code-block .monaco-toolbar .action-item{height:24px;margin:1px 2px;width:24px}.interactive-result-code-block .monaco-toolbar .action-item .codicon{margin:1px}.interactive-result-code-block .monaco-toolbar:focus-within,.interactive-result-code-block.focused .monaco-toolbar,.interactive-result-code-block:hover .monaco-toolbar{border-radius:2px;display:initial}.interactive-result-code-block .interactive-result-code-block-toolbar.force-visibility .monaco-toolbar{display:initial!important}.interactive-result-code-block{background-color:var(--vscode-interactive-result-editor-background-color);border:1px solid var(--vscode-input-border,transparent)
|
|
2
|
+
var css = ".interactive-result-code-block{position:relative}.interactive-result-code-block .monaco-toolbar{background-color:var(--vscode-interactive-result-editor-background-color,var(--vscode-editor-background));border:1px solid var(--vscode-chat-requestBorder);display:none;height:26px;position:absolute;right:10px;top:-13px;z-index:100}.interactive-result-code-block .monaco-toolbar .action-item{height:24px;margin:1px 2px;width:24px}.interactive-result-code-block .monaco-toolbar .action-item .codicon{margin:1px}.interactive-result-code-block .monaco-toolbar:focus-within,.interactive-result-code-block.focused .monaco-toolbar,.interactive-result-code-block:hover .monaco-toolbar{border-radius:2px;display:initial}.interactive-result-code-block .interactive-result-code-block-toolbar.force-visibility .monaco-toolbar{display:initial!important}.interactive-item-container .value .rendered-markdown [data-code]{margin:16px 0}.interactive-result-code-block{background-color:var(--vscode-interactive-result-editor-background-color);border:1px solid var(--vscode-input-border,transparent)}.interactive-result-code-block:has(.monaco-editor.focused){border-color:var(--vscode-focusBorder,transparent)}.interactive-result-code-block,.interactive-result-code-block .monaco-editor,.interactive-result-code-block .monaco-editor .overflow-guard{border-radius:4px}.interactive-result-code-block .interactive-result-vulns{font-size:.9em;padding:0 8px 2px}.interactive-result-code-block .interactive-result-vulns-header{display:flex;height:22px}.interactive-result-code-block .interactive-result-vulns-header,.interactive-result-code-block .interactive-result-vulns-list{opacity:.8}.interactive-result-code-block .interactive-result-vulns-list{margin:0;padding-bottom:3px;padding-left:16px!important}.interactive-result-code-block.chat-vulnerabilities-collapsed .interactive-result-vulns-list{display:none}.interactive-result-code-block .interactive-result-vulns-list .chat-vuln-title{font-weight:700}.interactive-result-code-block.no-vulns .interactive-result-vulns{display:none}.interactive-result-code-block .interactive-result-vulns-header .monaco-button{border:none;color:var(--vscode-foreground)!important;display:inline-flex;justify-content:normal;padding:0;text-align:initial;user-select:none;width:100%}.interactive-result-code-block .interactive-result-vulns-header .monaco-text-button:focus{outline:none}.interactive-result-code-block .interactive-result-vulns-header .monaco-text-button:focus-visible{outline:1px solid var(--vscode-focusBorder)}.interactive-result-code-block.compare.no-diff .message{display:inherit}.interactive-result-code-block.compare .message{display:none;padding:6px}.interactive-result-code-block.compare .message A{color:var(--vscode-textLink-foreground);cursor:pointer}";
|
|
3
3
|
n(css,{});
|
|
4
4
|
export { css, css as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import './codeBlockPart.css.js';
|
|
3
|
-
import { append, hide, show, clearNode, $ as $$1 } from '../../../../base/browser/dom.js';
|
|
3
|
+
import { append, hide, show, clearNode, reset, $ as $$1 } from '../../../../base/browser/dom.js';
|
|
4
4
|
import { Button } from '../../../../base/browser/ui/button/button.js';
|
|
5
5
|
import { Codicon } from '../../../../base/common/codicons.js';
|
|
6
6
|
import { Emitter } from '../../../../base/common/event.js';
|
|
7
|
-
import { Disposable } from '../../../../base/common/lifecycle.js';
|
|
7
|
+
import { Disposable, DisposableStore, MutableDisposable } from '../../../../base/common/lifecycle.js';
|
|
8
8
|
import { Schemas } from '../../../../base/common/network.js';
|
|
9
9
|
import { URI } from '../../../../base/common/uri.js';
|
|
10
10
|
import { EditorExtensionsRegistry } from '../../../../editor/browser/editorExtensions.js';
|
|
@@ -16,7 +16,6 @@ import { ITextModelService } from '../../../../editor/common/services/resolverSe
|
|
|
16
16
|
import { BracketMatchingController } from '../../../../editor/contrib/bracketMatching/browser/bracketMatching.js';
|
|
17
17
|
import { ContextMenuController } from '../../../../editor/contrib/contextmenu/browser/contextmenu.js';
|
|
18
18
|
import { GotoDefinitionAtPositionEditorContribution } from '../../../../editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js';
|
|
19
|
-
import { HoverController } from '../../../../editor/contrib/hover/browser/hover.js';
|
|
20
19
|
import { ViewportSemanticTokensContribution } from '../../../../editor/contrib/semanticTokens/browser/viewportSemanticTokens.js';
|
|
21
20
|
import { SmartSelectController } from '../../../../editor/contrib/smartSelect/browser/smartSelect.js';
|
|
22
21
|
import { WordHighlighterContribution } from '../../../../editor/contrib/wordHighlighter/browser/wordHighlighter.js';
|
|
@@ -32,6 +31,18 @@ import { MenuPreventer } from '../../codeEditor/browser/menuPreventer.js';
|
|
|
32
31
|
import { SelectionClipboardContributionID } from '../../codeEditor/browser/selectionClipboard.js';
|
|
33
32
|
import { getSimpleEditorOptions } from '../../codeEditor/browser/simpleEditorOptions.js';
|
|
34
33
|
import { TabFocus } from '../../../../editor/browser/config/tabFocus.js';
|
|
34
|
+
import { DiffEditorWidget } from '../../../../editor/browser/widget/diffEditor/diffEditorWidget.js';
|
|
35
|
+
import { HoverController } from '../../../../editor/contrib/hover/browser/hoverController.js';
|
|
36
|
+
import { CONTEXT_CHAT_EDIT_APPLIED } from '../common/chatContextKeys.js';
|
|
37
|
+
import { ILabelService } from '../../../../platform/label/common/label.service.js';
|
|
38
|
+
import { renderFormattedText } from '../../../../base/browser/formattedTextRenderer.js';
|
|
39
|
+
import { IOpenerService } from '../../../../platform/opener/common/opener.service.js';
|
|
40
|
+
import { TextEdit } from '../../../../editor/common/languages.js';
|
|
41
|
+
import { ICodeEditorService } from '../../../../editor/browser/services/codeEditorService.js';
|
|
42
|
+
import { isEqual } from '../../../../base/common/resources.js';
|
|
43
|
+
import { DefaultModelSHA1Computer } from '../../../../editor/common/services/modelService.js';
|
|
44
|
+
import { IDialogService } from '../../../../platform/dialogs/common/dialogs.service.js';
|
|
45
|
+
import { TextModelText } from '../../../../editor/common/model/textModelText.js';
|
|
35
46
|
const _moduleId = "vs/workbench/contrib/chat/browser/codeBlockPart";
|
|
36
47
|
const $ = $$1;
|
|
37
48
|
const localFileLanguageId = 'vscode-local-file';
|
|
@@ -73,6 +84,7 @@ let CodeBlockPart = class CodeBlockPart extends Disposable {
|
|
|
73
84
|
this._onDidChangeContentHeight = this._register(( (new Emitter())));
|
|
74
85
|
this.onDidChangeContentHeight = this._onDidChangeContentHeight.event;
|
|
75
86
|
this.currentScrollWidth = 0;
|
|
87
|
+
this.disposableStore = this._register(( (new DisposableStore())));
|
|
76
88
|
this.element = $('.interactive-result-code-block');
|
|
77
89
|
this.contextKeyService = this._register(contextKeyService.createScoped(this.element));
|
|
78
90
|
const scopedInstantiationService = instantiationService.createChild(( (new ServiceCollection([IContextKeyService, this.contextKeyService]))));
|
|
@@ -247,8 +259,9 @@ let CodeBlockPart = class CodeBlockPart extends Disposable {
|
|
|
247
259
|
await this.updateEditor(data);
|
|
248
260
|
this.layout(width);
|
|
249
261
|
if (editable) {
|
|
250
|
-
this.
|
|
251
|
-
this.
|
|
262
|
+
this.disposableStore.clear();
|
|
263
|
+
this.disposableStore.add(this.editor.onDidFocusEditorWidget(() => TabFocus.setTabFocusMode(true)));
|
|
264
|
+
this.disposableStore.add(this.editor.onDidBlurEditorWidget(() => TabFocus.setTabFocusMode(false)));
|
|
252
265
|
}
|
|
253
266
|
this.editor.updateOptions({ ariaLabel: ( localizeWithPath(_moduleId, 3, "Code block {0}", data.codeBlockIndex + 1)), readOnly: !editable });
|
|
254
267
|
if (data.hideToolbar) {
|
|
@@ -331,4 +344,351 @@ ChatCodeBlockContentProvider = ( (__decorate([
|
|
|
331
344
|
( (__param(0, ITextModelService))),
|
|
332
345
|
( (__param(1, IModelService)))
|
|
333
346
|
], ChatCodeBlockContentProvider)));
|
|
334
|
-
|
|
347
|
+
let CodeCompareBlockPart = class CodeCompareBlockPart extends Disposable {
|
|
348
|
+
constructor(options, menuId, delegate, overflowWidgetsDomNode, instantiationService, contextKeyService, modelService, configurationService, accessibilityService, labelService, openerService) {
|
|
349
|
+
super();
|
|
350
|
+
this.options = options;
|
|
351
|
+
this.menuId = menuId;
|
|
352
|
+
this.modelService = modelService;
|
|
353
|
+
this.configurationService = configurationService;
|
|
354
|
+
this.accessibilityService = accessibilityService;
|
|
355
|
+
this.labelService = labelService;
|
|
356
|
+
this.openerService = openerService;
|
|
357
|
+
this._onDidChangeContentHeight = this._register(( (new Emitter())));
|
|
358
|
+
this.onDidChangeContentHeight = this._onDidChangeContentHeight.event;
|
|
359
|
+
this._lastDiffEditorViewModel = this._store.add(( (new MutableDisposable())));
|
|
360
|
+
this.currentScrollWidth = 0;
|
|
361
|
+
this.element = $('.interactive-result-code-block');
|
|
362
|
+
this.element.classList.add('compare');
|
|
363
|
+
this.messageElement = append(this.element, $('.message'));
|
|
364
|
+
this.messageElement.setAttribute('role', 'status');
|
|
365
|
+
this.messageElement.tabIndex = 0;
|
|
366
|
+
this.contextKeyService = this._register(contextKeyService.createScoped(this.element));
|
|
367
|
+
const scopedInstantiationService = instantiationService.createChild(( (new ServiceCollection([IContextKeyService, this.contextKeyService]))));
|
|
368
|
+
const editorElement = append(this.element, $('.interactive-result-editor'));
|
|
369
|
+
this.diffEditor = this.createDiffEditor(scopedInstantiationService, editorElement, {
|
|
370
|
+
...getSimpleEditorOptions(this.configurationService),
|
|
371
|
+
lineNumbers: 'on',
|
|
372
|
+
selectOnLineNumbers: true,
|
|
373
|
+
scrollBeyondLastLine: false,
|
|
374
|
+
lineDecorationsWidth: 12,
|
|
375
|
+
dragAndDrop: false,
|
|
376
|
+
padding: { top: defaultCodeblockPadding, bottom: defaultCodeblockPadding },
|
|
377
|
+
mouseWheelZoom: false,
|
|
378
|
+
scrollbar: {
|
|
379
|
+
vertical: 'hidden',
|
|
380
|
+
alwaysConsumeMouseWheel: false
|
|
381
|
+
},
|
|
382
|
+
definitionLinkOpensInPeek: false,
|
|
383
|
+
gotoLocation: {
|
|
384
|
+
multiple: 'goto',
|
|
385
|
+
multipleDeclarations: 'goto',
|
|
386
|
+
multipleDefinitions: 'goto',
|
|
387
|
+
multipleImplementations: 'goto',
|
|
388
|
+
},
|
|
389
|
+
ariaLabel: ( localizeWithPath(_moduleId, 0, 'Code block')),
|
|
390
|
+
overflowWidgetsDomNode,
|
|
391
|
+
...this.getEditorOptionsFromConfig(),
|
|
392
|
+
});
|
|
393
|
+
const toolbarElement = append(this.element, $('.interactive-result-code-block-toolbar'));
|
|
394
|
+
const editorScopedService = this.diffEditor.getModifiedEditor().contextKeyService.createScoped(toolbarElement);
|
|
395
|
+
const editorScopedInstantiationService = scopedInstantiationService.createChild(( (new ServiceCollection([IContextKeyService, editorScopedService]))));
|
|
396
|
+
this.toolbar = this._register(editorScopedInstantiationService.createInstance(MenuWorkbenchToolBar, toolbarElement, menuId, {
|
|
397
|
+
menuOptions: {
|
|
398
|
+
shouldForwardArgs: true
|
|
399
|
+
}
|
|
400
|
+
}));
|
|
401
|
+
this._register(this.toolbar.onDidChangeDropdownVisibility(e => {
|
|
402
|
+
toolbarElement.classList.toggle('force-visibility', e);
|
|
403
|
+
}));
|
|
404
|
+
this._configureForScreenReader();
|
|
405
|
+
this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(() => this._configureForScreenReader()));
|
|
406
|
+
this._register(this.configurationService.onDidChangeConfiguration((e) => {
|
|
407
|
+
if (( (e.affectedKeys.has(
|
|
408
|
+
"accessibility.verbosity.panelChat"
|
|
409
|
+
)))) {
|
|
410
|
+
this._configureForScreenReader();
|
|
411
|
+
}
|
|
412
|
+
}));
|
|
413
|
+
this._register(this.options.onDidChange(() => {
|
|
414
|
+
this.diffEditor.updateOptions(this.getEditorOptionsFromConfig());
|
|
415
|
+
}));
|
|
416
|
+
this._register(this.diffEditor.getModifiedEditor().onDidScrollChange(e => {
|
|
417
|
+
this.currentScrollWidth = e.scrollWidth;
|
|
418
|
+
}));
|
|
419
|
+
this._register(this.diffEditor.onDidContentSizeChange(e => {
|
|
420
|
+
if (e.contentHeightChanged) {
|
|
421
|
+
this._onDidChangeContentHeight.fire();
|
|
422
|
+
}
|
|
423
|
+
}));
|
|
424
|
+
this._register(this.diffEditor.getModifiedEditor().onDidBlurEditorWidget(() => {
|
|
425
|
+
this.element.classList.remove('focused');
|
|
426
|
+
WordHighlighterContribution.get(this.diffEditor.getModifiedEditor())?.stopHighlighting();
|
|
427
|
+
this.clearWidgets();
|
|
428
|
+
}));
|
|
429
|
+
this._register(this.diffEditor.getModifiedEditor().onDidFocusEditorWidget(() => {
|
|
430
|
+
this.element.classList.add('focused');
|
|
431
|
+
WordHighlighterContribution.get(this.diffEditor.getModifiedEditor())?.restoreViewState(true);
|
|
432
|
+
}));
|
|
433
|
+
if (delegate.onDidScroll) {
|
|
434
|
+
this._register(delegate.onDidScroll(e => {
|
|
435
|
+
this.clearWidgets();
|
|
436
|
+
}));
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
get uri() {
|
|
440
|
+
return this.diffEditor.getModifiedEditor().getModel()?.uri;
|
|
441
|
+
}
|
|
442
|
+
createDiffEditor(instantiationService, parent, options) {
|
|
443
|
+
const widgetOptions = {
|
|
444
|
+
isSimpleWidget: false,
|
|
445
|
+
contributions: EditorExtensionsRegistry.getSomeEditorContributions([
|
|
446
|
+
MenuPreventer.ID,
|
|
447
|
+
SelectionClipboardContributionID,
|
|
448
|
+
ContextMenuController.ID,
|
|
449
|
+
WordHighlighterContribution.ID,
|
|
450
|
+
ViewportSemanticTokensContribution.ID,
|
|
451
|
+
BracketMatchingController.ID,
|
|
452
|
+
SmartSelectController.ID,
|
|
453
|
+
HoverController.ID,
|
|
454
|
+
GotoDefinitionAtPositionEditorContribution.ID,
|
|
455
|
+
])
|
|
456
|
+
};
|
|
457
|
+
return this._register(instantiationService.createInstance(DiffEditorWidget, parent, {
|
|
458
|
+
scrollbar: { useShadows: false, alwaysConsumeMouseWheel: false, ignoreHorizontalScrollbarInContentHeight: true, },
|
|
459
|
+
renderMarginRevertIcon: false,
|
|
460
|
+
diffCodeLens: false,
|
|
461
|
+
scrollBeyondLastLine: false,
|
|
462
|
+
stickyScroll: { enabled: false },
|
|
463
|
+
originalAriaLabel: ( localizeWithPath(_moduleId, 6, 'Original')),
|
|
464
|
+
modifiedAriaLabel: ( localizeWithPath(_moduleId, 7, 'Modified')),
|
|
465
|
+
diffAlgorithm: 'advanced',
|
|
466
|
+
readOnly: false,
|
|
467
|
+
isInEmbeddedEditor: true,
|
|
468
|
+
useInlineViewWhenSpaceIsLimited: false,
|
|
469
|
+
hideUnchangedRegions: { enabled: true, contextLineCount: 1 },
|
|
470
|
+
...options
|
|
471
|
+
}, { originalEditor: widgetOptions, modifiedEditor: widgetOptions }));
|
|
472
|
+
}
|
|
473
|
+
focus() {
|
|
474
|
+
this.diffEditor.focus();
|
|
475
|
+
}
|
|
476
|
+
updatePaddingForLayout() {
|
|
477
|
+
const horizontalScrollbarVisible = this.currentScrollWidth > this.diffEditor.getModifiedEditor().getLayoutInfo().contentWidth;
|
|
478
|
+
const scrollbarHeight = this.diffEditor.getModifiedEditor().getLayoutInfo().horizontalScrollbarHeight;
|
|
479
|
+
const bottomPadding = horizontalScrollbarVisible ?
|
|
480
|
+
Math.max(defaultCodeblockPadding - scrollbarHeight, 2) :
|
|
481
|
+
defaultCodeblockPadding;
|
|
482
|
+
this.diffEditor.updateOptions({ padding: { top: defaultCodeblockPadding, bottom: bottomPadding } });
|
|
483
|
+
}
|
|
484
|
+
_configureForScreenReader() {
|
|
485
|
+
const toolbarElt = this.toolbar.getElement();
|
|
486
|
+
if (this.accessibilityService.isScreenReaderOptimized()) {
|
|
487
|
+
toolbarElt.style.display = 'block';
|
|
488
|
+
toolbarElt.ariaLabel = this.configurationService.getValue("accessibility.verbosity.panelChat" ) ? ( localizeWithPath(_moduleId, 1, 'Toolbar for code block which can be reached via tab')) : ( localizeWithPath(_moduleId, 2, 'Code block toolbar'));
|
|
489
|
+
}
|
|
490
|
+
else {
|
|
491
|
+
toolbarElt.style.display = '';
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
getEditorOptionsFromConfig() {
|
|
495
|
+
return {
|
|
496
|
+
wordWrap: this.options.configuration.resultEditor.wordWrap,
|
|
497
|
+
fontLigatures: this.options.configuration.resultEditor.fontLigatures,
|
|
498
|
+
bracketPairColorization: this.options.configuration.resultEditor.bracketPairColorization,
|
|
499
|
+
fontFamily: this.options.configuration.resultEditor.fontFamily === 'default' ?
|
|
500
|
+
EDITOR_FONT_DEFAULTS.fontFamily :
|
|
501
|
+
this.options.configuration.resultEditor.fontFamily,
|
|
502
|
+
fontSize: this.options.configuration.resultEditor.fontSize,
|
|
503
|
+
fontWeight: this.options.configuration.resultEditor.fontWeight,
|
|
504
|
+
lineHeight: this.options.configuration.resultEditor.lineHeight,
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
layout(width) {
|
|
508
|
+
const contentHeight = this.getContentHeight();
|
|
509
|
+
const editorBorder = 2;
|
|
510
|
+
const dimension = { width: width - editorBorder, height: contentHeight };
|
|
511
|
+
this.element.style.height = `${dimension.height}px`;
|
|
512
|
+
this.element.style.width = `${dimension.width}px`;
|
|
513
|
+
this.diffEditor.layout(dimension);
|
|
514
|
+
this.updatePaddingForLayout();
|
|
515
|
+
}
|
|
516
|
+
getContentHeight() {
|
|
517
|
+
return this.diffEditor.getContentHeight();
|
|
518
|
+
}
|
|
519
|
+
async render(data, width, token) {
|
|
520
|
+
if (data.parentContextKeyService) {
|
|
521
|
+
this.contextKeyService.updateParent(data.parentContextKeyService);
|
|
522
|
+
}
|
|
523
|
+
if (this.options.configuration.resultEditor.wordWrap === 'on') {
|
|
524
|
+
this.layout(width);
|
|
525
|
+
}
|
|
526
|
+
await this.updateEditor(data, token);
|
|
527
|
+
this.layout(width);
|
|
528
|
+
this.diffEditor.updateOptions({ ariaLabel: ( localizeWithPath(_moduleId, 8, "Code Edits")) });
|
|
529
|
+
if (data.hideToolbar) {
|
|
530
|
+
hide(this.toolbar.getElement());
|
|
531
|
+
}
|
|
532
|
+
else {
|
|
533
|
+
show(this.toolbar.getElement());
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
reset() {
|
|
537
|
+
this.clearWidgets();
|
|
538
|
+
}
|
|
539
|
+
clearWidgets() {
|
|
540
|
+
HoverController.get(this.diffEditor.getOriginalEditor())?.hideContentHover();
|
|
541
|
+
HoverController.get(this.diffEditor.getModifiedEditor())?.hideContentHover();
|
|
542
|
+
}
|
|
543
|
+
async updateEditor(data, token) {
|
|
544
|
+
if (!isResponseVM(data.element)) {
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
const isEditApplied = Boolean(data.edit.state?.applied ?? 0);
|
|
548
|
+
CONTEXT_CHAT_EDIT_APPLIED.bindTo(this.contextKeyService).set(isEditApplied);
|
|
549
|
+
this.element.classList.toggle('no-diff', isEditApplied);
|
|
550
|
+
if (data.edit.state?.applied) {
|
|
551
|
+
const uriLabel = this.labelService.getUriLabel(data.edit.uri, { relative: true, noPrefix: true });
|
|
552
|
+
const template = data.edit.state.applied > 1
|
|
553
|
+
? ( localizeWithPath(
|
|
554
|
+
_moduleId,
|
|
555
|
+
9,
|
|
556
|
+
"Made {0} changes in [[{1}]]",
|
|
557
|
+
data.edit.state.applied,
|
|
558
|
+
uriLabel
|
|
559
|
+
))
|
|
560
|
+
: ( localizeWithPath(_moduleId, 10, "Made 1 change in [[{0}]]", uriLabel));
|
|
561
|
+
const message = renderFormattedText(template, {
|
|
562
|
+
actionHandler: {
|
|
563
|
+
callback: () => {
|
|
564
|
+
this.openerService.open(data.edit.uri, { fromUserGesture: true, allowCommands: false });
|
|
565
|
+
},
|
|
566
|
+
disposables: this._store,
|
|
567
|
+
}
|
|
568
|
+
});
|
|
569
|
+
reset(this.messageElement, message);
|
|
570
|
+
}
|
|
571
|
+
const diffData = await data.diffData;
|
|
572
|
+
if (!diffData) {
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
if (!isEditApplied) {
|
|
576
|
+
const viewModel = this.diffEditor.createViewModel({
|
|
577
|
+
original: diffData.original,
|
|
578
|
+
modified: diffData.modified
|
|
579
|
+
});
|
|
580
|
+
await viewModel.waitForDiff();
|
|
581
|
+
if (token.isCancellationRequested) {
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
this.diffEditor.setModel(viewModel);
|
|
585
|
+
this._lastDiffEditorViewModel.value = viewModel;
|
|
586
|
+
}
|
|
587
|
+
else {
|
|
588
|
+
this.diffEditor.setModel(null);
|
|
589
|
+
this._lastDiffEditorViewModel.value = undefined;
|
|
590
|
+
}
|
|
591
|
+
this.toolbar.context = {
|
|
592
|
+
edit: data.edit,
|
|
593
|
+
element: data.element,
|
|
594
|
+
diffEditor: this.diffEditor,
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
};
|
|
598
|
+
CodeCompareBlockPart = ( (__decorate([
|
|
599
|
+
( (__param(4, IInstantiationService))),
|
|
600
|
+
( (__param(5, IContextKeyService))),
|
|
601
|
+
( (__param(6, IModelService))),
|
|
602
|
+
( (__param(7, IConfigurationService))),
|
|
603
|
+
( (__param(8, IAccessibilityService))),
|
|
604
|
+
( (__param(9, ILabelService))),
|
|
605
|
+
( (__param(10, IOpenerService)))
|
|
606
|
+
], CodeCompareBlockPart)));
|
|
607
|
+
let DefaultChatTextEditor = class DefaultChatTextEditor {
|
|
608
|
+
constructor(modelService, editorService, dialogService) {
|
|
609
|
+
this.modelService = modelService;
|
|
610
|
+
this.editorService = editorService;
|
|
611
|
+
this.dialogService = dialogService;
|
|
612
|
+
this._sha1 = ( (new DefaultModelSHA1Computer()));
|
|
613
|
+
}
|
|
614
|
+
async apply(response, item) {
|
|
615
|
+
if (!response.response.value.includes(item)) {
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
if (item.state?.applied) {
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
let diffEditor;
|
|
622
|
+
for (const candidate of this.editorService.listDiffEditors()) {
|
|
623
|
+
if (!candidate.getContainerDomNode().isConnected) {
|
|
624
|
+
continue;
|
|
625
|
+
}
|
|
626
|
+
const model = candidate.getModel();
|
|
627
|
+
if (!model || !isEqual(model.original.uri, item.uri) || model.modified.uri.scheme !== Schemas.vscodeChatCodeCompreBlock) {
|
|
628
|
+
diffEditor = candidate;
|
|
629
|
+
break;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
const edits = diffEditor
|
|
633
|
+
? await this._applyWithDiffEditor(diffEditor, item)
|
|
634
|
+
: await this._apply(item);
|
|
635
|
+
response.setEditApplied(item, edits);
|
|
636
|
+
}
|
|
637
|
+
async _applyWithDiffEditor(diffEditor, item) {
|
|
638
|
+
const model = diffEditor.getModel();
|
|
639
|
+
if (!model) {
|
|
640
|
+
return 0;
|
|
641
|
+
}
|
|
642
|
+
const diff = diffEditor.getDiffComputationResult();
|
|
643
|
+
if (!diff || diff.identical) {
|
|
644
|
+
return 0;
|
|
645
|
+
}
|
|
646
|
+
if (!(await this._checkSha1(model.original, item))) {
|
|
647
|
+
return 0;
|
|
648
|
+
}
|
|
649
|
+
const modified = ( (new TextModelText(model.modified)));
|
|
650
|
+
const edits = ( (diff.changes2.map(i => i.toRangeMapping().toTextEdit(modified).toSingleEditOperation())));
|
|
651
|
+
model.original.pushStackElement();
|
|
652
|
+
model.original.pushEditOperations(null, edits, () => null);
|
|
653
|
+
model.original.pushStackElement();
|
|
654
|
+
return edits.length;
|
|
655
|
+
}
|
|
656
|
+
async _apply(item) {
|
|
657
|
+
const ref = await this.modelService.createModelReference(item.uri);
|
|
658
|
+
try {
|
|
659
|
+
if (!(await this._checkSha1(ref.object.textEditorModel, item))) {
|
|
660
|
+
return 0;
|
|
661
|
+
}
|
|
662
|
+
ref.object.textEditorModel.pushStackElement();
|
|
663
|
+
let total = 0;
|
|
664
|
+
for (const group of item.edits) {
|
|
665
|
+
const edits = ( (group.map(TextEdit.asEditOperation)));
|
|
666
|
+
ref.object.textEditorModel.pushEditOperations(null, edits, () => null);
|
|
667
|
+
total += edits.length;
|
|
668
|
+
}
|
|
669
|
+
ref.object.textEditorModel.pushStackElement();
|
|
670
|
+
return total;
|
|
671
|
+
}
|
|
672
|
+
finally {
|
|
673
|
+
ref.dispose();
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
async _checkSha1(model, item) {
|
|
677
|
+
if (item.state?.sha1 && this._sha1.computeSHA1(model) && this._sha1.computeSHA1(model) !== item.state.sha1) {
|
|
678
|
+
const result = await this.dialogService.confirm({
|
|
679
|
+
message: ( localizeWithPath(_moduleId, 11, "The original file has been modified.")),
|
|
680
|
+
detail: ( localizeWithPath(_moduleId, 12, "Do you want to apply the changes anyway?")),
|
|
681
|
+
});
|
|
682
|
+
if (!result.confirmed) {
|
|
683
|
+
return false;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
return true;
|
|
687
|
+
}
|
|
688
|
+
};
|
|
689
|
+
DefaultChatTextEditor = ( (__decorate([
|
|
690
|
+
( (__param(0, ITextModelService))),
|
|
691
|
+
( (__param(1, ICodeEditorService))),
|
|
692
|
+
( (__param(2, IDialogService)))
|
|
693
|
+
], DefaultChatTextEditor)));
|
|
694
|
+
export { ChatCodeBlockContentProvider, CodeBlockPart, CodeCompareBlockPart, DefaultChatTextEditor, localFileLanguageId, parseLocalFileData };
|
|
@@ -8,6 +8,7 @@ import { Range } from '../../../../../editor/common/core/range.js';
|
|
|
8
8
|
import { ITextModelService } from '../../../../../editor/common/services/resolverService.js';
|
|
9
9
|
import { localizeWithPath } from '../../../../../nls.js';
|
|
10
10
|
import { Action2, registerAction2 } from '../../../../../platform/actions/common/actions.js';
|
|
11
|
+
import { ICommandService } from '../../../../../platform/commands/common/commands.service.js';
|
|
11
12
|
import { ILabelService } from '../../../../../platform/label/common/label.service.js';
|
|
12
13
|
import { ILogService } from '../../../../../platform/log/common/log.service.js';
|
|
13
14
|
import { IQuickInputService } from '../../../../../platform/quickinput/common/quickInput.service.js';
|
|
@@ -202,9 +203,41 @@ class AddDynamicVariableAction extends Action2 {
|
|
|
202
203
|
if (!isAddDynamicVariableContext(context)) {
|
|
203
204
|
return;
|
|
204
205
|
}
|
|
206
|
+
let range = context.range;
|
|
207
|
+
const variableData = context.variableData;
|
|
208
|
+
const doCleanup = () => {
|
|
209
|
+
context.widget.inputEditor.executeEdits('chatInsertDynamicVariableWithArguments', [{ range: context.range, text: `` }]);
|
|
210
|
+
};
|
|
211
|
+
if (context.command) {
|
|
212
|
+
const commandService = accessor.get(ICommandService);
|
|
213
|
+
const selection = await commandService.executeCommand(context.command.id, ...(context.command.arguments ?? []));
|
|
214
|
+
if (!selection) {
|
|
215
|
+
doCleanup();
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
const insertText = ':' + selection;
|
|
219
|
+
const insertRange = ( (new Range(
|
|
220
|
+
range.startLineNumber,
|
|
221
|
+
range.endColumn,
|
|
222
|
+
range.endLineNumber,
|
|
223
|
+
range.endColumn + insertText.length
|
|
224
|
+
)));
|
|
225
|
+
range = ( (new Range(
|
|
226
|
+
range.startLineNumber,
|
|
227
|
+
range.startColumn,
|
|
228
|
+
range.endLineNumber,
|
|
229
|
+
range.endColumn + insertText.length
|
|
230
|
+
)));
|
|
231
|
+
const editor = context.widget.inputEditor;
|
|
232
|
+
const success = editor.executeEdits('chatInsertDynamicVariableWithArguments', [{ range: insertRange, text: insertText + ' ' }]);
|
|
233
|
+
if (!success) {
|
|
234
|
+
doCleanup();
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
205
238
|
context.widget.getContrib(ChatDynamicVariableModel.ID)?.addReference({
|
|
206
|
-
range:
|
|
207
|
-
data:
|
|
239
|
+
range: range,
|
|
240
|
+
data: variableData
|
|
208
241
|
});
|
|
209
242
|
}
|
|
210
243
|
}
|