monaco-editor-core 0.55.1 → 0.56.0-dev-20251122

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 (430) hide show
  1. package/esm/nls.keys.json +1 -1
  2. package/esm/nls.messages.cs.js +2 -2
  3. package/esm/nls.messages.de.js +2 -2
  4. package/esm/nls.messages.es.js +2 -2
  5. package/esm/nls.messages.fr.js +2 -2
  6. package/esm/nls.messages.it.js +2 -2
  7. package/esm/nls.messages.ja.js +2 -2
  8. package/esm/nls.messages.js +1 -1
  9. package/esm/nls.messages.json +1 -1
  10. package/esm/nls.messages.ko.js +2 -2
  11. package/esm/nls.messages.pl.js +2 -2
  12. package/esm/nls.messages.pt-br.js +2 -2
  13. package/esm/nls.messages.ru.js +2 -2
  14. package/esm/nls.messages.tr.js +2 -2
  15. package/esm/nls.messages.zh-cn.js +2 -2
  16. package/esm/nls.messages.zh-tw.js +2 -2
  17. package/esm/nls.metadata.json +29 -8
  18. package/esm/vs/base/browser/dom.js +31 -34
  19. package/esm/vs/base/browser/dom.js.map +1 -1
  20. package/esm/vs/base/browser/dompurify/dompurify.js +0 -1
  21. package/esm/vs/base/browser/keyboardEvent.js +3 -3
  22. package/esm/vs/base/browser/keyboardEvent.js.map +1 -1
  23. package/esm/vs/base/browser/markdownRenderer.js +5 -2
  24. package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
  25. package/esm/vs/base/browser/pixelRatio.js +5 -5
  26. package/esm/vs/base/browser/pixelRatio.js.map +1 -1
  27. package/esm/vs/base/browser/trustedTypes.js +1 -1
  28. package/esm/vs/base/browser/trustedTypes.js.map +1 -1
  29. package/esm/vs/base/browser/ui/actionbar/actionbar.js +3 -0
  30. package/esm/vs/base/browser/ui/actionbar/actionbar.js.map +1 -1
  31. package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  32. package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +7 -0
  33. package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js.map +1 -1
  34. package/esm/vs/base/browser/ui/hover/hoverWidget.css +0 -13
  35. package/esm/vs/base/browser/ui/inputbox/inputBox.js +7 -0
  36. package/esm/vs/base/browser/ui/inputbox/inputBox.js.map +1 -1
  37. package/esm/vs/base/browser/ui/keybindingLabel/keybindingLabel.css +4 -2
  38. package/esm/vs/base/browser/ui/list/listView.js +7 -2
  39. package/esm/vs/base/browser/ui/list/listView.js.map +1 -1
  40. package/esm/vs/base/browser/ui/list/rowCache.js +1 -4
  41. package/esm/vs/base/browser/ui/list/rowCache.js.map +1 -1
  42. package/esm/vs/base/browser/ui/menu/menu.js +14 -12
  43. package/esm/vs/base/browser/ui/menu/menu.js.map +1 -1
  44. package/esm/vs/base/browser/ui/selectBox/selectBox.js +4 -0
  45. package/esm/vs/base/browser/ui/selectBox/selectBox.js.map +1 -1
  46. package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.css +12 -32
  47. package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js +8 -18
  48. package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js.map +1 -1
  49. package/esm/vs/base/browser/ui/toolbar/toolbar.js +41 -14
  50. package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
  51. package/esm/vs/base/browser/ui/tree/abstractTree.js +11 -0
  52. package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
  53. package/esm/vs/base/browser/ui/tree/asyncDataTree.js +1 -0
  54. package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
  55. package/esm/vs/base/browser/ui/tree/compressedObjectTreeModel.js.map +1 -1
  56. package/esm/vs/base/browser/ui/tree/dataTree.js.map +1 -1
  57. package/esm/vs/base/browser/ui/tree/indexTreeModel.js.map +1 -1
  58. package/esm/vs/base/browser/ui/tree/objectTree.js.map +1 -1
  59. package/esm/vs/base/browser/ui/tree/objectTreeModel.js.map +1 -1
  60. package/esm/vs/base/browser/ui/tree/tree.js.map +1 -1
  61. package/esm/vs/base/common/arrays.js +10 -0
  62. package/esm/vs/base/common/arrays.js.map +1 -1
  63. package/esm/vs/base/common/async.js +34 -0
  64. package/esm/vs/base/common/async.js.map +1 -1
  65. package/esm/vs/base/common/buffer.js +1 -1
  66. package/esm/vs/base/common/buffer.js.map +1 -1
  67. package/esm/vs/base/common/cancellation.js.map +1 -1
  68. package/esm/vs/base/common/codiconsLibrary.js +3 -0
  69. package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
  70. package/esm/vs/base/common/collections.js.map +1 -1
  71. package/esm/vs/base/common/equals.js.map +1 -1
  72. package/esm/vs/base/common/event.js +32 -15
  73. package/esm/vs/base/common/event.js.map +1 -1
  74. package/esm/vs/base/common/filters.js +22 -3
  75. package/esm/vs/base/common/filters.js.map +1 -1
  76. package/esm/vs/base/common/hotReload.js +2 -2
  77. package/esm/vs/base/common/hotReload.js.map +1 -1
  78. package/esm/vs/base/common/iterator.js +1 -1
  79. package/esm/vs/base/common/iterator.js.map +1 -1
  80. package/esm/vs/base/common/keyCodes.js +7 -6
  81. package/esm/vs/base/common/keyCodes.js.map +1 -1
  82. package/esm/vs/base/common/linkedList.js.map +1 -1
  83. package/esm/vs/base/common/map.js +8 -5
  84. package/esm/vs/base/common/map.js.map +1 -1
  85. package/esm/vs/base/common/marked/marked.js +0 -1
  86. package/esm/vs/base/common/network.js +26 -1
  87. package/esm/vs/base/common/network.js.map +1 -1
  88. package/esm/vs/base/common/normalization.js +19 -6
  89. package/esm/vs/base/common/normalization.js.map +1 -1
  90. package/esm/vs/base/common/observableInternal/debugLocation.js +1 -2
  91. package/esm/vs/base/common/observableInternal/debugLocation.js.map +1 -1
  92. package/esm/vs/base/common/observableInternal/debugName.js +0 -1
  93. package/esm/vs/base/common/observableInternal/debugName.js.map +1 -1
  94. package/esm/vs/base/common/observableInternal/index.js +4 -4
  95. package/esm/vs/base/common/observableInternal/index.js.map +1 -1
  96. package/esm/vs/base/common/observableInternal/logging/debugGetDependencyGraph.js +38 -10
  97. package/esm/vs/base/common/observableInternal/logging/debugGetDependencyGraph.js.map +1 -1
  98. package/esm/vs/base/common/observableInternal/observables/baseObservable.js +3 -3
  99. package/esm/vs/base/common/observableInternal/observables/baseObservable.js.map +1 -1
  100. package/esm/vs/base/common/observableInternal/observables/derivedImpl.js +1 -4
  101. package/esm/vs/base/common/observableInternal/observables/derivedImpl.js.map +1 -1
  102. package/esm/vs/base/common/observableInternal/utils/utils.js +46 -5
  103. package/esm/vs/base/common/observableInternal/utils/utils.js.map +1 -1
  104. package/esm/vs/base/common/path.js +1 -0
  105. package/esm/vs/base/common/path.js.map +1 -1
  106. package/esm/vs/base/common/strings.js +27 -19
  107. package/esm/vs/base/common/strings.js.map +1 -1
  108. package/esm/vs/base/common/worker/webWorker.js +10 -7
  109. package/esm/vs/base/common/worker/webWorker.js.map +1 -1
  110. package/esm/vs/editor/browser/config/elementSizeObserver.js +5 -5
  111. package/esm/vs/editor/browser/config/elementSizeObserver.js.map +1 -1
  112. package/esm/vs/editor/browser/config/fontMeasurements.js.map +1 -1
  113. package/esm/vs/editor/browser/config/migrateOptions.js +6 -0
  114. package/esm/vs/editor/browser/config/migrateOptions.js.map +1 -1
  115. package/esm/vs/editor/browser/config/tabFocus.js +4 -2
  116. package/esm/vs/editor/browser/config/tabFocus.js.map +1 -1
  117. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +8 -0
  118. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
  119. package/esm/vs/editor/browser/coreCommands.js +1 -2
  120. package/esm/vs/editor/browser/coreCommands.js.map +1 -1
  121. package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
  122. package/esm/vs/editor/browser/observableCodeEditor.js +32 -1
  123. package/esm/vs/editor/browser/observableCodeEditor.js.map +1 -1
  124. package/esm/vs/editor/browser/services/contribution.js +9 -0
  125. package/esm/vs/editor/browser/services/contribution.js.map +1 -0
  126. package/esm/vs/editor/browser/services/editorWorkerService.js +27 -14
  127. package/esm/vs/editor/browser/services/editorWorkerService.js.map +1 -1
  128. package/esm/vs/editor/browser/services/openerService.js +5 -1
  129. package/esm/vs/editor/browser/services/openerService.js.map +1 -1
  130. package/esm/vs/editor/browser/view/domLineBreaksComputer.js +1 -1
  131. package/esm/vs/editor/browser/view/domLineBreaksComputer.js.map +1 -1
  132. package/esm/vs/editor/browser/view/renderingContext.js +1 -1
  133. package/esm/vs/editor/browser/view/renderingContext.js.map +1 -1
  134. package/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js +10 -3
  135. package/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js.map +1 -1
  136. package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +3 -4
  137. package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js.map +1 -1
  138. package/esm/vs/editor/browser/viewParts/minimap/minimap.js +1 -1
  139. package/esm/vs/editor/browser/viewParts/minimap/minimap.js.map +1 -1
  140. package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js +1 -1
  141. package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js.map +1 -1
  142. package/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js +4 -2
  143. package/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js.map +1 -1
  144. package/esm/vs/editor/browser/viewParts/rulers/rulers.js +1 -3
  145. package/esm/vs/editor/browser/viewParts/rulers/rulers.js.map +1 -1
  146. package/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js +1 -1
  147. package/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js.map +1 -1
  148. package/esm/vs/editor/browser/viewParts/viewLines/domReadingContext.js +2 -1
  149. package/esm/vs/editor/browser/viewParts/viewLines/domReadingContext.js.map +1 -1
  150. package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js +6 -18
  151. package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js.map +1 -1
  152. package/esm/vs/editor/browser/viewParts/whitespace/whitespace.js +0 -7
  153. package/esm/vs/editor/browser/viewParts/whitespace/whitespace.js.map +1 -1
  154. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +7 -2
  155. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
  156. package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +1 -0
  157. package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js.map +1 -1
  158. package/esm/vs/editor/common/commands/replaceCommand.js +2 -2
  159. package/esm/vs/editor/common/commands/replaceCommand.js.map +1 -1
  160. package/esm/vs/editor/common/config/editorOptions.js +374 -360
  161. package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
  162. package/esm/vs/editor/common/core/2d/rect.js +7 -0
  163. package/esm/vs/editor/common/core/2d/rect.js.map +1 -1
  164. package/esm/vs/editor/common/core/2d/size.js +20 -0
  165. package/esm/vs/editor/common/core/2d/size.js.map +1 -0
  166. package/esm/vs/editor/common/core/editorColorRegistry.js +69 -68
  167. package/esm/vs/editor/common/core/editorColorRegistry.js.map +1 -1
  168. package/esm/vs/editor/common/core/ranges/offsetRange.js +9 -0
  169. package/esm/vs/editor/common/core/ranges/offsetRange.js.map +1 -1
  170. package/esm/vs/editor/common/cursor/cursorMoveCommands.js +4 -4
  171. package/esm/vs/editor/common/cursor/cursorMoveCommands.js.map +1 -1
  172. package/esm/vs/editor/common/editorContextKeys.js +47 -47
  173. package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
  174. package/esm/vs/editor/common/languages.js +56 -56
  175. package/esm/vs/editor/common/languages.js.map +1 -1
  176. package/esm/vs/editor/common/model/editStack.js +1 -1
  177. package/esm/vs/editor/common/services/languagesAssociations.js +6 -8
  178. package/esm/vs/editor/common/services/languagesAssociations.js.map +1 -1
  179. package/esm/vs/editor/common/standaloneStrings.js +11 -10
  180. package/esm/vs/editor/common/standaloneStrings.js.map +1 -1
  181. package/esm/vs/editor/common/textModelEditSource.js +1 -1
  182. package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
  183. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
  184. package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
  185. package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
  186. package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
  187. package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
  188. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +17 -17
  189. package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
  190. package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
  191. package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
  192. package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
  193. package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
  194. package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
  195. package/esm/vs/editor/contrib/codelens/browser/codelens.js.map +1 -1
  196. package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
  197. package/esm/vs/editor/contrib/codelens/browser/codelensController.js.map +1 -1
  198. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
  199. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
  200. package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +1 -1
  201. package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
  202. package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
  203. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +10 -10
  204. package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
  205. package/esm/vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution.js +14 -0
  206. package/esm/vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution.js.map +1 -1
  207. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
  208. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +9 -9
  209. package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
  210. package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
  211. package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
  212. package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
  213. package/esm/vs/editor/contrib/find/browser/findController.js +17 -17
  214. package/esm/vs/editor/contrib/find/browser/findController.js.map +1 -1
  215. package/esm/vs/editor/contrib/find/browser/findWidget.js +26 -26
  216. package/esm/vs/editor/contrib/find/browser/findWidgetSearchHistory.js.map +1 -1
  217. package/esm/vs/editor/contrib/find/browser/replaceWidgetHistory.js.map +1 -1
  218. package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +1 -1
  219. package/esm/vs/editor/contrib/folding/browser/folding.js +20 -20
  220. package/esm/vs/editor/contrib/folding/browser/folding.js.map +1 -1
  221. package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
  222. package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
  223. package/esm/vs/editor/contrib/format/browser/format.js +21 -6
  224. package/esm/vs/editor/contrib/format/browser/format.js.map +1 -1
  225. package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
  226. package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
  227. package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
  228. package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
  229. package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
  230. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
  231. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
  232. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
  233. package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
  234. package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
  235. package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
  236. package/esm/vs/editor/contrib/hover/browser/contentHoverController.js +5 -10
  237. package/esm/vs/editor/contrib/hover/browser/contentHoverController.js.map +1 -1
  238. package/esm/vs/editor/contrib/hover/browser/glyphHoverController.js +11 -6
  239. package/esm/vs/editor/contrib/hover/browser/glyphHoverController.js.map +1 -1
  240. package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
  241. package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
  242. package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
  243. package/esm/vs/editor/contrib/hover/browser/hoverUtils.js +24 -0
  244. package/esm/vs/editor/contrib/hover/browser/hoverUtils.js.map +1 -1
  245. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +9 -9
  246. package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
  247. package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
  248. package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
  249. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
  250. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +20 -20
  251. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +12 -12
  252. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +18 -16
  253. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js.map +1 -1
  254. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
  255. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
  256. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +42 -37
  257. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
  258. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js +3 -3
  259. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js.map +1 -1
  260. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +8 -8
  261. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js.map +1 -1
  262. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +54 -43
  263. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js.map +1 -1
  264. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +12 -12
  265. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js.map +1 -1
  266. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +74 -48
  267. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
  268. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +8 -36
  269. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js.map +1 -1
  270. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsNewUsers.js +10 -11
  271. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsNewUsers.js.map +1 -1
  272. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +105 -119
  273. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
  274. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js.map +1 -1
  275. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +8 -36
  276. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js.map +1 -1
  277. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/debugVisualization.js +95 -0
  278. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/debugVisualization.js.map +1 -0
  279. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js +17 -9
  280. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js.map +1 -1
  281. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js +428 -0
  282. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js.map +1 -0
  283. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js +290 -0
  284. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js.map +1 -0
  285. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
  286. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/flexBoxLayout.js +103 -0
  287. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/flexBoxLayout.js.map +1 -0
  288. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/towersLayout.js +32 -0
  289. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/towersLayout.js.map +1 -0
  290. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js +44 -11
  291. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js.map +1 -1
  292. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/view.css +10 -0
  293. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js +181 -0
  294. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js.map +1 -0
  295. package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
  296. package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
  297. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +32 -31
  298. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js.map +1 -1
  299. package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
  300. package/esm/vs/editor/contrib/links/browser/links.js +10 -10
  301. package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
  302. package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
  303. package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
  304. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
  305. package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
  306. package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
  307. package/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js +2 -2
  308. package/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js.map +1 -1
  309. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +18 -13
  310. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js.map +1 -1
  311. package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
  312. package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
  313. package/esm/vs/editor/contrib/rename/browser/rename.js +12 -12
  314. package/esm/vs/editor/contrib/rename/browser/rename.js.map +1 -1
  315. package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
  316. package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
  317. package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
  318. package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
  319. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  320. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +1 -1
  321. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js.map +1 -1
  322. package/esm/vs/editor/contrib/suggest/browser/suggest.js +8 -8
  323. package/esm/vs/editor/contrib/suggest/browser/suggestController.js +10 -10
  324. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +17 -17
  325. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
  326. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
  327. package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
  328. package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
  329. package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  330. package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  331. package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  332. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +29 -29
  333. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js.map +1 -1
  334. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
  335. package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  336. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +4 -4
  337. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js.map +1 -1
  338. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +1 -1
  339. package/esm/vs/editor/editor.all.js +1 -0
  340. package/esm/vs/editor/editor.all.js.map +1 -1
  341. package/esm/vs/editor/editor.api.d.ts +9 -5
  342. package/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js +22 -2
  343. package/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js.map +1 -1
  344. package/esm/vs/editor/standalone/browser/services/standaloneWebWorkerService.js +39 -0
  345. package/esm/vs/editor/standalone/browser/services/standaloneWebWorkerService.js.map +1 -0
  346. package/esm/vs/editor/standalone/browser/standaloneEditor.js +2 -1
  347. package/esm/vs/editor/standalone/browser/standaloneEditor.js.map +1 -1
  348. package/esm/vs/editor/standalone/browser/standaloneServices.js +3 -21
  349. package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
  350. package/esm/vs/editor/standalone/browser/standaloneWebWorker.js +4 -4
  351. package/esm/vs/editor/standalone/browser/standaloneWebWorker.js.map +1 -1
  352. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
  353. package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
  354. package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
  355. package/esm/vs/platform/actionWidget/browser/actionWidget.css +7 -0
  356. package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
  357. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +7 -9
  358. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js.map +1 -1
  359. package/esm/vs/platform/actions/browser/toolbar.js +2 -2
  360. package/esm/vs/platform/actions/common/actions.js +2 -0
  361. package/esm/vs/platform/actions/common/actions.js.map +1 -1
  362. package/esm/vs/platform/actions/common/menuService.js +2 -2
  363. package/esm/vs/platform/configuration/common/configuration.js +5 -4
  364. package/esm/vs/platform/configuration/common/configuration.js.map +1 -1
  365. package/esm/vs/platform/configuration/common/configurationModels.js +21 -10
  366. package/esm/vs/platform/configuration/common/configurationModels.js.map +1 -1
  367. package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
  368. package/esm/vs/platform/configuration/common/configurationRegistry.js.map +1 -1
  369. package/esm/vs/platform/configuration/common/configurations.js.map +1 -1
  370. package/esm/vs/platform/contextkey/browser/contextKeyService.js +3 -3
  371. package/esm/vs/platform/contextkey/browser/contextKeyService.js.map +1 -1
  372. package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
  373. package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
  374. package/esm/vs/platform/contextkey/common/scanner.js +5 -5
  375. package/esm/vs/platform/contextview/browser/contextViewService.js.map +1 -1
  376. package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  377. package/esm/vs/platform/hover/browser/hoverService.js +17 -8
  378. package/esm/vs/platform/hover/browser/hoverService.js.map +1 -1
  379. package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
  380. package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
  381. package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
  382. package/esm/vs/platform/list/browser/listService.js +27 -27
  383. package/esm/vs/platform/list/browser/listService.js.map +1 -1
  384. package/esm/vs/platform/markers/common/markerService.js +2 -2
  385. package/esm/vs/platform/markers/common/markers.js +6 -6
  386. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +51 -39
  387. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js.map +1 -1
  388. package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
  389. package/esm/vs/platform/quickinput/browser/media/quickInput.css +9 -3
  390. package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
  391. package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
  392. package/esm/vs/platform/quickinput/browser/quickInputController.js +35 -14
  393. package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
  394. package/esm/vs/platform/quickinput/browser/quickInputList.js +4 -1
  395. package/esm/vs/platform/quickinput/browser/quickInputList.js.map +1 -1
  396. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  397. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
  398. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js +78 -39
  399. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js.map +1 -1
  400. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js +21 -8
  401. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js.map +1 -1
  402. package/esm/vs/platform/telemetry/common/gdprTypings.js.map +1 -1
  403. package/esm/vs/platform/telemetry/common/telemetry.js.map +1 -1
  404. package/esm/vs/platform/theme/common/colorUtils.js +2 -2
  405. package/esm/vs/platform/theme/common/colors/baseColors.js +17 -17
  406. package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
  407. package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
  408. package/esm/vs/platform/theme/common/colors/editorColors.js.map +1 -1
  409. package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
  410. package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
  411. package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
  412. package/esm/vs/platform/theme/common/colors/minimapColors.js +11 -11
  413. package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
  414. package/esm/vs/platform/theme/common/colors/miscColors.js.map +1 -1
  415. package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
  416. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  417. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  418. package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
  419. package/esm/vs/platform/webWorker/browser/webWorkerDescriptor.js +12 -0
  420. package/esm/vs/platform/webWorker/browser/webWorkerDescriptor.js.map +1 -0
  421. package/esm/vs/platform/webWorker/browser/webWorkerService.js +7 -0
  422. package/esm/vs/platform/webWorker/browser/webWorkerService.js.map +1 -0
  423. package/esm/vs/{base/browser/webWorkerFactory.js → platform/webWorker/browser/webWorkerServiceImpl.js} +47 -66
  424. package/esm/vs/platform/webWorker/browser/webWorkerServiceImpl.js.map +1 -0
  425. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  426. package/monaco.d.ts +9 -5
  427. package/package.json +2 -2
  428. package/esm/vs/base/browser/webWorkerFactory.js.map +0 -1
  429. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineCompletionsView.js +0 -82
  430. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineCompletionsView.js.map +0 -1
@@ -0,0 +1,428 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
8
+ return function (target, key) { decorator(target, key, paramIndex); }
9
+ };
10
+ /*---------------------------------------------------------------------------------------------
11
+ * Copyright (c) Microsoft Corporation. All rights reserved.
12
+ * Licensed under the MIT License. See License.txt in the project root for license information.
13
+ *--------------------------------------------------------------------------------------------*/
14
+ import { n } from '../../../../../../../../base/browser/dom.js';
15
+ import { Event } from '../../../../../../../../base/common/event.js';
16
+ import { Disposable } from '../../../../../../../../base/common/lifecycle.js';
17
+ import { autorun, constObservable, debouncedObservable2, derived, derivedDisposable } from '../../../../../../../../base/common/observable.js';
18
+ import { IInstantiationService } from '../../../../../../../../platform/instantiation/common/instantiation.js';
19
+ import { observableCodeEditor } from '../../../../../../../browser/observableCodeEditor.js';
20
+ import { Rect } from '../../../../../../../common/core/2d/rect.js';
21
+ import { Position } from '../../../../../../../common/core/position.js';
22
+ import { InlineEditTabAction } from '../../inlineEditsViewInterface.js';
23
+ import { getContentSizeOfLines, rectToProps } from '../../utils/utils.js';
24
+ import { OffsetRange } from '../../../../../../../common/core/ranges/offsetRange.js';
25
+ import { LineRange } from '../../../../../../../common/core/ranges/lineRange.js';
26
+ import { HideUnchangedRegionsFeature } from '../../../../../../../browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js';
27
+ import { Codicon } from '../../../../../../../../base/common/codicons.js';
28
+ import { renderIcon } from '../../../../../../../../base/browser/ui/iconLabel/iconLabels.js';
29
+ import { SymbolKinds } from '../../../../../../../common/languages.js';
30
+ import { debugLogRects, debugView } from '../debugVisualization.js';
31
+ import { distributeFlexBoxLayout } from '../../utils/flexBoxLayout.js';
32
+ import { Point } from '../../../../../../../common/core/2d/point.js';
33
+ import { Size2D } from '../../../../../../../common/core/2d/size.js';
34
+ import { getMaxTowerHeightInAvailableArea } from '../../utils/towersLayout.js';
35
+ import { IThemeService } from '../../../../../../../../platform/theme/common/themeService.js';
36
+ import { IKeybindingService } from '../../../../../../../../platform/keybinding/common/keybinding.js';
37
+ import { getEditorBlendedColor, inlineEditIndicatorPrimaryBackground, inlineEditIndicatorSecondaryBackground, inlineEditIndicatorsuccessfulBackground } from '../../theme.js';
38
+ import { asCssVariable, descriptionForeground, editorBackground, editorWidgetBackground } from '../../../../../../../../platform/theme/common/colorRegistry.js';
39
+ import { LongDistancePreviewEditor } from './longDistancePreviewEditor.js';
40
+ import { jumpToNextInlineEditId } from '../../../../controller/commandIds.js';
41
+ const BORDER_RADIUS = 4;
42
+ const MAX_WIDGET_WIDTH = { EMPTY_SPACE: 425, OVERLAY: 375 };
43
+ const MIN_WIDGET_WIDTH = 250;
44
+ let InlineEditsLongDistanceHint = class InlineEditsLongDistanceHint extends Disposable {
45
+ constructor(_editor, _viewState, _previewTextModel, _tabAction, _instantiationService, _themeService, _keybindingService) {
46
+ super();
47
+ this._editor = _editor;
48
+ this._viewState = _viewState;
49
+ this._previewTextModel = _previewTextModel;
50
+ this._tabAction = _tabAction;
51
+ this._instantiationService = _instantiationService;
52
+ this._themeService = _themeService;
53
+ this._keybindingService = _keybindingService;
54
+ this.onDidClick = Event.None;
55
+ this._viewWithElement = undefined;
56
+ this._hintTextPosition = derived(this, (reader) => {
57
+ const viewState = this._viewState.read(reader);
58
+ return viewState ? new Position(viewState.hint.lineNumber, Number.MAX_SAFE_INTEGER) : null;
59
+ });
60
+ this._lineSizesAroundHintPosition = derived(this, (reader) => {
61
+ const viewState = this._viewState.read(reader);
62
+ const p = this._hintTextPosition.read(reader);
63
+ if (!viewState || !p) {
64
+ return undefined;
65
+ }
66
+ const model = this._editorObs.model.read(reader);
67
+ if (!model) {
68
+ return undefined;
69
+ }
70
+ const range = LineRange.ofLength(p.lineNumber, 1).addMargin(5, 5).intersect(LineRange.ofLength(1, model.getLineCount()));
71
+ if (!range) {
72
+ return undefined;
73
+ }
74
+ const sizes = getContentSizeOfLines(this._editorObs, range, reader);
75
+ const top = this._editorObs.observeTopForLineNumber(range.startLineNumber).read(reader);
76
+ return {
77
+ lineRange: range,
78
+ top: top,
79
+ sizes: sizes,
80
+ };
81
+ });
82
+ this._isVisibleDelayed = debouncedObservable2(derived(this, reader => this._viewState.read(reader)?.hint.isVisible), (lastValue, newValue) => lastValue === true && newValue === false ? 200 : 0);
83
+ this._previewEditorLayoutInfo = derived(this, (reader) => {
84
+ const viewState = this._viewState.read(reader);
85
+ if (!viewState || !this._isVisibleDelayed.read(reader)) {
86
+ return undefined;
87
+ }
88
+ const lineSizes = this._lineSizesAroundHintPosition.read(reader);
89
+ if (!lineSizes) {
90
+ return undefined;
91
+ }
92
+ const editorScrollTop = this._editorObs.scrollTop.read(reader);
93
+ const editorScrollLeft = this._editorObs.scrollLeft.read(reader);
94
+ const editorLayout = this._editorObs.layoutInfo.read(reader);
95
+ const previewContentHeight = this._previewEditor.contentHeight.read(reader);
96
+ const previewEditorContentLayout = this._previewEditor.horizontalContentRangeInPreviewEditorToShow.read(reader);
97
+ if (!previewContentHeight || !previewEditorContentLayout) {
98
+ return undefined;
99
+ }
100
+ // const debugRects = stackSizesDown(new Point(editorLayout.contentLeft, lineSizes.top - scrollTop), lineSizes.sizes);
101
+ const editorTrueContentWidth = editorLayout.contentWidth - editorLayout.verticalScrollbarWidth;
102
+ const editorTrueContentRight = editorLayout.contentLeft + editorTrueContentWidth;
103
+ // drawEditorWidths(this._editor, reader);
104
+ const c = this._editorObs.cursorLineNumber.read(reader);
105
+ if (!c) {
106
+ return undefined;
107
+ }
108
+ const availableSpaceSizes = lineSizes.sizes.map((s, idx) => {
109
+ const lineNumber = lineSizes.lineRange.startLineNumber + idx;
110
+ let linePaddingLeft = 20;
111
+ if (lineNumber === viewState.hint.lineNumber) {
112
+ linePaddingLeft = 40;
113
+ }
114
+ return new Size2D(Math.max(0, editorTrueContentWidth - s.width - linePaddingLeft), s.height);
115
+ });
116
+ const showRects = false;
117
+ if (showRects) {
118
+ const rects2 = stackSizesDown(new Point(editorTrueContentRight, lineSizes.top - editorScrollTop), availableSpaceSizes, 'right');
119
+ debugView(debugLogRects({ ...rects2 }, this._editor.getDomNode()), reader);
120
+ }
121
+ const availableSpaceHeightPrefixSums = getSums(availableSpaceSizes, s => s.height);
122
+ const availableSpaceSizesTransposed = availableSpaceSizes.map(s => s.transpose());
123
+ const previewEditorMargin = 2;
124
+ const widgetPadding = 2;
125
+ const lowerBarHeight = 20;
126
+ const widgetBorder = 1;
127
+ const extraGutterMarginToAvoidScrollBar = 2;
128
+ const previewEditorHeight = previewContentHeight + extraGutterMarginToAvoidScrollBar;
129
+ function getWidgetVerticalOutline(lineNumber) {
130
+ const sizeIdx = lineNumber - lineSizes.lineRange.startLineNumber;
131
+ const top = lineSizes.top + availableSpaceHeightPrefixSums[sizeIdx];
132
+ const editorRange = OffsetRange.ofStartAndLength(top, previewEditorHeight);
133
+ const verticalWidgetRange = editorRange.withMargin(previewEditorMargin + widgetPadding + widgetBorder).withMargin(0, lowerBarHeight);
134
+ return verticalWidgetRange;
135
+ }
136
+ let possibleWidgetOutline = findFirstMinimzeDistance(lineSizes.lineRange.addMargin(-1, -1), viewState.hint.lineNumber, lineNumber => {
137
+ const verticalWidgetRange = getWidgetVerticalOutline(lineNumber);
138
+ const maxWidth = getMaxTowerHeightInAvailableArea(verticalWidgetRange.delta(-lineSizes.top), availableSpaceSizesTransposed);
139
+ if (maxWidth < MIN_WIDGET_WIDTH) {
140
+ return undefined;
141
+ }
142
+ const horizontalWidgetRange = OffsetRange.ofStartAndLength(editorTrueContentRight - maxWidth, maxWidth);
143
+ return { horizontalWidgetRange, verticalWidgetRange };
144
+ });
145
+ let position = 'empty-space';
146
+ if (!possibleWidgetOutline) {
147
+ position = 'overlay';
148
+ const maxAvailableWidth = Math.min(editorLayout.width - editorLayout.contentLeft, MAX_WIDGET_WIDTH.OVERLAY);
149
+ possibleWidgetOutline = {
150
+ horizontalWidgetRange: OffsetRange.ofStartAndLength(editorTrueContentRight - maxAvailableWidth, maxAvailableWidth),
151
+ verticalWidgetRange: getWidgetVerticalOutline(viewState.hint.lineNumber + 2).delta(10),
152
+ };
153
+ }
154
+ if (!possibleWidgetOutline) {
155
+ return undefined;
156
+ }
157
+ const rectAvailableSpace = Rect.fromRanges(possibleWidgetOutline.horizontalWidgetRange, possibleWidgetOutline.verticalWidgetRange).translateX(-editorScrollLeft).translateY(-editorScrollTop);
158
+ const showAvailableSpace = false;
159
+ if (showAvailableSpace) {
160
+ debugView(debugLogRects({ rectAvailableSpace }, this._editor.getDomNode()), reader);
161
+ }
162
+ const maxWidgetWidth = Math.min(position === 'overlay' ? MAX_WIDGET_WIDTH.OVERLAY : MAX_WIDGET_WIDTH.EMPTY_SPACE, previewEditorContentLayout.maxEditorWidth + previewEditorMargin + widgetPadding);
163
+ const layout = distributeFlexBoxLayout(rectAvailableSpace.width, {
164
+ spaceBefore: { min: 0, max: 10, priority: 1 },
165
+ content: { min: 50, rules: [{ max: 150, priority: 2 }, { max: maxWidgetWidth, priority: 1 }] },
166
+ spaceAfter: { min: 10 },
167
+ });
168
+ if (!layout) {
169
+ return null;
170
+ }
171
+ const ranges = lengthsToOffsetRanges([layout.spaceBefore, layout.content, layout.spaceAfter], rectAvailableSpace.left);
172
+ const spaceBeforeRect = rectAvailableSpace.withHorizontalRange(ranges[0]);
173
+ const widgetRect = rectAvailableSpace.withHorizontalRange(ranges[1]);
174
+ const spaceAfterRect = rectAvailableSpace.withHorizontalRange(ranges[2]);
175
+ const showRects2 = false;
176
+ if (showRects2) {
177
+ debugView(debugLogRects({ spaceBeforeRect, widgetRect, spaceAfterRect }, this._editor.getDomNode()), reader);
178
+ }
179
+ const previewEditorRect = widgetRect.withMargin(-widgetPadding - widgetBorder - previewEditorMargin).withMargin(0, 0, -lowerBarHeight, 0);
180
+ const showEditorRect = false;
181
+ if (showEditorRect) {
182
+ debugView(debugLogRects({ previewEditorRect }, this._editor.getDomNode()), reader);
183
+ }
184
+ const previewEditorContentWidth = previewEditorRect.width - previewEditorContentLayout.nonContentWidth;
185
+ const maxPrefferedRangeLength = previewEditorContentWidth * 0.8;
186
+ const preferredRangeToReveal = previewEditorContentLayout.preferredRangeToReveal.intersect(OffsetRange.ofStartAndLength(previewEditorContentLayout.preferredRangeToReveal.start, maxPrefferedRangeLength)) ?? previewEditorContentLayout.preferredRangeToReveal;
187
+ const desiredPreviewEditorScrollLeft = scrollToReveal(previewEditorContentLayout.indentationEnd, previewEditorContentWidth, preferredRangeToReveal);
188
+ return {
189
+ codeEditorSize: previewEditorRect.getSize(),
190
+ codeScrollLeft: editorScrollLeft,
191
+ contentLeft: editorLayout.contentLeft,
192
+ widgetRect,
193
+ previewEditorMargin,
194
+ widgetPadding,
195
+ widgetBorder,
196
+ lowerBarHeight,
197
+ desiredPreviewEditorScrollLeft: desiredPreviewEditorScrollLeft.newScrollPosition,
198
+ };
199
+ });
200
+ this._view = n.div({
201
+ class: 'inline-edits-view',
202
+ style: {
203
+ position: 'absolute',
204
+ overflow: 'visible',
205
+ top: '0px',
206
+ left: '0px',
207
+ display: derived(this, reader => !!this._previewEditorLayoutInfo.read(reader) ? 'block' : 'none'),
208
+ },
209
+ }, [
210
+ derived(this, _reader => [this._widgetContent]),
211
+ ]);
212
+ this._widgetContent = derived(this, reader => // TODO@hediet: remove when n.div lazily creates previewEditor.element node
213
+ n.div({
214
+ class: 'inline-edits-long-distance-hint-widget',
215
+ style: {
216
+ position: 'absolute',
217
+ overflow: 'hidden',
218
+ cursor: 'pointer',
219
+ background: asCssVariable(editorWidgetBackground),
220
+ padding: this._previewEditorLayoutInfo.map(i => i?.widgetPadding),
221
+ boxSizing: 'border-box',
222
+ borderRadius: BORDER_RADIUS,
223
+ border: derived(reader => `${this._previewEditorLayoutInfo.read(reader)?.widgetBorder}px solid ${this._styles.read(reader).border}`),
224
+ display: 'flex',
225
+ flexDirection: 'column',
226
+ opacity: derived(reader => this._viewState.read(reader)?.hint.isVisible ? '1' : '0'),
227
+ transition: 'opacity 200ms ease-in-out',
228
+ ...rectToProps(reader => this._previewEditorLayoutInfo.read(reader)?.widgetRect)
229
+ },
230
+ onmousedown: e => {
231
+ e.preventDefault(); // This prevents that the editor loses focus
232
+ },
233
+ onclick: () => {
234
+ this._viewState.read(undefined)?.model.jump();
235
+ }
236
+ }, [
237
+ n.div({
238
+ class: ['editorContainer'],
239
+ style: {
240
+ overflow: 'hidden',
241
+ padding: this._previewEditorLayoutInfo.map(i => i?.previewEditorMargin),
242
+ background: asCssVariable(editorBackground),
243
+ pointerEvents: 'none',
244
+ },
245
+ }, [
246
+ derived(this, r => this._previewEditor.element), // --
247
+ ]),
248
+ n.div({ class: 'bar', style: { color: asCssVariable(descriptionForeground), pointerEvents: 'none', margin: '0 4px', height: this._previewEditorLayoutInfo.map(i => i?.lowerBarHeight), display: 'flex', justifyContent: 'space-between', alignItems: 'center' } }, [
249
+ derived(this, reader => {
250
+ const children = [];
251
+ const viewState = this._viewState.read(reader);
252
+ if (!viewState) {
253
+ return children;
254
+ }
255
+ // Outline Element
256
+ const source = this._originalOutlineSource.read(reader);
257
+ const outlineItems = source?.getAt(viewState.edit.lineEdit.lineRange.startLineNumber, reader).slice(0, 1) ?? [];
258
+ const outlineElements = [];
259
+ if (outlineItems.length > 0) {
260
+ for (let i = 0; i < outlineItems.length; i++) {
261
+ const item = outlineItems[i];
262
+ const icon = SymbolKinds.toIcon(item.kind);
263
+ outlineElements.push(n.div({
264
+ class: 'breadcrumb-item',
265
+ style: { display: 'flex', alignItems: 'center', flex: '1 1 auto', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' },
266
+ }, [
267
+ renderIcon(icon),
268
+ '\u00a0',
269
+ item.name,
270
+ ...(i === outlineItems.length - 1
271
+ ? []
272
+ : [renderIcon(Codicon.chevronRight)])
273
+ ]));
274
+ }
275
+ }
276
+ children.push(n.div({ class: 'outline-elements', style: { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, outlineElements));
277
+ // Show Edit Direction
278
+ const arrowIcon = isEditBelowHint(viewState) ? Codicon.arrowDown : Codicon.arrowUp;
279
+ const keybinding = this._keybindingService.lookupKeybinding(jumpToNextInlineEditId);
280
+ let label = 'Go to suggestion';
281
+ if (keybinding && keybinding.getLabel() === 'Tab') {
282
+ label = 'Tab to suggestion';
283
+ }
284
+ children.push(n.div({
285
+ class: 'go-to-label',
286
+ style: { position: 'relative', display: 'flex', alignItems: 'center', flex: '0 0 auto', paddingLeft: '6px' },
287
+ }, [
288
+ label,
289
+ '\u00a0',
290
+ renderIcon(arrowIcon),
291
+ ]));
292
+ return children;
293
+ })
294
+ ]),
295
+ ]));
296
+ this._originalOutlineSource = derivedDisposable(this, (reader) => {
297
+ const m = this._editorObs.model.read(reader);
298
+ const factory = HideUnchangedRegionsFeature._breadcrumbsSourceFactory.read(reader);
299
+ return (!m || !factory) ? undefined : factory(m, this._instantiationService);
300
+ });
301
+ this._styles = this._tabAction.map((v, reader) => {
302
+ let border;
303
+ switch (v) {
304
+ case InlineEditTabAction.Inactive:
305
+ border = inlineEditIndicatorSecondaryBackground;
306
+ break;
307
+ case InlineEditTabAction.Jump:
308
+ border = inlineEditIndicatorPrimaryBackground;
309
+ break;
310
+ case InlineEditTabAction.Accept:
311
+ border = inlineEditIndicatorsuccessfulBackground;
312
+ break;
313
+ }
314
+ return {
315
+ border: getEditorBlendedColor(border, this._themeService).read(reader).toString(),
316
+ background: asCssVariable(editorBackground)
317
+ };
318
+ });
319
+ this._editorObs = observableCodeEditor(this._editor);
320
+ this._previewEditor = this._register(this._instantiationService.createInstance(LongDistancePreviewEditor, this._previewTextModel, derived(reader => {
321
+ const viewState = this._viewState.read(reader);
322
+ if (!viewState) {
323
+ return undefined;
324
+ }
325
+ return {
326
+ diff: viewState.diff,
327
+ model: viewState.model,
328
+ suggestInfo: viewState.suggestInfo,
329
+ };
330
+ }), this._editor, this._tabAction));
331
+ this._viewWithElement = this._view.keepUpdated(this._store);
332
+ this._register(this._editorObs.createOverlayWidget({
333
+ domNode: this._viewWithElement.element,
334
+ position: constObservable(null),
335
+ allowEditorOverflow: false,
336
+ minContentWidthInPx: constObservable(0),
337
+ }));
338
+ this._widgetContent.get().keepUpdated(this._store);
339
+ this._register(autorun(reader => {
340
+ const layoutInfo = this._previewEditorLayoutInfo.read(reader);
341
+ if (!layoutInfo) {
342
+ return;
343
+ }
344
+ this._previewEditor.layout(layoutInfo.codeEditorSize.toDimension(), layoutInfo.desiredPreviewEditorScrollLeft);
345
+ }));
346
+ this._isVisibleDelayed.recomputeInitiallyAndOnChange(this._store);
347
+ }
348
+ get isHovered() { return this._widgetContent.get().didMouseMoveDuringHover; }
349
+ };
350
+ InlineEditsLongDistanceHint = __decorate([
351
+ __param(4, IInstantiationService),
352
+ __param(5, IThemeService),
353
+ __param(6, IKeybindingService)
354
+ ], InlineEditsLongDistanceHint);
355
+ export { InlineEditsLongDistanceHint };
356
+ function lengthsToOffsetRanges(lengths, initialOffset = 0) {
357
+ const result = [];
358
+ let offset = initialOffset;
359
+ for (const length of lengths) {
360
+ result.push(new OffsetRange(offset, offset + length));
361
+ offset += length;
362
+ }
363
+ return result;
364
+ }
365
+ function stackSizesDown(at, sizes, alignment = 'left') {
366
+ const rects = [];
367
+ let offset = 0;
368
+ for (const s of sizes) {
369
+ rects.push(Rect.fromLeftTopWidthHeight(at.x + (alignment === 'left' ? 0 : -s.width), at.y + offset, s.width, s.height));
370
+ offset += s.height;
371
+ }
372
+ return rects;
373
+ }
374
+ function findFirstMinimzeDistance(range, targetLine, predicate) {
375
+ for (let offset = 0;; offset++) {
376
+ const down = targetLine + offset;
377
+ if (down <= range.endLineNumberExclusive) {
378
+ const result = predicate(down);
379
+ if (result !== undefined) {
380
+ return result;
381
+ }
382
+ }
383
+ const up = targetLine - offset;
384
+ if (up >= range.startLineNumber) {
385
+ const result = predicate(up);
386
+ if (result !== undefined) {
387
+ return result;
388
+ }
389
+ }
390
+ if (up < range.startLineNumber && down > range.endLineNumberExclusive) {
391
+ return undefined;
392
+ }
393
+ }
394
+ }
395
+ function getSums(array, fn) {
396
+ const result = [0];
397
+ let sum = 0;
398
+ for (const item of array) {
399
+ sum += fn(item);
400
+ result.push(sum);
401
+ }
402
+ return result;
403
+ }
404
+ function isEditBelowHint(viewState) {
405
+ const hintLineNumber = viewState.hint.lineNumber;
406
+ const editStartLineNumber = viewState.diff[0]?.original.startLineNumber;
407
+ return hintLineNumber < editStartLineNumber;
408
+ }
409
+ /**
410
+ * Changes the scroll position as little as possible just to reveal the given range in the window.
411
+ */
412
+ export function scrollToReveal(currentScrollPosition, windowWidth, contentRangeToReveal) {
413
+ const visibleRange = new OffsetRange(currentScrollPosition, currentScrollPosition + windowWidth);
414
+ if (visibleRange.containsRange(contentRangeToReveal)) {
415
+ return { newScrollPosition: currentScrollPosition };
416
+ }
417
+ if (contentRangeToReveal.length > windowWidth) {
418
+ return { newScrollPosition: contentRangeToReveal.start };
419
+ }
420
+ if (contentRangeToReveal.endExclusive > visibleRange.endExclusive) {
421
+ return { newScrollPosition: contentRangeToReveal.endExclusive - windowWidth };
422
+ }
423
+ if (contentRangeToReveal.start < visibleRange.start) {
424
+ return { newScrollPosition: contentRangeToReveal.start };
425
+ }
426
+ return { newScrollPosition: currentScrollPosition };
427
+ }
428
+ //# sourceMappingURL=inlineEditsLongDistanceHint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.ts","vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;gGAGgG;AAChG,OAAO,EAAa,CAAC,EAAyC,MAAM,6CAA6C,CAAC;AAClH,OAAO,EAAE,KAAK,EAAE,MAAM,8CAA8C,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,kDAAkD,CAAC;AAC9E,OAAO,EAAe,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AAC5J,OAAO,EAAE,qBAAqB,EAAE,MAAM,wEAAwE,CAAC;AAE/G,OAAO,EAAE,oBAAoB,EAAE,MAAM,sDAAsD,CAAC;AAC5F,OAAO,EAAE,IAAI,EAAE,MAAM,6CAA6C,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,8CAA8C,CAAC;AAExE,OAAO,EAAoB,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAE1F,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAE1E,OAAO,EAAE,WAAW,EAAE,MAAM,wDAAwD,CAAC;AACrF,OAAO,EAAE,SAAS,EAAE,MAAM,sDAAsD,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,wFAAwF,CAAC;AACrI,OAAO,EAAE,OAAO,EA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,YAAY,CAAC,KAAK,EAAE,CAAC;QACrD,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,CAAC,KAAK,EAAE,CAAC;IAC1D,CAAC;IACD,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,CAAC;AACrD,CAAC","file":"inlineEditsLongDistanceHint.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 *--------------------------------------------------------------------------------------------*/\nimport { ChildNode, n, ObserverNode, ObserverNodeWithElement } from '../../../../../../../../base/browser/dom.js';\nimport { Event } from '../../../../../../../../base/common/event.js';\nimport { Disposable } from '../../../../../../../../base/common/lifecycle.js';\nimport { IObservable, autorun, constObservable, debouncedObservable2, derived, derivedDisposable } from '../../../../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../../../../platform/instantiation/common/instantiation.js';\nimport { ICodeEditor } from '../../../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../../../../browser/observableCodeEditor.js';\nimport { Rect } from '../../../../../../../common/core/2d/rect.js';\nimport { Position } from '../../../../../../../common/core/position.js';\nimport { ITextModel } from '../../../../../../../common/model.js';\nimport { IInlineEditsView, InlineEditTabAction } from '../../inlineEditsViewInterface.js';\nimport { InlineEditWithChanges } from '../../inlineEditWithChanges.js';\nimport { getContentSizeOfLines, rectToProps } from '../../utils/utils.js';\nimport { DetailedLineRangeMapping } from '../../../../../../../common/diff/rangeMapping.js';\nimport { OffsetRange } from '../../../../../../../common/core/ranges/offsetRange.js';\nimport { LineRange } from '../../../../../../../common/core/ranges/lineRange.js';\nimport { HideUnchangedRegionsFeature } from '../../../../../../../browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js';\nimport { Codicon } from '../../../../../../../../base/common/codicons.js';\nimport { renderIcon } from '../../../../../../../../base/browser/ui/iconLabel/iconLabels.js';\nimport { SymbolKinds } from '../../../../../../../common/languages.js';\nimport { debugLogRects, debugView } from '../debugVisualization.js';\nimport { distributeFlexBoxLayout } from '../../utils/flexBoxLayout.js';\nimport { Point } from '../../../../../../../common/core/2d/point.js';\nimport { Size2D } from '../../../../../../../common/core/2d/size.js';\nimport { getMaxTowerHeightInAvailableArea } from '../../utils/towersLayout.js';\nimport { IThemeService } from '../../../../../../../../platform/theme/common/themeService.js';\nimport { IKeybindingService } from '../../../../../../../../platform/keybinding/common/keybinding.js';\nimport { getEditorBlendedColor, inlineEditIndicatorPrimaryBackground, inlineEditIndicatorSecondaryBackground, inlineEditIndicatorsuccessfulBackground } from '../../theme.js';\nimport { asCssVariable, descriptionForeground, editorBackground, editorWidgetBackground } from '../../../../../../../../platform/theme/common/colorRegistry.js';\nimport { ILongDistancePreviewProps, LongDistancePreviewEditor } from './longDistancePreviewEditor.js';\nimport { InlineSuggestionGutterMenuData, SimpleInlineSuggestModel } from '../../components/gutterIndicatorView.js';\nimport { jumpToNextInlineEditId } from '../../../../controller/commandIds.js';\n\nconst BORDER_RADIUS = 4;\nconst MAX_WIDGET_WIDTH = { EMPTY_SPACE: 425, OVERLAY: 375 };\nconst MIN_WIDGET_WIDTH = 250;\n\nexport class InlineEditsLongDistanceHint extends Disposable implements IInlineEditsView {\n\n\tprivate readonly _editorObs;\n\treadonly onDidClick = Event.None;\n\tprivate _viewWithElement: ObserverNodeWithElement<HTMLDivElement> | undefined = undefined;\n\n\tprivate readonly _previewEditor;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _viewState: IObservable<ILongDistanceViewState | undefined>,\n\t\tprivate readonly _previewTextModel: ITextModel,\n\t\tprivate readonly _tabAction: IObservable<InlineEditTabAction>,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IThemeService private readonly _themeService: IThemeService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t) {\n\t\tsuper();\n\n\t\tthis._styles = this._tabAction.map((v, reader) => {\n\t\t\tlet border;\n\t\t\tswitch (v) {\n\t\t\t\tcase InlineEditTabAction.Inactive: border = inlineEditIndicatorSecondaryBackground; break;\n\t\t\t\tcase InlineEditTabAction.Jump: border = inlineEditIndicatorPrimaryBackground; break;\n\t\t\t\tcase InlineEditTabAction.Accept: border = inlineEditIndicatorsuccessfulBackground; break;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tborder: getEditorBlendedColor(border, this._themeService).read(reader).toString(),\n\t\t\t\tbackground: asCssVariable(editorBackground)\n\t\t\t};\n\t\t});\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tthis._previewEditor = this._register(\n\t\t\tthis._instantiationService.createInstance(\n\t\t\t\tLongDistancePreviewEditor,\n\t\t\t\tthis._previewTextModel,\n\t\t\t\tderived(reader => {\n\t\t\t\t\tconst viewState = this._viewState.read(reader);\n\t\t\t\t\tif (!viewState) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdiff: viewState.diff,\n\t\t\t\t\t\tmodel: viewState.model,\n\t\t\t\t\t\tsuggestInfo: viewState.suggestInfo,\n\t\t\t\t\t} satisfies ILongDistancePreviewProps;\n\t\t\t\t}),\n\t\t\t\tthis._editor,\n\t\t\t\tthis._tabAction,\n\t\t\t)\n\t\t);\n\n\t\tthis._viewWithElement = this._view.keepUpdated(this._store);\n\t\tthis._register(this._editorObs.createOverlayWidget({\n\t\t\tdomNode: this._viewWithElement.element,\n\t\t\tposition: constObservable(null),\n\t\t\tallowEditorOverflow: false,\n\t\t\tminContentWidthInPx: constObservable(0),\n\t\t}));\n\n\t\tthis._widgetContent.get().keepUpdated(this._store);\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst layoutInfo = this._previewEditorLayoutInfo.read(reader);\n\t\t\tif (!layoutInfo) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._previewEditor.layout(layoutInfo.codeEditorSize.toDimension(), layoutInfo.desiredPreviewEditorScrollLeft);\n\t\t}));\n\n\t\tthis._isVisibleDelayed.recomputeInitiallyAndOnChange(this._store);\n\t}\n\n\tprivate readonly _styles;\n\n\tpublic get isHovered() { return this._widgetContent.get().didMouseMoveDuringHover; }\n\n\tprivate readonly _hintTextPosition = derived(this, (reader) => {\n\t\tconst viewState = this._viewState.read(reader);\n\t\treturn viewState ? new Position(viewState.hint.lineNumber, Number.MAX_SAFE_INTEGER) : null;\n\t});\n\n\tprivate readonly _lineSizesAroundHintPosition = derived(this, (reader) => {\n\t\tconst viewState = this._viewState.read(reader);\n\t\tconst p = this._hintTextPosition.read(reader);\n\t\tif (!viewState || !p) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst model = this._editorObs.model.read(reader);\n\t\tif (!model) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst range = LineRange.ofLength(p.lineNumber, 1).addMargin(5, 5).intersect(LineRange.ofLength(1, model.getLineCount()));\n\n\t\tif (!range) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst sizes = getContentSizeOfLines(this._editorObs, range, reader);\n\t\tconst top = this._editorObs.observeTopForLineNumber(range.startLineNumber).read(reader);\n\n\t\treturn {\n\t\t\tlineRange: range,\n\t\t\ttop: top,\n\t\t\tsizes: sizes,\n\t\t};\n\t});\n\n\tprivate readonly _isVisibleDelayed = debouncedObservable2(\n\t\tderived(this, reader => this._viewState.read(reader)?.hint.isVisible),\n\t\t(lastValue, newValue) => lastValue === true && newValue === false ? 200 : 0,\n\t);\n\n\tprivate readonly _previewEditorLayoutInfo = derived(this, (reader) => {\n\t\tconst viewState = this._viewState.read(reader);\n\n\t\tif (!viewState || !this._isVisibleDelayed.read(reader)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst lineSizes = this._lineSizesAroundHintPosition.read(reader);\n\t\tif (!lineSizes) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst editorScrollTop = this._editorObs.scrollTop.read(reader);\n\t\tconst editorScrollLeft = this._editorObs.scrollLeft.read(reader);\n\t\tconst editorLayout = this._editorObs.layoutInfo.read(reader);\n\n\t\tconst previewContentHeight = this._previewEditor.contentHeight.read(reader);\n\t\tconst previewEditorContentLayout = this._previewEditor.horizontalContentRangeInPreviewEditorToShow.read(reader);\n\n\t\tif (!previewContentHeight || !previewEditorContentLayout) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// const debugRects = stackSizesDown(new Point(editorLayout.contentLeft, lineSizes.top - scrollTop), lineSizes.sizes);\n\n\t\tconst editorTrueContentWidth = editorLayout.contentWidth - editorLayout.verticalScrollbarWidth;\n\t\tconst editorTrueContentRight = editorLayout.contentLeft + editorTrueContentWidth;\n\n\t\t// drawEditorWidths(this._editor, reader);\n\n\t\tconst c = this._editorObs.cursorLineNumber.read(reader);\n\t\tif (!c) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst availableSpaceSizes = lineSizes.sizes.map((s, idx) => {\n\t\t\tconst lineNumber = lineSizes.lineRange.startLineNumber + idx;\n\t\t\tlet linePaddingLeft = 20;\n\t\t\tif (lineNumber === viewState.hint.lineNumber) {\n\t\t\t\tlinePaddingLeft = 40;\n\t\t\t}\n\t\t\treturn new Size2D(Math.max(0, editorTrueContentWidth - s.width - linePaddingLeft), s.height);\n\t\t});\n\n\t\tconst showRects = false;\n\t\tif (showRects) {\n\t\t\tconst rects2 = stackSizesDown(new Point(editorTrueContentRight, lineSizes.top - editorScrollTop), availableSpaceSizes, 'right');\n\t\t\tdebugView(debugLogRects({ ...rects2 }, this._editor.getDomNode()!), reader);\n\t\t}\n\n\t\tconst availableSpaceHeightPrefixSums = getSums(availableSpaceSizes, s => s.height);\n\t\tconst availableSpaceSizesTransposed = availableSpaceSizes.map(s => s.transpose());\n\n\t\tconst previewEditorMargin = 2;\n\t\tconst widgetPadding = 2;\n\t\tconst lowerBarHeight = 20;\n\t\tconst widgetBorder = 1;\n\n\t\tconst extraGutterMarginToAvoidScrollBar = 2;\n\t\tconst previewEditorHeight = previewContentHeight! + extraGutterMarginToAvoidScrollBar;\n\n\t\tfunction getWidgetVerticalOutline(lineNumber: number): OffsetRange {\n\t\t\tconst sizeIdx = lineNumber - lineSizes!.lineRange.startLineNumber;\n\t\t\tconst top = lineSizes!.top + availableSpaceHeightPrefixSums[sizeIdx];\n\t\t\tconst editorRange = OffsetRange.ofStartAndLength(top, previewEditorHeight);\n\t\t\tconst verticalWidgetRange = editorRange.withMargin(previewEditorMargin + widgetPadding + widgetBorder).withMargin(0, lowerBarHeight);\n\t\t\treturn verticalWidgetRange;\n\t\t}\n\n\t\tlet possibleWidgetOutline = findFirstMinimzeDistance(lineSizes.lineRange.addMargin(-1, -1), viewState.hint.lineNumber, lineNumber => {\n\t\t\tconst verticalWidgetRange = getWidgetVerticalOutline(lineNumber);\n\t\t\tconst maxWidth = getMaxTowerHeightInAvailableArea(verticalWidgetRange.delta(-lineSizes.top), availableSpaceSizesTransposed);\n\t\t\tif (maxWidth < MIN_WIDGET_WIDTH) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst horizontalWidgetRange = OffsetRange.ofStartAndLength(editorTrueContentRight - maxWidth, maxWidth);\n\t\t\treturn { horizontalWidgetRange, verticalWidgetRange };\n\t\t});\n\n\t\tlet position: 'overlay' | 'empty-space' = 'empty-space';\n\t\tif (!possibleWidgetOutline) {\n\t\t\tposition = 'overlay';\n\t\t\tconst maxAvailableWidth = Math.min(editorLayout.width - editorLayout.contentLeft, MAX_WIDGET_WIDTH.OVERLAY);\n\t\t\tpossibleWidgetOutline = {\n\t\t\t\thorizontalWidgetRange: OffsetRange.ofStartAndLength(editorTrueContentRight - maxAvailableWidth, maxAvailableWidth),\n\t\t\t\tverticalWidgetRange: getWidgetVerticalOutline(viewState.hint.lineNumber + 2).delta(10),\n\t\t\t};\n\t\t}\n\n\t\tif (!possibleWidgetOutline) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst rectAvailableSpace = Rect.fromRanges(\n\t\t\tpossibleWidgetOutline.horizontalWidgetRange,\n\t\t\tpossibleWidgetOutline.verticalWidgetRange\n\t\t).translateX(-editorScrollLeft).translateY(-editorScrollTop);\n\n\t\tconst showAvailableSpace = false;\n\t\tif (showAvailableSpace) {\n\t\t\tdebugView(debugLogRects({ rectAvailableSpace }, this._editor.getDomNode()!), reader);\n\t\t}\n\n\t\tconst maxWidgetWidth = Math.min(position === 'overlay' ? MAX_WIDGET_WIDTH.OVERLAY : MAX_WIDGET_WIDTH.EMPTY_SPACE, previewEditorContentLayout.maxEditorWidth + previewEditorMargin + widgetPadding);\n\n\t\tconst layout = distributeFlexBoxLayout(rectAvailableSpace.width, {\n\t\t\tspaceBefore: { min: 0, max: 10, priority: 1 },\n\t\t\tcontent: { min: 50, rules: [{ max: 150, priority: 2 }, { max: maxWidgetWidth, priority: 1 }] },\n\t\t\tspaceAfter: { min: 10 },\n\t\t});\n\n\t\tif (!layout) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst ranges = lengthsToOffsetRanges([layout.spaceBefore, layout.content, layout.spaceAfter], rectAvailableSpace.left);\n\t\tconst spaceBeforeRect = rectAvailableSpace.withHorizontalRange(ranges[0]);\n\t\tconst widgetRect = rectAvailableSpace.withHorizontalRange(ranges[1]);\n\t\tconst spaceAfterRect = rectAvailableSpace.withHorizontalRange(ranges[2]);\n\n\t\tconst showRects2 = false;\n\t\tif (showRects2) {\n\t\t\tdebugView(debugLogRects({ spaceBeforeRect, widgetRect, spaceAfterRect }, this._editor.getDomNode()!), reader);\n\t\t}\n\n\t\tconst previewEditorRect = widgetRect.withMargin(-widgetPadding - widgetBorder - previewEditorMargin).withMargin(0, 0, -lowerBarHeight, 0);\n\n\t\tconst showEditorRect = false;\n\t\tif (showEditorRect) {\n\t\t\tdebugView(debugLogRects({ previewEditorRect }, this._editor.getDomNode()!), reader);\n\t\t}\n\n\t\tconst previewEditorContentWidth = previewEditorRect.width - previewEditorContentLayout.nonContentWidth;\n\t\tconst maxPrefferedRangeLength = previewEditorContentWidth * 0.8;\n\t\tconst preferredRangeToReveal = previewEditorContentLayout.preferredRangeToReveal.intersect(OffsetRange.ofStartAndLength(\n\t\t\tpreviewEditorContentLayout.preferredRangeToReveal.start,\n\t\t\tmaxPrefferedRangeLength\n\t\t)) ?? previewEditorContentLayout.preferredRangeToReveal;\n\t\tconst desiredPreviewEditorScrollLeft = scrollToReveal(previewEditorContentLayout.indentationEnd, previewEditorContentWidth, preferredRangeToReveal);\n\n\t\treturn {\n\t\t\tcodeEditorSize: previewEditorRect.getSize(),\n\t\t\tcodeScrollLeft: editorScrollLeft,\n\t\t\tcontentLeft: editorLayout.contentLeft,\n\n\t\t\twidgetRect,\n\n\t\t\tpreviewEditorMargin,\n\t\t\twidgetPadding,\n\t\t\twidgetBorder,\n\n\t\t\tlowerBarHeight,\n\n\t\t\tdesiredPreviewEditorScrollLeft: desiredPreviewEditorScrollLeft.newScrollPosition,\n\t\t};\n\t});\n\n\tprivate readonly _view = n.div({\n\t\tclass: 'inline-edits-view',\n\t\tstyle: {\n\t\t\tposition: 'absolute',\n\t\t\toverflow: 'visible',\n\t\t\ttop: '0px',\n\t\t\tleft: '0px',\n\t\t\tdisplay: derived(this, reader => !!this._previewEditorLayoutInfo.read(reader) ? 'block' : 'none'),\n\t\t},\n\t}, [\n\t\tderived(this, _reader => [this._widgetContent]),\n\t]);\n\n\tprivate readonly _widgetContent = derived(this, reader => // TODO@hediet: remove when n.div lazily creates previewEditor.element node\n\t\tn.div({\n\t\t\tclass: 'inline-edits-long-distance-hint-widget',\n\t\t\tstyle: {\n\t\t\t\tposition: 'absolute',\n\t\t\t\toverflow: 'hidden',\n\t\t\t\tcursor: 'pointer',\n\t\t\t\tbackground: asCssVariable(editorWidgetBackground),\n\t\t\t\tpadding: this._previewEditorLayoutInfo.map(i => i?.widgetPadding),\n\t\t\t\tboxSizing: 'border-box',\n\t\t\t\tborderRadius: BORDER_RADIUS,\n\t\t\t\tborder: derived(reader => `${this._previewEditorLayoutInfo.read(reader)?.widgetBorder}px solid ${this._styles.read(reader).border}`),\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tflexDirection: 'column',\n\t\t\t\topacity: derived(reader => this._viewState.read(reader)?.hint.isVisible ? '1' : '0'),\n\t\t\t\ttransition: 'opacity 200ms ease-in-out',\n\t\t\t\t...rectToProps(reader => this._previewEditorLayoutInfo.read(reader)?.widgetRect)\n\t\t\t},\n\t\t\tonmousedown: e => {\n\t\t\t\te.preventDefault(); // This prevents that the editor loses focus\n\t\t\t},\n\t\t\tonclick: () => {\n\t\t\t\tthis._viewState.read(undefined)?.model.jump();\n\t\t\t}\n\t\t}, [\n\t\t\tn.div({\n\t\t\t\tclass: ['editorContainer'],\n\t\t\t\tstyle: {\n\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\tpadding: this._previewEditorLayoutInfo.map(i => i?.previewEditorMargin),\n\t\t\t\t\tbackground: asCssVariable(editorBackground),\n\t\t\t\t\tpointerEvents: 'none',\n\t\t\t\t},\n\t\t\t}, [\n\t\t\t\tderived(this, r => this._previewEditor.element), // --\n\t\t\t]),\n\t\t\tn.div({ class: 'bar', style: { color: asCssVariable(descriptionForeground), pointerEvents: 'none', margin: '0 4px', height: this._previewEditorLayoutInfo.map(i => i?.lowerBarHeight), display: 'flex', justifyContent: 'space-between', alignItems: 'center' } }, [\n\t\t\t\tderived(this, reader => {\n\t\t\t\t\tconst children: (HTMLElement | ObserverNode<HTMLDivElement>)[] = [];\n\t\t\t\t\tconst viewState = this._viewState.read(reader);\n\t\t\t\t\tif (!viewState) {\n\t\t\t\t\t\treturn children;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Outline Element\n\t\t\t\t\tconst source = this._originalOutlineSource.read(reader);\n\t\t\t\t\tconst outlineItems = source?.getAt(viewState.edit.lineEdit.lineRange.startLineNumber, reader).slice(0, 1) ?? [];\n\t\t\t\t\tconst outlineElements: ChildNode[] = [];\n\t\t\t\t\tif (outlineItems.length > 0) {\n\t\t\t\t\t\tfor (let i = 0; i < outlineItems.length; i++) {\n\t\t\t\t\t\t\tconst item = outlineItems[i];\n\t\t\t\t\t\t\tconst icon = SymbolKinds.toIcon(item.kind);\n\t\t\t\t\t\t\toutlineElements.push(n.div({\n\t\t\t\t\t\t\t\tclass: 'breadcrumb-item',\n\t\t\t\t\t\t\t\tstyle: { display: 'flex', alignItems: 'center', flex: '1 1 auto', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' },\n\t\t\t\t\t\t\t}, [\n\t\t\t\t\t\t\t\trenderIcon(icon),\n\t\t\t\t\t\t\t\t'\\u00a0',\n\t\t\t\t\t\t\t\titem.name,\n\t\t\t\t\t\t\t\t...(i === outlineItems.length - 1\n\t\t\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t\t\t: [renderIcon(Codicon.chevronRight)]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t]));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tchildren.push(n.div({ class: 'outline-elements', style: { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, outlineElements));\n\n\t\t\t\t\t// Show Edit Direction\n\t\t\t\t\tconst arrowIcon = isEditBelowHint(viewState) ? Codicon.arrowDown : Codicon.arrowUp;\n\t\t\t\t\tconst keybinding = this._keybindingService.lookupKeybinding(jumpToNextInlineEditId);\n\t\t\t\t\tlet label = 'Go to suggestion';\n\t\t\t\t\tif (keybinding && keybinding.getLabel() === 'Tab') {\n\t\t\t\t\t\tlabel = 'Tab to suggestion';\n\t\t\t\t\t}\n\t\t\t\t\tchildren.push(n.div({\n\t\t\t\t\t\tclass: 'go-to-label',\n\t\t\t\t\t\tstyle: { position: 'relative', display: 'flex', alignItems: 'center', flex: '0 0 auto', paddingLeft: '6px' },\n\t\t\t\t\t}, [\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t'\\u00a0',\n\t\t\t\t\t\trenderIcon(arrowIcon),\n\t\t\t\t\t]));\n\n\t\t\t\t\treturn children;\n\t\t\t\t})\n\t\t\t]),\n\t\t])\n\t);\n\n\tprivate readonly _originalOutlineSource = derivedDisposable(this, (reader) => {\n\t\tconst m = this._editorObs.model.read(reader);\n\t\tconst factory = HideUnchangedRegionsFeature._breadcrumbsSourceFactory.read(reader);\n\t\treturn (!m || !factory) ? undefined : factory(m, this._instantiationService);\n\t});\n}\n\nexport interface ILongDistanceHint {\n\tlineNumber: number;\n\tisVisible: boolean;\n}\n\nexport interface ILongDistanceViewState {\n\thint: ILongDistanceHint;\n\tnewTextLineCount: number;\n\tedit: InlineEditWithChanges;\n\tdiff: DetailedLineRangeMapping[];\n\n\tmodel: SimpleInlineSuggestModel;\n\tsuggestInfo: InlineSuggestionGutterMenuData;\n}\n\nfunction lengthsToOffsetRanges(lengths: number[], initialOffset = 0): OffsetRange[] {\n\tconst result: OffsetRange[] = [];\n\tlet offset = initialOffset;\n\tfor (const length of lengths) {\n\t\tresult.push(new OffsetRange(offset, offset + length));\n\t\toffset += length;\n\t}\n\treturn result;\n}\n\nfunction stackSizesDown(at: Point, sizes: Size2D[], alignment: 'left' | 'right' = 'left'): Rect[] {\n\tconst rects: Rect[] = [];\n\tlet offset = 0;\n\tfor (const s of sizes) {\n\t\trects.push(\n\t\t\tRect.fromLeftTopWidthHeight(\n\t\t\t\tat.x + (alignment === 'left' ? 0 : -s.width),\n\t\t\t\tat.y + offset,\n\t\t\t\ts.width,\n\t\t\t\ts.height\n\t\t\t)\n\t\t);\n\t\toffset += s.height;\n\t}\n\treturn rects;\n}\n\nfunction findFirstMinimzeDistance<T>(range: LineRange, targetLine: number, predicate: (lineNumber: number) => T | undefined): T | undefined {\n\tfor (let offset = 0; ; offset++) {\n\t\tconst down = targetLine + offset;\n\t\tif (down <= range.endLineNumberExclusive) {\n\t\t\tconst result = predicate(down);\n\t\t\tif (result !== undefined) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\tconst up = targetLine - offset;\n\t\tif (up >= range.startLineNumber) {\n\t\t\tconst result = predicate(up);\n\t\t\tif (result !== undefined) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\tif (up < range.startLineNumber && down > range.endLineNumberExclusive) {\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n\nfunction getSums<T>(array: T[], fn: (item: T) => number): number[] {\n\tconst result: number[] = [0];\n\tlet sum = 0;\n\tfor (const item of array) {\n\t\tsum += fn(item);\n\t\tresult.push(sum);\n\t}\n\treturn result;\n}\n\nfunction isEditBelowHint(viewState: ILongDistanceViewState): boolean {\n\tconst hintLineNumber = viewState.hint.lineNumber;\n\tconst editStartLineNumber = viewState.diff[0]?.original.startLineNumber;\n\treturn hintLineNumber < editStartLineNumber;\n}\n\n\n/**\n * Changes the scroll position as little as possible just to reveal the given range in the window.\n*/\nexport function scrollToReveal(currentScrollPosition: number, windowWidth: number, contentRangeToReveal: OffsetRange): { newScrollPosition: number } {\n\tconst visibleRange = new OffsetRange(currentScrollPosition, currentScrollPosition + windowWidth);\n\tif (visibleRange.containsRange(contentRangeToReveal)) {\n\t\treturn { newScrollPosition: currentScrollPosition };\n\t}\n\tif (contentRangeToReveal.length > windowWidth) {\n\t\treturn { newScrollPosition: contentRangeToReveal.start };\n\t}\n\tif (contentRangeToReveal.endExclusive > visibleRange.endExclusive) {\n\t\treturn { newScrollPosition: contentRangeToReveal.endExclusive - windowWidth };\n\t}\n\tif (contentRangeToReveal.start < visibleRange.start) {\n\t\treturn { newScrollPosition: contentRangeToReveal.start };\n\t}\n\treturn { newScrollPosition: currentScrollPosition };\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 *--------------------------------------------------------------------------------------------*/\nimport { ChildNode, n, ObserverNode, ObserverNodeWithElement } from '../../../../../../../../base/browser/dom.js';\nimport { Event } from '../../../../../../../../base/common/event.js';\nimport { Disposable } from '../../../../../../../../base/common/lifecycle.js';\nimport { IObservable, autorun, constObservable, debouncedObservable2, derived, derivedDisposable } from '../../../../../../../../base/common/observable.js';\nimport { IInstantiationService } from '../../../../../../../../platform/instantiation/common/instantiation.js';\nimport { ICodeEditor } from '../../../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../../../../browser/observableCodeEditor.js';\nimport { Rect } from '../../../../../../../common/core/2d/rect.js';\nimport { Position } from '../../../../../../../common/core/position.js';\nimport { ITextModel } from '../../../../../../../common/model.js';\nimport { IInlineEditsView, InlineEditTabAction } from '../../inlineEditsViewInterface.js';\nimport { InlineEditWithChanges } from '../../inlineEditWithChanges.js';\nimport { getContentSizeOfLines, rectToProps } from '../../utils/utils.js';\nimport { DetailedLineRangeMapping } from '../../../../../../../common/diff/rangeMapping.js';\nimport { OffsetRange } from '../../../../../../../common/core/ranges/offsetRange.js';\nimport { LineRange } from '../../../../../../../common/core/ranges/lineRange.js';\nimport { HideUnchangedRegionsFeature } from '../../../../../../../browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js';\nimport { Codicon } from '../../../../../../../../base/common/codicons.js';\nimport { renderIcon } from '../../../../../../../../base/browser/ui/iconLabel/iconLabels.js';\nimport { SymbolKinds } from '../../../../../../../common/languages.js';\nimport { debugLogRects, debugView } from '../debugVisualization.js';\nimport { distributeFlexBoxLayout } from '../../utils/flexBoxLayout.js';\nimport { Point } from '../../../../../../../common/core/2d/point.js';\nimport { Size2D } from '../../../../../../../common/core/2d/size.js';\nimport { getMaxTowerHeightInAvailableArea } from '../../utils/towersLayout.js';\nimport { IThemeService } from '../../../../../../../../platform/theme/common/themeService.js';\nimport { IKeybindingService } from '../../../../../../../../platform/keybinding/common/keybinding.js';\nimport { getEditorBlendedColor, inlineEditIndicatorPrimaryBackground, inlineEditIndicatorSecondaryBackground, inlineEditIndicatorsuccessfulBackground } from '../../theme.js';\nimport { asCssVariable, descriptionForeground, editorBackground, editorWidgetBackground } from '../../../../../../../../platform/theme/common/colorRegistry.js';\nimport { ILongDistancePreviewProps, LongDistancePreviewEditor } from './longDistancePreviewEditor.js';\nimport { InlineSuggestionGutterMenuData, SimpleInlineSuggestModel } from '../../components/gutterIndicatorView.js';\nimport { jumpToNextInlineEditId } from '../../../../controller/commandIds.js';\n\nconst BORDER_RADIUS = 4;\nconst MAX_WIDGET_WIDTH = { EMPTY_SPACE: 425, OVERLAY: 375 };\nconst MIN_WIDGET_WIDTH = 250;\n\nexport class InlineEditsLongDistanceHint extends Disposable implements IInlineEditsView {\n\n\tprivate readonly _editorObs;\n\treadonly onDidClick = Event.None;\n\tprivate _viewWithElement: ObserverNodeWithElement<HTMLDivElement> | undefined = undefined;\n\n\tprivate readonly _previewEditor;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _viewState: IObservable<ILongDistanceViewState | undefined>,\n\t\tprivate readonly _previewTextModel: ITextModel,\n\t\tprivate readonly _tabAction: IObservable<InlineEditTabAction>,\n\t\t@IInstantiationService private readonly _instantiationService: IInstantiationService,\n\t\t@IThemeService private readonly _themeService: IThemeService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t) {\n\t\tsuper();\n\n\t\tthis._styles = this._tabAction.map((v, reader) => {\n\t\t\tlet border;\n\t\t\tswitch (v) {\n\t\t\t\tcase InlineEditTabAction.Inactive: border = inlineEditIndicatorSecondaryBackground; break;\n\t\t\t\tcase InlineEditTabAction.Jump: border = inlineEditIndicatorPrimaryBackground; break;\n\t\t\t\tcase InlineEditTabAction.Accept: border = inlineEditIndicatorsuccessfulBackground; break;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tborder: getEditorBlendedColor(border, this._themeService).read(reader).toString(),\n\t\t\t\tbackground: asCssVariable(editorBackground)\n\t\t\t};\n\t\t});\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\n\t\tthis._previewEditor = this._register(\n\t\t\tthis._instantiationService.createInstance(\n\t\t\t\tLongDistancePreviewEditor,\n\t\t\t\tthis._previewTextModel,\n\t\t\t\tderived(reader => {\n\t\t\t\t\tconst viewState = this._viewState.read(reader);\n\t\t\t\t\tif (!viewState) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdiff: viewState.diff,\n\t\t\t\t\t\tmodel: viewState.model,\n\t\t\t\t\t\tsuggestInfo: viewState.suggestInfo,\n\t\t\t\t\t} satisfies ILongDistancePreviewProps;\n\t\t\t\t}),\n\t\t\t\tthis._editor,\n\t\t\t\tthis._tabAction,\n\t\t\t)\n\t\t);\n\n\t\tthis._viewWithElement = this._view.keepUpdated(this._store);\n\t\tthis._register(this._editorObs.createOverlayWidget({\n\t\t\tdomNode: this._viewWithElement.element,\n\t\t\tposition: constObservable(null),\n\t\t\tallowEditorOverflow: false,\n\t\t\tminContentWidthInPx: constObservable(0),\n\t\t}));\n\n\t\tthis._widgetContent.get().keepUpdated(this._store);\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst layoutInfo = this._previewEditorLayoutInfo.read(reader);\n\t\t\tif (!layoutInfo) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._previewEditor.layout(layoutInfo.codeEditorSize.toDimension(), layoutInfo.desiredPreviewEditorScrollLeft);\n\t\t}));\n\n\t\tthis._isVisibleDelayed.recomputeInitiallyAndOnChange(this._store);\n\t}\n\n\tprivate readonly _styles;\n\n\tpublic get isHovered() { return this._widgetContent.get().didMouseMoveDuringHover; }\n\n\tprivate readonly _hintTextPosition = derived(this, (reader) => {\n\t\tconst viewState = this._viewState.read(reader);\n\t\treturn viewState ? new Position(viewState.hint.lineNumber, Number.MAX_SAFE_INTEGER) : null;\n\t});\n\n\tprivate readonly _lineSizesAroundHintPosition = derived(this, (reader) => {\n\t\tconst viewState = this._viewState.read(reader);\n\t\tconst p = this._hintTextPosition.read(reader);\n\t\tif (!viewState || !p) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst model = this._editorObs.model.read(reader);\n\t\tif (!model) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst range = LineRange.ofLength(p.lineNumber, 1).addMargin(5, 5).intersect(LineRange.ofLength(1, model.getLineCount()));\n\n\t\tif (!range) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst sizes = getContentSizeOfLines(this._editorObs, range, reader);\n\t\tconst top = this._editorObs.observeTopForLineNumber(range.startLineNumber).read(reader);\n\n\t\treturn {\n\t\t\tlineRange: range,\n\t\t\ttop: top,\n\t\t\tsizes: sizes,\n\t\t};\n\t});\n\n\tprivate readonly _isVisibleDelayed = debouncedObservable2(\n\t\tderived(this, reader => this._viewState.read(reader)?.hint.isVisible),\n\t\t(lastValue, newValue) => lastValue === true && newValue === false ? 200 : 0,\n\t);\n\n\tprivate readonly _previewEditorLayoutInfo = derived(this, (reader) => {\n\t\tconst viewState = this._viewState.read(reader);\n\n\t\tif (!viewState || !this._isVisibleDelayed.read(reader)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst lineSizes = this._lineSizesAroundHintPosition.read(reader);\n\t\tif (!lineSizes) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst editorScrollTop = this._editorObs.scrollTop.read(reader);\n\t\tconst editorScrollLeft = this._editorObs.scrollLeft.read(reader);\n\t\tconst editorLayout = this._editorObs.layoutInfo.read(reader);\n\n\t\tconst previewContentHeight = this._previewEditor.contentHeight.read(reader);\n\t\tconst previewEditorContentLayout = this._previewEditor.horizontalContentRangeInPreviewEditorToShow.read(reader);\n\n\t\tif (!previewContentHeight || !previewEditorContentLayout) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// const debugRects = stackSizesDown(new Point(editorLayout.contentLeft, lineSizes.top - scrollTop), lineSizes.sizes);\n\n\t\tconst editorTrueContentWidth = editorLayout.contentWidth - editorLayout.verticalScrollbarWidth;\n\t\tconst editorTrueContentRight = editorLayout.contentLeft + editorTrueContentWidth;\n\n\t\t// drawEditorWidths(this._editor, reader);\n\n\t\tconst c = this._editorObs.cursorLineNumber.read(reader);\n\t\tif (!c) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst availableSpaceSizes = lineSizes.sizes.map((s, idx) => {\n\t\t\tconst lineNumber = lineSizes.lineRange.startLineNumber + idx;\n\t\t\tlet linePaddingLeft = 20;\n\t\t\tif (lineNumber === viewState.hint.lineNumber) {\n\t\t\t\tlinePaddingLeft = 40;\n\t\t\t}\n\t\t\treturn new Size2D(Math.max(0, editorTrueContentWidth - s.width - linePaddingLeft), s.height);\n\t\t});\n\n\t\tconst showRects = false;\n\t\tif (showRects) {\n\t\t\tconst rects2 = stackSizesDown(new Point(editorTrueContentRight, lineSizes.top - editorScrollTop), availableSpaceSizes, 'right');\n\t\t\tdebugView(debugLogRects({ ...rects2 }, this._editor.getDomNode()!), reader);\n\t\t}\n\n\t\tconst availableSpaceHeightPrefixSums = getSums(availableSpaceSizes, s => s.height);\n\t\tconst availableSpaceSizesTransposed = availableSpaceSizes.map(s => s.transpose());\n\n\t\tconst previewEditorMargin = 2;\n\t\tconst widgetPadding = 2;\n\t\tconst lowerBarHeight = 20;\n\t\tconst widgetBorder = 1;\n\n\t\tconst extraGutterMarginToAvoidScrollBar = 2;\n\t\tconst previewEditorHeight = previewContentHeight! + extraGutterMarginToAvoidScrollBar;\n\n\t\tfunction getWidgetVerticalOutline(lineNumber: number): OffsetRange {\n\t\t\tconst sizeIdx = lineNumber - lineSizes!.lineRange.startLineNumber;\n\t\t\tconst top = lineSizes!.top + availableSpaceHeightPrefixSums[sizeIdx];\n\t\t\tconst editorRange = OffsetRange.ofStartAndLength(top, previewEditorHeight);\n\t\t\tconst verticalWidgetRange = editorRange.withMargin(previewEditorMargin + widgetPadding + widgetBorder).withMargin(0, lowerBarHeight);\n\t\t\treturn verticalWidgetRange;\n\t\t}\n\n\t\tlet possibleWidgetOutline = findFirstMinimzeDistance(lineSizes.lineRange.addMargin(-1, -1), viewState.hint.lineNumber, lineNumber => {\n\t\t\tconst verticalWidgetRange = getWidgetVerticalOutline(lineNumber);\n\t\t\tconst maxWidth = getMaxTowerHeightInAvailableArea(verticalWidgetRange.delta(-lineSizes.top), availableSpaceSizesTransposed);\n\t\t\tif (maxWidth < MIN_WIDGET_WIDTH) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst horizontalWidgetRange = OffsetRange.ofStartAndLength(editorTrueContentRight - maxWidth, maxWidth);\n\t\t\treturn { horizontalWidgetRange, verticalWidgetRange };\n\t\t});\n\n\t\tlet position: 'overlay' | 'empty-space' = 'empty-space';\n\t\tif (!possibleWidgetOutline) {\n\t\t\tposition = 'overlay';\n\t\t\tconst maxAvailableWidth = Math.min(editorLayout.width - editorLayout.contentLeft, MAX_WIDGET_WIDTH.OVERLAY);\n\t\t\tpossibleWidgetOutline = {\n\t\t\t\thorizontalWidgetRange: OffsetRange.ofStartAndLength(editorTrueContentRight - maxAvailableWidth, maxAvailableWidth),\n\t\t\t\tverticalWidgetRange: getWidgetVerticalOutline(viewState.hint.lineNumber + 2).delta(10),\n\t\t\t};\n\t\t}\n\n\t\tif (!possibleWidgetOutline) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst rectAvailableSpace = Rect.fromRanges(\n\t\t\tpossibleWidgetOutline.horizontalWidgetRange,\n\t\t\tpossibleWidgetOutline.verticalWidgetRange\n\t\t).translateX(-editorScrollLeft).translateY(-editorScrollTop);\n\n\t\tconst showAvailableSpace = false;\n\t\tif (showAvailableSpace) {\n\t\t\tdebugView(debugLogRects({ rectAvailableSpace }, this._editor.getDomNode()!), reader);\n\t\t}\n\n\t\tconst maxWidgetWidth = Math.min(position === 'overlay' ? MAX_WIDGET_WIDTH.OVERLAY : MAX_WIDGET_WIDTH.EMPTY_SPACE, previewEditorContentLayout.maxEditorWidth + previewEditorMargin + widgetPadding);\n\n\t\tconst layout = distributeFlexBoxLayout(rectAvailableSpace.width, {\n\t\t\tspaceBefore: { min: 0, max: 10, priority: 1 },\n\t\t\tcontent: { min: 50, rules: [{ max: 150, priority: 2 }, { max: maxWidgetWidth, priority: 1 }] },\n\t\t\tspaceAfter: { min: 10 },\n\t\t});\n\n\t\tif (!layout) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst ranges = lengthsToOffsetRanges([layout.spaceBefore, layout.content, layout.spaceAfter], rectAvailableSpace.left);\n\t\tconst spaceBeforeRect = rectAvailableSpace.withHorizontalRange(ranges[0]);\n\t\tconst widgetRect = rectAvailableSpace.withHorizontalRange(ranges[1]);\n\t\tconst spaceAfterRect = rectAvailableSpace.withHorizontalRange(ranges[2]);\n\n\t\tconst showRects2 = false;\n\t\tif (showRects2) {\n\t\t\tdebugView(debugLogRects({ spaceBeforeRect, widgetRect, spaceAfterRect }, this._editor.getDomNode()!), reader);\n\t\t}\n\n\t\tconst previewEditorRect = widgetRect.withMargin(-widgetPadding - widgetBorder - previewEditorMargin).withMargin(0, 0, -lowerBarHeight, 0);\n\n\t\tconst showEditorRect = false;\n\t\tif (showEditorRect) {\n\t\t\tdebugView(debugLogRects({ previewEditorRect }, this._editor.getDomNode()!), reader);\n\t\t}\n\n\t\tconst previewEditorContentWidth = previewEditorRect.width - previewEditorContentLayout.nonContentWidth;\n\t\tconst maxPrefferedRangeLength = previewEditorContentWidth * 0.8;\n\t\tconst preferredRangeToReveal = previewEditorContentLayout.preferredRangeToReveal.intersect(OffsetRange.ofStartAndLength(\n\t\t\tpreviewEditorContentLayout.preferredRangeToReveal.start,\n\t\t\tmaxPrefferedRangeLength\n\t\t)) ?? previewEditorContentLayout.preferredRangeToReveal;\n\t\tconst desiredPreviewEditorScrollLeft = scrollToReveal(previewEditorContentLayout.indentationEnd, previewEditorContentWidth, preferredRangeToReveal);\n\n\t\treturn {\n\t\t\tcodeEditorSize: previewEditorRect.getSize(),\n\t\t\tcodeScrollLeft: editorScrollLeft,\n\t\t\tcontentLeft: editorLayout.contentLeft,\n\n\t\t\twidgetRect,\n\n\t\t\tpreviewEditorMargin,\n\t\t\twidgetPadding,\n\t\t\twidgetBorder,\n\n\t\t\tlowerBarHeight,\n\n\t\t\tdesiredPreviewEditorScrollLeft: desiredPreviewEditorScrollLeft.newScrollPosition,\n\t\t};\n\t});\n\n\tprivate readonly _view = n.div({\n\t\tclass: 'inline-edits-view',\n\t\tstyle: {\n\t\t\tposition: 'absolute',\n\t\t\toverflow: 'visible',\n\t\t\ttop: '0px',\n\t\t\tleft: '0px',\n\t\t\tdisplay: derived(this, reader => !!this._previewEditorLayoutInfo.read(reader) ? 'block' : 'none'),\n\t\t},\n\t}, [\n\t\tderived(this, _reader => [this._widgetContent]),\n\t]);\n\n\tprivate readonly _widgetContent = derived(this, reader => // TODO@hediet: remove when n.div lazily creates previewEditor.element node\n\t\tn.div({\n\t\t\tclass: 'inline-edits-long-distance-hint-widget',\n\t\t\tstyle: {\n\t\t\t\tposition: 'absolute',\n\t\t\t\toverflow: 'hidden',\n\t\t\t\tcursor: 'pointer',\n\t\t\t\tbackground: asCssVariable(editorWidgetBackground),\n\t\t\t\tpadding: this._previewEditorLayoutInfo.map(i => i?.widgetPadding),\n\t\t\t\tboxSizing: 'border-box',\n\t\t\t\tborderRadius: BORDER_RADIUS,\n\t\t\t\tborder: derived(reader => `${this._previewEditorLayoutInfo.read(reader)?.widgetBorder}px solid ${this._styles.read(reader).border}`),\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tflexDirection: 'column',\n\t\t\t\topacity: derived(reader => this._viewState.read(reader)?.hint.isVisible ? '1' : '0'),\n\t\t\t\ttransition: 'opacity 200ms ease-in-out',\n\t\t\t\t...rectToProps(reader => this._previewEditorLayoutInfo.read(reader)?.widgetRect)\n\t\t\t},\n\t\t\tonmousedown: e => {\n\t\t\t\te.preventDefault(); // This prevents that the editor loses focus\n\t\t\t},\n\t\t\tonclick: () => {\n\t\t\t\tthis._viewState.read(undefined)?.model.jump();\n\t\t\t}\n\t\t}, [\n\t\t\tn.div({\n\t\t\t\tclass: ['editorContainer'],\n\t\t\t\tstyle: {\n\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\tpadding: this._previewEditorLayoutInfo.map(i => i?.previewEditorMargin),\n\t\t\t\t\tbackground: asCssVariable(editorBackground),\n\t\t\t\t\tpointerEvents: 'none',\n\t\t\t\t},\n\t\t\t}, [\n\t\t\t\tderived(this, r => this._previewEditor.element), // --\n\t\t\t]),\n\t\t\tn.div({ class: 'bar', style: { color: asCssVariable(descriptionForeground), pointerEvents: 'none', margin: '0 4px', height: this._previewEditorLayoutInfo.map(i => i?.lowerBarHeight), display: 'flex', justifyContent: 'space-between', alignItems: 'center' } }, [\n\t\t\t\tderived(this, reader => {\n\t\t\t\t\tconst children: (HTMLElement | ObserverNode<HTMLDivElement>)[] = [];\n\t\t\t\t\tconst viewState = this._viewState.read(reader);\n\t\t\t\t\tif (!viewState) {\n\t\t\t\t\t\treturn children;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Outline Element\n\t\t\t\t\tconst source = this._originalOutlineSource.read(reader);\n\t\t\t\t\tconst outlineItems = source?.getAt(viewState.edit.lineEdit.lineRange.startLineNumber, reader).slice(0, 1) ?? [];\n\t\t\t\t\tconst outlineElements: ChildNode[] = [];\n\t\t\t\t\tif (outlineItems.length > 0) {\n\t\t\t\t\t\tfor (let i = 0; i < outlineItems.length; i++) {\n\t\t\t\t\t\t\tconst item = outlineItems[i];\n\t\t\t\t\t\t\tconst icon = SymbolKinds.toIcon(item.kind);\n\t\t\t\t\t\t\toutlineElements.push(n.div({\n\t\t\t\t\t\t\t\tclass: 'breadcrumb-item',\n\t\t\t\t\t\t\t\tstyle: { display: 'flex', alignItems: 'center', flex: '1 1 auto', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' },\n\t\t\t\t\t\t\t}, [\n\t\t\t\t\t\t\t\trenderIcon(icon),\n\t\t\t\t\t\t\t\t'\\u00a0',\n\t\t\t\t\t\t\t\titem.name,\n\t\t\t\t\t\t\t\t...(i === outlineItems.length - 1\n\t\t\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t\t\t: [renderIcon(Codicon.chevronRight)]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t]));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tchildren.push(n.div({ class: 'outline-elements', style: { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, outlineElements));\n\n\t\t\t\t\t// Show Edit Direction\n\t\t\t\t\tconst arrowIcon = isEditBelowHint(viewState) ? Codicon.arrowDown : Codicon.arrowUp;\n\t\t\t\t\tconst keybinding = this._keybindingService.lookupKeybinding(jumpToNextInlineEditId);\n\t\t\t\t\tlet label = 'Go to suggestion';\n\t\t\t\t\tif (keybinding && keybinding.getLabel() === 'Tab') {\n\t\t\t\t\t\tlabel = 'Tab to suggestion';\n\t\t\t\t\t}\n\t\t\t\t\tchildren.push(n.div({\n\t\t\t\t\t\tclass: 'go-to-label',\n\t\t\t\t\t\tstyle: { position: 'relative', display: 'flex', alignItems: 'center', flex: '0 0 auto', paddingLeft: '6px' },\n\t\t\t\t\t}, [\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t'\\u00a0',\n\t\t\t\t\t\trenderIcon(arrowIcon),\n\t\t\t\t\t]));\n\n\t\t\t\t\treturn children;\n\t\t\t\t})\n\t\t\t]),\n\t\t])\n\t);\n\n\tprivate readonly _originalOutlineSource = derivedDisposable(this, (reader) => {\n\t\tconst m = this._editorObs.model.read(reader);\n\t\tconst factory = HideUnchangedRegionsFeature._breadcrumbsSourceFactory.read(reader);\n\t\treturn (!m || !factory) ? undefined : factory(m, this._instantiationService);\n\t});\n}\n\nexport interface ILongDistanceHint {\n\tlineNumber: number;\n\tisVisible: boolean;\n}\n\nexport interface ILongDistanceViewState {\n\thint: ILongDistanceHint;\n\tnewTextLineCount: number;\n\tedit: InlineEditWithChanges;\n\tdiff: DetailedLineRangeMapping[];\n\n\tmodel: SimpleInlineSuggestModel;\n\tsuggestInfo: InlineSuggestionGutterMenuData;\n}\n\nfunction lengthsToOffsetRanges(lengths: number[], initialOffset = 0): OffsetRange[] {\n\tconst result: OffsetRange[] = [];\n\tlet offset = initialOffset;\n\tfor (const length of lengths) {\n\t\tresult.push(new OffsetRange(offset, offset + length));\n\t\toffset += length;\n\t}\n\treturn result;\n}\n\nfunction stackSizesDown(at: Point, sizes: Size2D[], alignment: 'left' | 'right' = 'left'): Rect[] {\n\tconst rects: Rect[] = [];\n\tlet offset = 0;\n\tfor (const s of sizes) {\n\t\trects.push(\n\t\t\tRect.fromLeftTopWidthHeight(\n\t\t\t\tat.x + (alignment === 'left' ? 0 : -s.width),\n\t\t\t\tat.y + offset,\n\t\t\t\ts.width,\n\t\t\t\ts.height\n\t\t\t)\n\t\t);\n\t\toffset += s.height;\n\t}\n\treturn rects;\n}\n\nfunction findFirstMinimzeDistance<T>(range: LineRange, targetLine: number, predicate: (lineNumber: number) => T | undefined): T | undefined {\n\tfor (let offset = 0; ; offset++) {\n\t\tconst down = targetLine + offset;\n\t\tif (down <= range.endLineNumberExclusive) {\n\t\t\tconst result = predicate(down);\n\t\t\tif (result !== undefined) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\tconst up = targetLine - offset;\n\t\tif (up >= range.startLineNumber) {\n\t\t\tconst result = predicate(up);\n\t\t\tif (result !== undefined) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\tif (up < range.startLineNumber && down > range.endLineNumberExclusive) {\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n\nfunction getSums<T>(array: T[], fn: (item: T) => number): number[] {\n\tconst result: number[] = [0];\n\tlet sum = 0;\n\tfor (const item of array) {\n\t\tsum += fn(item);\n\t\tresult.push(sum);\n\t}\n\treturn result;\n}\n\nfunction isEditBelowHint(viewState: ILongDistanceViewState): boolean {\n\tconst hintLineNumber = viewState.hint.lineNumber;\n\tconst editStartLineNumber = viewState.diff[0]?.original.startLineNumber;\n\treturn hintLineNumber < editStartLineNumber;\n}\n\n\n/**\n * Changes the scroll position as little as possible just to reveal the given range in the window.\n*/\nexport function scrollToReveal(currentScrollPosition: number, windowWidth: number, contentRangeToReveal: OffsetRange): { newScrollPosition: number } {\n\tconst visibleRange = new OffsetRange(currentScrollPosition, currentScrollPosition + windowWidth);\n\tif (visibleRange.containsRange(contentRangeToReveal)) {\n\t\treturn { newScrollPosition: currentScrollPosition };\n\t}\n\tif (contentRangeToReveal.length > windowWidth) {\n\t\treturn { newScrollPosition: contentRangeToReveal.start };\n\t}\n\tif (contentRangeToReveal.endExclusive > visibleRange.endExclusive) {\n\t\treturn { newScrollPosition: contentRangeToReveal.endExclusive - windowWidth };\n\t}\n\tif (contentRangeToReveal.start < visibleRange.start) {\n\t\treturn { newScrollPosition: contentRangeToReveal.start };\n\t}\n\treturn { newScrollPosition: currentScrollPosition };\n}\n"]}