monaco-editor-core 0.54.0 → 0.55.0-dev-20251007

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 (251) hide show
  1. package/esm/nls.messages.de.js +1 -1
  2. package/esm/nls.messages.es.js +1 -1
  3. package/esm/nls.messages.fr.js +1 -1
  4. package/esm/nls.messages.it.js +1 -1
  5. package/esm/nls.messages.ja.js +1 -1
  6. package/esm/nls.messages.ko.js +1 -1
  7. package/esm/nls.messages.ru.js +1 -1
  8. package/esm/nls.messages.zh-cn.js +1 -1
  9. package/esm/nls.messages.zh-tw.js +1 -1
  10. package/esm/vs/base/browser/canIUse.js +1 -0
  11. package/esm/vs/base/browser/canIUse.js.map +1 -1
  12. package/esm/vs/base/browser/dom.js +9 -0
  13. package/esm/vs/base/browser/dom.js.map +1 -1
  14. package/esm/vs/base/browser/fastDomNode.js.map +1 -1
  15. package/esm/vs/base/browser/mouseEvent.js +3 -0
  16. package/esm/vs/base/browser/mouseEvent.js.map +1 -1
  17. package/esm/vs/base/browser/trustedTypes.js +2 -0
  18. package/esm/vs/base/browser/trustedTypes.js.map +1 -1
  19. package/esm/vs/base/browser/ui/list/listWidget.js +5 -5
  20. package/esm/vs/base/browser/ui/list/listWidget.js.map +1 -1
  21. package/esm/vs/base/browser/ui/sash/sash.css +1 -1
  22. package/esm/vs/base/browser/ui/sash/sash.js +4 -0
  23. package/esm/vs/base/browser/ui/sash/sash.js.map +1 -1
  24. package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js +1 -1
  25. package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js.map +1 -1
  26. package/esm/vs/base/browser/ui/table/table.css +2 -2
  27. package/esm/vs/base/browser/ui/tree/abstractTree.js +7 -3
  28. package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
  29. package/esm/vs/base/browser/ui/tree/asyncDataTree.js +4 -0
  30. package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
  31. package/esm/vs/base/browser/ui/tree/indexTreeModel.js +1 -0
  32. package/esm/vs/base/browser/ui/tree/indexTreeModel.js.map +1 -1
  33. package/esm/vs/base/browser/ui/tree/media/tree.css +2 -2
  34. package/esm/vs/base/browser/webWorkerFactory.js +3 -0
  35. package/esm/vs/base/browser/webWorkerFactory.js.map +1 -1
  36. package/esm/vs/base/common/buffer.js.map +1 -1
  37. package/esm/vs/base/common/decorators.js +1 -0
  38. package/esm/vs/base/common/decorators.js.map +1 -1
  39. package/esm/vs/base/common/errors.js +1 -0
  40. package/esm/vs/base/common/errors.js.map +1 -1
  41. package/esm/vs/base/common/glob.js +1 -1
  42. package/esm/vs/base/common/glob.js.map +1 -1
  43. package/esm/vs/base/common/hash.js.map +1 -1
  44. package/esm/vs/base/common/hotReload.js +2 -0
  45. package/esm/vs/base/common/hotReload.js.map +1 -1
  46. package/esm/vs/base/common/hotReloadHelpers.js +1 -0
  47. package/esm/vs/base/common/hotReloadHelpers.js.map +1 -1
  48. package/esm/vs/base/common/lifecycle.js +19 -0
  49. package/esm/vs/base/common/lifecycle.js.map +1 -1
  50. package/esm/vs/base/common/map.js.map +1 -1
  51. package/esm/vs/base/common/marshalling.js +4 -0
  52. package/esm/vs/base/common/marshalling.js.map +1 -1
  53. package/esm/vs/base/common/network.js +1 -0
  54. package/esm/vs/base/common/network.js.map +1 -1
  55. package/esm/vs/base/common/objects.js +1 -0
  56. package/esm/vs/base/common/objects.js.map +1 -1
  57. package/esm/vs/base/common/observableInternal/changeTracker.js +4 -0
  58. package/esm/vs/base/common/observableInternal/changeTracker.js.map +1 -1
  59. package/esm/vs/base/common/observableInternal/debugLocation.js +1 -0
  60. package/esm/vs/base/common/observableInternal/debugLocation.js.map +1 -1
  61. package/esm/vs/base/common/observableInternal/debugName.js +1 -0
  62. package/esm/vs/base/common/observableInternal/debugName.js.map +1 -1
  63. package/esm/vs/base/common/observableInternal/logging/consoleObservableLogger.js +1 -0
  64. package/esm/vs/base/common/observableInternal/logging/consoleObservableLogger.js.map +1 -1
  65. package/esm/vs/base/common/observableInternal/logging/debugger/debuggerRpc.js +1 -0
  66. package/esm/vs/base/common/observableInternal/logging/debugger/debuggerRpc.js.map +1 -1
  67. package/esm/vs/base/common/observableInternal/logging/debugger/rpc.js +1 -0
  68. package/esm/vs/base/common/observableInternal/logging/debugger/rpc.js.map +1 -1
  69. package/esm/vs/base/common/observableInternal/observables/derived.js +7 -1
  70. package/esm/vs/base/common/observableInternal/observables/derived.js.map +1 -1
  71. package/esm/vs/base/common/observableInternal/observables/derivedImpl.js +2 -0
  72. package/esm/vs/base/common/observableInternal/observables/derivedImpl.js.map +1 -1
  73. package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js +1 -0
  74. package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js.map +1 -1
  75. package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js +1 -0
  76. package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js.map +1 -1
  77. package/esm/vs/base/common/process.js +1 -0
  78. package/esm/vs/base/common/process.js.map +1 -1
  79. package/esm/vs/base/common/product.js.map +1 -1
  80. package/esm/vs/base/common/types.js +2 -0
  81. package/esm/vs/base/common/types.js.map +1 -1
  82. package/esm/vs/base/common/worker/webWorker.js +26 -14
  83. package/esm/vs/base/common/worker/webWorker.js.map +1 -1
  84. package/esm/vs/base/parts/sandbox/common/sandboxTypes.js +2 -0
  85. package/esm/vs/base/parts/sandbox/common/sandboxTypes.js.map +1 -0
  86. package/esm/vs/editor/browser/config/editorConfiguration.js +3 -2
  87. package/esm/vs/editor/browser/config/editorConfiguration.js.map +1 -1
  88. package/esm/vs/editor/browser/config/migrateOptions.js +1 -1
  89. package/esm/vs/editor/browser/config/migrateOptions.js.map +1 -1
  90. package/esm/vs/editor/browser/controller/editContext/native/editContextFactory.js.map +1 -1
  91. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContextUtils.js +2 -0
  92. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContextUtils.js.map +1 -1
  93. package/esm/vs/editor/browser/controller/mouseHandler.js +2 -1
  94. package/esm/vs/editor/browser/controller/mouseHandler.js.map +1 -1
  95. package/esm/vs/editor/browser/controller/mouseTarget.js +7 -0
  96. package/esm/vs/editor/browser/controller/mouseTarget.js.map +1 -1
  97. package/esm/vs/editor/browser/controller/pointerHandler.js.map +1 -1
  98. package/esm/vs/editor/browser/coreCommands.js.map +1 -1
  99. package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
  100. package/esm/vs/editor/browser/editorDom.js.map +1 -1
  101. package/esm/vs/editor/browser/editorExtensions.js.map +1 -1
  102. package/esm/vs/editor/browser/gpu/gpuUtils.js +1 -0
  103. package/esm/vs/editor/browser/gpu/gpuUtils.js.map +1 -1
  104. package/esm/vs/editor/browser/gpu/viewGpuContext.js +1 -0
  105. package/esm/vs/editor/browser/gpu/viewGpuContext.js.map +1 -1
  106. package/esm/vs/editor/browser/services/abstractCodeEditorService.js.map +1 -1
  107. package/esm/vs/editor/browser/services/bulkEditService.js.map +1 -1
  108. package/esm/vs/editor/browser/services/codeEditorService.js.map +1 -1
  109. package/esm/vs/editor/browser/services/editorWorkerService.js.map +1 -1
  110. package/esm/vs/editor/browser/services/hoverService/hover.css +2 -0
  111. package/esm/vs/editor/browser/services/hoverService/hoverService.js.map +1 -1
  112. package/esm/vs/editor/browser/services/hoverService/hoverWidget.js +1 -1
  113. package/esm/vs/editor/browser/services/hoverService/hoverWidget.js.map +1 -1
  114. package/esm/vs/editor/browser/services/inlineCompletionsService.js +8 -8
  115. package/esm/vs/editor/browser/services/inlineCompletionsService.js.map +1 -1
  116. package/esm/vs/editor/browser/services/openerService.js.map +1 -1
  117. package/esm/vs/editor/browser/view/viewLayer.js +1 -1
  118. package/esm/vs/editor/browser/view/viewLayer.js.map +1 -1
  119. package/esm/vs/editor/browser/view.js.map +1 -1
  120. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +1 -0
  121. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
  122. package/esm/vs/editor/browser/viewParts/viewZones/viewZones.js +1 -0
  123. package/esm/vs/editor/browser/viewParts/viewZones/viewZones.js.map +1 -1
  124. package/esm/vs/editor/browser/widget/codeEditor/codeEditorContributions.js.map +1 -1
  125. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +4 -1
  126. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
  127. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -0
  128. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js.map +1 -1
  129. package/esm/vs/editor/browser/widget/diffEditor/delegatingEditorImpl.js.map +1 -1
  130. package/esm/vs/editor/browser/widget/diffEditor/diffEditorOptions.js +1 -0
  131. package/esm/vs/editor/browser/widget/diffEditor/diffEditorOptions.js.map +1 -1
  132. package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +1 -0
  133. package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js.map +1 -1
  134. package/esm/vs/editor/browser/widget/diffEditor/utils.js +2 -0
  135. package/esm/vs/editor/browser/widget/diffEditor/utils.js.map +1 -1
  136. package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +2 -0
  137. package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js.map +1 -1
  138. package/esm/vs/editor/common/config/editorOptions.js +122 -68
  139. package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
  140. package/esm/vs/editor/common/config/fontInfo.js +32 -16
  141. package/esm/vs/editor/common/config/fontInfo.js.map +1 -1
  142. package/esm/vs/editor/common/config/fontInfoFromSettings.js +16 -0
  143. package/esm/vs/editor/common/config/fontInfoFromSettings.js.map +1 -0
  144. package/esm/vs/editor/common/core/edits/edit.js +1 -0
  145. package/esm/vs/editor/common/core/edits/edit.js.map +1 -1
  146. package/esm/vs/editor/common/core/edits/stringEdit.js +2 -0
  147. package/esm/vs/editor/common/core/edits/stringEdit.js.map +1 -1
  148. package/esm/vs/editor/common/core/position.js +1 -1
  149. package/esm/vs/editor/common/core/position.js.map +1 -1
  150. package/esm/vs/editor/common/core/range.js +1 -1
  151. package/esm/vs/editor/common/core/range.js.map +1 -1
  152. package/esm/vs/editor/common/core/selection.js +1 -1
  153. package/esm/vs/editor/common/core/selection.js.map +1 -1
  154. package/esm/vs/editor/common/cursor/cursorMoveCommands.js.map +1 -1
  155. package/esm/vs/editor/common/editorCommon.js.map +1 -1
  156. package/esm/vs/editor/common/languages.js +1 -1
  157. package/esm/vs/editor/common/languages.js.map +1 -1
  158. package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.js +14 -0
  159. package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.js.map +1 -1
  160. package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet.js +2 -0
  161. package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet.js.map +1 -1
  162. package/esm/vs/editor/common/model/textModel.js +1 -1
  163. package/esm/vs/editor/common/model/textModel.js.map +1 -1
  164. package/esm/vs/editor/common/model.js +1 -1
  165. package/esm/vs/editor/common/model.js.map +1 -1
  166. package/esm/vs/editor/common/services/editorBaseApi.js.map +1 -1
  167. package/esm/vs/editor/common/services/editorWebWorker.js +1 -0
  168. package/esm/vs/editor/common/services/editorWebWorker.js.map +1 -1
  169. package/esm/vs/editor/common/services/editorWorkerHost.js.map +1 -1
  170. package/esm/vs/editor/common/services/modelService.js +14 -21
  171. package/esm/vs/editor/common/services/modelService.js.map +1 -1
  172. package/esm/vs/editor/common/textModelEditSource.js +2 -0
  173. package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
  174. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +40 -1
  175. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js.map +1 -1
  176. package/esm/vs/editor/common/viewModel/viewModelImpl.js +2 -1
  177. package/esm/vs/editor/common/viewModel/viewModelImpl.js.map +1 -1
  178. package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +1 -1
  179. package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js.map +1 -1
  180. package/esm/vs/editor/contrib/codelens/browser/codelensController.js +1 -1
  181. package/esm/vs/editor/contrib/codelens/browser/codelensController.js.map +1 -1
  182. package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js +1 -0
  183. package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js.map +1 -1
  184. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +1 -0
  185. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js.map +1 -1
  186. package/esm/vs/editor/contrib/find/browser/findModel.js +1 -0
  187. package/esm/vs/editor/contrib/find/browser/findModel.js.map +1 -1
  188. package/esm/vs/editor/contrib/find/browser/findWidget.css +5 -5
  189. package/esm/vs/editor/contrib/folding/browser/folding.css +4 -4
  190. package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js.map +1 -1
  191. package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
  192. package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js.map +1 -1
  193. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +30 -14
  194. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js.map +1 -1
  195. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +4 -3
  196. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
  197. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +56 -7
  198. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
  199. package/esm/vs/editor/contrib/inlineCompletions/browser/structuredLogger.js +1 -0
  200. package/esm/vs/editor/contrib/inlineCompletions/browser/structuredLogger.js.map +1 -1
  201. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +2 -0
  202. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js.map +1 -1
  203. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +1 -0
  204. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
  205. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +1 -1
  206. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js.map +1 -1
  207. package/esm/vs/editor/contrib/rename/browser/renameWidget.js.map +1 -1
  208. package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.css +2 -0
  209. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +2 -0
  210. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js.map +1 -1
  211. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js.map +1 -1
  212. package/esm/vs/editor/editor.api.d.ts +8 -8
  213. package/esm/vs/editor/editor.api.js +4 -0
  214. package/esm/vs/editor/editor.api.js.map +1 -1
  215. package/esm/vs/editor/standalone/browser/standaloneCodeEditor.js.map +1 -1
  216. package/esm/vs/editor/standalone/browser/standaloneEditor.js +37 -0
  217. package/esm/vs/editor/standalone/browser/standaloneEditor.js.map +1 -1
  218. package/esm/vs/editor/standalone/browser/standaloneLanguages.js +37 -0
  219. package/esm/vs/editor/standalone/browser/standaloneLanguages.js.map +1 -1
  220. package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
  221. package/esm/vs/editor/standalone/browser/standaloneWebWorker.js.map +1 -1
  222. package/esm/vs/editor/standalone/common/monarch/monarchCompile.js +3 -0
  223. package/esm/vs/editor/standalone/common/monarch/monarchCompile.js.map +1 -1
  224. package/esm/vs/platform/accessibility/browser/accessibilityService.js +2 -2
  225. package/esm/vs/platform/accessibility/browser/accessibilityService.js.map +1 -1
  226. package/esm/vs/platform/actions/common/actions.js.map +1 -1
  227. package/esm/vs/platform/commands/common/commands.js.map +1 -1
  228. package/esm/vs/platform/contextkey/common/contextkey.js +5 -0
  229. package/esm/vs/platform/contextkey/common/contextkey.js.map +1 -1
  230. package/esm/vs/platform/dataChannel/browser/forwardingTelemetryService.js +1 -0
  231. package/esm/vs/platform/dataChannel/browser/forwardingTelemetryService.js.map +1 -1
  232. package/esm/vs/platform/dnd/browser/dnd.js +2 -0
  233. package/esm/vs/platform/dnd/browser/dnd.js.map +1 -1
  234. package/esm/vs/platform/instantiation/common/descriptors.js.map +1 -1
  235. package/esm/vs/platform/instantiation/common/instantiation.js.map +1 -1
  236. package/esm/vs/platform/instantiation/common/instantiationService.js +1 -0
  237. package/esm/vs/platform/instantiation/common/instantiationService.js.map +1 -1
  238. package/esm/vs/platform/list/browser/listService.js +5 -0
  239. package/esm/vs/platform/list/browser/listService.js.map +1 -1
  240. package/esm/vs/platform/log/common/log.js.map +1 -1
  241. package/esm/vs/platform/log/common/logService.js.map +1 -1
  242. package/esm/vs/platform/observable/common/wrapInHotClass.js +2 -0
  243. package/esm/vs/platform/observable/common/wrapInHotClass.js.map +1 -1
  244. package/esm/vs/platform/observable/common/wrapInReloadableClass.js +3 -0
  245. package/esm/vs/platform/observable/common/wrapInReloadableClass.js.map +1 -1
  246. package/esm/vs/platform/product/common/product.js +69 -0
  247. package/esm/vs/platform/product/common/product.js.map +1 -0
  248. package/esm/vs/platform/quickinput/browser/quickInput.js +1 -1
  249. package/esm/vs/platform/quickinput/browser/quickInput.js.map +1 -1
  250. package/monaco.d.ts +8 -8
  251. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/editorDom.ts","vs/editor/browser/editorDom.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AACjD,OAAO,KAAK,gBAAgB,MA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QAAQ,GAAG,KAAK,CAAC;YAClB,CAAC;YAED,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;YACxC,GAAG,IAAI,OAAO,WAAW,KAAK,QAAQ,GAAG,CAAC;QAC3C,CAAC;QACD,GAAG,IAAI,KAAK,CAAC;QACb,OAAO,GAAG,CAAC;IACZ,CAAC;IAEM,OAAO;QACb,IAAI,CAAC,wBAAwB,CAAC,OAAO,EAAE,CAAC;QACxC,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;IAChC,CAAC;IAEM,gBAAgB;QACtB,IAAI,CAAC,eAAe,EAAE,CAAC;IACxB,CAAC;IAEM,gBAAgB;QACtB,IAAI,CAAC,eAAe,EAAE,CAAC;IACxB,CAAC;IAEM,aAAa;QACnB,OAAO,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;IACjC,CAAC;CACD;AAED,SAAS,aAAa,CAAC,GAAW;IACjC,OAAO,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;SAC9D,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AACjE,CAAC","file":"editorDom.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 * as domStylesheetsJs from '../../base/browser/domStylesheets.js';\nimport { GlobalPointerMoveMonitor } from '../../base/browser/globalPointerMoveMonitor.js';\nimport { StandardMouseEvent } from '../../base/browser/mouseEvent.js';\nimport { RunOnceScheduler } from '../../base/common/async.js';\nimport { Disposable, DisposableMap, DisposableStore, IDisposable } from '../../base/common/lifecycle.js';\nimport { ICodeEditor } from './editorBrowser.js';\nimport { asCssVariable } from '../../platform/theme/common/colorRegistry.js';\nimport { ThemeColor } from '../../base/common/themables.js';\n\n/**\n * Coordinates relative to the whole document (e.g. mouse event's pageX and pageY)\n */\nexport class PageCoordinates {\n\t_pageCoordinatesBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly x: number,\n\t\tpublic readonly y: number\n\t) { }\n\n\tpublic toClientCoordinates(targetWindow: Window): ClientCoordinates {\n\t\treturn new ClientCoordinates(this.x - targetWindow.scrollX, this.y - targetWindow.scrollY);\n\t}\n}\n\n/**\n * Coordinates within the application's client area (i.e. origin is document's scroll position).\n *\n * For example, clicking in the top-left corner of the client area will\n * always result in a mouse event with a client.x value of 0, regardless\n * of whether the page is scrolled horizontally.\n */\nexport class ClientCoordinates {\n\t_clientCoordinatesBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly clientX: number,\n\t\tpublic readonly clientY: number\n\t) { }\n\n\tpublic toPageCoordinates(targetWindow: Window): PageCoordinates {\n\t\treturn new PageCoordinates(this.clientX + targetWindow.scrollX, this.clientY + targetWindow.scrollY);\n\t}\n}\n\n/**\n * The position of the editor in the page.\n */\nexport class EditorPagePosition {\n\t_editorPagePositionBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly x: number,\n\t\tpublic readonly y: number,\n\t\tpublic readonly width: number,\n\t\tpublic readonly height: number\n\t) { }\n}\n\n/**\n * Coordinates relative to the (top;left) of the editor that can be used safely with other internal editor metrics.\n * **NOTE**: This position is obtained by taking page coordinates and transforming them relative to the\n * editor's (top;left) position in a way in which scale transformations are taken into account.\n * **NOTE**: These coordinates could be negative if the mouse position is outside the editor.\n */\nexport class CoordinatesRelativeToEditor {\n\t_positionRelativeToEditorBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly x: number,\n\t\tpublic readonly y: number\n\t) { }\n}\n\nexport function createEditorPagePosition(editorViewDomNode: HTMLElement): EditorPagePosition {\n\tconst editorPos = dom.getDomNodePagePosition(editorViewDomNode);\n\treturn new EditorPagePosition(editorPos.left, editorPos.top, editorPos.width, editorPos.height);\n}\n\nexport function createCoordinatesRelativeToEditor(editorViewDomNode: HTMLElement, editorPagePosition: EditorPagePosition, pos: PageCoordinates) {\n\t// The editor's page position is read from the DOM using getBoundingClientRect().\n\t//\n\t// getBoundingClientRect() returns the actual dimensions, while offsetWidth and offsetHeight\n\t// reflect the unscaled size. We can use this difference to detect a transform:scale()\n\t// and we will apply the transformation in inverse to get mouse coordinates that make sense inside the editor.\n\t//\n\t// This could be expanded to cover rotation as well maybe by walking the DOM up from `editorViewDomNode`\n\t// and computing the effective transformation matrix using getComputedStyle(element).transform.\n\t//\n\tconst scaleX = editorPagePosition.width / editorViewDomNode.offsetWidth;\n\tconst scaleY = editorPagePosition.height / editorViewDomNode.offsetHeight;\n\n\t// Adjust mouse offsets if editor appears to be scaled via transforms\n\tconst relativeX = (pos.x - editorPagePosition.x) / scaleX;\n\tconst relativeY = (pos.y - editorPagePosition.y) / scaleY;\n\treturn new CoordinatesRelativeToEditor(relativeX, relativeY);\n}\n\nexport class EditorMouseEvent extends StandardMouseEvent {\n\t_editorMouseEventBrand: void = undefined;\n\n\t/**\n\t * If the event is a result of using `setPointerCapture`, the `event.target`\n\t * does not necessarily reflect the position in the editor.\n\t */\n\tpublic readonly isFromPointerCapture: boolean;\n\n\t/**\n\t * Coordinates relative to the whole document.\n\t */\n\tpublic readonly pos: PageCoordinates;\n\n\t/**\n\t * Editor's coordinates relative to the whole document.\n\t */\n\tpublic readonly editorPos: EditorPagePosition;\n\n\t/**\n\t * Coordinates relative to the (top;left) of the editor.\n\t * *NOTE*: These coordinates are preferred because they take into account transformations applied to the editor.\n\t * *NOTE*: These coordinates could be negative if the mouse position is outside the editor.\n\t */\n\tpublic readonly relativePos: CoordinatesRelativeToEditor;\n\n\tconstructor(e: MouseEvent, isFromPointerCapture: boolean, editorViewDomNode: HTMLElement) {\n\t\tsuper(dom.getWindow(editorViewDomNode), e);\n\t\tthis.isFromPointerCapture = isFromPointerCapture;\n\t\tthis.pos = new PageCoordinates(this.posx, this.posy);\n\t\tthis.editorPos = createEditorPagePosition(editorViewDomNode);\n\t\tthis.relativePos = createCoordinatesRelativeToEditor(editorViewDomNode, this.editorPos, this.pos);\n\t}\n}\n\nexport class EditorMouseEventFactory {\n\n\tprivate readonly _editorViewDomNode: HTMLElement;\n\n\tconstructor(editorViewDomNode: HTMLElement) {\n\t\tthis._editorViewDomNode = editorViewDomNode;\n\t}\n\n\tprivate _create(e: MouseEvent): EditorMouseEvent {\n\t\treturn new EditorMouseEvent(e, false, this._editorViewDomNode);\n\t}\n\n\tpublic onContextMenu(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.CONTEXT_MENU, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onMouseUp(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.MOUSE_UP, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onMouseDown(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.MOUSE_DOWN, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onPointerDown(target: HTMLElement, callback: (e: EditorMouseEvent, pointerId: number) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.POINTER_DOWN, (e: PointerEvent) => {\n\t\t\tcallback(this._create(e), e.pointerId);\n\t\t});\n\t}\n\n\tpublic onMouseLeave(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.MOUSE_LEAVE, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onMouseMove(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.MOUSE_MOVE, (e) => callback(this._create(e)));\n\t}\n}\n\nexport class EditorPointerEventFactory {\n\n\tprivate readonly _editorViewDomNode: HTMLElement;\n\n\tconstructor(editorViewDomNode: HTMLElement) {\n\t\tthis._editorViewDomNode = editorViewDomNode;\n\t}\n\n\tprivate _create(e: MouseEvent): EditorMouseEvent {\n\t\treturn new EditorMouseEvent(e, false, this._editorViewDomNode);\n\t}\n\n\tpublic onPointerUp(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, 'pointerup', (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onPointerDown(target: HTMLElement, callback: (e: EditorMouseEvent, pointerId: number) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.POINTER_DOWN, (e: PointerEvent) => {\n\t\t\tcallback(this._create(e), e.pointerId);\n\t\t});\n\t}\n\n\tpublic onPointerLeave(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.POINTER_LEAVE, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onPointerMove(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, 'pointermove', (e) => callback(this._create(e)));\n\t}\n}\n\nexport class GlobalEditorPointerMoveMonitor extends Disposable {\n\n\tprivate readonly _editorViewDomNode: HTMLElement;\n\tprivate readonly _globalPointerMoveMonitor: GlobalPointerMoveMonitor;\n\tprivate _keydownListener: IDisposable | null;\n\n\tconstructor(editorViewDomNode: HTMLElement) {\n\t\tsuper();\n\t\tthis._editorViewDomNode = editorViewDomNode;\n\t\tthis._globalPointerMoveMonitor = this._register(new GlobalPointerMoveMonitor());\n\t\tthis._keydownListener = null;\n\t}\n\n\tpublic startMonitoring(\n\t\tinitialElement: Element,\n\t\tpointerId: number,\n\t\tinitialButtons: number,\n\t\tpointerMoveCallback: (e: EditorMouseEvent) => void,\n\t\tonStopCallback: (browserEvent?: PointerEvent | KeyboardEvent) => void\n\t): void {\n\n\t\t// Add a <<capture>> keydown event listener that will cancel the monitoring\n\t\t// if something other than a modifier key is pressed\n\t\tthis._keydownListener = dom.addStandardDisposableListener(<any>initialElement.ownerDocument, 'keydown', (e) => {\n\t\t\tconst chord = e.toKeyCodeChord();\n\t\t\tif (chord.isModifierKey()) {\n\t\t\t\t// Allow modifier keys\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._globalPointerMoveMonitor.stopMonitoring(true, e.browserEvent);\n\t\t}, true);\n\n\t\tthis._globalPointerMoveMonitor.startMonitoring(\n\t\t\tinitialElement,\n\t\t\tpointerId,\n\t\t\tinitialButtons,\n\t\t\t(e) => {\n\t\t\t\tpointerMoveCallback(new EditorMouseEvent(e, true, this._editorViewDomNode));\n\t\t\t},\n\t\t\t(e) => {\n\t\t\t\tthis._keydownListener!.dispose();\n\t\t\t\tonStopCallback(e);\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic stopMonitoring(): void {\n\t\tthis._globalPointerMoveMonitor.stopMonitoring(true);\n\t}\n}\n\n\n/**\n * A helper to create dynamic css rules, bound to a class name.\n * Rules are reused.\n * Reference counting and delayed garbage collection ensure that no rules leak.\n*/\nexport class DynamicCssRules {\n\tprivate static _idPool = 0;\n\tprivate readonly _instanceId = ++DynamicCssRules._idPool;\n\tprivate _counter = 0;\n\tprivate readonly _rules = new DisposableMap<string, RefCountedCssRule>();\n\n\t// We delay garbage collection so that hanging rules can be reused.\n\tprivate readonly _garbageCollectionScheduler = new RunOnceScheduler(() => this.garbageCollect(), 1000);\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor\n\t) { }\n\n\tdispose(): void {\n\t\tthis._rules.dispose();\n\t\tthis._garbageCollectionScheduler.dispose();\n\t}\n\n\tpublic createClassNameRef(options: CssProperties): ClassNameReference {\n\t\tconst rule = this.getOrCreateRule(options);\n\t\trule.increaseRefCount();\n\n\t\treturn {\n\t\t\tclassName: rule.className,\n\t\t\tdispose: () => {\n\t\t\t\trule.decreaseRefCount();\n\t\t\t\tthis._garbageCollectionScheduler.schedule();\n\t\t\t}\n\t\t};\n\t}\n\n\tprivate getOrCreateRule(properties: CssProperties): RefCountedCssRule {\n\t\tconst key = this.computeUniqueKey(properties);\n\t\tlet existingRule = this._rules.get(key);\n\t\tif (!existingRule) {\n\t\t\tconst counter = this._counter++;\n\t\t\texistingRule = new RefCountedCssRule(key, `dyn-rule-${this._instanceId}-${counter}`,\n\t\t\t\tdom.isInShadowDOM(this._editor.getContainerDomNode())\n\t\t\t\t\t? this._editor.getContainerDomNode()\n\t\t\t\t\t: undefined,\n\t\t\t\tproperties\n\t\t\t);\n\t\t\tthis._rules.set(key, existingRule);\n\t\t}\n\t\treturn existingRule;\n\t}\n\n\tprivate computeUniqueKey(properties: CssProperties): string {\n\t\treturn JSON.stringify(properties);\n\t}\n\n\tprivate garbageCollect() {\n\t\tfor (const rule of this._rules.values()) {\n\t\t\tif (!rule.hasReferences()) {\n\t\t\t\tthis._rules.deleteAndDispose(rule.key);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport interface ClassNameReference extends IDisposable {\n\tclassName: string;\n}\n\nexport interface CssProperties {\n\tborderRadius?: string;\n\tfontSize?: string;\n\tfontFamily?: string;\n\tunicodeBidi?: string;\n\ttextDecoration?: string;\n\tcolor?: string | ThemeColor;\n\tbackgroundColor?: string | ThemeColor;\n\tverticalAlign?: string;\n\tcursor?: string;\n\tpadding?: string;\n\twidth?: string;\n\tdisplay?: string;\n}\n\nclass RefCountedCssRule {\n\tprivate _referenceCount: number = 0;\n\tprivate _styleElement: HTMLStyleElement | undefined;\n\tprivate readonly _styleElementDisposables: DisposableStore;\n\n\tconstructor(\n\t\tpublic readonly key: string,\n\t\tpublic readonly className: string,\n\t\t_containerElement: HTMLElement | undefined,\n\t\tpublic readonly properties: CssProperties,\n\t) {\n\t\tthis._styleElementDisposables = new DisposableStore();\n\t\tthis._styleElement = domStylesheetsJs.createStyleSheet(_containerElement, undefined, this._styleElementDisposables);\n\t\tthis._styleElement.textContent = this.getCssText(this.className, this.properties);\n\t}\n\n\tprivate getCssText(className: string, properties: CssProperties): string {\n\t\tlet str = `.${className} {`;\n\t\tfor (const prop in properties) {\n\t\t\tconst value = (properties as any)[prop] as string | ThemeColor;\n\t\t\tlet cssValue;\n\t\t\tif (typeof value === 'object') {\n\t\t\t\tcssValue = asCssVariable(value.id);\n\t\t\t} else {\n\t\t\t\tcssValue = value;\n\t\t\t}\n\n\t\t\tconst cssPropName = camelToDashes(prop);\n\t\t\tstr += `\\n\\t${cssPropName}: ${cssValue};`;\n\t\t}\n\t\tstr += `\\n}`;\n\t\treturn str;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._styleElementDisposables.dispose();\n\t\tthis._styleElement = undefined;\n\t}\n\n\tpublic increaseRefCount(): void {\n\t\tthis._referenceCount++;\n\t}\n\n\tpublic decreaseRefCount(): void {\n\t\tthis._referenceCount--;\n\t}\n\n\tpublic hasReferences(): boolean {\n\t\treturn this._referenceCount > 0;\n\t}\n}\n\nfunction camelToDashes(str: string): string {\n\treturn str.replace(/(^[A-Z])/, ([first]) => first.toLowerCase())\n\t\t.replace(/([A-Z])/g, ([letter]) => `-${letter.toLowerCase()}`);\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 * as domStylesheetsJs from '../../base/browser/domStylesheets.js';\nimport { GlobalPointerMoveMonitor } from '../../base/browser/globalPointerMoveMonitor.js';\nimport { StandardMouseEvent } from '../../base/browser/mouseEvent.js';\nimport { RunOnceScheduler } from '../../base/common/async.js';\nimport { Disposable, DisposableMap, DisposableStore, IDisposable } from '../../base/common/lifecycle.js';\nimport { ICodeEditor } from './editorBrowser.js';\nimport { asCssVariable } from '../../platform/theme/common/colorRegistry.js';\nimport { ThemeColor } from '../../base/common/themables.js';\n\n/**\n * Coordinates relative to the whole document (e.g. mouse event's pageX and pageY)\n */\nexport class PageCoordinates {\n\t_pageCoordinatesBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly x: number,\n\t\tpublic readonly y: number\n\t) { }\n\n\tpublic toClientCoordinates(targetWindow: Window): ClientCoordinates {\n\t\treturn new ClientCoordinates(this.x - targetWindow.scrollX, this.y - targetWindow.scrollY);\n\t}\n}\n\n/**\n * Coordinates within the application's client area (i.e. origin is document's scroll position).\n *\n * For example, clicking in the top-left corner of the client area will\n * always result in a mouse event with a client.x value of 0, regardless\n * of whether the page is scrolled horizontally.\n */\nexport class ClientCoordinates {\n\t_clientCoordinatesBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly clientX: number,\n\t\tpublic readonly clientY: number\n\t) { }\n\n\tpublic toPageCoordinates(targetWindow: Window): PageCoordinates {\n\t\treturn new PageCoordinates(this.clientX + targetWindow.scrollX, this.clientY + targetWindow.scrollY);\n\t}\n}\n\n/**\n * The position of the editor in the page.\n */\nexport class EditorPagePosition {\n\t_editorPagePositionBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly x: number,\n\t\tpublic readonly y: number,\n\t\tpublic readonly width: number,\n\t\tpublic readonly height: number\n\t) { }\n}\n\n/**\n * Coordinates relative to the (top;left) of the editor that can be used safely with other internal editor metrics.\n * **NOTE**: This position is obtained by taking page coordinates and transforming them relative to the\n * editor's (top;left) position in a way in which scale transformations are taken into account.\n * **NOTE**: These coordinates could be negative if the mouse position is outside the editor.\n */\nexport class CoordinatesRelativeToEditor {\n\t_positionRelativeToEditorBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly x: number,\n\t\tpublic readonly y: number\n\t) { }\n}\n\nexport function createEditorPagePosition(editorViewDomNode: HTMLElement): EditorPagePosition {\n\tconst editorPos = dom.getDomNodePagePosition(editorViewDomNode);\n\treturn new EditorPagePosition(editorPos.left, editorPos.top, editorPos.width, editorPos.height);\n}\n\nexport function createCoordinatesRelativeToEditor(editorViewDomNode: HTMLElement, editorPagePosition: EditorPagePosition, pos: PageCoordinates) {\n\t// The editor's page position is read from the DOM using getBoundingClientRect().\n\t//\n\t// getBoundingClientRect() returns the actual dimensions, while offsetWidth and offsetHeight\n\t// reflect the unscaled size. We can use this difference to detect a transform:scale()\n\t// and we will apply the transformation in inverse to get mouse coordinates that make sense inside the editor.\n\t//\n\t// This could be expanded to cover rotation as well maybe by walking the DOM up from `editorViewDomNode`\n\t// and computing the effective transformation matrix using getComputedStyle(element).transform.\n\t//\n\tconst scaleX = editorPagePosition.width / editorViewDomNode.offsetWidth;\n\tconst scaleY = editorPagePosition.height / editorViewDomNode.offsetHeight;\n\n\t// Adjust mouse offsets if editor appears to be scaled via transforms\n\tconst relativeX = (pos.x - editorPagePosition.x) / scaleX;\n\tconst relativeY = (pos.y - editorPagePosition.y) / scaleY;\n\treturn new CoordinatesRelativeToEditor(relativeX, relativeY);\n}\n\nexport class EditorMouseEvent extends StandardMouseEvent {\n\t_editorMouseEventBrand: void = undefined;\n\n\t/**\n\t * If the event is a result of using `setPointerCapture`, the `event.target`\n\t * does not necessarily reflect the position in the editor.\n\t */\n\tpublic readonly isFromPointerCapture: boolean;\n\n\t/**\n\t * Coordinates relative to the whole document.\n\t */\n\tpublic readonly pos: PageCoordinates;\n\n\t/**\n\t * Editor's coordinates relative to the whole document.\n\t */\n\tpublic readonly editorPos: EditorPagePosition;\n\n\t/**\n\t * Coordinates relative to the (top;left) of the editor.\n\t * *NOTE*: These coordinates are preferred because they take into account transformations applied to the editor.\n\t * *NOTE*: These coordinates could be negative if the mouse position is outside the editor.\n\t */\n\tpublic readonly relativePos: CoordinatesRelativeToEditor;\n\n\tconstructor(e: MouseEvent, isFromPointerCapture: boolean, editorViewDomNode: HTMLElement) {\n\t\tsuper(dom.getWindow(editorViewDomNode), e);\n\t\tthis.isFromPointerCapture = isFromPointerCapture;\n\t\tthis.pos = new PageCoordinates(this.posx, this.posy);\n\t\tthis.editorPos = createEditorPagePosition(editorViewDomNode);\n\t\tthis.relativePos = createCoordinatesRelativeToEditor(editorViewDomNode, this.editorPos, this.pos);\n\t}\n}\n\nexport class EditorMouseEventFactory {\n\n\tprivate readonly _editorViewDomNode: HTMLElement;\n\n\tconstructor(editorViewDomNode: HTMLElement) {\n\t\tthis._editorViewDomNode = editorViewDomNode;\n\t}\n\n\tprivate _create(e: MouseEvent): EditorMouseEvent {\n\t\treturn new EditorMouseEvent(e, false, this._editorViewDomNode);\n\t}\n\n\tpublic onContextMenu(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.CONTEXT_MENU, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onMouseUp(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.MOUSE_UP, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onMouseDown(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.MOUSE_DOWN, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onPointerDown(target: HTMLElement, callback: (e: EditorMouseEvent, pointerId: number) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.POINTER_DOWN, (e: PointerEvent) => {\n\t\t\tcallback(this._create(e), e.pointerId);\n\t\t});\n\t}\n\n\tpublic onMouseLeave(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.MOUSE_LEAVE, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onMouseMove(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.MOUSE_MOVE, (e) => callback(this._create(e)));\n\t}\n}\n\nexport class EditorPointerEventFactory {\n\n\tprivate readonly _editorViewDomNode: HTMLElement;\n\n\tconstructor(editorViewDomNode: HTMLElement) {\n\t\tthis._editorViewDomNode = editorViewDomNode;\n\t}\n\n\tprivate _create(e: MouseEvent): EditorMouseEvent {\n\t\treturn new EditorMouseEvent(e, false, this._editorViewDomNode);\n\t}\n\n\tpublic onPointerUp(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, 'pointerup', (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onPointerDown(target: HTMLElement, callback: (e: EditorMouseEvent, pointerId: number) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.POINTER_DOWN, (e: PointerEvent) => {\n\t\t\tcallback(this._create(e), e.pointerId);\n\t\t});\n\t}\n\n\tpublic onPointerLeave(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.POINTER_LEAVE, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onPointerMove(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, 'pointermove', (e) => callback(this._create(e)));\n\t}\n}\n\nexport class GlobalEditorPointerMoveMonitor extends Disposable {\n\n\tprivate readonly _editorViewDomNode: HTMLElement;\n\tprivate readonly _globalPointerMoveMonitor: GlobalPointerMoveMonitor;\n\tprivate _keydownListener: IDisposable | null;\n\n\tconstructor(editorViewDomNode: HTMLElement) {\n\t\tsuper();\n\t\tthis._editorViewDomNode = editorViewDomNode;\n\t\tthis._globalPointerMoveMonitor = this._register(new GlobalPointerMoveMonitor());\n\t\tthis._keydownListener = null;\n\t}\n\n\tpublic startMonitoring(\n\t\tinitialElement: Element,\n\t\tpointerId: number,\n\t\tinitialButtons: number,\n\t\tpointerMoveCallback: (e: EditorMouseEvent) => void,\n\t\tonStopCallback: (browserEvent?: PointerEvent | KeyboardEvent) => void\n\t): void {\n\n\t\t// Add a <<capture>> keydown event listener that will cancel the monitoring\n\t\t// if something other than a modifier key is pressed\n\t\tthis._keydownListener = dom.addStandardDisposableListener(<any>initialElement.ownerDocument, 'keydown', (e) => {\n\t\t\tconst chord = e.toKeyCodeChord();\n\t\t\tif (chord.isModifierKey()) {\n\t\t\t\t// Allow modifier keys\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._globalPointerMoveMonitor.stopMonitoring(true, e.browserEvent);\n\t\t}, true);\n\n\t\tthis._globalPointerMoveMonitor.startMonitoring(\n\t\t\tinitialElement,\n\t\t\tpointerId,\n\t\t\tinitialButtons,\n\t\t\t(e) => {\n\t\t\t\tpointerMoveCallback(new EditorMouseEvent(e, true, this._editorViewDomNode));\n\t\t\t},\n\t\t\t(e) => {\n\t\t\t\tthis._keydownListener!.dispose();\n\t\t\t\tonStopCallback(e);\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic stopMonitoring(): void {\n\t\tthis._globalPointerMoveMonitor.stopMonitoring(true);\n\t}\n}\n\n\n/**\n * A helper to create dynamic css rules, bound to a class name.\n * Rules are reused.\n * Reference counting and delayed garbage collection ensure that no rules leak.\n*/\nexport class DynamicCssRules {\n\tprivate static _idPool = 0;\n\tprivate readonly _instanceId = ++DynamicCssRules._idPool;\n\tprivate _counter = 0;\n\tprivate readonly _rules = new DisposableMap<string, RefCountedCssRule>();\n\n\t// We delay garbage collection so that hanging rules can be reused.\n\tprivate readonly _garbageCollectionScheduler = new RunOnceScheduler(() => this.garbageCollect(), 1000);\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor\n\t) { }\n\n\tdispose(): void {\n\t\tthis._rules.dispose();\n\t\tthis._garbageCollectionScheduler.dispose();\n\t}\n\n\tpublic createClassNameRef(options: CssProperties): ClassNameReference {\n\t\tconst rule = this.getOrCreateRule(options);\n\t\trule.increaseRefCount();\n\n\t\treturn {\n\t\t\tclassName: rule.className,\n\t\t\tdispose: () => {\n\t\t\t\trule.decreaseRefCount();\n\t\t\t\tthis._garbageCollectionScheduler.schedule();\n\t\t\t}\n\t\t};\n\t}\n\n\tprivate getOrCreateRule(properties: CssProperties): RefCountedCssRule {\n\t\tconst key = this.computeUniqueKey(properties);\n\t\tlet existingRule = this._rules.get(key);\n\t\tif (!existingRule) {\n\t\t\tconst counter = this._counter++;\n\t\t\texistingRule = new RefCountedCssRule(key, `dyn-rule-${this._instanceId}-${counter}`,\n\t\t\t\tdom.isInShadowDOM(this._editor.getContainerDomNode())\n\t\t\t\t\t? this._editor.getContainerDomNode()\n\t\t\t\t\t: undefined,\n\t\t\t\tproperties\n\t\t\t);\n\t\t\tthis._rules.set(key, existingRule);\n\t\t}\n\t\treturn existingRule;\n\t}\n\n\tprivate computeUniqueKey(properties: CssProperties): string {\n\t\treturn JSON.stringify(properties);\n\t}\n\n\tprivate garbageCollect() {\n\t\tfor (const rule of this._rules.values()) {\n\t\t\tif (!rule.hasReferences()) {\n\t\t\t\tthis._rules.deleteAndDispose(rule.key);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport interface ClassNameReference extends IDisposable {\n\tclassName: string;\n}\n\nexport interface CssProperties {\n\tborderRadius?: string;\n\tfontSize?: string;\n\tfontFamily?: string;\n\tunicodeBidi?: string;\n\ttextDecoration?: string;\n\tcolor?: string | ThemeColor;\n\tbackgroundColor?: string | ThemeColor;\n\tverticalAlign?: string;\n\tcursor?: string;\n\tpadding?: string;\n\twidth?: string;\n\tdisplay?: string;\n}\n\nclass RefCountedCssRule {\n\tprivate _referenceCount: number = 0;\n\tprivate _styleElement: HTMLStyleElement | undefined;\n\tprivate readonly _styleElementDisposables: DisposableStore;\n\n\tconstructor(\n\t\tpublic readonly key: string,\n\t\tpublic readonly className: string,\n\t\t_containerElement: HTMLElement | undefined,\n\t\tpublic readonly properties: CssProperties,\n\t) {\n\t\tthis._styleElementDisposables = new DisposableStore();\n\t\tthis._styleElement = domStylesheetsJs.createStyleSheet(_containerElement, undefined, this._styleElementDisposables);\n\t\tthis._styleElement.textContent = this.getCssText(this.className, this.properties);\n\t}\n\n\tprivate getCssText(className: string, properties: CssProperties): string {\n\t\tlet str = `.${className} {`;\n\t\tfor (const prop in properties) {\n\t\t\tconst value = (properties as any)[prop] as string | ThemeColor;\n\t\t\tlet cssValue;\n\t\t\tif (typeof value === 'object') {\n\t\t\t\tcssValue = asCssVariable(value.id);\n\t\t\t} else {\n\t\t\t\tcssValue = value;\n\t\t\t}\n\n\t\t\tconst cssPropName = camelToDashes(prop);\n\t\t\tstr += `\\n\\t${cssPropName}: ${cssValue};`;\n\t\t}\n\t\tstr += `\\n}`;\n\t\treturn str;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._styleElementDisposables.dispose();\n\t\tthis._styleElement = undefined;\n\t}\n\n\tpublic increaseRefCount(): void {\n\t\tthis._referenceCount++;\n\t}\n\n\tpublic decreaseRefCount(): void {\n\t\tthis._referenceCount--;\n\t}\n\n\tpublic hasReferences(): boolean {\n\t\treturn this._referenceCount > 0;\n\t}\n}\n\nfunction camelToDashes(str: string): string {\n\treturn str.replace(/(^[A-Z])/, ([first]) => first.toLowerCase())\n\t\t.replace(/([A-Z])/g, ([letter]) => `-${letter.toLowerCase()}`);\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/editorDom.ts","vs/editor/browser/editorDom.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AACjD,OAAO,KAAK,gBAAgB,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAA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,CAAC;YACxC,GAAG,IAAI,OAAO,WAAW,KAAK,QAAQ,GAAG,CAAC;QAC3C,CAAC;QACD,GAAG,IAAI,KAAK,CAAC;QACb,OAAO,GAAG,CAAC;IACZ,CAAC;IAEM,OAAO;QACb,IAAI,CAAC,wBAAwB,CAAC,OAAO,EAAE,CAAC;QACxC,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;IAChC,CAAC;IAEM,gBAAgB;QACtB,IAAI,CAAC,eAAe,EAAE,CAAC;IACxB,CAAC;IAEM,gBAAgB;QACtB,IAAI,CAAC,eAAe,EAAE,CAAC;IACxB,CAAC;IAEM,aAAa;QACnB,OAAO,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;IACjC,CAAC;CACD;AAED,SAAS,aAAa,CAAC,GAAW;IACjC,OAAO,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;SAC9D,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AACjE,CAAC","file":"editorDom.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 * as domStylesheetsJs from '../../base/browser/domStylesheets.js';\nimport { GlobalPointerMoveMonitor } from '../../base/browser/globalPointerMoveMonitor.js';\nimport { StandardMouseEvent } from '../../base/browser/mouseEvent.js';\nimport { RunOnceScheduler } from '../../base/common/async.js';\nimport { Disposable, DisposableMap, DisposableStore, IDisposable } from '../../base/common/lifecycle.js';\nimport { ICodeEditor } from './editorBrowser.js';\nimport { asCssVariable } from '../../platform/theme/common/colorRegistry.js';\nimport { ThemeColor } from '../../base/common/themables.js';\n\n/**\n * Coordinates relative to the whole document (e.g. mouse event's pageX and pageY)\n */\nexport class PageCoordinates {\n\t_pageCoordinatesBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly x: number,\n\t\tpublic readonly y: number\n\t) { }\n\n\tpublic toClientCoordinates(targetWindow: Window): ClientCoordinates {\n\t\treturn new ClientCoordinates(this.x - targetWindow.scrollX, this.y - targetWindow.scrollY);\n\t}\n}\n\n/**\n * Coordinates within the application's client area (i.e. origin is document's scroll position).\n *\n * For example, clicking in the top-left corner of the client area will\n * always result in a mouse event with a client.x value of 0, regardless\n * of whether the page is scrolled horizontally.\n */\nexport class ClientCoordinates {\n\t_clientCoordinatesBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly clientX: number,\n\t\tpublic readonly clientY: number\n\t) { }\n\n\tpublic toPageCoordinates(targetWindow: Window): PageCoordinates {\n\t\treturn new PageCoordinates(this.clientX + targetWindow.scrollX, this.clientY + targetWindow.scrollY);\n\t}\n}\n\n/**\n * The position of the editor in the page.\n */\nexport class EditorPagePosition {\n\t_editorPagePositionBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly x: number,\n\t\tpublic readonly y: number,\n\t\tpublic readonly width: number,\n\t\tpublic readonly height: number\n\t) { }\n}\n\n/**\n * Coordinates relative to the (top;left) of the editor that can be used safely with other internal editor metrics.\n * **NOTE**: This position is obtained by taking page coordinates and transforming them relative to the\n * editor's (top;left) position in a way in which scale transformations are taken into account.\n * **NOTE**: These coordinates could be negative if the mouse position is outside the editor.\n */\nexport class CoordinatesRelativeToEditor {\n\t_positionRelativeToEditorBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly x: number,\n\t\tpublic readonly y: number\n\t) { }\n}\n\nexport function createEditorPagePosition(editorViewDomNode: HTMLElement): EditorPagePosition {\n\tconst editorPos = dom.getDomNodePagePosition(editorViewDomNode);\n\treturn new EditorPagePosition(editorPos.left, editorPos.top, editorPos.width, editorPos.height);\n}\n\nexport function createCoordinatesRelativeToEditor(editorViewDomNode: HTMLElement, editorPagePosition: EditorPagePosition, pos: PageCoordinates) {\n\t// The editor's page position is read from the DOM using getBoundingClientRect().\n\t//\n\t// getBoundingClientRect() returns the actual dimensions, while offsetWidth and offsetHeight\n\t// reflect the unscaled size. We can use this difference to detect a transform:scale()\n\t// and we will apply the transformation in inverse to get mouse coordinates that make sense inside the editor.\n\t//\n\t// This could be expanded to cover rotation as well maybe by walking the DOM up from `editorViewDomNode`\n\t// and computing the effective transformation matrix using getComputedStyle(element).transform.\n\t//\n\tconst scaleX = editorPagePosition.width / editorViewDomNode.offsetWidth;\n\tconst scaleY = editorPagePosition.height / editorViewDomNode.offsetHeight;\n\n\t// Adjust mouse offsets if editor appears to be scaled via transforms\n\tconst relativeX = (pos.x - editorPagePosition.x) / scaleX;\n\tconst relativeY = (pos.y - editorPagePosition.y) / scaleY;\n\treturn new CoordinatesRelativeToEditor(relativeX, relativeY);\n}\n\nexport class EditorMouseEvent extends StandardMouseEvent {\n\t_editorMouseEventBrand: void = undefined;\n\n\t/**\n\t * If the event is a result of using `setPointerCapture`, the `event.target`\n\t * does not necessarily reflect the position in the editor.\n\t */\n\tpublic readonly isFromPointerCapture: boolean;\n\n\t/**\n\t * Coordinates relative to the whole document.\n\t */\n\tpublic readonly pos: PageCoordinates;\n\n\t/**\n\t * Editor's coordinates relative to the whole document.\n\t */\n\tpublic readonly editorPos: EditorPagePosition;\n\n\t/**\n\t * Coordinates relative to the (top;left) of the editor.\n\t * *NOTE*: These coordinates are preferred because they take into account transformations applied to the editor.\n\t * *NOTE*: These coordinates could be negative if the mouse position is outside the editor.\n\t */\n\tpublic readonly relativePos: CoordinatesRelativeToEditor;\n\n\tconstructor(e: MouseEvent, isFromPointerCapture: boolean, editorViewDomNode: HTMLElement) {\n\t\tsuper(dom.getWindow(editorViewDomNode), e);\n\t\tthis.isFromPointerCapture = isFromPointerCapture;\n\t\tthis.pos = new PageCoordinates(this.posx, this.posy);\n\t\tthis.editorPos = createEditorPagePosition(editorViewDomNode);\n\t\tthis.relativePos = createCoordinatesRelativeToEditor(editorViewDomNode, this.editorPos, this.pos);\n\t}\n}\n\nexport class EditorMouseEventFactory {\n\n\tprivate readonly _editorViewDomNode: HTMLElement;\n\n\tconstructor(editorViewDomNode: HTMLElement) {\n\t\tthis._editorViewDomNode = editorViewDomNode;\n\t}\n\n\tprivate _create(e: MouseEvent): EditorMouseEvent {\n\t\treturn new EditorMouseEvent(e, false, this._editorViewDomNode);\n\t}\n\n\tpublic onContextMenu(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.CONTEXT_MENU, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onMouseUp(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.MOUSE_UP, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onMouseDown(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.MOUSE_DOWN, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onPointerDown(target: HTMLElement, callback: (e: EditorMouseEvent, pointerId: number) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.POINTER_DOWN, (e: PointerEvent) => {\n\t\t\tcallback(this._create(e), e.pointerId);\n\t\t});\n\t}\n\n\tpublic onMouseLeave(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.MOUSE_LEAVE, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onMouseMove(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.MOUSE_MOVE, (e) => callback(this._create(e)));\n\t}\n}\n\nexport class EditorPointerEventFactory {\n\n\tprivate readonly _editorViewDomNode: HTMLElement;\n\n\tconstructor(editorViewDomNode: HTMLElement) {\n\t\tthis._editorViewDomNode = editorViewDomNode;\n\t}\n\n\tprivate _create(e: MouseEvent): EditorMouseEvent {\n\t\treturn new EditorMouseEvent(e, false, this._editorViewDomNode);\n\t}\n\n\tpublic onPointerUp(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, 'pointerup', (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onPointerDown(target: HTMLElement, callback: (e: EditorMouseEvent, pointerId: number) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.POINTER_DOWN, (e: PointerEvent) => {\n\t\t\tcallback(this._create(e), e.pointerId);\n\t\t});\n\t}\n\n\tpublic onPointerLeave(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.POINTER_LEAVE, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onPointerMove(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, 'pointermove', (e) => callback(this._create(e)));\n\t}\n}\n\nexport class GlobalEditorPointerMoveMonitor extends Disposable {\n\n\tprivate readonly _editorViewDomNode: HTMLElement;\n\tprivate readonly _globalPointerMoveMonitor: GlobalPointerMoveMonitor;\n\tprivate _keydownListener: IDisposable | null;\n\n\tconstructor(editorViewDomNode: HTMLElement) {\n\t\tsuper();\n\t\tthis._editorViewDomNode = editorViewDomNode;\n\t\tthis._globalPointerMoveMonitor = this._register(new GlobalPointerMoveMonitor());\n\t\tthis._keydownListener = null;\n\t}\n\n\tpublic startMonitoring(\n\t\tinitialElement: Element,\n\t\tpointerId: number,\n\t\tinitialButtons: number,\n\t\tpointerMoveCallback: (e: EditorMouseEvent) => void,\n\t\tonStopCallback: (browserEvent?: PointerEvent | KeyboardEvent) => void\n\t): void {\n\n\t\t// Add a <<capture>> keydown event listener that will cancel the monitoring\n\t\t// if something other than a modifier key is pressed\n\t\tthis._keydownListener = dom.addStandardDisposableListener(initialElement.ownerDocument, 'keydown', (e) => {\n\t\t\tconst chord = e.toKeyCodeChord();\n\t\t\tif (chord.isModifierKey()) {\n\t\t\t\t// Allow modifier keys\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._globalPointerMoveMonitor.stopMonitoring(true, e.browserEvent);\n\t\t}, true);\n\n\t\tthis._globalPointerMoveMonitor.startMonitoring(\n\t\t\tinitialElement,\n\t\t\tpointerId,\n\t\t\tinitialButtons,\n\t\t\t(e) => {\n\t\t\t\tpointerMoveCallback(new EditorMouseEvent(e, true, this._editorViewDomNode));\n\t\t\t},\n\t\t\t(e) => {\n\t\t\t\tthis._keydownListener!.dispose();\n\t\t\t\tonStopCallback(e);\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic stopMonitoring(): void {\n\t\tthis._globalPointerMoveMonitor.stopMonitoring(true);\n\t}\n}\n\n\n/**\n * A helper to create dynamic css rules, bound to a class name.\n * Rules are reused.\n * Reference counting and delayed garbage collection ensure that no rules leak.\n*/\nexport class DynamicCssRules {\n\tprivate static _idPool = 0;\n\tprivate readonly _instanceId = ++DynamicCssRules._idPool;\n\tprivate _counter = 0;\n\tprivate readonly _rules = new DisposableMap<string, RefCountedCssRule>();\n\n\t// We delay garbage collection so that hanging rules can be reused.\n\tprivate readonly _garbageCollectionScheduler = new RunOnceScheduler(() => this.garbageCollect(), 1000);\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor\n\t) { }\n\n\tdispose(): void {\n\t\tthis._rules.dispose();\n\t\tthis._garbageCollectionScheduler.dispose();\n\t}\n\n\tpublic createClassNameRef(options: CssProperties): ClassNameReference {\n\t\tconst rule = this.getOrCreateRule(options);\n\t\trule.increaseRefCount();\n\n\t\treturn {\n\t\t\tclassName: rule.className,\n\t\t\tdispose: () => {\n\t\t\t\trule.decreaseRefCount();\n\t\t\t\tthis._garbageCollectionScheduler.schedule();\n\t\t\t}\n\t\t};\n\t}\n\n\tprivate getOrCreateRule(properties: CssProperties): RefCountedCssRule {\n\t\tconst key = this.computeUniqueKey(properties);\n\t\tlet existingRule = this._rules.get(key);\n\t\tif (!existingRule) {\n\t\t\tconst counter = this._counter++;\n\t\t\texistingRule = new RefCountedCssRule(key, `dyn-rule-${this._instanceId}-${counter}`,\n\t\t\t\tdom.isInShadowDOM(this._editor.getContainerDomNode())\n\t\t\t\t\t? this._editor.getContainerDomNode()\n\t\t\t\t\t: undefined,\n\t\t\t\tproperties\n\t\t\t);\n\t\t\tthis._rules.set(key, existingRule);\n\t\t}\n\t\treturn existingRule;\n\t}\n\n\tprivate computeUniqueKey(properties: CssProperties): string {\n\t\treturn JSON.stringify(properties);\n\t}\n\n\tprivate garbageCollect() {\n\t\tfor (const rule of this._rules.values()) {\n\t\t\tif (!rule.hasReferences()) {\n\t\t\t\tthis._rules.deleteAndDispose(rule.key);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport interface ClassNameReference extends IDisposable {\n\tclassName: string;\n}\n\nexport interface CssProperties {\n\tborderRadius?: string;\n\tfontSize?: string;\n\tfontFamily?: string;\n\tunicodeBidi?: string;\n\ttextDecoration?: string;\n\tcolor?: string | ThemeColor;\n\tbackgroundColor?: string | ThemeColor;\n\tverticalAlign?: string;\n\tcursor?: string;\n\tpadding?: string;\n\twidth?: string;\n\tdisplay?: string;\n}\n\nclass RefCountedCssRule {\n\tprivate _referenceCount: number = 0;\n\tprivate _styleElement: HTMLStyleElement | undefined;\n\tprivate readonly _styleElementDisposables: DisposableStore;\n\n\tconstructor(\n\t\tpublic readonly key: string,\n\t\tpublic readonly className: string,\n\t\t_containerElement: HTMLElement | undefined,\n\t\tpublic readonly properties: CssProperties,\n\t) {\n\t\tthis._styleElementDisposables = new DisposableStore();\n\t\tthis._styleElement = domStylesheetsJs.createStyleSheet(_containerElement, undefined, this._styleElementDisposables);\n\t\tthis._styleElement.textContent = this.getCssText(this.className, this.properties);\n\t}\n\n\tprivate getCssText(className: string, properties: CssProperties): string {\n\t\tlet str = `.${className} {`;\n\t\tfor (const prop in properties) {\n\t\t\tconst value = (properties as Record<string, unknown>)[prop] as string | ThemeColor;\n\t\t\tlet cssValue: unknown;\n\t\t\tif (typeof value === 'object') {\n\t\t\t\tcssValue = asCssVariable(value.id);\n\t\t\t} else {\n\t\t\t\tcssValue = value;\n\t\t\t}\n\n\t\t\tconst cssPropName = camelToDashes(prop);\n\t\t\tstr += `\\n\\t${cssPropName}: ${cssValue};`;\n\t\t}\n\t\tstr += `\\n}`;\n\t\treturn str;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._styleElementDisposables.dispose();\n\t\tthis._styleElement = undefined;\n\t}\n\n\tpublic increaseRefCount(): void {\n\t\tthis._referenceCount++;\n\t}\n\n\tpublic decreaseRefCount(): void {\n\t\tthis._referenceCount--;\n\t}\n\n\tpublic hasReferences(): boolean {\n\t\treturn this._referenceCount > 0;\n\t}\n}\n\nfunction camelToDashes(str: string): string {\n\treturn str.replace(/(^[A-Z])/, ([first]) => first.toLowerCase())\n\t\t.replace(/([A-Z])/g, ([letter]) => `-${letter.toLowerCase()}`);\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 * as domStylesheetsJs from '../../base/browser/domStylesheets.js';\nimport { GlobalPointerMoveMonitor } from '../../base/browser/globalPointerMoveMonitor.js';\nimport { StandardMouseEvent } from '../../base/browser/mouseEvent.js';\nimport { RunOnceScheduler } from '../../base/common/async.js';\nimport { Disposable, DisposableMap, DisposableStore, IDisposable } from '../../base/common/lifecycle.js';\nimport { ICodeEditor } from './editorBrowser.js';\nimport { asCssVariable } from '../../platform/theme/common/colorRegistry.js';\nimport { ThemeColor } from '../../base/common/themables.js';\n\n/**\n * Coordinates relative to the whole document (e.g. mouse event's pageX and pageY)\n */\nexport class PageCoordinates {\n\t_pageCoordinatesBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly x: number,\n\t\tpublic readonly y: number\n\t) { }\n\n\tpublic toClientCoordinates(targetWindow: Window): ClientCoordinates {\n\t\treturn new ClientCoordinates(this.x - targetWindow.scrollX, this.y - targetWindow.scrollY);\n\t}\n}\n\n/**\n * Coordinates within the application's client area (i.e. origin is document's scroll position).\n *\n * For example, clicking in the top-left corner of the client area will\n * always result in a mouse event with a client.x value of 0, regardless\n * of whether the page is scrolled horizontally.\n */\nexport class ClientCoordinates {\n\t_clientCoordinatesBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly clientX: number,\n\t\tpublic readonly clientY: number\n\t) { }\n\n\tpublic toPageCoordinates(targetWindow: Window): PageCoordinates {\n\t\treturn new PageCoordinates(this.clientX + targetWindow.scrollX, this.clientY + targetWindow.scrollY);\n\t}\n}\n\n/**\n * The position of the editor in the page.\n */\nexport class EditorPagePosition {\n\t_editorPagePositionBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly x: number,\n\t\tpublic readonly y: number,\n\t\tpublic readonly width: number,\n\t\tpublic readonly height: number\n\t) { }\n}\n\n/**\n * Coordinates relative to the (top;left) of the editor that can be used safely with other internal editor metrics.\n * **NOTE**: This position is obtained by taking page coordinates and transforming them relative to the\n * editor's (top;left) position in a way in which scale transformations are taken into account.\n * **NOTE**: These coordinates could be negative if the mouse position is outside the editor.\n */\nexport class CoordinatesRelativeToEditor {\n\t_positionRelativeToEditorBrand: void = undefined;\n\n\tconstructor(\n\t\tpublic readonly x: number,\n\t\tpublic readonly y: number\n\t) { }\n}\n\nexport function createEditorPagePosition(editorViewDomNode: HTMLElement): EditorPagePosition {\n\tconst editorPos = dom.getDomNodePagePosition(editorViewDomNode);\n\treturn new EditorPagePosition(editorPos.left, editorPos.top, editorPos.width, editorPos.height);\n}\n\nexport function createCoordinatesRelativeToEditor(editorViewDomNode: HTMLElement, editorPagePosition: EditorPagePosition, pos: PageCoordinates) {\n\t// The editor's page position is read from the DOM using getBoundingClientRect().\n\t//\n\t// getBoundingClientRect() returns the actual dimensions, while offsetWidth and offsetHeight\n\t// reflect the unscaled size. We can use this difference to detect a transform:scale()\n\t// and we will apply the transformation in inverse to get mouse coordinates that make sense inside the editor.\n\t//\n\t// This could be expanded to cover rotation as well maybe by walking the DOM up from `editorViewDomNode`\n\t// and computing the effective transformation matrix using getComputedStyle(element).transform.\n\t//\n\tconst scaleX = editorPagePosition.width / editorViewDomNode.offsetWidth;\n\tconst scaleY = editorPagePosition.height / editorViewDomNode.offsetHeight;\n\n\t// Adjust mouse offsets if editor appears to be scaled via transforms\n\tconst relativeX = (pos.x - editorPagePosition.x) / scaleX;\n\tconst relativeY = (pos.y - editorPagePosition.y) / scaleY;\n\treturn new CoordinatesRelativeToEditor(relativeX, relativeY);\n}\n\nexport class EditorMouseEvent extends StandardMouseEvent {\n\t_editorMouseEventBrand: void = undefined;\n\n\t/**\n\t * If the event is a result of using `setPointerCapture`, the `event.target`\n\t * does not necessarily reflect the position in the editor.\n\t */\n\tpublic readonly isFromPointerCapture: boolean;\n\n\t/**\n\t * Coordinates relative to the whole document.\n\t */\n\tpublic readonly pos: PageCoordinates;\n\n\t/**\n\t * Editor's coordinates relative to the whole document.\n\t */\n\tpublic readonly editorPos: EditorPagePosition;\n\n\t/**\n\t * Coordinates relative to the (top;left) of the editor.\n\t * *NOTE*: These coordinates are preferred because they take into account transformations applied to the editor.\n\t * *NOTE*: These coordinates could be negative if the mouse position is outside the editor.\n\t */\n\tpublic readonly relativePos: CoordinatesRelativeToEditor;\n\n\tconstructor(e: MouseEvent, isFromPointerCapture: boolean, editorViewDomNode: HTMLElement) {\n\t\tsuper(dom.getWindow(editorViewDomNode), e);\n\t\tthis.isFromPointerCapture = isFromPointerCapture;\n\t\tthis.pos = new PageCoordinates(this.posx, this.posy);\n\t\tthis.editorPos = createEditorPagePosition(editorViewDomNode);\n\t\tthis.relativePos = createCoordinatesRelativeToEditor(editorViewDomNode, this.editorPos, this.pos);\n\t}\n}\n\nexport class EditorMouseEventFactory {\n\n\tprivate readonly _editorViewDomNode: HTMLElement;\n\n\tconstructor(editorViewDomNode: HTMLElement) {\n\t\tthis._editorViewDomNode = editorViewDomNode;\n\t}\n\n\tprivate _create(e: MouseEvent): EditorMouseEvent {\n\t\treturn new EditorMouseEvent(e, false, this._editorViewDomNode);\n\t}\n\n\tpublic onContextMenu(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.CONTEXT_MENU, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onMouseUp(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.MOUSE_UP, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onMouseDown(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.MOUSE_DOWN, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onPointerDown(target: HTMLElement, callback: (e: EditorMouseEvent, pointerId: number) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.POINTER_DOWN, (e: PointerEvent) => {\n\t\t\tcallback(this._create(e), e.pointerId);\n\t\t});\n\t}\n\n\tpublic onMouseLeave(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.MOUSE_LEAVE, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onMouseMove(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.MOUSE_MOVE, (e) => callback(this._create(e)));\n\t}\n}\n\nexport class EditorPointerEventFactory {\n\n\tprivate readonly _editorViewDomNode: HTMLElement;\n\n\tconstructor(editorViewDomNode: HTMLElement) {\n\t\tthis._editorViewDomNode = editorViewDomNode;\n\t}\n\n\tprivate _create(e: MouseEvent): EditorMouseEvent {\n\t\treturn new EditorMouseEvent(e, false, this._editorViewDomNode);\n\t}\n\n\tpublic onPointerUp(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, 'pointerup', (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onPointerDown(target: HTMLElement, callback: (e: EditorMouseEvent, pointerId: number) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.POINTER_DOWN, (e: PointerEvent) => {\n\t\t\tcallback(this._create(e), e.pointerId);\n\t\t});\n\t}\n\n\tpublic onPointerLeave(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, dom.EventType.POINTER_LEAVE, (e: MouseEvent) => {\n\t\t\tcallback(this._create(e));\n\t\t});\n\t}\n\n\tpublic onPointerMove(target: HTMLElement, callback: (e: EditorMouseEvent) => void): IDisposable {\n\t\treturn dom.addDisposableListener(target, 'pointermove', (e) => callback(this._create(e)));\n\t}\n}\n\nexport class GlobalEditorPointerMoveMonitor extends Disposable {\n\n\tprivate readonly _editorViewDomNode: HTMLElement;\n\tprivate readonly _globalPointerMoveMonitor: GlobalPointerMoveMonitor;\n\tprivate _keydownListener: IDisposable | null;\n\n\tconstructor(editorViewDomNode: HTMLElement) {\n\t\tsuper();\n\t\tthis._editorViewDomNode = editorViewDomNode;\n\t\tthis._globalPointerMoveMonitor = this._register(new GlobalPointerMoveMonitor());\n\t\tthis._keydownListener = null;\n\t}\n\n\tpublic startMonitoring(\n\t\tinitialElement: Element,\n\t\tpointerId: number,\n\t\tinitialButtons: number,\n\t\tpointerMoveCallback: (e: EditorMouseEvent) => void,\n\t\tonStopCallback: (browserEvent?: PointerEvent | KeyboardEvent) => void\n\t): void {\n\n\t\t// Add a <<capture>> keydown event listener that will cancel the monitoring\n\t\t// if something other than a modifier key is pressed\n\t\tthis._keydownListener = dom.addStandardDisposableListener(initialElement.ownerDocument, 'keydown', (e) => {\n\t\t\tconst chord = e.toKeyCodeChord();\n\t\t\tif (chord.isModifierKey()) {\n\t\t\t\t// Allow modifier keys\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._globalPointerMoveMonitor.stopMonitoring(true, e.browserEvent);\n\t\t}, true);\n\n\t\tthis._globalPointerMoveMonitor.startMonitoring(\n\t\t\tinitialElement,\n\t\t\tpointerId,\n\t\t\tinitialButtons,\n\t\t\t(e) => {\n\t\t\t\tpointerMoveCallback(new EditorMouseEvent(e, true, this._editorViewDomNode));\n\t\t\t},\n\t\t\t(e) => {\n\t\t\t\tthis._keydownListener!.dispose();\n\t\t\t\tonStopCallback(e);\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic stopMonitoring(): void {\n\t\tthis._globalPointerMoveMonitor.stopMonitoring(true);\n\t}\n}\n\n\n/**\n * A helper to create dynamic css rules, bound to a class name.\n * Rules are reused.\n * Reference counting and delayed garbage collection ensure that no rules leak.\n*/\nexport class DynamicCssRules {\n\tprivate static _idPool = 0;\n\tprivate readonly _instanceId = ++DynamicCssRules._idPool;\n\tprivate _counter = 0;\n\tprivate readonly _rules = new DisposableMap<string, RefCountedCssRule>();\n\n\t// We delay garbage collection so that hanging rules can be reused.\n\tprivate readonly _garbageCollectionScheduler = new RunOnceScheduler(() => this.garbageCollect(), 1000);\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor\n\t) { }\n\n\tdispose(): void {\n\t\tthis._rules.dispose();\n\t\tthis._garbageCollectionScheduler.dispose();\n\t}\n\n\tpublic createClassNameRef(options: CssProperties): ClassNameReference {\n\t\tconst rule = this.getOrCreateRule(options);\n\t\trule.increaseRefCount();\n\n\t\treturn {\n\t\t\tclassName: rule.className,\n\t\t\tdispose: () => {\n\t\t\t\trule.decreaseRefCount();\n\t\t\t\tthis._garbageCollectionScheduler.schedule();\n\t\t\t}\n\t\t};\n\t}\n\n\tprivate getOrCreateRule(properties: CssProperties): RefCountedCssRule {\n\t\tconst key = this.computeUniqueKey(properties);\n\t\tlet existingRule = this._rules.get(key);\n\t\tif (!existingRule) {\n\t\t\tconst counter = this._counter++;\n\t\t\texistingRule = new RefCountedCssRule(key, `dyn-rule-${this._instanceId}-${counter}`,\n\t\t\t\tdom.isInShadowDOM(this._editor.getContainerDomNode())\n\t\t\t\t\t? this._editor.getContainerDomNode()\n\t\t\t\t\t: undefined,\n\t\t\t\tproperties\n\t\t\t);\n\t\t\tthis._rules.set(key, existingRule);\n\t\t}\n\t\treturn existingRule;\n\t}\n\n\tprivate computeUniqueKey(properties: CssProperties): string {\n\t\treturn JSON.stringify(properties);\n\t}\n\n\tprivate garbageCollect() {\n\t\tfor (const rule of this._rules.values()) {\n\t\t\tif (!rule.hasReferences()) {\n\t\t\t\tthis._rules.deleteAndDispose(rule.key);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport interface ClassNameReference extends IDisposable {\n\tclassName: string;\n}\n\nexport interface CssProperties {\n\tborderRadius?: string;\n\tfontSize?: string;\n\tfontFamily?: string;\n\tunicodeBidi?: string;\n\ttextDecoration?: string;\n\tcolor?: string | ThemeColor;\n\tbackgroundColor?: string | ThemeColor;\n\tverticalAlign?: string;\n\tcursor?: string;\n\tpadding?: string;\n\twidth?: string;\n\tdisplay?: string;\n}\n\nclass RefCountedCssRule {\n\tprivate _referenceCount: number = 0;\n\tprivate _styleElement: HTMLStyleElement | undefined;\n\tprivate readonly _styleElementDisposables: DisposableStore;\n\n\tconstructor(\n\t\tpublic readonly key: string,\n\t\tpublic readonly className: string,\n\t\t_containerElement: HTMLElement | undefined,\n\t\tpublic readonly properties: CssProperties,\n\t) {\n\t\tthis._styleElementDisposables = new DisposableStore();\n\t\tthis._styleElement = domStylesheetsJs.createStyleSheet(_containerElement, undefined, this._styleElementDisposables);\n\t\tthis._styleElement.textContent = this.getCssText(this.className, this.properties);\n\t}\n\n\tprivate getCssText(className: string, properties: CssProperties): string {\n\t\tlet str = `.${className} {`;\n\t\tfor (const prop in properties) {\n\t\t\tconst value = (properties as Record<string, unknown>)[prop] as string | ThemeColor;\n\t\t\tlet cssValue: unknown;\n\t\t\tif (typeof value === 'object') {\n\t\t\t\tcssValue = asCssVariable(value.id);\n\t\t\t} else {\n\t\t\t\tcssValue = value;\n\t\t\t}\n\n\t\t\tconst cssPropName = camelToDashes(prop);\n\t\t\tstr += `\\n\\t${cssPropName}: ${cssValue};`;\n\t\t}\n\t\tstr += `\\n}`;\n\t\treturn str;\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._styleElementDisposables.dispose();\n\t\tthis._styleElement = undefined;\n\t}\n\n\tpublic increaseRefCount(): void {\n\t\tthis._referenceCount++;\n\t}\n\n\tpublic decreaseRefCount(): void {\n\t\tthis._referenceCount--;\n\t}\n\n\tpublic hasReferences(): boolean {\n\t\treturn this._referenceCount > 0;\n\t}\n}\n\nfunction camelToDashes(str: string): string {\n\treturn str.replace(/(^[A-Z])/, ([first]) => first.toLowerCase())\n\t\t.replace(/([A-Z])/g, ([letter]) => `-${letter.toLowerCase()}`);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["vs/editor/browser/editorExtensions.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAGtD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAA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eAAe,CAAC,IAAI,YAAY,CAAC,WAAW,EAAE,EAAE,EAAE,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;AAEhG,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC,IAAI,YAAY,CAAC;IAChE,EAAE,EAAE,yBAAyB;IAC7B,YAAY,EAAE,SAAS;IACvB,MAAM,EAAE;QACP,MAAM,qCAA6B;QACnC,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,iDAA6B;KACtC;IACD,QAAQ,EAAE,CAAC;YACV,MAAM,EAAE,MAAM,CAAC,oBAAoB;YACnC,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,GAAG,CAAC,QAAQ,CAAC,EAAE,AAAwD,EAAE,CAAvD,EAAE,WAAmE,CAAC,CAAvD,EAAE,OAAO,EAAE,CAAC,uBAAuB,CAAC;YAC5E,KAAK,EAAE,CAAC;SACR,EAAE;YACF,MAAM,EAAE,MAAM,CAAC,cAAc;YAC7B,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,GAAG,CAAC,QAAQ,CAAC,EAAW,EAAE,YAAY,CAAC;YAC9C,KAAK,EAAE,CAAC;SACR,EAAE;YACF,MAAM,EAAE,MAAM,CAAC,mBAAmB;YAClC,KAAK,EAAE,UAAU;YACjB,KAAK,EAAE,GAAG,CAAC,QAAQ,CAAC,EAAW,EAAE,YAAY,CAAC;YAC9C,KAAK,EAAE,CAAC;SACR,CAAC;CACF,CAAC,CAAC,CAAC","file":"editorExtensions.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 nls from '../../nls.js';\nimport { URI } from '../../base/common/uri.js';\nimport { ICodeEditor, IDiffEditor } from './editorBrowser.js';\nimport { ICodeEditorService } from './services/codeEditorService.js';\nimport { Position } from '../common/core/position.js';\nimport { IEditorContribution, IDiffEditorContribution } from '../common/editorCommon.js';\nimport { ITextModel } from '../common/model.js';\nimport { IModelService } from '../common/services/model.js';\nimport { ITextModelService } from '../common/services/resolverService.js';\nimport { MenuId, MenuRegistry, Action2 } from '../../platform/actions/common/actions.js';\nimport { CommandsRegistry, ICommandMetadata } from '../../platform/commands/common/commands.js';\nimport { ContextKeyExpr, IContextKeyService, ContextKeyExpression } from '../../platform/contextkey/common/contextkey.js';\nimport { ServicesAccessor as InstantiationServicesAccessor, BrandedService, IInstantiationService, IConstructorSignature } from '../../platform/instantiation/common/instantiation.js';\nimport { IKeybindings, KeybindingsRegistry, KeybindingWeight } from '../../platform/keybinding/common/keybindingsRegistry.js';\nimport { Registry } from '../../platform/registry/common/platform.js';\nimport { ITelemetryService } from '../../platform/telemetry/common/telemetry.js';\nimport { assertType } from '../../base/common/types.js';\nimport { ThemeIcon } from '../../base/common/themables.js';\nimport { IDisposable } from '../../base/common/lifecycle.js';\nimport { KeyMod, KeyCode } from '../../base/common/keyCodes.js';\nimport { ILogService } from '../../platform/log/common/log.js';\nimport { getActiveElement } from '../../base/browser/dom.js';\n\nexport type ServicesAccessor = InstantiationServicesAccessor;\nexport type EditorContributionCtor = IConstructorSignature<IEditorContribution, [ICodeEditor]>;\nexport type DiffEditorContributionCtor = IConstructorSignature<IDiffEditorContribution, [IDiffEditor]>;\n\nexport const enum EditorContributionInstantiation {\n\t/**\n\t * The contribution is created eagerly when the {@linkcode ICodeEditor} is instantiated.\n\t * Only Eager contributions can participate in saving or restoring of view state.\n\t */\n\tEager,\n\n\t/**\n\t * The contribution is created at the latest 50ms after the first render after attaching a text model.\n\t * If the contribution is explicitly requested via `getContribution`, it will be instantiated sooner.\n\t * If there is idle time available, it will be instantiated sooner.\n\t */\n\tAfterFirstRender,\n\n\t/**\n\t * The contribution is created before the editor emits events produced by user interaction (mouse events, keyboard events).\n\t * If the contribution is explicitly requested via `getContribution`, it will be instantiated sooner.\n\t * If there is idle time available, it will be instantiated sooner.\n\t */\n\tBeforeFirstInteraction,\n\n\t/**\n\t * The contribution is created when there is idle time available, at the latest 5000ms after the editor creation.\n\t * If the contribution is explicitly requested via `getContribution`, it will be instantiated sooner.\n\t */\n\tEventually,\n\n\t/**\n\t * The contribution is created only when explicitly requested via `getContribution`.\n\t */\n\tLazy,\n}\n\nexport interface IEditorContributionDescription {\n\treadonly id: string;\n\treadonly ctor: EditorContributionCtor;\n\treadonly instantiation: EditorContributionInstantiation;\n}\n\nexport interface IDiffEditorContributionDescription {\n\tctor: DiffEditorContributionCtor;\n}\n\n//#region Command\n\nexport interface ICommandKeybindingsOptions extends IKeybindings {\n\tkbExpr?: ContextKeyExpression | null;\n\tweight: number;\n\t/**\n\t * the default keybinding arguments\n\t */\n\targs?: any;\n}\nexport interface ICommandMenuOptions {\n\tmenuId: MenuId;\n\tgroup: string;\n\torder: number;\n\twhen?: ContextKeyExpression;\n\ttitle: string;\n\ticon?: ThemeIcon;\n}\nexport interface ICommandOptions {\n\tid: string;\n\tprecondition: ContextKeyExpression | undefined;\n\tkbOpts?: ICommandKeybindingsOptions | ICommandKeybindingsOptions[];\n\tmetadata?: ICommandMetadata;\n\tmenuOpts?: ICommandMenuOptions | ICommandMenuOptions[];\n}\nexport abstract class Command {\n\tpublic readonly id: string;\n\tpublic readonly precondition: ContextKeyExpression | undefined;\n\tprivate readonly _kbOpts: ICommandKeybindingsOptions | ICommandKeybindingsOptions[] | undefined;\n\tprivate readonly _menuOpts: ICommandMenuOptions | ICommandMenuOptions[] | undefined;\n\tpublic readonly metadata: ICommandMetadata | undefined;\n\n\tconstructor(opts: ICommandOptions) {\n\t\tthis.id = opts.id;\n\t\tthis.precondition = opts.precondition;\n\t\tthis._kbOpts = opts.kbOpts;\n\t\tthis._menuOpts = opts.menuOpts;\n\t\tthis.metadata = opts.metadata;\n\t}\n\n\tpublic register(): void {\n\n\t\tif (Array.isArray(this._menuOpts)) {\n\t\t\tthis._menuOpts.forEach(this._registerMenuItem, this);\n\t\t} else if (this._menuOpts) {\n\t\t\tthis._registerMenuItem(this._menuOpts);\n\t\t}\n\n\t\tif (this._kbOpts) {\n\t\t\tconst kbOptsArr = Array.isArray(this._kbOpts) ? this._kbOpts : [this._kbOpts];\n\t\t\tfor (const kbOpts of kbOptsArr) {\n\t\t\t\tlet kbWhen = kbOpts.kbExpr;\n\t\t\t\tif (this.precondition) {\n\t\t\t\t\tif (kbWhen) {\n\t\t\t\t\t\tkbWhen = ContextKeyExpr.and(kbWhen, this.precondition);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tkbWhen = this.precondition;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst desc = {\n\t\t\t\t\tid: this.id,\n\t\t\t\t\tweight: kbOpts.weight,\n\t\t\t\t\targs: kbOpts.args,\n\t\t\t\t\twhen: kbWhen,\n\t\t\t\t\tprimary: kbOpts.primary,\n\t\t\t\t\tsecondary: kbOpts.secondary,\n\t\t\t\t\twin: kbOpts.win,\n\t\t\t\t\tlinux: kbOpts.linux,\n\t\t\t\t\tmac: kbOpts.mac,\n\t\t\t\t};\n\n\t\t\t\tKeybindingsRegistry.registerKeybindingRule(desc);\n\t\t\t}\n\t\t}\n\n\t\tCommandsRegistry.registerCommand({\n\t\t\tid: this.id,\n\t\t\thandler: (accessor, args) => this.runCommand(accessor, args),\n\t\t\tmetadata: this.metadata\n\t\t});\n\t}\n\n\tprivate _registerMenuItem(item: ICommandMenuOptions): void {\n\t\tMenuRegistry.appendMenuItem(item.menuId, {\n\t\t\tgroup: item.group,\n\t\t\tcommand: {\n\t\t\t\tid: this.id,\n\t\t\t\ttitle: item.title,\n\t\t\t\ticon: item.icon,\n\t\t\t\tprecondition: this.precondition\n\t\t\t},\n\t\t\twhen: item.when,\n\t\t\torder: item.order\n\t\t});\n\t}\n\n\tpublic abstract runCommand(accessor: ServicesAccessor, args: any): void | Promise<void>;\n}\n\n//#endregion Command\n\n//#region MultiplexingCommand\n\n/**\n * Potential override for a command.\n *\n * @return `true` or a Promise if the command was successfully run. This stops other overrides from being executed.\n */\nexport type CommandImplementation = (accessor: ServicesAccessor, args: unknown) => boolean | Promise<void>;\n\ninterface ICommandImplementationRegistration {\n\tpriority: number;\n\tname: string;\n\timplementation: CommandImplementation;\n\twhen?: ContextKeyExpression;\n}\n\nexport class MultiCommand extends Command {\n\n\tprivate readonly _implementations: ICommandImplementationRegistration[] = [];\n\n\t/**\n\t * A higher priority gets to be looked at first\n\t */\n\tpublic addImplementation(priority: number, name: string, implementation: CommandImplementation, when?: ContextKeyExpression): IDisposable {\n\t\tthis._implementations.push({ priority, name, implementation, when });\n\t\tthis._implementations.sort((a, b) => b.priority - a.priority);\n\t\treturn {\n\t\t\tdispose: () => {\n\t\t\t\tfor (let i = 0; i < this._implementations.length; i++) {\n\t\t\t\t\tif (this._implementations[i].implementation === implementation) {\n\t\t\t\t\t\tthis._implementations.splice(i, 1);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic runCommand(accessor: ServicesAccessor, args: any): void | Promise<void> {\n\t\tconst logService = accessor.get(ILogService);\n\t\tconst contextKeyService = accessor.get(IContextKeyService);\n\t\tlogService.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);\n\t\tfor (const impl of this._implementations) {\n\t\t\tif (impl.when) {\n\t\t\t\tconst context = contextKeyService.getContext(getActiveElement());\n\t\t\t\tconst value = impl.when.evaluate(context);\n\t\t\t\tif (!value) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst result = impl.implementation(accessor, args);\n\t\t\tif (result) {\n\t\t\t\tlogService.trace(`Command '${this.id}' was handled by '${impl.name}'.`);\n\t\t\t\tif (typeof result === 'boolean') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\tlogService.trace(`The Command '${this.id}' was not handled by any implementation.`);\n\t}\n}\n\n//#endregion\n\n/**\n * A command that delegates to another command's implementation.\n *\n * This lets different commands be registered but share the same implementation\n */\nexport class ProxyCommand extends Command {\n\tconstructor(\n\t\tprivate readonly command: Command,\n\t\topts: ICommandOptions\n\t) {\n\t\tsuper(opts);\n\t}\n\n\tpublic runCommand(accessor: ServicesAccessor, args: any): void | Promise<void> {\n\t\treturn this.command.runCommand(accessor, args);\n\t}\n}\n\n//#region EditorCommand\n\nexport interface IContributionCommandOptions<T> extends ICommandOptions {\n\thandler: (controller: T, args: any) => void;\n}\nexport interface EditorControllerCommand<T extends IEditorContribution> {\n\tnew(opts: IContributionCommandOptions<T>): EditorCommand;\n}\nexport abstract class EditorCommand extends Command {\n\n\t/**\n\t * Create a command class that is bound to a certain editor contribution.\n\t */\n\tpublic static bindToContribution<T extends IEditorContribution>(controllerGetter: (editor: ICodeEditor) => T | null): EditorControllerCommand<T> {\n\t\treturn class EditorControllerCommandImpl extends EditorCommand {\n\t\t\tprivate readonly _callback: (controller: T, args: any) => void;\n\n\t\t\tconstructor(opts: IContributionCommandOptions<T>) {\n\t\t\t\tsuper(opts);\n\n\t\t\t\tthis._callback = opts.handler;\n\t\t\t}\n\n\t\t\tpublic runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void {\n\t\t\t\tconst controller = controllerGetter(editor);\n\t\t\t\tif (controller) {\n\t\t\t\t\tthis._callback(controller, args);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic static runEditorCommand(\n\t\taccessor: ServicesAccessor,\n\t\targs: any,\n\t\tprecondition: ContextKeyExpression | undefined,\n\t\trunner: (accessor: ServicesAccessor, editor: ICodeEditor, args: any) => void | Promise<void>\n\t): void | Promise<void> {\n\t\tconst codeEditorService = accessor.get(ICodeEditorService);\n\n\t\t// Find the editor with text focus or active\n\t\tconst editor = codeEditorService.getFocusedCodeEditor() || codeEditorService.getActiveCodeEditor();\n\t\tif (!editor) {\n\t\t\t// well, at least we tried...\n\t\t\treturn;\n\t\t}\n\n\t\treturn editor.invokeWithinContext((editorAccessor) => {\n\t\t\tconst kbService = editorAccessor.get(IContextKeyService);\n\t\t\tif (!kbService.contextMatchesRules(precondition ?? undefined)) {\n\t\t\t\t// precondition does not hold\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treturn runner(editorAccessor, editor, args);\n\t\t});\n\t}\n\n\tpublic runCommand(accessor: ServicesAccessor, args: any): void | Promise<void> {\n\t\treturn EditorCommand.runEditorCommand(accessor, args, this.precondition, (accessor, editor, args) => this.runEditorCommand(accessor, editor, args));\n\t}\n\n\tpublic abstract runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void | Promise<void>;\n}\n\n//#endregion EditorCommand\n\n//#region EditorAction\n\nexport interface IEditorActionContextMenuOptions {\n\tgroup: string;\n\torder: number;\n\twhen?: ContextKeyExpression;\n}\nexport type IActionOptions = ICommandOptions & {\n\tcontextMenuOpts?: IEditorActionContextMenuOptions | IEditorActionContextMenuOptions[];\n} & ({\n\tlabel: nls.ILocalizedString;\n\talias?: string;\n} | {\n\tlabel: string;\n\talias: string;\n});\n\nexport abstract class EditorAction extends EditorCommand {\n\n\tprivate static convertOptions(opts: IActionOptions): ICommandOptions {\n\n\t\tlet menuOpts: ICommandMenuOptions[];\n\t\tif (Array.isArray(opts.menuOpts)) {\n\t\t\tmenuOpts = opts.menuOpts;\n\t\t} else if (opts.menuOpts) {\n\t\t\tmenuOpts = [opts.menuOpts];\n\t\t} else {\n\t\t\tmenuOpts = [];\n\t\t}\n\n\t\tfunction withDefaults(item: Partial<ICommandMenuOptions>): ICommandMenuOptions {\n\t\t\tif (!item.menuId) {\n\t\t\t\titem.menuId = MenuId.EditorContext;\n\t\t\t}\n\t\t\tif (!item.title) {\n\t\t\t\titem.title = typeof opts.label === 'string' ? opts.label : opts.label.value;\n\t\t\t}\n\t\t\titem.when = ContextKeyExpr.and(opts.precondition, item.when);\n\t\t\treturn <ICommandMenuOptions>item;\n\t\t}\n\n\t\tif (Array.isArray(opts.contextMenuOpts)) {\n\t\t\tmenuOpts.push(...opts.contextMenuOpts.map(withDefaults));\n\t\t} else if (opts.contextMenuOpts) {\n\t\t\tmenuOpts.push(withDefaults(opts.contextMenuOpts));\n\t\t}\n\n\t\topts.menuOpts = menuOpts;\n\t\treturn <ICommandOptions>opts;\n\t}\n\n\tpublic readonly label: string;\n\tpublic readonly alias: string;\n\n\tconstructor(opts: IActionOptions) {\n\t\tsuper(EditorAction.convertOptions(opts));\n\t\tif (typeof opts.label === 'string') {\n\t\t\tthis.label = opts.label;\n\t\t\tthis.alias = opts.alias ?? opts.label;\n\t\t} else {\n\t\t\tthis.label = opts.label.value;\n\t\t\tthis.alias = opts.alias ?? opts.label.original;\n\t\t}\n\t}\n\n\tpublic runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void | Promise<void> {\n\t\tthis.reportTelemetry(accessor, editor);\n\t\treturn this.run(accessor, editor, args || {});\n\t}\n\n\tprotected reportTelemetry(accessor: ServicesAccessor, editor: ICodeEditor) {\n\t\ttype EditorActionInvokedClassification = {\n\t\t\towner: 'alexdima';\n\t\t\tcomment: 'An editor action has been invoked.';\n\t\t\tname: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The label of the action that was invoked.' };\n\t\t\tid: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The identifier of the action that was invoked.' };\n\t\t};\n\t\ttype EditorActionInvokedEvent = {\n\t\t\tname: string;\n\t\t\tid: string;\n\t\t};\n\t\taccessor.get(ITelemetryService).publicLog2<EditorActionInvokedEvent, EditorActionInvokedClassification>('editorActionInvoked', { name: this.label, id: this.id });\n\t}\n\n\tpublic abstract run(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void | Promise<void>;\n}\n\nexport type EditorActionImplementation = (accessor: ServicesAccessor, editor: ICodeEditor, args: any) => boolean | Promise<void>;\n\nexport class MultiEditorAction extends EditorAction {\n\n\tprivate readonly _implementations: [number, EditorActionImplementation][] = [];\n\n\t/**\n\t * A higher priority gets to be looked at first\n\t */\n\tpublic addImplementation(priority: number, implementation: EditorActionImplementation): IDisposable {\n\t\tthis._implementations.push([priority, implementation]);\n\t\tthis._implementations.sort((a, b) => b[0] - a[0]);\n\t\treturn {\n\t\t\tdispose: () => {\n\t\t\t\tfor (let i = 0; i < this._implementations.length; i++) {\n\t\t\t\t\tif (this._implementations[i][1] === implementation) {\n\t\t\t\t\t\tthis._implementations.splice(i, 1);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void | Promise<void> {\n\t\tfor (const impl of this._implementations) {\n\t\t\tconst result = impl[1](accessor, editor, args);\n\t\t\tif (result) {\n\t\t\t\tif (typeof result === 'boolean') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t}\n\n}\n\n//#endregion EditorAction\n\n//#region EditorAction2\n\nexport abstract class EditorAction2 extends Action2 {\n\n\trun(accessor: ServicesAccessor, ...args: any[]) {\n\t\t// Find the editor with text focus or active\n\t\tconst codeEditorService = accessor.get(ICodeEditorService);\n\t\tconst editor = codeEditorService.getFocusedCodeEditor() || codeEditorService.getActiveCodeEditor();\n\t\tif (!editor) {\n\t\t\t// well, at least we tried...\n\t\t\treturn;\n\t\t}\n\t\t// precondition does hold\n\t\treturn editor.invokeWithinContext((editorAccessor) => {\n\t\t\tconst kbService = editorAccessor.get(IContextKeyService);\n\t\t\tconst logService = editorAccessor.get(ILogService);\n\t\t\tconst enabled = kbService.contextMatchesRules(this.desc.precondition ?? undefined);\n\t\t\tif (!enabled) {\n\t\t\t\tlogService.debug(`[EditorAction2] NOT running command because its precondition is FALSE`, this.desc.id, this.desc.precondition?.serialize());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn this.runEditorCommand(editorAccessor, editor, ...args);\n\t\t});\n\t}\n\n\tabstract runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, ...args: any[]): any;\n}\n\n//#endregion\n\n// --- Registration of commands and actions\n\n\nexport function registerModelAndPositionCommand(id: string, handler: (accessor: ServicesAccessor, model: ITextModel, position: Position, ...args: any[]) => any) {\n\tCommandsRegistry.registerCommand(id, function (accessor, ...args) {\n\n\t\tconst instaService = accessor.get(IInstantiationService);\n\n\t\tconst [resource, position] = args;\n\t\tassertType(URI.isUri(resource));\n\t\tassertType(Position.isIPosition(position));\n\n\t\tconst model = accessor.get(IModelService).getModel(resource);\n\t\tif (model) {\n\t\t\tconst editorPosition = Position.lift(position);\n\t\t\treturn instaService.invokeFunction(handler, model, editorPosition, ...args.slice(2));\n\t\t}\n\n\t\treturn accessor.get(ITextModelService).createModelReference(resource).then(reference => {\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = instaService.invokeFunction(handler, reference.object.textEditorModel, Position.lift(position), args.slice(2));\n\t\t\t\t\tresolve(result);\n\t\t\t\t} catch (err) {\n\t\t\t\t\treject(err);\n\t\t\t\t}\n\t\t\t}).finally(() => {\n\t\t\t\treference.dispose();\n\t\t\t});\n\t\t});\n\t});\n}\n\nexport function registerEditorCommand<T extends EditorCommand>(editorCommand: T): T {\n\tEditorContributionRegistry.INSTANCE.registerEditorCommand(editorCommand);\n\treturn editorCommand;\n}\n\nexport function registerEditorAction<T extends EditorAction>(ctor: { new(): T }): T {\n\tconst action = new ctor();\n\tEditorContributionRegistry.INSTANCE.registerEditorAction(action);\n\treturn action;\n}\n\nexport function registerMultiEditorAction<T extends MultiEditorAction>(action: T): T {\n\tEditorContributionRegistry.INSTANCE.registerEditorAction(action);\n\treturn action;\n}\n\nexport function registerInstantiatedEditorAction(editorAction: EditorAction): void {\n\tEditorContributionRegistry.INSTANCE.registerEditorAction(editorAction);\n}\n\n/**\n * Registers an editor contribution. Editor contributions have a lifecycle which is bound\n * to a specific code editor instance.\n */\nexport function registerEditorContribution<Services extends BrandedService[]>(id: string, ctor: { new(editor: ICodeEditor, ...services: Services): IEditorContribution }, instantiation: EditorContributionInstantiation): void {\n\tEditorContributionRegistry.INSTANCE.registerEditorContribution(id, ctor, instantiation);\n}\n\nexport namespace EditorExtensionsRegistry {\n\n\texport function getEditorCommand(commandId: string): EditorCommand {\n\t\treturn EditorContributionRegistry.INSTANCE.getEditorCommand(commandId);\n\t}\n\n\texport function getEditorActions(): Iterable<EditorAction> {\n\t\treturn EditorContributionRegistry.INSTANCE.getEditorActions();\n\t}\n\n\texport function getEditorContributions(): IEditorContributionDescription[] {\n\t\treturn EditorContributionRegistry.INSTANCE.getEditorContributions();\n\t}\n\n\texport function getSomeEditorContributions(ids: string[]): IEditorContributionDescription[] {\n\t\treturn EditorContributionRegistry.INSTANCE.getEditorContributions().filter(c => ids.indexOf(c.id) >= 0);\n\t}\n\n\texport function getDiffEditorContributions(): IDiffEditorContributionDescription[] {\n\t\treturn EditorContributionRegistry.INSTANCE.getDiffEditorContributions();\n\t}\n}\n\n// Editor extension points\nconst Extensions = {\n\tEditorCommonContributions: 'editor.contributions'\n};\n\nclass EditorContributionRegistry {\n\n\tpublic static readonly INSTANCE = new EditorContributionRegistry();\n\n\tprivate readonly editorContributions: IEditorContributionDescription[] = [];\n\tprivate readonly diffEditorContributions: IDiffEditorContributionDescription[] = [];\n\tprivate readonly editorActions: EditorAction[] = [];\n\tprivate readonly editorCommands: { [commandId: string]: EditorCommand } = Object.create(null);\n\n\tconstructor() {\n\t}\n\n\tpublic registerEditorContribution<Services extends BrandedService[]>(id: string, ctor: { new(editor: ICodeEditor, ...services: Services): IEditorContribution }, instantiation: EditorContributionInstantiation): void {\n\t\tthis.editorContributions.push({ id, ctor: ctor as EditorContributionCtor, instantiation });\n\t}\n\n\tpublic getEditorContributions(): IEditorContributionDescription[] {\n\t\treturn this.editorContributions.slice(0);\n\t}\n\n\tpublic getDiffEditorContributions(): IDiffEditorContributionDescription[] {\n\t\treturn this.diffEditorContributions.slice(0);\n\t}\n\n\tpublic registerEditorAction(action: EditorAction) {\n\t\taction.register();\n\t\tthis.editorActions.push(action);\n\t}\n\n\tpublic getEditorActions(): Iterable<EditorAction> {\n\t\treturn this.editorActions;\n\t}\n\n\tpublic registerEditorCommand(editorCommand: EditorCommand) {\n\t\teditorCommand.register();\n\t\tthis.editorCommands[editorCommand.id] = editorCommand;\n\t}\n\n\tpublic getEditorCommand(commandId: string): EditorCommand {\n\t\treturn (this.editorCommands[commandId] || null);\n\t}\n\n}\nRegistry.add(Extensions.EditorCommonContributions, EditorContributionRegistry.INSTANCE);\n\nfunction registerCommand<T extends Command>(command: T): T {\n\tcommand.register();\n\treturn command;\n}\n\nexport const UndoCommand = registerCommand(new MultiCommand({\n\tid: 'undo',\n\tprecondition: undefined,\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorCore,\n\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyZ\n\t},\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '1_do',\n\t\ttitle: nls.localize({ key: 'miUndo', comment: ['&& denotes a mnemonic'] }, \"&&Undo\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('undo', \"Undo\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.SimpleEditorContext,\n\t\tgroup: '1_do',\n\t\ttitle: nls.localize('undo', \"Undo\"),\n\t\torder: 1\n\t}]\n}));\n\nregisterCommand(new ProxyCommand(UndoCommand, { id: 'default:undo', precondition: undefined }));\n\nexport const RedoCommand = registerCommand(new MultiCommand({\n\tid: 'redo',\n\tprecondition: undefined,\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorCore,\n\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyY,\n\t\tsecondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyZ],\n\t\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyZ }\n\t},\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '1_do',\n\t\ttitle: nls.localize({ key: 'miRedo', comment: ['&& denotes a mnemonic'] }, \"&&Redo\"),\n\t\torder: 2\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('redo', \"Redo\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.SimpleEditorContext,\n\t\tgroup: '1_do',\n\t\ttitle: nls.localize('redo', \"Redo\"),\n\t\torder: 2\n\t}]\n}));\n\nregisterCommand(new ProxyCommand(RedoCommand, { id: 'default:redo', precondition: undefined }));\n\nexport const SelectAllCommand = registerCommand(new MultiCommand({\n\tid: 'editor.action.selectAll',\n\tprecondition: undefined,\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorCore,\n\t\tkbExpr: null,\n\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyA\n\t},\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarSelectionMenu,\n\t\tgroup: '1_basic',\n\t\ttitle: nls.localize({ key: 'miSelectAll', comment: ['&& denotes a mnemonic'] }, \"&&Select All\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('selectAll', \"Select All\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.SimpleEditorContext,\n\t\tgroup: '9_select',\n\t\ttitle: nls.localize('selectAll', \"Select All\"),\n\t\torder: 1\n\t}]\n}));\n"]}
1
+ {"version":3,"sources":["vs/editor/browser/editorExtensions.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,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,CAAC,EAAM,EAAE,MAAM,CAAC;YACnC,KAAK,EAAE,CAAC;SACR,CAAC;CACF,CAAC,CAAC,CAAC;AAEJ,eAAe,CAAC,IAAI,YAAY,CAAC,WAAW,EAAE,EAAE,EAAE,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;AAEhG,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC,IAAI,YAAY,CAAC;IAChE,EAAE,EAAE,yBAAyB;IAC7B,YAAY,EAAE,SAAS;IACvB,MAAM,EAAE;QACP,MAAM,qCAA6B;QACnC,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,iDAA6B;KACtC;IACD,QAAQ,EAAE,CAAC;YACV,MAAM,EAAE,MAAM,CAAC,oBAAoB;YACnC,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,GAAG,CAAC,QAAQ,CAAC,EAAE,AAAwD,EAAE,CAAvD,EAAE,WAAmE,CAAC,CAAvD,EAAE,OAAO,EAAE,CAAC,uBAAuB,CAAC;YAC5E,KAAK,EAAE,CAAC;SACR,EAAE;YACF,MAAM,EAAE,MAAM,CAAC,cAAc;YAC7B,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,GAAG,CAAC,QAAQ,CAAC,EAAW,EAAE,YAAY,CAAC;YAC9C,KAAK,EAAE,CAAC;SACR,EAAE;YACF,MAAM,EAAE,MAAM,CAAC,mBAAmB;YAClC,KAAK,EAAE,UAAU;YACjB,KAAK,EAAE,GAAG,CAAC,QAAQ,CAAC,EAAW,EAAE,YAAY,CAAC;YAC9C,KAAK,EAAE,CAAC;SACR,CAAC;CACF,CAAC,CAAC,CAAC","file":"editorExtensions.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 nls from '../../nls.js';\nimport { URI } from '../../base/common/uri.js';\nimport { ICodeEditor, IDiffEditor } from './editorBrowser.js';\nimport { ICodeEditorService } from './services/codeEditorService.js';\nimport { Position } from '../common/core/position.js';\nimport { IEditorContribution, IDiffEditorContribution } from '../common/editorCommon.js';\nimport { ITextModel } from '../common/model.js';\nimport { IModelService } from '../common/services/model.js';\nimport { ITextModelService } from '../common/services/resolverService.js';\nimport { MenuId, MenuRegistry, Action2 } from '../../platform/actions/common/actions.js';\nimport { CommandsRegistry, ICommandMetadata } from '../../platform/commands/common/commands.js';\nimport { ContextKeyExpr, IContextKeyService, ContextKeyExpression } from '../../platform/contextkey/common/contextkey.js';\nimport { ServicesAccessor as InstantiationServicesAccessor, BrandedService, IInstantiationService, IConstructorSignature } from '../../platform/instantiation/common/instantiation.js';\nimport { IKeybindings, KeybindingsRegistry, KeybindingWeight } from '../../platform/keybinding/common/keybindingsRegistry.js';\nimport { Registry } from '../../platform/registry/common/platform.js';\nimport { ITelemetryService } from '../../platform/telemetry/common/telemetry.js';\nimport { assertType } from '../../base/common/types.js';\nimport { ThemeIcon } from '../../base/common/themables.js';\nimport { IDisposable } from '../../base/common/lifecycle.js';\nimport { KeyMod, KeyCode } from '../../base/common/keyCodes.js';\nimport { ILogService } from '../../platform/log/common/log.js';\nimport { getActiveElement } from '../../base/browser/dom.js';\n\nexport type ServicesAccessor = InstantiationServicesAccessor;\nexport type EditorContributionCtor = IConstructorSignature<IEditorContribution, [ICodeEditor]>;\nexport type DiffEditorContributionCtor = IConstructorSignature<IDiffEditorContribution, [IDiffEditor]>;\n\nexport const enum EditorContributionInstantiation {\n\t/**\n\t * The contribution is created eagerly when the {@linkcode ICodeEditor} is instantiated.\n\t * Only Eager contributions can participate in saving or restoring of view state.\n\t */\n\tEager,\n\n\t/**\n\t * The contribution is created at the latest 50ms after the first render after attaching a text model.\n\t * If the contribution is explicitly requested via `getContribution`, it will be instantiated sooner.\n\t * If there is idle time available, it will be instantiated sooner.\n\t */\n\tAfterFirstRender,\n\n\t/**\n\t * The contribution is created before the editor emits events produced by user interaction (mouse events, keyboard events).\n\t * If the contribution is explicitly requested via `getContribution`, it will be instantiated sooner.\n\t * If there is idle time available, it will be instantiated sooner.\n\t */\n\tBeforeFirstInteraction,\n\n\t/**\n\t * The contribution is created when there is idle time available, at the latest 5000ms after the editor creation.\n\t * If the contribution is explicitly requested via `getContribution`, it will be instantiated sooner.\n\t */\n\tEventually,\n\n\t/**\n\t * The contribution is created only when explicitly requested via `getContribution`.\n\t */\n\tLazy,\n}\n\nexport interface IEditorContributionDescription {\n\treadonly id: string;\n\treadonly ctor: EditorContributionCtor;\n\treadonly instantiation: EditorContributionInstantiation;\n}\n\nexport interface IDiffEditorContributionDescription {\n\tctor: DiffEditorContributionCtor;\n}\n\n//#region Command\n\nexport interface ICommandKeybindingsOptions extends IKeybindings {\n\tkbExpr?: ContextKeyExpression | null;\n\tweight: number;\n\t/**\n\t * the default keybinding arguments\n\t */\n\targs?: unknown;\n}\nexport interface ICommandMenuOptions {\n\tmenuId: MenuId;\n\tgroup: string;\n\torder: number;\n\twhen?: ContextKeyExpression;\n\ttitle: string;\n\ticon?: ThemeIcon;\n}\nexport interface ICommandOptions {\n\tid: string;\n\tprecondition: ContextKeyExpression | undefined;\n\tkbOpts?: ICommandKeybindingsOptions | ICommandKeybindingsOptions[];\n\tmetadata?: ICommandMetadata;\n\tmenuOpts?: ICommandMenuOptions | ICommandMenuOptions[];\n}\nexport abstract class Command {\n\tpublic readonly id: string;\n\tpublic readonly precondition: ContextKeyExpression | undefined;\n\tprivate readonly _kbOpts: ICommandKeybindingsOptions | ICommandKeybindingsOptions[] | undefined;\n\tprivate readonly _menuOpts: ICommandMenuOptions | ICommandMenuOptions[] | undefined;\n\tpublic readonly metadata: ICommandMetadata | undefined;\n\n\tconstructor(opts: ICommandOptions) {\n\t\tthis.id = opts.id;\n\t\tthis.precondition = opts.precondition;\n\t\tthis._kbOpts = opts.kbOpts;\n\t\tthis._menuOpts = opts.menuOpts;\n\t\tthis.metadata = opts.metadata;\n\t}\n\n\tpublic register(): void {\n\n\t\tif (Array.isArray(this._menuOpts)) {\n\t\t\tthis._menuOpts.forEach(this._registerMenuItem, this);\n\t\t} else if (this._menuOpts) {\n\t\t\tthis._registerMenuItem(this._menuOpts);\n\t\t}\n\n\t\tif (this._kbOpts) {\n\t\t\tconst kbOptsArr = Array.isArray(this._kbOpts) ? this._kbOpts : [this._kbOpts];\n\t\t\tfor (const kbOpts of kbOptsArr) {\n\t\t\t\tlet kbWhen = kbOpts.kbExpr;\n\t\t\t\tif (this.precondition) {\n\t\t\t\t\tif (kbWhen) {\n\t\t\t\t\t\tkbWhen = ContextKeyExpr.and(kbWhen, this.precondition);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tkbWhen = this.precondition;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst desc = {\n\t\t\t\t\tid: this.id,\n\t\t\t\t\tweight: kbOpts.weight,\n\t\t\t\t\targs: kbOpts.args,\n\t\t\t\t\twhen: kbWhen,\n\t\t\t\t\tprimary: kbOpts.primary,\n\t\t\t\t\tsecondary: kbOpts.secondary,\n\t\t\t\t\twin: kbOpts.win,\n\t\t\t\t\tlinux: kbOpts.linux,\n\t\t\t\t\tmac: kbOpts.mac,\n\t\t\t\t};\n\n\t\t\t\tKeybindingsRegistry.registerKeybindingRule(desc);\n\t\t\t}\n\t\t}\n\n\t\tCommandsRegistry.registerCommand({\n\t\t\tid: this.id,\n\t\t\thandler: (accessor, args) => this.runCommand(accessor, args),\n\t\t\tmetadata: this.metadata\n\t\t});\n\t}\n\n\tprivate _registerMenuItem(item: ICommandMenuOptions): void {\n\t\tMenuRegistry.appendMenuItem(item.menuId, {\n\t\t\tgroup: item.group,\n\t\t\tcommand: {\n\t\t\t\tid: this.id,\n\t\t\t\ttitle: item.title,\n\t\t\t\ticon: item.icon,\n\t\t\t\tprecondition: this.precondition\n\t\t\t},\n\t\t\twhen: item.when,\n\t\t\torder: item.order\n\t\t});\n\t}\n\n\tpublic abstract runCommand(accessor: ServicesAccessor, args: unknown): void | Promise<void>;\n}\n\n//#endregion Command\n\n//#region MultiplexingCommand\n\n/**\n * Potential override for a command.\n *\n * @return `true` or a Promise if the command was successfully run. This stops other overrides from being executed.\n */\nexport type CommandImplementation = (accessor: ServicesAccessor, args: unknown) => boolean | Promise<void>;\n\ninterface ICommandImplementationRegistration {\n\tpriority: number;\n\tname: string;\n\timplementation: CommandImplementation;\n\twhen?: ContextKeyExpression;\n}\n\nexport class MultiCommand extends Command {\n\n\tprivate readonly _implementations: ICommandImplementationRegistration[] = [];\n\n\t/**\n\t * A higher priority gets to be looked at first\n\t */\n\tpublic addImplementation(priority: number, name: string, implementation: CommandImplementation, when?: ContextKeyExpression): IDisposable {\n\t\tthis._implementations.push({ priority, name, implementation, when });\n\t\tthis._implementations.sort((a, b) => b.priority - a.priority);\n\t\treturn {\n\t\t\tdispose: () => {\n\t\t\t\tfor (let i = 0; i < this._implementations.length; i++) {\n\t\t\t\t\tif (this._implementations[i].implementation === implementation) {\n\t\t\t\t\t\tthis._implementations.splice(i, 1);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic runCommand(accessor: ServicesAccessor, args: unknown): void | Promise<void> {\n\t\tconst logService = accessor.get(ILogService);\n\t\tconst contextKeyService = accessor.get(IContextKeyService);\n\t\tlogService.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);\n\t\tfor (const impl of this._implementations) {\n\t\t\tif (impl.when) {\n\t\t\t\tconst context = contextKeyService.getContext(getActiveElement());\n\t\t\t\tconst value = impl.when.evaluate(context);\n\t\t\t\tif (!value) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst result = impl.implementation(accessor, args);\n\t\t\tif (result) {\n\t\t\t\tlogService.trace(`Command '${this.id}' was handled by '${impl.name}'.`);\n\t\t\t\tif (typeof result === 'boolean') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\tlogService.trace(`The Command '${this.id}' was not handled by any implementation.`);\n\t}\n}\n\n//#endregion\n\n/**\n * A command that delegates to another command's implementation.\n *\n * This lets different commands be registered but share the same implementation\n */\nexport class ProxyCommand extends Command {\n\tconstructor(\n\t\tprivate readonly command: Command,\n\t\topts: ICommandOptions\n\t) {\n\t\tsuper(opts);\n\t}\n\n\tpublic runCommand(accessor: ServicesAccessor, args: unknown): void | Promise<void> {\n\t\treturn this.command.runCommand(accessor, args);\n\t}\n}\n\n//#region EditorCommand\n\nexport interface IContributionCommandOptions<T> extends ICommandOptions {\n\thandler: (controller: T, args: unknown) => void;\n}\nexport interface EditorControllerCommand<T extends IEditorContribution> {\n\tnew(opts: IContributionCommandOptions<T>): EditorCommand;\n}\nexport abstract class EditorCommand extends Command {\n\n\t/**\n\t * Create a command class that is bound to a certain editor contribution.\n\t */\n\tpublic static bindToContribution<T extends IEditorContribution>(controllerGetter: (editor: ICodeEditor) => T | null): EditorControllerCommand<T> {\n\t\treturn class EditorControllerCommandImpl extends EditorCommand {\n\t\t\tprivate readonly _callback: (controller: T, args: unknown) => void;\n\n\t\t\tconstructor(opts: IContributionCommandOptions<T>) {\n\t\t\t\tsuper(opts);\n\n\t\t\t\tthis._callback = opts.handler;\n\t\t\t}\n\n\t\t\tpublic runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, args: unknown): void {\n\t\t\t\tconst controller = controllerGetter(editor);\n\t\t\t\tif (controller) {\n\t\t\t\t\tthis._callback(controller, args);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic static runEditorCommand<T = unknown>(\n\t\taccessor: ServicesAccessor,\n\t\targs: T,\n\t\tprecondition: ContextKeyExpression | undefined,\n\t\trunner: (accessor: ServicesAccessor, editor: ICodeEditor, args: T) => void | Promise<void>\n\t): void | Promise<void> {\n\t\tconst codeEditorService = accessor.get(ICodeEditorService);\n\n\t\t// Find the editor with text focus or active\n\t\tconst editor = codeEditorService.getFocusedCodeEditor() || codeEditorService.getActiveCodeEditor();\n\t\tif (!editor) {\n\t\t\t// well, at least we tried...\n\t\t\treturn;\n\t\t}\n\n\t\treturn editor.invokeWithinContext((editorAccessor) => {\n\t\t\tconst kbService = editorAccessor.get(IContextKeyService);\n\t\t\tif (!kbService.contextMatchesRules(precondition ?? undefined)) {\n\t\t\t\t// precondition does not hold\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treturn runner(editorAccessor, editor, args);\n\t\t});\n\t}\n\n\tpublic runCommand(accessor: ServicesAccessor, args: unknown): void | Promise<void> {\n\t\treturn EditorCommand.runEditorCommand(accessor, args, this.precondition, (accessor, editor, args) => this.runEditorCommand(accessor, editor, args));\n\t}\n\n\tpublic abstract runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, args: unknown): void | Promise<void>;\n}\n\n//#endregion EditorCommand\n\n//#region EditorAction\n\nexport interface IEditorActionContextMenuOptions {\n\tgroup: string;\n\torder: number;\n\twhen?: ContextKeyExpression;\n}\nexport type IActionOptions = ICommandOptions & {\n\tcontextMenuOpts?: IEditorActionContextMenuOptions | IEditorActionContextMenuOptions[];\n} & ({\n\tlabel: nls.ILocalizedString;\n\talias?: string;\n} | {\n\tlabel: string;\n\talias: string;\n});\n\nexport abstract class EditorAction extends EditorCommand {\n\n\tprivate static convertOptions(opts: IActionOptions): ICommandOptions {\n\n\t\tlet menuOpts: ICommandMenuOptions[];\n\t\tif (Array.isArray(opts.menuOpts)) {\n\t\t\tmenuOpts = opts.menuOpts;\n\t\t} else if (opts.menuOpts) {\n\t\t\tmenuOpts = [opts.menuOpts];\n\t\t} else {\n\t\t\tmenuOpts = [];\n\t\t}\n\n\t\tfunction withDefaults(item: Partial<ICommandMenuOptions>): ICommandMenuOptions {\n\t\t\tif (!item.menuId) {\n\t\t\t\titem.menuId = MenuId.EditorContext;\n\t\t\t}\n\t\t\tif (!item.title) {\n\t\t\t\titem.title = typeof opts.label === 'string' ? opts.label : opts.label.value;\n\t\t\t}\n\t\t\titem.when = ContextKeyExpr.and(opts.precondition, item.when);\n\t\t\treturn <ICommandMenuOptions>item;\n\t\t}\n\n\t\tif (Array.isArray(opts.contextMenuOpts)) {\n\t\t\tmenuOpts.push(...opts.contextMenuOpts.map(withDefaults));\n\t\t} else if (opts.contextMenuOpts) {\n\t\t\tmenuOpts.push(withDefaults(opts.contextMenuOpts));\n\t\t}\n\n\t\topts.menuOpts = menuOpts;\n\t\treturn <ICommandOptions>opts;\n\t}\n\n\tpublic readonly label: string;\n\tpublic readonly alias: string;\n\n\tconstructor(opts: IActionOptions) {\n\t\tsuper(EditorAction.convertOptions(opts));\n\t\tif (typeof opts.label === 'string') {\n\t\t\tthis.label = opts.label;\n\t\t\tthis.alias = opts.alias ?? opts.label;\n\t\t} else {\n\t\t\tthis.label = opts.label.value;\n\t\t\tthis.alias = opts.alias ?? opts.label.original;\n\t\t}\n\t}\n\n\tpublic runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, args: unknown): void | Promise<void> {\n\t\tthis.reportTelemetry(accessor, editor);\n\t\treturn this.run(accessor, editor, args || {});\n\t}\n\n\tprotected reportTelemetry(accessor: ServicesAccessor, editor: ICodeEditor) {\n\t\ttype EditorActionInvokedClassification = {\n\t\t\towner: 'alexdima';\n\t\t\tcomment: 'An editor action has been invoked.';\n\t\t\tname: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The label of the action that was invoked.' };\n\t\t\tid: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The identifier of the action that was invoked.' };\n\t\t};\n\t\ttype EditorActionInvokedEvent = {\n\t\t\tname: string;\n\t\t\tid: string;\n\t\t};\n\t\taccessor.get(ITelemetryService).publicLog2<EditorActionInvokedEvent, EditorActionInvokedClassification>('editorActionInvoked', { name: this.label, id: this.id });\n\t}\n\n\tpublic abstract run(accessor: ServicesAccessor, editor: ICodeEditor, args: unknown): void | Promise<void>;\n}\n\nexport type EditorActionImplementation = (accessor: ServicesAccessor, editor: ICodeEditor, args: unknown) => boolean | Promise<void>;\n\nexport class MultiEditorAction extends EditorAction {\n\n\tprivate readonly _implementations: [number, EditorActionImplementation][] = [];\n\n\t/**\n\t * A higher priority gets to be looked at first\n\t */\n\tpublic addImplementation(priority: number, implementation: EditorActionImplementation): IDisposable {\n\t\tthis._implementations.push([priority, implementation]);\n\t\tthis._implementations.sort((a, b) => b[0] - a[0]);\n\t\treturn {\n\t\t\tdispose: () => {\n\t\t\t\tfor (let i = 0; i < this._implementations.length; i++) {\n\t\t\t\t\tif (this._implementations[i][1] === implementation) {\n\t\t\t\t\t\tthis._implementations.splice(i, 1);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic run(accessor: ServicesAccessor, editor: ICodeEditor, args: unknown): void | Promise<void> {\n\t\tfor (const impl of this._implementations) {\n\t\t\tconst result = impl[1](accessor, editor, args);\n\t\t\tif (result) {\n\t\t\t\tif (typeof result === 'boolean') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t}\n\n}\n\n//#endregion EditorAction\n\n//#region EditorAction2\n\nexport abstract class EditorAction2 extends Action2 {\n\n\trun(accessor: ServicesAccessor, ...args: unknown[]) {\n\t\t// Find the editor with text focus or active\n\t\tconst codeEditorService = accessor.get(ICodeEditorService);\n\t\tconst editor = codeEditorService.getFocusedCodeEditor() || codeEditorService.getActiveCodeEditor();\n\t\tif (!editor) {\n\t\t\t// well, at least we tried...\n\t\t\treturn;\n\t\t}\n\t\t// precondition does hold\n\t\treturn editor.invokeWithinContext((editorAccessor) => {\n\t\t\tconst kbService = editorAccessor.get(IContextKeyService);\n\t\t\tconst logService = editorAccessor.get(ILogService);\n\t\t\tconst enabled = kbService.contextMatchesRules(this.desc.precondition ?? undefined);\n\t\t\tif (!enabled) {\n\t\t\t\tlogService.debug(`[EditorAction2] NOT running command because its precondition is FALSE`, this.desc.id, this.desc.precondition?.serialize());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn this.runEditorCommand(editorAccessor, editor, ...args);\n\t\t});\n\t}\n\n\tabstract runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, ...args: unknown[]): unknown;\n}\n\n//#endregion\n\n// --- Registration of commands and actions\n\n\nexport function registerModelAndPositionCommand(id: string, handler: (accessor: ServicesAccessor, model: ITextModel, position: Position, ...args: unknown[]) => unknown) {\n\tCommandsRegistry.registerCommand(id, function (accessor, ...args) {\n\n\t\tconst instaService = accessor.get(IInstantiationService);\n\n\t\tconst [resource, position] = args;\n\t\tassertType(URI.isUri(resource));\n\t\tassertType(Position.isIPosition(position));\n\n\t\tconst model = accessor.get(IModelService).getModel(resource);\n\t\tif (model) {\n\t\t\tconst editorPosition = Position.lift(position);\n\t\t\treturn instaService.invokeFunction(handler, model, editorPosition, ...args.slice(2));\n\t\t}\n\n\t\treturn accessor.get(ITextModelService).createModelReference(resource).then(reference => {\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = instaService.invokeFunction(handler, reference.object.textEditorModel, Position.lift(position), args.slice(2));\n\t\t\t\t\tresolve(result);\n\t\t\t\t} catch (err) {\n\t\t\t\t\treject(err);\n\t\t\t\t}\n\t\t\t}).finally(() => {\n\t\t\t\treference.dispose();\n\t\t\t});\n\t\t});\n\t});\n}\n\nexport function registerEditorCommand<T extends EditorCommand>(editorCommand: T): T {\n\tEditorContributionRegistry.INSTANCE.registerEditorCommand(editorCommand);\n\treturn editorCommand;\n}\n\nexport function registerEditorAction<T extends EditorAction>(ctor: { new(): T }): T {\n\tconst action = new ctor();\n\tEditorContributionRegistry.INSTANCE.registerEditorAction(action);\n\treturn action;\n}\n\nexport function registerMultiEditorAction<T extends MultiEditorAction>(action: T): T {\n\tEditorContributionRegistry.INSTANCE.registerEditorAction(action);\n\treturn action;\n}\n\nexport function registerInstantiatedEditorAction(editorAction: EditorAction): void {\n\tEditorContributionRegistry.INSTANCE.registerEditorAction(editorAction);\n}\n\n/**\n * Registers an editor contribution. Editor contributions have a lifecycle which is bound\n * to a specific code editor instance.\n */\nexport function registerEditorContribution<Services extends BrandedService[]>(id: string, ctor: { new(editor: ICodeEditor, ...services: Services): IEditorContribution }, instantiation: EditorContributionInstantiation): void {\n\tEditorContributionRegistry.INSTANCE.registerEditorContribution(id, ctor, instantiation);\n}\n\nexport namespace EditorExtensionsRegistry {\n\n\texport function getEditorCommand(commandId: string): EditorCommand {\n\t\treturn EditorContributionRegistry.INSTANCE.getEditorCommand(commandId);\n\t}\n\n\texport function getEditorActions(): Iterable<EditorAction> {\n\t\treturn EditorContributionRegistry.INSTANCE.getEditorActions();\n\t}\n\n\texport function getEditorContributions(): IEditorContributionDescription[] {\n\t\treturn EditorContributionRegistry.INSTANCE.getEditorContributions();\n\t}\n\n\texport function getSomeEditorContributions(ids: string[]): IEditorContributionDescription[] {\n\t\treturn EditorContributionRegistry.INSTANCE.getEditorContributions().filter(c => ids.indexOf(c.id) >= 0);\n\t}\n\n\texport function getDiffEditorContributions(): IDiffEditorContributionDescription[] {\n\t\treturn EditorContributionRegistry.INSTANCE.getDiffEditorContributions();\n\t}\n}\n\n// Editor extension points\nconst Extensions = {\n\tEditorCommonContributions: 'editor.contributions'\n};\n\nclass EditorContributionRegistry {\n\n\tpublic static readonly INSTANCE = new EditorContributionRegistry();\n\n\tprivate readonly editorContributions: IEditorContributionDescription[] = [];\n\tprivate readonly diffEditorContributions: IDiffEditorContributionDescription[] = [];\n\tprivate readonly editorActions: EditorAction[] = [];\n\tprivate readonly editorCommands: { [commandId: string]: EditorCommand } = Object.create(null);\n\n\tconstructor() {\n\t}\n\n\tpublic registerEditorContribution<Services extends BrandedService[]>(id: string, ctor: { new(editor: ICodeEditor, ...services: Services): IEditorContribution }, instantiation: EditorContributionInstantiation): void {\n\t\tthis.editorContributions.push({ id, ctor: ctor as EditorContributionCtor, instantiation });\n\t}\n\n\tpublic getEditorContributions(): IEditorContributionDescription[] {\n\t\treturn this.editorContributions.slice(0);\n\t}\n\n\tpublic getDiffEditorContributions(): IDiffEditorContributionDescription[] {\n\t\treturn this.diffEditorContributions.slice(0);\n\t}\n\n\tpublic registerEditorAction(action: EditorAction) {\n\t\taction.register();\n\t\tthis.editorActions.push(action);\n\t}\n\n\tpublic getEditorActions(): Iterable<EditorAction> {\n\t\treturn this.editorActions;\n\t}\n\n\tpublic registerEditorCommand(editorCommand: EditorCommand) {\n\t\teditorCommand.register();\n\t\tthis.editorCommands[editorCommand.id] = editorCommand;\n\t}\n\n\tpublic getEditorCommand(commandId: string): EditorCommand {\n\t\treturn (this.editorCommands[commandId] || null);\n\t}\n\n}\nRegistry.add(Extensions.EditorCommonContributions, EditorContributionRegistry.INSTANCE);\n\nfunction registerCommand<T extends Command>(command: T): T {\n\tcommand.register();\n\treturn command;\n}\n\nexport const UndoCommand = registerCommand(new MultiCommand({\n\tid: 'undo',\n\tprecondition: undefined,\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorCore,\n\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyZ\n\t},\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '1_do',\n\t\ttitle: nls.localize({ key: 'miUndo', comment: ['&& denotes a mnemonic'] }, \"&&Undo\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('undo', \"Undo\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.SimpleEditorContext,\n\t\tgroup: '1_do',\n\t\ttitle: nls.localize('undo', \"Undo\"),\n\t\torder: 1\n\t}]\n}));\n\nregisterCommand(new ProxyCommand(UndoCommand, { id: 'default:undo', precondition: undefined }));\n\nexport const RedoCommand = registerCommand(new MultiCommand({\n\tid: 'redo',\n\tprecondition: undefined,\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorCore,\n\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyY,\n\t\tsecondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyZ],\n\t\tmac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyZ }\n\t},\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarEditMenu,\n\t\tgroup: '1_do',\n\t\ttitle: nls.localize({ key: 'miRedo', comment: ['&& denotes a mnemonic'] }, \"&&Redo\"),\n\t\torder: 2\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('redo', \"Redo\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.SimpleEditorContext,\n\t\tgroup: '1_do',\n\t\ttitle: nls.localize('redo', \"Redo\"),\n\t\torder: 2\n\t}]\n}));\n\nregisterCommand(new ProxyCommand(RedoCommand, { id: 'default:redo', precondition: undefined }));\n\nexport const SelectAllCommand = registerCommand(new MultiCommand({\n\tid: 'editor.action.selectAll',\n\tprecondition: undefined,\n\tkbOpts: {\n\t\tweight: KeybindingWeight.EditorCore,\n\t\tkbExpr: null,\n\t\tprimary: KeyMod.CtrlCmd | KeyCode.KeyA\n\t},\n\tmenuOpts: [{\n\t\tmenuId: MenuId.MenubarSelectionMenu,\n\t\tgroup: '1_basic',\n\t\ttitle: nls.localize({ key: 'miSelectAll', comment: ['&& denotes a mnemonic'] }, \"&&Select All\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.CommandPalette,\n\t\tgroup: '',\n\t\ttitle: nls.localize('selectAll', \"Select All\"),\n\t\torder: 1\n\t}, {\n\t\tmenuId: MenuId.SimpleEditorContext,\n\t\tgroup: '9_select',\n\t\ttitle: nls.localize('selectAll', \"Select All\"),\n\t\torder: 1\n\t}]\n}));\n"]}
@@ -43,6 +43,7 @@ export function observeDevicePixelDimensions(element, parentWindow, callback) {
43
43
  }
44
44
  });
45
45
  try {
46
+ // eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
46
47
  observer.observe(element, { box: ['device-pixel-content-box'] });
47
48
  }
48
49
  catch {
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/gpu/gpuUtils.ts","vs/editor/browser/gpu/gpuUtils.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAoB,MAAM,mCAAmC,CAAC;AAEnF,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC;IAC5C,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;CACJ,CAAC,CAAC;AAEH,MAAM,UAAU,iBAAiB,CAAI,KAAe;IACnD,IAAI,CAAC,KAAK,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,UAAU,KAAK,kBAAkB,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,4BAA4B,CAAC,OAAoB,EAAE,YAAwC,EAAE,QAA6D;IACzK,6FAA6F;IAC7F,0FAA0F;IAC1F,4FAA4F;IAC5F,qCAAqC;IACrC,IAAI,QAAQ,GAA+B,IAAI,YAAY,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE;QACtF,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC;QAChE,IAAI,CAAC,KAAK,EAAE,CAAC;YACZ,OAAO;QACR,CAAC;QAED,yEAAyE;QACzE,IAAI,CAAC,CAAC,2BAA2B,IAAI,KAAK,CAAC,EAAE,CAAC;YAC7C,QAAQ,EAAE,UAAU,EAAE,CAAC;YACvB,QAAQ,GAAG,SAAS,CAAC;YACrB,OAAO;QACR,CAAC;QAED,+FAA+F;QAC/F,MAAM,KAAK,GAAG,KAAK,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;QAC5D,MAAM,MAAM,GAAG,KAAK,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC5D,IAAI,KAAK,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACzB,CAAC;IACF,CAAC,CAAC,CAAC;IACH,IAAI,CAAC;QACJ,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,0BAA0B,CAAC,EAAS,CAAC,CAAC;IACzE,CAAC;IAAC,MAAM,CAAC;QACR,QAAQ,CAAC,UAAU,EAAE,CAAC;QACtB,QAAQ,GAAG,SAAS,CAAC;QACrB,MAAM,IAAI,kBAAkB,CAAC,2CAA2C,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,YAAY,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC;AACnD,CAAC","file":"gpuUtils.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 { BugIndicatingError } from '../../../base/common/errors.js';\nimport { toDisposable, type IDisposable } from '../../../base/common/lifecycle.js';\n\nexport const quadVertices = new Float32Array([\n\t1, 0,\n\t1, 1,\n\t0, 1,\n\t0, 0,\n\t0, 1,\n\t1, 0,\n]);\n\nexport function ensureNonNullable<T>(value: T | null): T {\n\tif (!value) {\n\t\tthrow new Error(`Value \"${value}\" cannot be null`);\n\t}\n\treturn value;\n}\n\n// TODO: Move capabilities into ElementSizeObserver?\nexport function observeDevicePixelDimensions(element: HTMLElement, parentWindow: Window & typeof globalThis, callback: (deviceWidth: number, deviceHeight: number) => void): IDisposable {\n\t// Observe any resizes to the element and extract the actual pixel size of the element if the\n\t// devicePixelContentBoxSize API is supported. This allows correcting rounding errors when\n\t// converting between CSS pixels and device pixels which causes blurry rendering when device\n\t// pixel ratio is not a round number.\n\tlet observer: ResizeObserver | undefined = new parentWindow.ResizeObserver((entries) => {\n\t\tconst entry = entries.find((entry) => entry.target === element);\n\t\tif (!entry) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Disconnect if devicePixelContentBoxSize isn't supported by the browser\n\t\tif (!('devicePixelContentBoxSize' in entry)) {\n\t\t\tobserver?.disconnect();\n\t\t\tobserver = undefined;\n\t\t\treturn;\n\t\t}\n\n\t\t// Fire the callback, ignore events where the dimensions are 0x0 as the canvas is likely hidden\n\t\tconst width = entry.devicePixelContentBoxSize[0].inlineSize;\n\t\tconst height = entry.devicePixelContentBoxSize[0].blockSize;\n\t\tif (width > 0 && height > 0) {\n\t\t\tcallback(width, height);\n\t\t}\n\t});\n\ttry {\n\t\tobserver.observe(element, { box: ['device-pixel-content-box'] } as any);\n\t} catch {\n\t\tobserver.disconnect();\n\t\tobserver = undefined;\n\t\tthrow new BugIndicatingError('Could not observe device pixel dimensions');\n\t}\n\treturn toDisposable(() => observer?.disconnect());\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 { BugIndicatingError } from '../../../base/common/errors.js';\nimport { toDisposable, type IDisposable } from '../../../base/common/lifecycle.js';\n\nexport const quadVertices = new Float32Array([\n\t1, 0,\n\t1, 1,\n\t0, 1,\n\t0, 0,\n\t0, 1,\n\t1, 0,\n]);\n\nexport function ensureNonNullable<T>(value: T | null): T {\n\tif (!value) {\n\t\tthrow new Error(`Value \"${value}\" cannot be null`);\n\t}\n\treturn value;\n}\n\n// TODO: Move capabilities into ElementSizeObserver?\nexport function observeDevicePixelDimensions(element: HTMLElement, parentWindow: Window & typeof globalThis, callback: (deviceWidth: number, deviceHeight: number) => void): IDisposable {\n\t// Observe any resizes to the element and extract the actual pixel size of the element if the\n\t// devicePixelContentBoxSize API is supported. This allows correcting rounding errors when\n\t// converting between CSS pixels and device pixels which causes blurry rendering when device\n\t// pixel ratio is not a round number.\n\tlet observer: ResizeObserver | undefined = new parentWindow.ResizeObserver((entries) => {\n\t\tconst entry = entries.find((entry) => entry.target === element);\n\t\tif (!entry) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Disconnect if devicePixelContentBoxSize isn't supported by the browser\n\t\tif (!('devicePixelContentBoxSize' in entry)) {\n\t\t\tobserver?.disconnect();\n\t\t\tobserver = undefined;\n\t\t\treturn;\n\t\t}\n\n\t\t// Fire the callback, ignore events where the dimensions are 0x0 as the canvas is likely hidden\n\t\tconst width = entry.devicePixelContentBoxSize[0].inlineSize;\n\t\tconst height = entry.devicePixelContentBoxSize[0].blockSize;\n\t\tif (width > 0 && height > 0) {\n\t\t\tcallback(width, height);\n\t\t}\n\t});\n\ttry {\n\t\tobserver.observe(element, { box: ['device-pixel-content-box'] } as any);\n\t} catch {\n\t\tobserver.disconnect();\n\t\tobserver = undefined;\n\t\tthrow new BugIndicatingError('Could not observe device pixel dimensions');\n\t}\n\treturn toDisposable(() => observer?.disconnect());\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/gpu/gpuUtils.ts","vs/editor/browser/gpu/gpuUtils.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAoB,MAAM,mCAAmC,CAAC;AAEnF,MAAM,CAAC,MAAM,YAAY,GAAG,I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,CAAC;IACF,CAAC,CAAC,CAAC;IACH,IAAI,CAAC;QACJ,uFAAuF;QACvF,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,0BAA0B,CAAC,EAAS,CAAC,CAAC;IACzE,CAAC;IAAC,MAAM,CAAC;QACR,QAAQ,CAAC,UAAU,EAAE,CAAC;QACtB,QAAQ,GAAG,SAAS,CAAC;QACrB,MAAM,IAAI,kBAAkB,CAAC,2CAA2C,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,YAAY,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC;AACnD,CAAC","file":"gpuUtils.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 { BugIndicatingError } from '../../../base/common/errors.js';\nimport { toDisposable, type IDisposable } from '../../../base/common/lifecycle.js';\n\nexport const quadVertices = new Float32Array([\n\t1, 0,\n\t1, 1,\n\t0, 1,\n\t0, 0,\n\t0, 1,\n\t1, 0,\n]);\n\nexport function ensureNonNullable<T>(value: T | null): T {\n\tif (!value) {\n\t\tthrow new Error(`Value \"${value}\" cannot be null`);\n\t}\n\treturn value;\n}\n\n// TODO: Move capabilities into ElementSizeObserver?\nexport function observeDevicePixelDimensions(element: HTMLElement, parentWindow: Window & typeof globalThis, callback: (deviceWidth: number, deviceHeight: number) => void): IDisposable {\n\t// Observe any resizes to the element and extract the actual pixel size of the element if the\n\t// devicePixelContentBoxSize API is supported. This allows correcting rounding errors when\n\t// converting between CSS pixels and device pixels which causes blurry rendering when device\n\t// pixel ratio is not a round number.\n\tlet observer: ResizeObserver | undefined = new parentWindow.ResizeObserver((entries) => {\n\t\tconst entry = entries.find((entry) => entry.target === element);\n\t\tif (!entry) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Disconnect if devicePixelContentBoxSize isn't supported by the browser\n\t\tif (!('devicePixelContentBoxSize' in entry)) {\n\t\t\tobserver?.disconnect();\n\t\t\tobserver = undefined;\n\t\t\treturn;\n\t\t}\n\n\t\t// Fire the callback, ignore events where the dimensions are 0x0 as the canvas is likely hidden\n\t\tconst width = entry.devicePixelContentBoxSize[0].inlineSize;\n\t\tconst height = entry.devicePixelContentBoxSize[0].blockSize;\n\t\tif (width > 0 && height > 0) {\n\t\t\tcallback(width, height);\n\t\t}\n\t});\n\ttry {\n\t\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\t\tobserver.observe(element, { box: ['device-pixel-content-box'] } as any);\n\t} catch {\n\t\tobserver.disconnect();\n\t\tobserver = undefined;\n\t\tthrow new BugIndicatingError('Could not observe device pixel dimensions');\n\t}\n\treturn toDisposable(() => observer?.disconnect());\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 { BugIndicatingError } from '../../../base/common/errors.js';\nimport { toDisposable, type IDisposable } from '../../../base/common/lifecycle.js';\n\nexport const quadVertices = new Float32Array([\n\t1, 0,\n\t1, 1,\n\t0, 1,\n\t0, 0,\n\t0, 1,\n\t1, 0,\n]);\n\nexport function ensureNonNullable<T>(value: T | null): T {\n\tif (!value) {\n\t\tthrow new Error(`Value \"${value}\" cannot be null`);\n\t}\n\treturn value;\n}\n\n// TODO: Move capabilities into ElementSizeObserver?\nexport function observeDevicePixelDimensions(element: HTMLElement, parentWindow: Window & typeof globalThis, callback: (deviceWidth: number, deviceHeight: number) => void): IDisposable {\n\t// Observe any resizes to the element and extract the actual pixel size of the element if the\n\t// devicePixelContentBoxSize API is supported. This allows correcting rounding errors when\n\t// converting between CSS pixels and device pixels which causes blurry rendering when device\n\t// pixel ratio is not a round number.\n\tlet observer: ResizeObserver | undefined = new parentWindow.ResizeObserver((entries) => {\n\t\tconst entry = entries.find((entry) => entry.target === element);\n\t\tif (!entry) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Disconnect if devicePixelContentBoxSize isn't supported by the browser\n\t\tif (!('devicePixelContentBoxSize' in entry)) {\n\t\t\tobserver?.disconnect();\n\t\t\tobserver = undefined;\n\t\t\treturn;\n\t\t}\n\n\t\t// Fire the callback, ignore events where the dimensions are 0x0 as the canvas is likely hidden\n\t\tconst width = entry.devicePixelContentBoxSize[0].inlineSize;\n\t\tconst height = entry.devicePixelContentBoxSize[0].blockSize;\n\t\tif (width > 0 && height > 0) {\n\t\t\tcallback(width, height);\n\t\t}\n\t});\n\ttry {\n\t\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\t\tobserver.observe(element, { box: ['device-pixel-content-box'] } as any);\n\t} catch {\n\t\tobserver.disconnect();\n\t\tobserver = undefined;\n\t\tthrow new BugIndicatingError('Could not observe device pixel dimensions');\n\t}\n\treturn toDisposable(() => observer?.disconnect());\n}\n"]}
@@ -188,6 +188,7 @@ let ViewGpuContext = class ViewGpuContext extends Disposable {
188
188
  }
189
189
  for (const r of rule.style) {
190
190
  if (!supportsCssRule(r, rule.style)) {
191
+ // eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
191
192
  problemRules.push(`${r}: ${rule.style[r]}`);
192
193
  return false;
193
194
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["vs/editor/browser/gpu/viewGpuContext.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAoB,MAAM,sCAAsC,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,UAAU,EAA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WAAA,qBAAqB,CAAA;GAvDX,cAAc,CA4N1B;;AAED;;GAEG;AACH,MAAM,8BAA8B,GAAG;IACtC,OAAO;IACP,aAAa;IACb,SAAS;CACT,CAAC;AAEF,SAAS,eAAe,CAAC,IAAY,EAAE,KAA0B;IAChE,IAAI,CAAC,8BAA8B,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACpD,OAAO,KAAK,CAAC;IACd,CAAC;IACD,yCAAyC;IACzC,QAAQ,IAAI,EAAE,CAAC;QACd,OAAO,CAAC,CAAC,OAAO,IAAI,CAAC;IACtB,CAAC;AACF,CAAC","file":"viewGpuContext.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 nls from '../../../nls.js';\nimport { addDisposableListener, getActiveWindow } from '../../../base/browser/dom.js';\nimport { createFastDomNode, type FastDomNode } from '../../../base/browser/fastDomNode.js';\nimport { BugIndicatingError } from '../../../base/common/errors.js';\nimport { Disposable } from '../../../base/common/lifecycle.js';\nimport { ViewportData } from '../../common/viewLayout/viewLinesViewportData.js';\nimport { ViewLineOptions } from '../viewParts/viewLines/viewLineOptions.js';\nimport { observableValue, runOnChange, type IObservable } from '../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js';\nimport { TextureAtlas } from './atlas/textureAtlas.js';\nimport { IConfigurationService } from '../../../platform/configuration/common/configuration.js';\nimport { INotificationService, IPromptChoice, Severity } from '../../../platform/notification/common/notification.js';\nimport { GPULifecycle } from './gpuDisposable.js';\nimport { ensureNonNullable, observeDevicePixelDimensions } from './gpuUtils.js';\nimport { RectangleRenderer } from './rectangleRenderer.js';\nimport { ViewContext } from '../../common/viewModel/viewContext.js';\nimport { DecorationCssRuleExtractor } from './css/decorationCssRuleExtractor.js';\nimport { Event } from '../../../base/common/event.js';\nimport { EditorOption, type IEditorOptions } from '../../common/config/editorOptions.js';\nimport { DecorationStyleCache } from './css/decorationStyleCache.js';\nimport { InlineDecorationType } from '../../common/viewModel/inlineDecorations.js';\n\nexport class ViewGpuContext extends Disposable {\n\t/**\n\t * The hard cap for line columns rendered by the GPU renderer.\n\t */\n\treadonly maxGpuCols = 2000;\n\n\treadonly canvas: FastDomNode<HTMLCanvasElement>;\n\treadonly ctx: GPUCanvasContext;\n\n\tstatic device: Promise<GPUDevice>;\n\tstatic deviceSync: GPUDevice | undefined;\n\n\treadonly rectangleRenderer: RectangleRenderer;\n\n\tprivate static readonly _decorationCssRuleExtractor = new DecorationCssRuleExtractor();\n\tstatic get decorationCssRuleExtractor(): DecorationCssRuleExtractor {\n\t\treturn ViewGpuContext._decorationCssRuleExtractor;\n\t}\n\n\tprivate static readonly _decorationStyleCache = new DecorationStyleCache();\n\tstatic get decorationStyleCache(): DecorationStyleCache {\n\t\treturn ViewGpuContext._decorationStyleCache;\n\t}\n\n\tprivate static _atlas: TextureAtlas | undefined;\n\n\t/**\n\t * The shared texture atlas to use across all views.\n\t *\n\t * @throws if called before the GPU device is resolved\n\t */\n\tstatic get atlas(): TextureAtlas {\n\t\tif (!ViewGpuContext._atlas) {\n\t\t\tthrow new BugIndicatingError('Cannot call ViewGpuContext.textureAtlas before device is resolved');\n\t\t}\n\t\treturn ViewGpuContext._atlas;\n\t}\n\t/**\n\t * The shared texture atlas to use across all views. This is a convenience alias for\n\t * {@link ViewGpuContext.atlas}.\n\t *\n\t * @throws if called before the GPU device is resolved\n\t */\n\tget atlas(): TextureAtlas {\n\t\treturn ViewGpuContext.atlas;\n\t}\n\n\treadonly canvasDevicePixelDimensions: IObservable<{ width: number; height: number }>;\n\treadonly devicePixelRatio: IObservable<number>;\n\treadonly contentLeft: IObservable<number>;\n\n\tconstructor(\n\t\tcontext: ViewContext,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@INotificationService private readonly _notificationService: INotificationService,\n\t\t@IConfigurationService private readonly configurationService: IConfigurationService,\n\t) {\n\t\tsuper();\n\n\t\tthis.canvas = createFastDomNode(document.createElement('canvas'));\n\t\tthis.canvas.setClassName('editorCanvas');\n\n\t\t// Adjust the canvas size to avoid drawing under the scroll bar\n\t\tthis._register(Event.runAndSubscribe(configurationService.onDidChangeConfiguration, e => {\n\t\t\tif (!e || e.affectsConfiguration('editor.scrollbar.verticalScrollbarSize')) {\n\t\t\t\tconst verticalScrollbarSize = configurationService.getValue<IEditorOptions>('editor').scrollbar?.verticalScrollbarSize ?? 14;\n\t\t\t\tthis.canvas.domNode.style.boxSizing = 'border-box';\n\t\t\t\tthis.canvas.domNode.style.paddingRight = `${verticalScrollbarSize}px`;\n\t\t\t}\n\t\t}));\n\n\t\tthis.ctx = ensureNonNullable(this.canvas.domNode.getContext('webgpu'));\n\n\t\t// Request the GPU device, we only want to do this a single time per window as it's async\n\t\t// and can delay the initial render.\n\t\tif (!ViewGpuContext.device) {\n\t\t\tViewGpuContext.device = GPULifecycle.requestDevice((message) => {\n\t\t\t\tconst choices: IPromptChoice[] = [{\n\t\t\t\t\tlabel: nls.localize('editor.dom.render', \"Use DOM-based rendering\"),\n\t\t\t\t\trun: () => this.configurationService.updateValue('editor.experimentalGpuAcceleration', 'off'),\n\t\t\t\t}];\n\t\t\t\tthis._notificationService.prompt(Severity.Warning, message, choices);\n\t\t\t}).then(ref => {\n\t\t\t\tViewGpuContext.deviceSync = ref.object;\n\t\t\t\tif (!ViewGpuContext._atlas) {\n\t\t\t\t\tViewGpuContext._atlas = this._instantiationService.createInstance(TextureAtlas, ref.object.limits.maxTextureDimension2D, undefined, ViewGpuContext.decorationStyleCache);\n\t\t\t\t}\n\t\t\t\treturn ref.object;\n\t\t\t});\n\t\t}\n\n\t\tconst dprObs = observableValue(this, getActiveWindow().devicePixelRatio);\n\t\tthis._register(addDisposableListener(getActiveWindow(), 'resize', () => {\n\t\t\tdprObs.set(getActiveWindow().devicePixelRatio, undefined);\n\t\t}));\n\t\tthis.devicePixelRatio = dprObs;\n\t\tthis._register(runOnChange(this.devicePixelRatio, () => ViewGpuContext.atlas?.clear()));\n\n\t\tconst canvasDevicePixelDimensions = observableValue(this, { width: this.canvas.domNode.width, height: this.canvas.domNode.height });\n\t\tthis._register(observeDevicePixelDimensions(\n\t\t\tthis.canvas.domNode,\n\t\t\tgetActiveWindow(),\n\t\t\t(width, height) => {\n\t\t\t\tthis.canvas.domNode.width = width;\n\t\t\t\tthis.canvas.domNode.height = height;\n\t\t\t\tcanvasDevicePixelDimensions.set({ width, height }, undefined);\n\t\t\t}\n\t\t));\n\t\tthis.canvasDevicePixelDimensions = canvasDevicePixelDimensions;\n\n\t\tconst contentLeft = observableValue(this, 0);\n\t\tthis._register(this.configurationService.onDidChangeConfiguration(e => {\n\t\t\tcontentLeft.set(context.configuration.options.get(EditorOption.layoutInfo).contentLeft, undefined);\n\t\t}));\n\t\tthis.contentLeft = contentLeft;\n\n\t\tthis.rectangleRenderer = this._instantiationService.createInstance(RectangleRenderer, context, this.contentLeft, this.devicePixelRatio, this.canvas.domNode, this.ctx, ViewGpuContext.device);\n\t}\n\n\t/**\n\t * This method determines which lines can be and are allowed to be rendered using the GPU\n\t * renderer. Eventually this should trend all lines, except maybe exceptional cases like\n\t * decorations that use class names.\n\t */\n\tpublic canRender(options: ViewLineOptions, viewportData: ViewportData, lineNumber: number): boolean {\n\t\tconst data = viewportData.getViewLineRenderingData(lineNumber);\n\n\t\t// Check if the line has simple attributes that aren't supported\n\t\tif (\n\t\t\tdata.containsRTL ||\n\t\t\tdata.maxColumn > this.maxGpuCols\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if all inline decorations are supported\n\t\tif (data.inlineDecorations.length > 0) {\n\t\t\tlet supported = true;\n\t\t\tfor (const decoration of data.inlineDecorations) {\n\t\t\t\tif (decoration.type !== InlineDecorationType.Regular) {\n\t\t\t\t\tsupported = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tconst styleRules = ViewGpuContext._decorationCssRuleExtractor.getStyleRules(this.canvas.domNode, decoration.inlineClassName);\n\t\t\t\tsupported &&= styleRules.every(rule => {\n\t\t\t\t\t// Pseudo classes aren't supported currently\n\t\t\t\t\tif (rule.selectorText.includes(':')) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tfor (const r of rule.style) {\n\t\t\t\t\t\tif (!supportsCssRule(r, rule.style)) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t});\n\t\t\t\tif (!supported) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn supported;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Like {@link canRender} but returns detailed information about why the line cannot be rendered.\n\t */\n\tpublic canRenderDetailed(options: ViewLineOptions, viewportData: ViewportData, lineNumber: number): string[] {\n\t\tconst data = viewportData.getViewLineRenderingData(lineNumber);\n\t\tconst reasons: string[] = [];\n\t\tif (data.containsRTL) {\n\t\t\treasons.push('containsRTL');\n\t\t}\n\t\tif (data.maxColumn > this.maxGpuCols) {\n\t\t\treasons.push('maxColumn > maxGpuCols');\n\t\t}\n\t\tif (data.inlineDecorations.length > 0) {\n\t\t\tlet supported = true;\n\t\t\tconst problemTypes: InlineDecorationType[] = [];\n\t\t\tconst problemSelectors: string[] = [];\n\t\t\tconst problemRules: string[] = [];\n\t\t\tfor (const decoration of data.inlineDecorations) {\n\t\t\t\tif (decoration.type !== InlineDecorationType.Regular) {\n\t\t\t\t\tproblemTypes.push(decoration.type);\n\t\t\t\t\tsupported = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst styleRules = ViewGpuContext._decorationCssRuleExtractor.getStyleRules(this.canvas.domNode, decoration.inlineClassName);\n\t\t\t\tsupported &&= styleRules.every(rule => {\n\t\t\t\t\t// Pseudo classes aren't supported currently\n\t\t\t\t\tif (rule.selectorText.includes(':')) {\n\t\t\t\t\t\tproblemSelectors.push(rule.selectorText);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tfor (const r of rule.style) {\n\t\t\t\t\t\tif (!supportsCssRule(r, rule.style)) {\n\t\t\t\t\t\t\tproblemRules.push(`${r}: ${rule.style[r as any]}`);\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t});\n\t\t\t\tif (!supported) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (problemTypes.length > 0) {\n\t\t\t\treasons.push(`inlineDecorations with unsupported types (${problemTypes.map(e => `\\`${e}\\``).join(', ')})`);\n\t\t\t}\n\t\t\tif (problemRules.length > 0) {\n\t\t\t\treasons.push(`inlineDecorations with unsupported CSS rules (${problemRules.map(e => `\\`${e}\\``).join(', ')})`);\n\t\t\t}\n\t\t\tif (problemSelectors.length > 0) {\n\t\t\t\treasons.push(`inlineDecorations with unsupported CSS selectors (${problemSelectors.map(e => `\\`${e}\\``).join(', ')})`);\n\t\t\t}\n\t\t}\n\t\treturn reasons;\n\t}\n}\n\n/**\n * A list of supported decoration CSS rules that can be used in the GPU renderer.\n */\nconst gpuSupportedDecorationCssRules = [\n\t'color',\n\t'font-weight',\n\t'opacity',\n];\n\nfunction supportsCssRule(rule: string, style: CSSStyleDeclaration) {\n\tif (!gpuSupportedDecorationCssRules.includes(rule)) {\n\t\treturn false;\n\t}\n\t// Check for values that aren't supported\n\tswitch (rule) {\n\t\tdefault: return true;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["vs/editor/browser/gpu/viewGpuContext.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,8B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IAAI,CAAC,GAAG,CAAC,CAAC;YACxH,CAAC;QACF,CAAC;QACD,OAAO,OAAO,CAAC;IAChB,CAAC;;AA5NW,cAAc;IAqDxB,WAAA,qBAAqB,CAAA;IACrB,WAAA,oBAAoB,CAAA;IACpB,WAAA,qBAAqB,CAAA;GAvDX,cAAc,CA6N1B;;AAED;;GAEG;AACH,MAAM,8BAA8B,GAAG;IACtC,OAAO;IACP,aAAa;IACb,SAAS;CACT,CAAC;AAEF,SAAS,eAAe,CAAC,IAAY,EAAE,KAA0B;IAChE,IAAI,CAAC,8BAA8B,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACpD,OAAO,KAAK,CAAC;IACd,CAAC;IACD,yCAAyC;IACzC,QAAQ,IAAI,EAAE,CAAC;QACd,OAAO,CAAC,CAAC,OAAO,IAAI,CAAC;IACtB,CAAC;AACF,CAAC","file":"viewGpuContext.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 nls from '../../../nls.js';\nimport { addDisposableListener, getActiveWindow } from '../../../base/browser/dom.js';\nimport { createFastDomNode, type FastDomNode } from '../../../base/browser/fastDomNode.js';\nimport { BugIndicatingError } from '../../../base/common/errors.js';\nimport { Disposable } from '../../../base/common/lifecycle.js';\nimport { ViewportData } from '../../common/viewLayout/viewLinesViewportData.js';\nimport { ViewLineOptions } from '../viewParts/viewLines/viewLineOptions.js';\nimport { observableValue, runOnChange, type IObservable } from '../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js';\nimport { TextureAtlas } from './atlas/textureAtlas.js';\nimport { IConfigurationService } from '../../../platform/configuration/common/configuration.js';\nimport { INotificationService, IPromptChoice, Severity } from '../../../platform/notification/common/notification.js';\nimport { GPULifecycle } from './gpuDisposable.js';\nimport { ensureNonNullable, observeDevicePixelDimensions } from './gpuUtils.js';\nimport { RectangleRenderer } from './rectangleRenderer.js';\nimport { ViewContext } from '../../common/viewModel/viewContext.js';\nimport { DecorationCssRuleExtractor } from './css/decorationCssRuleExtractor.js';\nimport { Event } from '../../../base/common/event.js';\nimport { EditorOption, type IEditorOptions } from '../../common/config/editorOptions.js';\nimport { DecorationStyleCache } from './css/decorationStyleCache.js';\nimport { InlineDecorationType } from '../../common/viewModel/inlineDecorations.js';\n\nexport class ViewGpuContext extends Disposable {\n\t/**\n\t * The hard cap for line columns rendered by the GPU renderer.\n\t */\n\treadonly maxGpuCols = 2000;\n\n\treadonly canvas: FastDomNode<HTMLCanvasElement>;\n\treadonly ctx: GPUCanvasContext;\n\n\tstatic device: Promise<GPUDevice>;\n\tstatic deviceSync: GPUDevice | undefined;\n\n\treadonly rectangleRenderer: RectangleRenderer;\n\n\tprivate static readonly _decorationCssRuleExtractor = new DecorationCssRuleExtractor();\n\tstatic get decorationCssRuleExtractor(): DecorationCssRuleExtractor {\n\t\treturn ViewGpuContext._decorationCssRuleExtractor;\n\t}\n\n\tprivate static readonly _decorationStyleCache = new DecorationStyleCache();\n\tstatic get decorationStyleCache(): DecorationStyleCache {\n\t\treturn ViewGpuContext._decorationStyleCache;\n\t}\n\n\tprivate static _atlas: TextureAtlas | undefined;\n\n\t/**\n\t * The shared texture atlas to use across all views.\n\t *\n\t * @throws if called before the GPU device is resolved\n\t */\n\tstatic get atlas(): TextureAtlas {\n\t\tif (!ViewGpuContext._atlas) {\n\t\t\tthrow new BugIndicatingError('Cannot call ViewGpuContext.textureAtlas before device is resolved');\n\t\t}\n\t\treturn ViewGpuContext._atlas;\n\t}\n\t/**\n\t * The shared texture atlas to use across all views. This is a convenience alias for\n\t * {@link ViewGpuContext.atlas}.\n\t *\n\t * @throws if called before the GPU device is resolved\n\t */\n\tget atlas(): TextureAtlas {\n\t\treturn ViewGpuContext.atlas;\n\t}\n\n\treadonly canvasDevicePixelDimensions: IObservable<{ width: number; height: number }>;\n\treadonly devicePixelRatio: IObservable<number>;\n\treadonly contentLeft: IObservable<number>;\n\n\tconstructor(\n\t\tcontext: ViewContext,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@INotificationService private readonly _notificationService: INotificationService,\n\t\t@IConfigurationService private readonly configurationService: IConfigurationService,\n\t) {\n\t\tsuper();\n\n\t\tthis.canvas = createFastDomNode(document.createElement('canvas'));\n\t\tthis.canvas.setClassName('editorCanvas');\n\n\t\t// Adjust the canvas size to avoid drawing under the scroll bar\n\t\tthis._register(Event.runAndSubscribe(configurationService.onDidChangeConfiguration, e => {\n\t\t\tif (!e || e.affectsConfiguration('editor.scrollbar.verticalScrollbarSize')) {\n\t\t\t\tconst verticalScrollbarSize = configurationService.getValue<IEditorOptions>('editor').scrollbar?.verticalScrollbarSize ?? 14;\n\t\t\t\tthis.canvas.domNode.style.boxSizing = 'border-box';\n\t\t\t\tthis.canvas.domNode.style.paddingRight = `${verticalScrollbarSize}px`;\n\t\t\t}\n\t\t}));\n\n\t\tthis.ctx = ensureNonNullable(this.canvas.domNode.getContext('webgpu'));\n\n\t\t// Request the GPU device, we only want to do this a single time per window as it's async\n\t\t// and can delay the initial render.\n\t\tif (!ViewGpuContext.device) {\n\t\t\tViewGpuContext.device = GPULifecycle.requestDevice((message) => {\n\t\t\t\tconst choices: IPromptChoice[] = [{\n\t\t\t\t\tlabel: nls.localize('editor.dom.render', \"Use DOM-based rendering\"),\n\t\t\t\t\trun: () => this.configurationService.updateValue('editor.experimentalGpuAcceleration', 'off'),\n\t\t\t\t}];\n\t\t\t\tthis._notificationService.prompt(Severity.Warning, message, choices);\n\t\t\t}).then(ref => {\n\t\t\t\tViewGpuContext.deviceSync = ref.object;\n\t\t\t\tif (!ViewGpuContext._atlas) {\n\t\t\t\t\tViewGpuContext._atlas = this._instantiationService.createInstance(TextureAtlas, ref.object.limits.maxTextureDimension2D, undefined, ViewGpuContext.decorationStyleCache);\n\t\t\t\t}\n\t\t\t\treturn ref.object;\n\t\t\t});\n\t\t}\n\n\t\tconst dprObs = observableValue(this, getActiveWindow().devicePixelRatio);\n\t\tthis._register(addDisposableListener(getActiveWindow(), 'resize', () => {\n\t\t\tdprObs.set(getActiveWindow().devicePixelRatio, undefined);\n\t\t}));\n\t\tthis.devicePixelRatio = dprObs;\n\t\tthis._register(runOnChange(this.devicePixelRatio, () => ViewGpuContext.atlas?.clear()));\n\n\t\tconst canvasDevicePixelDimensions = observableValue(this, { width: this.canvas.domNode.width, height: this.canvas.domNode.height });\n\t\tthis._register(observeDevicePixelDimensions(\n\t\t\tthis.canvas.domNode,\n\t\t\tgetActiveWindow(),\n\t\t\t(width, height) => {\n\t\t\t\tthis.canvas.domNode.width = width;\n\t\t\t\tthis.canvas.domNode.height = height;\n\t\t\t\tcanvasDevicePixelDimensions.set({ width, height }, undefined);\n\t\t\t}\n\t\t));\n\t\tthis.canvasDevicePixelDimensions = canvasDevicePixelDimensions;\n\n\t\tconst contentLeft = observableValue(this, 0);\n\t\tthis._register(this.configurationService.onDidChangeConfiguration(e => {\n\t\t\tcontentLeft.set(context.configuration.options.get(EditorOption.layoutInfo).contentLeft, undefined);\n\t\t}));\n\t\tthis.contentLeft = contentLeft;\n\n\t\tthis.rectangleRenderer = this._instantiationService.createInstance(RectangleRenderer, context, this.contentLeft, this.devicePixelRatio, this.canvas.domNode, this.ctx, ViewGpuContext.device);\n\t}\n\n\t/**\n\t * This method determines which lines can be and are allowed to be rendered using the GPU\n\t * renderer. Eventually this should trend all lines, except maybe exceptional cases like\n\t * decorations that use class names.\n\t */\n\tpublic canRender(options: ViewLineOptions, viewportData: ViewportData, lineNumber: number): boolean {\n\t\tconst data = viewportData.getViewLineRenderingData(lineNumber);\n\n\t\t// Check if the line has simple attributes that aren't supported\n\t\tif (\n\t\t\tdata.containsRTL ||\n\t\t\tdata.maxColumn > this.maxGpuCols\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if all inline decorations are supported\n\t\tif (data.inlineDecorations.length > 0) {\n\t\t\tlet supported = true;\n\t\t\tfor (const decoration of data.inlineDecorations) {\n\t\t\t\tif (decoration.type !== InlineDecorationType.Regular) {\n\t\t\t\t\tsupported = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tconst styleRules = ViewGpuContext._decorationCssRuleExtractor.getStyleRules(this.canvas.domNode, decoration.inlineClassName);\n\t\t\t\tsupported &&= styleRules.every(rule => {\n\t\t\t\t\t// Pseudo classes aren't supported currently\n\t\t\t\t\tif (rule.selectorText.includes(':')) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tfor (const r of rule.style) {\n\t\t\t\t\t\tif (!supportsCssRule(r, rule.style)) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t});\n\t\t\t\tif (!supported) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn supported;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Like {@link canRender} but returns detailed information about why the line cannot be rendered.\n\t */\n\tpublic canRenderDetailed(options: ViewLineOptions, viewportData: ViewportData, lineNumber: number): string[] {\n\t\tconst data = viewportData.getViewLineRenderingData(lineNumber);\n\t\tconst reasons: string[] = [];\n\t\tif (data.containsRTL) {\n\t\t\treasons.push('containsRTL');\n\t\t}\n\t\tif (data.maxColumn > this.maxGpuCols) {\n\t\t\treasons.push('maxColumn > maxGpuCols');\n\t\t}\n\t\tif (data.inlineDecorations.length > 0) {\n\t\t\tlet supported = true;\n\t\t\tconst problemTypes: InlineDecorationType[] = [];\n\t\t\tconst problemSelectors: string[] = [];\n\t\t\tconst problemRules: string[] = [];\n\t\t\tfor (const decoration of data.inlineDecorations) {\n\t\t\t\tif (decoration.type !== InlineDecorationType.Regular) {\n\t\t\t\t\tproblemTypes.push(decoration.type);\n\t\t\t\t\tsupported = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst styleRules = ViewGpuContext._decorationCssRuleExtractor.getStyleRules(this.canvas.domNode, decoration.inlineClassName);\n\t\t\t\tsupported &&= styleRules.every(rule => {\n\t\t\t\t\t// Pseudo classes aren't supported currently\n\t\t\t\t\tif (rule.selectorText.includes(':')) {\n\t\t\t\t\t\tproblemSelectors.push(rule.selectorText);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tfor (const r of rule.style) {\n\t\t\t\t\t\tif (!supportsCssRule(r, rule.style)) {\n\t\t\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any\n\t\t\t\t\t\t\tproblemRules.push(`${r}: ${rule.style[r as any]}`);\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t});\n\t\t\t\tif (!supported) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (problemTypes.length > 0) {\n\t\t\t\treasons.push(`inlineDecorations with unsupported types (${problemTypes.map(e => `\\`${e}\\``).join(', ')})`);\n\t\t\t}\n\t\t\tif (problemRules.length > 0) {\n\t\t\t\treasons.push(`inlineDecorations with unsupported CSS rules (${problemRules.map(e => `\\`${e}\\``).join(', ')})`);\n\t\t\t}\n\t\t\tif (problemSelectors.length > 0) {\n\t\t\t\treasons.push(`inlineDecorations with unsupported CSS selectors (${problemSelectors.map(e => `\\`${e}\\``).join(', ')})`);\n\t\t\t}\n\t\t}\n\t\treturn reasons;\n\t}\n}\n\n/**\n * A list of supported decoration CSS rules that can be used in the GPU renderer.\n */\nconst gpuSupportedDecorationCssRules = [\n\t'color',\n\t'font-weight',\n\t'opacity',\n];\n\nfunction supportsCssRule(rule: string, style: CSSStyleDeclaration) {\n\tif (!gpuSupportedDecorationCssRules.includes(rule)) {\n\t\treturn false;\n\t}\n\t// Check for values that aren't supported\n\tswitch (rule) {\n\t\tdefault: return true;\n\t}\n}\n"]}