monaco-editor-core 0.57.0 → 0.58.0-dev-20261104
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 +38 -6
- package/esm/vs/base/browser/browser.js +8 -0
- package/esm/vs/base/browser/browser.js.map +1 -1
- package/esm/vs/base/browser/contextmenu.js +8 -1
- package/esm/vs/base/browser/contextmenu.js.map +1 -1
- package/esm/vs/base/browser/dom.js +34 -5
- package/esm/vs/base/browser/dom.js.map +1 -1
- package/esm/vs/base/browser/dompurify/dompurify.js +2457 -2640
- package/esm/vs/base/browser/markdownRenderer.js +48 -21
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/pixelRatio.js +3 -2
- package/esm/vs/base/browser/pixelRatio.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 +7 -2
- package/esm/vs/base/browser/ui/actionbar/actionbar.js.map +1 -1
- package/esm/vs/base/browser/ui/animations/animations.js +68 -40
- package/esm/vs/base/browser/ui/animations/animations.js.map +1 -1
- package/esm/vs/base/browser/ui/button/button.js +7 -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.css +15 -0
- package/esm/vs/base/browser/ui/contextview/contextview.js +266 -40
- package/esm/vs/base/browser/ui/contextview/contextview.js.map +1 -1
- package/esm/vs/base/browser/ui/contextview/windowControlsOverlay.js +72 -0
- package/esm/vs/base/browser/ui/contextview/windowControlsOverlay.js.map +1 -0
- package/esm/vs/base/browser/ui/dialog/dialog.css +5 -0
- package/esm/vs/base/browser/ui/dropdown/dropdown.js +2 -1
- package/esm/vs/base/browser/ui/dropdown/dropdown.js.map +1 -1
- package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +1 -0
- package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js.map +1 -1
- package/esm/vs/base/browser/ui/hover/hover.js.map +1 -1
- package/esm/vs/base/browser/ui/list/listView.js +87 -15
- package/esm/vs/base/browser/ui/list/listView.js.map +1 -1
- package/esm/vs/base/browser/ui/list/listWidget.js +37 -15
- package/esm/vs/base/browser/ui/list/listWidget.js.map +1 -1
- package/esm/vs/base/browser/ui/menu/menu.js +189 -52
- package/esm/vs/base/browser/ui/menu/menu.js.map +1 -1
- package/esm/vs/base/browser/ui/radio/radio.css +11 -0
- package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js +2 -1
- 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 +14 -8
- package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js.map +1 -1
- package/esm/vs/base/browser/ui/splitview/splitview.js +11 -7
- package/esm/vs/base/browser/ui/splitview/splitview.js.map +1 -1
- package/esm/vs/base/browser/ui/toggle/switch.css +16 -7
- package/esm/vs/base/browser/ui/toggle/switch.js +9 -6
- package/esm/vs/base/browser/ui/toggle/switch.js.map +1 -1
- package/esm/vs/base/browser/ui/toolbar/toolbar.css +1 -2
- package/esm/vs/base/browser/ui/toolbar/toolbar.js +85 -38
- package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js +48 -9
- package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js +10 -1
- 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/actions.js +8 -2
- package/esm/vs/base/common/actions.js.map +1 -1
- package/esm/vs/base/common/arrays.js +4 -4
- package/esm/vs/base/common/arrays.js.map +1 -1
- package/esm/vs/base/common/async.js +12 -8
- package/esm/vs/base/common/async.js.map +1 -1
- package/esm/vs/base/common/cancellation.js +25 -0
- package/esm/vs/base/common/cancellation.js.map +1 -1
- package/esm/vs/base/common/codicons.js +2 -0
- package/esm/vs/base/common/codicons.js.map +1 -1
- package/esm/vs/base/common/codiconsLibrary.js +2 -0
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/base/common/color.js +1 -1
- package/esm/vs/base/common/color.js.map +1 -1
- package/esm/vs/base/common/diff/diff.js +60 -1
- package/esm/vs/base/common/diff/diff.js.map +1 -1
- package/esm/vs/base/common/event.js +1 -1
- package/esm/vs/base/common/event.js.map +1 -1
- package/esm/vs/base/common/glob.js +1 -0
- package/esm/vs/base/common/glob.js.map +1 -1
- package/esm/vs/base/common/htmlContent.js +74 -12
- package/esm/vs/base/common/htmlContent.js.map +1 -1
- package/esm/vs/base/common/json.js +19 -0
- package/esm/vs/base/common/json.js.map +1 -0
- package/esm/vs/base/common/network.js +16 -0
- package/esm/vs/base/common/network.js.map +1 -1
- package/esm/vs/base/common/resources.js +14 -2
- package/esm/vs/base/common/resources.js.map +1 -1
- package/esm/vs/base/common/strings.js +1 -1
- package/esm/vs/base/common/strings.js.map +1 -1
- package/esm/vs/base/common/uri.js +2 -2
- 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 +19 -6
- package/esm/vs/editor/browser/config/fontMeasurements.js.map +1 -1
- package/esm/vs/editor/browser/controller/dragScrolling.js +3 -3
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js +11 -5
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +8 -38
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/screenReaderContentRich.js +3 -3
- package/esm/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +6 -6
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +12 -10
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/mouseHandler.js +7 -7
- package/esm/vs/editor/browser/controller/mouseTarget.js +3 -3
- package/esm/vs/editor/browser/coreCommands.js +2 -2
- package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
- package/esm/vs/editor/browser/editorMarkdownSanitizer.js +19 -0
- package/esm/vs/editor/browser/editorMarkdownSanitizer.js.map +1 -0
- package/esm/vs/editor/browser/gpu/rectangleRenderer.js +1 -1
- package/esm/vs/editor/browser/gpu/viewGpuContext.js +1 -1
- package/esm/vs/editor/browser/observableCodeEditor.js +1 -1
- package/esm/vs/editor/browser/services/editorWorkerService.js +3 -2
- package/esm/vs/editor/browser/services/editorWorkerService.js.map +1 -1
- package/esm/vs/editor/browser/services/openerService.js +6 -2
- package/esm/vs/editor/browser/services/openerService.js.map +1 -1
- package/esm/vs/editor/browser/view/domLineBreaksComputer.js +34 -11
- package/esm/vs/editor/browser/view/domLineBreaksComputer.js.map +1 -1
- package/esm/vs/editor/browser/view/viewController.js +7 -7
- package/esm/vs/editor/browser/view/viewController.js.map +1 -1
- 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 +5 -5
- package/esm/vs/editor/browser/viewParts/blockDecorations/blockDecorations.js +1 -1
- package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +11 -3
- package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js +6 -6
- package/esm/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.js +12 -12
- package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +9 -2
- package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/indentGuides/indentGuides.js +2 -2
- package/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.js +2 -2
- 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 +6 -6
- package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js +9 -2
- package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.js +5 -5
- package/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js +3 -3
- package/esm/vs/editor/browser/viewParts/rulers/rulers.js +2 -2
- package/esm/vs/editor/browser/viewParts/rulersGpu/rulersGpu.js +1 -1
- package/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js +3 -3
- package/esm/vs/editor/browser/viewParts/selections/selections.js +2 -2
- package/esm/vs/editor/browser/viewParts/viewCursors/viewCursor.js +2 -2
- package/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.js +6 -6
- package/esm/vs/editor/browser/viewParts/viewLines/viewLineOptions.js +5 -5
- package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js +11 -11
- 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 +4 -4
- package/esm/vs/editor/browser/viewParts/wordWrapIndicator/wordWrapIndicator.js +2 -2
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +22 -21
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/commands.js +12 -12
- package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +18 -18
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +3 -3
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +10 -10
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +4 -4
- package/esm/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js +21 -3
- package/esm/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +10 -10
- package/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/features/overviewRulerFeature.js +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/multiDiffEditor/colors.js +3 -3
- package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollLayout.js +2 -2
- package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollLayout.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollView.js +21 -2
- package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollView.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +2 -2
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +11 -3
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/virtualizedItemManager.js +1 -0
- package/esm/vs/editor/browser/widget/multiDiffEditor/virtualizedItemManager.js.map +1 -1
- package/esm/vs/editor/common/commands/columnSelectionPasteCommand.js +64 -0
- package/esm/vs/editor/common/commands/columnSelectionPasteCommand.js.map +1 -0
- package/esm/vs/editor/common/config/editorConfigurationSchema.js +68 -58
- package/esm/vs/editor/common/config/editorConfigurationSchema.js.map +1 -1
- package/esm/vs/editor/common/config/editorOptions.js +560 -500
- package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
- package/esm/vs/editor/common/core/editorColorRegistry.js +71 -71
- package/esm/vs/editor/common/core/edits/textEdit.js +16 -0
- package/esm/vs/editor/common/core/edits/textEdit.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursor.js +20 -10
- package/esm/vs/editor/common/cursor/cursor.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursorTypeEditOperations.js +67 -14
- package/esm/vs/editor/common/cursor/cursorTypeEditOperations.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursorTypeOperations.js +2 -2
- package/esm/vs/editor/common/cursor/cursorTypeOperations.js.map +1 -1
- package/esm/vs/editor/common/cursorCommon.js +22 -21
- package/esm/vs/editor/common/cursorCommon.js.map +1 -1
- package/esm/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js +21 -8
- package/esm/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js.map +1 -1
- package/esm/vs/editor/common/diff/documentDiffProvider.js.map +1 -1
- package/esm/vs/editor/common/diff/externalLinesDiffComputer.js +38 -26
- package/esm/vs/editor/common/diff/externalLinesDiffComputer.js.map +1 -1
- package/esm/vs/editor/common/diff/rangeMapping.js +11 -1
- package/esm/vs/editor/common/diff/rangeMapping.js.map +1 -1
- package/esm/vs/editor/common/diff/verifyLinesDiff.js +28 -0
- package/esm/vs/editor/common/diff/verifyLinesDiff.js.map +1 -0
- package/esm/vs/editor/common/editorContextKeys.js +53 -53
- package/esm/vs/editor/common/languages/languageConfiguration.js +8 -0
- package/esm/vs/editor/common/languages/languageConfiguration.js.map +1 -1
- package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
- package/esm/vs/editor/common/languages.js +56 -56
- package/esm/vs/editor/common/model/editStack.js +1 -1
- package/esm/vs/editor/common/services/editorWebWorker.js +27 -6
- package/esm/vs/editor/common/services/editorWebWorker.js.map +1 -1
- package/esm/vs/editor/common/services/editorWorker.js.map +1 -1
- package/esm/vs/editor/common/services/languageService.js +6 -4
- package/esm/vs/editor/common/services/languageService.js.map +1 -1
- package/esm/vs/editor/common/services/markerDecorationsService.js +21 -2
- package/esm/vs/editor/common/services/markerDecorationsService.js.map +1 -1
- package/esm/vs/editor/common/standalone/standaloneEnums.js +100 -97
- 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/textModelEditSource.js +9 -0
- package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
- package/esm/vs/editor/common/viewLayout/viewLayout.js +16 -16
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
- package/esm/vs/editor/common/viewModel/monospaceLineBreaksComputer.js +1 -1
- package/esm/vs/editor/common/viewModel/viewModelImpl.js +19 -19
- package/esm/vs/editor/common/viewModel/viewModelImpl.js.map +1 -1
- package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
- package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +9 -9
- 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 -20
- 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 +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
- package/esm/vs/editor/contrib/codeAction/browser/codeActionModel.js +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 +25 -10
- package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.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 +1 -1
- package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +17 -17
- 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 +39 -39
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
- 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/pasteEditSession.js +19 -0
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/pasteEditSession.js.map +1 -0
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +26 -18
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js.map +1 -1
- package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
- package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js.map +1 -1
- package/esm/vs/editor/contrib/find/browser/findController.js +18 -18
- package/esm/vs/editor/contrib/find/browser/findController.js.map +1 -1
- package/esm/vs/editor/contrib/find/browser/findModel.js +6 -6
- package/esm/vs/editor/contrib/find/browser/findWidget.js +40 -40
- package/esm/vs/editor/contrib/find/browser/findWidget.js.map +1 -1
- package/esm/vs/editor/contrib/folding/browser/folding.js +23 -23
- package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
- 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 +14 -14
- package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +2 -2
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +4 -4
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js.map +1 -1
- 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 +9 -3
- package/esm/vs/editor/contrib/hover/browser/contentHoverController.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/glyphHoverController.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js +2 -1
- package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.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 +10 -8
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +6 -6
- 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 +5 -5
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +9 -9
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.js +3 -3
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.js.map +1 -1
- 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 +7 -7
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +6 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +7 -7
- 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 +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/theme.js +20 -20
- package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
- package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +32 -32
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +5 -4
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js.map +1 -1
- package/esm/vs/editor/contrib/links/browser/links.js +16 -15
- package/esm/vs/editor/contrib/links/browser/links.js.map +1 -1
- package/esm/vs/editor/contrib/longLinesHelper/browser/longLinesHelper.js +1 -1
- package/esm/vs/editor/contrib/message/browser/messageController.js +16 -12
- package/esm/vs/editor/contrib/message/browser/messageController.js.map +1 -1
- package/esm/vs/editor/contrib/middleScroll/browser/middleScrollController.js +1 -1
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +91 -55
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js.map +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsModel.js +3 -3
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsModel.js.map +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +6 -4
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js.map +1 -1
- 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/placeholderText/browser/placeholderTextContribution.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 +3 -3
- package/esm/vs/editor/contrib/rename/browser/rename.js +11 -11
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
- package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js +6 -6
- package/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js +23 -13
- package/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js.map +1 -1
- package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +5 -5
- package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +5 -5
- package/esm/vs/editor/contrib/snippet/browser/snippetSession.js +2 -2
- 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 +10 -8
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js.map +1 -1
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.js +1 -1
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.js +2 -2
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +6 -6
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -9
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +15 -15
- package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/suggestModel.js +11 -11
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +27 -27
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +8 -6
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +5 -5
- package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +3 -3
- package/esm/vs/editor/contrib/suggest/browser/wordDistance.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 +27 -27
- package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider.js +1 -1
- package/esm/vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider.js.map +1 -1
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +50 -14
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js.map +1 -1
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +6 -6
- package/esm/vs/editor/editor.api.d.ts +133 -98
- package/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js +1 -1
- package/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js +5 -3
- package/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneCodeEditor.js +15 -1
- package/esm/vs/editor/standalone/browser/standaloneCodeEditor.js.map +1 -1
- package/esm/vs/nls.js.map +1 -1
- package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +72 -66
- 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 +434 -136
- package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
- package/esm/vs/platform/actionWidget/browser/actionWidget.css +74 -4
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +24 -26
- package/esm/vs/platform/actionWidget/browser/actionWidget.js.map +1 -1
- package/esm/vs/platform/actionWidget/browser/actionWidgetMotion.js +16 -0
- package/esm/vs/platform/actionWidget/browser/actionWidgetMotion.js.map +1 -0
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +15 -17
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js.map +1 -1
- package/esm/vs/platform/actions/browser/toolbar.js +25 -12
- package/esm/vs/platform/actions/browser/toolbar.js.map +1 -1
- package/esm/vs/platform/actions/common/actions.js +4 -2
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- package/esm/vs/platform/actions/common/menuService.js +15 -8
- package/esm/vs/platform/actions/common/menuService.js.map +1 -1
- package/esm/vs/platform/configuration/common/configuration.js +3 -1
- package/esm/vs/platform/configuration/common/configuration.js.map +1 -1
- package/esm/vs/platform/configuration/common/configurationModels.js +16 -11
- package/esm/vs/platform/configuration/common/configurationModels.js.map +1 -1
- package/esm/vs/platform/configuration/common/configurationRegistry.js +29 -27
- package/esm/vs/platform/configuration/common/configurationRegistry.js.map +1 -1
- package/esm/vs/platform/configuration/common/configurations.js +13 -1
- package/esm/vs/platform/configuration/common/configurations.js.map +1 -1
- package/esm/vs/platform/contextkey/browser/contextKeyService.js +2 -2
- package/esm/vs/platform/contextkey/browser/contextKeyService.js.map +1 -1
- package/esm/vs/platform/contextkey/common/contextkey.js +28 -14
- package/esm/vs/platform/contextkey/common/contextkey.js.map +1 -1
- package/esm/vs/platform/contextkey/common/contextkeys.js +10 -10
- package/esm/vs/platform/contextkey/common/scanner.js +5 -5
- package/esm/vs/platform/contextview/browser/contextMenuHandler.js +17 -4
- package/esm/vs/platform/contextview/browser/contextMenuHandler.js.map +1 -1
- package/esm/vs/platform/contextview/browser/contextMenuService.js +1 -1
- package/esm/vs/platform/contextview/browser/contextMenuService.js.map +1 -1
- package/esm/vs/platform/contextview/browser/contextView.js.map +1 -1
- package/esm/vs/platform/contextview/browser/contextViewService.js +7 -2
- package/esm/vs/platform/contextview/browser/contextViewService.js.map +1 -1
- package/esm/vs/platform/editor/common/editor.js +17 -0
- package/esm/vs/platform/editor/common/editor.js.map +1 -1
- package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
- package/esm/vs/platform/hover/browser/hoverService.js +6 -3
- package/esm/vs/platform/hover/browser/hoverService.js.map +1 -1
- package/esm/vs/platform/hover/browser/hoverWidget.js +38 -6
- package/esm/vs/platform/hover/browser/hoverWidget.js.map +1 -1
- package/esm/vs/platform/hover/browser/updatableHoverWidget.js +32 -5
- package/esm/vs/platform/hover/browser/updatableHoverWidget.js.map +1 -1
- package/esm/vs/platform/instantiation/common/instantiationService.js +1 -1
- package/esm/vs/platform/instantiation/common/instantiationService.js.map +1 -1
- package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +5 -5
- package/esm/vs/platform/keybinding/common/keybindingResolver.js +1 -1
- package/esm/vs/platform/keybinding/common/keybindingResolver.js.map +1 -1
- package/esm/vs/platform/list/browser/listService.js +27 -27
- package/esm/vs/platform/markers/common/markerService.js +11 -8
- package/esm/vs/platform/markers/common/markerService.js.map +1 -1
- package/esm/vs/platform/markers/common/markers.js +6 -6
- package/esm/vs/platform/markers/common/markers.js.map +1 -1
- package/esm/vs/platform/notification/common/notification.js.map +1 -1
- package/esm/vs/platform/notification/common/notificationMessage.js +37 -0
- package/esm/vs/platform/notification/common/notificationMessage.js.map +1 -0
- package/esm/vs/platform/opener/common/opener.js.map +1 -1
- package/esm/vs/platform/progress/common/progress.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
- package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
- package/esm/vs/platform/quickinput/browser/media/quickInput.css +33 -2
- package/esm/vs/platform/quickinput/browser/quickAccess.js +7 -4
- package/esm/vs/platform/quickinput/browser/quickAccess.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
- package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
- package/esm/vs/platform/quickinput/browser/quickInputController.js +65 -15
- package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputList.js +96 -90
- package/esm/vs/platform/quickinput/browser/quickInputList.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputService.js +5 -7
- package/esm/vs/platform/quickinput/browser/quickInputService.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/quickTree.js +1 -1
- package/esm/vs/platform/quickinput/common/quickAccess.js.map +1 -1
- package/esm/vs/platform/quickinput/common/quickInput.js.map +1 -1
- package/esm/vs/platform/storage/common/storage.js.map +1 -1
- package/esm/vs/platform/theme/common/colorRegistry.js +1 -0
- package/esm/vs/platform/theme/common/colorRegistry.js.map +1 -1
- package/esm/vs/platform/theme/common/colorUtils.js +11 -3
- package/esm/vs/platform/theme/common/colorUtils.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/baseColors.js +19 -19
- package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -9
- package/esm/vs/platform/theme/common/colors/chartsColors.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/confettiColors.js +14 -0
- package/esm/vs/platform/theme/common/colors/confettiColors.js.map +1 -0
- 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/inputColors.js.map +1 -1
- 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 +13 -13
- package/esm/vs/platform/theme/common/colors/minimapColors.js.map +1 -1
- 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/workspace/common/workspace.js +1 -1
- package/monaco.d.ts +133 -98
- package/package.json +3 -3
- package/version.txt +1 -1
|
@@ -25,6 +25,7 @@ import { Emitter } from '../../../../base/common/event.js';
|
|
|
25
25
|
import { isOnColorDecorator } from '../../colorPicker/browser/hoverColorPicker/hoverColorPicker.js';
|
|
26
26
|
import { isModifierKey } from '../../../../base/common/keyCodes.js';
|
|
27
27
|
import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js';
|
|
28
|
+
import { isHTMLElement } from '../../../../base/browser/dom.js';
|
|
28
29
|
// sticky hover widget which doesn't disappear on focus out and such
|
|
29
30
|
const _sticky = false;
|
|
30
31
|
let ContentHoverController = class ContentHoverController extends Disposable {
|
|
@@ -119,7 +120,8 @@ let ContentHoverController = class ContentHoverController extends Disposable {
|
|
|
119
120
|
if (!this._contentWidget || !this._contentWidget.getDomNode().isConnected) {
|
|
120
121
|
return false;
|
|
121
122
|
}
|
|
122
|
-
return
|
|
123
|
+
return this._contentWidget.containsNode(mouseEvent.event.target)
|
|
124
|
+
|| isMousePositionWithinElement(this._contentWidget.getDomNode(), mouseEvent.event.posx, mouseEvent.event.posy);
|
|
123
125
|
}
|
|
124
126
|
_onEditorMouseUp() {
|
|
125
127
|
if (this._ignoreMouseEvents) {
|
|
@@ -135,6 +137,10 @@ let ContentHoverController = class ContentHoverController extends Disposable {
|
|
|
135
137
|
return;
|
|
136
138
|
}
|
|
137
139
|
this._cancelScheduler();
|
|
140
|
+
const relatedTarget = mouseEvent.event.browserEvent.relatedTarget;
|
|
141
|
+
if (isHTMLElement(relatedTarget) && this._contentWidget?.containsNode(relatedTarget)) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
138
144
|
const shouldKeepHoverWidgetVisible = this._shouldKeepHoverWidgetVisible(mouseEvent);
|
|
139
145
|
if (shouldKeepHoverWidgetVisible) {
|
|
140
146
|
return;
|
|
@@ -213,7 +219,7 @@ let ContentHoverController = class ContentHoverController extends Disposable {
|
|
|
213
219
|
return isContentHoverWidgetVisible && this._hoverSettings.sticky && hidingDelay > 0;
|
|
214
220
|
}
|
|
215
221
|
_reactToEditorMouseMove(mouseEvent) {
|
|
216
|
-
if (shouldShowHover(this._hoverSettings.enabled, this._editor.getOption(
|
|
222
|
+
if (shouldShowHover(this._hoverSettings.enabled, this._editor.getOption(87 /* EditorOption.multiCursorModifier */), mouseEvent)) {
|
|
217
223
|
const contentWidget = this._getOrCreateContentWidget();
|
|
218
224
|
if (contentWidget.showsOrWillShow(mouseEvent)) {
|
|
219
225
|
return;
|
|
@@ -229,7 +235,7 @@ let ContentHoverController = class ContentHoverController extends Disposable {
|
|
|
229
235
|
return;
|
|
230
236
|
}
|
|
231
237
|
if (this._hoverSettings.enabled === 'onKeyboardModifier'
|
|
232
|
-
&& isTriggerModifierPressed(this._editor.getOption(
|
|
238
|
+
&& isTriggerModifierPressed(this._editor.getOption(87 /* EditorOption.multiCursorModifier */), e)
|
|
233
239
|
&& this._mouseMoveEvent) {
|
|
234
240
|
if (!this._contentWidget.isVisible) {
|
|
235
241
|
this._contentWidget.showsOrWillShow(this._mouseMoveEvent);
|
|
@@ -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,eAAe,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC1G,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAC;AACpG,OAAO,EAAE,aAAa,EAAW,MAAM,qCAAqC,CAA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AAW;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;;AAzWW,sBAAsB;IAsBhC,WAAA,mBAAmB,CAAA;IACnB,WAAA,qBAAqB,CAAA;IACrB,WAAA,kBAAkB,CAAA;GAxBR,sBAAsB,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"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vsc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AE,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;;AA9WW,sBAAsB;IAsBhC,WAAA,mBAAmB,CAAA;IACnB,WAAA,qBAAqB,CAAA;IACrB,WAAA,kBAAkB,CAAA;GAxBR,sBAAsB,CA+WlC","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';\nimport { isHTMLElement } from '../../../../base/browser/dom.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 this._contentWidget.containsNode(mouseEvent.event.target)\n\t\t\t|| 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 relatedTarget = mouseEvent.event.browserEvent.relatedTarget;\n\t\tif (isHTMLElement(relatedTarget) && this._contentWidget?.containsNode(relatedTarget)) {\n\t\t\treturn;\n\t\t}\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';\nimport { isHTMLElement } from '../../../../base/browser/dom.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 this._contentWidget.containsNode(mouseEvent.event.target)\n\t\t\t|| 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 relatedTarget = mouseEvent.event.browserEvent.relatedTarget;\n\t\tif (isHTMLElement(relatedTarget) && this._contentWidget?.containsNode(relatedTarget)) {\n\t\t\treturn;\n\t\t}\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"]}
|
|
@@ -130,7 +130,7 @@ let GlyphHoverController = class GlyphHoverController extends Disposable {
|
|
|
130
130
|
if (!mouseEvent) {
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
|
-
if (!shouldShowHover(this._hoverSettings.enabled, this._editor.getOption(
|
|
133
|
+
if (!shouldShowHover(this._hoverSettings.enabled, this._editor.getOption(87 /* EditorOption.multiCursorModifier */), mouseEvent)) {
|
|
134
134
|
if (_sticky) {
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
@@ -155,7 +155,7 @@ let GlyphHoverController = class GlyphHoverController extends Disposable {
|
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
157
|
if (this._hoverSettings.enabled === 'onKeyboardModifier'
|
|
158
|
-
&& isTriggerModifierPressed(this._editor.getOption(
|
|
158
|
+
&& isTriggerModifierPressed(this._editor.getOption(87 /* EditorOption.multiCursorModifier */), e)
|
|
159
159
|
&& this._mouseMoveEvent) {
|
|
160
160
|
this._tryShowHoverWidget(this._mouseMoveEvent);
|
|
161
161
|
return;
|
|
@@ -15,6 +15,7 @@ var GlyphHoverWidget_1;
|
|
|
15
15
|
import * as dom from '../../../../base/browser/dom.js';
|
|
16
16
|
import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';
|
|
17
17
|
import { IMarkdownRendererService } from '../../../../platform/markdown/browser/markdownRenderer.js';
|
|
18
|
+
import { getEditorMarkdownSanitizerConfig } from '../../../browser/editorMarkdownSanitizer.js';
|
|
18
19
|
import { HoverOperation } from './hoverOperation.js';
|
|
19
20
|
import { HoverWidget } from '../../../../base/browser/ui/hover/hoverWidget.js';
|
|
20
21
|
import { GlyphHoverComputer } from './glyphHoverComputer.js';
|
|
@@ -121,7 +122,7 @@ let GlyphHoverWidget = class GlyphHoverWidget extends Disposable {
|
|
|
121
122
|
for (const msg of messages) {
|
|
122
123
|
const markdownHoverElement = $('div.hover-row.markdown-hover');
|
|
123
124
|
const hoverContentsElement = dom.append(markdownHoverElement, $('div.hover-contents'));
|
|
124
|
-
const renderedContents = this._renderDisposeables.add(this._markdownRendererService.render(msg.value, { context: this._editor }));
|
|
125
|
+
const renderedContents = this._renderDisposeables.add(this._markdownRendererService.render(msg.value, { context: this._editor, sanitizerConfig: getEditorMarkdownSanitizerConfig(this._editor) }));
|
|
125
126
|
hoverContentsElement.appendChild(renderedContents.element);
|
|
126
127
|
fragment.appendChild(markdownHoverElement);
|
|
127
128
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/hover/browser/glyphHoverWidget.ts","vs/editor/contrib/hover/browser/glyphHoverWidget.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,KAAK,GAAG,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,2DAA2D,CAAC;AAGrG,OAAO,EAAE,cAAc,EAA+B,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AAE/E,OAAO,EAAmC,kBAAkB,EAA6B,MAAM,yBAAyB,CAAC;AACzH,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAE/D,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AAET,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;;aAExB,OAAE,GAAG,sCAAH,AAAyC,CAAC;IAcnE,YACC,MAAmB,EACO,wB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AAU,EAAE,CAAC;QAChD,MAAM,8BAA8B,GAAG,CAAC,aAAa,IAAI,CAAC,4BAA4B,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAChH,IAAI,8BAA8B,EAAE,CAAC;YACpC,IAAI,CAAC,IAAI,EAAE,CAAC;QACb,CAAC;IACF,CAAC;;AA9LW,gBAAgB;IAkB1B,WAAA,wBAAwB,CAAA;GAlBd,gBAAgB,CA+L5B","file":"glyphHoverWidget.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 * as dom from '../../../../base/browser/dom.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { IMarkdownRendererService } from '../../../../platform/markdown/browser/markdownRenderer.js';\nimport { ICodeEditor, IEditorMouseEvent, IOverlayWidget, IOverlayWidgetPosition, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js';\nimport { HoverOperation, HoverResult, HoverStartMode } from './hoverOperation.js';\nimport { HoverWidget } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverWidget } from './hoverTypes.js';\nimport { IHoverMessage, LaneOrLineNumber, GlyphHoverComputer, GlyphHoverComputerOptions } from './glyphHoverComputer.js';\nimport { isMousePositionWithinElement } from './hoverUtils.js';\n\nconst $ = dom.$;\n\nexport class GlyphHoverWidget extends Disposable implements IOverlayWidget, IHoverWidget {\n\n\tpublic static readonly ID = 'editor.contrib.modesGlyphHoverWidget';\n\tpublic readonly allowEditorOverflow = true;\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _hover: HoverWidget;\n\n\tprivate _isVisible: boolean;\n\tprivate _messages: IHoverMessage[];\n\n\tprivate readonly _hoverOperation: HoverOperation<GlyphHoverComputerOptions, IHoverMessage>;\n\tprivate readonly _renderDisposeables = this._register(new DisposableStore());\n\n\tprivate _hoverComputerOptions: GlyphHoverComputerOptions | undefined;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IMarkdownRendererService private readonly _markdownRendererService: IMarkdownRendererService,\n\t) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\n\t\tthis._isVisible = false;\n\t\tthis._messages = [];\n\n\t\tthis._hover = this._register(new HoverWidget(true));\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\n\t\tthis._hoverOperation = this._register(new HoverOperation(this._editor, new GlyphHoverComputer(this._editor)));\n\t\tthis._register(this._hoverOperation.onResult((result) => this._withResult(result)));\n\n\t\tthis._register(this._editor.onDidChangeModelDecorations(() => this._onModelDecorationsChanged()));\n\t\tthis._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {\n\t\t\tif (e.hasChanged(EditorOption.fontInfo)) {\n\t\t\t\tthis._updateFont();\n\t\t\t}\n\t\t}));\n\t\tthis._register(dom.addStandardDisposableListener(this._hover.containerDomNode, 'mouseleave', (e) => {\n\t\t\tthis._onMouseLeave(e);\n\t\t}));\n\t\tthis._editor.addOverlayWidget(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._hoverComputerOptions = undefined;\n\t\tthis._editor.removeOverlayWidget(this);\n\t\tsuper.dispose();\n\t}\n\n\tpublic getId(): string {\n\t\treturn GlyphHoverWidget.ID;\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._hover.containerDomNode;\n\t}\n\n\tpublic getPosition(): IOverlayWidgetPosition | null {\n\t\treturn null;\n\t}\n\n\tprivate _updateFont(): void {\n\t\t// eslint-disable-next-line no-restricted-syntax\n\t\tconst codeClasses: HTMLElement[] = Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName('code'));\n\t\tcodeClasses.forEach(node => this._editor.applyFontInfo(node));\n\t}\n\n\tprivate _onModelDecorationsChanged(): void {\n\t\tif (this._isVisible && this._hoverComputerOptions) {\n\t\t\t// The decorations have changed and the hover is visible,\n\t\t\t// we need to recompute the displayed text\n\t\t\tthis._hoverOperation.cancel();\n\t\t\tthis._hoverOperation.start(HoverStartMode.Delayed, this._hoverComputerOptions);\n\t\t}\n\t}\n\n\tpublic showsOrWillShow(mouseEvent: IEditorMouseEvent): boolean {\n\t\tconst target = mouseEvent.target;\n\t\tif (target.type === MouseTargetType.GUTTER_GLYPH_MARGIN && target.detail.glyphMarginLane) {\n\t\t\tthis._startShowingAt(target.position.lineNumber, target.detail.glyphMarginLane);\n\t\t\treturn true;\n\t\t}\n\t\tif (target.type === MouseTargetType.GUTTER_LINE_NUMBERS) {\n\t\t\tthis._startShowingAt(target.position.lineNumber, 'lineNo');\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _startShowingAt(lineNumber: number, laneOrLine: LaneOrLineNumber): void {\n\t\tif (this._hoverComputerOptions\n\t\t\t&& this._hoverComputerOptions.lineNumber === lineNumber\n\t\t\t&& this._hoverComputerOptions.laneOrLine === laneOrLine) {\n\t\t\t// We have to show the widget at the exact same line number as before, so no work is needed\n\t\t\treturn;\n\t\t}\n\t\tthis._hoverOperation.cancel();\n\t\tthis.hide();\n\t\tthis._hoverComputerOptions = { lineNumber, laneOrLine };\n\t\tthis._hoverOperation.start(HoverStartMode.Delayed, this._hoverComputerOptions);\n\t}\n\n\tpublic hide(): void {\n\t\tthis._hoverComputerOptions = undefined;\n\t\tthis._hoverOperation.cancel();\n\t\tif (!this._isVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isVisible = false;\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\t}\n\n\tprivate _withResult(result: HoverResult<GlyphHoverComputerOptions, IHoverMessage>): void {\n\t\tthis._messages = result.value;\n\n\t\tif (this._messages.length > 0) {\n\t\t\tthis._renderMessages(result.options.lineNumber, result.options.laneOrLine, this._messages);\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}\n\n\tprivate _renderMessages(lineNumber: number, laneOrLine: LaneOrLineNumber, messages: IHoverMessage[]): void {\n\t\tthis._renderDisposeables.clear();\n\n\t\tconst fragment = document.createDocumentFragment();\n\n\t\tfor (const msg of messages) {\n\t\t\tconst markdownHoverElement = $('div.hover-row.markdown-hover');\n\t\t\tconst hoverContentsElement = dom.append(markdownHoverElement, $('div.hover-contents'));\n\t\t\tconst renderedContents = this._renderDisposeables.add(this._markdownRendererService.render(msg.value, { context: this._editor }));\n\t\t\thoverContentsElement.appendChild(renderedContents.element);\n\t\t\tfragment.appendChild(markdownHoverElement);\n\t\t}\n\n\t\tthis._updateContents(fragment);\n\t\tthis._showAt(lineNumber, laneOrLine);\n\t}\n\n\tprivate _updateContents(node: Node): void {\n\t\tthis._hover.contentsDomNode.textContent = '';\n\t\tthis._hover.contentsDomNode.appendChild(node);\n\t\tthis._updateFont();\n\t}\n\n\tprivate _showAt(lineNumber: number, laneOrLine: LaneOrLineNumber): void {\n\t\tif (!this._isVisible) {\n\t\t\tthis._isVisible = true;\n\t\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\t\t}\n\n\t\tconst editorLayout = this._editor.getLayoutInfo();\n\t\tconst topForLineNumber = this._editor.getTopForLineNumber(lineNumber);\n\t\tconst editorScrollTop = this._editor.getScrollTop();\n\t\tconst lineHeight = this._editor.getOption(EditorOption.lineHeight);\n\t\tconst nodeHeight = this._hover.containerDomNode.clientHeight;\n\t\tconst top = topForLineNumber - editorScrollTop - ((nodeHeight - lineHeight) / 2);\n\t\tconst left = editorLayout.glyphMarginLeft + editorLayout.glyphMarginWidth + (laneOrLine === 'lineNo' ? editorLayout.lineNumbersWidth : 0);\n\n\t\t// Constrain the hover widget to stay within the editor bounds\n\t\tconst editorHeight = editorLayout.height;\n\t\tconst maxTop = editorHeight - nodeHeight;\n\t\tconst constrainedTop = Math.max(0, Math.min(Math.round(top), maxTop));\n\n\t\tconst fixedOverflowWidgets = this._editor.getOption(EditorOption.fixedOverflowWidgets);\n\t\tif (fixedOverflowWidgets) {\n\t\t\t// Use fixed positioning relative to the viewport\n\t\t\tconst editorDomNode = this._editor.getDomNode();\n\t\t\tif (editorDomNode) {\n\t\t\t\tconst editorRect = dom.getDomNodePagePosition(editorDomNode);\n\t\t\t\tthis._hover.containerDomNode.style.position = 'fixed';\n\t\t\t\tthis._hover.containerDomNode.style.left = `${editorRect.left + left}px`;\n\t\t\t\tthis._hover.containerDomNode.style.top = `${editorRect.top + constrainedTop}px`;\n\t\t\t}\n\t\t} else {\n\t\t\t// Use absolute positioning relative to the editor\n\t\t\tthis._hover.containerDomNode.style.position = 'absolute';\n\t\t\tthis._hover.containerDomNode.style.left = `${left}px`;\n\t\t\tthis._hover.containerDomNode.style.top = `${constrainedTop}px`;\n\t\t}\n\t\tthis._hover.containerDomNode.style.zIndex = '11'; // 1 more than the zone widget at 10 (#233819)\n\t}\n\n\tprivate _onMouseLeave(e: MouseEvent): void {\n\t\tconst editorDomNode = this._editor.getDomNode();\n\t\tconst isMousePositionOutsideOfEditor = !editorDomNode || !isMousePositionWithinElement(editorDomNode, e.x, e.y);\n\t\tif (isMousePositionOutsideOfEditor) {\n\t\t\tthis.hide();\n\t\t}\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 * as dom from '../../../../base/browser/dom.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { IMarkdownRendererService } from '../../../../platform/markdown/browser/markdownRenderer.js';\nimport { ICodeEditor, IEditorMouseEvent, IOverlayWidget, IOverlayWidgetPosition, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js';\nimport { HoverOperation, HoverResult, HoverStartMode } from './hoverOperation.js';\nimport { HoverWidget } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverWidget } from './hoverTypes.js';\nimport { IHoverMessage, LaneOrLineNumber, GlyphHoverComputer, GlyphHoverComputerOptions } from './glyphHoverComputer.js';\nimport { isMousePositionWithinElement } from './hoverUtils.js';\n\nconst $ = dom.$;\n\nexport class GlyphHoverWidget extends Disposable implements IOverlayWidget, IHoverWidget {\n\n\tpublic static readonly ID = 'editor.contrib.modesGlyphHoverWidget';\n\tpublic readonly allowEditorOverflow = true;\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _hover: HoverWidget;\n\n\tprivate _isVisible: boolean;\n\tprivate _messages: IHoverMessage[];\n\n\tprivate readonly _hoverOperation: HoverOperation<GlyphHoverComputerOptions, IHoverMessage>;\n\tprivate readonly _renderDisposeables = this._register(new DisposableStore());\n\n\tprivate _hoverComputerOptions: GlyphHoverComputerOptions | undefined;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IMarkdownRendererService private readonly _markdownRendererService: IMarkdownRendererService,\n\t) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\n\t\tthis._isVisible = false;\n\t\tthis._messages = [];\n\n\t\tthis._hover = this._register(new HoverWidget(true));\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\n\t\tthis._hoverOperation = this._register(new HoverOperation(this._editor, new GlyphHoverComputer(this._editor)));\n\t\tthis._register(this._hoverOperation.onResult((result) => this._withResult(result)));\n\n\t\tthis._register(this._editor.onDidChangeModelDecorations(() => this._onModelDecorationsChanged()));\n\t\tthis._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {\n\t\t\tif (e.hasChanged(EditorOption.fontInfo)) {\n\t\t\t\tthis._updateFont();\n\t\t\t}\n\t\t}));\n\t\tthis._register(dom.addStandardDisposableListener(this._hover.containerDomNode, 'mouseleave', (e) => {\n\t\t\tthis._onMouseLeave(e);\n\t\t}));\n\t\tthis._editor.addOverlayWidget(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._hoverComputerOptions = undefined;\n\t\tthis._editor.removeOverlayWidget(this);\n\t\tsuper.dispose();\n\t}\n\n\tpublic getId(): string {\n\t\treturn GlyphHoverWidget.ID;\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._hover.containerDomNode;\n\t}\n\n\tpublic getPosition(): IOverlayWidgetPosition | null {\n\t\treturn null;\n\t}\n\n\tprivate _updateFont(): void {\n\t\t// eslint-disable-next-line no-restricted-syntax\n\t\tconst codeClasses: HTMLElement[] = Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName('code'));\n\t\tcodeClasses.forEach(node => this._editor.applyFontInfo(node));\n\t}\n\n\tprivate _onModelDecorationsChanged(): void {\n\t\tif (this._isVisible && this._hoverComputerOptions) {\n\t\t\t// The decorations have changed and the hover is visible,\n\t\t\t// we need to recompute the displayed text\n\t\t\tthis._hoverOperation.cancel();\n\t\t\tthis._hoverOperation.start(HoverStartMode.Delayed, this._hoverComputerOptions);\n\t\t}\n\t}\n\n\tpublic showsOrWillShow(mouseEvent: IEditorMouseEvent): boolean {\n\t\tconst target = mouseEvent.target;\n\t\tif (target.type === MouseTargetType.GUTTER_GLYPH_MARGIN && target.detail.glyphMarginLane) {\n\t\t\tthis._startShowingAt(target.position.lineNumber, target.detail.glyphMarginLane);\n\t\t\treturn true;\n\t\t}\n\t\tif (target.type === MouseTargetType.GUTTER_LINE_NUMBERS) {\n\t\t\tthis._startShowingAt(target.position.lineNumber, 'lineNo');\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _startShowingAt(lineNumber: number, laneOrLine: LaneOrLineNumber): void {\n\t\tif (this._hoverComputerOptions\n\t\t\t&& this._hoverComputerOptions.lineNumber === lineNumber\n\t\t\t&& this._hoverComputerOptions.laneOrLine === laneOrLine) {\n\t\t\t// We have to show the widget at the exact same line number as before, so no work is needed\n\t\t\treturn;\n\t\t}\n\t\tthis._hoverOperation.cancel();\n\t\tthis.hide();\n\t\tthis._hoverComputerOptions = { lineNumber, laneOrLine };\n\t\tthis._hoverOperation.start(HoverStartMode.Delayed, this._hoverComputerOptions);\n\t}\n\n\tpublic hide(): void {\n\t\tthis._hoverComputerOptions = undefined;\n\t\tthis._hoverOperation.cancel();\n\t\tif (!this._isVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isVisible = false;\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\t}\n\n\tprivate _withResult(result: HoverResult<GlyphHoverComputerOptions, IHoverMessage>): void {\n\t\tthis._messages = result.value;\n\n\t\tif (this._messages.length > 0) {\n\t\t\tthis._renderMessages(result.options.lineNumber, result.options.laneOrLine, this._messages);\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}\n\n\tprivate _renderMessages(lineNumber: number, laneOrLine: LaneOrLineNumber, messages: IHoverMessage[]): void {\n\t\tthis._renderDisposeables.clear();\n\n\t\tconst fragment = document.createDocumentFragment();\n\n\t\tfor (const msg of messages) {\n\t\t\tconst markdownHoverElement = $('div.hover-row.markdown-hover');\n\t\t\tconst hoverContentsElement = dom.append(markdownHoverElement, $('div.hover-contents'));\n\t\t\tconst renderedContents = this._renderDisposeables.add(this._markdownRendererService.render(msg.value, { context: this._editor }));\n\t\t\thoverContentsElement.appendChild(renderedContents.element);\n\t\t\tfragment.appendChild(markdownHoverElement);\n\t\t}\n\n\t\tthis._updateContents(fragment);\n\t\tthis._showAt(lineNumber, laneOrLine);\n\t}\n\n\tprivate _updateContents(node: Node): void {\n\t\tthis._hover.contentsDomNode.textContent = '';\n\t\tthis._hover.contentsDomNode.appendChild(node);\n\t\tthis._updateFont();\n\t}\n\n\tprivate _showAt(lineNumber: number, laneOrLine: LaneOrLineNumber): void {\n\t\tif (!this._isVisible) {\n\t\t\tthis._isVisible = true;\n\t\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\t\t}\n\n\t\tconst editorLayout = this._editor.getLayoutInfo();\n\t\tconst topForLineNumber = this._editor.getTopForLineNumber(lineNumber);\n\t\tconst editorScrollTop = this._editor.getScrollTop();\n\t\tconst lineHeight = this._editor.getOption(EditorOption.lineHeight);\n\t\tconst nodeHeight = this._hover.containerDomNode.clientHeight;\n\t\tconst top = topForLineNumber - editorScrollTop - ((nodeHeight - lineHeight) / 2);\n\t\tconst left = editorLayout.glyphMarginLeft + editorLayout.glyphMarginWidth + (laneOrLine === 'lineNo' ? editorLayout.lineNumbersWidth : 0);\n\n\t\t// Constrain the hover widget to stay within the editor bounds\n\t\tconst editorHeight = editorLayout.height;\n\t\tconst maxTop = editorHeight - nodeHeight;\n\t\tconst constrainedTop = Math.max(0, Math.min(Math.round(top), maxTop));\n\n\t\tconst fixedOverflowWidgets = this._editor.getOption(EditorOption.fixedOverflowWidgets);\n\t\tif (fixedOverflowWidgets) {\n\t\t\t// Use fixed positioning relative to the viewport\n\t\t\tconst editorDomNode = this._editor.getDomNode();\n\t\t\tif (editorDomNode) {\n\t\t\t\tconst editorRect = dom.getDomNodePagePosition(editorDomNode);\n\t\t\t\tthis._hover.containerDomNode.style.position = 'fixed';\n\t\t\t\tthis._hover.containerDomNode.style.left = `${editorRect.left + left}px`;\n\t\t\t\tthis._hover.containerDomNode.style.top = `${editorRect.top + constrainedTop}px`;\n\t\t\t}\n\t\t} else {\n\t\t\t// Use absolute positioning relative to the editor\n\t\t\tthis._hover.containerDomNode.style.position = 'absolute';\n\t\t\tthis._hover.containerDomNode.style.left = `${left}px`;\n\t\t\tthis._hover.containerDomNode.style.top = `${constrainedTop}px`;\n\t\t}\n\t\tthis._hover.containerDomNode.style.zIndex = '11'; // 1 more than the zone widget at 10 (#233819)\n\t}\n\n\tprivate _onMouseLeave(e: MouseEvent): void {\n\t\tconst editorDomNode = this._editor.getDomNode();\n\t\tconst isMousePositionOutsideOfEditor = !editorDomNode || !isMousePositionWithinElement(editorDomNode, e.x, e.y);\n\t\tif (isMousePositionOutsideOfEditor) {\n\t\t\tthis.hide();\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/hover/browser/glyphHoverWidget.ts","vs/editor/contrib/hover/browser/glyphHoverWidget.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,KAAK,GAAG,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,2DAA2D,CAAC;AAErG,OAAO,EAAE,gCAAgC,EAAE,MAAM,6CAA6C,CAAC;AAE/F,OAAO,EAAE,cAAc,EAA+B,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AAE/E,OAAO,EAAmC,kBAAkB,EAA6B,MAAM,yBAAyB,CAAC;AACzH,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAE/D,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AAET,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;;aAExB,OAAE,GAAG,sCAAH,AAAyC,CAAC;IAcnE,YACC,MAAmB,EACO,wBAAmE;QAE7F,KAAK,EAAE,CAAC;QAFmC,6BAAwB,GAAxB,wBAAwB,CAA0B;QAf9E,wBAAmB,GAAG,IAAI,CAAC;QAS1B,wBAAmB,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,eAAe,EAAE,CAAC,CAAC;QAS5E,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAEtB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QAEpB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;QACpD,IAAI,CAAC,MAAM,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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 * as dom from '../../../../base/browser/dom.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { IMarkdownRendererService } from '../../../../platform/markdown/browser/markdownRenderer.js';\nimport { ICodeEditor, IEditorMouseEvent, IOverlayWidget, IOverlayWidgetPosition, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { getEditorMarkdownSanitizerConfig } from '../../../browser/editorMarkdownSanitizer.js';\nimport { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js';\nimport { HoverOperation, HoverResult, HoverStartMode } from './hoverOperation.js';\nimport { HoverWidget } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverWidget } from './hoverTypes.js';\nimport { IHoverMessage, LaneOrLineNumber, GlyphHoverComputer, GlyphHoverComputerOptions } from './glyphHoverComputer.js';\nimport { isMousePositionWithinElement } from './hoverUtils.js';\n\nconst $ = dom.$;\n\nexport class GlyphHoverWidget extends Disposable implements IOverlayWidget, IHoverWidget {\n\n\tpublic static readonly ID = 'editor.contrib.modesGlyphHoverWidget';\n\tpublic readonly allowEditorOverflow = true;\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _hover: HoverWidget;\n\n\tprivate _isVisible: boolean;\n\tprivate _messages: IHoverMessage[];\n\n\tprivate readonly _hoverOperation: HoverOperation<GlyphHoverComputerOptions, IHoverMessage>;\n\tprivate readonly _renderDisposeables = this._register(new DisposableStore());\n\n\tprivate _hoverComputerOptions: GlyphHoverComputerOptions | undefined;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IMarkdownRendererService private readonly _markdownRendererService: IMarkdownRendererService,\n\t) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\n\t\tthis._isVisible = false;\n\t\tthis._messages = [];\n\n\t\tthis._hover = this._register(new HoverWidget(true));\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\n\t\tthis._hoverOperation = this._register(new HoverOperation(this._editor, new GlyphHoverComputer(this._editor)));\n\t\tthis._register(this._hoverOperation.onResult((result) => this._withResult(result)));\n\n\t\tthis._register(this._editor.onDidChangeModelDecorations(() => this._onModelDecorationsChanged()));\n\t\tthis._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {\n\t\t\tif (e.hasChanged(EditorOption.fontInfo)) {\n\t\t\t\tthis._updateFont();\n\t\t\t}\n\t\t}));\n\t\tthis._register(dom.addStandardDisposableListener(this._hover.containerDomNode, 'mouseleave', (e) => {\n\t\t\tthis._onMouseLeave(e);\n\t\t}));\n\t\tthis._editor.addOverlayWidget(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._hoverComputerOptions = undefined;\n\t\tthis._editor.removeOverlayWidget(this);\n\t\tsuper.dispose();\n\t}\n\n\tpublic getId(): string {\n\t\treturn GlyphHoverWidget.ID;\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._hover.containerDomNode;\n\t}\n\n\tpublic getPosition(): IOverlayWidgetPosition | null {\n\t\treturn null;\n\t}\n\n\tprivate _updateFont(): void {\n\t\t// eslint-disable-next-line no-restricted-syntax\n\t\tconst codeClasses: HTMLElement[] = Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName('code'));\n\t\tcodeClasses.forEach(node => this._editor.applyFontInfo(node));\n\t}\n\n\tprivate _onModelDecorationsChanged(): void {\n\t\tif (this._isVisible && this._hoverComputerOptions) {\n\t\t\t// The decorations have changed and the hover is visible,\n\t\t\t// we need to recompute the displayed text\n\t\t\tthis._hoverOperation.cancel();\n\t\t\tthis._hoverOperation.start(HoverStartMode.Delayed, this._hoverComputerOptions);\n\t\t}\n\t}\n\n\tpublic showsOrWillShow(mouseEvent: IEditorMouseEvent): boolean {\n\t\tconst target = mouseEvent.target;\n\t\tif (target.type === MouseTargetType.GUTTER_GLYPH_MARGIN && target.detail.glyphMarginLane) {\n\t\t\tthis._startShowingAt(target.position.lineNumber, target.detail.glyphMarginLane);\n\t\t\treturn true;\n\t\t}\n\t\tif (target.type === MouseTargetType.GUTTER_LINE_NUMBERS) {\n\t\t\tthis._startShowingAt(target.position.lineNumber, 'lineNo');\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _startShowingAt(lineNumber: number, laneOrLine: LaneOrLineNumber): void {\n\t\tif (this._hoverComputerOptions\n\t\t\t&& this._hoverComputerOptions.lineNumber === lineNumber\n\t\t\t&& this._hoverComputerOptions.laneOrLine === laneOrLine) {\n\t\t\t// We have to show the widget at the exact same line number as before, so no work is needed\n\t\t\treturn;\n\t\t}\n\t\tthis._hoverOperation.cancel();\n\t\tthis.hide();\n\t\tthis._hoverComputerOptions = { lineNumber, laneOrLine };\n\t\tthis._hoverOperation.start(HoverStartMode.Delayed, this._hoverComputerOptions);\n\t}\n\n\tpublic hide(): void {\n\t\tthis._hoverComputerOptions = undefined;\n\t\tthis._hoverOperation.cancel();\n\t\tif (!this._isVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isVisible = false;\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\t}\n\n\tprivate _withResult(result: HoverResult<GlyphHoverComputerOptions, IHoverMessage>): void {\n\t\tthis._messages = result.value;\n\n\t\tif (this._messages.length > 0) {\n\t\t\tthis._renderMessages(result.options.lineNumber, result.options.laneOrLine, this._messages);\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}\n\n\tprivate _renderMessages(lineNumber: number, laneOrLine: LaneOrLineNumber, messages: IHoverMessage[]): void {\n\t\tthis._renderDisposeables.clear();\n\n\t\tconst fragment = document.createDocumentFragment();\n\n\t\tfor (const msg of messages) {\n\t\t\tconst markdownHoverElement = $('div.hover-row.markdown-hover');\n\t\t\tconst hoverContentsElement = dom.append(markdownHoverElement, $('div.hover-contents'));\n\t\t\tconst renderedContents = this._renderDisposeables.add(this._markdownRendererService.render(msg.value, { context: this._editor, sanitizerConfig: getEditorMarkdownSanitizerConfig(this._editor) }));\n\t\t\thoverContentsElement.appendChild(renderedContents.element);\n\t\t\tfragment.appendChild(markdownHoverElement);\n\t\t}\n\n\t\tthis._updateContents(fragment);\n\t\tthis._showAt(lineNumber, laneOrLine);\n\t}\n\n\tprivate _updateContents(node: Node): void {\n\t\tthis._hover.contentsDomNode.textContent = '';\n\t\tthis._hover.contentsDomNode.appendChild(node);\n\t\tthis._updateFont();\n\t}\n\n\tprivate _showAt(lineNumber: number, laneOrLine: LaneOrLineNumber): void {\n\t\tif (!this._isVisible) {\n\t\t\tthis._isVisible = true;\n\t\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\t\t}\n\n\t\tconst editorLayout = this._editor.getLayoutInfo();\n\t\tconst topForLineNumber = this._editor.getTopForLineNumber(lineNumber);\n\t\tconst editorScrollTop = this._editor.getScrollTop();\n\t\tconst lineHeight = this._editor.getOption(EditorOption.lineHeight);\n\t\tconst nodeHeight = this._hover.containerDomNode.clientHeight;\n\t\tconst top = topForLineNumber - editorScrollTop - ((nodeHeight - lineHeight) / 2);\n\t\tconst left = editorLayout.glyphMarginLeft + editorLayout.glyphMarginWidth + (laneOrLine === 'lineNo' ? editorLayout.lineNumbersWidth : 0);\n\n\t\t// Constrain the hover widget to stay within the editor bounds\n\t\tconst editorHeight = editorLayout.height;\n\t\tconst maxTop = editorHeight - nodeHeight;\n\t\tconst constrainedTop = Math.max(0, Math.min(Math.round(top), maxTop));\n\n\t\tconst fixedOverflowWidgets = this._editor.getOption(EditorOption.fixedOverflowWidgets);\n\t\tif (fixedOverflowWidgets) {\n\t\t\t// Use fixed positioning relative to the viewport\n\t\t\tconst editorDomNode = this._editor.getDomNode();\n\t\t\tif (editorDomNode) {\n\t\t\t\tconst editorRect = dom.getDomNodePagePosition(editorDomNode);\n\t\t\t\tthis._hover.containerDomNode.style.position = 'fixed';\n\t\t\t\tthis._hover.containerDomNode.style.left = `${editorRect.left + left}px`;\n\t\t\t\tthis._hover.containerDomNode.style.top = `${editorRect.top + constrainedTop}px`;\n\t\t\t}\n\t\t} else {\n\t\t\t// Use absolute positioning relative to the editor\n\t\t\tthis._hover.containerDomNode.style.position = 'absolute';\n\t\t\tthis._hover.containerDomNode.style.left = `${left}px`;\n\t\t\tthis._hover.containerDomNode.style.top = `${constrainedTop}px`;\n\t\t}\n\t\tthis._hover.containerDomNode.style.zIndex = '11'; // 1 more than the zone widget at 10 (#233819)\n\t}\n\n\tprivate _onMouseLeave(e: MouseEvent): void {\n\t\tconst editorDomNode = this._editor.getDomNode();\n\t\tconst isMousePositionOutsideOfEditor = !editorDomNode || !isMousePositionWithinElement(editorDomNode, e.x, e.y);\n\t\tif (isMousePositionOutsideOfEditor) {\n\t\t\tthis.hide();\n\t\t}\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 * as dom from '../../../../base/browser/dom.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { IMarkdownRendererService } from '../../../../platform/markdown/browser/markdownRenderer.js';\nimport { ICodeEditor, IEditorMouseEvent, IOverlayWidget, IOverlayWidgetPosition, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { getEditorMarkdownSanitizerConfig } from '../../../browser/editorMarkdownSanitizer.js';\nimport { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js';\nimport { HoverOperation, HoverResult, HoverStartMode } from './hoverOperation.js';\nimport { HoverWidget } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverWidget } from './hoverTypes.js';\nimport { IHoverMessage, LaneOrLineNumber, GlyphHoverComputer, GlyphHoverComputerOptions } from './glyphHoverComputer.js';\nimport { isMousePositionWithinElement } from './hoverUtils.js';\n\nconst $ = dom.$;\n\nexport class GlyphHoverWidget extends Disposable implements IOverlayWidget, IHoverWidget {\n\n\tpublic static readonly ID = 'editor.contrib.modesGlyphHoverWidget';\n\tpublic readonly allowEditorOverflow = true;\n\n\tprivate readonly _editor: ICodeEditor;\n\tprivate readonly _hover: HoverWidget;\n\n\tprivate _isVisible: boolean;\n\tprivate _messages: IHoverMessage[];\n\n\tprivate readonly _hoverOperation: HoverOperation<GlyphHoverComputerOptions, IHoverMessage>;\n\tprivate readonly _renderDisposeables = this._register(new DisposableStore());\n\n\tprivate _hoverComputerOptions: GlyphHoverComputerOptions | undefined;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IMarkdownRendererService private readonly _markdownRendererService: IMarkdownRendererService,\n\t) {\n\t\tsuper();\n\t\tthis._editor = editor;\n\n\t\tthis._isVisible = false;\n\t\tthis._messages = [];\n\n\t\tthis._hover = this._register(new HoverWidget(true));\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\n\t\tthis._hoverOperation = this._register(new HoverOperation(this._editor, new GlyphHoverComputer(this._editor)));\n\t\tthis._register(this._hoverOperation.onResult((result) => this._withResult(result)));\n\n\t\tthis._register(this._editor.onDidChangeModelDecorations(() => this._onModelDecorationsChanged()));\n\t\tthis._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {\n\t\t\tif (e.hasChanged(EditorOption.fontInfo)) {\n\t\t\t\tthis._updateFont();\n\t\t\t}\n\t\t}));\n\t\tthis._register(dom.addStandardDisposableListener(this._hover.containerDomNode, 'mouseleave', (e) => {\n\t\t\tthis._onMouseLeave(e);\n\t\t}));\n\t\tthis._editor.addOverlayWidget(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._hoverComputerOptions = undefined;\n\t\tthis._editor.removeOverlayWidget(this);\n\t\tsuper.dispose();\n\t}\n\n\tpublic getId(): string {\n\t\treturn GlyphHoverWidget.ID;\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._hover.containerDomNode;\n\t}\n\n\tpublic getPosition(): IOverlayWidgetPosition | null {\n\t\treturn null;\n\t}\n\n\tprivate _updateFont(): void {\n\t\t// eslint-disable-next-line no-restricted-syntax\n\t\tconst codeClasses: HTMLElement[] = Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName('code'));\n\t\tcodeClasses.forEach(node => this._editor.applyFontInfo(node));\n\t}\n\n\tprivate _onModelDecorationsChanged(): void {\n\t\tif (this._isVisible && this._hoverComputerOptions) {\n\t\t\t// The decorations have changed and the hover is visible,\n\t\t\t// we need to recompute the displayed text\n\t\t\tthis._hoverOperation.cancel();\n\t\t\tthis._hoverOperation.start(HoverStartMode.Delayed, this._hoverComputerOptions);\n\t\t}\n\t}\n\n\tpublic showsOrWillShow(mouseEvent: IEditorMouseEvent): boolean {\n\t\tconst target = mouseEvent.target;\n\t\tif (target.type === MouseTargetType.GUTTER_GLYPH_MARGIN && target.detail.glyphMarginLane) {\n\t\t\tthis._startShowingAt(target.position.lineNumber, target.detail.glyphMarginLane);\n\t\t\treturn true;\n\t\t}\n\t\tif (target.type === MouseTargetType.GUTTER_LINE_NUMBERS) {\n\t\t\tthis._startShowingAt(target.position.lineNumber, 'lineNo');\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _startShowingAt(lineNumber: number, laneOrLine: LaneOrLineNumber): void {\n\t\tif (this._hoverComputerOptions\n\t\t\t&& this._hoverComputerOptions.lineNumber === lineNumber\n\t\t\t&& this._hoverComputerOptions.laneOrLine === laneOrLine) {\n\t\t\t// We have to show the widget at the exact same line number as before, so no work is needed\n\t\t\treturn;\n\t\t}\n\t\tthis._hoverOperation.cancel();\n\t\tthis.hide();\n\t\tthis._hoverComputerOptions = { lineNumber, laneOrLine };\n\t\tthis._hoverOperation.start(HoverStartMode.Delayed, this._hoverComputerOptions);\n\t}\n\n\tpublic hide(): void {\n\t\tthis._hoverComputerOptions = undefined;\n\t\tthis._hoverOperation.cancel();\n\t\tif (!this._isVisible) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isVisible = false;\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\t}\n\n\tprivate _withResult(result: HoverResult<GlyphHoverComputerOptions, IHoverMessage>): void {\n\t\tthis._messages = result.value;\n\n\t\tif (this._messages.length > 0) {\n\t\t\tthis._renderMessages(result.options.lineNumber, result.options.laneOrLine, this._messages);\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}\n\n\tprivate _renderMessages(lineNumber: number, laneOrLine: LaneOrLineNumber, messages: IHoverMessage[]): void {\n\t\tthis._renderDisposeables.clear();\n\n\t\tconst fragment = document.createDocumentFragment();\n\n\t\tfor (const msg of messages) {\n\t\t\tconst markdownHoverElement = $('div.hover-row.markdown-hover');\n\t\t\tconst hoverContentsElement = dom.append(markdownHoverElement, $('div.hover-contents'));\n\t\t\tconst renderedContents = this._renderDisposeables.add(this._markdownRendererService.render(msg.value, { context: this._editor, sanitizerConfig: getEditorMarkdownSanitizerConfig(this._editor) }));\n\t\t\thoverContentsElement.appendChild(renderedContents.element);\n\t\t\tfragment.appendChild(markdownHoverElement);\n\t\t}\n\n\t\tthis._updateContents(fragment);\n\t\tthis._showAt(lineNumber, laneOrLine);\n\t}\n\n\tprivate _updateContents(node: Node): void {\n\t\tthis._hover.contentsDomNode.textContent = '';\n\t\tthis._hover.contentsDomNode.appendChild(node);\n\t\tthis._updateFont();\n\t}\n\n\tprivate _showAt(lineNumber: number, laneOrLine: LaneOrLineNumber): void {\n\t\tif (!this._isVisible) {\n\t\t\tthis._isVisible = true;\n\t\t\tthis._hover.containerDomNode.classList.toggle('hidden', !this._isVisible);\n\t\t}\n\n\t\tconst editorLayout = this._editor.getLayoutInfo();\n\t\tconst topForLineNumber = this._editor.getTopForLineNumber(lineNumber);\n\t\tconst editorScrollTop = this._editor.getScrollTop();\n\t\tconst lineHeight = this._editor.getOption(EditorOption.lineHeight);\n\t\tconst nodeHeight = this._hover.containerDomNode.clientHeight;\n\t\tconst top = topForLineNumber - editorScrollTop - ((nodeHeight - lineHeight) / 2);\n\t\tconst left = editorLayout.glyphMarginLeft + editorLayout.glyphMarginWidth + (laneOrLine === 'lineNo' ? editorLayout.lineNumbersWidth : 0);\n\n\t\t// Constrain the hover widget to stay within the editor bounds\n\t\tconst editorHeight = editorLayout.height;\n\t\tconst maxTop = editorHeight - nodeHeight;\n\t\tconst constrainedTop = Math.max(0, Math.min(Math.round(top), maxTop));\n\n\t\tconst fixedOverflowWidgets = this._editor.getOption(EditorOption.fixedOverflowWidgets);\n\t\tif (fixedOverflowWidgets) {\n\t\t\t// Use fixed positioning relative to the viewport\n\t\t\tconst editorDomNode = this._editor.getDomNode();\n\t\t\tif (editorDomNode) {\n\t\t\t\tconst editorRect = dom.getDomNodePagePosition(editorDomNode);\n\t\t\t\tthis._hover.containerDomNode.style.position = 'fixed';\n\t\t\t\tthis._hover.containerDomNode.style.left = `${editorRect.left + left}px`;\n\t\t\t\tthis._hover.containerDomNode.style.top = `${editorRect.top + constrainedTop}px`;\n\t\t\t}\n\t\t} else {\n\t\t\t// Use absolute positioning relative to the editor\n\t\t\tthis._hover.containerDomNode.style.position = 'absolute';\n\t\t\tthis._hover.containerDomNode.style.left = `${left}px`;\n\t\t\tthis._hover.containerDomNode.style.top = `${constrainedTop}px`;\n\t\t}\n\t\tthis._hover.containerDomNode.style.zIndex = '11'; // 1 more than the zone widget at 10 (#233819)\n\t}\n\n\tprivate _onMouseLeave(e: MouseEvent): void {\n\t\tconst editorDomNode = this._editor.getDomNode();\n\t\tconst isMousePositionOutsideOfEditor = !editorDomNode || !isMousePositionWithinElement(editorDomNode, e.x, e.y);\n\t\tif (isMousePositionOutsideOfEditor) {\n\t\t\tthis.hide();\n\t\t}\n\t}\n}\n"]}
|
|
@@ -15,8 +15,8 @@ export const PAGE_DOWN_HOVER_ACTION_ID = 'editor.action.pageDownHover';
|
|
|
15
15
|
export const GO_TO_TOP_HOVER_ACTION_ID = 'editor.action.goToTopHover';
|
|
16
16
|
export const GO_TO_BOTTOM_HOVER_ACTION_ID = 'editor.action.goToBottomHover';
|
|
17
17
|
export const INCREASE_HOVER_VERBOSITY_ACTION_ID = 'editor.action.increaseHoverVerbosityLevel';
|
|
18
|
-
export const INCREASE_HOVER_VERBOSITY_ACTION_LABEL = nls.localize(
|
|
18
|
+
export const INCREASE_HOVER_VERBOSITY_ACTION_LABEL = nls.localize(1167, "Increase Hover Verbosity Level");
|
|
19
19
|
export const DECREASE_HOVER_VERBOSITY_ACTION_ID = 'editor.action.decreaseHoverVerbosityLevel';
|
|
20
|
-
export const DECREASE_HOVER_VERBOSITY_ACTION_LABEL = nls.localize(
|
|
20
|
+
export const DECREASE_HOVER_VERBOSITY_ACTION_LABEL = nls.localize(1168, "Decrease Hover Verbosity Level");
|
|
21
21
|
export const HIDE_LONG_LINE_WARNING_HOVER_ACTION_ID = 'editor.action.hideLongLineWarningHover';
|
|
22
22
|
//# sourceMappingURL=hoverActionIds.js.map
|