monaco-editor-core 0.57.0 → 0.58.0-dev-20261104

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 (508) 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 +38 -6
  18. package/esm/vs/base/browser/browser.js +8 -0
  19. package/esm/vs/base/browser/browser.js.map +1 -1
  20. package/esm/vs/base/browser/contextmenu.js +8 -1
  21. package/esm/vs/base/browser/contextmenu.js.map +1 -1
  22. package/esm/vs/base/browser/dom.js +34 -5
  23. package/esm/vs/base/browser/dom.js.map +1 -1
  24. package/esm/vs/base/browser/dompurify/dompurify.js +2457 -2640
  25. package/esm/vs/base/browser/markdownRenderer.js +48 -21
  26. package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
  27. package/esm/vs/base/browser/pixelRatio.js +3 -2
  28. package/esm/vs/base/browser/pixelRatio.js.map +1 -1
  29. package/esm/vs/base/browser/ui/actionbar/actionViewItems.js +5 -2
  30. package/esm/vs/base/browser/ui/actionbar/actionViewItems.js.map +1 -1
  31. package/esm/vs/base/browser/ui/actionbar/actionbar.js +7 -2
  32. package/esm/vs/base/browser/ui/actionbar/actionbar.js.map +1 -1
  33. package/esm/vs/base/browser/ui/animations/animations.js +68 -40
  34. package/esm/vs/base/browser/ui/animations/animations.js.map +1 -1
  35. package/esm/vs/base/browser/ui/button/button.js +7 -0
  36. package/esm/vs/base/browser/ui/button/button.js.map +1 -1
  37. package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  38. package/esm/vs/base/browser/ui/contextview/contextview.css +15 -0
  39. package/esm/vs/base/browser/ui/contextview/contextview.js +266 -40
  40. package/esm/vs/base/browser/ui/contextview/contextview.js.map +1 -1
  41. package/esm/vs/base/browser/ui/contextview/windowControlsOverlay.js +72 -0
  42. package/esm/vs/base/browser/ui/contextview/windowControlsOverlay.js.map +1 -0
  43. package/esm/vs/base/browser/ui/dialog/dialog.css +5 -0
  44. package/esm/vs/base/browser/ui/dropdown/dropdown.js +2 -1
  45. package/esm/vs/base/browser/ui/dropdown/dropdown.js.map +1 -1
  46. package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +1 -0
  47. package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js.map +1 -1
  48. package/esm/vs/base/browser/ui/hover/hover.js.map +1 -1
  49. package/esm/vs/base/browser/ui/list/listView.js +87 -15
  50. package/esm/vs/base/browser/ui/list/listView.js.map +1 -1
  51. package/esm/vs/base/browser/ui/list/listWidget.js +37 -15
  52. package/esm/vs/base/browser/ui/list/listWidget.js.map +1 -1
  53. package/esm/vs/base/browser/ui/menu/menu.js +189 -52
  54. package/esm/vs/base/browser/ui/menu/menu.js.map +1 -1
  55. package/esm/vs/base/browser/ui/radio/radio.css +11 -0
  56. package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js +2 -1
  57. package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js.map +1 -1
  58. package/esm/vs/base/browser/ui/selectBox/selectBox.js.map +1 -1
  59. package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js +14 -8
  60. package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js.map +1 -1
  61. package/esm/vs/base/browser/ui/splitview/splitview.js +11 -7
  62. package/esm/vs/base/browser/ui/splitview/splitview.js.map +1 -1
  63. package/esm/vs/base/browser/ui/toggle/switch.css +16 -7
  64. package/esm/vs/base/browser/ui/toggle/switch.js +9 -6
  65. package/esm/vs/base/browser/ui/toggle/switch.js.map +1 -1
  66. package/esm/vs/base/browser/ui/toolbar/toolbar.css +1 -2
  67. package/esm/vs/base/browser/ui/toolbar/toolbar.js +85 -38
  68. package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
  69. package/esm/vs/base/browser/ui/tree/abstractTree.js +48 -9
  70. package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
  71. package/esm/vs/base/browser/ui/tree/asyncDataTree.js +10 -1
  72. package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
  73. package/esm/vs/base/browser/ui/tree/objectTree.js +3 -0
  74. package/esm/vs/base/browser/ui/tree/objectTree.js.map +1 -1
  75. package/esm/vs/base/browser/ui/tree/tree.js.map +1 -1
  76. package/esm/vs/base/common/actions.js +8 -2
  77. package/esm/vs/base/common/actions.js.map +1 -1
  78. package/esm/vs/base/common/arrays.js +4 -4
  79. package/esm/vs/base/common/arrays.js.map +1 -1
  80. package/esm/vs/base/common/async.js +12 -8
  81. package/esm/vs/base/common/async.js.map +1 -1
  82. package/esm/vs/base/common/cancellation.js +25 -0
  83. package/esm/vs/base/common/cancellation.js.map +1 -1
  84. package/esm/vs/base/common/codicons.js +2 -0
  85. package/esm/vs/base/common/codicons.js.map +1 -1
  86. package/esm/vs/base/common/codiconsLibrary.js +2 -0
  87. package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
  88. package/esm/vs/base/common/color.js +1 -1
  89. package/esm/vs/base/common/color.js.map +1 -1
  90. package/esm/vs/base/common/diff/diff.js +60 -1
  91. package/esm/vs/base/common/diff/diff.js.map +1 -1
  92. package/esm/vs/base/common/event.js +1 -1
  93. package/esm/vs/base/common/event.js.map +1 -1
  94. package/esm/vs/base/common/glob.js +1 -0
  95. package/esm/vs/base/common/glob.js.map +1 -1
  96. package/esm/vs/base/common/htmlContent.js +74 -12
  97. package/esm/vs/base/common/htmlContent.js.map +1 -1
  98. package/esm/vs/base/common/json.js +19 -0
  99. package/esm/vs/base/common/json.js.map +1 -0
  100. package/esm/vs/base/common/network.js +16 -0
  101. package/esm/vs/base/common/network.js.map +1 -1
  102. package/esm/vs/base/common/resources.js +14 -2
  103. package/esm/vs/base/common/resources.js.map +1 -1
  104. package/esm/vs/base/common/strings.js +1 -1
  105. package/esm/vs/base/common/strings.js.map +1 -1
  106. package/esm/vs/base/common/uri.js +2 -2
  107. package/esm/vs/base/common/uri.js.map +1 -1
  108. package/esm/vs/editor/browser/config/editorConfiguration.js +1 -1
  109. package/esm/vs/editor/browser/config/fontMeasurements.js +19 -6
  110. package/esm/vs/editor/browser/config/fontMeasurements.js.map +1 -1
  111. package/esm/vs/editor/browser/controller/dragScrolling.js +3 -3
  112. package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js +11 -5
  113. package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js.map +1 -1
  114. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +8 -38
  115. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
  116. package/esm/vs/editor/browser/controller/editContext/native/screenReaderContentRich.js +3 -3
  117. package/esm/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +6 -6
  118. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +12 -10
  119. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
  120. package/esm/vs/editor/browser/controller/mouseHandler.js +7 -7
  121. package/esm/vs/editor/browser/controller/mouseTarget.js +3 -3
  122. package/esm/vs/editor/browser/coreCommands.js +2 -2
  123. package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
  124. package/esm/vs/editor/browser/editorMarkdownSanitizer.js +19 -0
  125. package/esm/vs/editor/browser/editorMarkdownSanitizer.js.map +1 -0
  126. package/esm/vs/editor/browser/gpu/rectangleRenderer.js +1 -1
  127. package/esm/vs/editor/browser/gpu/viewGpuContext.js +1 -1
  128. package/esm/vs/editor/browser/observableCodeEditor.js +1 -1
  129. package/esm/vs/editor/browser/services/editorWorkerService.js +3 -2
  130. package/esm/vs/editor/browser/services/editorWorkerService.js.map +1 -1
  131. package/esm/vs/editor/browser/services/openerService.js +6 -2
  132. package/esm/vs/editor/browser/services/openerService.js.map +1 -1
  133. package/esm/vs/editor/browser/view/domLineBreaksComputer.js +34 -11
  134. package/esm/vs/editor/browser/view/domLineBreaksComputer.js.map +1 -1
  135. package/esm/vs/editor/browser/view/viewController.js +7 -7
  136. package/esm/vs/editor/browser/view/viewController.js.map +1 -1
  137. package/esm/vs/editor/browser/view/viewLayer.js +1 -1
  138. package/esm/vs/editor/browser/view/viewOverlays.js +4 -4
  139. package/esm/vs/editor/browser/view.js +5 -5
  140. package/esm/vs/editor/browser/viewParts/blockDecorations/blockDecorations.js +1 -1
  141. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +11 -3
  142. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
  143. package/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js +6 -6
  144. package/esm/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.js +12 -12
  145. package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +9 -2
  146. package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js.map +1 -1
  147. package/esm/vs/editor/browser/viewParts/indentGuides/indentGuides.js +2 -2
  148. package/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.js +2 -2
  149. package/esm/vs/editor/browser/viewParts/linesDecorations/linesDecorations.js +2 -2
  150. package/esm/vs/editor/browser/viewParts/margin/margin.js +2 -2
  151. package/esm/vs/editor/browser/viewParts/minimap/minimap.js +6 -6
  152. package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js +9 -2
  153. package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js.map +1 -1
  154. package/esm/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.js +5 -5
  155. package/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js +3 -3
  156. package/esm/vs/editor/browser/viewParts/rulers/rulers.js +2 -2
  157. package/esm/vs/editor/browser/viewParts/rulersGpu/rulersGpu.js +1 -1
  158. package/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js +3 -3
  159. package/esm/vs/editor/browser/viewParts/selections/selections.js +2 -2
  160. package/esm/vs/editor/browser/viewParts/viewCursors/viewCursor.js +2 -2
  161. package/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.js +6 -6
  162. package/esm/vs/editor/browser/viewParts/viewLines/viewLineOptions.js +5 -5
  163. package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js +11 -11
  164. package/esm/vs/editor/browser/viewParts/viewLinesGpu/viewLinesGpu.js +1 -1
  165. package/esm/vs/editor/browser/viewParts/viewZones/viewZones.js +2 -2
  166. package/esm/vs/editor/browser/viewParts/whitespace/whitespace.js +4 -4
  167. package/esm/vs/editor/browser/viewParts/wordWrapIndicator/wordWrapIndicator.js +2 -2
  168. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +22 -21
  169. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
  170. package/esm/vs/editor/browser/widget/diffEditor/commands.js +12 -12
  171. package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +18 -18
  172. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -1
  173. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +3 -3
  174. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +10 -10
  175. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js.map +1 -1
  176. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.js +2 -2
  177. package/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +4 -4
  178. package/esm/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js +21 -3
  179. package/esm/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js.map +1 -1
  180. package/esm/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +1 -1
  181. package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +10 -10
  182. package/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
  183. package/esm/vs/editor/browser/widget/diffEditor/features/overviewRulerFeature.js +1 -1
  184. package/esm/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +2 -2
  185. package/esm/vs/editor/browser/widget/diffEditor/registrations.contribution.js +5 -5
  186. package/esm/vs/editor/browser/widget/multiDiffEditor/colors.js +3 -3
  187. package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollLayout.js +2 -2
  188. package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollLayout.js.map +1 -1
  189. package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollView.js +21 -2
  190. package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollView.js.map +1 -1
  191. package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +2 -2
  192. package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +11 -3
  193. package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js.map +1 -1
  194. package/esm/vs/editor/browser/widget/multiDiffEditor/virtualizedItemManager.js +1 -0
  195. package/esm/vs/editor/browser/widget/multiDiffEditor/virtualizedItemManager.js.map +1 -1
  196. package/esm/vs/editor/common/commands/columnSelectionPasteCommand.js +64 -0
  197. package/esm/vs/editor/common/commands/columnSelectionPasteCommand.js.map +1 -0
  198. package/esm/vs/editor/common/config/editorConfigurationSchema.js +68 -58
  199. package/esm/vs/editor/common/config/editorConfigurationSchema.js.map +1 -1
  200. package/esm/vs/editor/common/config/editorOptions.js +560 -500
  201. package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
  202. package/esm/vs/editor/common/core/editorColorRegistry.js +71 -71
  203. package/esm/vs/editor/common/core/edits/textEdit.js +16 -0
  204. package/esm/vs/editor/common/core/edits/textEdit.js.map +1 -1
  205. package/esm/vs/editor/common/cursor/cursor.js +20 -10
  206. package/esm/vs/editor/common/cursor/cursor.js.map +1 -1
  207. package/esm/vs/editor/common/cursor/cursorTypeEditOperations.js +67 -14
  208. package/esm/vs/editor/common/cursor/cursorTypeEditOperations.js.map +1 -1
  209. package/esm/vs/editor/common/cursor/cursorTypeOperations.js +2 -2
  210. package/esm/vs/editor/common/cursor/cursorTypeOperations.js.map +1 -1
  211. package/esm/vs/editor/common/cursorCommon.js +22 -21
  212. package/esm/vs/editor/common/cursorCommon.js.map +1 -1
  213. package/esm/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js +21 -8
  214. package/esm/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js.map +1 -1
  215. package/esm/vs/editor/common/diff/documentDiffProvider.js.map +1 -1
  216. package/esm/vs/editor/common/diff/externalLinesDiffComputer.js +38 -26
  217. package/esm/vs/editor/common/diff/externalLinesDiffComputer.js.map +1 -1
  218. package/esm/vs/editor/common/diff/rangeMapping.js +11 -1
  219. package/esm/vs/editor/common/diff/rangeMapping.js.map +1 -1
  220. package/esm/vs/editor/common/diff/verifyLinesDiff.js +28 -0
  221. package/esm/vs/editor/common/diff/verifyLinesDiff.js.map +1 -0
  222. package/esm/vs/editor/common/editorContextKeys.js +53 -53
  223. package/esm/vs/editor/common/languages/languageConfiguration.js +8 -0
  224. package/esm/vs/editor/common/languages/languageConfiguration.js.map +1 -1
  225. package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
  226. package/esm/vs/editor/common/languages.js +56 -56
  227. package/esm/vs/editor/common/model/editStack.js +1 -1
  228. package/esm/vs/editor/common/services/editorWebWorker.js +27 -6
  229. package/esm/vs/editor/common/services/editorWebWorker.js.map +1 -1
  230. package/esm/vs/editor/common/services/editorWorker.js.map +1 -1
  231. package/esm/vs/editor/common/services/languageService.js +6 -4
  232. package/esm/vs/editor/common/services/languageService.js.map +1 -1
  233. package/esm/vs/editor/common/services/markerDecorationsService.js +21 -2
  234. package/esm/vs/editor/common/services/markerDecorationsService.js.map +1 -1
  235. package/esm/vs/editor/common/standalone/standaloneEnums.js +100 -97
  236. package/esm/vs/editor/common/standalone/standaloneEnums.js.map +1 -1
  237. package/esm/vs/editor/common/standaloneStrings.js +11 -11
  238. package/esm/vs/editor/common/textModelEditSource.js +9 -0
  239. package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
  240. package/esm/vs/editor/common/viewLayout/viewLayout.js +16 -16
  241. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
  242. package/esm/vs/editor/common/viewModel/monospaceLineBreaksComputer.js +1 -1
  243. package/esm/vs/editor/common/viewModel/viewModelImpl.js +19 -19
  244. package/esm/vs/editor/common/viewModel/viewModelImpl.js.map +1 -1
  245. package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
  246. package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +9 -9
  247. package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
  248. package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
  249. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +23 -20
  250. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
  251. package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
  252. package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
  253. package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
  254. package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
  255. package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
  256. package/esm/vs/editor/contrib/codeAction/browser/codeActionModel.js +1 -1
  257. package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
  258. package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
  259. package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js +25 -10
  260. package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js.map +1 -1
  261. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
  262. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
  263. package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerContribution.js +1 -1
  264. package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +3 -3
  265. package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
  266. package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerParticipant.js +1 -1
  267. package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
  268. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +17 -17
  269. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js.map +1 -1
  270. package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
  271. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
  272. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +39 -39
  273. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
  274. package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
  275. package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
  276. package/esm/vs/editor/contrib/dropOrPasteInto/browser/pasteEditSession.js +19 -0
  277. package/esm/vs/editor/contrib/dropOrPasteInto/browser/pasteEditSession.js.map +1 -0
  278. package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +26 -18
  279. package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js.map +1 -1
  280. package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
  281. package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js.map +1 -1
  282. package/esm/vs/editor/contrib/find/browser/findController.js +18 -18
  283. package/esm/vs/editor/contrib/find/browser/findController.js.map +1 -1
  284. package/esm/vs/editor/contrib/find/browser/findModel.js +6 -6
  285. package/esm/vs/editor/contrib/find/browser/findWidget.js +40 -40
  286. package/esm/vs/editor/contrib/find/browser/findWidget.js.map +1 -1
  287. package/esm/vs/editor/contrib/folding/browser/folding.js +23 -23
  288. package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
  289. package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
  290. package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
  291. package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
  292. package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
  293. package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
  294. package/esm/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.js +3 -3
  295. package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +2 -2
  296. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +4 -4
  297. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js.map +1 -1
  298. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
  299. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
  300. package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
  301. package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
  302. package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
  303. package/esm/vs/editor/contrib/hover/browser/contentHoverController.js +9 -3
  304. package/esm/vs/editor/contrib/hover/browser/contentHoverController.js.map +1 -1
  305. package/esm/vs/editor/contrib/hover/browser/glyphHoverController.js +2 -2
  306. package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js +2 -1
  307. package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js.map +1 -1
  308. package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
  309. package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
  310. package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
  311. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +10 -8
  312. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
  313. package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +6 -6
  314. package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
  315. package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
  316. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +5 -5
  317. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +9 -9
  318. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.js +3 -3
  319. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.js.map +1 -1
  320. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +21 -21
  321. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -13
  322. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +7 -7
  323. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
  324. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +6 -5
  325. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js.map +1 -1
  326. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +1 -1
  327. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +2 -2
  328. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +7 -7
  329. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
  330. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +1 -1
  331. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +3 -3
  332. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
  333. package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
  334. package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
  335. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +32 -32
  336. package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +5 -4
  337. package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js.map +1 -1
  338. package/esm/vs/editor/contrib/links/browser/links.js +16 -15
  339. package/esm/vs/editor/contrib/links/browser/links.js.map +1 -1
  340. package/esm/vs/editor/contrib/longLinesHelper/browser/longLinesHelper.js +1 -1
  341. package/esm/vs/editor/contrib/message/browser/messageController.js +16 -12
  342. package/esm/vs/editor/contrib/message/browser/messageController.js.map +1 -1
  343. package/esm/vs/editor/contrib/middleScroll/browser/middleScrollController.js +1 -1
  344. package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +91 -55
  345. package/esm/vs/editor/contrib/multicursor/browser/multicursor.js.map +1 -1
  346. package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
  347. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsModel.js +3 -3
  348. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsModel.js.map +1 -1
  349. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +6 -4
  350. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js.map +1 -1
  351. package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
  352. package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
  353. package/esm/vs/editor/contrib/placeholderText/browser/placeholderTextContribution.js +1 -1
  354. package/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js +1 -1
  355. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +12 -12
  356. package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
  357. package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +3 -3
  358. package/esm/vs/editor/contrib/rename/browser/rename.js +11 -11
  359. package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
  360. package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js +6 -6
  361. package/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js +23 -13
  362. package/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js.map +1 -1
  363. package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +5 -5
  364. package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +5 -5
  365. package/esm/vs/editor/contrib/snippet/browser/snippetSession.js +2 -2
  366. package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
  367. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  368. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +10 -8
  369. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js.map +1 -1
  370. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.js +1 -1
  371. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.js +2 -2
  372. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +6 -6
  373. package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -9
  374. package/esm/vs/editor/contrib/suggest/browser/suggestController.js +15 -15
  375. package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +2 -2
  376. package/esm/vs/editor/contrib/suggest/browser/suggestModel.js +11 -11
  377. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +27 -27
  378. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +8 -6
  379. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js.map +1 -1
  380. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +5 -5
  381. package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +3 -3
  382. package/esm/vs/editor/contrib/suggest/browser/wordDistance.js +1 -1
  383. package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
  384. package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  385. package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  386. package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  387. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +27 -27
  388. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +9 -9
  389. package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  390. package/esm/vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider.js +1 -1
  391. package/esm/vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider.js.map +1 -1
  392. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +50 -14
  393. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js.map +1 -1
  394. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +6 -6
  395. package/esm/vs/editor/editor.api.d.ts +133 -98
  396. package/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js +1 -1
  397. package/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js +5 -3
  398. package/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js.map +1 -1
  399. package/esm/vs/editor/standalone/browser/standaloneCodeEditor.js +15 -1
  400. package/esm/vs/editor/standalone/browser/standaloneCodeEditor.js.map +1 -1
  401. package/esm/vs/nls.js.map +1 -1
  402. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +72 -66
  403. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js.map +1 -1
  404. package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
  405. package/esm/vs/platform/actionWidget/browser/actionList.js +434 -136
  406. package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
  407. package/esm/vs/platform/actionWidget/browser/actionWidget.css +74 -4
  408. package/esm/vs/platform/actionWidget/browser/actionWidget.js +24 -26
  409. package/esm/vs/platform/actionWidget/browser/actionWidget.js.map +1 -1
  410. package/esm/vs/platform/actionWidget/browser/actionWidgetMotion.js +16 -0
  411. package/esm/vs/platform/actionWidget/browser/actionWidgetMotion.js.map +1 -0
  412. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +15 -17
  413. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js.map +1 -1
  414. package/esm/vs/platform/actions/browser/toolbar.js +25 -12
  415. package/esm/vs/platform/actions/browser/toolbar.js.map +1 -1
  416. package/esm/vs/platform/actions/common/actions.js +4 -2
  417. package/esm/vs/platform/actions/common/actions.js.map +1 -1
  418. package/esm/vs/platform/actions/common/menuService.js +15 -8
  419. package/esm/vs/platform/actions/common/menuService.js.map +1 -1
  420. package/esm/vs/platform/configuration/common/configuration.js +3 -1
  421. package/esm/vs/platform/configuration/common/configuration.js.map +1 -1
  422. package/esm/vs/platform/configuration/common/configurationModels.js +16 -11
  423. package/esm/vs/platform/configuration/common/configurationModels.js.map +1 -1
  424. package/esm/vs/platform/configuration/common/configurationRegistry.js +29 -27
  425. package/esm/vs/platform/configuration/common/configurationRegistry.js.map +1 -1
  426. package/esm/vs/platform/configuration/common/configurations.js +13 -1
  427. package/esm/vs/platform/configuration/common/configurations.js.map +1 -1
  428. package/esm/vs/platform/contextkey/browser/contextKeyService.js +2 -2
  429. package/esm/vs/platform/contextkey/browser/contextKeyService.js.map +1 -1
  430. package/esm/vs/platform/contextkey/common/contextkey.js +28 -14
  431. package/esm/vs/platform/contextkey/common/contextkey.js.map +1 -1
  432. package/esm/vs/platform/contextkey/common/contextkeys.js +10 -10
  433. package/esm/vs/platform/contextkey/common/scanner.js +5 -5
  434. package/esm/vs/platform/contextview/browser/contextMenuHandler.js +17 -4
  435. package/esm/vs/platform/contextview/browser/contextMenuHandler.js.map +1 -1
  436. package/esm/vs/platform/contextview/browser/contextMenuService.js +1 -1
  437. package/esm/vs/platform/contextview/browser/contextMenuService.js.map +1 -1
  438. package/esm/vs/platform/contextview/browser/contextView.js.map +1 -1
  439. package/esm/vs/platform/contextview/browser/contextViewService.js +7 -2
  440. package/esm/vs/platform/contextview/browser/contextViewService.js.map +1 -1
  441. package/esm/vs/platform/editor/common/editor.js +17 -0
  442. package/esm/vs/platform/editor/common/editor.js.map +1 -1
  443. package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  444. package/esm/vs/platform/hover/browser/hoverService.js +6 -3
  445. package/esm/vs/platform/hover/browser/hoverService.js.map +1 -1
  446. package/esm/vs/platform/hover/browser/hoverWidget.js +38 -6
  447. package/esm/vs/platform/hover/browser/hoverWidget.js.map +1 -1
  448. package/esm/vs/platform/hover/browser/updatableHoverWidget.js +32 -5
  449. package/esm/vs/platform/hover/browser/updatableHoverWidget.js.map +1 -1
  450. package/esm/vs/platform/instantiation/common/instantiationService.js +1 -1
  451. package/esm/vs/platform/instantiation/common/instantiationService.js.map +1 -1
  452. package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +5 -5
  453. package/esm/vs/platform/keybinding/common/keybindingResolver.js +1 -1
  454. package/esm/vs/platform/keybinding/common/keybindingResolver.js.map +1 -1
  455. package/esm/vs/platform/list/browser/listService.js +27 -27
  456. package/esm/vs/platform/markers/common/markerService.js +11 -8
  457. package/esm/vs/platform/markers/common/markerService.js.map +1 -1
  458. package/esm/vs/platform/markers/common/markers.js +6 -6
  459. package/esm/vs/platform/markers/common/markers.js.map +1 -1
  460. package/esm/vs/platform/notification/common/notification.js.map +1 -1
  461. package/esm/vs/platform/notification/common/notificationMessage.js +37 -0
  462. package/esm/vs/platform/notification/common/notificationMessage.js.map +1 -0
  463. package/esm/vs/platform/opener/common/opener.js.map +1 -1
  464. package/esm/vs/platform/progress/common/progress.js.map +1 -1
  465. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
  466. package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
  467. package/esm/vs/platform/quickinput/browser/media/quickInput.css +33 -2
  468. package/esm/vs/platform/quickinput/browser/quickAccess.js +7 -4
  469. package/esm/vs/platform/quickinput/browser/quickAccess.js.map +1 -1
  470. package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
  471. package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
  472. package/esm/vs/platform/quickinput/browser/quickInputController.js +65 -15
  473. package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
  474. package/esm/vs/platform/quickinput/browser/quickInputList.js +96 -90
  475. package/esm/vs/platform/quickinput/browser/quickInputList.js.map +1 -1
  476. package/esm/vs/platform/quickinput/browser/quickInputService.js +5 -7
  477. package/esm/vs/platform/quickinput/browser/quickInputService.js.map +1 -1
  478. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  479. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
  480. package/esm/vs/platform/quickinput/browser/tree/quickTree.js +1 -1
  481. package/esm/vs/platform/quickinput/common/quickAccess.js.map +1 -1
  482. package/esm/vs/platform/quickinput/common/quickInput.js.map +1 -1
  483. package/esm/vs/platform/storage/common/storage.js.map +1 -1
  484. package/esm/vs/platform/theme/common/colorRegistry.js +1 -0
  485. package/esm/vs/platform/theme/common/colorRegistry.js.map +1 -1
  486. package/esm/vs/platform/theme/common/colorUtils.js +11 -3
  487. package/esm/vs/platform/theme/common/colorUtils.js.map +1 -1
  488. package/esm/vs/platform/theme/common/colors/baseColors.js +19 -19
  489. package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -9
  490. package/esm/vs/platform/theme/common/colors/chartsColors.js.map +1 -1
  491. package/esm/vs/platform/theme/common/colors/confettiColors.js +14 -0
  492. package/esm/vs/platform/theme/common/colors/confettiColors.js.map +1 -0
  493. package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
  494. package/esm/vs/platform/theme/common/colors/inputColors.js +48 -48
  495. package/esm/vs/platform/theme/common/colors/inputColors.js.map +1 -1
  496. package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
  497. package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
  498. package/esm/vs/platform/theme/common/colors/minimapColors.js +13 -13
  499. package/esm/vs/platform/theme/common/colors/minimapColors.js.map +1 -1
  500. package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
  501. package/esm/vs/platform/theme/common/colors/quickpickColors.js +10 -10
  502. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  503. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  504. package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
  505. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  506. package/monaco.d.ts +133 -98
  507. package/package.json +3 -3
  508. package/version.txt +1 -1
@@ -38,8 +38,8 @@ export class TypeOperations {
38
38
  }
39
39
  return commands;
40
40
  }
41
- static paste(config, model, selections, text, pasteOnNewLine, multicursorText) {
42
- return PasteOperation.getEdits(config, model, selections, text, pasteOnNewLine, multicursorText);
41
+ static paste(config, model, selections, text, pasteOnNewLine, multicursorText, isBlock = false) {
42
+ return PasteOperation.getEdits(config, model, selections, text, pasteOnNewLine, multicursorText, isBlock);
43
43
  }
44
44
  static tab(config, model, selections) {
45
45
  return TabOperation.getCommands(config, model, selections);
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/cursor/cursorTypeOperations.ts","vs/editor/common/cursor/cursorTypeOperations.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,mCAAmC,EAAE,MAAM,yCAAyC,CAAC;AAC9F,OAAO,EAAuB,mBAAmB,EAAyC,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAM9H,OAAO,EAAE,gCAAgC,EAAE,4BAA4B,EAAE,4CAA4C,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,+BAA+B,EAAE,cAAc,EAAE,gCAAgC,EAAE,cAAc,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,YAAY,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AAEza,MAAM,OAAO,cAAc;IAEnB,MAAM,CAAC,MAAM,CAAC,MAA2B,EAAE,KAAgC,EAAE,UAA8B;QACjH,IAAI,KAAK,KAAK,IAAI,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;YAC3C,OAAO,EAAE,CAAC;QACX,CAAC;QAED,MAAM,QAAQ,GAAe,EAAE,CAAC;QAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YACvD,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;gBAC7C,SAAS,EAAE,KAAK;gBAChB,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,YAAY,EAAE,MAAM,CAAC,YAAY;gBACj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AAE,GAAG,CAAC,CAAC;IAC1F,CAAC;CACD;AAED,MAAM,OAAO,kBAAkB;IAC9B,YACiB,WAAmB,EACnB,qBAA6B,EAC7B,mBAA2B,EAC3B,YAAoB,EACpB,sBAA8B,EAC9B,oBAA4B,EAC5B,iBAAwB;QANxB,gBAAW,GAAX,WAAW,CAAQ;QACnB,0BAAqB,GAArB,qBAAqB,CAAQ;QAC7B,wBAAmB,GAAnB,mBAAmB,CAAQ;QAC3B,iBAAY,GAAZ,YAAY,CAAQ;QACpB,2BAAsB,GAAtB,sBAAsB,CAAQ;QAC9B,yBAAoB,GAApB,oBAAoB,CAAQ;QAC5B,sBAAiB,GAAjB,iBAAiB,CAAO;IACrC,CAAC;CACL","file":"cursorTypeOperations.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 { ShiftCommand } from '../commands/shiftCommand.js';\nimport { CompositionSurroundSelectionCommand } from '../commands/surroundSelectionCommand.js';\nimport { CursorConfiguration, EditOperationResult, EditOperationType, ICursorSimpleModel, isQuote } from '../cursorCommon.js';\nimport { Range } from '../core/range.js';\nimport { Selection } from '../core/selection.js';\nimport { Position } from '../core/position.js';\nimport { ICommand } from '../editorCommon.js';\nimport { ITextModel } from '../model.js';\nimport { AutoClosingOpenCharTypeOperation, AutoClosingOvertypeOperation, AutoClosingOvertypeWithInterceptorsOperation, AutoIndentOperation, CompositionOperation, CompositionEndOvertypeOperation, EnterOperation, InterceptorElectricCharOperation, PasteOperation, shouldSurroundChar, SimpleCharacterTypeOperation, SurroundSelectionOperation, TabOperation, TypeWithoutInterceptorsOperation } from './cursorTypeEditOperations.js';\n\nexport class TypeOperations {\n\n\tpublic static indent(config: CursorConfiguration, model: ICursorSimpleModel | null, selections: Selection[] | null): ICommand[] {\n\t\tif (model === null || selections === null) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tcommands[i] = new ShiftCommand(selections[i], {\n\t\t\t\tisUnshift: false,\n\t\t\t\ttabSize: config.tabSize,\n\t\t\t\tindentSize: config.indentSize,\n\t\t\t\tinsertSpaces: config.insertSpaces,\n\t\t\t\tuseTabStops: config.useTabStops,\n\t\t\t\tautoIndent: config.autoIndent\n\t\t\t}, config.languageConfigurationService);\n\t\t}\n\t\treturn commands;\n\t}\n\n\tpublic static outdent(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[]): ICommand[] {\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tcommands[i] = new ShiftCommand(selections[i], {\n\t\t\t\tisUnshift: true,\n\t\t\t\ttabSize: config.tabSize,\n\t\t\t\tindentSize: config.indentSize,\n\t\t\t\tinsertSpaces: config.insertSpaces,\n\t\t\t\tuseTabStops: config.useTabStops,\n\t\t\t\tautoIndent: config.autoIndent\n\t\t\t}, config.languageConfigurationService);\n\t\t}\n\t\treturn commands;\n\t}\n\n\tpublic static paste(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[], text: string, pasteOnNewLine: boolean, multicursorText: string[]): EditOperationResult {\n\t\treturn PasteOperation.getEdits(config, model, selections, text, pasteOnNewLine, multicursorText);\n\t}\n\n\tpublic static tab(config: CursorConfiguration, model: ITextModel, selections: Selection[]): ICommand[] {\n\t\treturn TabOperation.getCommands(config, model, selections);\n\t}\n\n\tpublic static compositionType(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], text: string, replacePrevCharCnt: number, replaceNextCharCnt: number, positionDelta: number): EditOperationResult {\n\t\treturn CompositionOperation.getEdits(prevEditOperationType, config, model, selections, text, replacePrevCharCnt, replaceNextCharCnt, positionDelta);\n\t}\n\n\t/**\n\t * This is very similar with typing, but the character is already in the text buffer!\n\t */\n\tpublic static compositionEndWithInterceptors(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, compositions: CompositionOutcome[] | null, selections: Selection[], autoClosedCharacters: Range[]): EditOperationResult | null {\n\t\tif (!compositions) {\n\t\t\t// could not deduce what the composition did\n\t\t\treturn null;\n\t\t}\n\n\t\tlet insertedText: string | null = null;\n\t\tfor (const composition of compositions) {\n\t\t\tif (insertedText === null) {\n\t\t\t\tinsertedText = composition.insertedText;\n\t\t\t} else if (insertedText !== composition.insertedText) {\n\t\t\t\t// not all selections agree on what was typed\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tif (!insertedText || insertedText.length !== 1) {\n\t\t\t// we're only interested in the case where a single character was inserted\n\t\t\treturn CompositionEndOvertypeOperation.getEdits(config, compositions);\n\t\t}\n\n\t\tconst ch = insertedText;\n\n\t\tlet hasDeletion = false;\n\t\tfor (const composition of compositions) {\n\t\t\tif (composition.deletedText.length !== 0) {\n\t\t\t\thasDeletion = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (hasDeletion) {\n\t\t\t// Check if this could have been a surround selection\n\n\t\t\tif (!shouldSurroundChar(config, ch) || !config.surroundingPairs.hasOwnProperty(ch)) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst isTypingAQuoteCharacter = isQuote(ch);\n\n\t\t\tfor (const composition of compositions) {\n\t\t\t\tif (composition.deletedSelectionStart !== 0 || composition.deletedSelectionEnd !== composition.deletedText.length) {\n\t\t\t\t\t// more text was deleted than was selected, so this could not have been a surround selection\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tif (/^[ \\t]+$/.test(composition.deletedText)) {\n\t\t\t\t\t// deleted text was only whitespace\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tif (isTypingAQuoteCharacter && isQuote(composition.deletedText)) {\n\t\t\t\t\t// deleted text was a quote\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst positions: Position[] = [];\n\t\t\tfor (const selection of selections) {\n\t\t\t\tif (!selection.isEmpty()) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tpositions.push(selection.getPosition());\n\t\t\t}\n\n\t\t\tif (positions.length !== compositions.length) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst commands: ICommand[] = [];\n\t\t\tfor (let i = 0, len = positions.length; i < len; i++) {\n\t\t\t\tcommands.push(new CompositionSurroundSelectionCommand(positions[i], compositions[i].deletedText, config.surroundingPairs[ch]));\n\t\t\t}\n\t\t\treturn new EditOperationResult(EditOperationType.TypingOther, commands, {\n\t\t\t\tshouldPushStackElementBefore: true,\n\t\t\t\tshouldPushStackElementAfter: false\n\t\t\t});\n\t\t}\n\n\t\tconst autoClosingOvertypeEdits = AutoClosingOvertypeWithInterceptorsOperation.getEdits(config, model, selections, autoClosedCharacters, ch);\n\t\tif (autoClosingOvertypeEdits !== undefined) {\n\t\t\treturn autoClosingOvertypeEdits;\n\t\t}\n\n\t\tconst autoClosingOpenCharEdits = AutoClosingOpenCharTypeOperation.getEdits(config, model, selections, ch, true, false);\n\t\tif (autoClosingOpenCharEdits !== undefined) {\n\t\t\treturn autoClosingOpenCharEdits;\n\t\t}\n\n\t\treturn CompositionEndOvertypeOperation.getEdits(config, compositions);\n\t}\n\n\tpublic static typeWithInterceptors(isDoingComposition: boolean, prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], autoClosedCharacters: Range[], ch: string): EditOperationResult {\n\n\t\tconst enterEdits = EnterOperation.getEdits(config, model, selections, ch, isDoingComposition);\n\t\tif (enterEdits !== undefined) {\n\t\t\treturn enterEdits;\n\t\t}\n\n\t\tconst autoIndentEdits = AutoIndentOperation.getEdits(config, model, selections, ch, isDoingComposition);\n\t\tif (autoIndentEdits !== undefined) {\n\t\t\treturn autoIndentEdits;\n\t\t}\n\n\t\tconst autoClosingOverTypeEdits = AutoClosingOvertypeOperation.getEdits(prevEditOperationType, config, model, selections, autoClosedCharacters, ch);\n\t\tif (autoClosingOverTypeEdits !== undefined) {\n\t\t\treturn autoClosingOverTypeEdits;\n\t\t}\n\n\t\tconst autoClosingOpenCharEdits = AutoClosingOpenCharTypeOperation.getEdits(config, model, selections, ch, false, isDoingComposition);\n\t\tif (autoClosingOpenCharEdits !== undefined) {\n\t\t\treturn autoClosingOpenCharEdits;\n\t\t}\n\n\t\tconst surroundSelectionEdits = SurroundSelectionOperation.getEdits(config, model, selections, ch, isDoingComposition);\n\t\tif (surroundSelectionEdits !== undefined) {\n\t\t\treturn surroundSelectionEdits;\n\t\t}\n\n\t\tconst interceptorElectricCharOperation = InterceptorElectricCharOperation.getEdits(prevEditOperationType, config, model, selections, ch, isDoingComposition);\n\t\tif (interceptorElectricCharOperation !== undefined) {\n\t\t\treturn interceptorElectricCharOperation;\n\t\t}\n\n\t\treturn SimpleCharacterTypeOperation.getEdits(config, prevEditOperationType, selections, ch, isDoingComposition);\n\t}\n\n\tpublic static typeWithoutInterceptors(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], str: string): EditOperationResult {\n\t\treturn TypeWithoutInterceptorsOperation.getEdits(prevEditOperationType, selections, str);\n\t}\n}\n\nexport class CompositionOutcome {\n\tconstructor(\n\t\tpublic readonly deletedText: string,\n\t\tpublic readonly deletedSelectionStart: number,\n\t\tpublic readonly deletedSelectionEnd: number,\n\t\tpublic readonly insertedText: string,\n\t\tpublic readonly insertedSelectionStart: number,\n\t\tpublic readonly insertedSelectionEnd: number,\n\t\tpublic readonly insertedTextRange: Range,\n\t) { }\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 { ShiftCommand } from '../commands/shiftCommand.js';\nimport { CompositionSurroundSelectionCommand } from '../commands/surroundSelectionCommand.js';\nimport { CursorConfiguration, EditOperationResult, EditOperationType, ICursorSimpleModel, isQuote } from '../cursorCommon.js';\nimport { Range } from '../core/range.js';\nimport { Selection } from '../core/selection.js';\nimport { Position } from '../core/position.js';\nimport { ICommand } from '../editorCommon.js';\nimport { ITextModel } from '../model.js';\nimport { AutoClosingOpenCharTypeOperation, AutoClosingOvertypeOperation, AutoClosingOvertypeWithInterceptorsOperation, AutoIndentOperation, CompositionOperation, CompositionEndOvertypeOperation, EnterOperation, InterceptorElectricCharOperation, PasteOperation, shouldSurroundChar, SimpleCharacterTypeOperation, SurroundSelectionOperation, TabOperation, TypeWithoutInterceptorsOperation } from './cursorTypeEditOperations.js';\n\nexport class TypeOperations {\n\n\tpublic static indent(config: CursorConfiguration, model: ICursorSimpleModel | null, selections: Selection[] | null): ICommand[] {\n\t\tif (model === null || selections === null) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tcommands[i] = new ShiftCommand(selections[i], {\n\t\t\t\tisUnshift: false,\n\t\t\t\ttabSize: config.tabSize,\n\t\t\t\tindentSize: config.indentSize,\n\t\t\t\tinsertSpaces: config.insertSpaces,\n\t\t\t\tuseTabStops: config.useTabStops,\n\t\t\t\tautoIndent: config.autoIndent\n\t\t\t}, config.languageConfigurationService);\n\t\t}\n\t\treturn commands;\n\t}\n\n\tpublic static outdent(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[]): ICommand[] {\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tcommands[i] = new ShiftCommand(selections[i], {\n\t\t\t\tisUnshift: true,\n\t\t\t\ttabSize: config.tabSize,\n\t\t\t\tindentSize: config.indentSize,\n\t\t\t\tinsertSpaces: config.insertSpaces,\n\t\t\t\tuseTabStops: config.useTabStops,\n\t\t\t\tautoIndent: config.autoIndent\n\t\t\t}, config.languageConfigurationService);\n\t\t}\n\t\treturn commands;\n\t}\n\n\tpublic static paste(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[], text: string, pasteOnNewLine: boolean, multicursorText: string[]): EditOperationResult {\n\t\treturn PasteOperation.getEdits(config, model, selections, text, pasteOnNewLine, multicursorText);\n\t}\n\n\tpublic static tab(config: CursorConfiguration, model: ITextModel, selections: Selection[]): ICommand[] {\n\t\treturn TabOperation.getCommands(config, model, selections);\n\t}\n\n\tpublic static compositionType(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], text: string, replacePrevCharCnt: number, replaceNextCharCnt: number, positionDelta: number): EditOperationResult {\n\t\treturn CompositionOperation.getEdits(prevEditOperationType, config, model, selections, text, replacePrevCharCnt, replaceNextCharCnt, positionDelta);\n\t}\n\n\t/**\n\t * This is very similar with typing, but the character is already in the text buffer!\n\t */\n\tpublic static compositionEndWithInterceptors(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, compositions: CompositionOutcome[] | null, selections: Selection[], autoClosedCharacters: Range[]): EditOperationResult | null {\n\t\tif (!compositions) {\n\t\t\t// could not deduce what the composition did\n\t\t\treturn null;\n\t\t}\n\n\t\tlet insertedText: string | null = null;\n\t\tfor (const composition of compositions) {\n\t\t\tif (insertedText === null) {\n\t\t\t\tinsertedText = composition.insertedText;\n\t\t\t} else if (insertedText !== composition.insertedText) {\n\t\t\t\t// not all selections agree on what was typed\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tif (!insertedText || insertedText.length !== 1) {\n\t\t\t// we're only interested in the case where a single character was inserted\n\t\t\treturn CompositionEndOvertypeOperation.getEdits(config, compositions);\n\t\t}\n\n\t\tconst ch = insertedText;\n\n\t\tlet hasDeletion = false;\n\t\tfor (const composition of compositions) {\n\t\t\tif (composition.deletedText.length !== 0) {\n\t\t\t\thasDeletion = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (hasDeletion) {\n\t\t\t// Check if this could have been a surround selection\n\n\t\t\tif (!shouldSurroundChar(config, ch) || !config.surroundingPairs.hasOwnProperty(ch)) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst isTypingAQuoteCharacter = isQuote(ch);\n\n\t\t\tfor (const composition of compositions) {\n\t\t\t\tif (composition.deletedSelectionStart !== 0 || composition.deletedSelectionEnd !== composition.deletedText.length) {\n\t\t\t\t\t// more text was deleted than was selected, so this could not have been a surround selection\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tif (/^[ \\t]+$/.test(composition.deletedText)) {\n\t\t\t\t\t// deleted text was only whitespace\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tif (isTypingAQuoteCharacter && isQuote(composition.deletedText)) {\n\t\t\t\t\t// deleted text was a quote\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst positions: Position[] = [];\n\t\t\tfor (const selection of selections) {\n\t\t\t\tif (!selection.isEmpty()) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tpositions.push(selection.getPosition());\n\t\t\t}\n\n\t\t\tif (positions.length !== compositions.length) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst commands: ICommand[] = [];\n\t\t\tfor (let i = 0, len = positions.length; i < len; i++) {\n\t\t\t\tcommands.push(new CompositionSurroundSelectionCommand(positions[i], compositions[i].deletedText, config.surroundingPairs[ch]));\n\t\t\t}\n\t\t\treturn new EditOperationResult(EditOperationType.TypingOther, commands, {\n\t\t\t\tshouldPushStackElementBefore: true,\n\t\t\t\tshouldPushStackElementAfter: false\n\t\t\t});\n\t\t}\n\n\t\tconst autoClosingOvertypeEdits = AutoClosingOvertypeWithInterceptorsOperation.getEdits(config, model, selections, autoClosedCharacters, ch);\n\t\tif (autoClosingOvertypeEdits !== undefined) {\n\t\t\treturn autoClosingOvertypeEdits;\n\t\t}\n\n\t\tconst autoClosingOpenCharEdits = AutoClosingOpenCharTypeOperation.getEdits(config, model, selections, ch, true, false);\n\t\tif (autoClosingOpenCharEdits !== undefined) {\n\t\t\treturn autoClosingOpenCharEdits;\n\t\t}\n\n\t\treturn CompositionEndOvertypeOperation.getEdits(config, compositions);\n\t}\n\n\tpublic static typeWithInterceptors(isDoingComposition: boolean, prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], autoClosedCharacters: Range[], ch: string): EditOperationResult {\n\n\t\tconst enterEdits = EnterOperation.getEdits(config, model, selections, ch, isDoingComposition);\n\t\tif (enterEdits !== undefined) {\n\t\t\treturn enterEdits;\n\t\t}\n\n\t\tconst autoIndentEdits = AutoIndentOperation.getEdits(config, model, selections, ch, isDoingComposition);\n\t\tif (autoIndentEdits !== undefined) {\n\t\t\treturn autoIndentEdits;\n\t\t}\n\n\t\tconst autoClosingOverTypeEdits = AutoClosingOvertypeOperation.getEdits(prevEditOperationType, config, model, selections, autoClosedCharacters, ch);\n\t\tif (autoClosingOverTypeEdits !== undefined) {\n\t\t\treturn autoClosingOverTypeEdits;\n\t\t}\n\n\t\tconst autoClosingOpenCharEdits = AutoClosingOpenCharTypeOperation.getEdits(config, model, selections, ch, false, isDoingComposition);\n\t\tif (autoClosingOpenCharEdits !== undefined) {\n\t\t\treturn autoClosingOpenCharEdits;\n\t\t}\n\n\t\tconst surroundSelectionEdits = SurroundSelectionOperation.getEdits(config, model, selections, ch, isDoingComposition);\n\t\tif (surroundSelectionEdits !== undefined) {\n\t\t\treturn surroundSelectionEdits;\n\t\t}\n\n\t\tconst interceptorElectricCharOperation = InterceptorElectricCharOperation.getEdits(prevEditOperationType, config, model, selections, ch, isDoingComposition);\n\t\tif (interceptorElectricCharOperation !== undefined) {\n\t\t\treturn interceptorElectricCharOperation;\n\t\t}\n\n\t\treturn SimpleCharacterTypeOperation.getEdits(config, prevEditOperationType, selections, ch, isDoingComposition);\n\t}\n\n\tpublic static typeWithoutInterceptors(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], str: string): EditOperationResult {\n\t\treturn TypeWithoutInterceptorsOperation.getEdits(prevEditOperationType, selections, str);\n\t}\n}\n\nexport class CompositionOutcome {\n\tconstructor(\n\t\tpublic readonly deletedText: string,\n\t\tpublic readonly deletedSelectionStart: number,\n\t\tpublic readonly deletedSelectionEnd: number,\n\t\tpublic readonly insertedText: string,\n\t\tpublic readonly insertedSelectionStart: number,\n\t\tpublic readonly insertedSelectionEnd: number,\n\t\tpublic readonly insertedTextRange: Range,\n\t) { }\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/cursor/cursorTypeOperations.ts","vs/editor/common/cursor/cursorTypeOperations.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,mCAAmC,EAAE,MAAM,yCAAyC,CAAC;AAC9F,OAAO,EAAuB,mBAAmB,EAAyC,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAM9H,OAAO,EAAE,gCAAgC,EAAE,4BAA4B,EAAE,4CAA4C,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,+BAA+B,EAAE,cAAc,EAAE,gCAAgC,EAAE,cAAc,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,YAAY,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AAEza,MAAM,OAAO,cAAc;IAEnB,MAAM,CAAC,MAAM,CAAC,MAA2B,EAAE,KAAgC,EAAE,UAA8B;QACjH,IAAI,KAAK,KAAK,IAAI,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;YAC3C,OAAO,EAAE,CAAC;QACX,CAAC;QAED,MAAM,QAAQ,GAAe,EAAE,CAAC;QAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YACvD,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,YAA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EAAE,UAAU,EAAE,EAAE,EAAE,kBAAkB,CAAC,CAAC;IACjH,CAAC;IAEM,MAAM,CAAC,uBAAuB,CAAC,qBAAwC,EAAE,MAA2B,EAAE,KAAiB,EAAE,UAAuB,EAAE,GAAW;QACnK,OAAO,gCAAgC,CAAC,QAAQ,CAAC,qBAAqB,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC;IAC1F,CAAC;CACD;AAED,MAAM,OAAO,kBAAkB;IAC9B,YACiB,WAAmB,EACnB,qBAA6B,EAC7B,mBAA2B,EAC3B,YAAoB,EACpB,sBAA8B,EAC9B,oBAA4B,EAC5B,iBAAwB;QANxB,gBAAW,GAAX,WAAW,CAAQ;QACnB,0BAAqB,GAArB,qBAAqB,CAAQ;QAC7B,wBAAmB,GAAnB,mBAAmB,CAAQ;QAC3B,iBAAY,GAAZ,YAAY,CAAQ;QACpB,2BAAsB,GAAtB,sBAAsB,CAAQ;QAC9B,yBAAoB,GAApB,oBAAoB,CAAQ;QAC5B,sBAAiB,GAAjB,iBAAiB,CAAO;IACrC,CAAC;CACL","file":"cursorTypeOperations.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 { ShiftCommand } from '../commands/shiftCommand.js';\nimport { CompositionSurroundSelectionCommand } from '../commands/surroundSelectionCommand.js';\nimport { CursorConfiguration, EditOperationResult, EditOperationType, ICursorSimpleModel, isQuote } from '../cursorCommon.js';\nimport { Range } from '../core/range.js';\nimport { Selection } from '../core/selection.js';\nimport { Position } from '../core/position.js';\nimport { ICommand } from '../editorCommon.js';\nimport { ITextModel } from '../model.js';\nimport { AutoClosingOpenCharTypeOperation, AutoClosingOvertypeOperation, AutoClosingOvertypeWithInterceptorsOperation, AutoIndentOperation, CompositionOperation, CompositionEndOvertypeOperation, EnterOperation, InterceptorElectricCharOperation, PasteOperation, shouldSurroundChar, SimpleCharacterTypeOperation, SurroundSelectionOperation, TabOperation, TypeWithoutInterceptorsOperation } from './cursorTypeEditOperations.js';\n\nexport class TypeOperations {\n\n\tpublic static indent(config: CursorConfiguration, model: ICursorSimpleModel | null, selections: Selection[] | null): ICommand[] {\n\t\tif (model === null || selections === null) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tcommands[i] = new ShiftCommand(selections[i], {\n\t\t\t\tisUnshift: false,\n\t\t\t\ttabSize: config.tabSize,\n\t\t\t\tindentSize: config.indentSize,\n\t\t\t\tinsertSpaces: config.insertSpaces,\n\t\t\t\tuseTabStops: config.useTabStops,\n\t\t\t\tautoIndent: config.autoIndent\n\t\t\t}, config.languageConfigurationService);\n\t\t}\n\t\treturn commands;\n\t}\n\n\tpublic static outdent(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[]): ICommand[] {\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tcommands[i] = new ShiftCommand(selections[i], {\n\t\t\t\tisUnshift: true,\n\t\t\t\ttabSize: config.tabSize,\n\t\t\t\tindentSize: config.indentSize,\n\t\t\t\tinsertSpaces: config.insertSpaces,\n\t\t\t\tuseTabStops: config.useTabStops,\n\t\t\t\tautoIndent: config.autoIndent\n\t\t\t}, config.languageConfigurationService);\n\t\t}\n\t\treturn commands;\n\t}\n\n\tpublic static paste(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[], text: string, pasteOnNewLine: boolean, multicursorText: string[], isBlock: boolean = false): EditOperationResult {\n\t\treturn PasteOperation.getEdits(config, model, selections, text, pasteOnNewLine, multicursorText, isBlock);\n\t}\n\n\tpublic static tab(config: CursorConfiguration, model: ITextModel, selections: Selection[]): ICommand[] {\n\t\treturn TabOperation.getCommands(config, model, selections);\n\t}\n\n\tpublic static compositionType(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], text: string, replacePrevCharCnt: number, replaceNextCharCnt: number, positionDelta: number): EditOperationResult {\n\t\treturn CompositionOperation.getEdits(prevEditOperationType, config, model, selections, text, replacePrevCharCnt, replaceNextCharCnt, positionDelta);\n\t}\n\n\t/**\n\t * This is very similar with typing, but the character is already in the text buffer!\n\t */\n\tpublic static compositionEndWithInterceptors(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, compositions: CompositionOutcome[] | null, selections: Selection[], autoClosedCharacters: Range[]): EditOperationResult | null {\n\t\tif (!compositions) {\n\t\t\t// could not deduce what the composition did\n\t\t\treturn null;\n\t\t}\n\n\t\tlet insertedText: string | null = null;\n\t\tfor (const composition of compositions) {\n\t\t\tif (insertedText === null) {\n\t\t\t\tinsertedText = composition.insertedText;\n\t\t\t} else if (insertedText !== composition.insertedText) {\n\t\t\t\t// not all selections agree on what was typed\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tif (!insertedText || insertedText.length !== 1) {\n\t\t\t// we're only interested in the case where a single character was inserted\n\t\t\treturn CompositionEndOvertypeOperation.getEdits(config, compositions);\n\t\t}\n\n\t\tconst ch = insertedText;\n\n\t\tlet hasDeletion = false;\n\t\tfor (const composition of compositions) {\n\t\t\tif (composition.deletedText.length !== 0) {\n\t\t\t\thasDeletion = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (hasDeletion) {\n\t\t\t// Check if this could have been a surround selection\n\n\t\t\tif (!shouldSurroundChar(config, ch) || !config.surroundingPairs.hasOwnProperty(ch)) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst isTypingAQuoteCharacter = isQuote(ch);\n\n\t\t\tfor (const composition of compositions) {\n\t\t\t\tif (composition.deletedSelectionStart !== 0 || composition.deletedSelectionEnd !== composition.deletedText.length) {\n\t\t\t\t\t// more text was deleted than was selected, so this could not have been a surround selection\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tif (/^[ \\t]+$/.test(composition.deletedText)) {\n\t\t\t\t\t// deleted text was only whitespace\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tif (isTypingAQuoteCharacter && isQuote(composition.deletedText)) {\n\t\t\t\t\t// deleted text was a quote\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst positions: Position[] = [];\n\t\t\tfor (const selection of selections) {\n\t\t\t\tif (!selection.isEmpty()) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tpositions.push(selection.getPosition());\n\t\t\t}\n\n\t\t\tif (positions.length !== compositions.length) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst commands: ICommand[] = [];\n\t\t\tfor (let i = 0, len = positions.length; i < len; i++) {\n\t\t\t\tcommands.push(new CompositionSurroundSelectionCommand(positions[i], compositions[i].deletedText, config.surroundingPairs[ch]));\n\t\t\t}\n\t\t\treturn new EditOperationResult(EditOperationType.TypingOther, commands, {\n\t\t\t\tshouldPushStackElementBefore: true,\n\t\t\t\tshouldPushStackElementAfter: false\n\t\t\t});\n\t\t}\n\n\t\tconst autoClosingOvertypeEdits = AutoClosingOvertypeWithInterceptorsOperation.getEdits(config, model, selections, autoClosedCharacters, ch);\n\t\tif (autoClosingOvertypeEdits !== undefined) {\n\t\t\treturn autoClosingOvertypeEdits;\n\t\t}\n\n\t\tconst autoClosingOpenCharEdits = AutoClosingOpenCharTypeOperation.getEdits(config, model, selections, ch, true, false);\n\t\tif (autoClosingOpenCharEdits !== undefined) {\n\t\t\treturn autoClosingOpenCharEdits;\n\t\t}\n\n\t\treturn CompositionEndOvertypeOperation.getEdits(config, compositions);\n\t}\n\n\tpublic static typeWithInterceptors(isDoingComposition: boolean, prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], autoClosedCharacters: Range[], ch: string): EditOperationResult {\n\n\t\tconst enterEdits = EnterOperation.getEdits(config, model, selections, ch, isDoingComposition);\n\t\tif (enterEdits !== undefined) {\n\t\t\treturn enterEdits;\n\t\t}\n\n\t\tconst autoIndentEdits = AutoIndentOperation.getEdits(config, model, selections, ch, isDoingComposition);\n\t\tif (autoIndentEdits !== undefined) {\n\t\t\treturn autoIndentEdits;\n\t\t}\n\n\t\tconst autoClosingOverTypeEdits = AutoClosingOvertypeOperation.getEdits(prevEditOperationType, config, model, selections, autoClosedCharacters, ch);\n\t\tif (autoClosingOverTypeEdits !== undefined) {\n\t\t\treturn autoClosingOverTypeEdits;\n\t\t}\n\n\t\tconst autoClosingOpenCharEdits = AutoClosingOpenCharTypeOperation.getEdits(config, model, selections, ch, false, isDoingComposition);\n\t\tif (autoClosingOpenCharEdits !== undefined) {\n\t\t\treturn autoClosingOpenCharEdits;\n\t\t}\n\n\t\tconst surroundSelectionEdits = SurroundSelectionOperation.getEdits(config, model, selections, ch, isDoingComposition);\n\t\tif (surroundSelectionEdits !== undefined) {\n\t\t\treturn surroundSelectionEdits;\n\t\t}\n\n\t\tconst interceptorElectricCharOperation = InterceptorElectricCharOperation.getEdits(prevEditOperationType, config, model, selections, ch, isDoingComposition);\n\t\tif (interceptorElectricCharOperation !== undefined) {\n\t\t\treturn interceptorElectricCharOperation;\n\t\t}\n\n\t\treturn SimpleCharacterTypeOperation.getEdits(config, prevEditOperationType, selections, ch, isDoingComposition);\n\t}\n\n\tpublic static typeWithoutInterceptors(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], str: string): EditOperationResult {\n\t\treturn TypeWithoutInterceptorsOperation.getEdits(prevEditOperationType, selections, str);\n\t}\n}\n\nexport class CompositionOutcome {\n\tconstructor(\n\t\tpublic readonly deletedText: string,\n\t\tpublic readonly deletedSelectionStart: number,\n\t\tpublic readonly deletedSelectionEnd: number,\n\t\tpublic readonly insertedText: string,\n\t\tpublic readonly insertedSelectionStart: number,\n\t\tpublic readonly insertedSelectionEnd: number,\n\t\tpublic readonly insertedTextRange: Range,\n\t) { }\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 { ShiftCommand } from '../commands/shiftCommand.js';\nimport { CompositionSurroundSelectionCommand } from '../commands/surroundSelectionCommand.js';\nimport { CursorConfiguration, EditOperationResult, EditOperationType, ICursorSimpleModel, isQuote } from '../cursorCommon.js';\nimport { Range } from '../core/range.js';\nimport { Selection } from '../core/selection.js';\nimport { Position } from '../core/position.js';\nimport { ICommand } from '../editorCommon.js';\nimport { ITextModel } from '../model.js';\nimport { AutoClosingOpenCharTypeOperation, AutoClosingOvertypeOperation, AutoClosingOvertypeWithInterceptorsOperation, AutoIndentOperation, CompositionOperation, CompositionEndOvertypeOperation, EnterOperation, InterceptorElectricCharOperation, PasteOperation, shouldSurroundChar, SimpleCharacterTypeOperation, SurroundSelectionOperation, TabOperation, TypeWithoutInterceptorsOperation } from './cursorTypeEditOperations.js';\n\nexport class TypeOperations {\n\n\tpublic static indent(config: CursorConfiguration, model: ICursorSimpleModel | null, selections: Selection[] | null): ICommand[] {\n\t\tif (model === null || selections === null) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tcommands[i] = new ShiftCommand(selections[i], {\n\t\t\t\tisUnshift: false,\n\t\t\t\ttabSize: config.tabSize,\n\t\t\t\tindentSize: config.indentSize,\n\t\t\t\tinsertSpaces: config.insertSpaces,\n\t\t\t\tuseTabStops: config.useTabStops,\n\t\t\t\tautoIndent: config.autoIndent\n\t\t\t}, config.languageConfigurationService);\n\t\t}\n\t\treturn commands;\n\t}\n\n\tpublic static outdent(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[]): ICommand[] {\n\t\tconst commands: ICommand[] = [];\n\t\tfor (let i = 0, len = selections.length; i < len; i++) {\n\t\t\tcommands[i] = new ShiftCommand(selections[i], {\n\t\t\t\tisUnshift: true,\n\t\t\t\ttabSize: config.tabSize,\n\t\t\t\tindentSize: config.indentSize,\n\t\t\t\tinsertSpaces: config.insertSpaces,\n\t\t\t\tuseTabStops: config.useTabStops,\n\t\t\t\tautoIndent: config.autoIndent\n\t\t\t}, config.languageConfigurationService);\n\t\t}\n\t\treturn commands;\n\t}\n\n\tpublic static paste(config: CursorConfiguration, model: ICursorSimpleModel, selections: Selection[], text: string, pasteOnNewLine: boolean, multicursorText: string[], isBlock: boolean = false): EditOperationResult {\n\t\treturn PasteOperation.getEdits(config, model, selections, text, pasteOnNewLine, multicursorText, isBlock);\n\t}\n\n\tpublic static tab(config: CursorConfiguration, model: ITextModel, selections: Selection[]): ICommand[] {\n\t\treturn TabOperation.getCommands(config, model, selections);\n\t}\n\n\tpublic static compositionType(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], text: string, replacePrevCharCnt: number, replaceNextCharCnt: number, positionDelta: number): EditOperationResult {\n\t\treturn CompositionOperation.getEdits(prevEditOperationType, config, model, selections, text, replacePrevCharCnt, replaceNextCharCnt, positionDelta);\n\t}\n\n\t/**\n\t * This is very similar with typing, but the character is already in the text buffer!\n\t */\n\tpublic static compositionEndWithInterceptors(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, compositions: CompositionOutcome[] | null, selections: Selection[], autoClosedCharacters: Range[]): EditOperationResult | null {\n\t\tif (!compositions) {\n\t\t\t// could not deduce what the composition did\n\t\t\treturn null;\n\t\t}\n\n\t\tlet insertedText: string | null = null;\n\t\tfor (const composition of compositions) {\n\t\t\tif (insertedText === null) {\n\t\t\t\tinsertedText = composition.insertedText;\n\t\t\t} else if (insertedText !== composition.insertedText) {\n\t\t\t\t// not all selections agree on what was typed\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tif (!insertedText || insertedText.length !== 1) {\n\t\t\t// we're only interested in the case where a single character was inserted\n\t\t\treturn CompositionEndOvertypeOperation.getEdits(config, compositions);\n\t\t}\n\n\t\tconst ch = insertedText;\n\n\t\tlet hasDeletion = false;\n\t\tfor (const composition of compositions) {\n\t\t\tif (composition.deletedText.length !== 0) {\n\t\t\t\thasDeletion = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (hasDeletion) {\n\t\t\t// Check if this could have been a surround selection\n\n\t\t\tif (!shouldSurroundChar(config, ch) || !config.surroundingPairs.hasOwnProperty(ch)) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst isTypingAQuoteCharacter = isQuote(ch);\n\n\t\t\tfor (const composition of compositions) {\n\t\t\t\tif (composition.deletedSelectionStart !== 0 || composition.deletedSelectionEnd !== composition.deletedText.length) {\n\t\t\t\t\t// more text was deleted than was selected, so this could not have been a surround selection\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tif (/^[ \\t]+$/.test(composition.deletedText)) {\n\t\t\t\t\t// deleted text was only whitespace\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tif (isTypingAQuoteCharacter && isQuote(composition.deletedText)) {\n\t\t\t\t\t// deleted text was a quote\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst positions: Position[] = [];\n\t\t\tfor (const selection of selections) {\n\t\t\t\tif (!selection.isEmpty()) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tpositions.push(selection.getPosition());\n\t\t\t}\n\n\t\t\tif (positions.length !== compositions.length) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst commands: ICommand[] = [];\n\t\t\tfor (let i = 0, len = positions.length; i < len; i++) {\n\t\t\t\tcommands.push(new CompositionSurroundSelectionCommand(positions[i], compositions[i].deletedText, config.surroundingPairs[ch]));\n\t\t\t}\n\t\t\treturn new EditOperationResult(EditOperationType.TypingOther, commands, {\n\t\t\t\tshouldPushStackElementBefore: true,\n\t\t\t\tshouldPushStackElementAfter: false\n\t\t\t});\n\t\t}\n\n\t\tconst autoClosingOvertypeEdits = AutoClosingOvertypeWithInterceptorsOperation.getEdits(config, model, selections, autoClosedCharacters, ch);\n\t\tif (autoClosingOvertypeEdits !== undefined) {\n\t\t\treturn autoClosingOvertypeEdits;\n\t\t}\n\n\t\tconst autoClosingOpenCharEdits = AutoClosingOpenCharTypeOperation.getEdits(config, model, selections, ch, true, false);\n\t\tif (autoClosingOpenCharEdits !== undefined) {\n\t\t\treturn autoClosingOpenCharEdits;\n\t\t}\n\n\t\treturn CompositionEndOvertypeOperation.getEdits(config, compositions);\n\t}\n\n\tpublic static typeWithInterceptors(isDoingComposition: boolean, prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], autoClosedCharacters: Range[], ch: string): EditOperationResult {\n\n\t\tconst enterEdits = EnterOperation.getEdits(config, model, selections, ch, isDoingComposition);\n\t\tif (enterEdits !== undefined) {\n\t\t\treturn enterEdits;\n\t\t}\n\n\t\tconst autoIndentEdits = AutoIndentOperation.getEdits(config, model, selections, ch, isDoingComposition);\n\t\tif (autoIndentEdits !== undefined) {\n\t\t\treturn autoIndentEdits;\n\t\t}\n\n\t\tconst autoClosingOverTypeEdits = AutoClosingOvertypeOperation.getEdits(prevEditOperationType, config, model, selections, autoClosedCharacters, ch);\n\t\tif (autoClosingOverTypeEdits !== undefined) {\n\t\t\treturn autoClosingOverTypeEdits;\n\t\t}\n\n\t\tconst autoClosingOpenCharEdits = AutoClosingOpenCharTypeOperation.getEdits(config, model, selections, ch, false, isDoingComposition);\n\t\tif (autoClosingOpenCharEdits !== undefined) {\n\t\t\treturn autoClosingOpenCharEdits;\n\t\t}\n\n\t\tconst surroundSelectionEdits = SurroundSelectionOperation.getEdits(config, model, selections, ch, isDoingComposition);\n\t\tif (surroundSelectionEdits !== undefined) {\n\t\t\treturn surroundSelectionEdits;\n\t\t}\n\n\t\tconst interceptorElectricCharOperation = InterceptorElectricCharOperation.getEdits(prevEditOperationType, config, model, selections, ch, isDoingComposition);\n\t\tif (interceptorElectricCharOperation !== undefined) {\n\t\t\treturn interceptorElectricCharOperation;\n\t\t}\n\n\t\treturn SimpleCharacterTypeOperation.getEdits(config, prevEditOperationType, selections, ch, isDoingComposition);\n\t}\n\n\tpublic static typeWithoutInterceptors(prevEditOperationType: EditOperationType, config: CursorConfiguration, model: ITextModel, selections: Selection[], str: string): EditOperationResult {\n\t\treturn TypeWithoutInterceptorsOperation.getEdits(prevEditOperationType, selections, str);\n\t}\n}\n\nexport class CompositionOutcome {\n\tconstructor(\n\t\tpublic readonly deletedText: string,\n\t\tpublic readonly deletedSelectionStart: number,\n\t\tpublic readonly deletedSelectionEnd: number,\n\t\tpublic readonly insertedText: string,\n\t\tpublic readonly insertedSelectionStart: number,\n\t\tpublic readonly insertedSelectionEnd: number,\n\t\tpublic readonly insertedTextRange: Range,\n\t) { }\n}\n"]}
@@ -14,48 +14,48 @@ const autoCloseNever = () => false;
14
14
  const autoCloseBeforeWhitespace = (chr) => (chr === ' ' || chr === '\t');
15
15
  export class CursorConfiguration {
16
16
  static shouldRecreate(e) {
17
- return (e.hasChanged(166 /* EditorOption.layoutInfo */)
18
- || e.hasChanged(148 /* EditorOption.wordSeparators */)
17
+ return (e.hasChanged(169 /* EditorOption.layoutInfo */)
18
+ || e.hasChanged(151 /* EditorOption.wordSeparators */)
19
19
  || e.hasChanged(45 /* EditorOption.emptySelectionClipboard */)
20
- || e.hasChanged(85 /* EditorOption.multiCursorMergeOverlapping */)
21
- || e.hasChanged(88 /* EditorOption.multiCursorPaste */)
22
- || e.hasChanged(89 /* EditorOption.multiCursorLimit */)
20
+ || e.hasChanged(86 /* EditorOption.multiCursorMergeOverlapping */)
21
+ || e.hasChanged(89 /* EditorOption.multiCursorPaste */)
22
+ || e.hasChanged(90 /* EditorOption.multiCursorLimit */)
23
23
  || e.hasChanged(10 /* EditorOption.autoClosingBrackets */)
24
24
  || e.hasChanged(11 /* EditorOption.autoClosingComments */)
25
25
  || e.hasChanged(15 /* EditorOption.autoClosingQuotes */)
26
26
  || e.hasChanged(13 /* EditorOption.autoClosingDelete */)
27
27
  || e.hasChanged(14 /* EditorOption.autoClosingOvertype */)
28
28
  || e.hasChanged(20 /* EditorOption.autoSurround */)
29
- || e.hasChanged(145 /* EditorOption.useTabStops */)
30
- || e.hasChanged(141 /* EditorOption.trimWhitespaceOnDelete */)
29
+ || e.hasChanged(148 /* EditorOption.useTabStops */)
30
+ || e.hasChanged(144 /* EditorOption.trimWhitespaceOnDelete */)
31
31
  || e.hasChanged(59 /* EditorOption.fontInfo */)
32
- || e.hasChanged(104 /* EditorOption.readOnly */)
33
- || e.hasChanged(147 /* EditorOption.wordSegmenterLocales */)
34
- || e.hasChanged(93 /* EditorOption.overtypeOnPaste */));
32
+ || e.hasChanged(106 /* EditorOption.readOnly */)
33
+ || e.hasChanged(150 /* EditorOption.wordSegmenterLocales */)
34
+ || e.hasChanged(95 /* EditorOption.overtypeOnPaste */));
35
35
  }
36
36
  constructor(languageId, modelOptions, configuration, languageConfigurationService) {
37
37
  this.languageConfigurationService = languageConfigurationService;
38
38
  this._cursorMoveConfigurationBrand = undefined;
39
39
  this._languageId = languageId;
40
40
  const options = configuration.options;
41
- const layoutInfo = options.get(166 /* EditorOption.layoutInfo */);
41
+ const layoutInfo = options.get(169 /* EditorOption.layoutInfo */);
42
42
  const fontInfo = options.get(59 /* EditorOption.fontInfo */);
43
- this.readOnly = options.get(104 /* EditorOption.readOnly */);
43
+ this.readOnly = options.get(106 /* EditorOption.readOnly */);
44
44
  this.tabSize = modelOptions.tabSize;
45
45
  this.indentSize = modelOptions.indentSize;
46
46
  this.insertSpaces = modelOptions.insertSpaces;
47
- this.stickyTabStops = options.get(132 /* EditorOption.stickyTabStops */);
47
+ this.stickyTabStops = options.get(135 /* EditorOption.stickyTabStops */);
48
48
  this.lineHeight = fontInfo.lineHeight;
49
49
  this.typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth;
50
50
  this.pageSize = Math.max(1, Math.floor(layoutInfo.height / this.lineHeight) - 2);
51
- this.useTabStops = options.get(145 /* EditorOption.useTabStops */);
52
- this.trimWhitespaceOnDelete = options.get(141 /* EditorOption.trimWhitespaceOnDelete */);
53
- this.wordSeparators = options.get(148 /* EditorOption.wordSeparators */);
51
+ this.useTabStops = options.get(148 /* EditorOption.useTabStops */);
52
+ this.trimWhitespaceOnDelete = options.get(144 /* EditorOption.trimWhitespaceOnDelete */);
53
+ this.wordSeparators = options.get(151 /* EditorOption.wordSeparators */);
54
54
  this.emptySelectionClipboard = options.get(45 /* EditorOption.emptySelectionClipboard */);
55
55
  this.copyWithSyntaxHighlighting = options.get(31 /* EditorOption.copyWithSyntaxHighlighting */);
56
- this.multiCursorMergeOverlapping = options.get(85 /* EditorOption.multiCursorMergeOverlapping */);
57
- this.multiCursorPaste = options.get(88 /* EditorOption.multiCursorPaste */);
58
- this.multiCursorLimit = options.get(89 /* EditorOption.multiCursorLimit */);
56
+ this.multiCursorMergeOverlapping = options.get(86 /* EditorOption.multiCursorMergeOverlapping */);
57
+ this.multiCursorPaste = options.get(89 /* EditorOption.multiCursorPaste */);
58
+ this.multiCursorLimit = options.get(90 /* EditorOption.multiCursorLimit */);
59
59
  this.autoClosingBrackets = options.get(10 /* EditorOption.autoClosingBrackets */);
60
60
  this.autoClosingComments = options.get(11 /* EditorOption.autoClosingComments */);
61
61
  this.autoClosingQuotes = options.get(15 /* EditorOption.autoClosingQuotes */);
@@ -63,8 +63,8 @@ export class CursorConfiguration {
63
63
  this.autoClosingOvertype = options.get(14 /* EditorOption.autoClosingOvertype */);
64
64
  this.autoSurround = options.get(20 /* EditorOption.autoSurround */);
65
65
  this.autoIndent = options.get(16 /* EditorOption.autoIndent */);
66
- this.wordSegmenterLocales = options.get(147 /* EditorOption.wordSegmenterLocales */);
67
- this.overtypeOnPaste = options.get(93 /* EditorOption.overtypeOnPaste */);
66
+ this.wordSegmenterLocales = options.get(150 /* EditorOption.wordSegmenterLocales */);
67
+ this.overtypeOnPaste = options.get(95 /* EditorOption.overtypeOnPaste */);
68
68
  this.surroundingPairs = {};
69
69
  this._electricChars = null;
70
70
  this.shouldAutoCloseBefore = {
@@ -240,6 +240,7 @@ export class EditOperationResult {
240
240
  this.commands = commands;
241
241
  this.shouldPushStackElementBefore = opts.shouldPushStackElementBefore;
242
242
  this.shouldPushStackElementAfter = opts.shouldPushStackElementAfter;
243
+ this.followUp = opts.followUp;
243
244
  }
244
245
  }
245
246
  export function isQuote(ch) {
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/cursorCommon.ts","vs/editor/common/cursorCommon.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAIhG,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAc,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAM5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AA2B3C,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;AACnC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC;AACnC,MAAM,yBAAyB,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,IAAI,CAAC,CAAC;AAEjF,MAAM,OAAO,mBAAmB;IAoCxB,MAAM,CAAC,cAAc,CAAC,CAA4B;QACxD,OAAO,CACN,CAAC,CAAC,UAAU,mCAAyB;eAClC,CAAC,CAAC,UAAU,uCAA6B;eACzC,CAAC,CAAC,UAAU,+CAAsC;eAClD,CAAC,CAAC,UAAU,mDAA0C;e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EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC;AAClD,CAAC","file":"cursorCommon.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 { ConfigurationChangedEvent, EditorAutoClosingEditStrategy, EditorAutoClosingStrategy, EditorAutoIndentStrategy, EditorAutoSurroundStrategy, EditorOption } from './config/editorOptions.js';\nimport { LineTokens } from './tokens/lineTokens.js';\nimport { Position } from './core/position.js';\nimport { Range } from './core/range.js';\nimport { ISelection, Selection } from './core/selection.js';\nimport { ICommand } from './editorCommon.js';\nimport { IEditorConfiguration } from './config/editorConfiguration.js';\nimport { PositionAffinity, TextModelResolvedOptions } from './model.js';\nimport { AutoClosingPairs } from './languages/languageConfiguration.js';\nimport { ILanguageConfigurationService } from './languages/languageConfigurationRegistry.js';\nimport { createScopedLineTokens } from './languages/supports.js';\nimport { IElectricAction } from './languages/supports/electricCharacter.js';\nimport { CursorColumns } from './core/cursorColumns.js';\nimport { normalizeIndentation } from './core/misc/indentation.js';\nimport { InputMode } from './inputMode.js';\n\nexport interface IColumnSelectData {\n\tisReal: boolean;\n\tfromViewLineNumber: number;\n\tfromViewVisualColumn: number;\n\ttoViewLineNumber: number;\n\ttoViewVisualColumn: number;\n}\n\n/**\n * This is an operation type that will be recorded for undo/redo purposes.\n * The goal is to introduce an undo stop when the controller switches between different operation types.\n */\nexport const enum EditOperationType {\n\tOther = 0,\n\tDeletingLeft = 2,\n\tDeletingRight = 3,\n\tTypingOther = 4,\n\tTypingFirstSpace = 5,\n\tTypingConsecutiveSpace = 6,\n}\n\nexport interface CharacterMap {\n\t[char: string]: string;\n}\n\nconst autoCloseAlways = () => true;\nconst autoCloseNever = () => false;\nconst autoCloseBeforeWhitespace = (chr: string) => (chr === ' ' || chr === '\\t');\n\nexport class CursorConfiguration {\n\t_cursorMoveConfigurationBrand: void = undefined;\n\n\tpublic readonly readOnly: boolean;\n\tpublic readonly tabSize: number;\n\tpublic readonly indentSize: number;\n\tpublic readonly insertSpaces: boolean;\n\tpublic readonly stickyTabStops: boolean;\n\tpublic readonly pageSize: number;\n\tpublic readonly lineHeight: number;\n\tpublic readonly typicalHalfwidthCharacterWidth: number;\n\tpublic readonly useTabStops: boolean;\n\tpublic readonly trimWhitespaceOnDelete: boolean;\n\tpublic readonly wordSeparators: string;\n\tpublic readonly emptySelectionClipboard: boolean;\n\tpublic readonly copyWithSyntaxHighlighting: boolean;\n\tpublic readonly multiCursorMergeOverlapping: boolean;\n\tpublic readonly multiCursorPaste: 'spread' | 'full';\n\tpublic readonly multiCursorLimit: number;\n\tpublic readonly autoClosingBrackets: EditorAutoClosingStrategy;\n\tpublic readonly autoClosingComments: EditorAutoClosingStrategy;\n\tpublic readonly autoClosingQuotes: EditorAutoClosingStrategy;\n\tpublic readonly autoClosingDelete: EditorAutoClosingEditStrategy;\n\tpublic readonly autoClosingOvertype: EditorAutoClosingEditStrategy;\n\tpublic readonly autoSurround: EditorAutoSurroundStrategy;\n\tpublic readonly autoIndent: EditorAutoIndentStrategy;\n\tpublic readonly autoClosingPairs: AutoClosingPairs;\n\tpublic readonly surroundingPairs: CharacterMap;\n\tpublic readonly blockCommentStartToken: string | null;\n\tpublic readonly shouldAutoCloseBefore: { quote: (ch: string) => boolean; bracket: (ch: string) => boolean; comment: (ch: string) => boolean };\n\tpublic readonly wordSegmenterLocales: string[];\n\tpublic readonly overtypeOnPaste: boolean;\n\n\tprivate readonly _languageId: string;\n\tprivate _electricChars: { [key: string]: boolean } | null;\n\n\tpublic static shouldRecreate(e: ConfigurationChangedEvent): boolean {\n\t\treturn (\n\t\t\te.hasChanged(EditorOption.layoutInfo)\n\t\t\t|| e.hasChanged(EditorOption.wordSeparators)\n\t\t\t|| e.hasChanged(EditorOption.emptySelectionClipboard)\n\t\t\t|| e.hasChanged(EditorOption.multiCursorMergeOverlapping)\n\t\t\t|| e.hasChanged(EditorOption.multiCursorPaste)\n\t\t\t|| e.hasChanged(EditorOption.multiCursorLimit)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingBrackets)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingComments)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingQuotes)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingDelete)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingOvertype)\n\t\t\t|| e.hasChanged(EditorOption.autoSurround)\n\t\t\t|| e.hasChanged(EditorOption.useTabStops)\n\t\t\t|| e.hasChanged(EditorOption.trimWhitespaceOnDelete)\n\t\t\t|| e.hasChanged(EditorOption.fontInfo)\n\t\t\t|| e.hasChanged(EditorOption.readOnly)\n\t\t\t|| e.hasChanged(EditorOption.wordSegmenterLocales)\n\t\t\t|| e.hasChanged(EditorOption.overtypeOnPaste)\n\t\t);\n\t}\n\n\tconstructor(\n\t\tlanguageId: string,\n\t\tmodelOptions: TextModelResolvedOptions,\n\t\tconfiguration: IEditorConfiguration,\n\t\tpublic readonly languageConfigurationService: ILanguageConfigurationService\n\t) {\n\t\tthis._languageId = languageId;\n\n\t\tconst options = configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tconst fontInfo = options.get(EditorOption.fontInfo);\n\n\t\tthis.readOnly = options.get(EditorOption.readOnly);\n\t\tthis.tabSize = modelOptions.tabSize;\n\t\tthis.indentSize = modelOptions.indentSize;\n\t\tthis.insertSpaces = modelOptions.insertSpaces;\n\t\tthis.stickyTabStops = options.get(EditorOption.stickyTabStops);\n\t\tthis.lineHeight = fontInfo.lineHeight;\n\t\tthis.typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth;\n\t\tthis.pageSize = Math.max(1, Math.floor(layoutInfo.height / this.lineHeight) - 2);\n\t\tthis.useTabStops = options.get(EditorOption.useTabStops);\n\t\tthis.trimWhitespaceOnDelete = options.get(EditorOption.trimWhitespaceOnDelete);\n\t\tthis.wordSeparators = options.get(EditorOption.wordSeparators);\n\t\tthis.emptySelectionClipboard = options.get(EditorOption.emptySelectionClipboard);\n\t\tthis.copyWithSyntaxHighlighting = options.get(EditorOption.copyWithSyntaxHighlighting);\n\t\tthis.multiCursorMergeOverlapping = options.get(EditorOption.multiCursorMergeOverlapping);\n\t\tthis.multiCursorPaste = options.get(EditorOption.multiCursorPaste);\n\t\tthis.multiCursorLimit = options.get(EditorOption.multiCursorLimit);\n\t\tthis.autoClosingBrackets = options.get(EditorOption.autoClosingBrackets);\n\t\tthis.autoClosingComments = options.get(EditorOption.autoClosingComments);\n\t\tthis.autoClosingQuotes = options.get(EditorOption.autoClosingQuotes);\n\t\tthis.autoClosingDelete = options.get(EditorOption.autoClosingDelete);\n\t\tthis.autoClosingOvertype = options.get(EditorOption.autoClosingOvertype);\n\t\tthis.autoSurround = options.get(EditorOption.autoSurround);\n\t\tthis.autoIndent = options.get(EditorOption.autoIndent);\n\t\tthis.wordSegmenterLocales = options.get(EditorOption.wordSegmenterLocales);\n\t\tthis.overtypeOnPaste = options.get(EditorOption.overtypeOnPaste);\n\n\t\tthis.surroundingPairs = {};\n\t\tthis._electricChars = null;\n\n\t\tthis.shouldAutoCloseBefore = {\n\t\t\tquote: this._getShouldAutoClose(languageId, this.autoClosingQuotes, true),\n\t\t\tcomment: this._getShouldAutoClose(languageId, this.autoClosingComments, false),\n\t\t\tbracket: this._getShouldAutoClose(languageId, this.autoClosingBrackets, false),\n\t\t};\n\n\t\tthis.autoClosingPairs = this.languageConfigurationService.getLanguageConfiguration(languageId).getAutoClosingPairs();\n\n\t\tconst surroundingPairs = this.languageConfigurationService.getLanguageConfiguration(languageId).getSurroundingPairs();\n\t\tif (surroundingPairs) {\n\t\t\tfor (const pair of surroundingPairs) {\n\t\t\t\tthis.surroundingPairs[pair.open] = pair.close;\n\t\t\t}\n\t\t}\n\n\t\tconst commentsConfiguration = this.languageConfigurationService.getLanguageConfiguration(languageId).comments;\n\t\tthis.blockCommentStartToken = commentsConfiguration?.blockCommentStartToken ?? null;\n\t}\n\n\tpublic get electricChars() {\n\t\tif (!this._electricChars) {\n\t\t\tthis._electricChars = {};\n\t\t\tconst electricChars = this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter?.getElectricCharacters();\n\t\t\tif (electricChars) {\n\t\t\t\tfor (const char of electricChars) {\n\t\t\t\t\tthis._electricChars[char] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this._electricChars;\n\t}\n\n\tpublic get inputMode(): 'insert' | 'overtype' {\n\t\treturn InputMode.getInputMode();\n\t}\n\n\t/**\n\t * Should return opening bracket type to match indentation with\n\t */\n\tpublic onElectricCharacter(character: string, context: LineTokens, column: number): IElectricAction | null {\n\t\tconst scopedLineTokens = createScopedLineTokens(context, column - 1);\n\t\tconst electricCharacterSupport = this.languageConfigurationService.getLanguageConfiguration(scopedLineTokens.languageId).electricCharacter;\n\t\tif (!electricCharacterSupport) {\n\t\t\treturn null;\n\t\t}\n\t\treturn electricCharacterSupport.onElectricCharacter(character, scopedLineTokens, column - scopedLineTokens.firstCharOffset);\n\t}\n\n\tpublic normalizeIndentation(str: string): string {\n\t\treturn normalizeIndentation(str, this.indentSize, this.insertSpaces);\n\t}\n\n\tprivate _getShouldAutoClose(languageId: string, autoCloseConfig: EditorAutoClosingStrategy, forQuotes: boolean): (ch: string) => boolean {\n\t\tswitch (autoCloseConfig) {\n\t\t\tcase 'beforeWhitespace':\n\t\t\t\treturn autoCloseBeforeWhitespace;\n\t\t\tcase 'languageDefined':\n\t\t\t\treturn this._getLanguageDefinedShouldAutoClose(languageId, forQuotes);\n\t\t\tcase 'always':\n\t\t\t\treturn autoCloseAlways;\n\t\t\tcase 'never':\n\t\t\t\treturn autoCloseNever;\n\t\t}\n\t}\n\n\tprivate _getLanguageDefinedShouldAutoClose(languageId: string, forQuotes: boolean): (ch: string) => boolean {\n\t\tconst autoCloseBeforeSet = this.languageConfigurationService.getLanguageConfiguration(languageId).getAutoCloseBeforeSet(forQuotes);\n\t\treturn c => autoCloseBeforeSet.indexOf(c) !== -1;\n\t}\n\n\t/**\n\t * Returns a visible column from a column.\n\t * @see {@link CursorColumns}\n\t */\n\tpublic visibleColumnFromColumn(model: ICursorSimpleModel, position: Position): number {\n\t\treturn CursorColumns.visibleColumnFromColumn(model.getLineContent(position.lineNumber), position.column, this.tabSize);\n\t}\n\n\t/**\n\t * Returns a visible column from a column.\n\t * @see {@link CursorColumns}\n\t */\n\tpublic columnFromVisibleColumn(model: ICursorSimpleModel, lineNumber: number, visibleColumn: number): number {\n\t\tconst result = CursorColumns.columnFromVisibleColumn(model.getLineContent(lineNumber), visibleColumn, this.tabSize);\n\n\t\tconst minColumn = model.getLineMinColumn(lineNumber);\n\t\tif (result < minColumn) {\n\t\t\treturn minColumn;\n\t\t}\n\n\t\tconst maxColumn = model.getLineMaxColumn(lineNumber);\n\t\tif (result > maxColumn) {\n\t\t\treturn maxColumn;\n\t\t}\n\n\t\treturn result;\n\t}\n}\n\n/**\n * Represents a simple model (either the model or the view model).\n */\nexport interface ICursorSimpleModel {\n\tgetLineCount(): number;\n\tgetLineContent(lineNumber: number): string;\n\tgetLineMinColumn(lineNumber: number): number;\n\tgetLineMaxColumn(lineNumber: number): number;\n\tgetLineFirstNonWhitespaceColumn(lineNumber: number): number;\n\tnormalizePosition(position: Position, affinity: PositionAffinity): Position;\n\n\t/**\n\t * Gets the column at which indentation stops at a given line.\n\t * @internal\n\t */\n\tgetLineIndentColumn(lineNumber: number): number;\n}\n\nexport type PartialCursorState = CursorState | PartialModelCursorState | PartialViewCursorState;\n\nexport class CursorState {\n\t_cursorStateBrand: void = undefined;\n\n\tpublic static fromModelState(modelState: SingleCursorState): PartialModelCursorState {\n\t\treturn new PartialModelCursorState(modelState);\n\t}\n\n\tpublic static fromViewState(viewState: SingleCursorState): PartialViewCursorState {\n\t\treturn new PartialViewCursorState(viewState);\n\t}\n\n\tpublic static fromModelSelection(modelSelection: ISelection): PartialModelCursorState {\n\t\tconst selection = Selection.liftSelection(modelSelection);\n\t\tconst modelState = new SingleCursorState(\n\t\t\tRange.fromPositions(selection.getSelectionStart()),\n\t\t\tSelectionStartKind.Simple, 0,\n\t\t\tselection.getPosition(), 0\n\t\t);\n\t\treturn CursorState.fromModelState(modelState);\n\t}\n\n\tpublic static fromModelSelections(modelSelections: readonly ISelection[]): PartialModelCursorState[] {\n\t\tconst states: PartialModelCursorState[] = [];\n\t\tfor (let i = 0, len = modelSelections.length; i < len; i++) {\n\t\t\tstates[i] = this.fromModelSelection(modelSelections[i]);\n\t\t}\n\t\treturn states;\n\t}\n\n\treadonly modelState: SingleCursorState;\n\treadonly viewState: SingleCursorState;\n\n\tconstructor(modelState: SingleCursorState, viewState: SingleCursorState) {\n\t\tthis.modelState = modelState;\n\t\tthis.viewState = viewState;\n\t}\n\n\tpublic equals(other: CursorState): boolean {\n\t\treturn (this.viewState.equals(other.viewState) && this.modelState.equals(other.modelState));\n\t}\n}\n\nexport class PartialModelCursorState {\n\treadonly modelState: SingleCursorState;\n\treadonly viewState: null;\n\n\tconstructor(modelState: SingleCursorState) {\n\t\tthis.modelState = modelState;\n\t\tthis.viewState = null;\n\t}\n}\n\nexport class PartialViewCursorState {\n\treadonly modelState: null;\n\treadonly viewState: SingleCursorState;\n\n\tconstructor(viewState: SingleCursorState) {\n\t\tthis.modelState = null;\n\t\tthis.viewState = viewState;\n\t}\n}\n\nexport const enum SelectionStartKind {\n\tSimple,\n\tWord,\n\tLine\n}\n\n/**\n * Represents the cursor state on either the model or on the view model.\n */\nexport class SingleCursorState {\n\t_singleCursorStateBrand: void = undefined;\n\n\tpublic readonly selection: Selection;\n\n\tconstructor(\n\t\tpublic readonly selectionStart: Range,\n\t\tpublic readonly selectionStartKind: SelectionStartKind,\n\t\tpublic readonly selectionStartLeftoverVisibleColumns: number,\n\t\tpublic readonly position: Position,\n\t\tpublic readonly leftoverVisibleColumns: number,\n\t) {\n\t\tthis.selection = SingleCursorState._computeSelection(this.selectionStart, this.position);\n\t}\n\n\tpublic equals(other: SingleCursorState) {\n\t\treturn (\n\t\t\tthis.selectionStartLeftoverVisibleColumns === other.selectionStartLeftoverVisibleColumns\n\t\t\t&& this.leftoverVisibleColumns === other.leftoverVisibleColumns\n\t\t\t&& this.selectionStartKind === other.selectionStartKind\n\t\t\t&& this.position.equals(other.position)\n\t\t\t&& this.selectionStart.equalsRange(other.selectionStart)\n\t\t);\n\t}\n\n\tpublic hasSelection(): boolean {\n\t\treturn (!this.selection.isEmpty() || !this.selectionStart.isEmpty());\n\t}\n\n\tpublic move(inSelectionMode: boolean, lineNumber: number, column: number, leftoverVisibleColumns: number): SingleCursorState {\n\t\tif (inSelectionMode) {\n\t\t\t// move just position\n\t\t\treturn new SingleCursorState(\n\t\t\t\tthis.selectionStart,\n\t\t\t\tthis.selectionStartKind,\n\t\t\t\tthis.selectionStartLeftoverVisibleColumns,\n\t\t\t\tnew Position(lineNumber, column),\n\t\t\t\tleftoverVisibleColumns\n\t\t\t);\n\t\t} else {\n\t\t\t// move everything\n\t\t\treturn new SingleCursorState(\n\t\t\t\tnew Range(lineNumber, column, lineNumber, column),\n\t\t\t\tSelectionStartKind.Simple,\n\t\t\t\tleftoverVisibleColumns,\n\t\t\t\tnew Position(lineNumber, column),\n\t\t\t\tleftoverVisibleColumns\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate static _computeSelection(selectionStart: Range, position: Position): Selection {\n\t\tif (selectionStart.isEmpty() || !position.isBeforeOrEqual(selectionStart.getStartPosition())) {\n\t\t\treturn Selection.fromPositions(selectionStart.getStartPosition(), position);\n\t\t} else {\n\t\t\treturn Selection.fromPositions(selectionStart.getEndPosition(), position);\n\t\t}\n\t}\n}\n\nexport class EditOperationResult {\n\t_editOperationResultBrand: void = undefined;\n\n\treadonly type: EditOperationType;\n\treadonly commands: Array<ICommand | null>;\n\treadonly shouldPushStackElementBefore: boolean;\n\treadonly shouldPushStackElementAfter: boolean;\n\n\tconstructor(\n\t\ttype: EditOperationType,\n\t\tcommands: Array<ICommand | null>,\n\t\topts: {\n\t\t\tshouldPushStackElementBefore: boolean;\n\t\t\tshouldPushStackElementAfter: boolean;\n\t\t}\n\t) {\n\t\tthis.type = type;\n\t\tthis.commands = commands;\n\t\tthis.shouldPushStackElementBefore = opts.shouldPushStackElementBefore;\n\t\tthis.shouldPushStackElementAfter = opts.shouldPushStackElementAfter;\n\t}\n}\n\nexport function isQuote(ch: string): boolean {\n\treturn (ch === '\\'' || ch === '\"' || ch === '`');\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 { ConfigurationChangedEvent, EditorAutoClosingEditStrategy, EditorAutoClosingStrategy, EditorAutoIndentStrategy, EditorAutoSurroundStrategy, EditorOption } from './config/editorOptions.js';\nimport { LineTokens } from './tokens/lineTokens.js';\nimport { Position } from './core/position.js';\nimport { Range } from './core/range.js';\nimport { ISelection, Selection } from './core/selection.js';\nimport { ICommand } from './editorCommon.js';\nimport { IEditorConfiguration } from './config/editorConfiguration.js';\nimport { PositionAffinity, TextModelResolvedOptions } from './model.js';\nimport { AutoClosingPairs } from './languages/languageConfiguration.js';\nimport { ILanguageConfigurationService } from './languages/languageConfigurationRegistry.js';\nimport { createScopedLineTokens } from './languages/supports.js';\nimport { IElectricAction } from './languages/supports/electricCharacter.js';\nimport { CursorColumns } from './core/cursorColumns.js';\nimport { normalizeIndentation } from './core/misc/indentation.js';\nimport { InputMode } from './inputMode.js';\n\nexport interface IColumnSelectData {\n\tisReal: boolean;\n\tfromViewLineNumber: number;\n\tfromViewVisualColumn: number;\n\ttoViewLineNumber: number;\n\ttoViewVisualColumn: number;\n}\n\n/**\n * This is an operation type that will be recorded for undo/redo purposes.\n * The goal is to introduce an undo stop when the controller switches between different operation types.\n */\nexport const enum EditOperationType {\n\tOther = 0,\n\tDeletingLeft = 2,\n\tDeletingRight = 3,\n\tTypingOther = 4,\n\tTypingFirstSpace = 5,\n\tTypingConsecutiveSpace = 6,\n}\n\nexport interface CharacterMap {\n\t[char: string]: string;\n}\n\nconst autoCloseAlways = () => true;\nconst autoCloseNever = () => false;\nconst autoCloseBeforeWhitespace = (chr: string) => (chr === ' ' || chr === '\\t');\n\nexport class CursorConfiguration {\n\t_cursorMoveConfigurationBrand: void = undefined;\n\n\tpublic readonly readOnly: boolean;\n\tpublic readonly tabSize: number;\n\tpublic readonly indentSize: number;\n\tpublic readonly insertSpaces: boolean;\n\tpublic readonly stickyTabStops: boolean;\n\tpublic readonly pageSize: number;\n\tpublic readonly lineHeight: number;\n\tpublic readonly typicalHalfwidthCharacterWidth: number;\n\tpublic readonly useTabStops: boolean;\n\tpublic readonly trimWhitespaceOnDelete: boolean;\n\tpublic readonly wordSeparators: string;\n\tpublic readonly emptySelectionClipboard: boolean;\n\tpublic readonly copyWithSyntaxHighlighting: boolean;\n\tpublic readonly multiCursorMergeOverlapping: boolean;\n\tpublic readonly multiCursorPaste: 'spread' | 'full';\n\tpublic readonly multiCursorLimit: number;\n\tpublic readonly autoClosingBrackets: EditorAutoClosingStrategy;\n\tpublic readonly autoClosingComments: EditorAutoClosingStrategy;\n\tpublic readonly autoClosingQuotes: EditorAutoClosingStrategy;\n\tpublic readonly autoClosingDelete: EditorAutoClosingEditStrategy;\n\tpublic readonly autoClosingOvertype: EditorAutoClosingEditStrategy;\n\tpublic readonly autoSurround: EditorAutoSurroundStrategy;\n\tpublic readonly autoIndent: EditorAutoIndentStrategy;\n\tpublic readonly autoClosingPairs: AutoClosingPairs;\n\tpublic readonly surroundingPairs: CharacterMap;\n\tpublic readonly blockCommentStartToken: string | null;\n\tpublic readonly shouldAutoCloseBefore: { quote: (ch: string) => boolean; bracket: (ch: string) => boolean; comment: (ch: string) => boolean };\n\tpublic readonly wordSegmenterLocales: string[];\n\tpublic readonly overtypeOnPaste: boolean;\n\n\tprivate readonly _languageId: string;\n\tprivate _electricChars: { [key: string]: boolean } | null;\n\n\tpublic static shouldRecreate(e: ConfigurationChangedEvent): boolean {\n\t\treturn (\n\t\t\te.hasChanged(EditorOption.layoutInfo)\n\t\t\t|| e.hasChanged(EditorOption.wordSeparators)\n\t\t\t|| e.hasChanged(EditorOption.emptySelectionClipboard)\n\t\t\t|| e.hasChanged(EditorOption.multiCursorMergeOverlapping)\n\t\t\t|| e.hasChanged(EditorOption.multiCursorPaste)\n\t\t\t|| e.hasChanged(EditorOption.multiCursorLimit)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingBrackets)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingComments)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingQuotes)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingDelete)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingOvertype)\n\t\t\t|| e.hasChanged(EditorOption.autoSurround)\n\t\t\t|| e.hasChanged(EditorOption.useTabStops)\n\t\t\t|| e.hasChanged(EditorOption.trimWhitespaceOnDelete)\n\t\t\t|| e.hasChanged(EditorOption.fontInfo)\n\t\t\t|| e.hasChanged(EditorOption.readOnly)\n\t\t\t|| e.hasChanged(EditorOption.wordSegmenterLocales)\n\t\t\t|| e.hasChanged(EditorOption.overtypeOnPaste)\n\t\t);\n\t}\n\n\tconstructor(\n\t\tlanguageId: string,\n\t\tmodelOptions: TextModelResolvedOptions,\n\t\tconfiguration: IEditorConfiguration,\n\t\tpublic readonly languageConfigurationService: ILanguageConfigurationService\n\t) {\n\t\tthis._languageId = languageId;\n\n\t\tconst options = configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tconst fontInfo = options.get(EditorOption.fontInfo);\n\n\t\tthis.readOnly = options.get(EditorOption.readOnly);\n\t\tthis.tabSize = modelOptions.tabSize;\n\t\tthis.indentSize = modelOptions.indentSize;\n\t\tthis.insertSpaces = modelOptions.insertSpaces;\n\t\tthis.stickyTabStops = options.get(EditorOption.stickyTabStops);\n\t\tthis.lineHeight = fontInfo.lineHeight;\n\t\tthis.typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth;\n\t\tthis.pageSize = Math.max(1, Math.floor(layoutInfo.height / this.lineHeight) - 2);\n\t\tthis.useTabStops = options.get(EditorOption.useTabStops);\n\t\tthis.trimWhitespaceOnDelete = options.get(EditorOption.trimWhitespaceOnDelete);\n\t\tthis.wordSeparators = options.get(EditorOption.wordSeparators);\n\t\tthis.emptySelectionClipboard = options.get(EditorOption.emptySelectionClipboard);\n\t\tthis.copyWithSyntaxHighlighting = options.get(EditorOption.copyWithSyntaxHighlighting);\n\t\tthis.multiCursorMergeOverlapping = options.get(EditorOption.multiCursorMergeOverlapping);\n\t\tthis.multiCursorPaste = options.get(EditorOption.multiCursorPaste);\n\t\tthis.multiCursorLimit = options.get(EditorOption.multiCursorLimit);\n\t\tthis.autoClosingBrackets = options.get(EditorOption.autoClosingBrackets);\n\t\tthis.autoClosingComments = options.get(EditorOption.autoClosingComments);\n\t\tthis.autoClosingQuotes = options.get(EditorOption.autoClosingQuotes);\n\t\tthis.autoClosingDelete = options.get(EditorOption.autoClosingDelete);\n\t\tthis.autoClosingOvertype = options.get(EditorOption.autoClosingOvertype);\n\t\tthis.autoSurround = options.get(EditorOption.autoSurround);\n\t\tthis.autoIndent = options.get(EditorOption.autoIndent);\n\t\tthis.wordSegmenterLocales = options.get(EditorOption.wordSegmenterLocales);\n\t\tthis.overtypeOnPaste = options.get(EditorOption.overtypeOnPaste);\n\n\t\tthis.surroundingPairs = {};\n\t\tthis._electricChars = null;\n\n\t\tthis.shouldAutoCloseBefore = {\n\t\t\tquote: this._getShouldAutoClose(languageId, this.autoClosingQuotes, true),\n\t\t\tcomment: this._getShouldAutoClose(languageId, this.autoClosingComments, false),\n\t\t\tbracket: this._getShouldAutoClose(languageId, this.autoClosingBrackets, false),\n\t\t};\n\n\t\tthis.autoClosingPairs = this.languageConfigurationService.getLanguageConfiguration(languageId).getAutoClosingPairs();\n\n\t\tconst surroundingPairs = this.languageConfigurationService.getLanguageConfiguration(languageId).getSurroundingPairs();\n\t\tif (surroundingPairs) {\n\t\t\tfor (const pair of surroundingPairs) {\n\t\t\t\tthis.surroundingPairs[pair.open] = pair.close;\n\t\t\t}\n\t\t}\n\n\t\tconst commentsConfiguration = this.languageConfigurationService.getLanguageConfiguration(languageId).comments;\n\t\tthis.blockCommentStartToken = commentsConfiguration?.blockCommentStartToken ?? null;\n\t}\n\n\tpublic get electricChars() {\n\t\tif (!this._electricChars) {\n\t\t\tthis._electricChars = {};\n\t\t\tconst electricChars = this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter?.getElectricCharacters();\n\t\t\tif (electricChars) {\n\t\t\t\tfor (const char of electricChars) {\n\t\t\t\t\tthis._electricChars[char] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this._electricChars;\n\t}\n\n\tpublic get inputMode(): 'insert' | 'overtype' {\n\t\treturn InputMode.getInputMode();\n\t}\n\n\t/**\n\t * Should return opening bracket type to match indentation with\n\t */\n\tpublic onElectricCharacter(character: string, context: LineTokens, column: number): IElectricAction | null {\n\t\tconst scopedLineTokens = createScopedLineTokens(context, column - 1);\n\t\tconst electricCharacterSupport = this.languageConfigurationService.getLanguageConfiguration(scopedLineTokens.languageId).electricCharacter;\n\t\tif (!electricCharacterSupport) {\n\t\t\treturn null;\n\t\t}\n\t\treturn electricCharacterSupport.onElectricCharacter(character, scopedLineTokens, column - scopedLineTokens.firstCharOffset);\n\t}\n\n\tpublic normalizeIndentation(str: string): string {\n\t\treturn normalizeIndentation(str, this.indentSize, this.insertSpaces);\n\t}\n\n\tprivate _getShouldAutoClose(languageId: string, autoCloseConfig: EditorAutoClosingStrategy, forQuotes: boolean): (ch: string) => boolean {\n\t\tswitch (autoCloseConfig) {\n\t\t\tcase 'beforeWhitespace':\n\t\t\t\treturn autoCloseBeforeWhitespace;\n\t\t\tcase 'languageDefined':\n\t\t\t\treturn this._getLanguageDefinedShouldAutoClose(languageId, forQuotes);\n\t\t\tcase 'always':\n\t\t\t\treturn autoCloseAlways;\n\t\t\tcase 'never':\n\t\t\t\treturn autoCloseNever;\n\t\t}\n\t}\n\n\tprivate _getLanguageDefinedShouldAutoClose(languageId: string, forQuotes: boolean): (ch: string) => boolean {\n\t\tconst autoCloseBeforeSet = this.languageConfigurationService.getLanguageConfiguration(languageId).getAutoCloseBeforeSet(forQuotes);\n\t\treturn c => autoCloseBeforeSet.indexOf(c) !== -1;\n\t}\n\n\t/**\n\t * Returns a visible column from a column.\n\t * @see {@link CursorColumns}\n\t */\n\tpublic visibleColumnFromColumn(model: ICursorSimpleModel, position: Position): number {\n\t\treturn CursorColumns.visibleColumnFromColumn(model.getLineContent(position.lineNumber), position.column, this.tabSize);\n\t}\n\n\t/**\n\t * Returns a visible column from a column.\n\t * @see {@link CursorColumns}\n\t */\n\tpublic columnFromVisibleColumn(model: ICursorSimpleModel, lineNumber: number, visibleColumn: number): number {\n\t\tconst result = CursorColumns.columnFromVisibleColumn(model.getLineContent(lineNumber), visibleColumn, this.tabSize);\n\n\t\tconst minColumn = model.getLineMinColumn(lineNumber);\n\t\tif (result < minColumn) {\n\t\t\treturn minColumn;\n\t\t}\n\n\t\tconst maxColumn = model.getLineMaxColumn(lineNumber);\n\t\tif (result > maxColumn) {\n\t\t\treturn maxColumn;\n\t\t}\n\n\t\treturn result;\n\t}\n}\n\n/**\n * Represents a simple model (either the model or the view model).\n */\nexport interface ICursorSimpleModel {\n\tgetLineCount(): number;\n\tgetLineContent(lineNumber: number): string;\n\tgetLineMinColumn(lineNumber: number): number;\n\tgetLineMaxColumn(lineNumber: number): number;\n\tgetLineFirstNonWhitespaceColumn(lineNumber: number): number;\n\tnormalizePosition(position: Position, affinity: PositionAffinity): Position;\n\n\t/**\n\t * Gets the column at which indentation stops at a given line.\n\t * @internal\n\t */\n\tgetLineIndentColumn(lineNumber: number): number;\n}\n\nexport type PartialCursorState = CursorState | PartialModelCursorState | PartialViewCursorState;\n\nexport class CursorState {\n\t_cursorStateBrand: void = undefined;\n\n\tpublic static fromModelState(modelState: SingleCursorState): PartialModelCursorState {\n\t\treturn new PartialModelCursorState(modelState);\n\t}\n\n\tpublic static fromViewState(viewState: SingleCursorState): PartialViewCursorState {\n\t\treturn new PartialViewCursorState(viewState);\n\t}\n\n\tpublic static fromModelSelection(modelSelection: ISelection): PartialModelCursorState {\n\t\tconst selection = Selection.liftSelection(modelSelection);\n\t\tconst modelState = new SingleCursorState(\n\t\t\tRange.fromPositions(selection.getSelectionStart()),\n\t\t\tSelectionStartKind.Simple, 0,\n\t\t\tselection.getPosition(), 0\n\t\t);\n\t\treturn CursorState.fromModelState(modelState);\n\t}\n\n\tpublic static fromModelSelections(modelSelections: readonly ISelection[]): PartialModelCursorState[] {\n\t\tconst states: PartialModelCursorState[] = [];\n\t\tfor (let i = 0, len = modelSelections.length; i < len; i++) {\n\t\t\tstates[i] = this.fromModelSelection(modelSelections[i]);\n\t\t}\n\t\treturn states;\n\t}\n\n\treadonly modelState: SingleCursorState;\n\treadonly viewState: SingleCursorState;\n\n\tconstructor(modelState: SingleCursorState, viewState: SingleCursorState) {\n\t\tthis.modelState = modelState;\n\t\tthis.viewState = viewState;\n\t}\n\n\tpublic equals(other: CursorState): boolean {\n\t\treturn (this.viewState.equals(other.viewState) && this.modelState.equals(other.modelState));\n\t}\n}\n\nexport class PartialModelCursorState {\n\treadonly modelState: SingleCursorState;\n\treadonly viewState: null;\n\n\tconstructor(modelState: SingleCursorState) {\n\t\tthis.modelState = modelState;\n\t\tthis.viewState = null;\n\t}\n}\n\nexport class PartialViewCursorState {\n\treadonly modelState: null;\n\treadonly viewState: SingleCursorState;\n\n\tconstructor(viewState: SingleCursorState) {\n\t\tthis.modelState = null;\n\t\tthis.viewState = viewState;\n\t}\n}\n\nexport const enum SelectionStartKind {\n\tSimple,\n\tWord,\n\tLine\n}\n\n/**\n * Represents the cursor state on either the model or on the view model.\n */\nexport class SingleCursorState {\n\t_singleCursorStateBrand: void = undefined;\n\n\tpublic readonly selection: Selection;\n\n\tconstructor(\n\t\tpublic readonly selectionStart: Range,\n\t\tpublic readonly selectionStartKind: SelectionStartKind,\n\t\tpublic readonly selectionStartLeftoverVisibleColumns: number,\n\t\tpublic readonly position: Position,\n\t\tpublic readonly leftoverVisibleColumns: number,\n\t) {\n\t\tthis.selection = SingleCursorState._computeSelection(this.selectionStart, this.position);\n\t}\n\n\tpublic equals(other: SingleCursorState) {\n\t\treturn (\n\t\t\tthis.selectionStartLeftoverVisibleColumns === other.selectionStartLeftoverVisibleColumns\n\t\t\t&& this.leftoverVisibleColumns === other.leftoverVisibleColumns\n\t\t\t&& this.selectionStartKind === other.selectionStartKind\n\t\t\t&& this.position.equals(other.position)\n\t\t\t&& this.selectionStart.equalsRange(other.selectionStart)\n\t\t);\n\t}\n\n\tpublic hasSelection(): boolean {\n\t\treturn (!this.selection.isEmpty() || !this.selectionStart.isEmpty());\n\t}\n\n\tpublic move(inSelectionMode: boolean, lineNumber: number, column: number, leftoverVisibleColumns: number): SingleCursorState {\n\t\tif (inSelectionMode) {\n\t\t\t// move just position\n\t\t\treturn new SingleCursorState(\n\t\t\t\tthis.selectionStart,\n\t\t\t\tthis.selectionStartKind,\n\t\t\t\tthis.selectionStartLeftoverVisibleColumns,\n\t\t\t\tnew Position(lineNumber, column),\n\t\t\t\tleftoverVisibleColumns\n\t\t\t);\n\t\t} else {\n\t\t\t// move everything\n\t\t\treturn new SingleCursorState(\n\t\t\t\tnew Range(lineNumber, column, lineNumber, column),\n\t\t\t\tSelectionStartKind.Simple,\n\t\t\t\tleftoverVisibleColumns,\n\t\t\t\tnew Position(lineNumber, column),\n\t\t\t\tleftoverVisibleColumns\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate static _computeSelection(selectionStart: Range, position: Position): Selection {\n\t\tif (selectionStart.isEmpty() || !position.isBeforeOrEqual(selectionStart.getStartPosition())) {\n\t\t\treturn Selection.fromPositions(selectionStart.getStartPosition(), position);\n\t\t} else {\n\t\t\treturn Selection.fromPositions(selectionStart.getEndPosition(), position);\n\t\t}\n\t}\n}\n\nexport class EditOperationResult {\n\t_editOperationResultBrand: void = undefined;\n\n\treadonly type: EditOperationType;\n\treadonly commands: Array<ICommand | null>;\n\treadonly shouldPushStackElementBefore: boolean;\n\treadonly shouldPushStackElementAfter: boolean;\n\n\tconstructor(\n\t\ttype: EditOperationType,\n\t\tcommands: Array<ICommand | null>,\n\t\topts: {\n\t\t\tshouldPushStackElementBefore: boolean;\n\t\t\tshouldPushStackElementAfter: boolean;\n\t\t}\n\t) {\n\t\tthis.type = type;\n\t\tthis.commands = commands;\n\t\tthis.shouldPushStackElementBefore = opts.shouldPushStackElementBefore;\n\t\tthis.shouldPushStackElementAfter = opts.shouldPushStackElementAfter;\n\t}\n}\n\nexport function isQuote(ch: string): boolean {\n\treturn (ch === '\\'' || ch === '\"' || ch === '`');\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/cursorCommon.ts","vs/editor/common/cursorCommon.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAIhG,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAc,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAM5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AA2B3C,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;AACnC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,KAAK,CAA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QAAgC,EAChC,IAIC;QApBF,8BAAyB,GAAS,SAAS,CAAC;QAsB3C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,4BAA4B,GAAG,IAAI,CAAC,4BAA4B,CAAC;QACtE,IAAI,CAAC,2BAA2B,GAAG,IAAI,CAAC,2BAA2B,CAAC;QACpE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC/B,CAAC;CACD;AAED,MAAM,UAAU,OAAO,CAAC,EAAU;IACjC,OAAO,CAAC,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC;AAClD,CAAC","file":"cursorCommon.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 { ConfigurationChangedEvent, EditorAutoClosingEditStrategy, EditorAutoClosingStrategy, EditorAutoIndentStrategy, EditorAutoSurroundStrategy, EditorOption } from './config/editorOptions.js';\nimport { LineTokens } from './tokens/lineTokens.js';\nimport { Position } from './core/position.js';\nimport { Range } from './core/range.js';\nimport { ISelection, Selection } from './core/selection.js';\nimport { ICommand } from './editorCommon.js';\nimport { IEditorConfiguration } from './config/editorConfiguration.js';\nimport { PositionAffinity, TextModelResolvedOptions } from './model.js';\nimport { AutoClosingPairs } from './languages/languageConfiguration.js';\nimport { ILanguageConfigurationService } from './languages/languageConfigurationRegistry.js';\nimport { createScopedLineTokens } from './languages/supports.js';\nimport { IElectricAction } from './languages/supports/electricCharacter.js';\nimport { CursorColumns } from './core/cursorColumns.js';\nimport { normalizeIndentation } from './core/misc/indentation.js';\nimport { InputMode } from './inputMode.js';\n\nexport interface IColumnSelectData {\n\tisReal: boolean;\n\tfromViewLineNumber: number;\n\tfromViewVisualColumn: number;\n\ttoViewLineNumber: number;\n\ttoViewVisualColumn: number;\n}\n\n/**\n * This is an operation type that will be recorded for undo/redo purposes.\n * The goal is to introduce an undo stop when the controller switches between different operation types.\n */\nexport const enum EditOperationType {\n\tOther = 0,\n\tDeletingLeft = 2,\n\tDeletingRight = 3,\n\tTypingOther = 4,\n\tTypingFirstSpace = 5,\n\tTypingConsecutiveSpace = 6,\n}\n\nexport interface CharacterMap {\n\t[char: string]: string;\n}\n\nconst autoCloseAlways = () => true;\nconst autoCloseNever = () => false;\nconst autoCloseBeforeWhitespace = (chr: string) => (chr === ' ' || chr === '\\t');\n\nexport class CursorConfiguration {\n\t_cursorMoveConfigurationBrand: void = undefined;\n\n\tpublic readonly readOnly: boolean;\n\tpublic readonly tabSize: number;\n\tpublic readonly indentSize: number;\n\tpublic readonly insertSpaces: boolean;\n\tpublic readonly stickyTabStops: boolean;\n\tpublic readonly pageSize: number;\n\tpublic readonly lineHeight: number;\n\tpublic readonly typicalHalfwidthCharacterWidth: number;\n\tpublic readonly useTabStops: boolean;\n\tpublic readonly trimWhitespaceOnDelete: boolean;\n\tpublic readonly wordSeparators: string;\n\tpublic readonly emptySelectionClipboard: boolean;\n\tpublic readonly copyWithSyntaxHighlighting: boolean;\n\tpublic readonly multiCursorMergeOverlapping: boolean;\n\tpublic readonly multiCursorPaste: 'spread' | 'full';\n\tpublic readonly multiCursorLimit: number;\n\tpublic readonly autoClosingBrackets: EditorAutoClosingStrategy;\n\tpublic readonly autoClosingComments: EditorAutoClosingStrategy;\n\tpublic readonly autoClosingQuotes: EditorAutoClosingStrategy;\n\tpublic readonly autoClosingDelete: EditorAutoClosingEditStrategy;\n\tpublic readonly autoClosingOvertype: EditorAutoClosingEditStrategy;\n\tpublic readonly autoSurround: EditorAutoSurroundStrategy;\n\tpublic readonly autoIndent: EditorAutoIndentStrategy;\n\tpublic readonly autoClosingPairs: AutoClosingPairs;\n\tpublic readonly surroundingPairs: CharacterMap;\n\tpublic readonly blockCommentStartToken: string | null;\n\tpublic readonly shouldAutoCloseBefore: { quote: (ch: string) => boolean; bracket: (ch: string) => boolean; comment: (ch: string) => boolean };\n\tpublic readonly wordSegmenterLocales: string[];\n\tpublic readonly overtypeOnPaste: boolean;\n\n\tprivate readonly _languageId: string;\n\tprivate _electricChars: { [key: string]: boolean } | null;\n\n\tpublic static shouldRecreate(e: ConfigurationChangedEvent): boolean {\n\t\treturn (\n\t\t\te.hasChanged(EditorOption.layoutInfo)\n\t\t\t|| e.hasChanged(EditorOption.wordSeparators)\n\t\t\t|| e.hasChanged(EditorOption.emptySelectionClipboard)\n\t\t\t|| e.hasChanged(EditorOption.multiCursorMergeOverlapping)\n\t\t\t|| e.hasChanged(EditorOption.multiCursorPaste)\n\t\t\t|| e.hasChanged(EditorOption.multiCursorLimit)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingBrackets)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingComments)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingQuotes)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingDelete)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingOvertype)\n\t\t\t|| e.hasChanged(EditorOption.autoSurround)\n\t\t\t|| e.hasChanged(EditorOption.useTabStops)\n\t\t\t|| e.hasChanged(EditorOption.trimWhitespaceOnDelete)\n\t\t\t|| e.hasChanged(EditorOption.fontInfo)\n\t\t\t|| e.hasChanged(EditorOption.readOnly)\n\t\t\t|| e.hasChanged(EditorOption.wordSegmenterLocales)\n\t\t\t|| e.hasChanged(EditorOption.overtypeOnPaste)\n\t\t);\n\t}\n\n\tconstructor(\n\t\tlanguageId: string,\n\t\tmodelOptions: TextModelResolvedOptions,\n\t\tconfiguration: IEditorConfiguration,\n\t\tpublic readonly languageConfigurationService: ILanguageConfigurationService\n\t) {\n\t\tthis._languageId = languageId;\n\n\t\tconst options = configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tconst fontInfo = options.get(EditorOption.fontInfo);\n\n\t\tthis.readOnly = options.get(EditorOption.readOnly);\n\t\tthis.tabSize = modelOptions.tabSize;\n\t\tthis.indentSize = modelOptions.indentSize;\n\t\tthis.insertSpaces = modelOptions.insertSpaces;\n\t\tthis.stickyTabStops = options.get(EditorOption.stickyTabStops);\n\t\tthis.lineHeight = fontInfo.lineHeight;\n\t\tthis.typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth;\n\t\tthis.pageSize = Math.max(1, Math.floor(layoutInfo.height / this.lineHeight) - 2);\n\t\tthis.useTabStops = options.get(EditorOption.useTabStops);\n\t\tthis.trimWhitespaceOnDelete = options.get(EditorOption.trimWhitespaceOnDelete);\n\t\tthis.wordSeparators = options.get(EditorOption.wordSeparators);\n\t\tthis.emptySelectionClipboard = options.get(EditorOption.emptySelectionClipboard);\n\t\tthis.copyWithSyntaxHighlighting = options.get(EditorOption.copyWithSyntaxHighlighting);\n\t\tthis.multiCursorMergeOverlapping = options.get(EditorOption.multiCursorMergeOverlapping);\n\t\tthis.multiCursorPaste = options.get(EditorOption.multiCursorPaste);\n\t\tthis.multiCursorLimit = options.get(EditorOption.multiCursorLimit);\n\t\tthis.autoClosingBrackets = options.get(EditorOption.autoClosingBrackets);\n\t\tthis.autoClosingComments = options.get(EditorOption.autoClosingComments);\n\t\tthis.autoClosingQuotes = options.get(EditorOption.autoClosingQuotes);\n\t\tthis.autoClosingDelete = options.get(EditorOption.autoClosingDelete);\n\t\tthis.autoClosingOvertype = options.get(EditorOption.autoClosingOvertype);\n\t\tthis.autoSurround = options.get(EditorOption.autoSurround);\n\t\tthis.autoIndent = options.get(EditorOption.autoIndent);\n\t\tthis.wordSegmenterLocales = options.get(EditorOption.wordSegmenterLocales);\n\t\tthis.overtypeOnPaste = options.get(EditorOption.overtypeOnPaste);\n\n\t\tthis.surroundingPairs = {};\n\t\tthis._electricChars = null;\n\n\t\tthis.shouldAutoCloseBefore = {\n\t\t\tquote: this._getShouldAutoClose(languageId, this.autoClosingQuotes, true),\n\t\t\tcomment: this._getShouldAutoClose(languageId, this.autoClosingComments, false),\n\t\t\tbracket: this._getShouldAutoClose(languageId, this.autoClosingBrackets, false),\n\t\t};\n\n\t\tthis.autoClosingPairs = this.languageConfigurationService.getLanguageConfiguration(languageId).getAutoClosingPairs();\n\n\t\tconst surroundingPairs = this.languageConfigurationService.getLanguageConfiguration(languageId).getSurroundingPairs();\n\t\tif (surroundingPairs) {\n\t\t\tfor (const pair of surroundingPairs) {\n\t\t\t\tthis.surroundingPairs[pair.open] = pair.close;\n\t\t\t}\n\t\t}\n\n\t\tconst commentsConfiguration = this.languageConfigurationService.getLanguageConfiguration(languageId).comments;\n\t\tthis.blockCommentStartToken = commentsConfiguration?.blockCommentStartToken ?? null;\n\t}\n\n\tpublic get electricChars() {\n\t\tif (!this._electricChars) {\n\t\t\tthis._electricChars = {};\n\t\t\tconst electricChars = this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter?.getElectricCharacters();\n\t\t\tif (electricChars) {\n\t\t\t\tfor (const char of electricChars) {\n\t\t\t\t\tthis._electricChars[char] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this._electricChars;\n\t}\n\n\tpublic get inputMode(): 'insert' | 'overtype' {\n\t\treturn InputMode.getInputMode();\n\t}\n\n\t/**\n\t * Should return opening bracket type to match indentation with\n\t */\n\tpublic onElectricCharacter(character: string, context: LineTokens, column: number): IElectricAction | null {\n\t\tconst scopedLineTokens = createScopedLineTokens(context, column - 1);\n\t\tconst electricCharacterSupport = this.languageConfigurationService.getLanguageConfiguration(scopedLineTokens.languageId).electricCharacter;\n\t\tif (!electricCharacterSupport) {\n\t\t\treturn null;\n\t\t}\n\t\treturn electricCharacterSupport.onElectricCharacter(character, scopedLineTokens, column - scopedLineTokens.firstCharOffset);\n\t}\n\n\tpublic normalizeIndentation(str: string): string {\n\t\treturn normalizeIndentation(str, this.indentSize, this.insertSpaces);\n\t}\n\n\tprivate _getShouldAutoClose(languageId: string, autoCloseConfig: EditorAutoClosingStrategy, forQuotes: boolean): (ch: string) => boolean {\n\t\tswitch (autoCloseConfig) {\n\t\t\tcase 'beforeWhitespace':\n\t\t\t\treturn autoCloseBeforeWhitespace;\n\t\t\tcase 'languageDefined':\n\t\t\t\treturn this._getLanguageDefinedShouldAutoClose(languageId, forQuotes);\n\t\t\tcase 'always':\n\t\t\t\treturn autoCloseAlways;\n\t\t\tcase 'never':\n\t\t\t\treturn autoCloseNever;\n\t\t}\n\t}\n\n\tprivate _getLanguageDefinedShouldAutoClose(languageId: string, forQuotes: boolean): (ch: string) => boolean {\n\t\tconst autoCloseBeforeSet = this.languageConfigurationService.getLanguageConfiguration(languageId).getAutoCloseBeforeSet(forQuotes);\n\t\treturn c => autoCloseBeforeSet.indexOf(c) !== -1;\n\t}\n\n\t/**\n\t * Returns a visible column from a column.\n\t * @see {@link CursorColumns}\n\t */\n\tpublic visibleColumnFromColumn(model: ICursorSimpleModel, position: Position): number {\n\t\treturn CursorColumns.visibleColumnFromColumn(model.getLineContent(position.lineNumber), position.column, this.tabSize);\n\t}\n\n\t/**\n\t * Returns a visible column from a column.\n\t * @see {@link CursorColumns}\n\t */\n\tpublic columnFromVisibleColumn(model: ICursorSimpleModel, lineNumber: number, visibleColumn: number): number {\n\t\tconst result = CursorColumns.columnFromVisibleColumn(model.getLineContent(lineNumber), visibleColumn, this.tabSize);\n\n\t\tconst minColumn = model.getLineMinColumn(lineNumber);\n\t\tif (result < minColumn) {\n\t\t\treturn minColumn;\n\t\t}\n\n\t\tconst maxColumn = model.getLineMaxColumn(lineNumber);\n\t\tif (result > maxColumn) {\n\t\t\treturn maxColumn;\n\t\t}\n\n\t\treturn result;\n\t}\n}\n\n/**\n * Represents a simple model (either the model or the view model).\n */\nexport interface ICursorSimpleModel {\n\tgetLineCount(): number;\n\tgetLineContent(lineNumber: number): string;\n\tgetLineMinColumn(lineNumber: number): number;\n\tgetLineMaxColumn(lineNumber: number): number;\n\tgetLineFirstNonWhitespaceColumn(lineNumber: number): number;\n\tnormalizePosition(position: Position, affinity: PositionAffinity): Position;\n\n\t/**\n\t * Gets the column at which indentation stops at a given line.\n\t * @internal\n\t */\n\tgetLineIndentColumn(lineNumber: number): number;\n}\n\nexport type PartialCursorState = CursorState | PartialModelCursorState | PartialViewCursorState;\n\nexport class CursorState {\n\t_cursorStateBrand: void = undefined;\n\n\tpublic static fromModelState(modelState: SingleCursorState): PartialModelCursorState {\n\t\treturn new PartialModelCursorState(modelState);\n\t}\n\n\tpublic static fromViewState(viewState: SingleCursorState): PartialViewCursorState {\n\t\treturn new PartialViewCursorState(viewState);\n\t}\n\n\tpublic static fromModelSelection(modelSelection: ISelection): PartialModelCursorState {\n\t\tconst selection = Selection.liftSelection(modelSelection);\n\t\tconst modelState = new SingleCursorState(\n\t\t\tRange.fromPositions(selection.getSelectionStart()),\n\t\t\tSelectionStartKind.Simple, 0,\n\t\t\tselection.getPosition(), 0\n\t\t);\n\t\treturn CursorState.fromModelState(modelState);\n\t}\n\n\tpublic static fromModelSelections(modelSelections: readonly ISelection[]): PartialModelCursorState[] {\n\t\tconst states: PartialModelCursorState[] = [];\n\t\tfor (let i = 0, len = modelSelections.length; i < len; i++) {\n\t\t\tstates[i] = this.fromModelSelection(modelSelections[i]);\n\t\t}\n\t\treturn states;\n\t}\n\n\treadonly modelState: SingleCursorState;\n\treadonly viewState: SingleCursorState;\n\n\tconstructor(modelState: SingleCursorState, viewState: SingleCursorState) {\n\t\tthis.modelState = modelState;\n\t\tthis.viewState = viewState;\n\t}\n\n\tpublic equals(other: CursorState): boolean {\n\t\treturn (this.viewState.equals(other.viewState) && this.modelState.equals(other.modelState));\n\t}\n}\n\nexport class PartialModelCursorState {\n\treadonly modelState: SingleCursorState;\n\treadonly viewState: null;\n\n\tconstructor(modelState: SingleCursorState) {\n\t\tthis.modelState = modelState;\n\t\tthis.viewState = null;\n\t}\n}\n\nexport class PartialViewCursorState {\n\treadonly modelState: null;\n\treadonly viewState: SingleCursorState;\n\n\tconstructor(viewState: SingleCursorState) {\n\t\tthis.modelState = null;\n\t\tthis.viewState = viewState;\n\t}\n}\n\nexport const enum SelectionStartKind {\n\tSimple,\n\tWord,\n\tLine\n}\n\n/**\n * Represents the cursor state on either the model or on the view model.\n */\nexport class SingleCursorState {\n\t_singleCursorStateBrand: void = undefined;\n\n\tpublic readonly selection: Selection;\n\n\tconstructor(\n\t\tpublic readonly selectionStart: Range,\n\t\tpublic readonly selectionStartKind: SelectionStartKind,\n\t\tpublic readonly selectionStartLeftoverVisibleColumns: number,\n\t\tpublic readonly position: Position,\n\t\tpublic readonly leftoverVisibleColumns: number,\n\t) {\n\t\tthis.selection = SingleCursorState._computeSelection(this.selectionStart, this.position);\n\t}\n\n\tpublic equals(other: SingleCursorState) {\n\t\treturn (\n\t\t\tthis.selectionStartLeftoverVisibleColumns === other.selectionStartLeftoverVisibleColumns\n\t\t\t&& this.leftoverVisibleColumns === other.leftoverVisibleColumns\n\t\t\t&& this.selectionStartKind === other.selectionStartKind\n\t\t\t&& this.position.equals(other.position)\n\t\t\t&& this.selectionStart.equalsRange(other.selectionStart)\n\t\t);\n\t}\n\n\tpublic hasSelection(): boolean {\n\t\treturn (!this.selection.isEmpty() || !this.selectionStart.isEmpty());\n\t}\n\n\tpublic move(inSelectionMode: boolean, lineNumber: number, column: number, leftoverVisibleColumns: number): SingleCursorState {\n\t\tif (inSelectionMode) {\n\t\t\t// move just position\n\t\t\treturn new SingleCursorState(\n\t\t\t\tthis.selectionStart,\n\t\t\t\tthis.selectionStartKind,\n\t\t\t\tthis.selectionStartLeftoverVisibleColumns,\n\t\t\t\tnew Position(lineNumber, column),\n\t\t\t\tleftoverVisibleColumns\n\t\t\t);\n\t\t} else {\n\t\t\t// move everything\n\t\t\treturn new SingleCursorState(\n\t\t\t\tnew Range(lineNumber, column, lineNumber, column),\n\t\t\t\tSelectionStartKind.Simple,\n\t\t\t\tleftoverVisibleColumns,\n\t\t\t\tnew Position(lineNumber, column),\n\t\t\t\tleftoverVisibleColumns\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate static _computeSelection(selectionStart: Range, position: Position): Selection {\n\t\tif (selectionStart.isEmpty() || !position.isBeforeOrEqual(selectionStart.getStartPosition())) {\n\t\t\treturn Selection.fromPositions(selectionStart.getStartPosition(), position);\n\t\t} else {\n\t\t\treturn Selection.fromPositions(selectionStart.getEndPosition(), position);\n\t\t}\n\t}\n}\n\nexport class EditOperationResult {\n\t_editOperationResultBrand: void = undefined;\n\n\treadonly type: EditOperationType;\n\treadonly commands: Array<ICommand | null>;\n\treadonly shouldPushStackElementBefore: boolean;\n\treadonly shouldPushStackElementAfter: boolean;\n\t/**\n\t * An optional edit operation which is computed from the selections resulting\n\t * from executing this edit operation, and which is executed right after it.\n\t * It can return `null` to skip the follow-up edit.\n\t */\n\treadonly followUp: ((selections: Selection[]) => EditOperationResult | null) | undefined;\n\n\tconstructor(\n\t\ttype: EditOperationType,\n\t\tcommands: Array<ICommand | null>,\n\t\topts: {\n\t\t\tshouldPushStackElementBefore: boolean;\n\t\t\tshouldPushStackElementAfter: boolean;\n\t\t\tfollowUp?: (selections: Selection[]) => EditOperationResult | null;\n\t\t}\n\t) {\n\t\tthis.type = type;\n\t\tthis.commands = commands;\n\t\tthis.shouldPushStackElementBefore = opts.shouldPushStackElementBefore;\n\t\tthis.shouldPushStackElementAfter = opts.shouldPushStackElementAfter;\n\t\tthis.followUp = opts.followUp;\n\t}\n}\n\nexport function isQuote(ch: string): boolean {\n\treturn (ch === '\\'' || ch === '\"' || ch === '`');\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 { ConfigurationChangedEvent, EditorAutoClosingEditStrategy, EditorAutoClosingStrategy, EditorAutoIndentStrategy, EditorAutoSurroundStrategy, EditorOption } from './config/editorOptions.js';\nimport { LineTokens } from './tokens/lineTokens.js';\nimport { Position } from './core/position.js';\nimport { Range } from './core/range.js';\nimport { ISelection, Selection } from './core/selection.js';\nimport { ICommand } from './editorCommon.js';\nimport { IEditorConfiguration } from './config/editorConfiguration.js';\nimport { PositionAffinity, TextModelResolvedOptions } from './model.js';\nimport { AutoClosingPairs } from './languages/languageConfiguration.js';\nimport { ILanguageConfigurationService } from './languages/languageConfigurationRegistry.js';\nimport { createScopedLineTokens } from './languages/supports.js';\nimport { IElectricAction } from './languages/supports/electricCharacter.js';\nimport { CursorColumns } from './core/cursorColumns.js';\nimport { normalizeIndentation } from './core/misc/indentation.js';\nimport { InputMode } from './inputMode.js';\n\nexport interface IColumnSelectData {\n\tisReal: boolean;\n\tfromViewLineNumber: number;\n\tfromViewVisualColumn: number;\n\ttoViewLineNumber: number;\n\ttoViewVisualColumn: number;\n}\n\n/**\n * This is an operation type that will be recorded for undo/redo purposes.\n * The goal is to introduce an undo stop when the controller switches between different operation types.\n */\nexport const enum EditOperationType {\n\tOther = 0,\n\tDeletingLeft = 2,\n\tDeletingRight = 3,\n\tTypingOther = 4,\n\tTypingFirstSpace = 5,\n\tTypingConsecutiveSpace = 6,\n}\n\nexport interface CharacterMap {\n\t[char: string]: string;\n}\n\nconst autoCloseAlways = () => true;\nconst autoCloseNever = () => false;\nconst autoCloseBeforeWhitespace = (chr: string) => (chr === ' ' || chr === '\\t');\n\nexport class CursorConfiguration {\n\t_cursorMoveConfigurationBrand: void = undefined;\n\n\tpublic readonly readOnly: boolean;\n\tpublic readonly tabSize: number;\n\tpublic readonly indentSize: number;\n\tpublic readonly insertSpaces: boolean;\n\tpublic readonly stickyTabStops: boolean;\n\tpublic readonly pageSize: number;\n\tpublic readonly lineHeight: number;\n\tpublic readonly typicalHalfwidthCharacterWidth: number;\n\tpublic readonly useTabStops: boolean;\n\tpublic readonly trimWhitespaceOnDelete: boolean;\n\tpublic readonly wordSeparators: string;\n\tpublic readonly emptySelectionClipboard: boolean;\n\tpublic readonly copyWithSyntaxHighlighting: boolean;\n\tpublic readonly multiCursorMergeOverlapping: boolean;\n\tpublic readonly multiCursorPaste: 'spread' | 'full';\n\tpublic readonly multiCursorLimit: number;\n\tpublic readonly autoClosingBrackets: EditorAutoClosingStrategy;\n\tpublic readonly autoClosingComments: EditorAutoClosingStrategy;\n\tpublic readonly autoClosingQuotes: EditorAutoClosingStrategy;\n\tpublic readonly autoClosingDelete: EditorAutoClosingEditStrategy;\n\tpublic readonly autoClosingOvertype: EditorAutoClosingEditStrategy;\n\tpublic readonly autoSurround: EditorAutoSurroundStrategy;\n\tpublic readonly autoIndent: EditorAutoIndentStrategy;\n\tpublic readonly autoClosingPairs: AutoClosingPairs;\n\tpublic readonly surroundingPairs: CharacterMap;\n\tpublic readonly blockCommentStartToken: string | null;\n\tpublic readonly shouldAutoCloseBefore: { quote: (ch: string) => boolean; bracket: (ch: string) => boolean; comment: (ch: string) => boolean };\n\tpublic readonly wordSegmenterLocales: string[];\n\tpublic readonly overtypeOnPaste: boolean;\n\n\tprivate readonly _languageId: string;\n\tprivate _electricChars: { [key: string]: boolean } | null;\n\n\tpublic static shouldRecreate(e: ConfigurationChangedEvent): boolean {\n\t\treturn (\n\t\t\te.hasChanged(EditorOption.layoutInfo)\n\t\t\t|| e.hasChanged(EditorOption.wordSeparators)\n\t\t\t|| e.hasChanged(EditorOption.emptySelectionClipboard)\n\t\t\t|| e.hasChanged(EditorOption.multiCursorMergeOverlapping)\n\t\t\t|| e.hasChanged(EditorOption.multiCursorPaste)\n\t\t\t|| e.hasChanged(EditorOption.multiCursorLimit)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingBrackets)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingComments)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingQuotes)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingDelete)\n\t\t\t|| e.hasChanged(EditorOption.autoClosingOvertype)\n\t\t\t|| e.hasChanged(EditorOption.autoSurround)\n\t\t\t|| e.hasChanged(EditorOption.useTabStops)\n\t\t\t|| e.hasChanged(EditorOption.trimWhitespaceOnDelete)\n\t\t\t|| e.hasChanged(EditorOption.fontInfo)\n\t\t\t|| e.hasChanged(EditorOption.readOnly)\n\t\t\t|| e.hasChanged(EditorOption.wordSegmenterLocales)\n\t\t\t|| e.hasChanged(EditorOption.overtypeOnPaste)\n\t\t);\n\t}\n\n\tconstructor(\n\t\tlanguageId: string,\n\t\tmodelOptions: TextModelResolvedOptions,\n\t\tconfiguration: IEditorConfiguration,\n\t\tpublic readonly languageConfigurationService: ILanguageConfigurationService\n\t) {\n\t\tthis._languageId = languageId;\n\n\t\tconst options = configuration.options;\n\t\tconst layoutInfo = options.get(EditorOption.layoutInfo);\n\t\tconst fontInfo = options.get(EditorOption.fontInfo);\n\n\t\tthis.readOnly = options.get(EditorOption.readOnly);\n\t\tthis.tabSize = modelOptions.tabSize;\n\t\tthis.indentSize = modelOptions.indentSize;\n\t\tthis.insertSpaces = modelOptions.insertSpaces;\n\t\tthis.stickyTabStops = options.get(EditorOption.stickyTabStops);\n\t\tthis.lineHeight = fontInfo.lineHeight;\n\t\tthis.typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth;\n\t\tthis.pageSize = Math.max(1, Math.floor(layoutInfo.height / this.lineHeight) - 2);\n\t\tthis.useTabStops = options.get(EditorOption.useTabStops);\n\t\tthis.trimWhitespaceOnDelete = options.get(EditorOption.trimWhitespaceOnDelete);\n\t\tthis.wordSeparators = options.get(EditorOption.wordSeparators);\n\t\tthis.emptySelectionClipboard = options.get(EditorOption.emptySelectionClipboard);\n\t\tthis.copyWithSyntaxHighlighting = options.get(EditorOption.copyWithSyntaxHighlighting);\n\t\tthis.multiCursorMergeOverlapping = options.get(EditorOption.multiCursorMergeOverlapping);\n\t\tthis.multiCursorPaste = options.get(EditorOption.multiCursorPaste);\n\t\tthis.multiCursorLimit = options.get(EditorOption.multiCursorLimit);\n\t\tthis.autoClosingBrackets = options.get(EditorOption.autoClosingBrackets);\n\t\tthis.autoClosingComments = options.get(EditorOption.autoClosingComments);\n\t\tthis.autoClosingQuotes = options.get(EditorOption.autoClosingQuotes);\n\t\tthis.autoClosingDelete = options.get(EditorOption.autoClosingDelete);\n\t\tthis.autoClosingOvertype = options.get(EditorOption.autoClosingOvertype);\n\t\tthis.autoSurround = options.get(EditorOption.autoSurround);\n\t\tthis.autoIndent = options.get(EditorOption.autoIndent);\n\t\tthis.wordSegmenterLocales = options.get(EditorOption.wordSegmenterLocales);\n\t\tthis.overtypeOnPaste = options.get(EditorOption.overtypeOnPaste);\n\n\t\tthis.surroundingPairs = {};\n\t\tthis._electricChars = null;\n\n\t\tthis.shouldAutoCloseBefore = {\n\t\t\tquote: this._getShouldAutoClose(languageId, this.autoClosingQuotes, true),\n\t\t\tcomment: this._getShouldAutoClose(languageId, this.autoClosingComments, false),\n\t\t\tbracket: this._getShouldAutoClose(languageId, this.autoClosingBrackets, false),\n\t\t};\n\n\t\tthis.autoClosingPairs = this.languageConfigurationService.getLanguageConfiguration(languageId).getAutoClosingPairs();\n\n\t\tconst surroundingPairs = this.languageConfigurationService.getLanguageConfiguration(languageId).getSurroundingPairs();\n\t\tif (surroundingPairs) {\n\t\t\tfor (const pair of surroundingPairs) {\n\t\t\t\tthis.surroundingPairs[pair.open] = pair.close;\n\t\t\t}\n\t\t}\n\n\t\tconst commentsConfiguration = this.languageConfigurationService.getLanguageConfiguration(languageId).comments;\n\t\tthis.blockCommentStartToken = commentsConfiguration?.blockCommentStartToken ?? null;\n\t}\n\n\tpublic get electricChars() {\n\t\tif (!this._electricChars) {\n\t\t\tthis._electricChars = {};\n\t\t\tconst electricChars = this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter?.getElectricCharacters();\n\t\t\tif (electricChars) {\n\t\t\t\tfor (const char of electricChars) {\n\t\t\t\t\tthis._electricChars[char] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this._electricChars;\n\t}\n\n\tpublic get inputMode(): 'insert' | 'overtype' {\n\t\treturn InputMode.getInputMode();\n\t}\n\n\t/**\n\t * Should return opening bracket type to match indentation with\n\t */\n\tpublic onElectricCharacter(character: string, context: LineTokens, column: number): IElectricAction | null {\n\t\tconst scopedLineTokens = createScopedLineTokens(context, column - 1);\n\t\tconst electricCharacterSupport = this.languageConfigurationService.getLanguageConfiguration(scopedLineTokens.languageId).electricCharacter;\n\t\tif (!electricCharacterSupport) {\n\t\t\treturn null;\n\t\t}\n\t\treturn electricCharacterSupport.onElectricCharacter(character, scopedLineTokens, column - scopedLineTokens.firstCharOffset);\n\t}\n\n\tpublic normalizeIndentation(str: string): string {\n\t\treturn normalizeIndentation(str, this.indentSize, this.insertSpaces);\n\t}\n\n\tprivate _getShouldAutoClose(languageId: string, autoCloseConfig: EditorAutoClosingStrategy, forQuotes: boolean): (ch: string) => boolean {\n\t\tswitch (autoCloseConfig) {\n\t\t\tcase 'beforeWhitespace':\n\t\t\t\treturn autoCloseBeforeWhitespace;\n\t\t\tcase 'languageDefined':\n\t\t\t\treturn this._getLanguageDefinedShouldAutoClose(languageId, forQuotes);\n\t\t\tcase 'always':\n\t\t\t\treturn autoCloseAlways;\n\t\t\tcase 'never':\n\t\t\t\treturn autoCloseNever;\n\t\t}\n\t}\n\n\tprivate _getLanguageDefinedShouldAutoClose(languageId: string, forQuotes: boolean): (ch: string) => boolean {\n\t\tconst autoCloseBeforeSet = this.languageConfigurationService.getLanguageConfiguration(languageId).getAutoCloseBeforeSet(forQuotes);\n\t\treturn c => autoCloseBeforeSet.indexOf(c) !== -1;\n\t}\n\n\t/**\n\t * Returns a visible column from a column.\n\t * @see {@link CursorColumns}\n\t */\n\tpublic visibleColumnFromColumn(model: ICursorSimpleModel, position: Position): number {\n\t\treturn CursorColumns.visibleColumnFromColumn(model.getLineContent(position.lineNumber), position.column, this.tabSize);\n\t}\n\n\t/**\n\t * Returns a visible column from a column.\n\t * @see {@link CursorColumns}\n\t */\n\tpublic columnFromVisibleColumn(model: ICursorSimpleModel, lineNumber: number, visibleColumn: number): number {\n\t\tconst result = CursorColumns.columnFromVisibleColumn(model.getLineContent(lineNumber), visibleColumn, this.tabSize);\n\n\t\tconst minColumn = model.getLineMinColumn(lineNumber);\n\t\tif (result < minColumn) {\n\t\t\treturn minColumn;\n\t\t}\n\n\t\tconst maxColumn = model.getLineMaxColumn(lineNumber);\n\t\tif (result > maxColumn) {\n\t\t\treturn maxColumn;\n\t\t}\n\n\t\treturn result;\n\t}\n}\n\n/**\n * Represents a simple model (either the model or the view model).\n */\nexport interface ICursorSimpleModel {\n\tgetLineCount(): number;\n\tgetLineContent(lineNumber: number): string;\n\tgetLineMinColumn(lineNumber: number): number;\n\tgetLineMaxColumn(lineNumber: number): number;\n\tgetLineFirstNonWhitespaceColumn(lineNumber: number): number;\n\tnormalizePosition(position: Position, affinity: PositionAffinity): Position;\n\n\t/**\n\t * Gets the column at which indentation stops at a given line.\n\t * @internal\n\t */\n\tgetLineIndentColumn(lineNumber: number): number;\n}\n\nexport type PartialCursorState = CursorState | PartialModelCursorState | PartialViewCursorState;\n\nexport class CursorState {\n\t_cursorStateBrand: void = undefined;\n\n\tpublic static fromModelState(modelState: SingleCursorState): PartialModelCursorState {\n\t\treturn new PartialModelCursorState(modelState);\n\t}\n\n\tpublic static fromViewState(viewState: SingleCursorState): PartialViewCursorState {\n\t\treturn new PartialViewCursorState(viewState);\n\t}\n\n\tpublic static fromModelSelection(modelSelection: ISelection): PartialModelCursorState {\n\t\tconst selection = Selection.liftSelection(modelSelection);\n\t\tconst modelState = new SingleCursorState(\n\t\t\tRange.fromPositions(selection.getSelectionStart()),\n\t\t\tSelectionStartKind.Simple, 0,\n\t\t\tselection.getPosition(), 0\n\t\t);\n\t\treturn CursorState.fromModelState(modelState);\n\t}\n\n\tpublic static fromModelSelections(modelSelections: readonly ISelection[]): PartialModelCursorState[] {\n\t\tconst states: PartialModelCursorState[] = [];\n\t\tfor (let i = 0, len = modelSelections.length; i < len; i++) {\n\t\t\tstates[i] = this.fromModelSelection(modelSelections[i]);\n\t\t}\n\t\treturn states;\n\t}\n\n\treadonly modelState: SingleCursorState;\n\treadonly viewState: SingleCursorState;\n\n\tconstructor(modelState: SingleCursorState, viewState: SingleCursorState) {\n\t\tthis.modelState = modelState;\n\t\tthis.viewState = viewState;\n\t}\n\n\tpublic equals(other: CursorState): boolean {\n\t\treturn (this.viewState.equals(other.viewState) && this.modelState.equals(other.modelState));\n\t}\n}\n\nexport class PartialModelCursorState {\n\treadonly modelState: SingleCursorState;\n\treadonly viewState: null;\n\n\tconstructor(modelState: SingleCursorState) {\n\t\tthis.modelState = modelState;\n\t\tthis.viewState = null;\n\t}\n}\n\nexport class PartialViewCursorState {\n\treadonly modelState: null;\n\treadonly viewState: SingleCursorState;\n\n\tconstructor(viewState: SingleCursorState) {\n\t\tthis.modelState = null;\n\t\tthis.viewState = viewState;\n\t}\n}\n\nexport const enum SelectionStartKind {\n\tSimple,\n\tWord,\n\tLine\n}\n\n/**\n * Represents the cursor state on either the model or on the view model.\n */\nexport class SingleCursorState {\n\t_singleCursorStateBrand: void = undefined;\n\n\tpublic readonly selection: Selection;\n\n\tconstructor(\n\t\tpublic readonly selectionStart: Range,\n\t\tpublic readonly selectionStartKind: SelectionStartKind,\n\t\tpublic readonly selectionStartLeftoverVisibleColumns: number,\n\t\tpublic readonly position: Position,\n\t\tpublic readonly leftoverVisibleColumns: number,\n\t) {\n\t\tthis.selection = SingleCursorState._computeSelection(this.selectionStart, this.position);\n\t}\n\n\tpublic equals(other: SingleCursorState) {\n\t\treturn (\n\t\t\tthis.selectionStartLeftoverVisibleColumns === other.selectionStartLeftoverVisibleColumns\n\t\t\t&& this.leftoverVisibleColumns === other.leftoverVisibleColumns\n\t\t\t&& this.selectionStartKind === other.selectionStartKind\n\t\t\t&& this.position.equals(other.position)\n\t\t\t&& this.selectionStart.equalsRange(other.selectionStart)\n\t\t);\n\t}\n\n\tpublic hasSelection(): boolean {\n\t\treturn (!this.selection.isEmpty() || !this.selectionStart.isEmpty());\n\t}\n\n\tpublic move(inSelectionMode: boolean, lineNumber: number, column: number, leftoverVisibleColumns: number): SingleCursorState {\n\t\tif (inSelectionMode) {\n\t\t\t// move just position\n\t\t\treturn new SingleCursorState(\n\t\t\t\tthis.selectionStart,\n\t\t\t\tthis.selectionStartKind,\n\t\t\t\tthis.selectionStartLeftoverVisibleColumns,\n\t\t\t\tnew Position(lineNumber, column),\n\t\t\t\tleftoverVisibleColumns\n\t\t\t);\n\t\t} else {\n\t\t\t// move everything\n\t\t\treturn new SingleCursorState(\n\t\t\t\tnew Range(lineNumber, column, lineNumber, column),\n\t\t\t\tSelectionStartKind.Simple,\n\t\t\t\tleftoverVisibleColumns,\n\t\t\t\tnew Position(lineNumber, column),\n\t\t\t\tleftoverVisibleColumns\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate static _computeSelection(selectionStart: Range, position: Position): Selection {\n\t\tif (selectionStart.isEmpty() || !position.isBeforeOrEqual(selectionStart.getStartPosition())) {\n\t\t\treturn Selection.fromPositions(selectionStart.getStartPosition(), position);\n\t\t} else {\n\t\t\treturn Selection.fromPositions(selectionStart.getEndPosition(), position);\n\t\t}\n\t}\n}\n\nexport class EditOperationResult {\n\t_editOperationResultBrand: void = undefined;\n\n\treadonly type: EditOperationType;\n\treadonly commands: Array<ICommand | null>;\n\treadonly shouldPushStackElementBefore: boolean;\n\treadonly shouldPushStackElementAfter: boolean;\n\t/**\n\t * An optional edit operation which is computed from the selections resulting\n\t * from executing this edit operation, and which is executed right after it.\n\t * It can return `null` to skip the follow-up edit.\n\t */\n\treadonly followUp: ((selections: Selection[]) => EditOperationResult | null) | undefined;\n\n\tconstructor(\n\t\ttype: EditOperationType,\n\t\tcommands: Array<ICommand | null>,\n\t\topts: {\n\t\t\tshouldPushStackElementBefore: boolean;\n\t\t\tshouldPushStackElementAfter: boolean;\n\t\t\tfollowUp?: (selections: Selection[]) => EditOperationResult | null;\n\t\t}\n\t) {\n\t\tthis.type = type;\n\t\tthis.commands = commands;\n\t\tthis.shouldPushStackElementBefore = opts.shouldPushStackElementBefore;\n\t\tthis.shouldPushStackElementAfter = opts.shouldPushStackElementAfter;\n\t\tthis.followUp = opts.followUp;\n\t}\n}\n\nexport function isQuote(ch: string): boolean {\n\treturn (ch === '\\'' || ch === '\"' || ch === '`');\n}\n"]}
@@ -23,14 +23,17 @@ export class DefaultLinesDiffComputer {
23
23
  this.myersDiffingAlgorithm = new MyersDiffAlgorithm();
24
24
  }
25
25
  computeDiff(originalLines, modifiedLines, options) {
26
+ return this._computeDiff(originalLines, modifiedLines, options);
27
+ }
28
+ _computeDiff(originalLines, modifiedLines, options, rawChanges) {
26
29
  if (originalLines.length <= 1 && equals(originalLines, modifiedLines, (a, b) => a === b)) {
27
30
  return new LinesDiff([], [], false);
28
31
  }
29
32
  if (originalLines.length === 1 && originalLines[0].length === 0 || modifiedLines.length === 1 && modifiedLines[0].length === 0) {
33
+ const rangeMapping = new RangeMapping(new Range(1, 1, originalLines.length, originalLines[originalLines.length - 1].length + 1), new Range(1, 1, modifiedLines.length, modifiedLines[modifiedLines.length - 1].length + 1));
34
+ rawChanges?.push(rangeMapping);
30
35
  return new LinesDiff([
31
- new DetailedLineRangeMapping(new LineRange(1, originalLines.length + 1), new LineRange(1, modifiedLines.length + 1), [
32
- new RangeMapping(new Range(1, 1, originalLines.length, originalLines[originalLines.length - 1].length + 1), new Range(1, 1, modifiedLines.length, modifiedLines[modifiedLines.length - 1].length + 1))
33
- ])
36
+ new DetailedLineRangeMapping(new LineRange(1, originalLines.length + 1), new LineRange(1, modifiedLines.length + 1), [rangeMapping])
34
37
  ], [], false);
35
38
  }
36
39
  const timeout = options.maxComputationTimeMs === 0 ? InfiniteTimeout.instance : new DateTimeout(options.maxComputationTimeMs);
@@ -73,7 +76,7 @@ export class DefaultLinesDiffComputer {
73
76
  const seq2Offset = seq2LastStart + i;
74
77
  if (originalLines[seq1Offset] !== modifiedLines[seq2Offset]) {
75
78
  // This is because of whitespace changes, diff these lines
76
- const characterDiffs = this.refineDiff(originalLines, modifiedLines, new SequenceDiff(new OffsetRange(seq1Offset, seq1Offset + 1), new OffsetRange(seq2Offset, seq2Offset + 1)), timeout, considerWhitespaceChanges, options);
79
+ const characterDiffs = this.refineDiff(originalLines, modifiedLines, new SequenceDiff(new OffsetRange(seq1Offset, seq1Offset + 1), new OffsetRange(seq2Offset, seq2Offset + 1)), timeout, considerWhitespaceChanges, options, rawChanges);
77
80
  for (const a of characterDiffs.mappings) {
78
81
  alignments.push(a);
79
82
  }
@@ -91,7 +94,7 @@ export class DefaultLinesDiffComputer {
91
94
  scanForWhitespaceChanges(equalLinesCount);
92
95
  seq1LastStart = diff.seq1Range.endExclusive;
93
96
  seq2LastStart = diff.seq2Range.endExclusive;
94
- const characterDiffs = this.refineDiff(originalLines, modifiedLines, diff, timeout, considerWhitespaceChanges, options);
97
+ const characterDiffs = this.refineDiff(originalLines, modifiedLines, diff, timeout, considerWhitespaceChanges, options, rawChanges);
95
98
  if (characterDiffs.hitTimeout) {
96
99
  hitTimeout = true;
97
100
  }
@@ -156,14 +159,24 @@ export class DefaultLinesDiffComputer {
156
159
  });
157
160
  return movesWithDiffs;
158
161
  }
159
- refineDiff(originalLines, modifiedLines, diff, timeout, considerWhitespaceChanges, options) {
162
+ refineDiff(originalLines, modifiedLines, diff, timeout, considerWhitespaceChanges, options, rawChanges) {
160
163
  const lineRangeMapping = toLineRangeMapping(diff);
161
164
  const rangeMapping = lineRangeMapping.toRangeMapping2(originalLines, modifiedLines);
162
165
  const slice1 = new LinesSliceCharSequence(originalLines, rangeMapping.originalRange, considerWhitespaceChanges);
163
166
  const slice2 = new LinesSliceCharSequence(modifiedLines, rangeMapping.modifiedRange, considerWhitespaceChanges);
164
- const diffResult = slice1.length + slice2.length < 500
167
+ const useDynamicProgramming = slice1.length + slice2.length < 500;
168
+ const diffResult = useDynamicProgramming
165
169
  ? this.dynamicProgrammingDiffing.compute(slice1, slice2, timeout)
166
170
  : this.myersDiffingAlgorithm.compute(slice1, slice2, timeout);
171
+ let hitTimeout = diffResult.hitTimeout;
172
+ if (rawChanges) {
173
+ // The small-slice display algorithm favors consecutive matches over the longest common subsequence.
174
+ const rawResult = useDynamicProgramming && !hitTimeout ? this.myersDiffingAlgorithm.compute(slice1, slice2, timeout) : diffResult;
175
+ hitTimeout ||= rawResult.hitTimeout;
176
+ for (const change of rawResult.diffs) {
177
+ rawChanges.push(new RangeMapping(slice1.translateRange(change.seq1Range), slice2.translateRange(change.seq2Range)));
178
+ }
179
+ }
167
180
  const check = false;
168
181
  let diffs = diffResult.diffs;
169
182
  if (check) {
@@ -198,7 +211,7 @@ export class DefaultLinesDiffComputer {
198
211
  // Assert: result applied on original should be the same as diff applied to original
199
212
  return {
200
213
  mappings: result,
201
- hitTimeout: diffResult.hitTimeout,
214
+ hitTimeout,
202
215
  };
203
216
  }
204
217
  }