monaco-editor-core 0.55.0-dev-20251028 → 0.55.0-dev-20251030

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.
Files changed (183) hide show
  1. package/esm/nls.keys.json +1 -1
  2. package/esm/nls.messages.cs.js +2 -2
  3. package/esm/nls.messages.de.js +2 -2
  4. package/esm/nls.messages.es.js +2 -2
  5. package/esm/nls.messages.fr.js +2 -2
  6. package/esm/nls.messages.it.js +2 -2
  7. package/esm/nls.messages.ja.js +2 -2
  8. package/esm/nls.messages.js +1 -1
  9. package/esm/nls.messages.json +1 -1
  10. package/esm/nls.messages.ko.js +2 -2
  11. package/esm/nls.messages.pl.js +2 -2
  12. package/esm/nls.messages.pt-br.js +2 -2
  13. package/esm/nls.messages.ru.js +2 -2
  14. package/esm/nls.messages.tr.js +2 -2
  15. package/esm/nls.messages.zh-cn.js +2 -2
  16. package/esm/nls.messages.zh-tw.js +2 -2
  17. package/esm/nls.metadata.json +14 -0
  18. package/esm/vs/base/browser/markdownRenderer.js +53 -1
  19. package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
  20. package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  21. package/esm/vs/base/common/codiconsLibrary.js +6 -3
  22. package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
  23. package/esm/vs/base/common/glob.js +41 -31
  24. package/esm/vs/base/common/glob.js.map +1 -1
  25. package/esm/vs/base/common/htmlContent.js +5 -1
  26. package/esm/vs/base/common/htmlContent.js.map +1 -1
  27. package/esm/vs/base/common/network.js +2 -6
  28. package/esm/vs/base/common/network.js.map +1 -1
  29. package/esm/vs/base/common/strings.js +8 -6
  30. package/esm/vs/base/common/strings.js.map +1 -1
  31. package/esm/vs/editor/browser/editorExtensions.js +5 -0
  32. package/esm/vs/editor/browser/editorExtensions.js.map +1 -1
  33. package/esm/vs/editor/browser/triggerInlineEditCommandsRegistry.js +17 -0
  34. package/esm/vs/editor/browser/triggerInlineEditCommandsRegistry.js.map +1 -0
  35. package/esm/vs/editor/common/textModelEditSource.js +1 -0
  36. package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
  37. package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +2 -1
  38. package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js.map +1 -1
  39. package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +4 -0
  40. package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js.map +1 -1
  41. package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
  42. package/esm/vs/editor/contrib/comment/browser/comment.js +16 -12
  43. package/esm/vs/editor/contrib/comment/browser/comment.js.map +1 -1
  44. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +10 -10
  45. package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
  46. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +7 -5
  47. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js.map +1 -1
  48. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +9 -9
  49. package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
  50. package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
  51. package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
  52. package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
  53. package/esm/vs/editor/contrib/find/browser/findController.js +16 -16
  54. package/esm/vs/editor/contrib/find/browser/findWidget.js +26 -26
  55. package/esm/vs/editor/contrib/folding/browser/folding.js +20 -20
  56. package/esm/vs/editor/contrib/folding/browser/folding.js.map +1 -1
  57. package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
  58. package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
  59. package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
  60. package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
  61. package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
  62. package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
  63. package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
  64. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
  65. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
  66. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
  67. package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
  68. package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
  69. package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
  70. package/esm/vs/editor/contrib/hover/browser/contentHoverRendered.js +17 -6
  71. package/esm/vs/editor/contrib/hover/browser/contentHoverRendered.js.map +1 -1
  72. package/esm/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.js +6 -3
  73. package/esm/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.js.map +1 -1
  74. package/esm/vs/editor/contrib/hover/browser/hover.css +36 -0
  75. package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
  76. package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
  77. package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +51 -0
  78. package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js.map +1 -0
  79. package/esm/vs/editor/contrib/hover/browser/hoverTypes.js.map +1 -1
  80. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +25 -9
  81. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
  82. package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +8 -5
  83. package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js.map +1 -1
  84. package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
  85. package/esm/vs/editor/contrib/indentation/browser/indentation.js +29 -27
  86. package/esm/vs/editor/contrib/indentation/browser/indentation.js.map +1 -1
  87. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
  88. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +20 -20
  89. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +12 -12
  90. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +3 -1
  91. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js.map +1 -1
  92. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +4 -1
  93. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js.map +1 -1
  94. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
  95. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
  96. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +1 -1
  97. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
  98. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +1 -1
  99. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
  100. package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
  101. package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
  102. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +87 -62
  103. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js.map +1 -1
  104. package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
  105. package/esm/vs/editor/contrib/links/browser/links.js +10 -10
  106. package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
  107. package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
  108. package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
  109. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
  110. package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
  111. package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
  112. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +8 -8
  113. package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
  114. package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
  115. package/esm/vs/editor/contrib/rename/browser/rename.js +13 -12
  116. package/esm/vs/editor/contrib/rename/browser/rename.js.map +1 -1
  117. package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
  118. package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
  119. package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
  120. package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
  121. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  122. package/esm/vs/editor/contrib/suggest/browser/suggest.js +8 -8
  123. package/esm/vs/editor/contrib/suggest/browser/suggestController.js +10 -10
  124. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +17 -17
  125. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
  126. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
  127. package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
  128. package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
  129. package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  130. package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  131. package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  132. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +27 -24
  133. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js.map +1 -1
  134. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
  135. package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  136. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
  137. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +9 -9
  138. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js.map +1 -1
  139. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
  140. package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
  141. package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
  142. package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
  143. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
  144. package/esm/vs/platform/actions/browser/toolbar.js +2 -2
  145. package/esm/vs/platform/actions/common/actions.js +2 -0
  146. package/esm/vs/platform/actions/common/actions.js.map +1 -1
  147. package/esm/vs/platform/actions/common/menuService.js +2 -2
  148. package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
  149. package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
  150. package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
  151. package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
  152. package/esm/vs/platform/contextkey/common/scanner.js +5 -5
  153. package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  154. package/esm/vs/platform/hover/browser/hoverWidget.js +2 -2
  155. package/esm/vs/platform/hover/browser/hoverWidget.js.map +1 -1
  156. package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
  157. package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
  158. package/esm/vs/platform/list/browser/listService.js +27 -27
  159. package/esm/vs/platform/markers/common/markerService.js +2 -2
  160. package/esm/vs/platform/markers/common/markers.js +6 -6
  161. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +7 -7
  162. package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
  163. package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
  164. package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
  165. package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
  166. package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
  167. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  168. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
  169. package/esm/vs/platform/theme/common/colorUtils.js +2 -2
  170. package/esm/vs/platform/theme/common/colors/baseColors.js +17 -17
  171. package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
  172. package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
  173. package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
  174. package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
  175. package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
  176. package/esm/vs/platform/theme/common/colors/minimapColors.js +11 -11
  177. package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
  178. package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
  179. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  180. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  181. package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
  182. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  183. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/hover/browser/contentHoverRendered.ts","vs/editor/contrib/hover/browser/contentHoverRendered.ts"],"names":[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C,CAAC,CAAC,iCAAiC,CAAC;QAC9K,OAAO,EAAE,KAAK,EAAE,0BAA0B,EAAE,YAAY,EAAE,yBAAyB,GAAG,CAAC,EAAE,CAAC;IAC3F,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACvB,CAAC;IAED,IAAW,kBAAkB;QAC5B,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC;IACvC,CAAC;IAED,IAAW,qBAAqB;QAC/B,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACpC,CAAC;IAED,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC;IACnC,CAAC;;AAvNI,yBAAyB;IAoB5B,WAAA,kBAAkB,CAAA;IAClB,WAAA,aAAa,CAAA;GArBV,yBAAyB,CAwN9B","file":"contentHoverRendered.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IEditorHoverContext, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverParts, RenderedHoverParts } from './hoverTypes.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { EditorHoverStatusBar } from './contentHoverStatusBar.js';\nimport { HoverStartSource } from './hoverOperation.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { ContentHoverResult } from './contentHoverTypes.js';\nimport * as dom from '../../../../base/browser/dom.js';\nimport { HoverVerbosityAction } from '../../../common/languages.js';\nimport { MarkdownHoverParticipant } from './markdownHoverParticipant.js';\nimport { HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';\nimport { InlayHintsHover } from '../../inlayHints/browser/inlayHintsHover.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { HoverAction } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverService } from '../../../../platform/hover/browser/hover.js';\nimport { IOffsetRange } from '../../../common/core/ranges/offsetRange.js';\n\nexport class RenderedContentHover extends Disposable {\n\n\tpublic closestMouseDistance: number | undefined;\n\tpublic initialMousePosX: number | undefined;\n\tpublic initialMousePosY: number | undefined;\n\n\tpublic readonly showAtPosition: Position;\n\tpublic readonly showAtSecondaryPosition: Position;\n\tpublic readonly shouldFocus: boolean;\n\tpublic readonly source: HoverStartSource;\n\tpublic readonly shouldAppearBeforeContent: boolean;\n\n\tprivate readonly _renderedHoverParts: RenderedContentHoverParts;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\thoverResult: ContentHoverResult,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService hoverService: IHoverService\n\t) {\n\t\tsuper();\n\t\tconst parts = hoverResult.hoverParts;\n\t\tthis._renderedHoverParts = this._register(new RenderedContentHoverParts(\n\t\t\teditor,\n\t\t\tparticipants,\n\t\t\tparts,\n\t\t\tcontext,\n\t\t\tkeybindingService,\n\t\t\thoverService\n\t\t));\n\t\tconst contentHoverComputerOptions = hoverResult.options;\n\t\tconst anchor = contentHoverComputerOptions.anchor;\n\t\tconst { showAtPosition, showAtSecondaryPosition } = RenderedContentHover.computeHoverPositions(editor, anchor.range, parts);\n\t\tthis.shouldAppearBeforeContent = parts.some(m => m.isBeforeContent);\n\t\tthis.showAtPosition = showAtPosition;\n\t\tthis.showAtSecondaryPosition = showAtSecondaryPosition;\n\t\tthis.initialMousePosX = anchor.initialMousePosX;\n\t\tthis.initialMousePosY = anchor.initialMousePosY;\n\t\tthis.shouldFocus = contentHoverComputerOptions.shouldFocus;\n\t\tthis.source = contentHoverComputerOptions.source;\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._renderedHoverParts.domNode;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._renderedHoverParts.domNodeHasChildren;\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._renderedHoverParts.focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedHoverParts.hoverPartsCount;\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tthis._renderedHoverParts.focusHoverPartWithIndex(index);\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tthis._renderedHoverParts.updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._renderedHoverParts.isColorPickerVisible();\n\t}\n\n\tpublic static computeHoverPositions(editor: ICodeEditor, anchorRange: Range, hoverParts: IHoverPart[]): { showAtPosition: Position; showAtSecondaryPosition: Position } {\n\n\t\tlet startColumnBoundary = 1;\n\t\tif (editor.hasModel()) {\n\t\t\t// Ensure the range is on the current view line\n\t\t\tconst viewModel = editor._getViewModel();\n\t\t\tconst coordinatesConverter = viewModel.coordinatesConverter;\n\t\t\tconst anchorViewRange = coordinatesConverter.convertModelRangeToViewRange(anchorRange);\n\t\t\tconst anchorViewMinColumn = viewModel.getLineMinColumn(anchorViewRange.startLineNumber);\n\t\t\tconst anchorViewRangeStart = new Position(anchorViewRange.startLineNumber, anchorViewMinColumn);\n\t\t\tstartColumnBoundary = coordinatesConverter.convertViewPositionToModelPosition(anchorViewRangeStart).column;\n\t\t}\n\n\t\t// The anchor range is always on a single line\n\t\tconst anchorStartLineNumber = anchorRange.startLineNumber;\n\t\tlet secondaryPositionColumn = anchorRange.startColumn;\n\t\tlet forceShowAtRange: Range | undefined;\n\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\tconst hoverPartRangeOnAnchorStartLine = hoverPartRange.startLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeOnAnchorEndLine = hoverPartRange.endLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeIsOnAnchorLine = hoverPartRangeOnAnchorStartLine && hoverPartRangeOnAnchorEndLine;\n\t\t\tif (hoverPartRangeIsOnAnchorLine) {\n\t\t\t\t// this message has a range that is completely sitting on the line of the anchor\n\t\t\t\tconst hoverPartStartColumn = hoverPartRange.startColumn;\n\t\t\t\tconst minSecondaryPositionColumn = Math.min(secondaryPositionColumn, hoverPartStartColumn);\n\t\t\t\tsecondaryPositionColumn = Math.max(minSecondaryPositionColumn, startColumnBoundary);\n\t\t\t}\n\t\t\tif (hoverPart.forceShowAtRange) {\n\t\t\t\tforceShowAtRange = hoverPartRange;\n\t\t\t}\n\t\t}\n\n\t\tlet showAtPosition: Position;\n\t\tlet showAtSecondaryPosition: Position;\n\t\tif (forceShowAtRange) {\n\t\t\tconst forceShowAtPosition = forceShowAtRange.getStartPosition();\n\t\t\tshowAtPosition = forceShowAtPosition;\n\t\t\tshowAtSecondaryPosition = forceShowAtPosition;\n\t\t} else {\n\t\t\tshowAtPosition = anchorRange.getStartPosition();\n\t\t\tshowAtSecondaryPosition = new Position(anchorStartLineNumber, secondaryPositionColumn);\n\t\t}\n\t\treturn {\n\t\t\tshowAtPosition,\n\t\t\tshowAtSecondaryPosition,\n\t\t};\n\t}\n}\n\ninterface IRenderedContentHoverPart {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'hoverPart';\n\t/**\n\t * Participant of the rendered hover part\n\t */\n\tparticipant: IEditorHoverParticipant<IHoverPart>;\n\t/**\n\t * The rendered hover part\n\t */\n\thoverPart: IHoverPart;\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n}\n\ninterface IRenderedContentStatusBar {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'statusBar';\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n\t/**\n\t * The actions of the hover status bar.\n\t */\n\tactions: HoverAction[];\n}\n\ntype IRenderedContentHoverPartOrStatusBar = IRenderedContentHoverPart | IRenderedContentStatusBar;\n\nclass RenderedStatusBar implements IDisposable {\n\n\tconstructor(fragment: DocumentFragment, private readonly _statusBar: EditorHoverStatusBar) {\n\t\tfragment.appendChild(this._statusBar.hoverElement);\n\t}\n\n\tget hoverElement(): HTMLElement {\n\t\treturn this._statusBar.hoverElement;\n\t}\n\n\tget actions(): HoverAction[] {\n\t\treturn this._statusBar.actions;\n\t}\n\n\tdispose() {\n\t\tthis._statusBar.dispose();\n\t}\n}\n\nclass RenderedContentHoverParts extends Disposable {\n\n\tprivate static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({\n\t\tdescription: 'content-hover-highlight',\n\t\tclassName: 'hoverHighlight'\n\t});\n\n\tprivate readonly _renderedParts: IRenderedContentHoverPartOrStatusBar[] = [];\n\tprivate readonly _fragment: DocumentFragment;\n\tprivate readonly _context: IEditorHoverContext;\n\n\tprivate _markdownHoverParticipant: MarkdownHoverParticipant | undefined;\n\tprivate _colorHoverParticipant: HoverColorPickerParticipant | undefined;\n\tprivate _focusedHoverPartIndex: number = -1;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\thoverParts: IHoverPart[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService hoverService: IHoverService\n\t) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._fragment = document.createDocumentFragment();\n\t\tthis._register(this._renderParts(participants, hoverParts, context, keybindingService, hoverService));\n\t\tthis._register(this._registerListenersOnRenderedParts());\n\t\tthis._register(this._createEditorDecorations(editor, hoverParts));\n\t\tthis._updateMarkdownAndColorParticipantInfo(participants);\n\t}\n\n\tprivate _createEditorDecorations(editor: ICodeEditor, hoverParts: IHoverPart[]): IDisposable {\n\t\tif (hoverParts.length === 0) {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tlet highlightRange = hoverParts[0].range;\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\thighlightRange = Range.plusRange(highlightRange, hoverPartRange);\n\t\t}\n\t\tconst highlightDecoration = editor.createDecorationsCollection();\n\t\thighlightDecoration.set([{\n\t\t\trange: highlightRange,\n\t\t\toptions: RenderedContentHoverParts._DECORATION_OPTIONS\n\t\t}]);\n\t\treturn toDisposable(() => {\n\t\t\thighlightDecoration.clear();\n\t\t});\n\t}\n\n\tprivate _renderParts(participants: IEditorHoverParticipant<IHoverPart>[], hoverParts: IHoverPart[], hoverContext: IEditorHoverContext, keybindingService: IKeybindingService, hoverService: IHoverService): IDisposable {\n\t\tconst statusBar = new EditorHoverStatusBar(keybindingService, hoverService);\n\t\tconst hoverRenderingContext: IEditorHoverRenderContext = {\n\t\t\tfragment: this._fragment,\n\t\t\tstatusBar,\n\t\t\t...hoverContext\n\t\t};\n\t\tconst disposables = new DisposableStore();\n\t\tdisposables.add(statusBar);\n\t\tfor (const participant of participants) {\n\t\t\tconst renderedHoverParts = this._renderHoverPartsForParticipant(hoverParts, participant, hoverRenderingContext);\n\t\t\tdisposables.add(renderedHoverParts);\n\t\t\tfor (const renderedHoverPart of renderedHoverParts.renderedHoverParts) {\n\t\t\t\tthis._renderedParts.push({\n\t\t\t\t\ttype: 'hoverPart',\n\t\t\t\t\tparticipant,\n\t\t\t\t\thoverPart: renderedHoverPart.hoverPart,\n\t\t\t\t\thoverElement: renderedHoverPart.hoverElement,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst renderedStatusBar = this._renderStatusBar(this._fragment, statusBar);\n\t\tif (renderedStatusBar) {\n\t\t\tdisposables.add(renderedStatusBar);\n\t\t\tthis._renderedParts.push({\n\t\t\t\ttype: 'statusBar',\n\t\t\t\thoverElement: renderedStatusBar.hoverElement,\n\t\t\t\tactions: renderedStatusBar.actions,\n\t\t\t});\n\t\t}\n\t\treturn disposables;\n\t}\n\n\tprivate _renderHoverPartsForParticipant(hoverParts: IHoverPart[], participant: IEditorHoverParticipant<IHoverPart>, hoverRenderingContext: IEditorHoverRenderContext): IRenderedHoverParts<IHoverPart> {\n\t\tconst hoverPartsForParticipant = hoverParts.filter(hoverPart => hoverPart.owner === participant);\n\t\tconst hasHoverPartsForParticipant = hoverPartsForParticipant.length > 0;\n\t\tif (!hasHoverPartsForParticipant) {\n\t\t\treturn new RenderedHoverParts([]);\n\t\t}\n\t\treturn participant.renderHoverParts(hoverRenderingContext, hoverPartsForParticipant);\n\t}\n\n\tprivate _renderStatusBar(fragment: DocumentFragment, statusBar: EditorHoverStatusBar): RenderedStatusBar | undefined {\n\t\tif (!statusBar.hasContent) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new RenderedStatusBar(fragment, statusBar);\n\t}\n\n\tprivate _registerListenersOnRenderedParts(): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\t\tthis._renderedParts.forEach((renderedPart: IRenderedContentHoverPartOrStatusBar, index: number) => {\n\t\t\tconst element = renderedPart.hoverElement;\n\t\t\telement.tabIndex = 0;\n\t\t\tdisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_IN, (event: Event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tthis._focusedHoverPartIndex = index;\n\t\t\t}));\n\t\t\tdisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_OUT, (event: Event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tthis._focusedHoverPartIndex = -1;\n\t\t\t}));\n\t\t});\n\t\treturn disposables;\n\t}\n\n\tprivate _updateMarkdownAndColorParticipantInfo(participants: IEditorHoverParticipant<IHoverPart>[]) {\n\t\tconst markdownHoverParticipant = participants.find(p => {\n\t\t\treturn (p instanceof MarkdownHoverParticipant) && !(p instanceof InlayHintsHover);\n\t\t});\n\t\tif (markdownHoverParticipant) {\n\t\t\tthis._markdownHoverParticipant = markdownHoverParticipant as MarkdownHoverParticipant;\n\t\t}\n\t\tthis._colorHoverParticipant = participants.find(p => p instanceof HoverColorPickerParticipant);\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tif (index < 0 || index >= this._renderedParts.length) {\n\t\t\treturn;\n\t\t}\n\t\tthis._renderedParts[index].hoverElement.focus();\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tif (!this._markdownHoverParticipant) {\n\t\t\treturn;\n\t\t}\n\t\tlet rangeOfIndicesToUpdate: IOffsetRange;\n\t\tif (index >= 0) {\n\t\t\trangeOfIndicesToUpdate = { start: index, endExclusive: index + 1 };\n\t\t} else {\n\t\t\trangeOfIndicesToUpdate = this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);\n\t\t}\n\t\tfor (let i = rangeOfIndicesToUpdate.start; i < rangeOfIndicesToUpdate.endExclusive; i++) {\n\t\t\tconst normalizedMarkdownHoverIndex = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, i);\n\t\t\tif (normalizedMarkdownHoverIndex === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst renderedPart = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(action, normalizedMarkdownHoverIndex);\n\t\t\tif (!renderedPart) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis._renderedParts[i] = {\n\t\t\t\ttype: 'hoverPart',\n\t\t\t\tparticipant: this._markdownHoverParticipant,\n\t\t\t\thoverPart: renderedPart.hoverPart,\n\t\t\t\thoverElement: renderedPart.hoverElement,\n\t\t\t};\n\t\t}\n\t\tif (focus) {\n\t\t\tif (index >= 0) {\n\t\t\t\tthis.focusHoverPartWithIndex(index);\n\t\t\t} else {\n\t\t\t\tthis._context.focus();\n\t\t\t}\n\t\t}\n\t\tthis._context.onContentsChanged();\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._colorHoverParticipant?.isColorPickerVisible() ?? false;\n\t}\n\n\tprivate _normalizedIndexToMarkdownHoverIndexRange(markdownHoverParticipant: MarkdownHoverParticipant, index: number): number | undefined {\n\t\tconst renderedPart = this._renderedParts[index];\n\t\tif (!renderedPart || renderedPart.type !== 'hoverPart') {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst isHoverPartMarkdownHover = renderedPart.participant === markdownHoverParticipant;\n\t\tif (!isHoverPartMarkdownHover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst firstIndexOfMarkdownHovers = this._renderedParts.findIndex(renderedPart =>\n\t\t\trenderedPart.type === 'hoverPart'\n\t\t\t&& renderedPart.participant === markdownHoverParticipant\n\t\t);\n\t\tif (firstIndexOfMarkdownHovers === -1) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\t\treturn index - firstIndexOfMarkdownHovers;\n\t}\n\n\tprivate _findRangeOfMarkdownHoverParts(markdownHoverParticipant: MarkdownHoverParticipant): IOffsetRange {\n\t\tconst copiedRenderedParts = this._renderedParts.slice();\n\t\tconst firstIndexOfMarkdownHovers = copiedRenderedParts.findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst inversedLastIndexOfMarkdownHovers = copiedRenderedParts.reverse().findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst lastIndexOfMarkdownHovers = inversedLastIndexOfMarkdownHovers >= 0 ? copiedRenderedParts.length - inversedLastIndexOfMarkdownHovers : inversedLastIndexOfMarkdownHovers;\n\t\treturn { start: firstIndexOfMarkdownHovers, endExclusive: lastIndexOfMarkdownHovers + 1 };\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._fragment;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._fragment.hasChildNodes();\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedParts.length;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IEditorHoverContext, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverParts, RenderedHoverParts } from './hoverTypes.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { EditorHoverStatusBar } from './contentHoverStatusBar.js';\nimport { HoverStartSource } from './hoverOperation.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { ContentHoverResult } from './contentHoverTypes.js';\nimport * as dom from '../../../../base/browser/dom.js';\nimport { HoverVerbosityAction } from '../../../common/languages.js';\nimport { MarkdownHoverParticipant } from './markdownHoverParticipant.js';\nimport { HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';\nimport { InlayHintsHover } from '../../inlayHints/browser/inlayHintsHover.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { HoverAction } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverService } from '../../../../platform/hover/browser/hover.js';\nimport { IOffsetRange } from '../../../common/core/ranges/offsetRange.js';\n\nexport class RenderedContentHover extends Disposable {\n\n\tpublic closestMouseDistance: number | undefined;\n\tpublic initialMousePosX: number | undefined;\n\tpublic initialMousePosY: number | undefined;\n\n\tpublic readonly showAtPosition: Position;\n\tpublic readonly showAtSecondaryPosition: Position;\n\tpublic readonly shouldFocus: boolean;\n\tpublic readonly source: HoverStartSource;\n\tpublic readonly shouldAppearBeforeContent: boolean;\n\n\tprivate readonly _renderedHoverParts: RenderedContentHoverParts;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\thoverResult: ContentHoverResult,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService hoverService: IHoverService\n\t) {\n\t\tsuper();\n\t\tconst parts = hoverResult.hoverParts;\n\t\tthis._renderedHoverParts = this._register(new RenderedContentHoverParts(\n\t\t\teditor,\n\t\t\tparticipants,\n\t\t\tparts,\n\t\t\tcontext,\n\t\t\tkeybindingService,\n\t\t\thoverService\n\t\t));\n\t\tconst contentHoverComputerOptions = hoverResult.options;\n\t\tconst anchor = contentHoverComputerOptions.anchor;\n\t\tconst { showAtPosition, showAtSecondaryPosition } = RenderedContentHover.computeHoverPositions(editor, anchor.range, parts);\n\t\tthis.shouldAppearBeforeContent = parts.some(m => m.isBeforeContent);\n\t\tthis.showAtPosition = showAtPosition;\n\t\tthis.showAtSecondaryPosition = showAtSecondaryPosition;\n\t\tthis.initialMousePosX = anchor.initialMousePosX;\n\t\tthis.initialMousePosY = anchor.initialMousePosY;\n\t\tthis.shouldFocus = contentHoverComputerOptions.shouldFocus;\n\t\tthis.source = contentHoverComputerOptions.source;\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._renderedHoverParts.domNode;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._renderedHoverParts.domNodeHasChildren;\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._renderedHoverParts.focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedHoverParts.hoverPartsCount;\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tthis._renderedHoverParts.focusHoverPartWithIndex(index);\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tthis._renderedHoverParts.updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._renderedHoverParts.isColorPickerVisible();\n\t}\n\n\tpublic static computeHoverPositions(editor: ICodeEditor, anchorRange: Range, hoverParts: IHoverPart[]): { showAtPosition: Position; showAtSecondaryPosition: Position } {\n\n\t\tlet startColumnBoundary = 1;\n\t\tif (editor.hasModel()) {\n\t\t\t// Ensure the range is on the current view line\n\t\t\tconst viewModel = editor._getViewModel();\n\t\t\tconst coordinatesConverter = viewModel.coordinatesConverter;\n\t\t\tconst anchorViewRange = coordinatesConverter.convertModelRangeToViewRange(anchorRange);\n\t\t\tconst anchorViewMinColumn = viewModel.getLineMinColumn(anchorViewRange.startLineNumber);\n\t\t\tconst anchorViewRangeStart = new Position(anchorViewRange.startLineNumber, anchorViewMinColumn);\n\t\t\tstartColumnBoundary = coordinatesConverter.convertViewPositionToModelPosition(anchorViewRangeStart).column;\n\t\t}\n\n\t\t// The anchor range is always on a single line\n\t\tconst anchorStartLineNumber = anchorRange.startLineNumber;\n\t\tlet secondaryPositionColumn = anchorRange.startColumn;\n\t\tlet forceShowAtRange: Range | undefined;\n\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\tconst hoverPartRangeOnAnchorStartLine = hoverPartRange.startLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeOnAnchorEndLine = hoverPartRange.endLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeIsOnAnchorLine = hoverPartRangeOnAnchorStartLine && hoverPartRangeOnAnchorEndLine;\n\t\t\tif (hoverPartRangeIsOnAnchorLine) {\n\t\t\t\t// this message has a range that is completely sitting on the line of the anchor\n\t\t\t\tconst hoverPartStartColumn = hoverPartRange.startColumn;\n\t\t\t\tconst minSecondaryPositionColumn = Math.min(secondaryPositionColumn, hoverPartStartColumn);\n\t\t\t\tsecondaryPositionColumn = Math.max(minSecondaryPositionColumn, startColumnBoundary);\n\t\t\t}\n\t\t\tif (hoverPart.forceShowAtRange) {\n\t\t\t\tforceShowAtRange = hoverPartRange;\n\t\t\t}\n\t\t}\n\n\t\tlet showAtPosition: Position;\n\t\tlet showAtSecondaryPosition: Position;\n\t\tif (forceShowAtRange) {\n\t\t\tconst forceShowAtPosition = forceShowAtRange.getStartPosition();\n\t\t\tshowAtPosition = forceShowAtPosition;\n\t\t\tshowAtSecondaryPosition = forceShowAtPosition;\n\t\t} else {\n\t\t\tshowAtPosition = anchorRange.getStartPosition();\n\t\t\tshowAtSecondaryPosition = new Position(anchorStartLineNumber, secondaryPositionColumn);\n\t\t}\n\t\treturn {\n\t\t\tshowAtPosition,\n\t\t\tshowAtSecondaryPosition,\n\t\t};\n\t}\n}\n\ninterface IRenderedContentHoverPart {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'hoverPart';\n\t/**\n\t * Participant of the rendered hover part\n\t */\n\tparticipant: IEditorHoverParticipant<IHoverPart>;\n\t/**\n\t * The rendered hover part\n\t */\n\thoverPart: IHoverPart;\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n}\n\ninterface IRenderedContentStatusBar {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'statusBar';\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n\t/**\n\t * The actions of the hover status bar.\n\t */\n\tactions: HoverAction[];\n}\n\ntype IRenderedContentHoverPartOrStatusBar = IRenderedContentHoverPart | IRenderedContentStatusBar;\n\nclass RenderedStatusBar implements IDisposable {\n\n\tconstructor(fragment: DocumentFragment, private readonly _statusBar: EditorHoverStatusBar) {\n\t\tfragment.appendChild(this._statusBar.hoverElement);\n\t}\n\n\tget hoverElement(): HTMLElement {\n\t\treturn this._statusBar.hoverElement;\n\t}\n\n\tget actions(): HoverAction[] {\n\t\treturn this._statusBar.actions;\n\t}\n\n\tdispose() {\n\t\tthis._statusBar.dispose();\n\t}\n}\n\nclass RenderedContentHoverParts extends Disposable {\n\n\tprivate static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({\n\t\tdescription: 'content-hover-highlight',\n\t\tclassName: 'hoverHighlight'\n\t});\n\n\tprivate readonly _renderedParts: IRenderedContentHoverPartOrStatusBar[] = [];\n\tprivate readonly _fragment: DocumentFragment;\n\tprivate readonly _context: IEditorHoverContext;\n\n\tprivate _markdownHoverParticipant: MarkdownHoverParticipant | undefined;\n\tprivate _colorHoverParticipant: HoverColorPickerParticipant | undefined;\n\tprivate _focusedHoverPartIndex: number = -1;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\thoverParts: IHoverPart[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService hoverService: IHoverService\n\t) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._fragment = document.createDocumentFragment();\n\t\tthis._register(this._renderParts(participants, hoverParts, context, keybindingService, hoverService));\n\t\tthis._register(this._registerListenersOnRenderedParts());\n\t\tthis._register(this._createEditorDecorations(editor, hoverParts));\n\t\tthis._updateMarkdownAndColorParticipantInfo(participants);\n\t}\n\n\tprivate _createEditorDecorations(editor: ICodeEditor, hoverParts: IHoverPart[]): IDisposable {\n\t\tif (hoverParts.length === 0) {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tlet highlightRange = hoverParts[0].range;\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\thighlightRange = Range.plusRange(highlightRange, hoverPartRange);\n\t\t}\n\t\tconst highlightDecoration = editor.createDecorationsCollection();\n\t\thighlightDecoration.set([{\n\t\t\trange: highlightRange,\n\t\t\toptions: RenderedContentHoverParts._DECORATION_OPTIONS\n\t\t}]);\n\t\treturn toDisposable(() => {\n\t\t\thighlightDecoration.clear();\n\t\t});\n\t}\n\n\tprivate _renderParts(participants: IEditorHoverParticipant<IHoverPart>[], hoverParts: IHoverPart[], hoverContext: IEditorHoverContext, keybindingService: IKeybindingService, hoverService: IHoverService): IDisposable {\n\t\tconst statusBar = new EditorHoverStatusBar(keybindingService, hoverService);\n\t\tconst hoverRenderingContext: IEditorHoverRenderContext = {\n\t\t\tfragment: this._fragment,\n\t\t\tstatusBar,\n\t\t\t...hoverContext\n\t\t};\n\t\tconst disposables = new DisposableStore();\n\t\tdisposables.add(statusBar);\n\t\tfor (const participant of participants) {\n\t\t\tconst renderedHoverParts = this._renderHoverPartsForParticipant(hoverParts, participant, hoverRenderingContext);\n\t\t\tdisposables.add(renderedHoverParts);\n\t\t\tfor (const renderedHoverPart of renderedHoverParts.renderedHoverParts) {\n\t\t\t\tthis._renderedParts.push({\n\t\t\t\t\ttype: 'hoverPart',\n\t\t\t\t\tparticipant,\n\t\t\t\t\thoverPart: renderedHoverPart.hoverPart,\n\t\t\t\t\thoverElement: renderedHoverPart.hoverElement,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst renderedStatusBar = this._renderStatusBar(this._fragment, statusBar);\n\t\tif (renderedStatusBar) {\n\t\t\tdisposables.add(renderedStatusBar);\n\t\t\tthis._renderedParts.push({\n\t\t\t\ttype: 'statusBar',\n\t\t\t\thoverElement: renderedStatusBar.hoverElement,\n\t\t\t\tactions: renderedStatusBar.actions,\n\t\t\t});\n\t\t}\n\t\treturn disposables;\n\t}\n\n\tprivate _renderHoverPartsForParticipant(hoverParts: IHoverPart[], participant: IEditorHoverParticipant<IHoverPart>, hoverRenderingContext: IEditorHoverRenderContext): IRenderedHoverParts<IHoverPart> {\n\t\tconst hoverPartsForParticipant = hoverParts.filter(hoverPart => hoverPart.owner === participant);\n\t\tconst hasHoverPartsForParticipant = hoverPartsForParticipant.length > 0;\n\t\tif (!hasHoverPartsForParticipant) {\n\t\t\treturn new RenderedHoverParts([]);\n\t\t}\n\t\treturn participant.renderHoverParts(hoverRenderingContext, hoverPartsForParticipant);\n\t}\n\n\tprivate _renderStatusBar(fragment: DocumentFragment, statusBar: EditorHoverStatusBar): RenderedStatusBar | undefined {\n\t\tif (!statusBar.hasContent) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new RenderedStatusBar(fragment, statusBar);\n\t}\n\n\tprivate _registerListenersOnRenderedParts(): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\t\tthis._renderedParts.forEach((renderedPart: IRenderedContentHoverPartOrStatusBar, index: number) => {\n\t\t\tconst element = renderedPart.hoverElement;\n\t\t\telement.tabIndex = 0;\n\t\t\tdisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_IN, (event: Event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tthis._focusedHoverPartIndex = index;\n\t\t\t}));\n\t\t\tdisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_OUT, (event: Event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tthis._focusedHoverPartIndex = -1;\n\t\t\t}));\n\t\t});\n\t\treturn disposables;\n\t}\n\n\tprivate _updateMarkdownAndColorParticipantInfo(participants: IEditorHoverParticipant<IHoverPart>[]) {\n\t\tconst markdownHoverParticipant = participants.find(p => {\n\t\t\treturn (p instanceof MarkdownHoverParticipant) && !(p instanceof InlayHintsHover);\n\t\t});\n\t\tif (markdownHoverParticipant) {\n\t\t\tthis._markdownHoverParticipant = markdownHoverParticipant as MarkdownHoverParticipant;\n\t\t}\n\t\tthis._colorHoverParticipant = participants.find(p => p instanceof HoverColorPickerParticipant);\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tif (index < 0 || index >= this._renderedParts.length) {\n\t\t\treturn;\n\t\t}\n\t\tthis._renderedParts[index].hoverElement.focus();\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tif (!this._markdownHoverParticipant) {\n\t\t\treturn;\n\t\t}\n\t\tlet rangeOfIndicesToUpdate: IOffsetRange;\n\t\tif (index >= 0) {\n\t\t\trangeOfIndicesToUpdate = { start: index, endExclusive: index + 1 };\n\t\t} else {\n\t\t\trangeOfIndicesToUpdate = this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);\n\t\t}\n\t\tfor (let i = rangeOfIndicesToUpdate.start; i < rangeOfIndicesToUpdate.endExclusive; i++) {\n\t\t\tconst normalizedMarkdownHoverIndex = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, i);\n\t\t\tif (normalizedMarkdownHoverIndex === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst renderedPart = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(action, normalizedMarkdownHoverIndex);\n\t\t\tif (!renderedPart) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis._renderedParts[i] = {\n\t\t\t\ttype: 'hoverPart',\n\t\t\t\tparticipant: this._markdownHoverParticipant,\n\t\t\t\thoverPart: renderedPart.hoverPart,\n\t\t\t\thoverElement: renderedPart.hoverElement,\n\t\t\t};\n\t\t}\n\t\tif (focus) {\n\t\t\tif (index >= 0) {\n\t\t\t\tthis.focusHoverPartWithIndex(index);\n\t\t\t} else {\n\t\t\t\tthis._context.focus();\n\t\t\t}\n\t\t}\n\t\tthis._context.onContentsChanged();\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._colorHoverParticipant?.isColorPickerVisible() ?? false;\n\t}\n\n\tprivate _normalizedIndexToMarkdownHoverIndexRange(markdownHoverParticipant: MarkdownHoverParticipant, index: number): number | undefined {\n\t\tconst renderedPart = this._renderedParts[index];\n\t\tif (!renderedPart || renderedPart.type !== 'hoverPart') {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst isHoverPartMarkdownHover = renderedPart.participant === markdownHoverParticipant;\n\t\tif (!isHoverPartMarkdownHover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst firstIndexOfMarkdownHovers = this._renderedParts.findIndex(renderedPart =>\n\t\t\trenderedPart.type === 'hoverPart'\n\t\t\t&& renderedPart.participant === markdownHoverParticipant\n\t\t);\n\t\tif (firstIndexOfMarkdownHovers === -1) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\t\treturn index - firstIndexOfMarkdownHovers;\n\t}\n\n\tprivate _findRangeOfMarkdownHoverParts(markdownHoverParticipant: MarkdownHoverParticipant): IOffsetRange {\n\t\tconst copiedRenderedParts = this._renderedParts.slice();\n\t\tconst firstIndexOfMarkdownHovers = copiedRenderedParts.findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst inversedLastIndexOfMarkdownHovers = copiedRenderedParts.reverse().findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst lastIndexOfMarkdownHovers = inversedLastIndexOfMarkdownHovers >= 0 ? copiedRenderedParts.length - inversedLastIndexOfMarkdownHovers : inversedLastIndexOfMarkdownHovers;\n\t\treturn { start: firstIndexOfMarkdownHovers, endExclusive: lastIndexOfMarkdownHovers + 1 };\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._fragment;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._fragment.hasChildNodes();\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedParts.length;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/hover/browser/contentHoverRendered.ts","vs/editor/contrib/hover/browser/contentHoverRendered.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAA4G,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC/J,OAAO,EAAE,UAAU,EAAE,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;QACxF,MAAM,mBAAmB,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QACxD,MAAM,0BAA0B,GAAG,mBAAmB,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,KAAK,WAAW,IAAI,YAAY,CAAC,WAAW,KAAK,wBAAwB,CAAC,CAAC;QAC7K,MAAM,iCAAiC,GAAG,mBAAmB,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,KAAK,WAAW,IAAI,YAAY,CAAC,WAAW,KAAK,wBAAwB,CAAC,CAAC;QAC9L,MAAM,yBAAyB,GAAG,iCAAiC,IAAI,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM,GAAG,iCAAiC,CAAC,CAAC,CAAC,iCAAiC,CAAC;QAC9K,OAAO,EAAE,KAAK,EAAE,0BAA0B,EAAE,YAAY,EAAE,yBAAyB,GAAG,CAAC,EAAE,CAAC;IAC3F,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACvB,CAAC;IAED,IAAW,kBAAkB;QAC5B,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC;IACvC,CAAC;IAED,IAAW,qBAAqB;QAC/B,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACpC,CAAC;IAED,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC;IACnC,CAAC;;AAjOI,yBAAyB;IAoB5B,WAAA,kBAAkB,CAAA;IAClB,WAAA,aAAa,CAAA;IACb,WAAA,iBAAiB,CAAA;GAtBd,yBAAyB,CAkO9B","file":"contentHoverRendered.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IEditorHoverContext, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverParts, RenderedHoverParts } from './hoverTypes.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { EditorHoverStatusBar } from './contentHoverStatusBar.js';\nimport { HoverStartSource } from './hoverOperation.js';\nimport { HoverCopyButton } from './hoverCopyButton.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { ContentHoverResult } from './contentHoverTypes.js';\nimport * as dom from '../../../../base/browser/dom.js';\nimport { HoverVerbosityAction } from '../../../common/languages.js';\nimport { MarkdownHoverParticipant } from './markdownHoverParticipant.js';\nimport { HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';\nimport { InlayHintsHover } from '../../inlayHints/browser/inlayHintsHover.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { HoverAction } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverService } from '../../../../platform/hover/browser/hover.js';\nimport { IOffsetRange } from '../../../common/core/ranges/offsetRange.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\nimport { MarkerHover } from './markerHoverParticipant.js';\n\nexport class RenderedContentHover extends Disposable {\n\n\tpublic closestMouseDistance: number | undefined;\n\tpublic initialMousePosX: number | undefined;\n\tpublic initialMousePosY: number | undefined;\n\n\tpublic readonly showAtPosition: Position;\n\tpublic readonly showAtSecondaryPosition: Position;\n\tpublic readonly shouldFocus: boolean;\n\tpublic readonly source: HoverStartSource;\n\tpublic readonly shouldAppearBeforeContent: boolean;\n\n\tprivate readonly _renderedHoverParts: RenderedContentHoverParts;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\thoverResult: ContentHoverResult,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService hoverService: IHoverService,\n\t\t@IClipboardService clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tconst parts = hoverResult.hoverParts;\n\t\tthis._renderedHoverParts = this._register(new RenderedContentHoverParts(\n\t\t\teditor,\n\t\t\tparticipants,\n\t\t\tparts,\n\t\t\tcontext,\n\t\t\tkeybindingService,\n\t\t\thoverService,\n\t\t\tclipboardService\n\t\t));\n\t\tconst contentHoverComputerOptions = hoverResult.options;\n\t\tconst anchor = contentHoverComputerOptions.anchor;\n\t\tconst { showAtPosition, showAtSecondaryPosition } = RenderedContentHover.computeHoverPositions(editor, anchor.range, parts);\n\t\tthis.shouldAppearBeforeContent = parts.some(m => m.isBeforeContent);\n\t\tthis.showAtPosition = showAtPosition;\n\t\tthis.showAtSecondaryPosition = showAtSecondaryPosition;\n\t\tthis.initialMousePosX = anchor.initialMousePosX;\n\t\tthis.initialMousePosY = anchor.initialMousePosY;\n\t\tthis.shouldFocus = contentHoverComputerOptions.shouldFocus;\n\t\tthis.source = contentHoverComputerOptions.source;\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._renderedHoverParts.domNode;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._renderedHoverParts.domNodeHasChildren;\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._renderedHoverParts.focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedHoverParts.hoverPartsCount;\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tthis._renderedHoverParts.focusHoverPartWithIndex(index);\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tthis._renderedHoverParts.updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._renderedHoverParts.isColorPickerVisible();\n\t}\n\n\tpublic static computeHoverPositions(editor: ICodeEditor, anchorRange: Range, hoverParts: IHoverPart[]): { showAtPosition: Position; showAtSecondaryPosition: Position } {\n\n\t\tlet startColumnBoundary = 1;\n\t\tif (editor.hasModel()) {\n\t\t\t// Ensure the range is on the current view line\n\t\t\tconst viewModel = editor._getViewModel();\n\t\t\tconst coordinatesConverter = viewModel.coordinatesConverter;\n\t\t\tconst anchorViewRange = coordinatesConverter.convertModelRangeToViewRange(anchorRange);\n\t\t\tconst anchorViewMinColumn = viewModel.getLineMinColumn(anchorViewRange.startLineNumber);\n\t\t\tconst anchorViewRangeStart = new Position(anchorViewRange.startLineNumber, anchorViewMinColumn);\n\t\t\tstartColumnBoundary = coordinatesConverter.convertViewPositionToModelPosition(anchorViewRangeStart).column;\n\t\t}\n\n\t\t// The anchor range is always on a single line\n\t\tconst anchorStartLineNumber = anchorRange.startLineNumber;\n\t\tlet secondaryPositionColumn = anchorRange.startColumn;\n\t\tlet forceShowAtRange: Range | undefined;\n\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\tconst hoverPartRangeOnAnchorStartLine = hoverPartRange.startLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeOnAnchorEndLine = hoverPartRange.endLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeIsOnAnchorLine = hoverPartRangeOnAnchorStartLine && hoverPartRangeOnAnchorEndLine;\n\t\t\tif (hoverPartRangeIsOnAnchorLine) {\n\t\t\t\t// this message has a range that is completely sitting on the line of the anchor\n\t\t\t\tconst hoverPartStartColumn = hoverPartRange.startColumn;\n\t\t\t\tconst minSecondaryPositionColumn = Math.min(secondaryPositionColumn, hoverPartStartColumn);\n\t\t\t\tsecondaryPositionColumn = Math.max(minSecondaryPositionColumn, startColumnBoundary);\n\t\t\t}\n\t\t\tif (hoverPart.forceShowAtRange) {\n\t\t\t\tforceShowAtRange = hoverPartRange;\n\t\t\t}\n\t\t}\n\n\t\tlet showAtPosition: Position;\n\t\tlet showAtSecondaryPosition: Position;\n\t\tif (forceShowAtRange) {\n\t\t\tconst forceShowAtPosition = forceShowAtRange.getStartPosition();\n\t\t\tshowAtPosition = forceShowAtPosition;\n\t\t\tshowAtSecondaryPosition = forceShowAtPosition;\n\t\t} else {\n\t\t\tshowAtPosition = anchorRange.getStartPosition();\n\t\t\tshowAtSecondaryPosition = new Position(anchorStartLineNumber, secondaryPositionColumn);\n\t\t}\n\t\treturn {\n\t\t\tshowAtPosition,\n\t\t\tshowAtSecondaryPosition,\n\t\t};\n\t}\n}\n\ninterface IRenderedContentHoverPart {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'hoverPart';\n\t/**\n\t * Participant of the rendered hover part\n\t */\n\tparticipant: IEditorHoverParticipant<IHoverPart>;\n\t/**\n\t * The rendered hover part\n\t */\n\thoverPart: IHoverPart;\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n}\n\ninterface IRenderedContentStatusBar {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'statusBar';\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n\t/**\n\t * The actions of the hover status bar.\n\t */\n\tactions: HoverAction[];\n}\n\ntype IRenderedContentHoverPartOrStatusBar = IRenderedContentHoverPart | IRenderedContentStatusBar;\n\nclass RenderedStatusBar implements IDisposable {\n\n\tconstructor(fragment: DocumentFragment, private readonly _statusBar: EditorHoverStatusBar) {\n\t\tfragment.appendChild(this._statusBar.hoverElement);\n\t}\n\n\tget hoverElement(): HTMLElement {\n\t\treturn this._statusBar.hoverElement;\n\t}\n\n\tget actions(): HoverAction[] {\n\t\treturn this._statusBar.actions;\n\t}\n\n\tdispose() {\n\t\tthis._statusBar.dispose();\n\t}\n}\n\nclass RenderedContentHoverParts extends Disposable {\n\n\tprivate static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({\n\t\tdescription: 'content-hover-highlight',\n\t\tclassName: 'hoverHighlight'\n\t});\n\n\tprivate readonly _renderedParts: IRenderedContentHoverPartOrStatusBar[] = [];\n\tprivate readonly _fragment: DocumentFragment;\n\tprivate readonly _context: IEditorHoverContext;\n\n\tprivate _markdownHoverParticipant: MarkdownHoverParticipant | undefined;\n\tprivate _colorHoverParticipant: HoverColorPickerParticipant | undefined;\n\tprivate _focusedHoverPartIndex: number = -1;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\thoverParts: IHoverPart[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService private readonly _hoverService: IHoverService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._fragment = document.createDocumentFragment();\n\t\tthis._register(this._renderParts(participants, hoverParts, context, keybindingService, this._hoverService));\n\t\tthis._register(this._registerListenersOnRenderedParts());\n\t\tthis._register(this._createEditorDecorations(editor, hoverParts));\n\t\tthis._updateMarkdownAndColorParticipantInfo(participants);\n\t}\n\n\tprivate _createEditorDecorations(editor: ICodeEditor, hoverParts: IHoverPart[]): IDisposable {\n\t\tif (hoverParts.length === 0) {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tlet highlightRange = hoverParts[0].range;\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\thighlightRange = Range.plusRange(highlightRange, hoverPartRange);\n\t\t}\n\t\tconst highlightDecoration = editor.createDecorationsCollection();\n\t\thighlightDecoration.set([{\n\t\t\trange: highlightRange,\n\t\t\toptions: RenderedContentHoverParts._DECORATION_OPTIONS\n\t\t}]);\n\t\treturn toDisposable(() => {\n\t\t\thighlightDecoration.clear();\n\t\t});\n\t}\n\n\tprivate _renderParts(participants: IEditorHoverParticipant<IHoverPart>[], hoverParts: IHoverPart[], hoverContext: IEditorHoverContext, keybindingService: IKeybindingService, hoverService: IHoverService): IDisposable {\n\t\tconst statusBar = new EditorHoverStatusBar(keybindingService, hoverService);\n\t\tconst hoverRenderingContext: IEditorHoverRenderContext = {\n\t\t\tfragment: this._fragment,\n\t\t\tstatusBar,\n\t\t\t...hoverContext\n\t\t};\n\t\tconst disposables = new DisposableStore();\n\t\tdisposables.add(statusBar);\n\t\tfor (const participant of participants) {\n\t\t\tconst renderedHoverParts = this._renderHoverPartsForParticipant(hoverParts, participant, hoverRenderingContext);\n\t\t\tdisposables.add(renderedHoverParts);\n\t\t\tfor (const renderedHoverPart of renderedHoverParts.renderedHoverParts) {\n\t\t\t\tthis._renderedParts.push({\n\t\t\t\t\ttype: 'hoverPart',\n\t\t\t\t\tparticipant,\n\t\t\t\t\thoverPart: renderedHoverPart.hoverPart,\n\t\t\t\t\thoverElement: renderedHoverPart.hoverElement,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst renderedStatusBar = this._renderStatusBar(this._fragment, statusBar);\n\t\tif (renderedStatusBar) {\n\t\t\tdisposables.add(renderedStatusBar);\n\t\t\tthis._renderedParts.push({\n\t\t\t\ttype: 'statusBar',\n\t\t\t\thoverElement: renderedStatusBar.hoverElement,\n\t\t\t\tactions: renderedStatusBar.actions,\n\t\t\t});\n\t\t}\n\t\treturn disposables;\n\t}\n\n\tprivate _renderHoverPartsForParticipant(hoverParts: IHoverPart[], participant: IEditorHoverParticipant<IHoverPart>, hoverRenderingContext: IEditorHoverRenderContext): IRenderedHoverParts<IHoverPart> {\n\t\tconst hoverPartsForParticipant = hoverParts.filter(hoverPart => hoverPart.owner === participant);\n\t\tconst hasHoverPartsForParticipant = hoverPartsForParticipant.length > 0;\n\t\tif (!hasHoverPartsForParticipant) {\n\t\t\treturn new RenderedHoverParts([]);\n\t\t}\n\t\treturn participant.renderHoverParts(hoverRenderingContext, hoverPartsForParticipant);\n\t}\n\n\tprivate _renderStatusBar(fragment: DocumentFragment, statusBar: EditorHoverStatusBar): RenderedStatusBar | undefined {\n\t\tif (!statusBar.hasContent) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new RenderedStatusBar(fragment, statusBar);\n\t}\n\n\tprivate _registerListenersOnRenderedParts(): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\t\tthis._renderedParts.forEach((renderedPart: IRenderedContentHoverPartOrStatusBar, index: number) => {\n\t\t\tconst element = renderedPart.hoverElement;\n\t\t\telement.tabIndex = 0;\n\t\t\tdisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_IN, (event: Event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tthis._focusedHoverPartIndex = index;\n\t\t\t}));\n\t\t\tdisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_OUT, (event: Event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tthis._focusedHoverPartIndex = -1;\n\t\t\t}));\n\t\t\t// Add copy button for marker hovers\n\t\t\tif (renderedPart.type === 'hoverPart' && renderedPart.hoverPart instanceof MarkerHover) {\n\t\t\t\tdisposables.add(new HoverCopyButton(\n\t\t\t\t\telement,\n\t\t\t\t\t() => renderedPart.participant.getAccessibleContent(renderedPart.hoverPart),\n\t\t\t\t\tthis._clipboardService,\n\t\t\t\t\tthis._hoverService\n\t\t\t\t));\n\t\t\t}\n\t\t});\n\t\treturn disposables;\n\t}\n\n\tprivate _updateMarkdownAndColorParticipantInfo(participants: IEditorHoverParticipant<IHoverPart>[]) {\n\t\tconst markdownHoverParticipant = participants.find(p => {\n\t\t\treturn (p instanceof MarkdownHoverParticipant) && !(p instanceof InlayHintsHover);\n\t\t});\n\t\tif (markdownHoverParticipant) {\n\t\t\tthis._markdownHoverParticipant = markdownHoverParticipant as MarkdownHoverParticipant;\n\t\t}\n\t\tthis._colorHoverParticipant = participants.find(p => p instanceof HoverColorPickerParticipant);\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tif (index < 0 || index >= this._renderedParts.length) {\n\t\t\treturn;\n\t\t}\n\t\tthis._renderedParts[index].hoverElement.focus();\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tif (!this._markdownHoverParticipant) {\n\t\t\treturn;\n\t\t}\n\t\tlet rangeOfIndicesToUpdate: IOffsetRange;\n\t\tif (index >= 0) {\n\t\t\trangeOfIndicesToUpdate = { start: index, endExclusive: index + 1 };\n\t\t} else {\n\t\t\trangeOfIndicesToUpdate = this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);\n\t\t}\n\t\tfor (let i = rangeOfIndicesToUpdate.start; i < rangeOfIndicesToUpdate.endExclusive; i++) {\n\t\t\tconst normalizedMarkdownHoverIndex = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, i);\n\t\t\tif (normalizedMarkdownHoverIndex === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst renderedPart = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(action, normalizedMarkdownHoverIndex);\n\t\t\tif (!renderedPart) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis._renderedParts[i] = {\n\t\t\t\ttype: 'hoverPart',\n\t\t\t\tparticipant: this._markdownHoverParticipant,\n\t\t\t\thoverPart: renderedPart.hoverPart,\n\t\t\t\thoverElement: renderedPart.hoverElement,\n\t\t\t};\n\t\t}\n\t\tif (focus) {\n\t\t\tif (index >= 0) {\n\t\t\t\tthis.focusHoverPartWithIndex(index);\n\t\t\t} else {\n\t\t\t\tthis._context.focus();\n\t\t\t}\n\t\t}\n\t\tthis._context.onContentsChanged();\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._colorHoverParticipant?.isColorPickerVisible() ?? false;\n\t}\n\n\tprivate _normalizedIndexToMarkdownHoverIndexRange(markdownHoverParticipant: MarkdownHoverParticipant, index: number): number | undefined {\n\t\tconst renderedPart = this._renderedParts[index];\n\t\tif (!renderedPart || renderedPart.type !== 'hoverPart') {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst isHoverPartMarkdownHover = renderedPart.participant === markdownHoverParticipant;\n\t\tif (!isHoverPartMarkdownHover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst firstIndexOfMarkdownHovers = this._renderedParts.findIndex(renderedPart =>\n\t\t\trenderedPart.type === 'hoverPart'\n\t\t\t&& renderedPart.participant === markdownHoverParticipant\n\t\t);\n\t\tif (firstIndexOfMarkdownHovers === -1) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\t\treturn index - firstIndexOfMarkdownHovers;\n\t}\n\n\tprivate _findRangeOfMarkdownHoverParts(markdownHoverParticipant: MarkdownHoverParticipant): IOffsetRange {\n\t\tconst copiedRenderedParts = this._renderedParts.slice();\n\t\tconst firstIndexOfMarkdownHovers = copiedRenderedParts.findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst inversedLastIndexOfMarkdownHovers = copiedRenderedParts.reverse().findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst lastIndexOfMarkdownHovers = inversedLastIndexOfMarkdownHovers >= 0 ? copiedRenderedParts.length - inversedLastIndexOfMarkdownHovers : inversedLastIndexOfMarkdownHovers;\n\t\treturn { start: firstIndexOfMarkdownHovers, endExclusive: lastIndexOfMarkdownHovers + 1 };\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._fragment;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._fragment.hasChildNodes();\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedParts.length;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IEditorHoverContext, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverParts, RenderedHoverParts } from './hoverTypes.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { EditorHoverStatusBar } from './contentHoverStatusBar.js';\nimport { HoverStartSource } from './hoverOperation.js';\nimport { HoverCopyButton } from './hoverCopyButton.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { ContentHoverResult } from './contentHoverTypes.js';\nimport * as dom from '../../../../base/browser/dom.js';\nimport { HoverVerbosityAction } from '../../../common/languages.js';\nimport { MarkdownHoverParticipant } from './markdownHoverParticipant.js';\nimport { HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';\nimport { InlayHintsHover } from '../../inlayHints/browser/inlayHintsHover.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { HoverAction } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverService } from '../../../../platform/hover/browser/hover.js';\nimport { IOffsetRange } from '../../../common/core/ranges/offsetRange.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\nimport { MarkerHover } from './markerHoverParticipant.js';\n\nexport class RenderedContentHover extends Disposable {\n\n\tpublic closestMouseDistance: number | undefined;\n\tpublic initialMousePosX: number | undefined;\n\tpublic initialMousePosY: number | undefined;\n\n\tpublic readonly showAtPosition: Position;\n\tpublic readonly showAtSecondaryPosition: Position;\n\tpublic readonly shouldFocus: boolean;\n\tpublic readonly source: HoverStartSource;\n\tpublic readonly shouldAppearBeforeContent: boolean;\n\n\tprivate readonly _renderedHoverParts: RenderedContentHoverParts;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\thoverResult: ContentHoverResult,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService hoverService: IHoverService,\n\t\t@IClipboardService clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tconst parts = hoverResult.hoverParts;\n\t\tthis._renderedHoverParts = this._register(new RenderedContentHoverParts(\n\t\t\teditor,\n\t\t\tparticipants,\n\t\t\tparts,\n\t\t\tcontext,\n\t\t\tkeybindingService,\n\t\t\thoverService,\n\t\t\tclipboardService\n\t\t));\n\t\tconst contentHoverComputerOptions = hoverResult.options;\n\t\tconst anchor = contentHoverComputerOptions.anchor;\n\t\tconst { showAtPosition, showAtSecondaryPosition } = RenderedContentHover.computeHoverPositions(editor, anchor.range, parts);\n\t\tthis.shouldAppearBeforeContent = parts.some(m => m.isBeforeContent);\n\t\tthis.showAtPosition = showAtPosition;\n\t\tthis.showAtSecondaryPosition = showAtSecondaryPosition;\n\t\tthis.initialMousePosX = anchor.initialMousePosX;\n\t\tthis.initialMousePosY = anchor.initialMousePosY;\n\t\tthis.shouldFocus = contentHoverComputerOptions.shouldFocus;\n\t\tthis.source = contentHoverComputerOptions.source;\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._renderedHoverParts.domNode;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._renderedHoverParts.domNodeHasChildren;\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._renderedHoverParts.focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedHoverParts.hoverPartsCount;\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tthis._renderedHoverParts.focusHoverPartWithIndex(index);\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tthis._renderedHoverParts.updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._renderedHoverParts.isColorPickerVisible();\n\t}\n\n\tpublic static computeHoverPositions(editor: ICodeEditor, anchorRange: Range, hoverParts: IHoverPart[]): { showAtPosition: Position; showAtSecondaryPosition: Position } {\n\n\t\tlet startColumnBoundary = 1;\n\t\tif (editor.hasModel()) {\n\t\t\t// Ensure the range is on the current view line\n\t\t\tconst viewModel = editor._getViewModel();\n\t\t\tconst coordinatesConverter = viewModel.coordinatesConverter;\n\t\t\tconst anchorViewRange = coordinatesConverter.convertModelRangeToViewRange(anchorRange);\n\t\t\tconst anchorViewMinColumn = viewModel.getLineMinColumn(anchorViewRange.startLineNumber);\n\t\t\tconst anchorViewRangeStart = new Position(anchorViewRange.startLineNumber, anchorViewMinColumn);\n\t\t\tstartColumnBoundary = coordinatesConverter.convertViewPositionToModelPosition(anchorViewRangeStart).column;\n\t\t}\n\n\t\t// The anchor range is always on a single line\n\t\tconst anchorStartLineNumber = anchorRange.startLineNumber;\n\t\tlet secondaryPositionColumn = anchorRange.startColumn;\n\t\tlet forceShowAtRange: Range | undefined;\n\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\tconst hoverPartRangeOnAnchorStartLine = hoverPartRange.startLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeOnAnchorEndLine = hoverPartRange.endLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeIsOnAnchorLine = hoverPartRangeOnAnchorStartLine && hoverPartRangeOnAnchorEndLine;\n\t\t\tif (hoverPartRangeIsOnAnchorLine) {\n\t\t\t\t// this message has a range that is completely sitting on the line of the anchor\n\t\t\t\tconst hoverPartStartColumn = hoverPartRange.startColumn;\n\t\t\t\tconst minSecondaryPositionColumn = Math.min(secondaryPositionColumn, hoverPartStartColumn);\n\t\t\t\tsecondaryPositionColumn = Math.max(minSecondaryPositionColumn, startColumnBoundary);\n\t\t\t}\n\t\t\tif (hoverPart.forceShowAtRange) {\n\t\t\t\tforceShowAtRange = hoverPartRange;\n\t\t\t}\n\t\t}\n\n\t\tlet showAtPosition: Position;\n\t\tlet showAtSecondaryPosition: Position;\n\t\tif (forceShowAtRange) {\n\t\t\tconst forceShowAtPosition = forceShowAtRange.getStartPosition();\n\t\t\tshowAtPosition = forceShowAtPosition;\n\t\t\tshowAtSecondaryPosition = forceShowAtPosition;\n\t\t} else {\n\t\t\tshowAtPosition = anchorRange.getStartPosition();\n\t\t\tshowAtSecondaryPosition = new Position(anchorStartLineNumber, secondaryPositionColumn);\n\t\t}\n\t\treturn {\n\t\t\tshowAtPosition,\n\t\t\tshowAtSecondaryPosition,\n\t\t};\n\t}\n}\n\ninterface IRenderedContentHoverPart {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'hoverPart';\n\t/**\n\t * Participant of the rendered hover part\n\t */\n\tparticipant: IEditorHoverParticipant<IHoverPart>;\n\t/**\n\t * The rendered hover part\n\t */\n\thoverPart: IHoverPart;\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n}\n\ninterface IRenderedContentStatusBar {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'statusBar';\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n\t/**\n\t * The actions of the hover status bar.\n\t */\n\tactions: HoverAction[];\n}\n\ntype IRenderedContentHoverPartOrStatusBar = IRenderedContentHoverPart | IRenderedContentStatusBar;\n\nclass RenderedStatusBar implements IDisposable {\n\n\tconstructor(fragment: DocumentFragment, private readonly _statusBar: EditorHoverStatusBar) {\n\t\tfragment.appendChild(this._statusBar.hoverElement);\n\t}\n\n\tget hoverElement(): HTMLElement {\n\t\treturn this._statusBar.hoverElement;\n\t}\n\n\tget actions(): HoverAction[] {\n\t\treturn this._statusBar.actions;\n\t}\n\n\tdispose() {\n\t\tthis._statusBar.dispose();\n\t}\n}\n\nclass RenderedContentHoverParts extends Disposable {\n\n\tprivate static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({\n\t\tdescription: 'content-hover-highlight',\n\t\tclassName: 'hoverHighlight'\n\t});\n\n\tprivate readonly _renderedParts: IRenderedContentHoverPartOrStatusBar[] = [];\n\tprivate readonly _fragment: DocumentFragment;\n\tprivate readonly _context: IEditorHoverContext;\n\n\tprivate _markdownHoverParticipant: MarkdownHoverParticipant | undefined;\n\tprivate _colorHoverParticipant: HoverColorPickerParticipant | undefined;\n\tprivate _focusedHoverPartIndex: number = -1;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\thoverParts: IHoverPart[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService private readonly _hoverService: IHoverService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._fragment = document.createDocumentFragment();\n\t\tthis._register(this._renderParts(participants, hoverParts, context, keybindingService, this._hoverService));\n\t\tthis._register(this._registerListenersOnRenderedParts());\n\t\tthis._register(this._createEditorDecorations(editor, hoverParts));\n\t\tthis._updateMarkdownAndColorParticipantInfo(participants);\n\t}\n\n\tprivate _createEditorDecorations(editor: ICodeEditor, hoverParts: IHoverPart[]): IDisposable {\n\t\tif (hoverParts.length === 0) {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tlet highlightRange = hoverParts[0].range;\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\thighlightRange = Range.plusRange(highlightRange, hoverPartRange);\n\t\t}\n\t\tconst highlightDecoration = editor.createDecorationsCollection();\n\t\thighlightDecoration.set([{\n\t\t\trange: highlightRange,\n\t\t\toptions: RenderedContentHoverParts._DECORATION_OPTIONS\n\t\t}]);\n\t\treturn toDisposable(() => {\n\t\t\thighlightDecoration.clear();\n\t\t});\n\t}\n\n\tprivate _renderParts(participants: IEditorHoverParticipant<IHoverPart>[], hoverParts: IHoverPart[], hoverContext: IEditorHoverContext, keybindingService: IKeybindingService, hoverService: IHoverService): IDisposable {\n\t\tconst statusBar = new EditorHoverStatusBar(keybindingService, hoverService);\n\t\tconst hoverRenderingContext: IEditorHoverRenderContext = {\n\t\t\tfragment: this._fragment,\n\t\t\tstatusBar,\n\t\t\t...hoverContext\n\t\t};\n\t\tconst disposables = new DisposableStore();\n\t\tdisposables.add(statusBar);\n\t\tfor (const participant of participants) {\n\t\t\tconst renderedHoverParts = this._renderHoverPartsForParticipant(hoverParts, participant, hoverRenderingContext);\n\t\t\tdisposables.add(renderedHoverParts);\n\t\t\tfor (const renderedHoverPart of renderedHoverParts.renderedHoverParts) {\n\t\t\t\tthis._renderedParts.push({\n\t\t\t\t\ttype: 'hoverPart',\n\t\t\t\t\tparticipant,\n\t\t\t\t\thoverPart: renderedHoverPart.hoverPart,\n\t\t\t\t\thoverElement: renderedHoverPart.hoverElement,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst renderedStatusBar = this._renderStatusBar(this._fragment, statusBar);\n\t\tif (renderedStatusBar) {\n\t\t\tdisposables.add(renderedStatusBar);\n\t\t\tthis._renderedParts.push({\n\t\t\t\ttype: 'statusBar',\n\t\t\t\thoverElement: renderedStatusBar.hoverElement,\n\t\t\t\tactions: renderedStatusBar.actions,\n\t\t\t});\n\t\t}\n\t\treturn disposables;\n\t}\n\n\tprivate _renderHoverPartsForParticipant(hoverParts: IHoverPart[], participant: IEditorHoverParticipant<IHoverPart>, hoverRenderingContext: IEditorHoverRenderContext): IRenderedHoverParts<IHoverPart> {\n\t\tconst hoverPartsForParticipant = hoverParts.filter(hoverPart => hoverPart.owner === participant);\n\t\tconst hasHoverPartsForParticipant = hoverPartsForParticipant.length > 0;\n\t\tif (!hasHoverPartsForParticipant) {\n\t\t\treturn new RenderedHoverParts([]);\n\t\t}\n\t\treturn participant.renderHoverParts(hoverRenderingContext, hoverPartsForParticipant);\n\t}\n\n\tprivate _renderStatusBar(fragment: DocumentFragment, statusBar: EditorHoverStatusBar): RenderedStatusBar | undefined {\n\t\tif (!statusBar.hasContent) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new RenderedStatusBar(fragment, statusBar);\n\t}\n\n\tprivate _registerListenersOnRenderedParts(): IDisposable {\n\t\tconst disposables = new DisposableStore();\n\t\tthis._renderedParts.forEach((renderedPart: IRenderedContentHoverPartOrStatusBar, index: number) => {\n\t\t\tconst element = renderedPart.hoverElement;\n\t\t\telement.tabIndex = 0;\n\t\t\tdisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_IN, (event: Event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tthis._focusedHoverPartIndex = index;\n\t\t\t}));\n\t\t\tdisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_OUT, (event: Event) => {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tthis._focusedHoverPartIndex = -1;\n\t\t\t}));\n\t\t\t// Add copy button for marker hovers\n\t\t\tif (renderedPart.type === 'hoverPart' && renderedPart.hoverPart instanceof MarkerHover) {\n\t\t\t\tdisposables.add(new HoverCopyButton(\n\t\t\t\t\telement,\n\t\t\t\t\t() => renderedPart.participant.getAccessibleContent(renderedPart.hoverPart),\n\t\t\t\t\tthis._clipboardService,\n\t\t\t\t\tthis._hoverService\n\t\t\t\t));\n\t\t\t}\n\t\t});\n\t\treturn disposables;\n\t}\n\n\tprivate _updateMarkdownAndColorParticipantInfo(participants: IEditorHoverParticipant<IHoverPart>[]) {\n\t\tconst markdownHoverParticipant = participants.find(p => {\n\t\t\treturn (p instanceof MarkdownHoverParticipant) && !(p instanceof InlayHintsHover);\n\t\t});\n\t\tif (markdownHoverParticipant) {\n\t\t\tthis._markdownHoverParticipant = markdownHoverParticipant as MarkdownHoverParticipant;\n\t\t}\n\t\tthis._colorHoverParticipant = participants.find(p => p instanceof HoverColorPickerParticipant);\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tif (index < 0 || index >= this._renderedParts.length) {\n\t\t\treturn;\n\t\t}\n\t\tthis._renderedParts[index].hoverElement.focus();\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tif (!this._markdownHoverParticipant) {\n\t\t\treturn;\n\t\t}\n\t\tlet rangeOfIndicesToUpdate: IOffsetRange;\n\t\tif (index >= 0) {\n\t\t\trangeOfIndicesToUpdate = { start: index, endExclusive: index + 1 };\n\t\t} else {\n\t\t\trangeOfIndicesToUpdate = this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);\n\t\t}\n\t\tfor (let i = rangeOfIndicesToUpdate.start; i < rangeOfIndicesToUpdate.endExclusive; i++) {\n\t\t\tconst normalizedMarkdownHoverIndex = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, i);\n\t\t\tif (normalizedMarkdownHoverIndex === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst renderedPart = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(action, normalizedMarkdownHoverIndex);\n\t\t\tif (!renderedPart) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis._renderedParts[i] = {\n\t\t\t\ttype: 'hoverPart',\n\t\t\t\tparticipant: this._markdownHoverParticipant,\n\t\t\t\thoverPart: renderedPart.hoverPart,\n\t\t\t\thoverElement: renderedPart.hoverElement,\n\t\t\t};\n\t\t}\n\t\tif (focus) {\n\t\t\tif (index >= 0) {\n\t\t\t\tthis.focusHoverPartWithIndex(index);\n\t\t\t} else {\n\t\t\t\tthis._context.focus();\n\t\t\t}\n\t\t}\n\t\tthis._context.onContentsChanged();\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._colorHoverParticipant?.isColorPickerVisible() ?? false;\n\t}\n\n\tprivate _normalizedIndexToMarkdownHoverIndexRange(markdownHoverParticipant: MarkdownHoverParticipant, index: number): number | undefined {\n\t\tconst renderedPart = this._renderedParts[index];\n\t\tif (!renderedPart || renderedPart.type !== 'hoverPart') {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst isHoverPartMarkdownHover = renderedPart.participant === markdownHoverParticipant;\n\t\tif (!isHoverPartMarkdownHover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst firstIndexOfMarkdownHovers = this._renderedParts.findIndex(renderedPart =>\n\t\t\trenderedPart.type === 'hoverPart'\n\t\t\t&& renderedPart.participant === markdownHoverParticipant\n\t\t);\n\t\tif (firstIndexOfMarkdownHovers === -1) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\t\treturn index - firstIndexOfMarkdownHovers;\n\t}\n\n\tprivate _findRangeOfMarkdownHoverParts(markdownHoverParticipant: MarkdownHoverParticipant): IOffsetRange {\n\t\tconst copiedRenderedParts = this._renderedParts.slice();\n\t\tconst firstIndexOfMarkdownHovers = copiedRenderedParts.findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst inversedLastIndexOfMarkdownHovers = copiedRenderedParts.reverse().findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst lastIndexOfMarkdownHovers = inversedLastIndexOfMarkdownHovers >= 0 ? copiedRenderedParts.length - inversedLastIndexOfMarkdownHovers : inversedLastIndexOfMarkdownHovers;\n\t\treturn { start: firstIndexOfMarkdownHovers, endExclusive: lastIndexOfMarkdownHovers + 1 };\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._fragment;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._fragment.hasChildNodes();\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedParts.length;\n\t}\n}\n"]}
@@ -25,13 +25,15 @@ import { Emitter } from '../../../../base/common/event.js';
25
25
  import { RenderedContentHover } from './contentHoverRendered.js';
26
26
  import { isMousePositionWithinElement } from './hoverUtils.js';
27
27
  import { IHoverService } from '../../../../platform/hover/browser/hover.js';
28
+ import { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';
28
29
  let ContentHoverWidgetWrapper = class ContentHoverWidgetWrapper extends Disposable {
29
- constructor(_editor, _instantiationService, _keybindingService, _hoverService) {
30
+ constructor(_editor, _instantiationService, _keybindingService, _hoverService, _clipboardService) {
30
31
  super();
31
32
  this._editor = _editor;
32
33
  this._instantiationService = _instantiationService;
33
34
  this._keybindingService = _keybindingService;
34
35
  this._hoverService = _hoverService;
36
+ this._clipboardService = _clipboardService;
35
37
  this._currentResult = null;
36
38
  this._renderedContentHover = this._register(new MutableDisposable());
37
39
  this._onContentsChanged = this._register(new Emitter());
@@ -197,7 +199,7 @@ let ContentHoverWidgetWrapper = class ContentHoverWidgetWrapper extends Disposab
197
199
  }
198
200
  _showHover(hoverResult) {
199
201
  const context = this._getHoverContext();
200
- this._renderedContentHover.value = new RenderedContentHover(this._editor, hoverResult, this._participants, context, this._keybindingService, this._hoverService);
202
+ this._renderedContentHover.value = new RenderedContentHover(this._editor, hoverResult, this._participants, context, this._keybindingService, this._hoverService, this._clipboardService);
201
203
  if (this._renderedContentHover.value.domNodeHasChildren) {
202
204
  this._contentHoverWidget.show(this._renderedContentHover.value);
203
205
  }
@@ -352,7 +354,8 @@ let ContentHoverWidgetWrapper = class ContentHoverWidgetWrapper extends Disposab
352
354
  ContentHoverWidgetWrapper = __decorate([
353
355
  __param(1, IInstantiationService),
354
356
  __param(2, IKeybindingService),
355
- __param(3, IHoverService)
357
+ __param(3, IHoverService),
358
+ __param(4, IClipboardService)
356
359
  ], ContentHoverWidgetWrapper);
357
360
  export { ContentHoverWidgetWrapper };
358
361
  //# sourceMappingURL=contentHoverWidgetWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/v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AA;GAhBH,yBAAyB,CAmXrC","file":"contentHoverWidgetWrapper.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 { KeyCode } from '../../../../base/common/keyCodes.js';\nimport { Disposable, MutableDisposable } from '../../../../base/common/lifecycle.js';\nimport { ICodeEditor, IEditorMouseEvent, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Range } from '../../../common/core/range.js';\nimport { TokenizationRegistry } from '../../../common/languages.js';\nimport { HoverOperation, HoverResult, HoverStartMode, HoverStartSource } from './hoverOperation.js';\nimport { HoverAnchor, HoverParticipantRegistry, HoverRangeAnchor, IEditorHoverContext, IEditorHoverParticipant, IHoverPart, IHoverWidget } from './hoverTypes.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { HoverVerbosityAction } from '../../../common/standalone/standaloneEnums.js';\nimport { ContentHoverWidget } from './contentHoverWidget.js';\nimport { ContentHoverComputer, ContentHoverComputerOptions } from './contentHoverComputer.js';\nimport { ContentHoverResult } from './contentHoverTypes.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { RenderedContentHover } from './contentHoverRendered.js';\nimport { isMousePositionWithinElement } from './hoverUtils.js';\nimport { IHoverService } from '../../../../platform/hover/browser/hover.js';\n\nexport class ContentHoverWidgetWrapper extends Disposable implements IHoverWidget {\n\n\tprivate _currentResult: ContentHoverResult | null = null;\n\tprivate readonly _renderedContentHover = this._register(new MutableDisposable<RenderedContentHover>());\n\n\tprivate readonly _contentHoverWidget: ContentHoverWidget;\n\tprivate readonly _participants: IEditorHoverParticipant[];\n\tprivate readonly _hoverOperation: HoverOperation<ContentHoverComputerOptions, IHoverPart>;\n\n\tprivate readonly _onContentsChanged = this._register(new Emitter<void>());\n\tpublic readonly onContentsChanged = this._onContentsChanged.event;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@IHoverService private readonly _hoverService: IHoverService\n\t) {\n\t\tsuper();\n\t\tthis._contentHoverWidget = this._register(this._instantiationService.createInstance(ContentHoverWidget, this._editor));\n\t\tthis._participants = this._initializeHoverParticipants();\n\t\tthis._hoverOperation = this._register(new HoverOperation(this._editor, new ContentHoverComputer(this._editor, this._participants)));\n\t\tthis._registerListeners();\n\t}\n\n\tprivate _initializeHoverParticipants(): IEditorHoverParticipant[] {\n\t\tconst participants: IEditorHoverParticipant[] = [];\n\t\tfor (const participant of HoverParticipantRegistry.getAll()) {\n\t\t\tconst participantInstance = this._instantiationService.createInstance(participant, this._editor);\n\t\t\tparticipants.push(participantInstance);\n\t\t}\n\t\tparticipants.sort((p1, p2) => p1.hoverOrdinal - p2.hoverOrdinal);\n\t\tthis._register(this._contentHoverWidget.onDidResize(() => {\n\t\t\tthis._participants.forEach(participant => participant.handleResize?.());\n\t\t}));\n\t\tthis._register(this._contentHoverWidget.onDidScroll((e) => {\n\t\t\tthis._participants.forEach(participant => participant.handleScroll?.(e));\n\t\t}));\n\t\tthis._register(this._contentHoverWidget.onContentsChanged(() => {\n\t\t\tthis._participants.forEach(participant => participant.handleContentsChanged?.());\n\t\t}));\n\t\treturn participants;\n\t}\n\n\tprivate _registerListeners(): void {\n\t\tthis._register(this._hoverOperation.onResult((result) => {\n\t\t\tconst messages = (result.hasLoadingMessage ? this._addLoadingMessage(result) : result.value);\n\t\t\tthis._withResult(new ContentHoverResult(messages, result.isComplete, result.options));\n\t\t}));\n\t\tconst contentHoverWidgetNode = this._contentHoverWidget.getDomNode();\n\t\tthis._register(dom.addStandardDisposableListener(contentHoverWidgetNode, 'keydown', (e) => {\n\t\t\tif (e.equals(KeyCode.Escape)) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}));\n\t\tthis._register(dom.addStandardDisposableListener(contentHoverWidgetNode, 'mouseleave', (e) => {\n\t\t\tthis._onMouseLeave(e);\n\t\t}));\n\t\tthis._register(TokenizationRegistry.onDidChange(() => {\n\t\t\tif (this._contentHoverWidget.position && this._currentResult) {\n\t\t\t\tthis._setCurrentResult(this._currentResult); // render again\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._contentHoverWidget.onContentsChanged(() => {\n\t\t\tthis._onContentsChanged.fire();\n\t\t}));\n\t}\n\n\t/**\n\t * Returns true if the hover shows now or will show.\n\t */\n\tprivate _startShowingOrUpdateHover(\n\t\tanchor: HoverAnchor | null,\n\t\tmode: HoverStartMode,\n\t\tsource: HoverStartSource,\n\t\tfocus: boolean,\n\t\tmouseEvent: IEditorMouseEvent | null\n\t): boolean {\n\t\tconst contentHoverIsVisible = this._contentHoverWidget.position && this._currentResult;\n\t\tif (!contentHoverIsVisible) {\n\t\t\tif (anchor) {\n\t\t\t\tthis._startHoverOperationIfNecessary(anchor, mode, source, focus, false);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tconst isHoverSticky = this._editor.getOption(EditorOption.hover).sticky;\n\t\tconst isMouseGettingCloser = mouseEvent && this._contentHoverWidget.isMouseGettingCloser(mouseEvent.event.posx, mouseEvent.event.posy);\n\t\tconst isHoverStickyAndIsMouseGettingCloser = isHoverSticky && isMouseGettingCloser;\n\t\t// The mouse is getting closer to the hover, so we will keep the hover untouched\n\t\t// But we will kick off a hover update at the new anchor, insisting on keeping the hover visible.\n\t\tif (isHoverStickyAndIsMouseGettingCloser) {\n\t\t\tif (anchor) {\n\t\t\t\tthis._startHoverOperationIfNecessary(anchor, mode, source, focus, true);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t// If mouse is not getting closer and anchor not defined, hide the hover\n\t\tif (!anchor) {\n\t\t\tthis._setCurrentResult(null);\n\t\t\treturn false;\n\t\t}\n\t\t// If mouse if not getting closer and anchor is defined, and the new anchor is the same as the previous anchor\n\t\tconst currentAnchorEqualsPreviousAnchor = this._currentResult && this._currentResult.options.anchor.equals(anchor);\n\t\tif (currentAnchorEqualsPreviousAnchor) {\n\t\t\treturn true;\n\t\t}\n\t\t// If mouse if not getting closer and anchor is defined, and the new anchor is not compatible with the previous anchor\n\t\tconst currentAnchorCompatibleWithPreviousAnchor = this._currentResult && anchor.canAdoptVisibleHover(this._currentResult.options.anchor, this._contentHoverWidget.position);\n\t\tif (!currentAnchorCompatibleWithPreviousAnchor) {\n\t\t\tthis._setCurrentResult(null);\n\t\t\tthis._startHoverOperationIfNecessary(anchor, mode, source, focus, false);\n\t\t\treturn true;\n\t\t}\n\t\t// We aren't getting any closer to the hover, so we will filter existing results\n\t\t// and keep those which also apply to the new anchor.\n\t\tif (this._currentResult) {\n\t\t\tthis._setCurrentResult(this._currentResult.filter(anchor));\n\t\t}\n\t\tthis._startHoverOperationIfNecessary(anchor, mode, source, focus, false);\n\t\treturn true;\n\t}\n\n\tprivate _startHoverOperationIfNecessary(anchor: HoverAnchor, mode: HoverStartMode, source: HoverStartSource, shouldFocus: boolean, insistOnKeepingHoverVisible: boolean): void {\n\t\tconst currentAnchorEqualToPreviousHover = this._hoverOperation.options && this._hoverOperation.options.anchor.equals(anchor);\n\t\tif (currentAnchorEqualToPreviousHover) {\n\t\t\treturn;\n\t\t}\n\t\tthis._hoverOperation.cancel();\n\t\tconst contentHoverComputerOptions: ContentHoverComputerOptions = {\n\t\t\tanchor,\n\t\t\tsource,\n\t\t\tshouldFocus,\n\t\t\tinsistOnKeepingHoverVisible\n\t\t};\n\t\tthis._hoverOperation.start(mode, contentHoverComputerOptions);\n\t}\n\n\tprivate _setCurrentResult(hoverResult: ContentHoverResult | null): void {\n\t\tlet currentHoverResult = hoverResult;\n\t\tconst currentResultEqualToPreviousResult = this._currentResult === currentHoverResult;\n\t\tif (currentResultEqualToPreviousResult) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentHoverResultIsEmpty = currentHoverResult && currentHoverResult.hoverParts.length === 0;\n\t\tif (currentHoverResultIsEmpty) {\n\t\t\tcurrentHoverResult = null;\n\t\t}\n\t\tthis._currentResult = currentHoverResult;\n\t\tif (this._currentResult) {\n\t\t\tthis._showHover(this._currentResult);\n\t\t} else {\n\t\t\tthis._hideHover();\n\t\t}\n\t}\n\n\tprivate _addLoadingMessage(hoverResult: HoverResult<ContentHoverComputerOptions, IHoverPart>): IHoverPart[] {\n\t\tfor (const participant of this._participants) {\n\t\t\tif (!participant.createLoadingMessage) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst loadingMessage = participant.createLoadingMessage(hoverResult.options.anchor);\n\t\t\tif (!loadingMessage) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn hoverResult.value.slice(0).concat([loadingMessage]);\n\t\t}\n\t\treturn hoverResult.value;\n\t}\n\n\tprivate _withResult(hoverResult: ContentHoverResult): void {\n\t\tconst previousHoverIsVisibleWithCompleteResult = this._contentHoverWidget.position && this._currentResult && this._currentResult.isComplete;\n\t\tif (!previousHoverIsVisibleWithCompleteResult) {\n\t\t\tthis._setCurrentResult(hoverResult);\n\t\t}\n\t\t// The hover is visible with a previous complete result.\n\t\tconst isCurrentHoverResultComplete = hoverResult.isComplete;\n\t\tif (!isCurrentHoverResultComplete) {\n\t\t\t// Instead of rendering the new partial result, we wait for the result to be complete.\n\t\t\treturn;\n\t\t}\n\t\tconst currentHoverResultIsEmpty = hoverResult.hoverParts.length === 0;\n\t\tconst insistOnKeepingPreviousHoverVisible = hoverResult.options.insistOnKeepingHoverVisible;\n\t\tconst shouldKeepPreviousHoverVisible = currentHoverResultIsEmpty && insistOnKeepingPreviousHoverVisible;\n\t\tif (shouldKeepPreviousHoverVisible) {\n\t\t\t// The hover would now hide normally, so we'll keep the previous messages\n\t\t\treturn;\n\t\t}\n\t\tthis._setCurrentResult(hoverResult);\n\t}\n\n\tprivate _showHover(hoverResult: ContentHoverResult): void {\n\t\tconst context = this._getHoverContext();\n\t\tthis._renderedContentHover.value = new RenderedContentHover(this._editor, hoverResult, this._participants, context, this._keybindingService, this._hoverService);\n\t\tif (this._renderedContentHover.value.domNodeHasChildren) {\n\t\t\tthis._contentHoverWidget.show(this._renderedContentHover.value);\n\t\t} else {\n\t\t\tthis._renderedContentHover.clear();\n\t\t}\n\t}\n\n\tprivate _hideHover(): void {\n\t\tthis._contentHoverWidget.hide();\n\t\tthis._participants.forEach(participant => participant.handleHide?.());\n\t}\n\n\tprivate _getHoverContext(): IEditorHoverContext {\n\t\tconst hide = () => {\n\t\t\tthis.hide();\n\t\t};\n\t\tconst onContentsChanged = () => {\n\t\t\tthis._contentHoverWidget.handleContentsChanged();\n\t\t};\n\t\tconst setMinimumDimensions = (dimensions: dom.Dimension) => {\n\t\t\tthis._contentHoverWidget.setMinimumDimensions(dimensions);\n\t\t};\n\t\tconst focus = () => this.focus();\n\t\treturn { hide, onContentsChanged, setMinimumDimensions, focus };\n\t}\n\n\n\tpublic showsOrWillShow(mouseEvent: IEditorMouseEvent): boolean {\n\t\tconst isContentWidgetResizing = this._contentHoverWidget.isResizing;\n\t\tif (isContentWidgetResizing) {\n\t\t\treturn true;\n\t\t}\n\t\tconst anchorCandidates: HoverAnchor[] = this._findHoverAnchorCandidates(mouseEvent);\n\t\tconst anchorCandidatesExist = anchorCandidates.length > 0;\n\t\tif (!anchorCandidatesExist) {\n\t\t\treturn this._startShowingOrUpdateHover(null, HoverStartMode.Delayed, HoverStartSource.Mouse, false, mouseEvent);\n\t\t}\n\t\tconst anchor = anchorCandidates[0];\n\t\treturn this._startShowingOrUpdateHover(anchor, HoverStartMode.Delayed, HoverStartSource.Mouse, false, mouseEvent);\n\t}\n\n\tprivate _findHoverAnchorCandidates(mouseEvent: IEditorMouseEvent): HoverAnchor[] {\n\t\tconst anchorCandidates: HoverAnchor[] = [];\n\t\tfor (const participant of this._participants) {\n\t\t\tif (!participant.suggestHoverAnchor) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst anchor = participant.suggestHoverAnchor(mouseEvent);\n\t\t\tif (!anchor) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tanchorCandidates.push(anchor);\n\t\t}\n\t\tconst target = mouseEvent.target;\n\t\tswitch (target.type) {\n\t\t\tcase MouseTargetType.CONTENT_TEXT: {\n\t\t\t\tanchorCandidates.push(new HoverRangeAnchor(0, target.range, mouseEvent.event.posx, mouseEvent.event.posy));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase MouseTargetType.CONTENT_EMPTY: {\n\t\t\t\tconst epsilon = this._editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth / 2;\n\t\t\t\t// Let hover kick in even when the mouse is technically in the empty area after a line, given the distance is small enough\n\t\t\t\tconst mouseIsWithinLinesAndCloseToHover = !target.detail.isAfterLines\n\t\t\t\t\t&& typeof target.detail.horizontalDistanceToText === 'number'\n\t\t\t\t\t&& target.detail.horizontalDistanceToText < epsilon;\n\t\t\t\tif (!mouseIsWithinLinesAndCloseToHover) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tanchorCandidates.push(new HoverRangeAnchor(0, target.range, mouseEvent.event.posx, mouseEvent.event.posy));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tanchorCandidates.sort((a, b) => b.priority - a.priority);\n\t\treturn anchorCandidates;\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\tpublic startShowingAtRange(range: Range, mode: HoverStartMode, source: HoverStartSource, focus: boolean): void {\n\t\tthis._startShowingOrUpdateHover(new HoverRangeAnchor(0, range, undefined, undefined), mode, source, focus, null);\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tthis._renderedContentHover.value?.updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic focusedHoverPartIndex(): number {\n\t\treturn this._renderedContentHover.value?.focusedHoverPartIndex ?? -1;\n\t}\n\n\tpublic containsNode(node: Node | null | undefined): boolean {\n\t\treturn (node ? this._contentHoverWidget.getDomNode().contains(node) : false);\n\t}\n\n\tpublic focus(): void {\n\t\tconst hoverPartsCount = this._renderedContentHover.value?.hoverPartsCount;\n\t\tif (hoverPartsCount === 1) {\n\t\t\tthis.focusHoverPartWithIndex(0);\n\t\t\treturn;\n\t\t}\n\t\tthis._contentHoverWidget.focus();\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tthis._renderedContentHover.value?.focusHoverPartWithIndex(index);\n\t}\n\n\tpublic scrollUp(): void {\n\t\tthis._contentHoverWidget.scrollUp();\n\t}\n\n\tpublic scrollDown(): void {\n\t\tthis._contentHoverWidget.scrollDown();\n\t}\n\n\tpublic scrollLeft(): void {\n\t\tthis._contentHoverWidget.scrollLeft();\n\t}\n\n\tpublic scrollRight(): void {\n\t\tthis._contentHoverWidget.scrollRight();\n\t}\n\n\tpublic pageUp(): void {\n\t\tthis._contentHoverWidget.pageUp();\n\t}\n\n\tpublic pageDown(): void {\n\t\tthis._contentHoverWidget.pageDown();\n\t}\n\n\tpublic goToTop(): void {\n\t\tthis._contentHoverWidget.goToTop();\n\t}\n\n\tpublic goToBottom(): void {\n\t\tthis._contentHoverWidget.goToBottom();\n\t}\n\n\tpublic hide(): void {\n\t\tthis._hoverOperation.cancel();\n\t\tthis._setCurrentResult(null);\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._contentHoverWidget.getDomNode();\n\t}\n\n\tpublic get isColorPickerVisible(): boolean {\n\t\treturn this._renderedContentHover.value?.isColorPickerVisible() ?? false;\n\t}\n\n\tpublic get isVisibleFromKeyboard(): boolean {\n\t\treturn this._contentHoverWidget.isVisibleFromKeyboard;\n\t}\n\n\tpublic get isVisible(): boolean {\n\t\treturn this._contentHoverWidget.isVisible;\n\t}\n\n\tpublic get isFocused(): boolean {\n\t\treturn this._contentHoverWidget.isFocused;\n\t}\n\n\tpublic get isResizing(): boolean {\n\t\treturn this._contentHoverWidget.isResizing;\n\t}\n\n\tpublic get widget() {\n\t\treturn this._contentHoverWidget;\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 { KeyCode } from '../../../../base/common/keyCodes.js';\nimport { Disposable, MutableDisposable } from '../../../../base/common/lifecycle.js';\nimport { ICodeEditor, IEditorMouseEvent, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Range } from '../../../common/core/range.js';\nimport { TokenizationRegistry } from '../../../common/languages.js';\nimport { HoverOperation, HoverResult, HoverStartMode, HoverStartSource } from './hoverOperation.js';\nimport { HoverAnchor, HoverParticipantRegistry, HoverRangeAnchor, IEditorHoverContext, IEditorHoverParticipant, IHoverPart, IHoverWidget } from './hoverTypes.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { HoverVerbosityAction } from '../../../common/standalone/standaloneEnums.js';\nimport { ContentHoverWidget } from './contentHoverWidget.js';\nimport { ContentHoverComputer, ContentHoverComputerOptions } from './contentHoverComputer.js';\nimport { ContentHoverResult } from './contentHoverTypes.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { RenderedContentHover } from './contentHoverRendered.js';\nimport { isMousePositionWithinElement } from './hoverUtils.js';\nimport { IHoverService } from '../../../../platform/hover/browser/hover.js';\n\nexport class ContentHoverWidgetWrapper extends Disposable implements IHoverWidget {\n\n\tprivate _currentResult: ContentHoverResult | null = null;\n\tprivate readonly _renderedContentHover = this._register(new MutableDisposable<RenderedContentHover>());\n\n\tprivate readonly _contentHoverWidget: ContentHoverWidget;\n\tprivate readonly _participants: IEditorHoverParticipant[];\n\tprivate readonly _hoverOperation: HoverOperation<ContentHoverComputerOptions, IHoverPart>;\n\n\tprivate readonly _onContentsChanged = this._register(new Emitter<void>());\n\tpublic readonly onContentsChanged = this._onContentsChanged.event;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@IHoverService private readonly _hoverService: IHoverService\n\t) {\n\t\tsuper();\n\t\tthis._contentHoverWidget = this._register(this._instantiationService.createInstance(ContentHoverWidget, this._editor));\n\t\tthis._participants = this._initializeHoverParticipants();\n\t\tthis._hoverOperation = this._register(new HoverOperation(this._editor, new ContentHoverComputer(this._editor, this._participants)));\n\t\tthis._registerListeners();\n\t}\n\n\tprivate _initializeHoverParticipants(): IEditorHoverParticipant[] {\n\t\tconst participants: IEditorHoverParticipant[] = [];\n\t\tfor (const participant of HoverParticipantRegistry.getAll()) {\n\t\t\tconst participantInstance = this._instantiationService.createInstance(participant, this._editor);\n\t\t\tparticipants.push(participantInstance);\n\t\t}\n\t\tparticipants.sort((p1, p2) => p1.hoverOrdinal - p2.hoverOrdinal);\n\t\tthis._register(this._contentHoverWidget.onDidResize(() => {\n\t\t\tthis._participants.forEach(participant => participant.handleResize?.());\n\t\t}));\n\t\tthis._register(this._contentHoverWidget.onDidScroll((e) => {\n\t\t\tthis._participants.forEach(participant => participant.handleScroll?.(e));\n\t\t}));\n\t\tthis._register(this._contentHoverWidget.onContentsChanged(() => {\n\t\t\tthis._participants.forEach(participant => participant.handleContentsChanged?.());\n\t\t}));\n\t\treturn participants;\n\t}\n\n\tprivate _registerListeners(): void {\n\t\tthis._register(this._hoverOperation.onResult((result) => {\n\t\t\tconst messages = (result.hasLoadingMessage ? this._addLoadingMessage(result) : result.value);\n\t\t\tthis._withResult(new ContentHoverResult(messages, result.isComplete, result.options));\n\t\t}));\n\t\tconst contentHoverWidgetNode = this._contentHoverWidget.getDomNode();\n\t\tthis._register(dom.addStandardDisposableListener(contentHoverWidgetNode, 'keydown', (e) => {\n\t\t\tif (e.equals(KeyCode.Escape)) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}));\n\t\tthis._register(dom.addStandardDisposableListener(contentHoverWidgetNode, 'mouseleave', (e) => {\n\t\t\tthis._onMouseLeave(e);\n\t\t}));\n\t\tthis._register(TokenizationRegistry.onDidChange(() => {\n\t\t\tif (this._contentHoverWidget.position && this._currentResult) {\n\t\t\t\tthis._setCurrentResult(this._currentResult); // render again\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._contentHoverWidget.onContentsChanged(() => {\n\t\t\tthis._onContentsChanged.fire();\n\t\t}));\n\t}\n\n\t/**\n\t * Returns true if the hover shows now or will show.\n\t */\n\tprivate _startShowingOrUpdateHover(\n\t\tanchor: HoverAnchor | null,\n\t\tmode: HoverStartMode,\n\t\tsource: HoverStartSource,\n\t\tfocus: boolean,\n\t\tmouseEvent: IEditorMouseEvent | null\n\t): boolean {\n\t\tconst contentHoverIsVisible = this._contentHoverWidget.position && this._currentResult;\n\t\tif (!contentHoverIsVisible) {\n\t\t\tif (anchor) {\n\t\t\t\tthis._startHoverOperationIfNecessary(anchor, mode, source, focus, false);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tconst isHoverSticky = this._editor.getOption(EditorOption.hover).sticky;\n\t\tconst isMouseGettingCloser = mouseEvent && this._contentHoverWidget.isMouseGettingCloser(mouseEvent.event.posx, mouseEvent.event.posy);\n\t\tconst isHoverStickyAndIsMouseGettingCloser = isHoverSticky && isMouseGettingCloser;\n\t\t// The mouse is getting closer to the hover, so we will keep the hover untouched\n\t\t// But we will kick off a hover update at the new anchor, insisting on keeping the hover visible.\n\t\tif (isHoverStickyAndIsMouseGettingCloser) {\n\t\t\tif (anchor) {\n\t\t\t\tthis._startHoverOperationIfNecessary(anchor, mode, source, focus, true);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t// If mouse is not getting closer and anchor not defined, hide the hover\n\t\tif (!anchor) {\n\t\t\tthis._setCurrentResult(null);\n\t\t\treturn false;\n\t\t}\n\t\t// If mouse if not getting closer and anchor is defined, and the new anchor is the same as the previous anchor\n\t\tconst currentAnchorEqualsPreviousAnchor = this._currentResult && this._currentResult.options.anchor.equals(anchor);\n\t\tif (currentAnchorEqualsPreviousAnchor) {\n\t\t\treturn true;\n\t\t}\n\t\t// If mouse if not getting closer and anchor is defined, and the new anchor is not compatible with the previous anchor\n\t\tconst currentAnchorCompatibleWithPreviousAnchor = this._currentResult && anchor.canAdoptVisibleHover(this._currentResult.options.anchor, this._contentHoverWidget.position);\n\t\tif (!currentAnchorCompatibleWithPreviousAnchor) {\n\t\t\tthis._setCurrentResult(null);\n\t\t\tthis._startHoverOperationIfNecessary(anchor, mode, source, focus, false);\n\t\t\treturn true;\n\t\t}\n\t\t// We aren't getting any closer to the hover, so we will filter existing results\n\t\t// and keep those which also apply to the new anchor.\n\t\tif (this._currentResult) {\n\t\t\tthis._setCurrentResult(this._currentResult.filter(anchor));\n\t\t}\n\t\tthis._startHoverOperationIfNecessary(anchor, mode, source, focus, false);\n\t\treturn true;\n\t}\n\n\tprivate _startHoverOperationIfNecessary(anchor: HoverAnchor, mode: HoverStartMode, source: HoverStartSource, shouldFocus: boolean, insistOnKeepingHoverVisible: boolean): void {\n\t\tconst currentAnchorEqualToPreviousHover = this._hoverOperation.options && this._hoverOperation.options.anchor.equals(anchor);\n\t\tif (currentAnchorEqualToPreviousHover) {\n\t\t\treturn;\n\t\t}\n\t\tthis._hoverOperation.cancel();\n\t\tconst contentHoverComputerOptions: ContentHoverComputerOptions = {\n\t\t\tanchor,\n\t\t\tsource,\n\t\t\tshouldFocus,\n\t\t\tinsistOnKeepingHoverVisible\n\t\t};\n\t\tthis._hoverOperation.start(mode, contentHoverComputerOptions);\n\t}\n\n\tprivate _setCurrentResult(hoverResult: ContentHoverResult | null): void {\n\t\tlet currentHoverResult = hoverResult;\n\t\tconst currentResultEqualToPreviousResult = this._currentResult === currentHoverResult;\n\t\tif (currentResultEqualToPreviousResult) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentHoverResultIsEmpty = currentHoverResult && currentHoverResult.hoverParts.length === 0;\n\t\tif (currentHoverResultIsEmpty) {\n\t\t\tcurrentHoverResult = null;\n\t\t}\n\t\tthis._currentResult = currentHoverResult;\n\t\tif (this._currentResult) {\n\t\t\tthis._showHover(this._currentResult);\n\t\t} else {\n\t\t\tthis._hideHover();\n\t\t}\n\t}\n\n\tprivate _addLoadingMessage(hoverResult: HoverResult<ContentHoverComputerOptions, IHoverPart>): IHoverPart[] {\n\t\tfor (const participant of this._participants) {\n\t\t\tif (!participant.createLoadingMessage) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst loadingMessage = participant.createLoadingMessage(hoverResult.options.anchor);\n\t\t\tif (!loadingMessage) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn hoverResult.value.slice(0).concat([loadingMessage]);\n\t\t}\n\t\treturn hoverResult.value;\n\t}\n\n\tprivate _withResult(hoverResult: ContentHoverResult): void {\n\t\tconst previousHoverIsVisibleWithCompleteResult = this._contentHoverWidget.position && this._currentResult && this._currentResult.isComplete;\n\t\tif (!previousHoverIsVisibleWithCompleteResult) {\n\t\t\tthis._setCurrentResult(hoverResult);\n\t\t}\n\t\t// The hover is visible with a previous complete result.\n\t\tconst isCurrentHoverResultComplete = hoverResult.isComplete;\n\t\tif (!isCurrentHoverResultComplete) {\n\t\t\t// Instead of rendering the new partial result, we wait for the result to be complete.\n\t\t\treturn;\n\t\t}\n\t\tconst currentHoverResultIsEmpty = hoverResult.hoverParts.length === 0;\n\t\tconst insistOnKeepingPreviousHoverVisible = hoverResult.options.insistOnKeepingHoverVisible;\n\t\tconst shouldKeepPreviousHoverVisible = currentHoverResultIsEmpty && insistOnKeepingPreviousHoverVisible;\n\t\tif (shouldKeepPreviousHoverVisible) {\n\t\t\t// The hover would now hide normally, so we'll keep the previous messages\n\t\t\treturn;\n\t\t}\n\t\tthis._setCurrentResult(hoverResult);\n\t}\n\n\tprivate _showHover(hoverResult: ContentHoverResult): void {\n\t\tconst context = this._getHoverContext();\n\t\tthis._renderedContentHover.value = new RenderedContentHover(this._editor, hoverResult, this._participants, context, this._keybindingService, this._hoverService);\n\t\tif (this._renderedContentHover.value.domNodeHasChildren) {\n\t\t\tthis._contentHoverWidget.show(this._renderedContentHover.value);\n\t\t} else {\n\t\t\tthis._renderedContentHover.clear();\n\t\t}\n\t}\n\n\tprivate _hideHover(): void {\n\t\tthis._contentHoverWidget.hide();\n\t\tthis._participants.forEach(participant => participant.handleHide?.());\n\t}\n\n\tprivate _getHoverContext(): IEditorHoverContext {\n\t\tconst hide = () => {\n\t\t\tthis.hide();\n\t\t};\n\t\tconst onContentsChanged = () => {\n\t\t\tthis._contentHoverWidget.handleContentsChanged();\n\t\t};\n\t\tconst setMinimumDimensions = (dimensions: dom.Dimension) => {\n\t\t\tthis._contentHoverWidget.setMinimumDimensions(dimensions);\n\t\t};\n\t\tconst focus = () => this.focus();\n\t\treturn { hide, onContentsChanged, setMinimumDimensions, focus };\n\t}\n\n\n\tpublic showsOrWillShow(mouseEvent: IEditorMouseEvent): boolean {\n\t\tconst isContentWidgetResizing = this._contentHoverWidget.isResizing;\n\t\tif (isContentWidgetResizing) {\n\t\t\treturn true;\n\t\t}\n\t\tconst anchorCandidates: HoverAnchor[] = this._findHoverAnchorCandidates(mouseEvent);\n\t\tconst anchorCandidatesExist = anchorCandidates.length > 0;\n\t\tif (!anchorCandidatesExist) {\n\t\t\treturn this._startShowingOrUpdateHover(null, HoverStartMode.Delayed, HoverStartSource.Mouse, false, mouseEvent);\n\t\t}\n\t\tconst anchor = anchorCandidates[0];\n\t\treturn this._startShowingOrUpdateHover(anchor, HoverStartMode.Delayed, HoverStartSource.Mouse, false, mouseEvent);\n\t}\n\n\tprivate _findHoverAnchorCandidates(mouseEvent: IEditorMouseEvent): HoverAnchor[] {\n\t\tconst anchorCandidates: HoverAnchor[] = [];\n\t\tfor (const participant of this._participants) {\n\t\t\tif (!participant.suggestHoverAnchor) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst anchor = participant.suggestHoverAnchor(mouseEvent);\n\t\t\tif (!anchor) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tanchorCandidates.push(anchor);\n\t\t}\n\t\tconst target = mouseEvent.target;\n\t\tswitch (target.type) {\n\t\t\tcase MouseTargetType.CONTENT_TEXT: {\n\t\t\t\tanchorCandidates.push(new HoverRangeAnchor(0, target.range, mouseEvent.event.posx, mouseEvent.event.posy));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase MouseTargetType.CONTENT_EMPTY: {\n\t\t\t\tconst epsilon = this._editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth / 2;\n\t\t\t\t// Let hover kick in even when the mouse is technically in the empty area after a line, given the distance is small enough\n\t\t\t\tconst mouseIsWithinLinesAndCloseToHover = !target.detail.isAfterLines\n\t\t\t\t\t&& typeof target.detail.horizontalDistanceToText === 'number'\n\t\t\t\t\t&& target.detail.horizontalDistanceToText < epsilon;\n\t\t\t\tif (!mouseIsWithinLinesAndCloseToHover) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tanchorCandidates.push(new HoverRangeAnchor(0, target.range, mouseEvent.event.posx, mouseEvent.event.posy));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tanchorCandidates.sort((a, b) => b.priority - a.priority);\n\t\treturn anchorCandidates;\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\tpublic startShowingAtRange(range: Range, mode: HoverStartMode, source: HoverStartSource, focus: boolean): void {\n\t\tthis._startShowingOrUpdateHover(new HoverRangeAnchor(0, range, undefined, undefined), mode, source, focus, null);\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tthis._renderedContentHover.value?.updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic focusedHoverPartIndex(): number {\n\t\treturn this._renderedContentHover.value?.focusedHoverPartIndex ?? -1;\n\t}\n\n\tpublic containsNode(node: Node | null | undefined): boolean {\n\t\treturn (node ? this._contentHoverWidget.getDomNode().contains(node) : false);\n\t}\n\n\tpublic focus(): void {\n\t\tconst hoverPartsCount = this._renderedContentHover.value?.hoverPartsCount;\n\t\tif (hoverPartsCount === 1) {\n\t\t\tthis.focusHoverPartWithIndex(0);\n\t\t\treturn;\n\t\t}\n\t\tthis._contentHoverWidget.focus();\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tthis._renderedContentHover.value?.focusHoverPartWithIndex(index);\n\t}\n\n\tpublic scrollUp(): void {\n\t\tthis._contentHoverWidget.scrollUp();\n\t}\n\n\tpublic scrollDown(): void {\n\t\tthis._contentHoverWidget.scrollDown();\n\t}\n\n\tpublic scrollLeft(): void {\n\t\tthis._contentHoverWidget.scrollLeft();\n\t}\n\n\tpublic scrollRight(): void {\n\t\tthis._contentHoverWidget.scrollRight();\n\t}\n\n\tpublic pageUp(): void {\n\t\tthis._contentHoverWidget.pageUp();\n\t}\n\n\tpublic pageDown(): void {\n\t\tthis._contentHoverWidget.pageDown();\n\t}\n\n\tpublic goToTop(): void {\n\t\tthis._contentHoverWidget.goToTop();\n\t}\n\n\tpublic goToBottom(): void {\n\t\tthis._contentHoverWidget.goToBottom();\n\t}\n\n\tpublic hide(): void {\n\t\tthis._hoverOperation.cancel();\n\t\tthis._setCurrentResult(null);\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._contentHoverWidget.getDomNode();\n\t}\n\n\tpublic get isColorPickerVisible(): boolean {\n\t\treturn this._renderedContentHover.value?.isColorPickerVisible() ?? false;\n\t}\n\n\tpublic get isVisibleFromKeyboard(): boolean {\n\t\treturn this._contentHoverWidget.isVisibleFromKeyboard;\n\t}\n\n\tpublic get isVisible(): boolean {\n\t\treturn this._contentHoverWidget.isVisible;\n\t}\n\n\tpublic get isFocused(): boolean {\n\t\treturn this._contentHoverWidget.isFocused;\n\t}\n\n\tpublic get isResizing(): boolean {\n\t\treturn this._contentHoverWidget.isResizing;\n\t}\n\n\tpublic get widget() {\n\t\treturn this._contentHoverWidget;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.ts","vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,KAAK,GAAG,MAAM,iCAAiC,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAIrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAiD,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAAe,wBAAwB,EAAE,gBAAgB,EAA0E,MAAM,iBAAiB,CAAC;AAClK,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AACnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAE1F,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAA+B,MAA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,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAEM,UAAU;QAChB,OAAO,IAAI,CAAC,mBAAmB,CAAC,UAAU,EAAE,CAAC;IAC9C,CAAC;IAED,IAAW,oBAAoB;QAC9B,OAAO,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,oBAAoB,EAAE,IAAI,KAAK,CAAC;IAC1E,CAAC;IAED,IAAW,qBAAqB;QAC/B,OAAO,IAAI,CAAC,mBAAmB,CAAC,qBAAqB,CAAC;IACvD,CAAC;IAED,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC;IAC3C,CAAC;IAED,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC;IAC3C,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC;IAC5C,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,mBAAmB,CAAC;IACjC,CAAC;CACD,CAAA;AApXY,yBAAyB;IAcnC,WAAA,qBAAqB,CAAA;IACrB,WAAA,kBAAkB,CAAA;IAClB,WAAA,aAAa,CAAA;IACb,WAAA,iBAAiB,CAAA;GAjBP,yBAAyB,CAoXrC","file":"contentHoverWidgetWrapper.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 { KeyCode } from '../../../../base/common/keyCodes.js';\nimport { Disposable, MutableDisposable } from '../../../../base/common/lifecycle.js';\nimport { ICodeEditor, IEditorMouseEvent, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Range } from '../../../common/core/range.js';\nimport { TokenizationRegistry } from '../../../common/languages.js';\nimport { HoverOperation, HoverResult, HoverStartMode, HoverStartSource } from './hoverOperation.js';\nimport { HoverAnchor, HoverParticipantRegistry, HoverRangeAnchor, IEditorHoverContext, IEditorHoverParticipant, IHoverPart, IHoverWidget } from './hoverTypes.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { HoverVerbosityAction } from '../../../common/standalone/standaloneEnums.js';\nimport { ContentHoverWidget } from './contentHoverWidget.js';\nimport { ContentHoverComputer, ContentHoverComputerOptions } from './contentHoverComputer.js';\nimport { ContentHoverResult } from './contentHoverTypes.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { RenderedContentHover } from './contentHoverRendered.js';\nimport { isMousePositionWithinElement } from './hoverUtils.js';\nimport { IHoverService } from '../../../../platform/hover/browser/hover.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\n\nexport class ContentHoverWidgetWrapper extends Disposable implements IHoverWidget {\n\n\tprivate _currentResult: ContentHoverResult | null = null;\n\tprivate readonly _renderedContentHover = this._register(new MutableDisposable<RenderedContentHover>());\n\n\tprivate readonly _contentHoverWidget: ContentHoverWidget;\n\tprivate readonly _participants: IEditorHoverParticipant[];\n\tprivate readonly _hoverOperation: HoverOperation<ContentHoverComputerOptions, IHoverPart>;\n\n\tprivate readonly _onContentsChanged = this._register(new Emitter<void>());\n\tpublic readonly onContentsChanged = this._onContentsChanged.event;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@IHoverService private readonly _hoverService: IHoverService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tthis._contentHoverWidget = this._register(this._instantiationService.createInstance(ContentHoverWidget, this._editor));\n\t\tthis._participants = this._initializeHoverParticipants();\n\t\tthis._hoverOperation = this._register(new HoverOperation(this._editor, new ContentHoverComputer(this._editor, this._participants)));\n\t\tthis._registerListeners();\n\t}\n\n\tprivate _initializeHoverParticipants(): IEditorHoverParticipant[] {\n\t\tconst participants: IEditorHoverParticipant[] = [];\n\t\tfor (const participant of HoverParticipantRegistry.getAll()) {\n\t\t\tconst participantInstance = this._instantiationService.createInstance(participant, this._editor);\n\t\t\tparticipants.push(participantInstance);\n\t\t}\n\t\tparticipants.sort((p1, p2) => p1.hoverOrdinal - p2.hoverOrdinal);\n\t\tthis._register(this._contentHoverWidget.onDidResize(() => {\n\t\t\tthis._participants.forEach(participant => participant.handleResize?.());\n\t\t}));\n\t\tthis._register(this._contentHoverWidget.onDidScroll((e) => {\n\t\t\tthis._participants.forEach(participant => participant.handleScroll?.(e));\n\t\t}));\n\t\tthis._register(this._contentHoverWidget.onContentsChanged(() => {\n\t\t\tthis._participants.forEach(participant => participant.handleContentsChanged?.());\n\t\t}));\n\t\treturn participants;\n\t}\n\n\tprivate _registerListeners(): void {\n\t\tthis._register(this._hoverOperation.onResult((result) => {\n\t\t\tconst messages = (result.hasLoadingMessage ? this._addLoadingMessage(result) : result.value);\n\t\t\tthis._withResult(new ContentHoverResult(messages, result.isComplete, result.options));\n\t\t}));\n\t\tconst contentHoverWidgetNode = this._contentHoverWidget.getDomNode();\n\t\tthis._register(dom.addStandardDisposableListener(contentHoverWidgetNode, 'keydown', (e) => {\n\t\t\tif (e.equals(KeyCode.Escape)) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}));\n\t\tthis._register(dom.addStandardDisposableListener(contentHoverWidgetNode, 'mouseleave', (e) => {\n\t\t\tthis._onMouseLeave(e);\n\t\t}));\n\t\tthis._register(TokenizationRegistry.onDidChange(() => {\n\t\t\tif (this._contentHoverWidget.position && this._currentResult) {\n\t\t\t\tthis._setCurrentResult(this._currentResult); // render again\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._contentHoverWidget.onContentsChanged(() => {\n\t\t\tthis._onContentsChanged.fire();\n\t\t}));\n\t}\n\n\t/**\n\t * Returns true if the hover shows now or will show.\n\t */\n\tprivate _startShowingOrUpdateHover(\n\t\tanchor: HoverAnchor | null,\n\t\tmode: HoverStartMode,\n\t\tsource: HoverStartSource,\n\t\tfocus: boolean,\n\t\tmouseEvent: IEditorMouseEvent | null\n\t): boolean {\n\t\tconst contentHoverIsVisible = this._contentHoverWidget.position && this._currentResult;\n\t\tif (!contentHoverIsVisible) {\n\t\t\tif (anchor) {\n\t\t\t\tthis._startHoverOperationIfNecessary(anchor, mode, source, focus, false);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tconst isHoverSticky = this._editor.getOption(EditorOption.hover).sticky;\n\t\tconst isMouseGettingCloser = mouseEvent && this._contentHoverWidget.isMouseGettingCloser(mouseEvent.event.posx, mouseEvent.event.posy);\n\t\tconst isHoverStickyAndIsMouseGettingCloser = isHoverSticky && isMouseGettingCloser;\n\t\t// The mouse is getting closer to the hover, so we will keep the hover untouched\n\t\t// But we will kick off a hover update at the new anchor, insisting on keeping the hover visible.\n\t\tif (isHoverStickyAndIsMouseGettingCloser) {\n\t\t\tif (anchor) {\n\t\t\t\tthis._startHoverOperationIfNecessary(anchor, mode, source, focus, true);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t// If mouse is not getting closer and anchor not defined, hide the hover\n\t\tif (!anchor) {\n\t\t\tthis._setCurrentResult(null);\n\t\t\treturn false;\n\t\t}\n\t\t// If mouse if not getting closer and anchor is defined, and the new anchor is the same as the previous anchor\n\t\tconst currentAnchorEqualsPreviousAnchor = this._currentResult && this._currentResult.options.anchor.equals(anchor);\n\t\tif (currentAnchorEqualsPreviousAnchor) {\n\t\t\treturn true;\n\t\t}\n\t\t// If mouse if not getting closer and anchor is defined, and the new anchor is not compatible with the previous anchor\n\t\tconst currentAnchorCompatibleWithPreviousAnchor = this._currentResult && anchor.canAdoptVisibleHover(this._currentResult.options.anchor, this._contentHoverWidget.position);\n\t\tif (!currentAnchorCompatibleWithPreviousAnchor) {\n\t\t\tthis._setCurrentResult(null);\n\t\t\tthis._startHoverOperationIfNecessary(anchor, mode, source, focus, false);\n\t\t\treturn true;\n\t\t}\n\t\t// We aren't getting any closer to the hover, so we will filter existing results\n\t\t// and keep those which also apply to the new anchor.\n\t\tif (this._currentResult) {\n\t\t\tthis._setCurrentResult(this._currentResult.filter(anchor));\n\t\t}\n\t\tthis._startHoverOperationIfNecessary(anchor, mode, source, focus, false);\n\t\treturn true;\n\t}\n\n\tprivate _startHoverOperationIfNecessary(anchor: HoverAnchor, mode: HoverStartMode, source: HoverStartSource, shouldFocus: boolean, insistOnKeepingHoverVisible: boolean): void {\n\t\tconst currentAnchorEqualToPreviousHover = this._hoverOperation.options && this._hoverOperation.options.anchor.equals(anchor);\n\t\tif (currentAnchorEqualToPreviousHover) {\n\t\t\treturn;\n\t\t}\n\t\tthis._hoverOperation.cancel();\n\t\tconst contentHoverComputerOptions: ContentHoverComputerOptions = {\n\t\t\tanchor,\n\t\t\tsource,\n\t\t\tshouldFocus,\n\t\t\tinsistOnKeepingHoverVisible\n\t\t};\n\t\tthis._hoverOperation.start(mode, contentHoverComputerOptions);\n\t}\n\n\tprivate _setCurrentResult(hoverResult: ContentHoverResult | null): void {\n\t\tlet currentHoverResult = hoverResult;\n\t\tconst currentResultEqualToPreviousResult = this._currentResult === currentHoverResult;\n\t\tif (currentResultEqualToPreviousResult) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentHoverResultIsEmpty = currentHoverResult && currentHoverResult.hoverParts.length === 0;\n\t\tif (currentHoverResultIsEmpty) {\n\t\t\tcurrentHoverResult = null;\n\t\t}\n\t\tthis._currentResult = currentHoverResult;\n\t\tif (this._currentResult) {\n\t\t\tthis._showHover(this._currentResult);\n\t\t} else {\n\t\t\tthis._hideHover();\n\t\t}\n\t}\n\n\tprivate _addLoadingMessage(hoverResult: HoverResult<ContentHoverComputerOptions, IHoverPart>): IHoverPart[] {\n\t\tfor (const participant of this._participants) {\n\t\t\tif (!participant.createLoadingMessage) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst loadingMessage = participant.createLoadingMessage(hoverResult.options.anchor);\n\t\t\tif (!loadingMessage) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn hoverResult.value.slice(0).concat([loadingMessage]);\n\t\t}\n\t\treturn hoverResult.value;\n\t}\n\n\tprivate _withResult(hoverResult: ContentHoverResult): void {\n\t\tconst previousHoverIsVisibleWithCompleteResult = this._contentHoverWidget.position && this._currentResult && this._currentResult.isComplete;\n\t\tif (!previousHoverIsVisibleWithCompleteResult) {\n\t\t\tthis._setCurrentResult(hoverResult);\n\t\t}\n\t\t// The hover is visible with a previous complete result.\n\t\tconst isCurrentHoverResultComplete = hoverResult.isComplete;\n\t\tif (!isCurrentHoverResultComplete) {\n\t\t\t// Instead of rendering the new partial result, we wait for the result to be complete.\n\t\t\treturn;\n\t\t}\n\t\tconst currentHoverResultIsEmpty = hoverResult.hoverParts.length === 0;\n\t\tconst insistOnKeepingPreviousHoverVisible = hoverResult.options.insistOnKeepingHoverVisible;\n\t\tconst shouldKeepPreviousHoverVisible = currentHoverResultIsEmpty && insistOnKeepingPreviousHoverVisible;\n\t\tif (shouldKeepPreviousHoverVisible) {\n\t\t\t// The hover would now hide normally, so we'll keep the previous messages\n\t\t\treturn;\n\t\t}\n\t\tthis._setCurrentResult(hoverResult);\n\t}\n\n\tprivate _showHover(hoverResult: ContentHoverResult): void {\n\t\tconst context = this._getHoverContext();\n\t\tthis._renderedContentHover.value = new RenderedContentHover(this._editor, hoverResult, this._participants, context, this._keybindingService, this._hoverService, this._clipboardService);\n\t\tif (this._renderedContentHover.value.domNodeHasChildren) {\n\t\t\tthis._contentHoverWidget.show(this._renderedContentHover.value);\n\t\t} else {\n\t\t\tthis._renderedContentHover.clear();\n\t\t}\n\t}\n\n\tprivate _hideHover(): void {\n\t\tthis._contentHoverWidget.hide();\n\t\tthis._participants.forEach(participant => participant.handleHide?.());\n\t}\n\n\tprivate _getHoverContext(): IEditorHoverContext {\n\t\tconst hide = () => {\n\t\t\tthis.hide();\n\t\t};\n\t\tconst onContentsChanged = () => {\n\t\t\tthis._contentHoverWidget.handleContentsChanged();\n\t\t};\n\t\tconst setMinimumDimensions = (dimensions: dom.Dimension) => {\n\t\t\tthis._contentHoverWidget.setMinimumDimensions(dimensions);\n\t\t};\n\t\tconst focus = () => this.focus();\n\t\treturn { hide, onContentsChanged, setMinimumDimensions, focus };\n\t}\n\n\n\tpublic showsOrWillShow(mouseEvent: IEditorMouseEvent): boolean {\n\t\tconst isContentWidgetResizing = this._contentHoverWidget.isResizing;\n\t\tif (isContentWidgetResizing) {\n\t\t\treturn true;\n\t\t}\n\t\tconst anchorCandidates: HoverAnchor[] = this._findHoverAnchorCandidates(mouseEvent);\n\t\tconst anchorCandidatesExist = anchorCandidates.length > 0;\n\t\tif (!anchorCandidatesExist) {\n\t\t\treturn this._startShowingOrUpdateHover(null, HoverStartMode.Delayed, HoverStartSource.Mouse, false, mouseEvent);\n\t\t}\n\t\tconst anchor = anchorCandidates[0];\n\t\treturn this._startShowingOrUpdateHover(anchor, HoverStartMode.Delayed, HoverStartSource.Mouse, false, mouseEvent);\n\t}\n\n\tprivate _findHoverAnchorCandidates(mouseEvent: IEditorMouseEvent): HoverAnchor[] {\n\t\tconst anchorCandidates: HoverAnchor[] = [];\n\t\tfor (const participant of this._participants) {\n\t\t\tif (!participant.suggestHoverAnchor) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst anchor = participant.suggestHoverAnchor(mouseEvent);\n\t\t\tif (!anchor) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tanchorCandidates.push(anchor);\n\t\t}\n\t\tconst target = mouseEvent.target;\n\t\tswitch (target.type) {\n\t\t\tcase MouseTargetType.CONTENT_TEXT: {\n\t\t\t\tanchorCandidates.push(new HoverRangeAnchor(0, target.range, mouseEvent.event.posx, mouseEvent.event.posy));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase MouseTargetType.CONTENT_EMPTY: {\n\t\t\t\tconst epsilon = this._editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth / 2;\n\t\t\t\t// Let hover kick in even when the mouse is technically in the empty area after a line, given the distance is small enough\n\t\t\t\tconst mouseIsWithinLinesAndCloseToHover = !target.detail.isAfterLines\n\t\t\t\t\t&& typeof target.detail.horizontalDistanceToText === 'number'\n\t\t\t\t\t&& target.detail.horizontalDistanceToText < epsilon;\n\t\t\t\tif (!mouseIsWithinLinesAndCloseToHover) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tanchorCandidates.push(new HoverRangeAnchor(0, target.range, mouseEvent.event.posx, mouseEvent.event.posy));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tanchorCandidates.sort((a, b) => b.priority - a.priority);\n\t\treturn anchorCandidates;\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\tpublic startShowingAtRange(range: Range, mode: HoverStartMode, source: HoverStartSource, focus: boolean): void {\n\t\tthis._startShowingOrUpdateHover(new HoverRangeAnchor(0, range, undefined, undefined), mode, source, focus, null);\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tthis._renderedContentHover.value?.updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic focusedHoverPartIndex(): number {\n\t\treturn this._renderedContentHover.value?.focusedHoverPartIndex ?? -1;\n\t}\n\n\tpublic containsNode(node: Node | null | undefined): boolean {\n\t\treturn (node ? this._contentHoverWidget.getDomNode().contains(node) : false);\n\t}\n\n\tpublic focus(): void {\n\t\tconst hoverPartsCount = this._renderedContentHover.value?.hoverPartsCount;\n\t\tif (hoverPartsCount === 1) {\n\t\t\tthis.focusHoverPartWithIndex(0);\n\t\t\treturn;\n\t\t}\n\t\tthis._contentHoverWidget.focus();\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tthis._renderedContentHover.value?.focusHoverPartWithIndex(index);\n\t}\n\n\tpublic scrollUp(): void {\n\t\tthis._contentHoverWidget.scrollUp();\n\t}\n\n\tpublic scrollDown(): void {\n\t\tthis._contentHoverWidget.scrollDown();\n\t}\n\n\tpublic scrollLeft(): void {\n\t\tthis._contentHoverWidget.scrollLeft();\n\t}\n\n\tpublic scrollRight(): void {\n\t\tthis._contentHoverWidget.scrollRight();\n\t}\n\n\tpublic pageUp(): void {\n\t\tthis._contentHoverWidget.pageUp();\n\t}\n\n\tpublic pageDown(): void {\n\t\tthis._contentHoverWidget.pageDown();\n\t}\n\n\tpublic goToTop(): void {\n\t\tthis._contentHoverWidget.goToTop();\n\t}\n\n\tpublic goToBottom(): void {\n\t\tthis._contentHoverWidget.goToBottom();\n\t}\n\n\tpublic hide(): void {\n\t\tthis._hoverOperation.cancel();\n\t\tthis._setCurrentResult(null);\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._contentHoverWidget.getDomNode();\n\t}\n\n\tpublic get isColorPickerVisible(): boolean {\n\t\treturn this._renderedContentHover.value?.isColorPickerVisible() ?? false;\n\t}\n\n\tpublic get isVisibleFromKeyboard(): boolean {\n\t\treturn this._contentHoverWidget.isVisibleFromKeyboard;\n\t}\n\n\tpublic get isVisible(): boolean {\n\t\treturn this._contentHoverWidget.isVisible;\n\t}\n\n\tpublic get isFocused(): boolean {\n\t\treturn this._contentHoverWidget.isFocused;\n\t}\n\n\tpublic get isResizing(): boolean {\n\t\treturn this._contentHoverWidget.isResizing;\n\t}\n\n\tpublic get widget() {\n\t\treturn this._contentHoverWidget;\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 { KeyCode } from '../../../../base/common/keyCodes.js';\nimport { Disposable, MutableDisposable } from '../../../../base/common/lifecycle.js';\nimport { ICodeEditor, IEditorMouseEvent, MouseTargetType } from '../../../browser/editorBrowser.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { Range } from '../../../common/core/range.js';\nimport { TokenizationRegistry } from '../../../common/languages.js';\nimport { HoverOperation, HoverResult, HoverStartMode, HoverStartSource } from './hoverOperation.js';\nimport { HoverAnchor, HoverParticipantRegistry, HoverRangeAnchor, IEditorHoverContext, IEditorHoverParticipant, IHoverPart, IHoverWidget } from './hoverTypes.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { HoverVerbosityAction } from '../../../common/standalone/standaloneEnums.js';\nimport { ContentHoverWidget } from './contentHoverWidget.js';\nimport { ContentHoverComputer, ContentHoverComputerOptions } from './contentHoverComputer.js';\nimport { ContentHoverResult } from './contentHoverTypes.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { RenderedContentHover } from './contentHoverRendered.js';\nimport { isMousePositionWithinElement } from './hoverUtils.js';\nimport { IHoverService } from '../../../../platform/hover/browser/hover.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\n\nexport class ContentHoverWidgetWrapper extends Disposable implements IHoverWidget {\n\n\tprivate _currentResult: ContentHoverResult | null = null;\n\tprivate readonly _renderedContentHover = this._register(new MutableDisposable<RenderedContentHover>());\n\n\tprivate readonly _contentHoverWidget: ContentHoverWidget;\n\tprivate readonly _participants: IEditorHoverParticipant[];\n\tprivate readonly _hoverOperation: HoverOperation<ContentHoverComputerOptions, IHoverPart>;\n\n\tprivate readonly _onContentsChanged = this._register(new Emitter<void>());\n\tpublic readonly onContentsChanged = this._onContentsChanged.event;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@IHoverService private readonly _hoverService: IHoverService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tthis._contentHoverWidget = this._register(this._instantiationService.createInstance(ContentHoverWidget, this._editor));\n\t\tthis._participants = this._initializeHoverParticipants();\n\t\tthis._hoverOperation = this._register(new HoverOperation(this._editor, new ContentHoverComputer(this._editor, this._participants)));\n\t\tthis._registerListeners();\n\t}\n\n\tprivate _initializeHoverParticipants(): IEditorHoverParticipant[] {\n\t\tconst participants: IEditorHoverParticipant[] = [];\n\t\tfor (const participant of HoverParticipantRegistry.getAll()) {\n\t\t\tconst participantInstance = this._instantiationService.createInstance(participant, this._editor);\n\t\t\tparticipants.push(participantInstance);\n\t\t}\n\t\tparticipants.sort((p1, p2) => p1.hoverOrdinal - p2.hoverOrdinal);\n\t\tthis._register(this._contentHoverWidget.onDidResize(() => {\n\t\t\tthis._participants.forEach(participant => participant.handleResize?.());\n\t\t}));\n\t\tthis._register(this._contentHoverWidget.onDidScroll((e) => {\n\t\t\tthis._participants.forEach(participant => participant.handleScroll?.(e));\n\t\t}));\n\t\tthis._register(this._contentHoverWidget.onContentsChanged(() => {\n\t\t\tthis._participants.forEach(participant => participant.handleContentsChanged?.());\n\t\t}));\n\t\treturn participants;\n\t}\n\n\tprivate _registerListeners(): void {\n\t\tthis._register(this._hoverOperation.onResult((result) => {\n\t\t\tconst messages = (result.hasLoadingMessage ? this._addLoadingMessage(result) : result.value);\n\t\t\tthis._withResult(new ContentHoverResult(messages, result.isComplete, result.options));\n\t\t}));\n\t\tconst contentHoverWidgetNode = this._contentHoverWidget.getDomNode();\n\t\tthis._register(dom.addStandardDisposableListener(contentHoverWidgetNode, 'keydown', (e) => {\n\t\t\tif (e.equals(KeyCode.Escape)) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}));\n\t\tthis._register(dom.addStandardDisposableListener(contentHoverWidgetNode, 'mouseleave', (e) => {\n\t\t\tthis._onMouseLeave(e);\n\t\t}));\n\t\tthis._register(TokenizationRegistry.onDidChange(() => {\n\t\t\tif (this._contentHoverWidget.position && this._currentResult) {\n\t\t\t\tthis._setCurrentResult(this._currentResult); // render again\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._contentHoverWidget.onContentsChanged(() => {\n\t\t\tthis._onContentsChanged.fire();\n\t\t}));\n\t}\n\n\t/**\n\t * Returns true if the hover shows now or will show.\n\t */\n\tprivate _startShowingOrUpdateHover(\n\t\tanchor: HoverAnchor | null,\n\t\tmode: HoverStartMode,\n\t\tsource: HoverStartSource,\n\t\tfocus: boolean,\n\t\tmouseEvent: IEditorMouseEvent | null\n\t): boolean {\n\t\tconst contentHoverIsVisible = this._contentHoverWidget.position && this._currentResult;\n\t\tif (!contentHoverIsVisible) {\n\t\t\tif (anchor) {\n\t\t\t\tthis._startHoverOperationIfNecessary(anchor, mode, source, focus, false);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tconst isHoverSticky = this._editor.getOption(EditorOption.hover).sticky;\n\t\tconst isMouseGettingCloser = mouseEvent && this._contentHoverWidget.isMouseGettingCloser(mouseEvent.event.posx, mouseEvent.event.posy);\n\t\tconst isHoverStickyAndIsMouseGettingCloser = isHoverSticky && isMouseGettingCloser;\n\t\t// The mouse is getting closer to the hover, so we will keep the hover untouched\n\t\t// But we will kick off a hover update at the new anchor, insisting on keeping the hover visible.\n\t\tif (isHoverStickyAndIsMouseGettingCloser) {\n\t\t\tif (anchor) {\n\t\t\t\tthis._startHoverOperationIfNecessary(anchor, mode, source, focus, true);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t// If mouse is not getting closer and anchor not defined, hide the hover\n\t\tif (!anchor) {\n\t\t\tthis._setCurrentResult(null);\n\t\t\treturn false;\n\t\t}\n\t\t// If mouse if not getting closer and anchor is defined, and the new anchor is the same as the previous anchor\n\t\tconst currentAnchorEqualsPreviousAnchor = this._currentResult && this._currentResult.options.anchor.equals(anchor);\n\t\tif (currentAnchorEqualsPreviousAnchor) {\n\t\t\treturn true;\n\t\t}\n\t\t// If mouse if not getting closer and anchor is defined, and the new anchor is not compatible with the previous anchor\n\t\tconst currentAnchorCompatibleWithPreviousAnchor = this._currentResult && anchor.canAdoptVisibleHover(this._currentResult.options.anchor, this._contentHoverWidget.position);\n\t\tif (!currentAnchorCompatibleWithPreviousAnchor) {\n\t\t\tthis._setCurrentResult(null);\n\t\t\tthis._startHoverOperationIfNecessary(anchor, mode, source, focus, false);\n\t\t\treturn true;\n\t\t}\n\t\t// We aren't getting any closer to the hover, so we will filter existing results\n\t\t// and keep those which also apply to the new anchor.\n\t\tif (this._currentResult) {\n\t\t\tthis._setCurrentResult(this._currentResult.filter(anchor));\n\t\t}\n\t\tthis._startHoverOperationIfNecessary(anchor, mode, source, focus, false);\n\t\treturn true;\n\t}\n\n\tprivate _startHoverOperationIfNecessary(anchor: HoverAnchor, mode: HoverStartMode, source: HoverStartSource, shouldFocus: boolean, insistOnKeepingHoverVisible: boolean): void {\n\t\tconst currentAnchorEqualToPreviousHover = this._hoverOperation.options && this._hoverOperation.options.anchor.equals(anchor);\n\t\tif (currentAnchorEqualToPreviousHover) {\n\t\t\treturn;\n\t\t}\n\t\tthis._hoverOperation.cancel();\n\t\tconst contentHoverComputerOptions: ContentHoverComputerOptions = {\n\t\t\tanchor,\n\t\t\tsource,\n\t\t\tshouldFocus,\n\t\t\tinsistOnKeepingHoverVisible\n\t\t};\n\t\tthis._hoverOperation.start(mode, contentHoverComputerOptions);\n\t}\n\n\tprivate _setCurrentResult(hoverResult: ContentHoverResult | null): void {\n\t\tlet currentHoverResult = hoverResult;\n\t\tconst currentResultEqualToPreviousResult = this._currentResult === currentHoverResult;\n\t\tif (currentResultEqualToPreviousResult) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentHoverResultIsEmpty = currentHoverResult && currentHoverResult.hoverParts.length === 0;\n\t\tif (currentHoverResultIsEmpty) {\n\t\t\tcurrentHoverResult = null;\n\t\t}\n\t\tthis._currentResult = currentHoverResult;\n\t\tif (this._currentResult) {\n\t\t\tthis._showHover(this._currentResult);\n\t\t} else {\n\t\t\tthis._hideHover();\n\t\t}\n\t}\n\n\tprivate _addLoadingMessage(hoverResult: HoverResult<ContentHoverComputerOptions, IHoverPart>): IHoverPart[] {\n\t\tfor (const participant of this._participants) {\n\t\t\tif (!participant.createLoadingMessage) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst loadingMessage = participant.createLoadingMessage(hoverResult.options.anchor);\n\t\t\tif (!loadingMessage) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn hoverResult.value.slice(0).concat([loadingMessage]);\n\t\t}\n\t\treturn hoverResult.value;\n\t}\n\n\tprivate _withResult(hoverResult: ContentHoverResult): void {\n\t\tconst previousHoverIsVisibleWithCompleteResult = this._contentHoverWidget.position && this._currentResult && this._currentResult.isComplete;\n\t\tif (!previousHoverIsVisibleWithCompleteResult) {\n\t\t\tthis._setCurrentResult(hoverResult);\n\t\t}\n\t\t// The hover is visible with a previous complete result.\n\t\tconst isCurrentHoverResultComplete = hoverResult.isComplete;\n\t\tif (!isCurrentHoverResultComplete) {\n\t\t\t// Instead of rendering the new partial result, we wait for the result to be complete.\n\t\t\treturn;\n\t\t}\n\t\tconst currentHoverResultIsEmpty = hoverResult.hoverParts.length === 0;\n\t\tconst insistOnKeepingPreviousHoverVisible = hoverResult.options.insistOnKeepingHoverVisible;\n\t\tconst shouldKeepPreviousHoverVisible = currentHoverResultIsEmpty && insistOnKeepingPreviousHoverVisible;\n\t\tif (shouldKeepPreviousHoverVisible) {\n\t\t\t// The hover would now hide normally, so we'll keep the previous messages\n\t\t\treturn;\n\t\t}\n\t\tthis._setCurrentResult(hoverResult);\n\t}\n\n\tprivate _showHover(hoverResult: ContentHoverResult): void {\n\t\tconst context = this._getHoverContext();\n\t\tthis._renderedContentHover.value = new RenderedContentHover(this._editor, hoverResult, this._participants, context, this._keybindingService, this._hoverService, this._clipboardService);\n\t\tif (this._renderedContentHover.value.domNodeHasChildren) {\n\t\t\tthis._contentHoverWidget.show(this._renderedContentHover.value);\n\t\t} else {\n\t\t\tthis._renderedContentHover.clear();\n\t\t}\n\t}\n\n\tprivate _hideHover(): void {\n\t\tthis._contentHoverWidget.hide();\n\t\tthis._participants.forEach(participant => participant.handleHide?.());\n\t}\n\n\tprivate _getHoverContext(): IEditorHoverContext {\n\t\tconst hide = () => {\n\t\t\tthis.hide();\n\t\t};\n\t\tconst onContentsChanged = () => {\n\t\t\tthis._contentHoverWidget.handleContentsChanged();\n\t\t};\n\t\tconst setMinimumDimensions = (dimensions: dom.Dimension) => {\n\t\t\tthis._contentHoverWidget.setMinimumDimensions(dimensions);\n\t\t};\n\t\tconst focus = () => this.focus();\n\t\treturn { hide, onContentsChanged, setMinimumDimensions, focus };\n\t}\n\n\n\tpublic showsOrWillShow(mouseEvent: IEditorMouseEvent): boolean {\n\t\tconst isContentWidgetResizing = this._contentHoverWidget.isResizing;\n\t\tif (isContentWidgetResizing) {\n\t\t\treturn true;\n\t\t}\n\t\tconst anchorCandidates: HoverAnchor[] = this._findHoverAnchorCandidates(mouseEvent);\n\t\tconst anchorCandidatesExist = anchorCandidates.length > 0;\n\t\tif (!anchorCandidatesExist) {\n\t\t\treturn this._startShowingOrUpdateHover(null, HoverStartMode.Delayed, HoverStartSource.Mouse, false, mouseEvent);\n\t\t}\n\t\tconst anchor = anchorCandidates[0];\n\t\treturn this._startShowingOrUpdateHover(anchor, HoverStartMode.Delayed, HoverStartSource.Mouse, false, mouseEvent);\n\t}\n\n\tprivate _findHoverAnchorCandidates(mouseEvent: IEditorMouseEvent): HoverAnchor[] {\n\t\tconst anchorCandidates: HoverAnchor[] = [];\n\t\tfor (const participant of this._participants) {\n\t\t\tif (!participant.suggestHoverAnchor) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst anchor = participant.suggestHoverAnchor(mouseEvent);\n\t\t\tif (!anchor) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tanchorCandidates.push(anchor);\n\t\t}\n\t\tconst target = mouseEvent.target;\n\t\tswitch (target.type) {\n\t\t\tcase MouseTargetType.CONTENT_TEXT: {\n\t\t\t\tanchorCandidates.push(new HoverRangeAnchor(0, target.range, mouseEvent.event.posx, mouseEvent.event.posy));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase MouseTargetType.CONTENT_EMPTY: {\n\t\t\t\tconst epsilon = this._editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth / 2;\n\t\t\t\t// Let hover kick in even when the mouse is technically in the empty area after a line, given the distance is small enough\n\t\t\t\tconst mouseIsWithinLinesAndCloseToHover = !target.detail.isAfterLines\n\t\t\t\t\t&& typeof target.detail.horizontalDistanceToText === 'number'\n\t\t\t\t\t&& target.detail.horizontalDistanceToText < epsilon;\n\t\t\t\tif (!mouseIsWithinLinesAndCloseToHover) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tanchorCandidates.push(new HoverRangeAnchor(0, target.range, mouseEvent.event.posx, mouseEvent.event.posy));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tanchorCandidates.sort((a, b) => b.priority - a.priority);\n\t\treturn anchorCandidates;\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\tpublic startShowingAtRange(range: Range, mode: HoverStartMode, source: HoverStartSource, focus: boolean): void {\n\t\tthis._startShowingOrUpdateHover(new HoverRangeAnchor(0, range, undefined, undefined), mode, source, focus, null);\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tthis._renderedContentHover.value?.updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic focusedHoverPartIndex(): number {\n\t\treturn this._renderedContentHover.value?.focusedHoverPartIndex ?? -1;\n\t}\n\n\tpublic containsNode(node: Node | null | undefined): boolean {\n\t\treturn (node ? this._contentHoverWidget.getDomNode().contains(node) : false);\n\t}\n\n\tpublic focus(): void {\n\t\tconst hoverPartsCount = this._renderedContentHover.value?.hoverPartsCount;\n\t\tif (hoverPartsCount === 1) {\n\t\t\tthis.focusHoverPartWithIndex(0);\n\t\t\treturn;\n\t\t}\n\t\tthis._contentHoverWidget.focus();\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tthis._renderedContentHover.value?.focusHoverPartWithIndex(index);\n\t}\n\n\tpublic scrollUp(): void {\n\t\tthis._contentHoverWidget.scrollUp();\n\t}\n\n\tpublic scrollDown(): void {\n\t\tthis._contentHoverWidget.scrollDown();\n\t}\n\n\tpublic scrollLeft(): void {\n\t\tthis._contentHoverWidget.scrollLeft();\n\t}\n\n\tpublic scrollRight(): void {\n\t\tthis._contentHoverWidget.scrollRight();\n\t}\n\n\tpublic pageUp(): void {\n\t\tthis._contentHoverWidget.pageUp();\n\t}\n\n\tpublic pageDown(): void {\n\t\tthis._contentHoverWidget.pageDown();\n\t}\n\n\tpublic goToTop(): void {\n\t\tthis._contentHoverWidget.goToTop();\n\t}\n\n\tpublic goToBottom(): void {\n\t\tthis._contentHoverWidget.goToBottom();\n\t}\n\n\tpublic hide(): void {\n\t\tthis._hoverOperation.cancel();\n\t\tthis._setCurrentResult(null);\n\t}\n\n\tpublic getDomNode(): HTMLElement {\n\t\treturn this._contentHoverWidget.getDomNode();\n\t}\n\n\tpublic get isColorPickerVisible(): boolean {\n\t\treturn this._renderedContentHover.value?.isColorPickerVisible() ?? false;\n\t}\n\n\tpublic get isVisibleFromKeyboard(): boolean {\n\t\treturn this._contentHoverWidget.isVisibleFromKeyboard;\n\t}\n\n\tpublic get isVisible(): boolean {\n\t\treturn this._contentHoverWidget.isVisible;\n\t}\n\n\tpublic get isFocused(): boolean {\n\t\treturn this._contentHoverWidget.isFocused;\n\t}\n\n\tpublic get isResizing(): boolean {\n\t\treturn this._contentHoverWidget.isResizing;\n\t}\n\n\tpublic get widget() {\n\t\treturn this._contentHoverWidget;\n\t}\n}\n"]}
@@ -37,6 +37,11 @@
37
37
  display: flex;
38
38
  }
39
39
 
40
+ .monaco-editor .monaco-hover .hover-row.hover-row-with-copy {
41
+ position: relative;
42
+ padding-right: 20px;
43
+ }
44
+
40
45
  .monaco-editor .monaco-hover .hover-row .hover-row-contents {
41
46
  min-width: 0;
42
47
  display: flex;
@@ -78,3 +83,34 @@
78
83
  .monaco-editor .monaco-hover code {
79
84
  background-color: var(--vscode-textCodeBlock-background);
80
85
  }
86
+
87
+ .monaco-editor .monaco-hover .hover-copy-button {
88
+ position: absolute;
89
+ top: 4px;
90
+ right: 4px;
91
+ padding: 2px 4px;
92
+ border-radius: 3px;
93
+ display: flex;
94
+ align-items: center;
95
+ justify-content: center;
96
+ opacity: 0;
97
+ }
98
+
99
+ .monaco-editor .monaco-hover .hover-row-with-copy:hover .hover-copy-button,
100
+ .monaco-editor .monaco-hover .hover-row-with-copy:focus-within .hover-copy-button {
101
+ opacity: 1;
102
+ }
103
+
104
+ .monaco-editor .monaco-hover .hover-copy-button:hover {
105
+ background-color: var(--vscode-toolbar-hoverBackground);
106
+ }
107
+
108
+ .monaco-editor .monaco-hover .hover-copy-button:focus {
109
+ outline: 1px solid var(--vscode-focusBorder);
110
+ outline-offset: -1px;
111
+ }
112
+
113
+ .monaco-editor .monaco-hover .hover-copy-button .codicon {
114
+ font-size: 16px;
115
+ color: var(--vscode-foreground);
116
+ }
@@ -15,7 +15,7 @@ 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(1101, "Increase Hover Verbosity Level");
18
+ export const INCREASE_HOVER_VERBOSITY_ACTION_LABEL = nls.localize(1102, "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(1102, "Decrease Hover Verbosity Level");
20
+ export const DECREASE_HOVER_VERBOSITY_ACTION_LABEL = nls.localize(1103, "Decrease Hover Verbosity Level");
21
21
  //# sourceMappingURL=hoverActionIds.js.map