@codingame/monaco-vscode-api 4.5.2 → 5.0.0

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 (434) hide show
  1. package/api.js +1 -1
  2. package/extensions.d.ts +2 -3
  3. package/lifecycle.js +6 -0
  4. package/localExtensionHost.d.ts +4 -1
  5. package/missing-services.js +41 -25
  6. package/package.json +8 -8
  7. package/service-override/tools/editor.js +31 -8
  8. package/service-override/tools/views.d.ts +1 -1
  9. package/service-override/tools/views.js +2 -3
  10. package/service-override/views.d.ts +0 -1
  11. package/services.d.ts +3 -3
  12. package/services.js +3 -3
  13. package/vscode/src/vs/base/browser/markdownRenderer.js +9 -3
  14. package/vscode/src/vs/base/browser/ui/actionbar/actionViewItems.js +2 -2
  15. package/vscode/src/vs/base/browser/ui/button/button.js +3 -3
  16. package/vscode/src/vs/base/browser/ui/codicons/codicon/codicon.css.js +1 -1
  17. package/vscode/src/vs/base/browser/ui/contextview/contextview.js +1 -1
  18. package/vscode/src/vs/base/browser/ui/dropdown/dropdown.js +2 -2
  19. package/vscode/src/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +2 -2
  20. package/vscode/src/vs/base/browser/ui/highlightedlabel/highlightedLabel.js +2 -2
  21. package/vscode/src/vs/{platform/hover/browser → base/browser/ui/hover}/hover.d.ts +64 -4
  22. package/vscode/src/vs/base/browser/ui/hover/hoverDelegate.d.ts +1 -1
  23. package/vscode/src/vs/base/browser/ui/hover/hoverDelegate2.js +13 -0
  24. package/vscode/src/vs/base/browser/ui/hover/hoverWidget.css.js +1 -1
  25. package/vscode/src/vs/base/browser/ui/hover/hoverWidget.js +30 -14
  26. package/vscode/src/vs/base/browser/ui/iconLabel/iconLabel.js +15 -2
  27. package/vscode/src/vs/base/browser/ui/iconLabel/simpleIconLabel.js +2 -2
  28. package/vscode/src/vs/base/browser/ui/icons/iconSelectBox.css.js +4 -0
  29. package/vscode/src/vs/base/browser/ui/icons/iconSelectBox.js +239 -0
  30. package/vscode/src/vs/base/browser/ui/inputbox/inputBox.js +2 -2
  31. package/vscode/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.js +2 -2
  32. package/vscode/src/vs/base/browser/ui/list/listView.js +5 -3
  33. package/vscode/src/vs/base/browser/ui/list/listWidget.d.ts +33 -0
  34. package/vscode/src/vs/base/browser/ui/list/listWidget.js +4 -1
  35. package/vscode/src/vs/base/browser/ui/menu/menu.js +1 -0
  36. package/vscode/src/vs/base/browser/ui/menu/menubar.css.js +1 -1
  37. package/vscode/src/vs/base/browser/ui/progressbar/progressAccessibilitySignal.js +13 -0
  38. package/vscode/src/vs/base/browser/ui/progressbar/progressbar.js +7 -1
  39. package/vscode/src/vs/base/browser/ui/selectBox/selectBoxCustom.js +2 -2
  40. package/vscode/src/vs/base/browser/ui/table/tableWidget.js +2 -2
  41. package/vscode/src/vs/base/browser/ui/toggle/toggle.js +8 -2
  42. package/vscode/src/vs/base/browser/ui/toolbar/toolbar.d.ts +1 -1
  43. package/vscode/src/vs/base/browser/ui/tree/abstractTree.js +11 -4
  44. package/vscode/src/vs/base/browser/ui/tree/media/tree.css.js +1 -1
  45. package/vscode/src/vs/base/browser/ui/tree/objectTree.js +6 -4
  46. package/vscode/src/vs/base/common/arraysFind.js +7 -7
  47. package/vscode/src/vs/base/common/async.js +8 -3
  48. package/vscode/src/vs/base/common/cache.js +29 -10
  49. package/vscode/src/vs/base/common/cancellation.js +6 -1
  50. package/vscode/src/vs/base/common/codicons.d.ts +3 -0
  51. package/vscode/src/vs/base/common/codiconsLibrary.js +3 -0
  52. package/vscode/src/vs/base/common/controlFlow.js +48 -0
  53. package/vscode/src/vs/base/common/equals.js +44 -0
  54. package/vscode/src/vs/base/common/event.d.ts +11 -1
  55. package/vscode/src/vs/base/common/event.js +26 -1
  56. package/vscode/src/vs/base/common/jsonEdit.js +1 -1
  57. package/vscode/src/vs/base/common/lifecycle.js +1 -1
  58. package/vscode/src/vs/base/common/map.js +53 -4
  59. package/vscode/src/vs/base/common/network.js +2 -0
  60. package/vscode/src/vs/base/common/objects.js +3 -0
  61. package/vscode/src/vs/base/common/observableInternal/autorun.js +1 -10
  62. package/vscode/src/vs/base/common/observableInternal/base.js +22 -10
  63. package/vscode/src/vs/base/common/observableInternal/derived.js +8 -8
  64. package/vscode/src/vs/base/common/observableInternal/promise.js +19 -1
  65. package/vscode/src/vs/base/common/observableInternal/utils.js +30 -52
  66. package/vscode/src/vs/base/common/product.d.ts +1 -0
  67. package/vscode/src/vs/base/common/strings.js +1 -1
  68. package/vscode/src/vs/base/common/types.d.ts +5 -1
  69. package/vscode/src/vs/editor/browser/config/editorConfiguration.js +3 -2
  70. package/vscode/src/vs/editor/browser/observableUtilities.js +58 -0
  71. package/vscode/src/vs/editor/browser/services/hoverService/hoverService.js +121 -2
  72. package/vscode/src/vs/editor/browser/services/hoverService/updatableHoverWidget.js +80 -0
  73. package/vscode/src/vs/editor/browser/stableEditorScroll.js +37 -1
  74. package/vscode/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +10 -3
  75. package/vscode/src/vs/editor/browser/widget/codeEditor/editor.css.js +1 -1
  76. package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorDecorations.js +1 -0
  77. package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +7 -5
  78. package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorSash.js +1 -0
  79. package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorOptions.js +1 -0
  80. package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorViewModel.js +3 -0
  81. package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +3 -10
  82. package/vscode/src/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js +8 -0
  83. package/vscode/src/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +6 -6
  84. package/vscode/src/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +1 -0
  85. package/vscode/src/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
  86. package/vscode/src/vs/editor/browser/widget/diffEditor/features/overviewRulerFeature.js +1 -0
  87. package/vscode/src/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +1 -0
  88. package/vscode/src/vs/editor/browser/widget/diffEditor/utils/editorGutter.js +1 -0
  89. package/vscode/src/vs/editor/browser/widget/diffEditor/utils.js +1 -0
  90. package/vscode/src/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +3 -2
  91. package/vscode/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorViewModel.js +17 -8
  92. package/vscode/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidget.js +1 -0
  93. package/vscode/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +27 -19
  94. package/vscode/src/vs/editor/browser/widget/multiDiffEditor/style.css.js +1 -1
  95. package/vscode/src/vs/editor/common/core/editorColorRegistry.js +4 -4
  96. package/vscode/src/vs/editor/common/core/lineRange.d.ts +12 -0
  97. package/vscode/src/vs/editor/common/core/lineRange.js +28 -0
  98. package/vscode/src/vs/editor/common/core/textEdit.d.ts +21 -0
  99. package/vscode/src/vs/editor/common/core/textEdit.js +13 -1
  100. package/vscode/src/vs/editor/common/core/textLength.d.ts +29 -0
  101. package/vscode/src/vs/editor/common/core/textLength.js +6 -0
  102. package/vscode/src/vs/editor/common/cursor/cursorCollection.js +3 -3
  103. package/vscode/src/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js +11 -1
  104. package/vscode/src/vs/editor/common/diff/rangeMapping.d.ts +11 -0
  105. package/vscode/src/vs/editor/common/diff/rangeMapping.js +34 -3
  106. package/vscode/src/vs/editor/common/languages.d.ts +50 -10
  107. package/vscode/src/vs/editor/common/languages.js +11 -1
  108. package/vscode/src/vs/editor/common/services/languageFeatureDebounce.js +1 -1
  109. package/vscode/src/vs/editor/common/services/languageFeatures.d.ts +2 -2
  110. package/vscode/src/vs/editor/common/services/languageFeaturesService.js +1 -1
  111. package/vscode/src/vs/editor/common/standalone/standaloneEnums.js +11 -1
  112. package/vscode/src/vs/editor/common/viewModel/viewModelImpl.js +3 -0
  113. package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionController.js +22 -6
  114. package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionModel.js +5 -0
  115. package/vscode/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +1 -0
  116. package/vscode/src/vs/editor/contrib/colorPicker/browser/colorContributions.js +1 -1
  117. package/vscode/src/vs/editor/contrib/colorPicker/browser/standaloneColorPickerActions.js +20 -3
  118. package/vscode/src/vs/editor/contrib/colorPicker/browser/standaloneColorPickerWidget.js +1 -1
  119. package/vscode/src/vs/editor/contrib/contextmenu/browser/contextmenu.js +2 -2
  120. package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +4 -4
  121. package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +2 -2
  122. package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +7 -0
  123. package/vscode/src/vs/editor/contrib/find/browser/findController.js +11 -6
  124. package/vscode/src/vs/editor/contrib/find/browser/findWidget.js +10 -10
  125. package/vscode/src/vs/editor/contrib/hover/browser/contentHoverComputer.js +74 -0
  126. package/vscode/src/vs/editor/contrib/hover/browser/contentHoverController.js +332 -0
  127. package/vscode/src/vs/editor/contrib/hover/browser/contentHoverStatusBar.js +34 -0
  128. package/vscode/src/vs/editor/contrib/hover/browser/contentHoverTypes.js +39 -0
  129. package/vscode/src/vs/editor/contrib/hover/browser/contentHoverWidget.js +355 -0
  130. package/vscode/src/vs/editor/contrib/hover/browser/getHover.js +11 -14
  131. package/vscode/src/vs/editor/contrib/hover/browser/hover.css.js +1 -1
  132. package/vscode/src/vs/editor/contrib/hover/browser/hoverActionIds.js +13 -0
  133. package/vscode/src/vs/editor/contrib/hover/browser/hoverActions.js +354 -0
  134. package/vscode/src/vs/editor/contrib/hover/browser/hoverContribution.js +42 -0
  135. package/vscode/src/vs/editor/contrib/hover/browser/hoverController.js +320 -0
  136. package/vscode/src/vs/editor/contrib/hover/browser/marginHoverComputer.js +48 -0
  137. package/vscode/src/vs/editor/contrib/hover/browser/{marginHover.js → marginHoverWidget.js} +14 -48
  138. package/vscode/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +250 -41
  139. package/vscode/src/vs/editor/contrib/hover/browser/markerHoverParticipant.js +1 -0
  140. package/vscode/src/vs/editor/contrib/indentation/browser/indentation.js +44 -20
  141. package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +11 -7
  142. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/commands.js +1 -0
  143. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.js +1 -0
  144. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hoverParticipant.js +2 -3
  145. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionContextKeys.js +1 -0
  146. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController.js +26 -13
  147. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHintsWidget.js +5 -11
  148. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel.js +24 -22
  149. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsSource.js +39 -70
  150. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/suggestWidgetInlineCompletionProvider.js +3 -3
  151. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/utils.js +1 -0
  152. package/vscode/src/vs/editor/contrib/inlineEdit/browser/ghostTextWidget.js +1 -0
  153. package/vscode/src/vs/editor/contrib/inlineEdit/browser/hoverParticipant.js +1 -0
  154. package/vscode/src/vs/editor/contrib/inlineEdit/browser/inlineEditController.js +4 -2
  155. package/vscode/src/vs/editor/contrib/inlineEdit/browser/inlineEditHintsWidget.js +5 -3
  156. package/vscode/src/vs/editor/contrib/inlineProgress/browser/inlineProgressWidget.css.js +1 -1
  157. package/vscode/src/vs/editor/contrib/rename/browser/rename.js +18 -6
  158. package/vscode/src/vs/editor/contrib/rename/browser/renameWidget.css.js +1 -1
  159. package/vscode/src/vs/editor/contrib/rename/browser/renameWidget.js +165 -40
  160. package/vscode/src/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js +5 -0
  161. package/vscode/src/vs/editor/contrib/snippet/browser/snippetController2.js +3 -3
  162. package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +15 -8
  163. package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +13 -6
  164. package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.js +0 -2
  165. package/vscode/src/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +9 -2
  166. package/vscode/src/vs/editor/standalone/browser/standaloneCodeEditor.js +23 -18
  167. package/vscode/src/vs/editor/standalone/browser/standaloneServices.js +33 -11
  168. package/vscode/src/vs/platform/accessibility/common/accessibility.d.ts +1 -9
  169. package/vscode/src/vs/platform/accessibility/common/accessibility.js +2 -1
  170. package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.d.ts +15 -9
  171. package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +133 -132
  172. package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service.d.ts +12 -5
  173. package/vscode/src/vs/platform/accessibilitySignal/browser/progressAccessibilitySignalScheduler.js +25 -0
  174. package/vscode/src/vs/platform/actionWidget/browser/actionWidget.js +4 -4
  175. package/vscode/src/vs/platform/actions/browser/buttonbar.js +10 -7
  176. package/vscode/src/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem.js +1 -1
  177. package/vscode/src/vs/platform/actions/browser/toolbar.d.ts +4 -1
  178. package/vscode/src/vs/platform/actions/browser/toolbar.js +53 -36
  179. package/vscode/src/vs/platform/actions/common/actions.d.ts +3 -1
  180. package/vscode/src/vs/platform/actions/common/actions.js +14 -4
  181. package/vscode/src/vs/platform/actions/common/menuService.js +30 -8
  182. package/vscode/src/vs/platform/configuration/common/configuration.js +4 -0
  183. package/vscode/src/vs/platform/configuration/common/configurationModels.js +43 -32
  184. package/vscode/src/vs/platform/configuration/common/configurations.js +12 -10
  185. package/vscode/src/vs/platform/contextview/browser/contextView.d.ts +4 -1
  186. package/vscode/src/vs/platform/contextview/browser/contextView.service.d.ts +2 -3
  187. package/vscode/src/vs/platform/contextview/browser/contextViewService.js +10 -8
  188. package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.d.ts +0 -1
  189. package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +1 -0
  190. package/vscode/src/vs/platform/extensionManagement/common/extensionsScannerService.js +1 -0
  191. package/vscode/src/vs/platform/extensions/common/extensions.d.ts +5 -0
  192. package/vscode/src/vs/platform/files/common/files.d.ts +14 -1
  193. package/vscode/src/vs/platform/hover/browser/hover.service.d.ts +2 -31
  194. package/vscode/src/vs/platform/instantiation/common/instantiation.d.ts +9 -0
  195. package/vscode/src/vs/platform/instantiation/common/instantiationService.js +42 -8
  196. package/vscode/src/vs/platform/log/common/log.js +3 -1
  197. package/vscode/src/vs/platform/markers/common/markerService.js +7 -3
  198. package/vscode/src/vs/platform/opener/browser/link.js +6 -4
  199. package/vscode/src/vs/platform/quickinput/browser/quickInput.js +2 -2
  200. package/vscode/src/vs/platform/quickinput/browser/quickInputTree.js +15 -7
  201. package/vscode/src/vs/platform/telemetry/common/gdprTypings.d.ts +0 -1
  202. package/vscode/src/vs/platform/telemetry/common/telemetryUtils.js +1 -0
  203. package/vscode/src/vs/platform/terminal/common/capabilities/capabilities.d.ts +5 -0
  204. package/vscode/src/vs/platform/terminal/common/capabilities/commandDetection/promptInputModel.d.ts +30 -0
  205. package/vscode/src/vs/platform/theme/browser/defaultStyles.js +6 -0
  206. package/vscode/src/vs/platform/theme/browser/iconsStyleSheet.js +13 -11
  207. package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.js +1 -1
  208. package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +28 -28
  209. package/vscode/src/vs/workbench/api/common/extHost.protocol.js +2 -6
  210. package/vscode/src/vs/workbench/api/common/extHostBulkEdits.js +2 -1
  211. package/vscode/src/vs/workbench/api/common/extHostChatAgents2.js +104 -96
  212. package/vscode/src/vs/workbench/api/common/extHostChatVariables.js +4 -4
  213. package/vscode/src/vs/workbench/api/common/extHostConfiguration.js +9 -3
  214. package/vscode/src/vs/workbench/api/common/extHostDebugService.js +3 -3
  215. package/vscode/src/vs/workbench/api/common/extHostDocumentSaveParticipant.js +2 -1
  216. package/vscode/src/vs/workbench/api/common/extHostEditorTabs.js +1 -1
  217. package/vscode/src/vs/workbench/api/common/extHostFileSystemEventService.js +19 -1
  218. package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +87 -17
  219. package/vscode/src/vs/workbench/api/common/extHostLanguageModels.js +39 -2
  220. package/vscode/src/vs/workbench/api/common/extHostNotebookDocumentSaveParticipant.js +2 -1
  221. package/vscode/src/vs/workbench/api/common/extHostTerminalShellIntegration.js +52 -36
  222. package/vscode/src/vs/workbench/api/common/extHostTesting.js +10 -28
  223. package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +6 -1
  224. package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +132 -136
  225. package/vscode/src/vs/workbench/api/common/extHostTypes.js +72 -18
  226. package/vscode/src/vs/workbench/api/common/extHostWindow.js +3 -5
  227. package/vscode/src/vs/workbench/browser/actions/layoutActions.js +86 -76
  228. package/vscode/src/vs/workbench/browser/actions/media/actions.css.js +1 -1
  229. package/vscode/src/vs/workbench/browser/actions/widgetNavigationCommands.js +30 -6
  230. package/vscode/src/vs/workbench/browser/labels.js +4 -1
  231. package/vscode/src/vs/workbench/browser/parts/compositePart.d.ts +3 -1
  232. package/vscode/src/vs/workbench/browser/parts/editor/diffEditorCommands.js +19 -7
  233. package/vscode/src/vs/workbench/browser/parts/editor/editorGroupView.js +16 -3
  234. package/vscode/src/vs/workbench/browser/parts/editor/media/editorquickaccess.css.js +1 -1
  235. package/vscode/src/vs/workbench/browser/parts/editor/media/multieditortabscontrol.css.js +1 -1
  236. package/vscode/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.js +14 -33
  237. package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +33 -13
  238. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.js +7 -5
  239. package/vscode/src/vs/workbench/browser/parts/paneCompositePart.d.ts +4 -3
  240. package/vscode/src/vs/workbench/browser/parts/panel/panelPart.d.ts +2 -1
  241. package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.d.ts +3 -1
  242. package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +3 -3
  243. package/vscode/src/vs/workbench/browser/parts/views/media/views.css.js +1 -1
  244. package/vscode/src/vs/workbench/browser/parts/views/treeView.js +182 -63
  245. package/vscode/src/vs/workbench/browser/parts/views/viewPane.d.ts +14 -3
  246. package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +61 -34
  247. package/vscode/src/vs/workbench/browser/workbench.contribution.js +16 -10
  248. package/vscode/src/vs/workbench/common/theme.js +144 -98
  249. package/vscode/src/vs/workbench/common/views.d.ts +2 -0
  250. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +190 -138
  251. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleView.js +876 -0
  252. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewActions.js +59 -7
  253. package/vscode/src/vs/workbench/contrib/accessibility/browser/{accessibilityContributions.js → accessibleViewContributions.js} +160 -6
  254. package/vscode/src/vs/workbench/contrib/accessibility/browser/editorAccessibilityHelp.js +3 -3
  255. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +66 -150
  256. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +75 -12
  257. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +21 -22
  258. package/vscode/src/vs/workbench/contrib/chat/browser/chat.js +6 -1
  259. package/vscode/src/vs/workbench/contrib/chat/browser/chatAgentHover.js +101 -0
  260. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorInput.js +6 -5
  261. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +30 -23
  262. package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +201 -47
  263. package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +42 -5
  264. package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +13 -28
  265. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css.js +1 -1
  266. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +366 -6
  267. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +35 -2
  268. package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css.js +1 -1
  269. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatAgentHover.css.js +4 -0
  270. package/vscode/src/vs/workbench/contrib/chat/common/annotations.js +4 -9
  271. package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.js +95 -5
  272. package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.service.js +2 -1
  273. package/vscode/src/vs/workbench/contrib/chat/common/chatColors.js +1 -1
  274. package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +11 -6
  275. package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +94 -79
  276. package/vscode/src/vs/workbench/contrib/chat/common/chatParserTypes.js +0 -13
  277. package/vscode/src/vs/workbench/contrib/chat/common/chatParticipantContribTypes.js +2 -0
  278. package/vscode/src/vs/workbench/contrib/chat/common/chatViewModel.js +7 -9
  279. package/vscode/src/vs/workbench/contrib/chat/common/languageModelStats.service.js +3 -0
  280. package/vscode/src/vs/workbench/contrib/codeEditor/browser/dictation/editorDictation.js +1 -1
  281. package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +1 -0
  282. package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +4 -4
  283. package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +30 -26
  284. package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +30 -29
  285. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +4 -4
  286. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +5 -4
  287. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +3 -3
  288. package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +13 -13
  289. package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +26 -16
  290. package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +107 -26
  291. package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +1 -1
  292. package/vscode/src/vs/workbench/contrib/comments/browser/simpleCommentEditor.js +23 -2
  293. package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +2 -3
  294. package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +39 -11
  295. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +53 -33
  296. package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +967 -0
  297. package/vscode/src/vs/workbench/contrib/debug/browser/debugSessionPicker.js +101 -0
  298. package/vscode/src/vs/workbench/contrib/debug/common/debug.js +4 -1
  299. package/vscode/src/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +82 -0
  300. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +10 -9
  301. package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +79 -45
  302. package/vscode/src/vs/workbench/contrib/files/browser/{fileCommands.save.js → fileCommands._save.js} +4 -4
  303. package/vscode/src/vs/workbench/contrib/files/browser/{files.configuration.contribution.js → files.contribution._configuration.js} +1 -1
  304. package/vscode/src/vs/workbench/contrib/files/browser/{files.editorPane.contribution.js → files.contribution._editorPane.js} +18 -18
  305. package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +5 -3
  306. package/vscode/src/vs/workbench/contrib/files/browser/views/explorerView.js +19 -14
  307. package/vscode/src/vs/workbench/contrib/files/browser/views/media/openeditors.css.js +1 -1
  308. package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +8 -8
  309. package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +15 -2
  310. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +29 -112
  311. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatContentWidget.js +10 -7
  312. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +99 -91
  313. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +9 -31
  314. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +345 -104
  315. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +62 -69
  316. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +63 -46
  317. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +18 -10
  318. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css.js +1 -1
  319. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatContentWidget.css.js +1 -1
  320. package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +1 -31
  321. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +7 -3
  322. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +5 -1
  323. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +1 -0
  324. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +1 -0
  325. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +1 -0
  326. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +4 -4
  327. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +2 -48
  328. package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput.js +28 -23
  329. package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.js +5 -9
  330. package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver.js +112 -0
  331. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +18 -10
  332. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +4 -4
  333. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +7 -2
  334. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.js +4 -5
  335. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +8 -3
  336. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.js +1 -0
  337. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +36 -4
  338. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +9 -6
  339. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +17 -5
  340. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.js +6 -4
  341. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +5 -5
  342. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +3 -3
  343. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +5 -4
  344. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +2 -0
  345. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +1 -1
  346. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.js +2 -3
  347. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +22 -1
  348. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +34 -6
  349. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +15 -0
  350. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.js +6 -4
  351. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProviderFactory.service.js +3 -0
  352. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +17 -14
  353. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +2 -1
  354. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.js +52 -16
  355. package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +3 -1
  356. package/vscode/src/vs/workbench/contrib/notebook/common/notebookContextKeys.js +2 -2
  357. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +25 -12
  358. package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.js +6 -4
  359. package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +0 -2
  360. package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +6 -4
  361. package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +24 -2
  362. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +38 -8
  363. package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +0 -1
  364. package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +1 -0
  365. package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.d.ts +7 -14
  366. package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.service.d.ts +24 -6
  367. package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.service.js +2 -1
  368. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +8 -9
  369. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm-private.d.ts +2 -20
  370. package/vscode/src/vs/workbench/contrib/terminal/common/terminal.d.ts +3 -1
  371. package/vscode/src/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +2 -2
  372. package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +1 -0
  373. package/vscode/src/vs/workbench/contrib/testing/common/testItemCollection.js +10 -0
  374. package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +15 -3
  375. package/vscode/src/vs/workbench/services/accessibility/common/accessibleViewInformationService.service.d.ts +9 -0
  376. package/vscode/src/vs/workbench/services/accessibility/common/accessibleViewInformationService.service.js +3 -0
  377. package/vscode/src/vs/workbench/services/editor/common/customEditorLabelService.js +30 -16
  378. package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.d.ts +15 -4
  379. package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.service.d.ts +20 -1
  380. package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.service.d.ts +0 -1
  381. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +4 -1
  382. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManagers.d.ts +4 -1
  383. package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocation.d.ts +1 -1
  384. package/vscode/src/vs/workbench/services/extensions/common/extensions.d.ts +8 -2
  385. package/vscode/src/vs/workbench/services/extensions/common/extensions.js +2 -1
  386. package/vscode/src/vs/workbench/services/extensions/common/extensions.service.d.ts +4 -1
  387. package/vscode/src/vs/workbench/services/extensions/common/extensionsApiProposals.js +3 -3
  388. package/vscode/src/vs/workbench/services/language/common/languageService.js +23 -18
  389. package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +6 -4
  390. package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +50 -9
  391. package/vscode/src/vs/workbench/services/themes/common/workbenchThemeService.js +1 -0
  392. package/vscode/src/vs/workbench/services/userDataProfile/browser/iconSelectBox.js +97 -0
  393. package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopy.d.ts +7 -2
  394. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.js +2 -2
  395. package/vscode-dts/vscode.proposed.chatParticipant.d.ts +23 -45
  396. package/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts +65 -91
  397. package/vscode-dts/vscode.proposed.chatProvider.d.ts +9 -0
  398. package/vscode-dts/vscode.proposed.chatTab.d.ts +1 -5
  399. package/vscode-dts/vscode.proposed.contribAccessibilityHelpContent.d.ts +15 -0
  400. package/vscode-dts/vscode.proposed.debugFocus.d.ts +4 -4
  401. package/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts +2 -2
  402. package/vscode-dts/vscode.proposed.documentPaste.d.ts +144 -43
  403. package/vscode-dts/vscode.proposed.editorHoverVerbosityLevel.d.ts +76 -0
  404. package/vscode-dts/vscode.proposed.interactive.d.ts +1 -17
  405. package/vscode-dts/vscode.proposed.languageModels.d.ts +56 -11
  406. package/vscode-dts/vscode.proposed.newSymbolNamesProvider.d.ts +12 -1
  407. package/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts +4 -4
  408. package/vscode-dts/vscode.proposed.speech.d.ts +2 -1
  409. package/vscode-dts/vscode.proposed.terminalShellIntegration.d.ts +144 -38
  410. package/vscode-dts/vscode.proposed.testPreserveFocus.d.ts +28 -0
  411. package/vscode/src/vs/base/browser/ui/hover/updatableHoverWidget.d.ts +0 -21
  412. package/vscode/src/vs/base/browser/ui/hover/updatableHoverWidget.js +0 -214
  413. package/vscode/src/vs/editor/browser/services/hoverService/hoverService.d.ts +0 -32
  414. package/vscode/src/vs/editor/contrib/hover/browser/contentHover.js +0 -838
  415. package/vscode/src/vs/editor/contrib/hover/browser/hover.js +0 -621
  416. package/vscode/src/vs/platform/accessibility/common/accessibility.service.d.ts +0 -19
  417. package/vscode/src/vs/workbench/api/common/extHostChat.js +0 -54
  418. package/vscode/src/vs/workbench/api/common/extHostIssueReporter.js +0 -70
  419. package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/accessibilitySignal.contribution.js +0 -237
  420. package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/accessibilitySignalDebuggerContribution.js +0 -49
  421. package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/accessibilitySignalLineFeatureContribution.js +0 -178
  422. package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/commands.js +0 -141
  423. package/vscode/src/vs/workbench/contrib/chat/common/chatContributionService.service.js +0 -3
  424. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatFileCreationWidget.js +0 -212
  425. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/OutlineEntry.js +0 -95
  426. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +0 -110
  427. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProvider.js +0 -224
  428. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.d.ts +0 -48
  429. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEvents.js +0 -47
  430. package/vscode-dts/vscode.proposed.dropMetadata.d.ts +0 -65
  431. package/vscode-dts/vscode.proposed.handleIssueUri.d.ts +0 -57
  432. package/vscode-dts/vscode.proposed.windowActivity.d.ts +0 -17
  433. /package/vscode/src/vs/workbench/browser/parts/editor/{editor.autosave.contribution.js → editor.contribution._autosave.js} +0 -0
  434. /package/vscode/src/vs/workbench/contrib/files/browser/{files.fileEditorFactory.contribution.js → files.contribution._fileEditorFactory.js} +0 -0
@@ -1,838 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { addStandardDisposableListener, Dimension, append, trackFocus, getClientArea, getDomNodePagePosition, getTotalHeight, getTotalWidth, $ as $$1 } from '../../../../base/browser/dom.js';
3
- import { HoverWidget, getHoverAccessibleViewHint, HoverAction } from '../../../../base/browser/ui/hover/hoverWidget.js';
4
- import { coalesce } from '../../../../base/common/arrays.js';
5
- import { Disposable, toDisposable, DisposableStore } from '../../../../base/common/lifecycle.js';
6
- import { Position } from '../../../common/core/position.js';
7
- import { Range } from '../../../common/core/range.js';
8
- import { ModelDecorationOptions } from '../../../common/model/textModel.js';
9
- import { TokenizationRegistry } from '../../../common/languages.js';
10
- import { HoverOperation } from './hoverOperation.js';
11
- import { HoverParticipantRegistry, HoverRangeAnchor } from './hoverTypes.js';
12
- import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
13
- import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.service.js';
14
- import { AsyncIterableObject } from '../../../../base/common/async.js';
15
- import { EditorContextKeys } from '../../../common/editorContextKeys.js';
16
- import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.service.js';
17
- import { ResizableContentWidget } from './resizableContentWidget.js';
18
- import { IConfigurationService } from '../../../../platform/configuration/common/configuration.service.js';
19
- import { IAccessibilityService } from '../../../../platform/accessibility/common/accessibility.service.js';
20
- var ContentHoverController_1, ContentHoverWidget_1;
21
- const $ = $$1;
22
- let ContentHoverController = class ContentHoverController extends Disposable {
23
- static { ContentHoverController_1 = this; }
24
- constructor(_editor, _instantiationService, _keybindingService) {
25
- super();
26
- this._editor = _editor;
27
- this._instantiationService = _instantiationService;
28
- this._keybindingService = _keybindingService;
29
- this._currentResult = null;
30
- this._widget = this._register(this._instantiationService.createInstance(ContentHoverWidget, this._editor));
31
- this._participants = [];
32
- for (const participant of HoverParticipantRegistry.getAll()) {
33
- this._participants.push(this._instantiationService.createInstance(participant, this._editor));
34
- }
35
- this._participants.sort((p1, p2) => p1.hoverOrdinal - p2.hoverOrdinal);
36
- this._computer = ( new ContentHoverComputer(this._editor, this._participants));
37
- this._hoverOperation = this._register(( new HoverOperation(this._editor, this._computer)));
38
- this._register(this._hoverOperation.onResult((result) => {
39
- if (!this._computer.anchor) {
40
- return;
41
- }
42
- const messages = (result.hasLoadingMessage ? this._addLoadingMessage(result.value) : result.value);
43
- this._withResult(( new HoverResult(this._computer.anchor, messages, result.isComplete)));
44
- }));
45
- this._register(addStandardDisposableListener(this._widget.getDomNode(), 'keydown', (e) => {
46
- if (e.equals(9 )) {
47
- this.hide();
48
- }
49
- }));
50
- this._register(TokenizationRegistry.onDidChange(() => {
51
- if (this._widget.position && this._currentResult) {
52
- this._setCurrentResult(this._currentResult);
53
- }
54
- }));
55
- }
56
- _startShowingOrUpdateHover(anchor, mode, source, focus, mouseEvent) {
57
- if (!this._widget.position || !this._currentResult) {
58
- if (anchor) {
59
- this._startHoverOperationIfNecessary(anchor, mode, source, focus, false);
60
- return true;
61
- }
62
- return false;
63
- }
64
- const isHoverSticky = this._editor.getOption(60 ).sticky;
65
- const isGettingCloser = (isHoverSticky
66
- && mouseEvent
67
- && this._widget.isMouseGettingCloser(mouseEvent.event.posx, mouseEvent.event.posy));
68
- if (isGettingCloser) {
69
- if (anchor) {
70
- this._startHoverOperationIfNecessary(anchor, mode, source, focus, true);
71
- }
72
- return true;
73
- }
74
- if (!anchor) {
75
- this._setCurrentResult(null);
76
- return false;
77
- }
78
- if (anchor && this._currentResult.anchor.equals(anchor)) {
79
- return true;
80
- }
81
- if (!anchor.canAdoptVisibleHover(this._currentResult.anchor, this._widget.position)) {
82
- this._setCurrentResult(null);
83
- this._startHoverOperationIfNecessary(anchor, mode, source, focus, false);
84
- return true;
85
- }
86
- this._setCurrentResult(this._currentResult.filter(anchor));
87
- this._startHoverOperationIfNecessary(anchor, mode, source, focus, false);
88
- return true;
89
- }
90
- _startHoverOperationIfNecessary(anchor, mode, source, focus, insistOnKeepingHoverVisible) {
91
- if (this._computer.anchor && this._computer.anchor.equals(anchor)) {
92
- return;
93
- }
94
- this._hoverOperation.cancel();
95
- this._computer.anchor = anchor;
96
- this._computer.shouldFocus = focus;
97
- this._computer.source = source;
98
- this._computer.insistOnKeepingHoverVisible = insistOnKeepingHoverVisible;
99
- this._hoverOperation.start(mode);
100
- }
101
- _setCurrentResult(hoverResult) {
102
- if (this._currentResult === hoverResult) {
103
- return;
104
- }
105
- if (hoverResult && hoverResult.messages.length === 0) {
106
- hoverResult = null;
107
- }
108
- this._currentResult = hoverResult;
109
- if (this._currentResult) {
110
- this._renderMessages(this._currentResult.anchor, this._currentResult.messages);
111
- }
112
- else {
113
- this._widget.hide();
114
- }
115
- }
116
- _addLoadingMessage(result) {
117
- if (this._computer.anchor) {
118
- for (const participant of this._participants) {
119
- if (participant.createLoadingMessage) {
120
- const loadingMessage = participant.createLoadingMessage(this._computer.anchor);
121
- if (loadingMessage) {
122
- return result.slice(0).concat([loadingMessage]);
123
- }
124
- }
125
- }
126
- }
127
- return result;
128
- }
129
- _withResult(hoverResult) {
130
- if (this._widget.position && this._currentResult && this._currentResult.isComplete) {
131
- if (!hoverResult.isComplete) {
132
- return;
133
- }
134
- if (this._computer.insistOnKeepingHoverVisible && hoverResult.messages.length === 0) {
135
- return;
136
- }
137
- }
138
- this._setCurrentResult(hoverResult);
139
- }
140
- _renderMessages(anchor, messages) {
141
- const { showAtPosition, showAtSecondaryPosition, highlightRange } = ContentHoverController_1.computeHoverRanges(this._editor, anchor.range, messages);
142
- const disposables = ( new DisposableStore());
143
- const statusBar = disposables.add(( new EditorHoverStatusBar(this._keybindingService)));
144
- const fragment = document.createDocumentFragment();
145
- let colorPicker = null;
146
- const context = {
147
- fragment,
148
- statusBar,
149
- setColorPicker: (widget) => colorPicker = widget,
150
- onContentsChanged: () => this._widget.onContentsChanged(),
151
- setMinimumDimensions: (dimensions) => this._widget.setMinimumDimensions(dimensions),
152
- hide: () => this.hide()
153
- };
154
- for (const participant of this._participants) {
155
- const hoverParts = messages.filter(msg => msg.owner === participant);
156
- if (hoverParts.length > 0) {
157
- disposables.add(participant.renderHoverParts(context, hoverParts));
158
- }
159
- }
160
- const isBeforeContent = ( messages.some(m => m.isBeforeContent));
161
- if (statusBar.hasContent) {
162
- fragment.appendChild(statusBar.hoverElement);
163
- }
164
- if (fragment.hasChildNodes()) {
165
- if (highlightRange) {
166
- const highlightDecoration = this._editor.createDecorationsCollection();
167
- highlightDecoration.set([{
168
- range: highlightRange,
169
- options: ContentHoverController_1._DECORATION_OPTIONS
170
- }]);
171
- disposables.add(toDisposable(() => {
172
- highlightDecoration.clear();
173
- }));
174
- }
175
- this._widget.showAt(fragment, ( new ContentHoverVisibleData(
176
- anchor.initialMousePosX,
177
- anchor.initialMousePosY,
178
- colorPicker,
179
- showAtPosition,
180
- showAtSecondaryPosition,
181
- this._editor.getOption(60 ).above,
182
- this._computer.shouldFocus,
183
- this._computer.source,
184
- isBeforeContent,
185
- disposables
186
- )));
187
- }
188
- else {
189
- disposables.dispose();
190
- }
191
- }
192
- static { this._DECORATION_OPTIONS = ModelDecorationOptions.register({
193
- description: 'content-hover-highlight',
194
- className: 'hoverHighlight'
195
- }); }
196
- static computeHoverRanges(editor, anchorRange, messages) {
197
- let startColumnBoundary = 1;
198
- if (editor.hasModel()) {
199
- const viewModel = editor._getViewModel();
200
- const coordinatesConverter = viewModel.coordinatesConverter;
201
- const anchorViewRange = coordinatesConverter.convertModelRangeToViewRange(anchorRange);
202
- const anchorViewRangeStart = ( new Position(
203
- anchorViewRange.startLineNumber,
204
- viewModel.getLineMinColumn(anchorViewRange.startLineNumber)
205
- ));
206
- startColumnBoundary = coordinatesConverter.convertViewPositionToModelPosition(anchorViewRangeStart).column;
207
- }
208
- const anchorLineNumber = anchorRange.startLineNumber;
209
- let renderStartColumn = anchorRange.startColumn;
210
- let highlightRange = messages[0].range;
211
- let forceShowAtRange = null;
212
- for (const msg of messages) {
213
- highlightRange = Range.plusRange(highlightRange, msg.range);
214
- if (msg.range.startLineNumber === anchorLineNumber && msg.range.endLineNumber === anchorLineNumber) {
215
- renderStartColumn = Math.max(Math.min(renderStartColumn, msg.range.startColumn), startColumnBoundary);
216
- }
217
- if (msg.forceShowAtRange) {
218
- forceShowAtRange = msg.range;
219
- }
220
- }
221
- const showAtPosition = forceShowAtRange ? forceShowAtRange.getStartPosition() : ( new Position(anchorLineNumber, anchorRange.startColumn));
222
- const showAtSecondaryPosition = forceShowAtRange ? forceShowAtRange.getStartPosition() : ( new Position(anchorLineNumber, renderStartColumn));
223
- return {
224
- showAtPosition,
225
- showAtSecondaryPosition,
226
- highlightRange
227
- };
228
- }
229
- showsOrWillShow(mouseEvent) {
230
- if (this._widget.isResizing) {
231
- return true;
232
- }
233
- const anchorCandidates = [];
234
- for (const participant of this._participants) {
235
- if (participant.suggestHoverAnchor) {
236
- const anchor = participant.suggestHoverAnchor(mouseEvent);
237
- if (anchor) {
238
- anchorCandidates.push(anchor);
239
- }
240
- }
241
- }
242
- const target = mouseEvent.target;
243
- if (target.type === 6 ) {
244
- anchorCandidates.push(( new HoverRangeAnchor(0, target.range, mouseEvent.event.posx, mouseEvent.event.posy)));
245
- }
246
- if (target.type === 7 ) {
247
- const epsilon = this._editor.getOption(50 ).typicalHalfwidthCharacterWidth / 2;
248
- if (!target.detail.isAfterLines
249
- && typeof target.detail.horizontalDistanceToText === 'number'
250
- && target.detail.horizontalDistanceToText < epsilon) {
251
- anchorCandidates.push(( new HoverRangeAnchor(0, target.range, mouseEvent.event.posx, mouseEvent.event.posy)));
252
- }
253
- }
254
- if (anchorCandidates.length === 0) {
255
- return this._startShowingOrUpdateHover(null, 0 , 0 , false, mouseEvent);
256
- }
257
- anchorCandidates.sort((a, b) => b.priority - a.priority);
258
- return this._startShowingOrUpdateHover(anchorCandidates[0], 0 , 0 , false, mouseEvent);
259
- }
260
- startShowingAtRange(range, mode, source, focus) {
261
- this._startShowingOrUpdateHover(( new HoverRangeAnchor(0, range, undefined, undefined)), mode, source, focus, null);
262
- }
263
- getWidgetContent() {
264
- const node = this._widget.getDomNode();
265
- if (!node.textContent) {
266
- return undefined;
267
- }
268
- return node.textContent;
269
- }
270
- containsNode(node) {
271
- return (node ? this._widget.getDomNode().contains(node) : false);
272
- }
273
- focus() {
274
- this._widget.focus();
275
- }
276
- scrollUp() {
277
- this._widget.scrollUp();
278
- }
279
- scrollDown() {
280
- this._widget.scrollDown();
281
- }
282
- scrollLeft() {
283
- this._widget.scrollLeft();
284
- }
285
- scrollRight() {
286
- this._widget.scrollRight();
287
- }
288
- pageUp() {
289
- this._widget.pageUp();
290
- }
291
- pageDown() {
292
- this._widget.pageDown();
293
- }
294
- goToTop() {
295
- this._widget.goToTop();
296
- }
297
- goToBottom() {
298
- this._widget.goToBottom();
299
- }
300
- hide() {
301
- this._computer.anchor = null;
302
- this._hoverOperation.cancel();
303
- this._setCurrentResult(null);
304
- }
305
- get isColorPickerVisible() {
306
- return this._widget.isColorPickerVisible;
307
- }
308
- get isVisibleFromKeyboard() {
309
- return this._widget.isVisibleFromKeyboard;
310
- }
311
- get isVisible() {
312
- return this._widget.isVisible;
313
- }
314
- get isFocused() {
315
- return this._widget.isFocused;
316
- }
317
- get isResizing() {
318
- return this._widget.isResizing;
319
- }
320
- get widget() {
321
- return this._widget;
322
- }
323
- };
324
- ContentHoverController = ContentHoverController_1 = ( __decorate([
325
- ( __param(1, IInstantiationService)),
326
- ( __param(2, IKeybindingService))
327
- ], ContentHoverController));
328
- class HoverResult {
329
- constructor(anchor, messages, isComplete) {
330
- this.anchor = anchor;
331
- this.messages = messages;
332
- this.isComplete = isComplete;
333
- }
334
- filter(anchor) {
335
- const filteredMessages = this.messages.filter((m) => m.isValidForHoverAnchor(anchor));
336
- if (filteredMessages.length === this.messages.length) {
337
- return this;
338
- }
339
- return ( new FilteredHoverResult(this, this.anchor, filteredMessages, this.isComplete));
340
- }
341
- }
342
- class FilteredHoverResult extends HoverResult {
343
- constructor(original, anchor, messages, isComplete) {
344
- super(anchor, messages, isComplete);
345
- this.original = original;
346
- }
347
- filter(anchor) {
348
- return this.original.filter(anchor);
349
- }
350
- }
351
- class ContentHoverVisibleData {
352
- constructor(initialMousePosX, initialMousePosY, colorPicker, showAtPosition, showAtSecondaryPosition, preferAbove, stoleFocus, source, isBeforeContent, disposables) {
353
- this.initialMousePosX = initialMousePosX;
354
- this.initialMousePosY = initialMousePosY;
355
- this.colorPicker = colorPicker;
356
- this.showAtPosition = showAtPosition;
357
- this.showAtSecondaryPosition = showAtSecondaryPosition;
358
- this.preferAbove = preferAbove;
359
- this.stoleFocus = stoleFocus;
360
- this.source = source;
361
- this.isBeforeContent = isBeforeContent;
362
- this.disposables = disposables;
363
- this.closestMouseDistance = undefined;
364
- }
365
- }
366
- const HORIZONTAL_SCROLLING_BY = 30;
367
- const SCROLLBAR_WIDTH = 10;
368
- const CONTAINER_HEIGHT_PADDING = 6;
369
- let ContentHoverWidget = class ContentHoverWidget extends ResizableContentWidget {
370
- static { ContentHoverWidget_1 = this; }
371
- static { this.ID = 'editor.contrib.resizableContentHoverWidget'; }
372
- static { this._lastDimensions = new Dimension(0, 0); }
373
- get isColorPickerVisible() {
374
- return Boolean(this._visibleData?.colorPicker);
375
- }
376
- get isVisibleFromKeyboard() {
377
- return (this._visibleData?.source === 1) ;
378
- }
379
- get isVisible() {
380
- return this._hoverVisibleKey.get() ?? false;
381
- }
382
- get isFocused() {
383
- return this._hoverFocusedKey.get() ?? false;
384
- }
385
- constructor(editor, contextKeyService, _configurationService, _accessibilityService, _keybindingService) {
386
- const minimumHeight = editor.getOption(67 ) + 8;
387
- const minimumWidth = 150;
388
- const minimumSize = new Dimension(minimumWidth, minimumHeight);
389
- super(editor, minimumSize);
390
- this._configurationService = _configurationService;
391
- this._accessibilityService = _accessibilityService;
392
- this._keybindingService = _keybindingService;
393
- this._hover = this._register(( new HoverWidget()));
394
- this._minimumSize = minimumSize;
395
- this._hoverVisibleKey = EditorContextKeys.hoverVisible.bindTo(contextKeyService);
396
- this._hoverFocusedKey = EditorContextKeys.hoverFocused.bindTo(contextKeyService);
397
- append(this._resizableNode.domNode, this._hover.containerDomNode);
398
- this._resizableNode.domNode.style.zIndex = '50';
399
- this._register(this._editor.onDidLayoutChange(() => {
400
- if (this.isVisible) {
401
- this._updateMaxDimensions();
402
- }
403
- }));
404
- this._register(this._editor.onDidChangeConfiguration((e) => {
405
- if (e.hasChanged(50 )) {
406
- this._updateFont();
407
- }
408
- }));
409
- const focusTracker = this._register(trackFocus(this._resizableNode.domNode));
410
- this._register(focusTracker.onDidFocus(() => {
411
- this._hoverFocusedKey.set(true);
412
- }));
413
- this._register(focusTracker.onDidBlur(() => {
414
- this._hoverFocusedKey.set(false);
415
- }));
416
- this._setHoverData(undefined);
417
- this._editor.addContentWidget(this);
418
- }
419
- dispose() {
420
- super.dispose();
421
- this._visibleData?.disposables.dispose();
422
- this._editor.removeContentWidget(this);
423
- }
424
- getId() {
425
- return ContentHoverWidget_1.ID;
426
- }
427
- static _applyDimensions(container, width, height) {
428
- const transformedWidth = typeof width === 'number' ? `${width}px` : width;
429
- const transformedHeight = typeof height === 'number' ? `${height}px` : height;
430
- container.style.width = transformedWidth;
431
- container.style.height = transformedHeight;
432
- }
433
- _setContentsDomNodeDimensions(width, height) {
434
- const contentsDomNode = this._hover.contentsDomNode;
435
- return ContentHoverWidget_1._applyDimensions(contentsDomNode, width, height);
436
- }
437
- _setContainerDomNodeDimensions(width, height) {
438
- const containerDomNode = this._hover.containerDomNode;
439
- return ContentHoverWidget_1._applyDimensions(containerDomNode, width, height);
440
- }
441
- _setHoverWidgetDimensions(width, height) {
442
- this._setContentsDomNodeDimensions(width, height);
443
- this._setContainerDomNodeDimensions(width, height);
444
- this._layoutContentWidget();
445
- }
446
- static _applyMaxDimensions(container, width, height) {
447
- const transformedWidth = typeof width === 'number' ? `${width}px` : width;
448
- const transformedHeight = typeof height === 'number' ? `${height}px` : height;
449
- container.style.maxWidth = transformedWidth;
450
- container.style.maxHeight = transformedHeight;
451
- }
452
- _setHoverWidgetMaxDimensions(width, height) {
453
- ContentHoverWidget_1._applyMaxDimensions(this._hover.contentsDomNode, width, height);
454
- ContentHoverWidget_1._applyMaxDimensions(this._hover.containerDomNode, width, height);
455
- this._hover.containerDomNode.style.setProperty('--vscode-hover-maxWidth', typeof width === 'number' ? `${width}px` : width);
456
- this._layoutContentWidget();
457
- }
458
- _hasHorizontalScrollbar() {
459
- const scrollDimensions = this._hover.scrollbar.getScrollDimensions();
460
- const hasHorizontalScrollbar = scrollDimensions.scrollWidth > scrollDimensions.width;
461
- return hasHorizontalScrollbar;
462
- }
463
- _adjustContentsBottomPadding() {
464
- const contentsDomNode = this._hover.contentsDomNode;
465
- const extraBottomPadding = `${this._hover.scrollbar.options.horizontalScrollbarSize}px`;
466
- if (contentsDomNode.style.paddingBottom !== extraBottomPadding) {
467
- contentsDomNode.style.paddingBottom = extraBottomPadding;
468
- }
469
- }
470
- _setAdjustedHoverWidgetDimensions(size) {
471
- this._setHoverWidgetMaxDimensions('none', 'none');
472
- const width = size.width;
473
- const height = size.height;
474
- this._setHoverWidgetDimensions(width, height);
475
- if (this._hasHorizontalScrollbar()) {
476
- this._adjustContentsBottomPadding();
477
- this._setContentsDomNodeDimensions(width, height - SCROLLBAR_WIDTH);
478
- }
479
- }
480
- _updateResizableNodeMaxDimensions() {
481
- const maxRenderingWidth = this._findMaximumRenderingWidth() ?? Infinity;
482
- const maxRenderingHeight = this._findMaximumRenderingHeight() ?? Infinity;
483
- this._resizableNode.maxSize = new Dimension(maxRenderingWidth, maxRenderingHeight);
484
- this._setHoverWidgetMaxDimensions(maxRenderingWidth, maxRenderingHeight);
485
- }
486
- _resize(size) {
487
- ContentHoverWidget_1._lastDimensions = new Dimension(size.width, size.height);
488
- this._setAdjustedHoverWidgetDimensions(size);
489
- this._resizableNode.layout(size.height, size.width);
490
- this._updateResizableNodeMaxDimensions();
491
- this._hover.scrollbar.scanDomNode();
492
- this._editor.layoutContentWidget(this);
493
- this._visibleData?.colorPicker?.layout();
494
- }
495
- _findAvailableSpaceVertically() {
496
- const position = this._visibleData?.showAtPosition;
497
- if (!position) {
498
- return;
499
- }
500
- return this._positionPreference === 1 ?
501
- this._availableVerticalSpaceAbove(position)
502
- : this._availableVerticalSpaceBelow(position);
503
- }
504
- _findMaximumRenderingHeight() {
505
- const availableSpace = this._findAvailableSpaceVertically();
506
- if (!availableSpace) {
507
- return;
508
- }
509
- let maximumHeight = CONTAINER_HEIGHT_PADDING;
510
- Array.from(this._hover.contentsDomNode.children).forEach((hoverPart) => {
511
- maximumHeight += hoverPart.clientHeight;
512
- });
513
- if (this._hasHorizontalScrollbar()) {
514
- maximumHeight += SCROLLBAR_WIDTH;
515
- }
516
- return Math.min(availableSpace, maximumHeight);
517
- }
518
- _isHoverTextOverflowing() {
519
- this._hover.containerDomNode.style.setProperty('--vscode-hover-whiteSpace', 'nowrap');
520
- this._hover.containerDomNode.style.setProperty('--vscode-hover-sourceWhiteSpace', 'nowrap');
521
- const overflowing = ( Array.from(this._hover.contentsDomNode.children).some((hoverElement) => {
522
- return hoverElement.scrollWidth > hoverElement.clientWidth;
523
- }));
524
- this._hover.containerDomNode.style.removeProperty('--vscode-hover-whiteSpace');
525
- this._hover.containerDomNode.style.removeProperty('--vscode-hover-sourceWhiteSpace');
526
- return overflowing;
527
- }
528
- _findMaximumRenderingWidth() {
529
- if (!this._editor || !this._editor.hasModel()) {
530
- return;
531
- }
532
- const overflowing = this._isHoverTextOverflowing();
533
- const initialWidth = ((typeof this._contentWidth === 'undefined' ? 0 : this._contentWidth - 2)
534
- );
535
- if (overflowing || this._hover.containerDomNode.clientWidth < initialWidth) {
536
- const bodyBoxWidth = getClientArea(this._hover.containerDomNode.ownerDocument.body).width;
537
- const horizontalPadding = 14;
538
- return bodyBoxWidth - horizontalPadding;
539
- }
540
- else {
541
- return this._hover.containerDomNode.clientWidth + 2;
542
- }
543
- }
544
- isMouseGettingCloser(posx, posy) {
545
- if (!this._visibleData) {
546
- return false;
547
- }
548
- if (typeof this._visibleData.initialMousePosX === 'undefined'
549
- || typeof this._visibleData.initialMousePosY === 'undefined') {
550
- this._visibleData.initialMousePosX = posx;
551
- this._visibleData.initialMousePosY = posy;
552
- return false;
553
- }
554
- const widgetRect = getDomNodePagePosition(this.getDomNode());
555
- if (typeof this._visibleData.closestMouseDistance === 'undefined') {
556
- this._visibleData.closestMouseDistance = computeDistanceFromPointToRectangle(this._visibleData.initialMousePosX, this._visibleData.initialMousePosY, widgetRect.left, widgetRect.top, widgetRect.width, widgetRect.height);
557
- }
558
- const distance = computeDistanceFromPointToRectangle(posx, posy, widgetRect.left, widgetRect.top, widgetRect.width, widgetRect.height);
559
- if (distance > this._visibleData.closestMouseDistance + 4 ) {
560
- return false;
561
- }
562
- this._visibleData.closestMouseDistance = Math.min(this._visibleData.closestMouseDistance, distance);
563
- return true;
564
- }
565
- _setHoverData(hoverData) {
566
- this._visibleData?.disposables.dispose();
567
- this._visibleData = hoverData;
568
- this._hoverVisibleKey.set(!!hoverData);
569
- this._hover.containerDomNode.classList.toggle('hidden', !hoverData);
570
- }
571
- _updateFont() {
572
- const { fontSize, lineHeight } = this._editor.getOption(50 );
573
- const contentsDomNode = this._hover.contentsDomNode;
574
- contentsDomNode.style.fontSize = `${fontSize}px`;
575
- contentsDomNode.style.lineHeight = `${lineHeight / fontSize}`;
576
- const codeClasses = Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName('code'));
577
- codeClasses.forEach(node => this._editor.applyFontInfo(node));
578
- }
579
- _updateContent(node) {
580
- const contentsDomNode = this._hover.contentsDomNode;
581
- contentsDomNode.style.paddingBottom = '';
582
- contentsDomNode.textContent = '';
583
- contentsDomNode.appendChild(node);
584
- }
585
- _layoutContentWidget() {
586
- this._editor.layoutContentWidget(this);
587
- this._hover.onContentsChanged();
588
- }
589
- _updateMaxDimensions() {
590
- const height = Math.max(this._editor.getLayoutInfo().height / 4, 250, ContentHoverWidget_1._lastDimensions.height);
591
- const width = Math.max(this._editor.getLayoutInfo().width * 0.66, 500, ContentHoverWidget_1._lastDimensions.width);
592
- this._setHoverWidgetMaxDimensions(width, height);
593
- }
594
- _render(node, hoverData) {
595
- this._setHoverData(hoverData);
596
- this._updateFont();
597
- this._updateContent(node);
598
- this._updateMaxDimensions();
599
- this.onContentsChanged();
600
- this._editor.render();
601
- }
602
- getPosition() {
603
- if (!this._visibleData) {
604
- return null;
605
- }
606
- return {
607
- position: this._visibleData.showAtPosition,
608
- secondaryPosition: this._visibleData.showAtSecondaryPosition,
609
- positionAffinity: this._visibleData.isBeforeContent ? 3 : undefined,
610
- preference: [this._positionPreference ?? 1 ]
611
- };
612
- }
613
- showAt(node, hoverData) {
614
- if (!this._editor || !this._editor.hasModel()) {
615
- return;
616
- }
617
- this._render(node, hoverData);
618
- const widgetHeight = getTotalHeight(this._hover.containerDomNode);
619
- const widgetPosition = hoverData.showAtPosition;
620
- this._positionPreference = this._findPositionPreference(widgetHeight, widgetPosition) ?? 1 ;
621
- this.onContentsChanged();
622
- if (hoverData.stoleFocus) {
623
- this._hover.containerDomNode.focus();
624
- }
625
- hoverData.colorPicker?.layout();
626
- const hoverFocused = this._hover.containerDomNode.ownerDocument.activeElement === this._hover.containerDomNode;
627
- const accessibleViewHint = hoverFocused && getHoverAccessibleViewHint(this._configurationService.getValue('accessibility.verbosity.hover') === true && this._accessibilityService.isScreenReaderOptimized(), this._keybindingService.lookupKeybinding('editor.action.accessibleView')?.getAriaLabel() ?? '');
628
- if (accessibleViewHint) {
629
- this._hover.contentsDomNode.ariaLabel = this._hover.contentsDomNode.textContent + ', ' + accessibleViewHint;
630
- }
631
- }
632
- hide() {
633
- if (!this._visibleData) {
634
- return;
635
- }
636
- const stoleFocus = this._visibleData.stoleFocus || this._hoverFocusedKey.get();
637
- this._setHoverData(undefined);
638
- this._resizableNode.maxSize = new Dimension(Infinity, Infinity);
639
- this._resizableNode.clearSashHoverState();
640
- this._hoverFocusedKey.set(false);
641
- this._editor.layoutContentWidget(this);
642
- if (stoleFocus) {
643
- this._editor.focus();
644
- }
645
- }
646
- _removeConstraintsRenderNormally() {
647
- const layoutInfo = this._editor.getLayoutInfo();
648
- this._resizableNode.layout(layoutInfo.height, layoutInfo.width);
649
- this._setHoverWidgetDimensions('auto', 'auto');
650
- }
651
- _adjustHoverHeightForScrollbar(height) {
652
- const containerDomNode = this._hover.containerDomNode;
653
- const contentsDomNode = this._hover.contentsDomNode;
654
- const maxRenderingHeight = this._findMaximumRenderingHeight() ?? Infinity;
655
- this._setContainerDomNodeDimensions(getTotalWidth(containerDomNode), Math.min(maxRenderingHeight, height));
656
- this._setContentsDomNodeDimensions(getTotalWidth(contentsDomNode), Math.min(maxRenderingHeight, height - SCROLLBAR_WIDTH));
657
- }
658
- setMinimumDimensions(dimensions) {
659
- this._minimumSize = new Dimension(Math.max(this._minimumSize.width, dimensions.width), Math.max(this._minimumSize.height, dimensions.height));
660
- this._updateMinimumWidth();
661
- }
662
- _updateMinimumWidth() {
663
- const width = (typeof this._contentWidth === 'undefined'
664
- ? this._minimumSize.width
665
- : Math.min(this._contentWidth, this._minimumSize.width));
666
- this._resizableNode.minSize = new Dimension(width, this._minimumSize.height);
667
- }
668
- onContentsChanged() {
669
- this._removeConstraintsRenderNormally();
670
- const containerDomNode = this._hover.containerDomNode;
671
- let height = getTotalHeight(containerDomNode);
672
- let width = getTotalWidth(containerDomNode);
673
- this._resizableNode.layout(height, width);
674
- this._setHoverWidgetDimensions(width, height);
675
- height = getTotalHeight(containerDomNode);
676
- width = getTotalWidth(containerDomNode);
677
- this._contentWidth = width;
678
- this._updateMinimumWidth();
679
- this._resizableNode.layout(height, width);
680
- if (this._hasHorizontalScrollbar()) {
681
- this._adjustContentsBottomPadding();
682
- this._adjustHoverHeightForScrollbar(height);
683
- }
684
- if (this._visibleData?.showAtPosition) {
685
- const widgetHeight = getTotalHeight(this._hover.containerDomNode);
686
- this._positionPreference = this._findPositionPreference(widgetHeight, this._visibleData.showAtPosition);
687
- }
688
- this._layoutContentWidget();
689
- }
690
- focus() {
691
- this._hover.containerDomNode.focus();
692
- }
693
- scrollUp() {
694
- const scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop;
695
- const fontInfo = this._editor.getOption(50 );
696
- this._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop - fontInfo.lineHeight });
697
- }
698
- scrollDown() {
699
- const scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop;
700
- const fontInfo = this._editor.getOption(50 );
701
- this._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop + fontInfo.lineHeight });
702
- }
703
- scrollLeft() {
704
- const scrollLeft = this._hover.scrollbar.getScrollPosition().scrollLeft;
705
- this._hover.scrollbar.setScrollPosition({ scrollLeft: scrollLeft - HORIZONTAL_SCROLLING_BY });
706
- }
707
- scrollRight() {
708
- const scrollLeft = this._hover.scrollbar.getScrollPosition().scrollLeft;
709
- this._hover.scrollbar.setScrollPosition({ scrollLeft: scrollLeft + HORIZONTAL_SCROLLING_BY });
710
- }
711
- pageUp() {
712
- const scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop;
713
- const scrollHeight = this._hover.scrollbar.getScrollDimensions().height;
714
- this._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop - scrollHeight });
715
- }
716
- pageDown() {
717
- const scrollTop = this._hover.scrollbar.getScrollPosition().scrollTop;
718
- const scrollHeight = this._hover.scrollbar.getScrollDimensions().height;
719
- this._hover.scrollbar.setScrollPosition({ scrollTop: scrollTop + scrollHeight });
720
- }
721
- goToTop() {
722
- this._hover.scrollbar.setScrollPosition({ scrollTop: 0 });
723
- }
724
- goToBottom() {
725
- this._hover.scrollbar.setScrollPosition({ scrollTop: this._hover.scrollbar.getScrollDimensions().scrollHeight });
726
- }
727
- };
728
- ContentHoverWidget = ContentHoverWidget_1 = ( __decorate([
729
- ( __param(1, IContextKeyService)),
730
- ( __param(2, IConfigurationService)),
731
- ( __param(3, IAccessibilityService)),
732
- ( __param(4, IKeybindingService))
733
- ], ContentHoverWidget));
734
- let EditorHoverStatusBar = class EditorHoverStatusBar extends Disposable {
735
- get hasContent() {
736
- return this._hasContent;
737
- }
738
- constructor(_keybindingService) {
739
- super();
740
- this._keybindingService = _keybindingService;
741
- this._hasContent = false;
742
- this.hoverElement = $('div.hover-row.status-bar');
743
- this.actionsElement = append(this.hoverElement, $('div.actions'));
744
- }
745
- addAction(actionOptions) {
746
- const keybinding = this._keybindingService.lookupKeybinding(actionOptions.commandId);
747
- const keybindingLabel = keybinding ? keybinding.getLabel() : null;
748
- this._hasContent = true;
749
- return this._register(HoverAction.render(this.actionsElement, actionOptions, keybindingLabel));
750
- }
751
- append(element) {
752
- const result = append(this.actionsElement, element);
753
- this._hasContent = true;
754
- return result;
755
- }
756
- };
757
- EditorHoverStatusBar = ( __decorate([
758
- ( __param(0, IKeybindingService))
759
- ], EditorHoverStatusBar));
760
- class ContentHoverComputer {
761
- get anchor() { return this._anchor; }
762
- set anchor(value) { this._anchor = value; }
763
- get shouldFocus() { return this._shouldFocus; }
764
- set shouldFocus(value) { this._shouldFocus = value; }
765
- get source() { return this._source; }
766
- set source(value) { this._source = value; }
767
- get insistOnKeepingHoverVisible() { return this._insistOnKeepingHoverVisible; }
768
- set insistOnKeepingHoverVisible(value) { this._insistOnKeepingHoverVisible = value; }
769
- constructor(_editor, _participants) {
770
- this._editor = _editor;
771
- this._participants = _participants;
772
- this._anchor = null;
773
- this._shouldFocus = false;
774
- this._source = 0 ;
775
- this._insistOnKeepingHoverVisible = false;
776
- }
777
- static _getLineDecorations(editor, anchor) {
778
- if (anchor.type !== 1 && !anchor.supportsMarkerHover) {
779
- return [];
780
- }
781
- const model = editor.getModel();
782
- const lineNumber = anchor.range.startLineNumber;
783
- if (lineNumber > model.getLineCount()) {
784
- return [];
785
- }
786
- const maxColumn = model.getLineMaxColumn(lineNumber);
787
- return editor.getLineDecorations(lineNumber).filter((d) => {
788
- if (d.options.isWholeLine) {
789
- return true;
790
- }
791
- const startColumn = (d.range.startLineNumber === lineNumber) ? d.range.startColumn : 1;
792
- const endColumn = (d.range.endLineNumber === lineNumber) ? d.range.endColumn : maxColumn;
793
- if (d.options.showIfCollapsed) {
794
- if (startColumn > anchor.range.startColumn + 1 || anchor.range.endColumn - 1 > endColumn) {
795
- return false;
796
- }
797
- }
798
- else {
799
- if (startColumn > anchor.range.startColumn || anchor.range.endColumn > endColumn) {
800
- return false;
801
- }
802
- }
803
- return true;
804
- });
805
- }
806
- computeAsync(token) {
807
- const anchor = this._anchor;
808
- if (!this._editor.hasModel() || !anchor) {
809
- return AsyncIterableObject.EMPTY;
810
- }
811
- const lineDecorations = ContentHoverComputer._getLineDecorations(this._editor, anchor);
812
- return AsyncIterableObject.merge(( this._participants.map((participant) => {
813
- if (!participant.computeAsync) {
814
- return AsyncIterableObject.EMPTY;
815
- }
816
- return participant.computeAsync(anchor, lineDecorations, token);
817
- })));
818
- }
819
- computeSync() {
820
- if (!this._editor.hasModel() || !this._anchor) {
821
- return [];
822
- }
823
- const lineDecorations = ContentHoverComputer._getLineDecorations(this._editor, this._anchor);
824
- let result = [];
825
- for (const participant of this._participants) {
826
- result = result.concat(participant.computeSync(this._anchor, lineDecorations));
827
- }
828
- return coalesce(result);
829
- }
830
- }
831
- function computeDistanceFromPointToRectangle(pointX, pointY, left, top, width, height) {
832
- const x = (left + width / 2);
833
- const y = (top + height / 2);
834
- const dx = Math.max(Math.abs(pointX - x) - width / 2, 0);
835
- const dy = Math.max(Math.abs(pointY - y) - height / 2, 0);
836
- return Math.sqrt(dx * dx + dy * dy);
837
- }
838
- export { ContentHoverController, ContentHoverWidget, EditorHoverStatusBar };