@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
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import { RenderedHoverParts } from './hoverTypes.js';
|
|
2
|
+
import { Disposable, toDisposable, DisposableStore } from '../../../../base/common/lifecycle.js';
|
|
3
|
+
import { EditorHoverStatusBar } from './contentHoverStatusBar.js';
|
|
4
|
+
import { ModelDecorationOptions } from '../../../common/model/textModel.js';
|
|
5
|
+
import { Position } from '../../../common/core/position.js';
|
|
6
|
+
import { Range } from '../../../common/core/range.js';
|
|
7
|
+
import { addDisposableListener, EventType } from '../../../../base/browser/dom.js';
|
|
8
|
+
import { MarkdownHoverParticipant } from './markdownHoverParticipant.js';
|
|
9
|
+
import { ColorHoverParticipant } from '../../colorPicker/browser/colorHoverParticipant.js';
|
|
10
|
+
import { localizeWithPath } from '../../../../nls.js';
|
|
11
|
+
import { InlayHintsHover } from '../../inlayHints/browser/inlayHintsHover.js';
|
|
12
|
+
import { BugIndicatingError } from '../../../../base/common/errors.js';
|
|
13
|
+
const _moduleId = "vs/editor/contrib/hover/browser/contentHoverRendered";
|
|
14
|
+
class RenderedContentHover extends Disposable {
|
|
15
|
+
constructor(editor, hoverResult, participants, computer, context, keybindingService) {
|
|
16
|
+
super();
|
|
17
|
+
const anchor = hoverResult.anchor;
|
|
18
|
+
const parts = hoverResult.hoverParts;
|
|
19
|
+
this._renderedHoverParts = this._register(( (new RenderedContentHoverParts(editor, participants, parts, keybindingService, context))));
|
|
20
|
+
const { showAtPosition, showAtSecondaryPosition } = RenderedContentHover.computeHoverPositions(editor, anchor.range, parts);
|
|
21
|
+
this.shouldAppearBeforeContent = ( (parts.some(m => m.isBeforeContent)));
|
|
22
|
+
this.showAtPosition = showAtPosition;
|
|
23
|
+
this.showAtSecondaryPosition = showAtSecondaryPosition;
|
|
24
|
+
this.initialMousePosX = anchor.initialMousePosX;
|
|
25
|
+
this.initialMousePosY = anchor.initialMousePosY;
|
|
26
|
+
this.shouldFocus = computer.shouldFocus;
|
|
27
|
+
this.source = computer.source;
|
|
28
|
+
}
|
|
29
|
+
get domNode() {
|
|
30
|
+
return this._renderedHoverParts.domNode;
|
|
31
|
+
}
|
|
32
|
+
get domNodeHasChildren() {
|
|
33
|
+
return this._renderedHoverParts.domNodeHasChildren;
|
|
34
|
+
}
|
|
35
|
+
get focusedHoverPartIndex() {
|
|
36
|
+
return this._renderedHoverParts.focusedHoverPartIndex;
|
|
37
|
+
}
|
|
38
|
+
focusHoverPartWithIndex(index) {
|
|
39
|
+
this._renderedHoverParts.focusHoverPartWithIndex(index);
|
|
40
|
+
}
|
|
41
|
+
getAccessibleWidgetContent() {
|
|
42
|
+
return this._renderedHoverParts.getAccessibleContent();
|
|
43
|
+
}
|
|
44
|
+
getAccessibleWidgetContentAtIndex(index) {
|
|
45
|
+
return this._renderedHoverParts.getAccessibleHoverContentAtIndex(index);
|
|
46
|
+
}
|
|
47
|
+
async updateHoverVerbosityLevel(action, index, focus) {
|
|
48
|
+
this._renderedHoverParts.updateHoverVerbosityLevel(action, index, focus);
|
|
49
|
+
}
|
|
50
|
+
doesHoverAtIndexSupportVerbosityAction(index, action) {
|
|
51
|
+
return this._renderedHoverParts.doesHoverAtIndexSupportVerbosityAction(index, action);
|
|
52
|
+
}
|
|
53
|
+
isColorPickerVisible() {
|
|
54
|
+
return this._renderedHoverParts.isColorPickerVisible();
|
|
55
|
+
}
|
|
56
|
+
static computeHoverPositions(editor, anchorRange, hoverParts) {
|
|
57
|
+
let startColumnBoundary = 1;
|
|
58
|
+
if (editor.hasModel()) {
|
|
59
|
+
const viewModel = editor._getViewModel();
|
|
60
|
+
const coordinatesConverter = viewModel.coordinatesConverter;
|
|
61
|
+
const anchorViewRange = coordinatesConverter.convertModelRangeToViewRange(anchorRange);
|
|
62
|
+
const anchorViewMinColumn = viewModel.getLineMinColumn(anchorViewRange.startLineNumber);
|
|
63
|
+
const anchorViewRangeStart = ( (new Position(anchorViewRange.startLineNumber, anchorViewMinColumn)));
|
|
64
|
+
startColumnBoundary = coordinatesConverter.convertViewPositionToModelPosition(anchorViewRangeStart).column;
|
|
65
|
+
}
|
|
66
|
+
const anchorStartLineNumber = anchorRange.startLineNumber;
|
|
67
|
+
let secondaryPositionColumn = anchorRange.startColumn;
|
|
68
|
+
let forceShowAtRange;
|
|
69
|
+
for (const hoverPart of hoverParts) {
|
|
70
|
+
const hoverPartRange = hoverPart.range;
|
|
71
|
+
const hoverPartRangeOnAnchorStartLine = hoverPartRange.startLineNumber === anchorStartLineNumber;
|
|
72
|
+
const hoverPartRangeOnAnchorEndLine = hoverPartRange.endLineNumber === anchorStartLineNumber;
|
|
73
|
+
const hoverPartRangeIsOnAnchorLine = hoverPartRangeOnAnchorStartLine && hoverPartRangeOnAnchorEndLine;
|
|
74
|
+
if (hoverPartRangeIsOnAnchorLine) {
|
|
75
|
+
const hoverPartStartColumn = hoverPartRange.startColumn;
|
|
76
|
+
const minSecondaryPositionColumn = Math.min(secondaryPositionColumn, hoverPartStartColumn);
|
|
77
|
+
secondaryPositionColumn = Math.max(minSecondaryPositionColumn, startColumnBoundary);
|
|
78
|
+
}
|
|
79
|
+
if (hoverPart.forceShowAtRange) {
|
|
80
|
+
forceShowAtRange = hoverPartRange;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
let showAtPosition;
|
|
84
|
+
let showAtSecondaryPosition;
|
|
85
|
+
if (forceShowAtRange) {
|
|
86
|
+
const forceShowAtPosition = forceShowAtRange.getStartPosition();
|
|
87
|
+
showAtPosition = forceShowAtPosition;
|
|
88
|
+
showAtSecondaryPosition = forceShowAtPosition;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
showAtPosition = anchorRange.getStartPosition();
|
|
92
|
+
showAtSecondaryPosition = ( (new Position(anchorStartLineNumber, secondaryPositionColumn)));
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
showAtPosition,
|
|
96
|
+
showAtSecondaryPosition,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
class RenderedStatusBar {
|
|
101
|
+
constructor(fragment, _statusBar) {
|
|
102
|
+
this._statusBar = _statusBar;
|
|
103
|
+
fragment.appendChild(this._statusBar.hoverElement);
|
|
104
|
+
}
|
|
105
|
+
get hoverElement() {
|
|
106
|
+
return this._statusBar.hoverElement;
|
|
107
|
+
}
|
|
108
|
+
get actions() {
|
|
109
|
+
return this._statusBar.actions;
|
|
110
|
+
}
|
|
111
|
+
dispose() {
|
|
112
|
+
this._statusBar.dispose();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
class RenderedContentHoverParts extends Disposable {
|
|
116
|
+
static { this._DECORATION_OPTIONS = ModelDecorationOptions.register({
|
|
117
|
+
description: 'content-hover-highlight',
|
|
118
|
+
className: 'hoverHighlight'
|
|
119
|
+
}); }
|
|
120
|
+
constructor(editor, participants, hoverParts, keybindingService, context) {
|
|
121
|
+
super();
|
|
122
|
+
this._renderedParts = [];
|
|
123
|
+
this._focusedHoverPartIndex = -1;
|
|
124
|
+
this._context = context;
|
|
125
|
+
this._fragment = document.createDocumentFragment();
|
|
126
|
+
this._register(this._renderParts(participants, hoverParts, context, keybindingService));
|
|
127
|
+
this._register(this._registerListenersOnRenderedParts());
|
|
128
|
+
this._register(this._createEditorDecorations(editor, hoverParts));
|
|
129
|
+
this._updateMarkdownAndColorParticipantInfo(participants);
|
|
130
|
+
}
|
|
131
|
+
_createEditorDecorations(editor, hoverParts) {
|
|
132
|
+
if (hoverParts.length === 0) {
|
|
133
|
+
return Disposable.None;
|
|
134
|
+
}
|
|
135
|
+
let highlightRange = hoverParts[0].range;
|
|
136
|
+
for (const hoverPart of hoverParts) {
|
|
137
|
+
const hoverPartRange = hoverPart.range;
|
|
138
|
+
highlightRange = Range.plusRange(highlightRange, hoverPartRange);
|
|
139
|
+
}
|
|
140
|
+
const highlightDecoration = editor.createDecorationsCollection();
|
|
141
|
+
highlightDecoration.set([{
|
|
142
|
+
range: highlightRange,
|
|
143
|
+
options: RenderedContentHoverParts._DECORATION_OPTIONS
|
|
144
|
+
}]);
|
|
145
|
+
return toDisposable(() => {
|
|
146
|
+
highlightDecoration.clear();
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
_renderParts(participants, hoverParts, hoverContext, keybindingService) {
|
|
150
|
+
const statusBar = ( (new EditorHoverStatusBar(keybindingService)));
|
|
151
|
+
const hoverRenderingContext = {
|
|
152
|
+
fragment: this._fragment,
|
|
153
|
+
statusBar,
|
|
154
|
+
...hoverContext
|
|
155
|
+
};
|
|
156
|
+
const disposables = ( (new DisposableStore()));
|
|
157
|
+
for (const participant of participants) {
|
|
158
|
+
const renderedHoverParts = this._renderHoverPartsForParticipant(hoverParts, participant, hoverRenderingContext);
|
|
159
|
+
disposables.add(renderedHoverParts);
|
|
160
|
+
for (const renderedHoverPart of renderedHoverParts.renderedHoverParts) {
|
|
161
|
+
this._renderedParts.push({
|
|
162
|
+
type: 'hoverPart',
|
|
163
|
+
participant,
|
|
164
|
+
hoverPart: renderedHoverPart.hoverPart,
|
|
165
|
+
hoverElement: renderedHoverPart.hoverElement,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
const renderedStatusBar = this._renderStatusBar(this._fragment, statusBar);
|
|
170
|
+
if (renderedStatusBar) {
|
|
171
|
+
disposables.add(renderedStatusBar);
|
|
172
|
+
this._renderedParts.push({
|
|
173
|
+
type: 'statusBar',
|
|
174
|
+
hoverElement: renderedStatusBar.hoverElement,
|
|
175
|
+
actions: renderedStatusBar.actions,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
return toDisposable(() => { disposables.dispose(); });
|
|
179
|
+
}
|
|
180
|
+
_renderHoverPartsForParticipant(hoverParts, participant, hoverRenderingContext) {
|
|
181
|
+
const hoverPartsForParticipant = hoverParts.filter(hoverPart => hoverPart.owner === participant);
|
|
182
|
+
const hasHoverPartsForParticipant = hoverPartsForParticipant.length > 0;
|
|
183
|
+
if (!hasHoverPartsForParticipant) {
|
|
184
|
+
return (
|
|
185
|
+
(new RenderedHoverParts([]))
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
return participant.renderHoverParts(hoverRenderingContext, hoverPartsForParticipant);
|
|
189
|
+
}
|
|
190
|
+
_renderStatusBar(fragment, statusBar) {
|
|
191
|
+
if (!statusBar.hasContent) {
|
|
192
|
+
return undefined;
|
|
193
|
+
}
|
|
194
|
+
return (
|
|
195
|
+
(new RenderedStatusBar(fragment, statusBar))
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
_registerListenersOnRenderedParts() {
|
|
199
|
+
const disposables = ( (new DisposableStore()));
|
|
200
|
+
this._renderedParts.forEach((renderedPart, index) => {
|
|
201
|
+
const element = renderedPart.hoverElement;
|
|
202
|
+
element.tabIndex = 0;
|
|
203
|
+
disposables.add(addDisposableListener(element, EventType.FOCUS_IN, (event) => {
|
|
204
|
+
event.stopPropagation();
|
|
205
|
+
this._focusedHoverPartIndex = index;
|
|
206
|
+
}));
|
|
207
|
+
disposables.add(addDisposableListener(element, EventType.FOCUS_OUT, (event) => {
|
|
208
|
+
event.stopPropagation();
|
|
209
|
+
this._focusedHoverPartIndex = -1;
|
|
210
|
+
}));
|
|
211
|
+
});
|
|
212
|
+
return disposables;
|
|
213
|
+
}
|
|
214
|
+
_updateMarkdownAndColorParticipantInfo(participants) {
|
|
215
|
+
const markdownHoverParticipant = participants.find(p => {
|
|
216
|
+
return (p instanceof MarkdownHoverParticipant) && !(p instanceof InlayHintsHover);
|
|
217
|
+
});
|
|
218
|
+
if (markdownHoverParticipant) {
|
|
219
|
+
this._markdownHoverParticipant = markdownHoverParticipant;
|
|
220
|
+
}
|
|
221
|
+
this._colorHoverParticipant = participants.find(p => p instanceof ColorHoverParticipant);
|
|
222
|
+
}
|
|
223
|
+
focusHoverPartWithIndex(index) {
|
|
224
|
+
if (index < 0 || index >= this._renderedParts.length) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
this._renderedParts[index].hoverElement.focus();
|
|
228
|
+
}
|
|
229
|
+
getAccessibleContent() {
|
|
230
|
+
const content = [];
|
|
231
|
+
for (let i = 0; i < this._renderedParts.length; i++) {
|
|
232
|
+
content.push(this.getAccessibleHoverContentAtIndex(i));
|
|
233
|
+
}
|
|
234
|
+
return content.join('\n\n');
|
|
235
|
+
}
|
|
236
|
+
getAccessibleHoverContentAtIndex(index) {
|
|
237
|
+
const renderedPart = this._renderedParts[index];
|
|
238
|
+
if (!renderedPart) {
|
|
239
|
+
return '';
|
|
240
|
+
}
|
|
241
|
+
if (renderedPart.type === 'statusBar') {
|
|
242
|
+
const statusBarDescription = [( localizeWithPath(_moduleId, 0, "This is a hover status bar."))];
|
|
243
|
+
for (const action of renderedPart.actions) {
|
|
244
|
+
const keybinding = action.actionKeybindingLabel;
|
|
245
|
+
if (keybinding) {
|
|
246
|
+
statusBarDescription.push(( localizeWithPath(
|
|
247
|
+
_moduleId,
|
|
248
|
+
1,
|
|
249
|
+
"It has an action with label {0} and keybinding {1}.",
|
|
250
|
+
action.actionLabel,
|
|
251
|
+
keybinding
|
|
252
|
+
)));
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
statusBarDescription.push(( localizeWithPath(_moduleId, 2, "It has an action with label {0}.", action.actionLabel)));
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return statusBarDescription.join('\n');
|
|
259
|
+
}
|
|
260
|
+
return renderedPart.participant.getAccessibleContent(renderedPart.hoverPart);
|
|
261
|
+
}
|
|
262
|
+
async updateHoverVerbosityLevel(action, index, focus) {
|
|
263
|
+
if (!this._markdownHoverParticipant) {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
const normalizedMarkdownHoverIndex = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, index);
|
|
267
|
+
if (normalizedMarkdownHoverIndex === undefined) {
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
const renderedPart = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(action, normalizedMarkdownHoverIndex, focus);
|
|
271
|
+
if (!renderedPart) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
this._renderedParts[index] = {
|
|
275
|
+
type: 'hoverPart',
|
|
276
|
+
participant: this._markdownHoverParticipant,
|
|
277
|
+
hoverPart: renderedPart.hoverPart,
|
|
278
|
+
hoverElement: renderedPart.hoverElement,
|
|
279
|
+
};
|
|
280
|
+
this._context.onContentsChanged();
|
|
281
|
+
}
|
|
282
|
+
doesHoverAtIndexSupportVerbosityAction(index, action) {
|
|
283
|
+
if (!this._markdownHoverParticipant) {
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
286
|
+
const normalizedMarkdownHoverIndex = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, index);
|
|
287
|
+
if (normalizedMarkdownHoverIndex === undefined) {
|
|
288
|
+
return false;
|
|
289
|
+
}
|
|
290
|
+
return this._markdownHoverParticipant.doesMarkdownHoverAtIndexSupportVerbosityAction(normalizedMarkdownHoverIndex, action);
|
|
291
|
+
}
|
|
292
|
+
isColorPickerVisible() {
|
|
293
|
+
return this._colorHoverParticipant?.isColorPickerVisible() ?? false;
|
|
294
|
+
}
|
|
295
|
+
_normalizedIndexToMarkdownHoverIndexRange(markdownHoverParticipant, index) {
|
|
296
|
+
const renderedPart = this._renderedParts[index];
|
|
297
|
+
if (!renderedPart || renderedPart.type !== 'hoverPart') {
|
|
298
|
+
return undefined;
|
|
299
|
+
}
|
|
300
|
+
const isHoverPartMarkdownHover = renderedPart.participant === markdownHoverParticipant;
|
|
301
|
+
if (!isHoverPartMarkdownHover) {
|
|
302
|
+
return undefined;
|
|
303
|
+
}
|
|
304
|
+
const firstIndexOfMarkdownHovers = this._renderedParts.findIndex(renderedPart => renderedPart.type === 'hoverPart'
|
|
305
|
+
&& renderedPart.participant === markdownHoverParticipant);
|
|
306
|
+
if (firstIndexOfMarkdownHovers === -1) {
|
|
307
|
+
throw ( (new BugIndicatingError()));
|
|
308
|
+
}
|
|
309
|
+
return index - firstIndexOfMarkdownHovers;
|
|
310
|
+
}
|
|
311
|
+
get domNode() {
|
|
312
|
+
return this._fragment;
|
|
313
|
+
}
|
|
314
|
+
get domNodeHasChildren() {
|
|
315
|
+
return this._fragment.hasChildNodes();
|
|
316
|
+
}
|
|
317
|
+
get focusedHoverPartIndex() {
|
|
318
|
+
return this._focusedHoverPartIndex;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
export { RenderedContentHover };
|
|
@@ -11,6 +11,7 @@ let EditorHoverStatusBar = class EditorHoverStatusBar extends Disposable {
|
|
|
11
11
|
constructor(_keybindingService) {
|
|
12
12
|
super();
|
|
13
13
|
this._keybindingService = _keybindingService;
|
|
14
|
+
this.actions = [];
|
|
14
15
|
this._hasContent = false;
|
|
15
16
|
this.hoverElement = $('div.hover-row.status-bar');
|
|
16
17
|
this.hoverElement.tabIndex = 0;
|
|
@@ -20,7 +21,9 @@ let EditorHoverStatusBar = class EditorHoverStatusBar extends Disposable {
|
|
|
20
21
|
const keybinding = this._keybindingService.lookupKeybinding(actionOptions.commandId);
|
|
21
22
|
const keybindingLabel = keybinding ? keybinding.getLabel() : null;
|
|
22
23
|
this._hasContent = true;
|
|
23
|
-
|
|
24
|
+
const action = this._register(HoverAction.render(this.actionsElement, actionOptions, keybindingLabel));
|
|
25
|
+
this.actions.push(action);
|
|
26
|
+
return action;
|
|
24
27
|
}
|
|
25
28
|
append(element) {
|
|
26
29
|
const result = append(this.actionsElement, element);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
class HoverResult {
|
|
2
|
-
constructor(anchor,
|
|
2
|
+
constructor(anchor, hoverParts, isComplete) {
|
|
3
3
|
this.anchor = anchor;
|
|
4
|
-
this.
|
|
4
|
+
this.hoverParts = hoverParts;
|
|
5
5
|
this.isComplete = isComplete;
|
|
6
6
|
}
|
|
7
7
|
filter(anchor) {
|
|
8
|
-
const
|
|
9
|
-
if (
|
|
8
|
+
const filteredHoverParts = this.hoverParts.filter((m) => m.isValidForHoverAnchor(anchor));
|
|
9
|
+
if (filteredHoverParts.length === this.hoverParts.length) {
|
|
10
10
|
return this;
|
|
11
11
|
}
|
|
12
|
-
return ( new FilteredHoverResult(this, this.anchor,
|
|
12
|
+
return ( new FilteredHoverResult(this, this.anchor, filteredHoverParts, this.isComplete));
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
class FilteredHoverResult extends HoverResult {
|
|
@@ -21,19 +21,4 @@ class FilteredHoverResult extends HoverResult {
|
|
|
21
21
|
return this.original.filter(anchor);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
constructor(initialMousePosX, initialMousePosY, colorPicker, showAtPosition, showAtSecondaryPosition, preferAbove, stoleFocus, source, isBeforeContent, disposables) {
|
|
26
|
-
this.initialMousePosX = initialMousePosX;
|
|
27
|
-
this.initialMousePosY = initialMousePosY;
|
|
28
|
-
this.colorPicker = colorPicker;
|
|
29
|
-
this.showAtPosition = showAtPosition;
|
|
30
|
-
this.showAtSecondaryPosition = showAtSecondaryPosition;
|
|
31
|
-
this.preferAbove = preferAbove;
|
|
32
|
-
this.stoleFocus = stoleFocus;
|
|
33
|
-
this.source = source;
|
|
34
|
-
this.isBeforeContent = isBeforeContent;
|
|
35
|
-
this.disposables = disposables;
|
|
36
|
-
this.closestMouseDistance = undefined;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
export { ContentHoverVisibleData, FilteredHoverResult, HoverResult };
|
|
24
|
+
export { FilteredHoverResult, HoverResult };
|
|
@@ -11,6 +11,7 @@ import { IAccessibilityService } from '../../../../platform/accessibility/common
|
|
|
11
11
|
import { EditorContextKeys } from '../../../common/editorContextKeys.js';
|
|
12
12
|
import { HoverWidget, getHoverAccessibleViewHint } from '../../../../base/browser/ui/hover/hoverWidget.js';
|
|
13
13
|
import { PositionAffinity } from '../../../common/model.js';
|
|
14
|
+
import { Emitter } from '../../../../base/common/event.js';
|
|
14
15
|
var ContentHoverWidget_1;
|
|
15
16
|
const HORIZONTAL_SCROLLING_BY = 30;
|
|
16
17
|
const CONTAINER_HEIGHT_PADDING = 6;
|
|
@@ -18,11 +19,8 @@ let ContentHoverWidget = class ContentHoverWidget extends ResizableContentWidget
|
|
|
18
19
|
static { ContentHoverWidget_1 = this; }
|
|
19
20
|
static { this.ID = 'editor.contrib.resizableContentHoverWidget'; }
|
|
20
21
|
static { this._lastDimensions = new Dimension(0, 0); }
|
|
21
|
-
get isColorPickerVisible() {
|
|
22
|
-
return Boolean(this._visibleData?.colorPicker);
|
|
23
|
-
}
|
|
24
22
|
get isVisibleFromKeyboard() {
|
|
25
|
-
return (this.
|
|
23
|
+
return (this._renderedHover?.source === HoverStartSource.Keyboard);
|
|
26
24
|
}
|
|
27
25
|
get isVisible() {
|
|
28
26
|
return this._hoverVisibleKey.get() ?? false;
|
|
@@ -39,6 +37,8 @@ let ContentHoverWidget = class ContentHoverWidget extends ResizableContentWidget
|
|
|
39
37
|
this._accessibilityService = _accessibilityService;
|
|
40
38
|
this._keybindingService = _keybindingService;
|
|
41
39
|
this._hover = this._register(( new HoverWidget()));
|
|
40
|
+
this._onDidResize = this._register(( new Emitter()));
|
|
41
|
+
this.onDidResize = this._onDidResize.event;
|
|
42
42
|
this._minimumSize = minimumSize;
|
|
43
43
|
this._hoverVisibleKey = EditorContextKeys.hoverVisible.bindTo(contextKeyService);
|
|
44
44
|
this._hoverFocusedKey = EditorContextKeys.hoverFocused.bindTo(contextKeyService);
|
|
@@ -61,12 +61,12 @@ let ContentHoverWidget = class ContentHoverWidget extends ResizableContentWidget
|
|
|
61
61
|
this._register(focusTracker.onDidBlur(() => {
|
|
62
62
|
this._hoverFocusedKey.set(false);
|
|
63
63
|
}));
|
|
64
|
-
this.
|
|
64
|
+
this._setRenderedHover(undefined);
|
|
65
65
|
this._editor.addContentWidget(this);
|
|
66
66
|
}
|
|
67
67
|
dispose() {
|
|
68
68
|
super.dispose();
|
|
69
|
-
this.
|
|
69
|
+
this._renderedHover?.dispose();
|
|
70
70
|
this._editor.removeContentWidget(this);
|
|
71
71
|
}
|
|
72
72
|
getId() {
|
|
@@ -122,10 +122,10 @@ let ContentHoverWidget = class ContentHoverWidget extends ResizableContentWidget
|
|
|
122
122
|
this._updateResizableNodeMaxDimensions();
|
|
123
123
|
this._hover.scrollbar.scanDomNode();
|
|
124
124
|
this._editor.layoutContentWidget(this);
|
|
125
|
-
this.
|
|
125
|
+
this._onDidResize.fire();
|
|
126
126
|
}
|
|
127
127
|
_findAvailableSpaceVertically() {
|
|
128
|
-
const position = this.
|
|
128
|
+
const position = this._renderedHover?.showAtPosition;
|
|
129
129
|
if (!position) {
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
@@ -171,31 +171,30 @@ let ContentHoverWidget = class ContentHoverWidget extends ResizableContentWidget
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
isMouseGettingCloser(posx, posy) {
|
|
174
|
-
if (!this.
|
|
174
|
+
if (!this._renderedHover) {
|
|
175
175
|
return false;
|
|
176
176
|
}
|
|
177
|
-
if (
|
|
178
|
-
|
|
179
|
-
this.
|
|
180
|
-
this._visibleData.initialMousePosY = posy;
|
|
177
|
+
if (this._renderedHover.initialMousePosX === undefined || this._renderedHover.initialMousePosY === undefined) {
|
|
178
|
+
this._renderedHover.initialMousePosX = posx;
|
|
179
|
+
this._renderedHover.initialMousePosY = posy;
|
|
181
180
|
return false;
|
|
182
181
|
}
|
|
183
182
|
const widgetRect = getDomNodePagePosition(this.getDomNode());
|
|
184
|
-
if (
|
|
185
|
-
this.
|
|
183
|
+
if (this._renderedHover.closestMouseDistance === undefined) {
|
|
184
|
+
this._renderedHover.closestMouseDistance = computeDistanceFromPointToRectangle(this._renderedHover.initialMousePosX, this._renderedHover.initialMousePosY, widgetRect.left, widgetRect.top, widgetRect.width, widgetRect.height);
|
|
186
185
|
}
|
|
187
186
|
const distance = computeDistanceFromPointToRectangle(posx, posy, widgetRect.left, widgetRect.top, widgetRect.width, widgetRect.height);
|
|
188
|
-
if (distance > this.
|
|
187
|
+
if (distance > this._renderedHover.closestMouseDistance + 4 ) {
|
|
189
188
|
return false;
|
|
190
189
|
}
|
|
191
|
-
this.
|
|
190
|
+
this._renderedHover.closestMouseDistance = Math.min(this._renderedHover.closestMouseDistance, distance);
|
|
192
191
|
return true;
|
|
193
192
|
}
|
|
194
|
-
|
|
195
|
-
this.
|
|
196
|
-
this.
|
|
197
|
-
this._hoverVisibleKey.set(!!
|
|
198
|
-
this._hover.containerDomNode.classList.toggle('hidden', !
|
|
193
|
+
_setRenderedHover(renderedHover) {
|
|
194
|
+
this._renderedHover?.dispose();
|
|
195
|
+
this._renderedHover = renderedHover;
|
|
196
|
+
this._hoverVisibleKey.set(!!renderedHover);
|
|
197
|
+
this._hover.containerDomNode.classList.toggle('hidden', !renderedHover);
|
|
199
198
|
}
|
|
200
199
|
_updateFont() {
|
|
201
200
|
const { fontSize, lineHeight } = this._editor.getOption(EditorOption.fontInfo);
|
|
@@ -220,38 +219,38 @@ let ContentHoverWidget = class ContentHoverWidget extends ResizableContentWidget
|
|
|
220
219
|
const width = Math.max(this._editor.getLayoutInfo().width * 0.66, 500, ContentHoverWidget_1._lastDimensions.width);
|
|
221
220
|
this._setHoverWidgetMaxDimensions(width, height);
|
|
222
221
|
}
|
|
223
|
-
_render(
|
|
224
|
-
this.
|
|
222
|
+
_render(renderedHover) {
|
|
223
|
+
this._setRenderedHover(renderedHover);
|
|
225
224
|
this._updateFont();
|
|
226
|
-
this._updateContent(
|
|
225
|
+
this._updateContent(renderedHover.domNode);
|
|
227
226
|
this._updateMaxDimensions();
|
|
228
227
|
this.onContentsChanged();
|
|
229
228
|
this._editor.render();
|
|
230
229
|
}
|
|
231
230
|
getPosition() {
|
|
232
|
-
if (!this.
|
|
231
|
+
if (!this._renderedHover) {
|
|
233
232
|
return null;
|
|
234
233
|
}
|
|
235
234
|
return {
|
|
236
|
-
position: this.
|
|
237
|
-
secondaryPosition: this.
|
|
238
|
-
positionAffinity: this.
|
|
235
|
+
position: this._renderedHover.showAtPosition,
|
|
236
|
+
secondaryPosition: this._renderedHover.showAtSecondaryPosition,
|
|
237
|
+
positionAffinity: this._renderedHover.shouldAppearBeforeContent ? PositionAffinity.LeftOfInjectedText : undefined,
|
|
239
238
|
preference: [this._positionPreference ?? ContentWidgetPositionPreference.ABOVE]
|
|
240
239
|
};
|
|
241
240
|
}
|
|
242
|
-
|
|
241
|
+
show(renderedHover) {
|
|
243
242
|
if (!this._editor || !this._editor.hasModel()) {
|
|
244
243
|
return;
|
|
245
244
|
}
|
|
246
|
-
this._render(
|
|
245
|
+
this._render(renderedHover);
|
|
247
246
|
const widgetHeight = getTotalHeight(this._hover.containerDomNode);
|
|
248
|
-
const widgetPosition =
|
|
247
|
+
const widgetPosition = renderedHover.showAtPosition;
|
|
249
248
|
this._positionPreference = this._findPositionPreference(widgetHeight, widgetPosition) ?? ContentWidgetPositionPreference.ABOVE;
|
|
250
249
|
this.onContentsChanged();
|
|
251
|
-
if (
|
|
250
|
+
if (renderedHover.shouldFocus) {
|
|
252
251
|
this._hover.containerDomNode.focus();
|
|
253
252
|
}
|
|
254
|
-
|
|
253
|
+
this._onDidResize.fire();
|
|
255
254
|
const hoverFocused = this._hover.containerDomNode.ownerDocument.activeElement === this._hover.containerDomNode;
|
|
256
255
|
const accessibleViewHint = hoverFocused && getHoverAccessibleViewHint(this._configurationService.getValue('accessibility.verbosity.hover') === true && this._accessibilityService.isScreenReaderOptimized(), this._keybindingService.lookupKeybinding('editor.action.accessibleView')?.getAriaLabel() ?? '');
|
|
257
256
|
if (accessibleViewHint) {
|
|
@@ -259,16 +258,16 @@ let ContentHoverWidget = class ContentHoverWidget extends ResizableContentWidget
|
|
|
259
258
|
}
|
|
260
259
|
}
|
|
261
260
|
hide() {
|
|
262
|
-
if (!this.
|
|
261
|
+
if (!this._renderedHover) {
|
|
263
262
|
return;
|
|
264
263
|
}
|
|
265
|
-
const
|
|
266
|
-
this.
|
|
264
|
+
const hoverStoleFocus = this._renderedHover.shouldFocus || this._hoverFocusedKey.get();
|
|
265
|
+
this._setRenderedHover(undefined);
|
|
267
266
|
this._resizableNode.maxSize = new Dimension(Infinity, Infinity);
|
|
268
267
|
this._resizableNode.clearSashHoverState();
|
|
269
268
|
this._hoverFocusedKey.set(false);
|
|
270
269
|
this._editor.layoutContentWidget(this);
|
|
271
|
-
if (
|
|
270
|
+
if (hoverStoleFocus) {
|
|
272
271
|
this._editor.focus();
|
|
273
272
|
}
|
|
274
273
|
}
|
|
@@ -299,9 +298,9 @@ let ContentHoverWidget = class ContentHoverWidget extends ResizableContentWidget
|
|
|
299
298
|
this._contentWidth = width;
|
|
300
299
|
this._updateMinimumWidth();
|
|
301
300
|
this._resizableNode.layout(height, width);
|
|
302
|
-
if (this.
|
|
301
|
+
if (this._renderedHover?.showAtPosition) {
|
|
303
302
|
const widgetHeight = getTotalHeight(this._hover.containerDomNode);
|
|
304
|
-
this._positionPreference = this._findPositionPreference(widgetHeight, this.
|
|
303
|
+
this._positionPreference = this._findPositionPreference(widgetHeight, this._renderedHover.showAtPosition);
|
|
305
304
|
}
|
|
306
305
|
this._layoutContentWidget();
|
|
307
306
|
}
|