@codingame/monaco-vscode-api 6.0.2 → 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/monaco.d.ts +1 -1
- package/monaco.js +1 -1
- 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/editor/editor.api.d.ts +31 -5
- package/vscode/src/vs/platform/accessibility/browser/accessibilityService.js +21 -0
- package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +5 -6
- package/vscode/src/vs/platform/actionWidget/browser/actionWidget.js +1 -1
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +27 -6
- package/vscode/src/vs/platform/actions/browser/floatingMenu.js +1 -1
- package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.css.js +1 -1
- package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.js +33 -3
- package/vscode/src/vs/platform/actions/browser/toolbar.js +2 -1
- package/vscode/src/vs/platform/actions/common/actions.d.ts +3 -0
- package/vscode/src/vs/platform/actions/common/actions.js +3 -0
- package/vscode/src/vs/platform/actions/common/menuService.js +3 -2
- package/vscode/src/vs/platform/clipboard/browser/clipboardService.js +1 -1
- package/vscode/src/vs/platform/configuration/common/configurationRegistry.d.ts +7 -5
- package/vscode/src/vs/platform/configuration/common/configurationRegistry.js +109 -13
- package/vscode/src/vs/platform/diagnostics/common/diagnostics.d.ts +2 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.d.ts +12 -6
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +2 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.service.d.ts +3 -3
- package/vscode/src/vs/platform/extensionManagement/common/extensionsScannerService.js +20 -10
- package/vscode/src/vs/platform/extensions/common/extensionValidator.js +46 -8
- package/vscode/src/vs/platform/extensions/common/extensions.d.ts +1 -1
- package/vscode/src/vs/platform/extensions/common/extensions.js +12 -3
- package/vscode/src/vs/platform/extensions/common/extensionsApiProposals.js +368 -0
- package/vscode/src/vs/platform/files/common/watcher.js +21 -24
- package/vscode/src/vs/platform/list/browser/listService.js +2 -1
- package/vscode/src/vs/platform/observable/common/platformObservableUtils.js +2 -2
- package/vscode/src/vs/platform/opener/browser/link.js +1 -1
- package/vscode/src/vs/platform/product/common/product.js +1 -1
- package/vscode/src/vs/platform/quickinput/browser/quickInputTree.js +1 -1
- package/vscode/src/vs/platform/remote/common/remoteExtensionsScanner.service.d.ts +0 -2
- package/vscode/src/vs/platform/request/common/request.js +18 -8
- package/vscode/src/vs/platform/terminal/common/capabilities/capabilities.d.ts +2 -6
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetection/promptInputModel.d.ts +8 -1
- package/vscode/src/vs/platform/theme/common/colorUtils.d.ts +1 -1
- package/vscode/src/vs/platform/theme/common/colorUtils.js +25 -5
- package/vscode/src/vs/platform/theme/common/colors/baseColors.js +1 -1
- package/vscode/src/vs/platform/theme/common/colors/chartsColors.js +6 -6
- package/vscode/src/vs/platform/theme/common/colors/editorColors.js +35 -35
- package/vscode/src/vs/platform/theme/common/colors/inputColors.js +9 -9
- package/vscode/src/vs/platform/theme/common/colors/listColors.js +11 -11
- package/vscode/src/vs/platform/theme/common/colors/menuColors.js +4 -4
- package/vscode/src/vs/platform/theme/common/colors/minimapColors.js +5 -5
- package/vscode/src/vs/platform/theme/common/colors/miscColors.js +1 -1
- package/vscode/src/vs/platform/theme/common/colors/quickpickColors.js +5 -5
- package/vscode/src/vs/platform/tunnel/common/tunnel.js +4 -1
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.js +75 -19
- package/vscode/src/vs/platform/window/common/window.d.ts +2 -2
- package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +32 -25
- package/vscode/src/vs/workbench/api/common/extHost.common.services.js +2 -0
- package/vscode/src/vs/workbench/api/common/extHost.protocol.js +2 -0
- package/vscode/src/vs/workbench/api/common/extHostAuthentication.js +5 -11
- package/vscode/src/vs/workbench/api/common/extHostChatAgents2.js +5 -15
- package/vscode/src/vs/workbench/api/common/extHostChatVariables.js +2 -5
- package/vscode/src/vs/workbench/api/common/extHostComments.js +9 -3
- package/vscode/src/vs/workbench/api/common/extHostDebugService.js +32 -22
- package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +3 -3
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +109 -40
- package/vscode/src/vs/workbench/api/common/extHostLanguageModelTools.js +46 -0
- package/vscode/src/vs/workbench/api/common/extHostLanguageModels.js +84 -35
- package/vscode/src/vs/workbench/api/common/extHostNotebook.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostSCM.js +50 -41
- package/vscode/src/vs/workbench/api/common/extHostSearch.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostSecrets.js +11 -8
- package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +7 -6
- package/vscode/src/vs/workbench/api/common/extHostTesting.js +63 -70
- package/vscode/src/vs/workbench/api/common/extHostTextEditors.js +5 -3
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +75 -16
- package/vscode/src/vs/workbench/api/common/extHostTypes.js +29 -4
- package/vscode/src/vs/workbench/api/common/extHostWorkspace.js +1 -1
- package/vscode/src/vs/workbench/browser/actions/developerActions.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorActions.js +127 -107
- package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/editor/editorPanes.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorStatus.js +33 -21
- package/vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +5 -5
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsToasts.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/views/treeView.js +23 -6
- package/vscode/src/vs/workbench/browser/parts/views/viewFilter.js +3 -1
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +3 -3
- package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +1 -1
- package/vscode/src/vs/workbench/browser/web.api.js +8 -0
- package/vscode/src/vs/workbench/browser/workbench.contribution.js +199 -194
- package/vscode/src/vs/workbench/common/configuration.js +1 -1
- package/vscode/src/vs/workbench/common/contributions.js +8 -1
- package/vscode/src/vs/workbench/common/editor.js +5 -1
- package/vscode/src/vs/workbench/common/theme.js +79 -454
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +221 -239
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +17 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAgentHover.js +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollections.js +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCommandContentPart.js +35 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationContentPart.js +51 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/{chatConfirmationWidget.js → chatContentParts/chatConfirmationWidget.js} +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownContentPart.js +131 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatProgressContentPart.js +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.js +263 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTaskContentPart.js +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.js +160 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTreeContentPart.js +171 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatWarningContentPart.js +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/{media → chatContentParts/media}/chatConfirmationWidget.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +91 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +292 -1019
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownRenderer.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +22 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +61 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +23 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatAgentHover.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.js +8 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatColors.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatWordCounter.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/common/codeBlockModelCollection.js +16 -0
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelToolsService.service.js +3 -0
- package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +43 -16
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +1 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.js +7 -5
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +7 -7
- package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +3 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +2 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +2 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +2 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +8 -5
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +1 -1
- package/vscode/src/vs/workbench/contrib/contextmenu/browser/contextmenu.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +14 -7
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +8 -7
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +19 -16
- package/vscode/src/vs/workbench/contrib/debug/browser/debugColors.js +13 -12
- package/vscode/src/vs/workbench/contrib/debug/common/debug.d.ts +19 -2
- package/vscode/src/vs/workbench/contrib/debug/common/debug.js +9 -4
- package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +10 -5
- package/vscode/src/vs/workbench/contrib/debug/common/replModel.js +4 -4
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +235 -173
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionActions.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/common/extensions.js +2 -1
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +17 -5
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._configuration.js +62 -44
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._editorPane.js +2 -2
- package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +114 -107
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatContentWidget.js +33 -25
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +71 -101
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +38 -43
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +11 -33
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +3 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +49 -86
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +60 -71
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatContentWidget.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +116 -113
- package/vscode/src/vs/workbench/contrib/markdown/browser/markdownDocumentRenderer.js +6 -10
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput.js +1 -0
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findFilters.js +12 -23
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +0 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findModel.js +7 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +88 -61
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +1 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +39 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +2 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.js +12 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookBrowser.js +3 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +40 -105
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +27 -26
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +14 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +43 -46
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +12 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +19 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +9 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +5 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +16 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.js +8 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineDataSourceFactory.service.js +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +11 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +12 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.js +5 -3
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +9 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +37 -36
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +18 -8
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.js +1 -1
- package/vscode/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.js +14 -5
- package/vscode/src/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +17 -22
- package/vscode/src/vs/workbench/contrib/remote/browser/media/tunnelView.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +7 -10
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +7 -27
- package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +3 -4
- package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchService.js +2 -2
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +4 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +13 -37
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.d.ts +88 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +48 -31
- package/vscode/src/vs/workbench/contrib/testing/common/testId.d.ts +115 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.d.ts +226 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testTypes.d.ts +319 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testTypes.js +2 -3
- package/vscode/src/vs/workbench/contrib/testing/common/testingStates.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewWindowDragMonitor.js +21 -2
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewIconManager.js +7 -8
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +3 -3
- package/vscode/src/vs/workbench/services/authentication/common/authentication.d.ts +10 -5
- package/vscode/src/vs/workbench/services/editor/common/customEditorLabelService.js +54 -21
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.service.d.ts +1 -0
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.d.ts +1 -2
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +2 -4
- package/vscode/src/vs/workbench/services/extensions/common/extensions.js +5 -3
- package/vscode/src/vs/workbench/services/extensions/common/extensions.service.d.ts +3 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsRegistry.js +59 -41
- package/vscode/src/vs/workbench/services/extensions/common/rpcProtocol.js +1 -1
- package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +3 -2
- package/vscode/src/vs/workbench/services/host/browser/host.service.d.ts +1 -0
- package/vscode/src/vs/workbench/services/language/common/languageService.js +7 -0
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +1 -1
- package/vscode/src/vs/workbench/services/preferences/common/preferences.d.ts +2 -2
- package/vscode/src/vs/workbench/services/search/common/search.js +2 -1
- package/vscode/src/vs/workbench/services/search/common/textSearchManager.js +2 -2
- package/vscode/src/vs/workbench/services/statusbar/browser/statusbar.d.ts +2 -2
- package/vscode/src/vs/workbench/services/textfile/common/encoding.js +69 -26
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +23 -4
- package/vscode/src/vs/workbench/services/textfile/common/textfiles.d.ts +5 -1
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +1 -1
- package/vscode/src/vs/workbench/services/views/browser/viewsService.js +12 -5
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.js +38 -19
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyFileService.service.d.ts +2 -1
- package/vscode-dts/vscode.proposed.aiTextSearchProvider.d.ts +0 -196
- package/vscode-dts/vscode.proposed.attributableCoverage.d.ts +28 -10
- package/vscode-dts/vscode.proposed.authGetSessions.d.ts +30 -22
- package/vscode-dts/vscode.proposed.chatProvider.d.ts +17 -8
- package/vscode-dts/vscode.proposed.chatVariableResolver.d.ts +0 -9
- package/vscode-dts/vscode.proposed.commentReveal.d.ts +32 -0
- package/vscode-dts/vscode.proposed.commentThreadApplicability.d.ts +10 -0
- package/vscode-dts/vscode.proposed.createFileSystemWatcher.d.ts +1 -1
- package/vscode-dts/vscode.proposed.fileComments.d.ts +12 -53
- package/vscode-dts/vscode.proposed.fileSearchProvider.d.ts +6 -0
- package/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts +6 -0
- package/vscode-dts/vscode.proposed.lmTools.d.ts +91 -0
- package/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts +1 -1
- package/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts +10 -6
- package/vscode-dts/vscode.proposed.terminalShellIntegration.d.ts +38 -13
- package/vscode/src/vs/editor/browser/observableUtilities.js +0 -58
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProviderFactory.service.js +0 -3
- package/vscode/src/vs/workbench/services/extensions/common/extensionsApiProposals.js +0 -122
package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.js
ADDED
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { $ as $$1 } from '../../../../../base/browser/dom.js';
|
|
3
|
+
import { Button } from '../../../../../base/browser/ui/button/button.js';
|
|
4
|
+
import { Codicon } from '../../../../../base/common/codicons.js';
|
|
5
|
+
import { Emitter } from '../../../../../base/common/event.js';
|
|
6
|
+
import { Disposable, DisposableStore } from '../../../../../base/common/lifecycle.js';
|
|
7
|
+
import { matchesSomeScheme, Schemas } from '../../../../../base/common/network.js';
|
|
8
|
+
import { basename } from '../../../../../base/common/path.js';
|
|
9
|
+
import { basenameOrAuthority } from '../../../../../base/common/resources.js';
|
|
10
|
+
import { ThemeIcon } from '../../../../../base/common/themables.js';
|
|
11
|
+
import { URI } from '../../../../../base/common/uri.js';
|
|
12
|
+
import { localizeWithPath } from '../../../../../nls.js';
|
|
13
|
+
import { FileKind } from '../../../../../platform/files/common/files.js';
|
|
14
|
+
import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';
|
|
15
|
+
import { WorkbenchList } from '../../../../../platform/list/browser/listService.js';
|
|
16
|
+
import { IOpenerService } from '../../../../../platform/opener/common/opener.service.js';
|
|
17
|
+
import { IThemeService } from '../../../../../platform/theme/common/themeService.service.js';
|
|
18
|
+
import { ResourceLabels } from '../../../../browser/labels.js';
|
|
19
|
+
import { ColorScheme } from '../../../../browser/web.api.js';
|
|
20
|
+
import { ResourcePool } from './chatCollections.js';
|
|
21
|
+
import { IChatVariablesService } from '../../common/chatVariables.service.js';
|
|
22
|
+
import { createFileIconThemableTreeContainerScope } from '../../../files/browser/views/explorerView.js';
|
|
23
|
+
var ContentReferencesListRenderer_1;
|
|
24
|
+
const _moduleId = "vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart";
|
|
25
|
+
const $ = $$1;
|
|
26
|
+
let ChatReferencesContentPart = class ChatReferencesContentPart extends Disposable {
|
|
27
|
+
constructor(data, labelOverride, element, contentReferencesListPool, openerService) {
|
|
28
|
+
super();
|
|
29
|
+
this.data = data;
|
|
30
|
+
this._onDidChangeHeight = this._register(( (new Emitter())));
|
|
31
|
+
this.onDidChangeHeight = this._onDidChangeHeight.event;
|
|
32
|
+
const referencesLabel = labelOverride ?? (data.length > 1 ?
|
|
33
|
+
( localizeWithPath(_moduleId, 0, "Used {0} references", data.length)) :
|
|
34
|
+
( localizeWithPath(_moduleId, 1, "Used {0} reference", 1)));
|
|
35
|
+
const iconElement = $('.chat-used-context-icon');
|
|
36
|
+
const icon = (element) => element.usedReferencesExpanded ? Codicon.chevronDown : Codicon.chevronRight;
|
|
37
|
+
iconElement.classList.add(...ThemeIcon.asClassNameArray(icon(element)));
|
|
38
|
+
const buttonElement = $('.chat-used-context-label', undefined);
|
|
39
|
+
const collapseButton = this._register(( (new Button(buttonElement, {
|
|
40
|
+
buttonBackground: undefined,
|
|
41
|
+
buttonBorder: undefined,
|
|
42
|
+
buttonForeground: undefined,
|
|
43
|
+
buttonHoverBackground: undefined,
|
|
44
|
+
buttonSecondaryBackground: undefined,
|
|
45
|
+
buttonSecondaryForeground: undefined,
|
|
46
|
+
buttonSecondaryHoverBackground: undefined,
|
|
47
|
+
buttonSeparator: undefined
|
|
48
|
+
}))));
|
|
49
|
+
this.domNode = $('.chat-used-context', undefined, buttonElement);
|
|
50
|
+
collapseButton.label = referencesLabel;
|
|
51
|
+
collapseButton.element.prepend(iconElement);
|
|
52
|
+
this.updateAriaLabel(collapseButton.element, referencesLabel, element.usedReferencesExpanded);
|
|
53
|
+
this.domNode.classList.toggle('chat-used-context-collapsed', !element.usedReferencesExpanded);
|
|
54
|
+
this._register(collapseButton.onDidClick(() => {
|
|
55
|
+
iconElement.classList.remove(...ThemeIcon.asClassNameArray(icon(element)));
|
|
56
|
+
element.usedReferencesExpanded = !element.usedReferencesExpanded;
|
|
57
|
+
iconElement.classList.add(...ThemeIcon.asClassNameArray(icon(element)));
|
|
58
|
+
this.domNode.classList.toggle('chat-used-context-collapsed', !element.usedReferencesExpanded);
|
|
59
|
+
this._onDidChangeHeight.fire();
|
|
60
|
+
this.updateAriaLabel(collapseButton.element, referencesLabel, element.usedReferencesExpanded);
|
|
61
|
+
}));
|
|
62
|
+
const ref = this._register(contentReferencesListPool.get());
|
|
63
|
+
const list = ref.object;
|
|
64
|
+
this.domNode.appendChild(list.getHTMLElement().parentElement);
|
|
65
|
+
this._register(list.onDidOpen((e) => {
|
|
66
|
+
if (e.element && 'reference' in e.element) {
|
|
67
|
+
const uriOrLocation = 'variableName' in e.element.reference ? e.element.reference.value : e.element.reference;
|
|
68
|
+
const uri = URI.isUri(uriOrLocation) ? uriOrLocation :
|
|
69
|
+
uriOrLocation?.uri;
|
|
70
|
+
if (uri) {
|
|
71
|
+
openerService.open(uri, {
|
|
72
|
+
fromUserGesture: true,
|
|
73
|
+
editorOptions: {
|
|
74
|
+
...e.editorOptions,
|
|
75
|
+
...{
|
|
76
|
+
selection: uriOrLocation && 'range' in uriOrLocation ? uriOrLocation.range : undefined
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}));
|
|
83
|
+
this._register(list.onContextMenu((e) => {
|
|
84
|
+
e.browserEvent.preventDefault();
|
|
85
|
+
e.browserEvent.stopPropagation();
|
|
86
|
+
}));
|
|
87
|
+
const maxItemsShown = 6;
|
|
88
|
+
const itemsShown = Math.min(data.length, maxItemsShown);
|
|
89
|
+
const height = itemsShown * 22;
|
|
90
|
+
list.layout(height);
|
|
91
|
+
list.getHTMLElement().style.height = `${height}px`;
|
|
92
|
+
list.splice(0, list.length, data);
|
|
93
|
+
}
|
|
94
|
+
hasSameContent(other, followingContent, element) {
|
|
95
|
+
return other.kind === 'references' && other.references.length === this.data.length;
|
|
96
|
+
}
|
|
97
|
+
updateAriaLabel(element, label, expanded) {
|
|
98
|
+
element.ariaLabel = expanded ? ( localizeWithPath(_moduleId, 2, "{0}, expanded", label)) : ( localizeWithPath(_moduleId, 3, "{0}, collapsed", label));
|
|
99
|
+
}
|
|
100
|
+
addDisposable(disposable) {
|
|
101
|
+
this._register(disposable);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
ChatReferencesContentPart = ( (__decorate([
|
|
105
|
+
( (__param(4, IOpenerService)))
|
|
106
|
+
], ChatReferencesContentPart)));
|
|
107
|
+
let ContentReferencesListPool = class ContentReferencesListPool extends Disposable {
|
|
108
|
+
get inUse() {
|
|
109
|
+
return this._pool.inUse;
|
|
110
|
+
}
|
|
111
|
+
constructor(_onDidChangeVisibility, instantiationService, themeService) {
|
|
112
|
+
super();
|
|
113
|
+
this._onDidChangeVisibility = _onDidChangeVisibility;
|
|
114
|
+
this.instantiationService = instantiationService;
|
|
115
|
+
this.themeService = themeService;
|
|
116
|
+
this._pool = this._register(( (new ResourcePool(() => this.listFactory()))));
|
|
117
|
+
}
|
|
118
|
+
listFactory() {
|
|
119
|
+
const resourceLabels = this._register(this.instantiationService.createInstance(ResourceLabels, { onDidChangeVisibility: this._onDidChangeVisibility }));
|
|
120
|
+
const container = $('.chat-used-context-list');
|
|
121
|
+
this._register(createFileIconThemableTreeContainerScope(container, this.themeService));
|
|
122
|
+
const list = this.instantiationService.createInstance((WorkbenchList), 'ChatListRenderer', container, ( (new ContentReferencesListDelegate())), [this.instantiationService.createInstance(ContentReferencesListRenderer, resourceLabels)], {
|
|
123
|
+
alwaysConsumeMouseWheel: false,
|
|
124
|
+
accessibilityProvider: {
|
|
125
|
+
getAriaLabel: (element) => {
|
|
126
|
+
if (element.kind === 'warning') {
|
|
127
|
+
return element.content.value;
|
|
128
|
+
}
|
|
129
|
+
const reference = element.reference;
|
|
130
|
+
if ('variableName' in reference) {
|
|
131
|
+
return reference.variableName;
|
|
132
|
+
}
|
|
133
|
+
else if (URI.isUri(reference)) {
|
|
134
|
+
return basename(reference.path);
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
return basename(reference.uri.path);
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
getWidgetAriaLabel: () => ( localizeWithPath(_moduleId, 4, "Used References"))
|
|
141
|
+
},
|
|
142
|
+
dnd: {
|
|
143
|
+
getDragURI: (element) => {
|
|
144
|
+
if (element.kind === 'warning') {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
const { reference } = element;
|
|
148
|
+
if ('variableName' in reference) {
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
else if (URI.isUri(reference)) {
|
|
152
|
+
return (
|
|
153
|
+
(reference.toString())
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
return (
|
|
158
|
+
(reference.uri.toString())
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
dispose: () => { },
|
|
163
|
+
onDragOver: () => false,
|
|
164
|
+
drop: () => { },
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
return list;
|
|
168
|
+
}
|
|
169
|
+
get() {
|
|
170
|
+
const object = this._pool.get();
|
|
171
|
+
let stale = false;
|
|
172
|
+
return {
|
|
173
|
+
object,
|
|
174
|
+
isStale: () => stale,
|
|
175
|
+
dispose: () => {
|
|
176
|
+
stale = true;
|
|
177
|
+
this._pool.release(object);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
ContentReferencesListPool = ( (__decorate([
|
|
183
|
+
( (__param(1, IInstantiationService))),
|
|
184
|
+
( (__param(2, IThemeService)))
|
|
185
|
+
], ContentReferencesListPool)));
|
|
186
|
+
class ContentReferencesListDelegate {
|
|
187
|
+
getHeight(element) {
|
|
188
|
+
return 22;
|
|
189
|
+
}
|
|
190
|
+
getTemplateId(element) {
|
|
191
|
+
return ContentReferencesListRenderer.TEMPLATE_ID;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
let ContentReferencesListRenderer = class ContentReferencesListRenderer {
|
|
195
|
+
static { ContentReferencesListRenderer_1 = this; }
|
|
196
|
+
static { this.TEMPLATE_ID = 'contentReferencesListRenderer'; }
|
|
197
|
+
constructor(labels, themeService, chatVariablesService) {
|
|
198
|
+
this.labels = labels;
|
|
199
|
+
this.themeService = themeService;
|
|
200
|
+
this.chatVariablesService = chatVariablesService;
|
|
201
|
+
this.templateId = ContentReferencesListRenderer_1.TEMPLATE_ID;
|
|
202
|
+
}
|
|
203
|
+
renderTemplate(container) {
|
|
204
|
+
const templateDisposables = ( (new DisposableStore()));
|
|
205
|
+
const label = templateDisposables.add(this.labels.create(container, { supportHighlights: true }));
|
|
206
|
+
return { templateDisposables, label };
|
|
207
|
+
}
|
|
208
|
+
getReferenceIcon(data) {
|
|
209
|
+
if (ThemeIcon.isThemeIcon(data.iconPath)) {
|
|
210
|
+
return data.iconPath;
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
return this.themeService.getColorTheme().type === ColorScheme.DARK && data.iconPath?.dark
|
|
214
|
+
? data.iconPath?.dark
|
|
215
|
+
: data.iconPath?.light;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
renderElement(data, index, templateData, height) {
|
|
219
|
+
if (data.kind === 'warning') {
|
|
220
|
+
templateData.label.setResource({ name: data.content.value }, { icon: Codicon.warning });
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
const reference = data.reference;
|
|
224
|
+
const icon = this.getReferenceIcon(data);
|
|
225
|
+
templateData.label.element.style.display = 'flex';
|
|
226
|
+
if ('variableName' in reference) {
|
|
227
|
+
if (reference.value) {
|
|
228
|
+
const uri = URI.isUri(reference.value) ? reference.value : reference.value.uri;
|
|
229
|
+
templateData.label.setResource({
|
|
230
|
+
resource: uri,
|
|
231
|
+
name: basenameOrAuthority(uri),
|
|
232
|
+
description: `#${reference.variableName}`,
|
|
233
|
+
range: 'range' in reference.value ? reference.value.range : undefined,
|
|
234
|
+
}, { icon });
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
const variable = this.chatVariablesService.getVariable(reference.variableName);
|
|
238
|
+
templateData.label.setLabel(`#${reference.variableName}`, undefined, { title: variable?.description });
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
const uri = 'uri' in reference ? reference.uri : reference;
|
|
243
|
+
if (matchesSomeScheme(uri, Schemas.mailto, Schemas.http, Schemas.https)) {
|
|
244
|
+
templateData.label.setResource({ resource: uri, name: ( (uri.toString())) }, { icon: icon ?? Codicon.globe });
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
templateData.label.setFile(uri, {
|
|
248
|
+
fileKind: FileKind.FILE,
|
|
249
|
+
fileDecorations: { badges: false, colors: false },
|
|
250
|
+
range: 'range' in reference ? reference.range : undefined
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
disposeTemplate(templateData) {
|
|
256
|
+
templateData.templateDisposables.dispose();
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
ContentReferencesListRenderer = ContentReferencesListRenderer_1 = ( (__decorate([
|
|
260
|
+
( (__param(1, IThemeService))),
|
|
261
|
+
( (__param(2, IChatVariablesService)))
|
|
262
|
+
], ContentReferencesListRenderer)));
|
|
263
|
+
export { ChatReferencesContentPart, ContentReferencesListPool };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { $ } from '../../../../../base/browser/dom.js';
|
|
3
|
+
import { Event } from '../../../../../base/common/event.js';
|
|
4
|
+
import { Disposable } from '../../../../../base/common/lifecycle.js';
|
|
5
|
+
import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';
|
|
6
|
+
import { ChatProgressContentPart } from './chatProgressContentPart.js';
|
|
7
|
+
import { ChatReferencesContentPart } from './chatReferencesContentPart.js';
|
|
8
|
+
let ChatTaskContentPart = class ChatTaskContentPart extends Disposable {
|
|
9
|
+
constructor(task, contentReferencesListPool, renderer, context, instantiationService) {
|
|
10
|
+
super();
|
|
11
|
+
this.task = task;
|
|
12
|
+
if (task.progress.length) {
|
|
13
|
+
const refsPart = this._register(instantiationService.createInstance(ChatReferencesContentPart, task.progress, task.content.value, context.element, contentReferencesListPool));
|
|
14
|
+
this.domNode = $('.chat-progress-task');
|
|
15
|
+
this.domNode.appendChild(refsPart.domNode);
|
|
16
|
+
this.onDidChangeHeight = refsPart.onDidChangeHeight;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
const isSettled = task.isSettled?.() ?? true;
|
|
20
|
+
const progressPart = this._register(instantiationService.createInstance(ChatProgressContentPart, task, renderer, context, !isSettled, true));
|
|
21
|
+
this.domNode = progressPart.domNode;
|
|
22
|
+
this.onDidChangeHeight = Event.None;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
hasSameContent(other) {
|
|
26
|
+
return other.kind === 'progressTask'
|
|
27
|
+
&& other.progress.length === this.task.progress.length
|
|
28
|
+
&& other.isSettled() === this.task.isSettled();
|
|
29
|
+
}
|
|
30
|
+
addDisposable(disposable) {
|
|
31
|
+
this._register(disposable);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
ChatTaskContentPart = ( __decorate([
|
|
35
|
+
( __param(4, IInstantiationService))
|
|
36
|
+
], ChatTaskContentPart));
|
|
37
|
+
export { ChatTaskContentPart };
|
package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.js
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { $ as $$1 } from '../../../../../base/browser/dom.js';
|
|
3
|
+
import { CancellationTokenSource } from '../../../../../base/common/cancellation.js';
|
|
4
|
+
import { Emitter, Event } from '../../../../../base/common/event.js';
|
|
5
|
+
import { Disposable, toDisposable } from '../../../../../base/common/lifecycle.js';
|
|
6
|
+
import { Schemas } from '../../../../../base/common/network.js';
|
|
7
|
+
import { isEqual } from '../../../../../base/common/resources.js';
|
|
8
|
+
import { URI } from '../../../../../base/common/uri.js';
|
|
9
|
+
import { generateUuid } from '../../../../../base/common/uuid.js';
|
|
10
|
+
import { TextEdit } from '../../../../../editor/common/languages.js';
|
|
11
|
+
import { createTextBufferFactoryFromSnapshot } from '../../../../../editor/common/model/textModel.js';
|
|
12
|
+
import { IModelService } from '../../../../../editor/common/services/model.js';
|
|
13
|
+
import { DefaultModelSHA1Computer } from '../../../../../editor/common/services/modelService.js';
|
|
14
|
+
import { ITextModelService } from '../../../../../editor/common/services/resolverService.js';
|
|
15
|
+
import { localizeWithPath } from '../../../../../nls.js';
|
|
16
|
+
import { MenuId } from '../../../../../platform/actions/common/actions.js';
|
|
17
|
+
import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';
|
|
18
|
+
import { ResourcePool } from './chatCollections.js';
|
|
19
|
+
import { CodeCompareBlockPart } from '../codeBlockPart.js';
|
|
20
|
+
import { IChatService } from '../../common/chatService.service.js';
|
|
21
|
+
import { isResponseVM } from '../../common/chatViewModel.js';
|
|
22
|
+
const _moduleId = "vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart";
|
|
23
|
+
const $ = $$1;
|
|
24
|
+
let ChatTextEditContentPart = class ChatTextEditContentPart extends Disposable {
|
|
25
|
+
constructor(chatTextEdit, context, rendererOptions, diffEditorPool, currentWidth, textModelService, modelService, chatService) {
|
|
26
|
+
super();
|
|
27
|
+
this.textModelService = textModelService;
|
|
28
|
+
this.modelService = modelService;
|
|
29
|
+
this.chatService = chatService;
|
|
30
|
+
this._onDidChangeHeight = this._register(( (new Emitter())));
|
|
31
|
+
this.onDidChangeHeight = this._onDidChangeHeight.event;
|
|
32
|
+
const element = context.element;
|
|
33
|
+
if (rendererOptions.renderTextEditsAsSummary?.(chatTextEdit.uri)) {
|
|
34
|
+
if (isResponseVM(element) && element.response.value.every(item => item.kind === 'textEditGroup')) {
|
|
35
|
+
this.domNode = $('.interactive-edits-summary', undefined, !element.isComplete
|
|
36
|
+
? ( localizeWithPath(_moduleId, 0, "Making changes..."))
|
|
37
|
+
: element.isCanceled
|
|
38
|
+
? ( localizeWithPath(_moduleId, 1, "Making changes was aborted."))
|
|
39
|
+
: ( localizeWithPath(_moduleId, 2, "Made changes.")));
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
this.domNode = $('div');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
const cts = ( (new CancellationTokenSource()));
|
|
47
|
+
let isDisposed = false;
|
|
48
|
+
this._register(toDisposable(() => {
|
|
49
|
+
isDisposed = true;
|
|
50
|
+
cts.dispose(true);
|
|
51
|
+
}));
|
|
52
|
+
this.ref = this._register(diffEditorPool.get());
|
|
53
|
+
this._register(this.ref.object.onDidChangeContentHeight(() => {
|
|
54
|
+
this._onDidChangeHeight.fire();
|
|
55
|
+
}));
|
|
56
|
+
const data = {
|
|
57
|
+
element,
|
|
58
|
+
edit: chatTextEdit,
|
|
59
|
+
diffData: (async () => {
|
|
60
|
+
const ref = await this.textModelService.createModelReference(chatTextEdit.uri);
|
|
61
|
+
if (isDisposed) {
|
|
62
|
+
ref.dispose();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
this._register(ref);
|
|
66
|
+
const original = ref.object.textEditorModel;
|
|
67
|
+
let originalSha1 = '';
|
|
68
|
+
if (chatTextEdit.state) {
|
|
69
|
+
originalSha1 = chatTextEdit.state.sha1;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
const sha1 = ( (new DefaultModelSHA1Computer()));
|
|
73
|
+
if (sha1.canComputeSHA1(original)) {
|
|
74
|
+
originalSha1 = sha1.computeSHA1(original);
|
|
75
|
+
chatTextEdit.state = { sha1: originalSha1, applied: 0 };
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const modified = this.modelService.createModel(createTextBufferFactoryFromSnapshot(original.createSnapshot()), { languageId: original.getLanguageId(), onDidChange: Event.None }, ( (URI.from(
|
|
79
|
+
{ scheme: Schemas.vscodeChatCodeBlock, path: original.uri.path, query: generateUuid() }
|
|
80
|
+
))), false);
|
|
81
|
+
const modRef = await this.textModelService.createModelReference(modified.uri);
|
|
82
|
+
this._register(modRef);
|
|
83
|
+
const editGroups = [];
|
|
84
|
+
if (isResponseVM(element)) {
|
|
85
|
+
const chatModel = this.chatService.getSession(element.sessionId);
|
|
86
|
+
for (const request of chatModel.getRequests()) {
|
|
87
|
+
if (!request.response) {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
for (const item of request.response.response.value) {
|
|
91
|
+
if (item.kind !== 'textEditGroup' || item.state?.applied || !isEqual(item.uri, chatTextEdit.uri)) {
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
for (const group of item.edits) {
|
|
95
|
+
const edits = ( (group.map(TextEdit.asEditOperation)));
|
|
96
|
+
editGroups.push(edits);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (request.response === element.model) {
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
for (const edits of editGroups) {
|
|
105
|
+
modified.pushEditOperations(null, edits, () => null);
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
modified,
|
|
109
|
+
original,
|
|
110
|
+
originalSha1
|
|
111
|
+
};
|
|
112
|
+
})()
|
|
113
|
+
};
|
|
114
|
+
this.ref.object.render(data, currentWidth, cts.token);
|
|
115
|
+
this.domNode = this.ref.object.element;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
layout(width) {
|
|
119
|
+
this.ref?.object.layout(width);
|
|
120
|
+
}
|
|
121
|
+
hasSameContent(other) {
|
|
122
|
+
return other.kind === 'textEditGroup';
|
|
123
|
+
}
|
|
124
|
+
addDisposable(disposable) {
|
|
125
|
+
this._register(disposable);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
ChatTextEditContentPart = ( (__decorate([
|
|
129
|
+
( (__param(5, ITextModelService))),
|
|
130
|
+
( (__param(6, IModelService))),
|
|
131
|
+
( (__param(7, IChatService)))
|
|
132
|
+
], ChatTextEditContentPart)));
|
|
133
|
+
let DiffEditorPool = class DiffEditorPool extends Disposable {
|
|
134
|
+
inUse() {
|
|
135
|
+
return this._pool.inUse;
|
|
136
|
+
}
|
|
137
|
+
constructor(options, delegate, overflowWidgetsDomNode, instantiationService) {
|
|
138
|
+
super();
|
|
139
|
+
this._pool = this._register(( (new ResourcePool(() => {
|
|
140
|
+
return instantiationService.createInstance(CodeCompareBlockPart, options, MenuId.ChatCompareBlock, delegate, overflowWidgetsDomNode);
|
|
141
|
+
}))));
|
|
142
|
+
}
|
|
143
|
+
get() {
|
|
144
|
+
const codeBlock = this._pool.get();
|
|
145
|
+
let stale = false;
|
|
146
|
+
return {
|
|
147
|
+
object: codeBlock,
|
|
148
|
+
isStale: () => stale,
|
|
149
|
+
dispose: () => {
|
|
150
|
+
codeBlock.reset();
|
|
151
|
+
stale = true;
|
|
152
|
+
this._pool.release(codeBlock);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
DiffEditorPool = ( (__decorate([
|
|
158
|
+
( (__param(3, IInstantiationService)))
|
|
159
|
+
], DiffEditorPool)));
|
|
160
|
+
export { ChatTextEditContentPart, DiffEditorPool };
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { $ as $$1 } from '../../../../../base/browser/dom.js';
|
|
3
|
+
import { Emitter } from '../../../../../base/common/event.js';
|
|
4
|
+
import { Disposable, DisposableStore } from '../../../../../base/common/lifecycle.js';
|
|
5
|
+
import { localizeWithPath } from '../../../../../nls.js';
|
|
6
|
+
import { IConfigurationService } from '../../../../../platform/configuration/common/configuration.service.js';
|
|
7
|
+
import { FileKind, FileType } from '../../../../../platform/files/common/files.js';
|
|
8
|
+
import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';
|
|
9
|
+
import { WorkbenchCompressibleAsyncDataTree } from '../../../../../platform/list/browser/listService.js';
|
|
10
|
+
import { IOpenerService } from '../../../../../platform/opener/common/opener.service.js';
|
|
11
|
+
import { IThemeService } from '../../../../../platform/theme/common/themeService.service.js';
|
|
12
|
+
import { ResourceLabels } from '../../../../browser/labels.js';
|
|
13
|
+
import { ResourcePool } from './chatCollections.js';
|
|
14
|
+
import { createFileIconThemableTreeContainerScope } from '../../../files/browser/views/explorerView.js';
|
|
15
|
+
const _moduleId = "vs/workbench/contrib/chat/browser/chatContentParts/chatTreeContentPart";
|
|
16
|
+
const $ = $$1;
|
|
17
|
+
let ChatTreeContentPart = class ChatTreeContentPart extends Disposable {
|
|
18
|
+
constructor(data, element, treePool, treeDataIndex, openerService) {
|
|
19
|
+
super();
|
|
20
|
+
this.openerService = openerService;
|
|
21
|
+
this._onDidChangeHeight = this._register(( (new Emitter())));
|
|
22
|
+
this.onDidChangeHeight = this._onDidChangeHeight.event;
|
|
23
|
+
const ref = this._register(treePool.get());
|
|
24
|
+
this.tree = ref.object;
|
|
25
|
+
this.onDidFocus = this.tree.onDidFocus;
|
|
26
|
+
this._register(this.tree.onDidOpen((e) => {
|
|
27
|
+
if (e.element && !('children' in e.element)) {
|
|
28
|
+
this.openerService.open(e.element.uri);
|
|
29
|
+
}
|
|
30
|
+
}));
|
|
31
|
+
this._register(this.tree.onDidChangeCollapseState(() => {
|
|
32
|
+
this._onDidChangeHeight.fire();
|
|
33
|
+
}));
|
|
34
|
+
this._register(this.tree.onContextMenu((e) => {
|
|
35
|
+
e.browserEvent.preventDefault();
|
|
36
|
+
e.browserEvent.stopPropagation();
|
|
37
|
+
}));
|
|
38
|
+
this.tree.setInput(data).then(() => {
|
|
39
|
+
if (!ref.isStale()) {
|
|
40
|
+
this.tree.layout();
|
|
41
|
+
this._onDidChangeHeight.fire();
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
this.domNode = this.tree.getHTMLElement().parentElement;
|
|
45
|
+
}
|
|
46
|
+
domFocus() {
|
|
47
|
+
this.tree.domFocus();
|
|
48
|
+
}
|
|
49
|
+
hasSameContent(other) {
|
|
50
|
+
return other.kind === 'treeData';
|
|
51
|
+
}
|
|
52
|
+
addDisposable(disposable) {
|
|
53
|
+
this._register(disposable);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
ChatTreeContentPart = ( (__decorate([
|
|
57
|
+
( (__param(4, IOpenerService)))
|
|
58
|
+
], ChatTreeContentPart)));
|
|
59
|
+
let TreePool = class TreePool extends Disposable {
|
|
60
|
+
get inUse() {
|
|
61
|
+
return this._pool.inUse;
|
|
62
|
+
}
|
|
63
|
+
constructor(_onDidChangeVisibility, instantiationService, configService, themeService) {
|
|
64
|
+
super();
|
|
65
|
+
this._onDidChangeVisibility = _onDidChangeVisibility;
|
|
66
|
+
this.instantiationService = instantiationService;
|
|
67
|
+
this.configService = configService;
|
|
68
|
+
this.themeService = themeService;
|
|
69
|
+
this._pool = this._register(( (new ResourcePool(() => this.treeFactory()))));
|
|
70
|
+
}
|
|
71
|
+
treeFactory() {
|
|
72
|
+
const resourceLabels = this._register(this.instantiationService.createInstance(ResourceLabels, { onDidChangeVisibility: this._onDidChangeVisibility }));
|
|
73
|
+
const container = $('.interactive-response-progress-tree');
|
|
74
|
+
this._register(createFileIconThemableTreeContainerScope(container, this.themeService));
|
|
75
|
+
const tree = this.instantiationService.createInstance((WorkbenchCompressibleAsyncDataTree), 'ChatListRenderer', container, ( (new ChatListTreeDelegate())), ( (new ChatListTreeCompressionDelegate())), [( (new ChatListTreeRenderer(resourceLabels, this.configService.getValue('explorer.decorations'))))], ( (new ChatListTreeDataSource())), {
|
|
76
|
+
collapseByDefault: () => false,
|
|
77
|
+
expandOnlyOnTwistieClick: () => false,
|
|
78
|
+
identityProvider: {
|
|
79
|
+
getId: (e) => ( (e.uri.toString()))
|
|
80
|
+
},
|
|
81
|
+
accessibilityProvider: {
|
|
82
|
+
getAriaLabel: (element) => element.label,
|
|
83
|
+
getWidgetAriaLabel: () => ( localizeWithPath(_moduleId, 0, "File Tree"))
|
|
84
|
+
},
|
|
85
|
+
alwaysConsumeMouseWheel: false
|
|
86
|
+
});
|
|
87
|
+
return tree;
|
|
88
|
+
}
|
|
89
|
+
get() {
|
|
90
|
+
const object = this._pool.get();
|
|
91
|
+
let stale = false;
|
|
92
|
+
return {
|
|
93
|
+
object,
|
|
94
|
+
isStale: () => stale,
|
|
95
|
+
dispose: () => {
|
|
96
|
+
stale = true;
|
|
97
|
+
this._pool.release(object);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
TreePool = ( (__decorate([
|
|
103
|
+
( (__param(1, IInstantiationService))),
|
|
104
|
+
( (__param(2, IConfigurationService))),
|
|
105
|
+
( (__param(3, IThemeService)))
|
|
106
|
+
], TreePool)));
|
|
107
|
+
class ChatListTreeDelegate {
|
|
108
|
+
static { this.ITEM_HEIGHT = 22; }
|
|
109
|
+
getHeight(element) {
|
|
110
|
+
return ChatListTreeDelegate.ITEM_HEIGHT;
|
|
111
|
+
}
|
|
112
|
+
getTemplateId(element) {
|
|
113
|
+
return 'chatListTreeTemplate';
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
class ChatListTreeCompressionDelegate {
|
|
117
|
+
isIncompressible(element) {
|
|
118
|
+
return !element.children;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
class ChatListTreeRenderer {
|
|
122
|
+
constructor(labels, decorations) {
|
|
123
|
+
this.labels = labels;
|
|
124
|
+
this.decorations = decorations;
|
|
125
|
+
this.templateId = 'chatListTreeTemplate';
|
|
126
|
+
}
|
|
127
|
+
renderCompressedElements(element, index, templateData, height) {
|
|
128
|
+
templateData.label.element.style.display = 'flex';
|
|
129
|
+
const label = ( (element.element.elements.map((e) => e.label)));
|
|
130
|
+
templateData.label.setResource({ resource: element.element.elements[0].uri, name: label }, {
|
|
131
|
+
title: element.element.elements[0].label,
|
|
132
|
+
fileKind: element.children ? FileKind.FOLDER : FileKind.FILE,
|
|
133
|
+
extraClasses: ['explorer-item'],
|
|
134
|
+
fileDecorations: this.decorations
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
renderTemplate(container) {
|
|
138
|
+
const templateDisposables = ( (new DisposableStore()));
|
|
139
|
+
const label = templateDisposables.add(this.labels.create(container, { supportHighlights: true }));
|
|
140
|
+
return { templateDisposables, label };
|
|
141
|
+
}
|
|
142
|
+
renderElement(element, index, templateData, height) {
|
|
143
|
+
templateData.label.element.style.display = 'flex';
|
|
144
|
+
if (!element.children.length && element.element.type !== FileType.Directory) {
|
|
145
|
+
templateData.label.setFile(element.element.uri, {
|
|
146
|
+
fileKind: FileKind.FILE,
|
|
147
|
+
hidePath: true,
|
|
148
|
+
fileDecorations: this.decorations,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
templateData.label.setResource({ resource: element.element.uri, name: element.element.label }, {
|
|
153
|
+
title: element.element.label,
|
|
154
|
+
fileKind: FileKind.FOLDER,
|
|
155
|
+
fileDecorations: this.decorations
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
disposeTemplate(templateData) {
|
|
160
|
+
templateData.templateDisposables.dispose();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
class ChatListTreeDataSource {
|
|
164
|
+
hasChildren(element) {
|
|
165
|
+
return !!element.children;
|
|
166
|
+
}
|
|
167
|
+
async getChildren(element) {
|
|
168
|
+
return element.children ?? [];
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
export { ChatTreeContentPart, TreePool };
|
package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatWarningContentPart.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { $ as $$1 } from '../../../../../base/browser/dom.js';
|
|
2
|
+
import { renderIcon } from '../../../../../base/browser/ui/iconLabel/iconLabels.js';
|
|
3
|
+
import { Codicon } from '../../../../../base/common/codicons.js';
|
|
4
|
+
import { Disposable } from '../../../../../base/common/lifecycle.js';
|
|
5
|
+
const $ = $$1;
|
|
6
|
+
class ChatWarningContentPart extends Disposable {
|
|
7
|
+
constructor(kind, content, renderer) {
|
|
8
|
+
super();
|
|
9
|
+
this.domNode = $('.chat-notification-widget');
|
|
10
|
+
let icon;
|
|
11
|
+
let iconClass;
|
|
12
|
+
switch (kind) {
|
|
13
|
+
case 'warning':
|
|
14
|
+
icon = Codicon.warning;
|
|
15
|
+
iconClass = '.chat-warning-codicon';
|
|
16
|
+
break;
|
|
17
|
+
case 'error':
|
|
18
|
+
icon = Codicon.error;
|
|
19
|
+
iconClass = '.chat-error-codicon';
|
|
20
|
+
break;
|
|
21
|
+
case 'info':
|
|
22
|
+
icon = Codicon.info;
|
|
23
|
+
iconClass = '.chat-info-codicon';
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
this.domNode.appendChild($(iconClass, undefined, renderIcon(icon)));
|
|
27
|
+
const markdownContent = renderer.render(content);
|
|
28
|
+
this.domNode.appendChild(markdownContent.element);
|
|
29
|
+
}
|
|
30
|
+
hasSameContent(other) {
|
|
31
|
+
return other.kind === 'warning';
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export { ChatWarningContentPart };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import n from '
|
|
1
|
+
import n from '../../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
|
|
2
2
|
var css = ".chat-confirmation-widget{border:1px solid var(--vscode-chat-requestBorder);border-radius:4px;margin-bottom:16px;padding:8px 12px 12px}.chat-confirmation-widget .chat-confirmation-widget-title{font-weight:600}.chat-confirmation-widget .chat-confirmation-widget-title p{margin:0 0 4px}.chat-confirmation-widget .chat-confirmation-widget-message .rendered-markdown p{margin-top:0}.chat-confirmation-widget .chat-confirmation-widget-message .rendered-markdown>:last-child{margin-bottom:0}.chat-confirmation-widget .chat-confirmation-buttons-container{display:flex;gap:8px;margin-top:13px}.chat-confirmation-widget.hideButtons .chat-confirmation-buttons-container{display:none}";
|
|
3
3
|
n(css,{});
|
|
4
4
|
export { css, css as default };
|