monaco-editor-core 0.57.0 → 0.58.0-dev-20261104

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (508) 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 +38 -6
  18. package/esm/vs/base/browser/browser.js +8 -0
  19. package/esm/vs/base/browser/browser.js.map +1 -1
  20. package/esm/vs/base/browser/contextmenu.js +8 -1
  21. package/esm/vs/base/browser/contextmenu.js.map +1 -1
  22. package/esm/vs/base/browser/dom.js +34 -5
  23. package/esm/vs/base/browser/dom.js.map +1 -1
  24. package/esm/vs/base/browser/dompurify/dompurify.js +2457 -2640
  25. package/esm/vs/base/browser/markdownRenderer.js +48 -21
  26. package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
  27. package/esm/vs/base/browser/pixelRatio.js +3 -2
  28. package/esm/vs/base/browser/pixelRatio.js.map +1 -1
  29. package/esm/vs/base/browser/ui/actionbar/actionViewItems.js +5 -2
  30. package/esm/vs/base/browser/ui/actionbar/actionViewItems.js.map +1 -1
  31. package/esm/vs/base/browser/ui/actionbar/actionbar.js +7 -2
  32. package/esm/vs/base/browser/ui/actionbar/actionbar.js.map +1 -1
  33. package/esm/vs/base/browser/ui/animations/animations.js +68 -40
  34. package/esm/vs/base/browser/ui/animations/animations.js.map +1 -1
  35. package/esm/vs/base/browser/ui/button/button.js +7 -0
  36. package/esm/vs/base/browser/ui/button/button.js.map +1 -1
  37. package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  38. package/esm/vs/base/browser/ui/contextview/contextview.css +15 -0
  39. package/esm/vs/base/browser/ui/contextview/contextview.js +266 -40
  40. package/esm/vs/base/browser/ui/contextview/contextview.js.map +1 -1
  41. package/esm/vs/base/browser/ui/contextview/windowControlsOverlay.js +72 -0
  42. package/esm/vs/base/browser/ui/contextview/windowControlsOverlay.js.map +1 -0
  43. package/esm/vs/base/browser/ui/dialog/dialog.css +5 -0
  44. package/esm/vs/base/browser/ui/dropdown/dropdown.js +2 -1
  45. package/esm/vs/base/browser/ui/dropdown/dropdown.js.map +1 -1
  46. package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +1 -0
  47. package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js.map +1 -1
  48. package/esm/vs/base/browser/ui/hover/hover.js.map +1 -1
  49. package/esm/vs/base/browser/ui/list/listView.js +87 -15
  50. package/esm/vs/base/browser/ui/list/listView.js.map +1 -1
  51. package/esm/vs/base/browser/ui/list/listWidget.js +37 -15
  52. package/esm/vs/base/browser/ui/list/listWidget.js.map +1 -1
  53. package/esm/vs/base/browser/ui/menu/menu.js +189 -52
  54. package/esm/vs/base/browser/ui/menu/menu.js.map +1 -1
  55. package/esm/vs/base/browser/ui/radio/radio.css +11 -0
  56. package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js +2 -1
  57. package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js.map +1 -1
  58. package/esm/vs/base/browser/ui/selectBox/selectBox.js.map +1 -1
  59. package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js +14 -8
  60. package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js.map +1 -1
  61. package/esm/vs/base/browser/ui/splitview/splitview.js +11 -7
  62. package/esm/vs/base/browser/ui/splitview/splitview.js.map +1 -1
  63. package/esm/vs/base/browser/ui/toggle/switch.css +16 -7
  64. package/esm/vs/base/browser/ui/toggle/switch.js +9 -6
  65. package/esm/vs/base/browser/ui/toggle/switch.js.map +1 -1
  66. package/esm/vs/base/browser/ui/toolbar/toolbar.css +1 -2
  67. package/esm/vs/base/browser/ui/toolbar/toolbar.js +85 -38
  68. package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
  69. package/esm/vs/base/browser/ui/tree/abstractTree.js +48 -9
  70. package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
  71. package/esm/vs/base/browser/ui/tree/asyncDataTree.js +10 -1
  72. package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
  73. package/esm/vs/base/browser/ui/tree/objectTree.js +3 -0
  74. package/esm/vs/base/browser/ui/tree/objectTree.js.map +1 -1
  75. package/esm/vs/base/browser/ui/tree/tree.js.map +1 -1
  76. package/esm/vs/base/common/actions.js +8 -2
  77. package/esm/vs/base/common/actions.js.map +1 -1
  78. package/esm/vs/base/common/arrays.js +4 -4
  79. package/esm/vs/base/common/arrays.js.map +1 -1
  80. package/esm/vs/base/common/async.js +12 -8
  81. package/esm/vs/base/common/async.js.map +1 -1
  82. package/esm/vs/base/common/cancellation.js +25 -0
  83. package/esm/vs/base/common/cancellation.js.map +1 -1
  84. package/esm/vs/base/common/codicons.js +2 -0
  85. package/esm/vs/base/common/codicons.js.map +1 -1
  86. package/esm/vs/base/common/codiconsLibrary.js +2 -0
  87. package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
  88. package/esm/vs/base/common/color.js +1 -1
  89. package/esm/vs/base/common/color.js.map +1 -1
  90. package/esm/vs/base/common/diff/diff.js +60 -1
  91. package/esm/vs/base/common/diff/diff.js.map +1 -1
  92. package/esm/vs/base/common/event.js +1 -1
  93. package/esm/vs/base/common/event.js.map +1 -1
  94. package/esm/vs/base/common/glob.js +1 -0
  95. package/esm/vs/base/common/glob.js.map +1 -1
  96. package/esm/vs/base/common/htmlContent.js +74 -12
  97. package/esm/vs/base/common/htmlContent.js.map +1 -1
  98. package/esm/vs/base/common/json.js +19 -0
  99. package/esm/vs/base/common/json.js.map +1 -0
  100. package/esm/vs/base/common/network.js +16 -0
  101. package/esm/vs/base/common/network.js.map +1 -1
  102. package/esm/vs/base/common/resources.js +14 -2
  103. package/esm/vs/base/common/resources.js.map +1 -1
  104. package/esm/vs/base/common/strings.js +1 -1
  105. package/esm/vs/base/common/strings.js.map +1 -1
  106. package/esm/vs/base/common/uri.js +2 -2
  107. package/esm/vs/base/common/uri.js.map +1 -1
  108. package/esm/vs/editor/browser/config/editorConfiguration.js +1 -1
  109. package/esm/vs/editor/browser/config/fontMeasurements.js +19 -6
  110. package/esm/vs/editor/browser/config/fontMeasurements.js.map +1 -1
  111. package/esm/vs/editor/browser/controller/dragScrolling.js +3 -3
  112. package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js +11 -5
  113. package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js.map +1 -1
  114. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +8 -38
  115. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
  116. package/esm/vs/editor/browser/controller/editContext/native/screenReaderContentRich.js +3 -3
  117. package/esm/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +6 -6
  118. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +12 -10
  119. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
  120. package/esm/vs/editor/browser/controller/mouseHandler.js +7 -7
  121. package/esm/vs/editor/browser/controller/mouseTarget.js +3 -3
  122. package/esm/vs/editor/browser/coreCommands.js +2 -2
  123. package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
  124. package/esm/vs/editor/browser/editorMarkdownSanitizer.js +19 -0
  125. package/esm/vs/editor/browser/editorMarkdownSanitizer.js.map +1 -0
  126. package/esm/vs/editor/browser/gpu/rectangleRenderer.js +1 -1
  127. package/esm/vs/editor/browser/gpu/viewGpuContext.js +1 -1
  128. package/esm/vs/editor/browser/observableCodeEditor.js +1 -1
  129. package/esm/vs/editor/browser/services/editorWorkerService.js +3 -2
  130. package/esm/vs/editor/browser/services/editorWorkerService.js.map +1 -1
  131. package/esm/vs/editor/browser/services/openerService.js +6 -2
  132. package/esm/vs/editor/browser/services/openerService.js.map +1 -1
  133. package/esm/vs/editor/browser/view/domLineBreaksComputer.js +34 -11
  134. package/esm/vs/editor/browser/view/domLineBreaksComputer.js.map +1 -1
  135. package/esm/vs/editor/browser/view/viewController.js +7 -7
  136. package/esm/vs/editor/browser/view/viewController.js.map +1 -1
  137. package/esm/vs/editor/browser/view/viewLayer.js +1 -1
  138. package/esm/vs/editor/browser/view/viewOverlays.js +4 -4
  139. package/esm/vs/editor/browser/view.js +5 -5
  140. package/esm/vs/editor/browser/viewParts/blockDecorations/blockDecorations.js +1 -1
  141. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +11 -3
  142. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
  143. package/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js +6 -6
  144. package/esm/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.js +12 -12
  145. package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +9 -2
  146. package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js.map +1 -1
  147. package/esm/vs/editor/browser/viewParts/indentGuides/indentGuides.js +2 -2
  148. package/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.js +2 -2
  149. package/esm/vs/editor/browser/viewParts/linesDecorations/linesDecorations.js +2 -2
  150. package/esm/vs/editor/browser/viewParts/margin/margin.js +2 -2
  151. package/esm/vs/editor/browser/viewParts/minimap/minimap.js +6 -6
  152. package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js +9 -2
  153. package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js.map +1 -1
  154. package/esm/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.js +5 -5
  155. package/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js +3 -3
  156. package/esm/vs/editor/browser/viewParts/rulers/rulers.js +2 -2
  157. package/esm/vs/editor/browser/viewParts/rulersGpu/rulersGpu.js +1 -1
  158. package/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js +3 -3
  159. package/esm/vs/editor/browser/viewParts/selections/selections.js +2 -2
  160. package/esm/vs/editor/browser/viewParts/viewCursors/viewCursor.js +2 -2
  161. package/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.js +6 -6
  162. package/esm/vs/editor/browser/viewParts/viewLines/viewLineOptions.js +5 -5
  163. package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js +11 -11
  164. package/esm/vs/editor/browser/viewParts/viewLinesGpu/viewLinesGpu.js +1 -1
  165. package/esm/vs/editor/browser/viewParts/viewZones/viewZones.js +2 -2
  166. package/esm/vs/editor/browser/viewParts/whitespace/whitespace.js +4 -4
  167. package/esm/vs/editor/browser/viewParts/wordWrapIndicator/wordWrapIndicator.js +2 -2
  168. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +22 -21
  169. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
  170. package/esm/vs/editor/browser/widget/diffEditor/commands.js +12 -12
  171. package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +18 -18
  172. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -1
  173. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +3 -3
  174. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +10 -10
  175. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js.map +1 -1
  176. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.js +2 -2
  177. package/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +4 -4
  178. package/esm/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js +21 -3
  179. package/esm/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js.map +1 -1
  180. package/esm/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +1 -1
  181. package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +10 -10
  182. package/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
  183. package/esm/vs/editor/browser/widget/diffEditor/features/overviewRulerFeature.js +1 -1
  184. package/esm/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +2 -2
  185. package/esm/vs/editor/browser/widget/diffEditor/registrations.contribution.js +5 -5
  186. package/esm/vs/editor/browser/widget/multiDiffEditor/colors.js +3 -3
  187. package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollLayout.js +2 -2
  188. package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollLayout.js.map +1 -1
  189. package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollView.js +21 -2
  190. package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollView.js.map +1 -1
  191. package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +2 -2
  192. package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +11 -3
  193. package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js.map +1 -1
  194. package/esm/vs/editor/browser/widget/multiDiffEditor/virtualizedItemManager.js +1 -0
  195. package/esm/vs/editor/browser/widget/multiDiffEditor/virtualizedItemManager.js.map +1 -1
  196. package/esm/vs/editor/common/commands/columnSelectionPasteCommand.js +64 -0
  197. package/esm/vs/editor/common/commands/columnSelectionPasteCommand.js.map +1 -0
  198. package/esm/vs/editor/common/config/editorConfigurationSchema.js +68 -58
  199. package/esm/vs/editor/common/config/editorConfigurationSchema.js.map +1 -1
  200. package/esm/vs/editor/common/config/editorOptions.js +560 -500
  201. package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
  202. package/esm/vs/editor/common/core/editorColorRegistry.js +71 -71
  203. package/esm/vs/editor/common/core/edits/textEdit.js +16 -0
  204. package/esm/vs/editor/common/core/edits/textEdit.js.map +1 -1
  205. package/esm/vs/editor/common/cursor/cursor.js +20 -10
  206. package/esm/vs/editor/common/cursor/cursor.js.map +1 -1
  207. package/esm/vs/editor/common/cursor/cursorTypeEditOperations.js +67 -14
  208. package/esm/vs/editor/common/cursor/cursorTypeEditOperations.js.map +1 -1
  209. package/esm/vs/editor/common/cursor/cursorTypeOperations.js +2 -2
  210. package/esm/vs/editor/common/cursor/cursorTypeOperations.js.map +1 -1
  211. package/esm/vs/editor/common/cursorCommon.js +22 -21
  212. package/esm/vs/editor/common/cursorCommon.js.map +1 -1
  213. package/esm/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js +21 -8
  214. package/esm/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js.map +1 -1
  215. package/esm/vs/editor/common/diff/documentDiffProvider.js.map +1 -1
  216. package/esm/vs/editor/common/diff/externalLinesDiffComputer.js +38 -26
  217. package/esm/vs/editor/common/diff/externalLinesDiffComputer.js.map +1 -1
  218. package/esm/vs/editor/common/diff/rangeMapping.js +11 -1
  219. package/esm/vs/editor/common/diff/rangeMapping.js.map +1 -1
  220. package/esm/vs/editor/common/diff/verifyLinesDiff.js +28 -0
  221. package/esm/vs/editor/common/diff/verifyLinesDiff.js.map +1 -0
  222. package/esm/vs/editor/common/editorContextKeys.js +53 -53
  223. package/esm/vs/editor/common/languages/languageConfiguration.js +8 -0
  224. package/esm/vs/editor/common/languages/languageConfiguration.js.map +1 -1
  225. package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
  226. package/esm/vs/editor/common/languages.js +56 -56
  227. package/esm/vs/editor/common/model/editStack.js +1 -1
  228. package/esm/vs/editor/common/services/editorWebWorker.js +27 -6
  229. package/esm/vs/editor/common/services/editorWebWorker.js.map +1 -1
  230. package/esm/vs/editor/common/services/editorWorker.js.map +1 -1
  231. package/esm/vs/editor/common/services/languageService.js +6 -4
  232. package/esm/vs/editor/common/services/languageService.js.map +1 -1
  233. package/esm/vs/editor/common/services/markerDecorationsService.js +21 -2
  234. package/esm/vs/editor/common/services/markerDecorationsService.js.map +1 -1
  235. package/esm/vs/editor/common/standalone/standaloneEnums.js +100 -97
  236. package/esm/vs/editor/common/standalone/standaloneEnums.js.map +1 -1
  237. package/esm/vs/editor/common/standaloneStrings.js +11 -11
  238. package/esm/vs/editor/common/textModelEditSource.js +9 -0
  239. package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
  240. package/esm/vs/editor/common/viewLayout/viewLayout.js +16 -16
  241. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
  242. package/esm/vs/editor/common/viewModel/monospaceLineBreaksComputer.js +1 -1
  243. package/esm/vs/editor/common/viewModel/viewModelImpl.js +19 -19
  244. package/esm/vs/editor/common/viewModel/viewModelImpl.js.map +1 -1
  245. package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
  246. package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +9 -9
  247. package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
  248. package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
  249. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +23 -20
  250. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
  251. package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
  252. package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
  253. package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
  254. package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
  255. package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
  256. package/esm/vs/editor/contrib/codeAction/browser/codeActionModel.js +1 -1
  257. package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
  258. package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
  259. package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js +25 -10
  260. package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js.map +1 -1
  261. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
  262. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
  263. package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerContribution.js +1 -1
  264. package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +3 -3
  265. package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
  266. package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerParticipant.js +1 -1
  267. package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
  268. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +17 -17
  269. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js.map +1 -1
  270. package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
  271. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
  272. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +39 -39
  273. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
  274. package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
  275. package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
  276. package/esm/vs/editor/contrib/dropOrPasteInto/browser/pasteEditSession.js +19 -0
  277. package/esm/vs/editor/contrib/dropOrPasteInto/browser/pasteEditSession.js.map +1 -0
  278. package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +26 -18
  279. package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js.map +1 -1
  280. package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
  281. package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js.map +1 -1
  282. package/esm/vs/editor/contrib/find/browser/findController.js +18 -18
  283. package/esm/vs/editor/contrib/find/browser/findController.js.map +1 -1
  284. package/esm/vs/editor/contrib/find/browser/findModel.js +6 -6
  285. package/esm/vs/editor/contrib/find/browser/findWidget.js +40 -40
  286. package/esm/vs/editor/contrib/find/browser/findWidget.js.map +1 -1
  287. package/esm/vs/editor/contrib/folding/browser/folding.js +23 -23
  288. package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
  289. package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
  290. package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
  291. package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
  292. package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
  293. package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
  294. package/esm/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.js +3 -3
  295. package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +2 -2
  296. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +4 -4
  297. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js.map +1 -1
  298. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
  299. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
  300. package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
  301. package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
  302. package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
  303. package/esm/vs/editor/contrib/hover/browser/contentHoverController.js +9 -3
  304. package/esm/vs/editor/contrib/hover/browser/contentHoverController.js.map +1 -1
  305. package/esm/vs/editor/contrib/hover/browser/glyphHoverController.js +2 -2
  306. package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js +2 -1
  307. package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js.map +1 -1
  308. package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
  309. package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
  310. package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
  311. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +10 -8
  312. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
  313. package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +6 -6
  314. package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
  315. package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
  316. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +5 -5
  317. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +9 -9
  318. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.js +3 -3
  319. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.js.map +1 -1
  320. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +21 -21
  321. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -13
  322. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +7 -7
  323. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
  324. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +6 -5
  325. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js.map +1 -1
  326. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +1 -1
  327. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +2 -2
  328. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +7 -7
  329. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
  330. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +1 -1
  331. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +3 -3
  332. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
  333. package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
  334. package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
  335. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +32 -32
  336. package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +5 -4
  337. package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js.map +1 -1
  338. package/esm/vs/editor/contrib/links/browser/links.js +16 -15
  339. package/esm/vs/editor/contrib/links/browser/links.js.map +1 -1
  340. package/esm/vs/editor/contrib/longLinesHelper/browser/longLinesHelper.js +1 -1
  341. package/esm/vs/editor/contrib/message/browser/messageController.js +16 -12
  342. package/esm/vs/editor/contrib/message/browser/messageController.js.map +1 -1
  343. package/esm/vs/editor/contrib/middleScroll/browser/middleScrollController.js +1 -1
  344. package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +91 -55
  345. package/esm/vs/editor/contrib/multicursor/browser/multicursor.js.map +1 -1
  346. package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
  347. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsModel.js +3 -3
  348. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsModel.js.map +1 -1
  349. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +6 -4
  350. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js.map +1 -1
  351. package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
  352. package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
  353. package/esm/vs/editor/contrib/placeholderText/browser/placeholderTextContribution.js +1 -1
  354. package/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js +1 -1
  355. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +12 -12
  356. package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
  357. package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +3 -3
  358. package/esm/vs/editor/contrib/rename/browser/rename.js +11 -11
  359. package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
  360. package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js +6 -6
  361. package/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js +23 -13
  362. package/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js.map +1 -1
  363. package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +5 -5
  364. package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +5 -5
  365. package/esm/vs/editor/contrib/snippet/browser/snippetSession.js +2 -2
  366. package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
  367. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  368. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +10 -8
  369. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js.map +1 -1
  370. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.js +1 -1
  371. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.js +2 -2
  372. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +6 -6
  373. package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -9
  374. package/esm/vs/editor/contrib/suggest/browser/suggestController.js +15 -15
  375. package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +2 -2
  376. package/esm/vs/editor/contrib/suggest/browser/suggestModel.js +11 -11
  377. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +27 -27
  378. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +8 -6
  379. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js.map +1 -1
  380. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +5 -5
  381. package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +3 -3
  382. package/esm/vs/editor/contrib/suggest/browser/wordDistance.js +1 -1
  383. package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
  384. package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  385. package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  386. package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  387. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +27 -27
  388. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +9 -9
  389. package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  390. package/esm/vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider.js +1 -1
  391. package/esm/vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider.js.map +1 -1
  392. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +50 -14
  393. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js.map +1 -1
  394. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +6 -6
  395. package/esm/vs/editor/editor.api.d.ts +133 -98
  396. package/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js +1 -1
  397. package/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js +5 -3
  398. package/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js.map +1 -1
  399. package/esm/vs/editor/standalone/browser/standaloneCodeEditor.js +15 -1
  400. package/esm/vs/editor/standalone/browser/standaloneCodeEditor.js.map +1 -1
  401. package/esm/vs/nls.js.map +1 -1
  402. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +72 -66
  403. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js.map +1 -1
  404. package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
  405. package/esm/vs/platform/actionWidget/browser/actionList.js +434 -136
  406. package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
  407. package/esm/vs/platform/actionWidget/browser/actionWidget.css +74 -4
  408. package/esm/vs/platform/actionWidget/browser/actionWidget.js +24 -26
  409. package/esm/vs/platform/actionWidget/browser/actionWidget.js.map +1 -1
  410. package/esm/vs/platform/actionWidget/browser/actionWidgetMotion.js +16 -0
  411. package/esm/vs/platform/actionWidget/browser/actionWidgetMotion.js.map +1 -0
  412. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +15 -17
  413. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js.map +1 -1
  414. package/esm/vs/platform/actions/browser/toolbar.js +25 -12
  415. package/esm/vs/platform/actions/browser/toolbar.js.map +1 -1
  416. package/esm/vs/platform/actions/common/actions.js +4 -2
  417. package/esm/vs/platform/actions/common/actions.js.map +1 -1
  418. package/esm/vs/platform/actions/common/menuService.js +15 -8
  419. package/esm/vs/platform/actions/common/menuService.js.map +1 -1
  420. package/esm/vs/platform/configuration/common/configuration.js +3 -1
  421. package/esm/vs/platform/configuration/common/configuration.js.map +1 -1
  422. package/esm/vs/platform/configuration/common/configurationModels.js +16 -11
  423. package/esm/vs/platform/configuration/common/configurationModels.js.map +1 -1
  424. package/esm/vs/platform/configuration/common/configurationRegistry.js +29 -27
  425. package/esm/vs/platform/configuration/common/configurationRegistry.js.map +1 -1
  426. package/esm/vs/platform/configuration/common/configurations.js +13 -1
  427. package/esm/vs/platform/configuration/common/configurations.js.map +1 -1
  428. package/esm/vs/platform/contextkey/browser/contextKeyService.js +2 -2
  429. package/esm/vs/platform/contextkey/browser/contextKeyService.js.map +1 -1
  430. package/esm/vs/platform/contextkey/common/contextkey.js +28 -14
  431. package/esm/vs/platform/contextkey/common/contextkey.js.map +1 -1
  432. package/esm/vs/platform/contextkey/common/contextkeys.js +10 -10
  433. package/esm/vs/platform/contextkey/common/scanner.js +5 -5
  434. package/esm/vs/platform/contextview/browser/contextMenuHandler.js +17 -4
  435. package/esm/vs/platform/contextview/browser/contextMenuHandler.js.map +1 -1
  436. package/esm/vs/platform/contextview/browser/contextMenuService.js +1 -1
  437. package/esm/vs/platform/contextview/browser/contextMenuService.js.map +1 -1
  438. package/esm/vs/platform/contextview/browser/contextView.js.map +1 -1
  439. package/esm/vs/platform/contextview/browser/contextViewService.js +7 -2
  440. package/esm/vs/platform/contextview/browser/contextViewService.js.map +1 -1
  441. package/esm/vs/platform/editor/common/editor.js +17 -0
  442. package/esm/vs/platform/editor/common/editor.js.map +1 -1
  443. package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  444. package/esm/vs/platform/hover/browser/hoverService.js +6 -3
  445. package/esm/vs/platform/hover/browser/hoverService.js.map +1 -1
  446. package/esm/vs/platform/hover/browser/hoverWidget.js +38 -6
  447. package/esm/vs/platform/hover/browser/hoverWidget.js.map +1 -1
  448. package/esm/vs/platform/hover/browser/updatableHoverWidget.js +32 -5
  449. package/esm/vs/platform/hover/browser/updatableHoverWidget.js.map +1 -1
  450. package/esm/vs/platform/instantiation/common/instantiationService.js +1 -1
  451. package/esm/vs/platform/instantiation/common/instantiationService.js.map +1 -1
  452. package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +5 -5
  453. package/esm/vs/platform/keybinding/common/keybindingResolver.js +1 -1
  454. package/esm/vs/platform/keybinding/common/keybindingResolver.js.map +1 -1
  455. package/esm/vs/platform/list/browser/listService.js +27 -27
  456. package/esm/vs/platform/markers/common/markerService.js +11 -8
  457. package/esm/vs/platform/markers/common/markerService.js.map +1 -1
  458. package/esm/vs/platform/markers/common/markers.js +6 -6
  459. package/esm/vs/platform/markers/common/markers.js.map +1 -1
  460. package/esm/vs/platform/notification/common/notification.js.map +1 -1
  461. package/esm/vs/platform/notification/common/notificationMessage.js +37 -0
  462. package/esm/vs/platform/notification/common/notificationMessage.js.map +1 -0
  463. package/esm/vs/platform/opener/common/opener.js.map +1 -1
  464. package/esm/vs/platform/progress/common/progress.js.map +1 -1
  465. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
  466. package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
  467. package/esm/vs/platform/quickinput/browser/media/quickInput.css +33 -2
  468. package/esm/vs/platform/quickinput/browser/quickAccess.js +7 -4
  469. package/esm/vs/platform/quickinput/browser/quickAccess.js.map +1 -1
  470. package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
  471. package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
  472. package/esm/vs/platform/quickinput/browser/quickInputController.js +65 -15
  473. package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
  474. package/esm/vs/platform/quickinput/browser/quickInputList.js +96 -90
  475. package/esm/vs/platform/quickinput/browser/quickInputList.js.map +1 -1
  476. package/esm/vs/platform/quickinput/browser/quickInputService.js +5 -7
  477. package/esm/vs/platform/quickinput/browser/quickInputService.js.map +1 -1
  478. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  479. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
  480. package/esm/vs/platform/quickinput/browser/tree/quickTree.js +1 -1
  481. package/esm/vs/platform/quickinput/common/quickAccess.js.map +1 -1
  482. package/esm/vs/platform/quickinput/common/quickInput.js.map +1 -1
  483. package/esm/vs/platform/storage/common/storage.js.map +1 -1
  484. package/esm/vs/platform/theme/common/colorRegistry.js +1 -0
  485. package/esm/vs/platform/theme/common/colorRegistry.js.map +1 -1
  486. package/esm/vs/platform/theme/common/colorUtils.js +11 -3
  487. package/esm/vs/platform/theme/common/colorUtils.js.map +1 -1
  488. package/esm/vs/platform/theme/common/colors/baseColors.js +19 -19
  489. package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -9
  490. package/esm/vs/platform/theme/common/colors/chartsColors.js.map +1 -1
  491. package/esm/vs/platform/theme/common/colors/confettiColors.js +14 -0
  492. package/esm/vs/platform/theme/common/colors/confettiColors.js.map +1 -0
  493. package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
  494. package/esm/vs/platform/theme/common/colors/inputColors.js +48 -48
  495. package/esm/vs/platform/theme/common/colors/inputColors.js.map +1 -1
  496. package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
  497. package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
  498. package/esm/vs/platform/theme/common/colors/minimapColors.js +13 -13
  499. package/esm/vs/platform/theme/common/colors/minimapColors.js.map +1 -1
  500. package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
  501. package/esm/vs/platform/theme/common/colors/quickpickColors.js +10 -10
  502. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  503. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  504. package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
  505. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  506. package/monaco.d.ts +133 -98
  507. package/package.json +3 -3
  508. package/version.txt +1 -1
@@ -95,7 +95,7 @@ let View = class View extends ViewEventHandler {
95
95
  this._context.addEventHandler(this);
96
96
  this._viewParts = [];
97
97
  // Keyboard handler
98
- this._editContextEnabled = this._context.configuration.options.get(171 /* EditorOption.effectiveEditContext */);
98
+ this._editContextEnabled = this._context.configuration.options.get(174 /* EditorOption.effectiveEditContext */);
99
99
  this._accessibilitySupport = this._context.configuration.options.get(2 /* EditorOption.accessibilitySupport */);
100
100
  this._editContext = this._instantiateEditContext();
101
101
  this._connectEditContextClipboardEvents();
@@ -203,7 +203,7 @@ let View = class View extends ViewEventHandler {
203
203
  this._pointerHandler = this._register(new PointerHandler(this._context, this._viewController, this._createPointerHandlerHelper()));
204
204
  }
205
205
  _instantiateEditContext() {
206
- const usingExperimentalEditContext = this._context.configuration.options.get(171 /* EditorOption.effectiveEditContext */);
206
+ const usingExperimentalEditContext = this._context.configuration.options.get(174 /* EditorOption.effectiveEditContext */);
207
207
  if (usingExperimentalEditContext) {
208
208
  return this._instantiationService.createInstance(NativeEditContext, this._ownerID, this._context, this._overflowGuardContainer, this._viewController, this._createTextAreaHandlerHelper());
209
209
  }
@@ -212,7 +212,7 @@ let View = class View extends ViewEventHandler {
212
212
  }
213
213
  }
214
214
  _updateEditContext() {
215
- const editContextEnabled = this._context.configuration.options.get(171 /* EditorOption.effectiveEditContext */);
215
+ const editContextEnabled = this._context.configuration.options.get(174 /* EditorOption.effectiveEditContext */);
216
216
  const accessibilitySupport = this._context.configuration.options.get(2 /* EditorOption.accessibilitySupport */);
217
217
  if (this._editContextEnabled === editContextEnabled && this._accessibilitySupport === accessibilitySupport) {
218
218
  return;
@@ -325,7 +325,7 @@ let View = class View extends ViewEventHandler {
325
325
  }
326
326
  _applyLayout() {
327
327
  const options = this._context.configuration.options;
328
- const layoutInfo = options.get(166 /* EditorOption.layoutInfo */);
328
+ const layoutInfo = options.get(169 /* EditorOption.layoutInfo */);
329
329
  this.domNode.setWidth(layoutInfo.width);
330
330
  this.domNode.setHeight(layoutInfo.height);
331
331
  this._overflowGuardContainer.setWidth(layoutInfo.width);
@@ -336,7 +336,7 @@ let View = class View extends ViewEventHandler {
336
336
  }
337
337
  _getEditorClassName() {
338
338
  const focused = this._editContext.isFocused() ? ' focused' : '';
339
- return this._context.configuration.options.get(163 /* EditorOption.editorClassName */) + ' ' + getThemeTypeSelector(this._context.theme.type) + focused;
339
+ return this._context.configuration.options.get(166 /* EditorOption.editorClassName */) + ' ' + getThemeTypeSelector(this._context.theme.type) + focused;
340
340
  }
341
341
  // --- begin event handlers
342
342
  handleEvents(events) {
@@ -20,7 +20,7 @@ export class BlockDecorations extends ViewPart {
20
20
  update() {
21
21
  let didChange = false;
22
22
  const options = this._context.configuration.options;
23
- const layoutInfo = options.get(166 /* EditorOption.layoutInfo */);
23
+ const layoutInfo = options.get(169 /* EditorOption.layoutInfo */);
24
24
  const newContentWidth = layoutInfo.contentWidth - layoutInfo.verticalScrollbarWidth;
25
25
  if (this.contentWidth !== newContentWidth) {
26
26
  this.contentWidth = newContentWidth;
@@ -26,6 +26,14 @@ export class ViewContentWidgets extends ViewPart {
26
26
  }
27
27
  dispose() {
28
28
  super.dispose();
29
+ // Widgets outlive the view, so detach their dom nodes to not keep this view's DOM alive (#146841)
30
+ for (const widget of Object.values(this._widgets)) {
31
+ const domNode = widget.domNode.domNode;
32
+ if (domNode.parentElement === this.domNode.domNode || domNode.parentElement === this.overflowingContentWidgetsDomNode.domNode) {
33
+ domNode.remove();
34
+ domNode.removeAttribute('monaco-visible-content-widget');
35
+ }
36
+ }
29
37
  this._widgets = {};
30
38
  }
31
39
  // --- begin event handlers
@@ -134,7 +142,7 @@ class Widget {
134
142
  this._viewDomNode = viewDomNode;
135
143
  this._actual = actual;
136
144
  const options = this._context.configuration.options;
137
- const layoutInfo = options.get(166 /* EditorOption.layoutInfo */);
145
+ const layoutInfo = options.get(169 /* EditorOption.layoutInfo */);
138
146
  const allowOverflow = options.get(4 /* EditorOption.allowOverflow */);
139
147
  this.domNode = createFastDomNode(this._actual.getDomNode());
140
148
  this.id = this._actual.getId();
@@ -159,8 +167,8 @@ class Widget {
159
167
  }
160
168
  onConfigurationChanged(e) {
161
169
  const options = this._context.configuration.options;
162
- if (e.hasChanged(166 /* EditorOption.layoutInfo */)) {
163
- const layoutInfo = options.get(166 /* EditorOption.layoutInfo */);
170
+ if (e.hasChanged(169 /* EditorOption.layoutInfo */)) {
171
+ const layoutInfo = options.get(169 /* EditorOption.layoutInfo */);
164
172
  this._contentLeft = layoutInfo.contentLeft;
165
173
  this._contentWidth = layoutInfo.contentWidth;
166
174
  this._maxWidth = this._getMaxWidth();
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts","vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,GAAG,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAe,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAEzF,OAAO,EAAmB,gBAAgB,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAWrF;;;;GAIG;AACH,MAAM,OAAO,kBAAmB,SAAQ,QAAQ;IAQ/C,YAAY,OAAoB,EAAE,WAAqC;QACtE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QAEnB,IAAI,CAAC,OAAO,GAAG,iBAAiB,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;QAChE,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,yCAAiC,CAAC;QACrE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;QAC5C,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAEvB,IAAI,CAAC,gCAAgC,GAAG,iBAAiB,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;QACzF,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,gCAAgC,oDAA4C,CAAC;QACzG,IAAI,CAAC,gCAAgC,CAAC,Y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B,CAAC;CACL;AAED,MAAM,gBAAgB;IAGrB,YACiB,GAAW,EACX,IAAY,EACZ,MAAc;QAFd,QAAG,GAAH,GAAG,CAAQ;QACX,SAAI,GAAJ,IAAI,CAAQ;QACZ,WAAM,GAAN,MAAM,CAAQ;QAL/B,2BAAsB,GAAS,SAAS,CAAC;IAMrC,CAAC;CACL;AAED,8DAA8D;AAC9D,SAAS,UAAU,CAAoC,EAAK,EAAE,OAA6B,EAAE,GAAG,IAAmB;IAClH,IAAI,CAAC;QACJ,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IAClC,CAAC;IAAC,MAAM,CAAC;QACR,SAAS;QACT,OAAO,IAAI,CAAC;IACb,CAAC;AACF,CAAC","file":"contentWidgets.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 { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js';\nimport { ContentWidgetPositionPreference, IContentWidget, IContentWidgetRenderedCoordinate } from '../../editorBrowser.js';\nimport { PartFingerprint, PartFingerprints, ViewPart } from '../../view/viewPart.js';\nimport { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js';\nimport { ViewContext } from '../../../common/viewModel/viewContext.js';\nimport * as viewEvents from '../../../common/viewEvents.js';\nimport { ViewportData } from '../../../common/viewLayout/viewLinesViewportData.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { IDimension } from '../../../common/core/2d/dimension.js';\nimport { PositionAffinity } from '../../../common/model.js';\nimport { IPosition, Position } from '../../../common/core/position.js';\nimport { IViewModel } from '../../../common/viewModel.js';\n\n/**\n * This view part is responsible for rendering the content widgets, which are\n * used for rendering elements that are associated to an editor position,\n * such as suggestions or the parameter hints.\n */\nexport class ViewContentWidgets extends ViewPart {\n\n\tprivate readonly _viewDomNode: FastDomNode<HTMLElement>;\n\tprivate _widgets: { [key: string]: Widget };\n\n\tpublic domNode: FastDomNode<HTMLElement>;\n\tpublic overflowingContentWidgetsDomNode: FastDomNode<HTMLElement>;\n\n\tconstructor(context: ViewContext, viewDomNode: FastDomNode<HTMLElement>) {\n\t\tsuper(context);\n\t\tthis._viewDomNode = viewDomNode;\n\t\tthis._widgets = {};\n\n\t\tthis.domNode = createFastDomNode(document.createElement('div'));\n\t\tPartFingerprints.write(this.domNode, PartFingerprint.ContentWidgets);\n\t\tthis.domNode.setClassName('contentWidgets');\n\t\tthis.domNode.setPosition('absolute');\n\t\tthis.domNode.setTop(0);\n\n\t\tthis.overflowingContentWidgetsDomNode = createFastDomNode(document.createElement('div'));\n\t\tPartFingerprints.write(this.overflowingContentWidgetsDomNode, PartFingerprint.OverflowingContentWidgets);\n\t\tthis.overflowingContentWidgetsDomNode.setClassName('overflowingContentWidgets');\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._widgets = {};\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].onConfigurationChanged(e);\n\t\t}\n\t\treturn true;\n\t}\n\tpublic override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\t// true for inline decorations that can end up relayouting text\n\t\treturn true;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLineMappingChanged(e: viewEvents.ViewLineMappingChangedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// ---- end view event handlers\n\n\tprivate _updateAnchorsViewPositions(): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].updateAnchorViewPosition();\n\t\t}\n\t}\n\n\tpublic addWidget(_widget: IContentWidget): void {\n\t\tconst myWidget = new Widget(this._context, this._viewDomNode, _widget);\n\t\tthis._widgets[myWidget.id] = myWidget;\n\n\t\tif (myWidget.allowEditorOverflow) {\n\t\t\tthis.overflowingContentWidgetsDomNode.appendChild(myWidget.domNode);\n\t\t} else {\n\t\t\tthis.domNode.appendChild(myWidget.domNode);\n\t\t}\n\n\t\tthis.setShouldRender();\n\t}\n\n\tpublic setWidgetPosition(widget: IContentWidget, primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null, preference: ContentWidgetPositionPreference[] | null, affinity: PositionAffinity | null): void {\n\t\tconst myWidget = this._widgets[widget.getId()];\n\t\tmyWidget.setPosition(primaryAnchor, secondaryAnchor, preference, affinity);\n\n\t\tif (!myWidget.useDisplayNone) {\n\t\t\tthis.setShouldRender();\n\t\t}\n\t}\n\n\tpublic removeWidget(widget: IContentWidget): void {\n\t\tconst widgetId = widget.getId();\n\t\tif (this._widgets.hasOwnProperty(widgetId)) {\n\t\t\tconst myWidget = this._widgets[widgetId];\n\t\t\tdelete this._widgets[widgetId];\n\n\t\t\tconst domNode = myWidget.domNode.domNode;\n\t\t\tdomNode.remove();\n\t\t\tdomNode.removeAttribute('monaco-visible-content-widget');\n\n\t\t\tthis.setShouldRender();\n\t\t}\n\t}\n\n\tpublic shouldSuppressMouseDownOnWidget(widgetId: string): boolean {\n\t\tif (this._widgets.hasOwnProperty(widgetId)) {\n\t\t\treturn this._widgets[widgetId].suppressMouseDown;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic override onBeforeRender(viewportData: ViewportData): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].onBeforeRender(viewportData);\n\t\t}\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].prepareRender(ctx);\n\t\t}\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].render(ctx);\n\t\t}\n\t}\n}\n\ninterface IBoxLayoutResult {\n\tfitsAbove: boolean;\n\taboveTop: number;\n\n\tfitsBelow: boolean;\n\tbelowTop: number;\n\n\tleft: number;\n}\n\ninterface IOffViewportRenderData {\n\tkind: 'offViewport';\n\tpreserveFocus: boolean;\n}\n\ninterface IInViewportRenderData {\n\tkind: 'inViewport';\n\tcoordinate: Coordinate;\n\tposition: ContentWidgetPositionPreference;\n}\n\ntype IRenderData = IInViewportRenderData | IOffViewportRenderData;\n\nclass Widget {\n\tprivate readonly _context: ViewContext;\n\tprivate readonly _viewDomNode: FastDomNode<HTMLElement>;\n\tprivate readonly _actual: IContentWidget;\n\n\tpublic readonly domNode: FastDomNode<HTMLElement>;\n\tpublic readonly id: string;\n\tpublic readonly allowEditorOverflow: boolean;\n\tpublic readonly suppressMouseDown: boolean;\n\n\tprivate readonly _fixedOverflowWidgets: boolean;\n\tprivate _contentWidth: number;\n\tprivate _contentLeft: number;\n\n\tprivate _primaryAnchor: PositionPair = new PositionPair(null, null);\n\tprivate _secondaryAnchor: PositionPair = new PositionPair(null, null);\n\tprivate _affinity: PositionAffinity | null;\n\tprivate _preference: ContentWidgetPositionPreference[] | null;\n\tprivate _cachedDomNodeOffsetWidth: number;\n\tprivate _cachedDomNodeOffsetHeight: number;\n\tprivate _maxWidth: number;\n\tprivate _isVisible: boolean;\n\n\tprivate _renderData: IRenderData | null;\n\tpublic readonly useDisplayNone: boolean;\n\n\tconstructor(context: ViewContext, viewDomNode: FastDomNode<HTMLElement>, actual: IContentWidget) {\n\t\tthis._context = context;\n\t\tthis._viewDomNode = viewDomNode;\n\t\tthis._actual = actual;\n\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tconst allowOverflow = options.get(EditorOption.allowOverflow);\n\n\t\tthis.domNode = createFastDomNode(this._actual.getDomNode());\n\t\tthis.id = this._actual.getId();\n\t\tthis.allowEditorOverflow = (this._actual.allowEditorOverflow || false) && allowOverflow;\n\t\tthis.suppressMouseDown = this._actual.suppressMouseDown || false;\n\t\tthis.useDisplayNone = this._actual.useDisplayNone || false;\n\n\t\tthis._fixedOverflowWidgets = options.get(EditorOption.fixedOverflowWidgets);\n\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\tthis._contentLeft = layoutInfo.contentLeft;\n\n\t\tthis._affinity = null;\n\t\tthis._preference = [];\n\t\tthis._cachedDomNodeOffsetWidth = -1;\n\t\tthis._cachedDomNodeOffsetHeight = -1;\n\t\tthis._maxWidth = this._getMaxWidth();\n\t\tthis._isVisible = false;\n\t\tthis._renderData = null;\n\n\t\tthis.domNode.setPosition((this._fixedOverflowWidgets && this.allowEditorOverflow) ? 'fixed' : 'absolute');\n\t\tthis.domNode.setDisplay('none');\n\t\tthis.domNode.setVisibility('hidden');\n\t\tthis.domNode.setAttribute('widgetId', this.id);\n\t\tthis.domNode.setMaxWidth(this._maxWidth);\n\t}\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): void {\n\t\tconst options = this._context.configuration.options;\n\t\tif (e.hasChanged(EditorOption.layoutInfo)) {\n\t\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\t\tthis._contentLeft = layoutInfo.contentLeft;\n\t\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\t\tthis._maxWidth = this._getMaxWidth();\n\t\t}\n\t}\n\n\tpublic updateAnchorViewPosition(): void {\n\t\tthis._setPosition(this._affinity, this._primaryAnchor.modelPosition, this._secondaryAnchor.modelPosition);\n\t}\n\n\tprivate _setPosition(affinity: PositionAffinity | null, primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null): void {\n\t\tthis._affinity = affinity;\n\t\tthis._primaryAnchor = getValidPositionPair(primaryAnchor, this._context.viewModel, this._affinity);\n\t\tthis._secondaryAnchor = getValidPositionPair(secondaryAnchor, this._context.viewModel, this._affinity);\n\n\t\tfunction getValidPositionPair(position: IPosition | null, viewModel: IViewModel, affinity: PositionAffinity | null): PositionPair {\n\t\t\tif (!position) {\n\t\t\t\treturn new PositionPair(null, null);\n\t\t\t}\n\t\t\t// Do not trust that widgets give a valid position\n\t\t\tconst validModelPosition = viewModel.model.validatePosition(position);\n\t\t\tif (viewModel.coordinatesConverter.modelPositionIsVisible(validModelPosition)) {\n\t\t\t\tconst viewPosition = viewModel.coordinatesConverter.convertModelPositionToViewPosition(validModelPosition, affinity ?? undefined);\n\t\t\t\treturn new PositionPair(position, viewPosition);\n\t\t\t}\n\t\t\treturn new PositionPair(position, null);\n\t\t}\n\t}\n\n\tprivate _getMaxWidth(): number {\n\t\tconst elDocument = this.domNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\treturn (\n\t\t\tthis.allowEditorOverflow\n\t\t\t\t? elWindow?.innerWidth || elDocument.documentElement.offsetWidth || elDocument.body.offsetWidth\n\t\t\t\t: this._contentWidth\n\t\t);\n\t}\n\n\tpublic setPosition(primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null, preference: ContentWidgetPositionPreference[] | null, affinity: PositionAffinity | null): void {\n\t\tthis._setPosition(affinity, primaryAnchor, secondaryAnchor);\n\t\tthis._preference = preference;\n\t\tif (!this.useDisplayNone && this._primaryAnchor.viewPosition && this._preference && this._preference.length > 0) {\n\t\t\t// this content widget would like to be visible if possible\n\t\t\t// we change it from `display:none` to `display:block` even if it\n\t\t\t// might be outside the viewport such that we can measure its size\n\t\t\t// in `prepareRender`\n\t\t\tthis.domNode.setDisplay('block');\n\t\t} else {\n\t\t\tthis.domNode.setDisplay('none');\n\t\t}\n\t\tthis._cachedDomNodeOffsetWidth = -1;\n\t\tthis._cachedDomNodeOffsetHeight = -1;\n\t}\n\n\tprivate _layoutBoxInViewport(anchor: AnchorCoordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult {\n\t\t// Our visible box is split horizontally by the current line => 2 boxes\n\n\t\t// a) the box above the line\n\t\tconst aboveLineTop = anchor.top;\n\t\tconst heightAvailableAboveLine = aboveLineTop;\n\n\t\t// b) the box under the line\n\t\tconst underLineTop = anchor.top + anchor.height;\n\t\tconst heightAvailableUnderLine = ctx.viewportHeight - underLineTop;\n\n\t\tconst aboveTop = aboveLineTop - height;\n\t\tconst fitsAbove = (heightAvailableAboveLine >= height);\n\t\tconst belowTop = underLineTop;\n\t\tconst fitsBelow = (heightAvailableUnderLine >= height);\n\n\t\t// And its left\n\t\tlet left = anchor.left;\n\t\tif (left + width > ctx.scrollLeft + ctx.viewportWidth) {\n\t\t\tleft = ctx.scrollLeft + ctx.viewportWidth - width;\n\t\t}\n\t\tif (left < ctx.scrollLeft) {\n\t\t\tleft = ctx.scrollLeft;\n\t\t}\n\n\t\treturn { fitsAbove, aboveTop, fitsBelow, belowTop, left };\n\t}\n\n\tprivate _layoutHorizontalSegmentInPage(windowSize: dom.Dimension, domNodePosition: dom.IDomNodePagePosition, left: number, width: number): [number, number] {\n\t\t// Leave some clearance to the left/right\n\t\tconst LEFT_PADDING = 15;\n\t\tconst RIGHT_PADDING = 15;\n\n\t\t// Initially, the limits are defined as the dom node limits\n\t\tconst MIN_LIMIT = Math.max(LEFT_PADDING, domNodePosition.left - width);\n\t\tconst MAX_LIMIT = Math.min(domNodePosition.left + domNodePosition.width + width, windowSize.width - RIGHT_PADDING);\n\n\t\tconst elDocument = this._viewDomNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\tlet absoluteLeft = domNodePosition.left + left - (elWindow?.scrollX ?? 0);\n\n\t\tif (absoluteLeft + width > MAX_LIMIT) {\n\t\t\tconst delta = absoluteLeft - (MAX_LIMIT - width);\n\t\t\tabsoluteLeft -= delta;\n\t\t\tleft -= delta;\n\t\t}\n\n\t\tif (absoluteLeft < MIN_LIMIT) {\n\t\t\tconst delta = absoluteLeft - MIN_LIMIT;\n\t\t\tabsoluteLeft -= delta;\n\t\t\tleft -= delta;\n\t\t}\n\n\t\treturn [left, absoluteLeft];\n\t}\n\n\tprivate _layoutBoxInPage(anchor: AnchorCoordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult | null {\n\t\tconst aboveTop = anchor.top - height;\n\t\tconst belowTop = anchor.top + anchor.height;\n\n\t\tconst domNodePosition = dom.getDomNodePagePosition(this._viewDomNode.domNode);\n\t\tconst elDocument = this._viewDomNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\tconst absoluteAboveTop = domNodePosition.top + aboveTop - (elWindow?.scrollY ?? 0);\n\t\tconst absoluteBelowTop = domNodePosition.top + belowTop - (elWindow?.scrollY ?? 0);\n\n\t\tconst windowSize = dom.getClientArea(elDocument.body);\n\t\tconst [left, absoluteAboveLeft] = this._layoutHorizontalSegmentInPage(windowSize, domNodePosition, anchor.left - ctx.scrollLeft + this._contentLeft, width);\n\n\t\t// Leave some clearance to the top/bottom\n\t\tconst TOP_PADDING = 22;\n\t\tconst BOTTOM_PADDING = 22;\n\n\t\tconst fitsAbove = (absoluteAboveTop >= TOP_PADDING);\n\t\tconst fitsBelow = (absoluteBelowTop + height <= windowSize.height - BOTTOM_PADDING);\n\n\t\tif (this._fixedOverflowWidgets) {\n\t\t\treturn {\n\t\t\t\tfitsAbove,\n\t\t\t\taboveTop: Math.max(absoluteAboveTop, TOP_PADDING),\n\t\t\t\tfitsBelow,\n\t\t\t\tbelowTop: absoluteBelowTop,\n\t\t\t\tleft: absoluteAboveLeft\n\t\t\t};\n\t\t}\n\n\t\treturn { fitsAbove, aboveTop, fitsBelow, belowTop, left };\n\t}\n\n\tprivate _prepareRenderWidgetAtExactPositionOverflowing(topLeft: Coordinate): Coordinate {\n\t\treturn new Coordinate(topLeft.top, topLeft.left + this._contentLeft);\n\t}\n\n\t/**\n\t * Compute the coordinates above and below the primary and secondary anchors.\n\t * The content widget *must* touch the primary anchor.\n\t * The content widget should touch if possible the secondary anchor.\n\t */\n\tprivate _getAnchorsCoordinates(ctx: RenderingContext): { primary: AnchorCoordinate | null; secondary: AnchorCoordinate | null } {\n\t\tconst primary = getCoordinates(this._primaryAnchor.viewPosition, this._affinity);\n\t\tconst secondaryViewPosition = (this._secondaryAnchor.viewPosition?.lineNumber === this._primaryAnchor.viewPosition?.lineNumber ? this._secondaryAnchor.viewPosition : null);\n\t\tconst secondary = getCoordinates(secondaryViewPosition, this._affinity);\n\t\treturn { primary, secondary };\n\n\t\tfunction getCoordinates(position: Position | null, affinity: PositionAffinity | null): AnchorCoordinate | null {\n\t\t\tif (!position) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst horizontalPosition = ctx.visibleRangeForPosition(position);\n\t\t\tif (!horizontalPosition) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Left-align widgets that should appear :before content\n\t\t\tconst left = (position.column === 1 && affinity === PositionAffinity.LeftOfInjectedText ? 0 : horizontalPosition.left);\n\t\t\tconst top = ctx.getVerticalOffsetForLineNumber(position.lineNumber) - ctx.scrollTop;\n\t\t\tconst lineHeight = ctx.getLineHeightForLineNumber(position.lineNumber);\n\t\t\treturn new AnchorCoordinate(top, left, lineHeight);\n\t\t}\n\t}\n\n\tprivate _reduceAnchorCoordinates(primary: AnchorCoordinate, secondary: AnchorCoordinate | null, width: number): AnchorCoordinate {\n\t\tif (!secondary) {\n\t\t\treturn primary;\n\t\t}\n\n\t\tconst fontInfo = this._context.configuration.options.get(EditorOption.fontInfo);\n\n\t\tlet left = secondary.left;\n\t\tif (left < primary.left) {\n\t\t\tleft = Math.max(left, primary.left - width + fontInfo.typicalFullwidthCharacterWidth);\n\t\t} else {\n\t\t\tleft = Math.min(left, primary.left + width - fontInfo.typicalFullwidthCharacterWidth);\n\t\t}\n\t\treturn new AnchorCoordinate(primary.top, left, primary.height);\n\t}\n\n\tprivate _prepareRenderWidget(ctx: RenderingContext): IRenderData | null {\n\t\tif (!this._preference || this._preference.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { primary, secondary } = this._getAnchorsCoordinates(ctx);\n\t\tif (!primary) {\n\t\t\treturn {\n\t\t\t\tkind: 'offViewport',\n\t\t\t\tpreserveFocus: this.domNode.domNode.contains(this.domNode.domNode.ownerDocument.activeElement)\n\t\t\t};\n\t\t\t// return null;\n\t\t}\n\n\t\tif (this._cachedDomNodeOffsetWidth === -1 || this._cachedDomNodeOffsetHeight === -1) {\n\n\t\t\tlet preferredDimensions: IDimension | null = null;\n\t\t\tif (typeof this._actual.beforeRender === 'function') {\n\t\t\t\tpreferredDimensions = safeInvoke(this._actual.beforeRender, this._actual);\n\t\t\t}\n\t\t\tif (preferredDimensions) {\n\t\t\t\tthis._cachedDomNodeOffsetWidth = preferredDimensions.width;\n\t\t\t\tthis._cachedDomNodeOffsetHeight = preferredDimensions.height;\n\t\t\t} else {\n\t\t\t\tconst domNode = this.domNode.domNode;\n\t\t\t\tconst clientRect = domNode.getBoundingClientRect();\n\t\t\t\tthis._cachedDomNodeOffsetWidth = Math.round(clientRect.width);\n\t\t\t\tthis._cachedDomNodeOffsetHeight = Math.round(clientRect.height);\n\t\t\t}\n\t\t}\n\n\t\tconst anchor = this._reduceAnchorCoordinates(primary, secondary, this._cachedDomNodeOffsetWidth);\n\n\t\tlet placement: IBoxLayoutResult | null;\n\t\tif (this.allowEditorOverflow) {\n\t\t\tplacement = this._layoutBoxInPage(anchor, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, ctx);\n\t\t} else {\n\t\t\tplacement = this._layoutBoxInViewport(anchor, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, ctx);\n\t\t}\n\n\t\t// Do two passes, first for perfect fit, second picks first option\n\t\tfor (let pass = 1; pass <= 2; pass++) {\n\t\t\tfor (const pref of this._preference) {\n\t\t\t\t// placement\n\t\t\t\tif (pref === ContentWidgetPositionPreference.ABOVE) {\n\t\t\t\t\tif (!placement) {\n\t\t\t\t\t\t// Widget outside of viewport\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (pass === 2 || placement.fitsAbove) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(placement.aboveTop, placement.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.ABOVE\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else if (pref === ContentWidgetPositionPreference.BELOW) {\n\t\t\t\t\tif (!placement) {\n\t\t\t\t\t\t// Widget outside of viewport\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (pass === 2 || placement.fitsBelow) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(placement.belowTop, placement.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.BELOW\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (this.allowEditorOverflow) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: this._prepareRenderWidgetAtExactPositionOverflowing(new Coordinate(anchor.top, anchor.left)),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.EXACT\n\t\t\t\t\t\t};\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(anchor.top, anchor.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.EXACT\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * On this first pass, we ensure that the content widget (if it is in the viewport) has the max width set correctly.\n\t */\n\tpublic onBeforeRender(viewportData: ViewportData): void {\n\t\tif (!this._primaryAnchor.viewPosition || !this._preference) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._primaryAnchor.viewPosition.lineNumber < viewportData.startLineNumber || this._primaryAnchor.viewPosition.lineNumber > viewportData.endLineNumber) {\n\t\t\t// Outside of viewport\n\t\t\treturn;\n\t\t}\n\n\t\tthis.domNode.setMaxWidth(this._maxWidth);\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tthis._renderData = this._prepareRenderWidget(ctx);\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tif (!this._renderData || this._renderData.kind === 'offViewport') {\n\t\t\t// This widget should be invisible\n\t\t\tif (this._isVisible) {\n\t\t\t\tthis.domNode.removeAttribute('monaco-visible-content-widget');\n\t\t\t\tthis._isVisible = false;\n\n\t\t\t\tif (this._renderData?.kind === 'offViewport' && this._renderData.preserveFocus) {\n\t\t\t\t\t// widget wants to be shown, but it is outside of the viewport and it\n\t\t\t\t\t// has focus which we need to preserve\n\t\t\t\t\tthis.domNode.setTop(-1000);\n\t\t\t\t} else {\n\t\t\t\t\tthis.domNode.setVisibility('hidden');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (typeof this._actual.afterRender === 'function') {\n\t\t\t\tsafeInvoke(this._actual.afterRender, this._actual, null, null);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// This widget should be visible\n\t\tif (this.allowEditorOverflow) {\n\t\t\tthis.domNode.setTop(this._renderData.coordinate.top);\n\t\t\tthis.domNode.setLeft(this._renderData.coordinate.left);\n\t\t} else {\n\t\t\tthis.domNode.setTop(this._renderData.coordinate.top + ctx.scrollTop - ctx.bigNumbersDelta);\n\t\t\tthis.domNode.setLeft(this._renderData.coordinate.left);\n\t\t}\n\n\t\tif (!this._isVisible) {\n\t\t\tthis.domNode.setVisibility('inherit');\n\t\t\tthis.domNode.setAttribute('monaco-visible-content-widget', 'true');\n\t\t\tthis._isVisible = true;\n\t\t}\n\n\t\tif (typeof this._actual.afterRender === 'function') {\n\t\t\tsafeInvoke(this._actual.afterRender, this._actual, this._renderData.position, this._renderData.coordinate);\n\t\t}\n\t}\n}\n\nclass PositionPair {\n\tconstructor(\n\t\tpublic readonly modelPosition: IPosition | null,\n\t\tpublic readonly viewPosition: Position | null\n\t) { }\n}\n\nclass Coordinate implements IContentWidgetRenderedCoordinate {\n\t_coordinateBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly top: number,\n\t\tpublic readonly left: number\n\t) { }\n}\n\nclass AnchorCoordinate {\n\t_anchorCoordinateBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly top: number,\n\t\tpublic readonly left: number,\n\t\tpublic readonly height: number\n\t) { }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction safeInvoke<T extends (...args: any[]) => any>(fn: T, thisArg: ThisParameterType<T>, ...args: Parameters<T>): ReturnType<T> | null {\n\ttry {\n\t\treturn fn.call(thisArg, ...args);\n\t} catch {\n\t\t// ignore\n\t\treturn null;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as dom from '../../../../base/browser/dom.js';\nimport { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js';\nimport { ContentWidgetPositionPreference, IContentWidget, IContentWidgetRenderedCoordinate } from '../../editorBrowser.js';\nimport { PartFingerprint, PartFingerprints, ViewPart } from '../../view/viewPart.js';\nimport { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js';\nimport { ViewContext } from '../../../common/viewModel/viewContext.js';\nimport * as viewEvents from '../../../common/viewEvents.js';\nimport { ViewportData } from '../../../common/viewLayout/viewLinesViewportData.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { IDimension } from '../../../common/core/2d/dimension.js';\nimport { PositionAffinity } from '../../../common/model.js';\nimport { IPosition, Position } from '../../../common/core/position.js';\nimport { IViewModel } from '../../../common/viewModel.js';\n\n/**\n * This view part is responsible for rendering the content widgets, which are\n * used for rendering elements that are associated to an editor position,\n * such as suggestions or the parameter hints.\n */\nexport class ViewContentWidgets extends ViewPart {\n\n\tprivate readonly _viewDomNode: FastDomNode<HTMLElement>;\n\tprivate _widgets: { [key: string]: Widget };\n\n\tpublic domNode: FastDomNode<HTMLElement>;\n\tpublic overflowingContentWidgetsDomNode: FastDomNode<HTMLElement>;\n\n\tconstructor(context: ViewContext, viewDomNode: FastDomNode<HTMLElement>) {\n\t\tsuper(context);\n\t\tthis._viewDomNode = viewDomNode;\n\t\tthis._widgets = {};\n\n\t\tthis.domNode = createFastDomNode(document.createElement('div'));\n\t\tPartFingerprints.write(this.domNode, PartFingerprint.ContentWidgets);\n\t\tthis.domNode.setClassName('contentWidgets');\n\t\tthis.domNode.setPosition('absolute');\n\t\tthis.domNode.setTop(0);\n\n\t\tthis.overflowingContentWidgetsDomNode = createFastDomNode(document.createElement('div'));\n\t\tPartFingerprints.write(this.overflowingContentWidgetsDomNode, PartFingerprint.OverflowingContentWidgets);\n\t\tthis.overflowingContentWidgetsDomNode.setClassName('overflowingContentWidgets');\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._widgets = {};\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].onConfigurationChanged(e);\n\t\t}\n\t\treturn true;\n\t}\n\tpublic override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\t// true for inline decorations that can end up relayouting text\n\t\treturn true;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLineMappingChanged(e: viewEvents.ViewLineMappingChangedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// ---- end view event handlers\n\n\tprivate _updateAnchorsViewPositions(): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].updateAnchorViewPosition();\n\t\t}\n\t}\n\n\tpublic addWidget(_widget: IContentWidget): void {\n\t\tconst myWidget = new Widget(this._context, this._viewDomNode, _widget);\n\t\tthis._widgets[myWidget.id] = myWidget;\n\n\t\tif (myWidget.allowEditorOverflow) {\n\t\t\tthis.overflowingContentWidgetsDomNode.appendChild(myWidget.domNode);\n\t\t} else {\n\t\t\tthis.domNode.appendChild(myWidget.domNode);\n\t\t}\n\n\t\tthis.setShouldRender();\n\t}\n\n\tpublic setWidgetPosition(widget: IContentWidget, primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null, preference: ContentWidgetPositionPreference[] | null, affinity: PositionAffinity | null): void {\n\t\tconst myWidget = this._widgets[widget.getId()];\n\t\tmyWidget.setPosition(primaryAnchor, secondaryAnchor, preference, affinity);\n\n\t\tif (!myWidget.useDisplayNone) {\n\t\t\tthis.setShouldRender();\n\t\t}\n\t}\n\n\tpublic removeWidget(widget: IContentWidget): void {\n\t\tconst widgetId = widget.getId();\n\t\tif (this._widgets.hasOwnProperty(widgetId)) {\n\t\t\tconst myWidget = this._widgets[widgetId];\n\t\t\tdelete this._widgets[widgetId];\n\n\t\t\tconst domNode = myWidget.domNode.domNode;\n\t\t\tdomNode.remove();\n\t\t\tdomNode.removeAttribute('monaco-visible-content-widget');\n\n\t\t\tthis.setShouldRender();\n\t\t}\n\t}\n\n\tpublic shouldSuppressMouseDownOnWidget(widgetId: string): boolean {\n\t\tif (this._widgets.hasOwnProperty(widgetId)) {\n\t\t\treturn this._widgets[widgetId].suppressMouseDown;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic override onBeforeRender(viewportData: ViewportData): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].onBeforeRender(viewportData);\n\t\t}\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].prepareRender(ctx);\n\t\t}\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].render(ctx);\n\t\t}\n\t}\n}\n\ninterface IBoxLayoutResult {\n\tfitsAbove: boolean;\n\taboveTop: number;\n\n\tfitsBelow: boolean;\n\tbelowTop: number;\n\n\tleft: number;\n}\n\ninterface IOffViewportRenderData {\n\tkind: 'offViewport';\n\tpreserveFocus: boolean;\n}\n\ninterface IInViewportRenderData {\n\tkind: 'inViewport';\n\tcoordinate: Coordinate;\n\tposition: ContentWidgetPositionPreference;\n}\n\ntype IRenderData = IInViewportRenderData | IOffViewportRenderData;\n\nclass Widget {\n\tprivate readonly _context: ViewContext;\n\tprivate readonly _viewDomNode: FastDomNode<HTMLElement>;\n\tprivate readonly _actual: IContentWidget;\n\n\tpublic readonly domNode: FastDomNode<HTMLElement>;\n\tpublic readonly id: string;\n\tpublic readonly allowEditorOverflow: boolean;\n\tpublic readonly suppressMouseDown: boolean;\n\n\tprivate readonly _fixedOverflowWidgets: boolean;\n\tprivate _contentWidth: number;\n\tprivate _contentLeft: number;\n\n\tprivate _primaryAnchor: PositionPair = new PositionPair(null, null);\n\tprivate _secondaryAnchor: PositionPair = new PositionPair(null, null);\n\tprivate _affinity: PositionAffinity | null;\n\tprivate _preference: ContentWidgetPositionPreference[] | null;\n\tprivate _cachedDomNodeOffsetWidth: number;\n\tprivate _cachedDomNodeOffsetHeight: number;\n\tprivate _maxWidth: number;\n\tprivate _isVisible: boolean;\n\n\tprivate _renderData: IRenderData | null;\n\tpublic readonly useDisplayNone: boolean;\n\n\tconstructor(context: ViewContext, viewDomNode: FastDomNode<HTMLElement>, actual: IContentWidget) {\n\t\tthis._context = context;\n\t\tthis._viewDomNode = viewDomNode;\n\t\tthis._actual = actual;\n\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tconst allowOverflow = options.get(EditorOption.allowOverflow);\n\n\t\tthis.domNode = createFastDomNode(this._actual.getDomNode());\n\t\tthis.id = this._actual.getId();\n\t\tthis.allowEditorOverflow = (this._actual.allowEditorOverflow || false) && allowOverflow;\n\t\tthis.suppressMouseDown = this._actual.suppressMouseDown || false;\n\t\tthis.useDisplayNone = this._actual.useDisplayNone || false;\n\n\t\tthis._fixedOverflowWidgets = options.get(EditorOption.fixedOverflowWidgets);\n\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\tthis._contentLeft = layoutInfo.contentLeft;\n\n\t\tthis._affinity = null;\n\t\tthis._preference = [];\n\t\tthis._cachedDomNodeOffsetWidth = -1;\n\t\tthis._cachedDomNodeOffsetHeight = -1;\n\t\tthis._maxWidth = this._getMaxWidth();\n\t\tthis._isVisible = false;\n\t\tthis._renderData = null;\n\n\t\tthis.domNode.setPosition((this._fixedOverflowWidgets && this.allowEditorOverflow) ? 'fixed' : 'absolute');\n\t\tthis.domNode.setDisplay('none');\n\t\tthis.domNode.setVisibility('hidden');\n\t\tthis.domNode.setAttribute('widgetId', this.id);\n\t\tthis.domNode.setMaxWidth(this._maxWidth);\n\t}\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): void {\n\t\tconst options = this._context.configuration.options;\n\t\tif (e.hasChanged(EditorOption.layoutInfo)) {\n\t\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\t\tthis._contentLeft = layoutInfo.contentLeft;\n\t\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\t\tthis._maxWidth = this._getMaxWidth();\n\t\t}\n\t}\n\n\tpublic updateAnchorViewPosition(): void {\n\t\tthis._setPosition(this._affinity, this._primaryAnchor.modelPosition, this._secondaryAnchor.modelPosition);\n\t}\n\n\tprivate _setPosition(affinity: PositionAffinity | null, primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null): void {\n\t\tthis._affinity = affinity;\n\t\tthis._primaryAnchor = getValidPositionPair(primaryAnchor, this._context.viewModel, this._affinity);\n\t\tthis._secondaryAnchor = getValidPositionPair(secondaryAnchor, this._context.viewModel, this._affinity);\n\n\t\tfunction getValidPositionPair(position: IPosition | null, viewModel: IViewModel, affinity: PositionAffinity | null): PositionPair {\n\t\t\tif (!position) {\n\t\t\t\treturn new PositionPair(null, null);\n\t\t\t}\n\t\t\t// Do not trust that widgets give a valid position\n\t\t\tconst validModelPosition = viewModel.model.validatePosition(position);\n\t\t\tif (viewModel.coordinatesConverter.modelPositionIsVisible(validModelPosition)) {\n\t\t\t\tconst viewPosition = viewModel.coordinatesConverter.convertModelPositionToViewPosition(validModelPosition, affinity ?? undefined);\n\t\t\t\treturn new PositionPair(position, viewPosition);\n\t\t\t}\n\t\t\treturn new PositionPair(position, null);\n\t\t}\n\t}\n\n\tprivate _getMaxWidth(): number {\n\t\tconst elDocument = this.domNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\treturn (\n\t\t\tthis.allowEditorOverflow\n\t\t\t\t? elWindow?.innerWidth || elDocument.documentElement.offsetWidth || elDocument.body.offsetWidth\n\t\t\t\t: this._contentWidth\n\t\t);\n\t}\n\n\tpublic setPosition(primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null, preference: ContentWidgetPositionPreference[] | null, affinity: PositionAffinity | null): void {\n\t\tthis._setPosition(affinity, primaryAnchor, secondaryAnchor);\n\t\tthis._preference = preference;\n\t\tif (!this.useDisplayNone && this._primaryAnchor.viewPosition && this._preference && this._preference.length > 0) {\n\t\t\t// this content widget would like to be visible if possible\n\t\t\t// we change it from `display:none` to `display:block` even if it\n\t\t\t// might be outside the viewport such that we can measure its size\n\t\t\t// in `prepareRender`\n\t\t\tthis.domNode.setDisplay('block');\n\t\t} else {\n\t\t\tthis.domNode.setDisplay('none');\n\t\t}\n\t\tthis._cachedDomNodeOffsetWidth = -1;\n\t\tthis._cachedDomNodeOffsetHeight = -1;\n\t}\n\n\tprivate _layoutBoxInViewport(anchor: AnchorCoordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult {\n\t\t// Our visible box is split horizontally by the current line => 2 boxes\n\n\t\t// a) the box above the line\n\t\tconst aboveLineTop = anchor.top;\n\t\tconst heightAvailableAboveLine = aboveLineTop;\n\n\t\t// b) the box under the line\n\t\tconst underLineTop = anchor.top + anchor.height;\n\t\tconst heightAvailableUnderLine = ctx.viewportHeight - underLineTop;\n\n\t\tconst aboveTop = aboveLineTop - height;\n\t\tconst fitsAbove = (heightAvailableAboveLine >= height);\n\t\tconst belowTop = underLineTop;\n\t\tconst fitsBelow = (heightAvailableUnderLine >= height);\n\n\t\t// And its left\n\t\tlet left = anchor.left;\n\t\tif (left + width > ctx.scrollLeft + ctx.viewportWidth) {\n\t\t\tleft = ctx.scrollLeft + ctx.viewportWidth - width;\n\t\t}\n\t\tif (left < ctx.scrollLeft) {\n\t\t\tleft = ctx.scrollLeft;\n\t\t}\n\n\t\treturn { fitsAbove, aboveTop, fitsBelow, belowTop, left };\n\t}\n\n\tprivate _layoutHorizontalSegmentInPage(windowSize: dom.Dimension, domNodePosition: dom.IDomNodePagePosition, left: number, width: number): [number, number] {\n\t\t// Leave some clearance to the left/right\n\t\tconst LEFT_PADDING = 15;\n\t\tconst RIGHT_PADDING = 15;\n\n\t\t// Initially, the limits are defined as the dom node limits\n\t\tconst MIN_LIMIT = Math.max(LEFT_PADDING, domNodePosition.left - width);\n\t\tconst MAX_LIMIT = Math.min(domNodePosition.left + domNodePosition.width + width, windowSize.width - RIGHT_PADDING);\n\n\t\tconst elDocument = this._viewDomNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\tlet absoluteLeft = domNodePosition.left + left - (elWindow?.scrollX ?? 0);\n\n\t\tif (absoluteLeft + width > MAX_LIMIT) {\n\t\t\tconst delta = absoluteLeft - (MAX_LIMIT - width);\n\t\t\tabsoluteLeft -= delta;\n\t\t\tleft -= delta;\n\t\t}\n\n\t\tif (absoluteLeft < MIN_LIMIT) {\n\t\t\tconst delta = absoluteLeft - MIN_LIMIT;\n\t\t\tabsoluteLeft -= delta;\n\t\t\tleft -= delta;\n\t\t}\n\n\t\treturn [left, absoluteLeft];\n\t}\n\n\tprivate _layoutBoxInPage(anchor: AnchorCoordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult | null {\n\t\tconst aboveTop = anchor.top - height;\n\t\tconst belowTop = anchor.top + anchor.height;\n\n\t\tconst domNodePosition = dom.getDomNodePagePosition(this._viewDomNode.domNode);\n\t\tconst elDocument = this._viewDomNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\tconst absoluteAboveTop = domNodePosition.top + aboveTop - (elWindow?.scrollY ?? 0);\n\t\tconst absoluteBelowTop = domNodePosition.top + belowTop - (elWindow?.scrollY ?? 0);\n\n\t\tconst windowSize = dom.getClientArea(elDocument.body);\n\t\tconst [left, absoluteAboveLeft] = this._layoutHorizontalSegmentInPage(windowSize, domNodePosition, anchor.left - ctx.scrollLeft + this._contentLeft, width);\n\n\t\t// Leave some clearance to the top/bottom\n\t\tconst TOP_PADDING = 22;\n\t\tconst BOTTOM_PADDING = 22;\n\n\t\tconst fitsAbove = (absoluteAboveTop >= TOP_PADDING);\n\t\tconst fitsBelow = (absoluteBelowTop + height <= windowSize.height - BOTTOM_PADDING);\n\n\t\tif (this._fixedOverflowWidgets) {\n\t\t\treturn {\n\t\t\t\tfitsAbove,\n\t\t\t\taboveTop: Math.max(absoluteAboveTop, TOP_PADDING),\n\t\t\t\tfitsBelow,\n\t\t\t\tbelowTop: absoluteBelowTop,\n\t\t\t\tleft: absoluteAboveLeft\n\t\t\t};\n\t\t}\n\n\t\treturn { fitsAbove, aboveTop, fitsBelow, belowTop, left };\n\t}\n\n\tprivate _prepareRenderWidgetAtExactPositionOverflowing(topLeft: Coordinate): Coordinate {\n\t\treturn new Coordinate(topLeft.top, topLeft.left + this._contentLeft);\n\t}\n\n\t/**\n\t * Compute the coordinates above and below the primary and secondary anchors.\n\t * The content widget *must* touch the primary anchor.\n\t * The content widget should touch if possible the secondary anchor.\n\t */\n\tprivate _getAnchorsCoordinates(ctx: RenderingContext): { primary: AnchorCoordinate | null; secondary: AnchorCoordinate | null } {\n\t\tconst primary = getCoordinates(this._primaryAnchor.viewPosition, this._affinity);\n\t\tconst secondaryViewPosition = (this._secondaryAnchor.viewPosition?.lineNumber === this._primaryAnchor.viewPosition?.lineNumber ? this._secondaryAnchor.viewPosition : null);\n\t\tconst secondary = getCoordinates(secondaryViewPosition, this._affinity);\n\t\treturn { primary, secondary };\n\n\t\tfunction getCoordinates(position: Position | null, affinity: PositionAffinity | null): AnchorCoordinate | null {\n\t\t\tif (!position) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst horizontalPosition = ctx.visibleRangeForPosition(position);\n\t\t\tif (!horizontalPosition) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Left-align widgets that should appear :before content\n\t\t\tconst left = (position.column === 1 && affinity === PositionAffinity.LeftOfInjectedText ? 0 : horizontalPosition.left);\n\t\t\tconst top = ctx.getVerticalOffsetForLineNumber(position.lineNumber) - ctx.scrollTop;\n\t\t\tconst lineHeight = ctx.getLineHeightForLineNumber(position.lineNumber);\n\t\t\treturn new AnchorCoordinate(top, left, lineHeight);\n\t\t}\n\t}\n\n\tprivate _reduceAnchorCoordinates(primary: AnchorCoordinate, secondary: AnchorCoordinate | null, width: number): AnchorCoordinate {\n\t\tif (!secondary) {\n\t\t\treturn primary;\n\t\t}\n\n\t\tconst fontInfo = this._context.configuration.options.get(EditorOption.fontInfo);\n\n\t\tlet left = secondary.left;\n\t\tif (left < primary.left) {\n\t\t\tleft = Math.max(left, primary.left - width + fontInfo.typicalFullwidthCharacterWidth);\n\t\t} else {\n\t\t\tleft = Math.min(left, primary.left + width - fontInfo.typicalFullwidthCharacterWidth);\n\t\t}\n\t\treturn new AnchorCoordinate(primary.top, left, primary.height);\n\t}\n\n\tprivate _prepareRenderWidget(ctx: RenderingContext): IRenderData | null {\n\t\tif (!this._preference || this._preference.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { primary, secondary } = this._getAnchorsCoordinates(ctx);\n\t\tif (!primary) {\n\t\t\treturn {\n\t\t\t\tkind: 'offViewport',\n\t\t\t\tpreserveFocus: this.domNode.domNode.contains(this.domNode.domNode.ownerDocument.activeElement)\n\t\t\t};\n\t\t\t// return null;\n\t\t}\n\n\t\tif (this._cachedDomNodeOffsetWidth === -1 || this._cachedDomNodeOffsetHeight === -1) {\n\n\t\t\tlet preferredDimensions: IDimension | null = null;\n\t\t\tif (typeof this._actual.beforeRender === 'function') {\n\t\t\t\tpreferredDimensions = safeInvoke(this._actual.beforeRender, this._actual);\n\t\t\t}\n\t\t\tif (preferredDimensions) {\n\t\t\t\tthis._cachedDomNodeOffsetWidth = preferredDimensions.width;\n\t\t\t\tthis._cachedDomNodeOffsetHeight = preferredDimensions.height;\n\t\t\t} else {\n\t\t\t\tconst domNode = this.domNode.domNode;\n\t\t\t\tconst clientRect = domNode.getBoundingClientRect();\n\t\t\t\tthis._cachedDomNodeOffsetWidth = Math.round(clientRect.width);\n\t\t\t\tthis._cachedDomNodeOffsetHeight = Math.round(clientRect.height);\n\t\t\t}\n\t\t}\n\n\t\tconst anchor = this._reduceAnchorCoordinates(primary, secondary, this._cachedDomNodeOffsetWidth);\n\n\t\tlet placement: IBoxLayoutResult | null;\n\t\tif (this.allowEditorOverflow) {\n\t\t\tplacement = this._layoutBoxInPage(anchor, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, ctx);\n\t\t} else {\n\t\t\tplacement = this._layoutBoxInViewport(anchor, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, ctx);\n\t\t}\n\n\t\t// Do two passes, first for perfect fit, second picks first option\n\t\tfor (let pass = 1; pass <= 2; pass++) {\n\t\t\tfor (const pref of this._preference) {\n\t\t\t\t// placement\n\t\t\t\tif (pref === ContentWidgetPositionPreference.ABOVE) {\n\t\t\t\t\tif (!placement) {\n\t\t\t\t\t\t// Widget outside of viewport\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (pass === 2 || placement.fitsAbove) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(placement.aboveTop, placement.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.ABOVE\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else if (pref === ContentWidgetPositionPreference.BELOW) {\n\t\t\t\t\tif (!placement) {\n\t\t\t\t\t\t// Widget outside of viewport\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (pass === 2 || placement.fitsBelow) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(placement.belowTop, placement.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.BELOW\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (this.allowEditorOverflow) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: this._prepareRenderWidgetAtExactPositionOverflowing(new Coordinate(anchor.top, anchor.left)),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.EXACT\n\t\t\t\t\t\t};\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(anchor.top, anchor.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.EXACT\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * On this first pass, we ensure that the content widget (if it is in the viewport) has the max width set correctly.\n\t */\n\tpublic onBeforeRender(viewportData: ViewportData): void {\n\t\tif (!this._primaryAnchor.viewPosition || !this._preference) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._primaryAnchor.viewPosition.lineNumber < viewportData.startLineNumber || this._primaryAnchor.viewPosition.lineNumber > viewportData.endLineNumber) {\n\t\t\t// Outside of viewport\n\t\t\treturn;\n\t\t}\n\n\t\tthis.domNode.setMaxWidth(this._maxWidth);\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tthis._renderData = this._prepareRenderWidget(ctx);\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tif (!this._renderData || this._renderData.kind === 'offViewport') {\n\t\t\t// This widget should be invisible\n\t\t\tif (this._isVisible) {\n\t\t\t\tthis.domNode.removeAttribute('monaco-visible-content-widget');\n\t\t\t\tthis._isVisible = false;\n\n\t\t\t\tif (this._renderData?.kind === 'offViewport' && this._renderData.preserveFocus) {\n\t\t\t\t\t// widget wants to be shown, but it is outside of the viewport and it\n\t\t\t\t\t// has focus which we need to preserve\n\t\t\t\t\tthis.domNode.setTop(-1000);\n\t\t\t\t} else {\n\t\t\t\t\tthis.domNode.setVisibility('hidden');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (typeof this._actual.afterRender === 'function') {\n\t\t\t\tsafeInvoke(this._actual.afterRender, this._actual, null, null);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// This widget should be visible\n\t\tif (this.allowEditorOverflow) {\n\t\t\tthis.domNode.setTop(this._renderData.coordinate.top);\n\t\t\tthis.domNode.setLeft(this._renderData.coordinate.left);\n\t\t} else {\n\t\t\tthis.domNode.setTop(this._renderData.coordinate.top + ctx.scrollTop - ctx.bigNumbersDelta);\n\t\t\tthis.domNode.setLeft(this._renderData.coordinate.left);\n\t\t}\n\n\t\tif (!this._isVisible) {\n\t\t\tthis.domNode.setVisibility('inherit');\n\t\t\tthis.domNode.setAttribute('monaco-visible-content-widget', 'true');\n\t\t\tthis._isVisible = true;\n\t\t}\n\n\t\tif (typeof this._actual.afterRender === 'function') {\n\t\t\tsafeInvoke(this._actual.afterRender, this._actual, this._renderData.position, this._renderData.coordinate);\n\t\t}\n\t}\n}\n\nclass PositionPair {\n\tconstructor(\n\t\tpublic readonly modelPosition: IPosition | null,\n\t\tpublic readonly viewPosition: Position | null\n\t) { }\n}\n\nclass Coordinate implements IContentWidgetRenderedCoordinate {\n\t_coordinateBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly top: number,\n\t\tpublic readonly left: number\n\t) { }\n}\n\nclass AnchorCoordinate {\n\t_anchorCoordinateBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly top: number,\n\t\tpublic readonly left: number,\n\t\tpublic readonly height: number\n\t) { }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction safeInvoke<T extends (...args: any[]) => any>(fn: T, thisArg: ThisParameterType<T>, ...args: Parameters<T>): ReturnType<T> | null {\n\ttry {\n\t\treturn fn.call(thisArg, ...args);\n\t} catch {\n\t\t// ignore\n\t\treturn null;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts","vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,GAAG,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAe,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAEzF,OAAO,EAAmB,gBAAgB,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAWrF;;;;GAIG;AACH,MAAM,OAAO,kBAAmB,SAAQ,QAAQ;IAQ/C,YAAY,OAAoB,EAAE,WAAqC;QACtE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QAEnB,IAAI,CAAC,OAAO,GAAG,iBAAiB,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;QAChE,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,yCAAiC,CAAC;QACrE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;QAC5C,IA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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 { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js';\nimport { ContentWidgetPositionPreference, IContentWidget, IContentWidgetRenderedCoordinate } from '../../editorBrowser.js';\nimport { PartFingerprint, PartFingerprints, ViewPart } from '../../view/viewPart.js';\nimport { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js';\nimport { ViewContext } from '../../../common/viewModel/viewContext.js';\nimport * as viewEvents from '../../../common/viewEvents.js';\nimport { ViewportData } from '../../../common/viewLayout/viewLinesViewportData.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { IDimension } from '../../../common/core/2d/dimension.js';\nimport { PositionAffinity } from '../../../common/model.js';\nimport { IPosition, Position } from '../../../common/core/position.js';\nimport { IViewModel } from '../../../common/viewModel.js';\n\n/**\n * This view part is responsible for rendering the content widgets, which are\n * used for rendering elements that are associated to an editor position,\n * such as suggestions or the parameter hints.\n */\nexport class ViewContentWidgets extends ViewPart {\n\n\tprivate readonly _viewDomNode: FastDomNode<HTMLElement>;\n\tprivate _widgets: { [key: string]: Widget };\n\n\tpublic domNode: FastDomNode<HTMLElement>;\n\tpublic overflowingContentWidgetsDomNode: FastDomNode<HTMLElement>;\n\n\tconstructor(context: ViewContext, viewDomNode: FastDomNode<HTMLElement>) {\n\t\tsuper(context);\n\t\tthis._viewDomNode = viewDomNode;\n\t\tthis._widgets = {};\n\n\t\tthis.domNode = createFastDomNode(document.createElement('div'));\n\t\tPartFingerprints.write(this.domNode, PartFingerprint.ContentWidgets);\n\t\tthis.domNode.setClassName('contentWidgets');\n\t\tthis.domNode.setPosition('absolute');\n\t\tthis.domNode.setTop(0);\n\n\t\tthis.overflowingContentWidgetsDomNode = createFastDomNode(document.createElement('div'));\n\t\tPartFingerprints.write(this.overflowingContentWidgetsDomNode, PartFingerprint.OverflowingContentWidgets);\n\t\tthis.overflowingContentWidgetsDomNode.setClassName('overflowingContentWidgets');\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\t// Widgets outlive the view, so detach their dom nodes to not keep this view's DOM alive (#146841)\n\t\tfor (const widget of Object.values(this._widgets)) {\n\t\t\tconst domNode = widget.domNode.domNode;\n\t\t\tif (domNode.parentElement === this.domNode.domNode || domNode.parentElement === this.overflowingContentWidgetsDomNode.domNode) {\n\t\t\t\tdomNode.remove();\n\t\t\t\tdomNode.removeAttribute('monaco-visible-content-widget');\n\t\t\t}\n\t\t}\n\t\tthis._widgets = {};\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].onConfigurationChanged(e);\n\t\t}\n\t\treturn true;\n\t}\n\tpublic override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\t// true for inline decorations that can end up relayouting text\n\t\treturn true;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLineMappingChanged(e: viewEvents.ViewLineMappingChangedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// ---- end view event handlers\n\n\tprivate _updateAnchorsViewPositions(): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].updateAnchorViewPosition();\n\t\t}\n\t}\n\n\tpublic addWidget(_widget: IContentWidget): void {\n\t\tconst myWidget = new Widget(this._context, this._viewDomNode, _widget);\n\t\tthis._widgets[myWidget.id] = myWidget;\n\n\t\tif (myWidget.allowEditorOverflow) {\n\t\t\tthis.overflowingContentWidgetsDomNode.appendChild(myWidget.domNode);\n\t\t} else {\n\t\t\tthis.domNode.appendChild(myWidget.domNode);\n\t\t}\n\n\t\tthis.setShouldRender();\n\t}\n\n\tpublic setWidgetPosition(widget: IContentWidget, primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null, preference: ContentWidgetPositionPreference[] | null, affinity: PositionAffinity | null): void {\n\t\tconst myWidget = this._widgets[widget.getId()];\n\t\tmyWidget.setPosition(primaryAnchor, secondaryAnchor, preference, affinity);\n\n\t\tif (!myWidget.useDisplayNone) {\n\t\t\tthis.setShouldRender();\n\t\t}\n\t}\n\n\tpublic removeWidget(widget: IContentWidget): void {\n\t\tconst widgetId = widget.getId();\n\t\tif (this._widgets.hasOwnProperty(widgetId)) {\n\t\t\tconst myWidget = this._widgets[widgetId];\n\t\t\tdelete this._widgets[widgetId];\n\n\t\t\tconst domNode = myWidget.domNode.domNode;\n\t\t\tdomNode.remove();\n\t\t\tdomNode.removeAttribute('monaco-visible-content-widget');\n\n\t\t\tthis.setShouldRender();\n\t\t}\n\t}\n\n\tpublic shouldSuppressMouseDownOnWidget(widgetId: string): boolean {\n\t\tif (this._widgets.hasOwnProperty(widgetId)) {\n\t\t\treturn this._widgets[widgetId].suppressMouseDown;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic override onBeforeRender(viewportData: ViewportData): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].onBeforeRender(viewportData);\n\t\t}\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].prepareRender(ctx);\n\t\t}\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].render(ctx);\n\t\t}\n\t}\n}\n\ninterface IBoxLayoutResult {\n\tfitsAbove: boolean;\n\taboveTop: number;\n\n\tfitsBelow: boolean;\n\tbelowTop: number;\n\n\tleft: number;\n}\n\ninterface IOffViewportRenderData {\n\tkind: 'offViewport';\n\tpreserveFocus: boolean;\n}\n\ninterface IInViewportRenderData {\n\tkind: 'inViewport';\n\tcoordinate: Coordinate;\n\tposition: ContentWidgetPositionPreference;\n}\n\ntype IRenderData = IInViewportRenderData | IOffViewportRenderData;\n\nclass Widget {\n\tprivate readonly _context: ViewContext;\n\tprivate readonly _viewDomNode: FastDomNode<HTMLElement>;\n\tprivate readonly _actual: IContentWidget;\n\n\tpublic readonly domNode: FastDomNode<HTMLElement>;\n\tpublic readonly id: string;\n\tpublic readonly allowEditorOverflow: boolean;\n\tpublic readonly suppressMouseDown: boolean;\n\n\tprivate readonly _fixedOverflowWidgets: boolean;\n\tprivate _contentWidth: number;\n\tprivate _contentLeft: number;\n\n\tprivate _primaryAnchor: PositionPair = new PositionPair(null, null);\n\tprivate _secondaryAnchor: PositionPair = new PositionPair(null, null);\n\tprivate _affinity: PositionAffinity | null;\n\tprivate _preference: ContentWidgetPositionPreference[] | null;\n\tprivate _cachedDomNodeOffsetWidth: number;\n\tprivate _cachedDomNodeOffsetHeight: number;\n\tprivate _maxWidth: number;\n\tprivate _isVisible: boolean;\n\n\tprivate _renderData: IRenderData | null;\n\tpublic readonly useDisplayNone: boolean;\n\n\tconstructor(context: ViewContext, viewDomNode: FastDomNode<HTMLElement>, actual: IContentWidget) {\n\t\tthis._context = context;\n\t\tthis._viewDomNode = viewDomNode;\n\t\tthis._actual = actual;\n\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tconst allowOverflow = options.get(EditorOption.allowOverflow);\n\n\t\tthis.domNode = createFastDomNode(this._actual.getDomNode());\n\t\tthis.id = this._actual.getId();\n\t\tthis.allowEditorOverflow = (this._actual.allowEditorOverflow || false) && allowOverflow;\n\t\tthis.suppressMouseDown = this._actual.suppressMouseDown || false;\n\t\tthis.useDisplayNone = this._actual.useDisplayNone || false;\n\n\t\tthis._fixedOverflowWidgets = options.get(EditorOption.fixedOverflowWidgets);\n\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\tthis._contentLeft = layoutInfo.contentLeft;\n\n\t\tthis._affinity = null;\n\t\tthis._preference = [];\n\t\tthis._cachedDomNodeOffsetWidth = -1;\n\t\tthis._cachedDomNodeOffsetHeight = -1;\n\t\tthis._maxWidth = this._getMaxWidth();\n\t\tthis._isVisible = false;\n\t\tthis._renderData = null;\n\n\t\tthis.domNode.setPosition((this._fixedOverflowWidgets && this.allowEditorOverflow) ? 'fixed' : 'absolute');\n\t\tthis.domNode.setDisplay('none');\n\t\tthis.domNode.setVisibility('hidden');\n\t\tthis.domNode.setAttribute('widgetId', this.id);\n\t\tthis.domNode.setMaxWidth(this._maxWidth);\n\t}\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): void {\n\t\tconst options = this._context.configuration.options;\n\t\tif (e.hasChanged(EditorOption.layoutInfo)) {\n\t\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\t\tthis._contentLeft = layoutInfo.contentLeft;\n\t\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\t\tthis._maxWidth = this._getMaxWidth();\n\t\t}\n\t}\n\n\tpublic updateAnchorViewPosition(): void {\n\t\tthis._setPosition(this._affinity, this._primaryAnchor.modelPosition, this._secondaryAnchor.modelPosition);\n\t}\n\n\tprivate _setPosition(affinity: PositionAffinity | null, primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null): void {\n\t\tthis._affinity = affinity;\n\t\tthis._primaryAnchor = getValidPositionPair(primaryAnchor, this._context.viewModel, this._affinity);\n\t\tthis._secondaryAnchor = getValidPositionPair(secondaryAnchor, this._context.viewModel, this._affinity);\n\n\t\tfunction getValidPositionPair(position: IPosition | null, viewModel: IViewModel, affinity: PositionAffinity | null): PositionPair {\n\t\t\tif (!position) {\n\t\t\t\treturn new PositionPair(null, null);\n\t\t\t}\n\t\t\t// Do not trust that widgets give a valid position\n\t\t\tconst validModelPosition = viewModel.model.validatePosition(position);\n\t\t\tif (viewModel.coordinatesConverter.modelPositionIsVisible(validModelPosition)) {\n\t\t\t\tconst viewPosition = viewModel.coordinatesConverter.convertModelPositionToViewPosition(validModelPosition, affinity ?? undefined);\n\t\t\t\treturn new PositionPair(position, viewPosition);\n\t\t\t}\n\t\t\treturn new PositionPair(position, null);\n\t\t}\n\t}\n\n\tprivate _getMaxWidth(): number {\n\t\tconst elDocument = this.domNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\treturn (\n\t\t\tthis.allowEditorOverflow\n\t\t\t\t? elWindow?.innerWidth || elDocument.documentElement.offsetWidth || elDocument.body.offsetWidth\n\t\t\t\t: this._contentWidth\n\t\t);\n\t}\n\n\tpublic setPosition(primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null, preference: ContentWidgetPositionPreference[] | null, affinity: PositionAffinity | null): void {\n\t\tthis._setPosition(affinity, primaryAnchor, secondaryAnchor);\n\t\tthis._preference = preference;\n\t\tif (!this.useDisplayNone && this._primaryAnchor.viewPosition && this._preference && this._preference.length > 0) {\n\t\t\t// this content widget would like to be visible if possible\n\t\t\t// we change it from `display:none` to `display:block` even if it\n\t\t\t// might be outside the viewport such that we can measure its size\n\t\t\t// in `prepareRender`\n\t\t\tthis.domNode.setDisplay('block');\n\t\t} else {\n\t\t\tthis.domNode.setDisplay('none');\n\t\t}\n\t\tthis._cachedDomNodeOffsetWidth = -1;\n\t\tthis._cachedDomNodeOffsetHeight = -1;\n\t}\n\n\tprivate _layoutBoxInViewport(anchor: AnchorCoordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult {\n\t\t// Our visible box is split horizontally by the current line => 2 boxes\n\n\t\t// a) the box above the line\n\t\tconst aboveLineTop = anchor.top;\n\t\tconst heightAvailableAboveLine = aboveLineTop;\n\n\t\t// b) the box under the line\n\t\tconst underLineTop = anchor.top + anchor.height;\n\t\tconst heightAvailableUnderLine = ctx.viewportHeight - underLineTop;\n\n\t\tconst aboveTop = aboveLineTop - height;\n\t\tconst fitsAbove = (heightAvailableAboveLine >= height);\n\t\tconst belowTop = underLineTop;\n\t\tconst fitsBelow = (heightAvailableUnderLine >= height);\n\n\t\t// And its left\n\t\tlet left = anchor.left;\n\t\tif (left + width > ctx.scrollLeft + ctx.viewportWidth) {\n\t\t\tleft = ctx.scrollLeft + ctx.viewportWidth - width;\n\t\t}\n\t\tif (left < ctx.scrollLeft) {\n\t\t\tleft = ctx.scrollLeft;\n\t\t}\n\n\t\treturn { fitsAbove, aboveTop, fitsBelow, belowTop, left };\n\t}\n\n\tprivate _layoutHorizontalSegmentInPage(windowSize: dom.Dimension, domNodePosition: dom.IDomNodePagePosition, left: number, width: number): [number, number] {\n\t\t// Leave some clearance to the left/right\n\t\tconst LEFT_PADDING = 15;\n\t\tconst RIGHT_PADDING = 15;\n\n\t\t// Initially, the limits are defined as the dom node limits\n\t\tconst MIN_LIMIT = Math.max(LEFT_PADDING, domNodePosition.left - width);\n\t\tconst MAX_LIMIT = Math.min(domNodePosition.left + domNodePosition.width + width, windowSize.width - RIGHT_PADDING);\n\n\t\tconst elDocument = this._viewDomNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\tlet absoluteLeft = domNodePosition.left + left - (elWindow?.scrollX ?? 0);\n\n\t\tif (absoluteLeft + width > MAX_LIMIT) {\n\t\t\tconst delta = absoluteLeft - (MAX_LIMIT - width);\n\t\t\tabsoluteLeft -= delta;\n\t\t\tleft -= delta;\n\t\t}\n\n\t\tif (absoluteLeft < MIN_LIMIT) {\n\t\t\tconst delta = absoluteLeft - MIN_LIMIT;\n\t\t\tabsoluteLeft -= delta;\n\t\t\tleft -= delta;\n\t\t}\n\n\t\treturn [left, absoluteLeft];\n\t}\n\n\tprivate _layoutBoxInPage(anchor: AnchorCoordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult | null {\n\t\tconst aboveTop = anchor.top - height;\n\t\tconst belowTop = anchor.top + anchor.height;\n\n\t\tconst domNodePosition = dom.getDomNodePagePosition(this._viewDomNode.domNode);\n\t\tconst elDocument = this._viewDomNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\tconst absoluteAboveTop = domNodePosition.top + aboveTop - (elWindow?.scrollY ?? 0);\n\t\tconst absoluteBelowTop = domNodePosition.top + belowTop - (elWindow?.scrollY ?? 0);\n\n\t\tconst windowSize = dom.getClientArea(elDocument.body);\n\t\tconst [left, absoluteAboveLeft] = this._layoutHorizontalSegmentInPage(windowSize, domNodePosition, anchor.left - ctx.scrollLeft + this._contentLeft, width);\n\n\t\t// Leave some clearance to the top/bottom\n\t\tconst TOP_PADDING = 22;\n\t\tconst BOTTOM_PADDING = 22;\n\n\t\tconst fitsAbove = (absoluteAboveTop >= TOP_PADDING);\n\t\tconst fitsBelow = (absoluteBelowTop + height <= windowSize.height - BOTTOM_PADDING);\n\n\t\tif (this._fixedOverflowWidgets) {\n\t\t\treturn {\n\t\t\t\tfitsAbove,\n\t\t\t\taboveTop: Math.max(absoluteAboveTop, TOP_PADDING),\n\t\t\t\tfitsBelow,\n\t\t\t\tbelowTop: absoluteBelowTop,\n\t\t\t\tleft: absoluteAboveLeft\n\t\t\t};\n\t\t}\n\n\t\treturn { fitsAbove, aboveTop, fitsBelow, belowTop, left };\n\t}\n\n\tprivate _prepareRenderWidgetAtExactPositionOverflowing(topLeft: Coordinate): Coordinate {\n\t\treturn new Coordinate(topLeft.top, topLeft.left + this._contentLeft);\n\t}\n\n\t/**\n\t * Compute the coordinates above and below the primary and secondary anchors.\n\t * The content widget *must* touch the primary anchor.\n\t * The content widget should touch if possible the secondary anchor.\n\t */\n\tprivate _getAnchorsCoordinates(ctx: RenderingContext): { primary: AnchorCoordinate | null; secondary: AnchorCoordinate | null } {\n\t\tconst primary = getCoordinates(this._primaryAnchor.viewPosition, this._affinity);\n\t\tconst secondaryViewPosition = (this._secondaryAnchor.viewPosition?.lineNumber === this._primaryAnchor.viewPosition?.lineNumber ? this._secondaryAnchor.viewPosition : null);\n\t\tconst secondary = getCoordinates(secondaryViewPosition, this._affinity);\n\t\treturn { primary, secondary };\n\n\t\tfunction getCoordinates(position: Position | null, affinity: PositionAffinity | null): AnchorCoordinate | null {\n\t\t\tif (!position) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst horizontalPosition = ctx.visibleRangeForPosition(position);\n\t\t\tif (!horizontalPosition) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Left-align widgets that should appear :before content\n\t\t\tconst left = (position.column === 1 && affinity === PositionAffinity.LeftOfInjectedText ? 0 : horizontalPosition.left);\n\t\t\tconst top = ctx.getVerticalOffsetForLineNumber(position.lineNumber) - ctx.scrollTop;\n\t\t\tconst lineHeight = ctx.getLineHeightForLineNumber(position.lineNumber);\n\t\t\treturn new AnchorCoordinate(top, left, lineHeight);\n\t\t}\n\t}\n\n\tprivate _reduceAnchorCoordinates(primary: AnchorCoordinate, secondary: AnchorCoordinate | null, width: number): AnchorCoordinate {\n\t\tif (!secondary) {\n\t\t\treturn primary;\n\t\t}\n\n\t\tconst fontInfo = this._context.configuration.options.get(EditorOption.fontInfo);\n\n\t\tlet left = secondary.left;\n\t\tif (left < primary.left) {\n\t\t\tleft = Math.max(left, primary.left - width + fontInfo.typicalFullwidthCharacterWidth);\n\t\t} else {\n\t\t\tleft = Math.min(left, primary.left + width - fontInfo.typicalFullwidthCharacterWidth);\n\t\t}\n\t\treturn new AnchorCoordinate(primary.top, left, primary.height);\n\t}\n\n\tprivate _prepareRenderWidget(ctx: RenderingContext): IRenderData | null {\n\t\tif (!this._preference || this._preference.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { primary, secondary } = this._getAnchorsCoordinates(ctx);\n\t\tif (!primary) {\n\t\t\treturn {\n\t\t\t\tkind: 'offViewport',\n\t\t\t\tpreserveFocus: this.domNode.domNode.contains(this.domNode.domNode.ownerDocument.activeElement)\n\t\t\t};\n\t\t\t// return null;\n\t\t}\n\n\t\tif (this._cachedDomNodeOffsetWidth === -1 || this._cachedDomNodeOffsetHeight === -1) {\n\n\t\t\tlet preferredDimensions: IDimension | null = null;\n\t\t\tif (typeof this._actual.beforeRender === 'function') {\n\t\t\t\tpreferredDimensions = safeInvoke(this._actual.beforeRender, this._actual);\n\t\t\t}\n\t\t\tif (preferredDimensions) {\n\t\t\t\tthis._cachedDomNodeOffsetWidth = preferredDimensions.width;\n\t\t\t\tthis._cachedDomNodeOffsetHeight = preferredDimensions.height;\n\t\t\t} else {\n\t\t\t\tconst domNode = this.domNode.domNode;\n\t\t\t\tconst clientRect = domNode.getBoundingClientRect();\n\t\t\t\tthis._cachedDomNodeOffsetWidth = Math.round(clientRect.width);\n\t\t\t\tthis._cachedDomNodeOffsetHeight = Math.round(clientRect.height);\n\t\t\t}\n\t\t}\n\n\t\tconst anchor = this._reduceAnchorCoordinates(primary, secondary, this._cachedDomNodeOffsetWidth);\n\n\t\tlet placement: IBoxLayoutResult | null;\n\t\tif (this.allowEditorOverflow) {\n\t\t\tplacement = this._layoutBoxInPage(anchor, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, ctx);\n\t\t} else {\n\t\t\tplacement = this._layoutBoxInViewport(anchor, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, ctx);\n\t\t}\n\n\t\t// Do two passes, first for perfect fit, second picks first option\n\t\tfor (let pass = 1; pass <= 2; pass++) {\n\t\t\tfor (const pref of this._preference) {\n\t\t\t\t// placement\n\t\t\t\tif (pref === ContentWidgetPositionPreference.ABOVE) {\n\t\t\t\t\tif (!placement) {\n\t\t\t\t\t\t// Widget outside of viewport\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (pass === 2 || placement.fitsAbove) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(placement.aboveTop, placement.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.ABOVE\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else if (pref === ContentWidgetPositionPreference.BELOW) {\n\t\t\t\t\tif (!placement) {\n\t\t\t\t\t\t// Widget outside of viewport\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (pass === 2 || placement.fitsBelow) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(placement.belowTop, placement.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.BELOW\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (this.allowEditorOverflow) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: this._prepareRenderWidgetAtExactPositionOverflowing(new Coordinate(anchor.top, anchor.left)),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.EXACT\n\t\t\t\t\t\t};\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(anchor.top, anchor.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.EXACT\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * On this first pass, we ensure that the content widget (if it is in the viewport) has the max width set correctly.\n\t */\n\tpublic onBeforeRender(viewportData: ViewportData): void {\n\t\tif (!this._primaryAnchor.viewPosition || !this._preference) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._primaryAnchor.viewPosition.lineNumber < viewportData.startLineNumber || this._primaryAnchor.viewPosition.lineNumber > viewportData.endLineNumber) {\n\t\t\t// Outside of viewport\n\t\t\treturn;\n\t\t}\n\n\t\tthis.domNode.setMaxWidth(this._maxWidth);\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tthis._renderData = this._prepareRenderWidget(ctx);\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tif (!this._renderData || this._renderData.kind === 'offViewport') {\n\t\t\t// This widget should be invisible\n\t\t\tif (this._isVisible) {\n\t\t\t\tthis.domNode.removeAttribute('monaco-visible-content-widget');\n\t\t\t\tthis._isVisible = false;\n\n\t\t\t\tif (this._renderData?.kind === 'offViewport' && this._renderData.preserveFocus) {\n\t\t\t\t\t// widget wants to be shown, but it is outside of the viewport and it\n\t\t\t\t\t// has focus which we need to preserve\n\t\t\t\t\tthis.domNode.setTop(-1000);\n\t\t\t\t} else {\n\t\t\t\t\tthis.domNode.setVisibility('hidden');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (typeof this._actual.afterRender === 'function') {\n\t\t\t\tsafeInvoke(this._actual.afterRender, this._actual, null, null);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// This widget should be visible\n\t\tif (this.allowEditorOverflow) {\n\t\t\tthis.domNode.setTop(this._renderData.coordinate.top);\n\t\t\tthis.domNode.setLeft(this._renderData.coordinate.left);\n\t\t} else {\n\t\t\tthis.domNode.setTop(this._renderData.coordinate.top + ctx.scrollTop - ctx.bigNumbersDelta);\n\t\t\tthis.domNode.setLeft(this._renderData.coordinate.left);\n\t\t}\n\n\t\tif (!this._isVisible) {\n\t\t\tthis.domNode.setVisibility('inherit');\n\t\t\tthis.domNode.setAttribute('monaco-visible-content-widget', 'true');\n\t\t\tthis._isVisible = true;\n\t\t}\n\n\t\tif (typeof this._actual.afterRender === 'function') {\n\t\t\tsafeInvoke(this._actual.afterRender, this._actual, this._renderData.position, this._renderData.coordinate);\n\t\t}\n\t}\n}\n\nclass PositionPair {\n\tconstructor(\n\t\tpublic readonly modelPosition: IPosition | null,\n\t\tpublic readonly viewPosition: Position | null\n\t) { }\n}\n\nclass Coordinate implements IContentWidgetRenderedCoordinate {\n\t_coordinateBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly top: number,\n\t\tpublic readonly left: number\n\t) { }\n}\n\nclass AnchorCoordinate {\n\t_anchorCoordinateBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly top: number,\n\t\tpublic readonly left: number,\n\t\tpublic readonly height: number\n\t) { }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction safeInvoke<T extends (...args: any[]) => any>(fn: T, thisArg: ThisParameterType<T>, ...args: Parameters<T>): ReturnType<T> | null {\n\ttry {\n\t\treturn fn.call(thisArg, ...args);\n\t} catch {\n\t\t// ignore\n\t\treturn null;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as dom from '../../../../base/browser/dom.js';\nimport { FastDomNode, createFastDomNode } from '../../../../base/browser/fastDomNode.js';\nimport { ContentWidgetPositionPreference, IContentWidget, IContentWidgetRenderedCoordinate } from '../../editorBrowser.js';\nimport { PartFingerprint, PartFingerprints, ViewPart } from '../../view/viewPart.js';\nimport { RenderingContext, RestrictedRenderingContext } from '../../view/renderingContext.js';\nimport { ViewContext } from '../../../common/viewModel/viewContext.js';\nimport * as viewEvents from '../../../common/viewEvents.js';\nimport { ViewportData } from '../../../common/viewLayout/viewLinesViewportData.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { IDimension } from '../../../common/core/2d/dimension.js';\nimport { PositionAffinity } from '../../../common/model.js';\nimport { IPosition, Position } from '../../../common/core/position.js';\nimport { IViewModel } from '../../../common/viewModel.js';\n\n/**\n * This view part is responsible for rendering the content widgets, which are\n * used for rendering elements that are associated to an editor position,\n * such as suggestions or the parameter hints.\n */\nexport class ViewContentWidgets extends ViewPart {\n\n\tprivate readonly _viewDomNode: FastDomNode<HTMLElement>;\n\tprivate _widgets: { [key: string]: Widget };\n\n\tpublic domNode: FastDomNode<HTMLElement>;\n\tpublic overflowingContentWidgetsDomNode: FastDomNode<HTMLElement>;\n\n\tconstructor(context: ViewContext, viewDomNode: FastDomNode<HTMLElement>) {\n\t\tsuper(context);\n\t\tthis._viewDomNode = viewDomNode;\n\t\tthis._widgets = {};\n\n\t\tthis.domNode = createFastDomNode(document.createElement('div'));\n\t\tPartFingerprints.write(this.domNode, PartFingerprint.ContentWidgets);\n\t\tthis.domNode.setClassName('contentWidgets');\n\t\tthis.domNode.setPosition('absolute');\n\t\tthis.domNode.setTop(0);\n\n\t\tthis.overflowingContentWidgetsDomNode = createFastDomNode(document.createElement('div'));\n\t\tPartFingerprints.write(this.overflowingContentWidgetsDomNode, PartFingerprint.OverflowingContentWidgets);\n\t\tthis.overflowingContentWidgetsDomNode.setClassName('overflowingContentWidgets');\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\t// Widgets outlive the view, so detach their dom nodes to not keep this view's DOM alive (#146841)\n\t\tfor (const widget of Object.values(this._widgets)) {\n\t\t\tconst domNode = widget.domNode.domNode;\n\t\t\tif (domNode.parentElement === this.domNode.domNode || domNode.parentElement === this.overflowingContentWidgetsDomNode.domNode) {\n\t\t\t\tdomNode.remove();\n\t\t\t\tdomNode.removeAttribute('monaco-visible-content-widget');\n\t\t\t}\n\t\t}\n\t\tthis._widgets = {};\n\t}\n\n\t// --- begin event handlers\n\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].onConfigurationChanged(e);\n\t\t}\n\t\treturn true;\n\t}\n\tpublic override onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean {\n\t\t// true for inline decorations that can end up relayouting text\n\t\treturn true;\n\t}\n\tpublic override onFlushed(e: viewEvents.ViewFlushedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onLineMappingChanged(e: viewEvents.ViewLineMappingChangedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesChanged(e: viewEvents.ViewLinesChangedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesDeleted(e: viewEvents.ViewLinesDeletedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onLinesInserted(e: viewEvents.ViewLinesInsertedEvent): boolean {\n\t\tthis._updateAnchorsViewPositions();\n\t\treturn true;\n\t}\n\tpublic override onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean {\n\t\treturn true;\n\t}\n\tpublic override onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean {\n\t\treturn true;\n\t}\n\n\t// ---- end view event handlers\n\n\tprivate _updateAnchorsViewPositions(): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].updateAnchorViewPosition();\n\t\t}\n\t}\n\n\tpublic addWidget(_widget: IContentWidget): void {\n\t\tconst myWidget = new Widget(this._context, this._viewDomNode, _widget);\n\t\tthis._widgets[myWidget.id] = myWidget;\n\n\t\tif (myWidget.allowEditorOverflow) {\n\t\t\tthis.overflowingContentWidgetsDomNode.appendChild(myWidget.domNode);\n\t\t} else {\n\t\t\tthis.domNode.appendChild(myWidget.domNode);\n\t\t}\n\n\t\tthis.setShouldRender();\n\t}\n\n\tpublic setWidgetPosition(widget: IContentWidget, primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null, preference: ContentWidgetPositionPreference[] | null, affinity: PositionAffinity | null): void {\n\t\tconst myWidget = this._widgets[widget.getId()];\n\t\tmyWidget.setPosition(primaryAnchor, secondaryAnchor, preference, affinity);\n\n\t\tif (!myWidget.useDisplayNone) {\n\t\t\tthis.setShouldRender();\n\t\t}\n\t}\n\n\tpublic removeWidget(widget: IContentWidget): void {\n\t\tconst widgetId = widget.getId();\n\t\tif (this._widgets.hasOwnProperty(widgetId)) {\n\t\t\tconst myWidget = this._widgets[widgetId];\n\t\t\tdelete this._widgets[widgetId];\n\n\t\t\tconst domNode = myWidget.domNode.domNode;\n\t\t\tdomNode.remove();\n\t\t\tdomNode.removeAttribute('monaco-visible-content-widget');\n\n\t\t\tthis.setShouldRender();\n\t\t}\n\t}\n\n\tpublic shouldSuppressMouseDownOnWidget(widgetId: string): boolean {\n\t\tif (this._widgets.hasOwnProperty(widgetId)) {\n\t\t\treturn this._widgets[widgetId].suppressMouseDown;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic override onBeforeRender(viewportData: ViewportData): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].onBeforeRender(viewportData);\n\t\t}\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].prepareRender(ctx);\n\t\t}\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tconst keys = Object.keys(this._widgets);\n\t\tfor (const widgetId of keys) {\n\t\t\tthis._widgets[widgetId].render(ctx);\n\t\t}\n\t}\n}\n\ninterface IBoxLayoutResult {\n\tfitsAbove: boolean;\n\taboveTop: number;\n\n\tfitsBelow: boolean;\n\tbelowTop: number;\n\n\tleft: number;\n}\n\ninterface IOffViewportRenderData {\n\tkind: 'offViewport';\n\tpreserveFocus: boolean;\n}\n\ninterface IInViewportRenderData {\n\tkind: 'inViewport';\n\tcoordinate: Coordinate;\n\tposition: ContentWidgetPositionPreference;\n}\n\ntype IRenderData = IInViewportRenderData | IOffViewportRenderData;\n\nclass Widget {\n\tprivate readonly _context: ViewContext;\n\tprivate readonly _viewDomNode: FastDomNode<HTMLElement>;\n\tprivate readonly _actual: IContentWidget;\n\n\tpublic readonly domNode: FastDomNode<HTMLElement>;\n\tpublic readonly id: string;\n\tpublic readonly allowEditorOverflow: boolean;\n\tpublic readonly suppressMouseDown: boolean;\n\n\tprivate readonly _fixedOverflowWidgets: boolean;\n\tprivate _contentWidth: number;\n\tprivate _contentLeft: number;\n\n\tprivate _primaryAnchor: PositionPair = new PositionPair(null, null);\n\tprivate _secondaryAnchor: PositionPair = new PositionPair(null, null);\n\tprivate _affinity: PositionAffinity | null;\n\tprivate _preference: ContentWidgetPositionPreference[] | null;\n\tprivate _cachedDomNodeOffsetWidth: number;\n\tprivate _cachedDomNodeOffsetHeight: number;\n\tprivate _maxWidth: number;\n\tprivate _isVisible: boolean;\n\n\tprivate _renderData: IRenderData | null;\n\tpublic readonly useDisplayNone: boolean;\n\n\tconstructor(context: ViewContext, viewDomNode: FastDomNode<HTMLElement>, actual: IContentWidget) {\n\t\tthis._context = context;\n\t\tthis._viewDomNode = viewDomNode;\n\t\tthis._actual = actual;\n\n\t\tconst options = this._context.configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tconst allowOverflow = options.get(EditorOption.allowOverflow);\n\n\t\tthis.domNode = createFastDomNode(this._actual.getDomNode());\n\t\tthis.id = this._actual.getId();\n\t\tthis.allowEditorOverflow = (this._actual.allowEditorOverflow || false) && allowOverflow;\n\t\tthis.suppressMouseDown = this._actual.suppressMouseDown || false;\n\t\tthis.useDisplayNone = this._actual.useDisplayNone || false;\n\n\t\tthis._fixedOverflowWidgets = options.get(EditorOption.fixedOverflowWidgets);\n\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\tthis._contentLeft = layoutInfo.contentLeft;\n\n\t\tthis._affinity = null;\n\t\tthis._preference = [];\n\t\tthis._cachedDomNodeOffsetWidth = -1;\n\t\tthis._cachedDomNodeOffsetHeight = -1;\n\t\tthis._maxWidth = this._getMaxWidth();\n\t\tthis._isVisible = false;\n\t\tthis._renderData = null;\n\n\t\tthis.domNode.setPosition((this._fixedOverflowWidgets && this.allowEditorOverflow) ? 'fixed' : 'absolute');\n\t\tthis.domNode.setDisplay('none');\n\t\tthis.domNode.setVisibility('hidden');\n\t\tthis.domNode.setAttribute('widgetId', this.id);\n\t\tthis.domNode.setMaxWidth(this._maxWidth);\n\t}\n\n\tpublic onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): void {\n\t\tconst options = this._context.configuration.options;\n\t\tif (e.hasChanged(EditorOption.layoutInfo)) {\n\t\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\t\tthis._contentLeft = layoutInfo.contentLeft;\n\t\t\tthis._contentWidth = layoutInfo.contentWidth;\n\t\t\tthis._maxWidth = this._getMaxWidth();\n\t\t}\n\t}\n\n\tpublic updateAnchorViewPosition(): void {\n\t\tthis._setPosition(this._affinity, this._primaryAnchor.modelPosition, this._secondaryAnchor.modelPosition);\n\t}\n\n\tprivate _setPosition(affinity: PositionAffinity | null, primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null): void {\n\t\tthis._affinity = affinity;\n\t\tthis._primaryAnchor = getValidPositionPair(primaryAnchor, this._context.viewModel, this._affinity);\n\t\tthis._secondaryAnchor = getValidPositionPair(secondaryAnchor, this._context.viewModel, this._affinity);\n\n\t\tfunction getValidPositionPair(position: IPosition | null, viewModel: IViewModel, affinity: PositionAffinity | null): PositionPair {\n\t\t\tif (!position) {\n\t\t\t\treturn new PositionPair(null, null);\n\t\t\t}\n\t\t\t// Do not trust that widgets give a valid position\n\t\t\tconst validModelPosition = viewModel.model.validatePosition(position);\n\t\t\tif (viewModel.coordinatesConverter.modelPositionIsVisible(validModelPosition)) {\n\t\t\t\tconst viewPosition = viewModel.coordinatesConverter.convertModelPositionToViewPosition(validModelPosition, affinity ?? undefined);\n\t\t\t\treturn new PositionPair(position, viewPosition);\n\t\t\t}\n\t\t\treturn new PositionPair(position, null);\n\t\t}\n\t}\n\n\tprivate _getMaxWidth(): number {\n\t\tconst elDocument = this.domNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\treturn (\n\t\t\tthis.allowEditorOverflow\n\t\t\t\t? elWindow?.innerWidth || elDocument.documentElement.offsetWidth || elDocument.body.offsetWidth\n\t\t\t\t: this._contentWidth\n\t\t);\n\t}\n\n\tpublic setPosition(primaryAnchor: IPosition | null, secondaryAnchor: IPosition | null, preference: ContentWidgetPositionPreference[] | null, affinity: PositionAffinity | null): void {\n\t\tthis._setPosition(affinity, primaryAnchor, secondaryAnchor);\n\t\tthis._preference = preference;\n\t\tif (!this.useDisplayNone && this._primaryAnchor.viewPosition && this._preference && this._preference.length > 0) {\n\t\t\t// this content widget would like to be visible if possible\n\t\t\t// we change it from `display:none` to `display:block` even if it\n\t\t\t// might be outside the viewport such that we can measure its size\n\t\t\t// in `prepareRender`\n\t\t\tthis.domNode.setDisplay('block');\n\t\t} else {\n\t\t\tthis.domNode.setDisplay('none');\n\t\t}\n\t\tthis._cachedDomNodeOffsetWidth = -1;\n\t\tthis._cachedDomNodeOffsetHeight = -1;\n\t}\n\n\tprivate _layoutBoxInViewport(anchor: AnchorCoordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult {\n\t\t// Our visible box is split horizontally by the current line => 2 boxes\n\n\t\t// a) the box above the line\n\t\tconst aboveLineTop = anchor.top;\n\t\tconst heightAvailableAboveLine = aboveLineTop;\n\n\t\t// b) the box under the line\n\t\tconst underLineTop = anchor.top + anchor.height;\n\t\tconst heightAvailableUnderLine = ctx.viewportHeight - underLineTop;\n\n\t\tconst aboveTop = aboveLineTop - height;\n\t\tconst fitsAbove = (heightAvailableAboveLine >= height);\n\t\tconst belowTop = underLineTop;\n\t\tconst fitsBelow = (heightAvailableUnderLine >= height);\n\n\t\t// And its left\n\t\tlet left = anchor.left;\n\t\tif (left + width > ctx.scrollLeft + ctx.viewportWidth) {\n\t\t\tleft = ctx.scrollLeft + ctx.viewportWidth - width;\n\t\t}\n\t\tif (left < ctx.scrollLeft) {\n\t\t\tleft = ctx.scrollLeft;\n\t\t}\n\n\t\treturn { fitsAbove, aboveTop, fitsBelow, belowTop, left };\n\t}\n\n\tprivate _layoutHorizontalSegmentInPage(windowSize: dom.Dimension, domNodePosition: dom.IDomNodePagePosition, left: number, width: number): [number, number] {\n\t\t// Leave some clearance to the left/right\n\t\tconst LEFT_PADDING = 15;\n\t\tconst RIGHT_PADDING = 15;\n\n\t\t// Initially, the limits are defined as the dom node limits\n\t\tconst MIN_LIMIT = Math.max(LEFT_PADDING, domNodePosition.left - width);\n\t\tconst MAX_LIMIT = Math.min(domNodePosition.left + domNodePosition.width + width, windowSize.width - RIGHT_PADDING);\n\n\t\tconst elDocument = this._viewDomNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\tlet absoluteLeft = domNodePosition.left + left - (elWindow?.scrollX ?? 0);\n\n\t\tif (absoluteLeft + width > MAX_LIMIT) {\n\t\t\tconst delta = absoluteLeft - (MAX_LIMIT - width);\n\t\t\tabsoluteLeft -= delta;\n\t\t\tleft -= delta;\n\t\t}\n\n\t\tif (absoluteLeft < MIN_LIMIT) {\n\t\t\tconst delta = absoluteLeft - MIN_LIMIT;\n\t\t\tabsoluteLeft -= delta;\n\t\t\tleft -= delta;\n\t\t}\n\n\t\treturn [left, absoluteLeft];\n\t}\n\n\tprivate _layoutBoxInPage(anchor: AnchorCoordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult | null {\n\t\tconst aboveTop = anchor.top - height;\n\t\tconst belowTop = anchor.top + anchor.height;\n\n\t\tconst domNodePosition = dom.getDomNodePagePosition(this._viewDomNode.domNode);\n\t\tconst elDocument = this._viewDomNode.domNode.ownerDocument;\n\t\tconst elWindow = elDocument.defaultView;\n\t\tconst absoluteAboveTop = domNodePosition.top + aboveTop - (elWindow?.scrollY ?? 0);\n\t\tconst absoluteBelowTop = domNodePosition.top + belowTop - (elWindow?.scrollY ?? 0);\n\n\t\tconst windowSize = dom.getClientArea(elDocument.body);\n\t\tconst [left, absoluteAboveLeft] = this._layoutHorizontalSegmentInPage(windowSize, domNodePosition, anchor.left - ctx.scrollLeft + this._contentLeft, width);\n\n\t\t// Leave some clearance to the top/bottom\n\t\tconst TOP_PADDING = 22;\n\t\tconst BOTTOM_PADDING = 22;\n\n\t\tconst fitsAbove = (absoluteAboveTop >= TOP_PADDING);\n\t\tconst fitsBelow = (absoluteBelowTop + height <= windowSize.height - BOTTOM_PADDING);\n\n\t\tif (this._fixedOverflowWidgets) {\n\t\t\treturn {\n\t\t\t\tfitsAbove,\n\t\t\t\taboveTop: Math.max(absoluteAboveTop, TOP_PADDING),\n\t\t\t\tfitsBelow,\n\t\t\t\tbelowTop: absoluteBelowTop,\n\t\t\t\tleft: absoluteAboveLeft\n\t\t\t};\n\t\t}\n\n\t\treturn { fitsAbove, aboveTop, fitsBelow, belowTop, left };\n\t}\n\n\tprivate _prepareRenderWidgetAtExactPositionOverflowing(topLeft: Coordinate): Coordinate {\n\t\treturn new Coordinate(topLeft.top, topLeft.left + this._contentLeft);\n\t}\n\n\t/**\n\t * Compute the coordinates above and below the primary and secondary anchors.\n\t * The content widget *must* touch the primary anchor.\n\t * The content widget should touch if possible the secondary anchor.\n\t */\n\tprivate _getAnchorsCoordinates(ctx: RenderingContext): { primary: AnchorCoordinate | null; secondary: AnchorCoordinate | null } {\n\t\tconst primary = getCoordinates(this._primaryAnchor.viewPosition, this._affinity);\n\t\tconst secondaryViewPosition = (this._secondaryAnchor.viewPosition?.lineNumber === this._primaryAnchor.viewPosition?.lineNumber ? this._secondaryAnchor.viewPosition : null);\n\t\tconst secondary = getCoordinates(secondaryViewPosition, this._affinity);\n\t\treturn { primary, secondary };\n\n\t\tfunction getCoordinates(position: Position | null, affinity: PositionAffinity | null): AnchorCoordinate | null {\n\t\t\tif (!position) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst horizontalPosition = ctx.visibleRangeForPosition(position);\n\t\t\tif (!horizontalPosition) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Left-align widgets that should appear :before content\n\t\t\tconst left = (position.column === 1 && affinity === PositionAffinity.LeftOfInjectedText ? 0 : horizontalPosition.left);\n\t\t\tconst top = ctx.getVerticalOffsetForLineNumber(position.lineNumber) - ctx.scrollTop;\n\t\t\tconst lineHeight = ctx.getLineHeightForLineNumber(position.lineNumber);\n\t\t\treturn new AnchorCoordinate(top, left, lineHeight);\n\t\t}\n\t}\n\n\tprivate _reduceAnchorCoordinates(primary: AnchorCoordinate, secondary: AnchorCoordinate | null, width: number): AnchorCoordinate {\n\t\tif (!secondary) {\n\t\t\treturn primary;\n\t\t}\n\n\t\tconst fontInfo = this._context.configuration.options.get(EditorOption.fontInfo);\n\n\t\tlet left = secondary.left;\n\t\tif (left < primary.left) {\n\t\t\tleft = Math.max(left, primary.left - width + fontInfo.typicalFullwidthCharacterWidth);\n\t\t} else {\n\t\t\tleft = Math.min(left, primary.left + width - fontInfo.typicalFullwidthCharacterWidth);\n\t\t}\n\t\treturn new AnchorCoordinate(primary.top, left, primary.height);\n\t}\n\n\tprivate _prepareRenderWidget(ctx: RenderingContext): IRenderData | null {\n\t\tif (!this._preference || this._preference.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { primary, secondary } = this._getAnchorsCoordinates(ctx);\n\t\tif (!primary) {\n\t\t\treturn {\n\t\t\t\tkind: 'offViewport',\n\t\t\t\tpreserveFocus: this.domNode.domNode.contains(this.domNode.domNode.ownerDocument.activeElement)\n\t\t\t};\n\t\t\t// return null;\n\t\t}\n\n\t\tif (this._cachedDomNodeOffsetWidth === -1 || this._cachedDomNodeOffsetHeight === -1) {\n\n\t\t\tlet preferredDimensions: IDimension | null = null;\n\t\t\tif (typeof this._actual.beforeRender === 'function') {\n\t\t\t\tpreferredDimensions = safeInvoke(this._actual.beforeRender, this._actual);\n\t\t\t}\n\t\t\tif (preferredDimensions) {\n\t\t\t\tthis._cachedDomNodeOffsetWidth = preferredDimensions.width;\n\t\t\t\tthis._cachedDomNodeOffsetHeight = preferredDimensions.height;\n\t\t\t} else {\n\t\t\t\tconst domNode = this.domNode.domNode;\n\t\t\t\tconst clientRect = domNode.getBoundingClientRect();\n\t\t\t\tthis._cachedDomNodeOffsetWidth = Math.round(clientRect.width);\n\t\t\t\tthis._cachedDomNodeOffsetHeight = Math.round(clientRect.height);\n\t\t\t}\n\t\t}\n\n\t\tconst anchor = this._reduceAnchorCoordinates(primary, secondary, this._cachedDomNodeOffsetWidth);\n\n\t\tlet placement: IBoxLayoutResult | null;\n\t\tif (this.allowEditorOverflow) {\n\t\t\tplacement = this._layoutBoxInPage(anchor, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, ctx);\n\t\t} else {\n\t\t\tplacement = this._layoutBoxInViewport(anchor, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, ctx);\n\t\t}\n\n\t\t// Do two passes, first for perfect fit, second picks first option\n\t\tfor (let pass = 1; pass <= 2; pass++) {\n\t\t\tfor (const pref of this._preference) {\n\t\t\t\t// placement\n\t\t\t\tif (pref === ContentWidgetPositionPreference.ABOVE) {\n\t\t\t\t\tif (!placement) {\n\t\t\t\t\t\t// Widget outside of viewport\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (pass === 2 || placement.fitsAbove) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(placement.aboveTop, placement.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.ABOVE\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else if (pref === ContentWidgetPositionPreference.BELOW) {\n\t\t\t\t\tif (!placement) {\n\t\t\t\t\t\t// Widget outside of viewport\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (pass === 2 || placement.fitsBelow) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(placement.belowTop, placement.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.BELOW\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (this.allowEditorOverflow) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: this._prepareRenderWidgetAtExactPositionOverflowing(new Coordinate(anchor.top, anchor.left)),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.EXACT\n\t\t\t\t\t\t};\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tkind: 'inViewport',\n\t\t\t\t\t\t\tcoordinate: new Coordinate(anchor.top, anchor.left),\n\t\t\t\t\t\t\tposition: ContentWidgetPositionPreference.EXACT\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * On this first pass, we ensure that the content widget (if it is in the viewport) has the max width set correctly.\n\t */\n\tpublic onBeforeRender(viewportData: ViewportData): void {\n\t\tif (!this._primaryAnchor.viewPosition || !this._preference) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._primaryAnchor.viewPosition.lineNumber < viewportData.startLineNumber || this._primaryAnchor.viewPosition.lineNumber > viewportData.endLineNumber) {\n\t\t\t// Outside of viewport\n\t\t\treturn;\n\t\t}\n\n\t\tthis.domNode.setMaxWidth(this._maxWidth);\n\t}\n\n\tpublic prepareRender(ctx: RenderingContext): void {\n\t\tthis._renderData = this._prepareRenderWidget(ctx);\n\t}\n\n\tpublic render(ctx: RestrictedRenderingContext): void {\n\t\tif (!this._renderData || this._renderData.kind === 'offViewport') {\n\t\t\t// This widget should be invisible\n\t\t\tif (this._isVisible) {\n\t\t\t\tthis.domNode.removeAttribute('monaco-visible-content-widget');\n\t\t\t\tthis._isVisible = false;\n\n\t\t\t\tif (this._renderData?.kind === 'offViewport' && this._renderData.preserveFocus) {\n\t\t\t\t\t// widget wants to be shown, but it is outside of the viewport and it\n\t\t\t\t\t// has focus which we need to preserve\n\t\t\t\t\tthis.domNode.setTop(-1000);\n\t\t\t\t} else {\n\t\t\t\t\tthis.domNode.setVisibility('hidden');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (typeof this._actual.afterRender === 'function') {\n\t\t\t\tsafeInvoke(this._actual.afterRender, this._actual, null, null);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// This widget should be visible\n\t\tif (this.allowEditorOverflow) {\n\t\t\tthis.domNode.setTop(this._renderData.coordinate.top);\n\t\t\tthis.domNode.setLeft(this._renderData.coordinate.left);\n\t\t} else {\n\t\t\tthis.domNode.setTop(this._renderData.coordinate.top + ctx.scrollTop - ctx.bigNumbersDelta);\n\t\t\tthis.domNode.setLeft(this._renderData.coordinate.left);\n\t\t}\n\n\t\tif (!this._isVisible) {\n\t\t\tthis.domNode.setVisibility('inherit');\n\t\t\tthis.domNode.setAttribute('monaco-visible-content-widget', 'true');\n\t\t\tthis._isVisible = true;\n\t\t}\n\n\t\tif (typeof this._actual.afterRender === 'function') {\n\t\t\tsafeInvoke(this._actual.afterRender, this._actual, this._renderData.position, this._renderData.coordinate);\n\t\t}\n\t}\n}\n\nclass PositionPair {\n\tconstructor(\n\t\tpublic readonly modelPosition: IPosition | null,\n\t\tpublic readonly viewPosition: Position | null\n\t) { }\n}\n\nclass Coordinate implements IContentWidgetRenderedCoordinate {\n\t_coordinateBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly top: number,\n\t\tpublic readonly left: number\n\t) { }\n}\n\nclass AnchorCoordinate {\n\t_anchorCoordinateBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly top: number,\n\t\tpublic readonly left: number,\n\t\tpublic readonly height: number\n\t) { }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction safeInvoke<T extends (...args: any[]) => any>(fn: T, thisArg: ThisParameterType<T>, ...args: Parameters<T>): ReturnType<T> | null {\n\ttry {\n\t\treturn fn.call(thisArg, ...args);\n\t} catch {\n\t\t// ignore\n\t\treturn null;\n\t}\n}\n"]}
@@ -15,9 +15,9 @@ export class AbstractLineHighlightOverlay extends DynamicViewOverlay {
15
15
  super();
16
16
  this._context = context;
17
17
  const options = this._context.configuration.options;
18
- const layoutInfo = options.get(166 /* EditorOption.layoutInfo */);
19
- this._renderLineHighlight = options.get(110 /* EditorOption.renderLineHighlight */);
20
- this._renderLineHighlightOnlyWhenFocus = options.get(111 /* EditorOption.renderLineHighlightOnlyWhenFocus */);
18
+ const layoutInfo = options.get(169 /* EditorOption.layoutInfo */);
19
+ this._renderLineHighlight = options.get(112 /* EditorOption.renderLineHighlight */);
20
+ this._renderLineHighlightOnlyWhenFocus = options.get(113 /* EditorOption.renderLineHighlightOnlyWhenFocus */);
21
21
  this._wordWrap = layoutInfo.isViewportWrapping;
22
22
  this._contentLeft = layoutInfo.contentLeft;
23
23
  this._contentWidth = layoutInfo.contentWidth;
@@ -57,9 +57,9 @@ export class AbstractLineHighlightOverlay extends DynamicViewOverlay {
57
57
  }
58
58
  onConfigurationChanged(e) {
59
59
  const options = this._context.configuration.options;
60
- const layoutInfo = options.get(166 /* EditorOption.layoutInfo */);
61
- this._renderLineHighlight = options.get(110 /* EditorOption.renderLineHighlight */);
62
- this._renderLineHighlightOnlyWhenFocus = options.get(111 /* EditorOption.renderLineHighlightOnlyWhenFocus */);
60
+ const layoutInfo = options.get(169 /* EditorOption.layoutInfo */);
61
+ this._renderLineHighlight = options.get(112 /* EditorOption.renderLineHighlight */);
62
+ this._renderLineHighlightOnlyWhenFocus = options.get(113 /* EditorOption.renderLineHighlightOnlyWhenFocus */);
63
63
  this._wordWrap = layoutInfo.isViewportWrapping;
64
64
  this._contentLeft = layoutInfo.contentLeft;
65
65
  this._contentWidth = layoutInfo.contentWidth;
@@ -15,11 +15,11 @@ export class EditorScrollbar extends ViewPart {
15
15
  constructor(context, linesContent, viewDomNode, overflowGuardDomNode) {
16
16
  super(context);
17
17
  const options = this._context.configuration.options;
18
- const scrollbar = options.get(117 /* EditorOption.scrollbar */);
19
- const mouseWheelScrollSensitivity = options.get(83 /* EditorOption.mouseWheelScrollSensitivity */);
18
+ const scrollbar = options.get(119 /* EditorOption.scrollbar */);
19
+ const mouseWheelScrollSensitivity = options.get(84 /* EditorOption.mouseWheelScrollSensitivity */);
20
20
  const fastScrollSensitivity = options.get(49 /* EditorOption.fastScrollSensitivity */);
21
- const scrollPredominantAxis = options.get(120 /* EditorOption.scrollPredominantAxis */);
22
- const inertialScroll = options.get(158 /* EditorOption.inertialScroll */);
21
+ const scrollPredominantAxis = options.get(122 /* EditorOption.scrollPredominantAxis */);
22
+ const inertialScroll = options.get(161 /* EditorOption.inertialScroll */);
23
23
  const scrollbarOptions = {
24
24
  listenOnDomNode: viewDomNode.domNode,
25
25
  className: 'editor-scrollable' + ' ' + getThemeTypeSelector(context.theme.type),
@@ -76,9 +76,9 @@ export class EditorScrollbar extends ViewPart {
76
76
  }
77
77
  _setLayout() {
78
78
  const options = this._context.configuration.options;
79
- const layoutInfo = options.get(166 /* EditorOption.layoutInfo */);
79
+ const layoutInfo = options.get(169 /* EditorOption.layoutInfo */);
80
80
  this.scrollbarDomNode.setLeft(layoutInfo.contentLeft);
81
- const minimap = options.get(81 /* EditorOption.minimap */);
81
+ const minimap = options.get(82 /* EditorOption.minimap */);
82
82
  const side = minimap.side;
83
83
  if (side === 'right') {
84
84
  this.scrollbarDomNode.setWidth(layoutInfo.contentWidth + layoutInfo.minimap.minimapWidth);
@@ -102,14 +102,14 @@ export class EditorScrollbar extends ViewPart {
102
102
  }
103
103
  // --- begin event handlers
104
104
  onConfigurationChanged(e) {
105
- if (e.hasChanged(117 /* EditorOption.scrollbar */)
106
- || e.hasChanged(83 /* EditorOption.mouseWheelScrollSensitivity */)
105
+ if (e.hasChanged(119 /* EditorOption.scrollbar */)
106
+ || e.hasChanged(84 /* EditorOption.mouseWheelScrollSensitivity */)
107
107
  || e.hasChanged(49 /* EditorOption.fastScrollSensitivity */)) {
108
108
  const options = this._context.configuration.options;
109
- const scrollbar = options.get(117 /* EditorOption.scrollbar */);
110
- const mouseWheelScrollSensitivity = options.get(83 /* EditorOption.mouseWheelScrollSensitivity */);
109
+ const scrollbar = options.get(119 /* EditorOption.scrollbar */);
110
+ const mouseWheelScrollSensitivity = options.get(84 /* EditorOption.mouseWheelScrollSensitivity */);
111
111
  const fastScrollSensitivity = options.get(49 /* EditorOption.fastScrollSensitivity */);
112
- const scrollPredominantAxis = options.get(120 /* EditorOption.scrollPredominantAxis */);
112
+ const scrollPredominantAxis = options.get(122 /* EditorOption.scrollPredominantAxis */);
113
113
  const newOpts = {
114
114
  vertical: scrollbar.vertical,
115
115
  horizontal: scrollbar.horizontal,
@@ -123,7 +123,7 @@ export class EditorScrollbar extends ViewPart {
123
123
  };
124
124
  this.scrollbar.updateOptions(newOpts);
125
125
  }
126
- if (e.hasChanged(166 /* EditorOption.layoutInfo */)) {
126
+ if (e.hasChanged(169 /* EditorOption.layoutInfo */)) {
127
127
  this._setLayout();
128
128
  }
129
129
  return true;
@@ -100,7 +100,7 @@ export class GlyphMarginWidgets extends ViewPart {
100
100
  this._widgets = {};
101
101
  this._context = context;
102
102
  const options = this._context.configuration.options;
103
- const layoutInfo = options.get(166 /* EditorOption.layoutInfo */);
103
+ const layoutInfo = options.get(169 /* EditorOption.layoutInfo */);
104
104
  this.domNode = createFastDomNode(document.createElement('div'));
105
105
  this.domNode.setClassName('glyph-margin-widgets');
106
106
  this.domNode.setPosition('absolute');
@@ -116,6 +116,13 @@ export class GlyphMarginWidgets extends ViewPart {
116
116
  dispose() {
117
117
  this._managedDomNodes = [];
118
118
  this._decorationGlyphsToRender = [];
119
+ // Widgets outlive the view, so detach their dom nodes to not keep this view's DOM alive (#146841)
120
+ for (const widgetData of Object.values(this._widgets)) {
121
+ const domNode = widgetData.domNode.domNode;
122
+ if (domNode.parentElement === this.domNode.domNode) {
123
+ domNode.remove();
124
+ }
125
+ }
119
126
  this._widgets = {};
120
127
  super.dispose();
121
128
  }
@@ -125,7 +132,7 @@ export class GlyphMarginWidgets extends ViewPart {
125
132
  // --- begin event handlers
126
133
  onConfigurationChanged(e) {
127
134
  const options = this._context.configuration.options;
128
- const layoutInfo = options.get(166 /* EditorOption.layoutInfo */);
135
+ const layoutInfo = options.get(169 /* EditorOption.layoutInfo */);
129
136
  this._lineHeight = options.get(75 /* EditorOption.lineHeight */);
130
137
  this._glyphMargin = options.get(66 /* EditorOption.glyphMargin */);
131
138
  this._glyphMarginLeft = layoutInfo.glyphMarginLeft;