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

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 (336) 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 +30 -4
  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/button/button.js +15 -8
  23. package/esm/vs/base/browser/ui/button/button.js.map +1 -1
  24. package/esm/vs/base/browser/ui/codicons/codicon/codicon-modifiers.css +3 -8
  25. package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  26. package/esm/vs/base/browser/ui/list/list.css +1 -0
  27. package/esm/vs/base/browser/ui/toolbar/toolbar.js +3 -0
  28. package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
  29. package/esm/vs/base/common/codiconsLibrary.js +11 -2
  30. package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
  31. package/esm/vs/base/common/defaultAccount.js +6 -0
  32. package/esm/vs/base/common/defaultAccount.js.map +1 -0
  33. package/esm/vs/base/common/equals.js +73 -24
  34. package/esm/vs/base/common/equals.js.map +1 -1
  35. package/esm/vs/base/common/event.js +14 -4
  36. package/esm/vs/base/common/event.js.map +1 -1
  37. package/esm/vs/base/common/iterator.js.map +1 -1
  38. package/esm/vs/base/common/keybindings.js +0 -8
  39. package/esm/vs/base/common/keybindings.js.map +1 -1
  40. package/esm/vs/base/common/lifecycle.js +2 -2
  41. package/esm/vs/base/common/lifecycle.js.map +1 -1
  42. package/esm/vs/base/common/marshallingIds.js.map +1 -1
  43. package/esm/vs/base/common/observableInternal/index.js +1 -1
  44. package/esm/vs/base/common/observableInternal/index.js.map +1 -1
  45. package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js +1 -1
  46. package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js.map +1 -1
  47. package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js +16 -0
  48. package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js.map +1 -1
  49. package/esm/vs/base/common/observableInternal/utils/utils.js +11 -0
  50. package/esm/vs/base/common/observableInternal/utils/utils.js.map +1 -1
  51. package/esm/vs/base/common/product.js.map +1 -1
  52. package/esm/vs/base/common/strings.js +3 -1
  53. package/esm/vs/base/common/strings.js.map +1 -1
  54. package/esm/vs/editor/browser/controller/dragScrolling.js +2 -1
  55. package/esm/vs/editor/browser/controller/dragScrolling.js.map +1 -1
  56. package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js +73 -2
  57. package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js.map +1 -1
  58. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +7 -51
  59. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
  60. package/esm/vs/editor/browser/controller/editContext/screenReaderUtils.js.map +1 -1
  61. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +7 -20
  62. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
  63. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js +14 -44
  64. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js.map +1 -1
  65. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextRegistry.js +19 -0
  66. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextRegistry.js.map +1 -0
  67. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.js +14 -1
  68. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.js.map +1 -1
  69. package/esm/vs/editor/browser/controller/mouseHandler.js +5 -2
  70. package/esm/vs/editor/browser/controller/mouseHandler.js.map +1 -1
  71. package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
  72. package/esm/vs/editor/browser/observableCodeEditor.js +32 -15
  73. package/esm/vs/editor/browser/observableCodeEditor.js.map +1 -1
  74. package/esm/vs/editor/browser/view.js +11 -2
  75. package/esm/vs/editor/browser/view.js.map +1 -1
  76. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +5 -2
  77. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
  78. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +10 -0
  79. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
  80. package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js.map +1 -1
  81. package/esm/vs/editor/browser/widget/multiDiffEditor/style.css +48 -0
  82. package/esm/vs/editor/common/config/fontInfo.js +1 -1
  83. package/esm/vs/editor/common/config/fontInfo.js.map +1 -1
  84. package/esm/vs/editor/common/core/edits/edit.js +19 -0
  85. package/esm/vs/editor/common/core/edits/edit.js.map +1 -1
  86. package/esm/vs/editor/common/core/edits/stringEdit.js +13 -0
  87. package/esm/vs/editor/common/core/edits/stringEdit.js.map +1 -1
  88. package/esm/vs/editor/common/core/edits/textEdit.js +0 -3
  89. package/esm/vs/editor/common/core/edits/textEdit.js.map +1 -1
  90. package/esm/vs/editor/common/core/text/positionToOffsetImpl.js +24 -10
  91. package/esm/vs/editor/common/core/text/positionToOffsetImpl.js.map +1 -1
  92. package/esm/vs/editor/common/cursor/cursorMoveCommands.js +4 -4
  93. package/esm/vs/editor/common/cursor/cursorMoveCommands.js.map +1 -1
  94. package/esm/vs/editor/common/cursor/cursorWordOperations.js +6 -3
  95. package/esm/vs/editor/common/cursor/cursorWordOperations.js.map +1 -1
  96. package/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js +2 -2
  97. package/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js.map +1 -1
  98. package/esm/vs/editor/common/languages/nullTokenize.js +1 -1
  99. package/esm/vs/editor/common/languages/nullTokenize.js.map +1 -1
  100. package/esm/vs/editor/common/languages/supports/tokenization.js +3 -0
  101. package/esm/vs/editor/common/languages/supports/tokenization.js.map +1 -1
  102. package/esm/vs/editor/common/languages.js +2 -1
  103. package/esm/vs/editor/common/languages.js.map +1 -1
  104. package/esm/vs/editor/common/model/decorationProvider.js +21 -1
  105. package/esm/vs/editor/common/model/decorationProvider.js.map +1 -1
  106. package/esm/vs/editor/common/model/textModel.js +49 -30
  107. package/esm/vs/editor/common/model/textModel.js.map +1 -1
  108. package/esm/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.js +6 -3
  109. package/esm/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.js.map +1 -1
  110. package/esm/vs/editor/common/model/tokens/annotations.js +177 -0
  111. package/esm/vs/editor/common/model/tokens/annotations.js.map +1 -0
  112. package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js +131 -0
  113. package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js.map +1 -0
  114. package/esm/vs/editor/common/model/tokens/tokenizationTextModelPart.js +9 -0
  115. package/esm/vs/editor/common/model/tokens/tokenizationTextModelPart.js.map +1 -1
  116. package/esm/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.js +9 -0
  117. package/esm/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.js.map +1 -1
  118. package/esm/vs/editor/common/textModelEditSource.js +2 -0
  119. package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
  120. package/esm/vs/editor/common/textModelEvents.js.map +1 -1
  121. package/esm/vs/editor/common/viewLayout/lineDecorations.js.map +1 -1
  122. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +1 -1
  123. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js.map +1 -1
  124. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +54 -36
  125. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
  126. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +14 -1
  127. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
  128. package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +1 -1
  129. package/esm/vs/editor/contrib/hover/browser/hover.css +1 -1
  130. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +1 -1
  131. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
  132. package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
  133. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +1 -0
  134. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js.map +1 -1
  135. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.js +1 -0
  136. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.js.map +1 -1
  137. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +33 -4
  138. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js.map +1 -1
  139. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -12
  140. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js.map +1 -1
  141. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +7 -1
  142. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js.map +1 -1
  143. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
  144. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
  145. package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js +2 -1
  146. package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js.map +1 -1
  147. package/esm/vs/editor/contrib/inlineCompletions/browser/model/InlineSuggestAlternativeAction.js +8 -0
  148. package/esm/vs/editor/contrib/inlineCompletions/browser/model/InlineSuggestAlternativeAction.js.map +1 -0
  149. package/esm/vs/editor/contrib/inlineCompletions/browser/model/editKind.js +198 -0
  150. package/esm/vs/editor/contrib/inlineCompletions/browser/model/editKind.js.map +1 -0
  151. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionIsVisible.js +40 -0
  152. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionIsVisible.js.map +1 -0
  153. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +128 -70
  154. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
  155. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +59 -11
  156. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
  157. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +152 -95
  158. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js.map +1 -1
  159. package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +113 -54
  160. package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js.map +1 -1
  161. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +317 -75
  162. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js.map +1 -1
  163. package/esm/vs/editor/contrib/inlineCompletions/browser/telemetry.js.map +1 -1
  164. package/esm/vs/editor/contrib/inlineCompletions/browser/utils.js +20 -0
  165. package/esm/vs/editor/contrib/inlineCompletions/browser/utils.js.map +1 -1
  166. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +59 -42
  167. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js.map +1 -1
  168. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +29 -8
  169. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js.map +1 -1
  170. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +78 -46
  171. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
  172. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js +9 -4
  173. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js.map +1 -1
  174. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +11 -4
  175. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js.map +1 -1
  176. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +81 -41
  177. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
  178. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js +48 -0
  179. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js.map +1 -1
  180. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +18 -15
  181. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js.map +1 -1
  182. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.js +3 -4
  183. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.js.map +1 -1
  184. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js +6 -7
  185. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js.map +1 -1
  186. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js +4 -5
  187. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js.map +1 -1
  188. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js +4 -3
  189. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js.map +1 -1
  190. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js +8 -8
  191. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js.map +1 -1
  192. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js +9 -7
  193. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js.map +1 -1
  194. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +203 -41
  195. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js.map +1 -1
  196. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/jumpToView.js +189 -0
  197. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/jumpToView.js.map +1 -0
  198. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js +85 -102
  199. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js.map +1 -1
  200. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js +75 -32
  201. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js.map +1 -1
  202. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistnaceWidgetPlacement.js +121 -0
  203. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistnaceWidgetPlacement.js.map +1 -0
  204. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js +2 -1
  205. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js.map +1 -1
  206. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +22 -20
  207. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js.map +1 -1
  208. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js +15 -5
  209. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js.map +1 -1
  210. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/view.css +39 -6
  211. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js +10 -5
  212. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js.map +1 -1
  213. package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
  214. package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
  215. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +32 -32
  216. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js.map +1 -1
  217. package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
  218. package/esm/vs/editor/contrib/links/browser/links.js +10 -10
  219. package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
  220. package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
  221. package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
  222. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
  223. package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
  224. package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
  225. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +11 -11
  226. package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
  227. package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
  228. package/esm/vs/editor/contrib/rename/browser/rename.js +19 -15
  229. package/esm/vs/editor/contrib/rename/browser/rename.js.map +1 -1
  230. package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
  231. package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js +3 -2
  232. package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js.map +1 -1
  233. package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
  234. package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
  235. package/esm/vs/editor/contrib/snippet/browser/snippetParser.js +33 -0
  236. package/esm/vs/editor/contrib/snippet/browser/snippetParser.js.map +1 -1
  237. package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
  238. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  239. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +12 -4
  240. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js.map +1 -1
  241. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +1 -0
  242. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js.map +1 -1
  243. package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -8
  244. package/esm/vs/editor/contrib/suggest/browser/suggest.js.map +1 -1
  245. package/esm/vs/editor/contrib/suggest/browser/suggestController.js +39 -28
  246. package/esm/vs/editor/contrib/suggest/browser/suggestController.js.map +1 -1
  247. package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +1 -0
  248. package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js.map +1 -1
  249. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +22 -18
  250. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js.map +1 -1
  251. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +28 -6
  252. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js.map +1 -1
  253. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
  254. package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
  255. package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
  256. package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  257. package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  258. package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  259. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
  260. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
  261. package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  262. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
  263. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +19 -2
  264. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js.map +1 -1
  265. package/esm/vs/editor/editor.api.d.ts +34 -3
  266. package/esm/vs/editor/standalone/browser/standaloneLanguages.js +2 -2
  267. package/esm/vs/editor/standalone/browser/standaloneLanguages.js.map +1 -1
  268. package/esm/vs/editor/standalone/browser/standaloneServices.js +11 -1
  269. package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
  270. package/esm/vs/editor/standalone/common/monarch/monarchLexer.js +1 -1
  271. package/esm/vs/editor/standalone/common/monarch/monarchLexer.js.map +1 -1
  272. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
  273. package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
  274. package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
  275. package/esm/vs/platform/actionWidget/browser/actionWidget.css +11 -8
  276. package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
  277. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
  278. package/esm/vs/platform/actions/browser/toolbar.js +2 -2
  279. package/esm/vs/platform/actions/common/actions.js +11 -5
  280. package/esm/vs/platform/actions/common/actions.js.map +1 -1
  281. package/esm/vs/platform/actions/common/menuService.js +2 -2
  282. package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
  283. package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
  284. package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
  285. package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
  286. package/esm/vs/platform/contextkey/common/scanner.js +5 -5
  287. package/esm/vs/platform/{product/common/productService.js → defaultAccount/common/defaultAccount.js} +2 -2
  288. package/esm/vs/platform/defaultAccount/common/defaultAccount.js.map +1 -0
  289. package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  290. package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
  291. package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
  292. package/esm/vs/platform/instantiation/common/instantiation.js.map +1 -1
  293. package/esm/vs/platform/instantiation/common/instantiationService.js +1 -8
  294. package/esm/vs/platform/instantiation/common/instantiationService.js.map +1 -1
  295. package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
  296. package/esm/vs/platform/list/browser/listService.js +27 -27
  297. package/esm/vs/platform/log/common/log.js +1 -1
  298. package/esm/vs/platform/log/common/log.js.map +1 -1
  299. package/esm/vs/platform/markers/common/markerService.js +6 -6
  300. package/esm/vs/platform/markers/common/markerService.js.map +1 -1
  301. package/esm/vs/platform/markers/common/markers.js +6 -6
  302. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
  303. package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
  304. package/esm/vs/platform/quickinput/browser/media/quickInput.css +7 -3
  305. package/esm/vs/platform/quickinput/browser/quickInput.js +19 -11
  306. package/esm/vs/platform/quickinput/browser/quickInput.js.map +1 -1
  307. package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
  308. package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
  309. package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
  310. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  311. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
  312. package/esm/vs/platform/theme/common/colorUtils.js +2 -2
  313. package/esm/vs/platform/theme/common/colors/baseColors.js +18 -17
  314. package/esm/vs/platform/theme/common/colors/baseColors.js.map +1 -1
  315. package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
  316. package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
  317. package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
  318. package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
  319. package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
  320. package/esm/vs/platform/theme/common/colors/minimapColors.js +13 -13
  321. package/esm/vs/platform/theme/common/colors/minimapColors.js.map +1 -1
  322. package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
  323. package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
  324. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  325. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  326. package/esm/vs/platform/undoRedo/common/undoRedoService.js +21 -21
  327. package/esm/vs/platform/undoRedo/common/undoRedoService.js.map +1 -1
  328. package/esm/vs/platform/window/common/window.js +1 -1
  329. package/esm/vs/platform/window/common/window.js.map +1 -1
  330. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  331. package/monaco.d.ts +34 -3
  332. package/package.json +2 -2
  333. package/version.txt +1 -1
  334. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js +0 -16
  335. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js.map +0 -1
  336. package/esm/vs/platform/product/common/productService.js.map +0 -1
@@ -8,63 +8,63 @@ import { localize } from '../../../../../../nls.js';
8
8
  import { buttonBackground, buttonForeground, buttonSecondaryBackground, buttonSecondaryForeground, diffInserted, diffInsertedLine, diffRemoved, editorBackground } from '../../../../../../platform/theme/common/colorRegistry.js';
9
9
  import { darken, registerColor, transparent } from '../../../../../../platform/theme/common/colorUtils.js';
10
10
  import { InlineEditTabAction } from './inlineEditsViewInterface.js';
11
- export const originalBackgroundColor = registerColor('inlineEdit.originalBackground', transparent(diffRemoved, 0.2), localize(1227, 'Background color for the original text in inline edits.'), true);
12
- export const modifiedBackgroundColor = registerColor('inlineEdit.modifiedBackground', transparent(diffInserted, 0.3), localize(1228, 'Background color for the modified text in inline edits.'), true);
13
- export const originalChangedLineBackgroundColor = registerColor('inlineEdit.originalChangedLineBackground', transparent(diffRemoved, 0.8), localize(1229, 'Background color for the changed lines in the original text of inline edits.'), true);
14
- export const originalChangedTextOverlayColor = registerColor('inlineEdit.originalChangedTextBackground', transparent(diffRemoved, 0.8), localize(1230, 'Overlay color for the changed text in the original text of inline edits.'), true);
11
+ export const originalBackgroundColor = registerColor('inlineEdit.originalBackground', transparent(diffRemoved, 0.2), localize(1233, 'Background color for the original text in inline edits.'), true);
12
+ export const modifiedBackgroundColor = registerColor('inlineEdit.modifiedBackground', transparent(diffInserted, 0.3), localize(1234, 'Background color for the modified text in inline edits.'), true);
13
+ export const originalChangedLineBackgroundColor = registerColor('inlineEdit.originalChangedLineBackground', transparent(diffRemoved, 0.8), localize(1235, 'Background color for the changed lines in the original text of inline edits.'), true);
14
+ export const originalChangedTextOverlayColor = registerColor('inlineEdit.originalChangedTextBackground', transparent(diffRemoved, 0.8), localize(1236, 'Overlay color for the changed text in the original text of inline edits.'), true);
15
15
  export const modifiedChangedLineBackgroundColor = registerColor('inlineEdit.modifiedChangedLineBackground', {
16
16
  light: transparent(diffInsertedLine, 0.7),
17
17
  dark: transparent(diffInsertedLine, 0.7),
18
18
  hcDark: diffInsertedLine,
19
19
  hcLight: diffInsertedLine
20
- }, localize(1231, 'Background color for the changed lines in the modified text of inline edits.'), true);
21
- export const modifiedChangedTextOverlayColor = registerColor('inlineEdit.modifiedChangedTextBackground', transparent(diffInserted, 0.7), localize(1232, 'Overlay color for the changed text in the modified text of inline edits.'), true);
20
+ }, localize(1237, 'Background color for the changed lines in the modified text of inline edits.'), true);
21
+ export const modifiedChangedTextOverlayColor = registerColor('inlineEdit.modifiedChangedTextBackground', transparent(diffInserted, 0.7), localize(1238, 'Overlay color for the changed text in the modified text of inline edits.'), true);
22
22
  // ------- GUTTER INDICATOR -------
23
- export const inlineEditIndicatorPrimaryForeground = registerColor('inlineEdit.gutterIndicator.primaryForeground', buttonForeground, localize(1233, 'Foreground color for the primary inline edit gutter indicator.'));
24
- export const inlineEditIndicatorPrimaryBorder = registerColor('inlineEdit.gutterIndicator.primaryBorder', buttonBackground, localize(1234, 'Border color for the primary inline edit gutter indicator.'));
23
+ export const inlineEditIndicatorPrimaryForeground = registerColor('inlineEdit.gutterIndicator.primaryForeground', buttonForeground, localize(1239, 'Foreground color for the primary inline edit gutter indicator.'));
24
+ export const inlineEditIndicatorPrimaryBorder = registerColor('inlineEdit.gutterIndicator.primaryBorder', buttonBackground, localize(1240, 'Border color for the primary inline edit gutter indicator.'));
25
25
  export const inlineEditIndicatorPrimaryBackground = registerColor('inlineEdit.gutterIndicator.primaryBackground', {
26
26
  light: transparent(inlineEditIndicatorPrimaryBorder, 0.5),
27
27
  dark: transparent(inlineEditIndicatorPrimaryBorder, 0.4),
28
28
  hcDark: transparent(inlineEditIndicatorPrimaryBorder, 0.4),
29
29
  hcLight: transparent(inlineEditIndicatorPrimaryBorder, 0.5),
30
- }, localize(1235, 'Background color for the primary inline edit gutter indicator.'));
31
- export const inlineEditIndicatorSecondaryForeground = registerColor('inlineEdit.gutterIndicator.secondaryForeground', buttonSecondaryForeground, localize(1236, 'Foreground color for the secondary inline edit gutter indicator.'));
32
- export const inlineEditIndicatorSecondaryBorder = registerColor('inlineEdit.gutterIndicator.secondaryBorder', buttonSecondaryBackground, localize(1237, 'Border color for the secondary inline edit gutter indicator.'));
33
- export const inlineEditIndicatorSecondaryBackground = registerColor('inlineEdit.gutterIndicator.secondaryBackground', inlineEditIndicatorSecondaryBorder, localize(1238, 'Background color for the secondary inline edit gutter indicator.'));
34
- export const inlineEditIndicatorsuccessfulForeground = registerColor('inlineEdit.gutterIndicator.successfulForeground', buttonForeground, localize(1239, 'Foreground color for the successful inline edit gutter indicator.'));
35
- export const inlineEditIndicatorsuccessfulBorder = registerColor('inlineEdit.gutterIndicator.successfulBorder', buttonBackground, localize(1240, 'Border color for the successful inline edit gutter indicator.'));
36
- export const inlineEditIndicatorsuccessfulBackground = registerColor('inlineEdit.gutterIndicator.successfulBackground', inlineEditIndicatorsuccessfulBorder, localize(1241, 'Background color for the successful inline edit gutter indicator.'));
30
+ }, localize(1241, 'Background color for the primary inline edit gutter indicator.'));
31
+ export const inlineEditIndicatorSecondaryForeground = registerColor('inlineEdit.gutterIndicator.secondaryForeground', buttonSecondaryForeground, localize(1242, 'Foreground color for the secondary inline edit gutter indicator.'));
32
+ export const inlineEditIndicatorSecondaryBorder = registerColor('inlineEdit.gutterIndicator.secondaryBorder', buttonSecondaryBackground, localize(1243, 'Border color for the secondary inline edit gutter indicator.'));
33
+ export const inlineEditIndicatorSecondaryBackground = registerColor('inlineEdit.gutterIndicator.secondaryBackground', inlineEditIndicatorSecondaryBorder, localize(1244, 'Background color for the secondary inline edit gutter indicator.'));
34
+ export const inlineEditIndicatorSuccessfulForeground = registerColor('inlineEdit.gutterIndicator.successfulForeground', buttonForeground, localize(1245, 'Foreground color for the successful inline edit gutter indicator.'));
35
+ export const inlineEditIndicatorSuccessfulBorder = registerColor('inlineEdit.gutterIndicator.successfulBorder', buttonBackground, localize(1246, 'Border color for the successful inline edit gutter indicator.'));
36
+ export const inlineEditIndicatorSuccessfulBackground = registerColor('inlineEdit.gutterIndicator.successfulBackground', inlineEditIndicatorSuccessfulBorder, localize(1247, 'Background color for the successful inline edit gutter indicator.'));
37
37
  export const inlineEditIndicatorBackground = registerColor('inlineEdit.gutterIndicator.background', {
38
38
  hcDark: transparent('tab.inactiveBackground', 0.5),
39
39
  hcLight: transparent('tab.inactiveBackground', 0.5),
40
40
  dark: transparent('tab.inactiveBackground', 0.5),
41
41
  light: '#5f5f5f18',
42
- }, localize(1242, 'Background color for the inline edit gutter indicator.'));
42
+ }, localize(1248, 'Background color for the inline edit gutter indicator.'));
43
43
  // ------- BORDER COLORS -------
44
44
  const originalBorder = registerColor('inlineEdit.originalBorder', {
45
45
  light: diffRemoved,
46
46
  dark: diffRemoved,
47
47
  hcDark: diffRemoved,
48
48
  hcLight: diffRemoved
49
- }, localize(1243, 'Border color for the original text in inline edits.'));
49
+ }, localize(1249, 'Border color for the original text in inline edits.'));
50
50
  const modifiedBorder = registerColor('inlineEdit.modifiedBorder', {
51
51
  light: darken(diffInserted, 0.6),
52
52
  dark: diffInserted,
53
53
  hcDark: diffInserted,
54
54
  hcLight: diffInserted
55
- }, localize(1244, 'Border color for the modified text in inline edits.'));
55
+ }, localize(1250, 'Border color for the modified text in inline edits.'));
56
56
  const tabWillAcceptModifiedBorder = registerColor('inlineEdit.tabWillAcceptModifiedBorder', {
57
57
  light: darken(modifiedBorder, 0),
58
58
  dark: darken(modifiedBorder, 0),
59
59
  hcDark: darken(modifiedBorder, 0),
60
60
  hcLight: darken(modifiedBorder, 0)
61
- }, localize(1245, 'Modified border color for the inline edits widget when tab will accept it.'));
61
+ }, localize(1251, 'Modified border color for the inline edits widget when tab will accept it.'));
62
62
  const tabWillAcceptOriginalBorder = registerColor('inlineEdit.tabWillAcceptOriginalBorder', {
63
63
  light: darken(originalBorder, 0),
64
64
  dark: darken(originalBorder, 0),
65
65
  hcDark: darken(originalBorder, 0),
66
66
  hcLight: darken(originalBorder, 0)
67
- }, localize(1246, 'Original border color for the inline edits widget over the original text when tab will accept it.'));
67
+ }, localize(1252, 'Original border color for the inline edits widget over the original text when tab will accept it.'));
68
68
  export function getModifiedBorderColor(tabAction) {
69
69
  return tabAction.map(a => a === InlineEditTabAction.Accept ? tabWillAcceptModifiedBorder : modifiedBorder);
70
70
  }
@@ -95,4 +95,6 @@ export function observeColor(colorIdentifier, themeService) {
95
95
  return color;
96
96
  });
97
97
  }
98
+ // Styles
99
+ export const INLINE_EDITS_BORDER_RADIUS = 3; // also used in CSS file
98
100
  //# sourceMappingURL=theme.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAe,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAA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C;SAAM,CAAC;QACP,KAAK,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1G,CAAC;IAED,MAAM,eAAe,GAAG,YAAY,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;IAErE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,8BAA8B,CAAC,CAAC,CAAC,UAAU,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC5G,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,eAAgC,EAAE,YAA2B;IACzF,OAAO,uBAAuB,CAC7B;QACC,KAAK,EAAE,EAAE,YAAY,EAAE,eAAe,EAAE;QACxC,QAAQ,EAAE,CAAC,CAAQ,EAAE,CAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;QAC7C,SAAS,EAAE,GAAG,EAAE,CAAC,gBAAgB,eAAe,GAAG;KACnD,EACD,YAAY,CAAC,qBAAqB,EAClC,GAAG,EAAE;QACJ,MAAM,KAAK,GAAG,YAAY,CAAC,aAAa,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QACrE,IAAI,CAAC,KAAK,EAAE,CAAC;YACZ,MAAM,IAAI,kBAAkB,CAAC,kBAAkB,eAAe,EAAE,CAAC,CAAC;QACnE,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC,CACD,CAAC;AACH,CAAC","file":"theme.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 { Color } from '../../../../../../base/common/color.js';\nimport { BugIndicatingError } from '../../../../../../base/common/errors.js';\nimport { IObservable, observableFromEventOpts } from '../../../../../../base/common/observable.js';\nimport { localize } from '../../../../../../nls.js';\nimport { buttonBackground, buttonForeground, buttonSecondaryBackground, buttonSecondaryForeground, diffInserted, diffInsertedLine, diffRemoved, editorBackground } from '../../../../../../platform/theme/common/colorRegistry.js';\nimport { ColorIdentifier, darken, registerColor, transparent } from '../../../../../../platform/theme/common/colorUtils.js';\nimport { IThemeService } from '../../../../../../platform/theme/common/themeService.js';\nimport { InlineEditTabAction } from './inlineEditsViewInterface.js';\n\nexport const originalBackgroundColor = registerColor(\n\t'inlineEdit.originalBackground',\n\ttransparent(diffRemoved, 0.2),\n\tlocalize('inlineEdit.originalBackground', 'Background color for the original text in inline edits.'),\n\ttrue\n);\nexport const modifiedBackgroundColor = registerColor(\n\t'inlineEdit.modifiedBackground',\n\ttransparent(diffInserted, 0.3),\n\tlocalize('inlineEdit.modifiedBackground', 'Background color for the modified text in inline edits.'),\n\ttrue\n);\n\nexport const originalChangedLineBackgroundColor = registerColor(\n\t'inlineEdit.originalChangedLineBackground',\n\ttransparent(diffRemoved, 0.8),\n\tlocalize('inlineEdit.originalChangedLineBackground', 'Background color for the changed lines in the original text of inline edits.'),\n\ttrue\n);\n\nexport const originalChangedTextOverlayColor = registerColor(\n\t'inlineEdit.originalChangedTextBackground',\n\ttransparent(diffRemoved, 0.8),\n\tlocalize('inlineEdit.originalChangedTextBackground', 'Overlay color for the changed text in the original text of inline edits.'),\n\ttrue\n);\n\nexport const modifiedChangedLineBackgroundColor = registerColor(\n\t'inlineEdit.modifiedChangedLineBackground',\n\t{\n\t\tlight: transparent(diffInsertedLine, 0.7),\n\t\tdark: transparent(diffInsertedLine, 0.7),\n\t\thcDark: diffInsertedLine,\n\t\thcLight: diffInsertedLine\n\t},\n\tlocalize('inlineEdit.modifiedChangedLineBackground', 'Background color for the changed lines in the modified text of inline edits.'),\n\ttrue\n);\n\nexport const modifiedChangedTextOverlayColor = registerColor(\n\t'inlineEdit.modifiedChangedTextBackground',\n\ttransparent(diffInserted, 0.7),\n\tlocalize('inlineEdit.modifiedChangedTextBackground', 'Overlay color for the changed text in the modified text of inline edits.'),\n\ttrue\n);\n\n// ------- GUTTER INDICATOR -------\n\nexport const inlineEditIndicatorPrimaryForeground = registerColor(\n\t'inlineEdit.gutterIndicator.primaryForeground',\n\tbuttonForeground,\n\tlocalize('inlineEdit.gutterIndicator.primaryForeground', 'Foreground color for the primary inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorPrimaryBorder = registerColor(\n\t'inlineEdit.gutterIndicator.primaryBorder',\n\tbuttonBackground,\n\tlocalize('inlineEdit.gutterIndicator.primaryBorder', 'Border color for the primary inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorPrimaryBackground = registerColor(\n\t'inlineEdit.gutterIndicator.primaryBackground',\n\t{\n\t\tlight: transparent(inlineEditIndicatorPrimaryBorder, 0.5),\n\t\tdark: transparent(inlineEditIndicatorPrimaryBorder, 0.4),\n\t\thcDark: transparent(inlineEditIndicatorPrimaryBorder, 0.4),\n\t\thcLight: transparent(inlineEditIndicatorPrimaryBorder, 0.5),\n\t},\n\tlocalize('inlineEdit.gutterIndicator.primaryBackground', 'Background color for the primary inline edit gutter indicator.')\n);\n\nexport const inlineEditIndicatorSecondaryForeground = registerColor(\n\t'inlineEdit.gutterIndicator.secondaryForeground',\n\tbuttonSecondaryForeground,\n\tlocalize('inlineEdit.gutterIndicator.secondaryForeground', 'Foreground color for the secondary inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorSecondaryBorder = registerColor(\n\t'inlineEdit.gutterIndicator.secondaryBorder',\n\tbuttonSecondaryBackground,\n\tlocalize('inlineEdit.gutterIndicator.secondaryBorder', 'Border color for the secondary inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorSecondaryBackground = registerColor(\n\t'inlineEdit.gutterIndicator.secondaryBackground',\n\tinlineEditIndicatorSecondaryBorder,\n\tlocalize('inlineEdit.gutterIndicator.secondaryBackground', 'Background color for the secondary inline edit gutter indicator.')\n);\n\nexport const inlineEditIndicatorsuccessfulForeground = registerColor(\n\t'inlineEdit.gutterIndicator.successfulForeground',\n\tbuttonForeground,\n\tlocalize('inlineEdit.gutterIndicator.successfulForeground', 'Foreground color for the successful inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorsuccessfulBorder = registerColor(\n\t'inlineEdit.gutterIndicator.successfulBorder',\n\tbuttonBackground,\n\tlocalize('inlineEdit.gutterIndicator.successfulBorder', 'Border color for the successful inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorsuccessfulBackground = registerColor(\n\t'inlineEdit.gutterIndicator.successfulBackground',\n\tinlineEditIndicatorsuccessfulBorder,\n\tlocalize('inlineEdit.gutterIndicator.successfulBackground', 'Background color for the successful inline edit gutter indicator.')\n);\n\nexport const inlineEditIndicatorBackground = registerColor(\n\t'inlineEdit.gutterIndicator.background',\n\t{\n\t\thcDark: transparent('tab.inactiveBackground', 0.5),\n\t\thcLight: transparent('tab.inactiveBackground', 0.5),\n\t\tdark: transparent('tab.inactiveBackground', 0.5),\n\t\tlight: '#5f5f5f18',\n\t},\n\tlocalize('inlineEdit.gutterIndicator.background', 'Background color for the inline edit gutter indicator.')\n);\n\n// ------- BORDER COLORS -------\n\nconst originalBorder = registerColor(\n\t'inlineEdit.originalBorder',\n\t{\n\t\tlight: diffRemoved,\n\t\tdark: diffRemoved,\n\t\thcDark: diffRemoved,\n\t\thcLight: diffRemoved\n\t},\n\tlocalize('inlineEdit.originalBorder', 'Border color for the original text in inline edits.')\n);\n\nconst modifiedBorder = registerColor(\n\t'inlineEdit.modifiedBorder',\n\t{\n\t\tlight: darken(diffInserted, 0.6),\n\t\tdark: diffInserted,\n\t\thcDark: diffInserted,\n\t\thcLight: diffInserted\n\t},\n\tlocalize('inlineEdit.modifiedBorder', 'Border color for the modified text in inline edits.')\n);\n\nconst tabWillAcceptModifiedBorder = registerColor(\n\t'inlineEdit.tabWillAcceptModifiedBorder',\n\t{\n\t\tlight: darken(modifiedBorder, 0),\n\t\tdark: darken(modifiedBorder, 0),\n\t\thcDark: darken(modifiedBorder, 0),\n\t\thcLight: darken(modifiedBorder, 0)\n\t},\n\tlocalize('inlineEdit.tabWillAcceptModifiedBorder', 'Modified border color for the inline edits widget when tab will accept it.')\n);\n\nconst tabWillAcceptOriginalBorder = registerColor(\n\t'inlineEdit.tabWillAcceptOriginalBorder',\n\t{\n\t\tlight: darken(originalBorder, 0),\n\t\tdark: darken(originalBorder, 0),\n\t\thcDark: darken(originalBorder, 0),\n\t\thcLight: darken(originalBorder, 0)\n\t},\n\tlocalize('inlineEdit.tabWillAcceptOriginalBorder', 'Original border color for the inline edits widget over the original text when tab will accept it.')\n);\n\nexport function getModifiedBorderColor(tabAction: IObservable<InlineEditTabAction>): IObservable<string> {\n\treturn tabAction.map(a => a === InlineEditTabAction.Accept ? tabWillAcceptModifiedBorder : modifiedBorder);\n}\n\nexport function getOriginalBorderColor(tabAction: IObservable<InlineEditTabAction>): IObservable<string> {\n\treturn tabAction.map(a => a === InlineEditTabAction.Accept ? tabWillAcceptOriginalBorder : originalBorder);\n}\n\nexport function getEditorBlendedColor(colorIdentifier: ColorIdentifier | IObservable<ColorIdentifier>, themeService: IThemeService): IObservable<Color> {\n\tlet color: IObservable<Color>;\n\tif (typeof colorIdentifier === 'string') {\n\t\tcolor = observeColor(colorIdentifier, themeService);\n\t} else {\n\t\tcolor = colorIdentifier.map((identifier, reader) => observeColor(identifier, themeService).read(reader));\n\t}\n\n\tconst backgroundColor = observeColor(editorBackground, themeService);\n\n\treturn color.map((c, reader) => /** @description makeOpaque */ c.makeOpaque(backgroundColor.read(reader)));\n}\n\nexport function observeColor(colorIdentifier: ColorIdentifier, themeService: IThemeService): IObservable<Color> {\n\treturn observableFromEventOpts(\n\t\t{\n\t\t\towner: { observeColor: colorIdentifier },\n\t\t\tequalsFn: (a: Color, b: Color) => a.equals(b),\n\t\t\tdebugName: () => `observeColor(${colorIdentifier})`\n\t\t},\n\t\tthemeService.onDidColorThemeChange,\n\t\t() => {\n\t\t\tconst color = themeService.getColorTheme().getColor(colorIdentifier);\n\t\t\tif (!color) {\n\t\t\t\tthrow new BugIndicatingError(`Missing color: ${colorIdentifier}`);\n\t\t\t}\n\t\t\treturn color;\n\t\t}\n\t);\n}\n"]}
1
+ {"version":3,"sources":["vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAe,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,0DAA0D,CAAC;AACnO,OAAO,EAAmB,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uDAAuD,CAAC;AAE5H,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CACnD,+BAA+B,EAC/B,WAAW,CAAC,WAAW,EAAE,GAAG,CAAC,EAC7B,QAAQ,CAAC,IAA+B,EAAE,yDAAyD,CAAC,EACpG,IAAI,CACJ,CAAC;AACF,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CACnD,+BAA+B,EAC/B,WAAW,CAAC,YAAY,EAAE,GAAG,CAAC,EAC9B,QAAQ,CAAC,IAA+B,EAAE,yDAAyD,CAAC,EACpG,IAAI,CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,kCAAkC,GAAG,aAAa,CAC9D,0CAA0C,EAC1C,WAAW,CAAC,WAAW,EAAE,GAAG,CAAC,EAC7B,QAAQ,CAAC,IAA0C,EAAE,8EAA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D,EACD,YAAY,CAAC,qBAAqB,EAClC,GAAG,EAAE;QACJ,MAAM,KAAK,GAAG,YAAY,CAAC,aAAa,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QACrE,IAAI,CAAC,KAAK,EAAE,CAAC;YACZ,MAAM,IAAI,kBAAkB,CAAC,kBAAkB,eAAe,EAAE,CAAC,CAAC;QACnE,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC,CACD,CAAC;AACH,CAAC;AAED,SAAS;AACT,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,CAAC,wBAAwB","file":"theme.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 { Color } from '../../../../../../base/common/color.js';\nimport { BugIndicatingError } from '../../../../../../base/common/errors.js';\nimport { IObservable, observableFromEventOpts } from '../../../../../../base/common/observable.js';\nimport { localize } from '../../../../../../nls.js';\nimport { buttonBackground, buttonForeground, buttonSecondaryBackground, buttonSecondaryForeground, diffInserted, diffInsertedLine, diffRemoved, editorBackground } from '../../../../../../platform/theme/common/colorRegistry.js';\nimport { ColorIdentifier, darken, registerColor, transparent } from '../../../../../../platform/theme/common/colorUtils.js';\nimport { IThemeService } from '../../../../../../platform/theme/common/themeService.js';\nimport { InlineEditTabAction } from './inlineEditsViewInterface.js';\n\nexport const originalBackgroundColor = registerColor(\n\t'inlineEdit.originalBackground',\n\ttransparent(diffRemoved, 0.2),\n\tlocalize('inlineEdit.originalBackground', 'Background color for the original text in inline edits.'),\n\ttrue\n);\nexport const modifiedBackgroundColor = registerColor(\n\t'inlineEdit.modifiedBackground',\n\ttransparent(diffInserted, 0.3),\n\tlocalize('inlineEdit.modifiedBackground', 'Background color for the modified text in inline edits.'),\n\ttrue\n);\n\nexport const originalChangedLineBackgroundColor = registerColor(\n\t'inlineEdit.originalChangedLineBackground',\n\ttransparent(diffRemoved, 0.8),\n\tlocalize('inlineEdit.originalChangedLineBackground', 'Background color for the changed lines in the original text of inline edits.'),\n\ttrue\n);\n\nexport const originalChangedTextOverlayColor = registerColor(\n\t'inlineEdit.originalChangedTextBackground',\n\ttransparent(diffRemoved, 0.8),\n\tlocalize('inlineEdit.originalChangedTextBackground', 'Overlay color for the changed text in the original text of inline edits.'),\n\ttrue\n);\n\nexport const modifiedChangedLineBackgroundColor = registerColor(\n\t'inlineEdit.modifiedChangedLineBackground',\n\t{\n\t\tlight: transparent(diffInsertedLine, 0.7),\n\t\tdark: transparent(diffInsertedLine, 0.7),\n\t\thcDark: diffInsertedLine,\n\t\thcLight: diffInsertedLine\n\t},\n\tlocalize('inlineEdit.modifiedChangedLineBackground', 'Background color for the changed lines in the modified text of inline edits.'),\n\ttrue\n);\n\nexport const modifiedChangedTextOverlayColor = registerColor(\n\t'inlineEdit.modifiedChangedTextBackground',\n\ttransparent(diffInserted, 0.7),\n\tlocalize('inlineEdit.modifiedChangedTextBackground', 'Overlay color for the changed text in the modified text of inline edits.'),\n\ttrue\n);\n\n// ------- GUTTER INDICATOR -------\n\nexport const inlineEditIndicatorPrimaryForeground = registerColor(\n\t'inlineEdit.gutterIndicator.primaryForeground',\n\tbuttonForeground,\n\tlocalize('inlineEdit.gutterIndicator.primaryForeground', 'Foreground color for the primary inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorPrimaryBorder = registerColor(\n\t'inlineEdit.gutterIndicator.primaryBorder',\n\tbuttonBackground,\n\tlocalize('inlineEdit.gutterIndicator.primaryBorder', 'Border color for the primary inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorPrimaryBackground = registerColor(\n\t'inlineEdit.gutterIndicator.primaryBackground',\n\t{\n\t\tlight: transparent(inlineEditIndicatorPrimaryBorder, 0.5),\n\t\tdark: transparent(inlineEditIndicatorPrimaryBorder, 0.4),\n\t\thcDark: transparent(inlineEditIndicatorPrimaryBorder, 0.4),\n\t\thcLight: transparent(inlineEditIndicatorPrimaryBorder, 0.5),\n\t},\n\tlocalize('inlineEdit.gutterIndicator.primaryBackground', 'Background color for the primary inline edit gutter indicator.')\n);\n\nexport const inlineEditIndicatorSecondaryForeground = registerColor(\n\t'inlineEdit.gutterIndicator.secondaryForeground',\n\tbuttonSecondaryForeground,\n\tlocalize('inlineEdit.gutterIndicator.secondaryForeground', 'Foreground color for the secondary inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorSecondaryBorder = registerColor(\n\t'inlineEdit.gutterIndicator.secondaryBorder',\n\tbuttonSecondaryBackground,\n\tlocalize('inlineEdit.gutterIndicator.secondaryBorder', 'Border color for the secondary inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorSecondaryBackground = registerColor(\n\t'inlineEdit.gutterIndicator.secondaryBackground',\n\tinlineEditIndicatorSecondaryBorder,\n\tlocalize('inlineEdit.gutterIndicator.secondaryBackground', 'Background color for the secondary inline edit gutter indicator.')\n);\n\nexport const inlineEditIndicatorSuccessfulForeground = registerColor(\n\t'inlineEdit.gutterIndicator.successfulForeground',\n\tbuttonForeground,\n\tlocalize('inlineEdit.gutterIndicator.successfulForeground', 'Foreground color for the successful inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorSuccessfulBorder = registerColor(\n\t'inlineEdit.gutterIndicator.successfulBorder',\n\tbuttonBackground,\n\tlocalize('inlineEdit.gutterIndicator.successfulBorder', 'Border color for the successful inline edit gutter indicator.')\n);\nexport const inlineEditIndicatorSuccessfulBackground = registerColor(\n\t'inlineEdit.gutterIndicator.successfulBackground',\n\tinlineEditIndicatorSuccessfulBorder,\n\tlocalize('inlineEdit.gutterIndicator.successfulBackground', 'Background color for the successful inline edit gutter indicator.')\n);\n\nexport const inlineEditIndicatorBackground = registerColor(\n\t'inlineEdit.gutterIndicator.background',\n\t{\n\t\thcDark: transparent('tab.inactiveBackground', 0.5),\n\t\thcLight: transparent('tab.inactiveBackground', 0.5),\n\t\tdark: transparent('tab.inactiveBackground', 0.5),\n\t\tlight: '#5f5f5f18',\n\t},\n\tlocalize('inlineEdit.gutterIndicator.background', 'Background color for the inline edit gutter indicator.')\n);\n\n// ------- BORDER COLORS -------\n\nconst originalBorder = registerColor(\n\t'inlineEdit.originalBorder',\n\t{\n\t\tlight: diffRemoved,\n\t\tdark: diffRemoved,\n\t\thcDark: diffRemoved,\n\t\thcLight: diffRemoved\n\t},\n\tlocalize('inlineEdit.originalBorder', 'Border color for the original text in inline edits.')\n);\n\nconst modifiedBorder = registerColor(\n\t'inlineEdit.modifiedBorder',\n\t{\n\t\tlight: darken(diffInserted, 0.6),\n\t\tdark: diffInserted,\n\t\thcDark: diffInserted,\n\t\thcLight: diffInserted\n\t},\n\tlocalize('inlineEdit.modifiedBorder', 'Border color for the modified text in inline edits.')\n);\n\nconst tabWillAcceptModifiedBorder = registerColor(\n\t'inlineEdit.tabWillAcceptModifiedBorder',\n\t{\n\t\tlight: darken(modifiedBorder, 0),\n\t\tdark: darken(modifiedBorder, 0),\n\t\thcDark: darken(modifiedBorder, 0),\n\t\thcLight: darken(modifiedBorder, 0)\n\t},\n\tlocalize('inlineEdit.tabWillAcceptModifiedBorder', 'Modified border color for the inline edits widget when tab will accept it.')\n);\n\nconst tabWillAcceptOriginalBorder = registerColor(\n\t'inlineEdit.tabWillAcceptOriginalBorder',\n\t{\n\t\tlight: darken(originalBorder, 0),\n\t\tdark: darken(originalBorder, 0),\n\t\thcDark: darken(originalBorder, 0),\n\t\thcLight: darken(originalBorder, 0)\n\t},\n\tlocalize('inlineEdit.tabWillAcceptOriginalBorder', 'Original border color for the inline edits widget over the original text when tab will accept it.')\n);\n\nexport function getModifiedBorderColor(tabAction: IObservable<InlineEditTabAction>): IObservable<string> {\n\treturn tabAction.map(a => a === InlineEditTabAction.Accept ? tabWillAcceptModifiedBorder : modifiedBorder);\n}\n\nexport function getOriginalBorderColor(tabAction: IObservable<InlineEditTabAction>): IObservable<string> {\n\treturn tabAction.map(a => a === InlineEditTabAction.Accept ? tabWillAcceptOriginalBorder : originalBorder);\n}\n\nexport function getEditorBlendedColor(colorIdentifier: ColorIdentifier | IObservable<ColorIdentifier>, themeService: IThemeService): IObservable<Color> {\n\tlet color: IObservable<Color>;\n\tif (typeof colorIdentifier === 'string') {\n\t\tcolor = observeColor(colorIdentifier, themeService);\n\t} else {\n\t\tcolor = colorIdentifier.map((identifier, reader) => observeColor(identifier, themeService).read(reader));\n\t}\n\n\tconst backgroundColor = observeColor(editorBackground, themeService);\n\n\treturn color.map((c, reader) => /** @description makeOpaque */ c.makeOpaque(backgroundColor.read(reader)));\n}\n\nexport function observeColor(colorIdentifier: ColorIdentifier, themeService: IThemeService): IObservable<Color> {\n\treturn observableFromEventOpts(\n\t\t{\n\t\t\towner: { observeColor: colorIdentifier },\n\t\t\tequalsFn: (a: Color, b: Color) => a.equals(b),\n\t\t\tdebugName: () => `observeColor(${colorIdentifier})`\n\t\t},\n\t\tthemeService.onDidColorThemeChange,\n\t\t() => {\n\t\t\tconst color = themeService.getColorTheme().getColor(colorIdentifier);\n\t\t\tif (!color) {\n\t\t\t\tthrow new BugIndicatingError(`Missing color: ${colorIdentifier}`);\n\t\t\t}\n\t\t\treturn color;\n\t\t}\n\t);\n}\n\n// Styles\nexport const INLINE_EDITS_BORDER_RADIUS = 3; // also used in CSS file\n"]}
@@ -1,6 +1,6 @@
1
1
  import { numberComparator } from '../../../../../../../base/common/arrays.js';
2
2
  import { findFirstMin } from '../../../../../../../base/common/arraysFind.js';
3
- import { DebugLocation, derived, derivedObservableWithCache, derivedOpts, observableSignalFromEvent } from '../../../../../../../base/common/observable.js';
3
+ import { DebugLocation, derived, derivedObservableWithCache, derivedOpts, observableSignalFromEvent, observableValue } from '../../../../../../../base/common/observable.js';
4
4
  import { splitLines } from '../../../../../../../base/common/strings.js';
5
5
  import { observableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';
6
6
  import { Rect } from '../../../../../../common/core/2d/rect.js';
@@ -12,6 +12,9 @@ import { RangeMapping } from '../../../../../../common/diff/rangeMapping.js';
12
12
  import { indentOfLine } from '../../../../../../common/model/textModel.js';
13
13
  import { BugIndicatingError } from '../../../../../../../base/common/errors.js';
14
14
  import { Size2D } from '../../../../../../common/core/2d/size.js';
15
+ /**
16
+ * Warning: might return 0.
17
+ */
15
18
  export function maxContentWidthInRange(editor, range, reader) {
16
19
  editor.layoutInfo.read(reader);
17
20
  editor.value.read(reader);
@@ -22,8 +25,7 @@ export function maxContentWidthInRange(editor, range, reader) {
22
25
  let maxContentWidth = 0;
23
26
  editor.scrollTop.read(reader);
24
27
  for (let i = range.startLineNumber; i < range.endLineNumberExclusive; i++) {
25
- const column = model.getLineMaxColumn(i);
26
- const lineContentWidth = editor.getLeftOfPosition(new Position(i, column), reader);
28
+ const lineContentWidth = editor.editor.getWidthOfLine(i);
27
29
  maxContentWidth = Math.max(maxContentWidth, lineContentWidth);
28
30
  }
29
31
  const lines = range.mapToLineArray(l => model.getLineContent(l));
@@ -43,10 +45,10 @@ export function getContentSizeOfLines(editor, range, reader) {
43
45
  const sizes = [];
44
46
  editor.scrollTop.read(reader);
45
47
  for (let i = range.startLineNumber; i < range.endLineNumberExclusive; i++) {
46
- const column = model.getLineMaxColumn(i);
47
- let lineContentWidth = editor.editor.getOffsetForColumn(i, column);
48
+ let lineContentWidth = editor.editor.getWidthOfLine(i);
48
49
  if (lineContentWidth === -1) {
49
50
  // approximation
51
+ const column = model.getLineMaxColumn(i);
50
52
  const typicalHalfwidthCharacterWidth = editor.editor.getOption(59 /* EditorOption.fontInfo */).typicalHalfwidthCharacterWidth;
51
53
  const approximation = column * typicalHalfwidthCharacterWidth;
52
54
  lineContentWidth = approximation;
@@ -234,4 +236,12 @@ export function rectToProps(fn, debugLocation = DebugLocation.ofCaller()) {
234
236
  }, debugLocation),
235
237
  };
236
238
  }
239
+ export function observeEditorBoundingClientRect(editor, store) {
240
+ const dom = editor.getContainerDomNode();
241
+ const initialDomRect = observableValue('domRect', dom.getBoundingClientRect());
242
+ store.add(editor.onDidLayoutChange(e => {
243
+ initialDomRect.set(dom.getBoundingClientRect(), undefined);
244
+ }));
245
+ return initialDomRect;
246
+ }
237
247
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.ts","vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,0BAA0B,EAAE,WAAW,EAAwB,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAClL,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAwB,MAAM,mDAAmD,CAAC;AAE/G,OAAO,EAAE,IAAI,EAAE,MAAM,0CAA0C,CAAC;AAGhE,OAAO,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAC;AAClF,OAAO,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAE3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAElE,MAAM,UAAU,sBAAsB,CAAC,MAA4B,EAAE,KAAgB,EAAE,MAA2B;IACjH,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MA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H,CAAC","file":"utils.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["\nimport { numberComparator } from '../../../../../../../base/common/arrays.js';\nimport { findFirstMin } from '../../../../../../../base/common/arraysFind.js';\nimport { DebugLocation, derived, derivedObservableWithCache, derivedOpts, IObservable, IReader, observableSignalFromEvent } from '../../../../../../../base/common/observable.js';\nimport { splitLines } from '../../../../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor, ObservableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { Point } from '../../../../../../common/core/2d/point.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { EditorOption } from '../../../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../../../common/core/ranges/lineRange.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { Position } from '../../../../../../common/core/position.js';\nimport { Range } from '../../../../../../common/core/range.js';\nimport { TextReplacement, TextEdit } from '../../../../../../common/core/edits/textEdit.js';\nimport { RangeMapping } from '../../../../../../common/diff/rangeMapping.js';\nimport { ITextModel } from '../../../../../../common/model.js';\nimport { indentOfLine } from '../../../../../../common/model/textModel.js';\nimport { CharCode } from '../../../../../../../base/common/charCode.js';\nimport { BugIndicatingError } from '../../../../../../../base/common/errors.js';\nimport { Size2D } from '../../../../../../common/core/2d/size.js';\n\nexport function maxContentWidthInRange(editor: ObservableCodeEditor, range: LineRange, reader: IReader | undefined): number {\n\teditor.layoutInfo.read(reader);\n\teditor.value.read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { return 0; }\n\tlet maxContentWidth = 0;\n\n\teditor.scrollTop.read(reader);\n\tfor (let i = range.startLineNumber; i < range.endLineNumberExclusive; i++) {\n\t\tconst column = model.getLineMaxColumn(i);\n\t\tconst lineContentWidth = editor.getLeftOfPosition(new Position(i, column), reader);\n\t\tmaxContentWidth = Math.max(maxContentWidth, lineContentWidth);\n\t}\n\tconst lines = range.mapToLineArray(l => model.getLineContent(l));\n\n\tif (maxContentWidth < 5 && lines.some(l => l.length > 0) && model.uri.scheme !== 'file') {\n\t\tconsole.error('unexpected width');\n\t}\n\treturn maxContentWidth;\n}\n\nexport function getContentSizeOfLines(editor: ObservableCodeEditor, range: LineRange, reader: IReader | undefined): Size2D[] {\n\teditor.layoutInfo.read(reader);\n\teditor.value.read(reader);\n\tobservableSignalFromEvent(editor, editor.editor.onDidChangeLineHeight).read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { throw new BugIndicatingError('Model is required'); }\n\n\tconst sizes: Size2D[] = [];\n\n\teditor.scrollTop.read(reader);\n\tfor (let i = range.startLineNumber; i < range.endLineNumberExclusive; i++) {\n\t\tconst column = model.getLineMaxColumn(i);\n\t\tlet lineContentWidth = editor.editor.getOffsetForColumn(i, column);\n\t\tif (lineContentWidth === -1) {\n\t\t\t// approximation\n\t\t\tconst typicalHalfwidthCharacterWidth = editor.editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\t\t\tconst approximation = column * typicalHalfwidthCharacterWidth;\n\t\t\tlineContentWidth = approximation;\n\t\t}\n\n\t\tconst height = editor.editor.getLineHeightForPosition(new Position(i, 1));\n\t\tsizes.push(new Size2D(lineContentWidth, height));\n\t}\n\n\treturn sizes;\n}\n\nexport function getOffsetForPos(editor: ObservableCodeEditor, pos: Position, reader: IReader): number {\n\teditor.layoutInfo.read(reader);\n\teditor.value.read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { return 0; }\n\n\teditor.scrollTop.read(reader);\n\tconst lineContentWidth = editor.editor.getOffsetForColumn(pos.lineNumber, pos.column);\n\n\treturn lineContentWidth;\n}\n\nexport function getPrefixTrim(diffRanges: Range[], originalLinesRange: LineRange, modifiedLines: string[], editor: ICodeEditor, reader: IReader | undefined = undefined): { prefixTrim: number; prefixLeftOffset: number } {\n\tconst textModel = editor.getModel();\n\tif (!textModel) {\n\t\treturn { prefixTrim: 0, prefixLeftOffset: 0 };\n\t}\n\n\tconst replacementStart = diffRanges.map(r => r.isSingleLine() ? r.startColumn - 1 : 0);\n\tconst originalIndents = originalLinesRange.mapToLineArray(line => indentOfLine(textModel.getLineContent(line)));\n\tconst modifiedIndents = modifiedLines.filter(line => line !== '').map(line => indentOfLine(line));\n\tconst prefixTrim = Math.min(...replacementStart, ...originalIndents, ...modifiedIndents);\n\n\tlet prefixLeftOffset;\n\tconst startLineIndent = textModel.getLineIndentColumn(originalLinesRange.startLineNumber);\n\tif (startLineIndent >= prefixTrim + 1) {\n\t\t// We can use the editor to get the offset\n\t\t// TODO go through other usages of getOffsetForColumn and come up with a robust reactive solution to read it\n\t\tobservableCodeEditor(editor).scrollTop.read(reader); // getOffsetForColumn requires the line number to be visible. This might change on scroll top.\n\t\tprefixLeftOffset = editor.getOffsetForColumn(originalLinesRange.startLineNumber, prefixTrim + 1);\n\t} else if (modifiedLines.length > 0) {\n\t\t// Content is not in the editor, we can use the content width to calculate the offset\n\t\tprefixLeftOffset = getContentRenderWidth(modifiedLines[0].slice(0, prefixTrim), editor, textModel);\n\t} else {\n\t\t// unable to approximate the offset\n\t\treturn { prefixTrim: 0, prefixLeftOffset: 0 };\n\t}\n\n\treturn { prefixTrim, prefixLeftOffset };\n}\n\nexport function getContentRenderWidth(content: string, editor: ICodeEditor, textModel: ITextModel) {\n\tconst w = editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\tconst tabSize = textModel.getOptions().tabSize * w;\n\n\tconst numTabs = content.split('\\t').length - 1;\n\tconst numNoneTabs = content.length - numTabs;\n\treturn numNoneTabs * w + numTabs * tabSize;\n}\n\nexport function getEditorValidOverlayRect(editor: ObservableCodeEditor): IObservable<Rect> {\n\tconst contentLeft = editor.layoutInfoContentLeft;\n\n\tconst width = derived({ name: 'editor.validOverlay.width' }, r => {\n\t\tconst hasMinimapOnTheRight = editor.layoutInfoMinimap.read(r).minimapLeft !== 0;\n\t\tconst editorWidth = editor.layoutInfoWidth.read(r) - contentLeft.read(r);\n\n\t\tif (hasMinimapOnTheRight) {\n\t\t\tconst minimapAndScrollbarWidth = editor.layoutInfoMinimap.read(r).minimapWidth + editor.layoutInfoVerticalScrollbarWidth.read(r);\n\t\t\treturn editorWidth - minimapAndScrollbarWidth;\n\t\t}\n\n\t\treturn editorWidth;\n\t});\n\n\tconst height = derived({ name: 'editor.validOverlay.height' }, r => editor.layoutInfoHeight.read(r) + editor.contentHeight.read(r));\n\n\treturn derived({ name: 'editor.validOverlay' }, r => Rect.fromLeftTopWidthHeight(contentLeft.read(r), 0, width.read(r), height.read(r)));\n}\nexport function applyEditToModifiedRangeMappings(rangeMapping: RangeMapping[], edit: TextEdit): RangeMapping[] {\n\tconst updatedMappings: RangeMapping[] = [];\n\tfor (const m of rangeMapping) {\n\t\tconst updatedRange = edit.mapRange(m.modifiedRange);\n\t\tupdatedMappings.push(new RangeMapping(m.originalRange, updatedRange));\n\t}\n\treturn updatedMappings;\n}\n\n\nexport function classNames(...classes: (string | false | undefined | null)[]) {\n\treturn classes.filter(c => typeof c === 'string').join(' ');\n}\n\nfunction offsetRangeToRange(columnOffsetRange: OffsetRange, startPos: Position): Range {\n\treturn new Range(\n\t\tstartPos.lineNumber,\n\t\tstartPos.column + columnOffsetRange.start,\n\t\tstartPos.lineNumber,\n\t\tstartPos.column + columnOffsetRange.endExclusive,\n\t);\n}\n\n/**\n * Calculates the indentation size (in spaces) of a given line,\n * interpreting tabs as the specified tab size.\n */\nfunction getIndentationSize(line: string, tabSize: number): number {\n\tlet currentSize = 0;\n\tloop: for (let i = 0, len = line.length; i < len; i++) {\n\t\tswitch (line.charCodeAt(i)) {\n\t\t\tcase CharCode.Tab: currentSize += tabSize; break;\n\t\t\tcase CharCode.Space: currentSize++; break;\n\t\t\tdefault: break loop;\n\t\t}\n\t}\n\t// if currentSize % tabSize !== 0,\n\t// then there are spaces which are not part of the indentation\n\treturn currentSize - (currentSize % tabSize);\n}\n\n/**\n * Calculates the number of characters at the start of a line that correspond to a given indentation size,\n * taking into account both tabs and spaces.\n */\nfunction indentSizeToIndentLength(line: string, indentSize: number, tabSize: number): number {\n\tlet remainingSize = indentSize - (indentSize % tabSize);\n\tlet i = 0;\n\tfor (; i < line.length; i++) {\n\t\tif (remainingSize === 0) {\n\t\t\tbreak;\n\t\t}\n\t\tswitch (line.charCodeAt(i)) {\n\t\t\tcase CharCode.Tab: remainingSize -= tabSize; break;\n\t\t\tcase CharCode.Space: remainingSize--; break;\n\t\t\tdefault: throw new BugIndicatingError('Unexpected character found while calculating indent length');\n\t\t}\n\t}\n\treturn i;\n}\n\nexport function createReindentEdit(text: string, range: LineRange, tabSize: number): TextEdit {\n\tconst newLines = splitLines(text);\n\tconst edits: TextReplacement[] = [];\n\tconst minIndentSize = findFirstMin(range.mapToLineArray(l => getIndentationSize(newLines[l - 1], tabSize)), numberComparator)!;\n\trange.forEach(lineNumber => {\n\t\tconst indentLength = indentSizeToIndentLength(newLines[lineNumber - 1], minIndentSize, tabSize);\n\t\tedits.push(new TextReplacement(offsetRangeToRange(new OffsetRange(0, indentLength), new Position(lineNumber, 1)), ''));\n\t});\n\treturn new TextEdit(edits);\n}\n\nexport class PathBuilder {\n\tprivate _data: string = '';\n\n\tpublic moveTo(point: Point): this {\n\t\tthis._data += `M ${point.x} ${point.y} `;\n\t\treturn this;\n\t}\n\n\tpublic lineTo(point: Point): this {\n\t\tthis._data += `L ${point.x} ${point.y} `;\n\t\treturn this;\n\t}\n\n\tpublic build(): string {\n\t\treturn this._data;\n\t}\n}\n\ntype RemoveFalsy<T> = T extends false | undefined | null ? never : T;\ntype Falsy<T> = T extends false | undefined | null ? T : never;\n\nexport function mapOutFalsy<T>(obs: IObservable<T>): IObservable<IObservable<RemoveFalsy<T>> | Falsy<T>> {\n\tconst nonUndefinedObs = derivedObservableWithCache<T | undefined | null | false>(undefined, (reader, lastValue) => obs.read(reader) || lastValue);\n\n\treturn derivedOpts({\n\t\tdebugName: () => `${obs.debugName}.mapOutFalsy`\n\t}, reader => {\n\t\tnonUndefinedObs.read(reader);\n\t\tconst val = obs.read(reader);\n\t\tif (!val) {\n\t\t\treturn undefined as Falsy<T>;\n\t\t}\n\n\t\treturn nonUndefinedObs as IObservable<RemoveFalsy<T>>;\n\t});\n}\n\nexport function rectToProps(fn: (reader: IReader) => Rect | undefined, debugLocation: DebugLocation = DebugLocation.ofCaller()) {\n\treturn {\n\t\tleft: derived({ name: 'editor.validOverlay.left' }, reader => /** @description left */ fn(reader)?.left, debugLocation),\n\t\ttop: derived({ name: 'editor.validOverlay.top' }, reader => /** @description top */ fn(reader)?.top, debugLocation),\n\t\twidth: derived({ name: 'editor.validOverlay.width' }, reader => {\n\t\t\t/** @description width */\n\t\t\tconst val = fn(reader);\n\t\t\tif (!val) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn val.width;\n\t\t}, debugLocation),\n\t\theight: derived({ name: 'editor.validOverlay.height' }, reader => {\n\t\t\t/** @description height */\n\t\t\tconst val = fn(reader);\n\t\t\tif (!val) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn val.height;\n\t\t}, debugLocation),\n\t};\n}\n\nexport type FirstFnArg<T> = T extends (arg: infer U) => any ? U : never;\n","\nimport { numberComparator } from '../../../../../../../base/common/arrays.js';\nimport { findFirstMin } from '../../../../../../../base/common/arraysFind.js';\nimport { DebugLocation, derived, derivedObservableWithCache, derivedOpts, IObservable, IReader, observableSignalFromEvent } from '../../../../../../../base/common/observable.js';\nimport { splitLines } from '../../../../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor, ObservableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { Point } from '../../../../../../common/core/2d/point.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { EditorOption } from '../../../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../../../common/core/ranges/lineRange.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { Position } from '../../../../../../common/core/position.js';\nimport { Range } from '../../../../../../common/core/range.js';\nimport { TextReplacement, TextEdit } from '../../../../../../common/core/edits/textEdit.js';\nimport { RangeMapping } from '../../../../../../common/diff/rangeMapping.js';\nimport { ITextModel } from '../../../../../../common/model.js';\nimport { indentOfLine } from '../../../../../../common/model/textModel.js';\nimport { CharCode } from '../../../../../../../base/common/charCode.js';\nimport { BugIndicatingError } from '../../../../../../../base/common/errors.js';\nimport { Size2D } from '../../../../../../common/core/2d/size.js';\n\nexport function maxContentWidthInRange(editor: ObservableCodeEditor, range: LineRange, reader: IReader | undefined): number {\n\teditor.layoutInfo.read(reader);\n\teditor.value.read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { return 0; }\n\tlet maxContentWidth = 0;\n\n\teditor.scrollTop.read(reader);\n\tfor (let i = range.startLineNumber; i < range.endLineNumberExclusive; i++) {\n\t\tconst column = model.getLineMaxColumn(i);\n\t\tconst lineContentWidth = editor.getLeftOfPosition(new Position(i, column), reader);\n\t\tmaxContentWidth = Math.max(maxContentWidth, lineContentWidth);\n\t}\n\tconst lines = range.mapToLineArray(l => model.getLineContent(l));\n\n\tif (maxContentWidth < 5 && lines.some(l => l.length > 0) && model.uri.scheme !== 'file') {\n\t\tconsole.error('unexpected width');\n\t}\n\treturn maxContentWidth;\n}\n\nexport function getContentSizeOfLines(editor: ObservableCodeEditor, range: LineRange, reader: IReader | undefined): Size2D[] {\n\teditor.layoutInfo.read(reader);\n\teditor.value.read(reader);\n\tobservableSignalFromEvent(editor, editor.editor.onDidChangeLineHeight).read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { throw new BugIndicatingError('Model is required'); }\n\n\tconst sizes: Size2D[] = [];\n\n\teditor.scrollTop.read(reader);\n\tfor (let i = range.startLineNumber; i < range.endLineNumberExclusive; i++) {\n\t\tconst column = model.getLineMaxColumn(i);\n\t\tlet lineContentWidth = editor.editor.getOffsetForColumn(i, column);\n\t\tif (lineContentWidth === -1) {\n\t\t\t// approximation\n\t\t\tconst typicalHalfwidthCharacterWidth = editor.editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\t\t\tconst approximation = column * typicalHalfwidthCharacterWidth;\n\t\t\tlineContentWidth = approximation;\n\t\t}\n\n\t\tconst height = editor.editor.getLineHeightForPosition(new Position(i, 1));\n\t\tsizes.push(new Size2D(lineContentWidth, height));\n\t}\n\n\treturn sizes;\n}\n\nexport function getOffsetForPos(editor: ObservableCodeEditor, pos: Position, reader: IReader): number {\n\teditor.layoutInfo.read(reader);\n\teditor.value.read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { return 0; }\n\n\teditor.scrollTop.read(reader);\n\tconst lineContentWidth = editor.editor.getOffsetForColumn(pos.lineNumber, pos.column);\n\n\treturn lineContentWidth;\n}\n\nexport function getPrefixTrim(diffRanges: Range[], originalLinesRange: LineRange, modifiedLines: string[], editor: ICodeEditor, reader: IReader | undefined = undefined): { prefixTrim: number; prefixLeftOffset: number } {\n\tconst textModel = editor.getModel();\n\tif (!textModel) {\n\t\treturn { prefixTrim: 0, prefixLeftOffset: 0 };\n\t}\n\n\tconst replacementStart = diffRanges.map(r => r.isSingleLine() ? r.startColumn - 1 : 0);\n\tconst originalIndents = originalLinesRange.mapToLineArray(line => indentOfLine(textModel.getLineContent(line)));\n\tconst modifiedIndents = modifiedLines.filter(line => line !== '').map(line => indentOfLine(line));\n\tconst prefixTrim = Math.min(...replacementStart, ...originalIndents, ...modifiedIndents);\n\n\tlet prefixLeftOffset;\n\tconst startLineIndent = textModel.getLineIndentColumn(originalLinesRange.startLineNumber);\n\tif (startLineIndent >= prefixTrim + 1) {\n\t\t// We can use the editor to get the offset\n\t\t// TODO go through other usages of getOffsetForColumn and come up with a robust reactive solution to read it\n\t\tobservableCodeEditor(editor).scrollTop.read(reader); // getOffsetForColumn requires the line number to be visible. This might change on scroll top.\n\t\tprefixLeftOffset = editor.getOffsetForColumn(originalLinesRange.startLineNumber, prefixTrim + 1);\n\t} else if (modifiedLines.length > 0) {\n\t\t// Content is not in the editor, we can use the content width to calculate the offset\n\t\tprefixLeftOffset = getContentRenderWidth(modifiedLines[0].slice(0, prefixTrim), editor, textModel);\n\t} else {\n\t\t// unable to approximate the offset\n\t\treturn { prefixTrim: 0, prefixLeftOffset: 0 };\n\t}\n\n\treturn { prefixTrim, prefixLeftOffset };\n}\n\nexport function getContentRenderWidth(content: string, editor: ICodeEditor, textModel: ITextModel) {\n\tconst w = editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\tconst tabSize = textModel.getOptions().tabSize * w;\n\n\tconst numTabs = content.split('\\t').length - 1;\n\tconst numNoneTabs = content.length - numTabs;\n\treturn numNoneTabs * w + numTabs * tabSize;\n}\n\nexport function getEditorValidOverlayRect(editor: ObservableCodeEditor): IObservable<Rect> {\n\tconst contentLeft = editor.layoutInfoContentLeft;\n\n\tconst width = derived({ name: 'editor.validOverlay.width' }, r => {\n\t\tconst hasMinimapOnTheRight = editor.layoutInfoMinimap.read(r).minimapLeft !== 0;\n\t\tconst editorWidth = editor.layoutInfoWidth.read(r) - contentLeft.read(r);\n\n\t\tif (hasMinimapOnTheRight) {\n\t\t\tconst minimapAndScrollbarWidth = editor.layoutInfoMinimap.read(r).minimapWidth + editor.layoutInfoVerticalScrollbarWidth.read(r);\n\t\t\treturn editorWidth - minimapAndScrollbarWidth;\n\t\t}\n\n\t\treturn editorWidth;\n\t});\n\n\tconst height = derived({ name: 'editor.validOverlay.height' }, r => editor.layoutInfoHeight.read(r) + editor.contentHeight.read(r));\n\n\treturn derived({ name: 'editor.validOverlay' }, r => Rect.fromLeftTopWidthHeight(contentLeft.read(r), 0, width.read(r), height.read(r)));\n}\nexport function applyEditToModifiedRangeMappings(rangeMapping: RangeMapping[], edit: TextEdit): RangeMapping[] {\n\tconst updatedMappings: RangeMapping[] = [];\n\tfor (const m of rangeMapping) {\n\t\tconst updatedRange = edit.mapRange(m.modifiedRange);\n\t\tupdatedMappings.push(new RangeMapping(m.originalRange, updatedRange));\n\t}\n\treturn updatedMappings;\n}\n\n\nexport function classNames(...classes: (string | false | undefined | null)[]) {\n\treturn classes.filter(c => typeof c === 'string').join(' ');\n}\n\nfunction offsetRangeToRange(columnOffsetRange: OffsetRange, startPos: Position): Range {\n\treturn new Range(\n\t\tstartPos.lineNumber,\n\t\tstartPos.column + columnOffsetRange.start,\n\t\tstartPos.lineNumber,\n\t\tstartPos.column + columnOffsetRange.endExclusive,\n\t);\n}\n\n/**\n * Calculates the indentation size (in spaces) of a given line,\n * interpreting tabs as the specified tab size.\n */\nfunction getIndentationSize(line: string, tabSize: number): number {\n\tlet currentSize = 0;\n\tloop: for (let i = 0, len = line.length; i < len; i++) {\n\t\tswitch (line.charCodeAt(i)) {\n\t\t\tcase CharCode.Tab: currentSize += tabSize; break;\n\t\t\tcase CharCode.Space: currentSize++; break;\n\t\t\tdefault: break loop;\n\t\t}\n\t}\n\t// if currentSize % tabSize !== 0,\n\t// then there are spaces which are not part of the indentation\n\treturn currentSize - (currentSize % tabSize);\n}\n\n/**\n * Calculates the number of characters at the start of a line that correspond to a given indentation size,\n * taking into account both tabs and spaces.\n */\nfunction indentSizeToIndentLength(line: string, indentSize: number, tabSize: number): number {\n\tlet remainingSize = indentSize - (indentSize % tabSize);\n\tlet i = 0;\n\tfor (; i < line.length; i++) {\n\t\tif (remainingSize === 0) {\n\t\t\tbreak;\n\t\t}\n\t\tswitch (line.charCodeAt(i)) {\n\t\t\tcase CharCode.Tab: remainingSize -= tabSize; break;\n\t\t\tcase CharCode.Space: remainingSize--; break;\n\t\t\tdefault: throw new BugIndicatingError('Unexpected character found while calculating indent length');\n\t\t}\n\t}\n\treturn i;\n}\n\nexport function createReindentEdit(text: string, range: LineRange, tabSize: number): TextEdit {\n\tconst newLines = splitLines(text);\n\tconst edits: TextReplacement[] = [];\n\tconst minIndentSize = findFirstMin(range.mapToLineArray(l => getIndentationSize(newLines[l - 1], tabSize)), numberComparator)!;\n\trange.forEach(lineNumber => {\n\t\tconst indentLength = indentSizeToIndentLength(newLines[lineNumber - 1], minIndentSize, tabSize);\n\t\tedits.push(new TextReplacement(offsetRangeToRange(new OffsetRange(0, indentLength), new Position(lineNumber, 1)), ''));\n\t});\n\treturn new TextEdit(edits);\n}\n\nexport class PathBuilder {\n\tprivate _data: string = '';\n\n\tpublic moveTo(point: Point): this {\n\t\tthis._data += `M ${point.x} ${point.y} `;\n\t\treturn this;\n\t}\n\n\tpublic lineTo(point: Point): this {\n\t\tthis._data += `L ${point.x} ${point.y} `;\n\t\treturn this;\n\t}\n\n\tpublic build(): string {\n\t\treturn this._data;\n\t}\n}\n\ntype RemoveFalsy<T> = T extends false | undefined | null ? never : T;\ntype Falsy<T> = T extends false | undefined | null ? T : never;\n\nexport function mapOutFalsy<T>(obs: IObservable<T>): IObservable<IObservable<RemoveFalsy<T>> | Falsy<T>> {\n\tconst nonUndefinedObs = derivedObservableWithCache<T | undefined | null | false>(undefined, (reader, lastValue) => obs.read(reader) || lastValue);\n\n\treturn derivedOpts({\n\t\tdebugName: () => `${obs.debugName}.mapOutFalsy`\n\t}, reader => {\n\t\tnonUndefinedObs.read(reader);\n\t\tconst val = obs.read(reader);\n\t\tif (!val) {\n\t\t\treturn undefined as Falsy<T>;\n\t\t}\n\n\t\treturn nonUndefinedObs as IObservable<RemoveFalsy<T>>;\n\t});\n}\n\nexport function rectToProps(fn: (reader: IReader) => Rect | undefined, debugLocation: DebugLocation = DebugLocation.ofCaller()) {\n\treturn {\n\t\tleft: derived({ name: 'editor.validOverlay.left' }, reader => /** @description left */ fn(reader)?.left, debugLocation),\n\t\ttop: derived({ name: 'editor.validOverlay.top' }, reader => /** @description top */ fn(reader)?.top, debugLocation),\n\t\twidth: derived({ name: 'editor.validOverlay.width' }, reader => {\n\t\t\t/** @description width */\n\t\t\tconst val = fn(reader);\n\t\t\tif (!val) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn val.width;\n\t\t}, debugLocation),\n\t\theight: derived({ name: 'editor.validOverlay.height' }, reader => {\n\t\t\t/** @description height */\n\t\t\tconst val = fn(reader);\n\t\t\tif (!val) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn val.height;\n\t\t}, debugLocation),\n\t};\n}\n\nexport type FirstFnArg<T> = T extends (arg: infer U) => any ? U : never;\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.ts","vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAE9E,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,0BAA0B,EAAE,WAAW,EAAwB,yBAAyB,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACnM,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAwB,MAAM,mDAAmD,CAAC;AAE/G,OAAO,EAAE,IAAI,EAAE,MAAM,0CAA0C,CAAC;AAGhE,OAAO,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAC;AAClF,OAAO,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAE3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAElE;;EAEE;AACF,MAAM,U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,+BAA+B,CAAC,MAAmB,EAAE,KAAsB;IAC1F,MAAM,GAAG,GAAG,MAAM,CAAC,mBAAmB,EAAG,CAAC;IAC1C,MAAM,cAAc,GAAG,eAAe,CAAC,SAAS,EAAE,GAAG,CAAC,qBAAqB,EAAE,CAAC,CAAC;IAC/E,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE;QACtC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,qBAAqB,EAAE,EAAE,SAAS,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC,CAAC;IACJ,OAAO,cAAc,CAAC;AACvB,CAAC","file":"utils.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["\nimport { numberComparator } from '../../../../../../../base/common/arrays.js';\nimport { findFirstMin } from '../../../../../../../base/common/arraysFind.js';\nimport { DisposableStore } from '../../../../../../../base/common/lifecycle.js';\nimport { DebugLocation, derived, derivedObservableWithCache, derivedOpts, IObservable, IReader, observableSignalFromEvent, observableValue } from '../../../../../../../base/common/observable.js';\nimport { splitLines } from '../../../../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor, ObservableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { Point } from '../../../../../../common/core/2d/point.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { EditorOption } from '../../../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../../../common/core/ranges/lineRange.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { Position } from '../../../../../../common/core/position.js';\nimport { Range } from '../../../../../../common/core/range.js';\nimport { TextReplacement, TextEdit } from '../../../../../../common/core/edits/textEdit.js';\nimport { RangeMapping } from '../../../../../../common/diff/rangeMapping.js';\nimport { ITextModel } from '../../../../../../common/model.js';\nimport { indentOfLine } from '../../../../../../common/model/textModel.js';\nimport { CharCode } from '../../../../../../../base/common/charCode.js';\nimport { BugIndicatingError } from '../../../../../../../base/common/errors.js';\nimport { Size2D } from '../../../../../../common/core/2d/size.js';\n\n/**\n * Warning: might return 0.\n*/\nexport function maxContentWidthInRange(editor: ObservableCodeEditor, range: LineRange, reader: IReader | undefined): number {\n\teditor.layoutInfo.read(reader);\n\teditor.value.read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { return 0; }\n\tlet maxContentWidth = 0;\n\n\teditor.scrollTop.read(reader);\n\tfor (let i = range.startLineNumber; i < range.endLineNumberExclusive; i++) {\n\t\tconst lineContentWidth = editor.editor.getWidthOfLine(i);\n\t\tmaxContentWidth = Math.max(maxContentWidth, lineContentWidth);\n\t}\n\tconst lines = range.mapToLineArray(l => model.getLineContent(l));\n\n\tif (maxContentWidth < 5 && lines.some(l => l.length > 0) && model.uri.scheme !== 'file') {\n\t\tconsole.error('unexpected width');\n\t}\n\treturn maxContentWidth;\n}\n\nexport function getContentSizeOfLines(editor: ObservableCodeEditor, range: LineRange, reader: IReader | undefined): Size2D[] {\n\teditor.layoutInfo.read(reader);\n\teditor.value.read(reader);\n\tobservableSignalFromEvent(editor, editor.editor.onDidChangeLineHeight).read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { throw new BugIndicatingError('Model is required'); }\n\n\tconst sizes: Size2D[] = [];\n\n\teditor.scrollTop.read(reader);\n\tfor (let i = range.startLineNumber; i < range.endLineNumberExclusive; i++) {\n\t\tlet lineContentWidth = editor.editor.getWidthOfLine(i);\n\t\tif (lineContentWidth === -1) {\n\t\t\t// approximation\n\t\t\tconst column = model.getLineMaxColumn(i);\n\t\t\tconst typicalHalfwidthCharacterWidth = editor.editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\t\t\tconst approximation = column * typicalHalfwidthCharacterWidth;\n\t\t\tlineContentWidth = approximation;\n\t\t}\n\n\t\tconst height = editor.editor.getLineHeightForPosition(new Position(i, 1));\n\t\tsizes.push(new Size2D(lineContentWidth, height));\n\t}\n\n\treturn sizes;\n}\n\nexport function getOffsetForPos(editor: ObservableCodeEditor, pos: Position, reader: IReader): number {\n\teditor.layoutInfo.read(reader);\n\teditor.value.read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { return 0; }\n\n\teditor.scrollTop.read(reader);\n\tconst lineContentWidth = editor.editor.getOffsetForColumn(pos.lineNumber, pos.column);\n\n\treturn lineContentWidth;\n}\n\nexport function getPrefixTrim(diffRanges: Range[], originalLinesRange: LineRange, modifiedLines: string[], editor: ICodeEditor, reader: IReader | undefined = undefined): { prefixTrim: number; prefixLeftOffset: number } {\n\tconst textModel = editor.getModel();\n\tif (!textModel) {\n\t\treturn { prefixTrim: 0, prefixLeftOffset: 0 };\n\t}\n\n\tconst replacementStart = diffRanges.map(r => r.isSingleLine() ? r.startColumn - 1 : 0);\n\tconst originalIndents = originalLinesRange.mapToLineArray(line => indentOfLine(textModel.getLineContent(line)));\n\tconst modifiedIndents = modifiedLines.filter(line => line !== '').map(line => indentOfLine(line));\n\tconst prefixTrim = Math.min(...replacementStart, ...originalIndents, ...modifiedIndents);\n\n\tlet prefixLeftOffset;\n\tconst startLineIndent = textModel.getLineIndentColumn(originalLinesRange.startLineNumber);\n\tif (startLineIndent >= prefixTrim + 1) {\n\t\t// We can use the editor to get the offset\n\t\t// TODO go through other usages of getOffsetForColumn and come up with a robust reactive solution to read it\n\t\tobservableCodeEditor(editor).scrollTop.read(reader); // getOffsetForColumn requires the line number to be visible. This might change on scroll top.\n\t\tprefixLeftOffset = editor.getOffsetForColumn(originalLinesRange.startLineNumber, prefixTrim + 1);\n\t} else if (modifiedLines.length > 0) {\n\t\t// Content is not in the editor, we can use the content width to calculate the offset\n\t\tprefixLeftOffset = getContentRenderWidth(modifiedLines[0].slice(0, prefixTrim), editor, textModel);\n\t} else {\n\t\t// unable to approximate the offset\n\t\treturn { prefixTrim: 0, prefixLeftOffset: 0 };\n\t}\n\n\treturn { prefixTrim, prefixLeftOffset };\n}\n\nexport function getContentRenderWidth(content: string, editor: ICodeEditor, textModel: ITextModel) {\n\tconst w = editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\tconst tabSize = textModel.getOptions().tabSize * w;\n\n\tconst numTabs = content.split('\\t').length - 1;\n\tconst numNoneTabs = content.length - numTabs;\n\treturn numNoneTabs * w + numTabs * tabSize;\n}\n\nexport function getEditorValidOverlayRect(editor: ObservableCodeEditor): IObservable<Rect> {\n\tconst contentLeft = editor.layoutInfoContentLeft;\n\n\tconst width = derived({ name: 'editor.validOverlay.width' }, r => {\n\t\tconst hasMinimapOnTheRight = editor.layoutInfoMinimap.read(r).minimapLeft !== 0;\n\t\tconst editorWidth = editor.layoutInfoWidth.read(r) - contentLeft.read(r);\n\n\t\tif (hasMinimapOnTheRight) {\n\t\t\tconst minimapAndScrollbarWidth = editor.layoutInfoMinimap.read(r).minimapWidth + editor.layoutInfoVerticalScrollbarWidth.read(r);\n\t\t\treturn editorWidth - minimapAndScrollbarWidth;\n\t\t}\n\n\t\treturn editorWidth;\n\t});\n\n\tconst height = derived({ name: 'editor.validOverlay.height' }, r => editor.layoutInfoHeight.read(r) + editor.contentHeight.read(r));\n\n\treturn derived({ name: 'editor.validOverlay' }, r => Rect.fromLeftTopWidthHeight(contentLeft.read(r), 0, width.read(r), height.read(r)));\n}\nexport function applyEditToModifiedRangeMappings(rangeMapping: RangeMapping[], edit: TextEdit): RangeMapping[] {\n\tconst updatedMappings: RangeMapping[] = [];\n\tfor (const m of rangeMapping) {\n\t\tconst updatedRange = edit.mapRange(m.modifiedRange);\n\t\tupdatedMappings.push(new RangeMapping(m.originalRange, updatedRange));\n\t}\n\treturn updatedMappings;\n}\n\n\nexport function classNames(...classes: (string | false | undefined | null)[]) {\n\treturn classes.filter(c => typeof c === 'string').join(' ');\n}\n\nfunction offsetRangeToRange(columnOffsetRange: OffsetRange, startPos: Position): Range {\n\treturn new Range(\n\t\tstartPos.lineNumber,\n\t\tstartPos.column + columnOffsetRange.start,\n\t\tstartPos.lineNumber,\n\t\tstartPos.column + columnOffsetRange.endExclusive,\n\t);\n}\n\n/**\n * Calculates the indentation size (in spaces) of a given line,\n * interpreting tabs as the specified tab size.\n */\nfunction getIndentationSize(line: string, tabSize: number): number {\n\tlet currentSize = 0;\n\tloop: for (let i = 0, len = line.length; i < len; i++) {\n\t\tswitch (line.charCodeAt(i)) {\n\t\t\tcase CharCode.Tab: currentSize += tabSize; break;\n\t\t\tcase CharCode.Space: currentSize++; break;\n\t\t\tdefault: break loop;\n\t\t}\n\t}\n\t// if currentSize % tabSize !== 0,\n\t// then there are spaces which are not part of the indentation\n\treturn currentSize - (currentSize % tabSize);\n}\n\n/**\n * Calculates the number of characters at the start of a line that correspond to a given indentation size,\n * taking into account both tabs and spaces.\n */\nfunction indentSizeToIndentLength(line: string, indentSize: number, tabSize: number): number {\n\tlet remainingSize = indentSize - (indentSize % tabSize);\n\tlet i = 0;\n\tfor (; i < line.length; i++) {\n\t\tif (remainingSize === 0) {\n\t\t\tbreak;\n\t\t}\n\t\tswitch (line.charCodeAt(i)) {\n\t\t\tcase CharCode.Tab: remainingSize -= tabSize; break;\n\t\t\tcase CharCode.Space: remainingSize--; break;\n\t\t\tdefault: throw new BugIndicatingError('Unexpected character found while calculating indent length');\n\t\t}\n\t}\n\treturn i;\n}\n\nexport function createReindentEdit(text: string, range: LineRange, tabSize: number): TextEdit {\n\tconst newLines = splitLines(text);\n\tconst edits: TextReplacement[] = [];\n\tconst minIndentSize = findFirstMin(range.mapToLineArray(l => getIndentationSize(newLines[l - 1], tabSize)), numberComparator)!;\n\trange.forEach(lineNumber => {\n\t\tconst indentLength = indentSizeToIndentLength(newLines[lineNumber - 1], minIndentSize, tabSize);\n\t\tedits.push(new TextReplacement(offsetRangeToRange(new OffsetRange(0, indentLength), new Position(lineNumber, 1)), ''));\n\t});\n\treturn new TextEdit(edits);\n}\n\nexport class PathBuilder {\n\tprivate _data: string = '';\n\n\tpublic moveTo(point: Point): this {\n\t\tthis._data += `M ${point.x} ${point.y} `;\n\t\treturn this;\n\t}\n\n\tpublic lineTo(point: Point): this {\n\t\tthis._data += `L ${point.x} ${point.y} `;\n\t\treturn this;\n\t}\n\n\tpublic build(): string {\n\t\treturn this._data;\n\t}\n}\n\ntype RemoveFalsy<T> = T extends false | undefined | null ? never : T;\ntype Falsy<T> = T extends false | undefined | null ? T : never;\n\nexport function mapOutFalsy<T>(obs: IObservable<T>): IObservable<IObservable<RemoveFalsy<T>> | Falsy<T>> {\n\tconst nonUndefinedObs = derivedObservableWithCache<T | undefined | null | false>(undefined, (reader, lastValue) => obs.read(reader) || lastValue);\n\n\treturn derivedOpts({\n\t\tdebugName: () => `${obs.debugName}.mapOutFalsy`\n\t}, reader => {\n\t\tnonUndefinedObs.read(reader);\n\t\tconst val = obs.read(reader);\n\t\tif (!val) {\n\t\t\treturn undefined as Falsy<T>;\n\t\t}\n\n\t\treturn nonUndefinedObs as IObservable<RemoveFalsy<T>>;\n\t});\n}\n\nexport function rectToProps(fn: (reader: IReader) => Rect | undefined, debugLocation: DebugLocation = DebugLocation.ofCaller()) {\n\treturn {\n\t\tleft: derived({ name: 'editor.validOverlay.left' }, reader => /** @description left */ fn(reader)?.left, debugLocation),\n\t\ttop: derived({ name: 'editor.validOverlay.top' }, reader => /** @description top */ fn(reader)?.top, debugLocation),\n\t\twidth: derived({ name: 'editor.validOverlay.width' }, reader => {\n\t\t\t/** @description width */\n\t\t\tconst val = fn(reader);\n\t\t\tif (!val) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn val.width;\n\t\t}, debugLocation),\n\t\theight: derived({ name: 'editor.validOverlay.height' }, reader => {\n\t\t\t/** @description height */\n\t\t\tconst val = fn(reader);\n\t\t\tif (!val) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn val.height;\n\t\t}, debugLocation),\n\t};\n}\n\nexport type FirstFnArg<T> = T extends (arg: infer U) => any ? U : never;\n\n\nexport function observeEditorBoundingClientRect(editor: ICodeEditor, store: DisposableStore): IObservable<DOMRectReadOnly> {\n\tconst dom = editor.getContainerDomNode()!;\n\tconst initialDomRect = observableValue('domRect', dom.getBoundingClientRect());\n\tstore.add(editor.onDidLayoutChange(e => {\n\t\tinitialDomRect.set(dom.getBoundingClientRect(), undefined);\n\t}));\n\treturn initialDomRect;\n}\n","\nimport { numberComparator } from '../../../../../../../base/common/arrays.js';\nimport { findFirstMin } from '../../../../../../../base/common/arraysFind.js';\nimport { DisposableStore } from '../../../../../../../base/common/lifecycle.js';\nimport { DebugLocation, derived, derivedObservableWithCache, derivedOpts, IObservable, IReader, observableSignalFromEvent, observableValue } from '../../../../../../../base/common/observable.js';\nimport { splitLines } from '../../../../../../../base/common/strings.js';\nimport { ICodeEditor } from '../../../../../../browser/editorBrowser.js';\nimport { observableCodeEditor, ObservableCodeEditor } from '../../../../../../browser/observableCodeEditor.js';\nimport { Point } from '../../../../../../common/core/2d/point.js';\nimport { Rect } from '../../../../../../common/core/2d/rect.js';\nimport { EditorOption } from '../../../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../../../common/core/ranges/lineRange.js';\nimport { OffsetRange } from '../../../../../../common/core/ranges/offsetRange.js';\nimport { Position } from '../../../../../../common/core/position.js';\nimport { Range } from '../../../../../../common/core/range.js';\nimport { TextReplacement, TextEdit } from '../../../../../../common/core/edits/textEdit.js';\nimport { RangeMapping } from '../../../../../../common/diff/rangeMapping.js';\nimport { ITextModel } from '../../../../../../common/model.js';\nimport { indentOfLine } from '../../../../../../common/model/textModel.js';\nimport { CharCode } from '../../../../../../../base/common/charCode.js';\nimport { BugIndicatingError } from '../../../../../../../base/common/errors.js';\nimport { Size2D } from '../../../../../../common/core/2d/size.js';\n\n/**\n * Warning: might return 0.\n*/\nexport function maxContentWidthInRange(editor: ObservableCodeEditor, range: LineRange, reader: IReader | undefined): number {\n\teditor.layoutInfo.read(reader);\n\teditor.value.read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { return 0; }\n\tlet maxContentWidth = 0;\n\n\teditor.scrollTop.read(reader);\n\tfor (let i = range.startLineNumber; i < range.endLineNumberExclusive; i++) {\n\t\tconst lineContentWidth = editor.editor.getWidthOfLine(i);\n\t\tmaxContentWidth = Math.max(maxContentWidth, lineContentWidth);\n\t}\n\tconst lines = range.mapToLineArray(l => model.getLineContent(l));\n\n\tif (maxContentWidth < 5 && lines.some(l => l.length > 0) && model.uri.scheme !== 'file') {\n\t\tconsole.error('unexpected width');\n\t}\n\treturn maxContentWidth;\n}\n\nexport function getContentSizeOfLines(editor: ObservableCodeEditor, range: LineRange, reader: IReader | undefined): Size2D[] {\n\teditor.layoutInfo.read(reader);\n\teditor.value.read(reader);\n\tobservableSignalFromEvent(editor, editor.editor.onDidChangeLineHeight).read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { throw new BugIndicatingError('Model is required'); }\n\n\tconst sizes: Size2D[] = [];\n\n\teditor.scrollTop.read(reader);\n\tfor (let i = range.startLineNumber; i < range.endLineNumberExclusive; i++) {\n\t\tlet lineContentWidth = editor.editor.getWidthOfLine(i);\n\t\tif (lineContentWidth === -1) {\n\t\t\t// approximation\n\t\t\tconst column = model.getLineMaxColumn(i);\n\t\t\tconst typicalHalfwidthCharacterWidth = editor.editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\t\t\tconst approximation = column * typicalHalfwidthCharacterWidth;\n\t\t\tlineContentWidth = approximation;\n\t\t}\n\n\t\tconst height = editor.editor.getLineHeightForPosition(new Position(i, 1));\n\t\tsizes.push(new Size2D(lineContentWidth, height));\n\t}\n\n\treturn sizes;\n}\n\nexport function getOffsetForPos(editor: ObservableCodeEditor, pos: Position, reader: IReader): number {\n\teditor.layoutInfo.read(reader);\n\teditor.value.read(reader);\n\n\tconst model = editor.model.read(reader);\n\tif (!model) { return 0; }\n\n\teditor.scrollTop.read(reader);\n\tconst lineContentWidth = editor.editor.getOffsetForColumn(pos.lineNumber, pos.column);\n\n\treturn lineContentWidth;\n}\n\nexport function getPrefixTrim(diffRanges: Range[], originalLinesRange: LineRange, modifiedLines: string[], editor: ICodeEditor, reader: IReader | undefined = undefined): { prefixTrim: number; prefixLeftOffset: number } {\n\tconst textModel = editor.getModel();\n\tif (!textModel) {\n\t\treturn { prefixTrim: 0, prefixLeftOffset: 0 };\n\t}\n\n\tconst replacementStart = diffRanges.map(r => r.isSingleLine() ? r.startColumn - 1 : 0);\n\tconst originalIndents = originalLinesRange.mapToLineArray(line => indentOfLine(textModel.getLineContent(line)));\n\tconst modifiedIndents = modifiedLines.filter(line => line !== '').map(line => indentOfLine(line));\n\tconst prefixTrim = Math.min(...replacementStart, ...originalIndents, ...modifiedIndents);\n\n\tlet prefixLeftOffset;\n\tconst startLineIndent = textModel.getLineIndentColumn(originalLinesRange.startLineNumber);\n\tif (startLineIndent >= prefixTrim + 1) {\n\t\t// We can use the editor to get the offset\n\t\t// TODO go through other usages of getOffsetForColumn and come up with a robust reactive solution to read it\n\t\tobservableCodeEditor(editor).scrollTop.read(reader); // getOffsetForColumn requires the line number to be visible. This might change on scroll top.\n\t\tprefixLeftOffset = editor.getOffsetForColumn(originalLinesRange.startLineNumber, prefixTrim + 1);\n\t} else if (modifiedLines.length > 0) {\n\t\t// Content is not in the editor, we can use the content width to calculate the offset\n\t\tprefixLeftOffset = getContentRenderWidth(modifiedLines[0].slice(0, prefixTrim), editor, textModel);\n\t} else {\n\t\t// unable to approximate the offset\n\t\treturn { prefixTrim: 0, prefixLeftOffset: 0 };\n\t}\n\n\treturn { prefixTrim, prefixLeftOffset };\n}\n\nexport function getContentRenderWidth(content: string, editor: ICodeEditor, textModel: ITextModel) {\n\tconst w = editor.getOption(EditorOption.fontInfo).typicalHalfwidthCharacterWidth;\n\tconst tabSize = textModel.getOptions().tabSize * w;\n\n\tconst numTabs = content.split('\\t').length - 1;\n\tconst numNoneTabs = content.length - numTabs;\n\treturn numNoneTabs * w + numTabs * tabSize;\n}\n\nexport function getEditorValidOverlayRect(editor: ObservableCodeEditor): IObservable<Rect> {\n\tconst contentLeft = editor.layoutInfoContentLeft;\n\n\tconst width = derived({ name: 'editor.validOverlay.width' }, r => {\n\t\tconst hasMinimapOnTheRight = editor.layoutInfoMinimap.read(r).minimapLeft !== 0;\n\t\tconst editorWidth = editor.layoutInfoWidth.read(r) - contentLeft.read(r);\n\n\t\tif (hasMinimapOnTheRight) {\n\t\t\tconst minimapAndScrollbarWidth = editor.layoutInfoMinimap.read(r).minimapWidth + editor.layoutInfoVerticalScrollbarWidth.read(r);\n\t\t\treturn editorWidth - minimapAndScrollbarWidth;\n\t\t}\n\n\t\treturn editorWidth;\n\t});\n\n\tconst height = derived({ name: 'editor.validOverlay.height' }, r => editor.layoutInfoHeight.read(r) + editor.contentHeight.read(r));\n\n\treturn derived({ name: 'editor.validOverlay' }, r => Rect.fromLeftTopWidthHeight(contentLeft.read(r), 0, width.read(r), height.read(r)));\n}\nexport function applyEditToModifiedRangeMappings(rangeMapping: RangeMapping[], edit: TextEdit): RangeMapping[] {\n\tconst updatedMappings: RangeMapping[] = [];\n\tfor (const m of rangeMapping) {\n\t\tconst updatedRange = edit.mapRange(m.modifiedRange);\n\t\tupdatedMappings.push(new RangeMapping(m.originalRange, updatedRange));\n\t}\n\treturn updatedMappings;\n}\n\n\nexport function classNames(...classes: (string | false | undefined | null)[]) {\n\treturn classes.filter(c => typeof c === 'string').join(' ');\n}\n\nfunction offsetRangeToRange(columnOffsetRange: OffsetRange, startPos: Position): Range {\n\treturn new Range(\n\t\tstartPos.lineNumber,\n\t\tstartPos.column + columnOffsetRange.start,\n\t\tstartPos.lineNumber,\n\t\tstartPos.column + columnOffsetRange.endExclusive,\n\t);\n}\n\n/**\n * Calculates the indentation size (in spaces) of a given line,\n * interpreting tabs as the specified tab size.\n */\nfunction getIndentationSize(line: string, tabSize: number): number {\n\tlet currentSize = 0;\n\tloop: for (let i = 0, len = line.length; i < len; i++) {\n\t\tswitch (line.charCodeAt(i)) {\n\t\t\tcase CharCode.Tab: currentSize += tabSize; break;\n\t\t\tcase CharCode.Space: currentSize++; break;\n\t\t\tdefault: break loop;\n\t\t}\n\t}\n\t// if currentSize % tabSize !== 0,\n\t// then there are spaces which are not part of the indentation\n\treturn currentSize - (currentSize % tabSize);\n}\n\n/**\n * Calculates the number of characters at the start of a line that correspond to a given indentation size,\n * taking into account both tabs and spaces.\n */\nfunction indentSizeToIndentLength(line: string, indentSize: number, tabSize: number): number {\n\tlet remainingSize = indentSize - (indentSize % tabSize);\n\tlet i = 0;\n\tfor (; i < line.length; i++) {\n\t\tif (remainingSize === 0) {\n\t\t\tbreak;\n\t\t}\n\t\tswitch (line.charCodeAt(i)) {\n\t\t\tcase CharCode.Tab: remainingSize -= tabSize; break;\n\t\t\tcase CharCode.Space: remainingSize--; break;\n\t\t\tdefault: throw new BugIndicatingError('Unexpected character found while calculating indent length');\n\t\t}\n\t}\n\treturn i;\n}\n\nexport function createReindentEdit(text: string, range: LineRange, tabSize: number): TextEdit {\n\tconst newLines = splitLines(text);\n\tconst edits: TextReplacement[] = [];\n\tconst minIndentSize = findFirstMin(range.mapToLineArray(l => getIndentationSize(newLines[l - 1], tabSize)), numberComparator)!;\n\trange.forEach(lineNumber => {\n\t\tconst indentLength = indentSizeToIndentLength(newLines[lineNumber - 1], minIndentSize, tabSize);\n\t\tedits.push(new TextReplacement(offsetRangeToRange(new OffsetRange(0, indentLength), new Position(lineNumber, 1)), ''));\n\t});\n\treturn new TextEdit(edits);\n}\n\nexport class PathBuilder {\n\tprivate _data: string = '';\n\n\tpublic moveTo(point: Point): this {\n\t\tthis._data += `M ${point.x} ${point.y} `;\n\t\treturn this;\n\t}\n\n\tpublic lineTo(point: Point): this {\n\t\tthis._data += `L ${point.x} ${point.y} `;\n\t\treturn this;\n\t}\n\n\tpublic build(): string {\n\t\treturn this._data;\n\t}\n}\n\ntype RemoveFalsy<T> = T extends false | undefined | null ? never : T;\ntype Falsy<T> = T extends false | undefined | null ? T : never;\n\nexport function mapOutFalsy<T>(obs: IObservable<T>): IObservable<IObservable<RemoveFalsy<T>> | Falsy<T>> {\n\tconst nonUndefinedObs = derivedObservableWithCache<T | undefined | null | false>(undefined, (reader, lastValue) => obs.read(reader) || lastValue);\n\n\treturn derivedOpts({\n\t\tdebugName: () => `${obs.debugName}.mapOutFalsy`\n\t}, reader => {\n\t\tnonUndefinedObs.read(reader);\n\t\tconst val = obs.read(reader);\n\t\tif (!val) {\n\t\t\treturn undefined as Falsy<T>;\n\t\t}\n\n\t\treturn nonUndefinedObs as IObservable<RemoveFalsy<T>>;\n\t});\n}\n\nexport function rectToProps(fn: (reader: IReader) => Rect | undefined, debugLocation: DebugLocation = DebugLocation.ofCaller()) {\n\treturn {\n\t\tleft: derived({ name: 'editor.validOverlay.left' }, reader => /** @description left */ fn(reader)?.left, debugLocation),\n\t\ttop: derived({ name: 'editor.validOverlay.top' }, reader => /** @description top */ fn(reader)?.top, debugLocation),\n\t\twidth: derived({ name: 'editor.validOverlay.width' }, reader => {\n\t\t\t/** @description width */\n\t\t\tconst val = fn(reader);\n\t\t\tif (!val) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn val.width;\n\t\t}, debugLocation),\n\t\theight: derived({ name: 'editor.validOverlay.height' }, reader => {\n\t\t\t/** @description height */\n\t\t\tconst val = fn(reader);\n\t\t\tif (!val) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn val.height;\n\t\t}, debugLocation),\n\t};\n}\n\nexport type FirstFnArg<T> = T extends (arg: infer U) => any ? U : never;\n\n\nexport function observeEditorBoundingClientRect(editor: ICodeEditor, store: DisposableStore): IObservable<DOMRectReadOnly> {\n\tconst dom = editor.getContainerDomNode()!;\n\tconst initialDomRect = observableValue('domRect', dom.getBoundingClientRect());\n\tstore.add(editor.onDidLayoutChange(e => {\n\t\tinitialDomRect.set(dom.getBoundingClientRect(), undefined);\n\t}));\n\treturn initialDomRect;\n}\n"]}
@@ -8,6 +8,8 @@
8
8
  */
9
9
 
10
10
  .monaco-editor {
11
+ --inline-edit-border-radius: 3px;
12
+
11
13
  .inline-edits-view-indicator {
12
14
  display: flex;
13
15
 
@@ -17,7 +19,7 @@
17
19
  color: var(--vscode-inlineEdit-gutterIndicator-primaryForeground);
18
20
  background-color: var(--vscode-inlineEdit-gutterIndicator-background);
19
21
  border: 1px solid var(--vscode-inlineEdit-gutterIndicator-primaryBorder);
20
- border-radius: 3px;
22
+ border-radius: var(--inline-edit-border-radius);
21
23
 
22
24
  align-items: center;
23
25
  padding: 2px;
@@ -132,13 +134,13 @@
132
134
  border-bottom: 1px solid var(--vscode-inlineEdit-modifiedBorder); /* TODO: Do not set border inline but create overlaywidget (like deletion view) */
133
135
  }
134
136
  .inlineCompletions-char-insert.single-line-inline.start {
135
- border-top-left-radius: 4px;
136
- border-bottom-left-radius: 4px;
137
+ border-top-left-radius: var(--inline-edit-border-radius);
138
+ border-bottom-left-radius: var(--inline-edit-border-radius);
137
139
  border-left: 1px solid var(--vscode-inlineEdit-modifiedBorder); /* TODO: Do not set border inline but create overlaywidget (like deletion view) */
138
140
  }
139
141
  .inlineCompletions-char-insert.single-line-inline.end {
140
- border-top-right-radius: 4px;
141
- border-bottom-right-radius: 4px;
142
+ border-top-right-radius: var(--inline-edit-border-radius);
143
+ border-bottom-right-radius: var(--inline-edit-border-radius);
142
144
  border-right: 1px solid var(--vscode-inlineEdit-modifiedBorder); /* TODO: Do not set border inline but create overlaywidget (like deletion view) */
143
145
  }
144
146
 
@@ -188,6 +190,17 @@
188
190
  .inlineCompletions-original-lines {
189
191
  background: var(--vscode-editor-background);
190
192
  }
193
+
194
+ .inline-edit-jump-to-widget {
195
+
196
+
197
+ .monaco-keybinding {
198
+ .monaco-keybinding-key {
199
+ font-size: 11px;
200
+ padding: 1px 2px 2px 2px;
201
+ }
202
+ }
203
+ }
191
204
  }
192
205
 
193
206
  .monaco-menu-option {
@@ -218,7 +231,7 @@
218
231
  }
219
232
  }
220
233
 
221
- .go-to-label::before {
234
+ .inline-edits-long-distance-hint-widget .go-to-label::before {
222
235
  content: '';
223
236
  position: absolute;
224
237
  left: -12px;
@@ -227,3 +240,23 @@
227
240
  height: 100%;
228
241
  background: linear-gradient(to left, var(--vscode-editorWidget-background) 0, transparent 12px);
229
242
  }
243
+
244
+ .hc-black .inline-edits-long-distance-hint-widget .go-to-label::before,
245
+ .hc-light .inline-edits-long-distance-hint-widget .go-to-label::before {
246
+ /* Remove gradient in high contrast mode for clearer separation */
247
+ background: var(--vscode-editorWidget-background);
248
+ }
249
+
250
+ .inline-edit-alternative-action-label .codicon {
251
+ font-size: 12px !important;
252
+ padding-right: 4px;
253
+ }
254
+
255
+ .inline-edit-alternative-action-label .monaco-keybinding-key {
256
+ padding: 2px 3px;
257
+ }
258
+
259
+ .inline-edit-alternative-action-label .inline-edit-alternative-action-label-separator {
260
+ width: 4px;
261
+ }
262
+
@@ -37,7 +37,7 @@ let InlineSuggestionsView = class InlineSuggestionsView extends Disposable {
37
37
  const model = this._model.read(reader);
38
38
  return model?.ghostTexts.read(reader) ?? [];
39
39
  });
40
- this._inlineEdit = derived(this, reader => this._model.read(reader)?.inlineEditState.read(reader)?.inlineEdit);
40
+ this._inlineEdit = derived(this, reader => this._model.read(reader)?.inlineEditState.read(reader)?.inlineSuggestion);
41
41
  this._everHadInlineEdit = derivedObservableWithCache(this, (reader, last) => last || !!this._inlineEdit.read(reader)
42
42
  || !!this._model.read(reader)?.inlineCompletionState.read(reader)?.inlineSuggestion?.showInlineEditMenu);
43
43
  // To break a cyclic dependency
@@ -50,7 +50,7 @@ let InlineSuggestionsView = class InlineSuggestionsView extends Disposable {
50
50
  if (!this._everHadInlineEdit.read(reader)) {
51
51
  return undefined;
52
52
  }
53
- return this._instantiationService.createInstance(InlineEditsViewAndDiffProducer, this._editor, this._inlineEdit, this._model, this._showInlineEditCollapsed);
53
+ return this._instantiationService.createInstance(InlineEditsViewAndDiffProducer, this._editor, this._model, this._showInlineEditCollapsed);
54
54
  });
55
55
  this._gutterIndicatorState = derived(reader => {
56
56
  const model = this._model.read(reader);
@@ -118,7 +118,7 @@ let InlineSuggestionsView = class InlineSuggestionsView extends Disposable {
118
118
  if (!s) {
119
119
  return undefined;
120
120
  }
121
- return new InlineEditsGutterIndicatorData(InlineSuggestionGutterMenuData.fromInlineSuggestion(s.inlineSuggestion), s.displayRange, SimpleInlineSuggestModel.fromInlineCompletionModel(s.model));
121
+ return new InlineEditsGutterIndicatorData(InlineSuggestionGutterMenuData.fromInlineSuggestion(s.inlineSuggestion), s.displayRange, SimpleInlineSuggestModel.fromInlineCompletionModel(s.model), s.inlineSuggestion.action?.kind === 'edit' ? s.inlineSuggestion.action.alternativeAction : undefined);
122
122
  }), this._gutterIndicatorState.map((s, reader) => s?.tabAction.read(reader) ?? InlineEditTabAction.Inactive), this._gutterIndicatorState.map((s, reader) => s?.gutterIndicatorOffset.read(reader) ?? 0), this._inlineEditWidget.map((w, reader) => w?.view.inlineEditsIsHovered.read(reader) ?? false), this._focusIsInMenu));
123
123
  this._indicatorIsHoverVisible.set(this._indicator.isHoverVisible, undefined);
124
124
  derived(reader => {
@@ -134,11 +134,16 @@ let InlineSuggestionsView = class InlineSuggestionsView extends Disposable {
134
134
  const model = this._model.read(reader);
135
135
  const inlineCompletion = model?.inlineCompletionState.read(reader)?.inlineSuggestion;
136
136
  if (!model || !inlineCompletion) {
137
- return undefined;
137
+ // editor.suggest.preview: true causes situations where we have ghost text, but no suggest preview.
138
+ return {
139
+ ghostText: ghostText.read(reader),
140
+ handleInlineCompletionShown: () => { },
141
+ warning: undefined,
142
+ };
138
143
  }
139
144
  return {
140
145
  ghostText: ghostText.read(reader),
141
- handleInlineCompletionShown: (viewData) => model.handleInlineSuggestionShown(inlineCompletion, InlineCompletionViewKind.GhostText, viewData),
146
+ handleInlineCompletionShown: (viewData) => model.handleInlineSuggestionShown(inlineCompletion, InlineCompletionViewKind.GhostText, viewData, Date.now()),
142
147
  warning: GhostTextWidgetWarning.from(model?.warning.read(reader)),
143
148
  };
144
149
  }), {