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
@@ -17,7 +17,7 @@ export class ToggleCollapseUnchangedRegions extends Action2 {
17
17
  constructor() {
18
18
  super({
19
19
  id: 'diffEditor.toggleCollapseUnchangedRegions',
20
- title: localize2(101, 'Toggle Collapse Unchanged Regions'),
20
+ title: localize2(102, 'Toggle Collapse Unchanged Regions'),
21
21
  icon: Codicon.map,
22
22
  toggled: ContextKeyExpr.has('config.diffEditor.hideUnchangedRegions.enabled'),
23
23
  precondition: ContextKeyExpr.has('isInDiffEditor'),
@@ -39,7 +39,7 @@ export class ToggleShowMovedCodeBlocks extends Action2 {
39
39
  constructor() {
40
40
  super({
41
41
  id: 'diffEditor.toggleShowMovedCodeBlocks',
42
- title: localize2(102, 'Toggle Show Moved Code Blocks'),
42
+ title: localize2(103, 'Toggle Show Moved Code Blocks'),
43
43
  precondition: ContextKeyExpr.has('isInDiffEditor'),
44
44
  });
45
45
  }
@@ -53,7 +53,7 @@ export class ToggleUseInlineViewWhenSpaceIsLimited extends Action2 {
53
53
  constructor() {
54
54
  super({
55
55
  id: 'diffEditor.toggleUseInlineViewWhenSpaceIsLimited',
56
- title: localize2(103, 'Toggle Use Inline View When Space Is Limited'),
56
+ title: localize2(104, 'Toggle Use Inline View When Space Is Limited'),
57
57
  precondition: ContextKeyExpr.has('isInDiffEditor'),
58
58
  });
59
59
  }
@@ -63,12 +63,12 @@ export class ToggleUseInlineViewWhenSpaceIsLimited extends Action2 {
63
63
  configurationService.updateValue('diffEditor.useInlineViewWhenSpaceIsLimited', newValue);
64
64
  }
65
65
  }
66
- const diffEditorCategory = localize2(104, "Diff Editor");
66
+ const diffEditorCategory = localize2(105, "Diff Editor");
67
67
  export class SwitchSide extends EditorAction2 {
68
68
  constructor() {
69
69
  super({
70
70
  id: 'diffEditor.switchSide',
71
- title: localize2(105, 'Switch Side'),
71
+ title: localize2(106, 'Switch Side'),
72
72
  icon: Codicon.arrowSwap,
73
73
  precondition: ContextKeyExpr.has('isInDiffEditor'),
74
74
  f1: true,
@@ -92,7 +92,7 @@ export class ExitCompareMove extends EditorAction2 {
92
92
  constructor() {
93
93
  super({
94
94
  id: 'diffEditor.exitCompareMove',
95
- title: localize2(106, 'Exit Compare Move'),
95
+ title: localize2(107, 'Exit Compare Move'),
96
96
  icon: Codicon.close,
97
97
  precondition: EditorContextKeys.comparingMovedCode,
98
98
  f1: false,
@@ -114,7 +114,7 @@ export class CollapseAllUnchangedRegions extends EditorAction2 {
114
114
  constructor() {
115
115
  super({
116
116
  id: 'diffEditor.collapseAllUnchangedRegions',
117
- title: localize2(107, 'Collapse All Unchanged Regions'),
117
+ title: localize2(108, 'Collapse All Unchanged Regions'),
118
118
  icon: Codicon.fold,
119
119
  precondition: ContextKeyExpr.has('isInDiffEditor'),
120
120
  f1: true,
@@ -132,7 +132,7 @@ export class ShowAllUnchangedRegions extends EditorAction2 {
132
132
  constructor() {
133
133
  super({
134
134
  id: 'diffEditor.showAllUnchangedRegions',
135
- title: localize2(108, 'Show All Unchanged Regions'),
135
+ title: localize2(109, 'Show All Unchanged Regions'),
136
136
  icon: Codicon.unfold,
137
137
  precondition: ContextKeyExpr.has('isInDiffEditor'),
138
138
  f1: true,
@@ -150,7 +150,7 @@ export class RevertHunkOrSelection extends Action2 {
150
150
  constructor() {
151
151
  super({
152
152
  id: 'diffEditor.revert',
153
- title: localize2(109, 'Revert'),
153
+ title: localize2(110, 'Revert'),
154
154
  f1: true,
155
155
  category: diffEditorCategory,
156
156
  precondition: ContextKeyExpr.has('isInDiffEditor'),
@@ -174,13 +174,13 @@ export class RevertHunkOrSelection extends Action2 {
174
174
  return undefined;
175
175
  }
176
176
  }
177
- const accessibleDiffViewerCategory = localize2(110, "Accessible Diff Viewer");
177
+ const accessibleDiffViewerCategory = localize2(111, "Accessible Diff Viewer");
178
178
  export class AccessibleDiffViewerNext extends Action2 {
179
179
  static { this.id = 'editor.action.accessibleDiffViewer.next'; }
180
180
  constructor() {
181
181
  super({
182
182
  id: AccessibleDiffViewerNext.id,
183
- title: localize2(111, 'Go to Next Difference'),
183
+ title: localize2(112, 'Go to Next Difference'),
184
184
  category: accessibleDiffViewerCategory,
185
185
  precondition: ContextKeyExpr.has('isInDiffEditor'),
186
186
  keybinding: {
@@ -200,7 +200,7 @@ export class AccessibleDiffViewerPrev extends Action2 {
200
200
  constructor() {
201
201
  super({
202
202
  id: AccessibleDiffViewerPrev.id,
203
- title: localize2(112, 'Go to Previous Difference'),
203
+ title: localize2(113, 'Go to Previous Difference'),
204
204
  category: accessibleDiffViewerCategory,
205
205
  precondition: ContextKeyExpr.has('isInDiffEditor'),
206
206
  keybinding: {
@@ -38,9 +38,9 @@ import { IInstantiationService } from '../../../../../platform/instantiation/com
38
38
  import { registerIcon } from '../../../../../platform/theme/common/iconRegistry.js';
39
39
  import './accessibleDiffViewer.css';
40
40
  import { toAction } from '../../../../../base/common/actions.js';
41
- const accessibleDiffViewerInsertIcon = registerIcon('diff-review-insert', Codicon.add, localize(113, 'Icon for \'Insert\' in accessible diff viewer.'));
42
- const accessibleDiffViewerRemoveIcon = registerIcon('diff-review-remove', Codicon.remove, localize(114, 'Icon for \'Remove\' in accessible diff viewer.'));
43
- const accessibleDiffViewerCloseIcon = registerIcon('diff-review-close', Codicon.close, localize(115, 'Icon for \'Close\' in accessible diff viewer.'));
41
+ const accessibleDiffViewerInsertIcon = registerIcon('diff-review-insert', Codicon.add, localize(114, 'Icon for \'Insert\' in accessible diff viewer.'));
42
+ const accessibleDiffViewerRemoveIcon = registerIcon('diff-review-remove', Codicon.remove, localize(115, 'Icon for \'Remove\' in accessible diff viewer.'));
43
+ const accessibleDiffViewerCloseIcon = registerIcon('diff-review-close', Codicon.close, localize(116, 'Icon for \'Close\' in accessible diff viewer.'));
44
44
  let AccessibleDiffViewer = class AccessibleDiffViewer extends Disposable {
45
45
  static { this._ttPolicy = createTrustedTypesPolicy('diffReview', { createHTML: value => value }); }
46
46
  constructor(_parentNode, _visible, _setVisible, _canClose, _width, _height, _diffs, _models, _instantiationService) {
@@ -298,7 +298,7 @@ let View = class View extends Disposable {
298
298
  if (this._model.canClose.read(reader)) {
299
299
  this._actionBar.push(toAction({
300
300
  id: 'diffreview.close',
301
- label: localize(116, "Close"),
301
+ label: localize(117, "Close"),
302
302
  class: 'close-diff-review ' + ThemeIcon.asClassName(accessibleDiffViewerCloseIcon),
303
303
  enabled: true,
304
304
  run: async () => _model.close()
@@ -357,7 +357,7 @@ let View = class View extends Disposable {
357
357
  const container = document.createElement('div');
358
358
  container.className = 'diff-review-table';
359
359
  container.setAttribute('role', 'list');
360
- container.setAttribute('aria-label', localize(117, 'Accessible Diff Viewer. Use arrow up and down to navigate.'));
360
+ container.setAttribute('aria-label', localize(118, 'Accessible Diff Viewer. Use arrow up and down to navigate.'));
361
361
  applyFontInfo(container, modifiedOptions.get(59 /* EditorOption.fontInfo */));
362
362
  reset(this._content, container);
363
363
  const originalModel = this._models.getOriginalModel();
@@ -381,12 +381,12 @@ let View = class View extends Disposable {
381
381
  const r = group.range;
382
382
  const diffIndex = this._model.currentGroupIndex.get();
383
383
  const diffsLength = this._model.groups.get().length;
384
- const getAriaLines = (lines) => lines === 0 ? localize(118, "no lines changed")
385
- : lines === 1 ? localize(119, "1 line changed")
386
- : localize(120, "{0} lines changed", lines);
384
+ const getAriaLines = (lines) => lines === 0 ? localize(119, "no lines changed")
385
+ : lines === 1 ? localize(120, "1 line changed")
386
+ : localize(121, "{0} lines changed", lines);
387
387
  const originalChangedLinesCntAria = getAriaLines(r.original.length);
388
388
  const modifiedChangedLinesCntAria = getAriaLines(r.modified.length);
389
- header.setAttribute('aria-label', localize(121, "Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}", (diffIndex + 1), diffsLength, r.original.startLineNumber, originalChangedLinesCntAria, r.modified.startLineNumber, modifiedChangedLinesCntAria));
389
+ header.setAttribute('aria-label', localize(122, "Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}", (diffIndex + 1), diffsLength, r.original.startLineNumber, originalChangedLinesCntAria, r.modified.startLineNumber, modifiedChangedLinesCntAria));
390
390
 
391
391
 
392
392
 
@@ -424,9 +424,9 @@ let View = class View extends Disposable {
424
424
  this._scrollbar.scanDomNode();
425
425
  }
426
426
  _createRow(item, lineHeight, width, originalOptions, originalModel, originalModelOpts, modifiedOptions, modifiedModel, modifiedModelOpts) {
427
- const originalLayoutInfo = originalOptions.get(166 /* EditorOption.layoutInfo */);
427
+ const originalLayoutInfo = originalOptions.get(169 /* EditorOption.layoutInfo */);
428
428
  const originalLineNumbersWidth = originalLayoutInfo.glyphMarginWidth + originalLayoutInfo.lineNumbersWidth;
429
- const modifiedLayoutInfo = modifiedOptions.get(166 /* EditorOption.layoutInfo */);
429
+ const modifiedLayoutInfo = modifiedOptions.get(169 /* EditorOption.layoutInfo */);
430
430
  const modifiedLineNumbersWidth = 10 + modifiedLayoutInfo.glyphMarginWidth + modifiedLayoutInfo.lineNumbersWidth;
431
431
  let rowClassName = 'diff-review-row';
432
432
  let lineNumbersExtraClassName = '';
@@ -506,23 +506,23 @@ let View = class View extends Disposable {
506
506
  lineContent = originalModel.getLineContent(item.originalLineNumber);
507
507
  }
508
508
  if (lineContent.length === 0) {
509
- lineContent = localize(122, "blank");
509
+ lineContent = localize(123, "blank");
510
510
  }
511
511
  let ariaLabel = '';
512
512
  switch (item.type) {
513
513
  case LineType.Unchanged:
514
514
  if (item.originalLineNumber === item.modifiedLineNumber) {
515
- ariaLabel = localize(123, "{0} unchanged line {1}", lineContent, item.originalLineNumber);
515
+ ariaLabel = localize(124, "{0} unchanged line {1}", lineContent, item.originalLineNumber);
516
516
  }
517
517
  else {
518
- ariaLabel = localize(124, "{0} original line {1} modified line {2}", lineContent, item.originalLineNumber, item.modifiedLineNumber);
518
+ ariaLabel = localize(125, "{0} original line {1} modified line {2}", lineContent, item.originalLineNumber, item.modifiedLineNumber);
519
519
  }
520
520
  break;
521
521
  case LineType.Added:
522
- ariaLabel = localize(125, "+ {0} modified line {1}", lineContent, item.modifiedLineNumber);
522
+ ariaLabel = localize(126, "+ {0} modified line {1}", lineContent, item.modifiedLineNumber);
523
523
  break;
524
524
  case LineType.Deleted:
525
- ariaLabel = localize(126, "- {0} original line {1}", lineContent, item.originalLineNumber);
525
+ ariaLabel = localize(127, "- {0} original line {1}", lineContent, item.originalLineNumber);
526
526
  break;
527
527
  }
528
528
  row.setAttribute('aria-label', ariaLabel);
@@ -531,11 +531,11 @@ let View = class View extends Disposable {
531
531
  _getLineHtml(model, options, tabSize, lineNumber, languageIdCodec) {
532
532
  const lineContent = model.getLineContent(lineNumber);
533
533
  const fontInfo = options.get(59 /* EditorOption.fontInfo */);
534
- const verticalScrollbarSize = options.get(117 /* EditorOption.scrollbar */).verticalScrollbarSize;
534
+ const verticalScrollbarSize = options.get(119 /* EditorOption.scrollbar */).verticalScrollbarSize;
535
535
  const lineTokens = LineTokens.createEmpty(lineContent, languageIdCodec);
536
536
  const isBasicASCII = ViewLineRenderingData.isBasicASCII(lineContent, model.mightContainNonBasicASCII());
537
537
  const containsRTL = ViewLineRenderingData.containsRTL(lineContent, isBasicASCII, model.mightContainRTL());
538
- const r = renderViewLine2(new RenderLineInput((fontInfo.isMonospace && !options.get(40 /* EditorOption.disableMonospaceOptimizations */)), fontInfo.canUseHalfwidthRightwardsArrow, lineContent, false, isBasicASCII, containsRTL, 0, lineTokens, [], tabSize, 0, fontInfo.spaceWidth, fontInfo.middotWidth, fontInfo.wsmiddotWidth, options.get(133 /* EditorOption.stopRenderingLineAfter */), options.get(113 /* EditorOption.renderWhitespace */), options.get(108 /* EditorOption.renderControlCharacters */), options.get(60 /* EditorOption.fontLigatures */) !== EditorFontLigatures.OFF, null, null, verticalScrollbarSize));
538
+ const r = renderViewLine2(new RenderLineInput((fontInfo.isMonospace && !options.get(40 /* EditorOption.disableMonospaceOptimizations */)), fontInfo.canUseHalfwidthRightwardsArrow, lineContent, false, isBasicASCII, containsRTL, 0, lineTokens, [], tabSize, 0, fontInfo.spaceWidth, fontInfo.middotWidth, fontInfo.wsmiddotWidth, options.get(136 /* EditorOption.stopRenderingLineAfter */), options.get(115 /* EditorOption.renderWhitespace */), options.get(110 /* EditorOption.renderControlCharacters */), options.get(60 /* EditorOption.fontLigatures */) !== EditorFontLigatures.OFF, null, null, verticalScrollbarSize));
539
539
  return r.html;
540
540
  }
541
541
  };
@@ -169,7 +169,7 @@ let DiffEditorEditors = class DiffEditorEditors extends Disposable {
169
169
  if (!ariaLabel) {
170
170
  ariaLabel = '';
171
171
  }
172
- const ariaNavigationTip = localize(127, ' use {0} to open the accessibility help.', this._keybindingService.lookupKeybinding('editor.action.accessibilityHelp')?.getAriaLabel());
172
+ const ariaNavigationTip = localize(128, ' use {0} to open the accessibility help.', this._keybindingService.lookupKeybinding('editor.action.accessibilityHelp')?.getAriaLabel());
173
173
  if (this._options.accessibilityVerbose.get()) {
174
174
  return ariaLabel + ariaNavigationTip;
175
175
  }
@@ -68,12 +68,12 @@ let DiffEditorViewZones = class DiffEditorViewZones extends Disposable {
68
68
  updateImmediately.schedule();
69
69
  } }));
70
70
  this._register(this._editors.original.onDidChangeConfiguration((args) => {
71
- if (args.hasChanged(167 /* EditorOption.wrappingInfo */) || args.hasChanged(75 /* EditorOption.lineHeight */)) {
71
+ if (args.hasChanged(170 /* EditorOption.wrappingInfo */) || args.hasChanged(75 /* EditorOption.lineHeight */)) {
72
72
  updateImmediately.schedule();
73
73
  }
74
74
  }));
75
75
  this._register(this._editors.modified.onDidChangeConfiguration((args) => {
76
- if (args.hasChanged(167 /* EditorOption.wrappingInfo */) || args.hasChanged(75 /* EditorOption.lineHeight */)) {
76
+ if (args.hasChanged(170 /* EditorOption.wrappingInfo */) || args.hasChanged(75 /* EditorOption.lineHeight */)) {
77
77
  updateImmediately.schedule();
78
78
  }
79
79
  }));
@@ -494,7 +494,7 @@ function computeRangeAlignment(originalEditor, modifiedEditor, diffs, originalEd
494
494
  function getAdditionalLineHeights(editor, viewZonesToIgnore) {
495
495
  const viewZoneHeights = [];
496
496
  const wrappingZoneHeights = [];
497
- const hasWrapping = editor.getOption(167 /* EditorOption.wrappingInfo */).wrappingColumn !== -1;
497
+ const hasWrapping = editor.getOption(170 /* EditorOption.wrappingInfo */).wrappingColumn !== -1;
498
498
  const coordinatesConverter = editor._getViewModel().coordinatesConverter;
499
499
  const editorLineHeight = editor.getOption(75 /* EditorOption.lineHeight */);
500
500
  if (hasWrapping) {
@@ -45,7 +45,7 @@ export class InlineDiffDeletedCodeMargin extends Disposable {
45
45
  this._diffActions.style.lineHeight = `${lineHeight}px`;
46
46
  this._marginDomNode.appendChild(this._diffActions);
47
47
  let currentLineNumberOffset = 0;
48
- const useShadowDOM = _modifiedEditor.getOption(144 /* EditorOption.useShadowDOM */) && !isIOS; // Do not use shadow dom on IOS #122035
48
+ const useShadowDOM = _modifiedEditor.getOption(147 /* EditorOption.useShadowDOM */) && !isIOS; // Do not use shadow dom on IOS #122035
49
49
  const showContextMenu = (anchor, baseActions, onHide) => {
50
50
  this._contextMenuService.showContextMenu({
51
51
  domForShadowRoot: useShadowDOM ? _modifiedEditor.getDomNode() ?? undefined : undefined,
@@ -57,18 +57,18 @@ export class InlineDiffDeletedCodeMargin extends Disposable {
57
57
  // default action
58
58
  actions.push(new Action('diff.clipboard.copyDeletedContent', isDeletion
59
59
  ? (_diff.original.length > 1
60
- ? localize(128, "Copy deleted lines")
61
- : localize(129, "Copy deleted line"))
60
+ ? localize(129, "Copy deleted lines")
61
+ : localize(130, "Copy deleted line"))
62
62
  : (_diff.original.length > 1
63
- ? localize(130, "Copy changed lines")
64
- : localize(131, "Copy changed line")), undefined, true, async () => {
63
+ ? localize(131, "Copy changed lines")
64
+ : localize(132, "Copy changed line")), undefined, true, async () => {
65
65
  const originalText = this._originalTextModel.getValueInRange(_diff.original.toExclusiveRange());
66
66
  await this._clipboardService.writeText(originalText);
67
67
  }));
68
68
  if (_diff.original.length > 1) {
69
69
  actions.push(new Action('diff.clipboard.copyDeletedLineContent', isDeletion
70
- ? localize(132, "Copy deleted line ({0})", _diff.original.startLineNumber + currentLineNumberOffset)
71
- : localize(133, "Copy changed line ({0})", _diff.original.startLineNumber + currentLineNumberOffset), undefined, true, async () => {
70
+ ? localize(133, "Copy deleted line ({0})", _diff.original.startLineNumber + currentLineNumberOffset)
71
+ : localize(134, "Copy changed line ({0})", _diff.original.startLineNumber + currentLineNumberOffset), undefined, true, async () => {
72
72
  let lineContent = this._originalTextModel.getLineContent(_diff.original.startLineNumber + currentLineNumberOffset);
73
73
  if (lineContent === '') {
74
74
  // empty line -> new line
@@ -78,15 +78,15 @@ export class InlineDiffDeletedCodeMargin extends Disposable {
78
78
  await this._clipboardService.writeText(lineContent);
79
79
  }));
80
80
  }
81
- const readOnly = _modifiedEditor.getOption(104 /* EditorOption.readOnly */);
81
+ const readOnly = _modifiedEditor.getOption(106 /* EditorOption.readOnly */);
82
82
  if (!readOnly) {
83
- actions.push(new Action('diff.inline.revertChange', localize(134, "Revert this change"), undefined, true, async () => {
83
+ actions.push(new Action('diff.inline.revertChange', localize(135, "Revert this change"), undefined, true, async () => {
84
84
  this._editor.revert(this._diff);
85
85
  }));
86
86
  }
87
87
  return actions;
88
88
  },
89
- autoSelectFirstItem: true
89
+ autoSelectItem: true
90
90
  });
91
91
  };
92
92
  this._register(addStandardDisposableListener(this._diffActions, 'mousedown', e => {
@@ -1 +1 @@
1
- {"version":3,"sources":["vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,6BAA6B,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC9G,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AAOvE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGzD,MAAM,OAAO,2BAA4B,SAAQ,UAAU;IAK1D,IAAI,UAAU;QACb,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;IAED,IAAI,UAAU,CAAC,WAAoB;QAClC,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I,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;gBACjD,IAAI,gBAAgB,GAAG,GAAG,EAAE,CAAC;oBAC5B,OAAO,CAAC,CAAC;gBACV,CAAC;YACF,CAAC;QACF,CAAC;QACD,OAAO,gBAAgB,CAAC;IACzB,CAAC;CACD","file":"inlineDiffDeletedCodeMargin.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 { addStandardDisposableListener, getDomNodePagePosition } from '../../../../../../base/browser/dom.js';\nimport { Action } from '../../../../../../base/common/actions.js';\nimport { Codicon } from '../../../../../../base/common/codicons.js';\nimport { Disposable } from '../../../../../../base/common/lifecycle.js';\nimport { isIOS } from '../../../../../../base/common/platform.js';\nimport { ThemeIcon } from '../../../../../../base/common/themables.js';\nimport { IEditorMouseEvent, MouseTargetType } from '../../../../editorBrowser.js';\nimport { CodeEditorWidget } from '../../../codeEditor/codeEditorWidget.js';\nimport { DiffEditorWidget } from '../../diffEditorWidget.js';\nimport { EditorOption } from '../../../../../common/config/editorOptions.js';\nimport { DetailedLineRangeMapping } from '../../../../../common/diff/rangeMapping.js';\nimport { EndOfLineSequence, ITextModel } from '../../../../../common/model.js';\nimport { localize } from '../../../../../../nls.js';\nimport { IClipboardService } from '../../../../../../platform/clipboard/common/clipboardService.js';\nimport { IContextMenuService } from '../../../../../../platform/contextview/browser/contextView.js';\nimport { enableCopySelection } from './copySelection.js';\nimport { RenderLinesResult } from './renderLines.js';\n\nexport class InlineDiffDeletedCodeMargin extends Disposable {\n\tprivate readonly _diffActions: HTMLElement;\n\n\tprivate _visibility: boolean = false;\n\n\tget visibility(): boolean {\n\t\treturn this._visibility;\n\t}\n\n\tset visibility(_visibility: boolean) {\n\t\tif (this._visibility !== _visibility) {\n\t\t\tthis._visibility = _visibility;\n\t\t\tthis._diffActions.style.visibility = _visibility ? 'visible' : 'hidden';\n\t\t}\n\t}\n\n\tconstructor(\n\t\tprivate readonly _getViewZoneId: () => string,\n\t\tprivate readonly _marginDomNode: HTMLElement,\n\t\tprivate readonly _deletedCodeDomNode: HTMLElement,\n\t\tprivate readonly _modifiedEditor: CodeEditorWidget,\n\t\tprivate readonly _diff: DetailedLineRangeMapping,\n\t\tprivate readonly _editor: DiffEditorWidget,\n\t\tprivate readonly _renderLinesResult: RenderLinesResult,\n\t\tprivate readonly _originalTextModel: ITextModel,\n\t\tprivate readonly _contextMenuService: IContextMenuService,\n\t\tprivate readonly _clipboardService: IClipboardService,\n\t) {\n\t\tsuper();\n\n\t\t// make sure the diff margin shows above overlay.\n\t\tthis._marginDomNode.style.zIndex = '10';\n\n\t\tthis._diffActions = document.createElement('div');\n\t\tthis._diffActions.className = ThemeIcon.asClassName(Codicon.lightBulb) + ' lightbulb-glyph';\n\t\tthis._diffActions.style.position = 'absolute';\n\t\tconst lineHeight = this._modifiedEditor.getOption(EditorOption.lineHeight);\n\t\tthis._diffActions.style.right = '0px';\n\t\tthis._diffActions.style.visibility = 'hidden';\n\t\tthis._diffActions.style.height = `${lineHeight}px`;\n\t\tthis._diffActions.style.lineHeight = `${lineHeight}px`;\n\t\tthis._marginDomNode.appendChild(this._diffActions);\n\n\t\tlet currentLineNumberOffset = 0;\n\n\t\tconst useShadowDOM = _modifiedEditor.getOption(EditorOption.useShadowDOM) && !isIOS; // Do not use shadow dom on IOS #122035\n\t\tconst showContextMenu = (anchor: { x: number; y: number }, baseActions?: Action[], onHide?: () => void) => {\n\t\t\tthis._contextMenuService.showContextMenu({\n\t\t\t\tdomForShadowRoot: useShadowDOM ? _modifiedEditor.getDomNode() ?? undefined : undefined,\n\t\t\t\tgetAnchor: () => anchor,\n\t\t\t\tonHide,\n\t\t\t\tgetActions: () => {\n\t\t\t\t\tconst actions: Action[] = baseActions ?? [];\n\t\t\t\t\tconst isDeletion = _diff.modified.isEmpty;\n\n\t\t\t\t\t// default action\n\t\t\t\t\tactions.push(new Action(\n\t\t\t\t\t\t'diff.clipboard.copyDeletedContent',\n\t\t\t\t\t\tisDeletion\n\t\t\t\t\t\t\t? (_diff.original.length > 1\n\t\t\t\t\t\t\t\t? localize('diff.clipboard.copyDeletedLinesContent.label', \"Copy deleted lines\")\n\t\t\t\t\t\t\t\t: localize('diff.clipboard.copyDeletedLinesContent.single.label', \"Copy deleted line\"))\n\t\t\t\t\t\t\t: (_diff.original.length > 1\n\t\t\t\t\t\t\t\t? localize('diff.clipboard.copyChangedLinesContent.label', \"Copy changed lines\")\n\t\t\t\t\t\t\t\t: localize('diff.clipboard.copyChangedLinesContent.single.label', \"Copy changed line\")),\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\ttrue,\n\t\t\t\t\t\tasync () => {\n\t\t\t\t\t\t\tconst originalText = this._originalTextModel.getValueInRange(_diff.original.toExclusiveRange());\n\t\t\t\t\t\t\tawait this._clipboardService.writeText(originalText);\n\t\t\t\t\t\t}\n\t\t\t\t\t));\n\n\t\t\t\t\tif (_diff.original.length > 1) {\n\t\t\t\t\t\tactions.push(new Action(\n\t\t\t\t\t\t\t'diff.clipboard.copyDeletedLineContent',\n\t\t\t\t\t\t\tisDeletion\n\t\t\t\t\t\t\t\t? localize('diff.clipboard.copyDeletedLineContent.label', \"Copy deleted line ({0})\",\n\t\t\t\t\t\t\t\t\t_diff.original.startLineNumber + currentLineNumberOffset)\n\t\t\t\t\t\t\t\t: localize('diff.clipboard.copyChangedLineContent.label', \"Copy changed line ({0})\",\n\t\t\t\t\t\t\t\t\t_diff.original.startLineNumber + currentLineNumberOffset),\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tasync () => {\n\t\t\t\t\t\t\t\tlet lineContent = this._originalTextModel.getLineContent(_diff.original.startLineNumber + currentLineNumberOffset);\n\t\t\t\t\t\t\t\tif (lineContent === '') {\n\t\t\t\t\t\t\t\t\t// empty line -> new line\n\t\t\t\t\t\t\t\t\tconst eof = this._originalTextModel.getEndOfLineSequence();\n\t\t\t\t\t\t\t\t\tlineContent = eof === EndOfLineSequence.LF ? '\\n' : '\\r\\n';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tawait this._clipboardService.writeText(lineContent);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t\tconst readOnly = _modifiedEditor.getOption(EditorOption.readOnly);\n\t\t\t\t\tif (!readOnly) {\n\t\t\t\t\t\tactions.push(new Action(\n\t\t\t\t\t\t\t'diff.inline.revertChange',\n\t\t\t\t\t\t\tlocalize('diff.inline.revertChange.label', \"Revert this change\"),\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tasync () => {\n\t\t\t\t\t\t\t\tthis._editor.revert(this._diff);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn actions;\n\t\t\t\t},\n\t\t\t\tautoSelectFirstItem: true\n\t\t\t});\n\t\t};\n\n\t\tthis._register(addStandardDisposableListener(this._diffActions, 'mousedown', e => {\n\t\t\tif (!e.leftButton) { return; }\n\n\t\t\tconst { top, height } = getDomNodePagePosition(this._diffActions);\n\t\t\tconst pad = Math.floor(lineHeight / 3);\n\t\t\te.preventDefault();\n\t\t\tshowContextMenu({ x: e.posx, y: top + height + pad });\n\t\t}));\n\n\t\tthis._register(_modifiedEditor.onMouseMove((e: IEditorMouseEvent) => {\n\t\t\tif ((e.target.type === MouseTargetType.CONTENT_VIEW_ZONE || e.target.type === MouseTargetType.GUTTER_VIEW_ZONE) && e.target.detail.viewZoneId === this._getViewZoneId()) {\n\t\t\t\tcurrentLineNumberOffset = this._updateLightBulbPosition(this._marginDomNode, e.event.browserEvent.y, lineHeight);\n\t\t\t\tthis.visibility = true;\n\t\t\t} else {\n\t\t\t\tthis.visibility = false;\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(enableCopySelection({\n\t\t\tdomNode: this._deletedCodeDomNode,\n\t\t\tdiffEntry: _diff,\n\t\t\toriginalModel: this._originalTextModel,\n\t\t\trenderLinesResult: this._renderLinesResult,\n\t\t\tclipboardService: _clipboardService,\n\t\t}));\n\t}\n\n\tprivate _updateLightBulbPosition(marginDomNode: HTMLElement, y: number, lineHeight: number): number {\n\t\tconst { top } = getDomNodePagePosition(marginDomNode);\n\t\tconst offset = y - top;\n\t\tconst lineNumberOffset = Math.floor(offset / lineHeight);\n\t\tconst newTop = lineNumberOffset * lineHeight;\n\t\tthis._diffActions.style.top = `${newTop}px`;\n\t\tif (this._renderLinesResult.viewLineCounts) {\n\t\t\tlet acc = 0;\n\t\t\tfor (let i = 0; i < this._renderLinesResult.viewLineCounts.length; i++) {\n\t\t\t\tacc += this._renderLinesResult.viewLineCounts[i];\n\t\t\t\tif (lineNumberOffset < acc) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn lineNumberOffset;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,6BAA6B,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC9G,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AAOvE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAG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AK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACxE,GAAG,IAAI,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;gBACjD,IAAI,gBAAgB,GAAG,GAAG,EAAE,CAAC;oBAC5B,OAAO,CAAC,CAAC;gBACV,CAAC;YACF,CAAC;QACF,CAAC;QACD,OAAO,gBAAgB,CAAC;IACzB,CAAC;CACD","file":"inlineDiffDeletedCodeMargin.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 { addStandardDisposableListener, getDomNodePagePosition } from '../../../../../../base/browser/dom.js';\nimport { Action } from '../../../../../../base/common/actions.js';\nimport { Codicon } from '../../../../../../base/common/codicons.js';\nimport { Disposable } from '../../../../../../base/common/lifecycle.js';\nimport { isIOS } from '../../../../../../base/common/platform.js';\nimport { ThemeIcon } from '../../../../../../base/common/themables.js';\nimport { IEditorMouseEvent, MouseTargetType } from '../../../../editorBrowser.js';\nimport { CodeEditorWidget } from '../../../codeEditor/codeEditorWidget.js';\nimport { DiffEditorWidget } from '../../diffEditorWidget.js';\nimport { EditorOption } from '../../../../../common/config/editorOptions.js';\nimport { DetailedLineRangeMapping } from '../../../../../common/diff/rangeMapping.js';\nimport { EndOfLineSequence, ITextModel } from '../../../../../common/model.js';\nimport { localize } from '../../../../../../nls.js';\nimport { IClipboardService } from '../../../../../../platform/clipboard/common/clipboardService.js';\nimport { IContextMenuService } from '../../../../../../platform/contextview/browser/contextView.js';\nimport { enableCopySelection } from './copySelection.js';\nimport { RenderLinesResult } from './renderLines.js';\n\nexport class InlineDiffDeletedCodeMargin extends Disposable {\n\tprivate readonly _diffActions: HTMLElement;\n\n\tprivate _visibility: boolean = false;\n\n\tget visibility(): boolean {\n\t\treturn this._visibility;\n\t}\n\n\tset visibility(_visibility: boolean) {\n\t\tif (this._visibility !== _visibility) {\n\t\t\tthis._visibility = _visibility;\n\t\t\tthis._diffActions.style.visibility = _visibility ? 'visible' : 'hidden';\n\t\t}\n\t}\n\n\tconstructor(\n\t\tprivate readonly _getViewZoneId: () => string,\n\t\tprivate readonly _marginDomNode: HTMLElement,\n\t\tprivate readonly _deletedCodeDomNode: HTMLElement,\n\t\tprivate readonly _modifiedEditor: CodeEditorWidget,\n\t\tprivate readonly _diff: DetailedLineRangeMapping,\n\t\tprivate readonly _editor: DiffEditorWidget,\n\t\tprivate readonly _renderLinesResult: RenderLinesResult,\n\t\tprivate readonly _originalTextModel: ITextModel,\n\t\tprivate readonly _contextMenuService: IContextMenuService,\n\t\tprivate readonly _clipboardService: IClipboardService,\n\t) {\n\t\tsuper();\n\n\t\t// make sure the diff margin shows above overlay.\n\t\tthis._marginDomNode.style.zIndex = '10';\n\n\t\tthis._diffActions = document.createElement('div');\n\t\tthis._diffActions.className = ThemeIcon.asClassName(Codicon.lightBulb) + ' lightbulb-glyph';\n\t\tthis._diffActions.style.position = 'absolute';\n\t\tconst lineHeight = this._modifiedEditor.getOption(EditorOption.lineHeight);\n\t\tthis._diffActions.style.right = '0px';\n\t\tthis._diffActions.style.visibility = 'hidden';\n\t\tthis._diffActions.style.height = `${lineHeight}px`;\n\t\tthis._diffActions.style.lineHeight = `${lineHeight}px`;\n\t\tthis._marginDomNode.appendChild(this._diffActions);\n\n\t\tlet currentLineNumberOffset = 0;\n\n\t\tconst useShadowDOM = _modifiedEditor.getOption(EditorOption.useShadowDOM) && !isIOS; // Do not use shadow dom on IOS #122035\n\t\tconst showContextMenu = (anchor: { x: number; y: number }, baseActions?: Action[], onHide?: () => void) => {\n\t\t\tthis._contextMenuService.showContextMenu({\n\t\t\t\tdomForShadowRoot: useShadowDOM ? _modifiedEditor.getDomNode() ?? undefined : undefined,\n\t\t\t\tgetAnchor: () => anchor,\n\t\t\t\tonHide,\n\t\t\t\tgetActions: () => {\n\t\t\t\t\tconst actions: Action[] = baseActions ?? [];\n\t\t\t\t\tconst isDeletion = _diff.modified.isEmpty;\n\n\t\t\t\t\t// default action\n\t\t\t\t\tactions.push(new Action(\n\t\t\t\t\t\t'diff.clipboard.copyDeletedContent',\n\t\t\t\t\t\tisDeletion\n\t\t\t\t\t\t\t? (_diff.original.length > 1\n\t\t\t\t\t\t\t\t? localize('diff.clipboard.copyDeletedLinesContent.label', \"Copy deleted lines\")\n\t\t\t\t\t\t\t\t: localize('diff.clipboard.copyDeletedLinesContent.single.label', \"Copy deleted line\"))\n\t\t\t\t\t\t\t: (_diff.original.length > 1\n\t\t\t\t\t\t\t\t? localize('diff.clipboard.copyChangedLinesContent.label', \"Copy changed lines\")\n\t\t\t\t\t\t\t\t: localize('diff.clipboard.copyChangedLinesContent.single.label', \"Copy changed line\")),\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\ttrue,\n\t\t\t\t\t\tasync () => {\n\t\t\t\t\t\t\tconst originalText = this._originalTextModel.getValueInRange(_diff.original.toExclusiveRange());\n\t\t\t\t\t\t\tawait this._clipboardService.writeText(originalText);\n\t\t\t\t\t\t}\n\t\t\t\t\t));\n\n\t\t\t\t\tif (_diff.original.length > 1) {\n\t\t\t\t\t\tactions.push(new Action(\n\t\t\t\t\t\t\t'diff.clipboard.copyDeletedLineContent',\n\t\t\t\t\t\t\tisDeletion\n\t\t\t\t\t\t\t\t? localize('diff.clipboard.copyDeletedLineContent.label', \"Copy deleted line ({0})\",\n\t\t\t\t\t\t\t\t\t_diff.original.startLineNumber + currentLineNumberOffset)\n\t\t\t\t\t\t\t\t: localize('diff.clipboard.copyChangedLineContent.label', \"Copy changed line ({0})\",\n\t\t\t\t\t\t\t\t\t_diff.original.startLineNumber + currentLineNumberOffset),\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tasync () => {\n\t\t\t\t\t\t\t\tlet lineContent = this._originalTextModel.getLineContent(_diff.original.startLineNumber + currentLineNumberOffset);\n\t\t\t\t\t\t\t\tif (lineContent === '') {\n\t\t\t\t\t\t\t\t\t// empty line -> new line\n\t\t\t\t\t\t\t\t\tconst eof = this._originalTextModel.getEndOfLineSequence();\n\t\t\t\t\t\t\t\t\tlineContent = eof === EndOfLineSequence.LF ? '\\n' : '\\r\\n';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tawait this._clipboardService.writeText(lineContent);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t\tconst readOnly = _modifiedEditor.getOption(EditorOption.readOnly);\n\t\t\t\t\tif (!readOnly) {\n\t\t\t\t\t\tactions.push(new Action(\n\t\t\t\t\t\t\t'diff.inline.revertChange',\n\t\t\t\t\t\t\tlocalize('diff.inline.revertChange.label', \"Revert this change\"),\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tasync () => {\n\t\t\t\t\t\t\t\tthis._editor.revert(this._diff);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn actions;\n\t\t\t\t},\n\t\t\t\tautoSelectItem: true\n\t\t\t});\n\t\t};\n\n\t\tthis._register(addStandardDisposableListener(this._diffActions, 'mousedown', e => {\n\t\t\tif (!e.leftButton) { return; }\n\n\t\t\tconst { top, height } = getDomNodePagePosition(this._diffActions);\n\t\t\tconst pad = Math.floor(lineHeight / 3);\n\t\t\te.preventDefault();\n\t\t\tshowContextMenu({ x: e.posx, y: top + height + pad });\n\t\t}));\n\n\t\tthis._register(_modifiedEditor.onMouseMove((e: IEditorMouseEvent) => {\n\t\t\tif ((e.target.type === MouseTargetType.CONTENT_VIEW_ZONE || e.target.type === MouseTargetType.GUTTER_VIEW_ZONE) && e.target.detail.viewZoneId === this._getViewZoneId()) {\n\t\t\t\tcurrentLineNumberOffset = this._updateLightBulbPosition(this._marginDomNode, e.event.browserEvent.y, lineHeight);\n\t\t\t\tthis.visibility = true;\n\t\t\t} else {\n\t\t\t\tthis.visibility = false;\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(enableCopySelection({\n\t\t\tdomNode: this._deletedCodeDomNode,\n\t\t\tdiffEntry: _diff,\n\t\t\toriginalModel: this._originalTextModel,\n\t\t\trenderLinesResult: this._renderLinesResult,\n\t\t\tclipboardService: _clipboardService,\n\t\t}));\n\t}\n\n\tprivate _updateLightBulbPosition(marginDomNode: HTMLElement, y: number, lineHeight: number): number {\n\t\tconst { top } = getDomNodePagePosition(marginDomNode);\n\t\tconst offset = y - top;\n\t\tconst lineNumberOffset = Math.floor(offset / lineHeight);\n\t\tconst newTop = lineNumberOffset * lineHeight;\n\t\tthis._diffActions.style.top = `${newTop}px`;\n\t\tif (this._renderLinesResult.viewLineCounts) {\n\t\t\tlet acc = 0;\n\t\t\tfor (let i = 0; i < this._renderLinesResult.viewLineCounts.length; i++) {\n\t\t\t\tacc += this._renderLinesResult.viewLineCounts[i];\n\t\t\t\tif (lineNumberOffset < acc) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn lineNumberOffset;\n\t}\n}\n"]}
@@ -64,8 +64,8 @@ export class RenderOptions {
64
64
  static fromEditor(editor) {
65
65
  const modifiedEditorOptions = editor.getOptions();
66
66
  const fontInfo = modifiedEditorOptions.get(59 /* EditorOption.fontInfo */);
67
- const layoutInfo = modifiedEditorOptions.get(166 /* EditorOption.layoutInfo */);
68
- return new RenderOptions(editor.getModel()?.getOptions().tabSize || 0, fontInfo, modifiedEditorOptions.get(40 /* EditorOption.disableMonospaceOptimizations */), fontInfo.typicalHalfwidthCharacterWidth, modifiedEditorOptions.get(118 /* EditorOption.scrollBeyondLastColumn */), modifiedEditorOptions.get(75 /* EditorOption.lineHeight */), layoutInfo.decorationsWidth, modifiedEditorOptions.get(133 /* EditorOption.stopRenderingLineAfter */), modifiedEditorOptions.get(113 /* EditorOption.renderWhitespace */), modifiedEditorOptions.get(108 /* EditorOption.renderControlCharacters */), modifiedEditorOptions.get(60 /* EditorOption.fontLigatures */), modifiedEditorOptions.get(117 /* EditorOption.scrollbar */).verticalScrollbarSize, modifiedEditorOptions.get(176 /* EditorOption.effectiveFullwidthCharacterWidth */) === 'twoCells');
67
+ const layoutInfo = modifiedEditorOptions.get(169 /* EditorOption.layoutInfo */);
68
+ return new RenderOptions(editor.getModel()?.getOptions().tabSize || 0, fontInfo, modifiedEditorOptions.get(40 /* EditorOption.disableMonospaceOptimizations */), fontInfo.typicalHalfwidthCharacterWidth, modifiedEditorOptions.get(120 /* EditorOption.scrollBeyondLastColumn */), modifiedEditorOptions.get(75 /* EditorOption.lineHeight */), layoutInfo.decorationsWidth, modifiedEditorOptions.get(136 /* EditorOption.stopRenderingLineAfter */), modifiedEditorOptions.get(115 /* EditorOption.renderWhitespace */), modifiedEditorOptions.get(110 /* EditorOption.renderControlCharacters */), modifiedEditorOptions.get(60 /* EditorOption.fontLigatures */), modifiedEditorOptions.get(119 /* EditorOption.scrollbar */).verticalScrollbarSize, modifiedEditorOptions.get(179 /* EditorOption.effectiveFullwidthCharacterWidth */) === 'twoCells');
69
69
  }
70
70
  constructor(tabSize, fontInfo, disableMonospaceOptimizations, typicalHalfwidthCharacterWidth, scrollBeyondLastColumn, lineHeight, lineDecorationsWidth, stopRenderingLineAfter, renderWhitespace, renderControlCharacters, fontLigatures, verticalScrollbarSize, useTwoCellFullwidthCharacters = false, setWidth = true) {
71
71
  this.tabSize = tabSize;
@@ -16,7 +16,7 @@ registerAction2(ToggleUseInlineViewWhenSpaceIsLimited);
16
16
  MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
17
17
  command: {
18
18
  id: new ToggleShowMovedCodeBlocks().desc.id,
19
- title: localize(135, "Show Moved Code Blocks"),
19
+ title: localize(136, "Show Moved Code Blocks"),
20
20
  icon: Codicon.move,
21
21
  toggled: ContextKeyEqualsExpr.create('config.diffEditor.experimental.showMoves', true),
22
22
  precondition: ContextKeyExpr.has('isInDiffEditor'),
@@ -33,7 +33,7 @@ for (const ctx of [
33
33
  MenuRegistry.appendMenuItem(MenuId.DiffEditorHunkToolbar, {
34
34
  command: {
35
35
  id: new RevertHunkOrSelection().desc.id,
36
- title: localize(136, "Revert Block"),
36
+ title: localize(137, "Revert Block"),
37
37
  icon: ctx.icon,
38
38
  },
39
39
  when: ContextKeyExpr.and(EditorContextKeys.diffEditorModifiedWritable, ctx.key),
@@ -43,7 +43,7 @@ for (const ctx of [
43
43
  MenuRegistry.appendMenuItem(MenuId.DiffEditorSelectionToolbar, {
44
44
  command: {
45
45
  id: new RevertHunkOrSelection().desc.id,
46
- title: localize(137, "Revert Selection"),
46
+ title: localize(138, "Revert Selection"),
47
47
  icon: ctx.icon,
48
48
  },
49
49
  when: ContextKeyExpr.and(EditorContextKeys.diffEditorModifiedWritable, ctx.key),
@@ -58,7 +58,7 @@ registerAction2(ShowAllUnchangedRegions);
58
58
  MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
59
59
  command: {
60
60
  id: AccessibleDiffViewerNext.id,
61
- title: localize(138, "Open Accessible Diff Viewer"),
61
+ title: localize(139, "Open Accessible Diff Viewer"),
62
62
  precondition: ContextKeyExpr.has('isInDiffEditor'),
63
63
  },
64
64
  order: 10,
@@ -20,6 +20,7 @@ import { LineRange } from '../../../common/core/ranges/lineRange.js';
20
20
  import { DetailedLineRangeMapping, RangeMapping } from '../../../common/diff/rangeMapping.js';
21
21
  import { IEditorWorkerService } from '../../../common/services/editorWorker.js';
22
22
  import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';
23
+ import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';
23
24
  export const IDiffProviderFactoryService = createDecorator('diffProviderFactoryService');
24
25
  let WorkerBasedDiffProviderFactoryService = class WorkerBasedDiffProviderFactoryService {
25
26
  constructor(instantiationService) {
@@ -37,9 +38,11 @@ registerSingleton(IDiffProviderFactoryService, WorkerBasedDiffProviderFactorySer
37
38
  let WorkerBasedDocumentDiffProvider = class WorkerBasedDocumentDiffProvider {
38
39
  static { WorkerBasedDocumentDiffProvider_1 = this; }
39
40
  static { this.diffCache = new Map(); }
40
- constructor(options, editorWorkerService, telemetryService) {
41
+ static { this.maxVerifiedLineCount = 50_000; }
42
+ constructor(options, editorWorkerService, telemetryService, configurationService) {
41
43
  this.editorWorkerService = editorWorkerService;
42
44
  this.telemetryService = telemetryService;
45
+ this.configurationService = configurationService;
43
46
  this.onDidChangeEventEmitter = new Emitter();
44
47
  this.onDidChange = this.onDidChangeEventEmitter.event;
45
48
  this.diffAlgorithm = 'advanced';
@@ -91,12 +94,16 @@ let WorkerBasedDocumentDiffProvider = class WorkerBasedDocumentDiffProvider {
91
94
  return c.result;
92
95
  }
93
96
  const sw = StopWatch.create();
94
- const result = await this.editorWorkerService.computeDiff(original.uri, modified.uri, options, this.diffAlgorithm);
97
+ const verify = this._shouldVerify(original, modified);
98
+ const result = await this.editorWorkerService.computeDiff(original.uri, modified.uri, options, this.diffAlgorithm, verify);
95
99
  const timeMs = sw.elapsed();
96
100
  this.telemetryService.publicLog2('diffEditor.computeDiff', {
97
101
  timeMs,
98
102
  timedOut: result?.quitEarly ?? true,
99
103
  detectedMoves: options.computeMoves ? (result?.moves.length ?? 0) : -1,
104
+ diffAlgorithm: this.diffAlgorithm,
105
+ ignoreTrimWhitespace: options.ignoreTrimWhitespace,
106
+ validity: result?.validity ?? 'notChecked',
100
107
  });
101
108
  if (cancellationToken.isCancellationRequested) {
102
109
  // Text models might be disposed!
@@ -117,6 +124,16 @@ let WorkerBasedDocumentDiffProvider = class WorkerBasedDocumentDiffProvider {
117
124
  WorkerBasedDocumentDiffProvider_1.diffCache.set(uriKey, { result, context });
118
125
  return result;
119
126
  }
127
+ /**
128
+ * Verifying a diff is linear in the document size, so it is only done for a sample of diffs,
129
+ * controlled by an experiment, and never for very large documents.
130
+ */
131
+ _shouldVerify(original, modified) {
132
+ const sampleRate = this.configurationService.getValue('diffEditor.experimental.verifyDiffSampleRate') ?? 0;
133
+ return Math.random() < sampleRate
134
+ && original.getLineCount() <= WorkerBasedDocumentDiffProvider_1.maxVerifiedLineCount
135
+ && modified.getLineCount() <= WorkerBasedDocumentDiffProvider_1.maxVerifiedLineCount;
136
+ }
120
137
  setOptions(newOptions) {
121
138
  let didChange = false;
122
139
  if (newOptions.diffAlgorithm) {
@@ -137,7 +154,8 @@ let WorkerBasedDocumentDiffProvider = class WorkerBasedDocumentDiffProvider {
137
154
  };
138
155
  WorkerBasedDocumentDiffProvider = WorkerBasedDocumentDiffProvider_1 = __decorate([
139
156
  __param(1, IEditorWorkerService),
140
- __param(2, ITelemetryService)
157
+ __param(2, ITelemetryService),
158
+ __param(3, IConfigurationService)
141
159
  ], WorkerBasedDocumentDiffProvider);
142
160
  export { WorkerBasedDocumentDiffProvider };
143
161
  //# sourceMappingURL=diffProviderFactoryService.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.ts","vs/editor/browser/widget/diffEditor/diffProviderFactoryService.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAqB,iBAAiB,EAAE,MAAM,yDAAyD,CAAC;AAC/G,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,4DAA4D,CAAC;AAEpH,OAAO,EAAE,OAAO,EAAS,MAAM,kCAAkC,CAAC;AAElE,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAErE,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAE9F,OAAO,EAAqB,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AACnG,OAAO,E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ies/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 { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';\nimport { IInstantiationService, createDecorator } from '../../../../platform/instantiation/common/instantiation.js';\nimport { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { Emitter, Event } from '../../../../base/common/event.js';\nimport { IDisposable } from '../../../../base/common/lifecycle.js';\nimport { StopWatch } from '../../../../base/common/stopwatch.js';\nimport { LineRange } from '../../../common/core/ranges/lineRange.js';\nimport { IDocumentDiff, IDocumentDiffProvider, IDocumentDiffProviderOptions } from '../../../common/diff/documentDiffProvider.js';\nimport { DetailedLineRangeMapping, RangeMapping } from '../../../common/diff/rangeMapping.js';\nimport { ITextModel } from '../../../common/model.js';\nimport { DiffAlgorithmName, IEditorWorkerService } from '../../../common/services/editorWorker.js';\nimport { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';\n\nexport const IDiffProviderFactoryService = createDecorator<IDiffProviderFactoryService>('diffProviderFactoryService');\n\nexport interface IDocumentDiffFactoryOptions {\n\treadonly diffAlgorithm?: 'legacy' | 'advanced' | 'advanced-external' | 'advanced-wasm';\n}\n\nexport interface IDiffProviderFactoryService {\n\treadonly _serviceBrand: undefined;\n\tcreateDiffProvider(options: IDocumentDiffFactoryOptions): IDocumentDiffProvider;\n}\n\nexport class WorkerBasedDiffProviderFactoryService implements IDiffProviderFactoryService {\n\treadonly _serviceBrand: undefined;\n\n\tconstructor(\n\t\t@IInstantiationService private readonly instantiationService: IInstantiationService,\n\t) { }\n\n\tcreateDiffProvider(options: IDocumentDiffFactoryOptions): IDocumentDiffProvider {\n\t\treturn this.instantiationService.createInstance(WorkerBasedDocumentDiffProvider, options);\n\t}\n}\n\nregisterSingleton(IDiffProviderFactoryService, WorkerBasedDiffProviderFactoryService, InstantiationType.Delayed);\n\nexport class WorkerBasedDocumentDiffProvider implements IDocumentDiffProvider, IDisposable {\n\tprivate onDidChangeEventEmitter = new Emitter<void>();\n\tpublic readonly onDidChange: Event<void> = this.onDidChangeEventEmitter.event;\n\n\tprivate diffAlgorithm: DiffAlgorithmName | IDocumentDiffProvider = 'advanced';\n\tprivate diffAlgorithmOnDidChangeSubscription: IDisposable | undefined = undefined;\n\n\tprivate static readonly diffCache = new Map<string, { result: IDocumentDiff; context: string }>();\n\n\tconstructor(\n\t\toptions: IWorkerBasedDocumentDiffProviderOptions,\n\t\t@IEditorWorkerService private readonly editorWorkerService: IEditorWorkerService,\n\t\t@ITelemetryService private readonly telemetryService: ITelemetryService,\n\t) {\n\t\tthis.setOptions(options);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.diffAlgorithmOnDidChangeSubscription?.dispose();\n\t\tthis.onDidChangeEventEmitter.dispose();\n\t}\n\n\tasync computeDiff(original: ITextModel, modified: ITextModel, options: IDocumentDiffProviderOptions, cancellationToken: CancellationToken): Promise<IDocumentDiff> {\n\t\tif (typeof this.diffAlgorithm !== 'string') {\n\t\t\treturn this.diffAlgorithm.computeDiff(original, modified, options, cancellationToken);\n\t\t}\n\n\t\tif (original.isDisposed() || modified.isDisposed()) {\n\t\t\t// TODO@hediet\n\t\t\treturn {\n\t\t\t\tchanges: [],\n\t\t\t\tidentical: true,\n\t\t\t\tquitEarly: false,\n\t\t\t\tmoves: [],\n\t\t\t};\n\t\t}\n\n\t\t// This significantly speeds up the case when the original file is empty\n\t\tif (original.getLineCount() === 1 && original.getLineMaxColumn(1) === 1) {\n\t\t\tif (modified.getLineCount() === 1 && modified.getLineMaxColumn(1) === 1) {\n\t\t\t\treturn {\n\t\t\t\t\tchanges: [],\n\t\t\t\t\tidentical: true,\n\t\t\t\t\tquitEarly: false,\n\t\t\t\t\tmoves: [],\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tchanges: [\n\t\t\t\t\tnew DetailedLineRangeMapping(\n\t\t\t\t\t\tnew LineRange(1, 2),\n\t\t\t\t\t\tnew LineRange(1, modified.getLineCount() + 1),\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tnew RangeMapping(\n\t\t\t\t\t\t\t\toriginal.getFullModelRange(),\n\t\t\t\t\t\t\t\tmodified.getFullModelRange(),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t]\n\t\t\t\t\t)\n\t\t\t\t],\n\t\t\t\tidentical: false,\n\t\t\t\tquitEarly: false,\n\t\t\t\tmoves: [],\n\t\t\t};\n\t\t}\n\n\t\tconst uriKey = JSON.stringify([original.uri.toString(), modified.uri.toString()]);\n\t\tconst context = JSON.stringify([original.id, modified.id, original.getAlternativeVersionId(), modified.getAlternativeVersionId(), JSON.stringify(options)]);\n\t\tconst c = WorkerBasedDocumentDiffProvider.diffCache.get(uriKey);\n\t\tif (c && c.context === context) {\n\t\t\treturn c.result;\n\t\t}\n\n\t\tconst sw = StopWatch.create();\n\t\tconst result = await this.editorWorkerService.computeDiff(original.uri, modified.uri, options, this.diffAlgorithm);\n\t\tconst timeMs = sw.elapsed();\n\n\t\tthis.telemetryService.publicLog2<{\n\t\t\ttimeMs: number;\n\t\t\ttimedOut: boolean;\n\t\t\tdetectedMoves: number;\n\t\t}, {\n\t\t\towner: 'hediet';\n\n\t\t\ttimeMs: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand if the new diff algorithm is slower/faster than the old one' };\n\t\t\ttimedOut: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how often the new diff algorithm times out' };\n\t\t\tdetectedMoves: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how often the new diff algorithm detects moves' };\n\n\t\t\tcomment: 'This event gives insight about the performance of the new diff algorithm.';\n\t\t}>('diffEditor.computeDiff', {\n\t\t\ttimeMs,\n\t\t\ttimedOut: result?.quitEarly ?? true,\n\t\t\tdetectedMoves: options.computeMoves ? (result?.moves.length ?? 0) : -1,\n\t\t});\n\n\t\tif (cancellationToken.isCancellationRequested) {\n\t\t\t// Text models might be disposed!\n\t\t\treturn {\n\t\t\t\tchanges: [],\n\t\t\t\tidentical: false,\n\t\t\t\tquitEarly: true,\n\t\t\t\tmoves: [],\n\t\t\t};\n\t\t}\n\n\t\tif (!result) {\n\t\t\tthrow new Error('no diff result available');\n\t\t}\n\n\t\t// max 10 items in cache\n\t\tif (WorkerBasedDocumentDiffProvider.diffCache.size > 10) {\n\t\t\tWorkerBasedDocumentDiffProvider.diffCache.delete(WorkerBasedDocumentDiffProvider.diffCache.keys().next().value!);\n\t\t}\n\n\t\tWorkerBasedDocumentDiffProvider.diffCache.set(uriKey, { result, context });\n\t\treturn result;\n\t}\n\n\tpublic setOptions(newOptions: IWorkerBasedDocumentDiffProviderOptions): void {\n\t\tlet didChange = false;\n\t\tif (newOptions.diffAlgorithm) {\n\t\t\tif (this.diffAlgorithm !== newOptions.diffAlgorithm) {\n\t\t\t\tthis.diffAlgorithmOnDidChangeSubscription?.dispose();\n\t\t\t\tthis.diffAlgorithmOnDidChangeSubscription = undefined;\n\n\t\t\t\tthis.diffAlgorithm = newOptions.diffAlgorithm;\n\t\t\t\tif (typeof newOptions.diffAlgorithm !== 'string') {\n\t\t\t\t\tthis.diffAlgorithmOnDidChangeSubscription = newOptions.diffAlgorithm.onDidChange(() => this.onDidChangeEventEmitter.fire());\n\t\t\t\t}\n\t\t\t\tdidChange = true;\n\t\t\t}\n\t\t}\n\t\tif (didChange) {\n\t\t\tthis.onDidChangeEventEmitter.fire();\n\t\t}\n\t}\n}\n\ninterface IWorkerBasedDocumentDiffProviderOptions {\n\treadonly diffAlgorithm?: 'legacy' | 'advanced' | 'advanced-external' | 'advanced-wasm' | IDocumentDiffProvider;\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 { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';\nimport { IInstantiationService, createDecorator } from '../../../../platform/instantiation/common/instantiation.js';\nimport { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { Emitter, Event } from '../../../../base/common/event.js';\nimport { IDisposable } from '../../../../base/common/lifecycle.js';\nimport { StopWatch } from '../../../../base/common/stopwatch.js';\nimport { LineRange } from '../../../common/core/ranges/lineRange.js';\nimport { IDocumentDiff, IDocumentDiffProvider, IDocumentDiffProviderOptions } from '../../../common/diff/documentDiffProvider.js';\nimport { DetailedLineRangeMapping, RangeMapping } from '../../../common/diff/rangeMapping.js';\nimport { ITextModel } from '../../../common/model.js';\nimport { DiffAlgorithmName, IEditorWorkerService } from '../../../common/services/editorWorker.js';\nimport { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';\n\nexport const IDiffProviderFactoryService = createDecorator<IDiffProviderFactoryService>('diffProviderFactoryService');\n\nexport interface IDocumentDiffFactoryOptions {\n\treadonly diffAlgorithm?: 'legacy' | 'advanced' | 'advanced-external' | 'advanced-wasm';\n}\n\nexport interface IDiffProviderFactoryService {\n\treadonly _serviceBrand: undefined;\n\tcreateDiffProvider(options: IDocumentDiffFactoryOptions): IDocumentDiffProvider;\n}\n\nexport class WorkerBasedDiffProviderFactoryService implements IDiffProviderFactoryService {\n\treadonly _serviceBrand: undefined;\n\n\tconstructor(\n\t\t@IInstantiationService private readonly instantiationService: IInstantiationService,\n\t) { }\n\n\tcreateDiffProvider(options: IDocumentDiffFactoryOptions): IDocumentDiffProvider {\n\t\treturn this.instantiationService.createInstance(WorkerBasedDocumentDiffProvider, options);\n\t}\n}\n\nregisterSingleton(IDiffProviderFactoryService, WorkerBasedDiffProviderFactoryService, InstantiationType.Delayed);\n\nexport class WorkerBasedDocumentDiffProvider implements IDocumentDiffProvider, IDisposable {\n\tprivate onDidChangeEventEmitter = new Emitter<void>();\n\tpublic readonly onDidChange: Event<void> = this.onDidChangeEventEmitter.event;\n\n\tprivate diffAlgorithm: DiffAlgorithmName | IDocumentDiffProvider = 'advanced';\n\tprivate diffAlgorithmOnDidChangeSubscription: IDisposable | undefined = undefined;\n\n\tprivate static readonly diffCache = new Map<string, { result: IDocumentDiff; context: string }>();\n\n\tconstructor(\n\t\toptions: IWorkerBasedDocumentDiffProviderOptions,\n\t\t@IEditorWorkerService private readonly editorWorkerService: IEditorWorkerService,\n\t\t@ITelemetryService private readonly telemetryService: ITelemetryService,\n\t) {\n\t\tthis.setOptions(options);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.diffAlgorithmOnDidChangeSubscription?.dispose();\n\t\tthis.onDidChangeEventEmitter.dispose();\n\t}\n\n\tasync computeDiff(original: ITextModel, modified: ITextModel, options: IDocumentDiffProviderOptions, cancellationToken: CancellationToken): Promise<IDocumentDiff> {\n\t\tif (typeof this.diffAlgorithm !== 'string') {\n\t\t\treturn this.diffAlgorithm.computeDiff(original, modified, options, cancellationToken);\n\t\t}\n\n\t\tif (original.isDisposed() || modified.isDisposed()) {\n\t\t\t// TODO@hediet\n\t\t\treturn {\n\t\t\t\tchanges: [],\n\t\t\t\tidentical: true,\n\t\t\t\tquitEarly: false,\n\t\t\t\tmoves: [],\n\t\t\t};\n\t\t}\n\n\t\t// This significantly speeds up the case when the original file is empty\n\t\tif (original.getLineCount() === 1 && original.getLineMaxColumn(1) === 1) {\n\t\t\tif (modified.getLineCount() === 1 && modified.getLineMaxColumn(1) === 1) {\n\t\t\t\treturn {\n\t\t\t\t\tchanges: [],\n\t\t\t\t\tidentical: true,\n\t\t\t\t\tquitEarly: false,\n\t\t\t\t\tmoves: [],\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tchanges: [\n\t\t\t\t\tnew DetailedLineRangeMapping(\n\t\t\t\t\t\tnew LineRange(1, 2),\n\t\t\t\t\t\tnew LineRange(1, modified.getLineCount() + 1),\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tnew RangeMapping(\n\t\t\t\t\t\t\t\toriginal.getFullModelRange(),\n\t\t\t\t\t\t\t\tmodified.getFullModelRange(),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t]\n\t\t\t\t\t)\n\t\t\t\t],\n\t\t\t\tidentical: false,\n\t\t\t\tquitEarly: false,\n\t\t\t\tmoves: [],\n\t\t\t};\n\t\t}\n\n\t\tconst uriKey = JSON.stringify([original.uri.toString(), modified.uri.toString()]);\n\t\tconst context = JSON.stringify([original.id, modified.id, original.getAlternativeVersionId(), modified.getAlternativeVersionId(), JSON.stringify(options)]);\n\t\tconst c = WorkerBasedDocumentDiffProvider.diffCache.get(uriKey);\n\t\tif (c && c.context === context) {\n\t\t\treturn c.result;\n\t\t}\n\n\t\tconst sw = StopWatch.create();\n\t\tconst result = await this.editorWorkerService.computeDiff(original.uri, modified.uri, options, this.diffAlgorithm);\n\t\tconst timeMs = sw.elapsed();\n\n\t\tthis.telemetryService.publicLog2<{\n\t\t\ttimeMs: number;\n\t\t\ttimedOut: boolean;\n\t\t\tdetectedMoves: number;\n\t\t}, {\n\t\t\towner: 'hediet';\n\n\t\t\ttimeMs: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand if the new diff algorithm is slower/faster than the old one' };\n\t\t\ttimedOut: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how often the new diff algorithm times out' };\n\t\t\tdetectedMoves: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how often the new diff algorithm detects moves' };\n\n\t\t\tcomment: 'This event gives insight about the performance of the new diff algorithm.';\n\t\t}>('diffEditor.computeDiff', {\n\t\t\ttimeMs,\n\t\t\ttimedOut: result?.quitEarly ?? true,\n\t\t\tdetectedMoves: options.computeMoves ? (result?.moves.length ?? 0) : -1,\n\t\t});\n\n\t\tif (cancellationToken.isCancellationRequested) {\n\t\t\t// Text models might be disposed!\n\t\t\treturn {\n\t\t\t\tchanges: [],\n\t\t\t\tidentical: false,\n\t\t\t\tquitEarly: true,\n\t\t\t\tmoves: [],\n\t\t\t};\n\t\t}\n\n\t\tif (!result) {\n\t\t\tthrow new Error('no diff result available');\n\t\t}\n\n\t\t// max 10 items in cache\n\t\tif (WorkerBasedDocumentDiffProvider.diffCache.size > 10) {\n\t\t\tWorkerBasedDocumentDiffProvider.diffCache.delete(WorkerBasedDocumentDiffProvider.diffCache.keys().next().value!);\n\t\t}\n\n\t\tWorkerBasedDocumentDiffProvider.diffCache.set(uriKey, { result, context });\n\t\treturn result;\n\t}\n\n\tpublic setOptions(newOptions: IWorkerBasedDocumentDiffProviderOptions): void {\n\t\tlet didChange = false;\n\t\tif (newOptions.diffAlgorithm) {\n\t\t\tif (this.diffAlgorithm !== newOptions.diffAlgorithm) {\n\t\t\t\tthis.diffAlgorithmOnDidChangeSubscription?.dispose();\n\t\t\t\tthis.diffAlgorithmOnDidChangeSubscription = undefined;\n\n\t\t\t\tthis.diffAlgorithm = newOptions.diffAlgorithm;\n\t\t\t\tif (typeof newOptions.diffAlgorithm !== 'string') {\n\t\t\t\t\tthis.diffAlgorithmOnDidChangeSubscription = newOptions.diffAlgorithm.onDidChange(() => this.onDidChangeEventEmitter.fire());\n\t\t\t\t}\n\t\t\t\tdidChange = true;\n\t\t\t}\n\t\t}\n\t\tif (didChange) {\n\t\t\tthis.onDidChangeEventEmitter.fire();\n\t\t}\n\t}\n}\n\ninterface IWorkerBasedDocumentDiffProviderOptions {\n\treadonly diffAlgorithm?: 'legacy' | 'advanced' | 'advanced-external' | 'advanced-wasm' | IDocumentDiffProvider;\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.ts","vs/editor/browser/widget/diffEditor/diffProviderFactoryService.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,EAAqB,iBAAiB,EAAE,MAAM,yDAAyD,CAAC;AAC/G,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,4DAA4D,CAAC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,GAAG,UAAU;eAC7B,QAAQ,CAAC,YAAY,EAAE,IAAI,iCAA+B,CAAC,oBAAoB;eAC/E,QAAQ,CAAC,YAAY,EAAE,IAAI,iCAA+B,CAAC,oBAAoB,CAAC;IACrF,CAAC;IAEM,UAAU,CAAC,UAAmD;QACpE,IAAI,SAAS,GAAG,KAAK,CAAC;QACtB,IAAI,UAAU,CAAC,aAAa,EAAE,CAAC;YAC9B,IAAI,IAAI,CAAC,aAAa,KAAK,UAAU,CAAC,aAAa,EAAE,CAAC;gBACrD,IAAI,CAAC,oCAAoC,EAAE,OAAO,EAAE,CAAC;gBACrD,IAAI,CAAC,oCAAoC,GAAG,SAAS,CAAC;gBAEtD,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC;gBAC9C,IAAI,OAAO,UAAU,CAAC,aAAa,KAAK,QAAQ,EAAE,CAAC;oBAClD,IAAI,CAAC,oCAAoC,GAAG,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,uBAAuB,CAAC,IAAI,EAAE,CAAC,CAAC;gBAC7H,CAAC;gBACD,SAAS,GAAG,IAAI,CAAC;YAClB,CAAC;QACF,CAAC;QACD,IAAI,SAAS,EAAE,CAAC;YACf,IAAI,CAAC,uBAAuB,CAAC,IAAI,EAAE,CAAC;QACrC,CAAC;IACF,CAAC;;AAhKW,+BAA+B;IAazC,WAAA,oBAAoB,CAAA;IACpB,WAAA,iBAAiB,CAAA;IACjB,WAAA,qBAAqB,CAAA;GAfX,+BAA+B,CAiK3C","file":"diffProviderFactoryService.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 { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';\nimport { IInstantiationService, createDecorator } from '../../../../platform/instantiation/common/instantiation.js';\nimport { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { Emitter, Event } from '../../../../base/common/event.js';\nimport { IDisposable } from '../../../../base/common/lifecycle.js';\nimport { StopWatch } from '../../../../base/common/stopwatch.js';\nimport { LineRange } from '../../../common/core/ranges/lineRange.js';\nimport { IDocumentDiff, IDocumentDiffProvider, IDocumentDiffProviderOptions } from '../../../common/diff/documentDiffProvider.js';\nimport { DetailedLineRangeMapping, RangeMapping } from '../../../common/diff/rangeMapping.js';\nimport { ITextModel } from '../../../common/model.js';\nimport { DiffAlgorithmName, IEditorWorkerService } from '../../../common/services/editorWorker.js';\nimport { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\n\nexport const IDiffProviderFactoryService = createDecorator<IDiffProviderFactoryService>('diffProviderFactoryService');\n\nexport interface IDocumentDiffFactoryOptions {\n\treadonly diffAlgorithm?: 'legacy' | 'advanced' | 'advanced-external' | 'advanced-wasm';\n}\n\nexport interface IDiffProviderFactoryService {\n\treadonly _serviceBrand: undefined;\n\tcreateDiffProvider(options: IDocumentDiffFactoryOptions): IDocumentDiffProvider;\n}\n\nexport class WorkerBasedDiffProviderFactoryService implements IDiffProviderFactoryService {\n\treadonly _serviceBrand: undefined;\n\n\tconstructor(\n\t\t@IInstantiationService private readonly instantiationService: IInstantiationService,\n\t) { }\n\n\tcreateDiffProvider(options: IDocumentDiffFactoryOptions): IDocumentDiffProvider {\n\t\treturn this.instantiationService.createInstance(WorkerBasedDocumentDiffProvider, options);\n\t}\n}\n\nregisterSingleton(IDiffProviderFactoryService, WorkerBasedDiffProviderFactoryService, InstantiationType.Delayed);\n\nexport class WorkerBasedDocumentDiffProvider implements IDocumentDiffProvider, IDisposable {\n\tprivate onDidChangeEventEmitter = new Emitter<void>();\n\tpublic readonly onDidChange: Event<void> = this.onDidChangeEventEmitter.event;\n\n\tprivate diffAlgorithm: DiffAlgorithmName | IDocumentDiffProvider = 'advanced';\n\tprivate diffAlgorithmOnDidChangeSubscription: IDisposable | undefined = undefined;\n\n\tprivate static readonly diffCache = new Map<string, { result: IDocumentDiff; context: string }>();\n\n\tprivate static readonly maxVerifiedLineCount = 50_000;\n\n\tconstructor(\n\t\toptions: IWorkerBasedDocumentDiffProviderOptions,\n\t\t@IEditorWorkerService private readonly editorWorkerService: IEditorWorkerService,\n\t\t@ITelemetryService private readonly telemetryService: ITelemetryService,\n\t\t@IConfigurationService private readonly configurationService: IConfigurationService,\n\t) {\n\t\tthis.setOptions(options);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.diffAlgorithmOnDidChangeSubscription?.dispose();\n\t\tthis.onDidChangeEventEmitter.dispose();\n\t}\n\n\tasync computeDiff(original: ITextModel, modified: ITextModel, options: IDocumentDiffProviderOptions, cancellationToken: CancellationToken): Promise<IDocumentDiff> {\n\t\tif (typeof this.diffAlgorithm !== 'string') {\n\t\t\treturn this.diffAlgorithm.computeDiff(original, modified, options, cancellationToken);\n\t\t}\n\n\t\tif (original.isDisposed() || modified.isDisposed()) {\n\t\t\t// TODO@hediet\n\t\t\treturn {\n\t\t\t\tchanges: [],\n\t\t\t\tidentical: true,\n\t\t\t\tquitEarly: false,\n\t\t\t\tmoves: [],\n\t\t\t};\n\t\t}\n\n\t\t// This significantly speeds up the case when the original file is empty\n\t\tif (original.getLineCount() === 1 && original.getLineMaxColumn(1) === 1) {\n\t\t\tif (modified.getLineCount() === 1 && modified.getLineMaxColumn(1) === 1) {\n\t\t\t\treturn {\n\t\t\t\t\tchanges: [],\n\t\t\t\t\tidentical: true,\n\t\t\t\t\tquitEarly: false,\n\t\t\t\t\tmoves: [],\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tchanges: [\n\t\t\t\t\tnew DetailedLineRangeMapping(\n\t\t\t\t\t\tnew LineRange(1, 2),\n\t\t\t\t\t\tnew LineRange(1, modified.getLineCount() + 1),\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tnew RangeMapping(\n\t\t\t\t\t\t\t\toriginal.getFullModelRange(),\n\t\t\t\t\t\t\t\tmodified.getFullModelRange(),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t]\n\t\t\t\t\t)\n\t\t\t\t],\n\t\t\t\tidentical: false,\n\t\t\t\tquitEarly: false,\n\t\t\t\tmoves: [],\n\t\t\t};\n\t\t}\n\n\t\tconst uriKey = JSON.stringify([original.uri.toString(), modified.uri.toString()]);\n\t\tconst context = JSON.stringify([original.id, modified.id, original.getAlternativeVersionId(), modified.getAlternativeVersionId(), JSON.stringify(options)]);\n\t\tconst c = WorkerBasedDocumentDiffProvider.diffCache.get(uriKey);\n\t\tif (c && c.context === context) {\n\t\t\treturn c.result;\n\t\t}\n\n\t\tconst sw = StopWatch.create();\n\t\tconst verify = this._shouldVerify(original, modified);\n\t\tconst result = await this.editorWorkerService.computeDiff(original.uri, modified.uri, options, this.diffAlgorithm, verify);\n\t\tconst timeMs = sw.elapsed();\n\n\t\tthis.telemetryService.publicLog2<{\n\t\t\ttimeMs: number;\n\t\t\ttimedOut: boolean;\n\t\t\tdetectedMoves: number;\n\t\t\tdiffAlgorithm: string;\n\t\t\tignoreTrimWhitespace: boolean;\n\t\t\tvalidity: string;\n\t\t}, {\n\t\t\towner: 'hediet';\n\n\t\t\ttimeMs: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand if the new diff algorithm is slower/faster than the old one' };\n\t\t\ttimedOut: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how often the new diff algorithm times out' };\n\t\t\tdetectedMoves: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how often the new diff algorithm detects moves' };\n\t\t\tdiffAlgorithm: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The diff algorithm that computed the diff, to compare algorithms.' };\n\t\t\tignoreTrimWhitespace: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'Whether leading/trailing whitespace changes were ignored.' };\n\t\t\tvalidity: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'Whether the diff reproduces the modified text (valid, invalid, unverified, or notChecked if not sampled), to measure how often an algorithm produces incorrect diffs. Includes verification time in timeMs when checked.' };\n\n\t\t\tcomment: 'This event gives insight about the performance of the new diff algorithm.';\n\t\t}>('diffEditor.computeDiff', {\n\t\t\ttimeMs,\n\t\t\ttimedOut: result?.quitEarly ?? true,\n\t\t\tdetectedMoves: options.computeMoves ? (result?.moves.length ?? 0) : -1,\n\t\t\tdiffAlgorithm: this.diffAlgorithm,\n\t\t\tignoreTrimWhitespace: options.ignoreTrimWhitespace,\n\t\t\tvalidity: result?.validity ?? 'notChecked',\n\t\t});\n\n\t\tif (cancellationToken.isCancellationRequested) {\n\t\t\t// Text models might be disposed!\n\t\t\treturn {\n\t\t\t\tchanges: [],\n\t\t\t\tidentical: false,\n\t\t\t\tquitEarly: true,\n\t\t\t\tmoves: [],\n\t\t\t};\n\t\t}\n\n\t\tif (!result) {\n\t\t\tthrow new Error('no diff result available');\n\t\t}\n\n\t\t// max 10 items in cache\n\t\tif (WorkerBasedDocumentDiffProvider.diffCache.size > 10) {\n\t\t\tWorkerBasedDocumentDiffProvider.diffCache.delete(WorkerBasedDocumentDiffProvider.diffCache.keys().next().value!);\n\t\t}\n\n\t\tWorkerBasedDocumentDiffProvider.diffCache.set(uriKey, { result, context });\n\t\treturn result;\n\t}\n\n\t/**\n\t * Verifying a diff is linear in the document size, so it is only done for a sample of diffs,\n\t * controlled by an experiment, and never for very large documents.\n\t */\n\tprivate _shouldVerify(original: ITextModel, modified: ITextModel): boolean {\n\t\tconst sampleRate = this.configurationService.getValue<number>('diffEditor.experimental.verifyDiffSampleRate') ?? 0;\n\t\treturn Math.random() < sampleRate\n\t\t\t&& original.getLineCount() <= WorkerBasedDocumentDiffProvider.maxVerifiedLineCount\n\t\t\t&& modified.getLineCount() <= WorkerBasedDocumentDiffProvider.maxVerifiedLineCount;\n\t}\n\n\tpublic setOptions(newOptions: IWorkerBasedDocumentDiffProviderOptions): void {\n\t\tlet didChange = false;\n\t\tif (newOptions.diffAlgorithm) {\n\t\t\tif (this.diffAlgorithm !== newOptions.diffAlgorithm) {\n\t\t\t\tthis.diffAlgorithmOnDidChangeSubscription?.dispose();\n\t\t\t\tthis.diffAlgorithmOnDidChangeSubscription = undefined;\n\n\t\t\t\tthis.diffAlgorithm = newOptions.diffAlgorithm;\n\t\t\t\tif (typeof newOptions.diffAlgorithm !== 'string') {\n\t\t\t\t\tthis.diffAlgorithmOnDidChangeSubscription = newOptions.diffAlgorithm.onDidChange(() => this.onDidChangeEventEmitter.fire());\n\t\t\t\t}\n\t\t\t\tdidChange = true;\n\t\t\t}\n\t\t}\n\t\tif (didChange) {\n\t\t\tthis.onDidChangeEventEmitter.fire();\n\t\t}\n\t}\n}\n\ninterface IWorkerBasedDocumentDiffProviderOptions {\n\treadonly diffAlgorithm?: 'legacy' | 'advanced' | 'advanced-external' | 'advanced-wasm' | IDocumentDiffProvider;\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 { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';\nimport { IInstantiationService, createDecorator } from '../../../../platform/instantiation/common/instantiation.js';\nimport { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { Emitter, Event } from '../../../../base/common/event.js';\nimport { IDisposable } from '../../../../base/common/lifecycle.js';\nimport { StopWatch } from '../../../../base/common/stopwatch.js';\nimport { LineRange } from '../../../common/core/ranges/lineRange.js';\nimport { IDocumentDiff, IDocumentDiffProvider, IDocumentDiffProviderOptions } from '../../../common/diff/documentDiffProvider.js';\nimport { DetailedLineRangeMapping, RangeMapping } from '../../../common/diff/rangeMapping.js';\nimport { ITextModel } from '../../../common/model.js';\nimport { DiffAlgorithmName, IEditorWorkerService } from '../../../common/services/editorWorker.js';\nimport { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\n\nexport const IDiffProviderFactoryService = createDecorator<IDiffProviderFactoryService>('diffProviderFactoryService');\n\nexport interface IDocumentDiffFactoryOptions {\n\treadonly diffAlgorithm?: 'legacy' | 'advanced' | 'advanced-external' | 'advanced-wasm';\n}\n\nexport interface IDiffProviderFactoryService {\n\treadonly _serviceBrand: undefined;\n\tcreateDiffProvider(options: IDocumentDiffFactoryOptions): IDocumentDiffProvider;\n}\n\nexport class WorkerBasedDiffProviderFactoryService implements IDiffProviderFactoryService {\n\treadonly _serviceBrand: undefined;\n\n\tconstructor(\n\t\t@IInstantiationService private readonly instantiationService: IInstantiationService,\n\t) { }\n\n\tcreateDiffProvider(options: IDocumentDiffFactoryOptions): IDocumentDiffProvider {\n\t\treturn this.instantiationService.createInstance(WorkerBasedDocumentDiffProvider, options);\n\t}\n}\n\nregisterSingleton(IDiffProviderFactoryService, WorkerBasedDiffProviderFactoryService, InstantiationType.Delayed);\n\nexport class WorkerBasedDocumentDiffProvider implements IDocumentDiffProvider, IDisposable {\n\tprivate onDidChangeEventEmitter = new Emitter<void>();\n\tpublic readonly onDidChange: Event<void> = this.onDidChangeEventEmitter.event;\n\n\tprivate diffAlgorithm: DiffAlgorithmName | IDocumentDiffProvider = 'advanced';\n\tprivate diffAlgorithmOnDidChangeSubscription: IDisposable | undefined = undefined;\n\n\tprivate static readonly diffCache = new Map<string, { result: IDocumentDiff; context: string }>();\n\n\tprivate static readonly maxVerifiedLineCount = 50_000;\n\n\tconstructor(\n\t\toptions: IWorkerBasedDocumentDiffProviderOptions,\n\t\t@IEditorWorkerService private readonly editorWorkerService: IEditorWorkerService,\n\t\t@ITelemetryService private readonly telemetryService: ITelemetryService,\n\t\t@IConfigurationService private readonly configurationService: IConfigurationService,\n\t) {\n\t\tthis.setOptions(options);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.diffAlgorithmOnDidChangeSubscription?.dispose();\n\t\tthis.onDidChangeEventEmitter.dispose();\n\t}\n\n\tasync computeDiff(original: ITextModel, modified: ITextModel, options: IDocumentDiffProviderOptions, cancellationToken: CancellationToken): Promise<IDocumentDiff> {\n\t\tif (typeof this.diffAlgorithm !== 'string') {\n\t\t\treturn this.diffAlgorithm.computeDiff(original, modified, options, cancellationToken);\n\t\t}\n\n\t\tif (original.isDisposed() || modified.isDisposed()) {\n\t\t\t// TODO@hediet\n\t\t\treturn {\n\t\t\t\tchanges: [],\n\t\t\t\tidentical: true,\n\t\t\t\tquitEarly: false,\n\t\t\t\tmoves: [],\n\t\t\t};\n\t\t}\n\n\t\t// This significantly speeds up the case when the original file is empty\n\t\tif (original.getLineCount() === 1 && original.getLineMaxColumn(1) === 1) {\n\t\t\tif (modified.getLineCount() === 1 && modified.getLineMaxColumn(1) === 1) {\n\t\t\t\treturn {\n\t\t\t\t\tchanges: [],\n\t\t\t\t\tidentical: true,\n\t\t\t\t\tquitEarly: false,\n\t\t\t\t\tmoves: [],\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tchanges: [\n\t\t\t\t\tnew DetailedLineRangeMapping(\n\t\t\t\t\t\tnew LineRange(1, 2),\n\t\t\t\t\t\tnew LineRange(1, modified.getLineCount() + 1),\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tnew RangeMapping(\n\t\t\t\t\t\t\t\toriginal.getFullModelRange(),\n\t\t\t\t\t\t\t\tmodified.getFullModelRange(),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t]\n\t\t\t\t\t)\n\t\t\t\t],\n\t\t\t\tidentical: false,\n\t\t\t\tquitEarly: false,\n\t\t\t\tmoves: [],\n\t\t\t};\n\t\t}\n\n\t\tconst uriKey = JSON.stringify([original.uri.toString(), modified.uri.toString()]);\n\t\tconst context = JSON.stringify([original.id, modified.id, original.getAlternativeVersionId(), modified.getAlternativeVersionId(), JSON.stringify(options)]);\n\t\tconst c = WorkerBasedDocumentDiffProvider.diffCache.get(uriKey);\n\t\tif (c && c.context === context) {\n\t\t\treturn c.result;\n\t\t}\n\n\t\tconst sw = StopWatch.create();\n\t\tconst verify = this._shouldVerify(original, modified);\n\t\tconst result = await this.editorWorkerService.computeDiff(original.uri, modified.uri, options, this.diffAlgorithm, verify);\n\t\tconst timeMs = sw.elapsed();\n\n\t\tthis.telemetryService.publicLog2<{\n\t\t\ttimeMs: number;\n\t\t\ttimedOut: boolean;\n\t\t\tdetectedMoves: number;\n\t\t\tdiffAlgorithm: string;\n\t\t\tignoreTrimWhitespace: boolean;\n\t\t\tvalidity: string;\n\t\t}, {\n\t\t\towner: 'hediet';\n\n\t\t\ttimeMs: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand if the new diff algorithm is slower/faster than the old one' };\n\t\t\ttimedOut: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how often the new diff algorithm times out' };\n\t\t\tdetectedMoves: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'To understand how often the new diff algorithm detects moves' };\n\t\t\tdiffAlgorithm: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The diff algorithm that computed the diff, to compare algorithms.' };\n\t\t\tignoreTrimWhitespace: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'Whether leading/trailing whitespace changes were ignored.' };\n\t\t\tvalidity: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'Whether the diff reproduces the modified text (valid, invalid, unverified, or notChecked if not sampled), to measure how often an algorithm produces incorrect diffs. Includes verification time in timeMs when checked.' };\n\n\t\t\tcomment: 'This event gives insight about the performance of the new diff algorithm.';\n\t\t}>('diffEditor.computeDiff', {\n\t\t\ttimeMs,\n\t\t\ttimedOut: result?.quitEarly ?? true,\n\t\t\tdetectedMoves: options.computeMoves ? (result?.moves.length ?? 0) : -1,\n\t\t\tdiffAlgorithm: this.diffAlgorithm,\n\t\t\tignoreTrimWhitespace: options.ignoreTrimWhitespace,\n\t\t\tvalidity: result?.validity ?? 'notChecked',\n\t\t});\n\n\t\tif (cancellationToken.isCancellationRequested) {\n\t\t\t// Text models might be disposed!\n\t\t\treturn {\n\t\t\t\tchanges: [],\n\t\t\t\tidentical: false,\n\t\t\t\tquitEarly: true,\n\t\t\t\tmoves: [],\n\t\t\t};\n\t\t}\n\n\t\tif (!result) {\n\t\t\tthrow new Error('no diff result available');\n\t\t}\n\n\t\t// max 10 items in cache\n\t\tif (WorkerBasedDocumentDiffProvider.diffCache.size > 10) {\n\t\t\tWorkerBasedDocumentDiffProvider.diffCache.delete(WorkerBasedDocumentDiffProvider.diffCache.keys().next().value!);\n\t\t}\n\n\t\tWorkerBasedDocumentDiffProvider.diffCache.set(uriKey, { result, context });\n\t\treturn result;\n\t}\n\n\t/**\n\t * Verifying a diff is linear in the document size, so it is only done for a sample of diffs,\n\t * controlled by an experiment, and never for very large documents.\n\t */\n\tprivate _shouldVerify(original: ITextModel, modified: ITextModel): boolean {\n\t\tconst sampleRate = this.configurationService.getValue<number>('diffEditor.experimental.verifyDiffSampleRate') ?? 0;\n\t\treturn Math.random() < sampleRate\n\t\t\t&& original.getLineCount() <= WorkerBasedDocumentDiffProvider.maxVerifiedLineCount\n\t\t\t&& modified.getLineCount() <= WorkerBasedDocumentDiffProvider.maxVerifiedLineCount;\n\t}\n\n\tpublic setOptions(newOptions: IWorkerBasedDocumentDiffProviderOptions): void {\n\t\tlet didChange = false;\n\t\tif (newOptions.diffAlgorithm) {\n\t\t\tif (this.diffAlgorithm !== newOptions.diffAlgorithm) {\n\t\t\t\tthis.diffAlgorithmOnDidChangeSubscription?.dispose();\n\t\t\t\tthis.diffAlgorithmOnDidChangeSubscription = undefined;\n\n\t\t\t\tthis.diffAlgorithm = newOptions.diffAlgorithm;\n\t\t\t\tif (typeof newOptions.diffAlgorithm !== 'string') {\n\t\t\t\t\tthis.diffAlgorithmOnDidChangeSubscription = newOptions.diffAlgorithm.onDidChange(() => this.onDidChangeEventEmitter.fire());\n\t\t\t\t}\n\t\t\t\tdidChange = true;\n\t\t\t}\n\t\t}\n\t\tif (didChange) {\n\t\t\tthis.onDidChangeEventEmitter.fire();\n\t\t}\n\t}\n}\n\ninterface IWorkerBasedDocumentDiffProviderOptions {\n\treadonly diffAlgorithm?: 'legacy' | 'advanced' | 'advanced-external' | 'advanced-wasm' | IDocumentDiffProvider;\n}\n"]}
@@ -118,7 +118,7 @@ let DiffEditorGutter = class DiffEditorGutter extends Disposable {
118
118
  },
119
119
  }));
120
120
  this._register(addDisposableListener(this.elements.gutter, EventType.MOUSE_WHEEL, (e) => {
121
- if (this._editors.modified.getOption(117 /* EditorOption.scrollbar */).handleMouseWheel) {
121
+ if (this._editors.modified.getOption(119 /* EditorOption.scrollbar */).handleMouseWheel) {
122
122
  this._editors.modified.delegateScrollFromMouseWheelEvent(e);
123
123
  }
124
124
  }, { passive: false }));