monaco-editor-core 0.56.0-dev-20251125 → 0.56.0-dev-20251218

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 (410) 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 +34 -6
  18. package/esm/vs/base/browser/dom.js +1 -4
  19. package/esm/vs/base/browser/dom.js.map +1 -1
  20. package/esm/vs/base/browser/markdownRenderer.js +25 -11
  21. package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
  22. package/esm/vs/base/browser/ui/actionbar/actionViewItems.js.map +1 -1
  23. package/esm/vs/base/browser/ui/button/button.js +15 -8
  24. package/esm/vs/base/browser/ui/button/button.js.map +1 -1
  25. package/esm/vs/base/browser/ui/codicons/codicon/codicon-modifiers.css +3 -8
  26. package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  27. package/esm/vs/base/browser/ui/findinput/findInput.js +6 -1
  28. package/esm/vs/base/browser/ui/findinput/findInput.js.map +1 -1
  29. package/esm/vs/base/browser/ui/inputbox/inputBox.js +17 -1
  30. package/esm/vs/base/browser/ui/inputbox/inputBox.js.map +1 -1
  31. package/esm/vs/base/browser/ui/list/list.css +1 -0
  32. package/esm/vs/base/browser/ui/toggle/toggle.js +78 -6
  33. package/esm/vs/base/browser/ui/toggle/toggle.js.map +1 -1
  34. package/esm/vs/base/browser/ui/toolbar/toolbar.js +3 -0
  35. package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
  36. package/esm/vs/base/common/codiconsLibrary.js +11 -2
  37. package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
  38. package/esm/vs/base/common/defaultAccount.js +6 -0
  39. package/esm/vs/base/common/defaultAccount.js.map +1 -0
  40. package/esm/vs/base/common/equals.js +73 -24
  41. package/esm/vs/base/common/equals.js.map +1 -1
  42. package/esm/vs/base/common/event.js +14 -4
  43. package/esm/vs/base/common/event.js.map +1 -1
  44. package/esm/vs/base/common/iterator.js.map +1 -1
  45. package/esm/vs/base/common/keybindings.js +0 -8
  46. package/esm/vs/base/common/keybindings.js.map +1 -1
  47. package/esm/vs/base/common/lifecycle.js +2 -2
  48. package/esm/vs/base/common/lifecycle.js.map +1 -1
  49. package/esm/vs/base/common/marshallingIds.js.map +1 -1
  50. package/esm/vs/base/common/observableInternal/index.js +1 -1
  51. package/esm/vs/base/common/observableInternal/index.js.map +1 -1
  52. package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js +1 -1
  53. package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js.map +1 -1
  54. package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js +16 -0
  55. package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js.map +1 -1
  56. package/esm/vs/base/common/observableInternal/utils/utils.js +11 -0
  57. package/esm/vs/base/common/observableInternal/utils/utils.js.map +1 -1
  58. package/esm/vs/base/common/product.js.map +1 -1
  59. package/esm/vs/base/common/strings.js +3 -1
  60. package/esm/vs/base/common/strings.js.map +1 -1
  61. package/esm/vs/editor/browser/controller/dragScrolling.js +2 -1
  62. package/esm/vs/editor/browser/controller/dragScrolling.js.map +1 -1
  63. package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js +73 -2
  64. package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js.map +1 -1
  65. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +7 -51
  66. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
  67. package/esm/vs/editor/browser/controller/editContext/screenReaderUtils.js.map +1 -1
  68. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +7 -20
  69. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
  70. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js +14 -44
  71. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js.map +1 -1
  72. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextRegistry.js +19 -0
  73. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextRegistry.js.map +1 -0
  74. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.js +14 -1
  75. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.js.map +1 -1
  76. package/esm/vs/editor/browser/controller/mouseHandler.js +5 -2
  77. package/esm/vs/editor/browser/controller/mouseHandler.js.map +1 -1
  78. package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
  79. package/esm/vs/editor/browser/observableCodeEditor.js +32 -15
  80. package/esm/vs/editor/browser/observableCodeEditor.js.map +1 -1
  81. package/esm/vs/editor/browser/services/editorWorkerService.js +6 -2
  82. package/esm/vs/editor/browser/services/editorWorkerService.js.map +1 -1
  83. package/esm/vs/editor/browser/view.js +11 -2
  84. package/esm/vs/editor/browser/view.js.map +1 -1
  85. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +5 -2
  86. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
  87. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +10 -0
  88. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
  89. package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js.map +1 -1
  90. package/esm/vs/editor/browser/widget/multiDiffEditor/style.css +48 -0
  91. package/esm/vs/editor/common/config/editorConfigurationSchema.js +49 -47
  92. package/esm/vs/editor/common/config/editorConfigurationSchema.js.map +1 -1
  93. package/esm/vs/editor/common/config/editorOptions.js +410 -410
  94. package/esm/vs/editor/common/config/fontInfo.js +1 -1
  95. package/esm/vs/editor/common/config/fontInfo.js.map +1 -1
  96. package/esm/vs/editor/common/core/editorColorRegistry.js +69 -69
  97. package/esm/vs/editor/common/core/edits/edit.js +19 -0
  98. package/esm/vs/editor/common/core/edits/edit.js.map +1 -1
  99. package/esm/vs/editor/common/core/edits/stringEdit.js +13 -0
  100. package/esm/vs/editor/common/core/edits/stringEdit.js.map +1 -1
  101. package/esm/vs/editor/common/core/edits/textEdit.js +0 -3
  102. package/esm/vs/editor/common/core/edits/textEdit.js.map +1 -1
  103. package/esm/vs/editor/common/core/text/positionToOffsetImpl.js +24 -10
  104. package/esm/vs/editor/common/core/text/positionToOffsetImpl.js.map +1 -1
  105. package/esm/vs/editor/common/cursor/cursorMoveCommands.js +4 -4
  106. package/esm/vs/editor/common/cursor/cursorMoveCommands.js.map +1 -1
  107. package/esm/vs/editor/common/cursor/cursorWordOperations.js +6 -3
  108. package/esm/vs/editor/common/cursor/cursorWordOperations.js.map +1 -1
  109. package/esm/vs/editor/common/editorContextKeys.js +47 -47
  110. package/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js +2 -2
  111. package/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js.map +1 -1
  112. package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
  113. package/esm/vs/editor/common/languages/nullTokenize.js +1 -1
  114. package/esm/vs/editor/common/languages/nullTokenize.js.map +1 -1
  115. package/esm/vs/editor/common/languages/supports/tokenization.js +3 -0
  116. package/esm/vs/editor/common/languages/supports/tokenization.js.map +1 -1
  117. package/esm/vs/editor/common/languages.js +58 -57
  118. package/esm/vs/editor/common/languages.js.map +1 -1
  119. package/esm/vs/editor/common/model/decorationProvider.js +21 -1
  120. package/esm/vs/editor/common/model/decorationProvider.js.map +1 -1
  121. package/esm/vs/editor/common/model/editStack.js +1 -1
  122. package/esm/vs/editor/common/model/textModel.js +49 -30
  123. package/esm/vs/editor/common/model/textModel.js.map +1 -1
  124. package/esm/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.js +6 -3
  125. package/esm/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.js.map +1 -1
  126. package/esm/vs/editor/common/model/tokens/annotations.js +177 -0
  127. package/esm/vs/editor/common/model/tokens/annotations.js.map +1 -0
  128. package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js +131 -0
  129. package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js.map +1 -0
  130. package/esm/vs/editor/common/model/tokens/tokenizationTextModelPart.js +9 -0
  131. package/esm/vs/editor/common/model/tokens/tokenizationTextModelPart.js.map +1 -1
  132. package/esm/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.js +9 -0
  133. package/esm/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.js.map +1 -1
  134. package/esm/vs/editor/common/standaloneStrings.js +11 -11
  135. package/esm/vs/editor/common/textModelEditSource.js +2 -0
  136. package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
  137. package/esm/vs/editor/common/textModelEvents.js.map +1 -1
  138. package/esm/vs/editor/common/viewLayout/lineDecorations.js.map +1 -1
  139. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +3 -3
  140. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js.map +1 -1
  141. package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
  142. package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
  143. package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
  144. package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
  145. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +71 -53
  146. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
  147. package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
  148. package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
  149. package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
  150. package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
  151. package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
  152. package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
  153. package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
  154. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
  155. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
  156. package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +1 -1
  157. package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
  158. package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
  159. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +10 -10
  160. package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
  161. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
  162. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +23 -10
  163. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
  164. package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
  165. package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
  166. package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
  167. package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
  168. package/esm/vs/editor/contrib/find/browser/findController.js +16 -16
  169. package/esm/vs/editor/contrib/find/browser/findWidget.js +26 -26
  170. package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +1 -1
  171. package/esm/vs/editor/contrib/folding/browser/folding.js +20 -20
  172. package/esm/vs/editor/contrib/folding/browser/folding.js.map +1 -1
  173. package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
  174. package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
  175. package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
  176. package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
  177. package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
  178. package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
  179. package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
  180. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
  181. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
  182. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
  183. package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
  184. package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
  185. package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
  186. package/esm/vs/editor/contrib/hover/browser/hover.css +1 -1
  187. package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
  188. package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
  189. package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
  190. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +10 -10
  191. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
  192. package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
  193. package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
  194. package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
  195. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +1 -0
  196. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js.map +1 -1
  197. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
  198. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.js +1 -0
  199. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.js.map +1 -1
  200. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +50 -21
  201. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js.map +1 -1
  202. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -12
  203. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js.map +1 -1
  204. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +7 -1
  205. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js.map +1 -1
  206. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
  207. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
  208. package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js +2 -1
  209. package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js.map +1 -1
  210. package/esm/vs/editor/contrib/inlineCompletions/browser/model/InlineSuggestAlternativeAction.js +8 -0
  211. package/esm/vs/editor/contrib/inlineCompletions/browser/model/InlineSuggestAlternativeAction.js.map +1 -0
  212. package/esm/vs/editor/contrib/inlineCompletions/browser/model/editKind.js +198 -0
  213. package/esm/vs/editor/contrib/inlineCompletions/browser/model/editKind.js.map +1 -0
  214. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionIsVisible.js +40 -0
  215. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionIsVisible.js.map +1 -0
  216. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +128 -70
  217. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
  218. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +59 -11
  219. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
  220. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +152 -95
  221. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js.map +1 -1
  222. package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +113 -54
  223. package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js.map +1 -1
  224. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +317 -75
  225. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js.map +1 -1
  226. package/esm/vs/editor/contrib/inlineCompletions/browser/telemetry.js.map +1 -1
  227. package/esm/vs/editor/contrib/inlineCompletions/browser/utils.js +20 -0
  228. package/esm/vs/editor/contrib/inlineCompletions/browser/utils.js.map +1 -1
  229. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +59 -42
  230. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js.map +1 -1
  231. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +29 -8
  232. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js.map +1 -1
  233. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +78 -46
  234. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
  235. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js +9 -4
  236. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js.map +1 -1
  237. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +11 -4
  238. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js.map +1 -1
  239. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +81 -41
  240. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
  241. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js +48 -0
  242. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js.map +1 -1
  243. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +18 -15
  244. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js.map +1 -1
  245. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.js +3 -4
  246. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.js.map +1 -1
  247. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js +6 -7
  248. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js.map +1 -1
  249. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js +4 -5
  250. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js.map +1 -1
  251. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js +4 -3
  252. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js.map +1 -1
  253. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js +8 -8
  254. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js.map +1 -1
  255. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js +9 -7
  256. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js.map +1 -1
  257. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +203 -41
  258. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js.map +1 -1
  259. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/jumpToView.js +189 -0
  260. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/jumpToView.js.map +1 -0
  261. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js +85 -102
  262. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js.map +1 -1
  263. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js +75 -32
  264. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js.map +1 -1
  265. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistnaceWidgetPlacement.js +121 -0
  266. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistnaceWidgetPlacement.js.map +1 -0
  267. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js +2 -1
  268. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js.map +1 -1
  269. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +22 -20
  270. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js.map +1 -1
  271. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js +15 -5
  272. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js.map +1 -1
  273. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/view.css +39 -6
  274. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js +10 -5
  275. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js.map +1 -1
  276. package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
  277. package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
  278. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +32 -32
  279. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js.map +1 -1
  280. package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
  281. package/esm/vs/editor/contrib/links/browser/links.js +10 -10
  282. package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
  283. package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
  284. package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
  285. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
  286. package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
  287. package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
  288. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +25 -27
  289. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js.map +1 -1
  290. package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
  291. package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
  292. package/esm/vs/editor/contrib/rename/browser/rename.js +19 -15
  293. package/esm/vs/editor/contrib/rename/browser/rename.js.map +1 -1
  294. package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
  295. package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js +3 -2
  296. package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js.map +1 -1
  297. package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
  298. package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
  299. package/esm/vs/editor/contrib/snippet/browser/snippetParser.js +33 -0
  300. package/esm/vs/editor/contrib/snippet/browser/snippetParser.js.map +1 -1
  301. package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
  302. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  303. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +12 -4
  304. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js.map +1 -1
  305. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +1 -0
  306. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js.map +1 -1
  307. package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -8
  308. package/esm/vs/editor/contrib/suggest/browser/suggest.js.map +1 -1
  309. package/esm/vs/editor/contrib/suggest/browser/suggestController.js +39 -28
  310. package/esm/vs/editor/contrib/suggest/browser/suggestController.js.map +1 -1
  311. package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +1 -0
  312. package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js.map +1 -1
  313. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +22 -18
  314. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js.map +1 -1
  315. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +28 -6
  316. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js.map +1 -1
  317. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
  318. package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
  319. package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
  320. package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  321. package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  322. package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  323. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
  324. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
  325. package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  326. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
  327. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +19 -2
  328. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js.map +1 -1
  329. package/esm/vs/editor/editor.api.d.ts +34 -3
  330. package/esm/vs/editor/standalone/browser/standaloneLanguages.js +2 -2
  331. package/esm/vs/editor/standalone/browser/standaloneLanguages.js.map +1 -1
  332. package/esm/vs/editor/standalone/browser/standaloneServices.js +11 -1
  333. package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
  334. package/esm/vs/editor/standalone/common/monarch/monarchLexer.js +1 -1
  335. package/esm/vs/editor/standalone/common/monarch/monarchLexer.js.map +1 -1
  336. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
  337. package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
  338. package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
  339. package/esm/vs/platform/actionWidget/browser/actionWidget.css +11 -8
  340. package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
  341. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
  342. package/esm/vs/platform/actions/browser/toolbar.js +2 -2
  343. package/esm/vs/platform/actions/common/actions.js +11 -5
  344. package/esm/vs/platform/actions/common/actions.js.map +1 -1
  345. package/esm/vs/platform/actions/common/menuService.js +2 -2
  346. package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
  347. package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
  348. package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
  349. package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
  350. package/esm/vs/platform/contextkey/common/scanner.js +5 -5
  351. package/esm/vs/platform/{product/common/productService.js → defaultAccount/common/defaultAccount.js} +2 -2
  352. package/esm/vs/platform/defaultAccount/common/defaultAccount.js.map +1 -0
  353. package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  354. package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
  355. package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
  356. package/esm/vs/platform/instantiation/common/instantiation.js.map +1 -1
  357. package/esm/vs/platform/instantiation/common/instantiationService.js +1 -8
  358. package/esm/vs/platform/instantiation/common/instantiationService.js.map +1 -1
  359. package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
  360. package/esm/vs/platform/list/browser/listService.js +27 -27
  361. package/esm/vs/platform/log/common/log.js +1 -1
  362. package/esm/vs/platform/log/common/log.js.map +1 -1
  363. package/esm/vs/platform/markers/common/markerService.js +6 -6
  364. package/esm/vs/platform/markers/common/markerService.js.map +1 -1
  365. package/esm/vs/platform/markers/common/markers.js +6 -6
  366. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
  367. package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
  368. package/esm/vs/platform/quickinput/browser/media/quickInput.css +45 -7
  369. package/esm/vs/platform/quickinput/browser/quickInput.js +51 -15
  370. package/esm/vs/platform/quickinput/browser/quickInput.js.map +1 -1
  371. package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
  372. package/esm/vs/platform/quickinput/browser/quickInputBox.js +13 -1
  373. package/esm/vs/platform/quickinput/browser/quickInputBox.js.map +1 -1
  374. package/esm/vs/platform/quickinput/browser/quickInputController.js +22 -12
  375. package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
  376. package/esm/vs/platform/quickinput/browser/quickInputList.js +17 -12
  377. package/esm/vs/platform/quickinput/browser/quickInputList.js.map +1 -1
  378. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +36 -8
  379. package/esm/vs/platform/quickinput/browser/quickInputUtils.js.map +1 -1
  380. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
  381. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js +3 -3
  382. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js.map +1 -1
  383. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js +8 -4
  384. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js.map +1 -1
  385. package/esm/vs/platform/quickinput/common/quickInput.js.map +1 -1
  386. package/esm/vs/platform/theme/common/colorUtils.js +2 -2
  387. package/esm/vs/platform/theme/common/colors/baseColors.js +18 -17
  388. package/esm/vs/platform/theme/common/colors/baseColors.js.map +1 -1
  389. package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
  390. package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
  391. package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
  392. package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
  393. package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
  394. package/esm/vs/platform/theme/common/colors/minimapColors.js +13 -13
  395. package/esm/vs/platform/theme/common/colors/minimapColors.js.map +1 -1
  396. package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
  397. package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
  398. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  399. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  400. package/esm/vs/platform/undoRedo/common/undoRedoService.js +21 -21
  401. package/esm/vs/platform/undoRedo/common/undoRedoService.js.map +1 -1
  402. package/esm/vs/platform/window/common/window.js +1 -1
  403. package/esm/vs/platform/window/common/window.js.map +1 -1
  404. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  405. package/monaco.d.ts +34 -3
  406. package/package.json +2 -2
  407. package/version.txt +1 -1
  408. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js +0 -16
  409. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js.map +0 -1
  410. package/esm/vs/platform/product/common/productService.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.ts","vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,2DAA2D,CAAC;AACvF,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1H,OAAO,EAAe,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC3K,OAAO,KAAK,OAAO,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AA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aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACjC,MAAM,IAAI,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC;IACxB,MAAM,WAAW,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAChE,OAAO,CAAC,SAAS,GAAG,WAAqB,CAAC;AAC3C,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,wBAAwB,CAAC,iBAAiB,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC","file":"ghostTextView.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { createTrustedTypesPolicy } from '../../../../../../base/browser/trustedTypes.js';\nimport { renderIcon } from '../../../../../../base/browser/ui/iconLabel/iconLabels.js';\nimport { Codicon } from '../../../../../../base/common/codicons.js';\nimport { Emitter, Event } from '../../../../../../base/common/event.js';\nimport { Disposable, DisposableStore, MutableDisposable, toDisposable } from '../../../../../../base/common/lifecycle.js';\nimport { IObservable, autorun, autorunWithStore, constObservable, derived, observableSignalFromEvent, observableValue } from '../../../../../../base/common/observable.js';\nimport * as strings from '../../../../../../base/common/strings.js';\nimport { applyFontInfo } from '../../../../../browser/config/domFontInfo.js';\nimport { ContentWidgetPositionPreference, ICodeEditor, IContentWidgetPosition, IViewZoneChangeAccessor, MouseTargetType } from '../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../../browser/observableCodeEditor.js';\nimport { EditorFontLigatures, EditorOption, IComputedEditorOptions } from '../../../../../common/config/editorOptions.js';\nimport { StringEdit, StringReplacement } from '../../../../../common/core/edits/stringEdit.js';\nimport { Position } from '../../../../../common/core/position.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { StringBuilder } from '../../../../../common/core/stringBuilder.js';\nimport { IconPath, InlineCompletionWarning } from '../../../../../common/languages.js';\nimport { ILanguageService } from '../../../../../common/languages/language.js';\nimport { IModelDeltaDecoration, ITextModel, InjectedTextCursorStops, PositionAffinity } from '../../../../../common/model.js';\nimport { LineTokens } from '../../../../../common/tokens/lineTokens.js';\nimport { LineDecoration } from '../../../../../common/viewLayout/lineDecorations.js';\nimport { RenderLineInput, renderViewLine } from '../../../../../common/viewLayout/viewLineRenderer.js';\nimport { GhostText, GhostTextReplacement, IGhostTextLine } from '../../model/ghostText.js';\nimport { RangeSingleLine } from '../../../../../common/core/ranges/rangeSingleLine.js';\nimport { ColumnRange } from '../../../../../common/core/ranges/columnRange.js';\nimport { addDisposableListener, getWindow, isHTMLElement, n } from '../../../../../../base/browser/dom.js';\nimport './ghostTextView.css';\nimport { IMouseEvent, StandardMouseEvent } from '../../../../../../base/browser/mouseEvent.js';\nimport { CodeEditorWidget } from '../../../../../browser/widget/codeEditor/codeEditorWidget.js';\nimport { TokenWithTextArray } from '../../../../../common/tokens/tokenWithTextArray.js';\nimport { InlineCompletionViewData } from '../inlineEdits/inlineEditsViewInterface.js';\nimport { InlineDecorationType } from '../../../../../common/viewModel/inlineDecorations.js';\nimport { sum } from '../../../../../../base/common/arrays.js';\n\nexport interface IGhostTextWidgetData {\n\treadonly ghostText: GhostText | GhostTextReplacement;\n\treadonly warning: GhostTextWidgetWarning | undefined;\n\thandleInlineCompletionShown(viewData: InlineCompletionViewData): void;\n}\n\nexport class GhostTextWidgetWarning {\n\tpublic static from(warning: InlineCompletionWarning | undefined): GhostTextWidgetWarning | undefined {\n\t\tif (!warning) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new GhostTextWidgetWarning(warning.icon);\n\t}\n\n\tconstructor(\n\t\tpublic readonly icon: IconPath = Codicon.warning,\n\t) { }\n}\n\nconst USE_SQUIGGLES_FOR_WARNING = true;\nconst GHOST_TEXT_CLASS_NAME = 'ghost-text';\n\nexport class GhostTextView extends Disposable {\n\tprivate readonly _isDisposed = observableValue(this, false);\n\tprivate readonly _editorObs;\n\tprivate readonly _warningState = derived(reader => {\n\t\tconst model = this._data.read(reader);\n\t\tconst warning = model?.warning;\n\t\tif (!model || !warning) { return undefined; }\n\t\tconst gt = model.ghostText;\n\t\treturn { lineNumber: gt.lineNumber, position: new Position(gt.lineNumber, gt.parts[0].column), icon: warning.icon };\n\t});\n\n\tprivate readonly _onDidClick = this._register(new Emitter<IMouseEvent>());\n\tpublic readonly onDidClick = this._onDidClick.event;\n\n\tprivate readonly _extraClasses: readonly string[];\n\tprivate readonly _isClickable: boolean;\n\tprivate readonly _shouldKeepCursorStable: boolean;\n\tprivate readonly _minReservedLineCount: IObservable<number>;\n\tprivate readonly _useSyntaxHighlighting: IObservable<boolean>;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _data: IObservable<IGhostTextWidgetData | undefined>,\n\t\toptions: {\n\t\t\textraClasses?: readonly string[]; // TODO@benibenj improve\n\t\t\tisClickable?: boolean;\n\t\t\tshouldKeepCursorStable?: boolean;\n\t\t\tminReservedLineCount?: IObservable<number>;\n\t\t\tuseSyntaxHighlighting?: IObservable<boolean>;\n\t\t},\n\t\t@ILanguageService private readonly _languageService: ILanguageService\n\t) {\n\t\tsuper();\n\n\t\tthis._extraClasses = options.extraClasses ?? [];\n\t\tthis._isClickable = options.isClickable ?? false;\n\t\tthis._shouldKeepCursorStable = options.shouldKeepCursorStable ?? false;\n\t\tthis._minReservedLineCount = options.minReservedLineCount ?? constObservable(0);\n\t\tthis._useSyntaxHighlighting = options.useSyntaxHighlighting ?? constObservable(true);\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\t\tthis._additionalLinesWidget = this._register(\n\t\t\tnew AdditionalLinesWidget(\n\t\t\t\tthis._editor,\n\t\t\t\tderived(reader => {\n\t\t\t\t\t/** @description lines */\n\t\t\t\t\tconst uiState = this._state.read(reader);\n\t\t\t\t\treturn uiState ? {\n\t\t\t\t\t\tlineNumber: uiState.lineNumber,\n\t\t\t\t\t\tadditionalLines: uiState.additionalLines,\n\t\t\t\t\t\tminReservedLineCount: uiState.additionalReservedLineCount,\n\t\t\t\t\t} : undefined;\n\t\t\t\t}),\n\t\t\t\tthis._shouldKeepCursorStable,\n\t\t\t\tthis._isClickable\n\t\t\t)\n\t\t);\n\t\tthis._isInlineTextHovered = this._editorObs.isTargetHovered(\n\t\t\tp => p.target.type === MouseTargetType.CONTENT_TEXT &&\n\t\t\t\tp.target.detail.injectedText?.options.attachedData instanceof GhostTextAttachedData &&\n\t\t\t\tp.target.detail.injectedText.options.attachedData.owner === this,\n\t\t\tthis._store\n\t\t);\n\n\t\tthis._register(toDisposable(() => { this._isDisposed.set(true, undefined); }));\n\t\tthis._register(this._editorObs.setDecorations(this._decorations));\n\n\t\tif (this._isClickable) {\n\t\t\tthis._register(this._additionalLinesWidget.onDidClick((e) => this._onDidClick.fire(e)));\n\t\t\tthis._register(this._editor.onMouseUp(e => {\n\t\t\t\tif (e.target.type !== MouseTargetType.CONTENT_TEXT) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst a = e.target.detail.injectedText?.options.attachedData;\n\t\t\t\tif (a instanceof GhostTextAttachedData && a.owner === this) {\n\t\t\t\t\tthis._onDidClick.fire(e.event);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst state = this._state.read(reader);\n\t\t\tstate?.handleInlineCompletionShown(state.telemetryViewData);\n\t\t}));\n\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tif (USE_SQUIGGLES_FOR_WARNING) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst state = this._warningState.read(reader);\n\t\t\tif (!state) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst lineHeight = this._editorObs.getOption(EditorOption.lineHeight);\n\t\t\tstore.add(this._editorObs.createContentWidget({\n\t\t\t\tposition: constObservable<IContentWidgetPosition>({\n\t\t\t\t\tposition: new Position(state.lineNumber, Number.MAX_SAFE_INTEGER),\n\t\t\t\t\tpreference: [ContentWidgetPositionPreference.EXACT],\n\t\t\t\t\tpositionAffinity: PositionAffinity.Right,\n\t\t\t\t}),\n\t\t\t\tallowEditorOverflow: false,\n\t\t\t\tdomNode: n.div({\n\t\t\t\t\tclass: 'ghost-text-view-warning-widget',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\twidth: lineHeight,\n\t\t\t\t\t\theight: lineHeight,\n\t\t\t\t\t\tmarginLeft: 4,\n\t\t\t\t\t\tcolor: 'orange',\n\t\t\t\t\t},\n\t\t\t\t\tref: (dom) => {\n\t\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\t\t\t(dom as any as WidgetDomElement).ghostTextViewWarningWidgetData = { range: Range.fromPositions(state.position) };\n\t\t\t\t\t}\n\t\t\t\t}, [\n\t\t\t\t\tn.div({\n\t\t\t\t\t\tclass: 'ghost-text-view-warning-widget-icon',\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\talignContent: 'center',\n\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\t[renderIcon(state.icon)]\n\t\t\t\t\t)\n\t\t\t\t]).keepUpdated(store).element,\n\t\t\t}));\n\t\t}));\n\t}\n\n\tpublic static getWarningWidgetContext(domNode: HTMLElement): { range: Range } | undefined {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tconst data = (domNode as any as WidgetDomElement).ghostTextViewWarningWidgetData;\n\t\tif (data) {\n\t\t\treturn data;\n\t\t} else if (domNode.parentElement) {\n\t\t\treturn this.getWarningWidgetContext(domNode.parentElement);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate readonly _extraClassNames = derived(this, reader => {\n\t\tconst extraClasses = this._extraClasses.slice();\n\t\tif (this._useSyntaxHighlighting.read(reader)) {\n\t\t\textraClasses.push('syntax-highlighted');\n\t\t}\n\t\tif (USE_SQUIGGLES_FOR_WARNING && this._warningState.read(reader)) {\n\t\t\textraClasses.push('warning');\n\t\t}\n\t\tconst extraClassNames = extraClasses.map(c => ` ${c}`).join('');\n\t\treturn extraClassNames;\n\t});\n\n\tprivate readonly _state = derived(this, reader => {\n\t\tif (this._isDisposed.read(reader)) { return undefined; }\n\n\t\tconst props = this._data.read(reader);\n\t\tif (!props) { return undefined; }\n\n\t\tconst textModel = this._editorObs.model.read(reader);\n\t\tif (!textModel) { return undefined; }\n\n\t\tconst ghostText = props.ghostText;\n\t\tconst replacedRange = ghostText instanceof GhostTextReplacement ? ghostText.columnRange : undefined;\n\n\t\tconst syntaxHighlightingEnabled = this._useSyntaxHighlighting.read(reader);\n\t\tconst extraClassNames = this._extraClassNames.read(reader);\n\t\tconst { inlineTexts, additionalLines, hiddenRange, additionalLinesOriginalSuffix } = computeGhostTextViewData(ghostText, textModel, GHOST_TEXT_CLASS_NAME + extraClassNames);\n\n\t\tconst currentLine = textModel.getLineContent(ghostText.lineNumber);\n\t\tconst edit = new StringEdit(inlineTexts.map(t => StringReplacement.insert(t.column - 1, t.text)));\n\t\tconst tokens = syntaxHighlightingEnabled ? textModel.tokenization.tokenizeLinesAt(ghostText.lineNumber, [edit.apply(currentLine), ...additionalLines.map(l => l.content)]) : undefined;\n\t\tconst newRanges = edit.getNewRanges();\n\t\tconst inlineTextsWithTokens = inlineTexts.map((t, idx) => ({ ...t, tokens: tokens?.[0]?.getTokensInRange(newRanges[idx]) }));\n\n\t\tconst tokenizedAdditionalLines: LineData[] = additionalLines.map((l, idx) => {\n\t\t\tlet content = tokens?.[idx + 1] ?? LineTokens.createEmpty(l.content, this._languageService.languageIdCodec);\n\t\t\tif (idx === additionalLines.length - 1 && additionalLinesOriginalSuffix) {\n\t\t\t\tconst t = TokenWithTextArray.fromLineTokens(textModel.tokenization.getLineTokens(additionalLinesOriginalSuffix.lineNumber));\n\t\t\t\tconst existingContent = t.slice(additionalLinesOriginalSuffix.columnRange.toZeroBasedOffsetRange());\n\t\t\t\tcontent = TokenWithTextArray.fromLineTokens(content).append(existingContent).toLineTokens(content.languageIdCodec);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tcontent,\n\t\t\t\tdecorations: l.decorations,\n\t\t\t};\n\t\t});\n\n\t\tconst cursorColumn = this._editor.getSelection()?.getStartPosition().column!;\n\t\tconst disjointInlineTexts = inlineTextsWithTokens.filter(inline => inline.text !== '');\n\t\tconst hasInsertionOnCurrentLine = disjointInlineTexts.length !== 0;\n\t\tconst telemetryViewData: InlineCompletionViewData = {\n\t\t\tcursorColumnDistance: (hasInsertionOnCurrentLine ? disjointInlineTexts[0].column : 1) - cursorColumn,\n\t\t\tcursorLineDistance: hasInsertionOnCurrentLine ? 0 : (additionalLines.findIndex(line => line.content !== '') + 1),\n\t\t\tlineCountOriginal: hasInsertionOnCurrentLine ? 1 : 0,\n\t\t\tlineCountModified: additionalLines.length + (hasInsertionOnCurrentLine ? 1 : 0),\n\t\t\tcharacterCountOriginal: 0,\n\t\t\tcharacterCountModified: sum(disjointInlineTexts.map(inline => inline.text.length)) + sum(tokenizedAdditionalLines.map(line => line.content.getTextLength())),\n\t\t\tdisjointReplacements: disjointInlineTexts.length + (additionalLines.length > 0 ? 1 : 0),\n\t\t\tsameShapeReplacements: disjointInlineTexts.length > 1 && tokenizedAdditionalLines.length === 0 ? disjointInlineTexts.every(inline => inline.text === disjointInlineTexts[0].text) : undefined,\n\t\t};\n\n\t\treturn {\n\t\t\treplacedRange,\n\t\t\tinlineTexts: inlineTextsWithTokens,\n\t\t\tadditionalLines: tokenizedAdditionalLines,\n\t\t\thiddenRange,\n\t\t\tlineNumber: ghostText.lineNumber,\n\t\t\tadditionalReservedLineCount: this._minReservedLineCount.read(reader),\n\t\t\ttargetTextModel: textModel,\n\t\t\tsyntaxHighlightingEnabled,\n\t\t\ttelemetryViewData,\n\t\t\thandleInlineCompletionShown: props.handleInlineCompletionShown,\n\t\t};\n\t});\n\n\tprivate readonly _decorations = derived(this, reader => {\n\t\tconst uiState = this._state.read(reader);\n\t\tif (!uiState) { return []; }\n\n\t\tconst decorations: IModelDeltaDecoration[] = [];\n\n\t\tconst extraClassNames = this._extraClassNames.read(reader);\n\n\t\tif (uiState.replacedRange) {\n\t\t\tdecorations.push({\n\t\t\t\trange: uiState.replacedRange.toRange(uiState.lineNumber),\n\t\t\t\toptions: { inlineClassName: 'inline-completion-text-to-replace' + extraClassNames, description: 'GhostTextReplacement' }\n\t\t\t});\n\t\t}\n\n\t\tif (uiState.hiddenRange) {\n\t\t\tdecorations.push({\n\t\t\t\trange: uiState.hiddenRange.toRange(uiState.lineNumber),\n\t\t\t\toptions: { inlineClassName: 'ghost-text-hidden', description: 'ghost-text-hidden', }\n\t\t\t});\n\t\t}\n\n\t\tfor (const p of uiState.inlineTexts) {\n\t\t\tdecorations.push({\n\t\t\t\trange: Range.fromPositions(new Position(uiState.lineNumber, p.column)),\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'ghost-text-decoration',\n\t\t\t\t\tafter: {\n\t\t\t\t\t\tcontent: p.text,\n\t\t\t\t\t\ttokens: p.tokens,\n\t\t\t\t\t\tinlineClassName: (p.preview ? 'ghost-text-decoration-preview' : 'ghost-text-decoration')\n\t\t\t\t\t\t\t+ (this._isClickable ? ' clickable' : '')\n\t\t\t\t\t\t\t+ extraClassNames\n\t\t\t\t\t\t\t+ p.lineDecorations.map(d => ' ' + d.className).join(' '), // TODO: take the ranges into account for line decorations\n\t\t\t\t\t\tcursorStops: InjectedTextCursorStops.Left,\n\t\t\t\t\t\tattachedData: new GhostTextAttachedData(this),\n\t\t\t\t\t},\n\t\t\t\t\tshowIfCollapsed: true,\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn decorations;\n\t});\n\n\tprivate readonly _additionalLinesWidget;\n\n\tprivate readonly _isInlineTextHovered;\n\n\tpublic readonly isHovered = derived(this, reader => {\n\t\tif (this._isDisposed.read(reader)) { return false; }\n\t\treturn this._isInlineTextHovered.read(reader) || this._additionalLinesWidget.isHovered.read(reader);\n\t});\n\n\tpublic readonly height = derived(this, reader => {\n\t\tconst lineHeight = this._editorObs.getOption(EditorOption.lineHeight).read(reader);\n\t\treturn lineHeight + (this._additionalLinesWidget.viewZoneHeight.read(reader) ?? 0);\n\t});\n\n\tpublic ownsViewZone(viewZoneId: string): boolean {\n\t\treturn this._additionalLinesWidget.viewZoneId === viewZoneId;\n\t}\n}\n\nclass GhostTextAttachedData {\n\tconstructor(public readonly owner: GhostTextView) { }\n}\n\ninterface WidgetDomElement {\n\tghostTextViewWarningWidgetData?: {\n\t\trange: Range;\n\t};\n}\n\nfunction computeGhostTextViewData(ghostText: GhostText | GhostTextReplacement, textModel: ITextModel, ghostTextClassName: string) {\n\tconst inlineTexts: { column: number; text: string; preview: boolean; lineDecorations: LineDecoration[] }[] = [];\n\tconst additionalLines: { content: string; decorations: LineDecoration[] }[] = [];\n\n\tfunction addToAdditionalLines(ghLines: readonly IGhostTextLine[], className: string | undefined) {\n\t\tif (additionalLines.length > 0) {\n\t\t\tconst lastLine = additionalLines[additionalLines.length - 1];\n\t\t\tif (className) {\n\t\t\t\tlastLine.decorations.push(new LineDecoration(\n\t\t\t\t\tlastLine.content.length + 1,\n\t\t\t\t\tlastLine.content.length + 1 + ghLines[0].line.length,\n\t\t\t\t\tclassName,\n\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t));\n\t\t\t}\n\t\t\tlastLine.content += ghLines[0].line;\n\n\t\t\tghLines = ghLines.slice(1);\n\t\t}\n\t\tfor (const ghLine of ghLines) {\n\t\t\tadditionalLines.push({\n\t\t\t\tcontent: ghLine.line,\n\t\t\t\tdecorations: className ? [new LineDecoration(\n\t\t\t\t\t1,\n\t\t\t\t\tghLine.line.length + 1,\n\t\t\t\t\tclassName,\n\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t), ...ghLine.lineDecorations] : [...ghLine.lineDecorations]\n\t\t\t});\n\t\t}\n\t}\n\n\tconst textBufferLine = textModel.getLineContent(ghostText.lineNumber);\n\n\tlet hiddenTextStartColumn: number | undefined = undefined;\n\tlet lastIdx = 0;\n\tfor (const part of ghostText.parts) {\n\t\tlet ghLines = part.lines;\n\t\tif (hiddenTextStartColumn === undefined) {\n\t\t\tinlineTexts.push({ column: part.column, text: ghLines[0].line, preview: part.preview, lineDecorations: ghLines[0].lineDecorations });\n\t\t\tghLines = ghLines.slice(1);\n\t\t} else {\n\t\t\taddToAdditionalLines([{ line: textBufferLine.substring(lastIdx, part.column - 1), lineDecorations: [] }], undefined);\n\t\t}\n\n\t\tif (ghLines.length > 0) {\n\t\t\taddToAdditionalLines(ghLines, ghostTextClassName);\n\t\t\tif (hiddenTextStartColumn === undefined && part.column <= textBufferLine.length) {\n\t\t\t\thiddenTextStartColumn = part.column;\n\t\t\t}\n\t\t}\n\n\t\tlastIdx = part.column - 1;\n\t}\n\tlet additionalLinesOriginalSuffix: RangeSingleLine | undefined = undefined;\n\tif (hiddenTextStartColumn !== undefined) {\n\t\tadditionalLinesOriginalSuffix = new RangeSingleLine(ghostText.lineNumber, new ColumnRange(lastIdx + 1, textBufferLine.length + 1));\n\t}\n\n\tconst hiddenRange = hiddenTextStartColumn !== undefined ? new ColumnRange(hiddenTextStartColumn, textBufferLine.length + 1) : undefined;\n\n\treturn {\n\t\tinlineTexts,\n\t\tadditionalLines,\n\t\thiddenRange,\n\t\tadditionalLinesOriginalSuffix,\n\t};\n}\n\nexport class AdditionalLinesWidget extends Disposable {\n\tprivate _viewZoneInfo: { viewZoneId: string; heightInLines: number; lineNumber: number } | undefined;\n\tpublic get viewZoneId(): string | undefined { return this._viewZoneInfo?.viewZoneId; }\n\n\tprivate _viewZoneHeight;\n\tpublic get viewZoneHeight(): IObservable<number | undefined> { return this._viewZoneHeight; }\n\n\tprivate readonly editorOptionsChanged;\n\n\tprivate readonly _onDidClick;\n\tpublic readonly onDidClick;\n\n\tprivate readonly _viewZoneListener;\n\n\treadonly isHovered;\n\n\tprivate hasBeenAccepted;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _lines: IObservable<{\n\t\t\tlineNumber: number;\n\t\t\tadditionalLines: LineData[];\n\t\t\tminReservedLineCount: number;\n\t\t} | undefined>,\n\t\tprivate readonly _shouldKeepCursorStable: boolean,\n\t\tprivate readonly _isClickable: boolean,\n\t) {\n\t\tsuper();\n\t\tthis._viewZoneHeight = observableValue<undefined | number>('viewZoneHeight', undefined);\n\t\tthis.editorOptionsChanged = observableSignalFromEvent('editorOptionChanged', Event.filter(\n\t\t\tthis._editor.onDidChangeConfiguration,\n\t\t\te => e.hasChanged(EditorOption.disableMonospaceOptimizations)\n\t\t\t\t|| e.hasChanged(EditorOption.stopRenderingLineAfter)\n\t\t\t\t|| e.hasChanged(EditorOption.renderWhitespace)\n\t\t\t\t|| e.hasChanged(EditorOption.renderControlCharacters)\n\t\t\t\t|| e.hasChanged(EditorOption.fontLigatures)\n\t\t\t\t|| e.hasChanged(EditorOption.fontInfo)\n\t\t\t\t|| e.hasChanged(EditorOption.lineHeight)\n\t\t));\n\t\tthis._onDidClick = this._register(new Emitter<IMouseEvent>());\n\t\tthis.onDidClick = this._onDidClick.event;\n\t\tthis._viewZoneListener = this._register(new MutableDisposable());\n\t\tthis.isHovered = observableCodeEditor(this._editor).isTargetHovered(\n\t\t\tp => isTargetGhostText(p.target.element),\n\t\t\tthis._store\n\t\t);\n\t\tthis.hasBeenAccepted = false;\n\n\t\tif (this._editor instanceof CodeEditorWidget && this._shouldKeepCursorStable) {\n\t\t\tthis._register(this._editor.onBeforeExecuteEdit(e => this.hasBeenAccepted = e.source === 'inlineSuggestion.accept'));\n\t\t}\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update view zone */\n\t\t\tconst lines = this._lines.read(reader);\n\t\t\tthis.editorOptionsChanged.read(reader);\n\n\t\t\tif (lines) {\n\t\t\t\tthis.hasBeenAccepted = false;\n\t\t\t\tthis.updateLines(lines.lineNumber, lines.additionalLines, lines.minReservedLineCount);\n\t\t\t} else {\n\t\t\t\tthis.clear();\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis.clear();\n\t}\n\n\tprivate clear(): void {\n\t\tthis._viewZoneListener.clear();\n\n\t\tthis._editor.changeViewZones((changeAccessor) => {\n\t\t\tthis.removeActiveViewZone(changeAccessor);\n\t\t});\n\t}\n\n\tprivate updateLines(lineNumber: number, additionalLines: LineData[], minReservedLineCount: number): void {\n\t\tconst textModel = this._editor.getModel();\n\t\tif (!textModel) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { tabSize } = textModel.getOptions();\n\n\t\tthis._editor.changeViewZones((changeAccessor) => {\n\t\t\tconst store = new DisposableStore();\n\n\t\t\tthis.removeActiveViewZone(changeAccessor);\n\n\t\t\tconst heightInLines = Math.max(additionalLines.length, minReservedLineCount);\n\t\t\tif (heightInLines > 0) {\n\t\t\t\tconst domNode = document.createElement('div');\n\t\t\t\trenderLines(domNode, tabSize, additionalLines, this._editor.getOptions(), this._isClickable);\n\n\t\t\t\tif (this._isClickable) {\n\t\t\t\t\tstore.add(addDisposableListener(domNode, 'mousedown', (e) => {\n\t\t\t\t\t\te.preventDefault(); // This prevents that the editor loses focus\n\t\t\t\t\t}));\n\t\t\t\t\tstore.add(addDisposableListener(domNode, 'click', (e) => {\n\t\t\t\t\t\tif (isTargetGhostText(e.target)) {\n\t\t\t\t\t\t\tthis._onDidClick.fire(new StandardMouseEvent(getWindow(e), e));\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t}\n\n\t\t\t\tthis.addViewZone(changeAccessor, lineNumber, heightInLines, domNode);\n\t\t\t}\n\n\t\t\tthis._viewZoneListener.value = store;\n\t\t});\n\t}\n\n\tprivate addViewZone(changeAccessor: IViewZoneChangeAccessor, afterLineNumber: number, heightInLines: number, domNode: HTMLElement): void {\n\t\tconst id = changeAccessor.addZone({\n\t\t\tafterLineNumber: afterLineNumber,\n\t\t\theightInLines: heightInLines,\n\t\t\tdomNode,\n\t\t\tafterColumnAffinity: PositionAffinity.Right,\n\t\t\tonComputedHeight: (height: number) => {\n\t\t\t\tthis._viewZoneHeight.set(height, undefined); // TODO: can a transaction be used to avoid flickering?\n\t\t\t}\n\t\t});\n\n\t\tthis.keepCursorStable(afterLineNumber, heightInLines);\n\n\t\tthis._viewZoneInfo = { viewZoneId: id, heightInLines, lineNumber: afterLineNumber };\n\t}\n\n\tprivate removeActiveViewZone(changeAccessor: IViewZoneChangeAccessor): void {\n\t\tif (this._viewZoneInfo) {\n\t\t\tchangeAccessor.removeZone(this._viewZoneInfo.viewZoneId);\n\n\t\t\tif (!this.hasBeenAccepted) {\n\t\t\t\tthis.keepCursorStable(this._viewZoneInfo.lineNumber, -this._viewZoneInfo.heightInLines);\n\t\t\t}\n\n\t\t\tthis._viewZoneInfo = undefined;\n\t\t\tthis._viewZoneHeight.set(undefined, undefined);\n\t\t}\n\t}\n\n\tprivate keepCursorStable(lineNumber: number, heightInLines: number): void {\n\t\tif (!this._shouldKeepCursorStable) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst cursorLineNumber = this._editor.getSelection()?.getStartPosition()?.lineNumber;\n\t\tif (cursorLineNumber !== undefined && lineNumber < cursorLineNumber) {\n\t\t\tthis._editor.setScrollTop(this._editor.getScrollTop() + heightInLines * this._editor.getOption(EditorOption.lineHeight));\n\t\t}\n\t}\n}\n\nfunction isTargetGhostText(target: EventTarget | null): boolean {\n\treturn isHTMLElement(target) && target.classList.contains(GHOST_TEXT_CLASS_NAME);\n}\n\nexport interface LineData {\n\tcontent: LineTokens; // Must not contain a linebreak!\n\tdecorations: LineDecoration[];\n}\n\nfunction renderLines(domNode: HTMLElement, tabSize: number, lines: LineData[], opts: IComputedEditorOptions, isClickable: boolean): void {\n\tconst disableMonospaceOptimizations = opts.get(EditorOption.disableMonospaceOptimizations);\n\tconst stopRenderingLineAfter = opts.get(EditorOption.stopRenderingLineAfter);\n\t// To avoid visual confusion, we don't want to render visible whitespace\n\tconst renderWhitespace = 'none';\n\tconst renderControlCharacters = opts.get(EditorOption.renderControlCharacters);\n\tconst fontLigatures = opts.get(EditorOption.fontLigatures);\n\tconst fontInfo = opts.get(EditorOption.fontInfo);\n\tconst lineHeight = opts.get(EditorOption.lineHeight);\n\n\tlet classNames = 'suggest-preview-text';\n\tif (isClickable) {\n\t\tclassNames += ' clickable';\n\t}\n\n\tconst sb = new StringBuilder(10000);\n\tsb.appendString(`<div class=\"${classNames}\">`);\n\n\tfor (let i = 0, len = lines.length; i < len; i++) {\n\t\tconst lineData = lines[i];\n\t\tconst lineTokens = lineData.content;\n\t\tsb.appendString('<div class=\"view-line');\n\t\tsb.appendString('\" style=\"top:');\n\t\tsb.appendString(String(i * lineHeight));\n\t\tsb.appendString('px;width:1000000px;\">');\n\n\t\tconst line = lineTokens.getLineContent();\n\t\tconst isBasicASCII = strings.isBasicASCII(line);\n\t\tconst containsRTL = strings.containsRTL(line);\n\n\t\trenderViewLine(new RenderLineInput(\n\t\t\t(fontInfo.isMonospace && !disableMonospaceOptimizations),\n\t\t\tfontInfo.canUseHalfwidthRightwardsArrow,\n\t\t\tline,\n\t\t\tfalse,\n\t\t\tisBasicASCII,\n\t\t\tcontainsRTL,\n\t\t\t0,\n\t\t\tlineTokens,\n\t\t\tlineData.decorations,\n\t\t\ttabSize,\n\t\t\t0,\n\t\t\tfontInfo.spaceWidth,\n\t\t\tfontInfo.middotWidth,\n\t\t\tfontInfo.wsmiddotWidth,\n\t\t\tstopRenderingLineAfter,\n\t\t\trenderWhitespace,\n\t\t\trenderControlCharacters,\n\t\t\tfontLigatures !== EditorFontLigatures.OFF,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\t0\n\t\t), sb);\n\n\t\tsb.appendString('</div>');\n\t}\n\tsb.appendString('</div>');\n\n\tapplyFontInfo(domNode, fontInfo);\n\tconst html = sb.build();\n\tconst trustedhtml = ttPolicy ? ttPolicy.createHTML(html) : html;\n\tdomNode.innerHTML = trustedhtml as string;\n}\n\nexport const ttPolicy = createTrustedTypesPolicy('editorGhostText', { createHTML: value => value });\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { createTrustedTypesPolicy } from '../../../../../../base/browser/trustedTypes.js';\nimport { renderIcon } from '../../../../../../base/browser/ui/iconLabel/iconLabels.js';\nimport { Codicon } from '../../../../../../base/common/codicons.js';\nimport { Emitter, Event } from '../../../../../../base/common/event.js';\nimport { Disposable, DisposableStore, MutableDisposable, toDisposable } from '../../../../../../base/common/lifecycle.js';\nimport { IObservable, autorun, autorunWithStore, constObservable, derived, observableSignalFromEvent, observableValue } from '../../../../../../base/common/observable.js';\nimport * as strings from '../../../../../../base/common/strings.js';\nimport { applyFontInfo } from '../../../../../browser/config/domFontInfo.js';\nimport { ContentWidgetPositionPreference, ICodeEditor, IContentWidgetPosition, IViewZoneChangeAccessor, MouseTargetType } from '../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../../browser/observableCodeEditor.js';\nimport { EditorFontLigatures, EditorOption, IComputedEditorOptions } from '../../../../../common/config/editorOptions.js';\nimport { StringEdit, StringReplacement } from '../../../../../common/core/edits/stringEdit.js';\nimport { Position } from '../../../../../common/core/position.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { StringBuilder } from '../../../../../common/core/stringBuilder.js';\nimport { IconPath, InlineCompletionWarning } from '../../../../../common/languages.js';\nimport { ILanguageService } from '../../../../../common/languages/language.js';\nimport { IModelDeltaDecoration, ITextModel, InjectedTextCursorStops, PositionAffinity } from '../../../../../common/model.js';\nimport { LineTokens } from '../../../../../common/tokens/lineTokens.js';\nimport { LineDecoration } from '../../../../../common/viewLayout/lineDecorations.js';\nimport { RenderLineInput, renderViewLine } from '../../../../../common/viewLayout/viewLineRenderer.js';\nimport { GhostText, GhostTextReplacement, IGhostTextLine } from '../../model/ghostText.js';\nimport { RangeSingleLine } from '../../../../../common/core/ranges/rangeSingleLine.js';\nimport { ColumnRange } from '../../../../../common/core/ranges/columnRange.js';\nimport { addDisposableListener, getWindow, isHTMLElement, n } from '../../../../../../base/browser/dom.js';\nimport './ghostTextView.css';\nimport { IMouseEvent, StandardMouseEvent } from '../../../../../../base/browser/mouseEvent.js';\nimport { CodeEditorWidget } from '../../../../../browser/widget/codeEditor/codeEditorWidget.js';\nimport { TokenWithTextArray } from '../../../../../common/tokens/tokenWithTextArray.js';\nimport { InlineCompletionViewData } from '../inlineEdits/inlineEditsViewInterface.js';\nimport { InlineDecorationType } from '../../../../../common/viewModel/inlineDecorations.js';\nimport { sum } from '../../../../../../base/common/arrays.js';\n\nexport interface IGhostTextWidgetData {\n\treadonly ghostText: GhostText | GhostTextReplacement;\n\treadonly warning: GhostTextWidgetWarning | undefined;\n\thandleInlineCompletionShown(viewData: InlineCompletionViewData): void;\n}\n\nexport class GhostTextWidgetWarning {\n\tpublic static from(warning: InlineCompletionWarning | undefined): GhostTextWidgetWarning | undefined {\n\t\tif (!warning) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new GhostTextWidgetWarning(warning.icon);\n\t}\n\n\tconstructor(\n\t\tpublic readonly icon: IconPath = Codicon.warning,\n\t) { }\n}\n\nconst USE_SQUIGGLES_FOR_WARNING = true;\nconst GHOST_TEXT_CLASS_NAME = 'ghost-text';\n\nexport class GhostTextView extends Disposable {\n\tprivate readonly _isDisposed = observableValue(this, false);\n\tprivate readonly _editorObs;\n\tprivate readonly _warningState = derived(reader => {\n\t\tconst model = this._data.read(reader);\n\t\tconst warning = model?.warning;\n\t\tif (!model || !warning) { return undefined; }\n\t\tconst gt = model.ghostText;\n\t\treturn { lineNumber: gt.lineNumber, position: new Position(gt.lineNumber, gt.parts[0].column), icon: warning.icon };\n\t});\n\n\tprivate readonly _onDidClick = this._register(new Emitter<IMouseEvent>());\n\tpublic readonly onDidClick = this._onDidClick.event;\n\n\tprivate readonly _extraClasses: readonly string[];\n\tprivate readonly _isClickable: boolean;\n\tprivate readonly _shouldKeepCursorStable: boolean;\n\tprivate readonly _minReservedLineCount: IObservable<number>;\n\tprivate readonly _useSyntaxHighlighting: IObservable<boolean>;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _data: IObservable<IGhostTextWidgetData | undefined>,\n\t\toptions: {\n\t\t\textraClasses?: readonly string[]; // TODO@benibenj improve\n\t\t\tisClickable?: boolean;\n\t\t\tshouldKeepCursorStable?: boolean;\n\t\t\tminReservedLineCount?: IObservable<number>;\n\t\t\tuseSyntaxHighlighting?: IObservable<boolean>;\n\t\t},\n\t\t@ILanguageService private readonly _languageService: ILanguageService\n\t) {\n\t\tsuper();\n\n\t\tthis._extraClasses = options.extraClasses ?? [];\n\t\tthis._isClickable = options.isClickable ?? false;\n\t\tthis._shouldKeepCursorStable = options.shouldKeepCursorStable ?? false;\n\t\tthis._minReservedLineCount = options.minReservedLineCount ?? constObservable(0);\n\t\tthis._useSyntaxHighlighting = options.useSyntaxHighlighting ?? constObservable(true);\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\t\tthis._additionalLinesWidget = this._register(\n\t\t\tnew AdditionalLinesWidget(\n\t\t\t\tthis._editor,\n\t\t\t\tderived(reader => {\n\t\t\t\t\t/** @description lines */\n\t\t\t\t\tconst uiState = this._state.read(reader);\n\t\t\t\t\treturn uiState ? {\n\t\t\t\t\t\tlineNumber: uiState.lineNumber,\n\t\t\t\t\t\tadditionalLines: uiState.additionalLines,\n\t\t\t\t\t\tminReservedLineCount: uiState.additionalReservedLineCount,\n\t\t\t\t\t} : undefined;\n\t\t\t\t}),\n\t\t\t\tthis._shouldKeepCursorStable,\n\t\t\t\tthis._isClickable\n\t\t\t)\n\t\t);\n\t\tthis._isInlineTextHovered = this._editorObs.isTargetHovered(\n\t\t\tp => p.target.type === MouseTargetType.CONTENT_TEXT &&\n\t\t\t\tp.target.detail.injectedText?.options.attachedData instanceof GhostTextAttachedData &&\n\t\t\t\tp.target.detail.injectedText.options.attachedData.owner === this,\n\t\t\tthis._store\n\t\t);\n\n\t\tthis._register(toDisposable(() => { this._isDisposed.set(true, undefined); }));\n\t\tthis._register(this._editorObs.setDecorations(this._decorations));\n\n\t\tif (this._isClickable) {\n\t\t\tthis._register(this._additionalLinesWidget.onDidClick((e) => this._onDidClick.fire(e)));\n\t\t\tthis._register(this._editor.onMouseUp(e => {\n\t\t\t\tif (e.target.type !== MouseTargetType.CONTENT_TEXT) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst a = e.target.detail.injectedText?.options.attachedData;\n\t\t\t\tif (a instanceof GhostTextAttachedData && a.owner === this) {\n\t\t\t\t\tthis._onDidClick.fire(e.event);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst state = this._state.read(reader);\n\t\t\tstate?.handleInlineCompletionShown(state.telemetryViewData);\n\t\t}));\n\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tif (USE_SQUIGGLES_FOR_WARNING) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst state = this._warningState.read(reader);\n\t\t\tif (!state) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst lineHeight = this._editorObs.getOption(EditorOption.lineHeight);\n\t\t\tstore.add(this._editorObs.createContentWidget({\n\t\t\t\tposition: constObservable<IContentWidgetPosition>({\n\t\t\t\t\tposition: new Position(state.lineNumber, Number.MAX_SAFE_INTEGER),\n\t\t\t\t\tpreference: [ContentWidgetPositionPreference.EXACT],\n\t\t\t\t\tpositionAffinity: PositionAffinity.Right,\n\t\t\t\t}),\n\t\t\t\tallowEditorOverflow: false,\n\t\t\t\tdomNode: n.div({\n\t\t\t\t\tclass: 'ghost-text-view-warning-widget',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\twidth: lineHeight,\n\t\t\t\t\t\theight: lineHeight,\n\t\t\t\t\t\tmarginLeft: 4,\n\t\t\t\t\t\tcolor: 'orange',\n\t\t\t\t\t},\n\t\t\t\t\tref: (dom) => {\n\t\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\t\t\t(dom as any as WidgetDomElement).ghostTextViewWarningWidgetData = { range: Range.fromPositions(state.position) };\n\t\t\t\t\t}\n\t\t\t\t}, [\n\t\t\t\t\tn.div({\n\t\t\t\t\t\tclass: 'ghost-text-view-warning-widget-icon',\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\talignContent: 'center',\n\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\t[renderIcon(state.icon)]\n\t\t\t\t\t)\n\t\t\t\t]).keepUpdated(store).element,\n\t\t\t}));\n\t\t}));\n\t}\n\n\tpublic static getWarningWidgetContext(domNode: HTMLElement): { range: Range } | undefined {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tconst data = (domNode as any as WidgetDomElement).ghostTextViewWarningWidgetData;\n\t\tif (data) {\n\t\t\treturn data;\n\t\t} else if (domNode.parentElement) {\n\t\t\treturn this.getWarningWidgetContext(domNode.parentElement);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate readonly _extraClassNames = derived(this, reader => {\n\t\tconst extraClasses = this._extraClasses.slice();\n\t\tif (this._useSyntaxHighlighting.read(reader)) {\n\t\t\textraClasses.push('syntax-highlighted');\n\t\t}\n\t\tif (USE_SQUIGGLES_FOR_WARNING && this._warningState.read(reader)) {\n\t\t\textraClasses.push('warning');\n\t\t}\n\t\tconst extraClassNames = extraClasses.map(c => ` ${c}`).join('');\n\t\treturn extraClassNames;\n\t});\n\n\tprivate readonly _state = derived(this, reader => {\n\t\tif (this._isDisposed.read(reader)) { return undefined; }\n\n\t\tconst props = this._data.read(reader);\n\t\tif (!props) { return undefined; }\n\n\t\tconst textModel = this._editorObs.model.read(reader);\n\t\tif (!textModel) { return undefined; }\n\n\t\tconst ghostText = props.ghostText;\n\t\tconst replacedRange = ghostText instanceof GhostTextReplacement ? ghostText.columnRange : undefined;\n\n\t\tconst syntaxHighlightingEnabled = this._useSyntaxHighlighting.read(reader);\n\t\tconst extraClassNames = this._extraClassNames.read(reader);\n\t\tconst { inlineTexts, additionalLines, hiddenRange, additionalLinesOriginalSuffix } = computeGhostTextViewData(ghostText, textModel, GHOST_TEXT_CLASS_NAME + extraClassNames);\n\n\t\tconst currentLine = textModel.getLineContent(ghostText.lineNumber);\n\t\tconst edit = new StringEdit(inlineTexts.map(t => StringReplacement.insert(t.column - 1, t.text)));\n\t\tconst tokens = syntaxHighlightingEnabled ? textModel.tokenization.tokenizeLinesAt(ghostText.lineNumber, [edit.apply(currentLine), ...additionalLines.map(l => l.content)]) : undefined;\n\t\tconst newRanges = edit.getNewRanges();\n\t\tconst inlineTextsWithTokens = inlineTexts.map((t, idx) => ({ ...t, tokens: tokens?.[0]?.getTokensInRange(newRanges[idx]) }));\n\n\t\tconst tokenizedAdditionalLines: LineData[] = additionalLines.map((l, idx) => {\n\t\t\tlet content = tokens?.[idx + 1] ?? LineTokens.createEmpty(l.content, this._languageService.languageIdCodec);\n\t\t\tif (idx === additionalLines.length - 1 && additionalLinesOriginalSuffix) {\n\t\t\t\tconst t = TokenWithTextArray.fromLineTokens(textModel.tokenization.getLineTokens(additionalLinesOriginalSuffix.lineNumber));\n\t\t\t\tconst existingContent = t.slice(additionalLinesOriginalSuffix.columnRange.toZeroBasedOffsetRange());\n\t\t\t\tcontent = TokenWithTextArray.fromLineTokens(content).append(existingContent).toLineTokens(content.languageIdCodec);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tcontent,\n\t\t\t\tdecorations: l.decorations,\n\t\t\t};\n\t\t});\n\n\t\tconst cursorColumn = this._editor.getSelection()?.getStartPosition().column!;\n\t\tconst disjointInlineTexts = inlineTextsWithTokens.filter(inline => inline.text !== '');\n\t\tconst hasInsertionOnCurrentLine = disjointInlineTexts.length !== 0;\n\t\tconst telemetryViewData: InlineCompletionViewData = {\n\t\t\tcursorColumnDistance: (hasInsertionOnCurrentLine ? disjointInlineTexts[0].column : 1) - cursorColumn,\n\t\t\tcursorLineDistance: hasInsertionOnCurrentLine ? 0 : (additionalLines.findIndex(line => line.content !== '') + 1),\n\t\t\tlineCountOriginal: hasInsertionOnCurrentLine ? 1 : 0,\n\t\t\tlineCountModified: additionalLines.length + (hasInsertionOnCurrentLine ? 1 : 0),\n\t\t\tcharacterCountOriginal: 0,\n\t\t\tcharacterCountModified: sum(disjointInlineTexts.map(inline => inline.text.length)) + sum(tokenizedAdditionalLines.map(line => line.content.getTextLength())),\n\t\t\tdisjointReplacements: disjointInlineTexts.length + (additionalLines.length > 0 ? 1 : 0),\n\t\t\tsameShapeReplacements: disjointInlineTexts.length > 1 && tokenizedAdditionalLines.length === 0 ? disjointInlineTexts.every(inline => inline.text === disjointInlineTexts[0].text) : undefined,\n\t\t};\n\n\t\treturn {\n\t\t\treplacedRange,\n\t\t\tinlineTexts: inlineTextsWithTokens,\n\t\t\tadditionalLines: tokenizedAdditionalLines,\n\t\t\thiddenRange,\n\t\t\tlineNumber: ghostText.lineNumber,\n\t\t\tadditionalReservedLineCount: this._minReservedLineCount.read(reader),\n\t\t\ttargetTextModel: textModel,\n\t\t\tsyntaxHighlightingEnabled,\n\t\t\ttelemetryViewData,\n\t\t\thandleInlineCompletionShown: props.handleInlineCompletionShown,\n\t\t};\n\t});\n\n\tprivate readonly _decorations = derived(this, reader => {\n\t\tconst uiState = this._state.read(reader);\n\t\tif (!uiState) { return []; }\n\n\t\tconst decorations: IModelDeltaDecoration[] = [];\n\n\t\tconst extraClassNames = this._extraClassNames.read(reader);\n\n\t\tif (uiState.replacedRange) {\n\t\t\tdecorations.push({\n\t\t\t\trange: uiState.replacedRange.toRange(uiState.lineNumber),\n\t\t\t\toptions: { inlineClassName: 'inline-completion-text-to-replace' + extraClassNames, description: 'GhostTextReplacement' }\n\t\t\t});\n\t\t}\n\n\t\tif (uiState.hiddenRange) {\n\t\t\tdecorations.push({\n\t\t\t\trange: uiState.hiddenRange.toRange(uiState.lineNumber),\n\t\t\t\toptions: { inlineClassName: 'ghost-text-hidden', description: 'ghost-text-hidden', }\n\t\t\t});\n\t\t}\n\n\t\tfor (const p of uiState.inlineTexts) {\n\t\t\tdecorations.push({\n\t\t\t\trange: Range.fromPositions(new Position(uiState.lineNumber, p.column)),\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'ghost-text-decoration',\n\t\t\t\t\tafter: {\n\t\t\t\t\t\tcontent: p.text,\n\t\t\t\t\t\ttokens: p.tokens,\n\t\t\t\t\t\tinlineClassName: (p.preview ? 'ghost-text-decoration-preview' : 'ghost-text-decoration')\n\t\t\t\t\t\t\t+ (this._isClickable ? ' clickable' : '')\n\t\t\t\t\t\t\t+ extraClassNames\n\t\t\t\t\t\t\t+ p.lineDecorations.map(d => ' ' + d.className).join(' '), // TODO: take the ranges into account for line decorations\n\t\t\t\t\t\tcursorStops: InjectedTextCursorStops.Left,\n\t\t\t\t\t\tattachedData: new GhostTextAttachedData(this),\n\t\t\t\t\t},\n\t\t\t\t\tshowIfCollapsed: true,\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn decorations;\n\t});\n\n\tprivate readonly _additionalLinesWidget;\n\n\tprivate readonly _isInlineTextHovered;\n\n\tpublic readonly isHovered = derived(this, reader => {\n\t\tif (this._isDisposed.read(reader)) { return false; }\n\t\treturn this._isInlineTextHovered.read(reader) || this._additionalLinesWidget.isHovered.read(reader);\n\t});\n\n\tpublic readonly height = derived(this, reader => {\n\t\tconst lineHeight = this._editorObs.getOption(EditorOption.lineHeight).read(reader);\n\t\treturn lineHeight + (this._additionalLinesWidget.viewZoneHeight.read(reader) ?? 0);\n\t});\n\n\tpublic ownsViewZone(viewZoneId: string): boolean {\n\t\treturn this._additionalLinesWidget.viewZoneId === viewZoneId;\n\t}\n}\n\nclass GhostTextAttachedData {\n\tconstructor(public readonly owner: GhostTextView) { }\n}\n\ninterface WidgetDomElement {\n\tghostTextViewWarningWidgetData?: {\n\t\trange: Range;\n\t};\n}\n\nfunction computeGhostTextViewData(ghostText: GhostText | GhostTextReplacement, textModel: ITextModel, ghostTextClassName: string) {\n\tconst inlineTexts: { column: number; text: string; preview: boolean; lineDecorations: LineDecoration[] }[] = [];\n\tconst additionalLines: { content: string; decorations: LineDecoration[] }[] = [];\n\n\tfunction addToAdditionalLines(ghLines: readonly IGhostTextLine[], className: string | undefined) {\n\t\tif (additionalLines.length > 0) {\n\t\t\tconst lastLine = additionalLines[additionalLines.length - 1];\n\t\t\tif (className) {\n\t\t\t\tlastLine.decorations.push(new LineDecoration(\n\t\t\t\t\tlastLine.content.length + 1,\n\t\t\t\t\tlastLine.content.length + 1 + ghLines[0].line.length,\n\t\t\t\t\tclassName,\n\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t));\n\t\t\t}\n\t\t\tlastLine.content += ghLines[0].line;\n\n\t\t\tghLines = ghLines.slice(1);\n\t\t}\n\t\tfor (const ghLine of ghLines) {\n\t\t\tadditionalLines.push({\n\t\t\t\tcontent: ghLine.line,\n\t\t\t\tdecorations: className ? [new LineDecoration(\n\t\t\t\t\t1,\n\t\t\t\t\tghLine.line.length + 1,\n\t\t\t\t\tclassName,\n\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t), ...ghLine.lineDecorations] : [...ghLine.lineDecorations]\n\t\t\t});\n\t\t}\n\t}\n\n\tconst textBufferLine = textModel.getLineContent(ghostText.lineNumber);\n\n\tlet hiddenTextStartColumn: number | undefined = undefined;\n\tlet lastIdx = 0;\n\tfor (const part of ghostText.parts) {\n\t\tlet ghLines = part.lines;\n\t\tif (hiddenTextStartColumn === undefined) {\n\t\t\tinlineTexts.push({ column: part.column, text: ghLines[0].line, preview: part.preview, lineDecorations: ghLines[0].lineDecorations });\n\t\t\tghLines = ghLines.slice(1);\n\t\t} else {\n\t\t\taddToAdditionalLines([{ line: textBufferLine.substring(lastIdx, part.column - 1), lineDecorations: [] }], undefined);\n\t\t}\n\n\t\tif (ghLines.length > 0) {\n\t\t\taddToAdditionalLines(ghLines, ghostTextClassName);\n\t\t\tif (hiddenTextStartColumn === undefined && part.column <= textBufferLine.length) {\n\t\t\t\thiddenTextStartColumn = part.column;\n\t\t\t}\n\t\t}\n\n\t\tlastIdx = part.column - 1;\n\t}\n\tlet additionalLinesOriginalSuffix: RangeSingleLine | undefined = undefined;\n\tif (hiddenTextStartColumn !== undefined) {\n\t\tadditionalLinesOriginalSuffix = new RangeSingleLine(ghostText.lineNumber, new ColumnRange(lastIdx + 1, textBufferLine.length + 1));\n\t}\n\n\tconst hiddenRange = hiddenTextStartColumn !== undefined ? new ColumnRange(hiddenTextStartColumn, textBufferLine.length + 1) : undefined;\n\n\treturn {\n\t\tinlineTexts,\n\t\tadditionalLines,\n\t\thiddenRange,\n\t\tadditionalLinesOriginalSuffix,\n\t};\n}\n\nexport class AdditionalLinesWidget extends Disposable {\n\tprivate _viewZoneInfo: { viewZoneId: string; heightInLines: number; lineNumber: number } | undefined;\n\tpublic get viewZoneId(): string | undefined { return this._viewZoneInfo?.viewZoneId; }\n\n\tprivate _viewZoneHeight;\n\tpublic get viewZoneHeight(): IObservable<number | undefined> { return this._viewZoneHeight; }\n\n\tprivate readonly editorOptionsChanged;\n\n\tprivate readonly _onDidClick;\n\tpublic readonly onDidClick;\n\n\tprivate readonly _viewZoneListener;\n\n\treadonly isHovered;\n\n\tprivate hasBeenAccepted;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _lines: IObservable<{\n\t\t\tlineNumber: number;\n\t\t\tadditionalLines: LineData[];\n\t\t\tminReservedLineCount: number;\n\t\t} | undefined>,\n\t\tprivate readonly _shouldKeepCursorStable: boolean,\n\t\tprivate readonly _isClickable: boolean,\n\t) {\n\t\tsuper();\n\t\tthis._viewZoneHeight = observableValue<undefined | number>('viewZoneHeight', undefined);\n\t\tthis.editorOptionsChanged = observableSignalFromEvent('editorOptionChanged', Event.filter(\n\t\t\tthis._editor.onDidChangeConfiguration,\n\t\t\te => e.hasChanged(EditorOption.disableMonospaceOptimizations)\n\t\t\t\t|| e.hasChanged(EditorOption.stopRenderingLineAfter)\n\t\t\t\t|| e.hasChanged(EditorOption.renderWhitespace)\n\t\t\t\t|| e.hasChanged(EditorOption.renderControlCharacters)\n\t\t\t\t|| e.hasChanged(EditorOption.fontLigatures)\n\t\t\t\t|| e.hasChanged(EditorOption.fontInfo)\n\t\t\t\t|| e.hasChanged(EditorOption.lineHeight)\n\t\t));\n\t\tthis._onDidClick = this._register(new Emitter<IMouseEvent>());\n\t\tthis.onDidClick = this._onDidClick.event;\n\t\tthis._viewZoneListener = this._register(new MutableDisposable());\n\t\tthis.isHovered = observableCodeEditor(this._editor).isTargetHovered(\n\t\t\tp => isTargetGhostText(p.target.element),\n\t\t\tthis._store\n\t\t);\n\t\tthis.hasBeenAccepted = false;\n\n\t\tif (this._editor instanceof CodeEditorWidget && this._shouldKeepCursorStable) {\n\t\t\tthis._register(this._editor.onBeforeExecuteEdit(e => this.hasBeenAccepted = e.source === 'inlineSuggestion.accept'));\n\t\t}\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update view zone */\n\t\t\tconst lines = this._lines.read(reader);\n\t\t\tthis.editorOptionsChanged.read(reader);\n\n\t\t\tif (lines) {\n\t\t\t\tthis.hasBeenAccepted = false;\n\t\t\t\tthis.updateLines(lines.lineNumber, lines.additionalLines, lines.minReservedLineCount);\n\t\t\t} else {\n\t\t\t\tthis.clear();\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis.clear();\n\t}\n\n\tprivate clear(): void {\n\t\tthis._viewZoneListener.clear();\n\n\t\tthis._editor.changeViewZones((changeAccessor) => {\n\t\t\tthis.removeActiveViewZone(changeAccessor);\n\t\t});\n\t}\n\n\tprivate updateLines(lineNumber: number, additionalLines: LineData[], minReservedLineCount: number): void {\n\t\tconst textModel = this._editor.getModel();\n\t\tif (!textModel) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { tabSize } = textModel.getOptions();\n\n\t\tthis._editor.changeViewZones((changeAccessor) => {\n\t\t\tconst store = new DisposableStore();\n\n\t\t\tthis.removeActiveViewZone(changeAccessor);\n\n\t\t\tconst heightInLines = Math.max(additionalLines.length, minReservedLineCount);\n\t\t\tif (heightInLines > 0) {\n\t\t\t\tconst domNode = document.createElement('div');\n\t\t\t\trenderLines(domNode, tabSize, additionalLines, this._editor.getOptions(), this._isClickable);\n\n\t\t\t\tif (this._isClickable) {\n\t\t\t\t\tstore.add(addDisposableListener(domNode, 'mousedown', (e) => {\n\t\t\t\t\t\te.preventDefault(); // This prevents that the editor loses focus\n\t\t\t\t\t}));\n\t\t\t\t\tstore.add(addDisposableListener(domNode, 'click', (e) => {\n\t\t\t\t\t\tif (isTargetGhostText(e.target)) {\n\t\t\t\t\t\t\tthis._onDidClick.fire(new StandardMouseEvent(getWindow(e), e));\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t}\n\n\t\t\t\tthis.addViewZone(changeAccessor, lineNumber, heightInLines, domNode);\n\t\t\t}\n\n\t\t\tthis._viewZoneListener.value = store;\n\t\t});\n\t}\n\n\tprivate addViewZone(changeAccessor: IViewZoneChangeAccessor, afterLineNumber: number, heightInLines: number, domNode: HTMLElement): void {\n\t\tconst id = changeAccessor.addZone({\n\t\t\tafterLineNumber: afterLineNumber,\n\t\t\theightInLines: heightInLines,\n\t\t\tdomNode,\n\t\t\tafterColumnAffinity: PositionAffinity.Right,\n\t\t\tonComputedHeight: (height: number) => {\n\t\t\t\tthis._viewZoneHeight.set(height, undefined); // TODO: can a transaction be used to avoid flickering?\n\t\t\t}\n\t\t});\n\n\t\tthis.keepCursorStable(afterLineNumber, heightInLines);\n\n\t\tthis._viewZoneInfo = { viewZoneId: id, heightInLines, lineNumber: afterLineNumber };\n\t}\n\n\tprivate removeActiveViewZone(changeAccessor: IViewZoneChangeAccessor): void {\n\t\tif (this._viewZoneInfo) {\n\t\t\tchangeAccessor.removeZone(this._viewZoneInfo.viewZoneId);\n\n\t\t\tif (!this.hasBeenAccepted) {\n\t\t\t\tthis.keepCursorStable(this._viewZoneInfo.lineNumber, -this._viewZoneInfo.heightInLines);\n\t\t\t}\n\n\t\t\tthis._viewZoneInfo = undefined;\n\t\t\tthis._viewZoneHeight.set(undefined, undefined);\n\t\t}\n\t}\n\n\tprivate keepCursorStable(lineNumber: number, heightInLines: number): void {\n\t\tif (!this._shouldKeepCursorStable) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst cursorLineNumber = this._editor.getSelection()?.getStartPosition()?.lineNumber;\n\t\tif (cursorLineNumber !== undefined && lineNumber < cursorLineNumber) {\n\t\t\tthis._editor.setScrollTop(this._editor.getScrollTop() + heightInLines * this._editor.getOption(EditorOption.lineHeight));\n\t\t}\n\t}\n}\n\nfunction isTargetGhostText(target: EventTarget | null): boolean {\n\treturn isHTMLElement(target) && target.classList.contains(GHOST_TEXT_CLASS_NAME);\n}\n\nexport interface LineData {\n\tcontent: LineTokens; // Must not contain a linebreak!\n\tdecorations: LineDecoration[];\n}\n\nfunction renderLines(domNode: HTMLElement, tabSize: number, lines: LineData[], opts: IComputedEditorOptions, isClickable: boolean): void {\n\tconst disableMonospaceOptimizations = opts.get(EditorOption.disableMonospaceOptimizations);\n\tconst stopRenderingLineAfter = opts.get(EditorOption.stopRenderingLineAfter);\n\t// To avoid visual confusion, we don't want to render visible whitespace\n\tconst renderWhitespace = 'none';\n\tconst renderControlCharacters = opts.get(EditorOption.renderControlCharacters);\n\tconst fontLigatures = opts.get(EditorOption.fontLigatures);\n\tconst fontInfo = opts.get(EditorOption.fontInfo);\n\tconst lineHeight = opts.get(EditorOption.lineHeight);\n\n\tlet classNames = 'suggest-preview-text';\n\tif (isClickable) {\n\t\tclassNames += ' clickable';\n\t}\n\n\tconst sb = new StringBuilder(10000);\n\tsb.appendString(`<div class=\"${classNames}\">`);\n\n\tfor (let i = 0, len = lines.length; i < len; i++) {\n\t\tconst lineData = lines[i];\n\t\tconst lineTokens = lineData.content;\n\t\tsb.appendString('<div class=\"view-line');\n\t\tsb.appendString('\" style=\"top:');\n\t\tsb.appendString(String(i * lineHeight));\n\t\tsb.appendString('px;width:1000000px;\">');\n\n\t\tconst line = lineTokens.getLineContent();\n\t\tconst isBasicASCII = strings.isBasicASCII(line);\n\t\tconst containsRTL = strings.containsRTL(line);\n\n\t\trenderViewLine(new RenderLineInput(\n\t\t\t(fontInfo.isMonospace && !disableMonospaceOptimizations),\n\t\t\tfontInfo.canUseHalfwidthRightwardsArrow,\n\t\t\tline,\n\t\t\tfalse,\n\t\t\tisBasicASCII,\n\t\t\tcontainsRTL,\n\t\t\t0,\n\t\t\tlineTokens,\n\t\t\tlineData.decorations,\n\t\t\ttabSize,\n\t\t\t0,\n\t\t\tfontInfo.spaceWidth,\n\t\t\tfontInfo.middotWidth,\n\t\t\tfontInfo.wsmiddotWidth,\n\t\t\tstopRenderingLineAfter,\n\t\t\trenderWhitespace,\n\t\t\trenderControlCharacters,\n\t\t\tfontLigatures !== EditorFontLigatures.OFF,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\t0\n\t\t), sb);\n\n\t\tsb.appendString('</div>');\n\t}\n\tsb.appendString('</div>');\n\n\tapplyFontInfo(domNode, fontInfo);\n\tconst html = sb.build();\n\tconst trustedhtml = ttPolicy ? ttPolicy.createHTML(html) : html;\n\tdomNode.innerHTML = trustedhtml as string;\n}\n\nexport const ttPolicy = createTrustedTypesPolicy('editorGhostText', { createHTML: value => value });\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.ts","vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,2DAA2D,CAAC;AACvF,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1H,OAAO,EAAe,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,OAAO,EAAE,WAAW,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AACxL,OAAO,KAAK,OAAO,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAE7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAwC,MAAM,+CAA+C,CAAC;AAC1H,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAC/F,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAE5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAqC,uBAAuB,EAAoB,MAAM,gCAAgC,CAAC;AAC9H,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAA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IAAI,CAAC,CAAC;QAE9C,cAAc,CAAC,IAAI,eAAe,CACjC,CAAC,QAAQ,CAAC,WAAW,IAAI,CAAC,6BAA6B,CAAC,EACxD,QAAQ,CAAC,8BAA8B,EACvC,IAAI,EACJ,KAAK,EACL,YAAY,EACZ,WAAW,EACX,CAAC,EACD,UAAU,EACV,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,EAC5B,OAAO,EACP,CAAC,EACD,QAAQ,CAAC,UAAU,EACnB,QAAQ,CAAC,WAAW,EACpB,QAAQ,CAAC,aAAa,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,EACvB,aAAa,KAAK,mBAAmB,CAAC,GAAG,EACzC,IAAI,EACJ,IAAI,EACJ,CAAC,CACD,EAAE,EAAE,CAAC,CAAC;QAEP,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;IACD,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAE1B,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACjC,MAAM,IAAI,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC;IACxB,MAAM,WAAW,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAChE,OAAO,CAAC,SAAS,GAAG,WAAqB,CAAC;AAC3C,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,wBAAwB,CAAC,iBAAiB,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC","file":"ghostTextView.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { createTrustedTypesPolicy } from '../../../../../../base/browser/trustedTypes.js';\nimport { renderIcon } from '../../../../../../base/browser/ui/iconLabel/iconLabels.js';\nimport { Codicon } from '../../../../../../base/common/codicons.js';\nimport { Emitter, Event } from '../../../../../../base/common/event.js';\nimport { Disposable, DisposableStore, MutableDisposable, toDisposable } from '../../../../../../base/common/lifecycle.js';\nimport { IObservable, autorun, autorunWithStore, constObservable, derived, derivedOpts, observableSignalFromEvent, observableValue } from '../../../../../../base/common/observable.js';\nimport * as strings from '../../../../../../base/common/strings.js';\nimport { applyFontInfo } from '../../../../../browser/config/domFontInfo.js';\nimport { ContentWidgetPositionPreference, ICodeEditor, IContentWidgetPosition, IViewZoneChangeAccessor, MouseTargetType } from '../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../../browser/observableCodeEditor.js';\nimport { EditorFontLigatures, EditorOption, IComputedEditorOptions } from '../../../../../common/config/editorOptions.js';\nimport { StringEdit, StringReplacement } from '../../../../../common/core/edits/stringEdit.js';\nimport { Position } from '../../../../../common/core/position.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { StringBuilder } from '../../../../../common/core/stringBuilder.js';\nimport { IconPath, InlineCompletionWarning } from '../../../../../common/languages.js';\nimport { ILanguageService } from '../../../../../common/languages/language.js';\nimport { IModelDeltaDecoration, ITextModel, InjectedTextCursorStops, PositionAffinity } from '../../../../../common/model.js';\nimport { LineTokens } from '../../../../../common/tokens/lineTokens.js';\nimport { LineDecoration } from '../../../../../common/viewLayout/lineDecorations.js';\nimport { RenderLineInput, renderViewLine } from '../../../../../common/viewLayout/viewLineRenderer.js';\nimport { GhostText, GhostTextReplacement, IGhostTextLine } from '../../model/ghostText.js';\nimport { RangeSingleLine } from '../../../../../common/core/ranges/rangeSingleLine.js';\nimport { ColumnRange } from '../../../../../common/core/ranges/columnRange.js';\nimport { addDisposableListener, getWindow, isHTMLElement, n } from '../../../../../../base/browser/dom.js';\nimport './ghostTextView.css';\nimport { IMouseEvent, StandardMouseEvent } from '../../../../../../base/browser/mouseEvent.js';\nimport { CodeEditorWidget } from '../../../../../browser/widget/codeEditor/codeEditorWidget.js';\nimport { TokenWithTextArray } from '../../../../../common/tokens/tokenWithTextArray.js';\nimport { InlineCompletionViewData } from '../inlineEdits/inlineEditsViewInterface.js';\nimport { InlineDecorationType } from '../../../../../common/viewModel/inlineDecorations.js';\nimport { equals, sum } from '../../../../../../base/common/arrays.js';\nimport { equalsIfDefinedC, IEquatable, thisEqualsC } from '../../../../../../base/common/equals.js';\n\nexport interface IGhostTextWidgetData {\n\treadonly ghostText: GhostText | GhostTextReplacement;\n\treadonly warning: GhostTextWidgetWarning | undefined;\n\thandleInlineCompletionShown(viewData: InlineCompletionViewData): void;\n}\n\nexport class GhostTextWidgetWarning {\n\tpublic static from(warning: InlineCompletionWarning | undefined): GhostTextWidgetWarning | undefined {\n\t\tif (!warning) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new GhostTextWidgetWarning(warning.icon);\n\t}\n\n\tconstructor(\n\t\tpublic readonly icon: IconPath = Codicon.warning,\n\t) { }\n}\n\nconst USE_SQUIGGLES_FOR_WARNING = true;\nconst GHOST_TEXT_CLASS_NAME = 'ghost-text';\n\nexport class GhostTextView extends Disposable {\n\tprivate readonly _isDisposed = observableValue(this, false);\n\tprivate readonly _editorObs;\n\tprivate readonly _warningState = derived(reader => {\n\t\tconst model = this._data.read(reader);\n\t\tconst warning = model?.warning;\n\t\tif (!model || !warning) { return undefined; }\n\t\tconst gt = model.ghostText;\n\t\treturn { lineNumber: gt.lineNumber, position: new Position(gt.lineNumber, gt.parts[0].column), icon: warning.icon };\n\t});\n\n\tprivate readonly _onDidClick = this._register(new Emitter<IMouseEvent>());\n\tpublic readonly onDidClick = this._onDidClick.event;\n\n\tprivate readonly _extraClasses: readonly string[];\n\tprivate readonly _isClickable: boolean;\n\tprivate readonly _shouldKeepCursorStable: boolean;\n\tprivate readonly _minReservedLineCount: IObservable<number>;\n\tprivate readonly _useSyntaxHighlighting: IObservable<boolean>;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _data: IObservable<IGhostTextWidgetData | undefined>,\n\t\toptions: {\n\t\t\textraClasses?: readonly string[]; // TODO@benibenj improve\n\t\t\tisClickable?: boolean;\n\t\t\tshouldKeepCursorStable?: boolean;\n\t\t\tminReservedLineCount?: IObservable<number>;\n\t\t\tuseSyntaxHighlighting?: IObservable<boolean>;\n\t\t},\n\t\t@ILanguageService private readonly _languageService: ILanguageService\n\t) {\n\t\tsuper();\n\n\t\tthis._extraClasses = options.extraClasses ?? [];\n\t\tthis._isClickable = options.isClickable ?? false;\n\t\tthis._shouldKeepCursorStable = options.shouldKeepCursorStable ?? false;\n\t\tthis._minReservedLineCount = options.minReservedLineCount ?? constObservable(0);\n\t\tthis._useSyntaxHighlighting = options.useSyntaxHighlighting ?? constObservable(true);\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\t\tthis._additionalLinesWidget = this._register(\n\t\t\tnew AdditionalLinesWidget(\n\t\t\t\tthis._editor,\n\t\t\t\tderivedOpts({ owner: this, equalsFn: equalsIfDefinedC(thisEqualsC()) }, reader => {\n\t\t\t\t\t/** @description lines */\n\t\t\t\t\tconst uiState = this._state.read(reader);\n\t\t\t\t\treturn uiState ? new AdditionalLinesData(\n\t\t\t\t\t\tuiState.lineNumber,\n\t\t\t\t\t\tuiState.additionalLines,\n\t\t\t\t\t\tuiState.additionalReservedLineCount,\n\t\t\t\t\t) : undefined;\n\t\t\t\t}),\n\t\t\t\tthis._shouldKeepCursorStable,\n\t\t\t\tthis._isClickable\n\t\t\t)\n\t\t);\n\t\tthis._isInlineTextHovered = this._editorObs.isTargetHovered(\n\t\t\tp => p.target.type === MouseTargetType.CONTENT_TEXT &&\n\t\t\t\tp.target.detail.injectedText?.options.attachedData instanceof GhostTextAttachedData &&\n\t\t\t\tp.target.detail.injectedText.options.attachedData.owner === this,\n\t\t\tthis._store\n\t\t);\n\n\t\tthis._register(toDisposable(() => { this._isDisposed.set(true, undefined); }));\n\t\tthis._register(this._editorObs.setDecorations(this._decorations));\n\n\t\tif (this._isClickable) {\n\t\t\tthis._register(this._additionalLinesWidget.onDidClick((e) => this._onDidClick.fire(e)));\n\t\t\tthis._register(this._editor.onMouseUp(e => {\n\t\t\t\tif (e.target.type !== MouseTargetType.CONTENT_TEXT) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst a = e.target.detail.injectedText?.options.attachedData;\n\t\t\t\tif (a instanceof GhostTextAttachedData && a.owner === this) {\n\t\t\t\t\tthis._onDidClick.fire(e.event);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst state = this._state.read(reader);\n\t\t\tstate?.handleInlineCompletionShown(state.telemetryViewData);\n\t\t}));\n\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tif (USE_SQUIGGLES_FOR_WARNING) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst state = this._warningState.read(reader);\n\t\t\tif (!state) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst lineHeight = this._editorObs.getOption(EditorOption.lineHeight);\n\t\t\tstore.add(this._editorObs.createContentWidget({\n\t\t\t\tposition: constObservable<IContentWidgetPosition>({\n\t\t\t\t\tposition: new Position(state.lineNumber, Number.MAX_SAFE_INTEGER),\n\t\t\t\t\tpreference: [ContentWidgetPositionPreference.EXACT],\n\t\t\t\t\tpositionAffinity: PositionAffinity.Right,\n\t\t\t\t}),\n\t\t\t\tallowEditorOverflow: false,\n\t\t\t\tdomNode: n.div({\n\t\t\t\t\tclass: 'ghost-text-view-warning-widget',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\twidth: lineHeight,\n\t\t\t\t\t\theight: lineHeight,\n\t\t\t\t\t\tmarginLeft: 4,\n\t\t\t\t\t\tcolor: 'orange',\n\t\t\t\t\t},\n\t\t\t\t\tref: (dom) => {\n\t\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\t\t\t(dom as any as WidgetDomElement).ghostTextViewWarningWidgetData = { range: Range.fromPositions(state.position) };\n\t\t\t\t\t}\n\t\t\t\t}, [\n\t\t\t\t\tn.div({\n\t\t\t\t\t\tclass: 'ghost-text-view-warning-widget-icon',\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\talignContent: 'center',\n\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\t[renderIcon(state.icon)]\n\t\t\t\t\t)\n\t\t\t\t]).keepUpdated(store).element,\n\t\t\t}));\n\t\t}));\n\t}\n\n\tpublic static getWarningWidgetContext(domNode: HTMLElement): { range: Range } | undefined {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tconst data = (domNode as any as WidgetDomElement).ghostTextViewWarningWidgetData;\n\t\tif (data) {\n\t\t\treturn data;\n\t\t} else if (domNode.parentElement) {\n\t\t\treturn this.getWarningWidgetContext(domNode.parentElement);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate readonly _extraClassNames = derived(this, reader => {\n\t\tconst extraClasses = this._extraClasses.slice();\n\t\tif (this._useSyntaxHighlighting.read(reader)) {\n\t\t\textraClasses.push('syntax-highlighted');\n\t\t}\n\t\tif (USE_SQUIGGLES_FOR_WARNING && this._warningState.read(reader)) {\n\t\t\textraClasses.push('warning');\n\t\t}\n\t\tconst extraClassNames = extraClasses.map(c => ` ${c}`).join('');\n\t\treturn extraClassNames;\n\t});\n\n\tprivate readonly _state = derived(this, reader => {\n\t\tif (this._isDisposed.read(reader)) { return undefined; }\n\n\t\tconst props = this._data.read(reader);\n\t\tif (!props) { return undefined; }\n\n\t\tconst textModel = this._editorObs.model.read(reader);\n\t\tif (!textModel) { return undefined; }\n\n\t\tconst ghostText = props.ghostText;\n\t\tconst replacedRange = ghostText instanceof GhostTextReplacement ? ghostText.columnRange : undefined;\n\n\t\tconst syntaxHighlightingEnabled = this._useSyntaxHighlighting.read(reader);\n\t\tconst extraClassNames = this._extraClassNames.read(reader);\n\t\tconst { inlineTexts, additionalLines, hiddenRange, additionalLinesOriginalSuffix } = computeGhostTextViewData(ghostText, textModel, GHOST_TEXT_CLASS_NAME + extraClassNames);\n\n\t\tconst currentLine = textModel.getLineContent(ghostText.lineNumber);\n\t\tconst edit = new StringEdit(inlineTexts.map(t => StringReplacement.insert(t.column - 1, t.text)));\n\t\tconst tokens = syntaxHighlightingEnabled ? textModel.tokenization.tokenizeLinesAt(ghostText.lineNumber, [edit.apply(currentLine), ...additionalLines.map(l => l.content)]) : undefined;\n\t\tconst newRanges = edit.getNewRanges();\n\t\tconst inlineTextsWithTokens = inlineTexts.map((t, idx) => ({ ...t, tokens: tokens?.[0]?.getTokensInRange(newRanges[idx]) }));\n\n\t\tconst tokenizedAdditionalLines: LineData[] = additionalLines.map((l, idx) => {\n\t\t\tlet content = tokens?.[idx + 1] ?? LineTokens.createEmpty(l.content, this._languageService.languageIdCodec);\n\t\t\tif (idx === additionalLines.length - 1 && additionalLinesOriginalSuffix) {\n\t\t\t\tconst t = TokenWithTextArray.fromLineTokens(textModel.tokenization.getLineTokens(additionalLinesOriginalSuffix.lineNumber));\n\t\t\t\tconst existingContent = t.slice(additionalLinesOriginalSuffix.columnRange.toZeroBasedOffsetRange());\n\t\t\t\tcontent = TokenWithTextArray.fromLineTokens(content).append(existingContent).toLineTokens(content.languageIdCodec);\n\t\t\t}\n\t\t\treturn new LineData(\n\t\t\t\tcontent,\n\t\t\t\tl.decorations,\n\t\t\t);\n\t\t});\n\n\t\tconst cursorColumn = this._editor.getSelection()?.getStartPosition().column!;\n\t\tconst disjointInlineTexts = inlineTextsWithTokens.filter(inline => inline.text !== '');\n\t\tconst hasInsertionOnCurrentLine = disjointInlineTexts.length !== 0;\n\t\tconst telemetryViewData = new InlineCompletionViewData(\n\t\t\t(hasInsertionOnCurrentLine ? disjointInlineTexts[0].column : 1) - cursorColumn,\n\t\t\thasInsertionOnCurrentLine ? 0 : (additionalLines.findIndex(line => line.content !== '') + 1),\n\t\t\thasInsertionOnCurrentLine ? 1 : 0,\n\t\t\tadditionalLines.length + (hasInsertionOnCurrentLine ? 1 : 0),\n\t\t\t0,\n\t\t\tsum(disjointInlineTexts.map(inline => inline.text.length)) + sum(tokenizedAdditionalLines.map(line => line.content.getTextLength())),\n\t\t\tdisjointInlineTexts.length + (additionalLines.length > 0 ? 1 : 0),\n\t\t\tdisjointInlineTexts.length > 1 && tokenizedAdditionalLines.length === 0 ? disjointInlineTexts.every(inline => inline.text === disjointInlineTexts[0].text) : undefined\n\t\t);\n\n\t\treturn {\n\t\t\treplacedRange,\n\t\t\tinlineTexts: inlineTextsWithTokens,\n\t\t\tadditionalLines: tokenizedAdditionalLines,\n\t\t\thiddenRange,\n\t\t\tlineNumber: ghostText.lineNumber,\n\t\t\tadditionalReservedLineCount: this._minReservedLineCount.read(reader),\n\t\t\ttargetTextModel: textModel,\n\t\t\tsyntaxHighlightingEnabled,\n\t\t\ttelemetryViewData,\n\t\t\thandleInlineCompletionShown: props.handleInlineCompletionShown,\n\t\t};\n\t});\n\n\tprivate readonly _decorations = derived(this, reader => {\n\t\tconst uiState = this._state.read(reader);\n\t\tif (!uiState) { return []; }\n\n\t\tconst decorations: IModelDeltaDecoration[] = [];\n\n\t\tconst extraClassNames = this._extraClassNames.read(reader);\n\n\t\tif (uiState.replacedRange) {\n\t\t\tdecorations.push({\n\t\t\t\trange: uiState.replacedRange.toRange(uiState.lineNumber),\n\t\t\t\toptions: { inlineClassName: 'inline-completion-text-to-replace' + extraClassNames, description: 'GhostTextReplacement' }\n\t\t\t});\n\t\t}\n\n\t\tif (uiState.hiddenRange) {\n\t\t\tdecorations.push({\n\t\t\t\trange: uiState.hiddenRange.toRange(uiState.lineNumber),\n\t\t\t\toptions: { inlineClassName: 'ghost-text-hidden', description: 'ghost-text-hidden', }\n\t\t\t});\n\t\t}\n\n\t\tfor (const p of uiState.inlineTexts) {\n\t\t\tdecorations.push({\n\t\t\t\trange: Range.fromPositions(new Position(uiState.lineNumber, p.column)),\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'ghost-text-decoration',\n\t\t\t\t\tafter: {\n\t\t\t\t\t\tcontent: p.text,\n\t\t\t\t\t\ttokens: p.tokens,\n\t\t\t\t\t\tinlineClassName: (p.preview ? 'ghost-text-decoration-preview' : 'ghost-text-decoration')\n\t\t\t\t\t\t\t+ (this._isClickable ? ' clickable' : '')\n\t\t\t\t\t\t\t+ extraClassNames\n\t\t\t\t\t\t\t+ p.lineDecorations.map(d => ' ' + d.className).join(' '), // TODO: take the ranges into account for line decorations\n\t\t\t\t\t\tcursorStops: InjectedTextCursorStops.Left,\n\t\t\t\t\t\tattachedData: new GhostTextAttachedData(this),\n\t\t\t\t\t},\n\t\t\t\t\tshowIfCollapsed: true,\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn decorations;\n\t});\n\n\tprivate readonly _additionalLinesWidget;\n\n\tprivate readonly _isInlineTextHovered;\n\n\tpublic readonly isHovered = derived(this, reader => {\n\t\tif (this._isDisposed.read(reader)) { return false; }\n\t\treturn this._isInlineTextHovered.read(reader) || this._additionalLinesWidget.isHovered.read(reader);\n\t});\n\n\tpublic readonly height = derived(this, reader => {\n\t\tconst lineHeight = this._editorObs.getOption(EditorOption.lineHeight).read(reader);\n\t\treturn lineHeight + (this._additionalLinesWidget.viewZoneHeight.read(reader) ?? 0);\n\t});\n\n\tpublic ownsViewZone(viewZoneId: string): boolean {\n\t\treturn this._additionalLinesWidget.viewZoneId === viewZoneId;\n\t}\n}\n\nclass GhostTextAttachedData {\n\tconstructor(public readonly owner: GhostTextView) { }\n}\n\ninterface WidgetDomElement {\n\tghostTextViewWarningWidgetData?: {\n\t\trange: Range;\n\t};\n}\n\nfunction computeGhostTextViewData(ghostText: GhostText | GhostTextReplacement, textModel: ITextModel, ghostTextClassName: string) {\n\tconst inlineTexts: { column: number; text: string; preview: boolean; lineDecorations: LineDecoration[] }[] = [];\n\tconst additionalLines: { content: string; decorations: LineDecoration[] }[] = [];\n\n\tfunction addToAdditionalLines(ghLines: readonly IGhostTextLine[], className: string | undefined) {\n\t\tif (additionalLines.length > 0) {\n\t\t\tconst lastLine = additionalLines[additionalLines.length - 1];\n\t\t\tif (className) {\n\t\t\t\tlastLine.decorations.push(new LineDecoration(\n\t\t\t\t\tlastLine.content.length + 1,\n\t\t\t\t\tlastLine.content.length + 1 + ghLines[0].line.length,\n\t\t\t\t\tclassName,\n\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t));\n\t\t\t}\n\t\t\tlastLine.content += ghLines[0].line;\n\n\t\t\tghLines = ghLines.slice(1);\n\t\t}\n\t\tfor (const ghLine of ghLines) {\n\t\t\tadditionalLines.push({\n\t\t\t\tcontent: ghLine.line,\n\t\t\t\tdecorations: className ? [new LineDecoration(\n\t\t\t\t\t1,\n\t\t\t\t\tghLine.line.length + 1,\n\t\t\t\t\tclassName,\n\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t), ...ghLine.lineDecorations] : [...ghLine.lineDecorations]\n\t\t\t});\n\t\t}\n\t}\n\n\tconst textBufferLine = textModel.getLineContent(ghostText.lineNumber);\n\n\tlet hiddenTextStartColumn: number | undefined = undefined;\n\tlet lastIdx = 0;\n\tfor (const part of ghostText.parts) {\n\t\tlet ghLines = part.lines;\n\t\tif (hiddenTextStartColumn === undefined) {\n\t\t\tinlineTexts.push({ column: part.column, text: ghLines[0].line, preview: part.preview, lineDecorations: ghLines[0].lineDecorations });\n\t\t\tghLines = ghLines.slice(1);\n\t\t} else {\n\t\t\taddToAdditionalLines([{ line: textBufferLine.substring(lastIdx, part.column - 1), lineDecorations: [] }], undefined);\n\t\t}\n\n\t\tif (ghLines.length > 0) {\n\t\t\taddToAdditionalLines(ghLines, ghostTextClassName);\n\t\t\tif (hiddenTextStartColumn === undefined && part.column <= textBufferLine.length) {\n\t\t\t\thiddenTextStartColumn = part.column;\n\t\t\t}\n\t\t}\n\n\t\tlastIdx = part.column - 1;\n\t}\n\tlet additionalLinesOriginalSuffix: RangeSingleLine | undefined = undefined;\n\tif (hiddenTextStartColumn !== undefined) {\n\t\tadditionalLinesOriginalSuffix = new RangeSingleLine(ghostText.lineNumber, new ColumnRange(lastIdx + 1, textBufferLine.length + 1));\n\t}\n\n\tconst hiddenRange = hiddenTextStartColumn !== undefined ? new ColumnRange(hiddenTextStartColumn, textBufferLine.length + 1) : undefined;\n\n\treturn {\n\t\tinlineTexts,\n\t\tadditionalLines,\n\t\thiddenRange,\n\t\tadditionalLinesOriginalSuffix,\n\t};\n}\n\nclass AdditionalLinesData implements IEquatable<AdditionalLinesData> {\n\tconstructor(\n\t\tpublic readonly lineNumber: number,\n\t\tpublic readonly additionalLines: readonly LineData[],\n\t\tpublic readonly minReservedLineCount: number,\n\t) { }\n\n\tequals(other: AdditionalLinesData): boolean {\n\t\tif (this.lineNumber !== other.lineNumber) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this.minReservedLineCount !== other.minReservedLineCount) {\n\t\t\treturn false;\n\t\t}\n\t\treturn equals(this.additionalLines, other.additionalLines, thisEqualsC());\n\t}\n}\n\nexport class AdditionalLinesWidget extends Disposable {\n\tprivate _viewZoneInfo: { viewZoneId: string; heightInLines: number; lineNumber: number } | undefined;\n\tpublic get viewZoneId(): string | undefined { return this._viewZoneInfo?.viewZoneId; }\n\n\tprivate _viewZoneHeight;\n\tpublic get viewZoneHeight(): IObservable<number | undefined> { return this._viewZoneHeight; }\n\n\tprivate readonly editorOptionsChanged;\n\n\tprivate readonly _onDidClick;\n\tpublic readonly onDidClick;\n\n\tprivate readonly _viewZoneListener;\n\n\treadonly isHovered;\n\n\tprivate hasBeenAccepted;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _lines: IObservable<AdditionalLinesData | undefined>,\n\t\tprivate readonly _shouldKeepCursorStable: boolean,\n\t\tprivate readonly _isClickable: boolean,\n\t) {\n\t\tsuper();\n\t\tthis._viewZoneHeight = observableValue<undefined | number>('viewZoneHeight', undefined);\n\t\tthis.editorOptionsChanged = observableSignalFromEvent('editorOptionChanged', Event.filter(\n\t\t\tthis._editor.onDidChangeConfiguration,\n\t\t\te => e.hasChanged(EditorOption.disableMonospaceOptimizations)\n\t\t\t\t|| e.hasChanged(EditorOption.stopRenderingLineAfter)\n\t\t\t\t|| e.hasChanged(EditorOption.renderWhitespace)\n\t\t\t\t|| e.hasChanged(EditorOption.renderControlCharacters)\n\t\t\t\t|| e.hasChanged(EditorOption.fontLigatures)\n\t\t\t\t|| e.hasChanged(EditorOption.fontInfo)\n\t\t\t\t|| e.hasChanged(EditorOption.lineHeight)\n\t\t));\n\t\tthis._onDidClick = this._register(new Emitter<IMouseEvent>());\n\t\tthis.onDidClick = this._onDidClick.event;\n\t\tthis._viewZoneListener = this._register(new MutableDisposable());\n\t\tthis.isHovered = observableCodeEditor(this._editor).isTargetHovered(\n\t\t\tp => isTargetGhostText(p.target.element),\n\t\t\tthis._store\n\t\t);\n\t\tthis.hasBeenAccepted = false;\n\n\t\tif (this._editor instanceof CodeEditorWidget && this._shouldKeepCursorStable) {\n\t\t\tthis._register(this._editor.onBeforeExecuteEdit(e => this.hasBeenAccepted = e.source === 'inlineSuggestion.accept'));\n\t\t}\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update view zone */\n\t\t\tconst lines = this._lines.read(reader);\n\t\t\tthis.editorOptionsChanged.read(reader);\n\n\t\t\tif (lines) {\n\t\t\t\tthis.hasBeenAccepted = false;\n\t\t\t\tthis.updateLines(lines.lineNumber, lines.additionalLines, lines.minReservedLineCount);\n\t\t\t} else {\n\t\t\t\tthis.clear();\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis.clear();\n\t}\n\n\tprivate clear(): void {\n\t\tthis._viewZoneListener.clear();\n\n\t\tthis._editor.changeViewZones((changeAccessor) => {\n\t\t\tthis.removeActiveViewZone(changeAccessor);\n\t\t});\n\t}\n\n\tprivate updateLines(lineNumber: number, additionalLines: readonly LineData[], minReservedLineCount: number): void {\n\t\tconst textModel = this._editor.getModel();\n\t\tif (!textModel) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { tabSize } = textModel.getOptions();\n\n\t\tobservableCodeEditor(this._editor).transaction(_ => {\n\t\t\tthis._editor.changeViewZones((changeAccessor) => {\n\t\t\t\tconst store = new DisposableStore();\n\n\t\t\t\tthis.removeActiveViewZone(changeAccessor);\n\n\t\t\t\tconst heightInLines = Math.max(additionalLines.length, minReservedLineCount);\n\t\t\t\tif (heightInLines > 0) {\n\t\t\t\t\tconst domNode = document.createElement('div');\n\t\t\t\t\trenderLines(domNode, tabSize, additionalLines, this._editor.getOptions(), this._isClickable);\n\n\t\t\t\t\tif (this._isClickable) {\n\t\t\t\t\t\tstore.add(addDisposableListener(domNode, 'mousedown', (e) => {\n\t\t\t\t\t\t\te.preventDefault(); // This prevents that the editor loses focus\n\t\t\t\t\t\t}));\n\t\t\t\t\t\tstore.add(addDisposableListener(domNode, 'click', (e) => {\n\t\t\t\t\t\t\tif (isTargetGhostText(e.target)) {\n\t\t\t\t\t\t\t\tthis._onDidClick.fire(new StandardMouseEvent(getWindow(e), e));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.addViewZone(changeAccessor, lineNumber, heightInLines, domNode);\n\t\t\t\t}\n\n\t\t\t\tthis._viewZoneListener.value = store;\n\t\t\t});\n\t\t});\n\t}\n\n\tprivate addViewZone(changeAccessor: IViewZoneChangeAccessor, afterLineNumber: number, heightInLines: number, domNode: HTMLElement): void {\n\t\tconst id = changeAccessor.addZone({\n\t\t\tafterLineNumber: afterLineNumber,\n\t\t\theightInLines: heightInLines,\n\t\t\tdomNode,\n\t\t\tafterColumnAffinity: PositionAffinity.Right,\n\t\t\tonComputedHeight: (height: number) => {\n\t\t\t\tthis._viewZoneHeight.set(height, undefined); // TODO: can a transaction be used to avoid flickering?\n\t\t\t}\n\t\t});\n\n\t\tthis.keepCursorStable(afterLineNumber, heightInLines);\n\n\t\tthis._viewZoneInfo = { viewZoneId: id, heightInLines, lineNumber: afterLineNumber };\n\t}\n\n\tprivate removeActiveViewZone(changeAccessor: IViewZoneChangeAccessor): void {\n\t\tif (this._viewZoneInfo) {\n\t\t\tchangeAccessor.removeZone(this._viewZoneInfo.viewZoneId);\n\n\t\t\tif (!this.hasBeenAccepted) {\n\t\t\t\tthis.keepCursorStable(this._viewZoneInfo.lineNumber, -this._viewZoneInfo.heightInLines);\n\t\t\t}\n\n\t\t\tthis._viewZoneInfo = undefined;\n\t\t\tthis._viewZoneHeight.set(undefined, undefined);\n\t\t}\n\t}\n\n\tprivate keepCursorStable(lineNumber: number, heightInLines: number): void {\n\t\tif (!this._shouldKeepCursorStable) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst cursorLineNumber = this._editor.getSelection()?.getStartPosition()?.lineNumber;\n\t\tif (cursorLineNumber !== undefined && lineNumber < cursorLineNumber) {\n\t\t\tthis._editor.setScrollTop(this._editor.getScrollTop() + heightInLines * this._editor.getOption(EditorOption.lineHeight));\n\t\t}\n\t}\n}\n\nfunction isTargetGhostText(target: EventTarget | null): boolean {\n\treturn isHTMLElement(target) && target.classList.contains(GHOST_TEXT_CLASS_NAME);\n}\n\nexport class LineData implements IEquatable<LineData> {\n\tconstructor(\n\t\tpublic readonly content: LineTokens, // Must not contain a linebreak!\n\t\tpublic readonly decorations: readonly LineDecoration[]\n\t) { }\n\n\tequals(other: LineData): boolean {\n\t\tif (!this.content.equals(other.content)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn LineDecoration.equalsArr(this.decorations, other.decorations);\n\t}\n}\n\nfunction renderLines(domNode: HTMLElement, tabSize: number, lines: readonly LineData[], opts: IComputedEditorOptions, isClickable: boolean): void {\n\tconst disableMonospaceOptimizations = opts.get(EditorOption.disableMonospaceOptimizations);\n\tconst stopRenderingLineAfter = opts.get(EditorOption.stopRenderingLineAfter);\n\t// To avoid visual confusion, we don't want to render visible whitespace\n\tconst renderWhitespace = 'none';\n\tconst renderControlCharacters = opts.get(EditorOption.renderControlCharacters);\n\tconst fontLigatures = opts.get(EditorOption.fontLigatures);\n\tconst fontInfo = opts.get(EditorOption.fontInfo);\n\tconst lineHeight = opts.get(EditorOption.lineHeight);\n\n\tlet classNames = 'suggest-preview-text';\n\tif (isClickable) {\n\t\tclassNames += ' clickable';\n\t}\n\n\tconst sb = new StringBuilder(10000);\n\tsb.appendString(`<div class=\"${classNames}\">`);\n\n\tfor (let i = 0, len = lines.length; i < len; i++) {\n\t\tconst lineData = lines[i];\n\t\tconst lineTokens = lineData.content;\n\t\tsb.appendString('<div class=\"view-line');\n\t\tsb.appendString('\" style=\"top:');\n\t\tsb.appendString(String(i * lineHeight));\n\t\tsb.appendString('px;width:1000000px;\">');\n\n\t\tconst line = lineTokens.getLineContent();\n\t\tconst isBasicASCII = strings.isBasicASCII(line);\n\t\tconst containsRTL = strings.containsRTL(line);\n\n\t\trenderViewLine(new RenderLineInput(\n\t\t\t(fontInfo.isMonospace && !disableMonospaceOptimizations),\n\t\t\tfontInfo.canUseHalfwidthRightwardsArrow,\n\t\t\tline,\n\t\t\tfalse,\n\t\t\tisBasicASCII,\n\t\t\tcontainsRTL,\n\t\t\t0,\n\t\t\tlineTokens,\n\t\t\tlineData.decorations.slice(),\n\t\t\ttabSize,\n\t\t\t0,\n\t\t\tfontInfo.spaceWidth,\n\t\t\tfontInfo.middotWidth,\n\t\t\tfontInfo.wsmiddotWidth,\n\t\t\tstopRenderingLineAfter,\n\t\t\trenderWhitespace,\n\t\t\trenderControlCharacters,\n\t\t\tfontLigatures !== EditorFontLigatures.OFF,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\t0\n\t\t), sb);\n\n\t\tsb.appendString('</div>');\n\t}\n\tsb.appendString('</div>');\n\n\tapplyFontInfo(domNode, fontInfo);\n\tconst html = sb.build();\n\tconst trustedhtml = ttPolicy ? ttPolicy.createHTML(html) : html;\n\tdomNode.innerHTML = trustedhtml as string;\n}\n\nexport const ttPolicy = createTrustedTypesPolicy('editorGhostText', { createHTML: value => value });\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { createTrustedTypesPolicy } from '../../../../../../base/browser/trustedTypes.js';\nimport { renderIcon } from '../../../../../../base/browser/ui/iconLabel/iconLabels.js';\nimport { Codicon } from '../../../../../../base/common/codicons.js';\nimport { Emitter, Event } from '../../../../../../base/common/event.js';\nimport { Disposable, DisposableStore, MutableDisposable, toDisposable } from '../../../../../../base/common/lifecycle.js';\nimport { IObservable, autorun, autorunWithStore, constObservable, derived, derivedOpts, observableSignalFromEvent, observableValue } from '../../../../../../base/common/observable.js';\nimport * as strings from '../../../../../../base/common/strings.js';\nimport { applyFontInfo } from '../../../../../browser/config/domFontInfo.js';\nimport { ContentWidgetPositionPreference, ICodeEditor, IContentWidgetPosition, IViewZoneChangeAccessor, MouseTargetType } from '../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor } from '../../../../../browser/observableCodeEditor.js';\nimport { EditorFontLigatures, EditorOption, IComputedEditorOptions } from '../../../../../common/config/editorOptions.js';\nimport { StringEdit, StringReplacement } from '../../../../../common/core/edits/stringEdit.js';\nimport { Position } from '../../../../../common/core/position.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { StringBuilder } from '../../../../../common/core/stringBuilder.js';\nimport { IconPath, InlineCompletionWarning } from '../../../../../common/languages.js';\nimport { ILanguageService } from '../../../../../common/languages/language.js';\nimport { IModelDeltaDecoration, ITextModel, InjectedTextCursorStops, PositionAffinity } from '../../../../../common/model.js';\nimport { LineTokens } from '../../../../../common/tokens/lineTokens.js';\nimport { LineDecoration } from '../../../../../common/viewLayout/lineDecorations.js';\nimport { RenderLineInput, renderViewLine } from '../../../../../common/viewLayout/viewLineRenderer.js';\nimport { GhostText, GhostTextReplacement, IGhostTextLine } from '../../model/ghostText.js';\nimport { RangeSingleLine } from '../../../../../common/core/ranges/rangeSingleLine.js';\nimport { ColumnRange } from '../../../../../common/core/ranges/columnRange.js';\nimport { addDisposableListener, getWindow, isHTMLElement, n } from '../../../../../../base/browser/dom.js';\nimport './ghostTextView.css';\nimport { IMouseEvent, StandardMouseEvent } from '../../../../../../base/browser/mouseEvent.js';\nimport { CodeEditorWidget } from '../../../../../browser/widget/codeEditor/codeEditorWidget.js';\nimport { TokenWithTextArray } from '../../../../../common/tokens/tokenWithTextArray.js';\nimport { InlineCompletionViewData } from '../inlineEdits/inlineEditsViewInterface.js';\nimport { InlineDecorationType } from '../../../../../common/viewModel/inlineDecorations.js';\nimport { equals, sum } from '../../../../../../base/common/arrays.js';\nimport { equalsIfDefinedC, IEquatable, thisEqualsC } from '../../../../../../base/common/equals.js';\n\nexport interface IGhostTextWidgetData {\n\treadonly ghostText: GhostText | GhostTextReplacement;\n\treadonly warning: GhostTextWidgetWarning | undefined;\n\thandleInlineCompletionShown(viewData: InlineCompletionViewData): void;\n}\n\nexport class GhostTextWidgetWarning {\n\tpublic static from(warning: InlineCompletionWarning | undefined): GhostTextWidgetWarning | undefined {\n\t\tif (!warning) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn new GhostTextWidgetWarning(warning.icon);\n\t}\n\n\tconstructor(\n\t\tpublic readonly icon: IconPath = Codicon.warning,\n\t) { }\n}\n\nconst USE_SQUIGGLES_FOR_WARNING = true;\nconst GHOST_TEXT_CLASS_NAME = 'ghost-text';\n\nexport class GhostTextView extends Disposable {\n\tprivate readonly _isDisposed = observableValue(this, false);\n\tprivate readonly _editorObs;\n\tprivate readonly _warningState = derived(reader => {\n\t\tconst model = this._data.read(reader);\n\t\tconst warning = model?.warning;\n\t\tif (!model || !warning) { return undefined; }\n\t\tconst gt = model.ghostText;\n\t\treturn { lineNumber: gt.lineNumber, position: new Position(gt.lineNumber, gt.parts[0].column), icon: warning.icon };\n\t});\n\n\tprivate readonly _onDidClick = this._register(new Emitter<IMouseEvent>());\n\tpublic readonly onDidClick = this._onDidClick.event;\n\n\tprivate readonly _extraClasses: readonly string[];\n\tprivate readonly _isClickable: boolean;\n\tprivate readonly _shouldKeepCursorStable: boolean;\n\tprivate readonly _minReservedLineCount: IObservable<number>;\n\tprivate readonly _useSyntaxHighlighting: IObservable<boolean>;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _data: IObservable<IGhostTextWidgetData | undefined>,\n\t\toptions: {\n\t\t\textraClasses?: readonly string[]; // TODO@benibenj improve\n\t\t\tisClickable?: boolean;\n\t\t\tshouldKeepCursorStable?: boolean;\n\t\t\tminReservedLineCount?: IObservable<number>;\n\t\t\tuseSyntaxHighlighting?: IObservable<boolean>;\n\t\t},\n\t\t@ILanguageService private readonly _languageService: ILanguageService\n\t) {\n\t\tsuper();\n\n\t\tthis._extraClasses = options.extraClasses ?? [];\n\t\tthis._isClickable = options.isClickable ?? false;\n\t\tthis._shouldKeepCursorStable = options.shouldKeepCursorStable ?? false;\n\t\tthis._minReservedLineCount = options.minReservedLineCount ?? constObservable(0);\n\t\tthis._useSyntaxHighlighting = options.useSyntaxHighlighting ?? constObservable(true);\n\n\t\tthis._editorObs = observableCodeEditor(this._editor);\n\t\tthis._additionalLinesWidget = this._register(\n\t\t\tnew AdditionalLinesWidget(\n\t\t\t\tthis._editor,\n\t\t\t\tderivedOpts({ owner: this, equalsFn: equalsIfDefinedC(thisEqualsC()) }, reader => {\n\t\t\t\t\t/** @description lines */\n\t\t\t\t\tconst uiState = this._state.read(reader);\n\t\t\t\t\treturn uiState ? new AdditionalLinesData(\n\t\t\t\t\t\tuiState.lineNumber,\n\t\t\t\t\t\tuiState.additionalLines,\n\t\t\t\t\t\tuiState.additionalReservedLineCount,\n\t\t\t\t\t) : undefined;\n\t\t\t\t}),\n\t\t\t\tthis._shouldKeepCursorStable,\n\t\t\t\tthis._isClickable\n\t\t\t)\n\t\t);\n\t\tthis._isInlineTextHovered = this._editorObs.isTargetHovered(\n\t\t\tp => p.target.type === MouseTargetType.CONTENT_TEXT &&\n\t\t\t\tp.target.detail.injectedText?.options.attachedData instanceof GhostTextAttachedData &&\n\t\t\t\tp.target.detail.injectedText.options.attachedData.owner === this,\n\t\t\tthis._store\n\t\t);\n\n\t\tthis._register(toDisposable(() => { this._isDisposed.set(true, undefined); }));\n\t\tthis._register(this._editorObs.setDecorations(this._decorations));\n\n\t\tif (this._isClickable) {\n\t\t\tthis._register(this._additionalLinesWidget.onDidClick((e) => this._onDidClick.fire(e)));\n\t\t\tthis._register(this._editor.onMouseUp(e => {\n\t\t\t\tif (e.target.type !== MouseTargetType.CONTENT_TEXT) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst a = e.target.detail.injectedText?.options.attachedData;\n\t\t\t\tif (a instanceof GhostTextAttachedData && a.owner === this) {\n\t\t\t\t\tthis._onDidClick.fire(e.event);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._register(autorun(reader => {\n\t\t\tconst state = this._state.read(reader);\n\t\t\tstate?.handleInlineCompletionShown(state.telemetryViewData);\n\t\t}));\n\n\t\tthis._register(autorunWithStore((reader, store) => {\n\t\t\tif (USE_SQUIGGLES_FOR_WARNING) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst state = this._warningState.read(reader);\n\t\t\tif (!state) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst lineHeight = this._editorObs.getOption(EditorOption.lineHeight);\n\t\t\tstore.add(this._editorObs.createContentWidget({\n\t\t\t\tposition: constObservable<IContentWidgetPosition>({\n\t\t\t\t\tposition: new Position(state.lineNumber, Number.MAX_SAFE_INTEGER),\n\t\t\t\t\tpreference: [ContentWidgetPositionPreference.EXACT],\n\t\t\t\t\tpositionAffinity: PositionAffinity.Right,\n\t\t\t\t}),\n\t\t\t\tallowEditorOverflow: false,\n\t\t\t\tdomNode: n.div({\n\t\t\t\t\tclass: 'ghost-text-view-warning-widget',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\twidth: lineHeight,\n\t\t\t\t\t\theight: lineHeight,\n\t\t\t\t\t\tmarginLeft: 4,\n\t\t\t\t\t\tcolor: 'orange',\n\t\t\t\t\t},\n\t\t\t\t\tref: (dom) => {\n\t\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\t\t\t(dom as any as WidgetDomElement).ghostTextViewWarningWidgetData = { range: Range.fromPositions(state.position) };\n\t\t\t\t\t}\n\t\t\t\t}, [\n\t\t\t\t\tn.div({\n\t\t\t\t\t\tclass: 'ghost-text-view-warning-widget-icon',\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\talignContent: 'center',\n\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\t[renderIcon(state.icon)]\n\t\t\t\t\t)\n\t\t\t\t]).keepUpdated(store).element,\n\t\t\t}));\n\t\t}));\n\t}\n\n\tpublic static getWarningWidgetContext(domNode: HTMLElement): { range: Range } | undefined {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tconst data = (domNode as any as WidgetDomElement).ghostTextViewWarningWidgetData;\n\t\tif (data) {\n\t\t\treturn data;\n\t\t} else if (domNode.parentElement) {\n\t\t\treturn this.getWarningWidgetContext(domNode.parentElement);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate readonly _extraClassNames = derived(this, reader => {\n\t\tconst extraClasses = this._extraClasses.slice();\n\t\tif (this._useSyntaxHighlighting.read(reader)) {\n\t\t\textraClasses.push('syntax-highlighted');\n\t\t}\n\t\tif (USE_SQUIGGLES_FOR_WARNING && this._warningState.read(reader)) {\n\t\t\textraClasses.push('warning');\n\t\t}\n\t\tconst extraClassNames = extraClasses.map(c => ` ${c}`).join('');\n\t\treturn extraClassNames;\n\t});\n\n\tprivate readonly _state = derived(this, reader => {\n\t\tif (this._isDisposed.read(reader)) { return undefined; }\n\n\t\tconst props = this._data.read(reader);\n\t\tif (!props) { return undefined; }\n\n\t\tconst textModel = this._editorObs.model.read(reader);\n\t\tif (!textModel) { return undefined; }\n\n\t\tconst ghostText = props.ghostText;\n\t\tconst replacedRange = ghostText instanceof GhostTextReplacement ? ghostText.columnRange : undefined;\n\n\t\tconst syntaxHighlightingEnabled = this._useSyntaxHighlighting.read(reader);\n\t\tconst extraClassNames = this._extraClassNames.read(reader);\n\t\tconst { inlineTexts, additionalLines, hiddenRange, additionalLinesOriginalSuffix } = computeGhostTextViewData(ghostText, textModel, GHOST_TEXT_CLASS_NAME + extraClassNames);\n\n\t\tconst currentLine = textModel.getLineContent(ghostText.lineNumber);\n\t\tconst edit = new StringEdit(inlineTexts.map(t => StringReplacement.insert(t.column - 1, t.text)));\n\t\tconst tokens = syntaxHighlightingEnabled ? textModel.tokenization.tokenizeLinesAt(ghostText.lineNumber, [edit.apply(currentLine), ...additionalLines.map(l => l.content)]) : undefined;\n\t\tconst newRanges = edit.getNewRanges();\n\t\tconst inlineTextsWithTokens = inlineTexts.map((t, idx) => ({ ...t, tokens: tokens?.[0]?.getTokensInRange(newRanges[idx]) }));\n\n\t\tconst tokenizedAdditionalLines: LineData[] = additionalLines.map((l, idx) => {\n\t\t\tlet content = tokens?.[idx + 1] ?? LineTokens.createEmpty(l.content, this._languageService.languageIdCodec);\n\t\t\tif (idx === additionalLines.length - 1 && additionalLinesOriginalSuffix) {\n\t\t\t\tconst t = TokenWithTextArray.fromLineTokens(textModel.tokenization.getLineTokens(additionalLinesOriginalSuffix.lineNumber));\n\t\t\t\tconst existingContent = t.slice(additionalLinesOriginalSuffix.columnRange.toZeroBasedOffsetRange());\n\t\t\t\tcontent = TokenWithTextArray.fromLineTokens(content).append(existingContent).toLineTokens(content.languageIdCodec);\n\t\t\t}\n\t\t\treturn new LineData(\n\t\t\t\tcontent,\n\t\t\t\tl.decorations,\n\t\t\t);\n\t\t});\n\n\t\tconst cursorColumn = this._editor.getSelection()?.getStartPosition().column!;\n\t\tconst disjointInlineTexts = inlineTextsWithTokens.filter(inline => inline.text !== '');\n\t\tconst hasInsertionOnCurrentLine = disjointInlineTexts.length !== 0;\n\t\tconst telemetryViewData = new InlineCompletionViewData(\n\t\t\t(hasInsertionOnCurrentLine ? disjointInlineTexts[0].column : 1) - cursorColumn,\n\t\t\thasInsertionOnCurrentLine ? 0 : (additionalLines.findIndex(line => line.content !== '') + 1),\n\t\t\thasInsertionOnCurrentLine ? 1 : 0,\n\t\t\tadditionalLines.length + (hasInsertionOnCurrentLine ? 1 : 0),\n\t\t\t0,\n\t\t\tsum(disjointInlineTexts.map(inline => inline.text.length)) + sum(tokenizedAdditionalLines.map(line => line.content.getTextLength())),\n\t\t\tdisjointInlineTexts.length + (additionalLines.length > 0 ? 1 : 0),\n\t\t\tdisjointInlineTexts.length > 1 && tokenizedAdditionalLines.length === 0 ? disjointInlineTexts.every(inline => inline.text === disjointInlineTexts[0].text) : undefined\n\t\t);\n\n\t\treturn {\n\t\t\treplacedRange,\n\t\t\tinlineTexts: inlineTextsWithTokens,\n\t\t\tadditionalLines: tokenizedAdditionalLines,\n\t\t\thiddenRange,\n\t\t\tlineNumber: ghostText.lineNumber,\n\t\t\tadditionalReservedLineCount: this._minReservedLineCount.read(reader),\n\t\t\ttargetTextModel: textModel,\n\t\t\tsyntaxHighlightingEnabled,\n\t\t\ttelemetryViewData,\n\t\t\thandleInlineCompletionShown: props.handleInlineCompletionShown,\n\t\t};\n\t});\n\n\tprivate readonly _decorations = derived(this, reader => {\n\t\tconst uiState = this._state.read(reader);\n\t\tif (!uiState) { return []; }\n\n\t\tconst decorations: IModelDeltaDecoration[] = [];\n\n\t\tconst extraClassNames = this._extraClassNames.read(reader);\n\n\t\tif (uiState.replacedRange) {\n\t\t\tdecorations.push({\n\t\t\t\trange: uiState.replacedRange.toRange(uiState.lineNumber),\n\t\t\t\toptions: { inlineClassName: 'inline-completion-text-to-replace' + extraClassNames, description: 'GhostTextReplacement' }\n\t\t\t});\n\t\t}\n\n\t\tif (uiState.hiddenRange) {\n\t\t\tdecorations.push({\n\t\t\t\trange: uiState.hiddenRange.toRange(uiState.lineNumber),\n\t\t\t\toptions: { inlineClassName: 'ghost-text-hidden', description: 'ghost-text-hidden', }\n\t\t\t});\n\t\t}\n\n\t\tfor (const p of uiState.inlineTexts) {\n\t\t\tdecorations.push({\n\t\t\t\trange: Range.fromPositions(new Position(uiState.lineNumber, p.column)),\n\t\t\t\toptions: {\n\t\t\t\t\tdescription: 'ghost-text-decoration',\n\t\t\t\t\tafter: {\n\t\t\t\t\t\tcontent: p.text,\n\t\t\t\t\t\ttokens: p.tokens,\n\t\t\t\t\t\tinlineClassName: (p.preview ? 'ghost-text-decoration-preview' : 'ghost-text-decoration')\n\t\t\t\t\t\t\t+ (this._isClickable ? ' clickable' : '')\n\t\t\t\t\t\t\t+ extraClassNames\n\t\t\t\t\t\t\t+ p.lineDecorations.map(d => ' ' + d.className).join(' '), // TODO: take the ranges into account for line decorations\n\t\t\t\t\t\tcursorStops: InjectedTextCursorStops.Left,\n\t\t\t\t\t\tattachedData: new GhostTextAttachedData(this),\n\t\t\t\t\t},\n\t\t\t\t\tshowIfCollapsed: true,\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn decorations;\n\t});\n\n\tprivate readonly _additionalLinesWidget;\n\n\tprivate readonly _isInlineTextHovered;\n\n\tpublic readonly isHovered = derived(this, reader => {\n\t\tif (this._isDisposed.read(reader)) { return false; }\n\t\treturn this._isInlineTextHovered.read(reader) || this._additionalLinesWidget.isHovered.read(reader);\n\t});\n\n\tpublic readonly height = derived(this, reader => {\n\t\tconst lineHeight = this._editorObs.getOption(EditorOption.lineHeight).read(reader);\n\t\treturn lineHeight + (this._additionalLinesWidget.viewZoneHeight.read(reader) ?? 0);\n\t});\n\n\tpublic ownsViewZone(viewZoneId: string): boolean {\n\t\treturn this._additionalLinesWidget.viewZoneId === viewZoneId;\n\t}\n}\n\nclass GhostTextAttachedData {\n\tconstructor(public readonly owner: GhostTextView) { }\n}\n\ninterface WidgetDomElement {\n\tghostTextViewWarningWidgetData?: {\n\t\trange: Range;\n\t};\n}\n\nfunction computeGhostTextViewData(ghostText: GhostText | GhostTextReplacement, textModel: ITextModel, ghostTextClassName: string) {\n\tconst inlineTexts: { column: number; text: string; preview: boolean; lineDecorations: LineDecoration[] }[] = [];\n\tconst additionalLines: { content: string; decorations: LineDecoration[] }[] = [];\n\n\tfunction addToAdditionalLines(ghLines: readonly IGhostTextLine[], className: string | undefined) {\n\t\tif (additionalLines.length > 0) {\n\t\t\tconst lastLine = additionalLines[additionalLines.length - 1];\n\t\t\tif (className) {\n\t\t\t\tlastLine.decorations.push(new LineDecoration(\n\t\t\t\t\tlastLine.content.length + 1,\n\t\t\t\t\tlastLine.content.length + 1 + ghLines[0].line.length,\n\t\t\t\t\tclassName,\n\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t));\n\t\t\t}\n\t\t\tlastLine.content += ghLines[0].line;\n\n\t\t\tghLines = ghLines.slice(1);\n\t\t}\n\t\tfor (const ghLine of ghLines) {\n\t\t\tadditionalLines.push({\n\t\t\t\tcontent: ghLine.line,\n\t\t\t\tdecorations: className ? [new LineDecoration(\n\t\t\t\t\t1,\n\t\t\t\t\tghLine.line.length + 1,\n\t\t\t\t\tclassName,\n\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t), ...ghLine.lineDecorations] : [...ghLine.lineDecorations]\n\t\t\t});\n\t\t}\n\t}\n\n\tconst textBufferLine = textModel.getLineContent(ghostText.lineNumber);\n\n\tlet hiddenTextStartColumn: number | undefined = undefined;\n\tlet lastIdx = 0;\n\tfor (const part of ghostText.parts) {\n\t\tlet ghLines = part.lines;\n\t\tif (hiddenTextStartColumn === undefined) {\n\t\t\tinlineTexts.push({ column: part.column, text: ghLines[0].line, preview: part.preview, lineDecorations: ghLines[0].lineDecorations });\n\t\t\tghLines = ghLines.slice(1);\n\t\t} else {\n\t\t\taddToAdditionalLines([{ line: textBufferLine.substring(lastIdx, part.column - 1), lineDecorations: [] }], undefined);\n\t\t}\n\n\t\tif (ghLines.length > 0) {\n\t\t\taddToAdditionalLines(ghLines, ghostTextClassName);\n\t\t\tif (hiddenTextStartColumn === undefined && part.column <= textBufferLine.length) {\n\t\t\t\thiddenTextStartColumn = part.column;\n\t\t\t}\n\t\t}\n\n\t\tlastIdx = part.column - 1;\n\t}\n\tlet additionalLinesOriginalSuffix: RangeSingleLine | undefined = undefined;\n\tif (hiddenTextStartColumn !== undefined) {\n\t\tadditionalLinesOriginalSuffix = new RangeSingleLine(ghostText.lineNumber, new ColumnRange(lastIdx + 1, textBufferLine.length + 1));\n\t}\n\n\tconst hiddenRange = hiddenTextStartColumn !== undefined ? new ColumnRange(hiddenTextStartColumn, textBufferLine.length + 1) : undefined;\n\n\treturn {\n\t\tinlineTexts,\n\t\tadditionalLines,\n\t\thiddenRange,\n\t\tadditionalLinesOriginalSuffix,\n\t};\n}\n\nclass AdditionalLinesData implements IEquatable<AdditionalLinesData> {\n\tconstructor(\n\t\tpublic readonly lineNumber: number,\n\t\tpublic readonly additionalLines: readonly LineData[],\n\t\tpublic readonly minReservedLineCount: number,\n\t) { }\n\n\tequals(other: AdditionalLinesData): boolean {\n\t\tif (this.lineNumber !== other.lineNumber) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this.minReservedLineCount !== other.minReservedLineCount) {\n\t\t\treturn false;\n\t\t}\n\t\treturn equals(this.additionalLines, other.additionalLines, thisEqualsC());\n\t}\n}\n\nexport class AdditionalLinesWidget extends Disposable {\n\tprivate _viewZoneInfo: { viewZoneId: string; heightInLines: number; lineNumber: number } | undefined;\n\tpublic get viewZoneId(): string | undefined { return this._viewZoneInfo?.viewZoneId; }\n\n\tprivate _viewZoneHeight;\n\tpublic get viewZoneHeight(): IObservable<number | undefined> { return this._viewZoneHeight; }\n\n\tprivate readonly editorOptionsChanged;\n\n\tprivate readonly _onDidClick;\n\tpublic readonly onDidClick;\n\n\tprivate readonly _viewZoneListener;\n\n\treadonly isHovered;\n\n\tprivate hasBeenAccepted;\n\n\tconstructor(\n\t\tprivate readonly _editor: ICodeEditor,\n\t\tprivate readonly _lines: IObservable<AdditionalLinesData | undefined>,\n\t\tprivate readonly _shouldKeepCursorStable: boolean,\n\t\tprivate readonly _isClickable: boolean,\n\t) {\n\t\tsuper();\n\t\tthis._viewZoneHeight = observableValue<undefined | number>('viewZoneHeight', undefined);\n\t\tthis.editorOptionsChanged = observableSignalFromEvent('editorOptionChanged', Event.filter(\n\t\t\tthis._editor.onDidChangeConfiguration,\n\t\t\te => e.hasChanged(EditorOption.disableMonospaceOptimizations)\n\t\t\t\t|| e.hasChanged(EditorOption.stopRenderingLineAfter)\n\t\t\t\t|| e.hasChanged(EditorOption.renderWhitespace)\n\t\t\t\t|| e.hasChanged(EditorOption.renderControlCharacters)\n\t\t\t\t|| e.hasChanged(EditorOption.fontLigatures)\n\t\t\t\t|| e.hasChanged(EditorOption.fontInfo)\n\t\t\t\t|| e.hasChanged(EditorOption.lineHeight)\n\t\t));\n\t\tthis._onDidClick = this._register(new Emitter<IMouseEvent>());\n\t\tthis.onDidClick = this._onDidClick.event;\n\t\tthis._viewZoneListener = this._register(new MutableDisposable());\n\t\tthis.isHovered = observableCodeEditor(this._editor).isTargetHovered(\n\t\t\tp => isTargetGhostText(p.target.element),\n\t\t\tthis._store\n\t\t);\n\t\tthis.hasBeenAccepted = false;\n\n\t\tif (this._editor instanceof CodeEditorWidget && this._shouldKeepCursorStable) {\n\t\t\tthis._register(this._editor.onBeforeExecuteEdit(e => this.hasBeenAccepted = e.source === 'inlineSuggestion.accept'));\n\t\t}\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update view zone */\n\t\t\tconst lines = this._lines.read(reader);\n\t\t\tthis.editorOptionsChanged.read(reader);\n\n\t\t\tif (lines) {\n\t\t\t\tthis.hasBeenAccepted = false;\n\t\t\t\tthis.updateLines(lines.lineNumber, lines.additionalLines, lines.minReservedLineCount);\n\t\t\t} else {\n\t\t\t\tthis.clear();\n\t\t\t}\n\t\t}));\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis.clear();\n\t}\n\n\tprivate clear(): void {\n\t\tthis._viewZoneListener.clear();\n\n\t\tthis._editor.changeViewZones((changeAccessor) => {\n\t\t\tthis.removeActiveViewZone(changeAccessor);\n\t\t});\n\t}\n\n\tprivate updateLines(lineNumber: number, additionalLines: readonly LineData[], minReservedLineCount: number): void {\n\t\tconst textModel = this._editor.getModel();\n\t\tif (!textModel) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { tabSize } = textModel.getOptions();\n\n\t\tobservableCodeEditor(this._editor).transaction(_ => {\n\t\t\tthis._editor.changeViewZones((changeAccessor) => {\n\t\t\t\tconst store = new DisposableStore();\n\n\t\t\t\tthis.removeActiveViewZone(changeAccessor);\n\n\t\t\t\tconst heightInLines = Math.max(additionalLines.length, minReservedLineCount);\n\t\t\t\tif (heightInLines > 0) {\n\t\t\t\t\tconst domNode = document.createElement('div');\n\t\t\t\t\trenderLines(domNode, tabSize, additionalLines, this._editor.getOptions(), this._isClickable);\n\n\t\t\t\t\tif (this._isClickable) {\n\t\t\t\t\t\tstore.add(addDisposableListener(domNode, 'mousedown', (e) => {\n\t\t\t\t\t\t\te.preventDefault(); // This prevents that the editor loses focus\n\t\t\t\t\t\t}));\n\t\t\t\t\t\tstore.add(addDisposableListener(domNode, 'click', (e) => {\n\t\t\t\t\t\t\tif (isTargetGhostText(e.target)) {\n\t\t\t\t\t\t\t\tthis._onDidClick.fire(new StandardMouseEvent(getWindow(e), e));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.addViewZone(changeAccessor, lineNumber, heightInLines, domNode);\n\t\t\t\t}\n\n\t\t\t\tthis._viewZoneListener.value = store;\n\t\t\t});\n\t\t});\n\t}\n\n\tprivate addViewZone(changeAccessor: IViewZoneChangeAccessor, afterLineNumber: number, heightInLines: number, domNode: HTMLElement): void {\n\t\tconst id = changeAccessor.addZone({\n\t\t\tafterLineNumber: afterLineNumber,\n\t\t\theightInLines: heightInLines,\n\t\t\tdomNode,\n\t\t\tafterColumnAffinity: PositionAffinity.Right,\n\t\t\tonComputedHeight: (height: number) => {\n\t\t\t\tthis._viewZoneHeight.set(height, undefined); // TODO: can a transaction be used to avoid flickering?\n\t\t\t}\n\t\t});\n\n\t\tthis.keepCursorStable(afterLineNumber, heightInLines);\n\n\t\tthis._viewZoneInfo = { viewZoneId: id, heightInLines, lineNumber: afterLineNumber };\n\t}\n\n\tprivate removeActiveViewZone(changeAccessor: IViewZoneChangeAccessor): void {\n\t\tif (this._viewZoneInfo) {\n\t\t\tchangeAccessor.removeZone(this._viewZoneInfo.viewZoneId);\n\n\t\t\tif (!this.hasBeenAccepted) {\n\t\t\t\tthis.keepCursorStable(this._viewZoneInfo.lineNumber, -this._viewZoneInfo.heightInLines);\n\t\t\t}\n\n\t\t\tthis._viewZoneInfo = undefined;\n\t\t\tthis._viewZoneHeight.set(undefined, undefined);\n\t\t}\n\t}\n\n\tprivate keepCursorStable(lineNumber: number, heightInLines: number): void {\n\t\tif (!this._shouldKeepCursorStable) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst cursorLineNumber = this._editor.getSelection()?.getStartPosition()?.lineNumber;\n\t\tif (cursorLineNumber !== undefined && lineNumber < cursorLineNumber) {\n\t\t\tthis._editor.setScrollTop(this._editor.getScrollTop() + heightInLines * this._editor.getOption(EditorOption.lineHeight));\n\t\t}\n\t}\n}\n\nfunction isTargetGhostText(target: EventTarget | null): boolean {\n\treturn isHTMLElement(target) && target.classList.contains(GHOST_TEXT_CLASS_NAME);\n}\n\nexport class LineData implements IEquatable<LineData> {\n\tconstructor(\n\t\tpublic readonly content: LineTokens, // Must not contain a linebreak!\n\t\tpublic readonly decorations: readonly LineDecoration[]\n\t) { }\n\n\tequals(other: LineData): boolean {\n\t\tif (!this.content.equals(other.content)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn LineDecoration.equalsArr(this.decorations, other.decorations);\n\t}\n}\n\nfunction renderLines(domNode: HTMLElement, tabSize: number, lines: readonly LineData[], opts: IComputedEditorOptions, isClickable: boolean): void {\n\tconst disableMonospaceOptimizations = opts.get(EditorOption.disableMonospaceOptimizations);\n\tconst stopRenderingLineAfter = opts.get(EditorOption.stopRenderingLineAfter);\n\t// To avoid visual confusion, we don't want to render visible whitespace\n\tconst renderWhitespace = 'none';\n\tconst renderControlCharacters = opts.get(EditorOption.renderControlCharacters);\n\tconst fontLigatures = opts.get(EditorOption.fontLigatures);\n\tconst fontInfo = opts.get(EditorOption.fontInfo);\n\tconst lineHeight = opts.get(EditorOption.lineHeight);\n\n\tlet classNames = 'suggest-preview-text';\n\tif (isClickable) {\n\t\tclassNames += ' clickable';\n\t}\n\n\tconst sb = new StringBuilder(10000);\n\tsb.appendString(`<div class=\"${classNames}\">`);\n\n\tfor (let i = 0, len = lines.length; i < len; i++) {\n\t\tconst lineData = lines[i];\n\t\tconst lineTokens = lineData.content;\n\t\tsb.appendString('<div class=\"view-line');\n\t\tsb.appendString('\" style=\"top:');\n\t\tsb.appendString(String(i * lineHeight));\n\t\tsb.appendString('px;width:1000000px;\">');\n\n\t\tconst line = lineTokens.getLineContent();\n\t\tconst isBasicASCII = strings.isBasicASCII(line);\n\t\tconst containsRTL = strings.containsRTL(line);\n\n\t\trenderViewLine(new RenderLineInput(\n\t\t\t(fontInfo.isMonospace && !disableMonospaceOptimizations),\n\t\t\tfontInfo.canUseHalfwidthRightwardsArrow,\n\t\t\tline,\n\t\t\tfalse,\n\t\t\tisBasicASCII,\n\t\t\tcontainsRTL,\n\t\t\t0,\n\t\t\tlineTokens,\n\t\t\tlineData.decorations.slice(),\n\t\t\ttabSize,\n\t\t\t0,\n\t\t\tfontInfo.spaceWidth,\n\t\t\tfontInfo.middotWidth,\n\t\t\tfontInfo.wsmiddotWidth,\n\t\t\tstopRenderingLineAfter,\n\t\t\trenderWhitespace,\n\t\t\trenderControlCharacters,\n\t\t\tfontLigatures !== EditorFontLigatures.OFF,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\t0\n\t\t), sb);\n\n\t\tsb.appendString('</div>');\n\t}\n\tsb.appendString('</div>');\n\n\tapplyFontInfo(domNode, fontInfo);\n\tconst html = sb.build();\n\tconst trustedhtml = ttPolicy ? ttPolicy.createHTML(html) : html;\n\tdomNode.innerHTML = trustedhtml as string;\n}\n\nexport const ttPolicy = createTrustedTypesPolicy('editorGhostText', { createHTML: value => value });\n"]}
@@ -30,7 +30,7 @@ import { nativeHoverDelegate } from '../../../../../../../platform/hover/browser
30
30
  import { IKeybindingService } from '../../../../../../../platform/keybinding/common/keybinding.js';
31
31
  import { defaultKeybindingLabelStyles } from '../../../../../../../platform/theme/browser/defaultStyles.js';
32
32
  import { asCssVariable, descriptionForeground, editorActionListForeground, editorHoverBorder } from '../../../../../../../platform/theme/common/colorRegistry.js';
33
- import { hideInlineCompletionId, inlineSuggestCommitId, toggleShowCollapsedId } from '../../../controller/commandIds.js';
33
+ import { hideInlineCompletionId, inlineSuggestCommitAlternativeActionId, inlineSuggestCommitId, toggleShowCollapsedId } from '../../../controller/commandIds.js';
34
34
  let GutterIndicatorMenuContent = class GutterIndicatorMenuContent {
35
35
  constructor(_editorObs, _data, _close, _contextKeyService, _keybindingService, _commandService) {
36
36
  this._editorObs = _editorObs;
@@ -62,16 +62,22 @@ let GutterIndicatorMenuContent = class GutterIndicatorMenuContent {
62
62
  const title = header(this._data.displayName);
63
63
  const gotoAndAccept = option(createOptionArgs({
64
64
  id: 'gotoAndAccept',
65
- title: `${localize(1219, "Go To")} / ${localize(1220, "Accept")}`,
65
+ title: `${localize(1223, "Go To")} / ${localize(1224, "Accept")}`,
66
66
  icon: Codicon.check,
67
- commandId: inlineSuggestCommitId
67
+ commandId: inlineSuggestCommitId,
68
68
  }));
69
69
  const reject = option(createOptionArgs({
70
70
  id: 'reject',
71
- title: localize(1221, "Reject"),
71
+ title: localize(1225, "Reject"),
72
72
  icon: Codicon.close,
73
73
  commandId: hideInlineCompletionId
74
74
  }));
75
+ const alternativeCommand = this._data.alternativeAction ? option(createOptionArgs({
76
+ id: 'alternativeCommand',
77
+ title: this._data.alternativeAction.command.title,
78
+ icon: this._data.alternativeAction.icon,
79
+ commandId: inlineSuggestCommitAlternativeActionId,
80
+ })) : undefined;
75
81
  const extensionCommands = this._data.extensionCommands.map((c, idx) => option(createOptionArgs({
76
82
  id: c.command.id + '_' + idx,
77
83
  title: c.command.title,
@@ -79,28 +85,40 @@ let GutterIndicatorMenuContent = class GutterIndicatorMenuContent {
79
85
  commandId: c.command.id,
80
86
  commandArgs: c.command.arguments
81
87
  })));
88
+ const showModelEnabled = false;
89
+ const modelOptions = showModelEnabled ? this._data.modelInfo?.models.map((m) => option({
90
+ title: m.name,
91
+ icon: m.id === this._data.modelInfo?.currentModelId ? Codicon.check : Codicon.circle,
92
+ keybinding: constObservable(undefined),
93
+ isActive: activeElement.map(v => v === 'model_' + m.id),
94
+ onHoverChange: v => activeElement.set(v ? 'model_' + m.id : undefined, undefined),
95
+ onAction: () => {
96
+ this._close(true);
97
+ this._data.setModelId?.(m.id);
98
+ },
99
+ })) ?? [] : [];
82
100
  const toggleCollapsedMode = this._inlineEditsShowCollapsed.map(showCollapsed => showCollapsed ?
83
101
  option(createOptionArgs({
84
102
  id: 'showExpanded',
85
- title: localize(1222, "Show Expanded"),
103
+ title: localize(1226, "Show Expanded"),
86
104
  icon: Codicon.expandAll,
87
105
  commandId: toggleShowCollapsedId
88
106
  }))
89
107
  : option(createOptionArgs({
90
108
  id: 'showCollapsed',
91
- title: localize(1223, "Show Collapsed"),
109
+ title: localize(1227, "Show Collapsed"),
92
110
  icon: Codicon.collapseAll,
93
111
  commandId: toggleShowCollapsedId
94
112
  })));
95
113
  const snooze = option(createOptionArgs({
96
114
  id: 'snooze',
97
- title: localize(1224, "Snooze"),
115
+ title: localize(1228, "Snooze"),
98
116
  icon: Codicon.bellSlash,
99
117
  commandId: 'editor.action.inlineSuggest.snooze'
100
118
  }));
101
119
  const settings = option(createOptionArgs({
102
120
  id: 'settings',
103
- title: localize(1225, "Settings"),
121
+ title: localize(1229, "Settings"),
104
122
  icon: Codicon.gear,
105
123
  commandId: 'workbench.action.openSettings',
106
124
  commandArgs: ['@tag:nextEditSuggestions']
@@ -117,8 +135,11 @@ let GutterIndicatorMenuContent = class GutterIndicatorMenuContent {
117
135
  return hoverContent([
118
136
  title,
119
137
  gotoAndAccept,
138
+ alternativeCommand,
120
139
  reject,
121
140
  toggleCollapsedMode,
141
+ modelOptions.length ? separator() : undefined,
142
+ ...modelOptions,
122
143
  extensionCommands.length ? separator() : undefined,
123
144
  snooze,
124
145
  settings,
@@ -1 +1 @@
1
- {"version":3,"sources":["vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAA0B,CAAC,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAE,SAAS,EAAqB,MAAM,6DAA6D,CAAC;AAC3G,OAAO,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,yEAAyE,CAAC;AAE1G,OAAO,EAAE,OAAO,EAAE,MAAM,8CAA8C,CAAC;AAEvE,OAAO,EAAe,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACtJ,OAAO,EAAE,EAAE,EAAE,MAAM,8CAA8C,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAC1E,OAAO,EAAE,QAAQ,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,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;gBAClE,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACvD,CAAC;SACD,CAAC;KACF,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,SAAS;IACjB,OAAO,CAAC,CAAC,GAAG,CAAC;QACZ,EAAE,EAAE,6CAA6C;QACjD,KAAK,EAAE,gBAAgB;QACvB,KAAK,EAAE;YACN,KAAK,EAAE,aAAa,CAAC,0BAA0B,CAAC;YAChD,OAAO,EAAE,OAAO;SAChB;KACD,EAAE,CAAC,CAAC,GAAG,CAAC;QACR,KAAK,EAAE;YACN,YAAY,EAAE,aAAa,aAAa,CAAC,iBAAiB,CAAC,EAAE;SAC7D;KACD,CAAC,CAAC,CAAC;AACL,CAAC","file":"gutterIndicatorMenu.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { ChildNode, LiveElement, n } from '../../../../../../../base/browser/dom.js';\nimport { ActionBar, IActionBarOptions } from '../../../../../../../base/browser/ui/actionbar/actionbar.js';\nimport { renderIcon } from '../../../../../../../base/browser/ui/iconLabel/iconLabels.js';\nimport { KeybindingLabel } from '../../../../../../../base/browser/ui/keybindingLabel/keybindingLabel.js';\nimport { IAction } from '../../../../../../../base/common/actions.js';\nimport { Codicon } from '../../../../../../../base/common/codicons.js';\nimport { ResolvedKeybinding } from '../../../../../../../base/common/keybindings.js';\nimport { IObservable, autorun, constObservable, derived, observableFromEvent, observableValue } from '../../../../../../../base/common/observable.js';\nimport { OS } from '../../../../../../../base/common/platform.js';\nimport { ThemeIcon } from '../../../../../../../base/common/themables.js';\nimport { localize } from '../../../../../../../nls.js';\nimport { ICommandService } from '../../../../../../../platform/commands/common/commands.js';\nimport { IContextKeyService } from '../../../../../../../platform/contextkey/common/contextkey.js';\nimport { nativeHoverDelegate } from '../../../../../../../platform/hover/browser/hover.js';\nimport { IKeybindingService } from '../../../../../../../platform/keybinding/common/keybinding.js';\nimport { defaultKeybindingLabelStyles } from '../../../../../../../platform/theme/browser/defaultStyles.js';\nimport { asCssVariable, descriptionForeground, editorActionListForeground, editorHoverBorder } from '../../../../../../../platform/theme/common/colorRegistry.js';\nimport { ObservableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { EditorOption } from '../../../../../../common/config/editorOptions.js';\nimport { hideInlineCompletionId, inlineSuggestCommitId, toggleShowCollapsedId } from '../../../controller/commandIds.js';\nimport { FirstFnArg } from '../utils/utils.js';\nimport { InlineSuggestionGutterMenuData } from './gutterIndicatorView.js';\n\nexport class GutterIndicatorMenuContent {\n\tprivate readonly _inlineEditsShowCollapsed: IObservable<boolean>;\n\n\tconstructor(\n\t\tprivate readonly _editorObs: ObservableCodeEditor,\n\t\tprivate readonly _data: InlineSuggestionGutterMenuData,\n\t\tprivate readonly _close: (focusEditor: boolean) => void,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t) {\n\t\tthis._inlineEditsShowCollapsed = this._editorObs.getOption(EditorOption.inlineSuggest).map(s => s.edits.showCollapsed);\n\t}\n\n\tpublic toDisposableLiveElement(): LiveElement {\n\t\treturn this._createHoverContent().toDisposableLiveElement();\n\t}\n\n\tprivate _createHoverContent() {\n\t\tconst activeElement = observableValue<string | undefined>('active', undefined);\n\n\t\tconst createOptionArgs = (options: { id: string; title: string; icon: IObservable<ThemeIcon> | ThemeIcon; commandId: string | IObservable<string>; commandArgs?: unknown[] }): FirstFnArg<typeof option> => {\n\t\t\treturn {\n\t\t\t\ttitle: options.title,\n\t\t\t\ticon: options.icon,\n\t\t\t\tkeybinding: typeof options.commandId === 'string' ? this._getKeybinding(options.commandArgs ? undefined : options.commandId) : derived(this, reader => typeof options.commandId === 'string' ? undefined : this._getKeybinding(options.commandArgs ? undefined : options.commandId.read(reader)).read(reader)),\n\t\t\t\tisActive: activeElement.map(v => v === options.id),\n\t\t\t\tonHoverChange: v => activeElement.set(v ? options.id : undefined, undefined),\n\t\t\t\tonAction: () => {\n\t\t\t\t\tthis._close(true);\n\t\t\t\t\treturn this._commandService.executeCommand(typeof options.commandId === 'string' ? options.commandId : options.commandId.get(), ...(options.commandArgs ?? []));\n\t\t\t\t},\n\t\t\t};\n\t\t};\n\n\t\tconst title = header(this._data.displayName);\n\n\t\tconst gotoAndAccept = option(createOptionArgs({\n\t\t\tid: 'gotoAndAccept',\n\t\t\ttitle: `${localize('goto', \"Go To\")} / ${localize('accept', \"Accept\")}`,\n\t\t\ticon: Codicon.check,\n\t\t\tcommandId: inlineSuggestCommitId\n\t\t}));\n\n\t\tconst reject = option(createOptionArgs({\n\t\t\tid: 'reject',\n\t\t\ttitle: localize('reject', \"Reject\"),\n\t\t\ticon: Codicon.close,\n\t\t\tcommandId: hideInlineCompletionId\n\t\t}));\n\n\t\tconst extensionCommands = this._data.extensionCommands.map((c, idx) => option(createOptionArgs({\n\t\t\tid: c.command.id + '_' + idx,\n\t\t\ttitle: c.command.title,\n\t\t\ticon: c.icon ?? Codicon.symbolEvent,\n\t\t\tcommandId: c.command.id,\n\t\t\tcommandArgs: c.command.arguments\n\t\t})));\n\n\t\tconst toggleCollapsedMode = this._inlineEditsShowCollapsed.map(showCollapsed => showCollapsed ?\n\t\t\toption(createOptionArgs({\n\t\t\t\tid: 'showExpanded',\n\t\t\t\ttitle: localize('showExpanded', \"Show Expanded\"),\n\t\t\t\ticon: Codicon.expandAll,\n\t\t\t\tcommandId: toggleShowCollapsedId\n\t\t\t}))\n\t\t\t: option(createOptionArgs({\n\t\t\t\tid: 'showCollapsed',\n\t\t\t\ttitle: localize('showCollapsed', \"Show Collapsed\"),\n\t\t\t\ticon: Codicon.collapseAll,\n\t\t\t\tcommandId: toggleShowCollapsedId\n\t\t\t}))\n\t\t);\n\n\t\tconst snooze = option(createOptionArgs({\n\t\t\tid: 'snooze',\n\t\t\ttitle: localize('snooze', \"Snooze\"),\n\t\t\ticon: Codicon.bellSlash,\n\t\t\tcommandId: 'editor.action.inlineSuggest.snooze'\n\t\t}));\n\n\t\tconst settings = option(createOptionArgs({\n\t\t\tid: 'settings',\n\t\t\ttitle: localize('settings', \"Settings\"),\n\t\t\ticon: Codicon.gear,\n\t\t\tcommandId: 'workbench.action.openSettings',\n\t\t\tcommandArgs: ['@tag:nextEditSuggestions']\n\t\t}));\n\n\t\tconst actions = this._data.action ? [this._data.action] : [];\n\t\tconst actionBarFooter = actions.length > 0 ? actionBar(\n\t\t\tactions.map(action => ({\n\t\t\t\tid: action.id,\n\t\t\t\tlabel: action.title + '...',\n\t\t\t\tenabled: true,\n\t\t\t\trun: () => this._commandService.executeCommand(action.id, ...(action.arguments ?? [])),\n\t\t\t\tclass: undefined,\n\t\t\t\ttooltip: action.tooltip ?? action.title\n\t\t\t})),\n\t\t\t{ hoverDelegate: nativeHoverDelegate /* unable to show hover inside another hover */ }\n\t\t) : undefined;\n\n\t\treturn hoverContent([\n\t\t\ttitle,\n\t\t\tgotoAndAccept,\n\t\t\treject,\n\t\t\ttoggleCollapsedMode,\n\t\t\textensionCommands.length ? separator() : undefined,\n\t\t\tsnooze,\n\t\t\tsettings,\n\n\t\t\t...extensionCommands,\n\n\t\t\tactionBarFooter ? separator() : undefined,\n\t\t\tactionBarFooter\n\t\t]);\n\t}\n\n\tprivate _getKeybinding(commandId: string | undefined) {\n\t\tif (!commandId) {\n\t\t\treturn constObservable(undefined);\n\t\t}\n\t\treturn observableFromEvent(this._contextKeyService.onDidChangeContext, () => this._keybindingService.lookupKeybinding(commandId)); // TODO: use contextkeyservice to use different renderings\n\t}\n}\n\nfunction hoverContent(content: ChildNode) {\n\treturn n.div({\n\t\tclass: 'content',\n\t\tstyle: {\n\t\t\tmargin: 4,\n\t\t\tminWidth: 180,\n\t\t}\n\t}, content);\n}\n\nfunction header(title: string | IObservable<string>) {\n\treturn n.div({\n\t\tclass: 'header',\n\t\tstyle: {\n\t\t\tcolor: asCssVariable(descriptionForeground),\n\t\t\tfontSize: '13px',\n\t\t\tfontWeight: '600',\n\t\t\tpadding: '0 4px',\n\t\t\tlineHeight: 28,\n\t\t}\n\t}, [title]);\n}\n\nfunction option(props: {\n\ttitle: string;\n\ticon: IObservable<ThemeIcon> | ThemeIcon;\n\tkeybinding: IObservable<ResolvedKeybinding | undefined>;\n\tisActive?: IObservable<boolean>;\n\tonHoverChange?: (isHovered: boolean) => void;\n\tonAction?: () => void;\n}) {\n\treturn derived({ name: 'inlineEdits.option' }, (_reader) => n.div({\n\t\tclass: ['monaco-menu-option', props.isActive?.map(v => v && 'active')],\n\t\tonmouseenter: () => props.onHoverChange?.(true),\n\t\tonmouseleave: () => props.onHoverChange?.(false),\n\t\tonclick: props.onAction,\n\t\tonkeydown: e => {\n\t\t\tif (e.key === 'Enter') {\n\t\t\t\tprops.onAction?.();\n\t\t\t}\n\t\t},\n\t\ttabIndex: 0,\n\t\tstyle: {\n\t\t\tborderRadius: 3, // same as hover widget border radius\n\t\t}\n\t}, [\n\t\tn.elem('span', {\n\t\t\tstyle: {\n\t\t\t\tfontSize: 16,\n\t\t\t\tdisplay: 'flex',\n\t\t\t}\n\t\t}, [ThemeIcon.isThemeIcon(props.icon) ? renderIcon(props.icon) : props.icon.map(icon => renderIcon(icon))]),\n\t\tn.elem('span', {}, [props.title]),\n\t\tn.div({\n\t\t\tstyle: { marginLeft: 'auto' },\n\t\t\tref: elem => {\n\t\t\t\tconst keybindingLabel = _reader.store.add(new KeybindingLabel(elem, OS, {\n\t\t\t\t\tdisableTitle: true,\n\t\t\t\t\t...defaultKeybindingLabelStyles,\n\t\t\t\t\tkeybindingLabelShadow: undefined,\n\t\t\t\t\tkeybindingLabelForeground: asCssVariable(descriptionForeground),\n\t\t\t\t\tkeybindingLabelBackground: 'transparent',\n\t\t\t\t\tkeybindingLabelBorder: 'transparent',\n\t\t\t\t\tkeybindingLabelBottomBorder: undefined,\n\t\t\t\t}));\n\t\t\t\t_reader.store.add(autorun(reader => {\n\t\t\t\t\tkeybindingLabel.set(props.keybinding.read(reader));\n\t\t\t\t}));\n\t\t\t}\n\t\t})\n\t]));\n}\n\n// TODO: make this observable\nfunction actionBar(actions: IAction[], options: IActionBarOptions) {\n\treturn derived({ name: 'inlineEdits.actionBar' }, (_reader) => n.div({\n\t\tclass: ['action-widget-action-bar'],\n\t\tstyle: {\n\t\t\tpadding: '3px 24px',\n\t\t}\n\t}, [\n\t\tn.div({\n\t\t\tref: elem => {\n\t\t\t\tconst actionBar = _reader.store.add(new ActionBar(elem, options));\n\t\t\t\tactionBar.push(actions, { icon: false, label: true });\n\t\t\t}\n\t\t})\n\t]));\n}\n\nfunction separator() {\n\treturn n.div({\n\t\tid: 'inline-edit-gutter-indicator-menu-separator',\n\t\tclass: 'menu-separator',\n\t\tstyle: {\n\t\t\tcolor: asCssVariable(editorActionListForeground),\n\t\t\tpadding: '2px 0',\n\t\t}\n\t}, n.div({\n\t\tstyle: {\n\t\t\tborderBottom: `1px solid ${asCssVariable(editorHoverBorder)}`,\n\t\t}\n\t}));\n}\n"]}
1
+ {"version":3,"sources":["vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAA0B,CAAC,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAE,SA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","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { ChildNode, LiveElement, n } from '../../../../../../../base/browser/dom.js';\nimport { ActionBar, IActionBarOptions } from '../../../../../../../base/browser/ui/actionbar/actionbar.js';\nimport { renderIcon } from '../../../../../../../base/browser/ui/iconLabel/iconLabels.js';\nimport { KeybindingLabel } from '../../../../../../../base/browser/ui/keybindingLabel/keybindingLabel.js';\nimport { IAction } from '../../../../../../../base/common/actions.js';\nimport { Codicon } from '../../../../../../../base/common/codicons.js';\nimport { ResolvedKeybinding } from '../../../../../../../base/common/keybindings.js';\nimport { IObservable, autorun, constObservable, derived, observableFromEvent, observableValue } from '../../../../../../../base/common/observable.js';\nimport { OS } from '../../../../../../../base/common/platform.js';\nimport { ThemeIcon } from '../../../../../../../base/common/themables.js';\nimport { localize } from '../../../../../../../nls.js';\nimport { ICommandService } from '../../../../../../../platform/commands/common/commands.js';\nimport { IContextKeyService } from '../../../../../../../platform/contextkey/common/contextkey.js';\nimport { nativeHoverDelegate } from '../../../../../../../platform/hover/browser/hover.js';\nimport { IKeybindingService } from '../../../../../../../platform/keybinding/common/keybinding.js';\nimport { defaultKeybindingLabelStyles } from '../../../../../../../platform/theme/browser/defaultStyles.js';\nimport { asCssVariable, descriptionForeground, editorActionListForeground, editorHoverBorder } from '../../../../../../../platform/theme/common/colorRegistry.js';\nimport { ObservableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { EditorOption } from '../../../../../../common/config/editorOptions.js';\nimport { hideInlineCompletionId, inlineSuggestCommitAlternativeActionId, inlineSuggestCommitId, toggleShowCollapsedId } from '../../../controller/commandIds.js';\nimport { FirstFnArg } from '../utils/utils.js';\nimport { InlineSuggestionGutterMenuData } from './gutterIndicatorView.js';\n\nexport class GutterIndicatorMenuContent {\n\tprivate readonly _inlineEditsShowCollapsed: IObservable<boolean>;\n\n\tconstructor(\n\t\tprivate readonly _editorObs: ObservableCodeEditor,\n\t\tprivate readonly _data: InlineSuggestionGutterMenuData,\n\t\tprivate readonly _close: (focusEditor: boolean) => void,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t) {\n\t\tthis._inlineEditsShowCollapsed = this._editorObs.getOption(EditorOption.inlineSuggest).map(s => s.edits.showCollapsed);\n\t}\n\n\tpublic toDisposableLiveElement(): LiveElement {\n\t\treturn this._createHoverContent().toDisposableLiveElement();\n\t}\n\n\tprivate _createHoverContent() {\n\t\tconst activeElement = observableValue<string | undefined>('active', undefined);\n\n\t\tconst createOptionArgs = (options: { id: string; title: string; icon: IObservable<ThemeIcon> | ThemeIcon; commandId: string | IObservable<string>; commandArgs?: unknown[] }): FirstFnArg<typeof option> => {\n\t\t\treturn {\n\t\t\t\ttitle: options.title,\n\t\t\t\ticon: options.icon,\n\t\t\t\tkeybinding: typeof options.commandId === 'string' ? this._getKeybinding(options.commandArgs ? undefined : options.commandId) : derived(this, reader => typeof options.commandId === 'string' ? undefined : this._getKeybinding(options.commandArgs ? undefined : options.commandId.read(reader)).read(reader)),\n\t\t\t\tisActive: activeElement.map(v => v === options.id),\n\t\t\t\tonHoverChange: v => activeElement.set(v ? options.id : undefined, undefined),\n\t\t\t\tonAction: () => {\n\t\t\t\t\tthis._close(true);\n\t\t\t\t\treturn this._commandService.executeCommand(typeof options.commandId === 'string' ? options.commandId : options.commandId.get(), ...(options.commandArgs ?? []));\n\t\t\t\t},\n\t\t\t};\n\t\t};\n\n\t\tconst title = header(this._data.displayName);\n\n\t\tconst gotoAndAccept = option(createOptionArgs({\n\t\t\tid: 'gotoAndAccept',\n\t\t\ttitle: `${localize('goto', \"Go To\")} / ${localize('accept', \"Accept\")}`,\n\t\t\ticon: Codicon.check,\n\t\t\tcommandId: inlineSuggestCommitId,\n\t\t}));\n\n\t\tconst reject = option(createOptionArgs({\n\t\t\tid: 'reject',\n\t\t\ttitle: localize('reject', \"Reject\"),\n\t\t\ticon: Codicon.close,\n\t\t\tcommandId: hideInlineCompletionId\n\t\t}));\n\n\t\tconst alternativeCommand = this._data.alternativeAction ? option(createOptionArgs({\n\t\t\tid: 'alternativeCommand',\n\t\t\ttitle: this._data.alternativeAction.command.title,\n\t\t\ticon: this._data.alternativeAction.icon,\n\t\t\tcommandId: inlineSuggestCommitAlternativeActionId,\n\t\t})) : undefined;\n\n\t\tconst extensionCommands = this._data.extensionCommands.map((c, idx) => option(createOptionArgs({\n\t\t\tid: c.command.id + '_' + idx,\n\t\t\ttitle: c.command.title,\n\t\t\ticon: c.icon ?? Codicon.symbolEvent,\n\t\t\tcommandId: c.command.id,\n\t\t\tcommandArgs: c.command.arguments\n\t\t})));\n\n\t\tconst showModelEnabled = false;\n\t\tconst modelOptions = showModelEnabled ? this._data.modelInfo?.models.map((m: { id: string; name: string }) => option({\n\t\t\ttitle: m.name,\n\t\t\ticon: m.id === this._data.modelInfo?.currentModelId ? Codicon.check : Codicon.circle,\n\t\t\tkeybinding: constObservable(undefined),\n\t\t\tisActive: activeElement.map(v => v === 'model_' + m.id),\n\t\t\tonHoverChange: v => activeElement.set(v ? 'model_' + m.id : undefined, undefined),\n\t\t\tonAction: () => {\n\t\t\t\tthis._close(true);\n\t\t\t\tthis._data.setModelId?.(m.id);\n\t\t\t},\n\t\t})) ?? [] : [];\n\n\t\tconst toggleCollapsedMode = this._inlineEditsShowCollapsed.map(showCollapsed => showCollapsed ?\n\t\t\toption(createOptionArgs({\n\t\t\t\tid: 'showExpanded',\n\t\t\t\ttitle: localize('showExpanded', \"Show Expanded\"),\n\t\t\t\ticon: Codicon.expandAll,\n\t\t\t\tcommandId: toggleShowCollapsedId\n\t\t\t}))\n\t\t\t: option(createOptionArgs({\n\t\t\t\tid: 'showCollapsed',\n\t\t\t\ttitle: localize('showCollapsed', \"Show Collapsed\"),\n\t\t\t\ticon: Codicon.collapseAll,\n\t\t\t\tcommandId: toggleShowCollapsedId\n\t\t\t}))\n\t\t);\n\n\t\tconst snooze = option(createOptionArgs({\n\t\t\tid: 'snooze',\n\t\t\ttitle: localize('snooze', \"Snooze\"),\n\t\t\ticon: Codicon.bellSlash,\n\t\t\tcommandId: 'editor.action.inlineSuggest.snooze'\n\t\t}));\n\n\t\tconst settings = option(createOptionArgs({\n\t\t\tid: 'settings',\n\t\t\ttitle: localize('settings', \"Settings\"),\n\t\t\ticon: Codicon.gear,\n\t\t\tcommandId: 'workbench.action.openSettings',\n\t\t\tcommandArgs: ['@tag:nextEditSuggestions']\n\t\t}));\n\n\t\tconst actions = this._data.action ? [this._data.action] : [];\n\t\tconst actionBarFooter = actions.length > 0 ? actionBar(\n\t\t\tactions.map(action => ({\n\t\t\t\tid: action.id,\n\t\t\t\tlabel: action.title + '...',\n\t\t\t\tenabled: true,\n\t\t\t\trun: () => this._commandService.executeCommand(action.id, ...(action.arguments ?? [])),\n\t\t\t\tclass: undefined,\n\t\t\t\ttooltip: action.tooltip ?? action.title\n\t\t\t})),\n\t\t\t{ hoverDelegate: nativeHoverDelegate /* unable to show hover inside another hover */ }\n\t\t) : undefined;\n\n\t\treturn hoverContent([\n\t\t\ttitle,\n\t\t\tgotoAndAccept,\n\t\t\talternativeCommand,\n\t\t\treject,\n\t\t\ttoggleCollapsedMode,\n\t\t\tmodelOptions.length ? separator() : undefined,\n\t\t\t...modelOptions,\n\t\t\textensionCommands.length ? separator() : undefined,\n\t\t\tsnooze,\n\t\t\tsettings,\n\n\t\t\t...extensionCommands,\n\n\t\t\tactionBarFooter ? separator() : undefined,\n\t\t\tactionBarFooter\n\t\t]);\n\t}\n\n\tprivate _getKeybinding(commandId: string | undefined) {\n\t\tif (!commandId) {\n\t\t\treturn constObservable(undefined);\n\t\t}\n\t\treturn observableFromEvent(this._contextKeyService.onDidChangeContext, () => this._keybindingService.lookupKeybinding(commandId)); // TODO: use contextkeyservice to use different renderings\n\t}\n}\n\nfunction hoverContent(content: ChildNode) {\n\treturn n.div({\n\t\tclass: 'content',\n\t\tstyle: {\n\t\t\tmargin: 4,\n\t\t\tminWidth: 180,\n\t\t}\n\t}, content);\n}\n\nfunction header(title: string | IObservable<string>) {\n\treturn n.div({\n\t\tclass: 'header',\n\t\tstyle: {\n\t\t\tcolor: asCssVariable(descriptionForeground),\n\t\t\tfontSize: '13px',\n\t\t\tfontWeight: '600',\n\t\t\tpadding: '0 4px',\n\t\t\tlineHeight: 28,\n\t\t}\n\t}, [title]);\n}\n\nfunction option(props: {\n\ttitle: string;\n\ticon: IObservable<ThemeIcon> | ThemeIcon;\n\tkeybinding: IObservable<ResolvedKeybinding | undefined>;\n\tisActive?: IObservable<boolean>;\n\tonHoverChange?: (isHovered: boolean) => void;\n\tonAction?: () => void;\n}) {\n\treturn derived({ name: 'inlineEdits.option' }, (_reader) => n.div({\n\t\tclass: ['monaco-menu-option', props.isActive?.map(v => v && 'active')],\n\t\tonmouseenter: () => props.onHoverChange?.(true),\n\t\tonmouseleave: () => props.onHoverChange?.(false),\n\t\tonclick: props.onAction,\n\t\tonkeydown: e => {\n\t\t\tif (e.key === 'Enter') {\n\t\t\t\tprops.onAction?.();\n\t\t\t}\n\t\t},\n\t\ttabIndex: 0,\n\t\tstyle: {\n\t\t\tborderRadius: 3, // same as hover widget border radius\n\t\t}\n\t}, [\n\t\tn.elem('span', {\n\t\t\tstyle: {\n\t\t\t\tfontSize: 16,\n\t\t\t\tdisplay: 'flex',\n\t\t\t}\n\t\t}, [ThemeIcon.isThemeIcon(props.icon) ? renderIcon(props.icon) : props.icon.map(icon => renderIcon(icon))]),\n\t\tn.elem('span', {}, [props.title]),\n\t\tn.div({\n\t\t\tstyle: { marginLeft: 'auto' },\n\t\t\tref: elem => {\n\t\t\t\tconst keybindingLabel = _reader.store.add(new KeybindingLabel(elem, OS, {\n\t\t\t\t\tdisableTitle: true,\n\t\t\t\t\t...defaultKeybindingLabelStyles,\n\t\t\t\t\tkeybindingLabelShadow: undefined,\n\t\t\t\t\tkeybindingLabelForeground: asCssVariable(descriptionForeground),\n\t\t\t\t\tkeybindingLabelBackground: 'transparent',\n\t\t\t\t\tkeybindingLabelBorder: 'transparent',\n\t\t\t\t\tkeybindingLabelBottomBorder: undefined,\n\t\t\t\t}));\n\t\t\t\t_reader.store.add(autorun(reader => {\n\t\t\t\t\tkeybindingLabel.set(props.keybinding.read(reader));\n\t\t\t\t}));\n\t\t\t}\n\t\t})\n\t]));\n}\n\n// TODO: make this observable\nfunction actionBar(actions: IAction[], options: IActionBarOptions) {\n\treturn derived({ name: 'inlineEdits.actionBar' }, (_reader) => n.div({\n\t\tclass: ['action-widget-action-bar'],\n\t\tstyle: {\n\t\t\tpadding: '3px 24px',\n\t\t}\n\t}, [\n\t\tn.div({\n\t\t\tref: elem => {\n\t\t\t\tconst actionBar = _reader.store.add(new ActionBar(elem, options));\n\t\t\t\tactionBar.push(actions, { icon: false, label: true });\n\t\t\t}\n\t\t})\n\t]));\n}\n\nfunction separator() {\n\treturn n.div({\n\t\tid: 'inline-edit-gutter-indicator-menu-separator',\n\t\tclass: 'menu-separator',\n\t\tstyle: {\n\t\t\tcolor: asCssVariable(editorActionListForeground),\n\t\t\tpadding: '2px 0',\n\t\t}\n\t}, n.div({\n\t\tstyle: {\n\t\t\tborderBottom: `1px solid ${asCssVariable(editorHoverBorder)}`,\n\t\t}\n\t}));\n}\n"]}