monaco-editor-core 0.58.0 → 0.59.0-dev-20261124

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 (211) 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 +2 -0
  18. package/esm/vs/base/browser/ui/selectBox/selectBox.js.map +1 -1
  19. package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js +3 -0
  20. package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js.map +1 -1
  21. package/esm/vs/base/browser/ui/selectBox/selectBoxNative.js +4 -2
  22. package/esm/vs/base/browser/ui/selectBox/selectBoxNative.js.map +1 -1
  23. package/esm/vs/base/browser/ui/tree/abstractTree.js +27 -1
  24. package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
  25. package/esm/vs/base/common/cancellation.js +3 -1
  26. package/esm/vs/base/common/cancellation.js.map +1 -1
  27. package/esm/vs/editor/browser/controller/mouseHandler.js +8 -1
  28. package/esm/vs/editor/browser/controller/mouseHandler.js.map +1 -1
  29. package/esm/vs/editor/browser/controller/mouseTarget.js +15 -6
  30. package/esm/vs/editor/browser/controller/mouseTarget.js.map +1 -1
  31. package/esm/vs/editor/browser/view.js +3 -2
  32. package/esm/vs/editor/browser/view.js.map +1 -1
  33. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +12 -8
  34. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
  35. package/esm/vs/editor/browser/viewParts/viewLines/viewLine.js +7 -11
  36. package/esm/vs/editor/browser/viewParts/viewLines/viewLine.js.map +1 -1
  37. package/esm/vs/editor/common/config/editorOptions.js +246 -238
  38. package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
  39. package/esm/vs/editor/common/core/editorColorRegistry.js +71 -71
  40. package/esm/vs/editor/common/editorContextKeys.js +53 -53
  41. package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
  42. package/esm/vs/editor/common/languages.js +56 -56
  43. package/esm/vs/editor/common/model/editStack.js +1 -1
  44. package/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.js +3 -1
  45. package/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.js.map +1 -1
  46. package/esm/vs/editor/common/model/textModel.js +1 -0
  47. package/esm/vs/editor/common/model/textModel.js.map +1 -1
  48. package/esm/vs/editor/common/model.js.map +1 -1
  49. package/esm/vs/editor/common/standaloneStrings.js +11 -11
  50. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
  51. package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
  52. package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
  53. package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
  54. package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
  55. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +17 -17
  56. package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
  57. package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
  58. package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
  59. package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
  60. package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
  61. package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
  62. package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
  63. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
  64. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
  65. package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +1 -1
  66. package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
  67. package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
  68. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +13 -13
  69. package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
  70. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
  71. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +9 -9
  72. package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
  73. package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
  74. package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
  75. package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js.map +1 -1
  76. package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
  77. package/esm/vs/editor/contrib/find/browser/findController.js +17 -17
  78. package/esm/vs/editor/contrib/find/browser/findWidget.js +29 -29
  79. package/esm/vs/editor/contrib/folding/browser/folding.css +15 -0
  80. package/esm/vs/editor/contrib/folding/browser/folding.js +20 -20
  81. package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
  82. package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
  83. package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
  84. package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
  85. package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
  86. package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
  87. package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
  88. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
  89. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
  90. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
  91. package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
  92. package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
  93. package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
  94. package/esm/vs/editor/contrib/hover/browser/contentHoverRendered.js +1 -1
  95. package/esm/vs/editor/contrib/hover/browser/contentHoverRendered.js.map +1 -1
  96. package/esm/vs/editor/contrib/hover/browser/contentHoverWidget.js +0 -5
  97. package/esm/vs/editor/contrib/hover/browser/contentHoverWidget.js.map +1 -1
  98. package/esm/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.js +0 -3
  99. package/esm/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.js.map +1 -1
  100. package/esm/vs/editor/contrib/hover/browser/hover.css +6 -2
  101. package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
  102. package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
  103. package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
  104. package/esm/vs/editor/contrib/hover/browser/hoverTypes.js.map +1 -1
  105. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +19 -39
  106. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
  107. package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +7 -7
  108. package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
  109. package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
  110. package/esm/vs/editor/contrib/indentation/common/indentation.js +14 -3
  111. package/esm/vs/editor/contrib/indentation/common/indentation.js.map +1 -1
  112. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
  113. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +21 -21
  114. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -13
  115. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +6 -6
  116. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
  117. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +4 -4
  118. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +2 -2
  119. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
  120. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +1 -1
  121. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +3 -3
  122. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
  123. package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
  124. package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
  125. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +31 -31
  126. package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
  127. package/esm/vs/editor/contrib/links/browser/links.js +11 -10
  128. package/esm/vs/editor/contrib/links/browser/links.js.map +1 -1
  129. package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
  130. package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
  131. package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
  132. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
  133. package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
  134. package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
  135. package/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js +1 -1
  136. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +12 -12
  137. package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
  138. package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
  139. package/esm/vs/editor/contrib/rename/browser/rename.js +11 -11
  140. package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
  141. package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
  142. package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +5 -5
  143. package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
  144. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  145. package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -9
  146. package/esm/vs/editor/contrib/suggest/browser/suggestController.js +11 -11
  147. package/esm/vs/editor/contrib/suggest/browser/suggestModel.js +93 -38
  148. package/esm/vs/editor/contrib/suggest/browser/suggestModel.js.map +1 -1
  149. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +18 -18
  150. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +3 -3
  151. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
  152. package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
  153. package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
  154. package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  155. package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  156. package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  157. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
  158. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
  159. package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  160. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
  161. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +3 -3
  162. package/esm/vs/editor/editor.api.d.ts +5 -0
  163. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +68 -68
  164. package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
  165. package/esm/vs/platform/actionWidget/browser/actionList.js +30 -31
  166. package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
  167. package/esm/vs/platform/actionWidget/browser/actionWidget.css +1 -1
  168. package/esm/vs/platform/actionWidget/browser/actionWidget.js +12 -12
  169. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +3 -3
  170. package/esm/vs/platform/actions/browser/toolbar.js +2 -2
  171. package/esm/vs/platform/actions/common/menuService.js +2 -2
  172. package/esm/vs/platform/configuration/common/configurationModels.js +15 -3
  173. package/esm/vs/platform/configuration/common/configurationModels.js.map +1 -1
  174. package/esm/vs/platform/configuration/common/configurationRegistry.js +12 -12
  175. package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
  176. package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
  177. package/esm/vs/platform/contextkey/common/contextkeys.js +10 -10
  178. package/esm/vs/platform/contextkey/common/scanner.js +5 -5
  179. package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  180. package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
  181. package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
  182. package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +5 -5
  183. package/esm/vs/platform/list/browser/listService.js +27 -27
  184. package/esm/vs/platform/markers/common/markerService.js +2 -2
  185. package/esm/vs/platform/markers/common/markers.js +6 -6
  186. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
  187. package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
  188. package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
  189. package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
  190. package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
  191. package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
  192. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  193. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
  194. package/esm/vs/platform/quickinput/browser/tree/quickTree.js +1 -1
  195. package/esm/vs/platform/theme/common/colorUtils.js +2 -2
  196. package/esm/vs/platform/theme/common/colors/baseColors.js +19 -19
  197. package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
  198. package/esm/vs/platform/theme/common/colors/confettiColors.js +6 -6
  199. package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
  200. package/esm/vs/platform/theme/common/colors/inputColors.js +48 -48
  201. package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
  202. package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
  203. package/esm/vs/platform/theme/common/colors/minimapColors.js +11 -11
  204. package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
  205. package/esm/vs/platform/theme/common/colors/quickpickColors.js +10 -10
  206. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  207. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  208. package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
  209. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  210. package/monaco.d.ts +5 -0
  211. package/package.json +3 -3
@@ -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/brow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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;;AAvPI,yBAAyB;IAqB5B,WAAA,kBAAkB,CAAA;IAClB,WAAA,aAAa,CAAA;IACb,WAAA,iBAAiB,CAAA;GAvBd,yBAAyB,CAwP9B","file":"contentHoverRendered.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IEditorHoverContext, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverParts, RenderedHoverParts } from './hoverTypes.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { EditorHoverStatusBar } from './contentHoverStatusBar.js';\nimport { HoverStartSource } from './hoverOperation.js';\nimport { HoverCopyButton } from './hoverCopyButton.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { ContentHoverResult } from './contentHoverTypes.js';\nimport * as dom from '../../../../base/browser/dom.js';\nimport { HoverVerbosityAction } from '../../../common/languages.js';\nimport { MarkdownHoverParticipant } from './markdownHoverParticipant.js';\nimport { ColorHover, HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';\nimport { InlayHintsHover } from '../../inlayHints/browser/inlayHintsHover.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { HoverAction } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverService } from '../../../../platform/hover/browser/hover.js';\nimport { IOffsetRange } from '../../../common/core/ranges/offsetRange.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\n\nexport class RenderedContentHover extends Disposable {\n\n\tpublic closestMouseDistance: number | undefined;\n\tpublic initialMousePosX: number | undefined;\n\tpublic initialMousePosY: number | undefined;\n\n\tpublic readonly showAtPosition: Position;\n\tpublic readonly showAtSecondaryPosition: Position;\n\tpublic readonly shouldFocus: boolean;\n\tpublic readonly source: HoverStartSource;\n\tpublic readonly shouldAppearBeforeContent: boolean;\n\n\tprivate readonly _renderedHoverParts: RenderedContentHoverParts;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\thoverResult: ContentHoverResult,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService hoverService: IHoverService,\n\t\t@IClipboardService clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tconst parts = hoverResult.hoverParts;\n\t\tthis._renderedHoverParts = this._register(new RenderedContentHoverParts(\n\t\t\teditor,\n\t\t\tparticipants,\n\t\t\tparts,\n\t\t\tcontext,\n\t\t\tkeybindingService,\n\t\t\thoverService,\n\t\t\tclipboardService\n\t\t));\n\t\tconst contentHoverComputerOptions = hoverResult.options;\n\t\tconst anchor = contentHoverComputerOptions.anchor;\n\t\tconst { showAtPosition, showAtSecondaryPosition } = RenderedContentHover.computeHoverPositions(editor, anchor.range, parts);\n\t\tthis.shouldAppearBeforeContent = parts.some(m => m.isBeforeContent);\n\t\tthis.showAtPosition = showAtPosition;\n\t\tthis.showAtSecondaryPosition = showAtSecondaryPosition;\n\t\tthis.initialMousePosX = anchor.initialMousePosX;\n\t\tthis.initialMousePosY = anchor.initialMousePosY;\n\t\tthis.shouldFocus = contentHoverComputerOptions.shouldFocus;\n\t\tthis.source = contentHoverComputerOptions.source;\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._renderedHoverParts.domNode;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._renderedHoverParts.domNodeHasChildren;\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._renderedHoverParts.focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedHoverParts.hoverPartsCount;\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tthis._renderedHoverParts.focusHoverPartWithIndex(index);\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tthis._renderedHoverParts.updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._renderedHoverParts.isColorPickerVisible();\n\t}\n\n\tpublic static computeHoverPositions(editor: ICodeEditor, anchorRange: Range, hoverParts: IHoverPart[]): { showAtPosition: Position; showAtSecondaryPosition: Position } {\n\n\t\tlet startColumnBoundary = 1;\n\t\tif (editor.hasModel()) {\n\t\t\t// Ensure the range is on the current view line\n\t\t\tconst viewModel = editor._getViewModel();\n\t\t\tconst coordinatesConverter = viewModel.coordinatesConverter;\n\t\t\tconst anchorViewRange = coordinatesConverter.convertModelRangeToViewRange(anchorRange);\n\t\t\tconst anchorViewMinColumn = viewModel.getLineMinColumn(anchorViewRange.startLineNumber);\n\t\t\tconst anchorViewRangeStart = new Position(anchorViewRange.startLineNumber, anchorViewMinColumn);\n\t\t\tstartColumnBoundary = coordinatesConverter.convertViewPositionToModelPosition(anchorViewRangeStart).column;\n\t\t}\n\n\t\t// The anchor range is always on a single line\n\t\tconst anchorStartLineNumber = anchorRange.startLineNumber;\n\t\tlet secondaryPositionColumn = anchorRange.startColumn;\n\t\tlet forceShowAtRange: Range | undefined;\n\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\tconst hoverPartRangeOnAnchorStartLine = hoverPartRange.startLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeOnAnchorEndLine = hoverPartRange.endLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeIsOnAnchorLine = hoverPartRangeOnAnchorStartLine && hoverPartRangeOnAnchorEndLine;\n\t\t\tif (hoverPartRangeIsOnAnchorLine) {\n\t\t\t\t// this message has a range that is completely sitting on the line of the anchor\n\t\t\t\tconst hoverPartStartColumn = hoverPartRange.startColumn;\n\t\t\t\tconst minSecondaryPositionColumn = Math.min(secondaryPositionColumn, hoverPartStartColumn);\n\t\t\t\tsecondaryPositionColumn = Math.max(minSecondaryPositionColumn, startColumnBoundary);\n\t\t\t}\n\t\t\tif (hoverPart.forceShowAtRange) {\n\t\t\t\tforceShowAtRange = hoverPartRange;\n\t\t\t}\n\t\t}\n\n\t\tlet showAtPosition: Position;\n\t\tlet showAtSecondaryPosition: Position;\n\t\tif (forceShowAtRange) {\n\t\t\tconst forceShowAtPosition = forceShowAtRange.getStartPosition();\n\t\t\tshowAtPosition = forceShowAtPosition;\n\t\t\tshowAtSecondaryPosition = forceShowAtPosition;\n\t\t} else {\n\t\t\tshowAtPosition = anchorRange.getStartPosition();\n\t\t\tshowAtSecondaryPosition = new Position(anchorStartLineNumber, secondaryPositionColumn);\n\t\t}\n\t\treturn {\n\t\t\tshowAtPosition,\n\t\t\tshowAtSecondaryPosition,\n\t\t};\n\t}\n}\n\ninterface IRenderedContentHoverPart {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'hoverPart';\n\t/**\n\t * Participant of the rendered hover part\n\t */\n\tparticipant: IEditorHoverParticipant<IHoverPart>;\n\t/**\n\t * The rendered hover part\n\t */\n\thoverPart: IHoverPart;\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n}\n\ninterface IRenderedContentStatusBar {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'statusBar';\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n\t/**\n\t * The actions of the hover status bar.\n\t */\n\tactions: HoverAction[];\n}\n\ntype IRenderedContentHoverPartOrStatusBar = IRenderedContentHoverPart | IRenderedContentStatusBar;\n\nclass RenderedStatusBar implements IDisposable {\n\n\tconstructor(fragment: DocumentFragment, private readonly _statusBar: EditorHoverStatusBar) {\n\t\tfragment.appendChild(this._statusBar.hoverElement);\n\t}\n\n\tget hoverElement(): HTMLElement {\n\t\treturn this._statusBar.hoverElement;\n\t}\n\n\tget actions(): HoverAction[] {\n\t\treturn this._statusBar.actions;\n\t}\n\n\tdispose() {\n\t\tthis._statusBar.dispose();\n\t}\n}\n\nclass RenderedContentHoverParts extends Disposable {\n\n\tprivate static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({\n\t\tdescription: 'content-hover-highlight',\n\t\tclassName: 'hoverHighlight'\n\t});\n\n\tprivate readonly _renderedParts: IRenderedContentHoverPartOrStatusBar[] = [];\n\tprivate readonly _perPartDisposables = new Map<number, IDisposable>();\n\tprivate readonly _fragment: DocumentFragment;\n\tprivate readonly _context: IEditorHoverContext;\n\n\tprivate _markdownHoverParticipant: MarkdownHoverParticipant | undefined;\n\tprivate _colorHoverParticipant: HoverColorPickerParticipant | undefined;\n\tprivate _focusedHoverPartIndex: number = -1;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\thoverParts: IHoverPart[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService private readonly _hoverService: IHoverService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._fragment = document.createDocumentFragment();\n\t\tthis._register(this._renderParts(participants, hoverParts, context, keybindingService, this._hoverService));\n\t\tthis._register(this._registerListenersOnRenderedParts());\n\t\tthis._register(this._createEditorDecorations(editor, hoverParts));\n\t\tthis._updateMarkdownAndColorParticipantInfo(participants);\n\t}\n\n\tprivate _createEditorDecorations(editor: ICodeEditor, hoverParts: IHoverPart[]): IDisposable {\n\t\tif (hoverParts.length === 0) {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tlet highlightRange = hoverParts[0].range;\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\thighlightRange = Range.plusRange(highlightRange, hoverPartRange);\n\t\t}\n\t\tconst highlightDecoration = editor.createDecorationsCollection();\n\t\thighlightDecoration.set([{\n\t\t\trange: highlightRange,\n\t\t\toptions: RenderedContentHoverParts._DECORATION_OPTIONS\n\t\t}]);\n\t\treturn toDisposable(() => {\n\t\t\thighlightDecoration.clear();\n\t\t});\n\t}\n\n\tprivate _renderParts(participants: IEditorHoverParticipant<IHoverPart>[], hoverParts: IHoverPart[], hoverContext: IEditorHoverContext, keybindingService: IKeybindingService, hoverService: IHoverService): IDisposable {\n\t\tconst statusBar = new EditorHoverStatusBar(keybindingService, hoverService);\n\t\tconst hoverRenderingContext: IEditorHoverRenderContext = {\n\t\t\tfragment: this._fragment,\n\t\t\tstatusBar,\n\t\t\t...hoverContext\n\t\t};\n\t\tconst disposables = new DisposableStore();\n\t\tdisposables.add(statusBar);\n\t\tfor (const participant of participants) {\n\t\t\tconst renderedHoverParts = this._renderHoverPartsForParticipant(hoverParts, participant, hoverRenderingContext);\n\t\t\tdisposables.add(renderedHoverParts);\n\t\t\tfor (const renderedHoverPart of renderedHoverParts.renderedHoverParts) {\n\t\t\t\tthis._renderedParts.push({\n\t\t\t\t\ttype: 'hoverPart',\n\t\t\t\t\tparticipant,\n\t\t\t\t\thoverPart: renderedHoverPart.hoverPart,\n\t\t\t\t\thoverElement: renderedHoverPart.hoverElement,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst renderedStatusBar = this._renderStatusBar(this._fragment, statusBar);\n\t\tif (renderedStatusBar) {\n\t\t\tdisposables.add(renderedStatusBar);\n\t\t\tthis._renderedParts.push({\n\t\t\t\ttype: 'statusBar',\n\t\t\t\thoverElement: renderedStatusBar.hoverElement,\n\t\t\t\tactions: renderedStatusBar.actions,\n\t\t\t});\n\t\t}\n\t\treturn disposables;\n\t}\n\n\tprivate _renderHoverPartsForParticipant(hoverParts: IHoverPart[], participant: IEditorHoverParticipant<IHoverPart>, hoverRenderingContext: IEditorHoverRenderContext): IRenderedHoverParts<IHoverPart> {\n\t\tconst hoverPartsForParticipant = hoverParts.filter(hoverPart => hoverPart.owner === participant);\n\t\tconst hasHoverPartsForParticipant = hoverPartsForParticipant.length > 0;\n\t\tif (!hasHoverPartsForParticipant) {\n\t\t\treturn new RenderedHoverParts([]);\n\t\t}\n\t\treturn participant.renderHoverParts(hoverRenderingContext, hoverPartsForParticipant);\n\t}\n\n\tprivate _renderStatusBar(fragment: DocumentFragment, statusBar: EditorHoverStatusBar): RenderedStatusBar | undefined {\n\t\tif (!statusBar.hasContent) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new RenderedStatusBar(fragment, statusBar);\n\t}\n\n\tprivate _registerListenersOnRenderedParts(): IDisposable {\n\t\t// Create per-part disposables so that when an individual rendered part is\n\t\t// updated we can dispose its listeners and copy button without affecting\n\t\t// the others.\n\t\tthis._renderedParts.forEach((renderedPart: IRenderedContentHoverPartOrStatusBar, index: number) => {\n\t\t\tthis._createListenersForPart(index, renderedPart);\n\t\t});\n\t\treturn toDisposable(() => {\n\t\t\tfor (const d of this._perPartDisposables.values()) {\n\t\t\t\td.dispose();\n\t\t\t}\n\t\t\tthis._perPartDisposables.clear();\n\t\t});\n\t}\n\n\tprivate _createListenersForPart(index: number, renderedPart: IRenderedContentHoverPartOrStatusBar): void {\n\t\tconst partDisposables = new DisposableStore();\n\t\tconst element = renderedPart.hoverElement;\n\t\telement.tabIndex = 0;\n\t\tpartDisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_IN, (event: Event) => {\n\t\t\tevent.stopPropagation();\n\t\t\tthis._focusedHoverPartIndex = index;\n\t\t}));\n\t\tpartDisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_OUT, (event: Event) => {\n\t\t\tevent.stopPropagation();\n\t\t\tthis._focusedHoverPartIndex = -1;\n\t\t}));\n\t\t// Add copy button for marker hovers\n\t\tif (renderedPart.type === 'hoverPart' && !(renderedPart.hoverPart instanceof ColorHover) && !renderedPart.participant.hideCopyButton) {\n\t\t\tpartDisposables.add(new HoverCopyButton(\n\t\t\t\telement,\n\t\t\t\t() => renderedPart.participant.getAccessibleContent(renderedPart.hoverPart),\n\t\t\t\tthis._clipboardService,\n\t\t\t\tthis._hoverService\n\t\t\t));\n\t\t}\n\t\tthis._perPartDisposables.set(index, partDisposables);\n\t}\n\n\tprivate _updateMarkdownAndColorParticipantInfo(participants: IEditorHoverParticipant<IHoverPart>[]) {\n\t\tconst markdownHoverParticipant = participants.find(p => {\n\t\t\treturn (p instanceof MarkdownHoverParticipant) && !(p instanceof InlayHintsHover);\n\t\t});\n\t\tif (markdownHoverParticipant) {\n\t\t\tthis._markdownHoverParticipant = markdownHoverParticipant as MarkdownHoverParticipant;\n\t\t}\n\t\tthis._colorHoverParticipant = participants.find(p => p instanceof HoverColorPickerParticipant);\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tif (index < 0 || index >= this._renderedParts.length) {\n\t\t\treturn;\n\t\t}\n\t\tthis._renderedParts[index].hoverElement.focus();\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tif (!this._markdownHoverParticipant) {\n\t\t\treturn;\n\t\t}\n\t\tlet rangeOfIndicesToUpdate: IOffsetRange;\n\t\tif (index >= 0) {\n\t\t\trangeOfIndicesToUpdate = { start: index, endExclusive: index + 1 };\n\t\t} else {\n\t\t\trangeOfIndicesToUpdate = this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);\n\t\t}\n\t\tfor (let i = rangeOfIndicesToUpdate.start; i < rangeOfIndicesToUpdate.endExclusive; i++) {\n\t\t\tconst normalizedMarkdownHoverIndex = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, i);\n\t\t\tif (normalizedMarkdownHoverIndex === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst renderedPart = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(action, normalizedMarkdownHoverIndex);\n\t\t\tif (!renderedPart) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Dispose any listeners/copy button for the previous part at this index\n\t\t\tconst prevDisposable = this._perPartDisposables.get(i);\n\t\t\tif (prevDisposable) {\n\t\t\t\tprevDisposable.dispose();\n\t\t\t\tthis._perPartDisposables.delete(i);\n\t\t\t}\n\t\t\tthis._renderedParts[i] = {\n\t\t\t\ttype: 'hoverPart',\n\t\t\t\tparticipant: this._markdownHoverParticipant,\n\t\t\t\thoverPart: renderedPart.hoverPart,\n\t\t\t\thoverElement: renderedPart.hoverElement,\n\t\t\t};\n\t\t\t// Recreate listeners and copy button for the updated part.\n\t\t\tthis._createListenersForPart(i, this._renderedParts[i]);\n\t\t}\n\t\tif (focus) {\n\t\t\tif (index >= 0) {\n\t\t\t\tthis.focusHoverPartWithIndex(index);\n\t\t\t} else {\n\t\t\t\tthis._context.focus();\n\t\t\t}\n\t\t}\n\t\tthis._context.onContentsChanged();\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._colorHoverParticipant?.isColorPickerVisible() ?? false;\n\t}\n\n\tprivate _normalizedIndexToMarkdownHoverIndexRange(markdownHoverParticipant: MarkdownHoverParticipant, index: number): number | undefined {\n\t\tconst renderedPart = this._renderedParts[index];\n\t\tif (!renderedPart || renderedPart.type !== 'hoverPart') {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst isHoverPartMarkdownHover = renderedPart.participant === markdownHoverParticipant;\n\t\tif (!isHoverPartMarkdownHover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst firstIndexOfMarkdownHovers = this._renderedParts.findIndex(renderedPart =>\n\t\t\trenderedPart.type === 'hoverPart'\n\t\t\t&& renderedPart.participant === markdownHoverParticipant\n\t\t);\n\t\tif (firstIndexOfMarkdownHovers === -1) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\t\treturn index - firstIndexOfMarkdownHovers;\n\t}\n\n\tprivate _findRangeOfMarkdownHoverParts(markdownHoverParticipant: MarkdownHoverParticipant): IOffsetRange {\n\t\tconst copiedRenderedParts = this._renderedParts.slice();\n\t\tconst firstIndexOfMarkdownHovers = copiedRenderedParts.findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst inversedLastIndexOfMarkdownHovers = copiedRenderedParts.reverse().findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst lastIndexOfMarkdownHovers = inversedLastIndexOfMarkdownHovers >= 0 ? copiedRenderedParts.length - inversedLastIndexOfMarkdownHovers : inversedLastIndexOfMarkdownHovers;\n\t\treturn { start: firstIndexOfMarkdownHovers, endExclusive: lastIndexOfMarkdownHovers + 1 };\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._fragment;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._fragment.hasChildNodes();\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedParts.length;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IEditorHoverContext, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverParts, RenderedHoverParts } from './hoverTypes.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { EditorHoverStatusBar } from './contentHoverStatusBar.js';\nimport { HoverStartSource } from './hoverOperation.js';\nimport { HoverCopyButton } from './hoverCopyButton.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { ContentHoverResult } from './contentHoverTypes.js';\nimport * as dom from '../../../../base/browser/dom.js';\nimport { HoverVerbosityAction } from '../../../common/languages.js';\nimport { MarkdownHoverParticipant } from './markdownHoverParticipant.js';\nimport { ColorHover, HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';\nimport { InlayHintsHover } from '../../inlayHints/browser/inlayHintsHover.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { HoverAction } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverService } from '../../../../platform/hover/browser/hover.js';\nimport { IOffsetRange } from '../../../common/core/ranges/offsetRange.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\n\nexport class RenderedContentHover extends Disposable {\n\n\tpublic closestMouseDistance: number | undefined;\n\tpublic initialMousePosX: number | undefined;\n\tpublic initialMousePosY: number | undefined;\n\n\tpublic readonly showAtPosition: Position;\n\tpublic readonly showAtSecondaryPosition: Position;\n\tpublic readonly shouldFocus: boolean;\n\tpublic readonly source: HoverStartSource;\n\tpublic readonly shouldAppearBeforeContent: boolean;\n\n\tprivate readonly _renderedHoverParts: RenderedContentHoverParts;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\thoverResult: ContentHoverResult,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService hoverService: IHoverService,\n\t\t@IClipboardService clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tconst parts = hoverResult.hoverParts;\n\t\tthis._renderedHoverParts = this._register(new RenderedContentHoverParts(\n\t\t\teditor,\n\t\t\tparticipants,\n\t\t\tparts,\n\t\t\tcontext,\n\t\t\tkeybindingService,\n\t\t\thoverService,\n\t\t\tclipboardService\n\t\t));\n\t\tconst contentHoverComputerOptions = hoverResult.options;\n\t\tconst anchor = contentHoverComputerOptions.anchor;\n\t\tconst { showAtPosition, showAtSecondaryPosition } = RenderedContentHover.computeHoverPositions(editor, anchor.range, parts);\n\t\tthis.shouldAppearBeforeContent = parts.some(m => m.isBeforeContent);\n\t\tthis.showAtPosition = showAtPosition;\n\t\tthis.showAtSecondaryPosition = showAtSecondaryPosition;\n\t\tthis.initialMousePosX = anchor.initialMousePosX;\n\t\tthis.initialMousePosY = anchor.initialMousePosY;\n\t\tthis.shouldFocus = contentHoverComputerOptions.shouldFocus;\n\t\tthis.source = contentHoverComputerOptions.source;\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._renderedHoverParts.domNode;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._renderedHoverParts.domNodeHasChildren;\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._renderedHoverParts.focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedHoverParts.hoverPartsCount;\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tthis._renderedHoverParts.focusHoverPartWithIndex(index);\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tthis._renderedHoverParts.updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._renderedHoverParts.isColorPickerVisible();\n\t}\n\n\tpublic static computeHoverPositions(editor: ICodeEditor, anchorRange: Range, hoverParts: IHoverPart[]): { showAtPosition: Position; showAtSecondaryPosition: Position } {\n\n\t\tlet startColumnBoundary = 1;\n\t\tif (editor.hasModel()) {\n\t\t\t// Ensure the range is on the current view line\n\t\t\tconst viewModel = editor._getViewModel();\n\t\t\tconst coordinatesConverter = viewModel.coordinatesConverter;\n\t\t\tconst anchorViewRange = coordinatesConverter.convertModelRangeToViewRange(anchorRange);\n\t\t\tconst anchorViewMinColumn = viewModel.getLineMinColumn(anchorViewRange.startLineNumber);\n\t\t\tconst anchorViewRangeStart = new Position(anchorViewRange.startLineNumber, anchorViewMinColumn);\n\t\t\tstartColumnBoundary = coordinatesConverter.convertViewPositionToModelPosition(anchorViewRangeStart).column;\n\t\t}\n\n\t\t// The anchor range is always on a single line\n\t\tconst anchorStartLineNumber = anchorRange.startLineNumber;\n\t\tlet secondaryPositionColumn = anchorRange.startColumn;\n\t\tlet forceShowAtRange: Range | undefined;\n\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\tconst hoverPartRangeOnAnchorStartLine = hoverPartRange.startLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeOnAnchorEndLine = hoverPartRange.endLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeIsOnAnchorLine = hoverPartRangeOnAnchorStartLine && hoverPartRangeOnAnchorEndLine;\n\t\t\tif (hoverPartRangeIsOnAnchorLine) {\n\t\t\t\t// this message has a range that is completely sitting on the line of the anchor\n\t\t\t\tconst hoverPartStartColumn = hoverPartRange.startColumn;\n\t\t\t\tconst minSecondaryPositionColumn = Math.min(secondaryPositionColumn, hoverPartStartColumn);\n\t\t\t\tsecondaryPositionColumn = Math.max(minSecondaryPositionColumn, startColumnBoundary);\n\t\t\t}\n\t\t\tif (hoverPart.forceShowAtRange) {\n\t\t\t\tforceShowAtRange = hoverPartRange;\n\t\t\t}\n\t\t}\n\n\t\tlet showAtPosition: Position;\n\t\tlet showAtSecondaryPosition: Position;\n\t\tif (forceShowAtRange) {\n\t\t\tconst forceShowAtPosition = forceShowAtRange.getStartPosition();\n\t\t\tshowAtPosition = forceShowAtPosition;\n\t\t\tshowAtSecondaryPosition = forceShowAtPosition;\n\t\t} else {\n\t\t\tshowAtPosition = anchorRange.getStartPosition();\n\t\t\tshowAtSecondaryPosition = new Position(anchorStartLineNumber, secondaryPositionColumn);\n\t\t}\n\t\treturn {\n\t\t\tshowAtPosition,\n\t\t\tshowAtSecondaryPosition,\n\t\t};\n\t}\n}\n\ninterface IRenderedContentHoverPart {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'hoverPart';\n\t/**\n\t * Participant of the rendered hover part\n\t */\n\tparticipant: IEditorHoverParticipant<IHoverPart>;\n\t/**\n\t * The rendered hover part\n\t */\n\thoverPart: IHoverPart;\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n}\n\ninterface IRenderedContentStatusBar {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'statusBar';\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n\t/**\n\t * The actions of the hover status bar.\n\t */\n\tactions: HoverAction[];\n}\n\ntype IRenderedContentHoverPartOrStatusBar = IRenderedContentHoverPart | IRenderedContentStatusBar;\n\nclass RenderedStatusBar implements IDisposable {\n\n\tconstructor(fragment: DocumentFragment, private readonly _statusBar: EditorHoverStatusBar) {\n\t\tfragment.appendChild(this._statusBar.hoverElement);\n\t}\n\n\tget hoverElement(): HTMLElement {\n\t\treturn this._statusBar.hoverElement;\n\t}\n\n\tget actions(): HoverAction[] {\n\t\treturn this._statusBar.actions;\n\t}\n\n\tdispose() {\n\t\tthis._statusBar.dispose();\n\t}\n}\n\nclass RenderedContentHoverParts extends Disposable {\n\n\tprivate static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({\n\t\tdescription: 'content-hover-highlight',\n\t\tclassName: 'hoverHighlight'\n\t});\n\n\tprivate readonly _renderedParts: IRenderedContentHoverPartOrStatusBar[] = [];\n\tprivate readonly _perPartDisposables = new Map<number, IDisposable>();\n\tprivate readonly _fragment: DocumentFragment;\n\tprivate readonly _context: IEditorHoverContext;\n\n\tprivate _markdownHoverParticipant: MarkdownHoverParticipant | undefined;\n\tprivate _colorHoverParticipant: HoverColorPickerParticipant | undefined;\n\tprivate _focusedHoverPartIndex: number = -1;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\thoverParts: IHoverPart[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService private readonly _hoverService: IHoverService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._fragment = document.createDocumentFragment();\n\t\tthis._register(this._renderParts(participants, hoverParts, context, keybindingService, this._hoverService));\n\t\tthis._register(this._registerListenersOnRenderedParts());\n\t\tthis._register(this._createEditorDecorations(editor, hoverParts));\n\t\tthis._updateMarkdownAndColorParticipantInfo(participants);\n\t}\n\n\tprivate _createEditorDecorations(editor: ICodeEditor, hoverParts: IHoverPart[]): IDisposable {\n\t\tif (hoverParts.length === 0) {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tlet highlightRange = hoverParts[0].range;\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\thighlightRange = Range.plusRange(highlightRange, hoverPartRange);\n\t\t}\n\t\tconst highlightDecoration = editor.createDecorationsCollection();\n\t\thighlightDecoration.set([{\n\t\t\trange: highlightRange,\n\t\t\toptions: RenderedContentHoverParts._DECORATION_OPTIONS\n\t\t}]);\n\t\treturn toDisposable(() => {\n\t\t\thighlightDecoration.clear();\n\t\t});\n\t}\n\n\tprivate _renderParts(participants: IEditorHoverParticipant<IHoverPart>[], hoverParts: IHoverPart[], hoverContext: IEditorHoverContext, keybindingService: IKeybindingService, hoverService: IHoverService): IDisposable {\n\t\tconst statusBar = new EditorHoverStatusBar(keybindingService, hoverService);\n\t\tconst hoverRenderingContext: IEditorHoverRenderContext = {\n\t\t\tfragment: this._fragment,\n\t\t\tstatusBar,\n\t\t\t...hoverContext\n\t\t};\n\t\tconst disposables = new DisposableStore();\n\t\tdisposables.add(statusBar);\n\t\tfor (const participant of participants) {\n\t\t\tconst renderedHoverParts = this._renderHoverPartsForParticipant(hoverParts, participant, hoverRenderingContext);\n\t\t\tdisposables.add(renderedHoverParts);\n\t\t\tfor (const renderedHoverPart of renderedHoverParts.renderedHoverParts) {\n\t\t\t\tthis._renderedParts.push({\n\t\t\t\t\ttype: 'hoverPart',\n\t\t\t\t\tparticipant,\n\t\t\t\t\thoverPart: renderedHoverPart.hoverPart,\n\t\t\t\t\thoverElement: renderedHoverPart.hoverElement,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst renderedStatusBar = this._renderStatusBar(this._fragment, statusBar);\n\t\tif (renderedStatusBar) {\n\t\t\tdisposables.add(renderedStatusBar);\n\t\t\tthis._renderedParts.push({\n\t\t\t\ttype: 'statusBar',\n\t\t\t\thoverElement: renderedStatusBar.hoverElement,\n\t\t\t\tactions: renderedStatusBar.actions,\n\t\t\t});\n\t\t}\n\t\treturn disposables;\n\t}\n\n\tprivate _renderHoverPartsForParticipant(hoverParts: IHoverPart[], participant: IEditorHoverParticipant<IHoverPart>, hoverRenderingContext: IEditorHoverRenderContext): IRenderedHoverParts<IHoverPart> {\n\t\tconst hoverPartsForParticipant = hoverParts.filter(hoverPart => hoverPart.owner === participant);\n\t\tconst hasHoverPartsForParticipant = hoverPartsForParticipant.length > 0;\n\t\tif (!hasHoverPartsForParticipant) {\n\t\t\treturn new RenderedHoverParts([]);\n\t\t}\n\t\treturn participant.renderHoverParts(hoverRenderingContext, hoverPartsForParticipant);\n\t}\n\n\tprivate _renderStatusBar(fragment: DocumentFragment, statusBar: EditorHoverStatusBar): RenderedStatusBar | undefined {\n\t\tif (!statusBar.hasContent) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new RenderedStatusBar(fragment, statusBar);\n\t}\n\n\tprivate _registerListenersOnRenderedParts(): IDisposable {\n\t\t// Create per-part disposables so that when an individual rendered part is\n\t\t// updated we can dispose its listeners and copy button without affecting\n\t\t// the others.\n\t\tthis._renderedParts.forEach((renderedPart: IRenderedContentHoverPartOrStatusBar, index: number) => {\n\t\t\tthis._createListenersForPart(index, renderedPart);\n\t\t});\n\t\treturn toDisposable(() => {\n\t\t\tfor (const d of this._perPartDisposables.values()) {\n\t\t\t\td.dispose();\n\t\t\t}\n\t\t\tthis._perPartDisposables.clear();\n\t\t});\n\t}\n\n\tprivate _createListenersForPart(index: number, renderedPart: IRenderedContentHoverPartOrStatusBar): void {\n\t\tconst partDisposables = new DisposableStore();\n\t\tconst element = renderedPart.hoverElement;\n\t\telement.tabIndex = 0;\n\t\tpartDisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_IN, (event: Event) => {\n\t\t\tevent.stopPropagation();\n\t\t\tthis._focusedHoverPartIndex = index;\n\t\t}));\n\t\tpartDisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_OUT, (event: Event) => {\n\t\t\tevent.stopPropagation();\n\t\t\tthis._focusedHoverPartIndex = -1;\n\t\t}));\n\t\t// Add copy button for marker hovers\n\t\tif (renderedPart.type === 'hoverPart' && !(renderedPart.hoverPart instanceof ColorHover) && !renderedPart.participant.hideCopyButton) {\n\t\t\tpartDisposables.add(new HoverCopyButton(\n\t\t\t\telement,\n\t\t\t\t() => renderedPart.participant.getAccessibleContent(renderedPart.hoverPart),\n\t\t\t\tthis._clipboardService,\n\t\t\t\tthis._hoverService\n\t\t\t));\n\t\t}\n\t\tthis._perPartDisposables.set(index, partDisposables);\n\t}\n\n\tprivate _updateMarkdownAndColorParticipantInfo(participants: IEditorHoverParticipant<IHoverPart>[]) {\n\t\tconst markdownHoverParticipant = participants.find(p => {\n\t\t\treturn (p instanceof MarkdownHoverParticipant) && !(p instanceof InlayHintsHover);\n\t\t});\n\t\tif (markdownHoverParticipant) {\n\t\t\tthis._markdownHoverParticipant = markdownHoverParticipant as MarkdownHoverParticipant;\n\t\t}\n\t\tthis._colorHoverParticipant = participants.find(p => p instanceof HoverColorPickerParticipant);\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tif (index < 0 || index >= this._renderedParts.length) {\n\t\t\treturn;\n\t\t}\n\t\tthis._renderedParts[index].hoverElement.focus();\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tif (!this._markdownHoverParticipant) {\n\t\t\treturn;\n\t\t}\n\t\tlet rangeOfIndicesToUpdate: IOffsetRange;\n\t\tif (index >= 0) {\n\t\t\trangeOfIndicesToUpdate = { start: index, endExclusive: index + 1 };\n\t\t} else {\n\t\t\trangeOfIndicesToUpdate = this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);\n\t\t}\n\t\tfor (let i = rangeOfIndicesToUpdate.start; i < rangeOfIndicesToUpdate.endExclusive; i++) {\n\t\t\tconst normalizedMarkdownHoverIndex = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, i);\n\t\t\tif (normalizedMarkdownHoverIndex === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst renderedPart = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(action, normalizedMarkdownHoverIndex);\n\t\t\tif (!renderedPart) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Dispose any listeners/copy button for the previous part at this index\n\t\t\tconst prevDisposable = this._perPartDisposables.get(i);\n\t\t\tif (prevDisposable) {\n\t\t\t\tprevDisposable.dispose();\n\t\t\t\tthis._perPartDisposables.delete(i);\n\t\t\t}\n\t\t\tthis._renderedParts[i] = {\n\t\t\t\ttype: 'hoverPart',\n\t\t\t\tparticipant: this._markdownHoverParticipant,\n\t\t\t\thoverPart: renderedPart.hoverPart,\n\t\t\t\thoverElement: renderedPart.hoverElement,\n\t\t\t};\n\t\t\t// Recreate listeners and copy button for the updated part.\n\t\t\tthis._createListenersForPart(i, this._renderedParts[i]);\n\t\t}\n\t\tif (focus) {\n\t\t\tif (index >= 0) {\n\t\t\t\tthis.focusHoverPartWithIndex(index);\n\t\t\t} else {\n\t\t\t\tthis._context.focus();\n\t\t\t}\n\t\t}\n\t\tthis._context.onContentsChanged();\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._colorHoverParticipant?.isColorPickerVisible() ?? false;\n\t}\n\n\tprivate _normalizedIndexToMarkdownHoverIndexRange(markdownHoverParticipant: MarkdownHoverParticipant, index: number): number | undefined {\n\t\tconst renderedPart = this._renderedParts[index];\n\t\tif (!renderedPart || renderedPart.type !== 'hoverPart') {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst isHoverPartMarkdownHover = renderedPart.participant === markdownHoverParticipant;\n\t\tif (!isHoverPartMarkdownHover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst firstIndexOfMarkdownHovers = this._renderedParts.findIndex(renderedPart =>\n\t\t\trenderedPart.type === 'hoverPart'\n\t\t\t&& renderedPart.participant === markdownHoverParticipant\n\t\t);\n\t\tif (firstIndexOfMarkdownHovers === -1) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\t\treturn index - firstIndexOfMarkdownHovers;\n\t}\n\n\tprivate _findRangeOfMarkdownHoverParts(markdownHoverParticipant: MarkdownHoverParticipant): IOffsetRange {\n\t\tconst copiedRenderedParts = this._renderedParts.slice();\n\t\tconst firstIndexOfMarkdownHovers = copiedRenderedParts.findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst inversedLastIndexOfMarkdownHovers = copiedRenderedParts.reverse().findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst lastIndexOfMarkdownHovers = inversedLastIndexOfMarkdownHovers >= 0 ? copiedRenderedParts.length - inversedLastIndexOfMarkdownHovers : inversedLastIndexOfMarkdownHovers;\n\t\treturn { start: firstIndexOfMarkdownHovers, endExclusive: lastIndexOfMarkdownHovers + 1 };\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._fragment;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._fragment.hasChildNodes();\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedParts.length;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/hover/browser/contentHoverRendered.ts","vs/editor/contrib/hover/browser/contentHoverRendered.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAA4G,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC/J,OAAO,EAAE,UAAU,EAAE,eAAe,EAAe,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAC9G,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAA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C,mBAAmB,CAAC,MAAM,GAAG,iCAAiC,CAAC,CAAC,CAAC,iCAAiC,CAAC;QAC9K,OAAO,EAAE,KAAK,EAAE,0BAA0B,EAAE,YAAY,EAAE,yBAAyB,GAAG,CAAC,EAAE,CAAC;IAC3F,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACvB,CAAC;IAED,IAAW,kBAAkB;QAC5B,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC;IACvC,CAAC;IAED,IAAW,qBAAqB;QAC/B,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACpC,CAAC;IAED,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC;IACnC,CAAC;;AAvPI,yBAAyB;IAqB5B,WAAA,kBAAkB,CAAA;IAClB,WAAA,aAAa,CAAA;IACb,WAAA,iBAAiB,CAAA;GAvBd,yBAAyB,CAwP9B","file":"contentHoverRendered.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IEditorHoverContext, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverParts, RenderedHoverParts } from './hoverTypes.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { EditorHoverStatusBar } from './contentHoverStatusBar.js';\nimport { HoverStartSource } from './hoverOperation.js';\nimport { HoverCopyButton } from './hoverCopyButton.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { ContentHoverResult } from './contentHoverTypes.js';\nimport * as dom from '../../../../base/browser/dom.js';\nimport { HoverVerbosityAction } from '../../../common/languages.js';\nimport { MarkdownHoverParticipant } from './markdownHoverParticipant.js';\nimport { ColorHover, HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';\nimport { InlayHintsHover } from '../../inlayHints/browser/inlayHintsHover.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { HoverAction } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverService } from '../../../../platform/hover/browser/hover.js';\nimport { IOffsetRange } from '../../../common/core/ranges/offsetRange.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\n\nexport class RenderedContentHover extends Disposable {\n\n\tpublic closestMouseDistance: number | undefined;\n\tpublic initialMousePosX: number | undefined;\n\tpublic initialMousePosY: number | undefined;\n\n\tpublic readonly showAtPosition: Position;\n\tpublic readonly showAtSecondaryPosition: Position;\n\tpublic readonly shouldFocus: boolean;\n\tpublic readonly source: HoverStartSource;\n\tpublic readonly shouldAppearBeforeContent: boolean;\n\n\tprivate readonly _renderedHoverParts: RenderedContentHoverParts;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\thoverResult: ContentHoverResult,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService hoverService: IHoverService,\n\t\t@IClipboardService clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tconst parts = hoverResult.hoverParts;\n\t\tthis._renderedHoverParts = this._register(new RenderedContentHoverParts(\n\t\t\teditor,\n\t\t\tparticipants,\n\t\t\tparts,\n\t\t\tcontext,\n\t\t\tkeybindingService,\n\t\t\thoverService,\n\t\t\tclipboardService\n\t\t));\n\t\tconst contentHoverComputerOptions = hoverResult.options;\n\t\tconst anchor = contentHoverComputerOptions.anchor;\n\t\tconst { showAtPosition, showAtSecondaryPosition } = RenderedContentHover.computeHoverPositions(editor, anchor.range, parts);\n\t\tthis.shouldAppearBeforeContent = parts.some(m => m.isBeforeContent);\n\t\tthis.showAtPosition = showAtPosition;\n\t\tthis.showAtSecondaryPosition = showAtSecondaryPosition;\n\t\tthis.initialMousePosX = anchor.initialMousePosX;\n\t\tthis.initialMousePosY = anchor.initialMousePosY;\n\t\tthis.shouldFocus = contentHoverComputerOptions.shouldFocus;\n\t\tthis.source = contentHoverComputerOptions.source;\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._renderedHoverParts.domNode;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._renderedHoverParts.domNodeHasChildren;\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._renderedHoverParts.focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedHoverParts.hoverPartsCount;\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tthis._renderedHoverParts.focusHoverPartWithIndex(index);\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tthis._renderedHoverParts.updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._renderedHoverParts.isColorPickerVisible();\n\t}\n\n\tpublic static computeHoverPositions(editor: ICodeEditor, anchorRange: Range, hoverParts: IHoverPart[]): { showAtPosition: Position; showAtSecondaryPosition: Position } {\n\n\t\tlet startColumnBoundary = 1;\n\t\tif (editor.hasModel()) {\n\t\t\t// Ensure the range is on the current view line\n\t\t\tconst viewModel = editor._getViewModel();\n\t\t\tconst coordinatesConverter = viewModel.coordinatesConverter;\n\t\t\tconst anchorViewRange = coordinatesConverter.convertModelRangeToViewRange(anchorRange);\n\t\t\tconst anchorViewMinColumn = viewModel.getLineMinColumn(anchorViewRange.startLineNumber);\n\t\t\tconst anchorViewRangeStart = new Position(anchorViewRange.startLineNumber, anchorViewMinColumn);\n\t\t\tstartColumnBoundary = coordinatesConverter.convertViewPositionToModelPosition(anchorViewRangeStart).column;\n\t\t}\n\n\t\t// The anchor range is always on a single line\n\t\tconst anchorStartLineNumber = anchorRange.startLineNumber;\n\t\tlet secondaryPositionColumn = anchorRange.startColumn;\n\t\tlet forceShowAtRange: Range | undefined;\n\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\tconst hoverPartRangeOnAnchorStartLine = hoverPartRange.startLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeOnAnchorEndLine = hoverPartRange.endLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeIsOnAnchorLine = hoverPartRangeOnAnchorStartLine && hoverPartRangeOnAnchorEndLine;\n\t\t\tif (hoverPartRangeIsOnAnchorLine) {\n\t\t\t\t// this message has a range that is completely sitting on the line of the anchor\n\t\t\t\tconst hoverPartStartColumn = hoverPartRange.startColumn;\n\t\t\t\tconst minSecondaryPositionColumn = Math.min(secondaryPositionColumn, hoverPartStartColumn);\n\t\t\t\tsecondaryPositionColumn = Math.max(minSecondaryPositionColumn, startColumnBoundary);\n\t\t\t}\n\t\t\tif (hoverPart.forceShowAtRange) {\n\t\t\t\tforceShowAtRange = hoverPartRange;\n\t\t\t}\n\t\t}\n\n\t\tlet showAtPosition: Position;\n\t\tlet showAtSecondaryPosition: Position;\n\t\tif (forceShowAtRange) {\n\t\t\tconst forceShowAtPosition = forceShowAtRange.getStartPosition();\n\t\t\tshowAtPosition = forceShowAtPosition;\n\t\t\tshowAtSecondaryPosition = forceShowAtPosition;\n\t\t} else {\n\t\t\tshowAtPosition = anchorRange.getStartPosition();\n\t\t\tshowAtSecondaryPosition = new Position(anchorStartLineNumber, secondaryPositionColumn);\n\t\t}\n\t\treturn {\n\t\t\tshowAtPosition,\n\t\t\tshowAtSecondaryPosition,\n\t\t};\n\t}\n}\n\ninterface IRenderedContentHoverPart {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'hoverPart';\n\t/**\n\t * Participant of the rendered hover part\n\t */\n\tparticipant: IEditorHoverParticipant<IHoverPart>;\n\t/**\n\t * The rendered hover part\n\t */\n\thoverPart: IHoverPart;\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n}\n\ninterface IRenderedContentStatusBar {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'statusBar';\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n\t/**\n\t * The actions of the hover status bar.\n\t */\n\tactions: HoverAction[];\n}\n\ntype IRenderedContentHoverPartOrStatusBar = IRenderedContentHoverPart | IRenderedContentStatusBar;\n\nclass RenderedStatusBar implements IDisposable {\n\n\tconstructor(fragment: DocumentFragment, private readonly _statusBar: EditorHoverStatusBar) {\n\t\tfragment.appendChild(this._statusBar.hoverElement);\n\t}\n\n\tget hoverElement(): HTMLElement {\n\t\treturn this._statusBar.hoverElement;\n\t}\n\n\tget actions(): HoverAction[] {\n\t\treturn this._statusBar.actions;\n\t}\n\n\tdispose() {\n\t\tthis._statusBar.dispose();\n\t}\n}\n\nclass RenderedContentHoverParts extends Disposable {\n\n\tprivate static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({\n\t\tdescription: 'content-hover-highlight',\n\t\tclassName: 'hoverHighlight'\n\t});\n\n\tprivate readonly _renderedParts: IRenderedContentHoverPartOrStatusBar[] = [];\n\tprivate readonly _perPartDisposables = new Map<number, IDisposable>();\n\tprivate readonly _fragment: DocumentFragment;\n\tprivate readonly _context: IEditorHoverContext;\n\n\tprivate _markdownHoverParticipant: MarkdownHoverParticipant | undefined;\n\tprivate _colorHoverParticipant: HoverColorPickerParticipant | undefined;\n\tprivate _focusedHoverPartIndex: number = -1;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\thoverParts: IHoverPart[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService private readonly _hoverService: IHoverService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._fragment = document.createDocumentFragment();\n\t\tthis._register(this._renderParts(participants, hoverParts, context, keybindingService, this._hoverService));\n\t\tthis._register(this._registerListenersOnRenderedParts());\n\t\tthis._register(this._createEditorDecorations(editor, hoverParts));\n\t\tthis._updateMarkdownAndColorParticipantInfo(participants);\n\t}\n\n\tprivate _createEditorDecorations(editor: ICodeEditor, hoverParts: IHoverPart[]): IDisposable {\n\t\tif (hoverParts.length === 0) {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tlet highlightRange = hoverParts[0].range;\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\thighlightRange = Range.plusRange(highlightRange, hoverPartRange);\n\t\t}\n\t\tconst highlightDecoration = editor.createDecorationsCollection();\n\t\thighlightDecoration.set([{\n\t\t\trange: highlightRange,\n\t\t\toptions: RenderedContentHoverParts._DECORATION_OPTIONS\n\t\t}]);\n\t\treturn toDisposable(() => {\n\t\t\thighlightDecoration.clear();\n\t\t});\n\t}\n\n\tprivate _renderParts(participants: IEditorHoverParticipant<IHoverPart>[], hoverParts: IHoverPart[], hoverContext: IEditorHoverContext, keybindingService: IKeybindingService, hoverService: IHoverService): IDisposable {\n\t\tconst statusBar = new EditorHoverStatusBar(keybindingService, hoverService);\n\t\tconst hoverRenderingContext: IEditorHoverRenderContext = {\n\t\t\tfragment: this._fragment,\n\t\t\tstatusBar,\n\t\t\t...hoverContext\n\t\t};\n\t\tconst disposables = new DisposableStore();\n\t\tdisposables.add(statusBar);\n\t\tfor (const participant of participants) {\n\t\t\tconst renderedHoverParts = this._renderHoverPartsForParticipant(hoverParts, participant, hoverRenderingContext);\n\t\t\tdisposables.add(renderedHoverParts);\n\t\t\tfor (const renderedHoverPart of renderedHoverParts.renderedHoverParts) {\n\t\t\t\tthis._renderedParts.push({\n\t\t\t\t\ttype: 'hoverPart',\n\t\t\t\t\tparticipant,\n\t\t\t\t\thoverPart: renderedHoverPart.hoverPart,\n\t\t\t\t\thoverElement: renderedHoverPart.hoverElement,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst renderedStatusBar = this._renderStatusBar(this._fragment, statusBar);\n\t\tif (renderedStatusBar) {\n\t\t\tdisposables.add(renderedStatusBar);\n\t\t\tthis._renderedParts.push({\n\t\t\t\ttype: 'statusBar',\n\t\t\t\thoverElement: renderedStatusBar.hoverElement,\n\t\t\t\tactions: renderedStatusBar.actions,\n\t\t\t});\n\t\t}\n\t\treturn disposables;\n\t}\n\n\tprivate _renderHoverPartsForParticipant(hoverParts: IHoverPart[], participant: IEditorHoverParticipant<IHoverPart>, hoverRenderingContext: IEditorHoverRenderContext): IRenderedHoverParts<IHoverPart> {\n\t\tconst hoverPartsForParticipant = hoverParts.filter(hoverPart => hoverPart.owner === participant);\n\t\tconst hasHoverPartsForParticipant = hoverPartsForParticipant.length > 0;\n\t\tif (!hasHoverPartsForParticipant) {\n\t\t\treturn new RenderedHoverParts([]);\n\t\t}\n\t\treturn participant.renderHoverParts(hoverRenderingContext, hoverPartsForParticipant);\n\t}\n\n\tprivate _renderStatusBar(fragment: DocumentFragment, statusBar: EditorHoverStatusBar): RenderedStatusBar | undefined {\n\t\tif (!statusBar.hasContent) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new RenderedStatusBar(fragment, statusBar);\n\t}\n\n\tprivate _registerListenersOnRenderedParts(): IDisposable {\n\t\t// Create per-part disposables so that when an individual rendered part is\n\t\t// updated we can dispose its listeners and copy button without affecting\n\t\t// the others.\n\t\tthis._renderedParts.forEach((renderedPart: IRenderedContentHoverPartOrStatusBar, index: number) => {\n\t\t\tthis._createListenersForPart(index, renderedPart);\n\t\t});\n\t\treturn toDisposable(() => {\n\t\t\tfor (const d of this._perPartDisposables.values()) {\n\t\t\t\td.dispose();\n\t\t\t}\n\t\t\tthis._perPartDisposables.clear();\n\t\t});\n\t}\n\n\tprivate _createListenersForPart(index: number, renderedPart: IRenderedContentHoverPartOrStatusBar): void {\n\t\tconst partDisposables = new DisposableStore();\n\t\tconst element = renderedPart.hoverElement;\n\t\telement.tabIndex = 0;\n\t\tpartDisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_IN, (event: Event) => {\n\t\t\tevent.stopPropagation();\n\t\t\tthis._focusedHoverPartIndex = index;\n\t\t}));\n\t\tpartDisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_OUT, (event: Event) => {\n\t\t\tevent.stopPropagation();\n\t\t\tthis._focusedHoverPartIndex = -1;\n\t\t}));\n\t\t// Add copy button for marker hovers\n\t\tif (renderedPart.type === 'hoverPart' && !(renderedPart.hoverPart instanceof ColorHover) && !renderedPart.participant.hideCopyButton) {\n\t\t\tpartDisposables.add(new HoverCopyButton(\n\t\t\t\telement,\n\t\t\t\t() => renderedPart.participant.getCopyContent?.(renderedPart.hoverPart) ?? renderedPart.participant.getAccessibleContent(renderedPart.hoverPart),\n\t\t\t\tthis._clipboardService,\n\t\t\t\tthis._hoverService\n\t\t\t));\n\t\t}\n\t\tthis._perPartDisposables.set(index, partDisposables);\n\t}\n\n\tprivate _updateMarkdownAndColorParticipantInfo(participants: IEditorHoverParticipant<IHoverPart>[]) {\n\t\tconst markdownHoverParticipant = participants.find(p => {\n\t\t\treturn (p instanceof MarkdownHoverParticipant) && !(p instanceof InlayHintsHover);\n\t\t});\n\t\tif (markdownHoverParticipant) {\n\t\t\tthis._markdownHoverParticipant = markdownHoverParticipant as MarkdownHoverParticipant;\n\t\t}\n\t\tthis._colorHoverParticipant = participants.find(p => p instanceof HoverColorPickerParticipant);\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tif (index < 0 || index >= this._renderedParts.length) {\n\t\t\treturn;\n\t\t}\n\t\tthis._renderedParts[index].hoverElement.focus();\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tif (!this._markdownHoverParticipant) {\n\t\t\treturn;\n\t\t}\n\t\tlet rangeOfIndicesToUpdate: IOffsetRange;\n\t\tif (index >= 0) {\n\t\t\trangeOfIndicesToUpdate = { start: index, endExclusive: index + 1 };\n\t\t} else {\n\t\t\trangeOfIndicesToUpdate = this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);\n\t\t}\n\t\tfor (let i = rangeOfIndicesToUpdate.start; i < rangeOfIndicesToUpdate.endExclusive; i++) {\n\t\t\tconst normalizedMarkdownHoverIndex = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, i);\n\t\t\tif (normalizedMarkdownHoverIndex === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst renderedPart = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(action, normalizedMarkdownHoverIndex);\n\t\t\tif (!renderedPart) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Dispose any listeners/copy button for the previous part at this index\n\t\t\tconst prevDisposable = this._perPartDisposables.get(i);\n\t\t\tif (prevDisposable) {\n\t\t\t\tprevDisposable.dispose();\n\t\t\t\tthis._perPartDisposables.delete(i);\n\t\t\t}\n\t\t\tthis._renderedParts[i] = {\n\t\t\t\ttype: 'hoverPart',\n\t\t\t\tparticipant: this._markdownHoverParticipant,\n\t\t\t\thoverPart: renderedPart.hoverPart,\n\t\t\t\thoverElement: renderedPart.hoverElement,\n\t\t\t};\n\t\t\t// Recreate listeners and copy button for the updated part.\n\t\t\tthis._createListenersForPart(i, this._renderedParts[i]);\n\t\t}\n\t\tif (focus) {\n\t\t\tif (index >= 0) {\n\t\t\t\tthis.focusHoverPartWithIndex(index);\n\t\t\t} else {\n\t\t\t\tthis._context.focus();\n\t\t\t}\n\t\t}\n\t\tthis._context.onContentsChanged();\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._colorHoverParticipant?.isColorPickerVisible() ?? false;\n\t}\n\n\tprivate _normalizedIndexToMarkdownHoverIndexRange(markdownHoverParticipant: MarkdownHoverParticipant, index: number): number | undefined {\n\t\tconst renderedPart = this._renderedParts[index];\n\t\tif (!renderedPart || renderedPart.type !== 'hoverPart') {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst isHoverPartMarkdownHover = renderedPart.participant === markdownHoverParticipant;\n\t\tif (!isHoverPartMarkdownHover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst firstIndexOfMarkdownHovers = this._renderedParts.findIndex(renderedPart =>\n\t\t\trenderedPart.type === 'hoverPart'\n\t\t\t&& renderedPart.participant === markdownHoverParticipant\n\t\t);\n\t\tif (firstIndexOfMarkdownHovers === -1) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\t\treturn index - firstIndexOfMarkdownHovers;\n\t}\n\n\tprivate _findRangeOfMarkdownHoverParts(markdownHoverParticipant: MarkdownHoverParticipant): IOffsetRange {\n\t\tconst copiedRenderedParts = this._renderedParts.slice();\n\t\tconst firstIndexOfMarkdownHovers = copiedRenderedParts.findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst inversedLastIndexOfMarkdownHovers = copiedRenderedParts.reverse().findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst lastIndexOfMarkdownHovers = inversedLastIndexOfMarkdownHovers >= 0 ? copiedRenderedParts.length - inversedLastIndexOfMarkdownHovers : inversedLastIndexOfMarkdownHovers;\n\t\treturn { start: firstIndexOfMarkdownHovers, endExclusive: lastIndexOfMarkdownHovers + 1 };\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._fragment;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._fragment.hasChildNodes();\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedParts.length;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IEditorHoverContext, IEditorHoverParticipant, IEditorHoverRenderContext, IHoverPart, IRenderedHoverParts, RenderedHoverParts } from './hoverTypes.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { EditorHoverStatusBar } from './contentHoverStatusBar.js';\nimport { HoverStartSource } from './hoverOperation.js';\nimport { HoverCopyButton } from './hoverCopyButton.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { ICodeEditor } from '../../../browser/editorBrowser.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Range } from '../../../common/core/range.js';\nimport { ContentHoverResult } from './contentHoverTypes.js';\nimport * as dom from '../../../../base/browser/dom.js';\nimport { HoverVerbosityAction } from '../../../common/languages.js';\nimport { MarkdownHoverParticipant } from './markdownHoverParticipant.js';\nimport { ColorHover, HoverColorPickerParticipant } from '../../colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js';\nimport { InlayHintsHover } from '../../inlayHints/browser/inlayHintsHover.js';\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { HoverAction } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { IHoverService } from '../../../../platform/hover/browser/hover.js';\nimport { IOffsetRange } from '../../../common/core/ranges/offsetRange.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\n\nexport class RenderedContentHover extends Disposable {\n\n\tpublic closestMouseDistance: number | undefined;\n\tpublic initialMousePosX: number | undefined;\n\tpublic initialMousePosY: number | undefined;\n\n\tpublic readonly showAtPosition: Position;\n\tpublic readonly showAtSecondaryPosition: Position;\n\tpublic readonly shouldFocus: boolean;\n\tpublic readonly source: HoverStartSource;\n\tpublic readonly shouldAppearBeforeContent: boolean;\n\n\tprivate readonly _renderedHoverParts: RenderedContentHoverParts;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\thoverResult: ContentHoverResult,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService hoverService: IHoverService,\n\t\t@IClipboardService clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tconst parts = hoverResult.hoverParts;\n\t\tthis._renderedHoverParts = this._register(new RenderedContentHoverParts(\n\t\t\teditor,\n\t\t\tparticipants,\n\t\t\tparts,\n\t\t\tcontext,\n\t\t\tkeybindingService,\n\t\t\thoverService,\n\t\t\tclipboardService\n\t\t));\n\t\tconst contentHoverComputerOptions = hoverResult.options;\n\t\tconst anchor = contentHoverComputerOptions.anchor;\n\t\tconst { showAtPosition, showAtSecondaryPosition } = RenderedContentHover.computeHoverPositions(editor, anchor.range, parts);\n\t\tthis.shouldAppearBeforeContent = parts.some(m => m.isBeforeContent);\n\t\tthis.showAtPosition = showAtPosition;\n\t\tthis.showAtSecondaryPosition = showAtSecondaryPosition;\n\t\tthis.initialMousePosX = anchor.initialMousePosX;\n\t\tthis.initialMousePosY = anchor.initialMousePosY;\n\t\tthis.shouldFocus = contentHoverComputerOptions.shouldFocus;\n\t\tthis.source = contentHoverComputerOptions.source;\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._renderedHoverParts.domNode;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._renderedHoverParts.domNodeHasChildren;\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._renderedHoverParts.focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedHoverParts.hoverPartsCount;\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tthis._renderedHoverParts.focusHoverPartWithIndex(index);\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tthis._renderedHoverParts.updateHoverVerbosityLevel(action, index, focus);\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._renderedHoverParts.isColorPickerVisible();\n\t}\n\n\tpublic static computeHoverPositions(editor: ICodeEditor, anchorRange: Range, hoverParts: IHoverPart[]): { showAtPosition: Position; showAtSecondaryPosition: Position } {\n\n\t\tlet startColumnBoundary = 1;\n\t\tif (editor.hasModel()) {\n\t\t\t// Ensure the range is on the current view line\n\t\t\tconst viewModel = editor._getViewModel();\n\t\t\tconst coordinatesConverter = viewModel.coordinatesConverter;\n\t\t\tconst anchorViewRange = coordinatesConverter.convertModelRangeToViewRange(anchorRange);\n\t\t\tconst anchorViewMinColumn = viewModel.getLineMinColumn(anchorViewRange.startLineNumber);\n\t\t\tconst anchorViewRangeStart = new Position(anchorViewRange.startLineNumber, anchorViewMinColumn);\n\t\t\tstartColumnBoundary = coordinatesConverter.convertViewPositionToModelPosition(anchorViewRangeStart).column;\n\t\t}\n\n\t\t// The anchor range is always on a single line\n\t\tconst anchorStartLineNumber = anchorRange.startLineNumber;\n\t\tlet secondaryPositionColumn = anchorRange.startColumn;\n\t\tlet forceShowAtRange: Range | undefined;\n\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\tconst hoverPartRangeOnAnchorStartLine = hoverPartRange.startLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeOnAnchorEndLine = hoverPartRange.endLineNumber === anchorStartLineNumber;\n\t\t\tconst hoverPartRangeIsOnAnchorLine = hoverPartRangeOnAnchorStartLine && hoverPartRangeOnAnchorEndLine;\n\t\t\tif (hoverPartRangeIsOnAnchorLine) {\n\t\t\t\t// this message has a range that is completely sitting on the line of the anchor\n\t\t\t\tconst hoverPartStartColumn = hoverPartRange.startColumn;\n\t\t\t\tconst minSecondaryPositionColumn = Math.min(secondaryPositionColumn, hoverPartStartColumn);\n\t\t\t\tsecondaryPositionColumn = Math.max(minSecondaryPositionColumn, startColumnBoundary);\n\t\t\t}\n\t\t\tif (hoverPart.forceShowAtRange) {\n\t\t\t\tforceShowAtRange = hoverPartRange;\n\t\t\t}\n\t\t}\n\n\t\tlet showAtPosition: Position;\n\t\tlet showAtSecondaryPosition: Position;\n\t\tif (forceShowAtRange) {\n\t\t\tconst forceShowAtPosition = forceShowAtRange.getStartPosition();\n\t\t\tshowAtPosition = forceShowAtPosition;\n\t\t\tshowAtSecondaryPosition = forceShowAtPosition;\n\t\t} else {\n\t\t\tshowAtPosition = anchorRange.getStartPosition();\n\t\t\tshowAtSecondaryPosition = new Position(anchorStartLineNumber, secondaryPositionColumn);\n\t\t}\n\t\treturn {\n\t\t\tshowAtPosition,\n\t\t\tshowAtSecondaryPosition,\n\t\t};\n\t}\n}\n\ninterface IRenderedContentHoverPart {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'hoverPart';\n\t/**\n\t * Participant of the rendered hover part\n\t */\n\tparticipant: IEditorHoverParticipant<IHoverPart>;\n\t/**\n\t * The rendered hover part\n\t */\n\thoverPart: IHoverPart;\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n}\n\ninterface IRenderedContentStatusBar {\n\t/**\n\t * Type of rendered part\n\t */\n\ttype: 'statusBar';\n\t/**\n\t * The HTML element containing the hover status bar.\n\t */\n\thoverElement: HTMLElement;\n\t/**\n\t * The actions of the hover status bar.\n\t */\n\tactions: HoverAction[];\n}\n\ntype IRenderedContentHoverPartOrStatusBar = IRenderedContentHoverPart | IRenderedContentStatusBar;\n\nclass RenderedStatusBar implements IDisposable {\n\n\tconstructor(fragment: DocumentFragment, private readonly _statusBar: EditorHoverStatusBar) {\n\t\tfragment.appendChild(this._statusBar.hoverElement);\n\t}\n\n\tget hoverElement(): HTMLElement {\n\t\treturn this._statusBar.hoverElement;\n\t}\n\n\tget actions(): HoverAction[] {\n\t\treturn this._statusBar.actions;\n\t}\n\n\tdispose() {\n\t\tthis._statusBar.dispose();\n\t}\n}\n\nclass RenderedContentHoverParts extends Disposable {\n\n\tprivate static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({\n\t\tdescription: 'content-hover-highlight',\n\t\tclassName: 'hoverHighlight'\n\t});\n\n\tprivate readonly _renderedParts: IRenderedContentHoverPartOrStatusBar[] = [];\n\tprivate readonly _perPartDisposables = new Map<number, IDisposable>();\n\tprivate readonly _fragment: DocumentFragment;\n\tprivate readonly _context: IEditorHoverContext;\n\n\tprivate _markdownHoverParticipant: MarkdownHoverParticipant | undefined;\n\tprivate _colorHoverParticipant: HoverColorPickerParticipant | undefined;\n\tprivate _focusedHoverPartIndex: number = -1;\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\tparticipants: IEditorHoverParticipant<IHoverPart>[],\n\t\thoverParts: IHoverPart[],\n\t\tcontext: IEditorHoverContext,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@IHoverService private readonly _hoverService: IHoverService,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService\n\t) {\n\t\tsuper();\n\t\tthis._context = context;\n\t\tthis._fragment = document.createDocumentFragment();\n\t\tthis._register(this._renderParts(participants, hoverParts, context, keybindingService, this._hoverService));\n\t\tthis._register(this._registerListenersOnRenderedParts());\n\t\tthis._register(this._createEditorDecorations(editor, hoverParts));\n\t\tthis._updateMarkdownAndColorParticipantInfo(participants);\n\t}\n\n\tprivate _createEditorDecorations(editor: ICodeEditor, hoverParts: IHoverPart[]): IDisposable {\n\t\tif (hoverParts.length === 0) {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tlet highlightRange = hoverParts[0].range;\n\t\tfor (const hoverPart of hoverParts) {\n\t\t\tconst hoverPartRange = hoverPart.range;\n\t\t\thighlightRange = Range.plusRange(highlightRange, hoverPartRange);\n\t\t}\n\t\tconst highlightDecoration = editor.createDecorationsCollection();\n\t\thighlightDecoration.set([{\n\t\t\trange: highlightRange,\n\t\t\toptions: RenderedContentHoverParts._DECORATION_OPTIONS\n\t\t}]);\n\t\treturn toDisposable(() => {\n\t\t\thighlightDecoration.clear();\n\t\t});\n\t}\n\n\tprivate _renderParts(participants: IEditorHoverParticipant<IHoverPart>[], hoverParts: IHoverPart[], hoverContext: IEditorHoverContext, keybindingService: IKeybindingService, hoverService: IHoverService): IDisposable {\n\t\tconst statusBar = new EditorHoverStatusBar(keybindingService, hoverService);\n\t\tconst hoverRenderingContext: IEditorHoverRenderContext = {\n\t\t\tfragment: this._fragment,\n\t\t\tstatusBar,\n\t\t\t...hoverContext\n\t\t};\n\t\tconst disposables = new DisposableStore();\n\t\tdisposables.add(statusBar);\n\t\tfor (const participant of participants) {\n\t\t\tconst renderedHoverParts = this._renderHoverPartsForParticipant(hoverParts, participant, hoverRenderingContext);\n\t\t\tdisposables.add(renderedHoverParts);\n\t\t\tfor (const renderedHoverPart of renderedHoverParts.renderedHoverParts) {\n\t\t\t\tthis._renderedParts.push({\n\t\t\t\t\ttype: 'hoverPart',\n\t\t\t\t\tparticipant,\n\t\t\t\t\thoverPart: renderedHoverPart.hoverPart,\n\t\t\t\t\thoverElement: renderedHoverPart.hoverElement,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst renderedStatusBar = this._renderStatusBar(this._fragment, statusBar);\n\t\tif (renderedStatusBar) {\n\t\t\tdisposables.add(renderedStatusBar);\n\t\t\tthis._renderedParts.push({\n\t\t\t\ttype: 'statusBar',\n\t\t\t\thoverElement: renderedStatusBar.hoverElement,\n\t\t\t\tactions: renderedStatusBar.actions,\n\t\t\t});\n\t\t}\n\t\treturn disposables;\n\t}\n\n\tprivate _renderHoverPartsForParticipant(hoverParts: IHoverPart[], participant: IEditorHoverParticipant<IHoverPart>, hoverRenderingContext: IEditorHoverRenderContext): IRenderedHoverParts<IHoverPart> {\n\t\tconst hoverPartsForParticipant = hoverParts.filter(hoverPart => hoverPart.owner === participant);\n\t\tconst hasHoverPartsForParticipant = hoverPartsForParticipant.length > 0;\n\t\tif (!hasHoverPartsForParticipant) {\n\t\t\treturn new RenderedHoverParts([]);\n\t\t}\n\t\treturn participant.renderHoverParts(hoverRenderingContext, hoverPartsForParticipant);\n\t}\n\n\tprivate _renderStatusBar(fragment: DocumentFragment, statusBar: EditorHoverStatusBar): RenderedStatusBar | undefined {\n\t\tif (!statusBar.hasContent) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new RenderedStatusBar(fragment, statusBar);\n\t}\n\n\tprivate _registerListenersOnRenderedParts(): IDisposable {\n\t\t// Create per-part disposables so that when an individual rendered part is\n\t\t// updated we can dispose its listeners and copy button without affecting\n\t\t// the others.\n\t\tthis._renderedParts.forEach((renderedPart: IRenderedContentHoverPartOrStatusBar, index: number) => {\n\t\t\tthis._createListenersForPart(index, renderedPart);\n\t\t});\n\t\treturn toDisposable(() => {\n\t\t\tfor (const d of this._perPartDisposables.values()) {\n\t\t\t\td.dispose();\n\t\t\t}\n\t\t\tthis._perPartDisposables.clear();\n\t\t});\n\t}\n\n\tprivate _createListenersForPart(index: number, renderedPart: IRenderedContentHoverPartOrStatusBar): void {\n\t\tconst partDisposables = new DisposableStore();\n\t\tconst element = renderedPart.hoverElement;\n\t\telement.tabIndex = 0;\n\t\tpartDisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_IN, (event: Event) => {\n\t\t\tevent.stopPropagation();\n\t\t\tthis._focusedHoverPartIndex = index;\n\t\t}));\n\t\tpartDisposables.add(dom.addDisposableListener(element, dom.EventType.FOCUS_OUT, (event: Event) => {\n\t\t\tevent.stopPropagation();\n\t\t\tthis._focusedHoverPartIndex = -1;\n\t\t}));\n\t\t// Add copy button for marker hovers\n\t\tif (renderedPart.type === 'hoverPart' && !(renderedPart.hoverPart instanceof ColorHover) && !renderedPart.participant.hideCopyButton) {\n\t\t\tpartDisposables.add(new HoverCopyButton(\n\t\t\t\telement,\n\t\t\t\t() => renderedPart.participant.getCopyContent?.(renderedPart.hoverPart) ?? renderedPart.participant.getAccessibleContent(renderedPart.hoverPart),\n\t\t\t\tthis._clipboardService,\n\t\t\t\tthis._hoverService\n\t\t\t));\n\t\t}\n\t\tthis._perPartDisposables.set(index, partDisposables);\n\t}\n\n\tprivate _updateMarkdownAndColorParticipantInfo(participants: IEditorHoverParticipant<IHoverPart>[]) {\n\t\tconst markdownHoverParticipant = participants.find(p => {\n\t\t\treturn (p instanceof MarkdownHoverParticipant) && !(p instanceof InlayHintsHover);\n\t\t});\n\t\tif (markdownHoverParticipant) {\n\t\t\tthis._markdownHoverParticipant = markdownHoverParticipant as MarkdownHoverParticipant;\n\t\t}\n\t\tthis._colorHoverParticipant = participants.find(p => p instanceof HoverColorPickerParticipant);\n\t}\n\n\tpublic focusHoverPartWithIndex(index: number): void {\n\t\tif (index < 0 || index >= this._renderedParts.length) {\n\t\t\treturn;\n\t\t}\n\t\tthis._renderedParts[index].hoverElement.focus();\n\t}\n\n\tpublic async updateHoverVerbosityLevel(action: HoverVerbosityAction, index: number, focus?: boolean): Promise<void> {\n\t\tif (!this._markdownHoverParticipant) {\n\t\t\treturn;\n\t\t}\n\t\tlet rangeOfIndicesToUpdate: IOffsetRange;\n\t\tif (index >= 0) {\n\t\t\trangeOfIndicesToUpdate = { start: index, endExclusive: index + 1 };\n\t\t} else {\n\t\t\trangeOfIndicesToUpdate = this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);\n\t\t}\n\t\tfor (let i = rangeOfIndicesToUpdate.start; i < rangeOfIndicesToUpdate.endExclusive; i++) {\n\t\t\tconst normalizedMarkdownHoverIndex = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, i);\n\t\t\tif (normalizedMarkdownHoverIndex === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst renderedPart = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(action, normalizedMarkdownHoverIndex);\n\t\t\tif (!renderedPart) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Dispose any listeners/copy button for the previous part at this index\n\t\t\tconst prevDisposable = this._perPartDisposables.get(i);\n\t\t\tif (prevDisposable) {\n\t\t\t\tprevDisposable.dispose();\n\t\t\t\tthis._perPartDisposables.delete(i);\n\t\t\t}\n\t\t\tthis._renderedParts[i] = {\n\t\t\t\ttype: 'hoverPart',\n\t\t\t\tparticipant: this._markdownHoverParticipant,\n\t\t\t\thoverPart: renderedPart.hoverPart,\n\t\t\t\thoverElement: renderedPart.hoverElement,\n\t\t\t};\n\t\t\t// Recreate listeners and copy button for the updated part.\n\t\t\tthis._createListenersForPart(i, this._renderedParts[i]);\n\t\t}\n\t\tif (focus) {\n\t\t\tif (index >= 0) {\n\t\t\t\tthis.focusHoverPartWithIndex(index);\n\t\t\t} else {\n\t\t\t\tthis._context.focus();\n\t\t\t}\n\t\t}\n\t\tthis._context.onContentsChanged();\n\t}\n\n\tpublic isColorPickerVisible(): boolean {\n\t\treturn this._colorHoverParticipant?.isColorPickerVisible() ?? false;\n\t}\n\n\tprivate _normalizedIndexToMarkdownHoverIndexRange(markdownHoverParticipant: MarkdownHoverParticipant, index: number): number | undefined {\n\t\tconst renderedPart = this._renderedParts[index];\n\t\tif (!renderedPart || renderedPart.type !== 'hoverPart') {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst isHoverPartMarkdownHover = renderedPart.participant === markdownHoverParticipant;\n\t\tif (!isHoverPartMarkdownHover) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst firstIndexOfMarkdownHovers = this._renderedParts.findIndex(renderedPart =>\n\t\t\trenderedPart.type === 'hoverPart'\n\t\t\t&& renderedPart.participant === markdownHoverParticipant\n\t\t);\n\t\tif (firstIndexOfMarkdownHovers === -1) {\n\t\t\tthrow new BugIndicatingError();\n\t\t}\n\t\treturn index - firstIndexOfMarkdownHovers;\n\t}\n\n\tprivate _findRangeOfMarkdownHoverParts(markdownHoverParticipant: MarkdownHoverParticipant): IOffsetRange {\n\t\tconst copiedRenderedParts = this._renderedParts.slice();\n\t\tconst firstIndexOfMarkdownHovers = copiedRenderedParts.findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst inversedLastIndexOfMarkdownHovers = copiedRenderedParts.reverse().findIndex(renderedPart => renderedPart.type === 'hoverPart' && renderedPart.participant === markdownHoverParticipant);\n\t\tconst lastIndexOfMarkdownHovers = inversedLastIndexOfMarkdownHovers >= 0 ? copiedRenderedParts.length - inversedLastIndexOfMarkdownHovers : inversedLastIndexOfMarkdownHovers;\n\t\treturn { start: firstIndexOfMarkdownHovers, endExclusive: lastIndexOfMarkdownHovers + 1 };\n\t}\n\n\tpublic get domNode(): DocumentFragment {\n\t\treturn this._fragment;\n\t}\n\n\tpublic get domNodeHasChildren(): boolean {\n\t\treturn this._fragment.hasChildNodes();\n\t}\n\n\tpublic get focusedHoverPartIndex(): number {\n\t\treturn this._focusedHoverPartIndex;\n\t}\n\n\tpublic get hoverPartsCount(): number {\n\t\treturn this._renderedParts.length;\n\t}\n}\n"]}
@@ -46,8 +46,6 @@ let ContentHoverWidget = class ContentHoverWidget extends ResizableContentWidget
46
46
  this._hover = this._register(new HoverWidget(true));
47
47
  this._onDidResize = this._register(new Emitter());
48
48
  this.onDidResize = this._onDidResize.event;
49
- this._onDidScroll = this._register(new Emitter());
50
- this.onDidScroll = this._onDidScroll.event;
51
49
  this._onContentsChanged = this._register(new Emitter());
52
50
  this.onContentsChanged = this._onContentsChanged.event;
53
51
  // Overflow widgets can be hosted outside the editor's DOM context.
@@ -75,9 +73,6 @@ let ContentHoverWidget = class ContentHoverWidget extends ResizableContentWidget
75
73
  this._register(focusTracker.onDidBlur(() => {
76
74
  this._hoverFocusedKey.set(false);
77
75
  }));
78
- this._register(this._hover.scrollbar.onScroll((e) => {
79
- this._onDidScroll.fire(e);
80
- }));
81
76
  this._setRenderedHover(undefined);
82
77
  this._editor.addContentWidget(this);
83
78
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/hover/browser/contentHoverWidget.ts","vs/editor/contrib/hover/browser/contentHoverWidget.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,KAAK,GAAG,MAAM,iCAAiC,CAAC;AAIvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAC1F,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAe,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AACvG,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AACnG,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AAE3G,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAI3D,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE5B,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,sBAAsB;;aAE/C,OAAE,GAAG,4CAAH,AAA+C,CAAC;aACjD,oBAAe,GAAkB,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAxC,AAAyC,CAAC;IAoBxE,IAAW,qBAAqB;QAC/B,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,sCAA8B,CAAC,CAAC;IACpE,CAAC;IAED,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,KAAK,CAAC;IAC7C,CAAC;IAED,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,KAAK,CAAC;IAC7C,CAAC;IAED,YACC,MAAmB,EACC,iBAAqC,EAClC,qBAA6D,EAC7D,qBA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,CAAA;IAClB,WAAA,qBAAqB,CAAA;IACrB,WAAA,qBAAqB,CAAA;IACrB,WAAA,kBAAkB,CAAA;GAxCR,kBAAkB,CAqc9B;;AAED,SAAS,mCAAmC,CAAC,MAAc,EAAE,MAAc,EAAE,IAAY,EAAE,GAAW,EAAE,KAAa,EAAE,MAAc;IACpI,MAAM,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,wBAAwB;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,wBAAwB;IACtD,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACzD,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1D,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;AACrC,CAAC","file":"contentHoverWidget.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 { ContentWidgetPositionPreference, ICodeEditor, IContentWidgetPosition } from '../../../browser/editorBrowser.js';\nimport { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js';\nimport { HoverStartSource } from './hoverOperation.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ResizableContentWidget } from './resizableContentWidget.js';\nimport { IContextKey, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\nimport { IAccessibilityService } from '../../../../platform/accessibility/common/accessibility.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { getHoverAccessibleViewHint, HoverWidget } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { PositionAffinity } from '../../../common/model.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { RenderedContentHover } from './contentHoverRendered.js';\nimport { ScrollEvent } from '../../../../base/common/scrollable.js';\n\nconst HORIZONTAL_SCROLLING_BY = 30;\n\nexport class ContentHoverWidget extends ResizableContentWidget {\n\n\tpublic static ID = 'editor.contrib.resizableContentHoverWidget';\n\tprivate static _lastDimensions: dom.Dimension = new dom.Dimension(0, 0);\n\n\tprivate _renderedHover: RenderedContentHover | undefined;\n\tprivate _positionPreference: ContentWidgetPositionPreference | undefined;\n\tprivate _minimumSize: dom.Dimension;\n\tprivate _contentWidth: number | undefined;\n\n\tprivate readonly _hover: HoverWidget = this._register(new HoverWidget(true));\n\tprivate readonly _hoverVisibleKey: IContextKey<boolean>;\n\tprivate readonly _hoverFocusedKey: IContextKey<boolean>;\n\n\tprivate readonly _onDidResize = this._register(new Emitter<void>());\n\tpublic readonly onDidResize = this._onDidResize.event;\n\n\tprivate readonly _onDidScroll = this._register(new Emitter<ScrollEvent>());\n\tpublic readonly onDidScroll = this._onDidScroll.event;\n\n\tprivate readonly _onContentsChanged = this._register(new Emitter<void>());\n\tpublic readonly onContentsChanged = this._onContentsChanged.event;\n\n\tpublic get isVisibleFromKeyboard(): boolean {\n\t\treturn (this._renderedHover?.source === HoverStartSource.Keyboard);\n\t}\n\n\tpublic get isVisible(): boolean {\n\t\treturn this._hoverVisibleKey.get() ?? false;\n\t}\n\n\tpublic get isFocused(): boolean {\n\t\treturn this._hoverFocusedKey.get() ?? false;\n\t}\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService\n\t) {\n\t\tconst minimumHeight = editor.getOption(EditorOption.lineHeight) + 8;\n\t\tconst minimumWidth = 150;\n\t\tconst minimumSize = new dom.Dimension(minimumWidth, minimumHeight);\n\t\tsuper(editor, minimumSize);\n\n\t\t// Overflow widgets can be hosted outside the editor's DOM context.\n\t\tthis._register(contextKeyService.createScoped(this._resizableNode.domNode));\n\t\tthis._minimumSize = minimumSize;\n\t\tthis._hoverVisibleKey = EditorContextKeys.hoverVisible.bindTo(contextKeyService);\n\t\tthis._hoverFocusedKey = EditorContextKeys.hoverFocused.bindTo(contextKeyService);\n\n\t\tdom.append(this._resizableNode.domNode, this._hover.containerDomNode);\n\t\tthis._resizableNode.domNode.style.zIndex = '50';\n\t\tthis._resizableNode.domNode.className = 'monaco-resizable-hover';\n\n\t\tthis._register(this._editor.onDidLayoutChange(() => {\n\t\t\tif (this.isVisible) {\n\t\t\t\tthis._updateMaxDimensions();\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {\n\t\t\tif (e.hasChanged(EditorOption.fontInfo)) {\n\t\t\t\tthis._updateFont();\n\t\t\t}\n\t\t}));\n\t\tconst focusTracker = this._register(dom.trackFocus(this._resizableNode.domNode));\n\t\tthis._register(focusTracker.onDidFocus(() => {\n\t\t\tthis._hoverFocusedKey.set(true);\n\t\t}));\n\t\tthis._register(focusTracker.onDidBlur(() => {\n\t\t\tthis._hoverFocusedKey.set(false);\n\t\t}));\n\t\tthis._register(this._hover.scrollbar.onScroll((e) => {\n\t\t\tthis._onDidScroll.fire(e);\n\t\t}));\n\t\tthis._setRenderedHover(undefined);\n\t\tthis._editor.addContentWidget(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._renderedHover?.dispose();\n\t\tthis._editor.removeContentWidget(this);\n\t}\n\n\tpublic getId(): string {\n\t\treturn ContentHoverWidget.ID;\n\t}\n\n\tprivate static _applyDimensions(container: HTMLElement, width: number | string, height: number | string): void {\n\t\tconst transformedWidth = typeof width === 'number' ? `${width}px` : width;\n\t\tconst transformedHeight = typeof height === 'number' ? `${height}px` : height;\n\t\tcontainer.style.width = transformedWidth;\n\t\tcontainer.style.height = transformedHeight;\n\t}\n\n\tprivate _setContentsDomNodeDimensions(width: number | string, height: number | string): void {\n\t\tconst contentsDomNode = this._hover.contentsDomNode;\n\t\treturn ContentHoverWidget._applyDimensions(contentsDomNode, width, height);\n\t}\n\n\tprivate _setContainerDomNodeDimensions(width: number | string, height: number | string): void {\n\t\tconst containerDomNode = this._hover.containerDomNode;\n\t\treturn ContentHoverWidget._applyDimensions(containerDomNode, width, height);\n\t}\n\n\tprivate _setScrollableElementDimensions(width: number | string, height: number | string): void {\n\t\tconst scrollbarDomElement = this._hover.scrollbar.getDomNode();\n\t\treturn ContentHoverWidget._applyDimensions(scrollbarDomElement, width, height);\n\t}\n\n\tprivate _setHoverWidgetDimensions(width: number | string, height: number | string): void {\n\t\tthis._setContainerDomNodeDimensions(width, height);\n\t\tthis._setScrollableElementDimensions(width, height);\n\t\tthis._setContentsDomNodeDimensions(width, height);\n\t\tthis._layoutContentWidget();\n\t}\n\n\tprivate static _applyMaxDimensions(container: HTMLElement, width: number | string, height: number | string) {\n\t\tconst transformedWidth = typeof width === 'number' ? `${width}px` : width;\n\t\tconst transformedHeight = typeof height === 'number' ? `${height}px` : height;\n\t\tcontainer.style.maxWidth = transformedWidth;\n\t\tcontainer.style.maxHeight = transformedHeight;\n\t}\n\n\tprivate _setHoverWidgetMaxDimensions(width: number | string, height: number | string): void {\n\t\tContentHoverWidget._applyMaxDimensions(this._hover.contentsDomNode, width, height);\n\t\tContentHoverWidget._applyMaxDimensions(this._hover.scrollbar.getDomNode(), width, height);\n\t\tContentHoverWidget._applyMaxDimensions(this._hover.containerDomNode, width, height);\n\t\tthis._hover.containerDomNode.style.setProperty('--vscode-hover-maxWidth', typeof width === 'number' ? `${width}px` : width);\n\t\tthis._layoutContentWidget();\n\t}\n\n\tprivate _setAdjustedHoverWidgetDimensions(size: dom.Dimension): void {\n\t\tthis._setHoverWidgetMaxDimensions('none', 'none');\n\t\tthis._setHoverWidgetDimensions(size.width, size.height);\n\t}\n\n\tprivate _updateResizableNodeMaxDimensions(): void {\n\t\tconst maxRenderingWidth = this._findMaximumRenderingWidth() ?? Infinity;\n\t\tconst maxRenderingHeight = this._findMaximumRenderingHeight() ?? Infinity;\n\t\tthis._resizableNode.maxSize = new dom.Dimension(maxRenderingWidth, maxRenderingHeight);\n\t\tthis._setHoverWidgetMaxDimensions(maxRenderingWidth, maxRenderingHeight);\n\t}\n\n\tprotected override _resize(size: dom.Dimension): void {\n\t\tContentHoverWidget._lastDimensions = new dom.Dimension(size.width, size.height);\n\t\tthis._setAdjustedHoverWidgetDimensions(size);\n\t\tthis._resizableNode.layout(size.height, size.width);\n\t\tthis._updateResizableNodeMaxDimensions();\n\t\tthis._hover.scrollbar.scanDomNode();\n\t\tthis._editor.layoutContentWidget(this);\n\t\tthis._onDidResize.fire();\n\t}\n\n\tprivate _findAvailableSpaceVertically(): number | undefined {\n\t\tconst position = this._renderedHover?.showAtPosition;\n\t\tif (!position) {\n\t\t\treturn;\n\t\t}\n\t\treturn this._positionPreference === ContentWidgetPositionPreference.ABOVE ?\n\t\t\tthis._availableVerticalSpaceAbove(position)\n\t\t\t: this._availableVerticalSpaceBelow(position);\n\t}\n\n\tprivate _findMaximumRenderingHeight(): number | undefined {\n\t\tconst availableSpace = this._findAvailableSpaceVertically();\n\t\tif (!availableSpace) {\n\t\t\treturn;\n\t\t}\n\t\tconst children = this._hover.contentsDomNode.children;\n\t\tlet maximumHeight = children.length - 1;\n\t\tArray.from(this._hover.contentsDomNode.children).forEach((hoverPart) => {\n\t\t\tmaximumHeight += hoverPart.clientHeight;\n\t\t});\n\t\treturn Math.min(availableSpace, maximumHeight);\n\t}\n\n\tprivate _isHoverTextOverflowing(): boolean {\n\t\t// To find out if the text is overflowing, we will disable wrapping, check the widths, and then re-enable wrapping\n\t\tthis._hover.containerDomNode.style.setProperty('--vscode-hover-whiteSpace', 'nowrap');\n\t\tthis._hover.containerDomNode.style.setProperty('--vscode-hover-sourceWhiteSpace', 'nowrap');\n\n\t\tconst overflowing = Array.from(this._hover.contentsDomNode.children).some((hoverElement) => {\n\t\t\treturn hoverElement.scrollWidth > hoverElement.clientWidth;\n\t\t});\n\n\t\tthis._hover.containerDomNode.style.removeProperty('--vscode-hover-whiteSpace');\n\t\tthis._hover.containerDomNode.style.removeProperty('--vscode-hover-sourceWhiteSpace');\n\n\t\treturn overflowing;\n\t}\n\n\tprivate _findMaximumRenderingWidth(): number | undefined {\n\t\tif (!this._editor || !this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst overflowing = this._isHoverTextOverflowing();\n\t\tconst initialWidth = (\n\t\t\ttypeof this._contentWidth === 'undefined'\n\t\t\t\t? 0\n\t\t\t\t: this._contentWidth\n\t\t);\n\n\t\tif (overflowing || this._hover.containerDomNode.clientWidth < initialWidth) {\n\t\t\tconst bodyBoxWidth = dom.getClientArea(this._hover.containerDomNode.ownerDocument.body).width;\n\t\t\tconst horizontalPadding = 14;\n\t\t\treturn bodyBoxWidth - horizontalPadding;\n\t\t} else {\n\t\t\treturn this._hover.containerDomNode.clientWidth;\n\t\t}\n\t}\n\n\tpublic isMouseGettingCloser(posx: number, posy: number): boolean {\n\n\t\tif (!this._renderedHover) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this._renderedHover.initialMousePosX === undefined || this._renderedHover.initialMousePosY === undefined) {\n\t\t\tthis._renderedHover.initialMousePosX = posx;\n\t\t\tthis._renderedHover.initialMousePosY = posy;\n\t\t\treturn false;\n\t\t}\n\n\t\tconst widgetRect = dom.getDomNodePagePosition(this.getDomNode());\n\t\tif (this._renderedHover.closestMouseDistance === undefined) {\n\t\t\tthis._renderedHover.closestMouseDistance = computeDistanceFromPointToRectangle(\n\t\t\t\tthis._renderedHover.initialMousePosX,\n\t\t\t\tthis._renderedHover.initialMousePosY,\n\t\t\t\twidgetRect.left,\n\t\t\t\twidgetRect.top,\n\t\t\t\twidgetRect.width,\n\t\t\t\twidgetRect.height\n\t\t\t);\n\t\t}\n\n\t\tconst distance = computeDistanceFromPointToRectangle(\n\t\t\tposx,\n\t\t\tposy,\n\t\t\twidgetRect.left,\n\t\t\twidgetRect.top,\n\t\t\twidgetRect.width,\n\t\t\twidgetRect.height\n\t\t);\n\t\tif (distance > this._renderedHover.closestMouseDistance + 4 /* tolerance of 4 pixels */) {\n\t\t\t// The mouse is getting farther away\n\t\t\treturn false;\n\t\t}\n\n\t\tthis._renderedHover.closestMouseDistance = Math.min(this._renderedHover.closestMouseDistance, distance);\n\t\treturn true;\n\t}\n\n\tprivate _setRenderedHover(renderedHover: RenderedContentHover | undefined): void {\n\t\tthis._renderedHover?.dispose();\n\t\tthis._renderedHover = renderedHover;\n\t\tthis._hoverVisibleKey.set(!!renderedHover);\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !renderedHover);\n\t}\n\n\tprivate _updateFont(): void {\n\t\tconst { fontSize, lineHeight } = this._editor.getOption(EditorOption.fontInfo);\n\t\tconst contentsDomNode = this._hover.contentsDomNode;\n\t\tcontentsDomNode.style.fontSize = `${fontSize}px`;\n\t\tcontentsDomNode.style.lineHeight = `${lineHeight / fontSize}`;\n\t\t// eslint-disable-next-line eslint-js/no-restricted-syntax\n\t\tconst codeClasses: HTMLElement[] = Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName('code'));\n\t\tcodeClasses.forEach(node => this._editor.applyFontInfo(node));\n\t}\n\n\tprivate _updateContent(node: DocumentFragment): void {\n\t\tconst contentsDomNode = this._hover.contentsDomNode;\n\t\tcontentsDomNode.style.paddingBottom = '';\n\t\tcontentsDomNode.textContent = '';\n\t\tcontentsDomNode.appendChild(node);\n\t}\n\n\tprivate _layoutContentWidget(): void {\n\t\tthis._editor.layoutContentWidget(this);\n\t\tthis._hover.onContentsChanged();\n\t}\n\n\tprivate _updateMaxDimensions() {\n\t\tconst height = Math.max(this._editor.getLayoutInfo().height / 4, 250, ContentHoverWidget._lastDimensions.height);\n\t\tconst width = Math.max(this._editor.getLayoutInfo().width * 0.66, 750, ContentHoverWidget._lastDimensions.width);\n\t\tthis._resizableNode.maxSize = new dom.Dimension(width, height);\n\t\tthis._setHoverWidgetMaxDimensions(width, height);\n\t}\n\n\tprivate _render(renderedHover: RenderedContentHover) {\n\t\tthis._setRenderedHover(renderedHover);\n\t\tthis._updateFont();\n\t\tthis._updateContent(renderedHover.domNode);\n\t\tthis.handleContentsChanged();\n\t\t// Simply force a synchronous render on the editor\n\t\t// such that the widget does not really render with left = '0px'\n\t\tthis._editor.render();\n\t}\n\n\toverride getPosition(): IContentWidgetPosition | null {\n\t\tif (!this._renderedHover) {\n\t\t\treturn null;\n\t\t}\n\t\treturn {\n\t\t\tposition: this._renderedHover.showAtPosition,\n\t\t\tsecondaryPosition: this._renderedHover.showAtSecondaryPosition,\n\t\t\tpositionAffinity: this._renderedHover.shouldAppearBeforeContent ? PositionAffinity.LeftOfInjectedText : undefined,\n\t\t\tpreference: [this._positionPreference ?? ContentWidgetPositionPreference.ABOVE]\n\t\t};\n\t}\n\n\tpublic show(renderedHover: RenderedContentHover): void {\n\t\tif (!this._editor || !this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tthis._render(renderedHover);\n\t\tconst widgetHeight = dom.getTotalHeight(this._hover.containerDomNode);\n\t\tconst widgetPosition = renderedHover.showAtPosition;\n\t\tthis._positionPreference = this._findPositionPreference(widgetHeight, widgetPosition) ?? ContentWidgetPositionPreference.ABOVE;\n\n\t\t// See https://github.com/microsoft/vscode/issues/140339\n\t\t// TODO: Doing a second layout of the hover after force rendering the editor\n\t\tthis.handleContentsChanged();\n\t\tif (renderedHover.shouldFocus) {\n\t\t\tthis._hover.containerDomNode.focus();\n\t\t}\n\t\tthis._onDidResize.fire();\n\t\t// The aria label overrides the label, so if we add to it, add the contents of the hover\n\t\tconst hoverFocused = this._hover.containerDomNode.ownerDocument.activeElement === this._hover.containerDomNode;\n\t\tconst accessibleViewHint = hoverFocused && getHoverAccessibleViewHint(\n\t\t\tthis._configurationService.getValue('accessibility.verbosity.hover') === true && this._accessibilityService.isScreenReaderOptimized(),\n\t\t\tthis._keybindingService.lookupKeybinding('editor.action.accessibleView')?.getAriaLabel() ?? ''\n\t\t);\n\n\t\tif (accessibleViewHint) {\n\t\t\tthis._hover.contentsDomNode.ariaLabel = this._hover.contentsDomNode.textContent + ', ' + accessibleViewHint;\n\t\t}\n\t}\n\n\tpublic hide(): void {\n\t\tif (!this._renderedHover) {\n\t\t\treturn;\n\t\t}\n\t\tconst hoverStoleFocus = this._renderedHover.shouldFocus || this._hoverFocusedKey.get();\n\t\tthis._setRenderedHover(undefined);\n\t\tthis._resizableNode.maxSize = new dom.Dimension(Infinity, Infinity);\n\t\tthis._resizableNode.clearSashHoverState();\n\t\tthis._hoverFocusedKey.set(false);\n\t\tthis._editor.layoutContentWidget(this);\n\t\tif (hoverStoleFocus) {\n\t\t\tthis._editor.focus();\n\t\t}\n\t}\n\n\tprivate _removeConstraintsRenderNormally(): void {\n\t\t// Added because otherwise the initial size of the hover content is smaller than should be\n\t\tconst layoutInfo = this._editor.getLayoutInfo();\n\t\tthis._resizableNode.layout(layoutInfo.height, layoutInfo.width);\n\t\tthis._setHoverWidgetDimensions('auto', 'auto');\n\t\tthis._updateMaxDimensions();\n\t}\n\n\tpublic setMinimumDimensions(dimensions: dom.Dimension): void {\n\t\t// We combine the new minimum dimensions with the previous ones\n\t\tthis._minimumSize = new dom.Dimension(\n\t\t\tMath.max(this._minimumSize.width, dimensions.width),\n\t\t\tMath.max(this._minimumSize.height, dimensions.height)\n\t\t);\n\t\tthis._updateMinimumWidth();\n\t}\n\n\tprivate _updateMinimumWidth(): void {\n\t\tconst width = (\n\t\t\ttypeof this._contentWidth === 'undefined'\n\t\t\t\t? this._minimumSize.width\n\t\t\t\t: Math.min(this._contentWidth, this._minimumSize.width)\n\t\t);\n\t\t// We want to avoid that the hover is artificially large, so we use the content width as minimum width\n\t\tthis._resizableNode.minSize = new dom.Dimension(width, this._minimumSize.height);\n\t}\n\n\tpublic handleContentsChanged(): void {\n\t\tthis._removeConstraintsRenderNormally();\n\t\tconst contentsDomNode = this._hover.contentsDomNode;\n\n\t\tlet height = dom.getTotalHeight(contentsDomNode);\n\t\tlet width = dom.getTotalWidth(contentsDomNode) + 2;\n\t\tthis._resizableNode.layout(height, width);\n\n\t\tthis._setHoverWidgetDimensions(width, height);\n\n\t\theight = dom.getTotalHeight(contentsDomNode);\n\t\twidth = dom.getTotalWidth(contentsDomNode);\n\t\tthis._contentWidth = width;\n\t\tthis._updateMinimumWidth();\n\t\tthis._resizableNode.layout(height, width);\n\n\t\tif (this._renderedHover?.showAtPosition) {\n\t\t\tconst widgetHeight = dom.getTotalHeight(this._hover.containerDomNode);\n\t\t\tthis._positionPreference = this._findPositionPreference(widgetHeight, this._renderedHover.showAtPosition);\n\t\t}\n\t\tthis._layoutContentWidget();\n\t\tthis._onContentsChanged.fire();\n\t}\n\n\tpublic focus(): void {\n\t\tthis._hover.containerDomNode.focus();\n\t}\n\n\tpublic scrollUp(): void {\n\t\tconst scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop;\n\t\tconst fontInfo = this._editor.getOption(EditorOption.fontInfo);\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop - fontInfo.lineHeight });\n\t}\n\n\tpublic scrollDown(): void {\n\t\tconst scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop;\n\t\tconst fontInfo = this._editor.getOption(EditorOption.fontInfo);\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop + fontInfo.lineHeight });\n\t}\n\n\tpublic scrollLeft(): void {\n\t\tconst scrollLeft = this._hover.scrollbar.getScrollPosition().scrollLeft;\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollLeft: scrollLeft - HORIZONTAL_SCROLLING_BY });\n\t}\n\n\tpublic scrollRight(): void {\n\t\tconst scrollLeft = this._hover.scrollbar.getScrollPosition().scrollLeft;\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollLeft: scrollLeft + HORIZONTAL_SCROLLING_BY });\n\t}\n\n\tpublic pageUp(): void {\n\t\tconst scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop;\n\t\tconst scrollHeight = this._hover.scrollbar.getScrollDimensions().height;\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop - scrollHeight });\n\t}\n\n\tpublic pageDown(): void {\n\t\tconst scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop;\n\t\tconst scrollHeight = this._hover.scrollbar.getScrollDimensions().height;\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop + scrollHeight });\n\t}\n\n\tpublic goToTop(): void {\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: 0 });\n\t}\n\n\tpublic goToBottom(): void {\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: this._hover.scrollbar.getScrollDimensions().scrollHeight });\n\t}\n}\n\nfunction computeDistanceFromPointToRectangle(pointX: number, pointY: number, left: number, top: number, width: number, height: number): number {\n\tconst x = (left + width / 2); // x center of rectangle\n\tconst y = (top + height / 2); // y center of rectangle\n\tconst dx = Math.max(Math.abs(pointX - x) - width / 2, 0);\n\tconst dy = Math.max(Math.abs(pointY - y) - height / 2, 0);\n\treturn Math.sqrt(dx * dx + dy * dy);\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 { ContentWidgetPositionPreference, ICodeEditor, IContentWidgetPosition } from '../../../browser/editorBrowser.js';\nimport { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js';\nimport { HoverStartSource } from './hoverOperation.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ResizableContentWidget } from './resizableContentWidget.js';\nimport { IContextKey, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\nimport { IAccessibilityService } from '../../../../platform/accessibility/common/accessibility.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { getHoverAccessibleViewHint, HoverWidget } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { PositionAffinity } from '../../../common/model.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { RenderedContentHover } from './contentHoverRendered.js';\nimport { ScrollEvent } from '../../../../base/common/scrollable.js';\n\nconst HORIZONTAL_SCROLLING_BY = 30;\n\nexport class ContentHoverWidget extends ResizableContentWidget {\n\n\tpublic static ID = 'editor.contrib.resizableContentHoverWidget';\n\tprivate static _lastDimensions: dom.Dimension = new dom.Dimension(0, 0);\n\n\tprivate _renderedHover: RenderedContentHover | undefined;\n\tprivate _positionPreference: ContentWidgetPositionPreference | undefined;\n\tprivate _minimumSize: dom.Dimension;\n\tprivate _contentWidth: number | undefined;\n\n\tprivate readonly _hover: HoverWidget = this._register(new HoverWidget(true));\n\tprivate readonly _hoverVisibleKey: IContextKey<boolean>;\n\tprivate readonly _hoverFocusedKey: IContextKey<boolean>;\n\n\tprivate readonly _onDidResize = this._register(new Emitter<void>());\n\tpublic readonly onDidResize = this._onDidResize.event;\n\n\tprivate readonly _onDidScroll = this._register(new Emitter<ScrollEvent>());\n\tpublic readonly onDidScroll = this._onDidScroll.event;\n\n\tprivate readonly _onContentsChanged = this._register(new Emitter<void>());\n\tpublic readonly onContentsChanged = this._onContentsChanged.event;\n\n\tpublic get isVisibleFromKeyboard(): boolean {\n\t\treturn (this._renderedHover?.source === HoverStartSource.Keyboard);\n\t}\n\n\tpublic get isVisible(): boolean {\n\t\treturn this._hoverVisibleKey.get() ?? false;\n\t}\n\n\tpublic get isFocused(): boolean {\n\t\treturn this._hoverFocusedKey.get() ?? false;\n\t}\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService\n\t) {\n\t\tconst minimumHeight = editor.getOption(EditorOption.lineHeight) + 8;\n\t\tconst minimumWidth = 150;\n\t\tconst minimumSize = new dom.Dimension(minimumWidth, minimumHeight);\n\t\tsuper(editor, minimumSize);\n\n\t\t// Overflow widgets can be hosted outside the editor's DOM context.\n\t\tthis._register(contextKeyService.createScoped(this._resizableNode.domNode));\n\t\tthis._minimumSize = minimumSize;\n\t\tthis._hoverVisibleKey = EditorContextKeys.hoverVisible.bindTo(contextKeyService);\n\t\tthis._hoverFocusedKey = EditorContextKeys.hoverFocused.bindTo(contextKeyService);\n\n\t\tdom.append(this._resizableNode.domNode, this._hover.containerDomNode);\n\t\tthis._resizableNode.domNode.style.zIndex = '50';\n\t\tthis._resizableNode.domNode.className = 'monaco-resizable-hover';\n\n\t\tthis._register(this._editor.onDidLayoutChange(() => {\n\t\t\tif (this.isVisible) {\n\t\t\t\tthis._updateMaxDimensions();\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {\n\t\t\tif (e.hasChanged(EditorOption.fontInfo)) {\n\t\t\t\tthis._updateFont();\n\t\t\t}\n\t\t}));\n\t\tconst focusTracker = this._register(dom.trackFocus(this._resizableNode.domNode));\n\t\tthis._register(focusTracker.onDidFocus(() => {\n\t\t\tthis._hoverFocusedKey.set(true);\n\t\t}));\n\t\tthis._register(focusTracker.onDidBlur(() => {\n\t\t\tthis._hoverFocusedKey.set(false);\n\t\t}));\n\t\tthis._register(this._hover.scrollbar.onScroll((e) => {\n\t\t\tthis._onDidScroll.fire(e);\n\t\t}));\n\t\tthis._setRenderedHover(undefined);\n\t\tthis._editor.addContentWidget(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._renderedHover?.dispose();\n\t\tthis._editor.removeContentWidget(this);\n\t}\n\n\tpublic getId(): string {\n\t\treturn ContentHoverWidget.ID;\n\t}\n\n\tprivate static _applyDimensions(container: HTMLElement, width: number | string, height: number | string): void {\n\t\tconst transformedWidth = typeof width === 'number' ? `${width}px` : width;\n\t\tconst transformedHeight = typeof height === 'number' ? `${height}px` : height;\n\t\tcontainer.style.width = transformedWidth;\n\t\tcontainer.style.height = transformedHeight;\n\t}\n\n\tprivate _setContentsDomNodeDimensions(width: number | string, height: number | string): void {\n\t\tconst contentsDomNode = this._hover.contentsDomNode;\n\t\treturn ContentHoverWidget._applyDimensions(contentsDomNode, width, height);\n\t}\n\n\tprivate _setContainerDomNodeDimensions(width: number | string, height: number | string): void {\n\t\tconst containerDomNode = this._hover.containerDomNode;\n\t\treturn ContentHoverWidget._applyDimensions(containerDomNode, width, height);\n\t}\n\n\tprivate _setScrollableElementDimensions(width: number | string, height: number | string): void {\n\t\tconst scrollbarDomElement = this._hover.scrollbar.getDomNode();\n\t\treturn ContentHoverWidget._applyDimensions(scrollbarDomElement, width, height);\n\t}\n\n\tprivate _setHoverWidgetDimensions(width: number | string, height: number | string): void {\n\t\tthis._setContainerDomNodeDimensions(width, height);\n\t\tthis._setScrollableElementDimensions(width, height);\n\t\tthis._setContentsDomNodeDimensions(width, height);\n\t\tthis._layoutContentWidget();\n\t}\n\n\tprivate static _applyMaxDimensions(container: HTMLElement, width: number | string, height: number | string) {\n\t\tconst transformedWidth = typeof width === 'number' ? `${width}px` : width;\n\t\tconst transformedHeight = typeof height === 'number' ? `${height}px` : height;\n\t\tcontainer.style.maxWidth = transformedWidth;\n\t\tcontainer.style.maxHeight = transformedHeight;\n\t}\n\n\tprivate _setHoverWidgetMaxDimensions(width: number | string, height: number | string): void {\n\t\tContentHoverWidget._applyMaxDimensions(this._hover.contentsDomNode, width, height);\n\t\tContentHoverWidget._applyMaxDimensions(this._hover.scrollbar.getDomNode(), width, height);\n\t\tContentHoverWidget._applyMaxDimensions(this._hover.containerDomNode, width, height);\n\t\tthis._hover.containerDomNode.style.setProperty('--vscode-hover-maxWidth', typeof width === 'number' ? `${width}px` : width);\n\t\tthis._layoutContentWidget();\n\t}\n\n\tprivate _setAdjustedHoverWidgetDimensions(size: dom.Dimension): void {\n\t\tthis._setHoverWidgetMaxDimensions('none', 'none');\n\t\tthis._setHoverWidgetDimensions(size.width, size.height);\n\t}\n\n\tprivate _updateResizableNodeMaxDimensions(): void {\n\t\tconst maxRenderingWidth = this._findMaximumRenderingWidth() ?? Infinity;\n\t\tconst maxRenderingHeight = this._findMaximumRenderingHeight() ?? Infinity;\n\t\tthis._resizableNode.maxSize = new dom.Dimension(maxRenderingWidth, maxRenderingHeight);\n\t\tthis._setHoverWidgetMaxDimensions(maxRenderingWidth, maxRenderingHeight);\n\t}\n\n\tprotected override _resize(size: dom.Dimension): void {\n\t\tContentHoverWidget._lastDimensions = new dom.Dimension(size.width, size.height);\n\t\tthis._setAdjustedHoverWidgetDimensions(size);\n\t\tthis._resizableNode.layout(size.height, size.width);\n\t\tthis._updateResizableNodeMaxDimensions();\n\t\tthis._hover.scrollbar.scanDomNode();\n\t\tthis._editor.layoutContentWidget(this);\n\t\tthis._onDidResize.fire();\n\t}\n\n\tprivate _findAvailableSpaceVertically(): number | undefined {\n\t\tconst position = this._renderedHover?.showAtPosition;\n\t\tif (!position) {\n\t\t\treturn;\n\t\t}\n\t\treturn this._positionPreference === ContentWidgetPositionPreference.ABOVE ?\n\t\t\tthis._availableVerticalSpaceAbove(position)\n\t\t\t: this._availableVerticalSpaceBelow(position);\n\t}\n\n\tprivate _findMaximumRenderingHeight(): number | undefined {\n\t\tconst availableSpace = this._findAvailableSpaceVertically();\n\t\tif (!availableSpace) {\n\t\t\treturn;\n\t\t}\n\t\tconst children = this._hover.contentsDomNode.children;\n\t\tlet maximumHeight = children.length - 1;\n\t\tArray.from(this._hover.contentsDomNode.children).forEach((hoverPart) => {\n\t\t\tmaximumHeight += hoverPart.clientHeight;\n\t\t});\n\t\treturn Math.min(availableSpace, maximumHeight);\n\t}\n\n\tprivate _isHoverTextOverflowing(): boolean {\n\t\t// To find out if the text is overflowing, we will disable wrapping, check the widths, and then re-enable wrapping\n\t\tthis._hover.containerDomNode.style.setProperty('--vscode-hover-whiteSpace', 'nowrap');\n\t\tthis._hover.containerDomNode.style.setProperty('--vscode-hover-sourceWhiteSpace', 'nowrap');\n\n\t\tconst overflowing = Array.from(this._hover.contentsDomNode.children).some((hoverElement) => {\n\t\t\treturn hoverElement.scrollWidth > hoverElement.clientWidth;\n\t\t});\n\n\t\tthis._hover.containerDomNode.style.removeProperty('--vscode-hover-whiteSpace');\n\t\tthis._hover.containerDomNode.style.removeProperty('--vscode-hover-sourceWhiteSpace');\n\n\t\treturn overflowing;\n\t}\n\n\tprivate _findMaximumRenderingWidth(): number | undefined {\n\t\tif (!this._editor || !this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst overflowing = this._isHoverTextOverflowing();\n\t\tconst initialWidth = (\n\t\t\ttypeof this._contentWidth === 'undefined'\n\t\t\t\t? 0\n\t\t\t\t: this._contentWidth\n\t\t);\n\n\t\tif (overflowing || this._hover.containerDomNode.clientWidth < initialWidth) {\n\t\t\tconst bodyBoxWidth = dom.getClientArea(this._hover.containerDomNode.ownerDocument.body).width;\n\t\t\tconst horizontalPadding = 14;\n\t\t\treturn bodyBoxWidth - horizontalPadding;\n\t\t} else {\n\t\t\treturn this._hover.containerDomNode.clientWidth;\n\t\t}\n\t}\n\n\tpublic isMouseGettingCloser(posx: number, posy: number): boolean {\n\n\t\tif (!this._renderedHover) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this._renderedHover.initialMousePosX === undefined || this._renderedHover.initialMousePosY === undefined) {\n\t\t\tthis._renderedHover.initialMousePosX = posx;\n\t\t\tthis._renderedHover.initialMousePosY = posy;\n\t\t\treturn false;\n\t\t}\n\n\t\tconst widgetRect = dom.getDomNodePagePosition(this.getDomNode());\n\t\tif (this._renderedHover.closestMouseDistance === undefined) {\n\t\t\tthis._renderedHover.closestMouseDistance = computeDistanceFromPointToRectangle(\n\t\t\t\tthis._renderedHover.initialMousePosX,\n\t\t\t\tthis._renderedHover.initialMousePosY,\n\t\t\t\twidgetRect.left,\n\t\t\t\twidgetRect.top,\n\t\t\t\twidgetRect.width,\n\t\t\t\twidgetRect.height\n\t\t\t);\n\t\t}\n\n\t\tconst distance = computeDistanceFromPointToRectangle(\n\t\t\tposx,\n\t\t\tposy,\n\t\t\twidgetRect.left,\n\t\t\twidgetRect.top,\n\t\t\twidgetRect.width,\n\t\t\twidgetRect.height\n\t\t);\n\t\tif (distance > this._renderedHover.closestMouseDistance + 4 /* tolerance of 4 pixels */) {\n\t\t\t// The mouse is getting farther away\n\t\t\treturn false;\n\t\t}\n\n\t\tthis._renderedHover.closestMouseDistance = Math.min(this._renderedHover.closestMouseDistance, distance);\n\t\treturn true;\n\t}\n\n\tprivate _setRenderedHover(renderedHover: RenderedContentHover | undefined): void {\n\t\tthis._renderedHover?.dispose();\n\t\tthis._renderedHover = renderedHover;\n\t\tthis._hoverVisibleKey.set(!!renderedHover);\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !renderedHover);\n\t}\n\n\tprivate _updateFont(): void {\n\t\tconst { fontSize, lineHeight } = this._editor.getOption(EditorOption.fontInfo);\n\t\tconst contentsDomNode = this._hover.contentsDomNode;\n\t\tcontentsDomNode.style.fontSize = `${fontSize}px`;\n\t\tcontentsDomNode.style.lineHeight = `${lineHeight / fontSize}`;\n\t\t// eslint-disable-next-line eslint-js/no-restricted-syntax\n\t\tconst codeClasses: HTMLElement[] = Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName('code'));\n\t\tcodeClasses.forEach(node => this._editor.applyFontInfo(node));\n\t}\n\n\tprivate _updateContent(node: DocumentFragment): void {\n\t\tconst contentsDomNode = this._hover.contentsDomNode;\n\t\tcontentsDomNode.style.paddingBottom = '';\n\t\tcontentsDomNode.textContent = '';\n\t\tcontentsDomNode.appendChild(node);\n\t}\n\n\tprivate _layoutContentWidget(): void {\n\t\tthis._editor.layoutContentWidget(this);\n\t\tthis._hover.onContentsChanged();\n\t}\n\n\tprivate _updateMaxDimensions() {\n\t\tconst height = Math.max(this._editor.getLayoutInfo().height / 4, 250, ContentHoverWidget._lastDimensions.height);\n\t\tconst width = Math.max(this._editor.getLayoutInfo().width * 0.66, 750, ContentHoverWidget._lastDimensions.width);\n\t\tthis._resizableNode.maxSize = new dom.Dimension(width, height);\n\t\tthis._setHoverWidgetMaxDimensions(width, height);\n\t}\n\n\tprivate _render(renderedHover: RenderedContentHover) {\n\t\tthis._setRenderedHover(renderedHover);\n\t\tthis._updateFont();\n\t\tthis._updateContent(renderedHover.domNode);\n\t\tthis.handleContentsChanged();\n\t\t// Simply force a synchronous render on the editor\n\t\t// such that the widget does not really render with left = '0px'\n\t\tthis._editor.render();\n\t}\n\n\toverride getPosition(): IContentWidgetPosition | null {\n\t\tif (!this._renderedHover) {\n\t\t\treturn null;\n\t\t}\n\t\treturn {\n\t\t\tposition: this._renderedHover.showAtPosition,\n\t\t\tsecondaryPosition: this._renderedHover.showAtSecondaryPosition,\n\t\t\tpositionAffinity: this._renderedHover.shouldAppearBeforeContent ? PositionAffinity.LeftOfInjectedText : undefined,\n\t\t\tpreference: [this._positionPreference ?? ContentWidgetPositionPreference.ABOVE]\n\t\t};\n\t}\n\n\tpublic show(renderedHover: RenderedContentHover): void {\n\t\tif (!this._editor || !this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tthis._render(renderedHover);\n\t\tconst widgetHeight = dom.getTotalHeight(this._hover.containerDomNode);\n\t\tconst widgetPosition = renderedHover.showAtPosition;\n\t\tthis._positionPreference = this._findPositionPreference(widgetHeight, widgetPosition) ?? ContentWidgetPositionPreference.ABOVE;\n\n\t\t// See https://github.com/microsoft/vscode/issues/140339\n\t\t// TODO: Doing a second layout of the hover after force rendering the editor\n\t\tthis.handleContentsChanged();\n\t\tif (renderedHover.shouldFocus) {\n\t\t\tthis._hover.containerDomNode.focus();\n\t\t}\n\t\tthis._onDidResize.fire();\n\t\t// The aria label overrides the label, so if we add to it, add the contents of the hover\n\t\tconst hoverFocused = this._hover.containerDomNode.ownerDocument.activeElement === this._hover.containerDomNode;\n\t\tconst accessibleViewHint = hoverFocused && getHoverAccessibleViewHint(\n\t\t\tthis._configurationService.getValue('accessibility.verbosity.hover') === true && this._accessibilityService.isScreenReaderOptimized(),\n\t\t\tthis._keybindingService.lookupKeybinding('editor.action.accessibleView')?.getAriaLabel() ?? ''\n\t\t);\n\n\t\tif (accessibleViewHint) {\n\t\t\tthis._hover.contentsDomNode.ariaLabel = this._hover.contentsDomNode.textContent + ', ' + accessibleViewHint;\n\t\t}\n\t}\n\n\tpublic hide(): void {\n\t\tif (!this._renderedHover) {\n\t\t\treturn;\n\t\t}\n\t\tconst hoverStoleFocus = this._renderedHover.shouldFocus || this._hoverFocusedKey.get();\n\t\tthis._setRenderedHover(undefined);\n\t\tthis._resizableNode.maxSize = new dom.Dimension(Infinity, Infinity);\n\t\tthis._resizableNode.clearSashHoverState();\n\t\tthis._hoverFocusedKey.set(false);\n\t\tthis._editor.layoutContentWidget(this);\n\t\tif (hoverStoleFocus) {\n\t\t\tthis._editor.focus();\n\t\t}\n\t}\n\n\tprivate _removeConstraintsRenderNormally(): void {\n\t\t// Added because otherwise the initial size of the hover content is smaller than should be\n\t\tconst layoutInfo = this._editor.getLayoutInfo();\n\t\tthis._resizableNode.layout(layoutInfo.height, layoutInfo.width);\n\t\tthis._setHoverWidgetDimensions('auto', 'auto');\n\t\tthis._updateMaxDimensions();\n\t}\n\n\tpublic setMinimumDimensions(dimensions: dom.Dimension): void {\n\t\t// We combine the new minimum dimensions with the previous ones\n\t\tthis._minimumSize = new dom.Dimension(\n\t\t\tMath.max(this._minimumSize.width, dimensions.width),\n\t\t\tMath.max(this._minimumSize.height, dimensions.height)\n\t\t);\n\t\tthis._updateMinimumWidth();\n\t}\n\n\tprivate _updateMinimumWidth(): void {\n\t\tconst width = (\n\t\t\ttypeof this._contentWidth === 'undefined'\n\t\t\t\t? this._minimumSize.width\n\t\t\t\t: Math.min(this._contentWidth, this._minimumSize.width)\n\t\t);\n\t\t// We want to avoid that the hover is artificially large, so we use the content width as minimum width\n\t\tthis._resizableNode.minSize = new dom.Dimension(width, this._minimumSize.height);\n\t}\n\n\tpublic handleContentsChanged(): void {\n\t\tthis._removeConstraintsRenderNormally();\n\t\tconst contentsDomNode = this._hover.contentsDomNode;\n\n\t\tlet height = dom.getTotalHeight(contentsDomNode);\n\t\tlet width = dom.getTotalWidth(contentsDomNode) + 2;\n\t\tthis._resizableNode.layout(height, width);\n\n\t\tthis._setHoverWidgetDimensions(width, height);\n\n\t\theight = dom.getTotalHeight(contentsDomNode);\n\t\twidth = dom.getTotalWidth(contentsDomNode);\n\t\tthis._contentWidth = width;\n\t\tthis._updateMinimumWidth();\n\t\tthis._resizableNode.layout(height, width);\n\n\t\tif (this._renderedHover?.showAtPosition) {\n\t\t\tconst widgetHeight = dom.getTotalHeight(this._hover.containerDomNode);\n\t\t\tthis._positionPreference = this._findPositionPreference(widgetHeight, this._renderedHover.showAtPosition);\n\t\t}\n\t\tthis._layoutContentWidget();\n\t\tthis._onContentsChanged.fire();\n\t}\n\n\tpublic focus(): void {\n\t\tthis._hover.containerDomNode.focus();\n\t}\n\n\tpublic scrollUp(): void {\n\t\tconst scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop;\n\t\tconst fontInfo = this._editor.getOption(EditorOption.fontInfo);\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop - fontInfo.lineHeight });\n\t}\n\n\tpublic scrollDown(): void {\n\t\tconst scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop;\n\t\tconst fontInfo = this._editor.getOption(EditorOption.fontInfo);\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop + fontInfo.lineHeight });\n\t}\n\n\tpublic scrollLeft(): void {\n\t\tconst scrollLeft = this._hover.scrollbar.getScrollPosition().scrollLeft;\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollLeft: scrollLeft - HORIZONTAL_SCROLLING_BY });\n\t}\n\n\tpublic scrollRight(): void {\n\t\tconst scrollLeft = this._hover.scrollbar.getScrollPosition().scrollLeft;\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollLeft: scrollLeft + HORIZONTAL_SCROLLING_BY });\n\t}\n\n\tpublic pageUp(): void {\n\t\tconst scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop;\n\t\tconst scrollHeight = this._hover.scrollbar.getScrollDimensions().height;\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop - scrollHeight });\n\t}\n\n\tpublic pageDown(): void {\n\t\tconst scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop;\n\t\tconst scrollHeight = this._hover.scrollbar.getScrollDimensions().height;\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop + scrollHeight });\n\t}\n\n\tpublic goToTop(): void {\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: 0 });\n\t}\n\n\tpublic goToBottom(): void {\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: this._hover.scrollbar.getScrollDimensions().scrollHeight });\n\t}\n}\n\nfunction computeDistanceFromPointToRectangle(pointX: number, pointY: number, left: number, top: number, width: number, height: number): number {\n\tconst x = (left + width / 2); // x center of rectangle\n\tconst y = (top + height / 2); // y center of rectangle\n\tconst dx = Math.max(Math.abs(pointX - x) - width / 2, 0);\n\tconst dy = Math.max(Math.abs(pointY - y) - height / 2, 0);\n\treturn Math.sqrt(dx * dx + dy * dy);\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/hover/browser/contentHoverWidget.ts","vs/editor/contrib/hover/browser/contentHoverWidget.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,KAAK,GAAG,MAAM,iCAAiC,CAAC;AAIvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAC1F,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAe,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AACvG,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AACnG,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AAE3G,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAG3D,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE5B,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,sBAAsB;;aAE/C,OAAE,GAAG,4CAAH,AAA+C,CAAC;aACjD,oBAAe,GAAkB,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAxC,AAAyC,CAAC;IAiBxE,IAAW,qBAAqB;QAC/B,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,sCAA8B,CAAC,CAAC;IACpE,CAAC;IAED,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,KAAK,CAAC;IAC7C,CAAC;IAED,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,KAAK,CAAC;IAC7C,CAAC;IAED,YACC,MAAmB,EACC,iBAAqC,EAClC,qBAA6D,EAC7D,qBAA6D,EAChE,kBAAuD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,CAAC,CAAC,CAAC,CAAC,wBAAwB;IACtD,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACzD,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1D,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;AACrC,CAAC","file":"contentHoverWidget.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 { ContentWidgetPositionPreference, ICodeEditor, IContentWidgetPosition } from '../../../browser/editorBrowser.js';\nimport { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js';\nimport { HoverStartSource } from './hoverOperation.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ResizableContentWidget } from './resizableContentWidget.js';\nimport { IContextKey, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\nimport { IAccessibilityService } from '../../../../platform/accessibility/common/accessibility.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { getHoverAccessibleViewHint, HoverWidget } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { PositionAffinity } from '../../../common/model.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { RenderedContentHover } from './contentHoverRendered.js';\n\nconst HORIZONTAL_SCROLLING_BY = 30;\n\nexport class ContentHoverWidget extends ResizableContentWidget {\n\n\tpublic static ID = 'editor.contrib.resizableContentHoverWidget';\n\tprivate static _lastDimensions: dom.Dimension = new dom.Dimension(0, 0);\n\n\tprivate _renderedHover: RenderedContentHover | undefined;\n\tprivate _positionPreference: ContentWidgetPositionPreference | undefined;\n\tprivate _minimumSize: dom.Dimension;\n\tprivate _contentWidth: number | undefined;\n\n\tprivate readonly _hover: HoverWidget = this._register(new HoverWidget(true));\n\tprivate readonly _hoverVisibleKey: IContextKey<boolean>;\n\tprivate readonly _hoverFocusedKey: IContextKey<boolean>;\n\n\tprivate readonly _onDidResize = this._register(new Emitter<void>());\n\tpublic readonly onDidResize = this._onDidResize.event;\n\n\tprivate readonly _onContentsChanged = this._register(new Emitter<void>());\n\tpublic readonly onContentsChanged = this._onContentsChanged.event;\n\n\tpublic get isVisibleFromKeyboard(): boolean {\n\t\treturn (this._renderedHover?.source === HoverStartSource.Keyboard);\n\t}\n\n\tpublic get isVisible(): boolean {\n\t\treturn this._hoverVisibleKey.get() ?? false;\n\t}\n\n\tpublic get isFocused(): boolean {\n\t\treturn this._hoverFocusedKey.get() ?? false;\n\t}\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService\n\t) {\n\t\tconst minimumHeight = editor.getOption(EditorOption.lineHeight) + 8;\n\t\tconst minimumWidth = 150;\n\t\tconst minimumSize = new dom.Dimension(minimumWidth, minimumHeight);\n\t\tsuper(editor, minimumSize);\n\n\t\t// Overflow widgets can be hosted outside the editor's DOM context.\n\t\tthis._register(contextKeyService.createScoped(this._resizableNode.domNode));\n\t\tthis._minimumSize = minimumSize;\n\t\tthis._hoverVisibleKey = EditorContextKeys.hoverVisible.bindTo(contextKeyService);\n\t\tthis._hoverFocusedKey = EditorContextKeys.hoverFocused.bindTo(contextKeyService);\n\n\t\tdom.append(this._resizableNode.domNode, this._hover.containerDomNode);\n\t\tthis._resizableNode.domNode.style.zIndex = '50';\n\t\tthis._resizableNode.domNode.className = 'monaco-resizable-hover';\n\n\t\tthis._register(this._editor.onDidLayoutChange(() => {\n\t\t\tif (this.isVisible) {\n\t\t\t\tthis._updateMaxDimensions();\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {\n\t\t\tif (e.hasChanged(EditorOption.fontInfo)) {\n\t\t\t\tthis._updateFont();\n\t\t\t}\n\t\t}));\n\t\tconst focusTracker = this._register(dom.trackFocus(this._resizableNode.domNode));\n\t\tthis._register(focusTracker.onDidFocus(() => {\n\t\t\tthis._hoverFocusedKey.set(true);\n\t\t}));\n\t\tthis._register(focusTracker.onDidBlur(() => {\n\t\t\tthis._hoverFocusedKey.set(false);\n\t\t}));\n\t\tthis._setRenderedHover(undefined);\n\t\tthis._editor.addContentWidget(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._renderedHover?.dispose();\n\t\tthis._editor.removeContentWidget(this);\n\t}\n\n\tpublic getId(): string {\n\t\treturn ContentHoverWidget.ID;\n\t}\n\n\tprivate static _applyDimensions(container: HTMLElement, width: number | string, height: number | string): void {\n\t\tconst transformedWidth = typeof width === 'number' ? `${width}px` : width;\n\t\tconst transformedHeight = typeof height === 'number' ? `${height}px` : height;\n\t\tcontainer.style.width = transformedWidth;\n\t\tcontainer.style.height = transformedHeight;\n\t}\n\n\tprivate _setContentsDomNodeDimensions(width: number | string, height: number | string): void {\n\t\tconst contentsDomNode = this._hover.contentsDomNode;\n\t\treturn ContentHoverWidget._applyDimensions(contentsDomNode, width, height);\n\t}\n\n\tprivate _setContainerDomNodeDimensions(width: number | string, height: number | string): void {\n\t\tconst containerDomNode = this._hover.containerDomNode;\n\t\treturn ContentHoverWidget._applyDimensions(containerDomNode, width, height);\n\t}\n\n\tprivate _setScrollableElementDimensions(width: number | string, height: number | string): void {\n\t\tconst scrollbarDomElement = this._hover.scrollbar.getDomNode();\n\t\treturn ContentHoverWidget._applyDimensions(scrollbarDomElement, width, height);\n\t}\n\n\tprivate _setHoverWidgetDimensions(width: number | string, height: number | string): void {\n\t\tthis._setContainerDomNodeDimensions(width, height);\n\t\tthis._setScrollableElementDimensions(width, height);\n\t\tthis._setContentsDomNodeDimensions(width, height);\n\t\tthis._layoutContentWidget();\n\t}\n\n\tprivate static _applyMaxDimensions(container: HTMLElement, width: number | string, height: number | string) {\n\t\tconst transformedWidth = typeof width === 'number' ? `${width}px` : width;\n\t\tconst transformedHeight = typeof height === 'number' ? `${height}px` : height;\n\t\tcontainer.style.maxWidth = transformedWidth;\n\t\tcontainer.style.maxHeight = transformedHeight;\n\t}\n\n\tprivate _setHoverWidgetMaxDimensions(width: number | string, height: number | string): void {\n\t\tContentHoverWidget._applyMaxDimensions(this._hover.contentsDomNode, width, height);\n\t\tContentHoverWidget._applyMaxDimensions(this._hover.scrollbar.getDomNode(), width, height);\n\t\tContentHoverWidget._applyMaxDimensions(this._hover.containerDomNode, width, height);\n\t\tthis._hover.containerDomNode.style.setProperty('--vscode-hover-maxWidth', typeof width === 'number' ? `${width}px` : width);\n\t\tthis._layoutContentWidget();\n\t}\n\n\tprivate _setAdjustedHoverWidgetDimensions(size: dom.Dimension): void {\n\t\tthis._setHoverWidgetMaxDimensions('none', 'none');\n\t\tthis._setHoverWidgetDimensions(size.width, size.height);\n\t}\n\n\tprivate _updateResizableNodeMaxDimensions(): void {\n\t\tconst maxRenderingWidth = this._findMaximumRenderingWidth() ?? Infinity;\n\t\tconst maxRenderingHeight = this._findMaximumRenderingHeight() ?? Infinity;\n\t\tthis._resizableNode.maxSize = new dom.Dimension(maxRenderingWidth, maxRenderingHeight);\n\t\tthis._setHoverWidgetMaxDimensions(maxRenderingWidth, maxRenderingHeight);\n\t}\n\n\tprotected override _resize(size: dom.Dimension): void {\n\t\tContentHoverWidget._lastDimensions = new dom.Dimension(size.width, size.height);\n\t\tthis._setAdjustedHoverWidgetDimensions(size);\n\t\tthis._resizableNode.layout(size.height, size.width);\n\t\tthis._updateResizableNodeMaxDimensions();\n\t\tthis._hover.scrollbar.scanDomNode();\n\t\tthis._editor.layoutContentWidget(this);\n\t\tthis._onDidResize.fire();\n\t}\n\n\tprivate _findAvailableSpaceVertically(): number | undefined {\n\t\tconst position = this._renderedHover?.showAtPosition;\n\t\tif (!position) {\n\t\t\treturn;\n\t\t}\n\t\treturn this._positionPreference === ContentWidgetPositionPreference.ABOVE ?\n\t\t\tthis._availableVerticalSpaceAbove(position)\n\t\t\t: this._availableVerticalSpaceBelow(position);\n\t}\n\n\tprivate _findMaximumRenderingHeight(): number | undefined {\n\t\tconst availableSpace = this._findAvailableSpaceVertically();\n\t\tif (!availableSpace) {\n\t\t\treturn;\n\t\t}\n\t\tconst children = this._hover.contentsDomNode.children;\n\t\tlet maximumHeight = children.length - 1;\n\t\tArray.from(this._hover.contentsDomNode.children).forEach((hoverPart) => {\n\t\t\tmaximumHeight += hoverPart.clientHeight;\n\t\t});\n\t\treturn Math.min(availableSpace, maximumHeight);\n\t}\n\n\tprivate _isHoverTextOverflowing(): boolean {\n\t\t// To find out if the text is overflowing, we will disable wrapping, check the widths, and then re-enable wrapping\n\t\tthis._hover.containerDomNode.style.setProperty('--vscode-hover-whiteSpace', 'nowrap');\n\t\tthis._hover.containerDomNode.style.setProperty('--vscode-hover-sourceWhiteSpace', 'nowrap');\n\n\t\tconst overflowing = Array.from(this._hover.contentsDomNode.children).some((hoverElement) => {\n\t\t\treturn hoverElement.scrollWidth > hoverElement.clientWidth;\n\t\t});\n\n\t\tthis._hover.containerDomNode.style.removeProperty('--vscode-hover-whiteSpace');\n\t\tthis._hover.containerDomNode.style.removeProperty('--vscode-hover-sourceWhiteSpace');\n\n\t\treturn overflowing;\n\t}\n\n\tprivate _findMaximumRenderingWidth(): number | undefined {\n\t\tif (!this._editor || !this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst overflowing = this._isHoverTextOverflowing();\n\t\tconst initialWidth = (\n\t\t\ttypeof this._contentWidth === 'undefined'\n\t\t\t\t? 0\n\t\t\t\t: this._contentWidth\n\t\t);\n\n\t\tif (overflowing || this._hover.containerDomNode.clientWidth < initialWidth) {\n\t\t\tconst bodyBoxWidth = dom.getClientArea(this._hover.containerDomNode.ownerDocument.body).width;\n\t\t\tconst horizontalPadding = 14;\n\t\t\treturn bodyBoxWidth - horizontalPadding;\n\t\t} else {\n\t\t\treturn this._hover.containerDomNode.clientWidth;\n\t\t}\n\t}\n\n\tpublic isMouseGettingCloser(posx: number, posy: number): boolean {\n\n\t\tif (!this._renderedHover) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this._renderedHover.initialMousePosX === undefined || this._renderedHover.initialMousePosY === undefined) {\n\t\t\tthis._renderedHover.initialMousePosX = posx;\n\t\t\tthis._renderedHover.initialMousePosY = posy;\n\t\t\treturn false;\n\t\t}\n\n\t\tconst widgetRect = dom.getDomNodePagePosition(this.getDomNode());\n\t\tif (this._renderedHover.closestMouseDistance === undefined) {\n\t\t\tthis._renderedHover.closestMouseDistance = computeDistanceFromPointToRectangle(\n\t\t\t\tthis._renderedHover.initialMousePosX,\n\t\t\t\tthis._renderedHover.initialMousePosY,\n\t\t\t\twidgetRect.left,\n\t\t\t\twidgetRect.top,\n\t\t\t\twidgetRect.width,\n\t\t\t\twidgetRect.height\n\t\t\t);\n\t\t}\n\n\t\tconst distance = computeDistanceFromPointToRectangle(\n\t\t\tposx,\n\t\t\tposy,\n\t\t\twidgetRect.left,\n\t\t\twidgetRect.top,\n\t\t\twidgetRect.width,\n\t\t\twidgetRect.height\n\t\t);\n\t\tif (distance > this._renderedHover.closestMouseDistance + 4 /* tolerance of 4 pixels */) {\n\t\t\t// The mouse is getting farther away\n\t\t\treturn false;\n\t\t}\n\n\t\tthis._renderedHover.closestMouseDistance = Math.min(this._renderedHover.closestMouseDistance, distance);\n\t\treturn true;\n\t}\n\n\tprivate _setRenderedHover(renderedHover: RenderedContentHover | undefined): void {\n\t\tthis._renderedHover?.dispose();\n\t\tthis._renderedHover = renderedHover;\n\t\tthis._hoverVisibleKey.set(!!renderedHover);\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !renderedHover);\n\t}\n\n\tprivate _updateFont(): void {\n\t\tconst { fontSize, lineHeight } = this._editor.getOption(EditorOption.fontInfo);\n\t\tconst contentsDomNode = this._hover.contentsDomNode;\n\t\tcontentsDomNode.style.fontSize = `${fontSize}px`;\n\t\tcontentsDomNode.style.lineHeight = `${lineHeight / fontSize}`;\n\t\t// eslint-disable-next-line eslint-js/no-restricted-syntax\n\t\tconst codeClasses: HTMLElement[] = Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName('code'));\n\t\tcodeClasses.forEach(node => this._editor.applyFontInfo(node));\n\t}\n\n\tprivate _updateContent(node: DocumentFragment): void {\n\t\tconst contentsDomNode = this._hover.contentsDomNode;\n\t\tcontentsDomNode.style.paddingBottom = '';\n\t\tcontentsDomNode.textContent = '';\n\t\tcontentsDomNode.appendChild(node);\n\t}\n\n\tprivate _layoutContentWidget(): void {\n\t\tthis._editor.layoutContentWidget(this);\n\t\tthis._hover.onContentsChanged();\n\t}\n\n\tprivate _updateMaxDimensions() {\n\t\tconst height = Math.max(this._editor.getLayoutInfo().height / 4, 250, ContentHoverWidget._lastDimensions.height);\n\t\tconst width = Math.max(this._editor.getLayoutInfo().width * 0.66, 750, ContentHoverWidget._lastDimensions.width);\n\t\tthis._resizableNode.maxSize = new dom.Dimension(width, height);\n\t\tthis._setHoverWidgetMaxDimensions(width, height);\n\t}\n\n\tprivate _render(renderedHover: RenderedContentHover) {\n\t\tthis._setRenderedHover(renderedHover);\n\t\tthis._updateFont();\n\t\tthis._updateContent(renderedHover.domNode);\n\t\tthis.handleContentsChanged();\n\t\t// Simply force a synchronous render on the editor\n\t\t// such that the widget does not really render with left = '0px'\n\t\tthis._editor.render();\n\t}\n\n\toverride getPosition(): IContentWidgetPosition | null {\n\t\tif (!this._renderedHover) {\n\t\t\treturn null;\n\t\t}\n\t\treturn {\n\t\t\tposition: this._renderedHover.showAtPosition,\n\t\t\tsecondaryPosition: this._renderedHover.showAtSecondaryPosition,\n\t\t\tpositionAffinity: this._renderedHover.shouldAppearBeforeContent ? PositionAffinity.LeftOfInjectedText : undefined,\n\t\t\tpreference: [this._positionPreference ?? ContentWidgetPositionPreference.ABOVE]\n\t\t};\n\t}\n\n\tpublic show(renderedHover: RenderedContentHover): void {\n\t\tif (!this._editor || !this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tthis._render(renderedHover);\n\t\tconst widgetHeight = dom.getTotalHeight(this._hover.containerDomNode);\n\t\tconst widgetPosition = renderedHover.showAtPosition;\n\t\tthis._positionPreference = this._findPositionPreference(widgetHeight, widgetPosition) ?? ContentWidgetPositionPreference.ABOVE;\n\n\t\t// See https://github.com/microsoft/vscode/issues/140339\n\t\t// TODO: Doing a second layout of the hover after force rendering the editor\n\t\tthis.handleContentsChanged();\n\t\tif (renderedHover.shouldFocus) {\n\t\t\tthis._hover.containerDomNode.focus();\n\t\t}\n\t\tthis._onDidResize.fire();\n\t\t// The aria label overrides the label, so if we add to it, add the contents of the hover\n\t\tconst hoverFocused = this._hover.containerDomNode.ownerDocument.activeElement === this._hover.containerDomNode;\n\t\tconst accessibleViewHint = hoverFocused && getHoverAccessibleViewHint(\n\t\t\tthis._configurationService.getValue('accessibility.verbosity.hover') === true && this._accessibilityService.isScreenReaderOptimized(),\n\t\t\tthis._keybindingService.lookupKeybinding('editor.action.accessibleView')?.getAriaLabel() ?? ''\n\t\t);\n\n\t\tif (accessibleViewHint) {\n\t\t\tthis._hover.contentsDomNode.ariaLabel = this._hover.contentsDomNode.textContent + ', ' + accessibleViewHint;\n\t\t}\n\t}\n\n\tpublic hide(): void {\n\t\tif (!this._renderedHover) {\n\t\t\treturn;\n\t\t}\n\t\tconst hoverStoleFocus = this._renderedHover.shouldFocus || this._hoverFocusedKey.get();\n\t\tthis._setRenderedHover(undefined);\n\t\tthis._resizableNode.maxSize = new dom.Dimension(Infinity, Infinity);\n\t\tthis._resizableNode.clearSashHoverState();\n\t\tthis._hoverFocusedKey.set(false);\n\t\tthis._editor.layoutContentWidget(this);\n\t\tif (hoverStoleFocus) {\n\t\t\tthis._editor.focus();\n\t\t}\n\t}\n\n\tprivate _removeConstraintsRenderNormally(): void {\n\t\t// Added because otherwise the initial size of the hover content is smaller than should be\n\t\tconst layoutInfo = this._editor.getLayoutInfo();\n\t\tthis._resizableNode.layout(layoutInfo.height, layoutInfo.width);\n\t\tthis._setHoverWidgetDimensions('auto', 'auto');\n\t\tthis._updateMaxDimensions();\n\t}\n\n\tpublic setMinimumDimensions(dimensions: dom.Dimension): void {\n\t\t// We combine the new minimum dimensions with the previous ones\n\t\tthis._minimumSize = new dom.Dimension(\n\t\t\tMath.max(this._minimumSize.width, dimensions.width),\n\t\t\tMath.max(this._minimumSize.height, dimensions.height)\n\t\t);\n\t\tthis._updateMinimumWidth();\n\t}\n\n\tprivate _updateMinimumWidth(): void {\n\t\tconst width = (\n\t\t\ttypeof this._contentWidth === 'undefined'\n\t\t\t\t? this._minimumSize.width\n\t\t\t\t: Math.min(this._contentWidth, this._minimumSize.width)\n\t\t);\n\t\t// We want to avoid that the hover is artificially large, so we use the content width as minimum width\n\t\tthis._resizableNode.minSize = new dom.Dimension(width, this._minimumSize.height);\n\t}\n\n\tpublic handleContentsChanged(): void {\n\t\tthis._removeConstraintsRenderNormally();\n\t\tconst contentsDomNode = this._hover.contentsDomNode;\n\n\t\tlet height = dom.getTotalHeight(contentsDomNode);\n\t\tlet width = dom.getTotalWidth(contentsDomNode) + 2;\n\t\tthis._resizableNode.layout(height, width);\n\n\t\tthis._setHoverWidgetDimensions(width, height);\n\n\t\theight = dom.getTotalHeight(contentsDomNode);\n\t\twidth = dom.getTotalWidth(contentsDomNode);\n\t\tthis._contentWidth = width;\n\t\tthis._updateMinimumWidth();\n\t\tthis._resizableNode.layout(height, width);\n\n\t\tif (this._renderedHover?.showAtPosition) {\n\t\t\tconst widgetHeight = dom.getTotalHeight(this._hover.containerDomNode);\n\t\t\tthis._positionPreference = this._findPositionPreference(widgetHeight, this._renderedHover.showAtPosition);\n\t\t}\n\t\tthis._layoutContentWidget();\n\t\tthis._onContentsChanged.fire();\n\t}\n\n\tpublic focus(): void {\n\t\tthis._hover.containerDomNode.focus();\n\t}\n\n\tpublic scrollUp(): void {\n\t\tconst scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop;\n\t\tconst fontInfo = this._editor.getOption(EditorOption.fontInfo);\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop - fontInfo.lineHeight });\n\t}\n\n\tpublic scrollDown(): void {\n\t\tconst scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop;\n\t\tconst fontInfo = this._editor.getOption(EditorOption.fontInfo);\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop + fontInfo.lineHeight });\n\t}\n\n\tpublic scrollLeft(): void {\n\t\tconst scrollLeft = this._hover.scrollbar.getScrollPosition().scrollLeft;\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollLeft: scrollLeft - HORIZONTAL_SCROLLING_BY });\n\t}\n\n\tpublic scrollRight(): void {\n\t\tconst scrollLeft = this._hover.scrollbar.getScrollPosition().scrollLeft;\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollLeft: scrollLeft + HORIZONTAL_SCROLLING_BY });\n\t}\n\n\tpublic pageUp(): void {\n\t\tconst scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop;\n\t\tconst scrollHeight = this._hover.scrollbar.getScrollDimensions().height;\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop - scrollHeight });\n\t}\n\n\tpublic pageDown(): void {\n\t\tconst scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop;\n\t\tconst scrollHeight = this._hover.scrollbar.getScrollDimensions().height;\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop + scrollHeight });\n\t}\n\n\tpublic goToTop(): void {\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: 0 });\n\t}\n\n\tpublic goToBottom(): void {\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: this._hover.scrollbar.getScrollDimensions().scrollHeight });\n\t}\n}\n\nfunction computeDistanceFromPointToRectangle(pointX: number, pointY: number, left: number, top: number, width: number, height: number): number {\n\tconst x = (left + width / 2); // x center of rectangle\n\tconst y = (top + height / 2); // y center of rectangle\n\tconst dx = Math.max(Math.abs(pointX - x) - width / 2, 0);\n\tconst dy = Math.max(Math.abs(pointY - y) - height / 2, 0);\n\treturn Math.sqrt(dx * dx + dy * dy);\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 { ContentWidgetPositionPreference, ICodeEditor, IContentWidgetPosition } from '../../../browser/editorBrowser.js';\nimport { ConfigurationChangedEvent, EditorOption } from '../../../common/config/editorOptions.js';\nimport { HoverStartSource } from './hoverOperation.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nimport { ResizableContentWidget } from './resizableContentWidget.js';\nimport { IContextKey, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\nimport { IAccessibilityService } from '../../../../platform/accessibility/common/accessibility.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { getHoverAccessibleViewHint, HoverWidget } from '../../../../base/browser/ui/hover/hoverWidget.js';\nimport { PositionAffinity } from '../../../common/model.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { RenderedContentHover } from './contentHoverRendered.js';\n\nconst HORIZONTAL_SCROLLING_BY = 30;\n\nexport class ContentHoverWidget extends ResizableContentWidget {\n\n\tpublic static ID = 'editor.contrib.resizableContentHoverWidget';\n\tprivate static _lastDimensions: dom.Dimension = new dom.Dimension(0, 0);\n\n\tprivate _renderedHover: RenderedContentHover | undefined;\n\tprivate _positionPreference: ContentWidgetPositionPreference | undefined;\n\tprivate _minimumSize: dom.Dimension;\n\tprivate _contentWidth: number | undefined;\n\n\tprivate readonly _hover: HoverWidget = this._register(new HoverWidget(true));\n\tprivate readonly _hoverVisibleKey: IContextKey<boolean>;\n\tprivate readonly _hoverFocusedKey: IContextKey<boolean>;\n\n\tprivate readonly _onDidResize = this._register(new Emitter<void>());\n\tpublic readonly onDidResize = this._onDidResize.event;\n\n\tprivate readonly _onContentsChanged = this._register(new Emitter<void>());\n\tpublic readonly onContentsChanged = this._onContentsChanged.event;\n\n\tpublic get isVisibleFromKeyboard(): boolean {\n\t\treturn (this._renderedHover?.source === HoverStartSource.Keyboard);\n\t}\n\n\tpublic get isVisible(): boolean {\n\t\treturn this._hoverVisibleKey.get() ?? false;\n\t}\n\n\tpublic get isFocused(): boolean {\n\t\treturn this._hoverFocusedKey.get() ?? false;\n\t}\n\n\tconstructor(\n\t\teditor: ICodeEditor,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IConfigurationService private readonly _configurationService: IConfigurationService,\n\t\t@IAccessibilityService private readonly _accessibilityService: IAccessibilityService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService\n\t) {\n\t\tconst minimumHeight = editor.getOption(EditorOption.lineHeight) + 8;\n\t\tconst minimumWidth = 150;\n\t\tconst minimumSize = new dom.Dimension(minimumWidth, minimumHeight);\n\t\tsuper(editor, minimumSize);\n\n\t\t// Overflow widgets can be hosted outside the editor's DOM context.\n\t\tthis._register(contextKeyService.createScoped(this._resizableNode.domNode));\n\t\tthis._minimumSize = minimumSize;\n\t\tthis._hoverVisibleKey = EditorContextKeys.hoverVisible.bindTo(contextKeyService);\n\t\tthis._hoverFocusedKey = EditorContextKeys.hoverFocused.bindTo(contextKeyService);\n\n\t\tdom.append(this._resizableNode.domNode, this._hover.containerDomNode);\n\t\tthis._resizableNode.domNode.style.zIndex = '50';\n\t\tthis._resizableNode.domNode.className = 'monaco-resizable-hover';\n\n\t\tthis._register(this._editor.onDidLayoutChange(() => {\n\t\t\tif (this.isVisible) {\n\t\t\t\tthis._updateMaxDimensions();\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {\n\t\t\tif (e.hasChanged(EditorOption.fontInfo)) {\n\t\t\t\tthis._updateFont();\n\t\t\t}\n\t\t}));\n\t\tconst focusTracker = this._register(dom.trackFocus(this._resizableNode.domNode));\n\t\tthis._register(focusTracker.onDidFocus(() => {\n\t\t\tthis._hoverFocusedKey.set(true);\n\t\t}));\n\t\tthis._register(focusTracker.onDidBlur(() => {\n\t\t\tthis._hoverFocusedKey.set(false);\n\t\t}));\n\t\tthis._setRenderedHover(undefined);\n\t\tthis._editor.addContentWidget(this);\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._renderedHover?.dispose();\n\t\tthis._editor.removeContentWidget(this);\n\t}\n\n\tpublic getId(): string {\n\t\treturn ContentHoverWidget.ID;\n\t}\n\n\tprivate static _applyDimensions(container: HTMLElement, width: number | string, height: number | string): void {\n\t\tconst transformedWidth = typeof width === 'number' ? `${width}px` : width;\n\t\tconst transformedHeight = typeof height === 'number' ? `${height}px` : height;\n\t\tcontainer.style.width = transformedWidth;\n\t\tcontainer.style.height = transformedHeight;\n\t}\n\n\tprivate _setContentsDomNodeDimensions(width: number | string, height: number | string): void {\n\t\tconst contentsDomNode = this._hover.contentsDomNode;\n\t\treturn ContentHoverWidget._applyDimensions(contentsDomNode, width, height);\n\t}\n\n\tprivate _setContainerDomNodeDimensions(width: number | string, height: number | string): void {\n\t\tconst containerDomNode = this._hover.containerDomNode;\n\t\treturn ContentHoverWidget._applyDimensions(containerDomNode, width, height);\n\t}\n\n\tprivate _setScrollableElementDimensions(width: number | string, height: number | string): void {\n\t\tconst scrollbarDomElement = this._hover.scrollbar.getDomNode();\n\t\treturn ContentHoverWidget._applyDimensions(scrollbarDomElement, width, height);\n\t}\n\n\tprivate _setHoverWidgetDimensions(width: number | string, height: number | string): void {\n\t\tthis._setContainerDomNodeDimensions(width, height);\n\t\tthis._setScrollableElementDimensions(width, height);\n\t\tthis._setContentsDomNodeDimensions(width, height);\n\t\tthis._layoutContentWidget();\n\t}\n\n\tprivate static _applyMaxDimensions(container: HTMLElement, width: number | string, height: number | string) {\n\t\tconst transformedWidth = typeof width === 'number' ? `${width}px` : width;\n\t\tconst transformedHeight = typeof height === 'number' ? `${height}px` : height;\n\t\tcontainer.style.maxWidth = transformedWidth;\n\t\tcontainer.style.maxHeight = transformedHeight;\n\t}\n\n\tprivate _setHoverWidgetMaxDimensions(width: number | string, height: number | string): void {\n\t\tContentHoverWidget._applyMaxDimensions(this._hover.contentsDomNode, width, height);\n\t\tContentHoverWidget._applyMaxDimensions(this._hover.scrollbar.getDomNode(), width, height);\n\t\tContentHoverWidget._applyMaxDimensions(this._hover.containerDomNode, width, height);\n\t\tthis._hover.containerDomNode.style.setProperty('--vscode-hover-maxWidth', typeof width === 'number' ? `${width}px` : width);\n\t\tthis._layoutContentWidget();\n\t}\n\n\tprivate _setAdjustedHoverWidgetDimensions(size: dom.Dimension): void {\n\t\tthis._setHoverWidgetMaxDimensions('none', 'none');\n\t\tthis._setHoverWidgetDimensions(size.width, size.height);\n\t}\n\n\tprivate _updateResizableNodeMaxDimensions(): void {\n\t\tconst maxRenderingWidth = this._findMaximumRenderingWidth() ?? Infinity;\n\t\tconst maxRenderingHeight = this._findMaximumRenderingHeight() ?? Infinity;\n\t\tthis._resizableNode.maxSize = new dom.Dimension(maxRenderingWidth, maxRenderingHeight);\n\t\tthis._setHoverWidgetMaxDimensions(maxRenderingWidth, maxRenderingHeight);\n\t}\n\n\tprotected override _resize(size: dom.Dimension): void {\n\t\tContentHoverWidget._lastDimensions = new dom.Dimension(size.width, size.height);\n\t\tthis._setAdjustedHoverWidgetDimensions(size);\n\t\tthis._resizableNode.layout(size.height, size.width);\n\t\tthis._updateResizableNodeMaxDimensions();\n\t\tthis._hover.scrollbar.scanDomNode();\n\t\tthis._editor.layoutContentWidget(this);\n\t\tthis._onDidResize.fire();\n\t}\n\n\tprivate _findAvailableSpaceVertically(): number | undefined {\n\t\tconst position = this._renderedHover?.showAtPosition;\n\t\tif (!position) {\n\t\t\treturn;\n\t\t}\n\t\treturn this._positionPreference === ContentWidgetPositionPreference.ABOVE ?\n\t\t\tthis._availableVerticalSpaceAbove(position)\n\t\t\t: this._availableVerticalSpaceBelow(position);\n\t}\n\n\tprivate _findMaximumRenderingHeight(): number | undefined {\n\t\tconst availableSpace = this._findAvailableSpaceVertically();\n\t\tif (!availableSpace) {\n\t\t\treturn;\n\t\t}\n\t\tconst children = this._hover.contentsDomNode.children;\n\t\tlet maximumHeight = children.length - 1;\n\t\tArray.from(this._hover.contentsDomNode.children).forEach((hoverPart) => {\n\t\t\tmaximumHeight += hoverPart.clientHeight;\n\t\t});\n\t\treturn Math.min(availableSpace, maximumHeight);\n\t}\n\n\tprivate _isHoverTextOverflowing(): boolean {\n\t\t// To find out if the text is overflowing, we will disable wrapping, check the widths, and then re-enable wrapping\n\t\tthis._hover.containerDomNode.style.setProperty('--vscode-hover-whiteSpace', 'nowrap');\n\t\tthis._hover.containerDomNode.style.setProperty('--vscode-hover-sourceWhiteSpace', 'nowrap');\n\n\t\tconst overflowing = Array.from(this._hover.contentsDomNode.children).some((hoverElement) => {\n\t\t\treturn hoverElement.scrollWidth > hoverElement.clientWidth;\n\t\t});\n\n\t\tthis._hover.containerDomNode.style.removeProperty('--vscode-hover-whiteSpace');\n\t\tthis._hover.containerDomNode.style.removeProperty('--vscode-hover-sourceWhiteSpace');\n\n\t\treturn overflowing;\n\t}\n\n\tprivate _findMaximumRenderingWidth(): number | undefined {\n\t\tif (!this._editor || !this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst overflowing = this._isHoverTextOverflowing();\n\t\tconst initialWidth = (\n\t\t\ttypeof this._contentWidth === 'undefined'\n\t\t\t\t? 0\n\t\t\t\t: this._contentWidth\n\t\t);\n\n\t\tif (overflowing || this._hover.containerDomNode.clientWidth < initialWidth) {\n\t\t\tconst bodyBoxWidth = dom.getClientArea(this._hover.containerDomNode.ownerDocument.body).width;\n\t\t\tconst horizontalPadding = 14;\n\t\t\treturn bodyBoxWidth - horizontalPadding;\n\t\t} else {\n\t\t\treturn this._hover.containerDomNode.clientWidth;\n\t\t}\n\t}\n\n\tpublic isMouseGettingCloser(posx: number, posy: number): boolean {\n\n\t\tif (!this._renderedHover) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this._renderedHover.initialMousePosX === undefined || this._renderedHover.initialMousePosY === undefined) {\n\t\t\tthis._renderedHover.initialMousePosX = posx;\n\t\t\tthis._renderedHover.initialMousePosY = posy;\n\t\t\treturn false;\n\t\t}\n\n\t\tconst widgetRect = dom.getDomNodePagePosition(this.getDomNode());\n\t\tif (this._renderedHover.closestMouseDistance === undefined) {\n\t\t\tthis._renderedHover.closestMouseDistance = computeDistanceFromPointToRectangle(\n\t\t\t\tthis._renderedHover.initialMousePosX,\n\t\t\t\tthis._renderedHover.initialMousePosY,\n\t\t\t\twidgetRect.left,\n\t\t\t\twidgetRect.top,\n\t\t\t\twidgetRect.width,\n\t\t\t\twidgetRect.height\n\t\t\t);\n\t\t}\n\n\t\tconst distance = computeDistanceFromPointToRectangle(\n\t\t\tposx,\n\t\t\tposy,\n\t\t\twidgetRect.left,\n\t\t\twidgetRect.top,\n\t\t\twidgetRect.width,\n\t\t\twidgetRect.height\n\t\t);\n\t\tif (distance > this._renderedHover.closestMouseDistance + 4 /* tolerance of 4 pixels */) {\n\t\t\t// The mouse is getting farther away\n\t\t\treturn false;\n\t\t}\n\n\t\tthis._renderedHover.closestMouseDistance = Math.min(this._renderedHover.closestMouseDistance, distance);\n\t\treturn true;\n\t}\n\n\tprivate _setRenderedHover(renderedHover: RenderedContentHover | undefined): void {\n\t\tthis._renderedHover?.dispose();\n\t\tthis._renderedHover = renderedHover;\n\t\tthis._hoverVisibleKey.set(!!renderedHover);\n\t\tthis._hover.containerDomNode.classList.toggle('hidden', !renderedHover);\n\t}\n\n\tprivate _updateFont(): void {\n\t\tconst { fontSize, lineHeight } = this._editor.getOption(EditorOption.fontInfo);\n\t\tconst contentsDomNode = this._hover.contentsDomNode;\n\t\tcontentsDomNode.style.fontSize = `${fontSize}px`;\n\t\tcontentsDomNode.style.lineHeight = `${lineHeight / fontSize}`;\n\t\t// eslint-disable-next-line eslint-js/no-restricted-syntax\n\t\tconst codeClasses: HTMLElement[] = Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName('code'));\n\t\tcodeClasses.forEach(node => this._editor.applyFontInfo(node));\n\t}\n\n\tprivate _updateContent(node: DocumentFragment): void {\n\t\tconst contentsDomNode = this._hover.contentsDomNode;\n\t\tcontentsDomNode.style.paddingBottom = '';\n\t\tcontentsDomNode.textContent = '';\n\t\tcontentsDomNode.appendChild(node);\n\t}\n\n\tprivate _layoutContentWidget(): void {\n\t\tthis._editor.layoutContentWidget(this);\n\t\tthis._hover.onContentsChanged();\n\t}\n\n\tprivate _updateMaxDimensions() {\n\t\tconst height = Math.max(this._editor.getLayoutInfo().height / 4, 250, ContentHoverWidget._lastDimensions.height);\n\t\tconst width = Math.max(this._editor.getLayoutInfo().width * 0.66, 750, ContentHoverWidget._lastDimensions.width);\n\t\tthis._resizableNode.maxSize = new dom.Dimension(width, height);\n\t\tthis._setHoverWidgetMaxDimensions(width, height);\n\t}\n\n\tprivate _render(renderedHover: RenderedContentHover) {\n\t\tthis._setRenderedHover(renderedHover);\n\t\tthis._updateFont();\n\t\tthis._updateContent(renderedHover.domNode);\n\t\tthis.handleContentsChanged();\n\t\t// Simply force a synchronous render on the editor\n\t\t// such that the widget does not really render with left = '0px'\n\t\tthis._editor.render();\n\t}\n\n\toverride getPosition(): IContentWidgetPosition | null {\n\t\tif (!this._renderedHover) {\n\t\t\treturn null;\n\t\t}\n\t\treturn {\n\t\t\tposition: this._renderedHover.showAtPosition,\n\t\t\tsecondaryPosition: this._renderedHover.showAtSecondaryPosition,\n\t\t\tpositionAffinity: this._renderedHover.shouldAppearBeforeContent ? PositionAffinity.LeftOfInjectedText : undefined,\n\t\t\tpreference: [this._positionPreference ?? ContentWidgetPositionPreference.ABOVE]\n\t\t};\n\t}\n\n\tpublic show(renderedHover: RenderedContentHover): void {\n\t\tif (!this._editor || !this._editor.hasModel()) {\n\t\t\treturn;\n\t\t}\n\t\tthis._render(renderedHover);\n\t\tconst widgetHeight = dom.getTotalHeight(this._hover.containerDomNode);\n\t\tconst widgetPosition = renderedHover.showAtPosition;\n\t\tthis._positionPreference = this._findPositionPreference(widgetHeight, widgetPosition) ?? ContentWidgetPositionPreference.ABOVE;\n\n\t\t// See https://github.com/microsoft/vscode/issues/140339\n\t\t// TODO: Doing a second layout of the hover after force rendering the editor\n\t\tthis.handleContentsChanged();\n\t\tif (renderedHover.shouldFocus) {\n\t\t\tthis._hover.containerDomNode.focus();\n\t\t}\n\t\tthis._onDidResize.fire();\n\t\t// The aria label overrides the label, so if we add to it, add the contents of the hover\n\t\tconst hoverFocused = this._hover.containerDomNode.ownerDocument.activeElement === this._hover.containerDomNode;\n\t\tconst accessibleViewHint = hoverFocused && getHoverAccessibleViewHint(\n\t\t\tthis._configurationService.getValue('accessibility.verbosity.hover') === true && this._accessibilityService.isScreenReaderOptimized(),\n\t\t\tthis._keybindingService.lookupKeybinding('editor.action.accessibleView')?.getAriaLabel() ?? ''\n\t\t);\n\n\t\tif (accessibleViewHint) {\n\t\t\tthis._hover.contentsDomNode.ariaLabel = this._hover.contentsDomNode.textContent + ', ' + accessibleViewHint;\n\t\t}\n\t}\n\n\tpublic hide(): void {\n\t\tif (!this._renderedHover) {\n\t\t\treturn;\n\t\t}\n\t\tconst hoverStoleFocus = this._renderedHover.shouldFocus || this._hoverFocusedKey.get();\n\t\tthis._setRenderedHover(undefined);\n\t\tthis._resizableNode.maxSize = new dom.Dimension(Infinity, Infinity);\n\t\tthis._resizableNode.clearSashHoverState();\n\t\tthis._hoverFocusedKey.set(false);\n\t\tthis._editor.layoutContentWidget(this);\n\t\tif (hoverStoleFocus) {\n\t\t\tthis._editor.focus();\n\t\t}\n\t}\n\n\tprivate _removeConstraintsRenderNormally(): void {\n\t\t// Added because otherwise the initial size of the hover content is smaller than should be\n\t\tconst layoutInfo = this._editor.getLayoutInfo();\n\t\tthis._resizableNode.layout(layoutInfo.height, layoutInfo.width);\n\t\tthis._setHoverWidgetDimensions('auto', 'auto');\n\t\tthis._updateMaxDimensions();\n\t}\n\n\tpublic setMinimumDimensions(dimensions: dom.Dimension): void {\n\t\t// We combine the new minimum dimensions with the previous ones\n\t\tthis._minimumSize = new dom.Dimension(\n\t\t\tMath.max(this._minimumSize.width, dimensions.width),\n\t\t\tMath.max(this._minimumSize.height, dimensions.height)\n\t\t);\n\t\tthis._updateMinimumWidth();\n\t}\n\n\tprivate _updateMinimumWidth(): void {\n\t\tconst width = (\n\t\t\ttypeof this._contentWidth === 'undefined'\n\t\t\t\t? this._minimumSize.width\n\t\t\t\t: Math.min(this._contentWidth, this._minimumSize.width)\n\t\t);\n\t\t// We want to avoid that the hover is artificially large, so we use the content width as minimum width\n\t\tthis._resizableNode.minSize = new dom.Dimension(width, this._minimumSize.height);\n\t}\n\n\tpublic handleContentsChanged(): void {\n\t\tthis._removeConstraintsRenderNormally();\n\t\tconst contentsDomNode = this._hover.contentsDomNode;\n\n\t\tlet height = dom.getTotalHeight(contentsDomNode);\n\t\tlet width = dom.getTotalWidth(contentsDomNode) + 2;\n\t\tthis._resizableNode.layout(height, width);\n\n\t\tthis._setHoverWidgetDimensions(width, height);\n\n\t\theight = dom.getTotalHeight(contentsDomNode);\n\t\twidth = dom.getTotalWidth(contentsDomNode);\n\t\tthis._contentWidth = width;\n\t\tthis._updateMinimumWidth();\n\t\tthis._resizableNode.layout(height, width);\n\n\t\tif (this._renderedHover?.showAtPosition) {\n\t\t\tconst widgetHeight = dom.getTotalHeight(this._hover.containerDomNode);\n\t\t\tthis._positionPreference = this._findPositionPreference(widgetHeight, this._renderedHover.showAtPosition);\n\t\t}\n\t\tthis._layoutContentWidget();\n\t\tthis._onContentsChanged.fire();\n\t}\n\n\tpublic focus(): void {\n\t\tthis._hover.containerDomNode.focus();\n\t}\n\n\tpublic scrollUp(): void {\n\t\tconst scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop;\n\t\tconst fontInfo = this._editor.getOption(EditorOption.fontInfo);\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop - fontInfo.lineHeight });\n\t}\n\n\tpublic scrollDown(): void {\n\t\tconst scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop;\n\t\tconst fontInfo = this._editor.getOption(EditorOption.fontInfo);\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop + fontInfo.lineHeight });\n\t}\n\n\tpublic scrollLeft(): void {\n\t\tconst scrollLeft = this._hover.scrollbar.getScrollPosition().scrollLeft;\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollLeft: scrollLeft - HORIZONTAL_SCROLLING_BY });\n\t}\n\n\tpublic scrollRight(): void {\n\t\tconst scrollLeft = this._hover.scrollbar.getScrollPosition().scrollLeft;\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollLeft: scrollLeft + HORIZONTAL_SCROLLING_BY });\n\t}\n\n\tpublic pageUp(): void {\n\t\tconst scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop;\n\t\tconst scrollHeight = this._hover.scrollbar.getScrollDimensions().height;\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop - scrollHeight });\n\t}\n\n\tpublic pageDown(): void {\n\t\tconst scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop;\n\t\tconst scrollHeight = this._hover.scrollbar.getScrollDimensions().height;\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop + scrollHeight });\n\t}\n\n\tpublic goToTop(): void {\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: 0 });\n\t}\n\n\tpublic goToBottom(): void {\n\t\tthis._hover.scrollbar.setScrollPosition({ scrollTop: this._hover.scrollbar.getScrollDimensions().scrollHeight });\n\t}\n}\n\nfunction computeDistanceFromPointToRectangle(pointX: number, pointY: number, left: number, top: number, width: number, height: number): number {\n\tconst x = (left + width / 2); // x center of rectangle\n\tconst y = (top + height / 2); // y center of rectangle\n\tconst dx = Math.max(Math.abs(pointX - x) - width / 2, 0);\n\tconst dy = Math.max(Math.abs(pointY - y) - height / 2, 0);\n\treturn Math.sqrt(dx * dx + dy * dy);\n}\n"]}
@@ -53,9 +53,6 @@ let ContentHoverWidgetWrapper = class ContentHoverWidgetWrapper extends Disposab
53
53
  this._register(this._contentHoverWidget.onDidResize(() => {
54
54
  this._participants.forEach(participant => participant.handleResize?.());
55
55
  }));
56
- this._register(this._contentHoverWidget.onDidScroll((e) => {
57
- this._participants.forEach(participant => participant.handleScroll?.(e));
58
- }));
59
56
  this._register(this._contentHoverWidget.onContentsChanged(() => {
60
57
  this._participants.forEach(participant => participant.handleContentsChanged?.());
61
58
  }));