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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (337) hide show
  1. package/esm/nls.keys.json +1 -1
  2. package/esm/nls.messages.cs.js +2 -2
  3. package/esm/nls.messages.de.js +2 -2
  4. package/esm/nls.messages.es.js +2 -2
  5. package/esm/nls.messages.fr.js +2 -2
  6. package/esm/nls.messages.it.js +2 -2
  7. package/esm/nls.messages.ja.js +2 -2
  8. package/esm/nls.messages.js +1 -1
  9. package/esm/nls.messages.json +1 -1
  10. package/esm/nls.messages.ko.js +2 -2
  11. package/esm/nls.messages.pl.js +2 -2
  12. package/esm/nls.messages.pt-br.js +2 -2
  13. package/esm/nls.messages.ru.js +2 -2
  14. package/esm/nls.messages.tr.js +2 -2
  15. package/esm/nls.messages.zh-cn.js +2 -2
  16. package/esm/nls.messages.zh-tw.js +2 -2
  17. package/esm/nls.metadata.json +34 -2
  18. package/esm/vs/base/browser/dom.js +1 -4
  19. package/esm/vs/base/browser/dom.js.map +1 -1
  20. package/esm/vs/base/browser/markdownRenderer.js +25 -11
  21. package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
  22. package/esm/vs/base/browser/ui/button/button.js +15 -8
  23. package/esm/vs/base/browser/ui/button/button.js.map +1 -1
  24. package/esm/vs/base/browser/ui/codicons/codicon/codicon-modifiers.css +3 -8
  25. package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  26. package/esm/vs/base/browser/ui/list/list.css +1 -0
  27. package/esm/vs/base/browser/ui/toolbar/toolbar.js +3 -0
  28. package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
  29. package/esm/vs/base/common/async.js +11 -0
  30. package/esm/vs/base/common/async.js.map +1 -1
  31. package/esm/vs/base/common/codiconsLibrary.js +11 -2
  32. package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
  33. package/esm/vs/base/common/defaultAccount.js +6 -0
  34. package/esm/vs/base/common/defaultAccount.js.map +1 -0
  35. package/esm/vs/base/common/equals.js +73 -24
  36. package/esm/vs/base/common/equals.js.map +1 -1
  37. package/esm/vs/base/common/event.js +14 -4
  38. package/esm/vs/base/common/event.js.map +1 -1
  39. package/esm/vs/base/common/iterator.js.map +1 -1
  40. package/esm/vs/base/common/keybindings.js +0 -8
  41. package/esm/vs/base/common/keybindings.js.map +1 -1
  42. package/esm/vs/base/common/lifecycle.js +2 -2
  43. package/esm/vs/base/common/lifecycle.js.map +1 -1
  44. package/esm/vs/base/common/marshallingIds.js.map +1 -1
  45. package/esm/vs/base/common/observableInternal/index.js +1 -1
  46. package/esm/vs/base/common/observableInternal/index.js.map +1 -1
  47. package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js +1 -1
  48. package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js.map +1 -1
  49. package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js +16 -0
  50. package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js.map +1 -1
  51. package/esm/vs/base/common/observableInternal/utils/utils.js +11 -0
  52. package/esm/vs/base/common/observableInternal/utils/utils.js.map +1 -1
  53. package/esm/vs/base/common/product.js.map +1 -1
  54. package/esm/vs/base/common/strings.js +3 -1
  55. package/esm/vs/base/common/strings.js.map +1 -1
  56. package/esm/vs/editor/browser/controller/dragScrolling.js +2 -1
  57. package/esm/vs/editor/browser/controller/dragScrolling.js.map +1 -1
  58. package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js +73 -2
  59. package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js.map +1 -1
  60. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +7 -51
  61. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
  62. package/esm/vs/editor/browser/controller/editContext/screenReaderUtils.js.map +1 -1
  63. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +7 -20
  64. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
  65. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js +14 -44
  66. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js.map +1 -1
  67. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextRegistry.js +19 -0
  68. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextRegistry.js.map +1 -0
  69. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.js +14 -1
  70. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContextState.js.map +1 -1
  71. package/esm/vs/editor/browser/controller/mouseHandler.js +5 -2
  72. package/esm/vs/editor/browser/controller/mouseHandler.js.map +1 -1
  73. package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
  74. package/esm/vs/editor/browser/observableCodeEditor.js +32 -15
  75. package/esm/vs/editor/browser/observableCodeEditor.js.map +1 -1
  76. package/esm/vs/editor/browser/view.js +11 -2
  77. package/esm/vs/editor/browser/view.js.map +1 -1
  78. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +5 -2
  79. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
  80. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +10 -0
  81. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
  82. package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js.map +1 -1
  83. package/esm/vs/editor/browser/widget/multiDiffEditor/style.css +48 -0
  84. package/esm/vs/editor/common/config/fontInfo.js +1 -1
  85. package/esm/vs/editor/common/config/fontInfo.js.map +1 -1
  86. package/esm/vs/editor/common/core/edits/edit.js +19 -0
  87. package/esm/vs/editor/common/core/edits/edit.js.map +1 -1
  88. package/esm/vs/editor/common/core/edits/stringEdit.js +13 -0
  89. package/esm/vs/editor/common/core/edits/stringEdit.js.map +1 -1
  90. package/esm/vs/editor/common/core/edits/textEdit.js.map +1 -1
  91. package/esm/vs/editor/common/core/text/positionToOffsetImpl.js +24 -10
  92. package/esm/vs/editor/common/core/text/positionToOffsetImpl.js.map +1 -1
  93. package/esm/vs/editor/common/cursor/cursorMoveCommands.js +4 -4
  94. package/esm/vs/editor/common/cursor/cursorMoveCommands.js.map +1 -1
  95. package/esm/vs/editor/common/cursor/cursorWordOperations.js +6 -3
  96. package/esm/vs/editor/common/cursor/cursorWordOperations.js.map +1 -1
  97. package/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js +2 -2
  98. package/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js.map +1 -1
  99. package/esm/vs/editor/common/languages/nullTokenize.js +1 -1
  100. package/esm/vs/editor/common/languages/nullTokenize.js.map +1 -1
  101. package/esm/vs/editor/common/languages/supports/tokenization.js +3 -0
  102. package/esm/vs/editor/common/languages/supports/tokenization.js.map +1 -1
  103. package/esm/vs/editor/common/languages.js +2 -1
  104. package/esm/vs/editor/common/languages.js.map +1 -1
  105. package/esm/vs/editor/common/model/decorationProvider.js +21 -1
  106. package/esm/vs/editor/common/model/decorationProvider.js.map +1 -1
  107. package/esm/vs/editor/common/model/textModel.js +49 -30
  108. package/esm/vs/editor/common/model/textModel.js.map +1 -1
  109. package/esm/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.js +6 -3
  110. package/esm/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.js.map +1 -1
  111. package/esm/vs/editor/common/model/tokens/annotations.js +177 -0
  112. package/esm/vs/editor/common/model/tokens/annotations.js.map +1 -0
  113. package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js +131 -0
  114. package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js.map +1 -0
  115. package/esm/vs/editor/common/model/tokens/tokenizationTextModelPart.js +9 -0
  116. package/esm/vs/editor/common/model/tokens/tokenizationTextModelPart.js.map +1 -1
  117. package/esm/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.js +9 -0
  118. package/esm/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.js.map +1 -1
  119. package/esm/vs/editor/common/textModelEditSource.js +2 -0
  120. package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
  121. package/esm/vs/editor/common/textModelEvents.js.map +1 -1
  122. package/esm/vs/editor/common/viewLayout/lineDecorations.js.map +1 -1
  123. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +1 -1
  124. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js.map +1 -1
  125. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +54 -36
  126. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
  127. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +14 -1
  128. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
  129. package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +1 -1
  130. package/esm/vs/editor/contrib/hover/browser/hover.css +1 -1
  131. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +1 -1
  132. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
  133. package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
  134. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +1 -0
  135. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js.map +1 -1
  136. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.js +2 -0
  137. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commandIds.js.map +1 -1
  138. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +33 -4
  139. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js.map +1 -1
  140. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -12
  141. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js.map +1 -1
  142. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +7 -1
  143. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js.map +1 -1
  144. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
  145. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
  146. package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js +2 -1
  147. package/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js.map +1 -1
  148. package/esm/vs/editor/contrib/inlineCompletions/browser/model/InlineSuggestAlternativeAction.js +8 -0
  149. package/esm/vs/editor/contrib/inlineCompletions/browser/model/InlineSuggestAlternativeAction.js.map +1 -0
  150. package/esm/vs/editor/contrib/inlineCompletions/browser/model/editKind.js +198 -0
  151. package/esm/vs/editor/contrib/inlineCompletions/browser/model/editKind.js.map +1 -0
  152. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionIsVisible.js +40 -0
  153. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionIsVisible.js.map +1 -0
  154. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +128 -65
  155. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
  156. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +69 -13
  157. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
  158. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +159 -94
  159. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js.map +1 -1
  160. package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +124 -50
  161. package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js.map +1 -1
  162. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +393 -0
  163. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js.map +1 -0
  164. package/esm/vs/editor/contrib/inlineCompletions/browser/telemetry.js.map +1 -1
  165. package/esm/vs/editor/contrib/inlineCompletions/browser/utils.js +20 -0
  166. package/esm/vs/editor/contrib/inlineCompletions/browser/utils.js.map +1 -1
  167. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +59 -42
  168. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js.map +1 -1
  169. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +29 -8
  170. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js.map +1 -1
  171. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +78 -46
  172. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
  173. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js +9 -4
  174. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js.map +1 -1
  175. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +11 -4
  176. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js.map +1 -1
  177. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +81 -41
  178. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
  179. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js +48 -0
  180. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js.map +1 -1
  181. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +18 -15
  182. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js.map +1 -1
  183. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.js +3 -4
  184. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.js.map +1 -1
  185. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js +6 -7
  186. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js.map +1 -1
  187. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js +4 -5
  188. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js.map +1 -1
  189. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js +4 -3
  190. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js.map +1 -1
  191. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js +8 -8
  192. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js.map +1 -1
  193. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js +9 -7
  194. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js.map +1 -1
  195. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +203 -41
  196. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js.map +1 -1
  197. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/jumpToView.js +189 -0
  198. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/jumpToView.js.map +1 -0
  199. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js +85 -102
  200. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js.map +1 -1
  201. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js +75 -32
  202. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js.map +1 -1
  203. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistnaceWidgetPlacement.js +121 -0
  204. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistnaceWidgetPlacement.js.map +1 -0
  205. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js +2 -1
  206. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js.map +1 -1
  207. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +22 -20
  208. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js.map +1 -1
  209. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js +15 -5
  210. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js.map +1 -1
  211. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/view.css +39 -6
  212. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js +10 -5
  213. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js.map +1 -1
  214. package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
  215. package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
  216. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +32 -32
  217. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js.map +1 -1
  218. package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
  219. package/esm/vs/editor/contrib/links/browser/links.js +10 -10
  220. package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
  221. package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
  222. package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
  223. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
  224. package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
  225. package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
  226. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +11 -11
  227. package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
  228. package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
  229. package/esm/vs/editor/contrib/rename/browser/rename.js +19 -11
  230. package/esm/vs/editor/contrib/rename/browser/rename.js.map +1 -1
  231. package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
  232. package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js +3 -2
  233. package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js.map +1 -1
  234. package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
  235. package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
  236. package/esm/vs/editor/contrib/snippet/browser/snippetParser.js +33 -0
  237. package/esm/vs/editor/contrib/snippet/browser/snippetParser.js.map +1 -1
  238. package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
  239. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  240. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +12 -4
  241. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js.map +1 -1
  242. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +1 -0
  243. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js.map +1 -1
  244. package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -8
  245. package/esm/vs/editor/contrib/suggest/browser/suggest.js.map +1 -1
  246. package/esm/vs/editor/contrib/suggest/browser/suggestController.js +39 -28
  247. package/esm/vs/editor/contrib/suggest/browser/suggestController.js.map +1 -1
  248. package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +1 -0
  249. package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js.map +1 -1
  250. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +22 -18
  251. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js.map +1 -1
  252. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +28 -6
  253. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js.map +1 -1
  254. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
  255. package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
  256. package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
  257. package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  258. package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  259. package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  260. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
  261. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
  262. package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  263. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
  264. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +19 -2
  265. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js.map +1 -1
  266. package/esm/vs/editor/editor.api.d.ts +37 -2
  267. package/esm/vs/editor/standalone/browser/standaloneLanguages.js +2 -2
  268. package/esm/vs/editor/standalone/browser/standaloneLanguages.js.map +1 -1
  269. package/esm/vs/editor/standalone/browser/standaloneServices.js +11 -1
  270. package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
  271. package/esm/vs/editor/standalone/common/monarch/monarchLexer.js +1 -1
  272. package/esm/vs/editor/standalone/common/monarch/monarchLexer.js.map +1 -1
  273. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
  274. package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
  275. package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
  276. package/esm/vs/platform/actionWidget/browser/actionWidget.css +11 -8
  277. package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
  278. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
  279. package/esm/vs/platform/actions/browser/toolbar.js +2 -2
  280. package/esm/vs/platform/actions/common/actions.js +11 -4
  281. package/esm/vs/platform/actions/common/actions.js.map +1 -1
  282. package/esm/vs/platform/actions/common/menuService.js +2 -2
  283. package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
  284. package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
  285. package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
  286. package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
  287. package/esm/vs/platform/contextkey/common/scanner.js +5 -5
  288. package/esm/vs/platform/{product/common/productService.js → defaultAccount/common/defaultAccount.js} +2 -2
  289. package/esm/vs/platform/defaultAccount/common/defaultAccount.js.map +1 -0
  290. package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  291. package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
  292. package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
  293. package/esm/vs/platform/instantiation/common/instantiation.js.map +1 -1
  294. package/esm/vs/platform/instantiation/common/instantiationService.js +1 -8
  295. package/esm/vs/platform/instantiation/common/instantiationService.js.map +1 -1
  296. package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
  297. package/esm/vs/platform/list/browser/listService.js +27 -27
  298. package/esm/vs/platform/log/common/log.js +1 -1
  299. package/esm/vs/platform/log/common/log.js.map +1 -1
  300. package/esm/vs/platform/markers/common/markerService.js +6 -6
  301. package/esm/vs/platform/markers/common/markerService.js.map +1 -1
  302. package/esm/vs/platform/markers/common/markers.js +6 -6
  303. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
  304. package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
  305. package/esm/vs/platform/quickinput/browser/media/quickInput.css +7 -3
  306. package/esm/vs/platform/quickinput/browser/quickInput.js +19 -11
  307. package/esm/vs/platform/quickinput/browser/quickInput.js.map +1 -1
  308. package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
  309. package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
  310. package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
  311. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  312. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
  313. package/esm/vs/platform/theme/common/colorUtils.js +2 -2
  314. package/esm/vs/platform/theme/common/colors/baseColors.js +18 -17
  315. package/esm/vs/platform/theme/common/colors/baseColors.js.map +1 -1
  316. package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
  317. package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
  318. package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
  319. package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
  320. package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
  321. package/esm/vs/platform/theme/common/colors/minimapColors.js +13 -13
  322. package/esm/vs/platform/theme/common/colors/minimapColors.js.map +1 -1
  323. package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
  324. package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
  325. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  326. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  327. package/esm/vs/platform/undoRedo/common/undoRedoService.js +21 -21
  328. package/esm/vs/platform/undoRedo/common/undoRedoService.js.map +1 -1
  329. package/esm/vs/platform/window/common/window.js +1 -1
  330. package/esm/vs/platform/window/common/window.js.map +1 -1
  331. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  332. package/monaco.d.ts +37 -2
  333. package/package.json +2 -2
  334. package/version.txt +1 -1
  335. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js +0 -16
  336. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js.map +0 -1
  337. package/esm/vs/platform/product/common/productService.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["vs/platform/undoRedo/common/undoRedoService.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAe,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,QAAQ,MAAM,kCAAkC,CAAC;AAExD,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAqB,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAmE,gBAAgB,EAA6B,yBAAyB,EAAu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AA,cAAc,CAAA;IACd,WAAA,oBAAoB,CAAA;GARV,eAAe,CAg5B3B;;AAED,MAAM,0BAA0B;IAC/B,YAA4B,WAAiC;QAAjC,gBAAW,GAAX,WAAW,CAAsB;IAAI,CAAC;CAClE;AAED,iBAAiB,CAAC,gBAAgB,EAAE,eAAe,oCAA4B,CAAC","file":"undoRedoService.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 { onUnexpectedError } from '../../../base/common/errors.js';\nimport { Disposable, IDisposable, isDisposable } from '../../../base/common/lifecycle.js';\nimport { Schemas } from '../../../base/common/network.js';\nimport Severity from '../../../base/common/severity.js';\nimport { URI } from '../../../base/common/uri.js';\nimport * as nls from '../../../nls.js';\nimport { IDialogService } from '../../dialogs/common/dialogs.js';\nimport { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js';\nimport { INotificationService } from '../../notification/common/notification.js';\nimport { IPastFutureElements, IResourceUndoRedoElement, IUndoRedoElement, IUndoRedoService, IWorkspaceUndoRedoElement, ResourceEditStackSnapshot, UndoRedoElementType, UndoRedoGroup, UndoRedoSource, UriComparisonKeyComputer } from './undoRedo.js';\n\nconst DEBUG = false;\n\nfunction getResourceLabel(resource: URI): string {\n\treturn resource.scheme === Schemas.file ? resource.fsPath : resource.path;\n}\n\nlet stackElementCounter = 0;\n\nclass ResourceStackElement {\n\tpublic readonly id = (++stackElementCounter);\n\tpublic readonly type = UndoRedoElementType.Resource;\n\tpublic readonly actual: IUndoRedoElement;\n\tpublic readonly label: string;\n\tpublic readonly confirmBeforeUndo: boolean;\n\n\tpublic readonly resourceLabel: string;\n\tpublic readonly strResource: string;\n\tpublic readonly resourceLabels: string[];\n\tpublic readonly strResources: string[];\n\tpublic readonly groupId: number;\n\tpublic readonly groupOrder: number;\n\tpublic readonly sourceId: number;\n\tpublic readonly sourceOrder: number;\n\tpublic isValid: boolean;\n\n\tconstructor(actual: IUndoRedoElement, resourceLabel: string, strResource: string, groupId: number, groupOrder: number, sourceId: number, sourceOrder: number) {\n\t\tthis.actual = actual;\n\t\tthis.label = actual.label;\n\t\tthis.confirmBeforeUndo = actual.confirmBeforeUndo || false;\n\t\tthis.resourceLabel = resourceLabel;\n\t\tthis.strResource = strResource;\n\t\tthis.resourceLabels = [this.resourceLabel];\n\t\tthis.strResources = [this.strResource];\n\t\tthis.groupId = groupId;\n\t\tthis.groupOrder = groupOrder;\n\t\tthis.sourceId = sourceId;\n\t\tthis.sourceOrder = sourceOrder;\n\t\tthis.isValid = true;\n\t}\n\n\tpublic setValid(isValid: boolean): void {\n\t\tthis.isValid = isValid;\n\t}\n\n\tpublic toString(): string {\n\t\treturn `[id:${this.id}] [group:${this.groupId}] [${this.isValid ? ' VALID' : 'INVALID'}] ${this.actual.constructor.name} - ${this.actual}`;\n\t}\n}\n\nconst enum RemovedResourceReason {\n\tExternalRemoval = 0,\n\tNoParallelUniverses = 1\n}\n\nclass ResourceReasonPair {\n\tconstructor(\n\t\tpublic readonly resourceLabel: string,\n\t\tpublic readonly reason: RemovedResourceReason\n\t) { }\n}\n\nclass RemovedResources {\n\tprivate readonly elements = new Map<string, ResourceReasonPair>();\n\n\tpublic createMessage(): string {\n\t\tconst externalRemoval: string[] = [];\n\t\tconst noParallelUniverses: string[] = [];\n\t\tfor (const [, element] of this.elements) {\n\t\t\tconst dest = (\n\t\t\t\telement.reason === RemovedResourceReason.ExternalRemoval\n\t\t\t\t\t? externalRemoval\n\t\t\t\t\t: noParallelUniverses\n\t\t\t);\n\t\t\tdest.push(element.resourceLabel);\n\t\t}\n\n\t\tconst messages: string[] = [];\n\t\tif (externalRemoval.length > 0) {\n\t\t\tmessages.push(\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'externalRemoval', comment: ['{0} is a list of filenames'] },\n\t\t\t\t\t\"The following files have been closed and modified on disk: {0}.\", externalRemoval.join(', ')\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tif (noParallelUniverses.length > 0) {\n\t\t\tmessages.push(\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'noParallelUniverses', comment: ['{0} is a list of filenames'] },\n\t\t\t\t\t\"The following files have been modified in an incompatible way: {0}.\", noParallelUniverses.join(', ')\n\t\t\t\t));\n\t\t}\n\t\treturn messages.join('\\n');\n\t}\n\n\tpublic get size(): number {\n\t\treturn this.elements.size;\n\t}\n\n\tpublic has(strResource: string): boolean {\n\t\treturn this.elements.has(strResource);\n\t}\n\n\tpublic set(strResource: string, value: ResourceReasonPair): void {\n\t\tthis.elements.set(strResource, value);\n\t}\n\n\tpublic delete(strResource: string): boolean {\n\t\treturn this.elements.delete(strResource);\n\t}\n}\n\nclass WorkspaceStackElement {\n\tpublic readonly id = (++stackElementCounter);\n\tpublic readonly type = UndoRedoElementType.Workspace;\n\tpublic readonly actual: IWorkspaceUndoRedoElement;\n\tpublic readonly label: string;\n\tpublic readonly confirmBeforeUndo: boolean;\n\n\tpublic readonly resourceLabels: string[];\n\tpublic readonly strResources: string[];\n\tpublic readonly groupId: number;\n\tpublic readonly groupOrder: number;\n\tpublic readonly sourceId: number;\n\tpublic readonly sourceOrder: number;\n\tpublic removedResources: RemovedResources | null;\n\tpublic invalidatedResources: RemovedResources | null;\n\n\tconstructor(actual: IWorkspaceUndoRedoElement, resourceLabels: string[], strResources: string[], groupId: number, groupOrder: number, sourceId: number, sourceOrder: number) {\n\t\tthis.actual = actual;\n\t\tthis.label = actual.label;\n\t\tthis.confirmBeforeUndo = actual.confirmBeforeUndo || false;\n\t\tthis.resourceLabels = resourceLabels;\n\t\tthis.strResources = strResources;\n\t\tthis.groupId = groupId;\n\t\tthis.groupOrder = groupOrder;\n\t\tthis.sourceId = sourceId;\n\t\tthis.sourceOrder = sourceOrder;\n\t\tthis.removedResources = null;\n\t\tthis.invalidatedResources = null;\n\t}\n\n\tpublic canSplit(): this is WorkspaceStackElement & { actual: { split(): IResourceUndoRedoElement[] } } {\n\t\treturn (typeof this.actual.split === 'function');\n\t}\n\n\tpublic removeResource(resourceLabel: string, strResource: string, reason: RemovedResourceReason): void {\n\t\tif (!this.removedResources) {\n\t\t\tthis.removedResources = new RemovedResources();\n\t\t}\n\t\tif (!this.removedResources.has(strResource)) {\n\t\t\tthis.removedResources.set(strResource, new ResourceReasonPair(resourceLabel, reason));\n\t\t}\n\t}\n\n\tpublic setValid(resourceLabel: string, strResource: string, isValid: boolean): void {\n\t\tif (isValid) {\n\t\t\tif (this.invalidatedResources) {\n\t\t\t\tthis.invalidatedResources.delete(strResource);\n\t\t\t\tif (this.invalidatedResources.size === 0) {\n\t\t\t\t\tthis.invalidatedResources = null;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (!this.invalidatedResources) {\n\t\t\t\tthis.invalidatedResources = new RemovedResources();\n\t\t\t}\n\t\t\tif (!this.invalidatedResources.has(strResource)) {\n\t\t\t\tthis.invalidatedResources.set(strResource, new ResourceReasonPair(resourceLabel, RemovedResourceReason.ExternalRemoval));\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic toString(): string {\n\t\treturn `[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources ? 'INVALID' : ' VALID'}] ${this.actual.constructor.name} - ${this.actual}`;\n\t}\n}\n\ntype StackElement = ResourceStackElement | WorkspaceStackElement;\n\nclass ResourceEditStack {\n\tpublic readonly resourceLabel: string;\n\tprivate readonly strResource: string;\n\tprivate _past: StackElement[];\n\tprivate _future: StackElement[];\n\tpublic locked: boolean;\n\tpublic versionId: number;\n\n\tconstructor(resourceLabel: string, strResource: string) {\n\t\tthis.resourceLabel = resourceLabel;\n\t\tthis.strResource = strResource;\n\t\tthis._past = [];\n\t\tthis._future = [];\n\t\tthis.locked = false;\n\t\tthis.versionId = 1;\n\t}\n\n\tpublic dispose(): void {\n\t\tfor (const element of this._past) {\n\t\t\tif (element.type === UndoRedoElementType.Workspace) {\n\t\t\t\telement.removeResource(this.resourceLabel, this.strResource, RemovedResourceReason.ExternalRemoval);\n\t\t\t}\n\t\t}\n\t\tfor (const element of this._future) {\n\t\t\tif (element.type === UndoRedoElementType.Workspace) {\n\t\t\t\telement.removeResource(this.resourceLabel, this.strResource, RemovedResourceReason.ExternalRemoval);\n\t\t\t}\n\t\t}\n\t\tthis.versionId++;\n\t}\n\n\tpublic toString(): string {\n\t\tconst result: string[] = [];\n\t\tresult.push(`* ${this.strResource}:`);\n\t\tfor (let i = 0; i < this._past.length; i++) {\n\t\t\tresult.push(` * [UNDO] ${this._past[i]}`);\n\t\t}\n\t\tfor (let i = this._future.length - 1; i >= 0; i--) {\n\t\t\tresult.push(` * [REDO] ${this._future[i]}`);\n\t\t}\n\t\treturn result.join('\\n');\n\t}\n\n\tpublic flushAllElements(): void {\n\t\tthis._past = [];\n\t\tthis._future = [];\n\t\tthis.versionId++;\n\t}\n\n\tprivate _setElementValidFlag(element: StackElement, isValid: boolean): void {\n\t\tif (element.type === UndoRedoElementType.Workspace) {\n\t\t\telement.setValid(this.resourceLabel, this.strResource, isValid);\n\t\t} else {\n\t\t\telement.setValid(isValid);\n\t\t}\n\t}\n\n\tpublic setElementsValidFlag(isValid: boolean, filter: (element: IUndoRedoElement) => boolean): void {\n\t\tfor (const element of this._past) {\n\t\t\tif (filter(element.actual)) {\n\t\t\t\tthis._setElementValidFlag(element, isValid);\n\t\t\t}\n\t\t}\n\t\tfor (const element of this._future) {\n\t\t\tif (filter(element.actual)) {\n\t\t\t\tthis._setElementValidFlag(element, isValid);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic pushElement(element: StackElement): void {\n\t\t// remove the future\n\t\tfor (const futureElement of this._future) {\n\t\t\tif (futureElement.type === UndoRedoElementType.Workspace) {\n\t\t\t\tfutureElement.removeResource(this.resourceLabel, this.strResource, RemovedResourceReason.NoParallelUniverses);\n\t\t\t}\n\t\t}\n\t\tthis._future = [];\n\t\tthis._past.push(element);\n\t\tthis.versionId++;\n\t}\n\n\tpublic createSnapshot(resource: URI): ResourceEditStackSnapshot {\n\t\tconst elements: number[] = [];\n\n\t\tfor (let i = 0, len = this._past.length; i < len; i++) {\n\t\t\telements.push(this._past[i].id);\n\t\t}\n\t\tfor (let i = this._future.length - 1; i >= 0; i--) {\n\t\t\telements.push(this._future[i].id);\n\t\t}\n\n\t\treturn new ResourceEditStackSnapshot(resource, elements);\n\t}\n\n\tpublic restoreSnapshot(snapshot: ResourceEditStackSnapshot): void {\n\t\tconst snapshotLength = snapshot.elements.length;\n\t\tlet isOK = true;\n\t\tlet snapshotIndex = 0;\n\t\tlet removePastAfter = -1;\n\t\tfor (let i = 0, len = this._past.length; i < len; i++, snapshotIndex++) {\n\t\t\tconst element = this._past[i];\n\t\t\tif (isOK && (snapshotIndex >= snapshotLength || element.id !== snapshot.elements[snapshotIndex])) {\n\t\t\t\tisOK = false;\n\t\t\t\tremovePastAfter = 0;\n\t\t\t}\n\t\t\tif (!isOK && element.type === UndoRedoElementType.Workspace) {\n\t\t\t\telement.removeResource(this.resourceLabel, this.strResource, RemovedResourceReason.ExternalRemoval);\n\t\t\t}\n\t\t}\n\t\tlet removeFutureBefore = -1;\n\t\tfor (let i = this._future.length - 1; i >= 0; i--, snapshotIndex++) {\n\t\t\tconst element = this._future[i];\n\t\t\tif (isOK && (snapshotIndex >= snapshotLength || element.id !== snapshot.elements[snapshotIndex])) {\n\t\t\t\tisOK = false;\n\t\t\t\tremoveFutureBefore = i;\n\t\t\t}\n\t\t\tif (!isOK && element.type === UndoRedoElementType.Workspace) {\n\t\t\t\telement.removeResource(this.resourceLabel, this.strResource, RemovedResourceReason.ExternalRemoval);\n\t\t\t}\n\t\t}\n\t\tif (removePastAfter !== -1) {\n\t\t\tthis._past = this._past.slice(0, removePastAfter);\n\t\t}\n\t\tif (removeFutureBefore !== -1) {\n\t\t\tthis._future = this._future.slice(removeFutureBefore + 1);\n\t\t}\n\t\tthis.versionId++;\n\t}\n\n\tpublic getElements(): IPastFutureElements {\n\t\tconst past: IUndoRedoElement[] = [];\n\t\tconst future: IUndoRedoElement[] = [];\n\n\t\tfor (const element of this._past) {\n\t\t\tpast.push(element.actual);\n\t\t}\n\t\tfor (const element of this._future) {\n\t\t\tfuture.push(element.actual);\n\t\t}\n\n\t\treturn { past, future };\n\t}\n\n\tpublic getClosestPastElement(): StackElement | null {\n\t\tif (this._past.length === 0) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._past[this._past.length - 1];\n\t}\n\n\tpublic getSecondClosestPastElement(): StackElement | null {\n\t\tif (this._past.length < 2) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._past[this._past.length - 2];\n\t}\n\n\tpublic getClosestFutureElement(): StackElement | null {\n\t\tif (this._future.length === 0) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._future[this._future.length - 1];\n\t}\n\n\tpublic hasPastElements(): boolean {\n\t\treturn (this._past.length > 0);\n\t}\n\n\tpublic hasFutureElements(): boolean {\n\t\treturn (this._future.length > 0);\n\t}\n\n\tpublic splitPastWorkspaceElement(toRemove: WorkspaceStackElement, individualMap: Map<string, ResourceStackElement>): void {\n\t\tfor (let j = this._past.length - 1; j >= 0; j--) {\n\t\t\tif (this._past[j] === toRemove) {\n\t\t\t\tif (individualMap.has(this.strResource)) {\n\t\t\t\t\t// gets replaced\n\t\t\t\t\tthis._past[j] = individualMap.get(this.strResource)!;\n\t\t\t\t} else {\n\t\t\t\t\t// gets deleted\n\t\t\t\t\tthis._past.splice(j, 1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis.versionId++;\n\t}\n\n\tpublic splitFutureWorkspaceElement(toRemove: WorkspaceStackElement, individualMap: Map<string, ResourceStackElement>): void {\n\t\tfor (let j = this._future.length - 1; j >= 0; j--) {\n\t\t\tif (this._future[j] === toRemove) {\n\t\t\t\tif (individualMap.has(this.strResource)) {\n\t\t\t\t\t// gets replaced\n\t\t\t\t\tthis._future[j] = individualMap.get(this.strResource)!;\n\t\t\t\t} else {\n\t\t\t\t\t// gets deleted\n\t\t\t\t\tthis._future.splice(j, 1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis.versionId++;\n\t}\n\n\tpublic moveBackward(element: StackElement): void {\n\t\tthis._past.pop();\n\t\tthis._future.push(element);\n\t\tthis.versionId++;\n\t}\n\n\tpublic moveForward(element: StackElement): void {\n\t\tthis._future.pop();\n\t\tthis._past.push(element);\n\t\tthis.versionId++;\n\t}\n}\n\nclass EditStackSnapshot {\n\n\tpublic readonly editStacks: ResourceEditStack[];\n\tprivate readonly _versionIds: number[];\n\n\tconstructor(editStacks: ResourceEditStack[]) {\n\t\tthis.editStacks = editStacks;\n\t\tthis._versionIds = [];\n\t\tfor (let i = 0, len = this.editStacks.length; i < len; i++) {\n\t\t\tthis._versionIds[i] = this.editStacks[i].versionId;\n\t\t}\n\t}\n\n\tpublic isValid(): boolean {\n\t\tfor (let i = 0, len = this.editStacks.length; i < len; i++) {\n\t\t\tif (this._versionIds[i] !== this.editStacks[i].versionId) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n}\n\nconst missingEditStack = new ResourceEditStack('', '');\nmissingEditStack.locked = true;\n\nexport class UndoRedoService implements IUndoRedoService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _editStacks: Map<string, ResourceEditStack>;\n\tprivate readonly _uriComparisonKeyComputers: [string, UriComparisonKeyComputer][];\n\n\tconstructor(\n\t\t@IDialogService private readonly _dialogService: IDialogService,\n\t\t@INotificationService private readonly _notificationService: INotificationService,\n\t) {\n\t\tthis._editStacks = new Map<string, ResourceEditStack>();\n\t\tthis._uriComparisonKeyComputers = [];\n\t}\n\n\tpublic getUriComparisonKey(resource: URI): string {\n\t\tfor (const uriComparisonKeyComputer of this._uriComparisonKeyComputers) {\n\t\t\tif (uriComparisonKeyComputer[0] === resource.scheme) {\n\t\t\t\treturn uriComparisonKeyComputer[1].getComparisonKey(resource);\n\t\t\t}\n\t\t}\n\t\treturn resource.toString();\n\t}\n\n\tprivate _print(label: string): void {\n\t\tconsole.log(`------------------------------------`);\n\t\tconsole.log(`AFTER ${label}: `);\n\t\tconst str: string[] = [];\n\t\tfor (const element of this._editStacks) {\n\t\t\tstr.push(element[1].toString());\n\t\t}\n\t\tconsole.log(str.join('\\n'));\n\t}\n\n\tpublic pushElement(element: IUndoRedoElement, group: UndoRedoGroup = UndoRedoGroup.None, source: UndoRedoSource = UndoRedoSource.None): void {\n\t\tif (element.type === UndoRedoElementType.Resource) {\n\t\t\tconst resourceLabel = getResourceLabel(element.resource);\n\t\t\tconst strResource = this.getUriComparisonKey(element.resource);\n\t\t\tthis._pushElement(new ResourceStackElement(element, resourceLabel, strResource, group.id, group.nextOrder(), source.id, source.nextOrder()));\n\t\t} else {\n\t\t\tconst seen = new Set<string>();\n\t\t\tconst resourceLabels: string[] = [];\n\t\t\tconst strResources: string[] = [];\n\t\t\tfor (const resource of element.resources) {\n\t\t\t\tconst resourceLabel = getResourceLabel(resource);\n\t\t\t\tconst strResource = this.getUriComparisonKey(resource);\n\n\t\t\t\tif (seen.has(strResource)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tseen.add(strResource);\n\t\t\t\tresourceLabels.push(resourceLabel);\n\t\t\t\tstrResources.push(strResource);\n\t\t\t}\n\n\t\t\tif (resourceLabels.length === 1) {\n\t\t\t\tthis._pushElement(new ResourceStackElement(element, resourceLabels[0], strResources[0], group.id, group.nextOrder(), source.id, source.nextOrder()));\n\t\t\t} else {\n\t\t\t\tthis._pushElement(new WorkspaceStackElement(element, resourceLabels, strResources, group.id, group.nextOrder(), source.id, source.nextOrder()));\n\t\t\t}\n\t\t}\n\t\tif (DEBUG) {\n\t\t\tthis._print('pushElement');\n\t\t}\n\t}\n\n\tprivate _pushElement(element: StackElement): void {\n\t\tfor (let i = 0, len = element.strResources.length; i < len; i++) {\n\t\t\tconst resourceLabel = element.resourceLabels[i];\n\t\t\tconst strResource = element.strResources[i];\n\n\t\t\tlet editStack: ResourceEditStack;\n\t\t\tif (this._editStacks.has(strResource)) {\n\t\t\t\teditStack = this._editStacks.get(strResource)!;\n\t\t\t} else {\n\t\t\t\teditStack = new ResourceEditStack(resourceLabel, strResource);\n\t\t\t\tthis._editStacks.set(strResource, editStack);\n\t\t\t}\n\n\t\t\teditStack.pushElement(element);\n\t\t}\n\t}\n\n\tpublic getLastElement(resource: URI): IUndoRedoElement | null {\n\t\tconst strResource = this.getUriComparisonKey(resource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\tif (editStack.hasFutureElements()) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst closestPastElement = editStack.getClosestPastElement();\n\t\t\treturn closestPastElement ? closestPastElement.actual : null;\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate _splitPastWorkspaceElement(toRemove: WorkspaceStackElement & { actual: { split(): IResourceUndoRedoElement[] } }, ignoreResources: RemovedResources | null): void {\n\t\tconst individualArr = toRemove.actual.split();\n\t\tconst individualMap = new Map<string, ResourceStackElement>();\n\t\tfor (const _element of individualArr) {\n\t\t\tconst resourceLabel = getResourceLabel(_element.resource);\n\t\t\tconst strResource = this.getUriComparisonKey(_element.resource);\n\t\t\tconst element = new ResourceStackElement(_element, resourceLabel, strResource, 0, 0, 0, 0);\n\t\t\tindividualMap.set(element.strResource, element);\n\t\t}\n\n\t\tfor (const strResource of toRemove.strResources) {\n\t\t\tif (ignoreResources && ignoreResources.has(strResource)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\teditStack.splitPastWorkspaceElement(toRemove, individualMap);\n\t\t}\n\t}\n\n\tprivate _splitFutureWorkspaceElement(toRemove: WorkspaceStackElement & { actual: { split(): IResourceUndoRedoElement[] } }, ignoreResources: RemovedResources | null): void {\n\t\tconst individualArr = toRemove.actual.split();\n\t\tconst individualMap = new Map<string, ResourceStackElement>();\n\t\tfor (const _element of individualArr) {\n\t\t\tconst resourceLabel = getResourceLabel(_element.resource);\n\t\t\tconst strResource = this.getUriComparisonKey(_element.resource);\n\t\t\tconst element = new ResourceStackElement(_element, resourceLabel, strResource, 0, 0, 0, 0);\n\t\t\tindividualMap.set(element.strResource, element);\n\t\t}\n\n\t\tfor (const strResource of toRemove.strResources) {\n\t\t\tif (ignoreResources && ignoreResources.has(strResource)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\teditStack.splitFutureWorkspaceElement(toRemove, individualMap);\n\t\t}\n\t}\n\n\tpublic removeElements(resource: URI | string): void {\n\t\tconst strResource = typeof resource === 'string' ? resource : this.getUriComparisonKey(resource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\teditStack.dispose();\n\t\t\tthis._editStacks.delete(strResource);\n\t\t}\n\t\tif (DEBUG) {\n\t\t\tthis._print('removeElements');\n\t\t}\n\t}\n\n\tpublic setElementsValidFlag(resource: URI, isValid: boolean, filter: (element: IUndoRedoElement) => boolean): void {\n\t\tconst strResource = this.getUriComparisonKey(resource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\teditStack.setElementsValidFlag(isValid, filter);\n\t\t}\n\t\tif (DEBUG) {\n\t\t\tthis._print('setElementsValidFlag');\n\t\t}\n\t}\n\n\tpublic createSnapshot(resource: URI): ResourceEditStackSnapshot {\n\t\tconst strResource = this.getUriComparisonKey(resource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\treturn editStack.createSnapshot(resource);\n\t\t}\n\t\treturn new ResourceEditStackSnapshot(resource, []);\n\t}\n\n\tpublic restoreSnapshot(snapshot: ResourceEditStackSnapshot): void {\n\t\tconst strResource = this.getUriComparisonKey(snapshot.resource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\teditStack.restoreSnapshot(snapshot);\n\n\t\t\tif (!editStack.hasPastElements() && !editStack.hasFutureElements()) {\n\t\t\t\t// the edit stack is now empty, just remove it entirely\n\t\t\t\teditStack.dispose();\n\t\t\t\tthis._editStacks.delete(strResource);\n\t\t\t}\n\t\t}\n\t\tif (DEBUG) {\n\t\t\tthis._print('restoreSnapshot');\n\t\t}\n\t}\n\n\tpublic getElements(resource: URI): IPastFutureElements {\n\t\tconst strResource = this.getUriComparisonKey(resource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\treturn editStack.getElements();\n\t\t}\n\t\treturn { past: [], future: [] };\n\t}\n\n\tprivate _findClosestUndoElementWithSource(sourceId: number): [StackElement | null, string | null] {\n\t\tif (!sourceId) {\n\t\t\treturn [null, null];\n\t\t}\n\n\t\t// find an element with the sourceId and with the highest sourceOrder ready to be undone\n\t\tlet matchedElement: StackElement | null = null;\n\t\tlet matchedStrResource: string | null = null;\n\n\t\tfor (const [strResource, editStack] of this._editStacks) {\n\t\t\tconst candidate = editStack.getClosestPastElement();\n\t\t\tif (!candidate) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (candidate.sourceId === sourceId) {\n\t\t\t\tif (!matchedElement || candidate.sourceOrder > matchedElement.sourceOrder) {\n\t\t\t\t\tmatchedElement = candidate;\n\t\t\t\t\tmatchedStrResource = strResource;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn [matchedElement, matchedStrResource];\n\t}\n\n\tpublic canUndo(resourceOrSource: URI | UndoRedoSource): boolean {\n\t\tif (resourceOrSource instanceof UndoRedoSource) {\n\t\t\tconst [, matchedStrResource] = this._findClosestUndoElementWithSource(resourceOrSource.id);\n\t\t\treturn matchedStrResource ? true : false;\n\t\t}\n\t\tconst strResource = this.getUriComparisonKey(resourceOrSource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\treturn editStack.hasPastElements();\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _onError(err: Error, element: StackElement): void {\n\t\tonUnexpectedError(err);\n\t\t// An error occurred while undoing or redoing => drop the undo/redo stack for all affected resources\n\t\tfor (const strResource of element.strResources) {\n\t\t\tthis.removeElements(strResource);\n\t\t}\n\t\tthis._notificationService.error(err);\n\t}\n\n\tprivate _acquireLocks(editStackSnapshot: EditStackSnapshot): () => void {\n\t\t// first, check if all locks can be acquired\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\tif (editStack.locked) {\n\t\t\t\tthrow new Error('Cannot acquire edit stack lock');\n\t\t\t}\n\t\t}\n\n\t\t// can acquire all locks\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\teditStack.locked = true;\n\t\t}\n\n\t\treturn () => {\n\t\t\t// release all locks\n\t\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\t\teditStack.locked = false;\n\t\t\t}\n\t\t};\n\t}\n\n\tprivate _safeInvokeWithLocks(element: StackElement, invoke: () => Promise<void> | void, editStackSnapshot: EditStackSnapshot, cleanup: IDisposable, continuation: () => Promise<void> | void): Promise<void> | void {\n\t\tconst releaseLocks = this._acquireLocks(editStackSnapshot);\n\n\t\tlet result: Promise<void> | void;\n\t\ttry {\n\t\t\tresult = invoke();\n\t\t} catch (err) {\n\t\t\treleaseLocks();\n\t\t\tcleanup.dispose();\n\t\t\treturn this._onError(err, element);\n\t\t}\n\n\t\tif (result) {\n\t\t\t// result is Promise<void>\n\t\t\treturn result.then(\n\t\t\t\t() => {\n\t\t\t\t\treleaseLocks();\n\t\t\t\t\tcleanup.dispose();\n\t\t\t\t\treturn continuation();\n\t\t\t\t},\n\t\t\t\t(err) => {\n\t\t\t\t\treleaseLocks();\n\t\t\t\t\tcleanup.dispose();\n\t\t\t\t\treturn this._onError(err, element);\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\t// result is void\n\t\t\treleaseLocks();\n\t\t\tcleanup.dispose();\n\t\t\treturn continuation();\n\t\t}\n\t}\n\n\tprivate async _invokeWorkspacePrepare(element: WorkspaceStackElement): Promise<IDisposable> {\n\t\tif (typeof element.actual.prepareUndoRedo === 'undefined') {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tconst result = element.actual.prepareUndoRedo();\n\t\tif (typeof result === 'undefined') {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate _invokeResourcePrepare(element: ResourceStackElement, callback: (disposable: IDisposable) => Promise<void> | void): void | Promise<void> {\n\t\tif (element.actual.type !== UndoRedoElementType.Workspace || typeof element.actual.prepareUndoRedo === 'undefined') {\n\t\t\t// no preparation needed\n\t\t\treturn callback(Disposable.None);\n\t\t}\n\n\t\tconst r = element.actual.prepareUndoRedo();\n\t\tif (!r) {\n\t\t\t// nothing to clean up\n\t\t\treturn callback(Disposable.None);\n\t\t}\n\n\t\tif (isDisposable(r)) {\n\t\t\treturn callback(r);\n\t\t}\n\n\t\treturn r.then((disposable) => {\n\t\t\treturn callback(disposable);\n\t\t});\n\t}\n\n\tprivate _getAffectedEditStacks(element: WorkspaceStackElement): EditStackSnapshot {\n\t\tconst affectedEditStacks: ResourceEditStack[] = [];\n\t\tfor (const strResource of element.strResources) {\n\t\t\taffectedEditStacks.push(this._editStacks.get(strResource) || missingEditStack);\n\t\t}\n\t\treturn new EditStackSnapshot(affectedEditStacks);\n\t}\n\n\tprivate _tryToSplitAndUndo(strResource: string, element: WorkspaceStackElement, ignoreResources: RemovedResources | null, message: string): WorkspaceVerificationError {\n\t\tif (element.canSplit()) {\n\t\t\tthis._splitPastWorkspaceElement(element, ignoreResources);\n\t\t\tthis._notificationService.warn(message);\n\t\t\treturn new WorkspaceVerificationError(this._undo(strResource, 0, true));\n\t\t} else {\n\t\t\t// Cannot safely split this workspace element => flush all undo/redo stacks\n\t\t\tfor (const strResource of element.strResources) {\n\t\t\t\tthis.removeElements(strResource);\n\t\t\t}\n\t\t\tthis._notificationService.warn(message);\n\t\t\treturn new WorkspaceVerificationError();\n\t\t}\n\t}\n\n\tprivate _checkWorkspaceUndo(strResource: string, element: WorkspaceStackElement, editStackSnapshot: EditStackSnapshot, checkInvalidatedResources: boolean): WorkspaceVerificationError | null {\n\t\tif (element.removedResources) {\n\t\t\treturn this._tryToSplitAndUndo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\telement.removedResources,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceUndo', comment: ['{0} is a label for an operation. {1} is another message.'] },\n\t\t\t\t\t\"Could not undo '{0}' across all files. {1}\", element.label, element.removedResources.createMessage()\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tif (checkInvalidatedResources && element.invalidatedResources) {\n\t\t\treturn this._tryToSplitAndUndo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\telement.invalidatedResources,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceUndo', comment: ['{0} is a label for an operation. {1} is another message.'] },\n\t\t\t\t\t\"Could not undo '{0}' across all files. {1}\", element.label, element.invalidatedResources.createMessage()\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// this must be the last past element in all the impacted resources!\n\t\tconst cannotUndoDueToResources: string[] = [];\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\tif (editStack.getClosestPastElement() !== element) {\n\t\t\t\tcannotUndoDueToResources.push(editStack.resourceLabel);\n\t\t\t}\n\t\t}\n\t\tif (cannotUndoDueToResources.length > 0) {\n\t\t\treturn this._tryToSplitAndUndo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\tnull,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceUndoDueToChanges', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] },\n\t\t\t\t\t\"Could not undo '{0}' across all files because changes were made to {1}\", element.label, cannotUndoDueToResources.join(', ')\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tconst cannotLockDueToResources: string[] = [];\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\tif (editStack.locked) {\n\t\t\t\tcannotLockDueToResources.push(editStack.resourceLabel);\n\t\t\t}\n\t\t}\n\t\tif (cannotLockDueToResources.length > 0) {\n\t\t\treturn this._tryToSplitAndUndo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\tnull,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceUndoDueToInProgressUndoRedo', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] },\n\t\t\t\t\t\"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}\", element.label, cannotLockDueToResources.join(', ')\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// check if new stack elements were added in the meantime...\n\t\tif (!editStackSnapshot.isValid()) {\n\t\t\treturn this._tryToSplitAndUndo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\tnull,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceUndoDueToInMeantimeUndoRedo', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] },\n\t\t\t\t\t\"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime\", element.label\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate _workspaceUndo(strResource: string, element: WorkspaceStackElement, undoConfirmed: boolean): Promise<void> | void {\n\t\tconst affectedEditStacks = this._getAffectedEditStacks(element);\n\t\tconst verificationError = this._checkWorkspaceUndo(strResource, element, affectedEditStacks, /*invalidated resources will be checked after the prepare call*/false);\n\t\tif (verificationError) {\n\t\t\treturn verificationError.returnValue;\n\t\t}\n\t\treturn this._confirmAndExecuteWorkspaceUndo(strResource, element, affectedEditStacks, undoConfirmed);\n\t}\n\n\tprivate _isPartOfUndoGroup(element: WorkspaceStackElement): boolean {\n\t\tif (!element.groupId) {\n\t\t\treturn false;\n\t\t}\n\t\t// check that there is at least another element with the same groupId ready to be undone\n\t\tfor (const [, editStack] of this._editStacks) {\n\t\t\tconst pastElement = editStack.getClosestPastElement();\n\t\t\tif (!pastElement) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (pastElement === element) {\n\t\t\t\tconst secondPastElement = editStack.getSecondClosestPastElement();\n\t\t\t\tif (secondPastElement && secondPastElement.groupId === element.groupId) {\n\t\t\t\t\t// there is another element with the same group id in the same stack!\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pastElement.groupId === element.groupId) {\n\t\t\t\t// there is another element with the same group id in another stack!\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate async _confirmAndExecuteWorkspaceUndo(strResource: string, element: WorkspaceStackElement, editStackSnapshot: EditStackSnapshot, undoConfirmed: boolean): Promise<void> {\n\n\t\tif (element.canSplit() && !this._isPartOfUndoGroup(element)) {\n\t\t\t// this element can be split\n\n\t\t\tenum UndoChoice {\n\t\t\t\tAll = 0,\n\t\t\t\tThis = 1,\n\t\t\t\tCancel = 2\n\t\t\t}\n\n\t\t\tconst { result } = await this._dialogService.prompt<UndoChoice>({\n\t\t\t\ttype: Severity.Info,\n\t\t\t\tmessage: nls.localize('confirmWorkspace', \"Would you like to undo '{0}' across all files?\", element.label),\n\t\t\t\tbuttons: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: nls.localize({ key: 'ok', comment: ['{0} denotes a number that is > 1, && denotes a mnemonic'] }, \"&&Undo in {0} Files\", editStackSnapshot.editStacks.length),\n\t\t\t\t\t\trun: () => UndoChoice.All\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: nls.localize({ key: 'nok', comment: ['&& denotes a mnemonic'] }, \"Undo this &&File\"),\n\t\t\t\t\t\trun: () => UndoChoice.This\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tcancelButton: {\n\t\t\t\t\trun: () => UndoChoice.Cancel\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif (result === UndoChoice.Cancel) {\n\t\t\t\t// choice: cancel\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (result === UndoChoice.This) {\n\t\t\t\t// choice: undo this file\n\t\t\t\tthis._splitPastWorkspaceElement(element, null);\n\t\t\t\treturn this._undo(strResource, 0, true);\n\t\t\t}\n\n\t\t\t// choice: undo in all files\n\n\t\t\t// At this point, it is possible that the element has been made invalid in the meantime (due to the confirmation await)\n\t\t\tconst verificationError1 = this._checkWorkspaceUndo(strResource, element, editStackSnapshot, /*invalidated resources will be checked after the prepare call*/false);\n\t\t\tif (verificationError1) {\n\t\t\t\treturn verificationError1.returnValue;\n\t\t\t}\n\n\t\t\tundoConfirmed = true;\n\t\t}\n\n\t\t// prepare\n\t\tlet cleanup: IDisposable;\n\t\ttry {\n\t\t\tcleanup = await this._invokeWorkspacePrepare(element);\n\t\t} catch (err) {\n\t\t\treturn this._onError(err, element);\n\t\t}\n\n\t\t// At this point, it is possible that the element has been made invalid in the meantime (due to the prepare await)\n\t\tconst verificationError2 = this._checkWorkspaceUndo(strResource, element, editStackSnapshot, /*now also check that there are no more invalidated resources*/true);\n\t\tif (verificationError2) {\n\t\t\tcleanup.dispose();\n\t\t\treturn verificationError2.returnValue;\n\t\t}\n\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\teditStack.moveBackward(element);\n\t\t}\n\t\treturn this._safeInvokeWithLocks(element, () => element.actual.undo(), editStackSnapshot, cleanup, () => this._continueUndoInGroup(element.groupId, undoConfirmed));\n\t}\n\n\tprivate _resourceUndo(editStack: ResourceEditStack, element: ResourceStackElement, undoConfirmed: boolean): Promise<void> | void {\n\t\tif (!element.isValid) {\n\t\t\t// invalid element => immediately flush edit stack!\n\t\t\teditStack.flushAllElements();\n\t\t\treturn;\n\t\t}\n\t\tif (editStack.locked) {\n\t\t\tconst message = nls.localize(\n\t\t\t\t{ key: 'cannotResourceUndoDueToInProgressUndoRedo', comment: ['{0} is a label for an operation.'] },\n\t\t\t\t\"Could not undo '{0}' because there is already an undo or redo operation running.\", element.label\n\t\t\t);\n\t\t\tthis._notificationService.warn(message);\n\t\t\treturn;\n\t\t}\n\t\treturn this._invokeResourcePrepare(element, (cleanup) => {\n\t\t\teditStack.moveBackward(element);\n\t\t\treturn this._safeInvokeWithLocks(element, () => element.actual.undo(), new EditStackSnapshot([editStack]), cleanup, () => this._continueUndoInGroup(element.groupId, undoConfirmed));\n\t\t});\n\t}\n\n\tprivate _findClosestUndoElementInGroup(groupId: number): [StackElement | null, string | null] {\n\t\tif (!groupId) {\n\t\t\treturn [null, null];\n\t\t}\n\n\t\t// find another element with the same groupId and with the highest groupOrder ready to be undone\n\t\tlet matchedElement: StackElement | null = null;\n\t\tlet matchedStrResource: string | null = null;\n\n\t\tfor (const [strResource, editStack] of this._editStacks) {\n\t\t\tconst candidate = editStack.getClosestPastElement();\n\t\t\tif (!candidate) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (candidate.groupId === groupId) {\n\t\t\t\tif (!matchedElement || candidate.groupOrder > matchedElement.groupOrder) {\n\t\t\t\t\tmatchedElement = candidate;\n\t\t\t\t\tmatchedStrResource = strResource;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn [matchedElement, matchedStrResource];\n\t}\n\n\tprivate _continueUndoInGroup(groupId: number, undoConfirmed: boolean): Promise<void> | void {\n\t\tif (!groupId) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst [, matchedStrResource] = this._findClosestUndoElementInGroup(groupId);\n\t\tif (matchedStrResource) {\n\t\t\treturn this._undo(matchedStrResource, 0, undoConfirmed);\n\t\t}\n\t}\n\n\tpublic undo(resourceOrSource: URI | UndoRedoSource): Promise<void> | void {\n\t\tif (resourceOrSource instanceof UndoRedoSource) {\n\t\t\tconst [, matchedStrResource] = this._findClosestUndoElementWithSource(resourceOrSource.id);\n\t\t\treturn matchedStrResource ? this._undo(matchedStrResource, resourceOrSource.id, false) : undefined;\n\t\t}\n\t\tif (typeof resourceOrSource === 'string') {\n\t\t\treturn this._undo(resourceOrSource, 0, false);\n\t\t}\n\t\treturn this._undo(this.getUriComparisonKey(resourceOrSource), 0, false);\n\t}\n\n\tprivate _undo(strResource: string, sourceId: number = 0, undoConfirmed: boolean): Promise<void> | void {\n\t\tif (!this._editStacks.has(strResource)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\tconst element = editStack.getClosestPastElement();\n\t\tif (!element) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (element.groupId) {\n\t\t\t// this element is a part of a group, we need to make sure undoing in a group is in order\n\t\t\tconst [matchedElement, matchedStrResource] = this._findClosestUndoElementInGroup(element.groupId);\n\t\t\tif (element !== matchedElement && matchedStrResource) {\n\t\t\t\t// there is an element in the same group that should be undone before this one\n\t\t\t\treturn this._undo(matchedStrResource, sourceId, undoConfirmed);\n\t\t\t}\n\t\t}\n\n\t\tconst shouldPromptForConfirmation = (element.sourceId !== sourceId || element.confirmBeforeUndo);\n\t\tif (shouldPromptForConfirmation && !undoConfirmed) {\n\t\t\t// Hit a different source or the element asks for prompt before undo, prompt for confirmation\n\t\t\treturn this._confirmAndContinueUndo(strResource, sourceId, element);\n\t\t}\n\n\t\ttry {\n\t\t\tif (element.type === UndoRedoElementType.Workspace) {\n\t\t\t\treturn this._workspaceUndo(strResource, element, undoConfirmed);\n\t\t\t} else {\n\t\t\t\treturn this._resourceUndo(editStack, element, undoConfirmed);\n\t\t\t}\n\t\t} finally {\n\t\t\tif (DEBUG) {\n\t\t\t\tthis._print('undo');\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate async _confirmAndContinueUndo(strResource: string, sourceId: number, element: StackElement): Promise<void> {\n\t\tconst result = await this._dialogService.confirm({\n\t\t\tmessage: nls.localize('confirmDifferentSource', \"Would you like to undo '{0}'?\", element.label),\n\t\t\tprimaryButton: nls.localize({ key: 'confirmDifferentSource.yes', comment: ['&& denotes a mnemonic'] }, \"&&Yes\"),\n\t\t\tcancelButton: nls.localize('confirmDifferentSource.no', \"No\")\n\t\t});\n\n\t\tif (!result.confirmed) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn this._undo(strResource, sourceId, true);\n\t}\n\n\tprivate _findClosestRedoElementWithSource(sourceId: number): [StackElement | null, string | null] {\n\t\tif (!sourceId) {\n\t\t\treturn [null, null];\n\t\t}\n\n\t\t// find an element with sourceId and with the lowest sourceOrder ready to be redone\n\t\tlet matchedElement: StackElement | null = null;\n\t\tlet matchedStrResource: string | null = null;\n\n\t\tfor (const [strResource, editStack] of this._editStacks) {\n\t\t\tconst candidate = editStack.getClosestFutureElement();\n\t\t\tif (!candidate) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (candidate.sourceId === sourceId) {\n\t\t\t\tif (!matchedElement || candidate.sourceOrder < matchedElement.sourceOrder) {\n\t\t\t\t\tmatchedElement = candidate;\n\t\t\t\t\tmatchedStrResource = strResource;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn [matchedElement, matchedStrResource];\n\t}\n\n\tpublic canRedo(resourceOrSource: URI | UndoRedoSource): boolean {\n\t\tif (resourceOrSource instanceof UndoRedoSource) {\n\t\t\tconst [, matchedStrResource] = this._findClosestRedoElementWithSource(resourceOrSource.id);\n\t\t\treturn matchedStrResource ? true : false;\n\t\t}\n\t\tconst strResource = this.getUriComparisonKey(resourceOrSource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\treturn editStack.hasFutureElements();\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _tryToSplitAndRedo(strResource: string, element: WorkspaceStackElement, ignoreResources: RemovedResources | null, message: string): WorkspaceVerificationError {\n\t\tif (element.canSplit()) {\n\t\t\tthis._splitFutureWorkspaceElement(element, ignoreResources);\n\t\t\tthis._notificationService.warn(message);\n\t\t\treturn new WorkspaceVerificationError(this._redo(strResource));\n\t\t} else {\n\t\t\t// Cannot safely split this workspace element => flush all undo/redo stacks\n\t\t\tfor (const strResource of element.strResources) {\n\t\t\t\tthis.removeElements(strResource);\n\t\t\t}\n\t\t\tthis._notificationService.warn(message);\n\t\t\treturn new WorkspaceVerificationError();\n\t\t}\n\t}\n\n\tprivate _checkWorkspaceRedo(strResource: string, element: WorkspaceStackElement, editStackSnapshot: EditStackSnapshot, checkInvalidatedResources: boolean): WorkspaceVerificationError | null {\n\t\tif (element.removedResources) {\n\t\t\treturn this._tryToSplitAndRedo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\telement.removedResources,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceRedo', comment: ['{0} is a label for an operation. {1} is another message.'] },\n\t\t\t\t\t\"Could not redo '{0}' across all files. {1}\", element.label, element.removedResources.createMessage()\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tif (checkInvalidatedResources && element.invalidatedResources) {\n\t\t\treturn this._tryToSplitAndRedo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\telement.invalidatedResources,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceRedo', comment: ['{0} is a label for an operation. {1} is another message.'] },\n\t\t\t\t\t\"Could not redo '{0}' across all files. {1}\", element.label, element.invalidatedResources.createMessage()\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// this must be the last future element in all the impacted resources!\n\t\tconst cannotRedoDueToResources: string[] = [];\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\tif (editStack.getClosestFutureElement() !== element) {\n\t\t\t\tcannotRedoDueToResources.push(editStack.resourceLabel);\n\t\t\t}\n\t\t}\n\t\tif (cannotRedoDueToResources.length > 0) {\n\t\t\treturn this._tryToSplitAndRedo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\tnull,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceRedoDueToChanges', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] },\n\t\t\t\t\t\"Could not redo '{0}' across all files because changes were made to {1}\", element.label, cannotRedoDueToResources.join(', ')\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tconst cannotLockDueToResources: string[] = [];\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\tif (editStack.locked) {\n\t\t\t\tcannotLockDueToResources.push(editStack.resourceLabel);\n\t\t\t}\n\t\t}\n\t\tif (cannotLockDueToResources.length > 0) {\n\t\t\treturn this._tryToSplitAndRedo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\tnull,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceRedoDueToInProgressUndoRedo', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] },\n\t\t\t\t\t\"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}\", element.label, cannotLockDueToResources.join(', ')\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// check if new stack elements were added in the meantime...\n\t\tif (!editStackSnapshot.isValid()) {\n\t\t\treturn this._tryToSplitAndRedo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\tnull,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceRedoDueToInMeantimeUndoRedo', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] },\n\t\t\t\t\t\"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime\", element.label\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate _workspaceRedo(strResource: string, element: WorkspaceStackElement): Promise<void> | void {\n\t\tconst affectedEditStacks = this._getAffectedEditStacks(element);\n\t\tconst verificationError = this._checkWorkspaceRedo(strResource, element, affectedEditStacks, /*invalidated resources will be checked after the prepare call*/false);\n\t\tif (verificationError) {\n\t\t\treturn verificationError.returnValue;\n\t\t}\n\t\treturn this._executeWorkspaceRedo(strResource, element, affectedEditStacks);\n\t}\n\n\tprivate async _executeWorkspaceRedo(strResource: string, element: WorkspaceStackElement, editStackSnapshot: EditStackSnapshot): Promise<void> {\n\t\t// prepare\n\t\tlet cleanup: IDisposable;\n\t\ttry {\n\t\t\tcleanup = await this._invokeWorkspacePrepare(element);\n\t\t} catch (err) {\n\t\t\treturn this._onError(err, element);\n\t\t}\n\n\t\t// At this point, it is possible that the element has been made invalid in the meantime (due to the prepare await)\n\t\tconst verificationError = this._checkWorkspaceRedo(strResource, element, editStackSnapshot, /*now also check that there are no more invalidated resources*/true);\n\t\tif (verificationError) {\n\t\t\tcleanup.dispose();\n\t\t\treturn verificationError.returnValue;\n\t\t}\n\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\teditStack.moveForward(element);\n\t\t}\n\t\treturn this._safeInvokeWithLocks(element, () => element.actual.redo(), editStackSnapshot, cleanup, () => this._continueRedoInGroup(element.groupId));\n\t}\n\n\tprivate _resourceRedo(editStack: ResourceEditStack, element: ResourceStackElement): Promise<void> | void {\n\t\tif (!element.isValid) {\n\t\t\t// invalid element => immediately flush edit stack!\n\t\t\teditStack.flushAllElements();\n\t\t\treturn;\n\t\t}\n\t\tif (editStack.locked) {\n\t\t\tconst message = nls.localize(\n\t\t\t\t{ key: 'cannotResourceRedoDueToInProgressUndoRedo', comment: ['{0} is a label for an operation.'] },\n\t\t\t\t\"Could not redo '{0}' because there is already an undo or redo operation running.\", element.label\n\t\t\t);\n\t\t\tthis._notificationService.warn(message);\n\t\t\treturn;\n\t\t}\n\n\t\treturn this._invokeResourcePrepare(element, (cleanup) => {\n\t\t\teditStack.moveForward(element);\n\t\t\treturn this._safeInvokeWithLocks(element, () => element.actual.redo(), new EditStackSnapshot([editStack]), cleanup, () => this._continueRedoInGroup(element.groupId));\n\t\t});\n\t}\n\n\tprivate _findClosestRedoElementInGroup(groupId: number): [StackElement | null, string | null] {\n\t\tif (!groupId) {\n\t\t\treturn [null, null];\n\t\t}\n\n\t\t// find another element with the same groupId and with the lowest groupOrder ready to be redone\n\t\tlet matchedElement: StackElement | null = null;\n\t\tlet matchedStrResource: string | null = null;\n\n\t\tfor (const [strResource, editStack] of this._editStacks) {\n\t\t\tconst candidate = editStack.getClosestFutureElement();\n\t\t\tif (!candidate) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (candidate.groupId === groupId) {\n\t\t\t\tif (!matchedElement || candidate.groupOrder < matchedElement.groupOrder) {\n\t\t\t\t\tmatchedElement = candidate;\n\t\t\t\t\tmatchedStrResource = strResource;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn [matchedElement, matchedStrResource];\n\t}\n\n\tprivate _continueRedoInGroup(groupId: number): Promise<void> | void {\n\t\tif (!groupId) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst [, matchedStrResource] = this._findClosestRedoElementInGroup(groupId);\n\t\tif (matchedStrResource) {\n\t\t\treturn this._redo(matchedStrResource);\n\t\t}\n\t}\n\n\tpublic redo(resourceOrSource: URI | UndoRedoSource | string): Promise<void> | void {\n\t\tif (resourceOrSource instanceof UndoRedoSource) {\n\t\t\tconst [, matchedStrResource] = this._findClosestRedoElementWithSource(resourceOrSource.id);\n\t\t\treturn matchedStrResource ? this._redo(matchedStrResource) : undefined;\n\t\t}\n\t\tif (typeof resourceOrSource === 'string') {\n\t\t\treturn this._redo(resourceOrSource);\n\t\t}\n\t\treturn this._redo(this.getUriComparisonKey(resourceOrSource));\n\t}\n\n\tprivate _redo(strResource: string): Promise<void> | void {\n\t\tif (!this._editStacks.has(strResource)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\tconst element = editStack.getClosestFutureElement();\n\t\tif (!element) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (element.groupId) {\n\t\t\t// this element is a part of a group, we need to make sure redoing in a group is in order\n\t\t\tconst [matchedElement, matchedStrResource] = this._findClosestRedoElementInGroup(element.groupId);\n\t\t\tif (element !== matchedElement && matchedStrResource) {\n\t\t\t\t// there is an element in the same group that should be redone before this one\n\t\t\t\treturn this._redo(matchedStrResource);\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tif (element.type === UndoRedoElementType.Workspace) {\n\t\t\t\treturn this._workspaceRedo(strResource, element);\n\t\t\t} else {\n\t\t\t\treturn this._resourceRedo(editStack, element);\n\t\t\t}\n\t\t} finally {\n\t\t\tif (DEBUG) {\n\t\t\t\tthis._print('redo');\n\t\t\t}\n\t\t}\n\t}\n}\n\nclass WorkspaceVerificationError {\n\tconstructor(public readonly returnValue: Promise<void> | void) { }\n}\n\nregisterSingleton(IUndoRedoService, UndoRedoService, InstantiationType.Delayed);\n"]}
1
+ {"version":3,"sources":["vs/platform/undoRedo/common/undoRedoService.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAe,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,QAAQ,MAAM,kCAAkC,CAAC;AAExD,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAqB,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAmE,gBAAgB,EAA6B,yBAAyB,EAAuB,aAAa,EAAE,cAAc,EAA4B,MAAM,eAAe,CAAC;AAEtP,MAAM,KAAK,GAAG,KAAK,CAAC;AAEpB,SAAS,gBAAgB,CAAC,QAAa;IACtC,OAAO,QAAQ,CAAC,MAAM,KAAK,OA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AED,iBAAiB,CAAC,gBAAgB,EAAE,eAAe,oCAA4B,CAAC","file":"undoRedoService.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 { onUnexpectedError } from '../../../base/common/errors.js';\nimport { Disposable, IDisposable, isDisposable } from '../../../base/common/lifecycle.js';\nimport { Schemas } from '../../../base/common/network.js';\nimport Severity from '../../../base/common/severity.js';\nimport { URI } from '../../../base/common/uri.js';\nimport * as nls from '../../../nls.js';\nimport { IDialogService } from '../../dialogs/common/dialogs.js';\nimport { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js';\nimport { INotificationService } from '../../notification/common/notification.js';\nimport { IPastFutureElements, IResourceUndoRedoElement, IUndoRedoElement, IUndoRedoService, IWorkspaceUndoRedoElement, ResourceEditStackSnapshot, UndoRedoElementType, UndoRedoGroup, UndoRedoSource, UriComparisonKeyComputer } from './undoRedo.js';\n\nconst DEBUG = false;\n\nfunction getResourceLabel(resource: URI): string {\n\treturn resource.scheme === Schemas.file ? resource.fsPath : resource.path;\n}\n\nlet stackElementCounter = 0;\n\nclass ResourceStackElement {\n\tpublic readonly id = (++stackElementCounter);\n\tpublic readonly type = UndoRedoElementType.Resource;\n\tpublic readonly actual: IUndoRedoElement;\n\tpublic readonly label: string;\n\tpublic readonly confirmBeforeUndo: boolean;\n\n\tpublic readonly resourceLabel: string;\n\tpublic readonly strResource: string;\n\tpublic readonly resourceLabels: string[];\n\tpublic readonly strResources: string[];\n\tpublic readonly groupId: number;\n\tpublic readonly groupOrder: number;\n\tpublic readonly sourceId: number;\n\tpublic readonly sourceOrder: number;\n\tpublic isValid: boolean;\n\n\tconstructor(actual: IUndoRedoElement, resourceLabel: string, strResource: string, groupId: number, groupOrder: number, sourceId: number, sourceOrder: number) {\n\t\tthis.actual = actual;\n\t\tthis.label = actual.label;\n\t\tthis.confirmBeforeUndo = actual.confirmBeforeUndo || false;\n\t\tthis.resourceLabel = resourceLabel;\n\t\tthis.strResource = strResource;\n\t\tthis.resourceLabels = [this.resourceLabel];\n\t\tthis.strResources = [this.strResource];\n\t\tthis.groupId = groupId;\n\t\tthis.groupOrder = groupOrder;\n\t\tthis.sourceId = sourceId;\n\t\tthis.sourceOrder = sourceOrder;\n\t\tthis.isValid = true;\n\t}\n\n\tpublic setValid(isValid: boolean): void {\n\t\tthis.isValid = isValid;\n\t}\n\n\tpublic toString(): string {\n\t\treturn `[id:${this.id}] [group:${this.groupId}] [${this.isValid ? ' VALID' : 'INVALID'}] ${this.actual.constructor.name} - ${this.actual}`;\n\t}\n}\n\nconst enum RemovedResourceReason {\n\tExternalRemoval = 0,\n\tNoParallelUniverses = 1\n}\n\nclass ResourceReasonPair {\n\tconstructor(\n\t\tpublic readonly resourceLabel: string,\n\t\tpublic readonly reason: RemovedResourceReason\n\t) { }\n}\n\nclass RemovedResources {\n\tprivate readonly elements = new Map<string, ResourceReasonPair>();\n\n\tpublic createMessage(): string {\n\t\tconst externalRemoval: string[] = [];\n\t\tconst noParallelUniverses: string[] = [];\n\t\tfor (const [, element] of this.elements) {\n\t\t\tconst dest = (\n\t\t\t\telement.reason === RemovedResourceReason.ExternalRemoval\n\t\t\t\t\t? externalRemoval\n\t\t\t\t\t: noParallelUniverses\n\t\t\t);\n\t\t\tdest.push(element.resourceLabel);\n\t\t}\n\n\t\tconst messages: string[] = [];\n\t\tif (externalRemoval.length > 0) {\n\t\t\tmessages.push(\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'externalRemoval', comment: ['{0} is a list of filenames'] },\n\t\t\t\t\t\"The following files have been closed and modified on disk: {0}.\", externalRemoval.join(', ')\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tif (noParallelUniverses.length > 0) {\n\t\t\tmessages.push(\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'noParallelUniverses', comment: ['{0} is a list of filenames'] },\n\t\t\t\t\t\"The following files have been modified in an incompatible way: {0}.\", noParallelUniverses.join(', ')\n\t\t\t\t));\n\t\t}\n\t\treturn messages.join('\\n');\n\t}\n\n\tpublic get size(): number {\n\t\treturn this.elements.size;\n\t}\n\n\tpublic has(strResource: string): boolean {\n\t\treturn this.elements.has(strResource);\n\t}\n\n\tpublic set(strResource: string, value: ResourceReasonPair): void {\n\t\tthis.elements.set(strResource, value);\n\t}\n\n\tpublic delete(strResource: string): boolean {\n\t\treturn this.elements.delete(strResource);\n\t}\n}\n\nclass WorkspaceStackElement {\n\tpublic readonly id = (++stackElementCounter);\n\tpublic readonly type = UndoRedoElementType.Workspace;\n\tpublic readonly actual: IWorkspaceUndoRedoElement;\n\tpublic readonly label: string;\n\tpublic readonly confirmBeforeUndo: boolean;\n\n\tpublic readonly resourceLabels: string[];\n\tpublic readonly strResources: string[];\n\tpublic readonly groupId: number;\n\tpublic readonly groupOrder: number;\n\tpublic readonly sourceId: number;\n\tpublic readonly sourceOrder: number;\n\tpublic removedResources: RemovedResources | null;\n\tpublic invalidatedResources: RemovedResources | null;\n\n\tconstructor(actual: IWorkspaceUndoRedoElement, resourceLabels: string[], strResources: string[], groupId: number, groupOrder: number, sourceId: number, sourceOrder: number) {\n\t\tthis.actual = actual;\n\t\tthis.label = actual.label;\n\t\tthis.confirmBeforeUndo = actual.confirmBeforeUndo || false;\n\t\tthis.resourceLabels = resourceLabels;\n\t\tthis.strResources = strResources;\n\t\tthis.groupId = groupId;\n\t\tthis.groupOrder = groupOrder;\n\t\tthis.sourceId = sourceId;\n\t\tthis.sourceOrder = sourceOrder;\n\t\tthis.removedResources = null;\n\t\tthis.invalidatedResources = null;\n\t}\n\n\tpublic canSplit(): this is WorkspaceStackElement & { actual: { split(): IResourceUndoRedoElement[] } } {\n\t\treturn (typeof this.actual.split === 'function');\n\t}\n\n\tpublic removeResource(resourceLabel: string, strResource: string, reason: RemovedResourceReason): void {\n\t\tif (!this.removedResources) {\n\t\t\tthis.removedResources = new RemovedResources();\n\t\t}\n\t\tif (!this.removedResources.has(strResource)) {\n\t\t\tthis.removedResources.set(strResource, new ResourceReasonPair(resourceLabel, reason));\n\t\t}\n\t}\n\n\tpublic setValid(resourceLabel: string, strResource: string, isValid: boolean): void {\n\t\tif (isValid) {\n\t\t\tif (this.invalidatedResources) {\n\t\t\t\tthis.invalidatedResources.delete(strResource);\n\t\t\t\tif (this.invalidatedResources.size === 0) {\n\t\t\t\t\tthis.invalidatedResources = null;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (!this.invalidatedResources) {\n\t\t\t\tthis.invalidatedResources = new RemovedResources();\n\t\t\t}\n\t\t\tif (!this.invalidatedResources.has(strResource)) {\n\t\t\t\tthis.invalidatedResources.set(strResource, new ResourceReasonPair(resourceLabel, RemovedResourceReason.ExternalRemoval));\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic toString(): string {\n\t\treturn `[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources ? 'INVALID' : ' VALID'}] ${this.actual.constructor.name} - ${this.actual}`;\n\t}\n}\n\ntype StackElement = ResourceStackElement | WorkspaceStackElement;\n\nclass ResourceEditStack {\n\tpublic readonly resourceLabel: string;\n\tprivate readonly strResource: string;\n\tprivate _past: StackElement[];\n\tprivate _future: StackElement[];\n\tpublic locked: boolean;\n\tpublic versionId: number;\n\n\tconstructor(resourceLabel: string, strResource: string) {\n\t\tthis.resourceLabel = resourceLabel;\n\t\tthis.strResource = strResource;\n\t\tthis._past = [];\n\t\tthis._future = [];\n\t\tthis.locked = false;\n\t\tthis.versionId = 1;\n\t}\n\n\tpublic dispose(): void {\n\t\tfor (const element of this._past) {\n\t\t\tif (element.type === UndoRedoElementType.Workspace) {\n\t\t\t\telement.removeResource(this.resourceLabel, this.strResource, RemovedResourceReason.ExternalRemoval);\n\t\t\t}\n\t\t}\n\t\tfor (const element of this._future) {\n\t\t\tif (element.type === UndoRedoElementType.Workspace) {\n\t\t\t\telement.removeResource(this.resourceLabel, this.strResource, RemovedResourceReason.ExternalRemoval);\n\t\t\t}\n\t\t}\n\t\tthis.versionId++;\n\t}\n\n\tpublic toString(): string {\n\t\tconst result: string[] = [];\n\t\tresult.push(`* ${this.strResource}:`);\n\t\tfor (let i = 0; i < this._past.length; i++) {\n\t\t\tresult.push(` * [UNDO] ${this._past[i]}`);\n\t\t}\n\t\tfor (let i = this._future.length - 1; i >= 0; i--) {\n\t\t\tresult.push(` * [REDO] ${this._future[i]}`);\n\t\t}\n\t\treturn result.join('\\n');\n\t}\n\n\tpublic flushAllElements(): void {\n\t\tthis._past = [];\n\t\tthis._future = [];\n\t\tthis.versionId++;\n\t}\n\n\tprivate _setElementValidFlag(element: StackElement, isValid: boolean): void {\n\t\tif (element.type === UndoRedoElementType.Workspace) {\n\t\t\telement.setValid(this.resourceLabel, this.strResource, isValid);\n\t\t} else {\n\t\t\telement.setValid(isValid);\n\t\t}\n\t}\n\n\tpublic setElementsValidFlag(isValid: boolean, filter: (element: IUndoRedoElement) => boolean): void {\n\t\tfor (const element of this._past) {\n\t\t\tif (filter(element.actual)) {\n\t\t\t\tthis._setElementValidFlag(element, isValid);\n\t\t\t}\n\t\t}\n\t\tfor (const element of this._future) {\n\t\t\tif (filter(element.actual)) {\n\t\t\t\tthis._setElementValidFlag(element, isValid);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic pushElement(element: StackElement): void {\n\t\t// remove the future\n\t\tfor (const futureElement of this._future) {\n\t\t\tif (futureElement.type === UndoRedoElementType.Workspace) {\n\t\t\t\tfutureElement.removeResource(this.resourceLabel, this.strResource, RemovedResourceReason.NoParallelUniverses);\n\t\t\t}\n\t\t}\n\t\tthis._future = [];\n\t\tthis._past.push(element);\n\t\tthis.versionId++;\n\t}\n\n\tpublic createSnapshot(resource: URI): ResourceEditStackSnapshot {\n\t\tconst elements: number[] = [];\n\n\t\tfor (let i = 0, len = this._past.length; i < len; i++) {\n\t\t\telements.push(this._past[i].id);\n\t\t}\n\t\tfor (let i = this._future.length - 1; i >= 0; i--) {\n\t\t\telements.push(this._future[i].id);\n\t\t}\n\n\t\treturn new ResourceEditStackSnapshot(resource, elements);\n\t}\n\n\tpublic restoreSnapshot(snapshot: ResourceEditStackSnapshot): void {\n\t\tconst snapshotLength = snapshot.elements.length;\n\t\tlet isOK = true;\n\t\tlet snapshotIndex = 0;\n\t\tlet removePastAfter = -1;\n\t\tfor (let i = 0, len = this._past.length; i < len; i++, snapshotIndex++) {\n\t\t\tconst element = this._past[i];\n\t\t\tif (isOK && (snapshotIndex >= snapshotLength || element.id !== snapshot.elements[snapshotIndex])) {\n\t\t\t\tisOK = false;\n\t\t\t\tremovePastAfter = i;\n\t\t\t}\n\t\t\tif (!isOK && element.type === UndoRedoElementType.Workspace) {\n\t\t\t\telement.removeResource(this.resourceLabel, this.strResource, RemovedResourceReason.ExternalRemoval);\n\t\t\t}\n\t\t}\n\t\tlet removeFutureBefore = -1;\n\t\tfor (let i = this._future.length - 1; i >= 0; i--, snapshotIndex++) {\n\t\t\tconst element = this._future[i];\n\t\t\tif (isOK && (snapshotIndex >= snapshotLength || element.id !== snapshot.elements[snapshotIndex])) {\n\t\t\t\tisOK = false;\n\t\t\t\tremoveFutureBefore = i;\n\t\t\t}\n\t\t\tif (!isOK && element.type === UndoRedoElementType.Workspace) {\n\t\t\t\telement.removeResource(this.resourceLabel, this.strResource, RemovedResourceReason.ExternalRemoval);\n\t\t\t}\n\t\t}\n\t\tif (removePastAfter !== -1) {\n\t\t\tthis._past = this._past.slice(0, removePastAfter);\n\t\t}\n\t\tif (removeFutureBefore !== -1) {\n\t\t\tthis._future = this._future.slice(removeFutureBefore + 1);\n\t\t}\n\t\tthis.versionId++;\n\t}\n\n\tpublic getElements(): IPastFutureElements {\n\t\tconst past: IUndoRedoElement[] = [];\n\t\tconst future: IUndoRedoElement[] = [];\n\n\t\tfor (const element of this._past) {\n\t\t\tpast.push(element.actual);\n\t\t}\n\t\tfor (const element of this._future) {\n\t\t\tfuture.push(element.actual);\n\t\t}\n\n\t\treturn { past, future };\n\t}\n\n\tpublic getClosestPastElement(): StackElement | null {\n\t\tif (this._past.length === 0) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._past[this._past.length - 1];\n\t}\n\n\tpublic getSecondClosestPastElement(): StackElement | null {\n\t\tif (this._past.length < 2) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._past[this._past.length - 2];\n\t}\n\n\tpublic getClosestFutureElement(): StackElement | null {\n\t\tif (this._future.length === 0) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this._future[this._future.length - 1];\n\t}\n\n\tpublic hasPastElements(): boolean {\n\t\treturn (this._past.length > 0);\n\t}\n\n\tpublic hasFutureElements(): boolean {\n\t\treturn (this._future.length > 0);\n\t}\n\n\tpublic splitPastWorkspaceElement(toRemove: WorkspaceStackElement, individualMap: Map<string, ResourceStackElement>): void {\n\t\tfor (let j = this._past.length - 1; j >= 0; j--) {\n\t\t\tif (this._past[j] === toRemove) {\n\t\t\t\tif (individualMap.has(this.strResource)) {\n\t\t\t\t\t// gets replaced\n\t\t\t\t\tthis._past[j] = individualMap.get(this.strResource)!;\n\t\t\t\t} else {\n\t\t\t\t\t// gets deleted\n\t\t\t\t\tthis._past.splice(j, 1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis.versionId++;\n\t}\n\n\tpublic splitFutureWorkspaceElement(toRemove: WorkspaceStackElement, individualMap: Map<string, ResourceStackElement>): void {\n\t\tfor (let j = this._future.length - 1; j >= 0; j--) {\n\t\t\tif (this._future[j] === toRemove) {\n\t\t\t\tif (individualMap.has(this.strResource)) {\n\t\t\t\t\t// gets replaced\n\t\t\t\t\tthis._future[j] = individualMap.get(this.strResource)!;\n\t\t\t\t} else {\n\t\t\t\t\t// gets deleted\n\t\t\t\t\tthis._future.splice(j, 1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis.versionId++;\n\t}\n\n\tpublic moveBackward(element: StackElement): void {\n\t\tthis._past.pop();\n\t\tthis._future.push(element);\n\t\tthis.versionId++;\n\t}\n\n\tpublic moveForward(element: StackElement): void {\n\t\tthis._future.pop();\n\t\tthis._past.push(element);\n\t\tthis.versionId++;\n\t}\n}\n\nclass EditStackSnapshot {\n\n\tpublic readonly editStacks: ResourceEditStack[];\n\tprivate readonly _versionIds: number[];\n\n\tconstructor(editStacks: ResourceEditStack[]) {\n\t\tthis.editStacks = editStacks;\n\t\tthis._versionIds = [];\n\t\tfor (let i = 0, len = this.editStacks.length; i < len; i++) {\n\t\t\tthis._versionIds[i] = this.editStacks[i].versionId;\n\t\t}\n\t}\n\n\tpublic isValid(): boolean {\n\t\tfor (let i = 0, len = this.editStacks.length; i < len; i++) {\n\t\t\tif (this._versionIds[i] !== this.editStacks[i].versionId) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n}\n\nconst missingEditStack = new ResourceEditStack('', '');\nmissingEditStack.locked = true;\n\nexport class UndoRedoService implements IUndoRedoService {\n\tdeclare readonly _serviceBrand: undefined;\n\n\tprivate readonly _editStacks: Map<string, ResourceEditStack>;\n\tprivate readonly _uriComparisonKeyComputers: [string, UriComparisonKeyComputer][];\n\n\tconstructor(\n\t\t@IDialogService private readonly _dialogService: IDialogService,\n\t\t@INotificationService private readonly _notificationService: INotificationService,\n\t) {\n\t\tthis._editStacks = new Map<string, ResourceEditStack>();\n\t\tthis._uriComparisonKeyComputers = [];\n\t}\n\n\tpublic getUriComparisonKey(resource: URI): string {\n\t\tfor (const uriComparisonKeyComputer of this._uriComparisonKeyComputers) {\n\t\t\tif (uriComparisonKeyComputer[0] === resource.scheme) {\n\t\t\t\treturn uriComparisonKeyComputer[1].getComparisonKey(resource);\n\t\t\t}\n\t\t}\n\t\treturn resource.toString();\n\t}\n\n\tprivate _print(label: string): void {\n\t\tconsole.log(`------------------------------------`);\n\t\tconsole.log(`AFTER ${label}: `);\n\t\tconst str: string[] = [];\n\t\tfor (const element of this._editStacks) {\n\t\t\tstr.push(element[1].toString());\n\t\t}\n\t\tconsole.log(str.join('\\n'));\n\t}\n\n\tpublic pushElement(element: IUndoRedoElement, group: UndoRedoGroup = UndoRedoGroup.None, source: UndoRedoSource = UndoRedoSource.None): void {\n\t\tif (element.type === UndoRedoElementType.Resource) {\n\t\t\tconst resourceLabel = getResourceLabel(element.resource);\n\t\t\tconst strResource = this.getUriComparisonKey(element.resource);\n\t\t\tthis._pushElement(new ResourceStackElement(element, resourceLabel, strResource, group.id, group.nextOrder(), source.id, source.nextOrder()));\n\t\t} else {\n\t\t\tconst seen = new Set<string>();\n\t\t\tconst resourceLabels: string[] = [];\n\t\t\tconst strResources: string[] = [];\n\t\t\tfor (const resource of element.resources) {\n\t\t\t\tconst resourceLabel = getResourceLabel(resource);\n\t\t\t\tconst strResource = this.getUriComparisonKey(resource);\n\n\t\t\t\tif (seen.has(strResource)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tseen.add(strResource);\n\t\t\t\tresourceLabels.push(resourceLabel);\n\t\t\t\tstrResources.push(strResource);\n\t\t\t}\n\n\t\t\tif (resourceLabels.length === 1) {\n\t\t\t\tthis._pushElement(new ResourceStackElement(element, resourceLabels[0], strResources[0], group.id, group.nextOrder(), source.id, source.nextOrder()));\n\t\t\t} else {\n\t\t\t\tthis._pushElement(new WorkspaceStackElement(element, resourceLabels, strResources, group.id, group.nextOrder(), source.id, source.nextOrder()));\n\t\t\t}\n\t\t}\n\t\tif (DEBUG) {\n\t\t\tthis._print('pushElement');\n\t\t}\n\t}\n\n\tprivate _pushElement(element: StackElement): void {\n\t\tfor (let i = 0, len = element.strResources.length; i < len; i++) {\n\t\t\tconst resourceLabel = element.resourceLabels[i];\n\t\t\tconst strResource = element.strResources[i];\n\n\t\t\tlet editStack: ResourceEditStack;\n\t\t\tif (this._editStacks.has(strResource)) {\n\t\t\t\teditStack = this._editStacks.get(strResource)!;\n\t\t\t} else {\n\t\t\t\teditStack = new ResourceEditStack(resourceLabel, strResource);\n\t\t\t\tthis._editStacks.set(strResource, editStack);\n\t\t\t}\n\n\t\t\teditStack.pushElement(element);\n\t\t}\n\t}\n\n\tpublic getLastElement(resource: URI): IUndoRedoElement | null {\n\t\tconst strResource = this.getUriComparisonKey(resource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\tif (editStack.hasFutureElements()) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst closestPastElement = editStack.getClosestPastElement();\n\t\t\treturn closestPastElement ? closestPastElement.actual : null;\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate _splitPastWorkspaceElement(toRemove: WorkspaceStackElement & { actual: { split(): IResourceUndoRedoElement[] } }, ignoreResources: RemovedResources | null): void {\n\t\tconst individualArr = toRemove.actual.split();\n\t\tconst individualMap = new Map<string, ResourceStackElement>();\n\t\tfor (const _element of individualArr) {\n\t\t\tconst resourceLabel = getResourceLabel(_element.resource);\n\t\t\tconst strResource = this.getUriComparisonKey(_element.resource);\n\t\t\tconst element = new ResourceStackElement(_element, resourceLabel, strResource, 0, 0, 0, 0);\n\t\t\tindividualMap.set(element.strResource, element);\n\t\t}\n\n\t\tfor (const strResource of toRemove.strResources) {\n\t\t\tif (ignoreResources && ignoreResources.has(strResource)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\teditStack.splitPastWorkspaceElement(toRemove, individualMap);\n\t\t}\n\t}\n\n\tprivate _splitFutureWorkspaceElement(toRemove: WorkspaceStackElement & { actual: { split(): IResourceUndoRedoElement[] } }, ignoreResources: RemovedResources | null): void {\n\t\tconst individualArr = toRemove.actual.split();\n\t\tconst individualMap = new Map<string, ResourceStackElement>();\n\t\tfor (const _element of individualArr) {\n\t\t\tconst resourceLabel = getResourceLabel(_element.resource);\n\t\t\tconst strResource = this.getUriComparisonKey(_element.resource);\n\t\t\tconst element = new ResourceStackElement(_element, resourceLabel, strResource, 0, 0, 0, 0);\n\t\t\tindividualMap.set(element.strResource, element);\n\t\t}\n\n\t\tfor (const strResource of toRemove.strResources) {\n\t\t\tif (ignoreResources && ignoreResources.has(strResource)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\teditStack.splitFutureWorkspaceElement(toRemove, individualMap);\n\t\t}\n\t}\n\n\tpublic removeElements(resource: URI | string): void {\n\t\tconst strResource = typeof resource === 'string' ? resource : this.getUriComparisonKey(resource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\teditStack.dispose();\n\t\t\tthis._editStacks.delete(strResource);\n\t\t}\n\t\tif (DEBUG) {\n\t\t\tthis._print('removeElements');\n\t\t}\n\t}\n\n\tpublic setElementsValidFlag(resource: URI, isValid: boolean, filter: (element: IUndoRedoElement) => boolean): void {\n\t\tconst strResource = this.getUriComparisonKey(resource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\teditStack.setElementsValidFlag(isValid, filter);\n\t\t}\n\t\tif (DEBUG) {\n\t\t\tthis._print('setElementsValidFlag');\n\t\t}\n\t}\n\n\tpublic createSnapshot(resource: URI): ResourceEditStackSnapshot {\n\t\tconst strResource = this.getUriComparisonKey(resource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\treturn editStack.createSnapshot(resource);\n\t\t}\n\t\treturn new ResourceEditStackSnapshot(resource, []);\n\t}\n\n\tpublic restoreSnapshot(snapshot: ResourceEditStackSnapshot): void {\n\t\tconst strResource = this.getUriComparisonKey(snapshot.resource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\teditStack.restoreSnapshot(snapshot);\n\n\t\t\tif (!editStack.hasPastElements() && !editStack.hasFutureElements()) {\n\t\t\t\t// the edit stack is now empty, just remove it entirely\n\t\t\t\teditStack.dispose();\n\t\t\t\tthis._editStacks.delete(strResource);\n\t\t\t}\n\t\t}\n\t\tif (DEBUG) {\n\t\t\tthis._print('restoreSnapshot');\n\t\t}\n\t}\n\n\tpublic getElements(resource: URI): IPastFutureElements {\n\t\tconst strResource = this.getUriComparisonKey(resource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\treturn editStack.getElements();\n\t\t}\n\t\treturn { past: [], future: [] };\n\t}\n\n\tprivate _findClosestUndoElementWithSource(sourceId: number): [StackElement | null, string | null] {\n\t\tif (!sourceId) {\n\t\t\treturn [null, null];\n\t\t}\n\n\t\t// find an element with the sourceId and with the highest sourceOrder ready to be undone\n\t\tlet matchedElement: StackElement | null = null;\n\t\tlet matchedStrResource: string | null = null;\n\n\t\tfor (const [strResource, editStack] of this._editStacks) {\n\t\t\tconst candidate = editStack.getClosestPastElement();\n\t\t\tif (!candidate) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (candidate.sourceId === sourceId) {\n\t\t\t\tif (!matchedElement || candidate.sourceOrder > matchedElement.sourceOrder) {\n\t\t\t\t\tmatchedElement = candidate;\n\t\t\t\t\tmatchedStrResource = strResource;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn [matchedElement, matchedStrResource];\n\t}\n\n\tpublic canUndo(resourceOrSource: URI | UndoRedoSource): boolean {\n\t\tif (resourceOrSource instanceof UndoRedoSource) {\n\t\t\tconst [, matchedStrResource] = this._findClosestUndoElementWithSource(resourceOrSource.id);\n\t\t\treturn matchedStrResource ? true : false;\n\t\t}\n\t\tconst strResource = this.getUriComparisonKey(resourceOrSource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\treturn editStack.hasPastElements();\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _onError(err: Error, element: StackElement): void {\n\t\tonUnexpectedError(err);\n\t\t// An error occurred while undoing or redoing => drop the undo/redo stack for all affected resources\n\t\tfor (const strResource of element.strResources) {\n\t\t\tthis.removeElements(strResource);\n\t\t}\n\t\tthis._notificationService.error(err);\n\t}\n\n\tprivate _acquireLocks(editStackSnapshot: EditStackSnapshot): () => void {\n\t\t// first, check if all locks can be acquired\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\tif (editStack.locked) {\n\t\t\t\tthrow new Error('Cannot acquire edit stack lock');\n\t\t\t}\n\t\t}\n\n\t\t// can acquire all locks\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\teditStack.locked = true;\n\t\t}\n\n\t\treturn () => {\n\t\t\t// release all locks\n\t\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\t\teditStack.locked = false;\n\t\t\t}\n\t\t};\n\t}\n\n\tprivate _safeInvokeWithLocks(element: StackElement, invoke: () => Promise<void> | void, editStackSnapshot: EditStackSnapshot, cleanup: IDisposable, continuation: () => Promise<void> | void): Promise<void> | void {\n\t\tconst releaseLocks = this._acquireLocks(editStackSnapshot);\n\n\t\tlet result: Promise<void> | void;\n\t\ttry {\n\t\t\tresult = invoke();\n\t\t} catch (err) {\n\t\t\treleaseLocks();\n\t\t\tcleanup.dispose();\n\t\t\treturn this._onError(err, element);\n\t\t}\n\n\t\tif (result) {\n\t\t\t// result is Promise<void>\n\t\t\treturn result.then(\n\t\t\t\t() => {\n\t\t\t\t\treleaseLocks();\n\t\t\t\t\tcleanup.dispose();\n\t\t\t\t\treturn continuation();\n\t\t\t\t},\n\t\t\t\t(err) => {\n\t\t\t\t\treleaseLocks();\n\t\t\t\t\tcleanup.dispose();\n\t\t\t\t\treturn this._onError(err, element);\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\t// result is void\n\t\t\treleaseLocks();\n\t\t\tcleanup.dispose();\n\t\t\treturn continuation();\n\t\t}\n\t}\n\n\tprivate async _invokeWorkspacePrepare(element: WorkspaceStackElement): Promise<IDisposable> {\n\t\tif (typeof element.actual.prepareUndoRedo === 'undefined') {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\tconst result = element.actual.prepareUndoRedo();\n\t\tif (typeof result === 'undefined') {\n\t\t\treturn Disposable.None;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate _invokeResourcePrepare(element: ResourceStackElement, callback: (disposable: IDisposable) => Promise<void> | void): void | Promise<void> {\n\t\tif (element.actual.type !== UndoRedoElementType.Workspace || typeof element.actual.prepareUndoRedo === 'undefined') {\n\t\t\t// no preparation needed\n\t\t\treturn callback(Disposable.None);\n\t\t}\n\n\t\tconst r = element.actual.prepareUndoRedo();\n\t\tif (!r) {\n\t\t\t// nothing to clean up\n\t\t\treturn callback(Disposable.None);\n\t\t}\n\n\t\tif (isDisposable(r)) {\n\t\t\treturn callback(r);\n\t\t}\n\n\t\treturn r.then((disposable) => {\n\t\t\treturn callback(disposable);\n\t\t});\n\t}\n\n\tprivate _getAffectedEditStacks(element: WorkspaceStackElement): EditStackSnapshot {\n\t\tconst affectedEditStacks: ResourceEditStack[] = [];\n\t\tfor (const strResource of element.strResources) {\n\t\t\taffectedEditStacks.push(this._editStacks.get(strResource) || missingEditStack);\n\t\t}\n\t\treturn new EditStackSnapshot(affectedEditStacks);\n\t}\n\n\tprivate _tryToSplitAndUndo(strResource: string, element: WorkspaceStackElement, ignoreResources: RemovedResources | null, message: string): WorkspaceVerificationError {\n\t\tif (element.canSplit()) {\n\t\t\tthis._splitPastWorkspaceElement(element, ignoreResources);\n\t\t\tthis._notificationService.warn(message);\n\t\t\treturn new WorkspaceVerificationError(this._undo(strResource, 0, true));\n\t\t} else {\n\t\t\t// Cannot safely split this workspace element => flush all undo/redo stacks\n\t\t\tfor (const strResource of element.strResources) {\n\t\t\t\tthis.removeElements(strResource);\n\t\t\t}\n\t\t\tthis._notificationService.warn(message);\n\t\t\treturn new WorkspaceVerificationError();\n\t\t}\n\t}\n\n\tprivate _checkWorkspaceUndo(strResource: string, element: WorkspaceStackElement, editStackSnapshot: EditStackSnapshot, checkInvalidatedResources: boolean): WorkspaceVerificationError | null {\n\t\tif (element.removedResources) {\n\t\t\treturn this._tryToSplitAndUndo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\telement.removedResources,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceUndo', comment: ['{0} is a label for an operation. {1} is another message.'] },\n\t\t\t\t\t\"Could not undo '{0}' across all files. {1}\", element.label, element.removedResources.createMessage()\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tif (checkInvalidatedResources && element.invalidatedResources) {\n\t\t\treturn this._tryToSplitAndUndo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\telement.invalidatedResources,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceUndo', comment: ['{0} is a label for an operation. {1} is another message.'] },\n\t\t\t\t\t\"Could not undo '{0}' across all files. {1}\", element.label, element.invalidatedResources.createMessage()\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// this must be the last past element in all the impacted resources!\n\t\tconst cannotUndoDueToResources: string[] = [];\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\tif (editStack.getClosestPastElement() !== element) {\n\t\t\t\tcannotUndoDueToResources.push(editStack.resourceLabel);\n\t\t\t}\n\t\t}\n\t\tif (cannotUndoDueToResources.length > 0) {\n\t\t\treturn this._tryToSplitAndUndo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\tnull,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceUndoDueToChanges', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] },\n\t\t\t\t\t\"Could not undo '{0}' across all files because changes were made to {1}\", element.label, cannotUndoDueToResources.join(', ')\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tconst cannotLockDueToResources: string[] = [];\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\tif (editStack.locked) {\n\t\t\t\tcannotLockDueToResources.push(editStack.resourceLabel);\n\t\t\t}\n\t\t}\n\t\tif (cannotLockDueToResources.length > 0) {\n\t\t\treturn this._tryToSplitAndUndo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\tnull,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceUndoDueToInProgressUndoRedo', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] },\n\t\t\t\t\t\"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}\", element.label, cannotLockDueToResources.join(', ')\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// check if new stack elements were added in the meantime...\n\t\tif (!editStackSnapshot.isValid()) {\n\t\t\treturn this._tryToSplitAndUndo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\tnull,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceUndoDueToInMeantimeUndoRedo', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] },\n\t\t\t\t\t\"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime\", element.label\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate _workspaceUndo(strResource: string, element: WorkspaceStackElement, undoConfirmed: boolean): Promise<void> | void {\n\t\tconst affectedEditStacks = this._getAffectedEditStacks(element);\n\t\tconst verificationError = this._checkWorkspaceUndo(strResource, element, affectedEditStacks, /*invalidated resources will be checked after the prepare call*/false);\n\t\tif (verificationError) {\n\t\t\treturn verificationError.returnValue;\n\t\t}\n\t\treturn this._confirmAndExecuteWorkspaceUndo(strResource, element, affectedEditStacks, undoConfirmed);\n\t}\n\n\tprivate _isPartOfUndoGroup(element: WorkspaceStackElement): boolean {\n\t\tif (!element.groupId) {\n\t\t\treturn false;\n\t\t}\n\t\t// check that there is at least another element with the same groupId ready to be undone\n\t\tfor (const [, editStack] of this._editStacks) {\n\t\t\tconst pastElement = editStack.getClosestPastElement();\n\t\t\tif (!pastElement) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (pastElement === element) {\n\t\t\t\tconst secondPastElement = editStack.getSecondClosestPastElement();\n\t\t\t\tif (secondPastElement && secondPastElement.groupId === element.groupId) {\n\t\t\t\t\t// there is another element with the same group id in the same stack!\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pastElement.groupId === element.groupId) {\n\t\t\t\t// there is another element with the same group id in another stack!\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate async _confirmAndExecuteWorkspaceUndo(strResource: string, element: WorkspaceStackElement, editStackSnapshot: EditStackSnapshot, undoConfirmed: boolean): Promise<void> {\n\n\t\tif (element.canSplit() && !this._isPartOfUndoGroup(element)) {\n\t\t\t// this element can be split\n\n\t\t\tenum UndoChoice {\n\t\t\t\tAll = 0,\n\t\t\t\tThis = 1,\n\t\t\t\tCancel = 2\n\t\t\t}\n\n\t\t\tconst { result } = await this._dialogService.prompt<UndoChoice>({\n\t\t\t\ttype: Severity.Info,\n\t\t\t\tmessage: nls.localize('confirmWorkspace', \"Would you like to undo '{0}' across all files?\", element.label),\n\t\t\t\tbuttons: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: nls.localize({ key: 'ok', comment: ['{0} denotes a number that is > 1, && denotes a mnemonic'] }, \"&&Undo in {0} Files\", editStackSnapshot.editStacks.length),\n\t\t\t\t\t\trun: () => UndoChoice.All\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: nls.localize({ key: 'nok', comment: ['&& denotes a mnemonic'] }, \"Undo this &&File\"),\n\t\t\t\t\t\trun: () => UndoChoice.This\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tcancelButton: {\n\t\t\t\t\trun: () => UndoChoice.Cancel\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif (result === UndoChoice.Cancel) {\n\t\t\t\t// choice: cancel\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (result === UndoChoice.This) {\n\t\t\t\t// choice: undo this file\n\t\t\t\tthis._splitPastWorkspaceElement(element, null);\n\t\t\t\treturn this._undo(strResource, 0, true);\n\t\t\t}\n\n\t\t\t// choice: undo in all files\n\n\t\t\t// At this point, it is possible that the element has been made invalid in the meantime (due to the confirmation await)\n\t\t\tconst verificationError1 = this._checkWorkspaceUndo(strResource, element, editStackSnapshot, /*invalidated resources will be checked after the prepare call*/false);\n\t\t\tif (verificationError1) {\n\t\t\t\treturn verificationError1.returnValue;\n\t\t\t}\n\n\t\t\tundoConfirmed = true;\n\t\t}\n\n\t\t// prepare\n\t\tlet cleanup: IDisposable;\n\t\ttry {\n\t\t\tcleanup = await this._invokeWorkspacePrepare(element);\n\t\t} catch (err) {\n\t\t\treturn this._onError(err, element);\n\t\t}\n\n\t\t// At this point, it is possible that the element has been made invalid in the meantime (due to the prepare await)\n\t\tconst verificationError2 = this._checkWorkspaceUndo(strResource, element, editStackSnapshot, /*now also check that there are no more invalidated resources*/true);\n\t\tif (verificationError2) {\n\t\t\tcleanup.dispose();\n\t\t\treturn verificationError2.returnValue;\n\t\t}\n\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\teditStack.moveBackward(element);\n\t\t}\n\t\treturn this._safeInvokeWithLocks(element, () => element.actual.undo(), editStackSnapshot, cleanup, () => this._continueUndoInGroup(element.groupId, undoConfirmed));\n\t}\n\n\tprivate _resourceUndo(editStack: ResourceEditStack, element: ResourceStackElement, undoConfirmed: boolean): Promise<void> | void {\n\t\tif (!element.isValid) {\n\t\t\t// invalid element => immediately flush edit stack!\n\t\t\teditStack.flushAllElements();\n\t\t\treturn;\n\t\t}\n\t\tif (editStack.locked) {\n\t\t\tconst message = nls.localize(\n\t\t\t\t{ key: 'cannotResourceUndoDueToInProgressUndoRedo', comment: ['{0} is a label for an operation.'] },\n\t\t\t\t\"Could not undo '{0}' because there is already an undo or redo operation running.\", element.label\n\t\t\t);\n\t\t\tthis._notificationService.warn(message);\n\t\t\treturn;\n\t\t}\n\t\treturn this._invokeResourcePrepare(element, (cleanup) => {\n\t\t\teditStack.moveBackward(element);\n\t\t\treturn this._safeInvokeWithLocks(element, () => element.actual.undo(), new EditStackSnapshot([editStack]), cleanup, () => this._continueUndoInGroup(element.groupId, undoConfirmed));\n\t\t});\n\t}\n\n\tprivate _findClosestUndoElementInGroup(groupId: number): [StackElement | null, string | null] {\n\t\tif (!groupId) {\n\t\t\treturn [null, null];\n\t\t}\n\n\t\t// find another element with the same groupId and with the highest groupOrder ready to be undone\n\t\tlet matchedElement: StackElement | null = null;\n\t\tlet matchedStrResource: string | null = null;\n\n\t\tfor (const [strResource, editStack] of this._editStacks) {\n\t\t\tconst candidate = editStack.getClosestPastElement();\n\t\t\tif (!candidate) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (candidate.groupId === groupId) {\n\t\t\t\tif (!matchedElement || candidate.groupOrder > matchedElement.groupOrder) {\n\t\t\t\t\tmatchedElement = candidate;\n\t\t\t\t\tmatchedStrResource = strResource;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn [matchedElement, matchedStrResource];\n\t}\n\n\tprivate _continueUndoInGroup(groupId: number, undoConfirmed: boolean): Promise<void> | void {\n\t\tif (!groupId) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst [, matchedStrResource] = this._findClosestUndoElementInGroup(groupId);\n\t\tif (matchedStrResource) {\n\t\t\treturn this._undo(matchedStrResource, 0, undoConfirmed);\n\t\t}\n\t}\n\n\tpublic undo(resourceOrSource: URI | UndoRedoSource): Promise<void> | void {\n\t\tif (resourceOrSource instanceof UndoRedoSource) {\n\t\t\tconst [, matchedStrResource] = this._findClosestUndoElementWithSource(resourceOrSource.id);\n\t\t\treturn matchedStrResource ? this._undo(matchedStrResource, resourceOrSource.id, false) : undefined;\n\t\t}\n\t\tif (typeof resourceOrSource === 'string') {\n\t\t\treturn this._undo(resourceOrSource, 0, false);\n\t\t}\n\t\treturn this._undo(this.getUriComparisonKey(resourceOrSource), 0, false);\n\t}\n\n\tprivate _undo(strResource: string, sourceId: number = 0, undoConfirmed: boolean): Promise<void> | void {\n\t\tif (!this._editStacks.has(strResource)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\tconst element = editStack.getClosestPastElement();\n\t\tif (!element) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (element.groupId) {\n\t\t\t// this element is a part of a group, we need to make sure undoing in a group is in order\n\t\t\tconst [matchedElement, matchedStrResource] = this._findClosestUndoElementInGroup(element.groupId);\n\t\t\tif (element !== matchedElement && matchedStrResource) {\n\t\t\t\t// there is an element in the same group that should be undone before this one\n\t\t\t\treturn this._undo(matchedStrResource, sourceId, undoConfirmed);\n\t\t\t}\n\t\t}\n\n\t\tconst shouldPromptForConfirmation = (element.sourceId !== sourceId || element.confirmBeforeUndo);\n\t\tif (shouldPromptForConfirmation && !undoConfirmed) {\n\t\t\t// Hit a different source or the element asks for prompt before undo, prompt for confirmation\n\t\t\treturn this._confirmAndContinueUndo(strResource, sourceId, element);\n\t\t}\n\n\t\ttry {\n\t\t\tif (element.type === UndoRedoElementType.Workspace) {\n\t\t\t\treturn this._workspaceUndo(strResource, element, undoConfirmed);\n\t\t\t} else {\n\t\t\t\treturn this._resourceUndo(editStack, element, undoConfirmed);\n\t\t\t}\n\t\t} finally {\n\t\t\tif (DEBUG) {\n\t\t\t\tthis._print('undo');\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate async _confirmAndContinueUndo(strResource: string, sourceId: number, element: StackElement): Promise<void> {\n\t\tconst result = await this._dialogService.confirm({\n\t\t\tmessage: nls.localize('confirmDifferentSource', \"Would you like to undo '{0}'?\", element.label),\n\t\t\tprimaryButton: nls.localize({ key: 'confirmDifferentSource.yes', comment: ['&& denotes a mnemonic'] }, \"&&Yes\"),\n\t\t\tcancelButton: nls.localize('confirmDifferentSource.no', \"No\")\n\t\t});\n\n\t\tif (!result.confirmed) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn this._undo(strResource, sourceId, true);\n\t}\n\n\tprivate _findClosestRedoElementWithSource(sourceId: number): [StackElement | null, string | null] {\n\t\tif (!sourceId) {\n\t\t\treturn [null, null];\n\t\t}\n\n\t\t// find an element with sourceId and with the lowest sourceOrder ready to be redone\n\t\tlet matchedElement: StackElement | null = null;\n\t\tlet matchedStrResource: string | null = null;\n\n\t\tfor (const [strResource, editStack] of this._editStacks) {\n\t\t\tconst candidate = editStack.getClosestFutureElement();\n\t\t\tif (!candidate) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (candidate.sourceId === sourceId) {\n\t\t\t\tif (!matchedElement || candidate.sourceOrder < matchedElement.sourceOrder) {\n\t\t\t\t\tmatchedElement = candidate;\n\t\t\t\t\tmatchedStrResource = strResource;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn [matchedElement, matchedStrResource];\n\t}\n\n\tpublic canRedo(resourceOrSource: URI | UndoRedoSource): boolean {\n\t\tif (resourceOrSource instanceof UndoRedoSource) {\n\t\t\tconst [, matchedStrResource] = this._findClosestRedoElementWithSource(resourceOrSource.id);\n\t\t\treturn matchedStrResource ? true : false;\n\t\t}\n\t\tconst strResource = this.getUriComparisonKey(resourceOrSource);\n\t\tif (this._editStacks.has(strResource)) {\n\t\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\t\treturn editStack.hasFutureElements();\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _tryToSplitAndRedo(strResource: string, element: WorkspaceStackElement, ignoreResources: RemovedResources | null, message: string): WorkspaceVerificationError {\n\t\tif (element.canSplit()) {\n\t\t\tthis._splitFutureWorkspaceElement(element, ignoreResources);\n\t\t\tthis._notificationService.warn(message);\n\t\t\treturn new WorkspaceVerificationError(this._redo(strResource));\n\t\t} else {\n\t\t\t// Cannot safely split this workspace element => flush all undo/redo stacks\n\t\t\tfor (const strResource of element.strResources) {\n\t\t\t\tthis.removeElements(strResource);\n\t\t\t}\n\t\t\tthis._notificationService.warn(message);\n\t\t\treturn new WorkspaceVerificationError();\n\t\t}\n\t}\n\n\tprivate _checkWorkspaceRedo(strResource: string, element: WorkspaceStackElement, editStackSnapshot: EditStackSnapshot, checkInvalidatedResources: boolean): WorkspaceVerificationError | null {\n\t\tif (element.removedResources) {\n\t\t\treturn this._tryToSplitAndRedo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\telement.removedResources,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceRedo', comment: ['{0} is a label for an operation. {1} is another message.'] },\n\t\t\t\t\t\"Could not redo '{0}' across all files. {1}\", element.label, element.removedResources.createMessage()\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tif (checkInvalidatedResources && element.invalidatedResources) {\n\t\t\treturn this._tryToSplitAndRedo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\telement.invalidatedResources,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceRedo', comment: ['{0} is a label for an operation. {1} is another message.'] },\n\t\t\t\t\t\"Could not redo '{0}' across all files. {1}\", element.label, element.invalidatedResources.createMessage()\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// this must be the last future element in all the impacted resources!\n\t\tconst cannotRedoDueToResources: string[] = [];\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\tif (editStack.getClosestFutureElement() !== element) {\n\t\t\t\tcannotRedoDueToResources.push(editStack.resourceLabel);\n\t\t\t}\n\t\t}\n\t\tif (cannotRedoDueToResources.length > 0) {\n\t\t\treturn this._tryToSplitAndRedo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\tnull,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceRedoDueToChanges', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] },\n\t\t\t\t\t\"Could not redo '{0}' across all files because changes were made to {1}\", element.label, cannotRedoDueToResources.join(', ')\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tconst cannotLockDueToResources: string[] = [];\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\tif (editStack.locked) {\n\t\t\t\tcannotLockDueToResources.push(editStack.resourceLabel);\n\t\t\t}\n\t\t}\n\t\tif (cannotLockDueToResources.length > 0) {\n\t\t\treturn this._tryToSplitAndRedo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\tnull,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceRedoDueToInProgressUndoRedo', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] },\n\t\t\t\t\t\"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}\", element.label, cannotLockDueToResources.join(', ')\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// check if new stack elements were added in the meantime...\n\t\tif (!editStackSnapshot.isValid()) {\n\t\t\treturn this._tryToSplitAndRedo(\n\t\t\t\tstrResource,\n\t\t\t\telement,\n\t\t\t\tnull,\n\t\t\t\tnls.localize(\n\t\t\t\t\t{ key: 'cannotWorkspaceRedoDueToInMeantimeUndoRedo', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] },\n\t\t\t\t\t\"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime\", element.label\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate _workspaceRedo(strResource: string, element: WorkspaceStackElement): Promise<void> | void {\n\t\tconst affectedEditStacks = this._getAffectedEditStacks(element);\n\t\tconst verificationError = this._checkWorkspaceRedo(strResource, element, affectedEditStacks, /*invalidated resources will be checked after the prepare call*/false);\n\t\tif (verificationError) {\n\t\t\treturn verificationError.returnValue;\n\t\t}\n\t\treturn this._executeWorkspaceRedo(strResource, element, affectedEditStacks);\n\t}\n\n\tprivate async _executeWorkspaceRedo(strResource: string, element: WorkspaceStackElement, editStackSnapshot: EditStackSnapshot): Promise<void> {\n\t\t// prepare\n\t\tlet cleanup: IDisposable;\n\t\ttry {\n\t\t\tcleanup = await this._invokeWorkspacePrepare(element);\n\t\t} catch (err) {\n\t\t\treturn this._onError(err, element);\n\t\t}\n\n\t\t// At this point, it is possible that the element has been made invalid in the meantime (due to the prepare await)\n\t\tconst verificationError = this._checkWorkspaceRedo(strResource, element, editStackSnapshot, /*now also check that there are no more invalidated resources*/true);\n\t\tif (verificationError) {\n\t\t\tcleanup.dispose();\n\t\t\treturn verificationError.returnValue;\n\t\t}\n\n\t\tfor (const editStack of editStackSnapshot.editStacks) {\n\t\t\teditStack.moveForward(element);\n\t\t}\n\t\treturn this._safeInvokeWithLocks(element, () => element.actual.redo(), editStackSnapshot, cleanup, () => this._continueRedoInGroup(element.groupId));\n\t}\n\n\tprivate _resourceRedo(editStack: ResourceEditStack, element: ResourceStackElement): Promise<void> | void {\n\t\tif (!element.isValid) {\n\t\t\t// invalid element => immediately flush edit stack!\n\t\t\teditStack.flushAllElements();\n\t\t\treturn;\n\t\t}\n\t\tif (editStack.locked) {\n\t\t\tconst message = nls.localize(\n\t\t\t\t{ key: 'cannotResourceRedoDueToInProgressUndoRedo', comment: ['{0} is a label for an operation.'] },\n\t\t\t\t\"Could not redo '{0}' because there is already an undo or redo operation running.\", element.label\n\t\t\t);\n\t\t\tthis._notificationService.warn(message);\n\t\t\treturn;\n\t\t}\n\n\t\treturn this._invokeResourcePrepare(element, (cleanup) => {\n\t\t\teditStack.moveForward(element);\n\t\t\treturn this._safeInvokeWithLocks(element, () => element.actual.redo(), new EditStackSnapshot([editStack]), cleanup, () => this._continueRedoInGroup(element.groupId));\n\t\t});\n\t}\n\n\tprivate _findClosestRedoElementInGroup(groupId: number): [StackElement | null, string | null] {\n\t\tif (!groupId) {\n\t\t\treturn [null, null];\n\t\t}\n\n\t\t// find another element with the same groupId and with the lowest groupOrder ready to be redone\n\t\tlet matchedElement: StackElement | null = null;\n\t\tlet matchedStrResource: string | null = null;\n\n\t\tfor (const [strResource, editStack] of this._editStacks) {\n\t\t\tconst candidate = editStack.getClosestFutureElement();\n\t\t\tif (!candidate) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (candidate.groupId === groupId) {\n\t\t\t\tif (!matchedElement || candidate.groupOrder < matchedElement.groupOrder) {\n\t\t\t\t\tmatchedElement = candidate;\n\t\t\t\t\tmatchedStrResource = strResource;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn [matchedElement, matchedStrResource];\n\t}\n\n\tprivate _continueRedoInGroup(groupId: number): Promise<void> | void {\n\t\tif (!groupId) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst [, matchedStrResource] = this._findClosestRedoElementInGroup(groupId);\n\t\tif (matchedStrResource) {\n\t\t\treturn this._redo(matchedStrResource);\n\t\t}\n\t}\n\n\tpublic redo(resourceOrSource: URI | UndoRedoSource | string): Promise<void> | void {\n\t\tif (resourceOrSource instanceof UndoRedoSource) {\n\t\t\tconst [, matchedStrResource] = this._findClosestRedoElementWithSource(resourceOrSource.id);\n\t\t\treturn matchedStrResource ? this._redo(matchedStrResource) : undefined;\n\t\t}\n\t\tif (typeof resourceOrSource === 'string') {\n\t\t\treturn this._redo(resourceOrSource);\n\t\t}\n\t\treturn this._redo(this.getUriComparisonKey(resourceOrSource));\n\t}\n\n\tprivate _redo(strResource: string): Promise<void> | void {\n\t\tif (!this._editStacks.has(strResource)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst editStack = this._editStacks.get(strResource)!;\n\t\tconst element = editStack.getClosestFutureElement();\n\t\tif (!element) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (element.groupId) {\n\t\t\t// this element is a part of a group, we need to make sure redoing in a group is in order\n\t\t\tconst [matchedElement, matchedStrResource] = this._findClosestRedoElementInGroup(element.groupId);\n\t\t\tif (element !== matchedElement && matchedStrResource) {\n\t\t\t\t// there is an element in the same group that should be redone before this one\n\t\t\t\treturn this._redo(matchedStrResource);\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tif (element.type === UndoRedoElementType.Workspace) {\n\t\t\t\treturn this._workspaceRedo(strResource, element);\n\t\t\t} else {\n\t\t\t\treturn this._resourceRedo(editStack, element);\n\t\t\t}\n\t\t} finally {\n\t\t\tif (DEBUG) {\n\t\t\t\tthis._print('redo');\n\t\t\t}\n\t\t}\n\t}\n}\n\nclass WorkspaceVerificationError {\n\tconstructor(public readonly returnValue: Promise<void> | void) { }\n}\n\nregisterSingleton(IUndoRedoService, UndoRedoService, InstantiationType.Delayed);\n"]}
@@ -31,7 +31,7 @@ export function getTitleBarStyle(configurationService) {
31
31
  if (configuration) {
32
32
  const useNativeTabs = isMacintosh && configuration.nativeTabs === true;
33
33
  if (useNativeTabs) {
34
- return "native" /* TitlebarStyle.NATIVE */; // native tabs on sierra do not work with custom title style
34
+ return "native" /* TitlebarStyle.NATIVE */; // native tabs on macOS do not work with custom title style
35
35
  }
36
36
  const useSimpleFullScreen = isMacintosh && configuration.nativeFullScreen === false;
37
37
  if (useSimpleFullScreen) {
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/platform/window/common/window.ts","vs/platform/window/common/window.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAStE,MAAM,UAAU,oBAAoB,CAAC,oBAA2C,EAAE,aAA6B;IAC9G,IAAI,KAAK,EAAE,CAAC;QACX,OAAO,KAAK,CAAC;IACd,CAAC;IAED,MAAM,WAAW,GAAG,iBAAiB,CAAC,oBAAoB,EAAE,aAAa,CAAC,CAAC;IAC3E,MAAM,oBAAoB,GAAG,oBAAoB,CAAC,QAAQ,CAA8B,QAAQ,CAAC,CAAC;IAElG,IAAI,oBAAoB,EAAE,SAAS,iDAAkC,EAAE,CAAC;QACvE,mDAAmD;QACnD,IAAI,CAAC,WAAW,IAAI,CAAC,WAAW,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;QAC7F,iDAAkC,CAAC,+DAA+D;IACnG,CAAC;IAED,MAAM,aAAa,GAAG,oBAAoB,CAAC,QAAQ,CAA8B,QAAQ,CAAC,CAAC;IAC3F,MAAM,KAAK,GAAG,aAAa,EAAE,aAAa,CAAC;IAC3C,IAAI,KAAK,8CAA+B,IAAI,KAAK,8CAA+B,EAAE,CAAC;QAClF,OAAO,KAAK,CAAC;IACd,CAAC;IAED,iDAAkC,CAAC,8BAA8B;AAClE,CAAC","file":"window.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["\nimport { isMacintosh, isWeb } from '../../../base/common/platform.js';\nimport { IConfigurationService } from '../../configuration/common/configuration.js';\n\nexport const enum MenuStyleConfiguration {\n\tCUSTOM = 'custom',\n\tNATIVE = 'native',\n\tINHERIT = 'inherit',\n}\n\nexport function hasNativeContextMenu(configurationService: IConfigurationService, titleBarStyle?: TitlebarStyle): boolean {\n\tif (isWeb) {\n\t\treturn false;\n\t}\n\n\tconst nativeTitle = hasNativeTitlebar(configurationService, titleBarStyle);\n\tconst windowConfigurations = configurationService.getValue<IWindowSettings | undefined>('window');\n\n\tif (windowConfigurations?.menuStyle === MenuStyleConfiguration.NATIVE) {\n\t\t// Do not support native menu with custom title bar\n\t\tif (!isMacintosh && !nativeTitle) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tif (windowConfigurations?.menuStyle === MenuStyleConfiguration.CUSTOM) {\n\t\treturn false;\n\t}\n\n\treturn nativeTitle; // Default to inherit from title bar style\n}\n\nexport interface IWindowSettings {\n\treadonly titleBarStyle: TitlebarStyle;\n\treadonly controlsStyle: WindowControlsStyle;\n\treadonly menuStyle: MenuStyleConfiguration;\n\treadonly nativeTabs: boolean;\n\treadonly nativeFullScreen: boolean;\n}\n\nexport const enum TitlebarStyle {\n\tNATIVE = 'native',\n\tCUSTOM = 'custom',\n}\n\nexport const enum WindowControlsStyle {\n\tNATIVE = 'native',\n\tCUSTOM = 'custom',\n\tHIDDEN = 'hidden'\n}\n\nexport function hasNativeTitlebar(configurationService: IConfigurationService, titleBarStyle?: TitlebarStyle): boolean {\n\tif (!titleBarStyle) {\n\t\ttitleBarStyle = getTitleBarStyle(configurationService);\n\t}\n\n\treturn titleBarStyle === TitlebarStyle.NATIVE;\n}\n\nexport function getTitleBarStyle(configurationService: IConfigurationService): TitlebarStyle {\n\tif (isWeb) {\n\t\treturn TitlebarStyle.CUSTOM;\n\t}\n\n\tconst configuration = configurationService.getValue<IWindowSettings | undefined>('window');\n\tif (configuration) {\n\t\tconst useNativeTabs = isMacintosh && configuration.nativeTabs === true;\n\t\tif (useNativeTabs) {\n\t\t\treturn TitlebarStyle.NATIVE; // native tabs on sierra do not work with custom title style\n\t\t}\n\n\t\tconst useSimpleFullScreen = isMacintosh && configuration.nativeFullScreen === false;\n\t\tif (useSimpleFullScreen) {\n\t\t\treturn TitlebarStyle.NATIVE; // simple fullscreen does not work well with custom title style (https://github.com/microsoft/vscode/issues/63291)\n\t\t}\n\n\t\tconst style = configuration.titleBarStyle;\n\t\tif (style === TitlebarStyle.NATIVE || style === TitlebarStyle.CUSTOM) {\n\t\t\treturn style;\n\t\t}\n\t}\n\n\treturn TitlebarStyle.CUSTOM; // default to custom on all OS\n}\n\nexport function getWindowControlsStyle(configurationService: IConfigurationService): WindowControlsStyle {\n\tif (isWeb || isMacintosh || getTitleBarStyle(configurationService) === TitlebarStyle.NATIVE) {\n\t\treturn WindowControlsStyle.NATIVE; // only supported on Windows/Linux desktop with custom titlebar\n\t}\n\n\tconst configuration = configurationService.getValue<IWindowSettings | undefined>('window');\n\tconst style = configuration?.controlsStyle;\n\tif (style === WindowControlsStyle.CUSTOM || style === WindowControlsStyle.HIDDEN) {\n\t\treturn style;\n\t}\n\n\treturn WindowControlsStyle.NATIVE; // default to native on all OS\n}\n","\nimport { isMacintosh, isWeb } from '../../../base/common/platform.js';\nimport { IConfigurationService } from '../../configuration/common/configuration.js';\n\nexport const enum MenuStyleConfiguration {\n\tCUSTOM = 'custom',\n\tNATIVE = 'native',\n\tINHERIT = 'inherit',\n}\n\nexport function hasNativeContextMenu(configurationService: IConfigurationService, titleBarStyle?: TitlebarStyle): boolean {\n\tif (isWeb) {\n\t\treturn false;\n\t}\n\n\tconst nativeTitle = hasNativeTitlebar(configurationService, titleBarStyle);\n\tconst windowConfigurations = configurationService.getValue<IWindowSettings | undefined>('window');\n\n\tif (windowConfigurations?.menuStyle === MenuStyleConfiguration.NATIVE) {\n\t\t// Do not support native menu with custom title bar\n\t\tif (!isMacintosh && !nativeTitle) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tif (windowConfigurations?.menuStyle === MenuStyleConfiguration.CUSTOM) {\n\t\treturn false;\n\t}\n\n\treturn nativeTitle; // Default to inherit from title bar style\n}\n\nexport interface IWindowSettings {\n\treadonly titleBarStyle: TitlebarStyle;\n\treadonly controlsStyle: WindowControlsStyle;\n\treadonly menuStyle: MenuStyleConfiguration;\n\treadonly nativeTabs: boolean;\n\treadonly nativeFullScreen: boolean;\n}\n\nexport const enum TitlebarStyle {\n\tNATIVE = 'native',\n\tCUSTOM = 'custom',\n}\n\nexport const enum WindowControlsStyle {\n\tNATIVE = 'native',\n\tCUSTOM = 'custom',\n\tHIDDEN = 'hidden'\n}\n\nexport function hasNativeTitlebar(configurationService: IConfigurationService, titleBarStyle?: TitlebarStyle): boolean {\n\tif (!titleBarStyle) {\n\t\ttitleBarStyle = getTitleBarStyle(configurationService);\n\t}\n\n\treturn titleBarStyle === TitlebarStyle.NATIVE;\n}\n\nexport function getTitleBarStyle(configurationService: IConfigurationService): TitlebarStyle {\n\tif (isWeb) {\n\t\treturn TitlebarStyle.CUSTOM;\n\t}\n\n\tconst configuration = configurationService.getValue<IWindowSettings | undefined>('window');\n\tif (configuration) {\n\t\tconst useNativeTabs = isMacintosh && configuration.nativeTabs === true;\n\t\tif (useNativeTabs) {\n\t\t\treturn TitlebarStyle.NATIVE; // native tabs on sierra do not work with custom title style\n\t\t}\n\n\t\tconst useSimpleFullScreen = isMacintosh && configuration.nativeFullScreen === false;\n\t\tif (useSimpleFullScreen) {\n\t\t\treturn TitlebarStyle.NATIVE; // simple fullscreen does not work well with custom title style (https://github.com/microsoft/vscode/issues/63291)\n\t\t}\n\n\t\tconst style = configuration.titleBarStyle;\n\t\tif (style === TitlebarStyle.NATIVE || style === TitlebarStyle.CUSTOM) {\n\t\t\treturn style;\n\t\t}\n\t}\n\n\treturn TitlebarStyle.CUSTOM; // default to custom on all OS\n}\n\nexport function getWindowControlsStyle(configurationService: IConfigurationService): WindowControlsStyle {\n\tif (isWeb || isMacintosh || getTitleBarStyle(configurationService) === TitlebarStyle.NATIVE) {\n\t\treturn WindowControlsStyle.NATIVE; // only supported on Windows/Linux desktop with custom titlebar\n\t}\n\n\tconst configuration = configurationService.getValue<IWindowSettings | undefined>('window');\n\tconst style = configuration?.controlsStyle;\n\tif (style === WindowControlsStyle.CUSTOM || style === WindowControlsStyle.HIDDEN) {\n\t\treturn style;\n\t}\n\n\treturn WindowControlsStyle.NATIVE; // default to native on all OS\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/platform/window/common/window.ts","vs/platform/window/common/window.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAStE,MAAM,UAAU,oBAAoB,CAAC,oBAA2C,EAAE,aAA6B;IAC9G,IAAI,KAAK,EAAE,CAAC;QACX,OAAO,KAAK,CAAC;IACd,CAAC;IAED,MAAM,WAAW,GAAG,iBAAiB,CAAC,oBAAoB,EAAE,aAAa,CAAC,CAAC;IAC3E,MAAM,oBAAoB,GAAG,oBAAoB,CAAC,QAAQ,CAA8B,QAAQ,CAAC,CAAC;IAElG,IAAI,oBAAoB,EAAE,SAAS,iDAAkC,EAAE,CAAC;QACvE,mDAAmD;QACnD,IAAI,CAAC,WAAW,IAAI,CAAC,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CAAC;QAC7F,iDAAkC,CAAC,+DAA+D;IACnG,CAAC;IAED,MAAM,aAAa,GAAG,oBAAoB,CAAC,QAAQ,CAA8B,QAAQ,CAAC,CAAC;IAC3F,MAAM,KAAK,GAAG,aAAa,EAAE,aAAa,CAAC;IAC3C,IAAI,KAAK,8CAA+B,IAAI,KAAK,8CAA+B,EAAE,CAAC;QAClF,OAAO,KAAK,CAAC;IACd,CAAC;IAED,iDAAkC,CAAC,8BAA8B;AAClE,CAAC","file":"window.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["\nimport { isMacintosh, isWeb } from '../../../base/common/platform.js';\nimport { IConfigurationService } from '../../configuration/common/configuration.js';\n\nexport const enum MenuStyleConfiguration {\n\tCUSTOM = 'custom',\n\tNATIVE = 'native',\n\tINHERIT = 'inherit',\n}\n\nexport function hasNativeContextMenu(configurationService: IConfigurationService, titleBarStyle?: TitlebarStyle): boolean {\n\tif (isWeb) {\n\t\treturn false;\n\t}\n\n\tconst nativeTitle = hasNativeTitlebar(configurationService, titleBarStyle);\n\tconst windowConfigurations = configurationService.getValue<IWindowSettings | undefined>('window');\n\n\tif (windowConfigurations?.menuStyle === MenuStyleConfiguration.NATIVE) {\n\t\t// Do not support native menu with custom title bar\n\t\tif (!isMacintosh && !nativeTitle) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tif (windowConfigurations?.menuStyle === MenuStyleConfiguration.CUSTOM) {\n\t\treturn false;\n\t}\n\n\treturn nativeTitle; // Default to inherit from title bar style\n}\n\nexport interface IWindowSettings {\n\treadonly titleBarStyle: TitlebarStyle;\n\treadonly controlsStyle: WindowControlsStyle;\n\treadonly menuStyle: MenuStyleConfiguration;\n\treadonly nativeTabs: boolean;\n\treadonly nativeFullScreen: boolean;\n}\n\nexport const enum TitlebarStyle {\n\tNATIVE = 'native',\n\tCUSTOM = 'custom',\n}\n\nexport const enum WindowControlsStyle {\n\tNATIVE = 'native',\n\tCUSTOM = 'custom',\n\tHIDDEN = 'hidden'\n}\n\nexport function hasNativeTitlebar(configurationService: IConfigurationService, titleBarStyle?: TitlebarStyle): boolean {\n\tif (!titleBarStyle) {\n\t\ttitleBarStyle = getTitleBarStyle(configurationService);\n\t}\n\n\treturn titleBarStyle === TitlebarStyle.NATIVE;\n}\n\nexport function getTitleBarStyle(configurationService: IConfigurationService): TitlebarStyle {\n\tif (isWeb) {\n\t\treturn TitlebarStyle.CUSTOM;\n\t}\n\n\tconst configuration = configurationService.getValue<IWindowSettings | undefined>('window');\n\tif (configuration) {\n\t\tconst useNativeTabs = isMacintosh && configuration.nativeTabs === true;\n\t\tif (useNativeTabs) {\n\t\t\treturn TitlebarStyle.NATIVE; // native tabs on macOS do not work with custom title style\n\t\t}\n\n\t\tconst useSimpleFullScreen = isMacintosh && configuration.nativeFullScreen === false;\n\t\tif (useSimpleFullScreen) {\n\t\t\treturn TitlebarStyle.NATIVE; // simple fullscreen does not work well with custom title style (https://github.com/microsoft/vscode/issues/63291)\n\t\t}\n\n\t\tconst style = configuration.titleBarStyle;\n\t\tif (style === TitlebarStyle.NATIVE || style === TitlebarStyle.CUSTOM) {\n\t\t\treturn style;\n\t\t}\n\t}\n\n\treturn TitlebarStyle.CUSTOM; // default to custom on all OS\n}\n\nexport function getWindowControlsStyle(configurationService: IConfigurationService): WindowControlsStyle {\n\tif (isWeb || isMacintosh || getTitleBarStyle(configurationService) === TitlebarStyle.NATIVE) {\n\t\treturn WindowControlsStyle.NATIVE; // only supported on Windows/Linux desktop with custom titlebar\n\t}\n\n\tconst configuration = configurationService.getValue<IWindowSettings | undefined>('window');\n\tconst style = configuration?.controlsStyle;\n\tif (style === WindowControlsStyle.CUSTOM || style === WindowControlsStyle.HIDDEN) {\n\t\treturn style;\n\t}\n\n\treturn WindowControlsStyle.NATIVE; // default to native on all OS\n}\n","\nimport { isMacintosh, isWeb } from '../../../base/common/platform.js';\nimport { IConfigurationService } from '../../configuration/common/configuration.js';\n\nexport const enum MenuStyleConfiguration {\n\tCUSTOM = 'custom',\n\tNATIVE = 'native',\n\tINHERIT = 'inherit',\n}\n\nexport function hasNativeContextMenu(configurationService: IConfigurationService, titleBarStyle?: TitlebarStyle): boolean {\n\tif (isWeb) {\n\t\treturn false;\n\t}\n\n\tconst nativeTitle = hasNativeTitlebar(configurationService, titleBarStyle);\n\tconst windowConfigurations = configurationService.getValue<IWindowSettings | undefined>('window');\n\n\tif (windowConfigurations?.menuStyle === MenuStyleConfiguration.NATIVE) {\n\t\t// Do not support native menu with custom title bar\n\t\tif (!isMacintosh && !nativeTitle) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tif (windowConfigurations?.menuStyle === MenuStyleConfiguration.CUSTOM) {\n\t\treturn false;\n\t}\n\n\treturn nativeTitle; // Default to inherit from title bar style\n}\n\nexport interface IWindowSettings {\n\treadonly titleBarStyle: TitlebarStyle;\n\treadonly controlsStyle: WindowControlsStyle;\n\treadonly menuStyle: MenuStyleConfiguration;\n\treadonly nativeTabs: boolean;\n\treadonly nativeFullScreen: boolean;\n}\n\nexport const enum TitlebarStyle {\n\tNATIVE = 'native',\n\tCUSTOM = 'custom',\n}\n\nexport const enum WindowControlsStyle {\n\tNATIVE = 'native',\n\tCUSTOM = 'custom',\n\tHIDDEN = 'hidden'\n}\n\nexport function hasNativeTitlebar(configurationService: IConfigurationService, titleBarStyle?: TitlebarStyle): boolean {\n\tif (!titleBarStyle) {\n\t\ttitleBarStyle = getTitleBarStyle(configurationService);\n\t}\n\n\treturn titleBarStyle === TitlebarStyle.NATIVE;\n}\n\nexport function getTitleBarStyle(configurationService: IConfigurationService): TitlebarStyle {\n\tif (isWeb) {\n\t\treturn TitlebarStyle.CUSTOM;\n\t}\n\n\tconst configuration = configurationService.getValue<IWindowSettings | undefined>('window');\n\tif (configuration) {\n\t\tconst useNativeTabs = isMacintosh && configuration.nativeTabs === true;\n\t\tif (useNativeTabs) {\n\t\t\treturn TitlebarStyle.NATIVE; // native tabs on macOS do not work with custom title style\n\t\t}\n\n\t\tconst useSimpleFullScreen = isMacintosh && configuration.nativeFullScreen === false;\n\t\tif (useSimpleFullScreen) {\n\t\t\treturn TitlebarStyle.NATIVE; // simple fullscreen does not work well with custom title style (https://github.com/microsoft/vscode/issues/63291)\n\t\t}\n\n\t\tconst style = configuration.titleBarStyle;\n\t\tif (style === TitlebarStyle.NATIVE || style === TitlebarStyle.CUSTOM) {\n\t\t\treturn style;\n\t\t}\n\t}\n\n\treturn TitlebarStyle.CUSTOM; // default to custom on all OS\n}\n\nexport function getWindowControlsStyle(configurationService: IConfigurationService): WindowControlsStyle {\n\tif (isWeb || isMacintosh || getTitleBarStyle(configurationService) === TitlebarStyle.NATIVE) {\n\t\treturn WindowControlsStyle.NATIVE; // only supported on Windows/Linux desktop with custom titlebar\n\t}\n\n\tconst configuration = configurationService.getValue<IWindowSettings | undefined>('window');\n\tconst style = configuration?.controlsStyle;\n\tif (style === WindowControlsStyle.CUSTOM || style === WindowControlsStyle.HIDDEN) {\n\t\treturn style;\n\t}\n\n\treturn WindowControlsStyle.NATIVE; // default to native on all OS\n}\n"]}
@@ -123,7 +123,7 @@ export class WorkspaceFolder {
123
123
  }
124
124
  }
125
125
  export const WORKSPACE_EXTENSION = 'code-workspace';
126
- export const WORKSPACE_FILTER = [{ name: localize(2058, "Code Workspace"), extensions: [WORKSPACE_EXTENSION] }];
126
+ export const WORKSPACE_FILTER = [{ name: localize(2070, "Code Workspace"), extensions: [WORKSPACE_EXTENSION] }];
127
127
  export const STANDALONE_EDITOR_WORKSPACE_ID = '4064f6ec-cb38-4ad0-af64-ee6467e63c82';
128
128
  export function isStandaloneEditorWorkspace(workspace) {
129
129
  return workspace.id === STANDALONE_EDITOR_WORKSPACE_ID;
package/monaco.d.ts CHANGED
@@ -5588,6 +5588,11 @@ declare namespace monaco.editor {
5588
5588
  * Render this content widget in a location where it could overflow the editor's view dom node.
5589
5589
  */
5590
5590
  allowEditorOverflow?: boolean;
5591
+ /**
5592
+ * If true, this widget doesn't have a visual representation.
5593
+ * The element will have display set to 'none'.
5594
+ */
5595
+ useDisplayNone?: boolean;
5591
5596
  /**
5592
5597
  * Call preventDefault() on mousedown events that target the content widget.
5593
5598
  */
@@ -6376,6 +6381,7 @@ declare namespace monaco.editor {
6376
6381
  * Use this method with caution.
6377
6382
  */
6378
6383
  getOffsetForColumn(lineNumber: number, column: number): number;
6384
+ getWidthOfLine(lineNumber: number): number;
6379
6385
  /**
6380
6386
  * Force an editor render now.
6381
6387
  */
@@ -7497,6 +7503,16 @@ declare namespace monaco.languages {
7497
7503
  readonly earliestShownDateTime: number;
7498
7504
  }
7499
7505
 
7506
+ export interface IInlineCompletionModelInfo {
7507
+ models: IInlineCompletionModel[];
7508
+ currentModelId: string;
7509
+ }
7510
+
7511
+ export interface IInlineCompletionModel {
7512
+ name: string;
7513
+ id: string;
7514
+ }
7515
+
7500
7516
  export class SelectedSuggestionInfo {
7501
7517
  readonly range: IRange;
7502
7518
  readonly text: string;
@@ -7555,11 +7571,14 @@ declare namespace monaco.languages {
7555
7571
  /** Only show the inline suggestion when the cursor is in the showRange. */
7556
7572
  readonly showRange?: IRange;
7557
7573
  readonly warning?: InlineCompletionWarning;
7558
- readonly hint?: InlineCompletionHint;
7574
+ readonly hint?: IInlineCompletionHint;
7575
+ readonly supportsRename?: boolean;
7559
7576
  /**
7560
7577
  * Used for telemetry.
7561
7578
  */
7562
7579
  readonly correlationId?: string | undefined;
7580
+ readonly jumpToPosition?: IPosition;
7581
+ readonly doNotLog?: boolean;
7563
7582
  }
7564
7583
 
7565
7584
  export interface InlineCompletionWarning {
@@ -7572,7 +7591,7 @@ declare namespace monaco.languages {
7572
7591
  Label = 2
7573
7592
  }
7574
7593
 
7575
- export interface InlineCompletionHint {
7594
+ export interface IInlineCompletionHint {
7576
7595
  /** Refers to the current document. */
7577
7596
  range: IRange;
7578
7597
  style: InlineCompletionHintStyle;
@@ -7640,6 +7659,9 @@ declare namespace monaco.languages {
7640
7659
  excludesGroupIds?: InlineCompletionProviderGroupId[];
7641
7660
  displayName?: string;
7642
7661
  debounceDelayMs?: number;
7662
+ modelInfo?: IInlineCompletionModelInfo;
7663
+ onDidModelInfoChange?: IEvent<void>;
7664
+ setModelId?(modelId: string): Promise<void>;
7643
7665
  toString?(): string;
7644
7666
  }
7645
7667
 
@@ -7655,6 +7677,7 @@ declare namespace monaco.languages {
7655
7677
 
7656
7678
  export type InlineCompletionEndOfLifeReason<TInlineCompletion = InlineCompletion> = {
7657
7679
  kind: InlineCompletionEndOfLifeReasonKind.Accepted;
7680
+ alternativeAction: boolean;
7658
7681
  } | {
7659
7682
  kind: InlineCompletionEndOfLifeReasonKind.Rejected;
7660
7683
  } | {
@@ -7674,6 +7697,7 @@ declare namespace monaco.languages {
7674
7697
  shownDuration: number;
7675
7698
  shownDurationUncollapsed: number;
7676
7699
  timeUntilShown: number | undefined;
7700
+ timeUntilActuallyShown: number | undefined;
7677
7701
  timeUntilProviderRequest: number;
7678
7702
  timeUntilProviderResponse: number;
7679
7703
  notShownReason: string | undefined;
@@ -7682,6 +7706,7 @@ declare namespace monaco.languages {
7682
7706
  preceeded: boolean;
7683
7707
  languageId: string;
7684
7708
  requestReason: string;
7709
+ performanceMarkers?: string;
7685
7710
  cursorColumnDistance?: number;
7686
7711
  cursorLineDistance?: number;
7687
7712
  lineCountOriginal?: number;
@@ -7694,6 +7719,16 @@ declare namespace monaco.languages {
7694
7719
  typingIntervalCharacterCount: number;
7695
7720
  selectedSuggestionInfo: boolean;
7696
7721
  availableProviders: string;
7722
+ skuPlan: string | undefined;
7723
+ skuType: string | undefined;
7724
+ renameCreated: boolean | undefined;
7725
+ renameDuration: number | undefined;
7726
+ renameTimedOut: boolean | undefined;
7727
+ renameDroppedOtherEdits: number | undefined;
7728
+ renameDroppedRenameEdits: number | undefined;
7729
+ editKind: string | undefined;
7730
+ longDistanceHintVisible?: boolean;
7731
+ longDistanceHintDistance?: number;
7697
7732
  };
7698
7733
 
7699
7734
  export interface CodeAction {