monaco-editor-core 0.56.0 → 0.57.0-rc.2
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/esm/nls.keys.json +1 -1
- package/esm/nls.messages.cs.js +2 -2
- package/esm/nls.messages.de.js +2 -2
- package/esm/nls.messages.es.js +2 -2
- package/esm/nls.messages.fr.js +2 -2
- package/esm/nls.messages.it.js +2 -2
- package/esm/nls.messages.ja.js +2 -2
- package/esm/nls.messages.js +1 -1
- package/esm/nls.messages.json +1 -1
- package/esm/nls.messages.ko.js +2 -2
- package/esm/nls.messages.pl.js +2 -2
- package/esm/nls.messages.pt-br.js +2 -2
- package/esm/nls.messages.ru.js +2 -2
- package/esm/nls.messages.tr.js +2 -2
- package/esm/nls.messages.zh-cn.js +2 -2
- package/esm/nls.messages.zh-tw.js +2 -2
- package/esm/nls.metadata.json +84 -11
- package/esm/vs/amdX.js +1 -2
- package/esm/vs/amdX.js.map +1 -1
- package/esm/vs/base/browser/contextmenu.js.map +1 -1
- package/esm/vs/base/browser/dom.js +136 -3
- package/esm/vs/base/browser/dom.js.map +1 -1
- package/esm/vs/base/browser/domSanitize.js +60 -17
- package/esm/vs/base/browser/domSanitize.js.map +1 -1
- package/esm/vs/base/browser/dompurify/dompurify.js +1247 -313
- package/esm/vs/base/browser/keyboardEvent.js +8 -1
- package/esm/vs/base/browser/keyboardEvent.js.map +1 -1
- package/esm/vs/base/browser/markdownRenderer.js +212 -47
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/ui/actionbar/actionViewItems.js +5 -2
- package/esm/vs/base/browser/ui/actionbar/actionViewItems.js.map +1 -1
- package/esm/vs/base/browser/ui/actionbar/actionbar.js +5 -0
- package/esm/vs/base/browser/ui/actionbar/actionbar.js.map +1 -1
- package/esm/vs/base/browser/ui/animations/animations.js +81 -106
- package/esm/vs/base/browser/ui/animations/animations.js.map +1 -1
- package/esm/vs/base/browser/ui/button/button.js +3 -0
- package/esm/vs/base/browser/ui/button/button.js.map +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/contextview/contextview.js +177 -15
- package/esm/vs/base/browser/ui/contextview/contextview.js.map +1 -1
- package/esm/vs/base/browser/ui/dialog/dialog.css +4 -2
- package/esm/vs/base/browser/ui/dropdown/dropdown.js +25 -6
- package/esm/vs/base/browser/ui/dropdown/dropdown.js.map +1 -1
- package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +5 -0
- package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js.map +1 -1
- package/esm/vs/base/browser/ui/findinput/findInput.js +4 -29
- package/esm/vs/base/browser/ui/findinput/findInput.js.map +1 -1
- package/esm/vs/base/browser/ui/findinput/findInputToggles.js +36 -0
- package/esm/vs/base/browser/ui/findinput/findInputToggles.js.map +1 -1
- package/esm/vs/base/browser/ui/findinput/replaceInput.js +2 -26
- package/esm/vs/base/browser/ui/findinput/replaceInput.js.map +1 -1
- package/esm/vs/base/browser/ui/hover/hover.js +4 -0
- package/esm/vs/base/browser/ui/hover/hover.js.map +1 -1
- package/esm/vs/base/browser/ui/hover/hoverDelegate.js.map +1 -1
- package/esm/vs/base/browser/ui/hover/hoverWidget.css +13 -8
- package/esm/vs/base/browser/ui/iconLabel/iconlabel.css +6 -3
- package/esm/vs/base/browser/ui/inputbox/inputBox.js +22 -1
- package/esm/vs/base/browser/ui/inputbox/inputBox.js.map +1 -1
- package/esm/vs/base/browser/ui/list/listView.js +318 -121
- package/esm/vs/base/browser/ui/list/listView.js.map +1 -1
- package/esm/vs/base/browser/ui/list/listWidget.js +19 -20
- package/esm/vs/base/browser/ui/list/listWidget.js.map +1 -1
- package/esm/vs/base/browser/ui/menu/menu.js +27 -10
- package/esm/vs/base/browser/ui/menu/menu.js.map +1 -1
- package/esm/vs/base/browser/ui/radio/radio.css +117 -8
- package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js +20 -2
- package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js.map +1 -1
- package/esm/vs/base/browser/ui/selectBox/selectBox.js.map +1 -1
- package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js +117 -52
- package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js.map +1 -1
- package/esm/vs/base/browser/ui/splitview/splitview.js +5 -1
- package/esm/vs/base/browser/ui/splitview/splitview.js.map +1 -1
- package/esm/vs/base/browser/ui/toggle/switch.css +60 -0
- package/esm/vs/base/browser/ui/toggle/switch.js +71 -0
- package/esm/vs/base/browser/ui/toggle/switch.js.map +1 -0
- package/esm/vs/base/browser/ui/toggle/toggle.css +9 -1
- package/esm/vs/base/browser/ui/toggle/toggle.js +6 -1
- package/esm/vs/base/browser/ui/toggle/toggle.js.map +1 -1
- package/esm/vs/base/browser/ui/toolbar/toolbar.js +216 -48
- package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js +164 -43
- package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js +1 -0
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/objectTree.js +3 -0
- package/esm/vs/base/browser/ui/tree/objectTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/tree.js.map +1 -1
- package/esm/vs/base/common/arrays.js +1 -1
- package/esm/vs/base/common/arrays.js.map +1 -1
- package/esm/vs/base/common/assert.js +0 -2
- package/esm/vs/base/common/assert.js.map +1 -1
- package/esm/vs/base/common/async.js +2 -2
- package/esm/vs/base/common/async.js.map +1 -1
- package/esm/vs/base/common/codiconsLibrary.js +43 -0
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/base/common/event.js +46 -23
- package/esm/vs/base/common/event.js.map +1 -1
- package/esm/vs/base/common/extpath.js +41 -0
- package/esm/vs/base/common/extpath.js.map +1 -1
- package/esm/vs/base/common/fuzzyScorer.js +7 -0
- package/esm/vs/base/common/fuzzyScorer.js.map +1 -1
- package/esm/vs/base/common/glob.js +7 -7
- package/esm/vs/base/common/glob.js.map +1 -1
- package/esm/vs/base/common/hash.js +17 -2
- package/esm/vs/base/common/hash.js.map +1 -1
- package/esm/vs/base/common/htmlContent.js +13 -1
- package/esm/vs/base/common/htmlContent.js.map +1 -1
- package/esm/vs/base/common/jsonSchema.js.map +1 -1
- package/esm/vs/base/common/lifecycle.js +32 -4
- package/esm/vs/base/common/lifecycle.js.map +1 -1
- package/esm/vs/base/common/map.js +4 -0
- package/esm/vs/base/common/map.js.map +1 -1
- package/esm/vs/base/common/network.js +9 -0
- package/esm/vs/base/common/network.js.map +1 -1
- package/esm/vs/base/common/numbers.js +18 -0
- package/esm/vs/base/common/numbers.js.map +1 -1
- package/esm/vs/base/common/objects.js +3 -2
- package/esm/vs/base/common/objects.js.map +1 -1
- package/esm/vs/base/common/observableInternal/base.js.map +1 -1
- package/esm/vs/base/common/observableInternal/index.js +1 -1
- package/esm/vs/base/common/observableInternal/index.js.map +1 -1
- package/esm/vs/base/common/observableInternal/logging/debugger/rpc.js +8 -0
- package/esm/vs/base/common/observableInternal/logging/debugger/rpc.js.map +1 -1
- package/esm/vs/base/common/observableInternal/observables/derivedImpl.js +7 -0
- package/esm/vs/base/common/observableInternal/observables/derivedImpl.js.map +1 -1
- package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js +6 -5
- package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js.map +1 -1
- package/esm/vs/base/common/observableInternal/reactions/autorun.js +33 -0
- package/esm/vs/base/common/observableInternal/reactions/autorun.js.map +1 -1
- package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js +10 -0
- package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js.map +1 -1
- package/esm/vs/base/common/observableInternal/utils/promise.js +2 -2
- package/esm/vs/base/common/observableInternal/utils/promise.js.map +1 -1
- package/esm/vs/base/common/platform.js +4 -0
- package/esm/vs/base/common/platform.js.map +1 -1
- package/esm/vs/base/common/product.js.map +1 -1
- package/esm/vs/base/common/uri.js +22 -13
- package/esm/vs/base/common/uri.js.map +1 -1
- package/esm/vs/editor/browser/config/editorConfiguration.js +1 -1
- package/esm/vs/editor/browser/config/fontMeasurements.js +12 -4
- package/esm/vs/editor/browser/config/fontMeasurements.js.map +1 -1
- package/esm/vs/editor/browser/controller/dragScrolling.js +13 -14
- package/esm/vs/editor/browser/controller/dragScrolling.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +36 -4
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContextUtils.js +2 -2
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContextUtils.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +15 -5
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/mouseHandler.js +4 -4
- package/esm/vs/editor/browser/controller/mouseTarget.js +2 -2
- package/esm/vs/editor/browser/gpu/rectangleRenderer.js +1 -1
- package/esm/vs/editor/browser/gpu/viewGpuContext.js +19 -2
- package/esm/vs/editor/browser/gpu/viewGpuContext.js.map +1 -1
- package/esm/vs/editor/browser/services/openerService.js +60 -23
- package/esm/vs/editor/browser/services/openerService.js.map +1 -1
- package/esm/vs/editor/browser/view/domLineBreaksComputer.js +185 -73
- package/esm/vs/editor/browser/view/domLineBreaksComputer.js.map +1 -1
- package/esm/vs/editor/browser/view/viewController.js +2 -2
- package/esm/vs/editor/browser/view/viewLayer.js +1 -1
- package/esm/vs/editor/browser/view/viewOverlays.js +4 -4
- package/esm/vs/editor/browser/view.js +7 -5
- package/esm/vs/editor/browser/view.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/blockDecorations/blockDecorations.js +1 -1
- package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +3 -3
- package/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js +2 -2
- package/esm/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.js +2 -2
- package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +2 -2
- package/esm/vs/editor/browser/viewParts/indentGuides/indentGuides.js +2 -2
- package/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.js +1 -1
- package/esm/vs/editor/browser/viewParts/linesDecorations/linesDecorations.js +2 -2
- package/esm/vs/editor/browser/viewParts/margin/margin.js +2 -2
- package/esm/vs/editor/browser/viewParts/minimap/minimap.js +2 -2
- package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js +2 -2
- package/esm/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.js +2 -2
- package/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js +3 -3
- package/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js +1 -1
- package/esm/vs/editor/browser/viewParts/viewCursors/viewCursor.js +2 -2
- package/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.js +4 -4
- package/esm/vs/editor/browser/viewParts/viewLines/rangeUtil.js +14 -0
- package/esm/vs/editor/browser/viewParts/viewLines/rangeUtil.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/viewLines/viewLine.js +20 -1
- package/esm/vs/editor/browser/viewParts/viewLines/viewLine.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/viewLines/viewLineOptions.js +3 -1
- package/esm/vs/editor/browser/viewParts/viewLines/viewLineOptions.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/viewLines/viewLines.css +12 -0
- package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js +5 -5
- package/esm/vs/editor/browser/viewParts/viewLinesGpu/viewLinesGpu.js +1 -1
- package/esm/vs/editor/browser/viewParts/viewZones/viewZones.js +2 -2
- package/esm/vs/editor/browser/viewParts/whitespace/whitespace.js +11 -4
- package/esm/vs/editor/browser/viewParts/whitespace/whitespace.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/wordWrapIndicator/wordWrapIndicator.css +10 -0
- package/esm/vs/editor/browser/viewParts/wordWrapIndicator/wordWrapIndicator.js +121 -0
- package/esm/vs/editor/browser/viewParts/wordWrapIndicator/wordWrapIndicator.js.map +1 -0
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +5 -5
- package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +4 -2
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +3 -3
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.js +7 -6
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +4 -15
- package/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/diffEditorOptions.js +44 -6
- package/esm/vs/editor/browser/widget/diffEditor/diffEditorOptions.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +76 -9
- package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +154 -48
- package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +5 -5
- package/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/features/overviewRulerFeature.js +3 -1
- package/esm/vs/editor/browser/widget/diffEditor/features/overviewRulerFeature.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/registrations.contribution.js +5 -5
- package/esm/vs/editor/browser/widget/diffEditor/style.css +127 -0
- package/esm/vs/editor/browser/widget/multiDiffEditor/colors.js +3 -3
- package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollLayout.js +146 -0
- package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollLayout.js.map +1 -0
- package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollView.js +297 -0
- package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollView.js.map +1 -0
- package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +298 -87
- package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/model.js +9 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/model.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorLogging.js +153 -0
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorLogging.js.map +1 -0
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorOptions.js +37 -0
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorOptions.js.map +1 -0
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorViewModel.js +56 -22
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorViewModel.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidget.js +53 -7
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +397 -200
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/style.css +426 -65
- package/esm/vs/editor/browser/widget/multiDiffEditor/virtualizedItemManager.js +222 -0
- package/esm/vs/editor/browser/widget/multiDiffEditor/virtualizedItemManager.js.map +1 -0
- package/esm/vs/editor/browser/widget/multiDiffEditor/workbenchUIElementFactory.js.map +1 -1
- package/esm/vs/editor/common/config/diffEditor.js +1 -0
- package/esm/vs/editor/common/config/diffEditor.js.map +1 -1
- package/esm/vs/editor/common/config/editorConfigurationSchema.js +62 -57
- package/esm/vs/editor/common/config/editorConfigurationSchema.js.map +1 -1
- package/esm/vs/editor/common/config/editorOptions.js +471 -430
- package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
- package/esm/vs/editor/common/core/editorColorRegistry.js +71 -70
- package/esm/vs/editor/common/core/editorColorRegistry.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursorMoveOperations.js +1 -1
- package/esm/vs/editor/common/cursor/cursorMoveOperations.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursorTypeEditOperations.js +10 -0
- package/esm/vs/editor/common/cursor/cursorTypeEditOperations.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursorWordOperations.js +1 -1
- package/esm/vs/editor/common/cursor/cursorWordOperations.js.map +1 -1
- package/esm/vs/editor/common/cursorCommon.js +2 -2
- package/esm/vs/editor/common/cursorEvents.js.map +1 -1
- package/esm/vs/editor/common/editorContextKeys.js +53 -49
- package/esm/vs/editor/common/editorContextKeys.js.map +1 -1
- package/esm/vs/editor/common/languages/autoIndent.js +1 -1
- package/esm/vs/editor/common/languages/autoIndent.js.map +1 -1
- package/esm/vs/editor/common/languages/languageConfigurationRegistry.js +4 -1
- package/esm/vs/editor/common/languages/languageConfigurationRegistry.js.map +1 -1
- package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
- package/esm/vs/editor/common/languages.js +56 -57
- package/esm/vs/editor/common/languages.js.map +1 -1
- package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsImpl.js +13 -0
- package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsImpl.js.map +1 -1
- package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/bracketPairsTree.js +44 -0
- package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/bracketPairsTree.js.map +1 -1
- package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/brackets.js +4 -0
- package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/brackets.js.map +1 -1
- package/esm/vs/editor/common/model/editStack.js +1 -1
- package/esm/vs/editor/common/model/textModel.js +1 -0
- package/esm/vs/editor/common/model/textModel.js.map +1 -1
- package/esm/vs/editor/common/model.js.map +1 -1
- package/esm/vs/editor/common/modelLineProjectionData.js.map +1 -1
- package/esm/vs/editor/common/multiDiffEditor.js +6 -0
- package/esm/vs/editor/common/multiDiffEditor.js.map +1 -0
- package/esm/vs/editor/common/services/inMemoryTextModelService.js +92 -0
- package/esm/vs/editor/common/services/inMemoryTextModelService.js.map +1 -0
- package/esm/vs/editor/common/services/resolverService.js.map +1 -1
- package/esm/vs/editor/common/services/semanticTokensProviderStyling.js +7 -0
- package/esm/vs/editor/common/services/semanticTokensProviderStyling.js.map +1 -1
- package/esm/vs/editor/common/standalone/standaloneEnums.js +16 -13
- package/esm/vs/editor/common/standalone/standaloneEnums.js.map +1 -1
- package/esm/vs/editor/common/standaloneStrings.js +11 -11
- package/esm/vs/editor/common/textModelBracketPairs.js.map +1 -1
- package/esm/vs/editor/common/textModelEditSource.js +15 -0
- package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
- package/esm/vs/editor/common/textModelEvents.js +34 -2
- package/esm/vs/editor/common/textModelEvents.js.map +1 -1
- package/esm/vs/editor/common/viewLayout/lineDecorations.js +3 -1
- package/esm/vs/editor/common/viewLayout/lineDecorations.js.map +1 -1
- package/esm/vs/editor/common/viewLayout/lineHeights.js +2 -2
- package/esm/vs/editor/common/viewLayout/lineHeights.js.map +1 -1
- package/esm/vs/editor/common/viewLayout/viewLayout.js +5 -5
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +60 -11
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js.map +1 -1
- package/esm/vs/editor/common/viewLayout/viewLinesViewportData.js +3 -0
- package/esm/vs/editor/common/viewLayout/viewLinesViewportData.js.map +1 -1
- package/esm/vs/editor/common/viewModel/inlineDecorations.js +17 -6
- package/esm/vs/editor/common/viewModel/inlineDecorations.js.map +1 -1
- package/esm/vs/editor/common/viewModel/modelLineProjection.js +10 -1
- package/esm/vs/editor/common/viewModel/modelLineProjection.js.map +1 -1
- package/esm/vs/editor/common/viewModel/monospaceLineBreaksComputer.js +123 -37
- package/esm/vs/editor/common/viewModel/monospaceLineBreaksComputer.js.map +1 -1
- package/esm/vs/editor/common/viewModel/viewModelImpl.js +12 -7
- package/esm/vs/editor/common/viewModel/viewModelImpl.js.map +1 -1
- package/esm/vs/editor/common/viewModel/viewModelLines.js +15 -5
- package/esm/vs/editor/common/viewModel/viewModelLines.js.map +1 -1
- package/esm/vs/editor/common/viewModel.js.map +1 -1
- package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
- package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
- package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
- package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +23 -23
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
- package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +9 -4
- package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js.map +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
- package/esm/vs/editor/contrib/codeAction/browser/codeActionModel.js +119 -88
- package/esm/vs/editor/contrib/codeAction/browser/codeActionModel.js.map +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
- package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
- package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js +17 -5
- package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js.map +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/colorPicker.css +3 -3
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParticipantUtils.js +7 -2
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParticipantUtils.js.map +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerContribution.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +3 -3
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerParticipant.js +3 -3
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerParticipant.js.map +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerWidget.js +3 -1
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerWidget.js.map +1 -1
- package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +15 -13
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js.map +1 -1
- package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +9 -9
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
- package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
- package/esm/vs/editor/contrib/find/browser/findController.js +19 -19
- package/esm/vs/editor/contrib/find/browser/findController.js.map +1 -1
- package/esm/vs/editor/contrib/find/browser/findWidget.js +30 -30
- package/esm/vs/editor/contrib/find/browser/findWidget.js.map +1 -1
- package/esm/vs/editor/contrib/folding/browser/folding.js +21 -26
- package/esm/vs/editor/contrib/folding/browser/folding.js.map +1 -1
- package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
- package/esm/vs/editor/contrib/folding/browser/foldingModel.js +20 -3
- package/esm/vs/editor/contrib/folding/browser/foldingModel.js.map +1 -1
- package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
- package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
- package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
- package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +15 -15
- package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js.map +1 -1
- package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
- package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
- package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
- package/esm/vs/editor/contrib/hover/browser/contentHoverController.js +7 -1
- package/esm/vs/editor/contrib/hover/browser/contentHoverController.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/contentHoverRendered.js +37 -16
- package/esm/vs/editor/contrib/hover/browser/contentHoverRendered.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.js +10 -0
- package/esm/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
- package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +7 -7
- package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +11 -10
- package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js.map +1 -1
- package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +9 -5
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js.map +1 -1
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +21 -21
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -13
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +37 -16
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +4 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +15 -12
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +14 -15
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/telemetry.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +5 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +3 -13
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +6 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js +7 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js +26 -14
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +3 -3
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js +7 -3
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js +25 -10
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
- package/esm/vs/editor/contrib/inlineProgress/browser/inlineProgress.js +1 -0
- package/esm/vs/editor/contrib/inlineProgress/browser/inlineProgress.js.map +1 -1
- package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
- package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLineCommand.js +0 -6
- package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLineCommand.js.map +1 -1
- package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +31 -31
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
- package/esm/vs/editor/contrib/links/browser/links.js +10 -10
- package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/esm/vs/editor/contrib/middleScroll/browser/middleScrollController.js +1 -1
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
- package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
- package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +12 -12
- package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
- package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
- package/esm/vs/editor/contrib/rename/browser/rename.js +13 -13
- package/esm/vs/editor/contrib/rename/browser/rename.js.map +1 -1
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
- package/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js +18 -5
- package/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js.map +1 -1
- package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +5 -5
- package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +5 -1
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js.map +1 -1
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +12 -3
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/media/suggest.css +19 -1
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -9
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +11 -11
- package/esm/vs/editor/contrib/suggest/browser/suggestModel.js +5 -3
- package/esm/vs/editor/contrib/suggest/browser/suggestModel.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +76 -19
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +3 -2
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
- package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
- package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
- package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
- package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
- package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +3 -3
- package/esm/vs/editor/editor.api.d.ts +40 -16
- package/esm/vs/editor/standalone/browser/standalone-tokens.css +6 -1
- package/esm/vs/editor/standalone/browser/standaloneEditor.js +1 -1
- package/esm/vs/editor/standalone/browser/standaloneEditor.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneLanguages.js +9 -0
- package/esm/vs/editor/standalone/browser/standaloneLanguages.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneServices.js +7 -34
- package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
- package/esm/vs/nls.js +1 -1
- package/esm/vs/nls.js.map +1 -1
- package/esm/vs/platform/accessibility/browser/accessibilityService.js +9 -3
- package/esm/vs/platform/accessibility/browser/accessibilityService.js.map +1 -1
- package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +74 -62
- package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js.map +1 -1
- package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
- package/esm/vs/platform/actionWidget/browser/actionList.js +1211 -235
- package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
- package/esm/vs/platform/actionWidget/browser/actionWidget.css +148 -30
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +100 -29
- package/esm/vs/platform/actionWidget/browser/actionWidget.js.map +1 -1
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +54 -26
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js.map +1 -1
- package/esm/vs/platform/actions/browser/toolbar.js +2 -2
- package/esm/vs/platform/actions/common/actions.js +5 -0
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- package/esm/vs/platform/actions/common/menuService.js +50 -52
- package/esm/vs/platform/actions/common/menuService.js.map +1 -1
- package/esm/vs/platform/clipboard/browser/clipboardService.js +8 -1
- package/esm/vs/platform/clipboard/browser/clipboardService.js.map +1 -1
- package/esm/vs/platform/configuration/common/configurationModels.js +45 -6
- package/esm/vs/platform/configuration/common/configurationModels.js.map +1 -1
- package/esm/vs/platform/configuration/common/configurationRegistry.js +45 -11
- package/esm/vs/platform/configuration/common/configurationRegistry.js.map +1 -1
- package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
- package/esm/vs/platform/contextkey/common/contextkey.js +11 -10
- package/esm/vs/platform/contextkey/common/contextkey.js.map +1 -1
- package/esm/vs/platform/contextkey/common/contextkeys.js +11 -10
- package/esm/vs/platform/contextkey/common/contextkeys.js.map +1 -1
- package/esm/vs/platform/contextkey/common/scanner.js +5 -5
- package/esm/vs/platform/contextview/browser/contextMenuHandler.js +2 -1
- package/esm/vs/platform/contextview/browser/contextMenuHandler.js.map +1 -1
- package/esm/vs/platform/contextview/browser/contextView.js.map +1 -1
- package/esm/vs/platform/contextview/browser/contextViewService.js +3 -2
- package/esm/vs/platform/contextview/browser/contextViewService.js.map +1 -1
- package/esm/vs/platform/dialogs/common/dialogs.js.map +1 -1
- package/esm/vs/platform/dnd/browser/dnd.js +1 -0
- package/esm/vs/platform/dnd/browser/dnd.js.map +1 -1
- package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +3 -3
- package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js.map +1 -1
- package/esm/vs/platform/hover/browser/hover.css +8 -8
- package/esm/vs/platform/hover/browser/hoverService.js +28 -4
- package/esm/vs/platform/hover/browser/hoverService.js.map +1 -1
- package/esm/vs/platform/hover/browser/hoverWidget.js +27 -9
- package/esm/vs/platform/hover/browser/hoverWidget.js.map +1 -1
- package/esm/vs/platform/hover/browser/updatableHoverWidget.js +10 -4
- package/esm/vs/platform/hover/browser/updatableHoverWidget.js.map +1 -1
- package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +31 -5
- package/esm/vs/platform/keybinding/common/abstractKeybindingService.js.map +1 -1
- package/esm/vs/platform/keybinding/common/resolvedKeybindingItem.js +2 -1
- package/esm/vs/platform/keybinding/common/resolvedKeybindingItem.js.map +1 -1
- package/esm/vs/platform/list/browser/listService.js +31 -31
- package/esm/vs/platform/list/browser/listService.js.map +1 -1
- package/esm/vs/platform/log/common/log.js.map +1 -1
- package/esm/vs/platform/markers/common/markerService.js +2 -2
- package/esm/vs/platform/markers/common/markers.js +6 -6
- package/esm/vs/platform/opener/common/opener.js +1 -0
- package/esm/vs/platform/opener/common/opener.js.map +1 -1
- package/esm/vs/platform/product/common/product.js +11 -2
- package/esm/vs/platform/product/common/product.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +9 -8
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
- package/esm/vs/platform/quickinput/browser/media/quickInput.css +45 -4
- package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
- package/esm/vs/platform/quickinput/browser/quickInputActions.js +6 -6
- package/esm/vs/platform/quickinput/browser/quickInputActions.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputBox.js +3 -0
- package/esm/vs/platform/quickinput/browser/quickInputBox.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputController.js +82 -16
- package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputList.js +9 -1
- package/esm/vs/platform/quickinput/browser/quickInputList.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js +2 -0
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickTree.js +1 -1
- package/esm/vs/platform/quickinput/common/quickInput.js.map +1 -1
- package/esm/vs/platform/theme/common/colorUtils.js +2 -2
- package/esm/vs/platform/theme/common/colors/baseColors.js +19 -19
- package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
- package/esm/vs/platform/theme/common/colors/inputColors.js +48 -48
- package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
- package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
- package/esm/vs/platform/theme/common/colors/minimapColors.js +11 -11
- package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
- package/esm/vs/platform/theme/common/colors/quickpickColors.js +10 -10
- package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
- package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
- package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
- package/esm/vs/platform/webWorker/browser/webWorkerServiceImpl.js +15 -2
- package/esm/vs/platform/webWorker/browser/webWorkerServiceImpl.js.map +1 -1
- package/esm/vs/platform/workspace/common/workspace.js +1 -1
- package/monaco.d.ts +40 -16
- package/package.json +3 -3
- package/version.txt +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/objectPool.js +0 -46
- package/esm/vs/editor/browser/widget/multiDiffEditor/objectPool.js.map +0 -1
|
@@ -116,7 +116,7 @@ let ContentHoverController = class ContentHoverController extends Disposable {
|
|
|
116
116
|
return this._isMouseOnContentHoverWidget(mouseEvent) || this._isContentWidgetResizing() || isOnColorDecorator(mouseEvent);
|
|
117
117
|
}
|
|
118
118
|
_isMouseOnContentHoverWidget(mouseEvent) {
|
|
119
|
-
if (!this._contentWidget) {
|
|
119
|
+
if (!this._contentWidget || !this._contentWidget.getDomNode().isConnected) {
|
|
120
120
|
return false;
|
|
121
121
|
}
|
|
122
122
|
return isMousePositionWithinElement(this._contentWidget.getDomNode(), mouseEvent.event.posx, mouseEvent.event.posy);
|
|
@@ -184,6 +184,12 @@ let ContentHoverController = class ContentHoverController extends Disposable {
|
|
|
184
184
|
if (this._ignoreMouseEvents) {
|
|
185
185
|
return;
|
|
186
186
|
}
|
|
187
|
+
// When the user is dragging to select text (mouse down started outside the hover widget),
|
|
188
|
+
// hide the hover and suppress any new hover computation to avoid covering the selection.
|
|
189
|
+
if (this._isMouseDown && !this._shouldKeepHoverWidgetVisible(mouseEvent)) {
|
|
190
|
+
this._cancelSchedulerAndHide();
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
187
193
|
this._mouseMoveEvent = mouseEvent;
|
|
188
194
|
const shouldKeepCurrentHover = this._shouldKeepCurrentHover(mouseEvent);
|
|
189
195
|
if (shouldKeepCurrentHover) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/hover/browser/contentHoverController.ts","vs/editor/contrib/hover/browser/contentHoverController.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAE,kCAAkC,EAAE,kCAAkC,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAE5I,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAMnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AACnG,OAAO,EAAE,kCAAkC,EAAE,MAAM,6EAA6E,CAAC;AACjI,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAG1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,4BAA4B,EAAE,eA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EAAE,CAAC;IACnC,CAAC;IAEM,WAAW;QACjB,IAAI,CAAC,cAAc,EAAE,WAAW,EAAE,CAAC;IACpC,CAAC;IAEM,MAAM;QACZ,IAAI,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;IAC/B,CAAC;IAEM,QAAQ;QACd,IAAI,CAAC,cAAc,EAAE,QAAQ,EAAE,CAAC;IACjC,CAAC;IAEM,OAAO;QACb,IAAI,CAAC,cAAc,EAAE,OAAO,EAAE,CAAC;IAChC,CAAC;IAEM,UAAU;QAChB,IAAI,CAAC,cAAc,EAAE,UAAU,EAAE,CAAC;IACnC,CAAC;IAED,IAAW,oBAAoB;QAC9B,OAAO,IAAI,CAAC,cAAc,EAAE,oBAAoB,CAAC;IAClD,CAAC;IAED,IAAW,cAAc;QACxB,OAAO,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC;IACvC,CAAC;IAEe,OAAO;QACtB,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;QAC/B,IAAI,CAAC,cAAc,EAAE,OAAO,EAAE,CAAC;IAChC,CAAC;;AAnWW,sBAAsB;IAsBhC,WAAA,mBAAmB,CAAA;IACnB,WAAA,qBAAqB,CAAA;IACrB,WAAA,kBAAkB,CAAA;GAxBR,sBAAsB,CAoWlC","file":"contentHoverController.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { DECREASE_HOVER_VERBOSITY_ACTION_ID, INCREASE_HOVER_VERBOSITY_ACTION_ID, SHOW_OR_FOCUS_HOVER_ACTION_ID } from './hoverActionIds.js';\nimport { IKeyboardEvent } from '../../../../base/browser/keyboardEvent.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { ICodeEditor, IEditorMouseEvent, IPartialEditorMouseEvent } from '../../../browser/editorBrowser.js';\nimport { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js';\nimport { Range } from '../../../common/core/range.js';\nimport { IEditorContribution, IScrollEvent } from '../../../common/editorCommon.js';\nimport { HoverStartMode, HoverStartSource } from './hoverOperation.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { InlineSuggestionHintsContentWidget } from '../../inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ResultKind } from '../../../../platform/keybinding/common/keybindingResolver.js';\nimport { HoverVerbosityAction } from '../../../common/languages.js';\nimport { RunOnceScheduler } from '../../../../base/common/async.js';\nimport { isMousePositionWithinElement, shouldShowHover, isTriggerModifierPressed } from './hoverUtils.js';\nimport { ContentHoverWidgetWrapper } from './contentHoverWidgetWrapper.js';\nimport './hover.css';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { isOnColorDecorator } from '../../colorPicker/browser/hoverColorPicker/hoverColorPicker.js';\nimport { isModifierKey, KeyCode } from '../../../../base/common/keyCodes.js';\nimport { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js';\n\n// sticky hover widget which doesn't disappear on focus out and such\nconst _sticky = false\n\t// || Boolean(\"true\") // done \"weirdly\" so that a lint warning prevents you from pushing this\n\t;\n\ninterface IHoverSettings {\n\treadonly enabled: 'on' | 'off' | 'onKeyboardModifier';\n\treadonly sticky: boolean;\n\treadonly hidingDelay: number;\n}\n\nexport class ContentHoverController extends Disposable implements IEditorContribution {\n\n\tprivate readonly _onHoverContentsChanged = this._register(new Emitter<void>());\n\n\tpublic static readonly ID = 'editor.contrib.contentHover';\n\n\tpublic shouldKeepOpenOnEditorMouseMoveOrLeave: boolean = false;\n\n\tprivate readonly _listenersStore = new DisposableStore();\n\n\tprivate _contentWidget: ContentHoverWidgetWrapper | undefined;\n\n\tprivate _mouseMoveEvent: IEditorMouseEvent | undefined;\n\tprivate _reactToEditorMouseMoveRunner: RunOnceScheduler;\n\n\tprivate _hoverSettings!: IHoverSettings;\n\tprivate _isMouseDown: boolean = false;\n\n\tprivate _ignoreMouseEvents: boolean = false;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IContextMenuService _contextMenuService: IContextMenuService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService\n\t) {\n\t\tsuper();\n\t\tthis._reactToEditorMouseMoveRunner = this._register(new RunOnceScheduler(\n\t\t\t() => {\n\t\t\t\tif (this._mouseMoveEvent) {\n\t\t\t\t\tthis._reactToEditorMouseMove(this._mouseMoveEvent);\n\t\t\t\t}\n\t\t\t}, 0\n\t\t));\n\t\tthis._register(_contextMenuService.onDidShowContextMenu(() => {\n\t\t\tthis.hideContentHover();\n\t\t\tthis._ignoreMouseEvents = true;\n\t\t}));\n\t\tthis._register(_contextMenuService.onDidHideContextMenu(() => {\n\t\t\tthis._ignoreMouseEvents = false;\n\t\t}));\n\t\tthis._hookListeners();\n\t\tthis._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {\n\t\t\tif (e.hasChanged(EditorOption.hover)) {\n\t\t\t\tthis._unhookListeners();\n\t\t\t\tthis._hookListeners();\n\t\t\t}\n\t\t}));\n\t}\n\n\tstatic get(editor: ICodeEditor): ContentHoverController | null {\n\t\treturn editor.getContribution<ContentHoverController>(ContentHoverController.ID);\n\t}\n\n\tprivate _hookListeners(): void {\n\t\tconst hoverOpts = this._editor.getOption(EditorOption.hover);\n\t\tthis._hoverSettings = {\n\t\t\tenabled: hoverOpts.enabled,\n\t\t\tsticky: hoverOpts.sticky,\n\t\t\thidingDelay: hoverOpts.hidingDelay\n\t\t};\n\t\tif (hoverOpts.enabled === 'off') {\n\t\t\tthis._cancelSchedulerAndHide();\n\t\t}\n\t\tthis._listenersStore.add(this._editor.onMouseDown((e: IEditorMouseEvent) => this._onEditorMouseDown(e)));\n\t\tthis._listenersStore.add(this._editor.onMouseUp(() => this._onEditorMouseUp()));\n\t\tthis._listenersStore.add(this._editor.onMouseMove((e: IEditorMouseEvent) => this._onEditorMouseMove(e)));\n\t\tthis._listenersStore.add(this._editor.onKeyDown((e: IKeyboardEvent) => this._onKeyDown(e)));\n\t\tthis._listenersStore.add(this._editor.onMouseLeave((e) => this._onEditorMouseLeave(e)));\n\t\tthis._listenersStore.add(this._editor.onDidChangeModel(() => this._cancelSchedulerAndHide()));\n\t\tthis._listenersStore.add(this._editor.onDidChangeModelContent(() => this._cancelScheduler()));\n\t\tthis._listenersStore.add(this._editor.onDidScrollChange((e: IScrollEvent) => this._onEditorScrollChanged(e)));\n\t}\n\n\tprivate _unhookListeners(): void {\n\t\tthis._listenersStore.clear();\n\t}\n\n\tprivate _cancelSchedulerAndHide(): void {\n\t\tthis._cancelScheduler();\n\t\tthis.hideContentHover();\n\t}\n\n\tprivate _cancelScheduler() {\n\t\tthis._mouseMoveEvent = undefined;\n\t\tthis._reactToEditorMouseMoveRunner.cancel();\n\t}\n\n\tprivate _onEditorScrollChanged(e: IScrollEvent): void {\n\t\tif (this._ignoreMouseEvents) {\n\t\t\treturn;\n\t\t}\n\t\tif (e.scrollTopChanged || e.scrollLeftChanged) {\n\t\t\tthis.hideContentHover();\n\t\t}\n\t}\n\n\tprivate _onEditorMouseDown(mouseEvent: IEditorMouseEvent): void {\n\t\tif (this._ignoreMouseEvents) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isMouseDown = true;\n\t\tconst shouldKeepHoverWidgetVisible = this._shouldKeepHoverWidgetVisible(mouseEvent);\n\t\tif (shouldKeepHoverWidgetVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis.hideContentHover();\n\t}\n\n\tprivate _shouldKeepHoverWidgetVisible(mouseEvent: IPartialEditorMouseEvent): boolean {\n\t\treturn this._isMouseOnContentHoverWidget(mouseEvent) || this._isContentWidgetResizing() || isOnColorDecorator(mouseEvent);\n\t}\n\n\tprivate _isMouseOnContentHoverWidget(mouseEvent: IPartialEditorMouseEvent): boolean {\n\t\tif (!this._contentWidget) {\n\t\t\treturn false;\n\t\t}\n\t\treturn isMousePositionWithinElement(this._contentWidget.getDomNode(), mouseEvent.event.posx, mouseEvent.event.posy);\n\t}\n\n\tprivate _onEditorMouseUp(): void {\n\t\tif (this._ignoreMouseEvents) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isMouseDown = false;\n\t}\n\n\tprivate _onEditorMouseLeave(mouseEvent: IPartialEditorMouseEvent): void {\n\t\tif (this._ignoreMouseEvents) {\n\t\t\treturn;\n\t\t}\n\t\tif (this.shouldKeepOpenOnEditorMouseMoveOrLeave) {\n\t\t\treturn;\n\t\t}\n\t\tthis._cancelScheduler();\n\t\tconst shouldKeepHoverWidgetVisible = this._shouldKeepHoverWidgetVisible(mouseEvent);\n\t\tif (shouldKeepHoverWidgetVisible) {\n\t\t\treturn;\n\t\t}\n\t\tif (_sticky) {\n\t\t\treturn;\n\t\t}\n\t\tthis.hideContentHover();\n\t}\n\n\tprivate _shouldKeepCurrentHover(mouseEvent: IEditorMouseEvent): boolean {\n\t\tconst contentWidget = this._contentWidget;\n\t\tif (!contentWidget) {\n\t\t\treturn false;\n\t\t}\n\t\tconst isHoverSticky = this._hoverSettings.sticky;\n\t\tconst isMouseOnStickyContentHoverWidget = (mouseEvent: IEditorMouseEvent, isHoverSticky: boolean): boolean => {\n\t\t\tconst isMouseOnContentHoverWidget = this._isMouseOnContentHoverWidget(mouseEvent);\n\t\t\treturn isHoverSticky && isMouseOnContentHoverWidget;\n\t\t};\n\t\tconst isMouseOnColorPickerOrChoosingColor = (mouseEvent: IEditorMouseEvent): boolean => {\n\t\t\tconst isColorPickerVisible = contentWidget.isColorPickerVisible;\n\t\t\tconst isMouseOnContentHoverWidget = this._isMouseOnContentHoverWidget(mouseEvent);\n\t\t\tconst isMouseOnHoverWithColorPicker = isColorPickerVisible && isMouseOnContentHoverWidget;\n\t\t\tconst isMaybeChoosingColor = isColorPickerVisible && this._isMouseDown;\n\t\t\treturn isMouseOnHoverWithColorPicker || isMaybeChoosingColor;\n\t\t};\n\t\t// TODO@aiday-mar verify if the following is necessary code\n\t\tconst isTextSelectedWithinContentHoverWidget = (mouseEvent: IEditorMouseEvent, sticky: boolean): boolean => {\n\t\t\tconst view = mouseEvent.event.browserEvent.view;\n\t\t\tif (!view) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn sticky && contentWidget.containsNode(view.document.activeElement) && !view.getSelection()?.isCollapsed;\n\t\t};\n\t\tconst isFocused = contentWidget.isFocused;\n\t\tconst isResizing = contentWidget.isResizing;\n\t\tconst isStickyAndVisibleFromKeyboard = this._hoverSettings.sticky && contentWidget.isVisibleFromKeyboard;\n\n\t\treturn this.shouldKeepOpenOnEditorMouseMoveOrLeave\n\t\t\t|| isFocused\n\t\t\t|| isResizing\n\t\t\t|| isStickyAndVisibleFromKeyboard\n\t\t\t|| isMouseOnStickyContentHoverWidget(mouseEvent, isHoverSticky)\n\t\t\t|| isMouseOnColorPickerOrChoosingColor(mouseEvent)\n\t\t\t|| isTextSelectedWithinContentHoverWidget(mouseEvent, isHoverSticky);\n\t}\n\n\tprivate _onEditorMouseMove(mouseEvent: IEditorMouseEvent): void {\n\t\tif (this._ignoreMouseEvents) {\n\t\t\treturn;\n\t\t}\n\t\tthis._mouseMoveEvent = mouseEvent;\n\t\tconst shouldKeepCurrentHover = this._shouldKeepCurrentHover(mouseEvent);\n\t\tif (shouldKeepCurrentHover) {\n\t\t\tthis._reactToEditorMouseMoveRunner.cancel();\n\t\t\treturn;\n\t\t}\n\t\tconst shouldRescheduleHoverComputation = this._shouldRescheduleHoverComputation();\n\t\tif (shouldRescheduleHoverComputation) {\n\t\t\tif (!this._reactToEditorMouseMoveRunner.isScheduled()) {\n\t\t\t\tthis._reactToEditorMouseMoveRunner.schedule(this._hoverSettings.hidingDelay);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tthis._reactToEditorMouseMove(mouseEvent);\n\t}\n\n\tprivate _shouldRescheduleHoverComputation(): boolean {\n\t\tconst hidingDelay = this._hoverSettings.hidingDelay;\n\t\tconst isContentHoverWidgetVisible = this._contentWidget?.isVisible ?? false;\n\t\t// If the mouse is not over the widget, and if sticky is on,\n\t\t// then give it a grace period before reacting to the mouse event\n\t\treturn isContentHoverWidgetVisible && this._hoverSettings.sticky && hidingDelay > 0;\n\t}\n\n\tprivate _reactToEditorMouseMove(mouseEvent: IEditorMouseEvent): void {\n\t\tif (shouldShowHover(\n\t\t\tthis._hoverSettings.enabled,\n\t\t\tthis._editor.getOption(EditorOption.multiCursorModifier),\n\t\t\tmouseEvent\n\t\t)) {\n\t\t\tconst contentWidget: ContentHoverWidgetWrapper = this._getOrCreateContentWidget();\n\t\t\tif (contentWidget.showsOrWillShow(mouseEvent)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (_sticky) {\n\t\t\treturn;\n\t\t}\n\t\tthis.hideContentHover();\n\t}\n\n\tprivate _onKeyDown(e: IKeyboardEvent): void {\n\t\tif (this._ignoreMouseEvents || !this._contentWidget) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._hoverSettings.enabled === 'onKeyboardModifier'\n\t\t\t&& isTriggerModifierPressed(this._editor.getOption(EditorOption.multiCursorModifier), e)\n\t\t\t&& this._mouseMoveEvent) {\n\t\t\tif (!this._contentWidget.isVisible) {\n\t\t\t\tthis._contentWidget.showsOrWillShow(this._mouseMoveEvent);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst isPotentialKeyboardShortcut = this._isPotentialKeyboardShortcut(e);\n\t\tconst isModifierKeyPressed = isModifierKey(e.keyCode);\n\t\tif (isPotentialKeyboardShortcut || isModifierKeyPressed) {\n\t\t\treturn;\n\t\t}\n\t\tif (this._contentWidget.isFocused && e.keyCode === KeyCode.Tab) {\n\t\t\treturn;\n\t\t}\n\t\tthis.hideContentHover();\n\t}\n\n\tprivate _isPotentialKeyboardShortcut(e: IKeyboardEvent): boolean {\n\t\tif (!this._editor.hasModel() || !this._contentWidget) {\n\t\t\treturn false;\n\t\t}\n\t\tconst resolvedKeyboardEvent = this._keybindingService.softDispatch(e, this._editor.getDomNode());\n\t\tconst moreChordsAreNeeded = resolvedKeyboardEvent.kind === ResultKind.MoreChordsNeeded;\n\t\tconst isHoverAction = resolvedKeyboardEvent.kind === ResultKind.KbFound\n\t\t\t&& (resolvedKeyboardEvent.commandId === SHOW_OR_FOCUS_HOVER_ACTION_ID\n\t\t\t\t|| resolvedKeyboardEvent.commandId === INCREASE_HOVER_VERBOSITY_ACTION_ID\n\t\t\t\t|| resolvedKeyboardEvent.commandId === DECREASE_HOVER_VERBOSITY_ACTION_ID)\n\t\t\t&& this._contentWidget.isVisible;\n\t\treturn moreChordsAreNeeded || isHoverAction;\n\t}\n\n\tpublic hideContentHover(): void {\n\t\tif (_sticky) {\n\t\t\treturn;\n\t\t}\n\t\tif (InlineSuggestionHintsContentWidget.dropDownVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis._contentWidget?.hide();\n\t}\n\n\tprivate _getOrCreateContentWidget(): ContentHoverWidgetWrapper {\n\t\tif (!this._contentWidget) {\n\t\t\tthis._contentWidget = this._instantiationService.createInstance(ContentHoverWidgetWrapper, this._editor);\n\t\t\tthis._listenersStore.add(this._contentWidget.onContentsChanged(() => this._onHoverContentsChanged.fire()));\n\t\t}\n\t\treturn this._contentWidget;\n\t}\n\n\tpublic showContentHover(\n\t\trange: Range,\n\t\tmode: HoverStartMode,\n\t\tsource: HoverStartSource,\n\t\tfocus: boolean\n\t): void {\n\t\tthis._getOrCreateContentWidget().startShowingAtRange(range, mode, source, focus);\n\t}\n\n\tprivate _isContentWidgetResizing(): boolean {\n\t\treturn this._contentWidget?.widget.isResizing || false;\n\t}\n\n\tpublic focusedHoverPartIndex(): number {\n\t\treturn this._getOrCreateContentWidget().focusedHoverPartIndex();\n\t}\n\n\tpublic updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): void {\n\t\tthis._getOrCreateContentWidget().updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic focus(): void {\n\t\tthis._contentWidget?.focus();\n\t}\n\n\tpublic scrollUp(): void {\n\t\tthis._contentWidget?.scrollUp();\n\t}\n\n\tpublic scrollDown(): void {\n\t\tthis._contentWidget?.scrollDown();\n\t}\n\n\tpublic scrollLeft(): void {\n\t\tthis._contentWidget?.scrollLeft();\n\t}\n\n\tpublic scrollRight(): void {\n\t\tthis._contentWidget?.scrollRight();\n\t}\n\n\tpublic pageUp(): void {\n\t\tthis._contentWidget?.pageUp();\n\t}\n\n\tpublic pageDown(): void {\n\t\tthis._contentWidget?.pageDown();\n\t}\n\n\tpublic goToTop(): void {\n\t\tthis._contentWidget?.goToTop();\n\t}\n\n\tpublic goToBottom(): void {\n\t\tthis._contentWidget?.goToBottom();\n\t}\n\n\tpublic get isColorPickerVisible(): boolean | undefined {\n\t\treturn this._contentWidget?.isColorPickerVisible;\n\t}\n\n\tpublic get isHoverVisible(): boolean | undefined {\n\t\treturn this._contentWidget?.isVisible;\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._unhookListeners();\n\t\tthis._listenersStore.dispose();\n\t\tthis._contentWidget?.dispose();\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { DECREASE_HOVER_VERBOSITY_ACTION_ID, INCREASE_HOVER_VERBOSITY_ACTION_ID, SHOW_OR_FOCUS_HOVER_ACTION_ID } from './hoverActionIds.js';\nimport { IKeyboardEvent } from '../../../../base/browser/keyboardEvent.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { ICodeEditor, IEditorMouseEvent, IPartialEditorMouseEvent } from '../../../browser/editorBrowser.js';\nimport { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js';\nimport { Range } from '../../../common/core/range.js';\nimport { IEditorContribution, IScrollEvent } from '../../../common/editorCommon.js';\nimport { HoverStartMode, HoverStartSource } from './hoverOperation.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { InlineSuggestionHintsContentWidget } from '../../inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ResultKind } from '../../../../platform/keybinding/common/keybindingResolver.js';\nimport { HoverVerbosityAction } from '../../../common/languages.js';\nimport { RunOnceScheduler } from '../../../../base/common/async.js';\nimport { isMousePositionWithinElement, shouldShowHover, isTriggerModifierPressed } from './hoverUtils.js';\nimport { ContentHoverWidgetWrapper } from './contentHoverWidgetWrapper.js';\nimport './hover.css';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { isOnColorDecorator } from '../../colorPicker/browser/hoverColorPicker/hoverColorPicker.js';\nimport { isModifierKey, KeyCode } from '../../../../base/common/keyCodes.js';\nimport { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js';\n\n// sticky hover widget which doesn't disappear on focus out and such\nconst _sticky = false\n\t// || Boolean(\"true\") // done \"weirdly\" so that a lint warning prevents you from pushing this\n\t;\n\ninterface IHoverSettings {\n\treadonly enabled: 'on' | 'off' | 'onKeyboardModifier';\n\treadonly sticky: boolean;\n\treadonly hidingDelay: number;\n}\n\nexport class ContentHoverController extends Disposable implements IEditorContribution {\n\n\tprivate readonly _onHoverContentsChanged = this._register(new Emitter<void>());\n\n\tpublic static readonly ID = 'editor.contrib.contentHover';\n\n\tpublic shouldKeepOpenOnEditorMouseMoveOrLeave: boolean = false;\n\n\tprivate readonly _listenersStore = new DisposableStore();\n\n\tprivate _contentWidget: ContentHoverWidgetWrapper | undefined;\n\n\tprivate _mouseMoveEvent: IEditorMouseEvent | undefined;\n\tprivate _reactToEditorMouseMoveRunner: RunOnceScheduler;\n\n\tprivate _hoverSettings!: IHoverSettings;\n\tprivate _isMouseDown: boolean = false;\n\n\tprivate _ignoreMouseEvents: boolean = false;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IContextMenuService _contextMenuService: IContextMenuService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService\n\t) {\n\t\tsuper();\n\t\tthis._reactToEditorMouseMoveRunner = this._register(new RunOnceScheduler(\n\t\t\t() => {\n\t\t\t\tif (this._mouseMoveEvent) {\n\t\t\t\t\tthis._reactToEditorMouseMove(this._mouseMoveEvent);\n\t\t\t\t}\n\t\t\t}, 0\n\t\t));\n\t\tthis._register(_contextMenuService.onDidShowContextMenu(() => {\n\t\t\tthis.hideContentHover();\n\t\t\tthis._ignoreMouseEvents = true;\n\t\t}));\n\t\tthis._register(_contextMenuService.onDidHideContextMenu(() => {\n\t\t\tthis._ignoreMouseEvents = false;\n\t\t}));\n\t\tthis._hookListeners();\n\t\tthis._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {\n\t\t\tif (e.hasChanged(EditorOption.hover)) {\n\t\t\t\tthis._unhookListeners();\n\t\t\t\tthis._hookListeners();\n\t\t\t}\n\t\t}));\n\t}\n\n\tstatic get(editor: ICodeEditor): ContentHoverController | null {\n\t\treturn editor.getContribution<ContentHoverController>(ContentHoverController.ID);\n\t}\n\n\tprivate _hookListeners(): void {\n\t\tconst hoverOpts = this._editor.getOption(EditorOption.hover);\n\t\tthis._hoverSettings = {\n\t\t\tenabled: hoverOpts.enabled,\n\t\t\tsticky: hoverOpts.sticky,\n\t\t\thidingDelay: hoverOpts.hidingDelay\n\t\t};\n\t\tif (hoverOpts.enabled === 'off') {\n\t\t\tthis._cancelSchedulerAndHide();\n\t\t}\n\t\tthis._listenersStore.add(this._editor.onMouseDown((e: IEditorMouseEvent) => this._onEditorMouseDown(e)));\n\t\tthis._listenersStore.add(this._editor.onMouseUp(() => this._onEditorMouseUp()));\n\t\tthis._listenersStore.add(this._editor.onMouseMove((e: IEditorMouseEvent) => this._onEditorMouseMove(e)));\n\t\tthis._listenersStore.add(this._editor.onKeyDown((e: IKeyboardEvent) => this._onKeyDown(e)));\n\t\tthis._listenersStore.add(this._editor.onMouseLeave((e) => this._onEditorMouseLeave(e)));\n\t\tthis._listenersStore.add(this._editor.onDidChangeModel(() => this._cancelSchedulerAndHide()));\n\t\tthis._listenersStore.add(this._editor.onDidChangeModelContent(() => this._cancelScheduler()));\n\t\tthis._listenersStore.add(this._editor.onDidScrollChange((e: IScrollEvent) => this._onEditorScrollChanged(e)));\n\t}\n\n\tprivate _unhookListeners(): void {\n\t\tthis._listenersStore.clear();\n\t}\n\n\tprivate _cancelSchedulerAndHide(): void {\n\t\tthis._cancelScheduler();\n\t\tthis.hideContentHover();\n\t}\n\n\tprivate _cancelScheduler() {\n\t\tthis._mouseMoveEvent = undefined;\n\t\tthis._reactToEditorMouseMoveRunner.cancel();\n\t}\n\n\tprivate _onEditorScrollChanged(e: IScrollEvent): void {\n\t\tif (this._ignoreMouseEvents) {\n\t\t\treturn;\n\t\t}\n\t\tif (e.scrollTopChanged || e.scrollLeftChanged) {\n\t\t\tthis.hideContentHover();\n\t\t}\n\t}\n\n\tprivate _onEditorMouseDown(mouseEvent: IEditorMouseEvent): void {\n\t\tif (this._ignoreMouseEvents) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isMouseDown = true;\n\t\tconst shouldKeepHoverWidgetVisible = this._shouldKeepHoverWidgetVisible(mouseEvent);\n\t\tif (shouldKeepHoverWidgetVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis.hideContentHover();\n\t}\n\n\tprivate _shouldKeepHoverWidgetVisible(mouseEvent: IPartialEditorMouseEvent): boolean {\n\t\treturn this._isMouseOnContentHoverWidget(mouseEvent) || this._isContentWidgetResizing() || isOnColorDecorator(mouseEvent);\n\t}\n\n\tprivate _isMouseOnContentHoverWidget(mouseEvent: IPartialEditorMouseEvent): boolean {\n\t\tif (!this._contentWidget) {\n\t\t\treturn false;\n\t\t}\n\t\treturn isMousePositionWithinElement(this._contentWidget.getDomNode(), mouseEvent.event.posx, mouseEvent.event.posy);\n\t}\n\n\tprivate _onEditorMouseUp(): void {\n\t\tif (this._ignoreMouseEvents) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isMouseDown = false;\n\t}\n\n\tprivate _onEditorMouseLeave(mouseEvent: IPartialEditorMouseEvent): void {\n\t\tif (this._ignoreMouseEvents) {\n\t\t\treturn;\n\t\t}\n\t\tif (this.shouldKeepOpenOnEditorMouseMoveOrLeave) {\n\t\t\treturn;\n\t\t}\n\t\tthis._cancelScheduler();\n\t\tconst shouldKeepHoverWidgetVisible = this._shouldKeepHoverWidgetVisible(mouseEvent);\n\t\tif (shouldKeepHoverWidgetVisible) {\n\t\t\treturn;\n\t\t}\n\t\tif (_sticky) {\n\t\t\treturn;\n\t\t}\n\t\tthis.hideContentHover();\n\t}\n\n\tprivate _shouldKeepCurrentHover(mouseEvent: IEditorMouseEvent): boolean {\n\t\tconst contentWidget = this._contentWidget;\n\t\tif (!contentWidget) {\n\t\t\treturn false;\n\t\t}\n\t\tconst isHoverSticky = this._hoverSettings.sticky;\n\t\tconst isMouseOnStickyContentHoverWidget = (mouseEvent: IEditorMouseEvent, isHoverSticky: boolean): boolean => {\n\t\t\tconst isMouseOnContentHoverWidget = this._isMouseOnContentHoverWidget(mouseEvent);\n\t\t\treturn isHoverSticky && isMouseOnContentHoverWidget;\n\t\t};\n\t\tconst isMouseOnColorPickerOrChoosingColor = (mouseEvent: IEditorMouseEvent): boolean => {\n\t\t\tconst isColorPickerVisible = contentWidget.isColorPickerVisible;\n\t\t\tconst isMouseOnContentHoverWidget = this._isMouseOnContentHoverWidget(mouseEvent);\n\t\t\tconst isMouseOnHoverWithColorPicker = isColorPickerVisible && isMouseOnContentHoverWidget;\n\t\t\tconst isMaybeChoosingColor = isColorPickerVisible && this._isMouseDown;\n\t\t\treturn isMouseOnHoverWithColorPicker || isMaybeChoosingColor;\n\t\t};\n\t\t// TODO@aiday-mar verify if the following is necessary code\n\t\tconst isTextSelectedWithinContentHoverWidget = (mouseEvent: IEditorMouseEvent, sticky: boolean): boolean => {\n\t\t\tconst view = mouseEvent.event.browserEvent.view;\n\t\t\tif (!view) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn sticky && contentWidget.containsNode(view.document.activeElement) && !view.getSelection()?.isCollapsed;\n\t\t};\n\t\tconst isFocused = contentWidget.isFocused;\n\t\tconst isResizing = contentWidget.isResizing;\n\t\tconst isStickyAndVisibleFromKeyboard = this._hoverSettings.sticky && contentWidget.isVisibleFromKeyboard;\n\n\t\treturn this.shouldKeepOpenOnEditorMouseMoveOrLeave\n\t\t\t|| isFocused\n\t\t\t|| isResizing\n\t\t\t|| isStickyAndVisibleFromKeyboard\n\t\t\t|| isMouseOnStickyContentHoverWidget(mouseEvent, isHoverSticky)\n\t\t\t|| isMouseOnColorPickerOrChoosingColor(mouseEvent)\n\t\t\t|| isTextSelectedWithinContentHoverWidget(mouseEvent, isHoverSticky);\n\t}\n\n\tprivate _onEditorMouseMove(mouseEvent: IEditorMouseEvent): void {\n\t\tif (this._ignoreMouseEvents) {\n\t\t\treturn;\n\t\t}\n\t\tthis._mouseMoveEvent = mouseEvent;\n\t\tconst shouldKeepCurrentHover = this._shouldKeepCurrentHover(mouseEvent);\n\t\tif (shouldKeepCurrentHover) {\n\t\t\tthis._reactToEditorMouseMoveRunner.cancel();\n\t\t\treturn;\n\t\t}\n\t\tconst shouldRescheduleHoverComputation = this._shouldRescheduleHoverComputation();\n\t\tif (shouldRescheduleHoverComputation) {\n\t\t\tif (!this._reactToEditorMouseMoveRunner.isScheduled()) {\n\t\t\t\tthis._reactToEditorMouseMoveRunner.schedule(this._hoverSettings.hidingDelay);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tthis._reactToEditorMouseMove(mouseEvent);\n\t}\n\n\tprivate _shouldRescheduleHoverComputation(): boolean {\n\t\tconst hidingDelay = this._hoverSettings.hidingDelay;\n\t\tconst isContentHoverWidgetVisible = this._contentWidget?.isVisible ?? false;\n\t\t// If the mouse is not over the widget, and if sticky is on,\n\t\t// then give it a grace period before reacting to the mouse event\n\t\treturn isContentHoverWidgetVisible && this._hoverSettings.sticky && hidingDelay > 0;\n\t}\n\n\tprivate _reactToEditorMouseMove(mouseEvent: IEditorMouseEvent): void {\n\t\tif (shouldShowHover(\n\t\t\tthis._hoverSettings.enabled,\n\t\t\tthis._editor.getOption(EditorOption.multiCursorModifier),\n\t\t\tmouseEvent\n\t\t)) {\n\t\t\tconst contentWidget: ContentHoverWidgetWrapper = this._getOrCreateContentWidget();\n\t\t\tif (contentWidget.showsOrWillShow(mouseEvent)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (_sticky) {\n\t\t\treturn;\n\t\t}\n\t\tthis.hideContentHover();\n\t}\n\n\tprivate _onKeyDown(e: IKeyboardEvent): void {\n\t\tif (this._ignoreMouseEvents || !this._contentWidget) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._hoverSettings.enabled === 'onKeyboardModifier'\n\t\t\t&& isTriggerModifierPressed(this._editor.getOption(EditorOption.multiCursorModifier), e)\n\t\t\t&& this._mouseMoveEvent) {\n\t\t\tif (!this._contentWidget.isVisible) {\n\t\t\t\tthis._contentWidget.showsOrWillShow(this._mouseMoveEvent);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst isPotentialKeyboardShortcut = this._isPotentialKeyboardShortcut(e);\n\t\tconst isModifierKeyPressed = isModifierKey(e.keyCode);\n\t\tif (isPotentialKeyboardShortcut || isModifierKeyPressed) {\n\t\t\treturn;\n\t\t}\n\t\tif (this._contentWidget.isFocused && e.keyCode === KeyCode.Tab) {\n\t\t\treturn;\n\t\t}\n\t\tthis.hideContentHover();\n\t}\n\n\tprivate _isPotentialKeyboardShortcut(e: IKeyboardEvent): boolean {\n\t\tif (!this._editor.hasModel() || !this._contentWidget) {\n\t\t\treturn false;\n\t\t}\n\t\tconst resolvedKeyboardEvent = this._keybindingService.softDispatch(e, this._editor.getDomNode());\n\t\tconst moreChordsAreNeeded = resolvedKeyboardEvent.kind === ResultKind.MoreChordsNeeded;\n\t\tconst isHoverAction = resolvedKeyboardEvent.kind === ResultKind.KbFound\n\t\t\t&& (resolvedKeyboardEvent.commandId === SHOW_OR_FOCUS_HOVER_ACTION_ID\n\t\t\t\t|| resolvedKeyboardEvent.commandId === INCREASE_HOVER_VERBOSITY_ACTION_ID\n\t\t\t\t|| resolvedKeyboardEvent.commandId === DECREASE_HOVER_VERBOSITY_ACTION_ID)\n\t\t\t&& this._contentWidget.isVisible;\n\t\treturn moreChordsAreNeeded || isHoverAction;\n\t}\n\n\tpublic hideContentHover(): void {\n\t\tif (_sticky) {\n\t\t\treturn;\n\t\t}\n\t\tif (InlineSuggestionHintsContentWidget.dropDownVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis._contentWidget?.hide();\n\t}\n\n\tprivate _getOrCreateContentWidget(): ContentHoverWidgetWrapper {\n\t\tif (!this._contentWidget) {\n\t\t\tthis._contentWidget = this._instantiationService.createInstance(ContentHoverWidgetWrapper, this._editor);\n\t\t\tthis._listenersStore.add(this._contentWidget.onContentsChanged(() => this._onHoverContentsChanged.fire()));\n\t\t}\n\t\treturn this._contentWidget;\n\t}\n\n\tpublic showContentHover(\n\t\trange: Range,\n\t\tmode: HoverStartMode,\n\t\tsource: HoverStartSource,\n\t\tfocus: boolean\n\t): void {\n\t\tthis._getOrCreateContentWidget().startShowingAtRange(range, mode, source, focus);\n\t}\n\n\tprivate _isContentWidgetResizing(): boolean {\n\t\treturn this._contentWidget?.widget.isResizing || false;\n\t}\n\n\tpublic focusedHoverPartIndex(): number {\n\t\treturn this._getOrCreateContentWidget().focusedHoverPartIndex();\n\t}\n\n\tpublic updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): void {\n\t\tthis._getOrCreateContentWidget().updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic focus(): void {\n\t\tthis._contentWidget?.focus();\n\t}\n\n\tpublic scrollUp(): void {\n\t\tthis._contentWidget?.scrollUp();\n\t}\n\n\tpublic scrollDown(): void {\n\t\tthis._contentWidget?.scrollDown();\n\t}\n\n\tpublic scrollLeft(): void {\n\t\tthis._contentWidget?.scrollLeft();\n\t}\n\n\tpublic scrollRight(): void {\n\t\tthis._contentWidget?.scrollRight();\n\t}\n\n\tpublic pageUp(): void {\n\t\tthis._contentWidget?.pageUp();\n\t}\n\n\tpublic pageDown(): void {\n\t\tthis._contentWidget?.pageDown();\n\t}\n\n\tpublic goToTop(): void {\n\t\tthis._contentWidget?.goToTop();\n\t}\n\n\tpublic goToBottom(): void {\n\t\tthis._contentWidget?.goToBottom();\n\t}\n\n\tpublic get isColorPickerVisible(): boolean | undefined {\n\t\treturn this._contentWidget?.isColorPickerVisible;\n\t}\n\n\tpublic get isHoverVisible(): boolean | undefined {\n\t\treturn this._contentWidget?.isVisible;\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._unhookListeners();\n\t\tthis._listenersStore.dispose();\n\t\tthis._contentWidget?.dispose();\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/hover/browser/contentHoverController.ts","vs/editor/contrib/hover/browser/contentHoverController.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAE,kCAAkC,EAAE,kCAAkC,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAE5I,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAMnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AACnG,OAAO,EAAE,kCAAkC,EAAE,MAAM,6EAA6E,CAAC;AACjI,OAA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B,CA0WlC","file":"contentHoverController.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { DECREASE_HOVER_VERBOSITY_ACTION_ID, INCREASE_HOVER_VERBOSITY_ACTION_ID, SHOW_OR_FOCUS_HOVER_ACTION_ID } from './hoverActionIds.js';\nimport { IKeyboardEvent } from '../../../../base/browser/keyboardEvent.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { ICodeEditor, IEditorMouseEvent, IPartialEditorMouseEvent } from '../../../browser/editorBrowser.js';\nimport { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js';\nimport { Range } from '../../../common/core/range.js';\nimport { IEditorContribution, IScrollEvent } from '../../../common/editorCommon.js';\nimport { HoverStartMode, HoverStartSource } from './hoverOperation.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { InlineSuggestionHintsContentWidget } from '../../inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ResultKind } from '../../../../platform/keybinding/common/keybindingResolver.js';\nimport { HoverVerbosityAction } from '../../../common/languages.js';\nimport { RunOnceScheduler } from '../../../../base/common/async.js';\nimport { isMousePositionWithinElement, shouldShowHover, isTriggerModifierPressed } from './hoverUtils.js';\nimport { ContentHoverWidgetWrapper } from './contentHoverWidgetWrapper.js';\nimport './hover.css';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { isOnColorDecorator } from '../../colorPicker/browser/hoverColorPicker/hoverColorPicker.js';\nimport { isModifierKey, KeyCode } from '../../../../base/common/keyCodes.js';\nimport { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js';\n\n// sticky hover widget which doesn't disappear on focus out and such\nconst _sticky = false\n\t// || Boolean(\"true\") // done \"weirdly\" so that a lint warning prevents you from pushing this\n\t;\n\ninterface IHoverSettings {\n\treadonly enabled: 'on' | 'off' | 'onKeyboardModifier';\n\treadonly sticky: boolean;\n\treadonly hidingDelay: number;\n}\n\nexport class ContentHoverController extends Disposable implements IEditorContribution {\n\n\tprivate readonly _onHoverContentsChanged = this._register(new Emitter<void>());\n\n\tpublic static readonly ID = 'editor.contrib.contentHover';\n\n\tpublic shouldKeepOpenOnEditorMouseMoveOrLeave: boolean = false;\n\n\tprivate readonly _listenersStore = new DisposableStore();\n\n\tprivate _contentWidget: ContentHoverWidgetWrapper | undefined;\n\n\tprivate _mouseMoveEvent: IEditorMouseEvent | undefined;\n\tprivate _reactToEditorMouseMoveRunner: RunOnceScheduler;\n\n\tprivate _hoverSettings!: IHoverSettings;\n\tprivate _isMouseDown: boolean = false;\n\n\tprivate _ignoreMouseEvents: boolean = false;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IContextMenuService _contextMenuService: IContextMenuService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService\n\t) {\n\t\tsuper();\n\t\tthis._reactToEditorMouseMoveRunner = this._register(new RunOnceScheduler(\n\t\t\t() => {\n\t\t\t\tif (this._mouseMoveEvent) {\n\t\t\t\t\tthis._reactToEditorMouseMove(this._mouseMoveEvent);\n\t\t\t\t}\n\t\t\t}, 0\n\t\t));\n\t\tthis._register(_contextMenuService.onDidShowContextMenu(() => {\n\t\t\tthis.hideContentHover();\n\t\t\tthis._ignoreMouseEvents = true;\n\t\t}));\n\t\tthis._register(_contextMenuService.onDidHideContextMenu(() => {\n\t\t\tthis._ignoreMouseEvents = false;\n\t\t}));\n\t\tthis._hookListeners();\n\t\tthis._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {\n\t\t\tif (e.hasChanged(EditorOption.hover)) {\n\t\t\t\tthis._unhookListeners();\n\t\t\t\tthis._hookListeners();\n\t\t\t}\n\t\t}));\n\t}\n\n\tstatic get(editor: ICodeEditor): ContentHoverController | null {\n\t\treturn editor.getContribution<ContentHoverController>(ContentHoverController.ID);\n\t}\n\n\tprivate _hookListeners(): void {\n\t\tconst hoverOpts = this._editor.getOption(EditorOption.hover);\n\t\tthis._hoverSettings = {\n\t\t\tenabled: hoverOpts.enabled,\n\t\t\tsticky: hoverOpts.sticky,\n\t\t\thidingDelay: hoverOpts.hidingDelay\n\t\t};\n\t\tif (hoverOpts.enabled === 'off') {\n\t\t\tthis._cancelSchedulerAndHide();\n\t\t}\n\t\tthis._listenersStore.add(this._editor.onMouseDown((e: IEditorMouseEvent) => this._onEditorMouseDown(e)));\n\t\tthis._listenersStore.add(this._editor.onMouseUp(() => this._onEditorMouseUp()));\n\t\tthis._listenersStore.add(this._editor.onMouseMove((e: IEditorMouseEvent) => this._onEditorMouseMove(e)));\n\t\tthis._listenersStore.add(this._editor.onKeyDown((e: IKeyboardEvent) => this._onKeyDown(e)));\n\t\tthis._listenersStore.add(this._editor.onMouseLeave((e) => this._onEditorMouseLeave(e)));\n\t\tthis._listenersStore.add(this._editor.onDidChangeModel(() => this._cancelSchedulerAndHide()));\n\t\tthis._listenersStore.add(this._editor.onDidChangeModelContent(() => this._cancelScheduler()));\n\t\tthis._listenersStore.add(this._editor.onDidScrollChange((e: IScrollEvent) => this._onEditorScrollChanged(e)));\n\t}\n\n\tprivate _unhookListeners(): void {\n\t\tthis._listenersStore.clear();\n\t}\n\n\tprivate _cancelSchedulerAndHide(): void {\n\t\tthis._cancelScheduler();\n\t\tthis.hideContentHover();\n\t}\n\n\tprivate _cancelScheduler() {\n\t\tthis._mouseMoveEvent = undefined;\n\t\tthis._reactToEditorMouseMoveRunner.cancel();\n\t}\n\n\tprivate _onEditorScrollChanged(e: IScrollEvent): void {\n\t\tif (this._ignoreMouseEvents) {\n\t\t\treturn;\n\t\t}\n\t\tif (e.scrollTopChanged || e.scrollLeftChanged) {\n\t\t\tthis.hideContentHover();\n\t\t}\n\t}\n\n\tprivate _onEditorMouseDown(mouseEvent: IEditorMouseEvent): void {\n\t\tif (this._ignoreMouseEvents) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isMouseDown = true;\n\t\tconst shouldKeepHoverWidgetVisible = this._shouldKeepHoverWidgetVisible(mouseEvent);\n\t\tif (shouldKeepHoverWidgetVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis.hideContentHover();\n\t}\n\n\tprivate _shouldKeepHoverWidgetVisible(mouseEvent: IPartialEditorMouseEvent): boolean {\n\t\treturn this._isMouseOnContentHoverWidget(mouseEvent) || this._isContentWidgetResizing() || isOnColorDecorator(mouseEvent);\n\t}\n\n\tprivate _isMouseOnContentHoverWidget(mouseEvent: IPartialEditorMouseEvent): boolean {\n\t\tif (!this._contentWidget || !this._contentWidget.getDomNode().isConnected) {\n\t\t\treturn false;\n\t\t}\n\t\treturn isMousePositionWithinElement(this._contentWidget.getDomNode(), mouseEvent.event.posx, mouseEvent.event.posy);\n\t}\n\n\tprivate _onEditorMouseUp(): void {\n\t\tif (this._ignoreMouseEvents) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isMouseDown = false;\n\t}\n\n\tprivate _onEditorMouseLeave(mouseEvent: IPartialEditorMouseEvent): void {\n\t\tif (this._ignoreMouseEvents) {\n\t\t\treturn;\n\t\t}\n\t\tif (this.shouldKeepOpenOnEditorMouseMoveOrLeave) {\n\t\t\treturn;\n\t\t}\n\t\tthis._cancelScheduler();\n\t\tconst shouldKeepHoverWidgetVisible = this._shouldKeepHoverWidgetVisible(mouseEvent);\n\t\tif (shouldKeepHoverWidgetVisible) {\n\t\t\treturn;\n\t\t}\n\t\tif (_sticky) {\n\t\t\treturn;\n\t\t}\n\t\tthis.hideContentHover();\n\t}\n\n\tprivate _shouldKeepCurrentHover(mouseEvent: IEditorMouseEvent): boolean {\n\t\tconst contentWidget = this._contentWidget;\n\t\tif (!contentWidget) {\n\t\t\treturn false;\n\t\t}\n\t\tconst isHoverSticky = this._hoverSettings.sticky;\n\t\tconst isMouseOnStickyContentHoverWidget = (mouseEvent: IEditorMouseEvent, isHoverSticky: boolean): boolean => {\n\t\t\tconst isMouseOnContentHoverWidget = this._isMouseOnContentHoverWidget(mouseEvent);\n\t\t\treturn isHoverSticky && isMouseOnContentHoverWidget;\n\t\t};\n\t\tconst isMouseOnColorPickerOrChoosingColor = (mouseEvent: IEditorMouseEvent): boolean => {\n\t\t\tconst isColorPickerVisible = contentWidget.isColorPickerVisible;\n\t\t\tconst isMouseOnContentHoverWidget = this._isMouseOnContentHoverWidget(mouseEvent);\n\t\t\tconst isMouseOnHoverWithColorPicker = isColorPickerVisible && isMouseOnContentHoverWidget;\n\t\t\tconst isMaybeChoosingColor = isColorPickerVisible && this._isMouseDown;\n\t\t\treturn isMouseOnHoverWithColorPicker || isMaybeChoosingColor;\n\t\t};\n\t\t// TODO@aiday-mar verify if the following is necessary code\n\t\tconst isTextSelectedWithinContentHoverWidget = (mouseEvent: IEditorMouseEvent, sticky: boolean): boolean => {\n\t\t\tconst view = mouseEvent.event.browserEvent.view;\n\t\t\tif (!view) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn sticky && contentWidget.containsNode(view.document.activeElement) && !view.getSelection()?.isCollapsed;\n\t\t};\n\t\tconst isFocused = contentWidget.isFocused;\n\t\tconst isResizing = contentWidget.isResizing;\n\t\tconst isStickyAndVisibleFromKeyboard = this._hoverSettings.sticky && contentWidget.isVisibleFromKeyboard;\n\n\t\treturn this.shouldKeepOpenOnEditorMouseMoveOrLeave\n\t\t\t|| isFocused\n\t\t\t|| isResizing\n\t\t\t|| isStickyAndVisibleFromKeyboard\n\t\t\t|| isMouseOnStickyContentHoverWidget(mouseEvent, isHoverSticky)\n\t\t\t|| isMouseOnColorPickerOrChoosingColor(mouseEvent)\n\t\t\t|| isTextSelectedWithinContentHoverWidget(mouseEvent, isHoverSticky);\n\t}\n\n\tprivate _onEditorMouseMove(mouseEvent: IEditorMouseEvent): void {\n\t\tif (this._ignoreMouseEvents) {\n\t\t\treturn;\n\t\t}\n\t\t// When the user is dragging to select text (mouse down started outside the hover widget),\n\t\t// hide the hover and suppress any new hover computation to avoid covering the selection.\n\t\tif (this._isMouseDown && !this._shouldKeepHoverWidgetVisible(mouseEvent)) {\n\t\t\tthis._cancelSchedulerAndHide();\n\t\t\treturn;\n\t\t}\n\t\tthis._mouseMoveEvent = mouseEvent;\n\t\tconst shouldKeepCurrentHover = this._shouldKeepCurrentHover(mouseEvent);\n\t\tif (shouldKeepCurrentHover) {\n\t\t\tthis._reactToEditorMouseMoveRunner.cancel();\n\t\t\treturn;\n\t\t}\n\t\tconst shouldRescheduleHoverComputation = this._shouldRescheduleHoverComputation();\n\t\tif (shouldRescheduleHoverComputation) {\n\t\t\tif (!this._reactToEditorMouseMoveRunner.isScheduled()) {\n\t\t\t\tthis._reactToEditorMouseMoveRunner.schedule(this._hoverSettings.hidingDelay);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tthis._reactToEditorMouseMove(mouseEvent);\n\t}\n\n\tprivate _shouldRescheduleHoverComputation(): boolean {\n\t\tconst hidingDelay = this._hoverSettings.hidingDelay;\n\t\tconst isContentHoverWidgetVisible = this._contentWidget?.isVisible ?? false;\n\t\t// If the mouse is not over the widget, and if sticky is on,\n\t\t// then give it a grace period before reacting to the mouse event\n\t\treturn isContentHoverWidgetVisible && this._hoverSettings.sticky && hidingDelay > 0;\n\t}\n\n\tprivate _reactToEditorMouseMove(mouseEvent: IEditorMouseEvent): void {\n\t\tif (shouldShowHover(\n\t\t\tthis._hoverSettings.enabled,\n\t\t\tthis._editor.getOption(EditorOption.multiCursorModifier),\n\t\t\tmouseEvent\n\t\t)) {\n\t\t\tconst contentWidget: ContentHoverWidgetWrapper = this._getOrCreateContentWidget();\n\t\t\tif (contentWidget.showsOrWillShow(mouseEvent)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (_sticky) {\n\t\t\treturn;\n\t\t}\n\t\tthis.hideContentHover();\n\t}\n\n\tprivate _onKeyDown(e: IKeyboardEvent): void {\n\t\tif (this._ignoreMouseEvents || !this._contentWidget) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._hoverSettings.enabled === 'onKeyboardModifier'\n\t\t\t&& isTriggerModifierPressed(this._editor.getOption(EditorOption.multiCursorModifier), e)\n\t\t\t&& this._mouseMoveEvent) {\n\t\t\tif (!this._contentWidget.isVisible) {\n\t\t\t\tthis._contentWidget.showsOrWillShow(this._mouseMoveEvent);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst isPotentialKeyboardShortcut = this._isPotentialKeyboardShortcut(e);\n\t\tconst isModifierKeyPressed = isModifierKey(e.keyCode);\n\t\tif (isPotentialKeyboardShortcut || isModifierKeyPressed) {\n\t\t\treturn;\n\t\t}\n\t\tif (this._contentWidget.isFocused && e.keyCode === KeyCode.Tab) {\n\t\t\treturn;\n\t\t}\n\t\tthis.hideContentHover();\n\t}\n\n\tprivate _isPotentialKeyboardShortcut(e: IKeyboardEvent): boolean {\n\t\tif (!this._editor.hasModel() || !this._contentWidget) {\n\t\t\treturn false;\n\t\t}\n\t\tconst resolvedKeyboardEvent = this._keybindingService.softDispatch(e, this._editor.getDomNode());\n\t\tconst moreChordsAreNeeded = resolvedKeyboardEvent.kind === ResultKind.MoreChordsNeeded;\n\t\tconst isHoverAction = resolvedKeyboardEvent.kind === ResultKind.KbFound\n\t\t\t&& (resolvedKeyboardEvent.commandId === SHOW_OR_FOCUS_HOVER_ACTION_ID\n\t\t\t\t|| resolvedKeyboardEvent.commandId === INCREASE_HOVER_VERBOSITY_ACTION_ID\n\t\t\t\t|| resolvedKeyboardEvent.commandId === DECREASE_HOVER_VERBOSITY_ACTION_ID)\n\t\t\t&& this._contentWidget.isVisible;\n\t\treturn moreChordsAreNeeded || isHoverAction;\n\t}\n\n\tpublic hideContentHover(): void {\n\t\tif (_sticky) {\n\t\t\treturn;\n\t\t}\n\t\tif (InlineSuggestionHintsContentWidget.dropDownVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis._contentWidget?.hide();\n\t}\n\n\tprivate _getOrCreateContentWidget(): ContentHoverWidgetWrapper {\n\t\tif (!this._contentWidget) {\n\t\t\tthis._contentWidget = this._instantiationService.createInstance(ContentHoverWidgetWrapper, this._editor);\n\t\t\tthis._listenersStore.add(this._contentWidget.onContentsChanged(() => this._onHoverContentsChanged.fire()));\n\t\t}\n\t\treturn this._contentWidget;\n\t}\n\n\tpublic showContentHover(\n\t\trange: Range,\n\t\tmode: HoverStartMode,\n\t\tsource: HoverStartSource,\n\t\tfocus: boolean\n\t): void {\n\t\tthis._getOrCreateContentWidget().startShowingAtRange(range, mode, source, focus);\n\t}\n\n\tprivate _isContentWidgetResizing(): boolean {\n\t\treturn this._contentWidget?.widget.isResizing || false;\n\t}\n\n\tpublic focusedHoverPartIndex(): number {\n\t\treturn this._getOrCreateContentWidget().focusedHoverPartIndex();\n\t}\n\n\tpublic updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): void {\n\t\tthis._getOrCreateContentWidget().updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic focus(): void {\n\t\tthis._contentWidget?.focus();\n\t}\n\n\tpublic scrollUp(): void {\n\t\tthis._contentWidget?.scrollUp();\n\t}\n\n\tpublic scrollDown(): void {\n\t\tthis._contentWidget?.scrollDown();\n\t}\n\n\tpublic scrollLeft(): void {\n\t\tthis._contentWidget?.scrollLeft();\n\t}\n\n\tpublic scrollRight(): void {\n\t\tthis._contentWidget?.scrollRight();\n\t}\n\n\tpublic pageUp(): void {\n\t\tthis._contentWidget?.pageUp();\n\t}\n\n\tpublic pageDown(): void {\n\t\tthis._contentWidget?.pageDown();\n\t}\n\n\tpublic goToTop(): void {\n\t\tthis._contentWidget?.goToTop();\n\t}\n\n\tpublic goToBottom(): void {\n\t\tthis._contentWidget?.goToBottom();\n\t}\n\n\tpublic get isColorPickerVisible(): boolean | undefined {\n\t\treturn this._contentWidget?.isColorPickerVisible;\n\t}\n\n\tpublic get isHoverVisible(): boolean | undefined {\n\t\treturn this._contentWidget?.isVisible;\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._unhookListeners();\n\t\tthis._listenersStore.dispose();\n\t\tthis._contentWidget?.dispose();\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { DECREASE_HOVER_VERBOSITY_ACTION_ID, INCREASE_HOVER_VERBOSITY_ACTION_ID, SHOW_OR_FOCUS_HOVER_ACTION_ID } from './hoverActionIds.js';\nimport { IKeyboardEvent } from '../../../../base/browser/keyboardEvent.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { ICodeEditor, IEditorMouseEvent, IPartialEditorMouseEvent } from '../../../browser/editorBrowser.js';\nimport { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js';\nimport { Range } from '../../../common/core/range.js';\nimport { IEditorContribution, IScrollEvent } from '../../../common/editorCommon.js';\nimport { HoverStartMode, HoverStartSource } from './hoverOperation.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { InlineSuggestionHintsContentWidget } from '../../inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ResultKind } from '../../../../platform/keybinding/common/keybindingResolver.js';\nimport { HoverVerbosityAction } from '../../../common/languages.js';\nimport { RunOnceScheduler } from '../../../../base/common/async.js';\nimport { isMousePositionWithinElement, shouldShowHover, isTriggerModifierPressed } from './hoverUtils.js';\nimport { ContentHoverWidgetWrapper } from './contentHoverWidgetWrapper.js';\nimport './hover.css';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { isOnColorDecorator } from '../../colorPicker/browser/hoverColorPicker/hoverColorPicker.js';\nimport { isModifierKey, KeyCode } from '../../../../base/common/keyCodes.js';\nimport { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js';\n\n// sticky hover widget which doesn't disappear on focus out and such\nconst _sticky = false\n\t// || Boolean(\"true\") // done \"weirdly\" so that a lint warning prevents you from pushing this\n\t;\n\ninterface IHoverSettings {\n\treadonly enabled: 'on' | 'off' | 'onKeyboardModifier';\n\treadonly sticky: boolean;\n\treadonly hidingDelay: number;\n}\n\nexport class ContentHoverController extends Disposable implements IEditorContribution {\n\n\tprivate readonly _onHoverContentsChanged = this._register(new Emitter<void>());\n\n\tpublic static readonly ID = 'editor.contrib.contentHover';\n\n\tpublic shouldKeepOpenOnEditorMouseMoveOrLeave: boolean = false;\n\n\tprivate readonly _listenersStore = new DisposableStore();\n\n\tprivate _contentWidget: ContentHoverWidgetWrapper | undefined;\n\n\tprivate _mouseMoveEvent: IEditorMouseEvent | undefined;\n\tprivate _reactToEditorMouseMoveRunner: RunOnceScheduler;\n\n\tprivate _hoverSettings!: IHoverSettings;\n\tprivate _isMouseDown: boolean = false;\n\n\tprivate _ignoreMouseEvents: boolean = false;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IContextMenuService _contextMenuService: IContextMenuService,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService\n\t) {\n\t\tsuper();\n\t\tthis._reactToEditorMouseMoveRunner = this._register(new RunOnceScheduler(\n\t\t\t() => {\n\t\t\t\tif (this._mouseMoveEvent) {\n\t\t\t\t\tthis._reactToEditorMouseMove(this._mouseMoveEvent);\n\t\t\t\t}\n\t\t\t}, 0\n\t\t));\n\t\tthis._register(_contextMenuService.onDidShowContextMenu(() => {\n\t\t\tthis.hideContentHover();\n\t\t\tthis._ignoreMouseEvents = true;\n\t\t}));\n\t\tthis._register(_contextMenuService.onDidHideContextMenu(() => {\n\t\t\tthis._ignoreMouseEvents = false;\n\t\t}));\n\t\tthis._hookListeners();\n\t\tthis._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {\n\t\t\tif (e.hasChanged(EditorOption.hover)) {\n\t\t\t\tthis._unhookListeners();\n\t\t\t\tthis._hookListeners();\n\t\t\t}\n\t\t}));\n\t}\n\n\tstatic get(editor: ICodeEditor): ContentHoverController | null {\n\t\treturn editor.getContribution<ContentHoverController>(ContentHoverController.ID);\n\t}\n\n\tprivate _hookListeners(): void {\n\t\tconst hoverOpts = this._editor.getOption(EditorOption.hover);\n\t\tthis._hoverSettings = {\n\t\t\tenabled: hoverOpts.enabled,\n\t\t\tsticky: hoverOpts.sticky,\n\t\t\thidingDelay: hoverOpts.hidingDelay\n\t\t};\n\t\tif (hoverOpts.enabled === 'off') {\n\t\t\tthis._cancelSchedulerAndHide();\n\t\t}\n\t\tthis._listenersStore.add(this._editor.onMouseDown((e: IEditorMouseEvent) => this._onEditorMouseDown(e)));\n\t\tthis._listenersStore.add(this._editor.onMouseUp(() => this._onEditorMouseUp()));\n\t\tthis._listenersStore.add(this._editor.onMouseMove((e: IEditorMouseEvent) => this._onEditorMouseMove(e)));\n\t\tthis._listenersStore.add(this._editor.onKeyDown((e: IKeyboardEvent) => this._onKeyDown(e)));\n\t\tthis._listenersStore.add(this._editor.onMouseLeave((e) => this._onEditorMouseLeave(e)));\n\t\tthis._listenersStore.add(this._editor.onDidChangeModel(() => this._cancelSchedulerAndHide()));\n\t\tthis._listenersStore.add(this._editor.onDidChangeModelContent(() => this._cancelScheduler()));\n\t\tthis._listenersStore.add(this._editor.onDidScrollChange((e: IScrollEvent) => this._onEditorScrollChanged(e)));\n\t}\n\n\tprivate _unhookListeners(): void {\n\t\tthis._listenersStore.clear();\n\t}\n\n\tprivate _cancelSchedulerAndHide(): void {\n\t\tthis._cancelScheduler();\n\t\tthis.hideContentHover();\n\t}\n\n\tprivate _cancelScheduler() {\n\t\tthis._mouseMoveEvent = undefined;\n\t\tthis._reactToEditorMouseMoveRunner.cancel();\n\t}\n\n\tprivate _onEditorScrollChanged(e: IScrollEvent): void {\n\t\tif (this._ignoreMouseEvents) {\n\t\t\treturn;\n\t\t}\n\t\tif (e.scrollTopChanged || e.scrollLeftChanged) {\n\t\t\tthis.hideContentHover();\n\t\t}\n\t}\n\n\tprivate _onEditorMouseDown(mouseEvent: IEditorMouseEvent): void {\n\t\tif (this._ignoreMouseEvents) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isMouseDown = true;\n\t\tconst shouldKeepHoverWidgetVisible = this._shouldKeepHoverWidgetVisible(mouseEvent);\n\t\tif (shouldKeepHoverWidgetVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis.hideContentHover();\n\t}\n\n\tprivate _shouldKeepHoverWidgetVisible(mouseEvent: IPartialEditorMouseEvent): boolean {\n\t\treturn this._isMouseOnContentHoverWidget(mouseEvent) || this._isContentWidgetResizing() || isOnColorDecorator(mouseEvent);\n\t}\n\n\tprivate _isMouseOnContentHoverWidget(mouseEvent: IPartialEditorMouseEvent): boolean {\n\t\tif (!this._contentWidget || !this._contentWidget.getDomNode().isConnected) {\n\t\t\treturn false;\n\t\t}\n\t\treturn isMousePositionWithinElement(this._contentWidget.getDomNode(), mouseEvent.event.posx, mouseEvent.event.posy);\n\t}\n\n\tprivate _onEditorMouseUp(): void {\n\t\tif (this._ignoreMouseEvents) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isMouseDown = false;\n\t}\n\n\tprivate _onEditorMouseLeave(mouseEvent: IPartialEditorMouseEvent): void {\n\t\tif (this._ignoreMouseEvents) {\n\t\t\treturn;\n\t\t}\n\t\tif (this.shouldKeepOpenOnEditorMouseMoveOrLeave) {\n\t\t\treturn;\n\t\t}\n\t\tthis._cancelScheduler();\n\t\tconst shouldKeepHoverWidgetVisible = this._shouldKeepHoverWidgetVisible(mouseEvent);\n\t\tif (shouldKeepHoverWidgetVisible) {\n\t\t\treturn;\n\t\t}\n\t\tif (_sticky) {\n\t\t\treturn;\n\t\t}\n\t\tthis.hideContentHover();\n\t}\n\n\tprivate _shouldKeepCurrentHover(mouseEvent: IEditorMouseEvent): boolean {\n\t\tconst contentWidget = this._contentWidget;\n\t\tif (!contentWidget) {\n\t\t\treturn false;\n\t\t}\n\t\tconst isHoverSticky = this._hoverSettings.sticky;\n\t\tconst isMouseOnStickyContentHoverWidget = (mouseEvent: IEditorMouseEvent, isHoverSticky: boolean): boolean => {\n\t\t\tconst isMouseOnContentHoverWidget = this._isMouseOnContentHoverWidget(mouseEvent);\n\t\t\treturn isHoverSticky && isMouseOnContentHoverWidget;\n\t\t};\n\t\tconst isMouseOnColorPickerOrChoosingColor = (mouseEvent: IEditorMouseEvent): boolean => {\n\t\t\tconst isColorPickerVisible = contentWidget.isColorPickerVisible;\n\t\t\tconst isMouseOnContentHoverWidget = this._isMouseOnContentHoverWidget(mouseEvent);\n\t\t\tconst isMouseOnHoverWithColorPicker = isColorPickerVisible && isMouseOnContentHoverWidget;\n\t\t\tconst isMaybeChoosingColor = isColorPickerVisible && this._isMouseDown;\n\t\t\treturn isMouseOnHoverWithColorPicker || isMaybeChoosingColor;\n\t\t};\n\t\t// TODO@aiday-mar verify if the following is necessary code\n\t\tconst isTextSelectedWithinContentHoverWidget = (mouseEvent: IEditorMouseEvent, sticky: boolean): boolean => {\n\t\t\tconst view = mouseEvent.event.browserEvent.view;\n\t\t\tif (!view) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn sticky && contentWidget.containsNode(view.document.activeElement) && !view.getSelection()?.isCollapsed;\n\t\t};\n\t\tconst isFocused = contentWidget.isFocused;\n\t\tconst isResizing = contentWidget.isResizing;\n\t\tconst isStickyAndVisibleFromKeyboard = this._hoverSettings.sticky && contentWidget.isVisibleFromKeyboard;\n\n\t\treturn this.shouldKeepOpenOnEditorMouseMoveOrLeave\n\t\t\t|| isFocused\n\t\t\t|| isResizing\n\t\t\t|| isStickyAndVisibleFromKeyboard\n\t\t\t|| isMouseOnStickyContentHoverWidget(mouseEvent, isHoverSticky)\n\t\t\t|| isMouseOnColorPickerOrChoosingColor(mouseEvent)\n\t\t\t|| isTextSelectedWithinContentHoverWidget(mouseEvent, isHoverSticky);\n\t}\n\n\tprivate _onEditorMouseMove(mouseEvent: IEditorMouseEvent): void {\n\t\tif (this._ignoreMouseEvents) {\n\t\t\treturn;\n\t\t}\n\t\t// When the user is dragging to select text (mouse down started outside the hover widget),\n\t\t// hide the hover and suppress any new hover computation to avoid covering the selection.\n\t\tif (this._isMouseDown && !this._shouldKeepHoverWidgetVisible(mouseEvent)) {\n\t\t\tthis._cancelSchedulerAndHide();\n\t\t\treturn;\n\t\t}\n\t\tthis._mouseMoveEvent = mouseEvent;\n\t\tconst shouldKeepCurrentHover = this._shouldKeepCurrentHover(mouseEvent);\n\t\tif (shouldKeepCurrentHover) {\n\t\t\tthis._reactToEditorMouseMoveRunner.cancel();\n\t\t\treturn;\n\t\t}\n\t\tconst shouldRescheduleHoverComputation = this._shouldRescheduleHoverComputation();\n\t\tif (shouldRescheduleHoverComputation) {\n\t\t\tif (!this._reactToEditorMouseMoveRunner.isScheduled()) {\n\t\t\t\tthis._reactToEditorMouseMoveRunner.schedule(this._hoverSettings.hidingDelay);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tthis._reactToEditorMouseMove(mouseEvent);\n\t}\n\n\tprivate _shouldRescheduleHoverComputation(): boolean {\n\t\tconst hidingDelay = this._hoverSettings.hidingDelay;\n\t\tconst isContentHoverWidgetVisible = this._contentWidget?.isVisible ?? false;\n\t\t// If the mouse is not over the widget, and if sticky is on,\n\t\t// then give it a grace period before reacting to the mouse event\n\t\treturn isContentHoverWidgetVisible && this._hoverSettings.sticky && hidingDelay > 0;\n\t}\n\n\tprivate _reactToEditorMouseMove(mouseEvent: IEditorMouseEvent): void {\n\t\tif (shouldShowHover(\n\t\t\tthis._hoverSettings.enabled,\n\t\t\tthis._editor.getOption(EditorOption.multiCursorModifier),\n\t\t\tmouseEvent\n\t\t)) {\n\t\t\tconst contentWidget: ContentHoverWidgetWrapper = this._getOrCreateContentWidget();\n\t\t\tif (contentWidget.showsOrWillShow(mouseEvent)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (_sticky) {\n\t\t\treturn;\n\t\t}\n\t\tthis.hideContentHover();\n\t}\n\n\tprivate _onKeyDown(e: IKeyboardEvent): void {\n\t\tif (this._ignoreMouseEvents || !this._contentWidget) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._hoverSettings.enabled === 'onKeyboardModifier'\n\t\t\t&& isTriggerModifierPressed(this._editor.getOption(EditorOption.multiCursorModifier), e)\n\t\t\t&& this._mouseMoveEvent) {\n\t\t\tif (!this._contentWidget.isVisible) {\n\t\t\t\tthis._contentWidget.showsOrWillShow(this._mouseMoveEvent);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst isPotentialKeyboardShortcut = this._isPotentialKeyboardShortcut(e);\n\t\tconst isModifierKeyPressed = isModifierKey(e.keyCode);\n\t\tif (isPotentialKeyboardShortcut || isModifierKeyPressed) {\n\t\t\treturn;\n\t\t}\n\t\tif (this._contentWidget.isFocused && e.keyCode === KeyCode.Tab) {\n\t\t\treturn;\n\t\t}\n\t\tthis.hideContentHover();\n\t}\n\n\tprivate _isPotentialKeyboardShortcut(e: IKeyboardEvent): boolean {\n\t\tif (!this._editor.hasModel() || !this._contentWidget) {\n\t\t\treturn false;\n\t\t}\n\t\tconst resolvedKeyboardEvent = this._keybindingService.softDispatch(e, this._editor.getDomNode());\n\t\tconst moreChordsAreNeeded = resolvedKeyboardEvent.kind === ResultKind.MoreChordsNeeded;\n\t\tconst isHoverAction = resolvedKeyboardEvent.kind === ResultKind.KbFound\n\t\t\t&& (resolvedKeyboardEvent.commandId === SHOW_OR_FOCUS_HOVER_ACTION_ID\n\t\t\t\t|| resolvedKeyboardEvent.commandId === INCREASE_HOVER_VERBOSITY_ACTION_ID\n\t\t\t\t|| resolvedKeyboardEvent.commandId === DECREASE_HOVER_VERBOSITY_ACTION_ID)\n\t\t\t&& this._contentWidget.isVisible;\n\t\treturn moreChordsAreNeeded || isHoverAction;\n\t}\n\n\tpublic hideContentHover(): void {\n\t\tif (_sticky) {\n\t\t\treturn;\n\t\t}\n\t\tif (InlineSuggestionHintsContentWidget.dropDownVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis._contentWidget?.hide();\n\t}\n\n\tprivate _getOrCreateContentWidget(): ContentHoverWidgetWrapper {\n\t\tif (!this._contentWidget) {\n\t\t\tthis._contentWidget = this._instantiationService.createInstance(ContentHoverWidgetWrapper, this._editor);\n\t\t\tthis._listenersStore.add(this._contentWidget.onContentsChanged(() => this._onHoverContentsChanged.fire()));\n\t\t}\n\t\treturn this._contentWidget;\n\t}\n\n\tpublic showContentHover(\n\t\trange: Range,\n\t\tmode: HoverStartMode,\n\t\tsource: HoverStartSource,\n\t\tfocus: boolean\n\t): void {\n\t\tthis._getOrCreateContentWidget().startShowingAtRange(range, mode, source, focus);\n\t}\n\n\tprivate _isContentWidgetResizing(): boolean {\n\t\treturn this._contentWidget?.widget.isResizing || false;\n\t}\n\n\tpublic focusedHoverPartIndex(): number {\n\t\treturn this._getOrCreateContentWidget().focusedHoverPartIndex();\n\t}\n\n\tpublic updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): void {\n\t\tthis._getOrCreateContentWidget().updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic focus(): void {\n\t\tthis._contentWidget?.focus();\n\t}\n\n\tpublic scrollUp(): void {\n\t\tthis._contentWidget?.scrollUp();\n\t}\n\n\tpublic scrollDown(): void {\n\t\tthis._contentWidget?.scrollDown();\n\t}\n\n\tpublic scrollLeft(): void {\n\t\tthis._contentWidget?.scrollLeft();\n\t}\n\n\tpublic scrollRight(): void {\n\t\tthis._contentWidget?.scrollRight();\n\t}\n\n\tpublic pageUp(): void {\n\t\tthis._contentWidget?.pageUp();\n\t}\n\n\tpublic pageDown(): void {\n\t\tthis._contentWidget?.pageDown();\n\t}\n\n\tpublic goToTop(): void {\n\t\tthis._contentWidget?.goToTop();\n\t}\n\n\tpublic goToBottom(): void {\n\t\tthis._contentWidget?.goToBottom();\n\t}\n\n\tpublic get isColorPickerVisible(): boolean | undefined {\n\t\treturn this._contentWidget?.isColorPickerVisible;\n\t}\n\n\tpublic get isHoverVisible(): boolean | undefined {\n\t\treturn this._contentWidget?.isVisible;\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._unhookListeners();\n\t\tthis._listenersStore.dispose();\n\t\tthis._contentWidget?.dispose();\n\t}\n}\n"]}
|
|
@@ -22,7 +22,7 @@ import { Position } from '../../../common/core/position.js';
|
|
|
22
22
|
import { Range } from '../../../common/core/range.js';
|
|
23
23
|
import * as dom from '../../../../base/browser/dom.js';
|
|
24
24
|
import { MarkdownHoverParticipant } from './markdownHoverParticipant.js';
|
|
25
|
-
import { HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';
|
|
25
|
+
import { ColorHover, HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';
|
|
26
26
|
import { InlayHintsHover } from '../../inlayHints/browser/inlayHintsHover.js';
|
|
27
27
|
import { BugIndicatingError } from '../../../../base/common/errors.js';
|
|
28
28
|
import { IHoverService } from '../../../../platform/hover/browser/hover.js';
|
|
@@ -143,6 +143,7 @@ let RenderedContentHoverParts = class RenderedContentHoverParts extends Disposab
|
|
|
143
143
|
this._hoverService = _hoverService;
|
|
144
144
|
this._clipboardService = _clipboardService;
|
|
145
145
|
this._renderedParts = [];
|
|
146
|
+
this._perPartDisposables = new Map();
|
|
146
147
|
this._focusedHoverPartIndex = -1;
|
|
147
148
|
this._context = context;
|
|
148
149
|
this._fragment = document.createDocumentFragment();
|
|
@@ -216,24 +217,36 @@ let RenderedContentHoverParts = class RenderedContentHoverParts extends Disposab
|
|
|
216
217
|
return new RenderedStatusBar(fragment, statusBar);
|
|
217
218
|
}
|
|
218
219
|
_registerListenersOnRenderedParts() {
|
|
219
|
-
|
|
220
|
+
// Create per-part disposables so that when an individual rendered part is
|
|
221
|
+
// updated we can dispose its listeners and copy button without affecting
|
|
222
|
+
// the others.
|
|
220
223
|
this._renderedParts.forEach((renderedPart, index) => {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}));
|
|
227
|
-
disposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_OUT, (event) => {
|
|
228
|
-
event.stopPropagation();
|
|
229
|
-
this._focusedHoverPartIndex = -1;
|
|
230
|
-
}));
|
|
231
|
-
// Add copy button for marker hovers
|
|
232
|
-
if (renderedPart.type === 'hoverPart' && !renderedPart.participant.hideCopyButton) {
|
|
233
|
-
disposables.add(new HoverCopyButton(element, () => renderedPart.participant.getAccessibleContent(renderedPart.hoverPart), this._clipboardService, this._hoverService));
|
|
224
|
+
this._createListenersForPart(index, renderedPart);
|
|
225
|
+
});
|
|
226
|
+
return toDisposable(() => {
|
|
227
|
+
for (const d of this._perPartDisposables.values()) {
|
|
228
|
+
d.dispose();
|
|
234
229
|
}
|
|
230
|
+
this._perPartDisposables.clear();
|
|
235
231
|
});
|
|
236
|
-
|
|
232
|
+
}
|
|
233
|
+
_createListenersForPart(index, renderedPart) {
|
|
234
|
+
const partDisposables = new DisposableStore();
|
|
235
|
+
const element = renderedPart.hoverElement;
|
|
236
|
+
element.tabIndex = 0;
|
|
237
|
+
partDisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_IN, (event) => {
|
|
238
|
+
event.stopPropagation();
|
|
239
|
+
this._focusedHoverPartIndex = index;
|
|
240
|
+
}));
|
|
241
|
+
partDisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_OUT, (event) => {
|
|
242
|
+
event.stopPropagation();
|
|
243
|
+
this._focusedHoverPartIndex = -1;
|
|
244
|
+
}));
|
|
245
|
+
// Add copy button for marker hovers
|
|
246
|
+
if (renderedPart.type === 'hoverPart' && !(renderedPart.hoverPart instanceof ColorHover) && !renderedPart.participant.hideCopyButton) {
|
|
247
|
+
partDisposables.add(new HoverCopyButton(element, () => renderedPart.participant.getAccessibleContent(renderedPart.hoverPart), this._clipboardService, this._hoverService));
|
|
248
|
+
}
|
|
249
|
+
this._perPartDisposables.set(index, partDisposables);
|
|
237
250
|
}
|
|
238
251
|
_updateMarkdownAndColorParticipantInfo(participants) {
|
|
239
252
|
const markdownHoverParticipant = participants.find(p => {
|
|
@@ -270,12 +283,20 @@ let RenderedContentHoverParts = class RenderedContentHoverParts extends Disposab
|
|
|
270
283
|
if (!renderedPart) {
|
|
271
284
|
continue;
|
|
272
285
|
}
|
|
286
|
+
// Dispose any listeners/copy button for the previous part at this index
|
|
287
|
+
const prevDisposable = this._perPartDisposables.get(i);
|
|
288
|
+
if (prevDisposable) {
|
|
289
|
+
prevDisposable.dispose();
|
|
290
|
+
this._perPartDisposables.delete(i);
|
|
291
|
+
}
|
|
273
292
|
this._renderedParts[i] = {
|
|
274
293
|
type: 'hoverPart',
|
|
275
294
|
participant: this._markdownHoverParticipant,
|
|
276
295
|
hoverPart: renderedPart.hoverPart,
|
|
277
296
|
hoverElement: renderedPart.hoverElement,
|
|
278
297
|
};
|
|
298
|
+
// Recreate listeners and copy button for the updated part.
|
|
299
|
+
this._createListenersForPart(i, this._renderedParts[i]);
|
|
279
300
|
}
|
|
280
301
|
if (focus) {
|
|
281
302
|
if (index >= 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/hover/browser/contentHoverRendered.ts","vs/editor/contrib/hover/browser/contentHoverRendered.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAA4G,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC/J,OAAO,EAAE,UAAU,EAAE,eAAe,EAAe,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAC9G,OAAO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B,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,KAAK,WAAW,IAAI,YAAY,CAAC,WAAW,KAAK,wBAAwB,CAAC,CAAC;QAC7K,MAAM,iCAAiC,GAAG,mBAAmB,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,KAAK,WAAW,IAAI,YAAY,CAAC,WAAW,KAAK,wBAAwB,CAAC,CAAC;QAC9L,MAAM,yBAAyB,GAAG,iCAAiC,IAAI,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM,GAAG,iCAAiC,CAAC,CAAC,CAAC,iCAAiC,CAAC;QAC9K,OAAO,EAAE,KAAK,EAAE,0BAA0B,EAAE,YAAY,EAAE,yBAAyB,GAAG,CAAC,EAAE,CAAC;IAC3F,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACvB,CAAC;IAED,IAAW,kBAAkB;QAC5B,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC;IACvC,CAAC;IAED,IAAW,qBAAqB;QAC/B,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACpC,CAAC;IAED,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC;IACnC,CAAC;;AAjOI,yBAAyB;IAoB5B,WAAA,kBAAkB,CAAA;IAClB,WAAA,aAAa,CAAA;IACb,WAAA,iBAAiB,CAAA;GAtBd,yBAAyB,CAkO9B","file":"contentHoverRendered.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IEditorHoverContext, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverParts, RenderedHoverParts } from './hoverTypes.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { EditorHoverStatusBar } from './contentHoverStatusBar.js';\nimport { HoverStartSource } from './hoverOperation.js';\nimport { HoverCopyButton } from './hoverCopyButton.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { ContentHoverResult } from './contentHoverTypes.js';\nimport * as dom from '../../../../base/browser/dom.js';\nimport { HoverVerbosityAction } from '../../../common/languages.js';\nimport { MarkdownHoverParticipant } from './markdownHoverParticipant.js';\nimport { HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';\nimport { InlayHintsHover } from '../../inlayHints/browser/inlayHintsHover.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { HoverAction } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverService } from '../../../../platform/hover/browser/hover.js';\nimport { IOffsetRange } from '../../../common/core/ranges/offsetRange.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\n\nexport class RenderedContentHover extends Disposable {\n\n\tpublic closestMouseDistance: number | undefined;\n\tpublic initialMousePosX: number | undefined;\n\tpublic initialMousePosY: number | undefined;\n\n\tpublic readonly showAtPosition: Position;\n\tpublic readonly showAtSecondaryPosition: Position;\n\tpublic readonly shouldFocus: boolean;\n\tpublic readonly source: HoverStartSource;\n\tpublic readonly shouldAppearBeforeContent: boolean;\n\n\tprivate readonly _renderedHoverParts: RenderedContentHoverParts;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\thoverResult: ContentHoverResult,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService hoverService: IHoverService,\n\t\t@IClipboardService clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tconst parts = hoverResult.hoverParts;\n\t\tthis._renderedHoverParts = this._register(new RenderedContentHoverParts(\n\t\t\teditor,\n\t\t\tparticipants,\n\t\t\tparts,\n\t\t\tcontext,\n\t\t\tkeybindingService,\n\t\t\thoverService,\n\t\t\tclipboardService\n\t\t));\n\t\tconst contentHoverComputerOptions = hoverResult.options;\n\t\tconst anchor = contentHoverComputerOptions.anchor;\n\t\tconst { showAtPosition, showAtSecondaryPosition } = RenderedContentHover.computeHoverPositions(editor, anchor.range, parts);\n\t\tthis.shouldAppearBeforeContent = parts.some(m => m.isBeforeContent);\n\t\tthis.showAtPosition = showAtPosition;\n\t\tthis.showAtSecondaryPosition = showAtSecondaryPosition;\n\t\tthis.initialMousePosX = anchor.initialMousePosX;\n\t\tthis.initialMousePosY = anchor.initialMousePosY;\n\t\tthis.shouldFocus = contentHoverComputerOptions.shouldFocus;\n\t\tthis.source = contentHoverComputerOptions.source;\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._renderedHoverParts.domNode;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._renderedHoverParts.domNodeHasChildren;\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._renderedHoverParts.focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedHoverParts.hoverPartsCount;\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tthis._renderedHoverParts.focusHoverPartWithIndex(index);\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tthis._renderedHoverParts.updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._renderedHoverParts.isColorPickerVisible();\n\t}\n\n\tpublic static computeHoverPositions(editor: ICodeEditor, anchorRange: Range, hoverParts: IHoverPart[]): { showAtPosition: Position; showAtSecondaryPosition: Position } {\n\n\t\tlet startColumnBoundary = 1;\n\t\tif (editor.hasModel()) {\n\t\t\t// Ensure the range is on the current view line\n\t\t\tconst viewModel = editor._getViewModel();\n\t\t\tconst coordinatesConverter = viewModel.coordinatesConverter;\n\t\t\tconst anchorViewRange = coordinatesConverter.convertModelRangeToViewRange(anchorRange);\n\t\t\tconst anchorViewMinColumn = viewModel.getLineMinColumn(anchorViewRange.startLineNumber);\n\t\t\tconst anchorViewRangeStart = new Position(anchorViewRange.startLineNumber, anchorViewMinColumn);\n\t\t\tstartColumnBoundary = coordinatesConverter.convertViewPositionToModelPosition(anchorViewRangeStart).column;\n\t\t}\n\n\t\t// The anchor range is always on a single line\n\t\tconst anchorStartLineNumber = anchorRange.startLineNumber;\n\t\tlet secondaryPositionColumn = anchorRange.startColumn;\n\t\tlet forceShowAtRange: Range | undefined;\n\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\tconst hoverPartRangeOnAnchorStartLine = hoverPartRange.startLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeOnAnchorEndLine = hoverPartRange.endLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeIsOnAnchorLine = hoverPartRangeOnAnchorStartLine && hoverPartRangeOnAnchorEndLine;\n\t\t\tif (hoverPartRangeIsOnAnchorLine) {\n\t\t\t\t// this message has a range that is completely sitting on the line of the anchor\n\t\t\t\tconst hoverPartStartColumn = hoverPartRange.startColumn;\n\t\t\t\tconst minSecondaryPositionColumn = Math.min(secondaryPositionColumn, hoverPartStartColumn);\n\t\t\t\tsecondaryPositionColumn = Math.max(minSecondaryPositionColumn, startColumnBoundary);\n\t\t\t}\n\t\t\tif (hoverPart.forceShowAtRange) {\n\t\t\t\tforceShowAtRange = hoverPartRange;\n\t\t\t}\n\t\t}\n\n\t\tlet showAtPosition: Position;\n\t\tlet showAtSecondaryPosition: Position;\n\t\tif (forceShowAtRange) {\n\t\t\tconst forceShowAtPosition = forceShowAtRange.getStartPosition();\n\t\t\tshowAtPosition = forceShowAtPosition;\n\t\t\tshowAtSecondaryPosition = forceShowAtPosition;\n\t\t} else {\n\t\t\tshowAtPosition = anchorRange.getStartPosition();\n\t\t\tshowAtSecondaryPosition = new Position(anchorStartLineNumber, secondaryPositionColumn);\n\t\t}\n\t\treturn {\n\t\t\tshowAtPosition,\n\t\t\tshowAtSecondaryPosition,\n\t\t};\n\t}\n}\n\ninterface IRenderedContentHoverPart {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'hoverPart';\n\t/**\n\t * Participant of the rendered hover part\n\t */\n\tparticipant: IEditorHoverParticipant<IHoverPart>;\n\t/**\n\t * The rendered hover part\n\t */\n\thoverPart: IHoverPart;\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n}\n\ninterface IRenderedContentStatusBar {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'statusBar';\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n\t/**\n\t * The actions of the hover status bar.\n\t */\n\tactions: HoverAction[];\n}\n\ntype IRenderedContentHoverPartOrStatusBar = IRenderedContentHoverPart | IRenderedContentStatusBar;\n\nclass RenderedStatusBar implements IDisposable {\n\n\tconstructor(fragment: DocumentFragment, private readonly _statusBar: EditorHoverStatusBar) {\n\t\tfragment.appendChild(this._statusBar.hoverElement);\n\t}\n\n\tget hoverElement(): HTMLElement {\n\t\treturn this._statusBar.hoverElement;\n\t}\n\n\tget actions(): HoverAction[] {\n\t\treturn this._statusBar.actions;\n\t}\n\n\tdispose() {\n\t\tthis._statusBar.dispose();\n\t}\n}\n\nclass RenderedContentHoverParts extends Disposable {\n\n\tprivate static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({\n\t\tdescription: 'content-hover-highlight',\n\t\tclassName: 'hoverHighlight'\n\t});\n\n\tprivate readonly _renderedParts: IRenderedContentHoverPartOrStatusBar[] = [];\n\tprivate readonly _fragment: DocumentFragment;\n\tprivate readonly _context: IEditorHoverContext;\n\n\tprivate _markdownHoverParticipant: MarkdownHoverParticipant | undefined;\n\tprivate _colorHoverParticipant: HoverColorPickerParticipant | undefined;\n\tprivate _focusedHoverPartIndex: number = -1;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\thoverParts: IHoverPart[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService private readonly _hoverService: IHoverService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._fragment = document.createDocumentFragment();\n\t\tthis._register(this._renderParts(participants, hoverParts, context, keybindingService, this._hoverService));\n\t\tthis._register(this._registerListenersOnRenderedParts());\n\t\tthis._register(this._createEditorDecorations(editor, hoverParts));\n\t\tthis._updateMarkdownAndColorParticipantInfo(participants);\n\t}\n\n\tprivate _createEditorDecorations(editor: ICodeEditor, hoverParts: IHoverPart[]): IDisposable {\n\t\tif (hoverParts.length === 0) {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tlet highlightRange = hoverParts[0].range;\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\thighlightRange = Range.plusRange(highlightRange, hoverPartRange);\n\t\t}\n\t\tconst highlightDecoration = editor.createDecorationsCollection();\n\t\thighlightDecoration.set([{\n\t\t\trange: highlightRange,\n\t\t\toptions: RenderedContentHoverParts._DECORATION_OPTIONS\n\t\t}]);\n\t\treturn toDisposable(() => {\n\t\t\thighlightDecoration.clear();\n\t\t});\n\t}\n\n\tprivate _renderParts(participants: IEditorHoverParticipant<IHoverPart>[], hoverParts: IHoverPart[], hoverContext: IEditorHoverContext, keybindingService: IKeybindingService, hoverService: IHoverService): IDisposable {\n\t\tconst statusBar = new EditorHoverStatusBar(keybindingService, hoverService);\n\t\tconst hoverRenderingContext: IEditorHoverRenderContext = {\n\t\t\tfragment: this._fragment,\n\t\t\tstatusBar,\n\t\t\t...hoverContext\n\t\t};\n\t\tconst disposables = new DisposableStore();\n\t\tdisposables.add(statusBar);\n\t\tfor (const participant of participants) {\n\t\t\tconst renderedHoverParts = this._renderHoverPartsForParticipant(hoverParts, participant, hoverRenderingContext);\n\t\t\tdisposables.add(renderedHoverParts);\n\t\t\tfor (const renderedHoverPart of renderedHoverParts.renderedHoverParts) {\n\t\t\t\tthis._renderedParts.push({\n\t\t\t\t\ttype: 'hoverPart',\n\t\t\t\t\tparticipant,\n\t\t\t\t\thoverPart: renderedHoverPart.hoverPart,\n\t\t\t\t\thoverElement: renderedHoverPart.hoverElement,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst renderedStatusBar = this._renderStatusBar(this._fragment, statusBar);\n\t\tif (renderedStatusBar) {\n\t\t\tdisposables.add(renderedStatusBar);\n\t\t\tthis._renderedParts.push({\n\t\t\t\ttype: 'statusBar',\n\t\t\t\thoverElement: renderedStatusBar.hoverElement,\n\t\t\t\tactions: renderedStatusBar.actions,\n\t\t\t});\n\t\t}\n\t\treturn disposables;\n\t}\n\n\tprivate _renderHoverPartsForParticipant(hoverParts: IHoverPart[], participant: IEditorHoverParticipant<IHoverPart>, hoverRenderingContext: IEditorHoverRenderContext): IRenderedHoverParts<IHoverPart> {\n\t\tconst hoverPartsForParticipant = hoverParts.filter(hoverPart => hoverPart.owner === participant);\n\t\tconst hasHoverPartsForParticipant = hoverPartsForParticipant.length > 0;\n\t\tif (!hasHoverPartsForParticipant) {\n\t\t\treturn new RenderedHoverParts([]);\n\t\t}\n\t\treturn participant.renderHoverParts(hoverRenderingContext, hoverPartsForParticipant);\n\t}\n\n\tprivate _renderStatusBar(fragment: DocumentFragment, statusBar: EditorHoverStatusBar): RenderedStatusBar | undefined {\n\t\tif (!statusBar.hasContent) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new RenderedStatusBar(fragment, statusBar);\n\t}\n\n\tprivate _registerListenersOnRenderedParts(): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\t\tthis._renderedParts.forEach((renderedPart: IRenderedContentHoverPartOrStatusBar, index: number) => {\n\t\t\tconst element = renderedPart.hoverElement;\n\t\t\telement.tabIndex = 0;\n\t\t\tdisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_IN, (event: Event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tthis._focusedHoverPartIndex = index;\n\t\t\t}));\n\t\t\tdisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_OUT, (event: Event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tthis._focusedHoverPartIndex = -1;\n\t\t\t}));\n\t\t\t// Add copy button for marker hovers\n\t\t\tif (renderedPart.type === 'hoverPart' && !renderedPart.participant.hideCopyButton) {\n\t\t\t\tdisposables.add(new HoverCopyButton(\n\t\t\t\t\telement,\n\t\t\t\t\t() => renderedPart.participant.getAccessibleContent(renderedPart.hoverPart),\n\t\t\t\t\tthis._clipboardService,\n\t\t\t\t\tthis._hoverService\n\t\t\t\t));\n\t\t\t}\n\t\t});\n\t\treturn disposables;\n\t}\n\n\tprivate _updateMarkdownAndColorParticipantInfo(participants: IEditorHoverParticipant<IHoverPart>[]) {\n\t\tconst markdownHoverParticipant = participants.find(p => {\n\t\t\treturn (p instanceof MarkdownHoverParticipant) && !(p instanceof InlayHintsHover);\n\t\t});\n\t\tif (markdownHoverParticipant) {\n\t\t\tthis._markdownHoverParticipant = markdownHoverParticipant as MarkdownHoverParticipant;\n\t\t}\n\t\tthis._colorHoverParticipant = participants.find(p => p instanceof HoverColorPickerParticipant);\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tif (index < 0 || index >= this._renderedParts.length) {\n\t\t\treturn;\n\t\t}\n\t\tthis._renderedParts[index].hoverElement.focus();\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tif (!this._markdownHoverParticipant) {\n\t\t\treturn;\n\t\t}\n\t\tlet rangeOfIndicesToUpdate: IOffsetRange;\n\t\tif (index >= 0) {\n\t\t\trangeOfIndicesToUpdate = { start: index, endExclusive: index + 1 };\n\t\t} else {\n\t\t\trangeOfIndicesToUpdate = this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);\n\t\t}\n\t\tfor (let i = rangeOfIndicesToUpdate.start; i < rangeOfIndicesToUpdate.endExclusive; i++) {\n\t\t\tconst normalizedMarkdownHoverIndex = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, i);\n\t\t\tif (normalizedMarkdownHoverIndex === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst renderedPart = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(action, normalizedMarkdownHoverIndex);\n\t\t\tif (!renderedPart) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis._renderedParts[i] = {\n\t\t\t\ttype: 'hoverPart',\n\t\t\t\tparticipant: this._markdownHoverParticipant,\n\t\t\t\thoverPart: renderedPart.hoverPart,\n\t\t\t\thoverElement: renderedPart.hoverElement,\n\t\t\t};\n\t\t}\n\t\tif (focus) {\n\t\t\tif (index >= 0) {\n\t\t\t\tthis.focusHoverPartWithIndex(index);\n\t\t\t} else {\n\t\t\t\tthis._context.focus();\n\t\t\t}\n\t\t}\n\t\tthis._context.onContentsChanged();\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._colorHoverParticipant?.isColorPickerVisible() ?? false;\n\t}\n\n\tprivate _normalizedIndexToMarkdownHoverIndexRange(markdownHoverParticipant: MarkdownHoverParticipant, index: number): number | undefined {\n\t\tconst renderedPart = this._renderedParts[index];\n\t\tif (!renderedPart || renderedPart.type !== 'hoverPart') {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst isHoverPartMarkdownHover = renderedPart.participant === markdownHoverParticipant;\n\t\tif (!isHoverPartMarkdownHover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst firstIndexOfMarkdownHovers = this._renderedParts.findIndex(renderedPart =>\n\t\t\trenderedPart.type === 'hoverPart'\n\t\t\t&& renderedPart.participant === markdownHoverParticipant\n\t\t);\n\t\tif (firstIndexOfMarkdownHovers === -1) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\t\treturn index - firstIndexOfMarkdownHovers;\n\t}\n\n\tprivate _findRangeOfMarkdownHoverParts(markdownHoverParticipant: MarkdownHoverParticipant): IOffsetRange {\n\t\tconst copiedRenderedParts = this._renderedParts.slice();\n\t\tconst firstIndexOfMarkdownHovers = copiedRenderedParts.findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst inversedLastIndexOfMarkdownHovers = copiedRenderedParts.reverse().findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst lastIndexOfMarkdownHovers = inversedLastIndexOfMarkdownHovers >= 0 ? copiedRenderedParts.length - inversedLastIndexOfMarkdownHovers : inversedLastIndexOfMarkdownHovers;\n\t\treturn { start: firstIndexOfMarkdownHovers, endExclusive: lastIndexOfMarkdownHovers + 1 };\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._fragment;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._fragment.hasChildNodes();\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedParts.length;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IEditorHoverContext, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverParts, RenderedHoverParts } from './hoverTypes.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { EditorHoverStatusBar } from './contentHoverStatusBar.js';\nimport { HoverStartSource } from './hoverOperation.js';\nimport { HoverCopyButton } from './hoverCopyButton.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { ContentHoverResult } from './contentHoverTypes.js';\nimport * as dom from '../../../../base/browser/dom.js';\nimport { HoverVerbosityAction } from '../../../common/languages.js';\nimport { MarkdownHoverParticipant } from './markdownHoverParticipant.js';\nimport { HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';\nimport { InlayHintsHover } from '../../inlayHints/browser/inlayHintsHover.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { HoverAction } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverService } from '../../../../platform/hover/browser/hover.js';\nimport { IOffsetRange } from '../../../common/core/ranges/offsetRange.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\n\nexport class RenderedContentHover extends Disposable {\n\n\tpublic closestMouseDistance: number | undefined;\n\tpublic initialMousePosX: number | undefined;\n\tpublic initialMousePosY: number | undefined;\n\n\tpublic readonly showAtPosition: Position;\n\tpublic readonly showAtSecondaryPosition: Position;\n\tpublic readonly shouldFocus: boolean;\n\tpublic readonly source: HoverStartSource;\n\tpublic readonly shouldAppearBeforeContent: boolean;\n\n\tprivate readonly _renderedHoverParts: RenderedContentHoverParts;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\thoverResult: ContentHoverResult,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService hoverService: IHoverService,\n\t\t@IClipboardService clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tconst parts = hoverResult.hoverParts;\n\t\tthis._renderedHoverParts = this._register(new RenderedContentHoverParts(\n\t\t\teditor,\n\t\t\tparticipants,\n\t\t\tparts,\n\t\t\tcontext,\n\t\t\tkeybindingService,\n\t\t\thoverService,\n\t\t\tclipboardService\n\t\t));\n\t\tconst contentHoverComputerOptions = hoverResult.options;\n\t\tconst anchor = contentHoverComputerOptions.anchor;\n\t\tconst { showAtPosition, showAtSecondaryPosition } = RenderedContentHover.computeHoverPositions(editor, anchor.range, parts);\n\t\tthis.shouldAppearBeforeContent = parts.some(m => m.isBeforeContent);\n\t\tthis.showAtPosition = showAtPosition;\n\t\tthis.showAtSecondaryPosition = showAtSecondaryPosition;\n\t\tthis.initialMousePosX = anchor.initialMousePosX;\n\t\tthis.initialMousePosY = anchor.initialMousePosY;\n\t\tthis.shouldFocus = contentHoverComputerOptions.shouldFocus;\n\t\tthis.source = contentHoverComputerOptions.source;\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._renderedHoverParts.domNode;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._renderedHoverParts.domNodeHasChildren;\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._renderedHoverParts.focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedHoverParts.hoverPartsCount;\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tthis._renderedHoverParts.focusHoverPartWithIndex(index);\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tthis._renderedHoverParts.updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._renderedHoverParts.isColorPickerVisible();\n\t}\n\n\tpublic static computeHoverPositions(editor: ICodeEditor, anchorRange: Range, hoverParts: IHoverPart[]): { showAtPosition: Position; showAtSecondaryPosition: Position } {\n\n\t\tlet startColumnBoundary = 1;\n\t\tif (editor.hasModel()) {\n\t\t\t// Ensure the range is on the current view line\n\t\t\tconst viewModel = editor._getViewModel();\n\t\t\tconst coordinatesConverter = viewModel.coordinatesConverter;\n\t\t\tconst anchorViewRange = coordinatesConverter.convertModelRangeToViewRange(anchorRange);\n\t\t\tconst anchorViewMinColumn = viewModel.getLineMinColumn(anchorViewRange.startLineNumber);\n\t\t\tconst anchorViewRangeStart = new Position(anchorViewRange.startLineNumber, anchorViewMinColumn);\n\t\t\tstartColumnBoundary = coordinatesConverter.convertViewPositionToModelPosition(anchorViewRangeStart).column;\n\t\t}\n\n\t\t// The anchor range is always on a single line\n\t\tconst anchorStartLineNumber = anchorRange.startLineNumber;\n\t\tlet secondaryPositionColumn = anchorRange.startColumn;\n\t\tlet forceShowAtRange: Range | undefined;\n\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\tconst hoverPartRangeOnAnchorStartLine = hoverPartRange.startLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeOnAnchorEndLine = hoverPartRange.endLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeIsOnAnchorLine = hoverPartRangeOnAnchorStartLine && hoverPartRangeOnAnchorEndLine;\n\t\t\tif (hoverPartRangeIsOnAnchorLine) {\n\t\t\t\t// this message has a range that is completely sitting on the line of the anchor\n\t\t\t\tconst hoverPartStartColumn = hoverPartRange.startColumn;\n\t\t\t\tconst minSecondaryPositionColumn = Math.min(secondaryPositionColumn, hoverPartStartColumn);\n\t\t\t\tsecondaryPositionColumn = Math.max(minSecondaryPositionColumn, startColumnBoundary);\n\t\t\t}\n\t\t\tif (hoverPart.forceShowAtRange) {\n\t\t\t\tforceShowAtRange = hoverPartRange;\n\t\t\t}\n\t\t}\n\n\t\tlet showAtPosition: Position;\n\t\tlet showAtSecondaryPosition: Position;\n\t\tif (forceShowAtRange) {\n\t\t\tconst forceShowAtPosition = forceShowAtRange.getStartPosition();\n\t\t\tshowAtPosition = forceShowAtPosition;\n\t\t\tshowAtSecondaryPosition = forceShowAtPosition;\n\t\t} else {\n\t\t\tshowAtPosition = anchorRange.getStartPosition();\n\t\t\tshowAtSecondaryPosition = new Position(anchorStartLineNumber, secondaryPositionColumn);\n\t\t}\n\t\treturn {\n\t\t\tshowAtPosition,\n\t\t\tshowAtSecondaryPosition,\n\t\t};\n\t}\n}\n\ninterface IRenderedContentHoverPart {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'hoverPart';\n\t/**\n\t * Participant of the rendered hover part\n\t */\n\tparticipant: IEditorHoverParticipant<IHoverPart>;\n\t/**\n\t * The rendered hover part\n\t */\n\thoverPart: IHoverPart;\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n}\n\ninterface IRenderedContentStatusBar {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'statusBar';\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n\t/**\n\t * The actions of the hover status bar.\n\t */\n\tactions: HoverAction[];\n}\n\ntype IRenderedContentHoverPartOrStatusBar = IRenderedContentHoverPart | IRenderedContentStatusBar;\n\nclass RenderedStatusBar implements IDisposable {\n\n\tconstructor(fragment: DocumentFragment, private readonly _statusBar: EditorHoverStatusBar) {\n\t\tfragment.appendChild(this._statusBar.hoverElement);\n\t}\n\n\tget hoverElement(): HTMLElement {\n\t\treturn this._statusBar.hoverElement;\n\t}\n\n\tget actions(): HoverAction[] {\n\t\treturn this._statusBar.actions;\n\t}\n\n\tdispose() {\n\t\tthis._statusBar.dispose();\n\t}\n}\n\nclass RenderedContentHoverParts extends Disposable {\n\n\tprivate static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({\n\t\tdescription: 'content-hover-highlight',\n\t\tclassName: 'hoverHighlight'\n\t});\n\n\tprivate readonly _renderedParts: IRenderedContentHoverPartOrStatusBar[] = [];\n\tprivate readonly _fragment: DocumentFragment;\n\tprivate readonly _context: IEditorHoverContext;\n\n\tprivate _markdownHoverParticipant: MarkdownHoverParticipant | undefined;\n\tprivate _colorHoverParticipant: HoverColorPickerParticipant | undefined;\n\tprivate _focusedHoverPartIndex: number = -1;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\thoverParts: IHoverPart[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService private readonly _hoverService: IHoverService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._fragment = document.createDocumentFragment();\n\t\tthis._register(this._renderParts(participants, hoverParts, context, keybindingService, this._hoverService));\n\t\tthis._register(this._registerListenersOnRenderedParts());\n\t\tthis._register(this._createEditorDecorations(editor, hoverParts));\n\t\tthis._updateMarkdownAndColorParticipantInfo(participants);\n\t}\n\n\tprivate _createEditorDecorations(editor: ICodeEditor, hoverParts: IHoverPart[]): IDisposable {\n\t\tif (hoverParts.length === 0) {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tlet highlightRange = hoverParts[0].range;\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\thighlightRange = Range.plusRange(highlightRange, hoverPartRange);\n\t\t}\n\t\tconst highlightDecoration = editor.createDecorationsCollection();\n\t\thighlightDecoration.set([{\n\t\t\trange: highlightRange,\n\t\t\toptions: RenderedContentHoverParts._DECORATION_OPTIONS\n\t\t}]);\n\t\treturn toDisposable(() => {\n\t\t\thighlightDecoration.clear();\n\t\t});\n\t}\n\n\tprivate _renderParts(participants: IEditorHoverParticipant<IHoverPart>[], hoverParts: IHoverPart[], hoverContext: IEditorHoverContext, keybindingService: IKeybindingService, hoverService: IHoverService): IDisposable {\n\t\tconst statusBar = new EditorHoverStatusBar(keybindingService, hoverService);\n\t\tconst hoverRenderingContext: IEditorHoverRenderContext = {\n\t\t\tfragment: this._fragment,\n\t\t\tstatusBar,\n\t\t\t...hoverContext\n\t\t};\n\t\tconst disposables = new DisposableStore();\n\t\tdisposables.add(statusBar);\n\t\tfor (const participant of participants) {\n\t\t\tconst renderedHoverParts = this._renderHoverPartsForParticipant(hoverParts, participant, hoverRenderingContext);\n\t\t\tdisposables.add(renderedHoverParts);\n\t\t\tfor (const renderedHoverPart of renderedHoverParts.renderedHoverParts) {\n\t\t\t\tthis._renderedParts.push({\n\t\t\t\t\ttype: 'hoverPart',\n\t\t\t\t\tparticipant,\n\t\t\t\t\thoverPart: renderedHoverPart.hoverPart,\n\t\t\t\t\thoverElement: renderedHoverPart.hoverElement,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst renderedStatusBar = this._renderStatusBar(this._fragment, statusBar);\n\t\tif (renderedStatusBar) {\n\t\t\tdisposables.add(renderedStatusBar);\n\t\t\tthis._renderedParts.push({\n\t\t\t\ttype: 'statusBar',\n\t\t\t\thoverElement: renderedStatusBar.hoverElement,\n\t\t\t\tactions: renderedStatusBar.actions,\n\t\t\t});\n\t\t}\n\t\treturn disposables;\n\t}\n\n\tprivate _renderHoverPartsForParticipant(hoverParts: IHoverPart[], participant: IEditorHoverParticipant<IHoverPart>, hoverRenderingContext: IEditorHoverRenderContext): IRenderedHoverParts<IHoverPart> {\n\t\tconst hoverPartsForParticipant = hoverParts.filter(hoverPart => hoverPart.owner === participant);\n\t\tconst hasHoverPartsForParticipant = hoverPartsForParticipant.length > 0;\n\t\tif (!hasHoverPartsForParticipant) {\n\t\t\treturn new RenderedHoverParts([]);\n\t\t}\n\t\treturn participant.renderHoverParts(hoverRenderingContext, hoverPartsForParticipant);\n\t}\n\n\tprivate _renderStatusBar(fragment: DocumentFragment, statusBar: EditorHoverStatusBar): RenderedStatusBar | undefined {\n\t\tif (!statusBar.hasContent) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new RenderedStatusBar(fragment, statusBar);\n\t}\n\n\tprivate _registerListenersOnRenderedParts(): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\t\tthis._renderedParts.forEach((renderedPart: IRenderedContentHoverPartOrStatusBar, index: number) => {\n\t\t\tconst element = renderedPart.hoverElement;\n\t\t\telement.tabIndex = 0;\n\t\t\tdisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_IN, (event: Event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tthis._focusedHoverPartIndex = index;\n\t\t\t}));\n\t\t\tdisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_OUT, (event: Event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tthis._focusedHoverPartIndex = -1;\n\t\t\t}));\n\t\t\t// Add copy button for marker hovers\n\t\t\tif (renderedPart.type === 'hoverPart' && !renderedPart.participant.hideCopyButton) {\n\t\t\t\tdisposables.add(new HoverCopyButton(\n\t\t\t\t\telement,\n\t\t\t\t\t() => renderedPart.participant.getAccessibleContent(renderedPart.hoverPart),\n\t\t\t\t\tthis._clipboardService,\n\t\t\t\t\tthis._hoverService\n\t\t\t\t));\n\t\t\t}\n\t\t});\n\t\treturn disposables;\n\t}\n\n\tprivate _updateMarkdownAndColorParticipantInfo(participants: IEditorHoverParticipant<IHoverPart>[]) {\n\t\tconst markdownHoverParticipant = participants.find(p => {\n\t\t\treturn (p instanceof MarkdownHoverParticipant) && !(p instanceof InlayHintsHover);\n\t\t});\n\t\tif (markdownHoverParticipant) {\n\t\t\tthis._markdownHoverParticipant = markdownHoverParticipant as MarkdownHoverParticipant;\n\t\t}\n\t\tthis._colorHoverParticipant = participants.find(p => p instanceof HoverColorPickerParticipant);\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tif (index < 0 || index >= this._renderedParts.length) {\n\t\t\treturn;\n\t\t}\n\t\tthis._renderedParts[index].hoverElement.focus();\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tif (!this._markdownHoverParticipant) {\n\t\t\treturn;\n\t\t}\n\t\tlet rangeOfIndicesToUpdate: IOffsetRange;\n\t\tif (index >= 0) {\n\t\t\trangeOfIndicesToUpdate = { start: index, endExclusive: index + 1 };\n\t\t} else {\n\t\t\trangeOfIndicesToUpdate = this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);\n\t\t}\n\t\tfor (let i = rangeOfIndicesToUpdate.start; i < rangeOfIndicesToUpdate.endExclusive; i++) {\n\t\t\tconst normalizedMarkdownHoverIndex = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, i);\n\t\t\tif (normalizedMarkdownHoverIndex === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst renderedPart = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(action, normalizedMarkdownHoverIndex);\n\t\t\tif (!renderedPart) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis._renderedParts[i] = {\n\t\t\t\ttype: 'hoverPart',\n\t\t\t\tparticipant: this._markdownHoverParticipant,\n\t\t\t\thoverPart: renderedPart.hoverPart,\n\t\t\t\thoverElement: renderedPart.hoverElement,\n\t\t\t};\n\t\t}\n\t\tif (focus) {\n\t\t\tif (index >= 0) {\n\t\t\t\tthis.focusHoverPartWithIndex(index);\n\t\t\t} else {\n\t\t\t\tthis._context.focus();\n\t\t\t}\n\t\t}\n\t\tthis._context.onContentsChanged();\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._colorHoverParticipant?.isColorPickerVisible() ?? false;\n\t}\n\n\tprivate _normalizedIndexToMarkdownHoverIndexRange(markdownHoverParticipant: MarkdownHoverParticipant, index: number): number | undefined {\n\t\tconst renderedPart = this._renderedParts[index];\n\t\tif (!renderedPart || renderedPart.type !== 'hoverPart') {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst isHoverPartMarkdownHover = renderedPart.participant === markdownHoverParticipant;\n\t\tif (!isHoverPartMarkdownHover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst firstIndexOfMarkdownHovers = this._renderedParts.findIndex(renderedPart =>\n\t\t\trenderedPart.type === 'hoverPart'\n\t\t\t&& renderedPart.participant === markdownHoverParticipant\n\t\t);\n\t\tif (firstIndexOfMarkdownHovers === -1) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\t\treturn index - firstIndexOfMarkdownHovers;\n\t}\n\n\tprivate _findRangeOfMarkdownHoverParts(markdownHoverParticipant: MarkdownHoverParticipant): IOffsetRange {\n\t\tconst copiedRenderedParts = this._renderedParts.slice();\n\t\tconst firstIndexOfMarkdownHovers = copiedRenderedParts.findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst inversedLastIndexOfMarkdownHovers = copiedRenderedParts.reverse().findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst lastIndexOfMarkdownHovers = inversedLastIndexOfMarkdownHovers >= 0 ? copiedRenderedParts.length - inversedLastIndexOfMarkdownHovers : inversedLastIndexOfMarkdownHovers;\n\t\treturn { start: firstIndexOfMarkdownHovers, endExclusive: lastIndexOfMarkdownHovers + 1 };\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._fragment;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._fragment.hasChildNodes();\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedParts.length;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/hover/browser/contentHoverRendered.ts","vs/editor/contrib/hover/browser/contentHoverRendered.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAA4G,kBAAkB,EA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AY,CAAC,IAAI,KAAK,WAAW,IAAI,YAAY,CAAC,WAAW,KAAK,wBAAwB,CAAC,CAAC;QAC9L,MAAM,yBAAyB,GAAG,iCAAiC,IAAI,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM,GAAG,iCAAiC,CAAC,CAAC,CAAC,iCAAiC,CAAC;QAC9K,OAAO,EAAE,KAAK,EAAE,0BAA0B,EAAE,YAAY,EAAE,yBAAyB,GAAG,CAAC,EAAE,CAAC;IAC3F,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACvB,CAAC;IAED,IAAW,kBAAkB;QAC5B,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC;IACvC,CAAC;IAED,IAAW,qBAAqB;QAC/B,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACpC,CAAC;IAED,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC;IACnC,CAAC;;AAvPI,yBAAyB;IAqB5B,WAAA,kBAAkB,CAAA;IAClB,WAAA,aAAa,CAAA;IACb,WAAA,iBAAiB,CAAA;GAvBd,yBAAyB,CAwP9B","file":"contentHoverRendered.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IEditorHoverContext, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverParts, RenderedHoverParts } from './hoverTypes.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { EditorHoverStatusBar } from './contentHoverStatusBar.js';\nimport { HoverStartSource } from './hoverOperation.js';\nimport { HoverCopyButton } from './hoverCopyButton.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { ContentHoverResult } from './contentHoverTypes.js';\nimport * as dom from '../../../../base/browser/dom.js';\nimport { HoverVerbosityAction } from '../../../common/languages.js';\nimport { MarkdownHoverParticipant } from './markdownHoverParticipant.js';\nimport { ColorHover, HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';\nimport { InlayHintsHover } from '../../inlayHints/browser/inlayHintsHover.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { HoverAction } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverService } from '../../../../platform/hover/browser/hover.js';\nimport { IOffsetRange } from '../../../common/core/ranges/offsetRange.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\n\nexport class RenderedContentHover extends Disposable {\n\n\tpublic closestMouseDistance: number | undefined;\n\tpublic initialMousePosX: number | undefined;\n\tpublic initialMousePosY: number | undefined;\n\n\tpublic readonly showAtPosition: Position;\n\tpublic readonly showAtSecondaryPosition: Position;\n\tpublic readonly shouldFocus: boolean;\n\tpublic readonly source: HoverStartSource;\n\tpublic readonly shouldAppearBeforeContent: boolean;\n\n\tprivate readonly _renderedHoverParts: RenderedContentHoverParts;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\thoverResult: ContentHoverResult,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService hoverService: IHoverService,\n\t\t@IClipboardService clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tconst parts = hoverResult.hoverParts;\n\t\tthis._renderedHoverParts = this._register(new RenderedContentHoverParts(\n\t\t\teditor,\n\t\t\tparticipants,\n\t\t\tparts,\n\t\t\tcontext,\n\t\t\tkeybindingService,\n\t\t\thoverService,\n\t\t\tclipboardService\n\t\t));\n\t\tconst contentHoverComputerOptions = hoverResult.options;\n\t\tconst anchor = contentHoverComputerOptions.anchor;\n\t\tconst { showAtPosition, showAtSecondaryPosition } = RenderedContentHover.computeHoverPositions(editor, anchor.range, parts);\n\t\tthis.shouldAppearBeforeContent = parts.some(m => m.isBeforeContent);\n\t\tthis.showAtPosition = showAtPosition;\n\t\tthis.showAtSecondaryPosition = showAtSecondaryPosition;\n\t\tthis.initialMousePosX = anchor.initialMousePosX;\n\t\tthis.initialMousePosY = anchor.initialMousePosY;\n\t\tthis.shouldFocus = contentHoverComputerOptions.shouldFocus;\n\t\tthis.source = contentHoverComputerOptions.source;\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._renderedHoverParts.domNode;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._renderedHoverParts.domNodeHasChildren;\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._renderedHoverParts.focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedHoverParts.hoverPartsCount;\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tthis._renderedHoverParts.focusHoverPartWithIndex(index);\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tthis._renderedHoverParts.updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._renderedHoverParts.isColorPickerVisible();\n\t}\n\n\tpublic static computeHoverPositions(editor: ICodeEditor, anchorRange: Range, hoverParts: IHoverPart[]): { showAtPosition: Position; showAtSecondaryPosition: Position } {\n\n\t\tlet startColumnBoundary = 1;\n\t\tif (editor.hasModel()) {\n\t\t\t// Ensure the range is on the current view line\n\t\t\tconst viewModel = editor._getViewModel();\n\t\t\tconst coordinatesConverter = viewModel.coordinatesConverter;\n\t\t\tconst anchorViewRange = coordinatesConverter.convertModelRangeToViewRange(anchorRange);\n\t\t\tconst anchorViewMinColumn = viewModel.getLineMinColumn(anchorViewRange.startLineNumber);\n\t\t\tconst anchorViewRangeStart = new Position(anchorViewRange.startLineNumber, anchorViewMinColumn);\n\t\t\tstartColumnBoundary = coordinatesConverter.convertViewPositionToModelPosition(anchorViewRangeStart).column;\n\t\t}\n\n\t\t// The anchor range is always on a single line\n\t\tconst anchorStartLineNumber = anchorRange.startLineNumber;\n\t\tlet secondaryPositionColumn = anchorRange.startColumn;\n\t\tlet forceShowAtRange: Range | undefined;\n\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\tconst hoverPartRangeOnAnchorStartLine = hoverPartRange.startLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeOnAnchorEndLine = hoverPartRange.endLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeIsOnAnchorLine = hoverPartRangeOnAnchorStartLine && hoverPartRangeOnAnchorEndLine;\n\t\t\tif (hoverPartRangeIsOnAnchorLine) {\n\t\t\t\t// this message has a range that is completely sitting on the line of the anchor\n\t\t\t\tconst hoverPartStartColumn = hoverPartRange.startColumn;\n\t\t\t\tconst minSecondaryPositionColumn = Math.min(secondaryPositionColumn, hoverPartStartColumn);\n\t\t\t\tsecondaryPositionColumn = Math.max(minSecondaryPositionColumn, startColumnBoundary);\n\t\t\t}\n\t\t\tif (hoverPart.forceShowAtRange) {\n\t\t\t\tforceShowAtRange = hoverPartRange;\n\t\t\t}\n\t\t}\n\n\t\tlet showAtPosition: Position;\n\t\tlet showAtSecondaryPosition: Position;\n\t\tif (forceShowAtRange) {\n\t\t\tconst forceShowAtPosition = forceShowAtRange.getStartPosition();\n\t\t\tshowAtPosition = forceShowAtPosition;\n\t\t\tshowAtSecondaryPosition = forceShowAtPosition;\n\t\t} else {\n\t\t\tshowAtPosition = anchorRange.getStartPosition();\n\t\t\tshowAtSecondaryPosition = new Position(anchorStartLineNumber, secondaryPositionColumn);\n\t\t}\n\t\treturn {\n\t\t\tshowAtPosition,\n\t\t\tshowAtSecondaryPosition,\n\t\t};\n\t}\n}\n\ninterface IRenderedContentHoverPart {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'hoverPart';\n\t/**\n\t * Participant of the rendered hover part\n\t */\n\tparticipant: IEditorHoverParticipant<IHoverPart>;\n\t/**\n\t * The rendered hover part\n\t */\n\thoverPart: IHoverPart;\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n}\n\ninterface IRenderedContentStatusBar {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'statusBar';\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n\t/**\n\t * The actions of the hover status bar.\n\t */\n\tactions: HoverAction[];\n}\n\ntype IRenderedContentHoverPartOrStatusBar = IRenderedContentHoverPart | IRenderedContentStatusBar;\n\nclass RenderedStatusBar implements IDisposable {\n\n\tconstructor(fragment: DocumentFragment, private readonly _statusBar: EditorHoverStatusBar) {\n\t\tfragment.appendChild(this._statusBar.hoverElement);\n\t}\n\n\tget hoverElement(): HTMLElement {\n\t\treturn this._statusBar.hoverElement;\n\t}\n\n\tget actions(): HoverAction[] {\n\t\treturn this._statusBar.actions;\n\t}\n\n\tdispose() {\n\t\tthis._statusBar.dispose();\n\t}\n}\n\nclass RenderedContentHoverParts extends Disposable {\n\n\tprivate static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({\n\t\tdescription: 'content-hover-highlight',\n\t\tclassName: 'hoverHighlight'\n\t});\n\n\tprivate readonly _renderedParts: IRenderedContentHoverPartOrStatusBar[] = [];\n\tprivate readonly _perPartDisposables = new Map<number, IDisposable>();\n\tprivate readonly _fragment: DocumentFragment;\n\tprivate readonly _context: IEditorHoverContext;\n\n\tprivate _markdownHoverParticipant: MarkdownHoverParticipant | undefined;\n\tprivate _colorHoverParticipant: HoverColorPickerParticipant | undefined;\n\tprivate _focusedHoverPartIndex: number = -1;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\thoverParts: IHoverPart[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService private readonly _hoverService: IHoverService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._fragment = document.createDocumentFragment();\n\t\tthis._register(this._renderParts(participants, hoverParts, context, keybindingService, this._hoverService));\n\t\tthis._register(this._registerListenersOnRenderedParts());\n\t\tthis._register(this._createEditorDecorations(editor, hoverParts));\n\t\tthis._updateMarkdownAndColorParticipantInfo(participants);\n\t}\n\n\tprivate _createEditorDecorations(editor: ICodeEditor, hoverParts: IHoverPart[]): IDisposable {\n\t\tif (hoverParts.length === 0) {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tlet highlightRange = hoverParts[0].range;\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\thighlightRange = Range.plusRange(highlightRange, hoverPartRange);\n\t\t}\n\t\tconst highlightDecoration = editor.createDecorationsCollection();\n\t\thighlightDecoration.set([{\n\t\t\trange: highlightRange,\n\t\t\toptions: RenderedContentHoverParts._DECORATION_OPTIONS\n\t\t}]);\n\t\treturn toDisposable(() => {\n\t\t\thighlightDecoration.clear();\n\t\t});\n\t}\n\n\tprivate _renderParts(participants: IEditorHoverParticipant<IHoverPart>[], hoverParts: IHoverPart[], hoverContext: IEditorHoverContext, keybindingService: IKeybindingService, hoverService: IHoverService): IDisposable {\n\t\tconst statusBar = new EditorHoverStatusBar(keybindingService, hoverService);\n\t\tconst hoverRenderingContext: IEditorHoverRenderContext = {\n\t\t\tfragment: this._fragment,\n\t\t\tstatusBar,\n\t\t\t...hoverContext\n\t\t};\n\t\tconst disposables = new DisposableStore();\n\t\tdisposables.add(statusBar);\n\t\tfor (const participant of participants) {\n\t\t\tconst renderedHoverParts = this._renderHoverPartsForParticipant(hoverParts, participant, hoverRenderingContext);\n\t\t\tdisposables.add(renderedHoverParts);\n\t\t\tfor (const renderedHoverPart of renderedHoverParts.renderedHoverParts) {\n\t\t\t\tthis._renderedParts.push({\n\t\t\t\t\ttype: 'hoverPart',\n\t\t\t\t\tparticipant,\n\t\t\t\t\thoverPart: renderedHoverPart.hoverPart,\n\t\t\t\t\thoverElement: renderedHoverPart.hoverElement,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst renderedStatusBar = this._renderStatusBar(this._fragment, statusBar);\n\t\tif (renderedStatusBar) {\n\t\t\tdisposables.add(renderedStatusBar);\n\t\t\tthis._renderedParts.push({\n\t\t\t\ttype: 'statusBar',\n\t\t\t\thoverElement: renderedStatusBar.hoverElement,\n\t\t\t\tactions: renderedStatusBar.actions,\n\t\t\t});\n\t\t}\n\t\treturn disposables;\n\t}\n\n\tprivate _renderHoverPartsForParticipant(hoverParts: IHoverPart[], participant: IEditorHoverParticipant<IHoverPart>, hoverRenderingContext: IEditorHoverRenderContext): IRenderedHoverParts<IHoverPart> {\n\t\tconst hoverPartsForParticipant = hoverParts.filter(hoverPart => hoverPart.owner === participant);\n\t\tconst hasHoverPartsForParticipant = hoverPartsForParticipant.length > 0;\n\t\tif (!hasHoverPartsForParticipant) {\n\t\t\treturn new RenderedHoverParts([]);\n\t\t}\n\t\treturn participant.renderHoverParts(hoverRenderingContext, hoverPartsForParticipant);\n\t}\n\n\tprivate _renderStatusBar(fragment: DocumentFragment, statusBar: EditorHoverStatusBar): RenderedStatusBar | undefined {\n\t\tif (!statusBar.hasContent) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new RenderedStatusBar(fragment, statusBar);\n\t}\n\n\tprivate _registerListenersOnRenderedParts(): IDisposable {\n\t\t// Create per-part disposables so that when an individual rendered part is\n\t\t// updated we can dispose its listeners and copy button without affecting\n\t\t// the others.\n\t\tthis._renderedParts.forEach((renderedPart: IRenderedContentHoverPartOrStatusBar, index: number) => {\n\t\t\tthis._createListenersForPart(index, renderedPart);\n\t\t});\n\t\treturn toDisposable(() => {\n\t\t\tfor (const d of this._perPartDisposables.values()) {\n\t\t\t\td.dispose();\n\t\t\t}\n\t\t\tthis._perPartDisposables.clear();\n\t\t});\n\t}\n\n\tprivate _createListenersForPart(index: number, renderedPart: IRenderedContentHoverPartOrStatusBar): void {\n\t\tconst partDisposables = new DisposableStore();\n\t\tconst element = renderedPart.hoverElement;\n\t\telement.tabIndex = 0;\n\t\tpartDisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_IN, (event: Event) => {\n\t\t\tevent.stopPropagation();\n\t\t\tthis._focusedHoverPartIndex = index;\n\t\t}));\n\t\tpartDisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_OUT, (event: Event) => {\n\t\t\tevent.stopPropagation();\n\t\t\tthis._focusedHoverPartIndex = -1;\n\t\t}));\n\t\t// Add copy button for marker hovers\n\t\tif (renderedPart.type === 'hoverPart' && !(renderedPart.hoverPart instanceof ColorHover) && !renderedPart.participant.hideCopyButton) {\n\t\t\tpartDisposables.add(new HoverCopyButton(\n\t\t\t\telement,\n\t\t\t\t() => renderedPart.participant.getAccessibleContent(renderedPart.hoverPart),\n\t\t\t\tthis._clipboardService,\n\t\t\t\tthis._hoverService\n\t\t\t));\n\t\t}\n\t\tthis._perPartDisposables.set(index, partDisposables);\n\t}\n\n\tprivate _updateMarkdownAndColorParticipantInfo(participants: IEditorHoverParticipant<IHoverPart>[]) {\n\t\tconst markdownHoverParticipant = participants.find(p => {\n\t\t\treturn (p instanceof MarkdownHoverParticipant) && !(p instanceof InlayHintsHover);\n\t\t});\n\t\tif (markdownHoverParticipant) {\n\t\t\tthis._markdownHoverParticipant = markdownHoverParticipant as MarkdownHoverParticipant;\n\t\t}\n\t\tthis._colorHoverParticipant = participants.find(p => p instanceof HoverColorPickerParticipant);\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tif (index < 0 || index >= this._renderedParts.length) {\n\t\t\treturn;\n\t\t}\n\t\tthis._renderedParts[index].hoverElement.focus();\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tif (!this._markdownHoverParticipant) {\n\t\t\treturn;\n\t\t}\n\t\tlet rangeOfIndicesToUpdate: IOffsetRange;\n\t\tif (index >= 0) {\n\t\t\trangeOfIndicesToUpdate = { start: index, endExclusive: index + 1 };\n\t\t} else {\n\t\t\trangeOfIndicesToUpdate = this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);\n\t\t}\n\t\tfor (let i = rangeOfIndicesToUpdate.start; i < rangeOfIndicesToUpdate.endExclusive; i++) {\n\t\t\tconst normalizedMarkdownHoverIndex = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, i);\n\t\t\tif (normalizedMarkdownHoverIndex === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst renderedPart = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(action, normalizedMarkdownHoverIndex);\n\t\t\tif (!renderedPart) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Dispose any listeners/copy button for the previous part at this index\n\t\t\tconst prevDisposable = this._perPartDisposables.get(i);\n\t\t\tif (prevDisposable) {\n\t\t\t\tprevDisposable.dispose();\n\t\t\t\tthis._perPartDisposables.delete(i);\n\t\t\t}\n\t\t\tthis._renderedParts[i] = {\n\t\t\t\ttype: 'hoverPart',\n\t\t\t\tparticipant: this._markdownHoverParticipant,\n\t\t\t\thoverPart: renderedPart.hoverPart,\n\t\t\t\thoverElement: renderedPart.hoverElement,\n\t\t\t};\n\t\t\t// Recreate listeners and copy button for the updated part.\n\t\t\tthis._createListenersForPart(i, this._renderedParts[i]);\n\t\t}\n\t\tif (focus) {\n\t\t\tif (index >= 0) {\n\t\t\t\tthis.focusHoverPartWithIndex(index);\n\t\t\t} else {\n\t\t\t\tthis._context.focus();\n\t\t\t}\n\t\t}\n\t\tthis._context.onContentsChanged();\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._colorHoverParticipant?.isColorPickerVisible() ?? false;\n\t}\n\n\tprivate _normalizedIndexToMarkdownHoverIndexRange(markdownHoverParticipant: MarkdownHoverParticipant, index: number): number | undefined {\n\t\tconst renderedPart = this._renderedParts[index];\n\t\tif (!renderedPart || renderedPart.type !== 'hoverPart') {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst isHoverPartMarkdownHover = renderedPart.participant === markdownHoverParticipant;\n\t\tif (!isHoverPartMarkdownHover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst firstIndexOfMarkdownHovers = this._renderedParts.findIndex(renderedPart =>\n\t\t\trenderedPart.type === 'hoverPart'\n\t\t\t&& renderedPart.participant === markdownHoverParticipant\n\t\t);\n\t\tif (firstIndexOfMarkdownHovers === -1) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\t\treturn index - firstIndexOfMarkdownHovers;\n\t}\n\n\tprivate _findRangeOfMarkdownHoverParts(markdownHoverParticipant: MarkdownHoverParticipant): IOffsetRange {\n\t\tconst copiedRenderedParts = this._renderedParts.slice();\n\t\tconst firstIndexOfMarkdownHovers = copiedRenderedParts.findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst inversedLastIndexOfMarkdownHovers = copiedRenderedParts.reverse().findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst lastIndexOfMarkdownHovers = inversedLastIndexOfMarkdownHovers >= 0 ? copiedRenderedParts.length - inversedLastIndexOfMarkdownHovers : inversedLastIndexOfMarkdownHovers;\n\t\treturn { start: firstIndexOfMarkdownHovers, endExclusive: lastIndexOfMarkdownHovers + 1 };\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._fragment;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._fragment.hasChildNodes();\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedParts.length;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IEditorHoverContext, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverParts, RenderedHoverParts } from './hoverTypes.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { EditorHoverStatusBar } from './contentHoverStatusBar.js';\nimport { HoverStartSource } from './hoverOperation.js';\nimport { HoverCopyButton } from './hoverCopyButton.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { ContentHoverResult } from './contentHoverTypes.js';\nimport * as dom from '../../../../base/browser/dom.js';\nimport { HoverVerbosityAction } from '../../../common/languages.js';\nimport { MarkdownHoverParticipant } from './markdownHoverParticipant.js';\nimport { ColorHover, HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';\nimport { InlayHintsHover } from '../../inlayHints/browser/inlayHintsHover.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { HoverAction } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverService } from '../../../../platform/hover/browser/hover.js';\nimport { IOffsetRange } from '../../../common/core/ranges/offsetRange.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\n\nexport class RenderedContentHover extends Disposable {\n\n\tpublic closestMouseDistance: number | undefined;\n\tpublic initialMousePosX: number | undefined;\n\tpublic initialMousePosY: number | undefined;\n\n\tpublic readonly showAtPosition: Position;\n\tpublic readonly showAtSecondaryPosition: Position;\n\tpublic readonly shouldFocus: boolean;\n\tpublic readonly source: HoverStartSource;\n\tpublic readonly shouldAppearBeforeContent: boolean;\n\n\tprivate readonly _renderedHoverParts: RenderedContentHoverParts;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\thoverResult: ContentHoverResult,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService hoverService: IHoverService,\n\t\t@IClipboardService clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tconst parts = hoverResult.hoverParts;\n\t\tthis._renderedHoverParts = this._register(new RenderedContentHoverParts(\n\t\t\teditor,\n\t\t\tparticipants,\n\t\t\tparts,\n\t\t\tcontext,\n\t\t\tkeybindingService,\n\t\t\thoverService,\n\t\t\tclipboardService\n\t\t));\n\t\tconst contentHoverComputerOptions = hoverResult.options;\n\t\tconst anchor = contentHoverComputerOptions.anchor;\n\t\tconst { showAtPosition, showAtSecondaryPosition } = RenderedContentHover.computeHoverPositions(editor, anchor.range, parts);\n\t\tthis.shouldAppearBeforeContent = parts.some(m => m.isBeforeContent);\n\t\tthis.showAtPosition = showAtPosition;\n\t\tthis.showAtSecondaryPosition = showAtSecondaryPosition;\n\t\tthis.initialMousePosX = anchor.initialMousePosX;\n\t\tthis.initialMousePosY = anchor.initialMousePosY;\n\t\tthis.shouldFocus = contentHoverComputerOptions.shouldFocus;\n\t\tthis.source = contentHoverComputerOptions.source;\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._renderedHoverParts.domNode;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._renderedHoverParts.domNodeHasChildren;\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._renderedHoverParts.focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedHoverParts.hoverPartsCount;\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tthis._renderedHoverParts.focusHoverPartWithIndex(index);\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tthis._renderedHoverParts.updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._renderedHoverParts.isColorPickerVisible();\n\t}\n\n\tpublic static computeHoverPositions(editor: ICodeEditor, anchorRange: Range, hoverParts: IHoverPart[]): { showAtPosition: Position; showAtSecondaryPosition: Position } {\n\n\t\tlet startColumnBoundary = 1;\n\t\tif (editor.hasModel()) {\n\t\t\t// Ensure the range is on the current view line\n\t\t\tconst viewModel = editor._getViewModel();\n\t\t\tconst coordinatesConverter = viewModel.coordinatesConverter;\n\t\t\tconst anchorViewRange = coordinatesConverter.convertModelRangeToViewRange(anchorRange);\n\t\t\tconst anchorViewMinColumn = viewModel.getLineMinColumn(anchorViewRange.startLineNumber);\n\t\t\tconst anchorViewRangeStart = new Position(anchorViewRange.startLineNumber, anchorViewMinColumn);\n\t\t\tstartColumnBoundary = coordinatesConverter.convertViewPositionToModelPosition(anchorViewRangeStart).column;\n\t\t}\n\n\t\t// The anchor range is always on a single line\n\t\tconst anchorStartLineNumber = anchorRange.startLineNumber;\n\t\tlet secondaryPositionColumn = anchorRange.startColumn;\n\t\tlet forceShowAtRange: Range | undefined;\n\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\tconst hoverPartRangeOnAnchorStartLine = hoverPartRange.startLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeOnAnchorEndLine = hoverPartRange.endLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeIsOnAnchorLine = hoverPartRangeOnAnchorStartLine && hoverPartRangeOnAnchorEndLine;\n\t\t\tif (hoverPartRangeIsOnAnchorLine) {\n\t\t\t\t// this message has a range that is completely sitting on the line of the anchor\n\t\t\t\tconst hoverPartStartColumn = hoverPartRange.startColumn;\n\t\t\t\tconst minSecondaryPositionColumn = Math.min(secondaryPositionColumn, hoverPartStartColumn);\n\t\t\t\tsecondaryPositionColumn = Math.max(minSecondaryPositionColumn, startColumnBoundary);\n\t\t\t}\n\t\t\tif (hoverPart.forceShowAtRange) {\n\t\t\t\tforceShowAtRange = hoverPartRange;\n\t\t\t}\n\t\t}\n\n\t\tlet showAtPosition: Position;\n\t\tlet showAtSecondaryPosition: Position;\n\t\tif (forceShowAtRange) {\n\t\t\tconst forceShowAtPosition = forceShowAtRange.getStartPosition();\n\t\t\tshowAtPosition = forceShowAtPosition;\n\t\t\tshowAtSecondaryPosition = forceShowAtPosition;\n\t\t} else {\n\t\t\tshowAtPosition = anchorRange.getStartPosition();\n\t\t\tshowAtSecondaryPosition = new Position(anchorStartLineNumber, secondaryPositionColumn);\n\t\t}\n\t\treturn {\n\t\t\tshowAtPosition,\n\t\t\tshowAtSecondaryPosition,\n\t\t};\n\t}\n}\n\ninterface IRenderedContentHoverPart {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'hoverPart';\n\t/**\n\t * Participant of the rendered hover part\n\t */\n\tparticipant: IEditorHoverParticipant<IHoverPart>;\n\t/**\n\t * The rendered hover part\n\t */\n\thoverPart: IHoverPart;\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n}\n\ninterface IRenderedContentStatusBar {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'statusBar';\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n\t/**\n\t * The actions of the hover status bar.\n\t */\n\tactions: HoverAction[];\n}\n\ntype IRenderedContentHoverPartOrStatusBar = IRenderedContentHoverPart | IRenderedContentStatusBar;\n\nclass RenderedStatusBar implements IDisposable {\n\n\tconstructor(fragment: DocumentFragment, private readonly _statusBar: EditorHoverStatusBar) {\n\t\tfragment.appendChild(this._statusBar.hoverElement);\n\t}\n\n\tget hoverElement(): HTMLElement {\n\t\treturn this._statusBar.hoverElement;\n\t}\n\n\tget actions(): HoverAction[] {\n\t\treturn this._statusBar.actions;\n\t}\n\n\tdispose() {\n\t\tthis._statusBar.dispose();\n\t}\n}\n\nclass RenderedContentHoverParts extends Disposable {\n\n\tprivate static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({\n\t\tdescription: 'content-hover-highlight',\n\t\tclassName: 'hoverHighlight'\n\t});\n\n\tprivate readonly _renderedParts: IRenderedContentHoverPartOrStatusBar[] = [];\n\tprivate readonly _perPartDisposables = new Map<number, IDisposable>();\n\tprivate readonly _fragment: DocumentFragment;\n\tprivate readonly _context: IEditorHoverContext;\n\n\tprivate _markdownHoverParticipant: MarkdownHoverParticipant | undefined;\n\tprivate _colorHoverParticipant: HoverColorPickerParticipant | undefined;\n\tprivate _focusedHoverPartIndex: number = -1;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\thoverParts: IHoverPart[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService private readonly _hoverService: IHoverService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._fragment = document.createDocumentFragment();\n\t\tthis._register(this._renderParts(participants, hoverParts, context, keybindingService, this._hoverService));\n\t\tthis._register(this._registerListenersOnRenderedParts());\n\t\tthis._register(this._createEditorDecorations(editor, hoverParts));\n\t\tthis._updateMarkdownAndColorParticipantInfo(participants);\n\t}\n\n\tprivate _createEditorDecorations(editor: ICodeEditor, hoverParts: IHoverPart[]): IDisposable {\n\t\tif (hoverParts.length === 0) {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tlet highlightRange = hoverParts[0].range;\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\thighlightRange = Range.plusRange(highlightRange, hoverPartRange);\n\t\t}\n\t\tconst highlightDecoration = editor.createDecorationsCollection();\n\t\thighlightDecoration.set([{\n\t\t\trange: highlightRange,\n\t\t\toptions: RenderedContentHoverParts._DECORATION_OPTIONS\n\t\t}]);\n\t\treturn toDisposable(() => {\n\t\t\thighlightDecoration.clear();\n\t\t});\n\t}\n\n\tprivate _renderParts(participants: IEditorHoverParticipant<IHoverPart>[], hoverParts: IHoverPart[], hoverContext: IEditorHoverContext, keybindingService: IKeybindingService, hoverService: IHoverService): IDisposable {\n\t\tconst statusBar = new EditorHoverStatusBar(keybindingService, hoverService);\n\t\tconst hoverRenderingContext: IEditorHoverRenderContext = {\n\t\t\tfragment: this._fragment,\n\t\t\tstatusBar,\n\t\t\t...hoverContext\n\t\t};\n\t\tconst disposables = new DisposableStore();\n\t\tdisposables.add(statusBar);\n\t\tfor (const participant of participants) {\n\t\t\tconst renderedHoverParts = this._renderHoverPartsForParticipant(hoverParts, participant, hoverRenderingContext);\n\t\t\tdisposables.add(renderedHoverParts);\n\t\t\tfor (const renderedHoverPart of renderedHoverParts.renderedHoverParts) {\n\t\t\t\tthis._renderedParts.push({\n\t\t\t\t\ttype: 'hoverPart',\n\t\t\t\t\tparticipant,\n\t\t\t\t\thoverPart: renderedHoverPart.hoverPart,\n\t\t\t\t\thoverElement: renderedHoverPart.hoverElement,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst renderedStatusBar = this._renderStatusBar(this._fragment, statusBar);\n\t\tif (renderedStatusBar) {\n\t\t\tdisposables.add(renderedStatusBar);\n\t\t\tthis._renderedParts.push({\n\t\t\t\ttype: 'statusBar',\n\t\t\t\thoverElement: renderedStatusBar.hoverElement,\n\t\t\t\tactions: renderedStatusBar.actions,\n\t\t\t});\n\t\t}\n\t\treturn disposables;\n\t}\n\n\tprivate _renderHoverPartsForParticipant(hoverParts: IHoverPart[], participant: IEditorHoverParticipant<IHoverPart>, hoverRenderingContext: IEditorHoverRenderContext): IRenderedHoverParts<IHoverPart> {\n\t\tconst hoverPartsForParticipant = hoverParts.filter(hoverPart => hoverPart.owner === participant);\n\t\tconst hasHoverPartsForParticipant = hoverPartsForParticipant.length > 0;\n\t\tif (!hasHoverPartsForParticipant) {\n\t\t\treturn new RenderedHoverParts([]);\n\t\t}\n\t\treturn participant.renderHoverParts(hoverRenderingContext, hoverPartsForParticipant);\n\t}\n\n\tprivate _renderStatusBar(fragment: DocumentFragment, statusBar: EditorHoverStatusBar): RenderedStatusBar | undefined {\n\t\tif (!statusBar.hasContent) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new RenderedStatusBar(fragment, statusBar);\n\t}\n\n\tprivate _registerListenersOnRenderedParts(): IDisposable {\n\t\t// Create per-part disposables so that when an individual rendered part is\n\t\t// updated we can dispose its listeners and copy button without affecting\n\t\t// the others.\n\t\tthis._renderedParts.forEach((renderedPart: IRenderedContentHoverPartOrStatusBar, index: number) => {\n\t\t\tthis._createListenersForPart(index, renderedPart);\n\t\t});\n\t\treturn toDisposable(() => {\n\t\t\tfor (const d of this._perPartDisposables.values()) {\n\t\t\t\td.dispose();\n\t\t\t}\n\t\t\tthis._perPartDisposables.clear();\n\t\t});\n\t}\n\n\tprivate _createListenersForPart(index: number, renderedPart: IRenderedContentHoverPartOrStatusBar): void {\n\t\tconst partDisposables = new DisposableStore();\n\t\tconst element = renderedPart.hoverElement;\n\t\telement.tabIndex = 0;\n\t\tpartDisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_IN, (event: Event) => {\n\t\t\tevent.stopPropagation();\n\t\t\tthis._focusedHoverPartIndex = index;\n\t\t}));\n\t\tpartDisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_OUT, (event: Event) => {\n\t\t\tevent.stopPropagation();\n\t\t\tthis._focusedHoverPartIndex = -1;\n\t\t}));\n\t\t// Add copy button for marker hovers\n\t\tif (renderedPart.type === 'hoverPart' && !(renderedPart.hoverPart instanceof ColorHover) && !renderedPart.participant.hideCopyButton) {\n\t\t\tpartDisposables.add(new HoverCopyButton(\n\t\t\t\telement,\n\t\t\t\t() => renderedPart.participant.getAccessibleContent(renderedPart.hoverPart),\n\t\t\t\tthis._clipboardService,\n\t\t\t\tthis._hoverService\n\t\t\t));\n\t\t}\n\t\tthis._perPartDisposables.set(index, partDisposables);\n\t}\n\n\tprivate _updateMarkdownAndColorParticipantInfo(participants: IEditorHoverParticipant<IHoverPart>[]) {\n\t\tconst markdownHoverParticipant = participants.find(p => {\n\t\t\treturn (p instanceof MarkdownHoverParticipant) && !(p instanceof InlayHintsHover);\n\t\t});\n\t\tif (markdownHoverParticipant) {\n\t\t\tthis._markdownHoverParticipant = markdownHoverParticipant as MarkdownHoverParticipant;\n\t\t}\n\t\tthis._colorHoverParticipant = participants.find(p => p instanceof HoverColorPickerParticipant);\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tif (index < 0 || index >= this._renderedParts.length) {\n\t\t\treturn;\n\t\t}\n\t\tthis._renderedParts[index].hoverElement.focus();\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tif (!this._markdownHoverParticipant) {\n\t\t\treturn;\n\t\t}\n\t\tlet rangeOfIndicesToUpdate: IOffsetRange;\n\t\tif (index >= 0) {\n\t\t\trangeOfIndicesToUpdate = { start: index, endExclusive: index + 1 };\n\t\t} else {\n\t\t\trangeOfIndicesToUpdate = this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);\n\t\t}\n\t\tfor (let i = rangeOfIndicesToUpdate.start; i < rangeOfIndicesToUpdate.endExclusive; i++) {\n\t\t\tconst normalizedMarkdownHoverIndex = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, i);\n\t\t\tif (normalizedMarkdownHoverIndex === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst renderedPart = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(action, normalizedMarkdownHoverIndex);\n\t\t\tif (!renderedPart) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Dispose any listeners/copy button for the previous part at this index\n\t\t\tconst prevDisposable = this._perPartDisposables.get(i);\n\t\t\tif (prevDisposable) {\n\t\t\t\tprevDisposable.dispose();\n\t\t\t\tthis._perPartDisposables.delete(i);\n\t\t\t}\n\t\t\tthis._renderedParts[i] = {\n\t\t\t\ttype: 'hoverPart',\n\t\t\t\tparticipant: this._markdownHoverParticipant,\n\t\t\t\thoverPart: renderedPart.hoverPart,\n\t\t\t\thoverElement: renderedPart.hoverElement,\n\t\t\t};\n\t\t\t// Recreate listeners and copy button for the updated part.\n\t\t\tthis._createListenersForPart(i, this._renderedParts[i]);\n\t\t}\n\t\tif (focus) {\n\t\t\tif (index >= 0) {\n\t\t\t\tthis.focusHoverPartWithIndex(index);\n\t\t\t} else {\n\t\t\t\tthis._context.focus();\n\t\t\t}\n\t\t}\n\t\tthis._context.onContentsChanged();\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._colorHoverParticipant?.isColorPickerVisible() ?? false;\n\t}\n\n\tprivate _normalizedIndexToMarkdownHoverIndexRange(markdownHoverParticipant: MarkdownHoverParticipant, index: number): number | undefined {\n\t\tconst renderedPart = this._renderedParts[index];\n\t\tif (!renderedPart || renderedPart.type !== 'hoverPart') {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst isHoverPartMarkdownHover = renderedPart.participant === markdownHoverParticipant;\n\t\tif (!isHoverPartMarkdownHover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst firstIndexOfMarkdownHovers = this._renderedParts.findIndex(renderedPart =>\n\t\t\trenderedPart.type === 'hoverPart'\n\t\t\t&& renderedPart.participant === markdownHoverParticipant\n\t\t);\n\t\tif (firstIndexOfMarkdownHovers === -1) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\t\treturn index - firstIndexOfMarkdownHovers;\n\t}\n\n\tprivate _findRangeOfMarkdownHoverParts(markdownHoverParticipant: MarkdownHoverParticipant): IOffsetRange {\n\t\tconst copiedRenderedParts = this._renderedParts.slice();\n\t\tconst firstIndexOfMarkdownHovers = copiedRenderedParts.findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst inversedLastIndexOfMarkdownHovers = copiedRenderedParts.reverse().findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst lastIndexOfMarkdownHovers = inversedLastIndexOfMarkdownHovers >= 0 ? copiedRenderedParts.length - inversedLastIndexOfMarkdownHovers : inversedLastIndexOfMarkdownHovers;\n\t\treturn { start: firstIndexOfMarkdownHovers, endExclusive: lastIndexOfMarkdownHovers + 1 };\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._fragment;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._fragment.hasChildNodes();\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedParts.length;\n\t}\n}\n"]}
|
|
@@ -229,6 +229,9 @@ let ContentHoverWidgetWrapper = class ContentHoverWidgetWrapper extends Disposab
|
|
|
229
229
|
if (isContentWidgetResizing) {
|
|
230
230
|
return true;
|
|
231
231
|
}
|
|
232
|
+
if (this._isMouseOnCodeActionWidget(mouseEvent)) {
|
|
233
|
+
return true;
|
|
234
|
+
}
|
|
232
235
|
const anchorCandidates = this._findHoverAnchorCandidates(mouseEvent);
|
|
233
236
|
const anchorCandidatesExist = anchorCandidates.length > 0;
|
|
234
237
|
if (!anchorCandidatesExist) {
|
|
@@ -271,6 +274,13 @@ let ContentHoverWidgetWrapper = class ContentHoverWidgetWrapper extends Disposab
|
|
|
271
274
|
anchorCandidates.sort((a, b) => b.priority - a.priority);
|
|
272
275
|
return anchorCandidates;
|
|
273
276
|
}
|
|
277
|
+
_isMouseOnCodeActionWidget(mouseEvent) {
|
|
278
|
+
const target = mouseEvent.event.browserEvent.target;
|
|
279
|
+
if (target instanceof Element && !!target.closest('.action-widget')) {
|
|
280
|
+
return true;
|
|
281
|
+
}
|
|
282
|
+
return false;
|
|
283
|
+
}
|
|
274
284
|
_onMouseLeave(e) {
|
|
275
285
|
const editorDomNode = this._editor.getDomNode();
|
|
276
286
|
const isMousePositionOutsideOfEditor = !editorDomNode || !isMousePositionWithinElement(editorDomNode, e.x, e.y);
|