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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (410) hide show
  1. package/esm/nls.keys.json +1 -1
  2. package/esm/nls.messages.cs.js +2 -2
  3. package/esm/nls.messages.de.js +2 -2
  4. package/esm/nls.messages.es.js +2 -2
  5. package/esm/nls.messages.fr.js +2 -2
  6. package/esm/nls.messages.it.js +2 -2
  7. package/esm/nls.messages.ja.js +2 -2
  8. package/esm/nls.messages.js +1 -1
  9. package/esm/nls.messages.json +1 -1
  10. package/esm/nls.messages.ko.js +2 -2
  11. package/esm/nls.messages.pl.js +2 -2
  12. package/esm/nls.messages.pt-br.js +2 -2
  13. package/esm/nls.messages.ru.js +2 -2
  14. package/esm/nls.messages.tr.js +2 -2
  15. package/esm/nls.messages.zh-cn.js +2 -2
  16. package/esm/nls.messages.zh-tw.js +2 -2
  17. package/esm/nls.metadata.json +34 -6
  18. package/esm/vs/base/browser/dom.js +1 -4
  19. package/esm/vs/base/browser/dom.js.map +1 -1
  20. package/esm/vs/base/browser/markdownRenderer.js +25 -11
  21. package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
  22. package/esm/vs/base/browser/ui/actionbar/actionViewItems.js.map +1 -1
  23. package/esm/vs/base/browser/ui/button/button.js +15 -8
  24. package/esm/vs/base/browser/ui/button/button.js.map +1 -1
  25. package/esm/vs/base/browser/ui/codicons/codicon/codicon-modifiers.css +3 -8
  26. package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  27. package/esm/vs/base/browser/ui/findinput/findInput.js +6 -1
  28. package/esm/vs/base/browser/ui/findinput/findInput.js.map +1 -1
  29. package/esm/vs/base/browser/ui/inputbox/inputBox.js +17 -1
  30. package/esm/vs/base/browser/ui/inputbox/inputBox.js.map +1 -1
  31. package/esm/vs/base/browser/ui/list/list.css +1 -0
  32. package/esm/vs/base/browser/ui/toggle/toggle.js +78 -6
  33. package/esm/vs/base/browser/ui/toggle/toggle.js.map +1 -1
  34. package/esm/vs/base/browser/ui/toolbar/toolbar.js +3 -0
  35. package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
  36. package/esm/vs/base/common/codiconsLibrary.js +11 -2
  37. package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
  38. package/esm/vs/base/common/defaultAccount.js +6 -0
  39. package/esm/vs/base/common/defaultAccount.js.map +1 -0
  40. package/esm/vs/base/common/equals.js +73 -24
  41. package/esm/vs/base/common/equals.js.map +1 -1
  42. package/esm/vs/base/common/event.js +14 -4
  43. package/esm/vs/base/common/event.js.map +1 -1
  44. package/esm/vs/base/common/iterator.js.map +1 -1
  45. package/esm/vs/base/common/keybindings.js +0 -8
  46. package/esm/vs/base/common/keybindings.js.map +1 -1
  47. package/esm/vs/base/common/lifecycle.js +2 -2
  48. package/esm/vs/base/common/lifecycle.js.map +1 -1
  49. package/esm/vs/base/common/marshallingIds.js.map +1 -1
  50. package/esm/vs/base/common/observableInternal/index.js +1 -1
  51. package/esm/vs/base/common/observableInternal/index.js.map +1 -1
  52. package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js +1 -1
  53. package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js.map +1 -1
  54. package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js +16 -0
  55. package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js.map +1 -1
  56. package/esm/vs/base/common/observableInternal/utils/utils.js +11 -0
  57. package/esm/vs/base/common/observableInternal/utils/utils.js.map +1 -1
  58. package/esm/vs/base/common/product.js.map +1 -1
  59. package/esm/vs/base/common/strings.js +3 -1
  60. package/esm/vs/base/common/strings.js.map +1 -1
  61. package/esm/vs/editor/browser/controller/dragScrolling.js +2 -1
  62. package/esm/vs/editor/browser/controller/dragScrolling.js.map +1 -1
  63. package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js +73 -2
  64. package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js.map +1 -1
  65. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +7 -51
  66. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
  67. package/esm/vs/editor/browser/controller/editContext/screenReaderUtils.js.map +1 -1
  68. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +7 -20
  69. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
  70. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js +14 -44
  71. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js.map +1 -1
  72. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextRegistry.js +19 -0
  73. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextRegistry.js.map +1 -0
  74. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.js +14 -1
  75. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.js.map +1 -1
  76. package/esm/vs/editor/browser/controller/mouseHandler.js +5 -2
  77. package/esm/vs/editor/browser/controller/mouseHandler.js.map +1 -1
  78. package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
  79. package/esm/vs/editor/browser/observableCodeEditor.js +32 -15
  80. package/esm/vs/editor/browser/observableCodeEditor.js.map +1 -1
  81. package/esm/vs/editor/browser/services/editorWorkerService.js +6 -2
  82. package/esm/vs/editor/browser/services/editorWorkerService.js.map +1 -1
  83. package/esm/vs/editor/browser/view.js +11 -2
  84. package/esm/vs/editor/browser/view.js.map +1 -1
  85. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +5 -2
  86. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
  87. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +10 -0
  88. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
  89. package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js.map +1 -1
  90. package/esm/vs/editor/browser/widget/multiDiffEditor/style.css +48 -0
  91. package/esm/vs/editor/common/config/editorConfigurationSchema.js +49 -47
  92. package/esm/vs/editor/common/config/editorConfigurationSchema.js.map +1 -1
  93. package/esm/vs/editor/common/config/editorOptions.js +410 -410
  94. package/esm/vs/editor/common/config/fontInfo.js +1 -1
  95. package/esm/vs/editor/common/config/fontInfo.js.map +1 -1
  96. package/esm/vs/editor/common/core/editorColorRegistry.js +69 -69
  97. package/esm/vs/editor/common/core/edits/edit.js +19 -0
  98. package/esm/vs/editor/common/core/edits/edit.js.map +1 -1
  99. package/esm/vs/editor/common/core/edits/stringEdit.js +13 -0
  100. package/esm/vs/editor/common/core/edits/stringEdit.js.map +1 -1
  101. package/esm/vs/editor/common/core/edits/textEdit.js +0 -3
  102. package/esm/vs/editor/common/core/edits/textEdit.js.map +1 -1
  103. package/esm/vs/editor/common/core/text/positionToOffsetImpl.js +24 -10
  104. package/esm/vs/editor/common/core/text/positionToOffsetImpl.js.map +1 -1
  105. package/esm/vs/editor/common/cursor/cursorMoveCommands.js +4 -4
  106. package/esm/vs/editor/common/cursor/cursorMoveCommands.js.map +1 -1
  107. package/esm/vs/editor/common/cursor/cursorWordOperations.js +6 -3
  108. package/esm/vs/editor/common/cursor/cursorWordOperations.js.map +1 -1
  109. package/esm/vs/editor/common/editorContextKeys.js +47 -47
  110. package/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js +2 -2
  111. package/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js.map +1 -1
  112. package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
  113. package/esm/vs/editor/common/languages/nullTokenize.js +1 -1
  114. package/esm/vs/editor/common/languages/nullTokenize.js.map +1 -1
  115. package/esm/vs/editor/common/languages/supports/tokenization.js +3 -0
  116. package/esm/vs/editor/common/languages/supports/tokenization.js.map +1 -1
  117. package/esm/vs/editor/common/languages.js +58 -57
  118. package/esm/vs/editor/common/languages.js.map +1 -1
  119. package/esm/vs/editor/common/model/decorationProvider.js +21 -1
  120. package/esm/vs/editor/common/model/decorationProvider.js.map +1 -1
  121. package/esm/vs/editor/common/model/editStack.js +1 -1
  122. package/esm/vs/editor/common/model/textModel.js +49 -30
  123. package/esm/vs/editor/common/model/textModel.js.map +1 -1
  124. package/esm/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.js +6 -3
  125. package/esm/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.js.map +1 -1
  126. package/esm/vs/editor/common/model/tokens/annotations.js +177 -0
  127. package/esm/vs/editor/common/model/tokens/annotations.js.map +1 -0
  128. package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js +131 -0
  129. package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js.map +1 -0
  130. package/esm/vs/editor/common/model/tokens/tokenizationTextModelPart.js +9 -0
  131. package/esm/vs/editor/common/model/tokens/tokenizationTextModelPart.js.map +1 -1
  132. package/esm/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.js +9 -0
  133. package/esm/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.js.map +1 -1
  134. package/esm/vs/editor/common/standaloneStrings.js +11 -11
  135. package/esm/vs/editor/common/textModelEditSource.js +2 -0
  136. package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
  137. package/esm/vs/editor/common/textModelEvents.js.map +1 -1
  138. package/esm/vs/editor/common/viewLayout/lineDecorations.js.map +1 -1
  139. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +3 -3
  140. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js.map +1 -1
  141. package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
  142. package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
  143. package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
  144. package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
  145. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +71 -53
  146. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
  147. package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
  148. package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
  149. package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
  150. package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
  151. package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
  152. package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
  153. package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
  154. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
  155. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
  156. package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +1 -1
  157. package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
  158. package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
  159. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +10 -10
  160. package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
  161. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
  162. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +23 -10
  163. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
  164. package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
  165. package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
  166. package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
  167. package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
  168. package/esm/vs/editor/contrib/find/browser/findController.js +16 -16
  169. package/esm/vs/editor/contrib/find/browser/findWidget.js +26 -26
  170. package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +1 -1
  171. package/esm/vs/editor/contrib/folding/browser/folding.js +20 -20
  172. package/esm/vs/editor/contrib/folding/browser/folding.js.map +1 -1
  173. package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
  174. package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
  175. package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
  176. package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
  177. package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
  178. package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
  179. package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
  180. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
  181. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
  182. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
  183. package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
  184. package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
  185. package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
  186. package/esm/vs/editor/contrib/hover/browser/hover.css +1 -1
  187. package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
  188. package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
  189. package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
  190. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +10 -10
  191. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
  192. package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
  193. package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
  194. package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
  195. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +1 -0
  196. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js.map +1 -1
  197. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
  198. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.js +1 -0
  199. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.js.map +1 -1
  200. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +50 -21
  201. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js.map +1 -1
  202. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -12
  203. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js.map +1 -1
  204. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +7 -1
  205. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js.map +1 -1
  206. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
  207. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
  208. package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js +2 -1
  209. package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js.map +1 -1
  210. package/esm/vs/editor/contrib/inlineCompletions/browser/model/InlineSuggestAlternativeAction.js +8 -0
  211. package/esm/vs/editor/contrib/inlineCompletions/browser/model/InlineSuggestAlternativeAction.js.map +1 -0
  212. package/esm/vs/editor/contrib/inlineCompletions/browser/model/editKind.js +198 -0
  213. package/esm/vs/editor/contrib/inlineCompletions/browser/model/editKind.js.map +1 -0
  214. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionIsVisible.js +40 -0
  215. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionIsVisible.js.map +1 -0
  216. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +128 -70
  217. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
  218. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +59 -11
  219. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
  220. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +152 -95
  221. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js.map +1 -1
  222. package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +113 -54
  223. package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js.map +1 -1
  224. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +317 -75
  225. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js.map +1 -1
  226. package/esm/vs/editor/contrib/inlineCompletions/browser/telemetry.js.map +1 -1
  227. package/esm/vs/editor/contrib/inlineCompletions/browser/utils.js +20 -0
  228. package/esm/vs/editor/contrib/inlineCompletions/browser/utils.js.map +1 -1
  229. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +59 -42
  230. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js.map +1 -1
  231. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +29 -8
  232. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js.map +1 -1
  233. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +78 -46
  234. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
  235. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js +9 -4
  236. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js.map +1 -1
  237. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +11 -4
  238. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js.map +1 -1
  239. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +81 -41
  240. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
  241. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js +48 -0
  242. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js.map +1 -1
  243. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +18 -15
  244. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js.map +1 -1
  245. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.js +3 -4
  246. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.js.map +1 -1
  247. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js +6 -7
  248. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js.map +1 -1
  249. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js +4 -5
  250. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js.map +1 -1
  251. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js +4 -3
  252. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js.map +1 -1
  253. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js +8 -8
  254. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js.map +1 -1
  255. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js +9 -7
  256. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js.map +1 -1
  257. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +203 -41
  258. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js.map +1 -1
  259. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/jumpToView.js +189 -0
  260. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/jumpToView.js.map +1 -0
  261. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js +85 -102
  262. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js.map +1 -1
  263. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js +75 -32
  264. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js.map +1 -1
  265. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistnaceWidgetPlacement.js +121 -0
  266. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistnaceWidgetPlacement.js.map +1 -0
  267. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js +2 -1
  268. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js.map +1 -1
  269. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +22 -20
  270. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js.map +1 -1
  271. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js +15 -5
  272. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js.map +1 -1
  273. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/view.css +39 -6
  274. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js +10 -5
  275. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js.map +1 -1
  276. package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
  277. package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
  278. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +32 -32
  279. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js.map +1 -1
  280. package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
  281. package/esm/vs/editor/contrib/links/browser/links.js +10 -10
  282. package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
  283. package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
  284. package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
  285. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
  286. package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
  287. package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
  288. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +25 -27
  289. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js.map +1 -1
  290. package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
  291. package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
  292. package/esm/vs/editor/contrib/rename/browser/rename.js +19 -15
  293. package/esm/vs/editor/contrib/rename/browser/rename.js.map +1 -1
  294. package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
  295. package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js +3 -2
  296. package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js.map +1 -1
  297. package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
  298. package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
  299. package/esm/vs/editor/contrib/snippet/browser/snippetParser.js +33 -0
  300. package/esm/vs/editor/contrib/snippet/browser/snippetParser.js.map +1 -1
  301. package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
  302. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  303. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +12 -4
  304. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js.map +1 -1
  305. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +1 -0
  306. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js.map +1 -1
  307. package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -8
  308. package/esm/vs/editor/contrib/suggest/browser/suggest.js.map +1 -1
  309. package/esm/vs/editor/contrib/suggest/browser/suggestController.js +39 -28
  310. package/esm/vs/editor/contrib/suggest/browser/suggestController.js.map +1 -1
  311. package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +1 -0
  312. package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js.map +1 -1
  313. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +22 -18
  314. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js.map +1 -1
  315. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +28 -6
  316. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js.map +1 -1
  317. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
  318. package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
  319. package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
  320. package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  321. package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  322. package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  323. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
  324. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
  325. package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  326. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
  327. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +19 -2
  328. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js.map +1 -1
  329. package/esm/vs/editor/editor.api.d.ts +34 -3
  330. package/esm/vs/editor/standalone/browser/standaloneLanguages.js +2 -2
  331. package/esm/vs/editor/standalone/browser/standaloneLanguages.js.map +1 -1
  332. package/esm/vs/editor/standalone/browser/standaloneServices.js +11 -1
  333. package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
  334. package/esm/vs/editor/standalone/common/monarch/monarchLexer.js +1 -1
  335. package/esm/vs/editor/standalone/common/monarch/monarchLexer.js.map +1 -1
  336. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
  337. package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
  338. package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
  339. package/esm/vs/platform/actionWidget/browser/actionWidget.css +11 -8
  340. package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
  341. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
  342. package/esm/vs/platform/actions/browser/toolbar.js +2 -2
  343. package/esm/vs/platform/actions/common/actions.js +11 -5
  344. package/esm/vs/platform/actions/common/actions.js.map +1 -1
  345. package/esm/vs/platform/actions/common/menuService.js +2 -2
  346. package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
  347. package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
  348. package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
  349. package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
  350. package/esm/vs/platform/contextkey/common/scanner.js +5 -5
  351. package/esm/vs/platform/{product/common/productService.js → defaultAccount/common/defaultAccount.js} +2 -2
  352. package/esm/vs/platform/defaultAccount/common/defaultAccount.js.map +1 -0
  353. package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  354. package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
  355. package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
  356. package/esm/vs/platform/instantiation/common/instantiation.js.map +1 -1
  357. package/esm/vs/platform/instantiation/common/instantiationService.js +1 -8
  358. package/esm/vs/platform/instantiation/common/instantiationService.js.map +1 -1
  359. package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
  360. package/esm/vs/platform/list/browser/listService.js +27 -27
  361. package/esm/vs/platform/log/common/log.js +1 -1
  362. package/esm/vs/platform/log/common/log.js.map +1 -1
  363. package/esm/vs/platform/markers/common/markerService.js +6 -6
  364. package/esm/vs/platform/markers/common/markerService.js.map +1 -1
  365. package/esm/vs/platform/markers/common/markers.js +6 -6
  366. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
  367. package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
  368. package/esm/vs/platform/quickinput/browser/media/quickInput.css +45 -7
  369. package/esm/vs/platform/quickinput/browser/quickInput.js +51 -15
  370. package/esm/vs/platform/quickinput/browser/quickInput.js.map +1 -1
  371. package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
  372. package/esm/vs/platform/quickinput/browser/quickInputBox.js +13 -1
  373. package/esm/vs/platform/quickinput/browser/quickInputBox.js.map +1 -1
  374. package/esm/vs/platform/quickinput/browser/quickInputController.js +22 -12
  375. package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
  376. package/esm/vs/platform/quickinput/browser/quickInputList.js +17 -12
  377. package/esm/vs/platform/quickinput/browser/quickInputList.js.map +1 -1
  378. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +36 -8
  379. package/esm/vs/platform/quickinput/browser/quickInputUtils.js.map +1 -1
  380. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
  381. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js +3 -3
  382. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js.map +1 -1
  383. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js +8 -4
  384. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js.map +1 -1
  385. package/esm/vs/platform/quickinput/common/quickInput.js.map +1 -1
  386. package/esm/vs/platform/theme/common/colorUtils.js +2 -2
  387. package/esm/vs/platform/theme/common/colors/baseColors.js +18 -17
  388. package/esm/vs/platform/theme/common/colors/baseColors.js.map +1 -1
  389. package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
  390. package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
  391. package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
  392. package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
  393. package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
  394. package/esm/vs/platform/theme/common/colors/minimapColors.js +13 -13
  395. package/esm/vs/platform/theme/common/colors/minimapColors.js.map +1 -1
  396. package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
  397. package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
  398. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  399. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  400. package/esm/vs/platform/undoRedo/common/undoRedoService.js +21 -21
  401. package/esm/vs/platform/undoRedo/common/undoRedoService.js.map +1 -1
  402. package/esm/vs/platform/window/common/window.js +1 -1
  403. package/esm/vs/platform/window/common/window.js.map +1 -1
  404. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  405. package/monaco.d.ts +34 -3
  406. package/package.json +2 -2
  407. package/version.txt +1 -1
  408. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js +0 -16
  409. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js.map +0 -1
  410. package/esm/vs/platform/product/common/productService.js.map +0 -1
@@ -156,7 +156,7 @@ export const DEFAULT_MAC_FONT_FAMILY = 'Menlo, Monaco, \'Courier New\', monospac
156
156
  /**
157
157
  * @internal
158
158
  */
159
- export const DEFAULT_LINUX_FONT_FAMILY = '\'Droid Sans Mono\', \'monospace\', monospace';
159
+ export const DEFAULT_LINUX_FONT_FAMILY = '\'Droid Sans Mono\', monospace';
160
160
  /**
161
161
  * @internal
162
162
  */
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/config/fontInfo.ts","vs/editor/common/config/fontInfo.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,QAAQ,MAAM,kCAAkC,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AAE1E;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AASrC,MAAM,OAAO,YAAY;IAGxB;;OA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AAQ;IACpB,QAAQ,EAAE,CACT,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAC9B;IACD,UAAU,EAAE,CAAC;IACb,aAAa,EAAE,CAAC;CAChB,CAAC","file":"fontInfo.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as platform from '../../../base/common/platform.js';\nimport { EditorOption, FindComputedEditorOptionValueById } from './editorOptions.js';\nimport { EditorZoom } from './editorZoom.js';\n\n/**\n * Determined from empirical observations.\n * @internal\n */\nexport const GOLDEN_LINE_HEIGHT_RATIO = platform.isMacintosh ? 1.5 : 1.35;\n\n/**\n * @internal\n */\nexport const MINIMUM_LINE_HEIGHT = 8;\n\n/**\n * @internal\n */\nexport interface IValidatedEditorOptions {\n\tget<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T>;\n}\n\nexport class BareFontInfo {\n\treadonly _bareFontInfoBrand: void = undefined;\n\n\t/**\n\t * @internal\n\t */\n\tpublic static _create(fontFamily: string, fontWeight: string, fontSize: number, fontFeatureSettings: string, fontVariationSettings: string, lineHeight: number, letterSpacing: number, pixelRatio: number, ignoreEditorZoom: boolean): BareFontInfo {\n\t\tif (lineHeight === 0) {\n\t\t\tlineHeight = GOLDEN_LINE_HEIGHT_RATIO * fontSize;\n\t\t} else if (lineHeight < MINIMUM_LINE_HEIGHT) {\n\t\t\t// Values too small to be line heights in pixels are in ems.\n\t\t\tlineHeight = lineHeight * fontSize;\n\t\t}\n\n\t\t// Enforce integer, minimum constraints\n\t\tlineHeight = Math.round(lineHeight);\n\t\tif (lineHeight < MINIMUM_LINE_HEIGHT) {\n\t\t\tlineHeight = MINIMUM_LINE_HEIGHT;\n\t\t}\n\n\t\tconst editorZoomLevelMultiplier = 1 + (ignoreEditorZoom ? 0 : EditorZoom.getZoomLevel() * 0.1);\n\t\tfontSize *= editorZoomLevelMultiplier;\n\t\tlineHeight *= editorZoomLevelMultiplier;\n\n\t\tif (fontVariationSettings === FONT_VARIATION_TRANSLATE) {\n\t\t\tif (fontWeight === 'normal' || fontWeight === 'bold') {\n\t\t\t\tfontVariationSettings = FONT_VARIATION_OFF;\n\t\t\t} else {\n\t\t\t\tconst fontWeightAsNumber = parseInt(fontWeight, 10);\n\t\t\t\tfontVariationSettings = `'wght' ${fontWeightAsNumber}`;\n\t\t\t\tfontWeight = 'normal';\n\t\t\t}\n\t\t}\n\n\t\treturn new BareFontInfo({\n\t\t\tpixelRatio: pixelRatio,\n\t\t\tfontFamily: fontFamily,\n\t\t\tfontWeight: fontWeight,\n\t\t\tfontSize: fontSize,\n\t\t\tfontFeatureSettings: fontFeatureSettings,\n\t\t\tfontVariationSettings,\n\t\t\tlineHeight: lineHeight,\n\t\t\tletterSpacing: letterSpacing\n\t\t});\n\t}\n\n\treadonly pixelRatio: number;\n\treadonly fontFamily: string;\n\treadonly fontWeight: string;\n\treadonly fontSize: number;\n\treadonly fontFeatureSettings: string;\n\treadonly fontVariationSettings: string;\n\treadonly lineHeight: number;\n\treadonly letterSpacing: number;\n\n\t/**\n\t * @internal\n\t */\n\tprotected constructor(opts: {\n\t\tpixelRatio: number;\n\t\tfontFamily: string;\n\t\tfontWeight: string;\n\t\tfontSize: number;\n\t\tfontFeatureSettings: string;\n\t\tfontVariationSettings: string;\n\t\tlineHeight: number;\n\t\tletterSpacing: number;\n\t}) {\n\t\tthis.pixelRatio = opts.pixelRatio;\n\t\tthis.fontFamily = String(opts.fontFamily);\n\t\tthis.fontWeight = String(opts.fontWeight);\n\t\tthis.fontSize = opts.fontSize;\n\t\tthis.fontFeatureSettings = opts.fontFeatureSettings;\n\t\tthis.fontVariationSettings = opts.fontVariationSettings;\n\t\tthis.lineHeight = opts.lineHeight | 0;\n\t\tthis.letterSpacing = opts.letterSpacing;\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic getId(): string {\n\t\treturn `${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`;\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic getMassagedFontFamily(): string {\n\t\tconst fallbackFontFamily = EDITOR_FONT_DEFAULTS.fontFamily;\n\t\tconst fontFamily = BareFontInfo._wrapInQuotes(this.fontFamily);\n\t\tif (fallbackFontFamily && this.fontFamily !== fallbackFontFamily) {\n\t\t\treturn `${fontFamily}, ${fallbackFontFamily}`;\n\t\t}\n\t\treturn fontFamily;\n\t}\n\n\tprivate static _wrapInQuotes(fontFamily: string): string {\n\t\tif (/[,\"']/.test(fontFamily)) {\n\t\t\t// Looks like the font family might be already escaped\n\t\t\treturn fontFamily;\n\t\t}\n\t\tif (/[+ ]/.test(fontFamily)) {\n\t\t\t// Wrap a font family using + or <space> with quotes\n\t\t\treturn `\"${fontFamily}\"`;\n\t\t}\n\t\treturn fontFamily;\n\t}\n}\n\n// change this whenever `FontInfo` members are changed\nexport const SERIALIZED_FONT_INFO_VERSION = 2;\n\nexport class FontInfo extends BareFontInfo {\n\treadonly _editorStylingBrand: void = undefined;\n\n\treadonly version: number = SERIALIZED_FONT_INFO_VERSION;\n\treadonly isTrusted: boolean;\n\treadonly isMonospace: boolean;\n\treadonly typicalHalfwidthCharacterWidth: number;\n\treadonly typicalFullwidthCharacterWidth: number;\n\treadonly canUseHalfwidthRightwardsArrow: boolean;\n\treadonly spaceWidth: number;\n\treadonly middotWidth: number;\n\treadonly wsmiddotWidth: number;\n\treadonly maxDigitWidth: number;\n\n\t/**\n\t * @internal\n\t */\n\tconstructor(opts: {\n\t\tpixelRatio: number;\n\t\tfontFamily: string;\n\t\tfontWeight: string;\n\t\tfontSize: number;\n\t\tfontFeatureSettings: string;\n\t\tfontVariationSettings: string;\n\t\tlineHeight: number;\n\t\tletterSpacing: number;\n\t\tisMonospace: boolean;\n\t\ttypicalHalfwidthCharacterWidth: number;\n\t\ttypicalFullwidthCharacterWidth: number;\n\t\tcanUseHalfwidthRightwardsArrow: boolean;\n\t\tspaceWidth: number;\n\t\tmiddotWidth: number;\n\t\twsmiddotWidth: number;\n\t\tmaxDigitWidth: number;\n\t}, isTrusted: boolean) {\n\t\tsuper(opts);\n\t\tthis.isTrusted = isTrusted;\n\t\tthis.isMonospace = opts.isMonospace;\n\t\tthis.typicalHalfwidthCharacterWidth = opts.typicalHalfwidthCharacterWidth;\n\t\tthis.typicalFullwidthCharacterWidth = opts.typicalFullwidthCharacterWidth;\n\t\tthis.canUseHalfwidthRightwardsArrow = opts.canUseHalfwidthRightwardsArrow;\n\t\tthis.spaceWidth = opts.spaceWidth;\n\t\tthis.middotWidth = opts.middotWidth;\n\t\tthis.wsmiddotWidth = opts.wsmiddotWidth;\n\t\tthis.maxDigitWidth = opts.maxDigitWidth;\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic equals(other: FontInfo): boolean {\n\t\treturn (\n\t\t\tthis.fontFamily === other.fontFamily\n\t\t\t&& this.fontWeight === other.fontWeight\n\t\t\t&& this.fontSize === other.fontSize\n\t\t\t&& this.fontFeatureSettings === other.fontFeatureSettings\n\t\t\t&& this.fontVariationSettings === other.fontVariationSettings\n\t\t\t&& this.lineHeight === other.lineHeight\n\t\t\t&& this.letterSpacing === other.letterSpacing\n\t\t\t&& this.typicalHalfwidthCharacterWidth === other.typicalHalfwidthCharacterWidth\n\t\t\t&& this.typicalFullwidthCharacterWidth === other.typicalFullwidthCharacterWidth\n\t\t\t&& this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow\n\t\t\t&& this.spaceWidth === other.spaceWidth\n\t\t\t&& this.middotWidth === other.middotWidth\n\t\t\t&& this.wsmiddotWidth === other.wsmiddotWidth\n\t\t\t&& this.maxDigitWidth === other.maxDigitWidth\n\t\t);\n\t}\n}\n/**\n * @internal\n */\nexport const FONT_VARIATION_OFF = 'normal';\n/**\n * @internal\n */\nexport const FONT_VARIATION_TRANSLATE = 'translate';\n\n/**\n * @internal\n */\nexport const DEFAULT_WINDOWS_FONT_FAMILY = 'Consolas, \\'Courier New\\', monospace';\n/**\n * @internal\n */\nexport const DEFAULT_MAC_FONT_FAMILY = 'Menlo, Monaco, \\'Courier New\\', monospace';\n/**\n * @internal\n */\nexport const DEFAULT_LINUX_FONT_FAMILY = '\\'Droid Sans Mono\\', \\'monospace\\', monospace';\n/**\n * @internal\n */\nexport const EDITOR_FONT_DEFAULTS = {\n\tfontFamily: (\n\t\tplatform.isMacintosh ? DEFAULT_MAC_FONT_FAMILY : (platform.isWindows ? DEFAULT_WINDOWS_FONT_FAMILY : DEFAULT_LINUX_FONT_FAMILY)\n\t),\n\tfontWeight: 'normal',\n\tfontSize: (\n\t\tplatform.isMacintosh ? 12 : 14\n\t),\n\tlineHeight: 0,\n\tletterSpacing: 0,\n};\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as platform from '../../../base/common/platform.js';\nimport { EditorOption, FindComputedEditorOptionValueById } from './editorOptions.js';\nimport { EditorZoom } from './editorZoom.js';\n\n/**\n * Determined from empirical observations.\n * @internal\n */\nexport const GOLDEN_LINE_HEIGHT_RATIO = platform.isMacintosh ? 1.5 : 1.35;\n\n/**\n * @internal\n */\nexport const MINIMUM_LINE_HEIGHT = 8;\n\n/**\n * @internal\n */\nexport interface IValidatedEditorOptions {\n\tget<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T>;\n}\n\nexport class BareFontInfo {\n\treadonly _bareFontInfoBrand: void = undefined;\n\n\t/**\n\t * @internal\n\t */\n\tpublic static _create(fontFamily: string, fontWeight: string, fontSize: number, fontFeatureSettings: string, fontVariationSettings: string, lineHeight: number, letterSpacing: number, pixelRatio: number, ignoreEditorZoom: boolean): BareFontInfo {\n\t\tif (lineHeight === 0) {\n\t\t\tlineHeight = GOLDEN_LINE_HEIGHT_RATIO * fontSize;\n\t\t} else if (lineHeight < MINIMUM_LINE_HEIGHT) {\n\t\t\t// Values too small to be line heights in pixels are in ems.\n\t\t\tlineHeight = lineHeight * fontSize;\n\t\t}\n\n\t\t// Enforce integer, minimum constraints\n\t\tlineHeight = Math.round(lineHeight);\n\t\tif (lineHeight < MINIMUM_LINE_HEIGHT) {\n\t\t\tlineHeight = MINIMUM_LINE_HEIGHT;\n\t\t}\n\n\t\tconst editorZoomLevelMultiplier = 1 + (ignoreEditorZoom ? 0 : EditorZoom.getZoomLevel() * 0.1);\n\t\tfontSize *= editorZoomLevelMultiplier;\n\t\tlineHeight *= editorZoomLevelMultiplier;\n\n\t\tif (fontVariationSettings === FONT_VARIATION_TRANSLATE) {\n\t\t\tif (fontWeight === 'normal' || fontWeight === 'bold') {\n\t\t\t\tfontVariationSettings = FONT_VARIATION_OFF;\n\t\t\t} else {\n\t\t\t\tconst fontWeightAsNumber = parseInt(fontWeight, 10);\n\t\t\t\tfontVariationSettings = `'wght' ${fontWeightAsNumber}`;\n\t\t\t\tfontWeight = 'normal';\n\t\t\t}\n\t\t}\n\n\t\treturn new BareFontInfo({\n\t\t\tpixelRatio: pixelRatio,\n\t\t\tfontFamily: fontFamily,\n\t\t\tfontWeight: fontWeight,\n\t\t\tfontSize: fontSize,\n\t\t\tfontFeatureSettings: fontFeatureSettings,\n\t\t\tfontVariationSettings,\n\t\t\tlineHeight: lineHeight,\n\t\t\tletterSpacing: letterSpacing\n\t\t});\n\t}\n\n\treadonly pixelRatio: number;\n\treadonly fontFamily: string;\n\treadonly fontWeight: string;\n\treadonly fontSize: number;\n\treadonly fontFeatureSettings: string;\n\treadonly fontVariationSettings: string;\n\treadonly lineHeight: number;\n\treadonly letterSpacing: number;\n\n\t/**\n\t * @internal\n\t */\n\tprotected constructor(opts: {\n\t\tpixelRatio: number;\n\t\tfontFamily: string;\n\t\tfontWeight: string;\n\t\tfontSize: number;\n\t\tfontFeatureSettings: string;\n\t\tfontVariationSettings: string;\n\t\tlineHeight: number;\n\t\tletterSpacing: number;\n\t}) {\n\t\tthis.pixelRatio = opts.pixelRatio;\n\t\tthis.fontFamily = String(opts.fontFamily);\n\t\tthis.fontWeight = String(opts.fontWeight);\n\t\tthis.fontSize = opts.fontSize;\n\t\tthis.fontFeatureSettings = opts.fontFeatureSettings;\n\t\tthis.fontVariationSettings = opts.fontVariationSettings;\n\t\tthis.lineHeight = opts.lineHeight | 0;\n\t\tthis.letterSpacing = opts.letterSpacing;\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic getId(): string {\n\t\treturn `${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`;\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic getMassagedFontFamily(): string {\n\t\tconst fallbackFontFamily = EDITOR_FONT_DEFAULTS.fontFamily;\n\t\tconst fontFamily = BareFontInfo._wrapInQuotes(this.fontFamily);\n\t\tif (fallbackFontFamily && this.fontFamily !== fallbackFontFamily) {\n\t\t\treturn `${fontFamily}, ${fallbackFontFamily}`;\n\t\t}\n\t\treturn fontFamily;\n\t}\n\n\tprivate static _wrapInQuotes(fontFamily: string): string {\n\t\tif (/[,\"']/.test(fontFamily)) {\n\t\t\t// Looks like the font family might be already escaped\n\t\t\treturn fontFamily;\n\t\t}\n\t\tif (/[+ ]/.test(fontFamily)) {\n\t\t\t// Wrap a font family using + or <space> with quotes\n\t\t\treturn `\"${fontFamily}\"`;\n\t\t}\n\t\treturn fontFamily;\n\t}\n}\n\n// change this whenever `FontInfo` members are changed\nexport const SERIALIZED_FONT_INFO_VERSION = 2;\n\nexport class FontInfo extends BareFontInfo {\n\treadonly _editorStylingBrand: void = undefined;\n\n\treadonly version: number = SERIALIZED_FONT_INFO_VERSION;\n\treadonly isTrusted: boolean;\n\treadonly isMonospace: boolean;\n\treadonly typicalHalfwidthCharacterWidth: number;\n\treadonly typicalFullwidthCharacterWidth: number;\n\treadonly canUseHalfwidthRightwardsArrow: boolean;\n\treadonly spaceWidth: number;\n\treadonly middotWidth: number;\n\treadonly wsmiddotWidth: number;\n\treadonly maxDigitWidth: number;\n\n\t/**\n\t * @internal\n\t */\n\tconstructor(opts: {\n\t\tpixelRatio: number;\n\t\tfontFamily: string;\n\t\tfontWeight: string;\n\t\tfontSize: number;\n\t\tfontFeatureSettings: string;\n\t\tfontVariationSettings: string;\n\t\tlineHeight: number;\n\t\tletterSpacing: number;\n\t\tisMonospace: boolean;\n\t\ttypicalHalfwidthCharacterWidth: number;\n\t\ttypicalFullwidthCharacterWidth: number;\n\t\tcanUseHalfwidthRightwardsArrow: boolean;\n\t\tspaceWidth: number;\n\t\tmiddotWidth: number;\n\t\twsmiddotWidth: number;\n\t\tmaxDigitWidth: number;\n\t}, isTrusted: boolean) {\n\t\tsuper(opts);\n\t\tthis.isTrusted = isTrusted;\n\t\tthis.isMonospace = opts.isMonospace;\n\t\tthis.typicalHalfwidthCharacterWidth = opts.typicalHalfwidthCharacterWidth;\n\t\tthis.typicalFullwidthCharacterWidth = opts.typicalFullwidthCharacterWidth;\n\t\tthis.canUseHalfwidthRightwardsArrow = opts.canUseHalfwidthRightwardsArrow;\n\t\tthis.spaceWidth = opts.spaceWidth;\n\t\tthis.middotWidth = opts.middotWidth;\n\t\tthis.wsmiddotWidth = opts.wsmiddotWidth;\n\t\tthis.maxDigitWidth = opts.maxDigitWidth;\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic equals(other: FontInfo): boolean {\n\t\treturn (\n\t\t\tthis.fontFamily === other.fontFamily\n\t\t\t&& this.fontWeight === other.fontWeight\n\t\t\t&& this.fontSize === other.fontSize\n\t\t\t&& this.fontFeatureSettings === other.fontFeatureSettings\n\t\t\t&& this.fontVariationSettings === other.fontVariationSettings\n\t\t\t&& this.lineHeight === other.lineHeight\n\t\t\t&& this.letterSpacing === other.letterSpacing\n\t\t\t&& this.typicalHalfwidthCharacterWidth === other.typicalHalfwidthCharacterWidth\n\t\t\t&& this.typicalFullwidthCharacterWidth === other.typicalFullwidthCharacterWidth\n\t\t\t&& this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow\n\t\t\t&& this.spaceWidth === other.spaceWidth\n\t\t\t&& this.middotWidth === other.middotWidth\n\t\t\t&& this.wsmiddotWidth === other.wsmiddotWidth\n\t\t\t&& this.maxDigitWidth === other.maxDigitWidth\n\t\t);\n\t}\n}\n/**\n * @internal\n */\nexport const FONT_VARIATION_OFF = 'normal';\n/**\n * @internal\n */\nexport const FONT_VARIATION_TRANSLATE = 'translate';\n\n/**\n * @internal\n */\nexport const DEFAULT_WINDOWS_FONT_FAMILY = 'Consolas, \\'Courier New\\', monospace';\n/**\n * @internal\n */\nexport const DEFAULT_MAC_FONT_FAMILY = 'Menlo, Monaco, \\'Courier New\\', monospace';\n/**\n * @internal\n */\nexport const DEFAULT_LINUX_FONT_FAMILY = '\\'Droid Sans Mono\\', \\'monospace\\', monospace';\n/**\n * @internal\n */\nexport const EDITOR_FONT_DEFAULTS = {\n\tfontFamily: (\n\t\tplatform.isMacintosh ? DEFAULT_MAC_FONT_FAMILY : (platform.isWindows ? DEFAULT_WINDOWS_FONT_FAMILY : DEFAULT_LINUX_FONT_FAMILY)\n\t),\n\tfontWeight: 'normal',\n\tfontSize: (\n\t\tplatform.isMacintosh ? 12 : 14\n\t),\n\tlineHeight: 0,\n\tletterSpacing: 0,\n};\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/config/fontInfo.ts","vs/editor/common/config/fontInfo.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,QAAQ,MAAM,kCAAkC,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;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MAAM,oBAAoB,GAAG;IACnC,UAAU,EAAE,CACX,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAC/H;IACD,UAAU,EAAE,QAAQ;IACpB,QAAQ,EAAE,CACT,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAC9B;IACD,UAAU,EAAE,CAAC;IACb,aAAa,EAAE,CAAC;CAChB,CAAC","file":"fontInfo.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as platform from '../../../base/common/platform.js';\nimport { EditorOption, FindComputedEditorOptionValueById } from './editorOptions.js';\nimport { EditorZoom } from './editorZoom.js';\n\n/**\n * Determined from empirical observations.\n * @internal\n */\nexport const GOLDEN_LINE_HEIGHT_RATIO = platform.isMacintosh ? 1.5 : 1.35;\n\n/**\n * @internal\n */\nexport const MINIMUM_LINE_HEIGHT = 8;\n\n/**\n * @internal\n */\nexport interface IValidatedEditorOptions {\n\tget<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T>;\n}\n\nexport class BareFontInfo {\n\treadonly _bareFontInfoBrand: void = undefined;\n\n\t/**\n\t * @internal\n\t */\n\tpublic static _create(fontFamily: string, fontWeight: string, fontSize: number, fontFeatureSettings: string, fontVariationSettings: string, lineHeight: number, letterSpacing: number, pixelRatio: number, ignoreEditorZoom: boolean): BareFontInfo {\n\t\tif (lineHeight === 0) {\n\t\t\tlineHeight = GOLDEN_LINE_HEIGHT_RATIO * fontSize;\n\t\t} else if (lineHeight < MINIMUM_LINE_HEIGHT) {\n\t\t\t// Values too small to be line heights in pixels are in ems.\n\t\t\tlineHeight = lineHeight * fontSize;\n\t\t}\n\n\t\t// Enforce integer, minimum constraints\n\t\tlineHeight = Math.round(lineHeight);\n\t\tif (lineHeight < MINIMUM_LINE_HEIGHT) {\n\t\t\tlineHeight = MINIMUM_LINE_HEIGHT;\n\t\t}\n\n\t\tconst editorZoomLevelMultiplier = 1 + (ignoreEditorZoom ? 0 : EditorZoom.getZoomLevel() * 0.1);\n\t\tfontSize *= editorZoomLevelMultiplier;\n\t\tlineHeight *= editorZoomLevelMultiplier;\n\n\t\tif (fontVariationSettings === FONT_VARIATION_TRANSLATE) {\n\t\t\tif (fontWeight === 'normal' || fontWeight === 'bold') {\n\t\t\t\tfontVariationSettings = FONT_VARIATION_OFF;\n\t\t\t} else {\n\t\t\t\tconst fontWeightAsNumber = parseInt(fontWeight, 10);\n\t\t\t\tfontVariationSettings = `'wght' ${fontWeightAsNumber}`;\n\t\t\t\tfontWeight = 'normal';\n\t\t\t}\n\t\t}\n\n\t\treturn new BareFontInfo({\n\t\t\tpixelRatio: pixelRatio,\n\t\t\tfontFamily: fontFamily,\n\t\t\tfontWeight: fontWeight,\n\t\t\tfontSize: fontSize,\n\t\t\tfontFeatureSettings: fontFeatureSettings,\n\t\t\tfontVariationSettings,\n\t\t\tlineHeight: lineHeight,\n\t\t\tletterSpacing: letterSpacing\n\t\t});\n\t}\n\n\treadonly pixelRatio: number;\n\treadonly fontFamily: string;\n\treadonly fontWeight: string;\n\treadonly fontSize: number;\n\treadonly fontFeatureSettings: string;\n\treadonly fontVariationSettings: string;\n\treadonly lineHeight: number;\n\treadonly letterSpacing: number;\n\n\t/**\n\t * @internal\n\t */\n\tprotected constructor(opts: {\n\t\tpixelRatio: number;\n\t\tfontFamily: string;\n\t\tfontWeight: string;\n\t\tfontSize: number;\n\t\tfontFeatureSettings: string;\n\t\tfontVariationSettings: string;\n\t\tlineHeight: number;\n\t\tletterSpacing: number;\n\t}) {\n\t\tthis.pixelRatio = opts.pixelRatio;\n\t\tthis.fontFamily = String(opts.fontFamily);\n\t\tthis.fontWeight = String(opts.fontWeight);\n\t\tthis.fontSize = opts.fontSize;\n\t\tthis.fontFeatureSettings = opts.fontFeatureSettings;\n\t\tthis.fontVariationSettings = opts.fontVariationSettings;\n\t\tthis.lineHeight = opts.lineHeight | 0;\n\t\tthis.letterSpacing = opts.letterSpacing;\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic getId(): string {\n\t\treturn `${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`;\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic getMassagedFontFamily(): string {\n\t\tconst fallbackFontFamily = EDITOR_FONT_DEFAULTS.fontFamily;\n\t\tconst fontFamily = BareFontInfo._wrapInQuotes(this.fontFamily);\n\t\tif (fallbackFontFamily && this.fontFamily !== fallbackFontFamily) {\n\t\t\treturn `${fontFamily}, ${fallbackFontFamily}`;\n\t\t}\n\t\treturn fontFamily;\n\t}\n\n\tprivate static _wrapInQuotes(fontFamily: string): string {\n\t\tif (/[,\"']/.test(fontFamily)) {\n\t\t\t// Looks like the font family might be already escaped\n\t\t\treturn fontFamily;\n\t\t}\n\t\tif (/[+ ]/.test(fontFamily)) {\n\t\t\t// Wrap a font family using + or <space> with quotes\n\t\t\treturn `\"${fontFamily}\"`;\n\t\t}\n\t\treturn fontFamily;\n\t}\n}\n\n// change this whenever `FontInfo` members are changed\nexport const SERIALIZED_FONT_INFO_VERSION = 2;\n\nexport class FontInfo extends BareFontInfo {\n\treadonly _editorStylingBrand: void = undefined;\n\n\treadonly version: number = SERIALIZED_FONT_INFO_VERSION;\n\treadonly isTrusted: boolean;\n\treadonly isMonospace: boolean;\n\treadonly typicalHalfwidthCharacterWidth: number;\n\treadonly typicalFullwidthCharacterWidth: number;\n\treadonly canUseHalfwidthRightwardsArrow: boolean;\n\treadonly spaceWidth: number;\n\treadonly middotWidth: number;\n\treadonly wsmiddotWidth: number;\n\treadonly maxDigitWidth: number;\n\n\t/**\n\t * @internal\n\t */\n\tconstructor(opts: {\n\t\tpixelRatio: number;\n\t\tfontFamily: string;\n\t\tfontWeight: string;\n\t\tfontSize: number;\n\t\tfontFeatureSettings: string;\n\t\tfontVariationSettings: string;\n\t\tlineHeight: number;\n\t\tletterSpacing: number;\n\t\tisMonospace: boolean;\n\t\ttypicalHalfwidthCharacterWidth: number;\n\t\ttypicalFullwidthCharacterWidth: number;\n\t\tcanUseHalfwidthRightwardsArrow: boolean;\n\t\tspaceWidth: number;\n\t\tmiddotWidth: number;\n\t\twsmiddotWidth: number;\n\t\tmaxDigitWidth: number;\n\t}, isTrusted: boolean) {\n\t\tsuper(opts);\n\t\tthis.isTrusted = isTrusted;\n\t\tthis.isMonospace = opts.isMonospace;\n\t\tthis.typicalHalfwidthCharacterWidth = opts.typicalHalfwidthCharacterWidth;\n\t\tthis.typicalFullwidthCharacterWidth = opts.typicalFullwidthCharacterWidth;\n\t\tthis.canUseHalfwidthRightwardsArrow = opts.canUseHalfwidthRightwardsArrow;\n\t\tthis.spaceWidth = opts.spaceWidth;\n\t\tthis.middotWidth = opts.middotWidth;\n\t\tthis.wsmiddotWidth = opts.wsmiddotWidth;\n\t\tthis.maxDigitWidth = opts.maxDigitWidth;\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic equals(other: FontInfo): boolean {\n\t\treturn (\n\t\t\tthis.fontFamily === other.fontFamily\n\t\t\t&& this.fontWeight === other.fontWeight\n\t\t\t&& this.fontSize === other.fontSize\n\t\t\t&& this.fontFeatureSettings === other.fontFeatureSettings\n\t\t\t&& this.fontVariationSettings === other.fontVariationSettings\n\t\t\t&& this.lineHeight === other.lineHeight\n\t\t\t&& this.letterSpacing === other.letterSpacing\n\t\t\t&& this.typicalHalfwidthCharacterWidth === other.typicalHalfwidthCharacterWidth\n\t\t\t&& this.typicalFullwidthCharacterWidth === other.typicalFullwidthCharacterWidth\n\t\t\t&& this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow\n\t\t\t&& this.spaceWidth === other.spaceWidth\n\t\t\t&& this.middotWidth === other.middotWidth\n\t\t\t&& this.wsmiddotWidth === other.wsmiddotWidth\n\t\t\t&& this.maxDigitWidth === other.maxDigitWidth\n\t\t);\n\t}\n}\n/**\n * @internal\n */\nexport const FONT_VARIATION_OFF = 'normal';\n/**\n * @internal\n */\nexport const FONT_VARIATION_TRANSLATE = 'translate';\n\n/**\n * @internal\n */\nexport const DEFAULT_WINDOWS_FONT_FAMILY = 'Consolas, \\'Courier New\\', monospace';\n/**\n * @internal\n */\nexport const DEFAULT_MAC_FONT_FAMILY = 'Menlo, Monaco, \\'Courier New\\', monospace';\n/**\n * @internal\n */\nexport const DEFAULT_LINUX_FONT_FAMILY = '\\'Droid Sans Mono\\', monospace';\n/**\n * @internal\n */\nexport const EDITOR_FONT_DEFAULTS = {\n\tfontFamily: (\n\t\tplatform.isMacintosh ? DEFAULT_MAC_FONT_FAMILY : (platform.isWindows ? DEFAULT_WINDOWS_FONT_FAMILY : DEFAULT_LINUX_FONT_FAMILY)\n\t),\n\tfontWeight: 'normal',\n\tfontSize: (\n\t\tplatform.isMacintosh ? 12 : 14\n\t),\n\tlineHeight: 0,\n\tletterSpacing: 0,\n};\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as platform from '../../../base/common/platform.js';\nimport { EditorOption, FindComputedEditorOptionValueById } from './editorOptions.js';\nimport { EditorZoom } from './editorZoom.js';\n\n/**\n * Determined from empirical observations.\n * @internal\n */\nexport const GOLDEN_LINE_HEIGHT_RATIO = platform.isMacintosh ? 1.5 : 1.35;\n\n/**\n * @internal\n */\nexport const MINIMUM_LINE_HEIGHT = 8;\n\n/**\n * @internal\n */\nexport interface IValidatedEditorOptions {\n\tget<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T>;\n}\n\nexport class BareFontInfo {\n\treadonly _bareFontInfoBrand: void = undefined;\n\n\t/**\n\t * @internal\n\t */\n\tpublic static _create(fontFamily: string, fontWeight: string, fontSize: number, fontFeatureSettings: string, fontVariationSettings: string, lineHeight: number, letterSpacing: number, pixelRatio: number, ignoreEditorZoom: boolean): BareFontInfo {\n\t\tif (lineHeight === 0) {\n\t\t\tlineHeight = GOLDEN_LINE_HEIGHT_RATIO * fontSize;\n\t\t} else if (lineHeight < MINIMUM_LINE_HEIGHT) {\n\t\t\t// Values too small to be line heights in pixels are in ems.\n\t\t\tlineHeight = lineHeight * fontSize;\n\t\t}\n\n\t\t// Enforce integer, minimum constraints\n\t\tlineHeight = Math.round(lineHeight);\n\t\tif (lineHeight < MINIMUM_LINE_HEIGHT) {\n\t\t\tlineHeight = MINIMUM_LINE_HEIGHT;\n\t\t}\n\n\t\tconst editorZoomLevelMultiplier = 1 + (ignoreEditorZoom ? 0 : EditorZoom.getZoomLevel() * 0.1);\n\t\tfontSize *= editorZoomLevelMultiplier;\n\t\tlineHeight *= editorZoomLevelMultiplier;\n\n\t\tif (fontVariationSettings === FONT_VARIATION_TRANSLATE) {\n\t\t\tif (fontWeight === 'normal' || fontWeight === 'bold') {\n\t\t\t\tfontVariationSettings = FONT_VARIATION_OFF;\n\t\t\t} else {\n\t\t\t\tconst fontWeightAsNumber = parseInt(fontWeight, 10);\n\t\t\t\tfontVariationSettings = `'wght' ${fontWeightAsNumber}`;\n\t\t\t\tfontWeight = 'normal';\n\t\t\t}\n\t\t}\n\n\t\treturn new BareFontInfo({\n\t\t\tpixelRatio: pixelRatio,\n\t\t\tfontFamily: fontFamily,\n\t\t\tfontWeight: fontWeight,\n\t\t\tfontSize: fontSize,\n\t\t\tfontFeatureSettings: fontFeatureSettings,\n\t\t\tfontVariationSettings,\n\t\t\tlineHeight: lineHeight,\n\t\t\tletterSpacing: letterSpacing\n\t\t});\n\t}\n\n\treadonly pixelRatio: number;\n\treadonly fontFamily: string;\n\treadonly fontWeight: string;\n\treadonly fontSize: number;\n\treadonly fontFeatureSettings: string;\n\treadonly fontVariationSettings: string;\n\treadonly lineHeight: number;\n\treadonly letterSpacing: number;\n\n\t/**\n\t * @internal\n\t */\n\tprotected constructor(opts: {\n\t\tpixelRatio: number;\n\t\tfontFamily: string;\n\t\tfontWeight: string;\n\t\tfontSize: number;\n\t\tfontFeatureSettings: string;\n\t\tfontVariationSettings: string;\n\t\tlineHeight: number;\n\t\tletterSpacing: number;\n\t}) {\n\t\tthis.pixelRatio = opts.pixelRatio;\n\t\tthis.fontFamily = String(opts.fontFamily);\n\t\tthis.fontWeight = String(opts.fontWeight);\n\t\tthis.fontSize = opts.fontSize;\n\t\tthis.fontFeatureSettings = opts.fontFeatureSettings;\n\t\tthis.fontVariationSettings = opts.fontVariationSettings;\n\t\tthis.lineHeight = opts.lineHeight | 0;\n\t\tthis.letterSpacing = opts.letterSpacing;\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic getId(): string {\n\t\treturn `${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`;\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic getMassagedFontFamily(): string {\n\t\tconst fallbackFontFamily = EDITOR_FONT_DEFAULTS.fontFamily;\n\t\tconst fontFamily = BareFontInfo._wrapInQuotes(this.fontFamily);\n\t\tif (fallbackFontFamily && this.fontFamily !== fallbackFontFamily) {\n\t\t\treturn `${fontFamily}, ${fallbackFontFamily}`;\n\t\t}\n\t\treturn fontFamily;\n\t}\n\n\tprivate static _wrapInQuotes(fontFamily: string): string {\n\t\tif (/[,\"']/.test(fontFamily)) {\n\t\t\t// Looks like the font family might be already escaped\n\t\t\treturn fontFamily;\n\t\t}\n\t\tif (/[+ ]/.test(fontFamily)) {\n\t\t\t// Wrap a font family using + or <space> with quotes\n\t\t\treturn `\"${fontFamily}\"`;\n\t\t}\n\t\treturn fontFamily;\n\t}\n}\n\n// change this whenever `FontInfo` members are changed\nexport const SERIALIZED_FONT_INFO_VERSION = 2;\n\nexport class FontInfo extends BareFontInfo {\n\treadonly _editorStylingBrand: void = undefined;\n\n\treadonly version: number = SERIALIZED_FONT_INFO_VERSION;\n\treadonly isTrusted: boolean;\n\treadonly isMonospace: boolean;\n\treadonly typicalHalfwidthCharacterWidth: number;\n\treadonly typicalFullwidthCharacterWidth: number;\n\treadonly canUseHalfwidthRightwardsArrow: boolean;\n\treadonly spaceWidth: number;\n\treadonly middotWidth: number;\n\treadonly wsmiddotWidth: number;\n\treadonly maxDigitWidth: number;\n\n\t/**\n\t * @internal\n\t */\n\tconstructor(opts: {\n\t\tpixelRatio: number;\n\t\tfontFamily: string;\n\t\tfontWeight: string;\n\t\tfontSize: number;\n\t\tfontFeatureSettings: string;\n\t\tfontVariationSettings: string;\n\t\tlineHeight: number;\n\t\tletterSpacing: number;\n\t\tisMonospace: boolean;\n\t\ttypicalHalfwidthCharacterWidth: number;\n\t\ttypicalFullwidthCharacterWidth: number;\n\t\tcanUseHalfwidthRightwardsArrow: boolean;\n\t\tspaceWidth: number;\n\t\tmiddotWidth: number;\n\t\twsmiddotWidth: number;\n\t\tmaxDigitWidth: number;\n\t}, isTrusted: boolean) {\n\t\tsuper(opts);\n\t\tthis.isTrusted = isTrusted;\n\t\tthis.isMonospace = opts.isMonospace;\n\t\tthis.typicalHalfwidthCharacterWidth = opts.typicalHalfwidthCharacterWidth;\n\t\tthis.typicalFullwidthCharacterWidth = opts.typicalFullwidthCharacterWidth;\n\t\tthis.canUseHalfwidthRightwardsArrow = opts.canUseHalfwidthRightwardsArrow;\n\t\tthis.spaceWidth = opts.spaceWidth;\n\t\tthis.middotWidth = opts.middotWidth;\n\t\tthis.wsmiddotWidth = opts.wsmiddotWidth;\n\t\tthis.maxDigitWidth = opts.maxDigitWidth;\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic equals(other: FontInfo): boolean {\n\t\treturn (\n\t\t\tthis.fontFamily === other.fontFamily\n\t\t\t&& this.fontWeight === other.fontWeight\n\t\t\t&& this.fontSize === other.fontSize\n\t\t\t&& this.fontFeatureSettings === other.fontFeatureSettings\n\t\t\t&& this.fontVariationSettings === other.fontVariationSettings\n\t\t\t&& this.lineHeight === other.lineHeight\n\t\t\t&& this.letterSpacing === other.letterSpacing\n\t\t\t&& this.typicalHalfwidthCharacterWidth === other.typicalHalfwidthCharacterWidth\n\t\t\t&& this.typicalFullwidthCharacterWidth === other.typicalFullwidthCharacterWidth\n\t\t\t&& this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow\n\t\t\t&& this.spaceWidth === other.spaceWidth\n\t\t\t&& this.middotWidth === other.middotWidth\n\t\t\t&& this.wsmiddotWidth === other.wsmiddotWidth\n\t\t\t&& this.maxDigitWidth === other.maxDigitWidth\n\t\t);\n\t}\n}\n/**\n * @internal\n */\nexport const FONT_VARIATION_OFF = 'normal';\n/**\n * @internal\n */\nexport const FONT_VARIATION_TRANSLATE = 'translate';\n\n/**\n * @internal\n */\nexport const DEFAULT_WINDOWS_FONT_FAMILY = 'Consolas, \\'Courier New\\', monospace';\n/**\n * @internal\n */\nexport const DEFAULT_MAC_FONT_FAMILY = 'Menlo, Monaco, \\'Courier New\\', monospace';\n/**\n * @internal\n */\nexport const DEFAULT_LINUX_FONT_FAMILY = '\\'Droid Sans Mono\\', monospace';\n/**\n * @internal\n */\nexport const EDITOR_FONT_DEFAULTS = {\n\tfontFamily: (\n\t\tplatform.isMacintosh ? DEFAULT_MAC_FONT_FAMILY : (platform.isWindows ? DEFAULT_WINDOWS_FONT_FAMILY : DEFAULT_LINUX_FONT_FAMILY)\n\t),\n\tfontWeight: 'normal',\n\tfontSize: (\n\t\tplatform.isMacintosh ? 12 : 14\n\t),\n\tlineHeight: 0,\n\tletterSpacing: 0,\n};\n"]}
@@ -9,76 +9,76 @@ import { registerThemingParticipant } from '../../../platform/theme/common/theme
9
9
  /**
10
10
  * Definition of the editor colors
11
11
  */
12
- export const editorLineHighlight = registerColor('editor.lineHighlightBackground', null, nls.localize(614, 'Background color for the highlight of line at the cursor position.'));
13
- export const editorInactiveLineHighlight = registerColor('editor.inactiveLineHighlightBackground', editorLineHighlight, nls.localize(615, 'Background color for the highlight of line at the cursor position when the editor is not focused.'));
14
- export const editorLineHighlightBorder = registerColor('editor.lineHighlightBorder', { dark: '#282828', light: '#eeeeee', hcDark: '#f38518', hcLight: contrastBorder }, nls.localize(616, 'Background color for the border around the line at the cursor position.'));
15
- export const editorRangeHighlight = registerColor('editor.rangeHighlightBackground', { dark: '#ffffff0b', light: '#fdff0033', hcDark: null, hcLight: null }, nls.localize(617, 'Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations.'), true);
16
- export const editorRangeHighlightBorder = registerColor('editor.rangeHighlightBorder', { dark: null, light: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, nls.localize(618, 'Background color of the border around highlighted ranges.'));
17
- export const editorSymbolHighlight = registerColor('editor.symbolHighlightBackground', { dark: editorFindMatchHighlight, light: editorFindMatchHighlight, hcDark: null, hcLight: null }, nls.localize(619, 'Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations.'), true);
18
- export const editorSymbolHighlightBorder = registerColor('editor.symbolHighlightBorder', { dark: null, light: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, nls.localize(620, 'Background color of the border around highlighted symbols.'));
19
- export const editorCursorForeground = registerColor('editorCursor.foreground', { dark: '#AEAFAD', light: Color.black, hcDark: Color.white, hcLight: '#0F4A85' }, nls.localize(621, 'Color of the editor cursor.'));
20
- export const editorCursorBackground = registerColor('editorCursor.background', null, nls.localize(622, 'The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.'));
21
- export const editorMultiCursorPrimaryForeground = registerColor('editorMultiCursor.primary.foreground', editorCursorForeground, nls.localize(623, 'Color of the primary editor cursor when multiple cursors are present.'));
22
- export const editorMultiCursorPrimaryBackground = registerColor('editorMultiCursor.primary.background', editorCursorBackground, nls.localize(624, 'The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.'));
23
- export const editorMultiCursorSecondaryForeground = registerColor('editorMultiCursor.secondary.foreground', editorCursorForeground, nls.localize(625, 'Color of secondary editor cursors when multiple cursors are present.'));
24
- export const editorMultiCursorSecondaryBackground = registerColor('editorMultiCursor.secondary.background', editorCursorBackground, nls.localize(626, 'The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.'));
25
- export const editorWhitespaces = registerColor('editorWhitespace.foreground', { dark: '#e3e4e229', light: '#33333333', hcDark: '#e3e4e229', hcLight: '#CCCCCC' }, nls.localize(627, 'Color of whitespace characters in the editor.'));
26
- export const editorLineNumbers = registerColor('editorLineNumber.foreground', { dark: '#858585', light: '#237893', hcDark: Color.white, hcLight: '#292929' }, nls.localize(628, 'Color of editor line numbers.'));
27
- export const deprecatedEditorIndentGuides = registerColor('editorIndentGuide.background', editorWhitespaces, nls.localize(629, 'Color of the editor indentation guides.'), false, nls.localize(630, '\'editorIndentGuide.background\' is deprecated. Use \'editorIndentGuide.background1\' instead.'));
28
- export const deprecatedEditorActiveIndentGuides = registerColor('editorIndentGuide.activeBackground', editorWhitespaces, nls.localize(631, 'Color of the active editor indentation guides.'), false, nls.localize(632, '\'editorIndentGuide.activeBackground\' is deprecated. Use \'editorIndentGuide.activeBackground1\' instead.'));
29
- export const editorIndentGuide1 = registerColor('editorIndentGuide.background1', deprecatedEditorIndentGuides, nls.localize(633, 'Color of the editor indentation guides (1).'));
30
- export const editorIndentGuide2 = registerColor('editorIndentGuide.background2', '#00000000', nls.localize(634, 'Color of the editor indentation guides (2).'));
31
- export const editorIndentGuide3 = registerColor('editorIndentGuide.background3', '#00000000', nls.localize(635, 'Color of the editor indentation guides (3).'));
32
- export const editorIndentGuide4 = registerColor('editorIndentGuide.background4', '#00000000', nls.localize(636, 'Color of the editor indentation guides (4).'));
33
- export const editorIndentGuide5 = registerColor('editorIndentGuide.background5', '#00000000', nls.localize(637, 'Color of the editor indentation guides (5).'));
34
- export const editorIndentGuide6 = registerColor('editorIndentGuide.background6', '#00000000', nls.localize(638, 'Color of the editor indentation guides (6).'));
35
- export const editorActiveIndentGuide1 = registerColor('editorIndentGuide.activeBackground1', deprecatedEditorActiveIndentGuides, nls.localize(639, 'Color of the active editor indentation guides (1).'));
36
- export const editorActiveIndentGuide2 = registerColor('editorIndentGuide.activeBackground2', '#00000000', nls.localize(640, 'Color of the active editor indentation guides (2).'));
37
- export const editorActiveIndentGuide3 = registerColor('editorIndentGuide.activeBackground3', '#00000000', nls.localize(641, 'Color of the active editor indentation guides (3).'));
38
- export const editorActiveIndentGuide4 = registerColor('editorIndentGuide.activeBackground4', '#00000000', nls.localize(642, 'Color of the active editor indentation guides (4).'));
39
- export const editorActiveIndentGuide5 = registerColor('editorIndentGuide.activeBackground5', '#00000000', nls.localize(643, 'Color of the active editor indentation guides (5).'));
40
- export const editorActiveIndentGuide6 = registerColor('editorIndentGuide.activeBackground6', '#00000000', nls.localize(644, 'Color of the active editor indentation guides (6).'));
41
- const deprecatedEditorActiveLineNumber = registerColor('editorActiveLineNumber.foreground', { dark: '#c6c6c6', light: '#0B216F', hcDark: activeContrastBorder, hcLight: activeContrastBorder }, nls.localize(645, 'Color of editor active line number'), false, nls.localize(646, 'Id is deprecated. Use \'editorLineNumber.activeForeground\' instead.'));
42
- export const editorActiveLineNumber = registerColor('editorLineNumber.activeForeground', deprecatedEditorActiveLineNumber, nls.localize(647, 'Color of editor active line number'));
43
- export const editorDimmedLineNumber = registerColor('editorLineNumber.dimmedForeground', null, nls.localize(648, 'Color of the final editor line when editor.renderFinalNewline is set to dimmed.'));
44
- export const editorRuler = registerColor('editorRuler.foreground', { dark: '#5A5A5A', light: Color.lightgrey, hcDark: Color.white, hcLight: '#292929' }, nls.localize(649, 'Color of the editor rulers.'));
45
- export const editorCodeLensForeground = registerColor('editorCodeLens.foreground', { dark: '#999999', light: '#919191', hcDark: '#999999', hcLight: '#292929' }, nls.localize(650, 'Foreground color of editor CodeLens'));
46
- export const editorBracketMatchBackground = registerColor('editorBracketMatch.background', { dark: '#0064001a', light: '#0064001a', hcDark: '#0064001a', hcLight: '#0000' }, nls.localize(651, 'Background color behind matching brackets'));
47
- export const editorBracketMatchBorder = registerColor('editorBracketMatch.border', { dark: '#888', light: '#B9B9B9', hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize(652, 'Color for matching brackets boxes'));
48
- export const editorOverviewRulerBorder = registerColor('editorOverviewRuler.border', { dark: '#7f7f7f4d', light: '#7f7f7f4d', hcDark: '#7f7f7f4d', hcLight: '#666666' }, nls.localize(653, 'Color of the overview ruler border.'));
49
- export const editorOverviewRulerBackground = registerColor('editorOverviewRuler.background', null, nls.localize(654, 'Background color of the editor overview ruler.'));
50
- export const editorGutter = registerColor('editorGutter.background', editorBackground, nls.localize(655, 'Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.'));
51
- export const editorUnnecessaryCodeBorder = registerColor('editorUnnecessaryCode.border', { dark: null, light: null, hcDark: Color.fromHex('#fff').transparent(0.8), hcLight: contrastBorder }, nls.localize(656, 'Border color of unnecessary (unused) source code in the editor.'));
52
- export const editorUnnecessaryCodeOpacity = registerColor('editorUnnecessaryCode.opacity', { dark: Color.fromHex('#000a'), light: Color.fromHex('#0007'), hcDark: null, hcLight: null }, nls.localize(657, 'Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the \'editorUnnecessaryCode.border\' theme color to underline unnecessary code instead of fading it out.'));
53
- export const ghostTextBorder = registerColor('editorGhostText.border', { dark: null, light: null, hcDark: Color.fromHex('#fff').transparent(0.8), hcLight: Color.fromHex('#292929').transparent(0.8) }, nls.localize(658, 'Border color of ghost text in the editor.'));
54
- export const ghostTextForeground = registerColor('editorGhostText.foreground', { dark: Color.fromHex('#ffffff56'), light: Color.fromHex('#0007'), hcDark: null, hcLight: null }, nls.localize(659, 'Foreground color of the ghost text in the editor.'));
55
- export const ghostTextBackground = registerColor('editorGhostText.background', null, nls.localize(660, 'Background color of the ghost text in the editor.'));
12
+ export const editorLineHighlight = registerColor('editor.lineHighlightBackground', null, nls.localize(615, 'Background color for the highlight of line at the cursor position.'));
13
+ export const editorInactiveLineHighlight = registerColor('editor.inactiveLineHighlightBackground', editorLineHighlight, nls.localize(616, 'Background color for the highlight of line at the cursor position when the editor is not focused.'));
14
+ export const editorLineHighlightBorder = registerColor('editor.lineHighlightBorder', { dark: '#282828', light: '#eeeeee', hcDark: '#f38518', hcLight: contrastBorder }, nls.localize(617, 'Background color for the border around the line at the cursor position.'));
15
+ export const editorRangeHighlight = registerColor('editor.rangeHighlightBackground', { dark: '#ffffff0b', light: '#fdff0033', hcDark: null, hcLight: null }, nls.localize(618, 'Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations.'), true);
16
+ export const editorRangeHighlightBorder = registerColor('editor.rangeHighlightBorder', { dark: null, light: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, nls.localize(619, 'Background color of the border around highlighted ranges.'));
17
+ export const editorSymbolHighlight = registerColor('editor.symbolHighlightBackground', { dark: editorFindMatchHighlight, light: editorFindMatchHighlight, hcDark: null, hcLight: null }, nls.localize(620, 'Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations.'), true);
18
+ export const editorSymbolHighlightBorder = registerColor('editor.symbolHighlightBorder', { dark: null, light: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, nls.localize(621, 'Background color of the border around highlighted symbols.'));
19
+ export const editorCursorForeground = registerColor('editorCursor.foreground', { dark: '#AEAFAD', light: Color.black, hcDark: Color.white, hcLight: '#0F4A85' }, nls.localize(622, 'Color of the editor cursor.'));
20
+ export const editorCursorBackground = registerColor('editorCursor.background', null, nls.localize(623, 'The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.'));
21
+ export const editorMultiCursorPrimaryForeground = registerColor('editorMultiCursor.primary.foreground', editorCursorForeground, nls.localize(624, 'Color of the primary editor cursor when multiple cursors are present.'));
22
+ export const editorMultiCursorPrimaryBackground = registerColor('editorMultiCursor.primary.background', editorCursorBackground, nls.localize(625, 'The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.'));
23
+ export const editorMultiCursorSecondaryForeground = registerColor('editorMultiCursor.secondary.foreground', editorCursorForeground, nls.localize(626, 'Color of secondary editor cursors when multiple cursors are present.'));
24
+ export const editorMultiCursorSecondaryBackground = registerColor('editorMultiCursor.secondary.background', editorCursorBackground, nls.localize(627, 'The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.'));
25
+ export const editorWhitespaces = registerColor('editorWhitespace.foreground', { dark: '#e3e4e229', light: '#33333333', hcDark: '#e3e4e229', hcLight: '#CCCCCC' }, nls.localize(628, 'Color of whitespace characters in the editor.'));
26
+ export const editorLineNumbers = registerColor('editorLineNumber.foreground', { dark: '#858585', light: '#237893', hcDark: Color.white, hcLight: '#292929' }, nls.localize(629, 'Color of editor line numbers.'));
27
+ export const deprecatedEditorIndentGuides = registerColor('editorIndentGuide.background', editorWhitespaces, nls.localize(630, 'Color of the editor indentation guides.'), false, nls.localize(631, '\'editorIndentGuide.background\' is deprecated. Use \'editorIndentGuide.background1\' instead.'));
28
+ export const deprecatedEditorActiveIndentGuides = registerColor('editorIndentGuide.activeBackground', editorWhitespaces, nls.localize(632, 'Color of the active editor indentation guides.'), false, nls.localize(633, '\'editorIndentGuide.activeBackground\' is deprecated. Use \'editorIndentGuide.activeBackground1\' instead.'));
29
+ export const editorIndentGuide1 = registerColor('editorIndentGuide.background1', deprecatedEditorIndentGuides, nls.localize(634, 'Color of the editor indentation guides (1).'));
30
+ export const editorIndentGuide2 = registerColor('editorIndentGuide.background2', '#00000000', nls.localize(635, 'Color of the editor indentation guides (2).'));
31
+ export const editorIndentGuide3 = registerColor('editorIndentGuide.background3', '#00000000', nls.localize(636, 'Color of the editor indentation guides (3).'));
32
+ export const editorIndentGuide4 = registerColor('editorIndentGuide.background4', '#00000000', nls.localize(637, 'Color of the editor indentation guides (4).'));
33
+ export const editorIndentGuide5 = registerColor('editorIndentGuide.background5', '#00000000', nls.localize(638, 'Color of the editor indentation guides (5).'));
34
+ export const editorIndentGuide6 = registerColor('editorIndentGuide.background6', '#00000000', nls.localize(639, 'Color of the editor indentation guides (6).'));
35
+ export const editorActiveIndentGuide1 = registerColor('editorIndentGuide.activeBackground1', deprecatedEditorActiveIndentGuides, nls.localize(640, 'Color of the active editor indentation guides (1).'));
36
+ export const editorActiveIndentGuide2 = registerColor('editorIndentGuide.activeBackground2', '#00000000', nls.localize(641, 'Color of the active editor indentation guides (2).'));
37
+ export const editorActiveIndentGuide3 = registerColor('editorIndentGuide.activeBackground3', '#00000000', nls.localize(642, 'Color of the active editor indentation guides (3).'));
38
+ export const editorActiveIndentGuide4 = registerColor('editorIndentGuide.activeBackground4', '#00000000', nls.localize(643, 'Color of the active editor indentation guides (4).'));
39
+ export const editorActiveIndentGuide5 = registerColor('editorIndentGuide.activeBackground5', '#00000000', nls.localize(644, 'Color of the active editor indentation guides (5).'));
40
+ export const editorActiveIndentGuide6 = registerColor('editorIndentGuide.activeBackground6', '#00000000', nls.localize(645, 'Color of the active editor indentation guides (6).'));
41
+ const deprecatedEditorActiveLineNumber = registerColor('editorActiveLineNumber.foreground', { dark: '#c6c6c6', light: '#0B216F', hcDark: activeContrastBorder, hcLight: activeContrastBorder }, nls.localize(646, 'Color of editor active line number'), false, nls.localize(647, 'Id is deprecated. Use \'editorLineNumber.activeForeground\' instead.'));
42
+ export const editorActiveLineNumber = registerColor('editorLineNumber.activeForeground', deprecatedEditorActiveLineNumber, nls.localize(648, 'Color of editor active line number'));
43
+ export const editorDimmedLineNumber = registerColor('editorLineNumber.dimmedForeground', null, nls.localize(649, 'Color of the final editor line when editor.renderFinalNewline is set to dimmed.'));
44
+ export const editorRuler = registerColor('editorRuler.foreground', { dark: '#5A5A5A', light: Color.lightgrey, hcDark: Color.white, hcLight: '#292929' }, nls.localize(650, 'Color of the editor rulers.'));
45
+ export const editorCodeLensForeground = registerColor('editorCodeLens.foreground', { dark: '#999999', light: '#919191', hcDark: '#999999', hcLight: '#292929' }, nls.localize(651, 'Foreground color of editor CodeLens'));
46
+ export const editorBracketMatchBackground = registerColor('editorBracketMatch.background', { dark: '#0064001a', light: '#0064001a', hcDark: '#0064001a', hcLight: '#0000' }, nls.localize(652, 'Background color behind matching brackets'));
47
+ export const editorBracketMatchBorder = registerColor('editorBracketMatch.border', { dark: '#888', light: '#B9B9B9', hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize(653, 'Color for matching brackets boxes'));
48
+ export const editorOverviewRulerBorder = registerColor('editorOverviewRuler.border', { dark: '#7f7f7f4d', light: '#7f7f7f4d', hcDark: '#7f7f7f4d', hcLight: '#666666' }, nls.localize(654, 'Color of the overview ruler border.'));
49
+ export const editorOverviewRulerBackground = registerColor('editorOverviewRuler.background', null, nls.localize(655, 'Background color of the editor overview ruler.'));
50
+ export const editorGutter = registerColor('editorGutter.background', editorBackground, nls.localize(656, 'Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.'));
51
+ export const editorUnnecessaryCodeBorder = registerColor('editorUnnecessaryCode.border', { dark: null, light: null, hcDark: Color.fromHex('#fff').transparent(0.8), hcLight: contrastBorder }, nls.localize(657, 'Border color of unnecessary (unused) source code in the editor.'));
52
+ export const editorUnnecessaryCodeOpacity = registerColor('editorUnnecessaryCode.opacity', { dark: Color.fromHex('#000a'), light: Color.fromHex('#0007'), hcDark: null, hcLight: null }, nls.localize(658, 'Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the \'editorUnnecessaryCode.border\' theme color to underline unnecessary code instead of fading it out.'));
53
+ export const ghostTextBorder = registerColor('editorGhostText.border', { dark: null, light: null, hcDark: Color.fromHex('#fff').transparent(0.8), hcLight: Color.fromHex('#292929').transparent(0.8) }, nls.localize(659, 'Border color of ghost text in the editor.'));
54
+ export const ghostTextForeground = registerColor('editorGhostText.foreground', { dark: Color.fromHex('#ffffff56'), light: Color.fromHex('#0007'), hcDark: null, hcLight: null }, nls.localize(660, 'Foreground color of the ghost text in the editor.'));
55
+ export const ghostTextBackground = registerColor('editorGhostText.background', null, nls.localize(661, 'Background color of the ghost text in the editor.'));
56
56
  const rulerRangeDefault = new Color(new RGBA(0, 122, 204, 0.6));
57
- export const overviewRulerRangeHighlight = registerColor('editorOverviewRuler.rangeHighlightForeground', rulerRangeDefault, nls.localize(661, 'Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations.'), true);
58
- export const overviewRulerError = registerColor('editorOverviewRuler.errorForeground', { dark: new Color(new RGBA(255, 18, 18, 0.7)), light: new Color(new RGBA(255, 18, 18, 0.7)), hcDark: new Color(new RGBA(255, 50, 50, 1)), hcLight: '#B5200D' }, nls.localize(662, 'Overview ruler marker color for errors.'));
59
- export const overviewRulerWarning = registerColor('editorOverviewRuler.warningForeground', { dark: editorWarningForeground, light: editorWarningForeground, hcDark: editorWarningBorder, hcLight: editorWarningBorder }, nls.localize(663, 'Overview ruler marker color for warnings.'));
60
- export const overviewRulerInfo = registerColor('editorOverviewRuler.infoForeground', { dark: editorInfoForeground, light: editorInfoForeground, hcDark: editorInfoBorder, hcLight: editorInfoBorder }, nls.localize(664, 'Overview ruler marker color for infos.'));
61
- export const editorBracketHighlightingForeground1 = registerColor('editorBracketHighlight.foreground1', { dark: '#FFD700', light: '#0431FAFF', hcDark: '#FFD700', hcLight: '#0431FAFF' }, nls.localize(665, 'Foreground color of brackets (1). Requires enabling bracket pair colorization.'));
62
- export const editorBracketHighlightingForeground2 = registerColor('editorBracketHighlight.foreground2', { dark: '#DA70D6', light: '#319331FF', hcDark: '#DA70D6', hcLight: '#319331FF' }, nls.localize(666, 'Foreground color of brackets (2). Requires enabling bracket pair colorization.'));
63
- export const editorBracketHighlightingForeground3 = registerColor('editorBracketHighlight.foreground3', { dark: '#179FFF', light: '#7B3814FF', hcDark: '#87CEFA', hcLight: '#7B3814FF' }, nls.localize(667, 'Foreground color of brackets (3). Requires enabling bracket pair colorization.'));
64
- export const editorBracketHighlightingForeground4 = registerColor('editorBracketHighlight.foreground4', '#00000000', nls.localize(668, 'Foreground color of brackets (4). Requires enabling bracket pair colorization.'));
65
- export const editorBracketHighlightingForeground5 = registerColor('editorBracketHighlight.foreground5', '#00000000', nls.localize(669, 'Foreground color of brackets (5). Requires enabling bracket pair colorization.'));
66
- export const editorBracketHighlightingForeground6 = registerColor('editorBracketHighlight.foreground6', '#00000000', nls.localize(670, 'Foreground color of brackets (6). Requires enabling bracket pair colorization.'));
67
- export const editorBracketHighlightingUnexpectedBracketForeground = registerColor('editorBracketHighlight.unexpectedBracket.foreground', { dark: new Color(new RGBA(255, 18, 18, 0.8)), light: new Color(new RGBA(255, 18, 18, 0.8)), hcDark: new Color(new RGBA(255, 50, 50, 1)), hcLight: '#B5200D' }, nls.localize(671, 'Foreground color of unexpected brackets.'));
68
- export const editorBracketPairGuideBackground1 = registerColor('editorBracketPairGuide.background1', '#00000000', nls.localize(672, 'Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.'));
69
- export const editorBracketPairGuideBackground2 = registerColor('editorBracketPairGuide.background2', '#00000000', nls.localize(673, 'Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.'));
70
- export const editorBracketPairGuideBackground3 = registerColor('editorBracketPairGuide.background3', '#00000000', nls.localize(674, 'Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.'));
71
- export const editorBracketPairGuideBackground4 = registerColor('editorBracketPairGuide.background4', '#00000000', nls.localize(675, 'Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.'));
72
- export const editorBracketPairGuideBackground5 = registerColor('editorBracketPairGuide.background5', '#00000000', nls.localize(676, 'Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.'));
73
- export const editorBracketPairGuideBackground6 = registerColor('editorBracketPairGuide.background6', '#00000000', nls.localize(677, 'Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.'));
74
- export const editorBracketPairGuideActiveBackground1 = registerColor('editorBracketPairGuide.activeBackground1', '#00000000', nls.localize(678, 'Background color of active bracket pair guides (1). Requires enabling bracket pair guides.'));
75
- export const editorBracketPairGuideActiveBackground2 = registerColor('editorBracketPairGuide.activeBackground2', '#00000000', nls.localize(679, 'Background color of active bracket pair guides (2). Requires enabling bracket pair guides.'));
76
- export const editorBracketPairGuideActiveBackground3 = registerColor('editorBracketPairGuide.activeBackground3', '#00000000', nls.localize(680, 'Background color of active bracket pair guides (3). Requires enabling bracket pair guides.'));
77
- export const editorBracketPairGuideActiveBackground4 = registerColor('editorBracketPairGuide.activeBackground4', '#00000000', nls.localize(681, 'Background color of active bracket pair guides (4). Requires enabling bracket pair guides.'));
78
- export const editorBracketPairGuideActiveBackground5 = registerColor('editorBracketPairGuide.activeBackground5', '#00000000', nls.localize(682, 'Background color of active bracket pair guides (5). Requires enabling bracket pair guides.'));
79
- export const editorBracketPairGuideActiveBackground6 = registerColor('editorBracketPairGuide.activeBackground6', '#00000000', nls.localize(683, 'Background color of active bracket pair guides (6). Requires enabling bracket pair guides.'));
80
- export const editorUnicodeHighlightBorder = registerColor('editorUnicodeHighlight.border', editorWarningForeground, nls.localize(684, 'Border color used to highlight unicode characters.'));
81
- export const editorUnicodeHighlightBackground = registerColor('editorUnicodeHighlight.background', editorWarningBackground, nls.localize(685, 'Background color used to highlight unicode characters.'));
57
+ export const overviewRulerRangeHighlight = registerColor('editorOverviewRuler.rangeHighlightForeground', rulerRangeDefault, nls.localize(662, 'Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations.'), true);
58
+ export const overviewRulerError = registerColor('editorOverviewRuler.errorForeground', { dark: new Color(new RGBA(255, 18, 18, 0.7)), light: new Color(new RGBA(255, 18, 18, 0.7)), hcDark: new Color(new RGBA(255, 50, 50, 1)), hcLight: '#B5200D' }, nls.localize(663, 'Overview ruler marker color for errors.'));
59
+ export const overviewRulerWarning = registerColor('editorOverviewRuler.warningForeground', { dark: editorWarningForeground, light: editorWarningForeground, hcDark: editorWarningBorder, hcLight: editorWarningBorder }, nls.localize(664, 'Overview ruler marker color for warnings.'));
60
+ export const overviewRulerInfo = registerColor('editorOverviewRuler.infoForeground', { dark: editorInfoForeground, light: editorInfoForeground, hcDark: editorInfoBorder, hcLight: editorInfoBorder }, nls.localize(665, 'Overview ruler marker color for infos.'));
61
+ export const editorBracketHighlightingForeground1 = registerColor('editorBracketHighlight.foreground1', { dark: '#FFD700', light: '#0431FAFF', hcDark: '#FFD700', hcLight: '#0431FAFF' }, nls.localize(666, 'Foreground color of brackets (1). Requires enabling bracket pair colorization.'));
62
+ export const editorBracketHighlightingForeground2 = registerColor('editorBracketHighlight.foreground2', { dark: '#DA70D6', light: '#319331FF', hcDark: '#DA70D6', hcLight: '#319331FF' }, nls.localize(667, 'Foreground color of brackets (2). Requires enabling bracket pair colorization.'));
63
+ export const editorBracketHighlightingForeground3 = registerColor('editorBracketHighlight.foreground3', { dark: '#179FFF', light: '#7B3814FF', hcDark: '#87CEFA', hcLight: '#7B3814FF' }, nls.localize(668, 'Foreground color of brackets (3). Requires enabling bracket pair colorization.'));
64
+ export const editorBracketHighlightingForeground4 = registerColor('editorBracketHighlight.foreground4', '#00000000', nls.localize(669, 'Foreground color of brackets (4). Requires enabling bracket pair colorization.'));
65
+ export const editorBracketHighlightingForeground5 = registerColor('editorBracketHighlight.foreground5', '#00000000', nls.localize(670, 'Foreground color of brackets (5). Requires enabling bracket pair colorization.'));
66
+ export const editorBracketHighlightingForeground6 = registerColor('editorBracketHighlight.foreground6', '#00000000', nls.localize(671, 'Foreground color of brackets (6). Requires enabling bracket pair colorization.'));
67
+ export const editorBracketHighlightingUnexpectedBracketForeground = registerColor('editorBracketHighlight.unexpectedBracket.foreground', { dark: new Color(new RGBA(255, 18, 18, 0.8)), light: new Color(new RGBA(255, 18, 18, 0.8)), hcDark: new Color(new RGBA(255, 50, 50, 1)), hcLight: '#B5200D' }, nls.localize(672, 'Foreground color of unexpected brackets.'));
68
+ export const editorBracketPairGuideBackground1 = registerColor('editorBracketPairGuide.background1', '#00000000', nls.localize(673, 'Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.'));
69
+ export const editorBracketPairGuideBackground2 = registerColor('editorBracketPairGuide.background2', '#00000000', nls.localize(674, 'Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.'));
70
+ export const editorBracketPairGuideBackground3 = registerColor('editorBracketPairGuide.background3', '#00000000', nls.localize(675, 'Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.'));
71
+ export const editorBracketPairGuideBackground4 = registerColor('editorBracketPairGuide.background4', '#00000000', nls.localize(676, 'Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.'));
72
+ export const editorBracketPairGuideBackground5 = registerColor('editorBracketPairGuide.background5', '#00000000', nls.localize(677, 'Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.'));
73
+ export const editorBracketPairGuideBackground6 = registerColor('editorBracketPairGuide.background6', '#00000000', nls.localize(678, 'Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.'));
74
+ export const editorBracketPairGuideActiveBackground1 = registerColor('editorBracketPairGuide.activeBackground1', '#00000000', nls.localize(679, 'Background color of active bracket pair guides (1). Requires enabling bracket pair guides.'));
75
+ export const editorBracketPairGuideActiveBackground2 = registerColor('editorBracketPairGuide.activeBackground2', '#00000000', nls.localize(680, 'Background color of active bracket pair guides (2). Requires enabling bracket pair guides.'));
76
+ export const editorBracketPairGuideActiveBackground3 = registerColor('editorBracketPairGuide.activeBackground3', '#00000000', nls.localize(681, 'Background color of active bracket pair guides (3). Requires enabling bracket pair guides.'));
77
+ export const editorBracketPairGuideActiveBackground4 = registerColor('editorBracketPairGuide.activeBackground4', '#00000000', nls.localize(682, 'Background color of active bracket pair guides (4). Requires enabling bracket pair guides.'));
78
+ export const editorBracketPairGuideActiveBackground5 = registerColor('editorBracketPairGuide.activeBackground5', '#00000000', nls.localize(683, 'Background color of active bracket pair guides (5). Requires enabling bracket pair guides.'));
79
+ export const editorBracketPairGuideActiveBackground6 = registerColor('editorBracketPairGuide.activeBackground6', '#00000000', nls.localize(684, 'Background color of active bracket pair guides (6). Requires enabling bracket pair guides.'));
80
+ export const editorUnicodeHighlightBorder = registerColor('editorUnicodeHighlight.border', editorWarningForeground, nls.localize(685, 'Border color used to highlight unicode characters.'));
81
+ export const editorUnicodeHighlightBackground = registerColor('editorUnicodeHighlight.background', editorWarningBackground, nls.localize(686, 'Background color used to highlight unicode characters.'));
82
82
  // contains all color rules that used to defined in editor/browser/widget/editor.css
83
83
  registerThemingParticipant((theme, collector) => {
84
84
  const background = theme.getColor(editorBackground);
@@ -153,6 +153,25 @@ export class BaseEdit {
153
153
  isEmpty() {
154
154
  return this.replacements.length === 0;
155
155
  }
156
+ /**
157
+ * Return undefined if the originalOffset is within an edit
158
+ */
159
+ applyToOffsetOrUndefined(originalOffset) {
160
+ let accumulatedDelta = 0;
161
+ for (const edit of this.replacements) {
162
+ if (edit.replaceRange.start <= originalOffset) {
163
+ if (originalOffset < edit.replaceRange.endExclusive) {
164
+ // the offset is in the replaced range
165
+ return undefined;
166
+ }
167
+ accumulatedDelta += edit.getNewLength() - edit.replaceRange.length;
168
+ }
169
+ else {
170
+ break;
171
+ }
172
+ }
173
+ return originalOffset + accumulatedDelta;
174
+ }
156
175
  }
157
176
  export class BaseReplacement {
158
177
  constructor(
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/edits/edit.ts","vs/editor/common/core/edits/edit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,8DAA8D;AAC9D,MAAM,OAAg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BAAoB;QACnB,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;IAChG,CAAC;CACD","file":"edit.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { OffsetRange } from '../ranges/offsetRange.js';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport abstract class BaseEdit<T extends BaseReplacement<T> = BaseReplacement<any>, TEdit extends BaseEdit<T, TEdit> = BaseEdit<T, any>> {\n\tconstructor(\n\t\tpublic readonly replacements: readonly T[],\n\t) {\n\t\tlet lastEndEx = -1;\n\t\tfor (const replacement of replacements) {\n\t\t\tif (!(replacement.replaceRange.start >= lastEndEx)) {\n\t\t\t\tthrow new BugIndicatingError(`Edits must be disjoint and sorted. Found ${replacement} after ${lastEndEx}`);\n\t\t\t}\n\t\t\tlastEndEx = replacement.replaceRange.endExclusive;\n\t\t}\n\t}\n\n\tprotected abstract _createNew(replacements: readonly T[]): TEdit;\n\n\tpublic toString() {\n\t\tconst edits = this.replacements.map(e => e.toString()).join(', ');\n\t\treturn `[${edits}]`;\n\t}\n\n\t/**\n\t * Normalizes the edit by removing empty replacements and joining touching replacements (if the replacements allow joining).\n\t * Two edits have an equal normalized edit if and only if they have the same effect on any input.\n\t *\n\t * ![](https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/src/vs/editor/common/core/edits/docs/BaseEdit_normalize.drawio.png)\n\t *\n\t * Invariant:\n\t * ```\n\t * (forall base: TEdit.apply(base).equals(other.apply(base))) <-> this.normalize().equals(other.normalize())\n\t * ```\n\t * and\n\t * ```\n\t * forall base: TEdit.apply(base).equals(this.normalize().apply(base))\n\t * ```\n\t *\n\t */\n\tpublic normalize(): TEdit {\n\t\tconst newReplacements: T[] = [];\n\t\tlet lastReplacement: T | undefined;\n\t\tfor (const r of this.replacements) {\n\t\t\tif (r.getNewLength() === 0 && r.replaceRange.length === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (lastReplacement && lastReplacement.replaceRange.endExclusive === r.replaceRange.start) {\n\t\t\t\tconst joined = lastReplacement.tryJoinTouching(r);\n\t\t\t\tif (joined) {\n\t\t\t\t\tlastReplacement = joined;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (lastReplacement) {\n\t\t\t\tnewReplacements.push(lastReplacement);\n\t\t\t}\n\t\t\tlastReplacement = r;\n\t\t}\n\n\t\tif (lastReplacement) {\n\t\t\tnewReplacements.push(lastReplacement);\n\t\t}\n\t\treturn this._createNew(newReplacements);\n\t}\n\n\t/**\n\t * Combines two edits into one with the same effect.\n\t *\n\t * ![](https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/src/vs/editor/common/core/edits/docs/BaseEdit_compose.drawio.png)\n\t *\n\t * Invariant:\n\t * ```\n\t * other.apply(this.apply(s0)) = this.compose(other).apply(s0)\n\t * ```\n\t */\n\tpublic compose(other: TEdit): TEdit {\n\t\tconst edits1 = this.normalize();\n\t\tconst edits2 = other.normalize();\n\n\t\tif (edits1.isEmpty()) { return edits2; }\n\t\tif (edits2.isEmpty()) { return edits1; }\n\n\t\tconst edit1Queue = [...edits1.replacements];\n\t\tconst result: T[] = [];\n\n\t\tlet edit1ToEdit2 = 0;\n\n\t\tfor (const r2 of edits2.replacements) {\n\t\t\t// Copy over edit1 unmodified until it touches edit2.\n\t\t\twhile (true) {\n\t\t\t\tconst r1 = edit1Queue[0];\n\t\t\t\tif (!r1 || r1.replaceRange.start + edit1ToEdit2 + r1.getNewLength() >= r2.replaceRange.start) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tedit1Queue.shift();\n\n\t\t\t\tresult.push(r1);\n\t\t\t\tedit1ToEdit2 += r1.getNewLength() - r1.replaceRange.length;\n\t\t\t}\n\n\t\t\tconst firstEdit1ToEdit2 = edit1ToEdit2;\n\t\t\tlet firstIntersecting: T | undefined; // or touching\n\t\t\tlet lastIntersecting: T | undefined; // or touching\n\n\t\t\twhile (true) {\n\t\t\t\tconst r1 = edit1Queue[0];\n\t\t\t\tif (!r1 || r1.replaceRange.start + edit1ToEdit2 > r2.replaceRange.endExclusive) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// else we intersect, because the new end of edit1 is after or equal to our start\n\n\t\t\t\tif (!firstIntersecting) {\n\t\t\t\t\tfirstIntersecting = r1;\n\t\t\t\t}\n\t\t\t\tlastIntersecting = r1;\n\t\t\t\tedit1Queue.shift();\n\n\t\t\t\tedit1ToEdit2 += r1.getNewLength() - r1.replaceRange.length;\n\t\t\t}\n\n\t\t\tif (!firstIntersecting) {\n\t\t\t\tresult.push(r2.delta(-edit1ToEdit2));\n\t\t\t} else {\n\t\t\t\tconst newReplaceRangeStart = Math.min(firstIntersecting.replaceRange.start, r2.replaceRange.start - firstEdit1ToEdit2);\n\n\t\t\t\tconst prefixLength = r2.replaceRange.start - (firstIntersecting.replaceRange.start + firstEdit1ToEdit2);\n\t\t\t\tif (prefixLength > 0) {\n\t\t\t\t\tconst prefix = firstIntersecting.slice(OffsetRange.emptyAt(newReplaceRangeStart), new OffsetRange(0, prefixLength));\n\t\t\t\t\tresult.push(prefix);\n\t\t\t\t}\n\t\t\t\tif (!lastIntersecting) {\n\t\t\t\t\tthrow new BugIndicatingError(`Invariant violation: lastIntersecting is undefined`);\n\t\t\t\t}\n\t\t\t\tconst suffixLength = (lastIntersecting.replaceRange.endExclusive + edit1ToEdit2) - r2.replaceRange.endExclusive;\n\t\t\t\tif (suffixLength > 0) {\n\t\t\t\t\tconst e = lastIntersecting.slice(\n\t\t\t\t\t\tOffsetRange.ofStartAndLength(lastIntersecting.replaceRange.endExclusive, 0),\n\t\t\t\t\t\tnew OffsetRange(lastIntersecting.getNewLength() - suffixLength, lastIntersecting.getNewLength())\n\t\t\t\t\t);\n\t\t\t\t\tedit1Queue.unshift(e);\n\t\t\t\t\tedit1ToEdit2 -= e.getNewLength() - e.replaceRange.length;\n\t\t\t\t}\n\n\t\t\t\tconst newReplaceRange = new OffsetRange(\n\t\t\t\t\tnewReplaceRangeStart,\n\t\t\t\t\tr2.replaceRange.endExclusive - edit1ToEdit2\n\t\t\t\t);\n\t\t\t\tconst middle = r2.slice(newReplaceRange, new OffsetRange(0, r2.getNewLength()));\n\t\t\t\tresult.push(middle);\n\t\t\t}\n\t\t}\n\n\t\twhile (true) {\n\t\t\tconst item = edit1Queue.shift();\n\t\t\tif (!item) { break; }\n\t\t\tresult.push(item);\n\t\t}\n\n\t\treturn this._createNew(result).normalize();\n\t}\n\n\t/**\n\t * Returns the range of each replacement in the applied value.\n\t*/\n\tpublic getNewRanges(): OffsetRange[] {\n\t\tconst ranges: OffsetRange[] = [];\n\t\tlet offset = 0;\n\t\tfor (const e of this.replacements) {\n\t\t\tranges.push(OffsetRange.ofStartAndLength(e.replaceRange.start + offset, e.getNewLength()));\n\t\t\toffset += e.getLengthDelta();\n\t\t}\n\t\treturn ranges;\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn this.replacements.length === 0;\n\t}\n}\n\nexport abstract class BaseReplacement<TSelf extends BaseReplacement<TSelf>> {\n\tconstructor(\n\t\t/**\n\t\t * The range to be replaced.\n\t\t*/\n\t\tpublic readonly replaceRange: OffsetRange,\n\t) { }\n\n\tpublic abstract getNewLength(): number;\n\n\t/**\n\t * Precondition: TEdit.range.endExclusive === other.range.start\n\t*/\n\tpublic abstract tryJoinTouching(other: TSelf): TSelf | undefined;\n\n\tpublic abstract slice(newReplaceRange: OffsetRange, rangeInReplacement?: OffsetRange): TSelf;\n\n\tpublic delta(offset: number): TSelf {\n\t\treturn this.slice(this.replaceRange.delta(offset), new OffsetRange(0, this.getNewLength()));\n\t}\n\n\tpublic getLengthDelta(): number {\n\t\treturn this.getNewLength() - this.replaceRange.length;\n\t}\n\n\tabstract equals(other: TSelf): boolean;\n\n\ttoString(): string {\n\t\treturn `{ ${this.replaceRange.toString()} -> ${this.getNewLength()} }`;\n\t}\n\n\tget isEmpty() {\n\t\treturn this.getNewLength() === 0 && this.replaceRange.length === 0;\n\t}\n\n\tgetRangeAfterReplace(): OffsetRange {\n\t\treturn new OffsetRange(this.replaceRange.start, this.replaceRange.start + this.getNewLength());\n\t}\n}\n","\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { OffsetRange } from '../ranges/offsetRange.js';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport abstract class BaseEdit<T extends BaseReplacement<T> = BaseReplacement<any>, TEdit extends BaseEdit<T, TEdit> = BaseEdit<T, any>> {\n\tconstructor(\n\t\tpublic readonly replacements: readonly T[],\n\t) {\n\t\tlet lastEndEx = -1;\n\t\tfor (const replacement of replacements) {\n\t\t\tif (!(replacement.replaceRange.start >= lastEndEx)) {\n\t\t\t\tthrow new BugIndicatingError(`Edits must be disjoint and sorted. Found ${replacement} after ${lastEndEx}`);\n\t\t\t}\n\t\t\tlastEndEx = replacement.replaceRange.endExclusive;\n\t\t}\n\t}\n\n\tprotected abstract _createNew(replacements: readonly T[]): TEdit;\n\n\tpublic toString() {\n\t\tconst edits = this.replacements.map(e => e.toString()).join(', ');\n\t\treturn `[${edits}]`;\n\t}\n\n\t/**\n\t * Normalizes the edit by removing empty replacements and joining touching replacements (if the replacements allow joining).\n\t * Two edits have an equal normalized edit if and only if they have the same effect on any input.\n\t *\n\t * ![](https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/src/vs/editor/common/core/edits/docs/BaseEdit_normalize.drawio.png)\n\t *\n\t * Invariant:\n\t * ```\n\t * (forall base: TEdit.apply(base).equals(other.apply(base))) <-> this.normalize().equals(other.normalize())\n\t * ```\n\t * and\n\t * ```\n\t * forall base: TEdit.apply(base).equals(this.normalize().apply(base))\n\t * ```\n\t *\n\t */\n\tpublic normalize(): TEdit {\n\t\tconst newReplacements: T[] = [];\n\t\tlet lastReplacement: T | undefined;\n\t\tfor (const r of this.replacements) {\n\t\t\tif (r.getNewLength() === 0 && r.replaceRange.length === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (lastReplacement && lastReplacement.replaceRange.endExclusive === r.replaceRange.start) {\n\t\t\t\tconst joined = lastReplacement.tryJoinTouching(r);\n\t\t\t\tif (joined) {\n\t\t\t\t\tlastReplacement = joined;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (lastReplacement) {\n\t\t\t\tnewReplacements.push(lastReplacement);\n\t\t\t}\n\t\t\tlastReplacement = r;\n\t\t}\n\n\t\tif (lastReplacement) {\n\t\t\tnewReplacements.push(lastReplacement);\n\t\t}\n\t\treturn this._createNew(newReplacements);\n\t}\n\n\t/**\n\t * Combines two edits into one with the same effect.\n\t *\n\t * ![](https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/src/vs/editor/common/core/edits/docs/BaseEdit_compose.drawio.png)\n\t *\n\t * Invariant:\n\t * ```\n\t * other.apply(this.apply(s0)) = this.compose(other).apply(s0)\n\t * ```\n\t */\n\tpublic compose(other: TEdit): TEdit {\n\t\tconst edits1 = this.normalize();\n\t\tconst edits2 = other.normalize();\n\n\t\tif (edits1.isEmpty()) { return edits2; }\n\t\tif (edits2.isEmpty()) { return edits1; }\n\n\t\tconst edit1Queue = [...edits1.replacements];\n\t\tconst result: T[] = [];\n\n\t\tlet edit1ToEdit2 = 0;\n\n\t\tfor (const r2 of edits2.replacements) {\n\t\t\t// Copy over edit1 unmodified until it touches edit2.\n\t\t\twhile (true) {\n\t\t\t\tconst r1 = edit1Queue[0];\n\t\t\t\tif (!r1 || r1.replaceRange.start + edit1ToEdit2 + r1.getNewLength() >= r2.replaceRange.start) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tedit1Queue.shift();\n\n\t\t\t\tresult.push(r1);\n\t\t\t\tedit1ToEdit2 += r1.getNewLength() - r1.replaceRange.length;\n\t\t\t}\n\n\t\t\tconst firstEdit1ToEdit2 = edit1ToEdit2;\n\t\t\tlet firstIntersecting: T | undefined; // or touching\n\t\t\tlet lastIntersecting: T | undefined; // or touching\n\n\t\t\twhile (true) {\n\t\t\t\tconst r1 = edit1Queue[0];\n\t\t\t\tif (!r1 || r1.replaceRange.start + edit1ToEdit2 > r2.replaceRange.endExclusive) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// else we intersect, because the new end of edit1 is after or equal to our start\n\n\t\t\t\tif (!firstIntersecting) {\n\t\t\t\t\tfirstIntersecting = r1;\n\t\t\t\t}\n\t\t\t\tlastIntersecting = r1;\n\t\t\t\tedit1Queue.shift();\n\n\t\t\t\tedit1ToEdit2 += r1.getNewLength() - r1.replaceRange.length;\n\t\t\t}\n\n\t\t\tif (!firstIntersecting) {\n\t\t\t\tresult.push(r2.delta(-edit1ToEdit2));\n\t\t\t} else {\n\t\t\t\tconst newReplaceRangeStart = Math.min(firstIntersecting.replaceRange.start, r2.replaceRange.start - firstEdit1ToEdit2);\n\n\t\t\t\tconst prefixLength = r2.replaceRange.start - (firstIntersecting.replaceRange.start + firstEdit1ToEdit2);\n\t\t\t\tif (prefixLength > 0) {\n\t\t\t\t\tconst prefix = firstIntersecting.slice(OffsetRange.emptyAt(newReplaceRangeStart), new OffsetRange(0, prefixLength));\n\t\t\t\t\tresult.push(prefix);\n\t\t\t\t}\n\t\t\t\tif (!lastIntersecting) {\n\t\t\t\t\tthrow new BugIndicatingError(`Invariant violation: lastIntersecting is undefined`);\n\t\t\t\t}\n\t\t\t\tconst suffixLength = (lastIntersecting.replaceRange.endExclusive + edit1ToEdit2) - r2.replaceRange.endExclusive;\n\t\t\t\tif (suffixLength > 0) {\n\t\t\t\t\tconst e = lastIntersecting.slice(\n\t\t\t\t\t\tOffsetRange.ofStartAndLength(lastIntersecting.replaceRange.endExclusive, 0),\n\t\t\t\t\t\tnew OffsetRange(lastIntersecting.getNewLength() - suffixLength, lastIntersecting.getNewLength())\n\t\t\t\t\t);\n\t\t\t\t\tedit1Queue.unshift(e);\n\t\t\t\t\tedit1ToEdit2 -= e.getNewLength() - e.replaceRange.length;\n\t\t\t\t}\n\n\t\t\t\tconst newReplaceRange = new OffsetRange(\n\t\t\t\t\tnewReplaceRangeStart,\n\t\t\t\t\tr2.replaceRange.endExclusive - edit1ToEdit2\n\t\t\t\t);\n\t\t\t\tconst middle = r2.slice(newReplaceRange, new OffsetRange(0, r2.getNewLength()));\n\t\t\t\tresult.push(middle);\n\t\t\t}\n\t\t}\n\n\t\twhile (true) {\n\t\t\tconst item = edit1Queue.shift();\n\t\t\tif (!item) { break; }\n\t\t\tresult.push(item);\n\t\t}\n\n\t\treturn this._createNew(result).normalize();\n\t}\n\n\t/**\n\t * Returns the range of each replacement in the applied value.\n\t*/\n\tpublic getNewRanges(): OffsetRange[] {\n\t\tconst ranges: OffsetRange[] = [];\n\t\tlet offset = 0;\n\t\tfor (const e of this.replacements) {\n\t\t\tranges.push(OffsetRange.ofStartAndLength(e.replaceRange.start + offset, e.getNewLength()));\n\t\t\toffset += e.getLengthDelta();\n\t\t}\n\t\treturn ranges;\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn this.replacements.length === 0;\n\t}\n}\n\nexport abstract class BaseReplacement<TSelf extends BaseReplacement<TSelf>> {\n\tconstructor(\n\t\t/**\n\t\t * The range to be replaced.\n\t\t*/\n\t\tpublic readonly replaceRange: OffsetRange,\n\t) { }\n\n\tpublic abstract getNewLength(): number;\n\n\t/**\n\t * Precondition: TEdit.range.endExclusive === other.range.start\n\t*/\n\tpublic abstract tryJoinTouching(other: TSelf): TSelf | undefined;\n\n\tpublic abstract slice(newReplaceRange: OffsetRange, rangeInReplacement?: OffsetRange): TSelf;\n\n\tpublic delta(offset: number): TSelf {\n\t\treturn this.slice(this.replaceRange.delta(offset), new OffsetRange(0, this.getNewLength()));\n\t}\n\n\tpublic getLengthDelta(): number {\n\t\treturn this.getNewLength() - this.replaceRange.length;\n\t}\n\n\tabstract equals(other: TSelf): boolean;\n\n\ttoString(): string {\n\t\treturn `{ ${this.replaceRange.toString()} -> ${this.getNewLength()} }`;\n\t}\n\n\tget isEmpty() {\n\t\treturn this.getNewLength() === 0 && this.replaceRange.length === 0;\n\t}\n\n\tgetRangeAfterReplace(): OffsetRange {\n\t\treturn new OffsetRange(this.replaceRange.start, this.replaceRange.start + this.getNewLength());\n\t}\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/edits/edit.ts","vs/editor/common/core/edits/edit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,8DAA8D;AAC9D,MAAM,OAAgB,QAAQ;IAC7B,YACiB,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;QAE1C,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC;QACnB,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;YACxC,IAAI,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,KAAK,IAAI,SAAS,CAAC,EAAE,CAAC;gBACpD,MAAM,IAAI,kBAAkB,CAAC,4CAA4C,WAAW,UAAU,SAAS,EAAE,CAAC,CAAC;YAC5G,CAAC;YACD,SAAS,GAAG,WAAW,CAAC,YAAY,CAAC,YAAY,CAAC;QACnD,CAAC;IACF,CAAC;IAIM,QAAQ;QACd,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClE,OAAO,IAAI,KAAK,GAAG,CAAC;IACrB,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACI,SAAS;QACf,MAAM,eAAe,GAAQ,EAAE,CAAC;QAChC,IAAI,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:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { OffsetRange } from '../ranges/offsetRange.js';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport abstract class BaseEdit<T extends BaseReplacement<T> = BaseReplacement<any>, TEdit extends BaseEdit<T, TEdit> = BaseEdit<T, any>> {\n\tconstructor(\n\t\tpublic readonly replacements: readonly T[],\n\t) {\n\t\tlet lastEndEx = -1;\n\t\tfor (const replacement of replacements) {\n\t\t\tif (!(replacement.replaceRange.start >= lastEndEx)) {\n\t\t\t\tthrow new BugIndicatingError(`Edits must be disjoint and sorted. Found ${replacement} after ${lastEndEx}`);\n\t\t\t}\n\t\t\tlastEndEx = replacement.replaceRange.endExclusive;\n\t\t}\n\t}\n\n\tprotected abstract _createNew(replacements: readonly T[]): TEdit;\n\n\tpublic toString() {\n\t\tconst edits = this.replacements.map(e => e.toString()).join(', ');\n\t\treturn `[${edits}]`;\n\t}\n\n\t/**\n\t * Normalizes the edit by removing empty replacements and joining touching replacements (if the replacements allow joining).\n\t * Two edits have an equal normalized edit if and only if they have the same effect on any input.\n\t *\n\t * ![](https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/src/vs/editor/common/core/edits/docs/BaseEdit_normalize.drawio.png)\n\t *\n\t * Invariant:\n\t * ```\n\t * (forall base: TEdit.apply(base).equals(other.apply(base))) <-> this.normalize().equals(other.normalize())\n\t * ```\n\t * and\n\t * ```\n\t * forall base: TEdit.apply(base).equals(this.normalize().apply(base))\n\t * ```\n\t *\n\t */\n\tpublic normalize(): TEdit {\n\t\tconst newReplacements: T[] = [];\n\t\tlet lastReplacement: T | undefined;\n\t\tfor (const r of this.replacements) {\n\t\t\tif (r.getNewLength() === 0 && r.replaceRange.length === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (lastReplacement && lastReplacement.replaceRange.endExclusive === r.replaceRange.start) {\n\t\t\t\tconst joined = lastReplacement.tryJoinTouching(r);\n\t\t\t\tif (joined) {\n\t\t\t\t\tlastReplacement = joined;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (lastReplacement) {\n\t\t\t\tnewReplacements.push(lastReplacement);\n\t\t\t}\n\t\t\tlastReplacement = r;\n\t\t}\n\n\t\tif (lastReplacement) {\n\t\t\tnewReplacements.push(lastReplacement);\n\t\t}\n\t\treturn this._createNew(newReplacements);\n\t}\n\n\t/**\n\t * Combines two edits into one with the same effect.\n\t *\n\t * ![](https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/src/vs/editor/common/core/edits/docs/BaseEdit_compose.drawio.png)\n\t *\n\t * Invariant:\n\t * ```\n\t * other.apply(this.apply(s0)) = this.compose(other).apply(s0)\n\t * ```\n\t */\n\tpublic compose(other: TEdit): TEdit {\n\t\tconst edits1 = this.normalize();\n\t\tconst edits2 = other.normalize();\n\n\t\tif (edits1.isEmpty()) { return edits2; }\n\t\tif (edits2.isEmpty()) { return edits1; }\n\n\t\tconst edit1Queue = [...edits1.replacements];\n\t\tconst result: T[] = [];\n\n\t\tlet edit1ToEdit2 = 0;\n\n\t\tfor (const r2 of edits2.replacements) {\n\t\t\t// Copy over edit1 unmodified until it touches edit2.\n\t\t\twhile (true) {\n\t\t\t\tconst r1 = edit1Queue[0];\n\t\t\t\tif (!r1 || r1.replaceRange.start + edit1ToEdit2 + r1.getNewLength() >= r2.replaceRange.start) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tedit1Queue.shift();\n\n\t\t\t\tresult.push(r1);\n\t\t\t\tedit1ToEdit2 += r1.getNewLength() - r1.replaceRange.length;\n\t\t\t}\n\n\t\t\tconst firstEdit1ToEdit2 = edit1ToEdit2;\n\t\t\tlet firstIntersecting: T | undefined; // or touching\n\t\t\tlet lastIntersecting: T | undefined; // or touching\n\n\t\t\twhile (true) {\n\t\t\t\tconst r1 = edit1Queue[0];\n\t\t\t\tif (!r1 || r1.replaceRange.start + edit1ToEdit2 > r2.replaceRange.endExclusive) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// else we intersect, because the new end of edit1 is after or equal to our start\n\n\t\t\t\tif (!firstIntersecting) {\n\t\t\t\t\tfirstIntersecting = r1;\n\t\t\t\t}\n\t\t\t\tlastIntersecting = r1;\n\t\t\t\tedit1Queue.shift();\n\n\t\t\t\tedit1ToEdit2 += r1.getNewLength() - r1.replaceRange.length;\n\t\t\t}\n\n\t\t\tif (!firstIntersecting) {\n\t\t\t\tresult.push(r2.delta(-edit1ToEdit2));\n\t\t\t} else {\n\t\t\t\tconst newReplaceRangeStart = Math.min(firstIntersecting.replaceRange.start, r2.replaceRange.start - firstEdit1ToEdit2);\n\n\t\t\t\tconst prefixLength = r2.replaceRange.start - (firstIntersecting.replaceRange.start + firstEdit1ToEdit2);\n\t\t\t\tif (prefixLength > 0) {\n\t\t\t\t\tconst prefix = firstIntersecting.slice(OffsetRange.emptyAt(newReplaceRangeStart), new OffsetRange(0, prefixLength));\n\t\t\t\t\tresult.push(prefix);\n\t\t\t\t}\n\t\t\t\tif (!lastIntersecting) {\n\t\t\t\t\tthrow new BugIndicatingError(`Invariant violation: lastIntersecting is undefined`);\n\t\t\t\t}\n\t\t\t\tconst suffixLength = (lastIntersecting.replaceRange.endExclusive + edit1ToEdit2) - r2.replaceRange.endExclusive;\n\t\t\t\tif (suffixLength > 0) {\n\t\t\t\t\tconst e = lastIntersecting.slice(\n\t\t\t\t\t\tOffsetRange.ofStartAndLength(lastIntersecting.replaceRange.endExclusive, 0),\n\t\t\t\t\t\tnew OffsetRange(lastIntersecting.getNewLength() - suffixLength, lastIntersecting.getNewLength())\n\t\t\t\t\t);\n\t\t\t\t\tedit1Queue.unshift(e);\n\t\t\t\t\tedit1ToEdit2 -= e.getNewLength() - e.replaceRange.length;\n\t\t\t\t}\n\n\t\t\t\tconst newReplaceRange = new OffsetRange(\n\t\t\t\t\tnewReplaceRangeStart,\n\t\t\t\t\tr2.replaceRange.endExclusive - edit1ToEdit2\n\t\t\t\t);\n\t\t\t\tconst middle = r2.slice(newReplaceRange, new OffsetRange(0, r2.getNewLength()));\n\t\t\t\tresult.push(middle);\n\t\t\t}\n\t\t}\n\n\t\twhile (true) {\n\t\t\tconst item = edit1Queue.shift();\n\t\t\tif (!item) { break; }\n\t\t\tresult.push(item);\n\t\t}\n\n\t\treturn this._createNew(result).normalize();\n\t}\n\n\t/**\n\t * Returns the range of each replacement in the applied value.\n\t*/\n\tpublic getNewRanges(): OffsetRange[] {\n\t\tconst ranges: OffsetRange[] = [];\n\t\tlet offset = 0;\n\t\tfor (const e of this.replacements) {\n\t\t\tranges.push(OffsetRange.ofStartAndLength(e.replaceRange.start + offset, e.getNewLength()));\n\t\t\toffset += e.getLengthDelta();\n\t\t}\n\t\treturn ranges;\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn this.replacements.length === 0;\n\t}\n\n\t/**\n\t * Return undefined if the originalOffset is within an edit\n\t */\n\tpublic applyToOffsetOrUndefined(originalOffset: number): number | undefined {\n\t\tlet accumulatedDelta = 0;\n\t\tfor (const edit of this.replacements) {\n\t\t\tif (edit.replaceRange.start <= originalOffset) {\n\t\t\t\tif (originalOffset < edit.replaceRange.endExclusive) {\n\t\t\t\t\t// the offset is in the replaced range\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\taccumulatedDelta += edit.getNewLength() - edit.replaceRange.length;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn originalOffset + accumulatedDelta;\n\t}\n}\n\nexport abstract class BaseReplacement<TSelf extends BaseReplacement<TSelf>> {\n\tconstructor(\n\t\t/**\n\t\t * The range to be replaced.\n\t\t*/\n\t\tpublic readonly replaceRange: OffsetRange,\n\t) { }\n\n\tpublic abstract getNewLength(): number;\n\n\t/**\n\t * Precondition: TEdit.range.endExclusive === other.range.start\n\t*/\n\tpublic abstract tryJoinTouching(other: TSelf): TSelf | undefined;\n\n\tpublic abstract slice(newReplaceRange: OffsetRange, rangeInReplacement?: OffsetRange): TSelf;\n\n\tpublic delta(offset: number): TSelf {\n\t\treturn this.slice(this.replaceRange.delta(offset), new OffsetRange(0, this.getNewLength()));\n\t}\n\n\tpublic getLengthDelta(): number {\n\t\treturn this.getNewLength() - this.replaceRange.length;\n\t}\n\n\tabstract equals(other: TSelf): boolean;\n\n\ttoString(): string {\n\t\treturn `{ ${this.replaceRange.toString()} -> ${this.getNewLength()} }`;\n\t}\n\n\tget isEmpty() {\n\t\treturn this.getNewLength() === 0 && this.replaceRange.length === 0;\n\t}\n\n\tgetRangeAfterReplace(): OffsetRange {\n\t\treturn new OffsetRange(this.replaceRange.start, this.replaceRange.start + this.getNewLength());\n\t}\n}\n","\nimport { BugIndicatingError } from '../../../../base/common/errors.js';\nimport { OffsetRange } from '../ranges/offsetRange.js';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport abstract class BaseEdit<T extends BaseReplacement<T> = BaseReplacement<any>, TEdit extends BaseEdit<T, TEdit> = BaseEdit<T, any>> {\n\tconstructor(\n\t\tpublic readonly replacements: readonly T[],\n\t) {\n\t\tlet lastEndEx = -1;\n\t\tfor (const replacement of replacements) {\n\t\t\tif (!(replacement.replaceRange.start >= lastEndEx)) {\n\t\t\t\tthrow new BugIndicatingError(`Edits must be disjoint and sorted. Found ${replacement} after ${lastEndEx}`);\n\t\t\t}\n\t\t\tlastEndEx = replacement.replaceRange.endExclusive;\n\t\t}\n\t}\n\n\tprotected abstract _createNew(replacements: readonly T[]): TEdit;\n\n\tpublic toString() {\n\t\tconst edits = this.replacements.map(e => e.toString()).join(', ');\n\t\treturn `[${edits}]`;\n\t}\n\n\t/**\n\t * Normalizes the edit by removing empty replacements and joining touching replacements (if the replacements allow joining).\n\t * Two edits have an equal normalized edit if and only if they have the same effect on any input.\n\t *\n\t * ![](https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/src/vs/editor/common/core/edits/docs/BaseEdit_normalize.drawio.png)\n\t *\n\t * Invariant:\n\t * ```\n\t * (forall base: TEdit.apply(base).equals(other.apply(base))) <-> this.normalize().equals(other.normalize())\n\t * ```\n\t * and\n\t * ```\n\t * forall base: TEdit.apply(base).equals(this.normalize().apply(base))\n\t * ```\n\t *\n\t */\n\tpublic normalize(): TEdit {\n\t\tconst newReplacements: T[] = [];\n\t\tlet lastReplacement: T | undefined;\n\t\tfor (const r of this.replacements) {\n\t\t\tif (r.getNewLength() === 0 && r.replaceRange.length === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (lastReplacement && lastReplacement.replaceRange.endExclusive === r.replaceRange.start) {\n\t\t\t\tconst joined = lastReplacement.tryJoinTouching(r);\n\t\t\t\tif (joined) {\n\t\t\t\t\tlastReplacement = joined;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (lastReplacement) {\n\t\t\t\tnewReplacements.push(lastReplacement);\n\t\t\t}\n\t\t\tlastReplacement = r;\n\t\t}\n\n\t\tif (lastReplacement) {\n\t\t\tnewReplacements.push(lastReplacement);\n\t\t}\n\t\treturn this._createNew(newReplacements);\n\t}\n\n\t/**\n\t * Combines two edits into one with the same effect.\n\t *\n\t * ![](https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/src/vs/editor/common/core/edits/docs/BaseEdit_compose.drawio.png)\n\t *\n\t * Invariant:\n\t * ```\n\t * other.apply(this.apply(s0)) = this.compose(other).apply(s0)\n\t * ```\n\t */\n\tpublic compose(other: TEdit): TEdit {\n\t\tconst edits1 = this.normalize();\n\t\tconst edits2 = other.normalize();\n\n\t\tif (edits1.isEmpty()) { return edits2; }\n\t\tif (edits2.isEmpty()) { return edits1; }\n\n\t\tconst edit1Queue = [...edits1.replacements];\n\t\tconst result: T[] = [];\n\n\t\tlet edit1ToEdit2 = 0;\n\n\t\tfor (const r2 of edits2.replacements) {\n\t\t\t// Copy over edit1 unmodified until it touches edit2.\n\t\t\twhile (true) {\n\t\t\t\tconst r1 = edit1Queue[0];\n\t\t\t\tif (!r1 || r1.replaceRange.start + edit1ToEdit2 + r1.getNewLength() >= r2.replaceRange.start) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tedit1Queue.shift();\n\n\t\t\t\tresult.push(r1);\n\t\t\t\tedit1ToEdit2 += r1.getNewLength() - r1.replaceRange.length;\n\t\t\t}\n\n\t\t\tconst firstEdit1ToEdit2 = edit1ToEdit2;\n\t\t\tlet firstIntersecting: T | undefined; // or touching\n\t\t\tlet lastIntersecting: T | undefined; // or touching\n\n\t\t\twhile (true) {\n\t\t\t\tconst r1 = edit1Queue[0];\n\t\t\t\tif (!r1 || r1.replaceRange.start + edit1ToEdit2 > r2.replaceRange.endExclusive) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// else we intersect, because the new end of edit1 is after or equal to our start\n\n\t\t\t\tif (!firstIntersecting) {\n\t\t\t\t\tfirstIntersecting = r1;\n\t\t\t\t}\n\t\t\t\tlastIntersecting = r1;\n\t\t\t\tedit1Queue.shift();\n\n\t\t\t\tedit1ToEdit2 += r1.getNewLength() - r1.replaceRange.length;\n\t\t\t}\n\n\t\t\tif (!firstIntersecting) {\n\t\t\t\tresult.push(r2.delta(-edit1ToEdit2));\n\t\t\t} else {\n\t\t\t\tconst newReplaceRangeStart = Math.min(firstIntersecting.replaceRange.start, r2.replaceRange.start - firstEdit1ToEdit2);\n\n\t\t\t\tconst prefixLength = r2.replaceRange.start - (firstIntersecting.replaceRange.start + firstEdit1ToEdit2);\n\t\t\t\tif (prefixLength > 0) {\n\t\t\t\t\tconst prefix = firstIntersecting.slice(OffsetRange.emptyAt(newReplaceRangeStart), new OffsetRange(0, prefixLength));\n\t\t\t\t\tresult.push(prefix);\n\t\t\t\t}\n\t\t\t\tif (!lastIntersecting) {\n\t\t\t\t\tthrow new BugIndicatingError(`Invariant violation: lastIntersecting is undefined`);\n\t\t\t\t}\n\t\t\t\tconst suffixLength = (lastIntersecting.replaceRange.endExclusive + edit1ToEdit2) - r2.replaceRange.endExclusive;\n\t\t\t\tif (suffixLength > 0) {\n\t\t\t\t\tconst e = lastIntersecting.slice(\n\t\t\t\t\t\tOffsetRange.ofStartAndLength(lastIntersecting.replaceRange.endExclusive, 0),\n\t\t\t\t\t\tnew OffsetRange(lastIntersecting.getNewLength() - suffixLength, lastIntersecting.getNewLength())\n\t\t\t\t\t);\n\t\t\t\t\tedit1Queue.unshift(e);\n\t\t\t\t\tedit1ToEdit2 -= e.getNewLength() - e.replaceRange.length;\n\t\t\t\t}\n\n\t\t\t\tconst newReplaceRange = new OffsetRange(\n\t\t\t\t\tnewReplaceRangeStart,\n\t\t\t\t\tr2.replaceRange.endExclusive - edit1ToEdit2\n\t\t\t\t);\n\t\t\t\tconst middle = r2.slice(newReplaceRange, new OffsetRange(0, r2.getNewLength()));\n\t\t\t\tresult.push(middle);\n\t\t\t}\n\t\t}\n\n\t\twhile (true) {\n\t\t\tconst item = edit1Queue.shift();\n\t\t\tif (!item) { break; }\n\t\t\tresult.push(item);\n\t\t}\n\n\t\treturn this._createNew(result).normalize();\n\t}\n\n\t/**\n\t * Returns the range of each replacement in the applied value.\n\t*/\n\tpublic getNewRanges(): OffsetRange[] {\n\t\tconst ranges: OffsetRange[] = [];\n\t\tlet offset = 0;\n\t\tfor (const e of this.replacements) {\n\t\t\tranges.push(OffsetRange.ofStartAndLength(e.replaceRange.start + offset, e.getNewLength()));\n\t\t\toffset += e.getLengthDelta();\n\t\t}\n\t\treturn ranges;\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn this.replacements.length === 0;\n\t}\n\n\t/**\n\t * Return undefined if the originalOffset is within an edit\n\t */\n\tpublic applyToOffsetOrUndefined(originalOffset: number): number | undefined {\n\t\tlet accumulatedDelta = 0;\n\t\tfor (const edit of this.replacements) {\n\t\t\tif (edit.replaceRange.start <= originalOffset) {\n\t\t\t\tif (originalOffset < edit.replaceRange.endExclusive) {\n\t\t\t\t\t// the offset is in the replaced range\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\taccumulatedDelta += edit.getNewLength() - edit.replaceRange.length;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn originalOffset + accumulatedDelta;\n\t}\n}\n\nexport abstract class BaseReplacement<TSelf extends BaseReplacement<TSelf>> {\n\tconstructor(\n\t\t/**\n\t\t * The range to be replaced.\n\t\t*/\n\t\tpublic readonly replaceRange: OffsetRange,\n\t) { }\n\n\tpublic abstract getNewLength(): number;\n\n\t/**\n\t * Precondition: TEdit.range.endExclusive === other.range.start\n\t*/\n\tpublic abstract tryJoinTouching(other: TSelf): TSelf | undefined;\n\n\tpublic abstract slice(newReplaceRange: OffsetRange, rangeInReplacement?: OffsetRange): TSelf;\n\n\tpublic delta(offset: number): TSelf {\n\t\treturn this.slice(this.replaceRange.delta(offset), new OffsetRange(0, this.getNewLength()));\n\t}\n\n\tpublic getLengthDelta(): number {\n\t\treturn this.getNewLength() - this.replaceRange.length;\n\t}\n\n\tabstract equals(other: TSelf): boolean;\n\n\ttoString(): string {\n\t\treturn `{ ${this.replaceRange.toString()} -> ${this.getNewLength()} }`;\n\t}\n\n\tget isEmpty() {\n\t\treturn this.getNewLength() === 0 && this.replaceRange.length === 0;\n\t}\n\n\tgetRangeAfterReplace(): OffsetRange {\n\t\treturn new OffsetRange(this.replaceRange.start, this.replaceRange.start + this.getNewLength());\n\t}\n}\n"]}
@@ -18,6 +18,16 @@ export class BaseStringEdit extends BaseEdit {
18
18
  resultText.push(base.substring(pos));
19
19
  return resultText.join('');
20
20
  }
21
+ removeCommonSuffixPrefix(originalText) {
22
+ const edits = [];
23
+ for (const e of this.replacements) {
24
+ const edit = e.removeCommonSuffixPrefix(originalText);
25
+ if (!edit.isEmpty) {
26
+ edits.push(edit);
27
+ }
28
+ }
29
+ return new StringEdit(edits);
30
+ }
21
31
  }
22
32
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
33
  export class BaseStringReplacement extends BaseReplacement {
@@ -73,6 +83,9 @@ export class BaseStringReplacement extends BaseReplacement {
73
83
  */
74
84
  export class StringEdit extends BaseStringEdit {
75
85
  static { this.empty = new StringEdit([]); }
86
+ static replace(range, replacement) {
87
+ return new StringEdit([new StringReplacement(range, replacement)]);
88
+ }
76
89
  static compose(edits) {
77
90
  if (edits.length === 0) {
78
91
  return StringEdit.empty;
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/edits/stringEdit.ts","vs/editor/common/core/edits/stringEdit.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAGtD,8DAA8D;AAC9D,MAAM,OAAgB,cAAmJ,SAAQ,QAAkB;IAE3L,KAAK,CAAC,IAAY;QACxB,MAAM,UAAU,GAAa,EAAE,CAAC;QAChC,IAAI,GAAG,GAAG,CAAC,CAAC;QACZ,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;YAC9D,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC9B,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC;QACtC,CAAC;QACD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACrC,OAAO,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5B,CAAC;CACD;AAED,8DAA8D;AAC9D,MAAM,OAAgB,qBAAuF,SAAQ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,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC;IACpD,CAAC;IAED,OAAO,IAAI,EAAE,CAAC;QACb,MAAM,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,CAAC,CAAC,EAAE,CAAC;YACR,MAAM;QACP,CAAC;QACD,YAAY,CAAC,KAAK,EAAE,CAAC;QACrB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC","file":"stringEdit.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 { commonPrefixLength, commonSuffixLength } from '../../../../base/common/strings.js';\nimport { OffsetRange } from '../ranges/offsetRange.js';\nimport { BaseEdit, BaseReplacement } from './edit.js';\n\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport abstract class BaseStringEdit<T extends BaseStringReplacement<T> = BaseStringReplacement<any>, TEdit extends BaseStringEdit<T, TEdit> = BaseStringEdit<any, any>> extends BaseEdit<T, TEdit> {\n\n\tpublic apply(base: string): string {\n\t\tconst resultText: string[] = [];\n\t\tlet pos = 0;\n\t\tfor (const edit of this.replacements) {\n\t\t\tresultText.push(base.substring(pos, edit.replaceRange.start));\n\t\t\tresultText.push(edit.newText);\n\t\t\tpos = edit.replaceRange.endExclusive;\n\t\t}\n\t\tresultText.push(base.substring(pos));\n\t\treturn resultText.join('');\n\t}\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport abstract class BaseStringReplacement<T extends BaseStringReplacement<T> = BaseStringReplacement<any>> extends BaseReplacement<T> {\n\tconstructor(\n\t\trange: OffsetRange,\n\t\tpublic readonly newText: string\n\t) {\n\t\tsuper(range);\n\t}\n\n\tgetNewLength(): number { return this.newText.length; }\n\n\toverride toString(): string {\n\t\treturn `${this.replaceRange} -> ${JSON.stringify(this.newText)}`;\n\t}\n\n\treplace(str: string): string {\n\t\treturn str.substring(0, this.replaceRange.start) + this.newText + str.substring(this.replaceRange.endExclusive);\n\t}\n\n\tremoveCommonSuffixPrefix(originalText: string): StringReplacement {\n\t\tconst oldText = originalText.substring(this.replaceRange.start, this.replaceRange.endExclusive);\n\n\t\tconst prefixLen = commonPrefixLength(oldText, this.newText);\n\t\tconst suffixLen = Math.min(\n\t\t\toldText.length - prefixLen,\n\t\t\tthis.newText.length - prefixLen,\n\t\t\tcommonSuffixLength(oldText, this.newText)\n\t\t);\n\n\t\tconst replaceRange = new OffsetRange(\n\t\t\tthis.replaceRange.start + prefixLen,\n\t\t\tthis.replaceRange.endExclusive - suffixLen,\n\t\t);\n\t\tconst newText = this.newText.substring(prefixLen, this.newText.length - suffixLen);\n\n\t\treturn new StringReplacement(replaceRange, newText);\n\t}\n\n\tpublic removeCommonSuffixAndPrefix(source: string): T {\n\t\treturn this.removeCommonSuffix(source).removeCommonPrefix(source);\n\t}\n\n\tpublic removeCommonPrefix(source: string): T {\n\t\tconst oldText = this.replaceRange.substring(source);\n\n\t\tconst prefixLen = commonPrefixLength(oldText, this.newText);\n\t\tif (prefixLen === 0) {\n\t\t\treturn this as unknown as T;\n\t\t}\n\n\t\treturn this.slice(this.replaceRange.deltaStart(prefixLen), new OffsetRange(prefixLen, this.newText.length));\n\t}\n\n\tpublic removeCommonSuffix(source: string): T {\n\t\tconst oldText = this.replaceRange.substring(source);\n\n\t\tconst suffixLen = commonSuffixLength(oldText, this.newText);\n\t\tif (suffixLen === 0) {\n\t\t\treturn this as unknown as T;\n\t\t}\n\t\treturn this.slice(this.replaceRange.deltaEnd(-suffixLen), new OffsetRange(0, this.newText.length - suffixLen));\n\t}\n\n\tpublic toJson(): ISerializedStringReplacement {\n\t\treturn ({\n\t\t\ttxt: this.newText,\n\t\t\tpos: this.replaceRange.start,\n\t\t\tlen: this.replaceRange.length,\n\t\t});\n\t}\n}\n\n\n/**\n * Represents a set of replacements to a string.\n * All these replacements are applied at once.\n*/\nexport class StringEdit extends BaseStringEdit<StringReplacement, StringEdit> {\n\tpublic static readonly empty = new StringEdit([]);\n\n\tpublic static compose(edits: readonly StringEdit[]): StringEdit {\n\t\tif (edits.length === 0) {\n\t\t\treturn StringEdit.empty;\n\t\t}\n\t\tlet result = edits[0];\n\t\tfor (let i = 1; i < edits.length; i++) {\n\t\t\tresult = result.compose(edits[i]);\n\t\t}\n\t\treturn result;\n\t}\n\n\tconstructor(replacements: readonly StringReplacement[]) {\n\t\tsuper(replacements);\n\t}\n\n\tprotected override _createNew(replacements: readonly StringReplacement[]): StringEdit {\n\t\treturn new StringEdit(replacements);\n\t}\n}\n\n/**\n * Warning: Be careful when changing this type, as it is used for serialization!\n*/\nexport interface ISerializedStringReplacement {\n\ttxt: string;\n\tpos: number;\n\tlen: number;\n}\n\nexport class StringReplacement extends BaseStringReplacement<StringReplacement> {\n\tpublic static insert(offset: number, text: string): StringReplacement {\n\t\treturn new StringReplacement(OffsetRange.emptyAt(offset), text);\n\t}\n\n\tpublic static replace(range: OffsetRange, text: string): StringReplacement {\n\t\treturn new StringReplacement(range, text);\n\t}\n\n\toverride equals(other: StringReplacement): boolean {\n\t\treturn this.replaceRange.equals(other.replaceRange) && this.newText === other.newText;\n\t}\n\n\toverride tryJoinTouching(other: StringReplacement): StringReplacement | undefined {\n\t\treturn new StringReplacement(this.replaceRange.joinRightTouching(other.replaceRange), this.newText + other.newText);\n\t}\n\n\toverride slice(range: OffsetRange, rangeInReplacement?: OffsetRange): StringReplacement {\n\t\treturn new StringReplacement(range, rangeInReplacement ? rangeInReplacement.substring(this.newText) : this.newText);\n\t}\n}\n\nexport function applyEditsToRanges(sortedRanges: OffsetRange[], edit: StringEdit): OffsetRange[] {\n\tsortedRanges = sortedRanges.slice();\n\n\t// treat edits as deletion of the replace range and then as insertion that extends the first range\n\tconst result: OffsetRange[] = [];\n\n\tlet offset = 0;\n\n\tfor (const e of edit.replacements) {\n\t\twhile (true) {\n\t\t\t// ranges before the current edit\n\t\t\tconst r = sortedRanges[0];\n\t\t\tif (!r || r.endExclusive >= e.replaceRange.start) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsortedRanges.shift();\n\t\t\tresult.push(r.delta(offset));\n\t\t}\n\n\t\tconst intersecting: OffsetRange[] = [];\n\t\twhile (true) {\n\t\t\tconst r = sortedRanges[0];\n\t\t\tif (!r || !r.intersectsOrTouches(e.replaceRange)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsortedRanges.shift();\n\t\t\tintersecting.push(r);\n\t\t}\n\n\t\tfor (let i = intersecting.length - 1; i >= 0; i--) {\n\t\t\tlet r = intersecting[i];\n\n\t\t\tconst overlap = r.intersect(e.replaceRange)!.length;\n\t\t\tr = r.deltaEnd(-overlap + (i === 0 ? e.newText.length : 0));\n\n\t\t\tconst rangeAheadOfReplaceRange = r.start - e.replaceRange.start;\n\t\t\tif (rangeAheadOfReplaceRange > 0) {\n\t\t\t\tr = r.delta(-rangeAheadOfReplaceRange);\n\t\t\t}\n\n\t\t\tif (i !== 0) {\n\t\t\t\tr = r.delta(e.newText.length);\n\t\t\t}\n\n\t\t\t// We already took our offset into account.\n\t\t\t// Because we add r back to the queue (which then adds offset again),\n\t\t\t// we have to remove it here.\n\t\t\tr = r.delta(-(e.newText.length - e.replaceRange.length));\n\n\t\t\tsortedRanges.unshift(r);\n\t\t}\n\n\t\toffset += e.newText.length - e.replaceRange.length;\n\t}\n\n\twhile (true) {\n\t\tconst r = sortedRanges[0];\n\t\tif (!r) {\n\t\t\tbreak;\n\t\t}\n\t\tsortedRanges.shift();\n\t\tresult.push(r.delta(offset));\n\t}\n\n\treturn result;\n}\n\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { commonPrefixLength, commonSuffixLength } from '../../../../base/common/strings.js';\nimport { OffsetRange } from '../ranges/offsetRange.js';\nimport { BaseEdit, BaseReplacement } from './edit.js';\n\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport abstract class BaseStringEdit<T extends BaseStringReplacement<T> = BaseStringReplacement<any>, TEdit extends BaseStringEdit<T, TEdit> = BaseStringEdit<any, any>> extends BaseEdit<T, TEdit> {\n\n\tpublic apply(base: string): string {\n\t\tconst resultText: string[] = [];\n\t\tlet pos = 0;\n\t\tfor (const edit of this.replacements) {\n\t\t\tresultText.push(base.substring(pos, edit.replaceRange.start));\n\t\t\tresultText.push(edit.newText);\n\t\t\tpos = edit.replaceRange.endExclusive;\n\t\t}\n\t\tresultText.push(base.substring(pos));\n\t\treturn resultText.join('');\n\t}\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport abstract class BaseStringReplacement<T extends BaseStringReplacement<T> = BaseStringReplacement<any>> extends BaseReplacement<T> {\n\tconstructor(\n\t\trange: OffsetRange,\n\t\tpublic readonly newText: string\n\t) {\n\t\tsuper(range);\n\t}\n\n\tgetNewLength(): number { return this.newText.length; }\n\n\toverride toString(): string {\n\t\treturn `${this.replaceRange} -> ${JSON.stringify(this.newText)}`;\n\t}\n\n\treplace(str: string): string {\n\t\treturn str.substring(0, this.replaceRange.start) + this.newText + str.substring(this.replaceRange.endExclusive);\n\t}\n\n\tremoveCommonSuffixPrefix(originalText: string): StringReplacement {\n\t\tconst oldText = originalText.substring(this.replaceRange.start, this.replaceRange.endExclusive);\n\n\t\tconst prefixLen = commonPrefixLength(oldText, this.newText);\n\t\tconst suffixLen = Math.min(\n\t\t\toldText.length - prefixLen,\n\t\t\tthis.newText.length - prefixLen,\n\t\t\tcommonSuffixLength(oldText, this.newText)\n\t\t);\n\n\t\tconst replaceRange = new OffsetRange(\n\t\t\tthis.replaceRange.start + prefixLen,\n\t\t\tthis.replaceRange.endExclusive - suffixLen,\n\t\t);\n\t\tconst newText = this.newText.substring(prefixLen, this.newText.length - suffixLen);\n\n\t\treturn new StringReplacement(replaceRange, newText);\n\t}\n\n\tpublic removeCommonSuffixAndPrefix(source: string): T {\n\t\treturn this.removeCommonSuffix(source).removeCommonPrefix(source);\n\t}\n\n\tpublic removeCommonPrefix(source: string): T {\n\t\tconst oldText = this.replaceRange.substring(source);\n\n\t\tconst prefixLen = commonPrefixLength(oldText, this.newText);\n\t\tif (prefixLen === 0) {\n\t\t\treturn this as unknown as T;\n\t\t}\n\n\t\treturn this.slice(this.replaceRange.deltaStart(prefixLen), new OffsetRange(prefixLen, this.newText.length));\n\t}\n\n\tpublic removeCommonSuffix(source: string): T {\n\t\tconst oldText = this.replaceRange.substring(source);\n\n\t\tconst suffixLen = commonSuffixLength(oldText, this.newText);\n\t\tif (suffixLen === 0) {\n\t\t\treturn this as unknown as T;\n\t\t}\n\t\treturn this.slice(this.replaceRange.deltaEnd(-suffixLen), new OffsetRange(0, this.newText.length - suffixLen));\n\t}\n\n\tpublic toJson(): ISerializedStringReplacement {\n\t\treturn ({\n\t\t\ttxt: this.newText,\n\t\t\tpos: this.replaceRange.start,\n\t\t\tlen: this.replaceRange.length,\n\t\t});\n\t}\n}\n\n\n/**\n * Represents a set of replacements to a string.\n * All these replacements are applied at once.\n*/\nexport class StringEdit extends BaseStringEdit<StringReplacement, StringEdit> {\n\tpublic static readonly empty = new StringEdit([]);\n\n\tpublic static compose(edits: readonly StringEdit[]): StringEdit {\n\t\tif (edits.length === 0) {\n\t\t\treturn StringEdit.empty;\n\t\t}\n\t\tlet result = edits[0];\n\t\tfor (let i = 1; i < edits.length; i++) {\n\t\t\tresult = result.compose(edits[i]);\n\t\t}\n\t\treturn result;\n\t}\n\n\tconstructor(replacements: readonly StringReplacement[]) {\n\t\tsuper(replacements);\n\t}\n\n\tprotected override _createNew(replacements: readonly StringReplacement[]): StringEdit {\n\t\treturn new StringEdit(replacements);\n\t}\n}\n\n/**\n * Warning: Be careful when changing this type, as it is used for serialization!\n*/\nexport interface ISerializedStringReplacement {\n\ttxt: string;\n\tpos: number;\n\tlen: number;\n}\n\nexport class StringReplacement extends BaseStringReplacement<StringReplacement> {\n\tpublic static insert(offset: number, text: string): StringReplacement {\n\t\treturn new StringReplacement(OffsetRange.emptyAt(offset), text);\n\t}\n\n\tpublic static replace(range: OffsetRange, text: string): StringReplacement {\n\t\treturn new StringReplacement(range, text);\n\t}\n\n\toverride equals(other: StringReplacement): boolean {\n\t\treturn this.replaceRange.equals(other.replaceRange) && this.newText === other.newText;\n\t}\n\n\toverride tryJoinTouching(other: StringReplacement): StringReplacement | undefined {\n\t\treturn new StringReplacement(this.replaceRange.joinRightTouching(other.replaceRange), this.newText + other.newText);\n\t}\n\n\toverride slice(range: OffsetRange, rangeInReplacement?: OffsetRange): StringReplacement {\n\t\treturn new StringReplacement(range, rangeInReplacement ? rangeInReplacement.substring(this.newText) : this.newText);\n\t}\n}\n\nexport function applyEditsToRanges(sortedRanges: OffsetRange[], edit: StringEdit): OffsetRange[] {\n\tsortedRanges = sortedRanges.slice();\n\n\t// treat edits as deletion of the replace range and then as insertion that extends the first range\n\tconst result: OffsetRange[] = [];\n\n\tlet offset = 0;\n\n\tfor (const e of edit.replacements) {\n\t\twhile (true) {\n\t\t\t// ranges before the current edit\n\t\t\tconst r = sortedRanges[0];\n\t\t\tif (!r || r.endExclusive >= e.replaceRange.start) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsortedRanges.shift();\n\t\t\tresult.push(r.delta(offset));\n\t\t}\n\n\t\tconst intersecting: OffsetRange[] = [];\n\t\twhile (true) {\n\t\t\tconst r = sortedRanges[0];\n\t\t\tif (!r || !r.intersectsOrTouches(e.replaceRange)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsortedRanges.shift();\n\t\t\tintersecting.push(r);\n\t\t}\n\n\t\tfor (let i = intersecting.length - 1; i >= 0; i--) {\n\t\t\tlet r = intersecting[i];\n\n\t\t\tconst overlap = r.intersect(e.replaceRange)!.length;\n\t\t\tr = r.deltaEnd(-overlap + (i === 0 ? e.newText.length : 0));\n\n\t\t\tconst rangeAheadOfReplaceRange = r.start - e.replaceRange.start;\n\t\t\tif (rangeAheadOfReplaceRange > 0) {\n\t\t\t\tr = r.delta(-rangeAheadOfReplaceRange);\n\t\t\t}\n\n\t\t\tif (i !== 0) {\n\t\t\t\tr = r.delta(e.newText.length);\n\t\t\t}\n\n\t\t\t// We already took our offset into account.\n\t\t\t// Because we add r back to the queue (which then adds offset again),\n\t\t\t// we have to remove it here.\n\t\t\tr = r.delta(-(e.newText.length - e.replaceRange.length));\n\n\t\t\tsortedRanges.unshift(r);\n\t\t}\n\n\t\toffset += e.newText.length - e.replaceRange.length;\n\t}\n\n\twhile (true) {\n\t\tconst r = sortedRanges[0];\n\t\tif (!r) {\n\t\t\tbreak;\n\t\t}\n\t\tsortedRanges.shift();\n\t\tresult.push(r.delta(offset));\n\t}\n\n\treturn result;\n}\n\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/edits/stringEdit.ts","vs/editor/common/core/edits/stringEdit.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAGtD,8DAA8D;AAC9D,MAAM,OAAgB,cAAmJ,SAAQ,QAAkB;IAE3L,KAAK,CAAC,IAAY;QACxB,MAAM,UAAU,GAAa,EAAE,CAAC;QAChC,IAAI,GAAG,GAAG,CAAC,CAAC;QACZ,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,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AAC;AACf,CAAC","file":"stringEdit.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 { commonPrefixLength, commonSuffixLength } from '../../../../base/common/strings.js';\nimport { OffsetRange } from '../ranges/offsetRange.js';\nimport { BaseEdit, BaseReplacement } from './edit.js';\n\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport abstract class BaseStringEdit<T extends BaseStringReplacement<T> = BaseStringReplacement<any>, TEdit extends BaseStringEdit<T, TEdit> = BaseStringEdit<any, any>> extends BaseEdit<T, TEdit> {\n\n\tpublic apply(base: string): string {\n\t\tconst resultText: string[] = [];\n\t\tlet pos = 0;\n\t\tfor (const edit of this.replacements) {\n\t\t\tresultText.push(base.substring(pos, edit.replaceRange.start));\n\t\t\tresultText.push(edit.newText);\n\t\t\tpos = edit.replaceRange.endExclusive;\n\t\t}\n\t\tresultText.push(base.substring(pos));\n\t\treturn resultText.join('');\n\t}\n\n\tpublic removeCommonSuffixPrefix(originalText: string): StringEdit {\n\t\tconst edits: StringReplacement[] = [];\n\t\tfor (const e of this.replacements) {\n\t\t\tconst edit = e.removeCommonSuffixPrefix(originalText);\n\t\t\tif (!edit.isEmpty) {\n\t\t\t\tedits.push(edit);\n\t\t\t}\n\t\t}\n\t\treturn new StringEdit(edits);\n\t}\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport abstract class BaseStringReplacement<T extends BaseStringReplacement<T> = BaseStringReplacement<any>> extends BaseReplacement<T> {\n\tconstructor(\n\t\trange: OffsetRange,\n\t\tpublic readonly newText: string\n\t) {\n\t\tsuper(range);\n\t}\n\n\tgetNewLength(): number { return this.newText.length; }\n\n\toverride toString(): string {\n\t\treturn `${this.replaceRange} -> ${JSON.stringify(this.newText)}`;\n\t}\n\n\treplace(str: string): string {\n\t\treturn str.substring(0, this.replaceRange.start) + this.newText + str.substring(this.replaceRange.endExclusive);\n\t}\n\n\tremoveCommonSuffixPrefix(originalText: string): StringReplacement {\n\t\tconst oldText = originalText.substring(this.replaceRange.start, this.replaceRange.endExclusive);\n\n\t\tconst prefixLen = commonPrefixLength(oldText, this.newText);\n\t\tconst suffixLen = Math.min(\n\t\t\toldText.length - prefixLen,\n\t\t\tthis.newText.length - prefixLen,\n\t\t\tcommonSuffixLength(oldText, this.newText)\n\t\t);\n\n\t\tconst replaceRange = new OffsetRange(\n\t\t\tthis.replaceRange.start + prefixLen,\n\t\t\tthis.replaceRange.endExclusive - suffixLen,\n\t\t);\n\t\tconst newText = this.newText.substring(prefixLen, this.newText.length - suffixLen);\n\n\t\treturn new StringReplacement(replaceRange, newText);\n\t}\n\n\tpublic removeCommonSuffixAndPrefix(source: string): T {\n\t\treturn this.removeCommonSuffix(source).removeCommonPrefix(source);\n\t}\n\n\tpublic removeCommonPrefix(source: string): T {\n\t\tconst oldText = this.replaceRange.substring(source);\n\n\t\tconst prefixLen = commonPrefixLength(oldText, this.newText);\n\t\tif (prefixLen === 0) {\n\t\t\treturn this as unknown as T;\n\t\t}\n\n\t\treturn this.slice(this.replaceRange.deltaStart(prefixLen), new OffsetRange(prefixLen, this.newText.length));\n\t}\n\n\tpublic removeCommonSuffix(source: string): T {\n\t\tconst oldText = this.replaceRange.substring(source);\n\n\t\tconst suffixLen = commonSuffixLength(oldText, this.newText);\n\t\tif (suffixLen === 0) {\n\t\t\treturn this as unknown as T;\n\t\t}\n\t\treturn this.slice(this.replaceRange.deltaEnd(-suffixLen), new OffsetRange(0, this.newText.length - suffixLen));\n\t}\n\n\tpublic toJson(): ISerializedStringReplacement {\n\t\treturn ({\n\t\t\ttxt: this.newText,\n\t\t\tpos: this.replaceRange.start,\n\t\t\tlen: this.replaceRange.length,\n\t\t});\n\t}\n}\n\n\n/**\n * Represents a set of replacements to a string.\n * All these replacements are applied at once.\n*/\nexport class StringEdit extends BaseStringEdit<StringReplacement, StringEdit> {\n\tpublic static readonly empty = new StringEdit([]);\n\n\tpublic static replace(range: OffsetRange, replacement: string): StringEdit {\n\t\treturn new StringEdit([new StringReplacement(range, replacement)]);\n\t}\n\n\tpublic static compose(edits: readonly StringEdit[]): StringEdit {\n\t\tif (edits.length === 0) {\n\t\t\treturn StringEdit.empty;\n\t\t}\n\t\tlet result = edits[0];\n\t\tfor (let i = 1; i < edits.length; i++) {\n\t\t\tresult = result.compose(edits[i]);\n\t\t}\n\t\treturn result;\n\t}\n\n\tconstructor(replacements: readonly StringReplacement[]) {\n\t\tsuper(replacements);\n\t}\n\n\tprotected override _createNew(replacements: readonly StringReplacement[]): StringEdit {\n\t\treturn new StringEdit(replacements);\n\t}\n}\n\n/**\n * Warning: Be careful when changing this type, as it is used for serialization!\n*/\nexport interface ISerializedStringReplacement {\n\ttxt: string;\n\tpos: number;\n\tlen: number;\n}\n\nexport class StringReplacement extends BaseStringReplacement<StringReplacement> {\n\tpublic static insert(offset: number, text: string): StringReplacement {\n\t\treturn new StringReplacement(OffsetRange.emptyAt(offset), text);\n\t}\n\n\tpublic static replace(range: OffsetRange, text: string): StringReplacement {\n\t\treturn new StringReplacement(range, text);\n\t}\n\n\toverride equals(other: StringReplacement): boolean {\n\t\treturn this.replaceRange.equals(other.replaceRange) && this.newText === other.newText;\n\t}\n\n\toverride tryJoinTouching(other: StringReplacement): StringReplacement | undefined {\n\t\treturn new StringReplacement(this.replaceRange.joinRightTouching(other.replaceRange), this.newText + other.newText);\n\t}\n\n\toverride slice(range: OffsetRange, rangeInReplacement?: OffsetRange): StringReplacement {\n\t\treturn new StringReplacement(range, rangeInReplacement ? rangeInReplacement.substring(this.newText) : this.newText);\n\t}\n}\n\nexport function applyEditsToRanges(sortedRanges: OffsetRange[], edit: StringEdit): OffsetRange[] {\n\tsortedRanges = sortedRanges.slice();\n\n\t// treat edits as deletion of the replace range and then as insertion that extends the first range\n\tconst result: OffsetRange[] = [];\n\n\tlet offset = 0;\n\n\tfor (const e of edit.replacements) {\n\t\twhile (true) {\n\t\t\t// ranges before the current edit\n\t\t\tconst r = sortedRanges[0];\n\t\t\tif (!r || r.endExclusive >= e.replaceRange.start) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsortedRanges.shift();\n\t\t\tresult.push(r.delta(offset));\n\t\t}\n\n\t\tconst intersecting: OffsetRange[] = [];\n\t\twhile (true) {\n\t\t\tconst r = sortedRanges[0];\n\t\t\tif (!r || !r.intersectsOrTouches(e.replaceRange)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsortedRanges.shift();\n\t\t\tintersecting.push(r);\n\t\t}\n\n\t\tfor (let i = intersecting.length - 1; i >= 0; i--) {\n\t\t\tlet r = intersecting[i];\n\n\t\t\tconst overlap = r.intersect(e.replaceRange)!.length;\n\t\t\tr = r.deltaEnd(-overlap + (i === 0 ? e.newText.length : 0));\n\n\t\t\tconst rangeAheadOfReplaceRange = r.start - e.replaceRange.start;\n\t\t\tif (rangeAheadOfReplaceRange > 0) {\n\t\t\t\tr = r.delta(-rangeAheadOfReplaceRange);\n\t\t\t}\n\n\t\t\tif (i !== 0) {\n\t\t\t\tr = r.delta(e.newText.length);\n\t\t\t}\n\n\t\t\t// We already took our offset into account.\n\t\t\t// Because we add r back to the queue (which then adds offset again),\n\t\t\t// we have to remove it here.\n\t\t\tr = r.delta(-(e.newText.length - e.replaceRange.length));\n\n\t\t\tsortedRanges.unshift(r);\n\t\t}\n\n\t\toffset += e.newText.length - e.replaceRange.length;\n\t}\n\n\twhile (true) {\n\t\tconst r = sortedRanges[0];\n\t\tif (!r) {\n\t\t\tbreak;\n\t\t}\n\t\tsortedRanges.shift();\n\t\tresult.push(r.delta(offset));\n\t}\n\n\treturn result;\n}\n\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { commonPrefixLength, commonSuffixLength } from '../../../../base/common/strings.js';\nimport { OffsetRange } from '../ranges/offsetRange.js';\nimport { BaseEdit, BaseReplacement } from './edit.js';\n\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport abstract class BaseStringEdit<T extends BaseStringReplacement<T> = BaseStringReplacement<any>, TEdit extends BaseStringEdit<T, TEdit> = BaseStringEdit<any, any>> extends BaseEdit<T, TEdit> {\n\n\tpublic apply(base: string): string {\n\t\tconst resultText: string[] = [];\n\t\tlet pos = 0;\n\t\tfor (const edit of this.replacements) {\n\t\t\tresultText.push(base.substring(pos, edit.replaceRange.start));\n\t\t\tresultText.push(edit.newText);\n\t\t\tpos = edit.replaceRange.endExclusive;\n\t\t}\n\t\tresultText.push(base.substring(pos));\n\t\treturn resultText.join('');\n\t}\n\n\tpublic removeCommonSuffixPrefix(originalText: string): StringEdit {\n\t\tconst edits: StringReplacement[] = [];\n\t\tfor (const e of this.replacements) {\n\t\t\tconst edit = e.removeCommonSuffixPrefix(originalText);\n\t\t\tif (!edit.isEmpty) {\n\t\t\t\tedits.push(edit);\n\t\t\t}\n\t\t}\n\t\treturn new StringEdit(edits);\n\t}\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport abstract class BaseStringReplacement<T extends BaseStringReplacement<T> = BaseStringReplacement<any>> extends BaseReplacement<T> {\n\tconstructor(\n\t\trange: OffsetRange,\n\t\tpublic readonly newText: string\n\t) {\n\t\tsuper(range);\n\t}\n\n\tgetNewLength(): number { return this.newText.length; }\n\n\toverride toString(): string {\n\t\treturn `${this.replaceRange} -> ${JSON.stringify(this.newText)}`;\n\t}\n\n\treplace(str: string): string {\n\t\treturn str.substring(0, this.replaceRange.start) + this.newText + str.substring(this.replaceRange.endExclusive);\n\t}\n\n\tremoveCommonSuffixPrefix(originalText: string): StringReplacement {\n\t\tconst oldText = originalText.substring(this.replaceRange.start, this.replaceRange.endExclusive);\n\n\t\tconst prefixLen = commonPrefixLength(oldText, this.newText);\n\t\tconst suffixLen = Math.min(\n\t\t\toldText.length - prefixLen,\n\t\t\tthis.newText.length - prefixLen,\n\t\t\tcommonSuffixLength(oldText, this.newText)\n\t\t);\n\n\t\tconst replaceRange = new OffsetRange(\n\t\t\tthis.replaceRange.start + prefixLen,\n\t\t\tthis.replaceRange.endExclusive - suffixLen,\n\t\t);\n\t\tconst newText = this.newText.substring(prefixLen, this.newText.length - suffixLen);\n\n\t\treturn new StringReplacement(replaceRange, newText);\n\t}\n\n\tpublic removeCommonSuffixAndPrefix(source: string): T {\n\t\treturn this.removeCommonSuffix(source).removeCommonPrefix(source);\n\t}\n\n\tpublic removeCommonPrefix(source: string): T {\n\t\tconst oldText = this.replaceRange.substring(source);\n\n\t\tconst prefixLen = commonPrefixLength(oldText, this.newText);\n\t\tif (prefixLen === 0) {\n\t\t\treturn this as unknown as T;\n\t\t}\n\n\t\treturn this.slice(this.replaceRange.deltaStart(prefixLen), new OffsetRange(prefixLen, this.newText.length));\n\t}\n\n\tpublic removeCommonSuffix(source: string): T {\n\t\tconst oldText = this.replaceRange.substring(source);\n\n\t\tconst suffixLen = commonSuffixLength(oldText, this.newText);\n\t\tif (suffixLen === 0) {\n\t\t\treturn this as unknown as T;\n\t\t}\n\t\treturn this.slice(this.replaceRange.deltaEnd(-suffixLen), new OffsetRange(0, this.newText.length - suffixLen));\n\t}\n\n\tpublic toJson(): ISerializedStringReplacement {\n\t\treturn ({\n\t\t\ttxt: this.newText,\n\t\t\tpos: this.replaceRange.start,\n\t\t\tlen: this.replaceRange.length,\n\t\t});\n\t}\n}\n\n\n/**\n * Represents a set of replacements to a string.\n * All these replacements are applied at once.\n*/\nexport class StringEdit extends BaseStringEdit<StringReplacement, StringEdit> {\n\tpublic static readonly empty = new StringEdit([]);\n\n\tpublic static replace(range: OffsetRange, replacement: string): StringEdit {\n\t\treturn new StringEdit([new StringReplacement(range, replacement)]);\n\t}\n\n\tpublic static compose(edits: readonly StringEdit[]): StringEdit {\n\t\tif (edits.length === 0) {\n\t\t\treturn StringEdit.empty;\n\t\t}\n\t\tlet result = edits[0];\n\t\tfor (let i = 1; i < edits.length; i++) {\n\t\t\tresult = result.compose(edits[i]);\n\t\t}\n\t\treturn result;\n\t}\n\n\tconstructor(replacements: readonly StringReplacement[]) {\n\t\tsuper(replacements);\n\t}\n\n\tprotected override _createNew(replacements: readonly StringReplacement[]): StringEdit {\n\t\treturn new StringEdit(replacements);\n\t}\n}\n\n/**\n * Warning: Be careful when changing this type, as it is used for serialization!\n*/\nexport interface ISerializedStringReplacement {\n\ttxt: string;\n\tpos: number;\n\tlen: number;\n}\n\nexport class StringReplacement extends BaseStringReplacement<StringReplacement> {\n\tpublic static insert(offset: number, text: string): StringReplacement {\n\t\treturn new StringReplacement(OffsetRange.emptyAt(offset), text);\n\t}\n\n\tpublic static replace(range: OffsetRange, text: string): StringReplacement {\n\t\treturn new StringReplacement(range, text);\n\t}\n\n\toverride equals(other: StringReplacement): boolean {\n\t\treturn this.replaceRange.equals(other.replaceRange) && this.newText === other.newText;\n\t}\n\n\toverride tryJoinTouching(other: StringReplacement): StringReplacement | undefined {\n\t\treturn new StringReplacement(this.replaceRange.joinRightTouching(other.replaceRange), this.newText + other.newText);\n\t}\n\n\toverride slice(range: OffsetRange, rangeInReplacement?: OffsetRange): StringReplacement {\n\t\treturn new StringReplacement(range, rangeInReplacement ? rangeInReplacement.substring(this.newText) : this.newText);\n\t}\n}\n\nexport function applyEditsToRanges(sortedRanges: OffsetRange[], edit: StringEdit): OffsetRange[] {\n\tsortedRanges = sortedRanges.slice();\n\n\t// treat edits as deletion of the replace range and then as insertion that extends the first range\n\tconst result: OffsetRange[] = [];\n\n\tlet offset = 0;\n\n\tfor (const e of edit.replacements) {\n\t\twhile (true) {\n\t\t\t// ranges before the current edit\n\t\t\tconst r = sortedRanges[0];\n\t\t\tif (!r || r.endExclusive >= e.replaceRange.start) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsortedRanges.shift();\n\t\t\tresult.push(r.delta(offset));\n\t\t}\n\n\t\tconst intersecting: OffsetRange[] = [];\n\t\twhile (true) {\n\t\t\tconst r = sortedRanges[0];\n\t\t\tif (!r || !r.intersectsOrTouches(e.replaceRange)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsortedRanges.shift();\n\t\t\tintersecting.push(r);\n\t\t}\n\n\t\tfor (let i = intersecting.length - 1; i >= 0; i--) {\n\t\t\tlet r = intersecting[i];\n\n\t\t\tconst overlap = r.intersect(e.replaceRange)!.length;\n\t\t\tr = r.deltaEnd(-overlap + (i === 0 ? e.newText.length : 0));\n\n\t\t\tconst rangeAheadOfReplaceRange = r.start - e.replaceRange.start;\n\t\t\tif (rangeAheadOfReplaceRange > 0) {\n\t\t\t\tr = r.delta(-rangeAheadOfReplaceRange);\n\t\t\t}\n\n\t\t\tif (i !== 0) {\n\t\t\t\tr = r.delta(e.newText.length);\n\t\t\t}\n\n\t\t\t// We already took our offset into account.\n\t\t\t// Because we add r back to the queue (which then adds offset again),\n\t\t\t// we have to remove it here.\n\t\t\tr = r.delta(-(e.newText.length - e.replaceRange.length));\n\n\t\t\tsortedRanges.unshift(r);\n\t\t}\n\n\t\toffset += e.newText.length - e.replaceRange.length;\n\t}\n\n\twhile (true) {\n\t\tconst r = sortedRanges[0];\n\t\tif (!r) {\n\t\t\tbreak;\n\t\t}\n\t\tsortedRanges.shift();\n\t\tresult.push(r.delta(offset));\n\t}\n\n\treturn result;\n}\n\n"]}