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":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/iterator.ts","vs/base/common/iterator.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,KAAW,QAAQ,CA0LxB;AA1LD,WAAiB,QAAQ;IAExB,SAAgB,EAAE,CAAc,KAAc;QAC7C,OAAO,CAAC,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAQ,KAAqB,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,UAAU,CAAC;IAC9G,CAAC;IAFe,WAAE,KAEjB,CAAA;IAED,MAAM,MAAM,GAAoB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAClD,SAAgB,KAAK;QACpB,OAAO,MAAqB,CAAC;IAC9B,C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AK,UAAU,YAAY,CAAI,QAA0B;QAC/D,MAAM,MAAM,GAAQ,EAAE,CAAC;QACvB,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;YACnC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC;IANqB,qBAAY,eAMjC,CAAA;IAEM,KAAK,UAAU,gBAAgB,CAAI,QAA4B;QACrE,IAAI,MAAM,GAAQ,EAAE,CAAC;QACrB,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;YACnC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC;IANqB,yBAAgB,mBAMrC,CAAA;AACF,CAAC,EA1LgB,QAAQ,KAAR,QAAQ,QA0LxB","file":"iterator.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 { isIterable } from './types.js';\n\nexport namespace Iterable {\n\n\texport function is<T = unknown>(thing: unknown): thing is Iterable<T> {\n\t\treturn !!thing && typeof thing === 'object' && typeof (thing as Iterable<T>)[Symbol.iterator] === 'function';\n\t}\n\n\tconst _empty: Iterable<never> = Object.freeze([]);\n\texport function empty<T = never>(): Iterable<T> {\n\t\treturn _empty as Iterable<T>;\n\t}\n\n\texport function* single<T>(element: T): Iterable<T> {\n\t\tyield element;\n\t}\n\n\texport function wrap<T>(iterableOrElement: Iterable<T> | T): Iterable<T> {\n\t\tif (is(iterableOrElement)) {\n\t\t\treturn iterableOrElement;\n\t\t} else {\n\t\t\treturn single(iterableOrElement);\n\t\t}\n\t}\n\n\texport function from<T>(iterable: Iterable<T> | undefined | null): Iterable<T> {\n\t\treturn iterable ?? (_empty as Iterable<T>);\n\t}\n\n\texport function* reverse<T>(array: ReadonlyArray<T>): Iterable<T> {\n\t\tfor (let i = array.length - 1; i >= 0; i--) {\n\t\t\tyield array[i];\n\t\t}\n\t}\n\n\texport function isEmpty<T>(iterable: Iterable<T> | undefined | null): boolean {\n\t\treturn !iterable || iterable[Symbol.iterator]().next().done === true;\n\t}\n\n\texport function first<T>(iterable: Iterable<T>): T | undefined {\n\t\treturn iterable[Symbol.iterator]().next().value;\n\t}\n\n\texport function some<T>(iterable: Iterable<T>, predicate: (t: T, i: number) => unknown): boolean {\n\t\tlet i = 0;\n\t\tfor (const element of iterable) {\n\t\t\tif (predicate(element, i++)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\texport function every<T>(iterable: Iterable<T>, predicate: (t: T, i: number) => unknown): boolean {\n\t\tlet i = 0;\n\t\tfor (const element of iterable) {\n\t\t\tif (!predicate(element, i++)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\texport function find<T, R extends T>(iterable: Iterable<T>, predicate: (t: T) => t is R): R | undefined;\n\texport function find<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): T | undefined;\n\texport function find<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): T | undefined {\n\t\tfor (const element of iterable) {\n\t\t\tif (predicate(element)) {\n\t\t\t\treturn element;\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\texport function filter<T, R extends T>(iterable: Iterable<T>, predicate: (t: T) => t is R): Iterable<R>;\n\texport function filter<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): Iterable<T>;\n\texport function* filter<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): Iterable<T> {\n\t\tfor (const element of iterable) {\n\t\t\tif (predicate(element)) {\n\t\t\t\tyield element;\n\t\t\t}\n\t\t}\n\t}\n\n\texport function* map<T, R>(iterable: Iterable<T>, fn: (t: T, index: number) => R): Iterable<R> {\n\t\tlet index = 0;\n\t\tfor (const element of iterable) {\n\t\t\tyield fn(element, index++);\n\t\t}\n\t}\n\n\texport function* flatMap<T, R>(iterable: Iterable<T>, fn: (t: T, index: number) => Iterable<R>): Iterable<R> {\n\t\tlet index = 0;\n\t\tfor (const element of iterable) {\n\t\t\tyield* fn(element, index++);\n\t\t}\n\t}\n\n\texport function* concat<T>(...iterables: (Iterable<T> | T)[]): Iterable<T> {\n\t\tfor (const item of iterables) {\n\t\t\tif (isIterable(item)) {\n\t\t\t\tyield* item;\n\t\t\t} else {\n\t\t\t\tyield item;\n\t\t\t}\n\t\t}\n\t}\n\n\texport function reduce<T, R>(iterable: Iterable<T>, reducer: (previousValue: R, currentValue: T) => R, initialValue: R): R {\n\t\tlet value = initialValue;\n\t\tfor (const element of iterable) {\n\t\t\tvalue = reducer(value, element);\n\t\t}\n\t\treturn value;\n\t}\n\n\texport function length<T>(iterable: Iterable<T>): number {\n\t\tlet count = 0;\n\t\tfor (const _ of iterable) {\n\t\t\tcount++;\n\t\t}\n\t\treturn count;\n\t}\n\n\t/**\n\t * Returns an iterable slice of the array, with the same semantics as `array.slice()`.\n\t */\n\texport function* slice<T>(arr: ReadonlyArray<T>, from: number, to = arr.length): Iterable<T> {\n\t\tif (from < -arr.length) {\n\t\t\tfrom = 0;\n\t\t}\n\t\tif (from < 0) {\n\t\t\tfrom += arr.length;\n\t\t}\n\n\t\tif (to < 0) {\n\t\t\tto += arr.length;\n\t\t} else if (to > arr.length) {\n\t\t\tto = arr.length;\n\t\t}\n\n\t\tfor (; from < to; from++) {\n\t\t\tyield arr[from];\n\t\t}\n\t}\n\n\t/**\n\t * Consumes `atMost` elements from iterable and returns the consumed elements,\n\t * and an iterable for the rest of the elements.\n\t */\n\texport function consume<T>(iterable: Iterable<T>, atMost: number = Number.POSITIVE_INFINITY): [T[], Iterable<T>] {\n\t\tconst consumed: T[] = [];\n\n\t\tif (atMost === 0) {\n\t\t\treturn [consumed, iterable];\n\t\t}\n\n\t\tconst iterator = iterable[Symbol.iterator]();\n\n\t\tfor (let i = 0; i < atMost; i++) {\n\t\t\tconst next = iterator.next();\n\n\t\t\tif (next.done) {\n\t\t\t\treturn [consumed, Iterable.empty()];\n\t\t\t}\n\n\t\t\tconsumed.push(next.value);\n\t\t}\n\n\t\treturn [consumed, { [Symbol.iterator]() { return iterator; } }];\n\t}\n\n\texport async function asyncToArray<T>(iterable: AsyncIterable<T>): Promise<T[]> {\n\t\tconst result: T[] = [];\n\t\tfor await (const item of iterable) {\n\t\t\tresult.push(item);\n\t\t}\n\t\treturn result;\n\t}\n\n\texport async function asyncToArrayFlat<T>(iterable: AsyncIterable<T[]>): Promise<T[]> {\n\t\tlet result: T[] = [];\n\t\tfor await (const item of iterable) {\n\t\t\tresult = result.concat(item);\n\t\t}\n\t\treturn result;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { isIterable } from './types.js';\n\nexport namespace Iterable {\n\n\texport function is<T = unknown>(thing: unknown): thing is Iterable<T> {\n\t\treturn !!thing && typeof thing === 'object' && typeof (thing as Iterable<T>)[Symbol.iterator] === 'function';\n\t}\n\n\tconst _empty: Iterable<never> = Object.freeze([]);\n\texport function empty<T = never>(): Iterable<T> {\n\t\treturn _empty as Iterable<T>;\n\t}\n\n\texport function* single<T>(element: T): Iterable<T> {\n\t\tyield element;\n\t}\n\n\texport function wrap<T>(iterableOrElement: Iterable<T> | T): Iterable<T> {\n\t\tif (is(iterableOrElement)) {\n\t\t\treturn iterableOrElement;\n\t\t} else {\n\t\t\treturn single(iterableOrElement);\n\t\t}\n\t}\n\n\texport function from<T>(iterable: Iterable<T> | undefined | null): Iterable<T> {\n\t\treturn iterable ?? (_empty as Iterable<T>);\n\t}\n\n\texport function* reverse<T>(array: ReadonlyArray<T>): Iterable<T> {\n\t\tfor (let i = array.length - 1; i >= 0; i--) {\n\t\t\tyield array[i];\n\t\t}\n\t}\n\n\texport function isEmpty<T>(iterable: Iterable<T> | undefined | null): boolean {\n\t\treturn !iterable || iterable[Symbol.iterator]().next().done === true;\n\t}\n\n\texport function first<T>(iterable: Iterable<T>): T | undefined {\n\t\treturn iterable[Symbol.iterator]().next().value;\n\t}\n\n\texport function some<T>(iterable: Iterable<T>, predicate: (t: T, i: number) => unknown): boolean {\n\t\tlet i = 0;\n\t\tfor (const element of iterable) {\n\t\t\tif (predicate(element, i++)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\texport function every<T>(iterable: Iterable<T>, predicate: (t: T, i: number) => unknown): boolean {\n\t\tlet i = 0;\n\t\tfor (const element of iterable) {\n\t\t\tif (!predicate(element, i++)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\texport function find<T, R extends T>(iterable: Iterable<T>, predicate: (t: T) => t is R): R | undefined;\n\texport function find<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): T | undefined;\n\texport function find<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): T | undefined {\n\t\tfor (const element of iterable) {\n\t\t\tif (predicate(element)) {\n\t\t\t\treturn element;\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\texport function filter<T, R extends T>(iterable: Iterable<T>, predicate: (t: T) => t is R): Iterable<R>;\n\texport function filter<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): Iterable<T>;\n\texport function* filter<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): Iterable<T> {\n\t\tfor (const element of iterable) {\n\t\t\tif (predicate(element)) {\n\t\t\t\tyield element;\n\t\t\t}\n\t\t}\n\t}\n\n\texport function* map<T, R>(iterable: Iterable<T>, fn: (t: T, index: number) => R): Iterable<R> {\n\t\tlet index = 0;\n\t\tfor (const element of iterable) {\n\t\t\tyield fn(element, index++);\n\t\t}\n\t}\n\n\texport function* flatMap<T, R>(iterable: Iterable<T>, fn: (t: T, index: number) => Iterable<R>): Iterable<R> {\n\t\tlet index = 0;\n\t\tfor (const element of iterable) {\n\t\t\tyield* fn(element, index++);\n\t\t}\n\t}\n\n\texport function* concat<T>(...iterables: (Iterable<T> | T)[]): Iterable<T> {\n\t\tfor (const item of iterables) {\n\t\t\tif (isIterable(item)) {\n\t\t\t\tyield* item;\n\t\t\t} else {\n\t\t\t\tyield item;\n\t\t\t}\n\t\t}\n\t}\n\n\texport function reduce<T, R>(iterable: Iterable<T>, reducer: (previousValue: R, currentValue: T) => R, initialValue: R): R {\n\t\tlet value = initialValue;\n\t\tfor (const element of iterable) {\n\t\t\tvalue = reducer(value, element);\n\t\t}\n\t\treturn value;\n\t}\n\n\texport function length<T>(iterable: Iterable<T>): number {\n\t\tlet count = 0;\n\t\tfor (const _ of iterable) {\n\t\t\tcount++;\n\t\t}\n\t\treturn count;\n\t}\n\n\t/**\n\t * Returns an iterable slice of the array, with the same semantics as `array.slice()`.\n\t */\n\texport function* slice<T>(arr: ReadonlyArray<T>, from: number, to = arr.length): Iterable<T> {\n\t\tif (from < -arr.length) {\n\t\t\tfrom = 0;\n\t\t}\n\t\tif (from < 0) {\n\t\t\tfrom += arr.length;\n\t\t}\n\n\t\tif (to < 0) {\n\t\t\tto += arr.length;\n\t\t} else if (to > arr.length) {\n\t\t\tto = arr.length;\n\t\t}\n\n\t\tfor (; from < to; from++) {\n\t\t\tyield arr[from];\n\t\t}\n\t}\n\n\t/**\n\t * Consumes `atMost` elements from iterable and returns the consumed elements,\n\t * and an iterable for the rest of the elements.\n\t */\n\texport function consume<T>(iterable: Iterable<T>, atMost: number = Number.POSITIVE_INFINITY): [T[], Iterable<T>] {\n\t\tconst consumed: T[] = [];\n\n\t\tif (atMost === 0) {\n\t\t\treturn [consumed, iterable];\n\t\t}\n\n\t\tconst iterator = iterable[Symbol.iterator]();\n\n\t\tfor (let i = 0; i < atMost; i++) {\n\t\t\tconst next = iterator.next();\n\n\t\t\tif (next.done) {\n\t\t\t\treturn [consumed, Iterable.empty()];\n\t\t\t}\n\n\t\t\tconsumed.push(next.value);\n\t\t}\n\n\t\treturn [consumed, { [Symbol.iterator]() { return iterator; } }];\n\t}\n\n\texport async function asyncToArray<T>(iterable: AsyncIterable<T>): Promise<T[]> {\n\t\tconst result: T[] = [];\n\t\tfor await (const item of iterable) {\n\t\t\tresult.push(item);\n\t\t}\n\t\treturn result;\n\t}\n\n\texport async function asyncToArrayFlat<T>(iterable: AsyncIterable<T[]>): Promise<T[]> {\n\t\tlet result: T[] = [];\n\t\tfor await (const item of iterable) {\n\t\t\tresult = result.concat(item);\n\t\t}\n\t\treturn result;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/iterator.ts","vs/base/common/iterator.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,KAAW,QAAQ,CA0LxB;AA1LD,WAAiB,QAAQ;IAExB,SAAgB,EAAE,CAAc,KAAc;QAC7C,OAAO,CAAC,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAQ,KAAqB,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,UAAU,CAAC;IAC9G,CAAC;IAFe,WAAE,KAEjB,CAAA;IAED,MAAM,MAAM,GAAoB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAClD,SAAgB,KAAK;QACpB,OAAO,MAA0B,CAAC;IACnC,CAAC;IAFe,cAAK,QAEpB,CAAA;IAED,QAAe,CAAC,CAAC,MAAM,CAAI,OAAU;QACpC,MAAM,OAAO,CAAC;IACf,CAAC;IAFgB,eAAM,SAEtB,CAAA;IAED,SAAgB,IAAI,CAAI,iBAAkC;QACzD,IAAI,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC;YAC3B,OAAO,iBAAiB,CAAC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,CAAA;IAEM,KAAK,UAAU,gBAAgB,CAAI,QAA4B;QACrE,IAAI,MAAM,GAAQ,EAAE,CAAC;QACrB,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;YACnC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC;IANqB,yBAAgB,mBAMrC,CAAA;AACF,CAAC,EA1LgB,QAAQ,KAAR,QAAQ,QA0LxB","file":"iterator.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 { isIterable } from './types.js';\n\nexport namespace Iterable {\n\n\texport function is<T = unknown>(thing: unknown): thing is Iterable<T> {\n\t\treturn !!thing && typeof thing === 'object' && typeof (thing as Iterable<T>)[Symbol.iterator] === 'function';\n\t}\n\n\tconst _empty: Iterable<never> = Object.freeze([]);\n\texport function empty<T = never>(): readonly never[] {\n\t\treturn _empty as readonly never[];\n\t}\n\n\texport function* single<T>(element: T): Iterable<T> {\n\t\tyield element;\n\t}\n\n\texport function wrap<T>(iterableOrElement: Iterable<T> | T): Iterable<T> {\n\t\tif (is(iterableOrElement)) {\n\t\t\treturn iterableOrElement;\n\t\t} else {\n\t\t\treturn single(iterableOrElement);\n\t\t}\n\t}\n\n\texport function from<T>(iterable: Iterable<T> | undefined | null): Iterable<T> {\n\t\treturn iterable ?? (_empty as Iterable<T>);\n\t}\n\n\texport function* reverse<T>(array: ReadonlyArray<T>): Iterable<T> {\n\t\tfor (let i = array.length - 1; i >= 0; i--) {\n\t\t\tyield array[i];\n\t\t}\n\t}\n\n\texport function isEmpty<T>(iterable: Iterable<T> | undefined | null): boolean {\n\t\treturn !iterable || iterable[Symbol.iterator]().next().done === true;\n\t}\n\n\texport function first<T>(iterable: Iterable<T>): T | undefined {\n\t\treturn iterable[Symbol.iterator]().next().value;\n\t}\n\n\texport function some<T>(iterable: Iterable<T>, predicate: (t: T, i: number) => unknown): boolean {\n\t\tlet i = 0;\n\t\tfor (const element of iterable) {\n\t\t\tif (predicate(element, i++)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\texport function every<T>(iterable: Iterable<T>, predicate: (t: T, i: number) => unknown): boolean {\n\t\tlet i = 0;\n\t\tfor (const element of iterable) {\n\t\t\tif (!predicate(element, i++)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\texport function find<T, R extends T>(iterable: Iterable<T>, predicate: (t: T) => t is R): R | undefined;\n\texport function find<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): T | undefined;\n\texport function find<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): T | undefined {\n\t\tfor (const element of iterable) {\n\t\t\tif (predicate(element)) {\n\t\t\t\treturn element;\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\texport function filter<T, R extends T>(iterable: Iterable<T>, predicate: (t: T) => t is R): Iterable<R>;\n\texport function filter<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): Iterable<T>;\n\texport function* filter<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): Iterable<T> {\n\t\tfor (const element of iterable) {\n\t\t\tif (predicate(element)) {\n\t\t\t\tyield element;\n\t\t\t}\n\t\t}\n\t}\n\n\texport function* map<T, R>(iterable: Iterable<T>, fn: (t: T, index: number) => R): Iterable<R> {\n\t\tlet index = 0;\n\t\tfor (const element of iterable) {\n\t\t\tyield fn(element, index++);\n\t\t}\n\t}\n\n\texport function* flatMap<T, R>(iterable: Iterable<T>, fn: (t: T, index: number) => Iterable<R>): Iterable<R> {\n\t\tlet index = 0;\n\t\tfor (const element of iterable) {\n\t\t\tyield* fn(element, index++);\n\t\t}\n\t}\n\n\texport function* concat<T>(...iterables: (Iterable<T> | T)[]): Iterable<T> {\n\t\tfor (const item of iterables) {\n\t\t\tif (isIterable(item)) {\n\t\t\t\tyield* item;\n\t\t\t} else {\n\t\t\t\tyield item;\n\t\t\t}\n\t\t}\n\t}\n\n\texport function reduce<T, R>(iterable: Iterable<T>, reducer: (previousValue: R, currentValue: T) => R, initialValue: R): R {\n\t\tlet value = initialValue;\n\t\tfor (const element of iterable) {\n\t\t\tvalue = reducer(value, element);\n\t\t}\n\t\treturn value;\n\t}\n\n\texport function length<T>(iterable: Iterable<T>): number {\n\t\tlet count = 0;\n\t\tfor (const _ of iterable) {\n\t\t\tcount++;\n\t\t}\n\t\treturn count;\n\t}\n\n\t/**\n\t * Returns an iterable slice of the array, with the same semantics as `array.slice()`.\n\t */\n\texport function* slice<T>(arr: ReadonlyArray<T>, from: number, to = arr.length): Iterable<T> {\n\t\tif (from < -arr.length) {\n\t\t\tfrom = 0;\n\t\t}\n\t\tif (from < 0) {\n\t\t\tfrom += arr.length;\n\t\t}\n\n\t\tif (to < 0) {\n\t\t\tto += arr.length;\n\t\t} else if (to > arr.length) {\n\t\t\tto = arr.length;\n\t\t}\n\n\t\tfor (; from < to; from++) {\n\t\t\tyield arr[from];\n\t\t}\n\t}\n\n\t/**\n\t * Consumes `atMost` elements from iterable and returns the consumed elements,\n\t * and an iterable for the rest of the elements.\n\t */\n\texport function consume<T>(iterable: Iterable<T>, atMost: number = Number.POSITIVE_INFINITY): [T[], Iterable<T>] {\n\t\tconst consumed: T[] = [];\n\n\t\tif (atMost === 0) {\n\t\t\treturn [consumed, iterable];\n\t\t}\n\n\t\tconst iterator = iterable[Symbol.iterator]();\n\n\t\tfor (let i = 0; i < atMost; i++) {\n\t\t\tconst next = iterator.next();\n\n\t\t\tif (next.done) {\n\t\t\t\treturn [consumed, Iterable.empty()];\n\t\t\t}\n\n\t\t\tconsumed.push(next.value);\n\t\t}\n\n\t\treturn [consumed, { [Symbol.iterator]() { return iterator; } }];\n\t}\n\n\texport async function asyncToArray<T>(iterable: AsyncIterable<T>): Promise<T[]> {\n\t\tconst result: T[] = [];\n\t\tfor await (const item of iterable) {\n\t\t\tresult.push(item);\n\t\t}\n\t\treturn result;\n\t}\n\n\texport async function asyncToArrayFlat<T>(iterable: AsyncIterable<T[]>): Promise<T[]> {\n\t\tlet result: T[] = [];\n\t\tfor await (const item of iterable) {\n\t\t\tresult = result.concat(item);\n\t\t}\n\t\treturn result;\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { isIterable } from './types.js';\n\nexport namespace Iterable {\n\n\texport function is<T = unknown>(thing: unknown): thing is Iterable<T> {\n\t\treturn !!thing && typeof thing === 'object' && typeof (thing as Iterable<T>)[Symbol.iterator] === 'function';\n\t}\n\n\tconst _empty: Iterable<never> = Object.freeze([]);\n\texport function empty<T = never>(): readonly never[] {\n\t\treturn _empty as readonly never[];\n\t}\n\n\texport function* single<T>(element: T): Iterable<T> {\n\t\tyield element;\n\t}\n\n\texport function wrap<T>(iterableOrElement: Iterable<T> | T): Iterable<T> {\n\t\tif (is(iterableOrElement)) {\n\t\t\treturn iterableOrElement;\n\t\t} else {\n\t\t\treturn single(iterableOrElement);\n\t\t}\n\t}\n\n\texport function from<T>(iterable: Iterable<T> | undefined | null): Iterable<T> {\n\t\treturn iterable ?? (_empty as Iterable<T>);\n\t}\n\n\texport function* reverse<T>(array: ReadonlyArray<T>): Iterable<T> {\n\t\tfor (let i = array.length - 1; i >= 0; i--) {\n\t\t\tyield array[i];\n\t\t}\n\t}\n\n\texport function isEmpty<T>(iterable: Iterable<T> | undefined | null): boolean {\n\t\treturn !iterable || iterable[Symbol.iterator]().next().done === true;\n\t}\n\n\texport function first<T>(iterable: Iterable<T>): T | undefined {\n\t\treturn iterable[Symbol.iterator]().next().value;\n\t}\n\n\texport function some<T>(iterable: Iterable<T>, predicate: (t: T, i: number) => unknown): boolean {\n\t\tlet i = 0;\n\t\tfor (const element of iterable) {\n\t\t\tif (predicate(element, i++)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\texport function every<T>(iterable: Iterable<T>, predicate: (t: T, i: number) => unknown): boolean {\n\t\tlet i = 0;\n\t\tfor (const element of iterable) {\n\t\t\tif (!predicate(element, i++)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\texport function find<T, R extends T>(iterable: Iterable<T>, predicate: (t: T) => t is R): R | undefined;\n\texport function find<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): T | undefined;\n\texport function find<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): T | undefined {\n\t\tfor (const element of iterable) {\n\t\t\tif (predicate(element)) {\n\t\t\t\treturn element;\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\texport function filter<T, R extends T>(iterable: Iterable<T>, predicate: (t: T) => t is R): Iterable<R>;\n\texport function filter<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): Iterable<T>;\n\texport function* filter<T>(iterable: Iterable<T>, predicate: (t: T) => boolean): Iterable<T> {\n\t\tfor (const element of iterable) {\n\t\t\tif (predicate(element)) {\n\t\t\t\tyield element;\n\t\t\t}\n\t\t}\n\t}\n\n\texport function* map<T, R>(iterable: Iterable<T>, fn: (t: T, index: number) => R): Iterable<R> {\n\t\tlet index = 0;\n\t\tfor (const element of iterable) {\n\t\t\tyield fn(element, index++);\n\t\t}\n\t}\n\n\texport function* flatMap<T, R>(iterable: Iterable<T>, fn: (t: T, index: number) => Iterable<R>): Iterable<R> {\n\t\tlet index = 0;\n\t\tfor (const element of iterable) {\n\t\t\tyield* fn(element, index++);\n\t\t}\n\t}\n\n\texport function* concat<T>(...iterables: (Iterable<T> | T)[]): Iterable<T> {\n\t\tfor (const item of iterables) {\n\t\t\tif (isIterable(item)) {\n\t\t\t\tyield* item;\n\t\t\t} else {\n\t\t\t\tyield item;\n\t\t\t}\n\t\t}\n\t}\n\n\texport function reduce<T, R>(iterable: Iterable<T>, reducer: (previousValue: R, currentValue: T) => R, initialValue: R): R {\n\t\tlet value = initialValue;\n\t\tfor (const element of iterable) {\n\t\t\tvalue = reducer(value, element);\n\t\t}\n\t\treturn value;\n\t}\n\n\texport function length<T>(iterable: Iterable<T>): number {\n\t\tlet count = 0;\n\t\tfor (const _ of iterable) {\n\t\t\tcount++;\n\t\t}\n\t\treturn count;\n\t}\n\n\t/**\n\t * Returns an iterable slice of the array, with the same semantics as `array.slice()`.\n\t */\n\texport function* slice<T>(arr: ReadonlyArray<T>, from: number, to = arr.length): Iterable<T> {\n\t\tif (from < -arr.length) {\n\t\t\tfrom = 0;\n\t\t}\n\t\tif (from < 0) {\n\t\t\tfrom += arr.length;\n\t\t}\n\n\t\tif (to < 0) {\n\t\t\tto += arr.length;\n\t\t} else if (to > arr.length) {\n\t\t\tto = arr.length;\n\t\t}\n\n\t\tfor (; from < to; from++) {\n\t\t\tyield arr[from];\n\t\t}\n\t}\n\n\t/**\n\t * Consumes `atMost` elements from iterable and returns the consumed elements,\n\t * and an iterable for the rest of the elements.\n\t */\n\texport function consume<T>(iterable: Iterable<T>, atMost: number = Number.POSITIVE_INFINITY): [T[], Iterable<T>] {\n\t\tconst consumed: T[] = [];\n\n\t\tif (atMost === 0) {\n\t\t\treturn [consumed, iterable];\n\t\t}\n\n\t\tconst iterator = iterable[Symbol.iterator]();\n\n\t\tfor (let i = 0; i < atMost; i++) {\n\t\t\tconst next = iterator.next();\n\n\t\t\tif (next.done) {\n\t\t\t\treturn [consumed, Iterable.empty()];\n\t\t\t}\n\n\t\t\tconsumed.push(next.value);\n\t\t}\n\n\t\treturn [consumed, { [Symbol.iterator]() { return iterator; } }];\n\t}\n\n\texport async function asyncToArray<T>(iterable: AsyncIterable<T>): Promise<T[]> {\n\t\tconst result: T[] = [];\n\t\tfor await (const item of iterable) {\n\t\t\tresult.push(item);\n\t\t}\n\t\treturn result;\n\t}\n\n\texport async function asyncToArrayFlat<T>(iterable: AsyncIterable<T[]>): Promise<T[]> {\n\t\tlet result: T[] = [];\n\t\tfor await (const item of iterable) {\n\t\t\tresult = result.concat(item);\n\t\t}\n\t\treturn result;\n\t}\n}\n"]}
@@ -48,14 +48,6 @@ export class KeyCodeChord {
48
48
  this.metaKey = metaKey;
49
49
  this.keyCode = keyCode;
50
50
  }
51
- equals(other) {
52
- return (other instanceof KeyCodeChord
53
- && this.ctrlKey === other.ctrlKey
54
- && this.shiftKey === other.shiftKey
55
- && this.altKey === other.altKey
56
- && this.metaKey === other.metaKey
57
- && this.keyCode === other.keyCode);
58
- }
59
51
  isModifierKey() {
60
52
  return (this.keyCode === 0 /* KeyCode.Unknown */
61
53
  || this.keyCode === 5 /* KeyCode.Ctrl */
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/keybindings.ts","vs/base/common/keybindings.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAyB9C,MAAM,UAAU,gBAAgB,CAAC,UAA6B,EAAE,EAAmB;IAClF,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QACpC,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC;QACb,CAAC;QACD,MAAM,UAAU,GAAG,CAAC,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;QACnD,MAAM,WAAW,GAAG,CAAC,UAAU,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC;QACrD,IAAI,WAAW,KAAK,CAAC,EAAE,CAAC;YACvB,OAAO,IAAI,UAAU,CAAC;gBACrB,sBAAsB,CAAC,UAAU,EAAE,EAAE,CAAC;gBACtC,sBAAsB,CAAC,WAAW,EAAE,EAAE,CAAC;aACvC,CAAC,CAAC;QACJ,CAAC;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CAAS;QAChB,aAAQ,GAAR,QAAQ,CAAe;QACvB,iBAAY,GAAZ,YAAY,CAAe;IACxC,CAAC;CACL;AAID;;GAEG;AACH,MAAM,OAAgB,kBAAkB;CAwCvC","file":"keybindings.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 { illegalArgument } from './errors.js';\nimport { KeyCode, ScanCode } from './keyCodes.js';\nimport { OperatingSystem } from './platform.js';\n\n/**\n * Binary encoding strategy:\n * ```\n * 1111 11\n * 5432 1098 7654 3210\n * ---- CSAW KKKK KKKK\n * C = bit 11 = ctrlCmd flag\n * S = bit 10 = shift flag\n * A = bit 9 = alt flag\n * W = bit 8 = winCtrl flag\n * K = bits 0-7 = key code\n * ```\n */\nconst enum BinaryKeybindingsMask {\n\tCtrlCmd = (1 << 11) >>> 0,\n\tShift = (1 << 10) >>> 0,\n\tAlt = (1 << 9) >>> 0,\n\tWinCtrl = (1 << 8) >>> 0,\n\tKeyCode = 0x000000FF\n}\n\nexport function decodeKeybinding(keybinding: number | number[], OS: OperatingSystem): Keybinding | null {\n\tif (typeof keybinding === 'number') {\n\t\tif (keybinding === 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst firstChord = (keybinding & 0x0000FFFF) >>> 0;\n\t\tconst secondChord = (keybinding & 0xFFFF0000) >>> 16;\n\t\tif (secondChord !== 0) {\n\t\t\treturn new Keybinding([\n\t\t\t\tcreateSimpleKeybinding(firstChord, OS),\n\t\t\t\tcreateSimpleKeybinding(secondChord, OS)\n\t\t\t]);\n\t\t}\n\t\treturn new Keybinding([createSimpleKeybinding(firstChord, OS)]);\n\t} else {\n\t\tconst chords = [];\n\t\tfor (let i = 0; i < keybinding.length; i++) {\n\t\t\tchords.push(createSimpleKeybinding(keybinding[i], OS));\n\t\t}\n\t\treturn new Keybinding(chords);\n\t}\n}\n\nexport function createSimpleKeybinding(keybinding: number, OS: OperatingSystem): KeyCodeChord {\n\n\tconst ctrlCmd = (keybinding & BinaryKeybindingsMask.CtrlCmd ? true : false);\n\tconst winCtrl = (keybinding & BinaryKeybindingsMask.WinCtrl ? true : false);\n\n\tconst ctrlKey = (OS === OperatingSystem.Macintosh ? winCtrl : ctrlCmd);\n\tconst shiftKey = (keybinding & BinaryKeybindingsMask.Shift ? true : false);\n\tconst altKey = (keybinding & BinaryKeybindingsMask.Alt ? true : false);\n\tconst metaKey = (OS === OperatingSystem.Macintosh ? ctrlCmd : winCtrl);\n\tconst keyCode = (keybinding & BinaryKeybindingsMask.KeyCode);\n\n\treturn new KeyCodeChord(ctrlKey, shiftKey, altKey, metaKey, keyCode);\n}\n\nexport interface Modifiers {\n\treadonly ctrlKey: boolean;\n\treadonly shiftKey: boolean;\n\treadonly altKey: boolean;\n\treadonly metaKey: boolean;\n}\n\n/**\n * Represents a chord which uses the `keyCode` field of keyboard events.\n * A chord is a combination of keys pressed simultaneously.\n */\nexport class KeyCodeChord implements Modifiers {\n\n\tconstructor(\n\t\tpublic readonly ctrlKey: boolean,\n\t\tpublic readonly shiftKey: boolean,\n\t\tpublic readonly altKey: boolean,\n\t\tpublic readonly metaKey: boolean,\n\t\tpublic readonly keyCode: KeyCode\n\t) { }\n\n\tpublic equals(other: Chord): boolean {\n\t\treturn (\n\t\t\tother instanceof KeyCodeChord\n\t\t\t&& this.ctrlKey === other.ctrlKey\n\t\t\t&& this.shiftKey === other.shiftKey\n\t\t\t&& this.altKey === other.altKey\n\t\t\t&& this.metaKey === other.metaKey\n\t\t\t&& this.keyCode === other.keyCode\n\t\t);\n\t}\n\n\tpublic isModifierKey(): boolean {\n\t\treturn (\n\t\t\tthis.keyCode === KeyCode.Unknown\n\t\t\t|| this.keyCode === KeyCode.Ctrl\n\t\t\t|| this.keyCode === KeyCode.Meta\n\t\t\t|| this.keyCode === KeyCode.Alt\n\t\t\t|| this.keyCode === KeyCode.Shift\n\t\t);\n\t}\n\n\t/**\n\t * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?\n\t */\n\tpublic isDuplicateModifierCase(): boolean {\n\t\treturn (\n\t\t\t(this.ctrlKey && this.keyCode === KeyCode.Ctrl)\n\t\t\t|| (this.shiftKey && this.keyCode === KeyCode.Shift)\n\t\t\t|| (this.altKey && this.keyCode === KeyCode.Alt)\n\t\t\t|| (this.metaKey && this.keyCode === KeyCode.Meta)\n\t\t);\n\t}\n}\n\n/**\n * Represents a chord which uses the `code` field of keyboard events.\n * A chord is a combination of keys pressed simultaneously.\n */\nexport class ScanCodeChord implements Modifiers {\n\n\tconstructor(\n\t\tpublic readonly ctrlKey: boolean,\n\t\tpublic readonly shiftKey: boolean,\n\t\tpublic readonly altKey: boolean,\n\t\tpublic readonly metaKey: boolean,\n\t\tpublic readonly scanCode: ScanCode\n\t) { }\n\n\t/**\n\t * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?\n\t */\n\tpublic isDuplicateModifierCase(): boolean {\n\t\treturn (\n\t\t\t(this.ctrlKey && (this.scanCode === ScanCode.ControlLeft || this.scanCode === ScanCode.ControlRight))\n\t\t\t|| (this.shiftKey && (this.scanCode === ScanCode.ShiftLeft || this.scanCode === ScanCode.ShiftRight))\n\t\t\t|| (this.altKey && (this.scanCode === ScanCode.AltLeft || this.scanCode === ScanCode.AltRight))\n\t\t\t|| (this.metaKey && (this.scanCode === ScanCode.MetaLeft || this.scanCode === ScanCode.MetaRight))\n\t\t);\n\t}\n}\n\nexport type Chord = KeyCodeChord | ScanCodeChord;\n\n/**\n * A keybinding is a sequence of chords.\n */\nexport class Keybinding {\n\n\tpublic readonly chords: Chord[];\n\n\tconstructor(chords: Chord[]) {\n\t\tif (chords.length === 0) {\n\t\t\tthrow illegalArgument(`chords`);\n\t\t}\n\t\tthis.chords = chords;\n\t}\n}\n\nexport class ResolvedChord {\n\tconstructor(\n\t\tpublic readonly ctrlKey: boolean,\n\t\tpublic readonly shiftKey: boolean,\n\t\tpublic readonly altKey: boolean,\n\t\tpublic readonly metaKey: boolean,\n\t\tpublic readonly keyLabel: string | null,\n\t\tpublic readonly keyAriaLabel: string | null\n\t) { }\n}\n\nexport type SingleModifierChord = 'ctrl' | 'shift' | 'alt' | 'meta';\n\n/**\n * A resolved keybinding. Consists of one or multiple chords.\n */\nexport abstract class ResolvedKeybinding {\n\t/**\n\t * This prints the binding in a format suitable for displaying in the UI.\n\t */\n\tpublic abstract getLabel(): string | null;\n\t/**\n\t * This prints the binding in a format suitable for ARIA.\n\t */\n\tpublic abstract getAriaLabel(): string | null;\n\t/**\n\t * This prints the binding in a format suitable for electron's accelerators.\n\t * See https://github.com/electron/electron/blob/master/docs/api/accelerator.md\n\t */\n\tpublic abstract getElectronAccelerator(): string | null;\n\t/**\n\t * This prints the binding in a format suitable for user settings.\n\t */\n\tpublic abstract getUserSettingsLabel(): string | null;\n\t/**\n\t * Does the keybinding consist of more than one chord?\n\t */\n\tpublic abstract hasMultipleChords(): boolean;\n\t/**\n\t * Returns the chords that comprise of the keybinding.\n\t */\n\tpublic abstract getChords(): ResolvedChord[];\n\t/**\n\t * Returns the chords as strings useful for dispatching.\n\t * Returns null for modifier only chords.\n\t * @example keybinding \"Shift\" -> null\n\t * @example keybinding (\"D\" with shift == true) -> \"shift+D\"\n\t */\n\tpublic abstract getDispatchChords(): (string | null)[];\n\t/**\n\t * Returns the modifier only chords as strings useful for dispatching.\n\t * Returns null for chords that contain more than one modifier or a regular key.\n\t * @example keybinding \"Shift\" -> \"shift\"\n\t * @example keybinding (\"D\" with shift == true\") -> null\n\t */\n\tpublic abstract getSingleModifierDispatchChords(): (SingleModifierChord | null)[];\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { illegalArgument } from './errors.js';\nimport { KeyCode, ScanCode } from './keyCodes.js';\nimport { OperatingSystem } from './platform.js';\n\n/**\n * Binary encoding strategy:\n * ```\n * 1111 11\n * 5432 1098 7654 3210\n * ---- CSAW KKKK KKKK\n * C = bit 11 = ctrlCmd flag\n * S = bit 10 = shift flag\n * A = bit 9 = alt flag\n * W = bit 8 = winCtrl flag\n * K = bits 0-7 = key code\n * ```\n */\nconst enum BinaryKeybindingsMask {\n\tCtrlCmd = (1 << 11) >>> 0,\n\tShift = (1 << 10) >>> 0,\n\tAlt = (1 << 9) >>> 0,\n\tWinCtrl = (1 << 8) >>> 0,\n\tKeyCode = 0x000000FF\n}\n\nexport function decodeKeybinding(keybinding: number | number[], OS: OperatingSystem): Keybinding | null {\n\tif (typeof keybinding === 'number') {\n\t\tif (keybinding === 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst firstChord = (keybinding & 0x0000FFFF) >>> 0;\n\t\tconst secondChord = (keybinding & 0xFFFF0000) >>> 16;\n\t\tif (secondChord !== 0) {\n\t\t\treturn new Keybinding([\n\t\t\t\tcreateSimpleKeybinding(firstChord, OS),\n\t\t\t\tcreateSimpleKeybinding(secondChord, OS)\n\t\t\t]);\n\t\t}\n\t\treturn new Keybinding([createSimpleKeybinding(firstChord, OS)]);\n\t} else {\n\t\tconst chords = [];\n\t\tfor (let i = 0; i < keybinding.length; i++) {\n\t\t\tchords.push(createSimpleKeybinding(keybinding[i], OS));\n\t\t}\n\t\treturn new Keybinding(chords);\n\t}\n}\n\nexport function createSimpleKeybinding(keybinding: number, OS: OperatingSystem): KeyCodeChord {\n\n\tconst ctrlCmd = (keybinding & BinaryKeybindingsMask.CtrlCmd ? true : false);\n\tconst winCtrl = (keybinding & BinaryKeybindingsMask.WinCtrl ? true : false);\n\n\tconst ctrlKey = (OS === OperatingSystem.Macintosh ? winCtrl : ctrlCmd);\n\tconst shiftKey = (keybinding & BinaryKeybindingsMask.Shift ? true : false);\n\tconst altKey = (keybinding & BinaryKeybindingsMask.Alt ? true : false);\n\tconst metaKey = (OS === OperatingSystem.Macintosh ? ctrlCmd : winCtrl);\n\tconst keyCode = (keybinding & BinaryKeybindingsMask.KeyCode);\n\n\treturn new KeyCodeChord(ctrlKey, shiftKey, altKey, metaKey, keyCode);\n}\n\nexport interface Modifiers {\n\treadonly ctrlKey: boolean;\n\treadonly shiftKey: boolean;\n\treadonly altKey: boolean;\n\treadonly metaKey: boolean;\n}\n\n/**\n * Represents a chord which uses the `keyCode` field of keyboard events.\n * A chord is a combination of keys pressed simultaneously.\n */\nexport class KeyCodeChord implements Modifiers {\n\n\tconstructor(\n\t\tpublic readonly ctrlKey: boolean,\n\t\tpublic readonly shiftKey: boolean,\n\t\tpublic readonly altKey: boolean,\n\t\tpublic readonly metaKey: boolean,\n\t\tpublic readonly keyCode: KeyCode\n\t) { }\n\n\tpublic equals(other: Chord): boolean {\n\t\treturn (\n\t\t\tother instanceof KeyCodeChord\n\t\t\t&& this.ctrlKey === other.ctrlKey\n\t\t\t&& this.shiftKey === other.shiftKey\n\t\t\t&& this.altKey === other.altKey\n\t\t\t&& this.metaKey === other.metaKey\n\t\t\t&& this.keyCode === other.keyCode\n\t\t);\n\t}\n\n\tpublic isModifierKey(): boolean {\n\t\treturn (\n\t\t\tthis.keyCode === KeyCode.Unknown\n\t\t\t|| this.keyCode === KeyCode.Ctrl\n\t\t\t|| this.keyCode === KeyCode.Meta\n\t\t\t|| this.keyCode === KeyCode.Alt\n\t\t\t|| this.keyCode === KeyCode.Shift\n\t\t);\n\t}\n\n\t/**\n\t * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?\n\t */\n\tpublic isDuplicateModifierCase(): boolean {\n\t\treturn (\n\t\t\t(this.ctrlKey && this.keyCode === KeyCode.Ctrl)\n\t\t\t|| (this.shiftKey && this.keyCode === KeyCode.Shift)\n\t\t\t|| (this.altKey && this.keyCode === KeyCode.Alt)\n\t\t\t|| (this.metaKey && this.keyCode === KeyCode.Meta)\n\t\t);\n\t}\n}\n\n/**\n * Represents a chord which uses the `code` field of keyboard events.\n * A chord is a combination of keys pressed simultaneously.\n */\nexport class ScanCodeChord implements Modifiers {\n\n\tconstructor(\n\t\tpublic readonly ctrlKey: boolean,\n\t\tpublic readonly shiftKey: boolean,\n\t\tpublic readonly altKey: boolean,\n\t\tpublic readonly metaKey: boolean,\n\t\tpublic readonly scanCode: ScanCode\n\t) { }\n\n\t/**\n\t * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?\n\t */\n\tpublic isDuplicateModifierCase(): boolean {\n\t\treturn (\n\t\t\t(this.ctrlKey && (this.scanCode === ScanCode.ControlLeft || this.scanCode === ScanCode.ControlRight))\n\t\t\t|| (this.shiftKey && (this.scanCode === ScanCode.ShiftLeft || this.scanCode === ScanCode.ShiftRight))\n\t\t\t|| (this.altKey && (this.scanCode === ScanCode.AltLeft || this.scanCode === ScanCode.AltRight))\n\t\t\t|| (this.metaKey && (this.scanCode === ScanCode.MetaLeft || this.scanCode === ScanCode.MetaRight))\n\t\t);\n\t}\n}\n\nexport type Chord = KeyCodeChord | ScanCodeChord;\n\n/**\n * A keybinding is a sequence of chords.\n */\nexport class Keybinding {\n\n\tpublic readonly chords: Chord[];\n\n\tconstructor(chords: Chord[]) {\n\t\tif (chords.length === 0) {\n\t\t\tthrow illegalArgument(`chords`);\n\t\t}\n\t\tthis.chords = chords;\n\t}\n}\n\nexport class ResolvedChord {\n\tconstructor(\n\t\tpublic readonly ctrlKey: boolean,\n\t\tpublic readonly shiftKey: boolean,\n\t\tpublic readonly altKey: boolean,\n\t\tpublic readonly metaKey: boolean,\n\t\tpublic readonly keyLabel: string | null,\n\t\tpublic readonly keyAriaLabel: string | null\n\t) { }\n}\n\nexport type SingleModifierChord = 'ctrl' | 'shift' | 'alt' | 'meta';\n\n/**\n * A resolved keybinding. Consists of one or multiple chords.\n */\nexport abstract class ResolvedKeybinding {\n\t/**\n\t * This prints the binding in a format suitable for displaying in the UI.\n\t */\n\tpublic abstract getLabel(): string | null;\n\t/**\n\t * This prints the binding in a format suitable for ARIA.\n\t */\n\tpublic abstract getAriaLabel(): string | null;\n\t/**\n\t * This prints the binding in a format suitable for electron's accelerators.\n\t * See https://github.com/electron/electron/blob/master/docs/api/accelerator.md\n\t */\n\tpublic abstract getElectronAccelerator(): string | null;\n\t/**\n\t * This prints the binding in a format suitable for user settings.\n\t */\n\tpublic abstract getUserSettingsLabel(): string | null;\n\t/**\n\t * Does the keybinding consist of more than one chord?\n\t */\n\tpublic abstract hasMultipleChords(): boolean;\n\t/**\n\t * Returns the chords that comprise of the keybinding.\n\t */\n\tpublic abstract getChords(): ResolvedChord[];\n\t/**\n\t * Returns the chords as strings useful for dispatching.\n\t * Returns null for modifier only chords.\n\t * @example keybinding \"Shift\" -> null\n\t * @example keybinding (\"D\" with shift == true) -> \"shift+D\"\n\t */\n\tpublic abstract getDispatchChords(): (string | null)[];\n\t/**\n\t * Returns the modifier only chords as strings useful for dispatching.\n\t * Returns null for chords that contain more than one modifier or a regular key.\n\t * @example keybinding \"Shift\" -> \"shift\"\n\t * @example keybinding (\"D\" with shift == true\") -> null\n\t */\n\tpublic abstract getSingleModifierDispatchChords(): (SingleModifierChord | null)[];\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/keybindings.ts","vs/base/common/keybindings.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAyB9C,MAAM,UAAU,gBAAgB,CAAC,UAA6B,EAAE,EAAmB;IAClF,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QACpC,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC;QACb,CAAC;QACD,MAAM,UAAU,GAAG,CAAC,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;QACnD,MAAM,WAAW,GAAG,CAAC,UAAU,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC;QACrD,IAAI,WAAW,KAAK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///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 { illegalArgument } from './errors.js';\nimport { KeyCode, ScanCode } from './keyCodes.js';\nimport { OperatingSystem } from './platform.js';\n\n/**\n * Binary encoding strategy:\n * ```\n * 1111 11\n * 5432 1098 7654 3210\n * ---- CSAW KKKK KKKK\n * C = bit 11 = ctrlCmd flag\n * S = bit 10 = shift flag\n * A = bit 9 = alt flag\n * W = bit 8 = winCtrl flag\n * K = bits 0-7 = key code\n * ```\n */\nconst enum BinaryKeybindingsMask {\n\tCtrlCmd = (1 << 11) >>> 0,\n\tShift = (1 << 10) >>> 0,\n\tAlt = (1 << 9) >>> 0,\n\tWinCtrl = (1 << 8) >>> 0,\n\tKeyCode = 0x000000FF\n}\n\nexport function decodeKeybinding(keybinding: number | number[], OS: OperatingSystem): Keybinding | null {\n\tif (typeof keybinding === 'number') {\n\t\tif (keybinding === 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst firstChord = (keybinding & 0x0000FFFF) >>> 0;\n\t\tconst secondChord = (keybinding & 0xFFFF0000) >>> 16;\n\t\tif (secondChord !== 0) {\n\t\t\treturn new Keybinding([\n\t\t\t\tcreateSimpleKeybinding(firstChord, OS),\n\t\t\t\tcreateSimpleKeybinding(secondChord, OS)\n\t\t\t]);\n\t\t}\n\t\treturn new Keybinding([createSimpleKeybinding(firstChord, OS)]);\n\t} else {\n\t\tconst chords = [];\n\t\tfor (let i = 0; i < keybinding.length; i++) {\n\t\t\tchords.push(createSimpleKeybinding(keybinding[i], OS));\n\t\t}\n\t\treturn new Keybinding(chords);\n\t}\n}\n\nexport function createSimpleKeybinding(keybinding: number, OS: OperatingSystem): KeyCodeChord {\n\n\tconst ctrlCmd = (keybinding & BinaryKeybindingsMask.CtrlCmd ? true : false);\n\tconst winCtrl = (keybinding & BinaryKeybindingsMask.WinCtrl ? true : false);\n\n\tconst ctrlKey = (OS === OperatingSystem.Macintosh ? winCtrl : ctrlCmd);\n\tconst shiftKey = (keybinding & BinaryKeybindingsMask.Shift ? true : false);\n\tconst altKey = (keybinding & BinaryKeybindingsMask.Alt ? true : false);\n\tconst metaKey = (OS === OperatingSystem.Macintosh ? ctrlCmd : winCtrl);\n\tconst keyCode = (keybinding & BinaryKeybindingsMask.KeyCode);\n\n\treturn new KeyCodeChord(ctrlKey, shiftKey, altKey, metaKey, keyCode);\n}\n\nexport interface Modifiers {\n\treadonly ctrlKey: boolean;\n\treadonly shiftKey: boolean;\n\treadonly altKey: boolean;\n\treadonly metaKey: boolean;\n}\n\n/**\n * Represents a chord which uses the `keyCode` field of keyboard events.\n * A chord is a combination of keys pressed simultaneously.\n */\nexport class KeyCodeChord implements Modifiers {\n\n\tconstructor(\n\t\tpublic readonly ctrlKey: boolean,\n\t\tpublic readonly shiftKey: boolean,\n\t\tpublic readonly altKey: boolean,\n\t\tpublic readonly metaKey: boolean,\n\t\tpublic readonly keyCode: KeyCode\n\t) { }\n\n\tpublic isModifierKey(): boolean {\n\t\treturn (\n\t\t\tthis.keyCode === KeyCode.Unknown\n\t\t\t|| this.keyCode === KeyCode.Ctrl\n\t\t\t|| this.keyCode === KeyCode.Meta\n\t\t\t|| this.keyCode === KeyCode.Alt\n\t\t\t|| this.keyCode === KeyCode.Shift\n\t\t);\n\t}\n\n\t/**\n\t * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?\n\t */\n\tpublic isDuplicateModifierCase(): boolean {\n\t\treturn (\n\t\t\t(this.ctrlKey && this.keyCode === KeyCode.Ctrl)\n\t\t\t|| (this.shiftKey && this.keyCode === KeyCode.Shift)\n\t\t\t|| (this.altKey && this.keyCode === KeyCode.Alt)\n\t\t\t|| (this.metaKey && this.keyCode === KeyCode.Meta)\n\t\t);\n\t}\n}\n\n/**\n * Represents a chord which uses the `code` field of keyboard events.\n * A chord is a combination of keys pressed simultaneously.\n */\nexport class ScanCodeChord implements Modifiers {\n\n\tconstructor(\n\t\tpublic readonly ctrlKey: boolean,\n\t\tpublic readonly shiftKey: boolean,\n\t\tpublic readonly altKey: boolean,\n\t\tpublic readonly metaKey: boolean,\n\t\tpublic readonly scanCode: ScanCode\n\t) { }\n\n\t/**\n\t * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?\n\t */\n\tpublic isDuplicateModifierCase(): boolean {\n\t\treturn (\n\t\t\t(this.ctrlKey && (this.scanCode === ScanCode.ControlLeft || this.scanCode === ScanCode.ControlRight))\n\t\t\t|| (this.shiftKey && (this.scanCode === ScanCode.ShiftLeft || this.scanCode === ScanCode.ShiftRight))\n\t\t\t|| (this.altKey && (this.scanCode === ScanCode.AltLeft || this.scanCode === ScanCode.AltRight))\n\t\t\t|| (this.metaKey && (this.scanCode === ScanCode.MetaLeft || this.scanCode === ScanCode.MetaRight))\n\t\t);\n\t}\n}\n\nexport type Chord = KeyCodeChord | ScanCodeChord;\n\n/**\n * A keybinding is a sequence of chords.\n */\nexport class Keybinding {\n\n\tpublic readonly chords: Chord[];\n\n\tconstructor(chords: Chord[]) {\n\t\tif (chords.length === 0) {\n\t\t\tthrow illegalArgument(`chords`);\n\t\t}\n\t\tthis.chords = chords;\n\t}\n}\n\nexport class ResolvedChord {\n\tconstructor(\n\t\tpublic readonly ctrlKey: boolean,\n\t\tpublic readonly shiftKey: boolean,\n\t\tpublic readonly altKey: boolean,\n\t\tpublic readonly metaKey: boolean,\n\t\tpublic readonly keyLabel: string | null,\n\t\tpublic readonly keyAriaLabel: string | null\n\t) { }\n}\n\nexport type SingleModifierChord = 'ctrl' | 'shift' | 'alt' | 'meta';\n\n/**\n * A resolved keybinding. Consists of one or multiple chords.\n */\nexport abstract class ResolvedKeybinding {\n\t/**\n\t * This prints the binding in a format suitable for displaying in the UI.\n\t */\n\tpublic abstract getLabel(): string | null;\n\t/**\n\t * This prints the binding in a format suitable for ARIA.\n\t */\n\tpublic abstract getAriaLabel(): string | null;\n\t/**\n\t * This prints the binding in a format suitable for electron's accelerators.\n\t * See https://github.com/electron/electron/blob/master/docs/api/accelerator.md\n\t */\n\tpublic abstract getElectronAccelerator(): string | null;\n\t/**\n\t * This prints the binding in a format suitable for user settings.\n\t */\n\tpublic abstract getUserSettingsLabel(): string | null;\n\t/**\n\t * Does the keybinding consist of more than one chord?\n\t */\n\tpublic abstract hasMultipleChords(): boolean;\n\t/**\n\t * Returns the chords that comprise of the keybinding.\n\t */\n\tpublic abstract getChords(): ResolvedChord[];\n\t/**\n\t * Returns the chords as strings useful for dispatching.\n\t * Returns null for modifier only chords.\n\t * @example keybinding \"Shift\" -> null\n\t * @example keybinding (\"D\" with shift == true) -> \"shift+D\"\n\t */\n\tpublic abstract getDispatchChords(): (string | null)[];\n\t/**\n\t * Returns the modifier only chords as strings useful for dispatching.\n\t * Returns null for chords that contain more than one modifier or a regular key.\n\t * @example keybinding \"Shift\" -> \"shift\"\n\t * @example keybinding (\"D\" with shift == true\") -> null\n\t */\n\tpublic abstract getSingleModifierDispatchChords(): (SingleModifierChord | null)[];\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { illegalArgument } from './errors.js';\nimport { KeyCode, ScanCode } from './keyCodes.js';\nimport { OperatingSystem } from './platform.js';\n\n/**\n * Binary encoding strategy:\n * ```\n * 1111 11\n * 5432 1098 7654 3210\n * ---- CSAW KKKK KKKK\n * C = bit 11 = ctrlCmd flag\n * S = bit 10 = shift flag\n * A = bit 9 = alt flag\n * W = bit 8 = winCtrl flag\n * K = bits 0-7 = key code\n * ```\n */\nconst enum BinaryKeybindingsMask {\n\tCtrlCmd = (1 << 11) >>> 0,\n\tShift = (1 << 10) >>> 0,\n\tAlt = (1 << 9) >>> 0,\n\tWinCtrl = (1 << 8) >>> 0,\n\tKeyCode = 0x000000FF\n}\n\nexport function decodeKeybinding(keybinding: number | number[], OS: OperatingSystem): Keybinding | null {\n\tif (typeof keybinding === 'number') {\n\t\tif (keybinding === 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst firstChord = (keybinding & 0x0000FFFF) >>> 0;\n\t\tconst secondChord = (keybinding & 0xFFFF0000) >>> 16;\n\t\tif (secondChord !== 0) {\n\t\t\treturn new Keybinding([\n\t\t\t\tcreateSimpleKeybinding(firstChord, OS),\n\t\t\t\tcreateSimpleKeybinding(secondChord, OS)\n\t\t\t]);\n\t\t}\n\t\treturn new Keybinding([createSimpleKeybinding(firstChord, OS)]);\n\t} else {\n\t\tconst chords = [];\n\t\tfor (let i = 0; i < keybinding.length; i++) {\n\t\t\tchords.push(createSimpleKeybinding(keybinding[i], OS));\n\t\t}\n\t\treturn new Keybinding(chords);\n\t}\n}\n\nexport function createSimpleKeybinding(keybinding: number, OS: OperatingSystem): KeyCodeChord {\n\n\tconst ctrlCmd = (keybinding & BinaryKeybindingsMask.CtrlCmd ? true : false);\n\tconst winCtrl = (keybinding & BinaryKeybindingsMask.WinCtrl ? true : false);\n\n\tconst ctrlKey = (OS === OperatingSystem.Macintosh ? winCtrl : ctrlCmd);\n\tconst shiftKey = (keybinding & BinaryKeybindingsMask.Shift ? true : false);\n\tconst altKey = (keybinding & BinaryKeybindingsMask.Alt ? true : false);\n\tconst metaKey = (OS === OperatingSystem.Macintosh ? ctrlCmd : winCtrl);\n\tconst keyCode = (keybinding & BinaryKeybindingsMask.KeyCode);\n\n\treturn new KeyCodeChord(ctrlKey, shiftKey, altKey, metaKey, keyCode);\n}\n\nexport interface Modifiers {\n\treadonly ctrlKey: boolean;\n\treadonly shiftKey: boolean;\n\treadonly altKey: boolean;\n\treadonly metaKey: boolean;\n}\n\n/**\n * Represents a chord which uses the `keyCode` field of keyboard events.\n * A chord is a combination of keys pressed simultaneously.\n */\nexport class KeyCodeChord implements Modifiers {\n\n\tconstructor(\n\t\tpublic readonly ctrlKey: boolean,\n\t\tpublic readonly shiftKey: boolean,\n\t\tpublic readonly altKey: boolean,\n\t\tpublic readonly metaKey: boolean,\n\t\tpublic readonly keyCode: KeyCode\n\t) { }\n\n\tpublic isModifierKey(): boolean {\n\t\treturn (\n\t\t\tthis.keyCode === KeyCode.Unknown\n\t\t\t|| this.keyCode === KeyCode.Ctrl\n\t\t\t|| this.keyCode === KeyCode.Meta\n\t\t\t|| this.keyCode === KeyCode.Alt\n\t\t\t|| this.keyCode === KeyCode.Shift\n\t\t);\n\t}\n\n\t/**\n\t * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?\n\t */\n\tpublic isDuplicateModifierCase(): boolean {\n\t\treturn (\n\t\t\t(this.ctrlKey && this.keyCode === KeyCode.Ctrl)\n\t\t\t|| (this.shiftKey && this.keyCode === KeyCode.Shift)\n\t\t\t|| (this.altKey && this.keyCode === KeyCode.Alt)\n\t\t\t|| (this.metaKey && this.keyCode === KeyCode.Meta)\n\t\t);\n\t}\n}\n\n/**\n * Represents a chord which uses the `code` field of keyboard events.\n * A chord is a combination of keys pressed simultaneously.\n */\nexport class ScanCodeChord implements Modifiers {\n\n\tconstructor(\n\t\tpublic readonly ctrlKey: boolean,\n\t\tpublic readonly shiftKey: boolean,\n\t\tpublic readonly altKey: boolean,\n\t\tpublic readonly metaKey: boolean,\n\t\tpublic readonly scanCode: ScanCode\n\t) { }\n\n\t/**\n\t * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?\n\t */\n\tpublic isDuplicateModifierCase(): boolean {\n\t\treturn (\n\t\t\t(this.ctrlKey && (this.scanCode === ScanCode.ControlLeft || this.scanCode === ScanCode.ControlRight))\n\t\t\t|| (this.shiftKey && (this.scanCode === ScanCode.ShiftLeft || this.scanCode === ScanCode.ShiftRight))\n\t\t\t|| (this.altKey && (this.scanCode === ScanCode.AltLeft || this.scanCode === ScanCode.AltRight))\n\t\t\t|| (this.metaKey && (this.scanCode === ScanCode.MetaLeft || this.scanCode === ScanCode.MetaRight))\n\t\t);\n\t}\n}\n\nexport type Chord = KeyCodeChord | ScanCodeChord;\n\n/**\n * A keybinding is a sequence of chords.\n */\nexport class Keybinding {\n\n\tpublic readonly chords: Chord[];\n\n\tconstructor(chords: Chord[]) {\n\t\tif (chords.length === 0) {\n\t\t\tthrow illegalArgument(`chords`);\n\t\t}\n\t\tthis.chords = chords;\n\t}\n}\n\nexport class ResolvedChord {\n\tconstructor(\n\t\tpublic readonly ctrlKey: boolean,\n\t\tpublic readonly shiftKey: boolean,\n\t\tpublic readonly altKey: boolean,\n\t\tpublic readonly metaKey: boolean,\n\t\tpublic readonly keyLabel: string | null,\n\t\tpublic readonly keyAriaLabel: string | null\n\t) { }\n}\n\nexport type SingleModifierChord = 'ctrl' | 'shift' | 'alt' | 'meta';\n\n/**\n * A resolved keybinding. Consists of one or multiple chords.\n */\nexport abstract class ResolvedKeybinding {\n\t/**\n\t * This prints the binding in a format suitable for displaying in the UI.\n\t */\n\tpublic abstract getLabel(): string | null;\n\t/**\n\t * This prints the binding in a format suitable for ARIA.\n\t */\n\tpublic abstract getAriaLabel(): string | null;\n\t/**\n\t * This prints the binding in a format suitable for electron's accelerators.\n\t * See https://github.com/electron/electron/blob/master/docs/api/accelerator.md\n\t */\n\tpublic abstract getElectronAccelerator(): string | null;\n\t/**\n\t * This prints the binding in a format suitable for user settings.\n\t */\n\tpublic abstract getUserSettingsLabel(): string | null;\n\t/**\n\t * Does the keybinding consist of more than one chord?\n\t */\n\tpublic abstract hasMultipleChords(): boolean;\n\t/**\n\t * Returns the chords that comprise of the keybinding.\n\t */\n\tpublic abstract getChords(): ResolvedChord[];\n\t/**\n\t * Returns the chords as strings useful for dispatching.\n\t * Returns null for modifier only chords.\n\t * @example keybinding \"Shift\" -> null\n\t * @example keybinding (\"D\" with shift == true) -> \"shift+D\"\n\t */\n\tpublic abstract getDispatchChords(): (string | null)[];\n\t/**\n\t * Returns the modifier only chords as strings useful for dispatching.\n\t * Returns null for chords that contain more than one modifier or a regular key.\n\t * @example keybinding \"Shift\" -> \"shift\"\n\t * @example keybinding (\"D\" with shift == true\") -> null\n\t */\n\tpublic abstract getSingleModifierDispatchChords(): (SingleModifierChord | null)[];\n}\n"]}
@@ -333,9 +333,9 @@ export class ImmortalReference {
333
333
  * A map the manages the lifecycle of the values that it stores.
334
334
  */
335
335
  export class DisposableMap {
336
- constructor() {
337
- this._store = new Map();
336
+ constructor(store = new Map()) {
338
337
  this._isDisposed = false;
338
+ this._store = store;
339
339
  trackDisposable(this);
340
340
  }
341
341
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/lifecycle.ts","vs/base/common/lifecycle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,8BAA8B;AAE9B;;;;;;GAMG;AACH,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAChC,IAAI,iBAAiB,GAA8B,IAAI,CAAC;AAyBxD,MAAM,UAAU,oBAAoB,CAAC,OAAkC;IACtE,iBAAiB,GAAG,OAAO,CAAC;AAC7B,CAAC;AAED,IAAI,iBAAiB,EAAE,CAAC;IACvB,MAAM,yBAAyB,GAAG,2BAA2B,CAAC;IAC9D,oBAAoB,CAAC,IAAI;QACxB,eAAe,CAAC,CAAc;YAC7B,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC,KAAM,CAAC;YAChE,UAAU,CAAC,GAAG,EAAE;gBACf,mDAAmD;gBACnD,IAAI,CAAE,CAAS,CAAC,yBAAyB,CAAC,EAAE,CAAC;oBAC5C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBACpB,CAAC;YACF,CAAC,EAAE,IAAI,CAAC,CAAC;QACV,CAAC;QAED,SAAS,CAAC,KAAkB,EAAE,MAA0B;YACvD,IAAI,KAAK,IAAI,KAAK,KAAK,UAAU,CAAC,IAAI,EAAE,CAAC;gBACxC,IAAI,CAAC;oBACJ,mDA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IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACrB,CAAC;IACF,CAAC;IAED,GAAG,CAAC,GAAM;QACT,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED,GAAG,CAAC,GAAM,EAAE,KAAQ,EAAE,sBAAsB,GAAG,KAAK;QACnD,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,mHAAmH,CAAC,CAAC,KAAK,CAAC,CAAC;QACpJ,CAAC;QAED,IAAI,CAAC,sBAAsB,EAAE,CAAC;YAC7B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC;QACjC,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC5B,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,gBAAgB,CAAC,GAAM;QACtB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC;QAChC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAED,MAAM;QACL,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IAC7B,CAAC;IAED,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IACvC,CAAC;CACD","file":"lifecycle.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["\nimport { Iterable } from './iterator.js';\n\n// #region Disposable Tracking\n\n/**\n * Enables logging of potentially leaked disposables.\n *\n * A disposable is considered leaked if it is not disposed or not registered as the child of\n * another disposable. This tracking is very simple an only works for classes that either\n * extend Disposable or use a DisposableStore. This means there are a lot of false positives.\n */\nconst TRACK_DISPOSABLES = false;\nlet disposableTracker: IDisposableTracker | null = null;\n\nexport interface IDisposableTracker {\n\t/**\n\t * Is called on construction of a disposable.\n\t*/\n\ttrackDisposable(disposable: IDisposable): void;\n\n\t/**\n\t * Is called when a disposable is registered as child of another disposable (e.g. {@link DisposableStore}).\n\t * If parent is `null`, the disposable is removed from its former parent.\n\t*/\n\tsetParent(child: IDisposable, parent: IDisposable | null): void;\n\n\t/**\n\t * Is called after a disposable is disposed.\n\t*/\n\tmarkAsDisposed(disposable: IDisposable): void;\n\n\t/**\n\t * Indicates that the given object is a singleton which does not need to be disposed.\n\t*/\n\tmarkAsSingleton(disposable: IDisposable): void;\n}\n\nexport function setDisposableTracker(tracker: IDisposableTracker | null): void {\n\tdisposableTracker = tracker;\n}\n\nif (TRACK_DISPOSABLES) {\n\tconst __is_disposable_tracked__ = '__is_disposable_tracked__';\n\tsetDisposableTracker(new class implements IDisposableTracker {\n\t\ttrackDisposable(x: IDisposable): void {\n\t\t\tconst stack = new Error('Potentially leaked disposable').stack!;\n\t\t\tsetTimeout(() => {\n\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\tif (!(x as any)[__is_disposable_tracked__]) {\n\t\t\t\t\tconsole.log(stack);\n\t\t\t\t}\n\t\t\t}, 3000);\n\t\t}\n\n\t\tsetParent(child: IDisposable, parent: IDisposable | null): void {\n\t\t\tif (child && child !== Disposable.None) {\n\t\t\t\ttry {\n\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\t\t(child as any)[__is_disposable_tracked__] = true;\n\t\t\t\t} catch {\n\t\t\t\t\t// noop\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tmarkAsDisposed(disposable: IDisposable): void {\n\t\t\tif (disposable && disposable !== Disposable.None) {\n\t\t\t\ttry {\n\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\t\t(disposable as any)[__is_disposable_tracked__] = true;\n\t\t\t\t} catch {\n\t\t\t\t\t// noop\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tmarkAsSingleton(disposable: IDisposable): void { }\n\t});\n}\n\nexport function trackDisposable<T extends IDisposable>(x: T): T {\n\tdisposableTracker?.trackDisposable(x);\n\treturn x;\n}\n\nexport function markAsDisposed(disposable: IDisposable): void {\n\tdisposableTracker?.markAsDisposed(disposable);\n}\n\nfunction setParentOfDisposable(child: IDisposable, parent: IDisposable | null): void {\n\tdisposableTracker?.setParent(child, parent);\n}\n\nfunction setParentOfDisposables(children: IDisposable[], parent: IDisposable | null): void {\n\tif (!disposableTracker) {\n\t\treturn;\n\t}\n\tfor (const child of children) {\n\t\tdisposableTracker.setParent(child, parent);\n\t}\n}\n\n/**\n * Indicates that the given object is a singleton which does not need to be disposed.\n*/\nexport function markAsSingleton<T extends IDisposable>(singleton: T): T {\n\tdisposableTracker?.markAsSingleton(singleton);\n\treturn singleton;\n}\n\n// #endregion\n\n/**\n * An object that performs a cleanup operation when `.dispose()` is called.\n *\n * Some examples of how disposables are used:\n *\n * - An event listener that removes itself when `.dispose()` is called.\n * - A resource such as a file system watcher that cleans up the resource when `.dispose()` is called.\n * - The return value from registering a provider. When `.dispose()` is called, the provider is unregistered.\n */\nexport interface IDisposable {\n\tdispose(): void;\n}\n\n/**\n * Check if `thing` is {@link IDisposable disposable}.\n */\nexport function isDisposable<E>(thing: E): thing is E & IDisposable {\n\t// eslint-disable-next-line local/code-no-any-casts\n\treturn typeof thing === 'object' && thing !== null && typeof (<IDisposable><any>thing).dispose === 'function' && (<IDisposable><any>thing).dispose.length === 0;\n}\n\n/**\n * Disposes of the value(s) passed in.\n */\nexport function dispose<T extends IDisposable>(disposable: T): T;\nexport function dispose<T extends IDisposable>(disposable: T | undefined): T | undefined;\nexport function dispose<T extends IDisposable, A extends Iterable<T> = Iterable<T>>(disposables: A): A;\nexport function dispose<T extends IDisposable>(disposables: Array<T>): Array<T>;\nexport function dispose<T extends IDisposable>(disposables: ReadonlyArray<T>): ReadonlyArray<T>;\nexport function dispose<T extends IDisposable>(arg: T | Iterable<T> | undefined): any {\n\tif (Iterable.is(arg)) {\n\t\tconst errors: any[] = [];\n\n\t\tfor (const d of arg) {\n\t\t\tif (d) {\n\t\t\t\ttry {\n\t\t\t\t\td.dispose();\n\t\t\t\t} catch (e) {\n\t\t\t\t\terrors.push(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (errors.length === 1) {\n\t\t\tthrow errors[0];\n\t\t} else if (errors.length > 1) {\n\t\t\tthrow new AggregateError(errors, 'Encountered errors while disposing of store');\n\t\t}\n\n\t\treturn Array.isArray(arg) ? [] : arg;\n\t} else if (arg) {\n\t\targ.dispose();\n\t\treturn arg;\n\t}\n}\n\n/**\n * Combine multiple disposable values into a single {@link IDisposable}.\n */\nexport function combinedDisposable(...disposables: IDisposable[]): IDisposable {\n\tconst parent = toDisposable(() => dispose(disposables));\n\tsetParentOfDisposables(disposables, parent);\n\treturn parent;\n}\n\nclass FunctionDisposable implements IDisposable {\n\tprivate _isDisposed: boolean;\n\tprivate readonly _fn: () => void;\n\n\tconstructor(fn: () => void) {\n\t\tthis._isDisposed = false;\n\t\tthis._fn = fn;\n\t\ttrackDisposable(this);\n\t}\n\n\tdispose() {\n\t\tif (this._isDisposed) {\n\t\t\treturn;\n\t\t}\n\t\tif (!this._fn) {\n\t\t\tthrow new Error(`Unbound disposable context: Need to use an arrow function to preserve the value of this`);\n\t\t}\n\t\tthis._isDisposed = true;\n\t\tmarkAsDisposed(this);\n\t\tthis._fn();\n\t}\n}\n\n/**\n * Turn a function that implements dispose into an {@link IDisposable}.\n *\n * @param fn Clean up function, guaranteed to be called only **once**.\n */\nexport function toDisposable(fn: () => void): IDisposable {\n\treturn new FunctionDisposable(fn);\n}\n\n/**\n * Manages a collection of disposable values.\n *\n * This is the preferred way to manage multiple disposables. A `DisposableStore` is safer to work with than an\n * `IDisposable[]` as it considers edge cases, such as registering the same value multiple times or adding an item to a\n * store that has already been disposed of.\n */\nexport class DisposableStore implements IDisposable {\n\n\tstatic DISABLE_DISPOSED_WARNING = false;\n\n\tprivate readonly _toDispose = new Set<IDisposable>();\n\tprivate _isDisposed = false;\n\n\tconstructor() {\n\t\ttrackDisposable(this);\n\t}\n\n\t/**\n\t * Dispose of all registered disposables and mark this object as disposed.\n\t *\n\t * Any future disposables added to this object will be disposed of on `add`.\n\t */\n\tpublic dispose(): void {\n\t\tif (this._isDisposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tmarkAsDisposed(this);\n\t\tthis._isDisposed = true;\n\t\tthis.clear();\n\t}\n\n\t/**\n\t * @return `true` if this object has been disposed of.\n\t */\n\tpublic get isDisposed(): boolean {\n\t\treturn this._isDisposed;\n\t}\n\n\t/**\n\t * Dispose of all registered disposables but do not mark this object as disposed.\n\t */\n\tpublic clear(): void {\n\t\tif (this._toDispose.size === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tdispose(this._toDispose);\n\t\t} finally {\n\t\t\tthis._toDispose.clear();\n\t\t}\n\t}\n\n\t/**\n\t * Add a new {@link IDisposable disposable} to the collection.\n\t */\n\tpublic add<T extends IDisposable>(o: T): T {\n\t\tif (!o || o === Disposable.None) {\n\t\t\treturn o;\n\t\t}\n\t\tif ((o as unknown as DisposableStore) === this) {\n\t\t\tthrow new Error('Cannot register a disposable on itself!');\n\t\t}\n\n\t\tsetParentOfDisposable(o, this);\n\t\tif (this._isDisposed) {\n\t\t\tif (!DisposableStore.DISABLE_DISPOSED_WARNING) {\n\t\t\t\tconsole.warn(new Error('Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!').stack);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._toDispose.add(o);\n\t\t}\n\n\t\treturn o;\n\t}\n\n\t/**\n\t * Deletes a disposable from store and disposes of it. This will not throw or warn and proceed to dispose the\n\t * disposable even when the disposable is not part in the store.\n\t */\n\tpublic delete<T extends IDisposable>(o: T): void {\n\t\tif (!o) {\n\t\t\treturn;\n\t\t}\n\t\tif ((o as unknown as DisposableStore) === this) {\n\t\t\tthrow new Error('Cannot dispose a disposable on itself!');\n\t\t}\n\t\tthis._toDispose.delete(o);\n\t\to.dispose();\n\t}\n}\n\n/**\n * Abstract base class for a {@link IDisposable disposable} object.\n *\n * Subclasses can {@linkcode _register} disposables that will be automatically cleaned up when this object is disposed of.\n */\nexport abstract class Disposable implements IDisposable {\n\n\t/**\n\t * A disposable that does nothing when it is disposed of.\n\t *\n\t * TODO: This should not be a static property.\n\t */\n\tstatic readonly None = Object.freeze<IDisposable>({ dispose() { } });\n\n\tprotected readonly _store = new DisposableStore();\n\n\tconstructor() {\n\t\ttrackDisposable(this);\n\t\tsetParentOfDisposable(this._store, this);\n\t}\n\n\tpublic dispose(): void {\n\t\tmarkAsDisposed(this);\n\n\t\tthis._store.dispose();\n\t}\n\n\t/**\n\t * Adds `o` to the collection of disposables managed by this object.\n\t */\n\tprotected _register<T extends IDisposable>(o: T): T {\n\t\tif ((o as unknown as Disposable) === this) {\n\t\t\tthrow new Error('Cannot register a disposable on itself!');\n\t\t}\n\t\treturn this._store.add(o);\n\t}\n}\n\n/**\n * Manages the lifecycle of a disposable value that may be changed.\n *\n * This ensures that when the disposable value is changed, the previously held disposable is disposed of. You can\n * also register a `MutableDisposable` on a `Disposable` to ensure it is automatically cleaned up.\n */\nexport class MutableDisposable<T extends IDisposable> implements IDisposable {\n\tprivate _value?: T;\n\tprivate _isDisposed = false;\n\n\tconstructor() {\n\t\ttrackDisposable(this);\n\t}\n\n\t/**\n\t * Get the currently held disposable value, or `undefined` if this MutableDisposable has been disposed\n\t */\n\tget value(): T | undefined {\n\t\treturn this._isDisposed ? undefined : this._value;\n\t}\n\n\t/**\n\t * Set a new disposable value.\n\t *\n\t * Behaviour:\n\t * - If the MutableDisposable has been disposed, the setter is a no-op.\n\t * - If the new value is strictly equal to the current value, the setter is a no-op.\n\t * - Otherwise the previous value (if any) is disposed and the new value is stored.\n\t *\n\t * Related helpers:\n\t * - clear() resets the value to `undefined` (and disposes the previous value).\n\t * - clearAndLeak() returns the old value without disposing it and removes its parent.\n\t */\n\tset value(value: T | undefined) {\n\t\tif (this._isDisposed || value === this._value) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._value?.dispose();\n\t\tif (value) {\n\t\t\tsetParentOfDisposable(value, this);\n\t\t}\n\t\tthis._value = value;\n\t}\n\n\t/**\n\t * Resets the stored value and disposed of the previously stored value.\n\t */\n\tclear(): void {\n\t\tthis.value = undefined;\n\t}\n\n\tdispose(): void {\n\t\tthis._isDisposed = true;\n\t\tmarkAsDisposed(this);\n\t\tthis._value?.dispose();\n\t\tthis._value = undefined;\n\t}\n}\n\nexport class RefCountedDisposable {\n\n\tprivate _counter: number = 1;\n\n\tconstructor(\n\t\tprivate readonly _disposable: IDisposable,\n\t) { }\n\n\tacquire() {\n\t\tthis._counter++;\n\t\treturn this;\n\t}\n\n\trelease() {\n\t\tif (--this._counter === 0) {\n\t\t\tthis._disposable.dispose();\n\t\t}\n\t\treturn this;\n\t}\n}\n\nexport interface IReference<T> extends IDisposable {\n\treadonly object: T;\n}\n\nexport class ImmortalReference<T> implements IReference<T> {\n\tconstructor(public object: T) { }\n\tdispose(): void { /* noop */ }\n}\n\n/**\n * A map the manages the lifecycle of the values that it stores.\n */\nexport class DisposableMap<K, V extends IDisposable = IDisposable> implements IDisposable {\n\n\tprivate readonly _store = new Map<K, V>();\n\tprivate _isDisposed = false;\n\n\tconstructor() {\n\t\ttrackDisposable(this);\n\t}\n\n\t/**\n\t * Disposes of all stored values and mark this object as disposed.\n\t *\n\t * Trying to use this object after it has been disposed of is an error.\n\t */\n\tdispose(): void {\n\t\tmarkAsDisposed(this);\n\t\tthis._isDisposed = true;\n\t\tthis.clearAndDisposeAll();\n\t}\n\n\t/**\n\t * Disposes of all stored values and clear the map, but DO NOT mark this object as disposed.\n\t */\n\tclearAndDisposeAll(): void {\n\t\tif (!this._store.size) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tdispose(this._store.values());\n\t\t} finally {\n\t\t\tthis._store.clear();\n\t\t}\n\t}\n\n\tget(key: K): V | undefined {\n\t\treturn this._store.get(key);\n\t}\n\n\tset(key: K, value: V, skipDisposeOnOverwrite = false): void {\n\t\tif (this._isDisposed) {\n\t\t\tconsole.warn(new Error('Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!').stack);\n\t\t}\n\n\t\tif (!skipDisposeOnOverwrite) {\n\t\t\tthis._store.get(key)?.dispose();\n\t\t}\n\n\t\tthis._store.set(key, value);\n\t\tsetParentOfDisposable(value, this);\n\t}\n\n\t/**\n\t * Delete the value stored for `key` from this map and also dispose of it.\n\t */\n\tdeleteAndDispose(key: K): void {\n\t\tthis._store.get(key)?.dispose();\n\t\tthis._store.delete(key);\n\t}\n\n\tvalues(): IterableIterator<V> {\n\t\treturn this._store.values();\n\t}\n\n\t[Symbol.iterator](): IterableIterator<[K, V]> {\n\t\treturn this._store[Symbol.iterator]();\n\t}\n}\n","\nimport { Iterable } from './iterator.js';\n\n// #region Disposable Tracking\n\n/**\n * Enables logging of potentially leaked disposables.\n *\n * A disposable is considered leaked if it is not disposed or not registered as the child of\n * another disposable. This tracking is very simple an only works for classes that either\n * extend Disposable or use a DisposableStore. This means there are a lot of false positives.\n */\nconst TRACK_DISPOSABLES = false;\nlet disposableTracker: IDisposableTracker | null = null;\n\nexport interface IDisposableTracker {\n\t/**\n\t * Is called on construction of a disposable.\n\t*/\n\ttrackDisposable(disposable: IDisposable): void;\n\n\t/**\n\t * Is called when a disposable is registered as child of another disposable (e.g. {@link DisposableStore}).\n\t * If parent is `null`, the disposable is removed from its former parent.\n\t*/\n\tsetParent(child: IDisposable, parent: IDisposable | null): void;\n\n\t/**\n\t * Is called after a disposable is disposed.\n\t*/\n\tmarkAsDisposed(disposable: IDisposable): void;\n\n\t/**\n\t * Indicates that the given object is a singleton which does not need to be disposed.\n\t*/\n\tmarkAsSingleton(disposable: IDisposable): void;\n}\n\nexport function setDisposableTracker(tracker: IDisposableTracker | null): void {\n\tdisposableTracker = tracker;\n}\n\nif (TRACK_DISPOSABLES) {\n\tconst __is_disposable_tracked__ = '__is_disposable_tracked__';\n\tsetDisposableTracker(new class implements IDisposableTracker {\n\t\ttrackDisposable(x: IDisposable): void {\n\t\t\tconst stack = new Error('Potentially leaked disposable').stack!;\n\t\t\tsetTimeout(() => {\n\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\tif (!(x as any)[__is_disposable_tracked__]) {\n\t\t\t\t\tconsole.log(stack);\n\t\t\t\t}\n\t\t\t}, 3000);\n\t\t}\n\n\t\tsetParent(child: IDisposable, parent: IDisposable | null): void {\n\t\t\tif (child && child !== Disposable.None) {\n\t\t\t\ttry {\n\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\t\t(child as any)[__is_disposable_tracked__] = true;\n\t\t\t\t} catch {\n\t\t\t\t\t// noop\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tmarkAsDisposed(disposable: IDisposable): void {\n\t\t\tif (disposable && disposable !== Disposable.None) {\n\t\t\t\ttry {\n\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\t\t(disposable as any)[__is_disposable_tracked__] = true;\n\t\t\t\t} catch {\n\t\t\t\t\t// noop\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tmarkAsSingleton(disposable: IDisposable): void { }\n\t});\n}\n\nexport function trackDisposable<T extends IDisposable>(x: T): T {\n\tdisposableTracker?.trackDisposable(x);\n\treturn x;\n}\n\nexport function markAsDisposed(disposable: IDisposable): void {\n\tdisposableTracker?.markAsDisposed(disposable);\n}\n\nfunction setParentOfDisposable(child: IDisposable, parent: IDisposable | null): void {\n\tdisposableTracker?.setParent(child, parent);\n}\n\nfunction setParentOfDisposables(children: IDisposable[], parent: IDisposable | null): void {\n\tif (!disposableTracker) {\n\t\treturn;\n\t}\n\tfor (const child of children) {\n\t\tdisposableTracker.setParent(child, parent);\n\t}\n}\n\n/**\n * Indicates that the given object is a singleton which does not need to be disposed.\n*/\nexport function markAsSingleton<T extends IDisposable>(singleton: T): T {\n\tdisposableTracker?.markAsSingleton(singleton);\n\treturn singleton;\n}\n\n// #endregion\n\n/**\n * An object that performs a cleanup operation when `.dispose()` is called.\n *\n * Some examples of how disposables are used:\n *\n * - An event listener that removes itself when `.dispose()` is called.\n * - A resource such as a file system watcher that cleans up the resource when `.dispose()` is called.\n * - The return value from registering a provider. When `.dispose()` is called, the provider is unregistered.\n */\nexport interface IDisposable {\n\tdispose(): void;\n}\n\n/**\n * Check if `thing` is {@link IDisposable disposable}.\n */\nexport function isDisposable<E>(thing: E): thing is E & IDisposable {\n\t// eslint-disable-next-line local/code-no-any-casts\n\treturn typeof thing === 'object' && thing !== null && typeof (<IDisposable><any>thing).dispose === 'function' && (<IDisposable><any>thing).dispose.length === 0;\n}\n\n/**\n * Disposes of the value(s) passed in.\n */\nexport function dispose<T extends IDisposable>(disposable: T): T;\nexport function dispose<T extends IDisposable>(disposable: T | undefined): T | undefined;\nexport function dispose<T extends IDisposable, A extends Iterable<T> = Iterable<T>>(disposables: A): A;\nexport function dispose<T extends IDisposable>(disposables: Array<T>): Array<T>;\nexport function dispose<T extends IDisposable>(disposables: ReadonlyArray<T>): ReadonlyArray<T>;\nexport function dispose<T extends IDisposable>(arg: T | Iterable<T> | undefined): any {\n\tif (Iterable.is(arg)) {\n\t\tconst errors: any[] = [];\n\n\t\tfor (const d of arg) {\n\t\t\tif (d) {\n\t\t\t\ttry {\n\t\t\t\t\td.dispose();\n\t\t\t\t} catch (e) {\n\t\t\t\t\terrors.push(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (errors.length === 1) {\n\t\t\tthrow errors[0];\n\t\t} else if (errors.length > 1) {\n\t\t\tthrow new AggregateError(errors, 'Encountered errors while disposing of store');\n\t\t}\n\n\t\treturn Array.isArray(arg) ? [] : arg;\n\t} else if (arg) {\n\t\targ.dispose();\n\t\treturn arg;\n\t}\n}\n\n/**\n * Combine multiple disposable values into a single {@link IDisposable}.\n */\nexport function combinedDisposable(...disposables: IDisposable[]): IDisposable {\n\tconst parent = toDisposable(() => dispose(disposables));\n\tsetParentOfDisposables(disposables, parent);\n\treturn parent;\n}\n\nclass FunctionDisposable implements IDisposable {\n\tprivate _isDisposed: boolean;\n\tprivate readonly _fn: () => void;\n\n\tconstructor(fn: () => void) {\n\t\tthis._isDisposed = false;\n\t\tthis._fn = fn;\n\t\ttrackDisposable(this);\n\t}\n\n\tdispose() {\n\t\tif (this._isDisposed) {\n\t\t\treturn;\n\t\t}\n\t\tif (!this._fn) {\n\t\t\tthrow new Error(`Unbound disposable context: Need to use an arrow function to preserve the value of this`);\n\t\t}\n\t\tthis._isDisposed = true;\n\t\tmarkAsDisposed(this);\n\t\tthis._fn();\n\t}\n}\n\n/**\n * Turn a function that implements dispose into an {@link IDisposable}.\n *\n * @param fn Clean up function, guaranteed to be called only **once**.\n */\nexport function toDisposable(fn: () => void): IDisposable {\n\treturn new FunctionDisposable(fn);\n}\n\n/**\n * Manages a collection of disposable values.\n *\n * This is the preferred way to manage multiple disposables. A `DisposableStore` is safer to work with than an\n * `IDisposable[]` as it considers edge cases, such as registering the same value multiple times or adding an item to a\n * store that has already been disposed of.\n */\nexport class DisposableStore implements IDisposable {\n\n\tstatic DISABLE_DISPOSED_WARNING = false;\n\n\tprivate readonly _toDispose = new Set<IDisposable>();\n\tprivate _isDisposed = false;\n\n\tconstructor() {\n\t\ttrackDisposable(this);\n\t}\n\n\t/**\n\t * Dispose of all registered disposables and mark this object as disposed.\n\t *\n\t * Any future disposables added to this object will be disposed of on `add`.\n\t */\n\tpublic dispose(): void {\n\t\tif (this._isDisposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tmarkAsDisposed(this);\n\t\tthis._isDisposed = true;\n\t\tthis.clear();\n\t}\n\n\t/**\n\t * @return `true` if this object has been disposed of.\n\t */\n\tpublic get isDisposed(): boolean {\n\t\treturn this._isDisposed;\n\t}\n\n\t/**\n\t * Dispose of all registered disposables but do not mark this object as disposed.\n\t */\n\tpublic clear(): void {\n\t\tif (this._toDispose.size === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tdispose(this._toDispose);\n\t\t} finally {\n\t\t\tthis._toDispose.clear();\n\t\t}\n\t}\n\n\t/**\n\t * Add a new {@link IDisposable disposable} to the collection.\n\t */\n\tpublic add<T extends IDisposable>(o: T): T {\n\t\tif (!o || o === Disposable.None) {\n\t\t\treturn o;\n\t\t}\n\t\tif ((o as unknown as DisposableStore) === this) {\n\t\t\tthrow new Error('Cannot register a disposable on itself!');\n\t\t}\n\n\t\tsetParentOfDisposable(o, this);\n\t\tif (this._isDisposed) {\n\t\t\tif (!DisposableStore.DISABLE_DISPOSED_WARNING) {\n\t\t\t\tconsole.warn(new Error('Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!').stack);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._toDispose.add(o);\n\t\t}\n\n\t\treturn o;\n\t}\n\n\t/**\n\t * Deletes a disposable from store and disposes of it. This will not throw or warn and proceed to dispose the\n\t * disposable even when the disposable is not part in the store.\n\t */\n\tpublic delete<T extends IDisposable>(o: T): void {\n\t\tif (!o) {\n\t\t\treturn;\n\t\t}\n\t\tif ((o as unknown as DisposableStore) === this) {\n\t\t\tthrow new Error('Cannot dispose a disposable on itself!');\n\t\t}\n\t\tthis._toDispose.delete(o);\n\t\to.dispose();\n\t}\n}\n\n/**\n * Abstract base class for a {@link IDisposable disposable} object.\n *\n * Subclasses can {@linkcode _register} disposables that will be automatically cleaned up when this object is disposed of.\n */\nexport abstract class Disposable implements IDisposable {\n\n\t/**\n\t * A disposable that does nothing when it is disposed of.\n\t *\n\t * TODO: This should not be a static property.\n\t */\n\tstatic readonly None = Object.freeze<IDisposable>({ dispose() { } });\n\n\tprotected readonly _store = new DisposableStore();\n\n\tconstructor() {\n\t\ttrackDisposable(this);\n\t\tsetParentOfDisposable(this._store, this);\n\t}\n\n\tpublic dispose(): void {\n\t\tmarkAsDisposed(this);\n\n\t\tthis._store.dispose();\n\t}\n\n\t/**\n\t * Adds `o` to the collection of disposables managed by this object.\n\t */\n\tprotected _register<T extends IDisposable>(o: T): T {\n\t\tif ((o as unknown as Disposable) === this) {\n\t\t\tthrow new Error('Cannot register a disposable on itself!');\n\t\t}\n\t\treturn this._store.add(o);\n\t}\n}\n\n/**\n * Manages the lifecycle of a disposable value that may be changed.\n *\n * This ensures that when the disposable value is changed, the previously held disposable is disposed of. You can\n * also register a `MutableDisposable` on a `Disposable` to ensure it is automatically cleaned up.\n */\nexport class MutableDisposable<T extends IDisposable> implements IDisposable {\n\tprivate _value?: T;\n\tprivate _isDisposed = false;\n\n\tconstructor() {\n\t\ttrackDisposable(this);\n\t}\n\n\t/**\n\t * Get the currently held disposable value, or `undefined` if this MutableDisposable has been disposed\n\t */\n\tget value(): T | undefined {\n\t\treturn this._isDisposed ? undefined : this._value;\n\t}\n\n\t/**\n\t * Set a new disposable value.\n\t *\n\t * Behaviour:\n\t * - If the MutableDisposable has been disposed, the setter is a no-op.\n\t * - If the new value is strictly equal to the current value, the setter is a no-op.\n\t * - Otherwise the previous value (if any) is disposed and the new value is stored.\n\t *\n\t * Related helpers:\n\t * - clear() resets the value to `undefined` (and disposes the previous value).\n\t * - clearAndLeak() returns the old value without disposing it and removes its parent.\n\t */\n\tset value(value: T | undefined) {\n\t\tif (this._isDisposed || value === this._value) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._value?.dispose();\n\t\tif (value) {\n\t\t\tsetParentOfDisposable(value, this);\n\t\t}\n\t\tthis._value = value;\n\t}\n\n\t/**\n\t * Resets the stored value and disposed of the previously stored value.\n\t */\n\tclear(): void {\n\t\tthis.value = undefined;\n\t}\n\n\tdispose(): void {\n\t\tthis._isDisposed = true;\n\t\tmarkAsDisposed(this);\n\t\tthis._value?.dispose();\n\t\tthis._value = undefined;\n\t}\n}\n\nexport class RefCountedDisposable {\n\n\tprivate _counter: number = 1;\n\n\tconstructor(\n\t\tprivate readonly _disposable: IDisposable,\n\t) { }\n\n\tacquire() {\n\t\tthis._counter++;\n\t\treturn this;\n\t}\n\n\trelease() {\n\t\tif (--this._counter === 0) {\n\t\t\tthis._disposable.dispose();\n\t\t}\n\t\treturn this;\n\t}\n}\n\nexport interface IReference<T> extends IDisposable {\n\treadonly object: T;\n}\n\nexport class ImmortalReference<T> implements IReference<T> {\n\tconstructor(public object: T) { }\n\tdispose(): void { /* noop */ }\n}\n\n/**\n * A map the manages the lifecycle of the values that it stores.\n */\nexport class DisposableMap<K, V extends IDisposable = IDisposable> implements IDisposable {\n\n\tprivate readonly _store = new Map<K, V>();\n\tprivate _isDisposed = false;\n\n\tconstructor() {\n\t\ttrackDisposable(this);\n\t}\n\n\t/**\n\t * Disposes of all stored values and mark this object as disposed.\n\t *\n\t * Trying to use this object after it has been disposed of is an error.\n\t */\n\tdispose(): void {\n\t\tmarkAsDisposed(this);\n\t\tthis._isDisposed = true;\n\t\tthis.clearAndDisposeAll();\n\t}\n\n\t/**\n\t * Disposes of all stored values and clear the map, but DO NOT mark this object as disposed.\n\t */\n\tclearAndDisposeAll(): void {\n\t\tif (!this._store.size) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tdispose(this._store.values());\n\t\t} finally {\n\t\t\tthis._store.clear();\n\t\t}\n\t}\n\n\tget(key: K): V | undefined {\n\t\treturn this._store.get(key);\n\t}\n\n\tset(key: K, value: V, skipDisposeOnOverwrite = false): void {\n\t\tif (this._isDisposed) {\n\t\t\tconsole.warn(new Error('Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!').stack);\n\t\t}\n\n\t\tif (!skipDisposeOnOverwrite) {\n\t\t\tthis._store.get(key)?.dispose();\n\t\t}\n\n\t\tthis._store.set(key, value);\n\t\tsetParentOfDisposable(value, this);\n\t}\n\n\t/**\n\t * Delete the value stored for `key` from this map and also dispose of it.\n\t */\n\tdeleteAndDispose(key: K): void {\n\t\tthis._store.get(key)?.dispose();\n\t\tthis._store.delete(key);\n\t}\n\n\tvalues(): IterableIterator<V> {\n\t\treturn this._store.values();\n\t}\n\n\t[Symbol.iterator](): IterableIterator<[K, V]> {\n\t\treturn this._store[Symbol.iterator]();\n\t}\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/lifecycle.ts","vs/base/common/lifecycle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,8BAA8B;AAE9B;;;;;;GAMG;AACH,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAChC,IAAI,iBAAiB,GAA8B,IAAI,CAAC;AAyBxD,MAAM,UAAU,oBAAoB,CAAC,OAAkC;IACtE,iBAAiB,GAAG,OAAO,CAAC;AAC7B,CAAC;AAED,IAAI,iBAAiB,EAAE,CAAC;IACvB,MAAM,yBAAyB,GAAG,2BAA2B,CAAC;IAC9D,oBAAoB,CAAC,IAAI;QACxB,eAAe,CAAC,CAAc;YAC7B,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC,KAAM,CAAC;YAChE,UAAU,CAAC,GAAG,EAAE;gBACf,mDAAmD;gBACnD,IAAI,CAAE,CAAS,CAAC,yBAAyB,CAAC,EAAE,CAAC;oBAC5C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBACpB,CAAC;YACF,CAAC,EAAE,IAAI,CAAC,CAAC;QACV,CAAC;QAED,SAAS,CAAC,KAAkB,EAAE,MAA0B;YACvD,IAAI,KAAK,IAAI,KAAK,KAAK,UAAU,CAAC,IAAI,EAAE,CAAC;gBACxC,IAAI,CAAC;oBACJ,mDAAmD;oBAClD,KAAa,CAAC,yBAAyB,CAAC,GAAG,IAAI,CAAC;gBAClD,CAAC;gBAAC,MAAM,CAAC;oBACR,OAAO;gB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AG,CAAC,GAAM;QACT,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED,GAAG,CAAC,GAAM,EAAE,KAAQ,EAAE,sBAAsB,GAAG,KAAK;QACnD,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,mHAAmH,CAAC,CAAC,KAAK,CAAC,CAAC;QACpJ,CAAC;QAED,IAAI,CAAC,sBAAsB,EAAE,CAAC;YAC7B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC;QACjC,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC5B,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,gBAAgB,CAAC,GAAM;QACtB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC;QAChC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAED,MAAM;QACL,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IAC7B,CAAC;IAED,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IACvC,CAAC;CACD","file":"lifecycle.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["\nimport { Iterable } from './iterator.js';\n\n// #region Disposable Tracking\n\n/**\n * Enables logging of potentially leaked disposables.\n *\n * A disposable is considered leaked if it is not disposed or not registered as the child of\n * another disposable. This tracking is very simple an only works for classes that either\n * extend Disposable or use a DisposableStore. This means there are a lot of false positives.\n */\nconst TRACK_DISPOSABLES = false;\nlet disposableTracker: IDisposableTracker | null = null;\n\nexport interface IDisposableTracker {\n\t/**\n\t * Is called on construction of a disposable.\n\t*/\n\ttrackDisposable(disposable: IDisposable): void;\n\n\t/**\n\t * Is called when a disposable is registered as child of another disposable (e.g. {@link DisposableStore}).\n\t * If parent is `null`, the disposable is removed from its former parent.\n\t*/\n\tsetParent(child: IDisposable, parent: IDisposable | null): void;\n\n\t/**\n\t * Is called after a disposable is disposed.\n\t*/\n\tmarkAsDisposed(disposable: IDisposable): void;\n\n\t/**\n\t * Indicates that the given object is a singleton which does not need to be disposed.\n\t*/\n\tmarkAsSingleton(disposable: IDisposable): void;\n}\n\nexport function setDisposableTracker(tracker: IDisposableTracker | null): void {\n\tdisposableTracker = tracker;\n}\n\nif (TRACK_DISPOSABLES) {\n\tconst __is_disposable_tracked__ = '__is_disposable_tracked__';\n\tsetDisposableTracker(new class implements IDisposableTracker {\n\t\ttrackDisposable(x: IDisposable): void {\n\t\t\tconst stack = new Error('Potentially leaked disposable').stack!;\n\t\t\tsetTimeout(() => {\n\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\tif (!(x as any)[__is_disposable_tracked__]) {\n\t\t\t\t\tconsole.log(stack);\n\t\t\t\t}\n\t\t\t}, 3000);\n\t\t}\n\n\t\tsetParent(child: IDisposable, parent: IDisposable | null): void {\n\t\t\tif (child && child !== Disposable.None) {\n\t\t\t\ttry {\n\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\t\t(child as any)[__is_disposable_tracked__] = true;\n\t\t\t\t} catch {\n\t\t\t\t\t// noop\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tmarkAsDisposed(disposable: IDisposable): void {\n\t\t\tif (disposable && disposable !== Disposable.None) {\n\t\t\t\ttry {\n\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\t\t(disposable as any)[__is_disposable_tracked__] = true;\n\t\t\t\t} catch {\n\t\t\t\t\t// noop\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tmarkAsSingleton(disposable: IDisposable): void { }\n\t});\n}\n\nexport function trackDisposable<T extends IDisposable>(x: T): T {\n\tdisposableTracker?.trackDisposable(x);\n\treturn x;\n}\n\nexport function markAsDisposed(disposable: IDisposable): void {\n\tdisposableTracker?.markAsDisposed(disposable);\n}\n\nfunction setParentOfDisposable(child: IDisposable, parent: IDisposable | null): void {\n\tdisposableTracker?.setParent(child, parent);\n}\n\nfunction setParentOfDisposables(children: IDisposable[], parent: IDisposable | null): void {\n\tif (!disposableTracker) {\n\t\treturn;\n\t}\n\tfor (const child of children) {\n\t\tdisposableTracker.setParent(child, parent);\n\t}\n}\n\n/**\n * Indicates that the given object is a singleton which does not need to be disposed.\n*/\nexport function markAsSingleton<T extends IDisposable>(singleton: T): T {\n\tdisposableTracker?.markAsSingleton(singleton);\n\treturn singleton;\n}\n\n// #endregion\n\n/**\n * An object that performs a cleanup operation when `.dispose()` is called.\n *\n * Some examples of how disposables are used:\n *\n * - An event listener that removes itself when `.dispose()` is called.\n * - A resource such as a file system watcher that cleans up the resource when `.dispose()` is called.\n * - The return value from registering a provider. When `.dispose()` is called, the provider is unregistered.\n */\nexport interface IDisposable {\n\tdispose(): void;\n}\n\n/**\n * Check if `thing` is {@link IDisposable disposable}.\n */\nexport function isDisposable<E>(thing: E): thing is E & IDisposable {\n\t// eslint-disable-next-line local/code-no-any-casts\n\treturn typeof thing === 'object' && thing !== null && typeof (<IDisposable><any>thing).dispose === 'function' && (<IDisposable><any>thing).dispose.length === 0;\n}\n\n/**\n * Disposes of the value(s) passed in.\n */\nexport function dispose<T extends IDisposable>(disposable: T): T;\nexport function dispose<T extends IDisposable>(disposable: T | undefined): T | undefined;\nexport function dispose<T extends IDisposable, A extends Iterable<T> = Iterable<T>>(disposables: A): A;\nexport function dispose<T extends IDisposable>(disposables: Array<T>): Array<T>;\nexport function dispose<T extends IDisposable>(disposables: ReadonlyArray<T>): ReadonlyArray<T>;\nexport function dispose<T extends IDisposable>(arg: T | Iterable<T> | undefined): any {\n\tif (Iterable.is(arg)) {\n\t\tconst errors: any[] = [];\n\n\t\tfor (const d of arg) {\n\t\t\tif (d) {\n\t\t\t\ttry {\n\t\t\t\t\td.dispose();\n\t\t\t\t} catch (e) {\n\t\t\t\t\terrors.push(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (errors.length === 1) {\n\t\t\tthrow errors[0];\n\t\t} else if (errors.length > 1) {\n\t\t\tthrow new AggregateError(errors, 'Encountered errors while disposing of store');\n\t\t}\n\n\t\treturn Array.isArray(arg) ? [] : arg;\n\t} else if (arg) {\n\t\targ.dispose();\n\t\treturn arg;\n\t}\n}\n\n/**\n * Combine multiple disposable values into a single {@link IDisposable}.\n */\nexport function combinedDisposable(...disposables: IDisposable[]): IDisposable {\n\tconst parent = toDisposable(() => dispose(disposables));\n\tsetParentOfDisposables(disposables, parent);\n\treturn parent;\n}\n\nclass FunctionDisposable implements IDisposable {\n\tprivate _isDisposed: boolean;\n\tprivate readonly _fn: () => void;\n\n\tconstructor(fn: () => void) {\n\t\tthis._isDisposed = false;\n\t\tthis._fn = fn;\n\t\ttrackDisposable(this);\n\t}\n\n\tdispose() {\n\t\tif (this._isDisposed) {\n\t\t\treturn;\n\t\t}\n\t\tif (!this._fn) {\n\t\t\tthrow new Error(`Unbound disposable context: Need to use an arrow function to preserve the value of this`);\n\t\t}\n\t\tthis._isDisposed = true;\n\t\tmarkAsDisposed(this);\n\t\tthis._fn();\n\t}\n}\n\n/**\n * Turn a function that implements dispose into an {@link IDisposable}.\n *\n * @param fn Clean up function, guaranteed to be called only **once**.\n */\nexport function toDisposable(fn: () => void): IDisposable {\n\treturn new FunctionDisposable(fn);\n}\n\n/**\n * Manages a collection of disposable values.\n *\n * This is the preferred way to manage multiple disposables. A `DisposableStore` is safer to work with than an\n * `IDisposable[]` as it considers edge cases, such as registering the same value multiple times or adding an item to a\n * store that has already been disposed of.\n */\nexport class DisposableStore implements IDisposable {\n\n\tstatic DISABLE_DISPOSED_WARNING = false;\n\n\tprivate readonly _toDispose = new Set<IDisposable>();\n\tprivate _isDisposed = false;\n\n\tconstructor() {\n\t\ttrackDisposable(this);\n\t}\n\n\t/**\n\t * Dispose of all registered disposables and mark this object as disposed.\n\t *\n\t * Any future disposables added to this object will be disposed of on `add`.\n\t */\n\tpublic dispose(): void {\n\t\tif (this._isDisposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tmarkAsDisposed(this);\n\t\tthis._isDisposed = true;\n\t\tthis.clear();\n\t}\n\n\t/**\n\t * @return `true` if this object has been disposed of.\n\t */\n\tpublic get isDisposed(): boolean {\n\t\treturn this._isDisposed;\n\t}\n\n\t/**\n\t * Dispose of all registered disposables but do not mark this object as disposed.\n\t */\n\tpublic clear(): void {\n\t\tif (this._toDispose.size === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tdispose(this._toDispose);\n\t\t} finally {\n\t\t\tthis._toDispose.clear();\n\t\t}\n\t}\n\n\t/**\n\t * Add a new {@link IDisposable disposable} to the collection.\n\t */\n\tpublic add<T extends IDisposable>(o: T): T {\n\t\tif (!o || o === Disposable.None) {\n\t\t\treturn o;\n\t\t}\n\t\tif ((o as unknown as DisposableStore) === this) {\n\t\t\tthrow new Error('Cannot register a disposable on itself!');\n\t\t}\n\n\t\tsetParentOfDisposable(o, this);\n\t\tif (this._isDisposed) {\n\t\t\tif (!DisposableStore.DISABLE_DISPOSED_WARNING) {\n\t\t\t\tconsole.warn(new Error('Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!').stack);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._toDispose.add(o);\n\t\t}\n\n\t\treturn o;\n\t}\n\n\t/**\n\t * Deletes a disposable from store and disposes of it. This will not throw or warn and proceed to dispose the\n\t * disposable even when the disposable is not part in the store.\n\t */\n\tpublic delete<T extends IDisposable>(o: T): void {\n\t\tif (!o) {\n\t\t\treturn;\n\t\t}\n\t\tif ((o as unknown as DisposableStore) === this) {\n\t\t\tthrow new Error('Cannot dispose a disposable on itself!');\n\t\t}\n\t\tthis._toDispose.delete(o);\n\t\to.dispose();\n\t}\n}\n\n/**\n * Abstract base class for a {@link IDisposable disposable} object.\n *\n * Subclasses can {@linkcode _register} disposables that will be automatically cleaned up when this object is disposed of.\n */\nexport abstract class Disposable implements IDisposable {\n\n\t/**\n\t * A disposable that does nothing when it is disposed of.\n\t *\n\t * TODO: This should not be a static property.\n\t */\n\tstatic readonly None = Object.freeze<IDisposable>({ dispose() { } });\n\n\tprotected readonly _store = new DisposableStore();\n\n\tconstructor() {\n\t\ttrackDisposable(this);\n\t\tsetParentOfDisposable(this._store, this);\n\t}\n\n\tpublic dispose(): void {\n\t\tmarkAsDisposed(this);\n\n\t\tthis._store.dispose();\n\t}\n\n\t/**\n\t * Adds `o` to the collection of disposables managed by this object.\n\t */\n\tprotected _register<T extends IDisposable>(o: T): T {\n\t\tif ((o as unknown as Disposable) === this) {\n\t\t\tthrow new Error('Cannot register a disposable on itself!');\n\t\t}\n\t\treturn this._store.add(o);\n\t}\n}\n\n/**\n * Manages the lifecycle of a disposable value that may be changed.\n *\n * This ensures that when the disposable value is changed, the previously held disposable is disposed of. You can\n * also register a `MutableDisposable` on a `Disposable` to ensure it is automatically cleaned up.\n */\nexport class MutableDisposable<T extends IDisposable> implements IDisposable {\n\tprivate _value?: T;\n\tprivate _isDisposed = false;\n\n\tconstructor() {\n\t\ttrackDisposable(this);\n\t}\n\n\t/**\n\t * Get the currently held disposable value, or `undefined` if this MutableDisposable has been disposed\n\t */\n\tget value(): T | undefined {\n\t\treturn this._isDisposed ? undefined : this._value;\n\t}\n\n\t/**\n\t * Set a new disposable value.\n\t *\n\t * Behaviour:\n\t * - If the MutableDisposable has been disposed, the setter is a no-op.\n\t * - If the new value is strictly equal to the current value, the setter is a no-op.\n\t * - Otherwise the previous value (if any) is disposed and the new value is stored.\n\t *\n\t * Related helpers:\n\t * - clear() resets the value to `undefined` (and disposes the previous value).\n\t * - clearAndLeak() returns the old value without disposing it and removes its parent.\n\t */\n\tset value(value: T | undefined) {\n\t\tif (this._isDisposed || value === this._value) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._value?.dispose();\n\t\tif (value) {\n\t\t\tsetParentOfDisposable(value, this);\n\t\t}\n\t\tthis._value = value;\n\t}\n\n\t/**\n\t * Resets the stored value and disposed of the previously stored value.\n\t */\n\tclear(): void {\n\t\tthis.value = undefined;\n\t}\n\n\tdispose(): void {\n\t\tthis._isDisposed = true;\n\t\tmarkAsDisposed(this);\n\t\tthis._value?.dispose();\n\t\tthis._value = undefined;\n\t}\n}\n\nexport class RefCountedDisposable {\n\n\tprivate _counter: number = 1;\n\n\tconstructor(\n\t\tprivate readonly _disposable: IDisposable,\n\t) { }\n\n\tacquire() {\n\t\tthis._counter++;\n\t\treturn this;\n\t}\n\n\trelease() {\n\t\tif (--this._counter === 0) {\n\t\t\tthis._disposable.dispose();\n\t\t}\n\t\treturn this;\n\t}\n}\n\nexport interface IReference<T> extends IDisposable {\n\treadonly object: T;\n}\n\nexport class ImmortalReference<T> implements IReference<T> {\n\tconstructor(public object: T) { }\n\tdispose(): void { /* noop */ }\n}\n\n/**\n * A map the manages the lifecycle of the values that it stores.\n */\nexport class DisposableMap<K, V extends IDisposable = IDisposable> implements IDisposable {\n\n\tprivate readonly _store: Map<K, V>;\n\tprivate _isDisposed = false;\n\n\tconstructor(store: Map<K, V> = new Map<K, V>()) {\n\t\tthis._store = store;\n\t\ttrackDisposable(this);\n\t}\n\n\t/**\n\t * Disposes of all stored values and mark this object as disposed.\n\t *\n\t * Trying to use this object after it has been disposed of is an error.\n\t */\n\tdispose(): void {\n\t\tmarkAsDisposed(this);\n\t\tthis._isDisposed = true;\n\t\tthis.clearAndDisposeAll();\n\t}\n\n\t/**\n\t * Disposes of all stored values and clear the map, but DO NOT mark this object as disposed.\n\t */\n\tclearAndDisposeAll(): void {\n\t\tif (!this._store.size) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tdispose(this._store.values());\n\t\t} finally {\n\t\t\tthis._store.clear();\n\t\t}\n\t}\n\n\tget(key: K): V | undefined {\n\t\treturn this._store.get(key);\n\t}\n\n\tset(key: K, value: V, skipDisposeOnOverwrite = false): void {\n\t\tif (this._isDisposed) {\n\t\t\tconsole.warn(new Error('Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!').stack);\n\t\t}\n\n\t\tif (!skipDisposeOnOverwrite) {\n\t\t\tthis._store.get(key)?.dispose();\n\t\t}\n\n\t\tthis._store.set(key, value);\n\t\tsetParentOfDisposable(value, this);\n\t}\n\n\t/**\n\t * Delete the value stored for `key` from this map and also dispose of it.\n\t */\n\tdeleteAndDispose(key: K): void {\n\t\tthis._store.get(key)?.dispose();\n\t\tthis._store.delete(key);\n\t}\n\n\tvalues(): IterableIterator<V> {\n\t\treturn this._store.values();\n\t}\n\n\t[Symbol.iterator](): IterableIterator<[K, V]> {\n\t\treturn this._store[Symbol.iterator]();\n\t}\n}\n","\nimport { Iterable } from './iterator.js';\n\n// #region Disposable Tracking\n\n/**\n * Enables logging of potentially leaked disposables.\n *\n * A disposable is considered leaked if it is not disposed or not registered as the child of\n * another disposable. This tracking is very simple an only works for classes that either\n * extend Disposable or use a DisposableStore. This means there are a lot of false positives.\n */\nconst TRACK_DISPOSABLES = false;\nlet disposableTracker: IDisposableTracker | null = null;\n\nexport interface IDisposableTracker {\n\t/**\n\t * Is called on construction of a disposable.\n\t*/\n\ttrackDisposable(disposable: IDisposable): void;\n\n\t/**\n\t * Is called when a disposable is registered as child of another disposable (e.g. {@link DisposableStore}).\n\t * If parent is `null`, the disposable is removed from its former parent.\n\t*/\n\tsetParent(child: IDisposable, parent: IDisposable | null): void;\n\n\t/**\n\t * Is called after a disposable is disposed.\n\t*/\n\tmarkAsDisposed(disposable: IDisposable): void;\n\n\t/**\n\t * Indicates that the given object is a singleton which does not need to be disposed.\n\t*/\n\tmarkAsSingleton(disposable: IDisposable): void;\n}\n\nexport function setDisposableTracker(tracker: IDisposableTracker | null): void {\n\tdisposableTracker = tracker;\n}\n\nif (TRACK_DISPOSABLES) {\n\tconst __is_disposable_tracked__ = '__is_disposable_tracked__';\n\tsetDisposableTracker(new class implements IDisposableTracker {\n\t\ttrackDisposable(x: IDisposable): void {\n\t\t\tconst stack = new Error('Potentially leaked disposable').stack!;\n\t\t\tsetTimeout(() => {\n\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\tif (!(x as any)[__is_disposable_tracked__]) {\n\t\t\t\t\tconsole.log(stack);\n\t\t\t\t}\n\t\t\t}, 3000);\n\t\t}\n\n\t\tsetParent(child: IDisposable, parent: IDisposable | null): void {\n\t\t\tif (child && child !== Disposable.None) {\n\t\t\t\ttry {\n\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\t\t(child as any)[__is_disposable_tracked__] = true;\n\t\t\t\t} catch {\n\t\t\t\t\t// noop\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tmarkAsDisposed(disposable: IDisposable): void {\n\t\t\tif (disposable && disposable !== Disposable.None) {\n\t\t\t\ttry {\n\t\t\t\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\t\t\t\t(disposable as any)[__is_disposable_tracked__] = true;\n\t\t\t\t} catch {\n\t\t\t\t\t// noop\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tmarkAsSingleton(disposable: IDisposable): void { }\n\t});\n}\n\nexport function trackDisposable<T extends IDisposable>(x: T): T {\n\tdisposableTracker?.trackDisposable(x);\n\treturn x;\n}\n\nexport function markAsDisposed(disposable: IDisposable): void {\n\tdisposableTracker?.markAsDisposed(disposable);\n}\n\nfunction setParentOfDisposable(child: IDisposable, parent: IDisposable | null): void {\n\tdisposableTracker?.setParent(child, parent);\n}\n\nfunction setParentOfDisposables(children: IDisposable[], parent: IDisposable | null): void {\n\tif (!disposableTracker) {\n\t\treturn;\n\t}\n\tfor (const child of children) {\n\t\tdisposableTracker.setParent(child, parent);\n\t}\n}\n\n/**\n * Indicates that the given object is a singleton which does not need to be disposed.\n*/\nexport function markAsSingleton<T extends IDisposable>(singleton: T): T {\n\tdisposableTracker?.markAsSingleton(singleton);\n\treturn singleton;\n}\n\n// #endregion\n\n/**\n * An object that performs a cleanup operation when `.dispose()` is called.\n *\n * Some examples of how disposables are used:\n *\n * - An event listener that removes itself when `.dispose()` is called.\n * - A resource such as a file system watcher that cleans up the resource when `.dispose()` is called.\n * - The return value from registering a provider. When `.dispose()` is called, the provider is unregistered.\n */\nexport interface IDisposable {\n\tdispose(): void;\n}\n\n/**\n * Check if `thing` is {@link IDisposable disposable}.\n */\nexport function isDisposable<E>(thing: E): thing is E & IDisposable {\n\t// eslint-disable-next-line local/code-no-any-casts\n\treturn typeof thing === 'object' && thing !== null && typeof (<IDisposable><any>thing).dispose === 'function' && (<IDisposable><any>thing).dispose.length === 0;\n}\n\n/**\n * Disposes of the value(s) passed in.\n */\nexport function dispose<T extends IDisposable>(disposable: T): T;\nexport function dispose<T extends IDisposable>(disposable: T | undefined): T | undefined;\nexport function dispose<T extends IDisposable, A extends Iterable<T> = Iterable<T>>(disposables: A): A;\nexport function dispose<T extends IDisposable>(disposables: Array<T>): Array<T>;\nexport function dispose<T extends IDisposable>(disposables: ReadonlyArray<T>): ReadonlyArray<T>;\nexport function dispose<T extends IDisposable>(arg: T | Iterable<T> | undefined): any {\n\tif (Iterable.is(arg)) {\n\t\tconst errors: any[] = [];\n\n\t\tfor (const d of arg) {\n\t\t\tif (d) {\n\t\t\t\ttry {\n\t\t\t\t\td.dispose();\n\t\t\t\t} catch (e) {\n\t\t\t\t\terrors.push(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (errors.length === 1) {\n\t\t\tthrow errors[0];\n\t\t} else if (errors.length > 1) {\n\t\t\tthrow new AggregateError(errors, 'Encountered errors while disposing of store');\n\t\t}\n\n\t\treturn Array.isArray(arg) ? [] : arg;\n\t} else if (arg) {\n\t\targ.dispose();\n\t\treturn arg;\n\t}\n}\n\n/**\n * Combine multiple disposable values into a single {@link IDisposable}.\n */\nexport function combinedDisposable(...disposables: IDisposable[]): IDisposable {\n\tconst parent = toDisposable(() => dispose(disposables));\n\tsetParentOfDisposables(disposables, parent);\n\treturn parent;\n}\n\nclass FunctionDisposable implements IDisposable {\n\tprivate _isDisposed: boolean;\n\tprivate readonly _fn: () => void;\n\n\tconstructor(fn: () => void) {\n\t\tthis._isDisposed = false;\n\t\tthis._fn = fn;\n\t\ttrackDisposable(this);\n\t}\n\n\tdispose() {\n\t\tif (this._isDisposed) {\n\t\t\treturn;\n\t\t}\n\t\tif (!this._fn) {\n\t\t\tthrow new Error(`Unbound disposable context: Need to use an arrow function to preserve the value of this`);\n\t\t}\n\t\tthis._isDisposed = true;\n\t\tmarkAsDisposed(this);\n\t\tthis._fn();\n\t}\n}\n\n/**\n * Turn a function that implements dispose into an {@link IDisposable}.\n *\n * @param fn Clean up function, guaranteed to be called only **once**.\n */\nexport function toDisposable(fn: () => void): IDisposable {\n\treturn new FunctionDisposable(fn);\n}\n\n/**\n * Manages a collection of disposable values.\n *\n * This is the preferred way to manage multiple disposables. A `DisposableStore` is safer to work with than an\n * `IDisposable[]` as it considers edge cases, such as registering the same value multiple times or adding an item to a\n * store that has already been disposed of.\n */\nexport class DisposableStore implements IDisposable {\n\n\tstatic DISABLE_DISPOSED_WARNING = false;\n\n\tprivate readonly _toDispose = new Set<IDisposable>();\n\tprivate _isDisposed = false;\n\n\tconstructor() {\n\t\ttrackDisposable(this);\n\t}\n\n\t/**\n\t * Dispose of all registered disposables and mark this object as disposed.\n\t *\n\t * Any future disposables added to this object will be disposed of on `add`.\n\t */\n\tpublic dispose(): void {\n\t\tif (this._isDisposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tmarkAsDisposed(this);\n\t\tthis._isDisposed = true;\n\t\tthis.clear();\n\t}\n\n\t/**\n\t * @return `true` if this object has been disposed of.\n\t */\n\tpublic get isDisposed(): boolean {\n\t\treturn this._isDisposed;\n\t}\n\n\t/**\n\t * Dispose of all registered disposables but do not mark this object as disposed.\n\t */\n\tpublic clear(): void {\n\t\tif (this._toDispose.size === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tdispose(this._toDispose);\n\t\t} finally {\n\t\t\tthis._toDispose.clear();\n\t\t}\n\t}\n\n\t/**\n\t * Add a new {@link IDisposable disposable} to the collection.\n\t */\n\tpublic add<T extends IDisposable>(o: T): T {\n\t\tif (!o || o === Disposable.None) {\n\t\t\treturn o;\n\t\t}\n\t\tif ((o as unknown as DisposableStore) === this) {\n\t\t\tthrow new Error('Cannot register a disposable on itself!');\n\t\t}\n\n\t\tsetParentOfDisposable(o, this);\n\t\tif (this._isDisposed) {\n\t\t\tif (!DisposableStore.DISABLE_DISPOSED_WARNING) {\n\t\t\t\tconsole.warn(new Error('Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!').stack);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._toDispose.add(o);\n\t\t}\n\n\t\treturn o;\n\t}\n\n\t/**\n\t * Deletes a disposable from store and disposes of it. This will not throw or warn and proceed to dispose the\n\t * disposable even when the disposable is not part in the store.\n\t */\n\tpublic delete<T extends IDisposable>(o: T): void {\n\t\tif (!o) {\n\t\t\treturn;\n\t\t}\n\t\tif ((o as unknown as DisposableStore) === this) {\n\t\t\tthrow new Error('Cannot dispose a disposable on itself!');\n\t\t}\n\t\tthis._toDispose.delete(o);\n\t\to.dispose();\n\t}\n}\n\n/**\n * Abstract base class for a {@link IDisposable disposable} object.\n *\n * Subclasses can {@linkcode _register} disposables that will be automatically cleaned up when this object is disposed of.\n */\nexport abstract class Disposable implements IDisposable {\n\n\t/**\n\t * A disposable that does nothing when it is disposed of.\n\t *\n\t * TODO: This should not be a static property.\n\t */\n\tstatic readonly None = Object.freeze<IDisposable>({ dispose() { } });\n\n\tprotected readonly _store = new DisposableStore();\n\n\tconstructor() {\n\t\ttrackDisposable(this);\n\t\tsetParentOfDisposable(this._store, this);\n\t}\n\n\tpublic dispose(): void {\n\t\tmarkAsDisposed(this);\n\n\t\tthis._store.dispose();\n\t}\n\n\t/**\n\t * Adds `o` to the collection of disposables managed by this object.\n\t */\n\tprotected _register<T extends IDisposable>(o: T): T {\n\t\tif ((o as unknown as Disposable) === this) {\n\t\t\tthrow new Error('Cannot register a disposable on itself!');\n\t\t}\n\t\treturn this._store.add(o);\n\t}\n}\n\n/**\n * Manages the lifecycle of a disposable value that may be changed.\n *\n * This ensures that when the disposable value is changed, the previously held disposable is disposed of. You can\n * also register a `MutableDisposable` on a `Disposable` to ensure it is automatically cleaned up.\n */\nexport class MutableDisposable<T extends IDisposable> implements IDisposable {\n\tprivate _value?: T;\n\tprivate _isDisposed = false;\n\n\tconstructor() {\n\t\ttrackDisposable(this);\n\t}\n\n\t/**\n\t * Get the currently held disposable value, or `undefined` if this MutableDisposable has been disposed\n\t */\n\tget value(): T | undefined {\n\t\treturn this._isDisposed ? undefined : this._value;\n\t}\n\n\t/**\n\t * Set a new disposable value.\n\t *\n\t * Behaviour:\n\t * - If the MutableDisposable has been disposed, the setter is a no-op.\n\t * - If the new value is strictly equal to the current value, the setter is a no-op.\n\t * - Otherwise the previous value (if any) is disposed and the new value is stored.\n\t *\n\t * Related helpers:\n\t * - clear() resets the value to `undefined` (and disposes the previous value).\n\t * - clearAndLeak() returns the old value without disposing it and removes its parent.\n\t */\n\tset value(value: T | undefined) {\n\t\tif (this._isDisposed || value === this._value) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._value?.dispose();\n\t\tif (value) {\n\t\t\tsetParentOfDisposable(value, this);\n\t\t}\n\t\tthis._value = value;\n\t}\n\n\t/**\n\t * Resets the stored value and disposed of the previously stored value.\n\t */\n\tclear(): void {\n\t\tthis.value = undefined;\n\t}\n\n\tdispose(): void {\n\t\tthis._isDisposed = true;\n\t\tmarkAsDisposed(this);\n\t\tthis._value?.dispose();\n\t\tthis._value = undefined;\n\t}\n}\n\nexport class RefCountedDisposable {\n\n\tprivate _counter: number = 1;\n\n\tconstructor(\n\t\tprivate readonly _disposable: IDisposable,\n\t) { }\n\n\tacquire() {\n\t\tthis._counter++;\n\t\treturn this;\n\t}\n\n\trelease() {\n\t\tif (--this._counter === 0) {\n\t\t\tthis._disposable.dispose();\n\t\t}\n\t\treturn this;\n\t}\n}\n\nexport interface IReference<T> extends IDisposable {\n\treadonly object: T;\n}\n\nexport class ImmortalReference<T> implements IReference<T> {\n\tconstructor(public object: T) { }\n\tdispose(): void { /* noop */ }\n}\n\n/**\n * A map the manages the lifecycle of the values that it stores.\n */\nexport class DisposableMap<K, V extends IDisposable = IDisposable> implements IDisposable {\n\n\tprivate readonly _store: Map<K, V>;\n\tprivate _isDisposed = false;\n\n\tconstructor(store: Map<K, V> = new Map<K, V>()) {\n\t\tthis._store = store;\n\t\ttrackDisposable(this);\n\t}\n\n\t/**\n\t * Disposes of all stored values and mark this object as disposed.\n\t *\n\t * Trying to use this object after it has been disposed of is an error.\n\t */\n\tdispose(): void {\n\t\tmarkAsDisposed(this);\n\t\tthis._isDisposed = true;\n\t\tthis.clearAndDisposeAll();\n\t}\n\n\t/**\n\t * Disposes of all stored values and clear the map, but DO NOT mark this object as disposed.\n\t */\n\tclearAndDisposeAll(): void {\n\t\tif (!this._store.size) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tdispose(this._store.values());\n\t\t} finally {\n\t\t\tthis._store.clear();\n\t\t}\n\t}\n\n\tget(key: K): V | undefined {\n\t\treturn this._store.get(key);\n\t}\n\n\tset(key: K, value: V, skipDisposeOnOverwrite = false): void {\n\t\tif (this._isDisposed) {\n\t\t\tconsole.warn(new Error('Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!').stack);\n\t\t}\n\n\t\tif (!skipDisposeOnOverwrite) {\n\t\t\tthis._store.get(key)?.dispose();\n\t\t}\n\n\t\tthis._store.set(key, value);\n\t\tsetParentOfDisposable(value, this);\n\t}\n\n\t/**\n\t * Delete the value stored for `key` from this map and also dispose of it.\n\t */\n\tdeleteAndDispose(key: K): void {\n\t\tthis._store.get(key)?.dispose();\n\t\tthis._store.delete(key);\n\t}\n\n\tvalues(): IterableIterator<V> {\n\t\treturn this._store.values();\n\t}\n\n\t[Symbol.iterator](): IterableIterator<[K, V]> {\n\t\treturn this._store[Symbol.iterator]();\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/marshallingIds.ts","vs/base/common/marshallingIds.ts"],"names":[],"mappings":"AAAA;;;gGAGgG","file":"marshallingIds.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\nexport const enum MarshalledId {\n\tUri = 1,\n\tRegexp,\n\tScmResource,\n\tScmResourceGroup,\n\tScmProvider,\n\tCommentController,\n\tCommentThread,\n\tCommentThreadInstance,\n\tCommentThreadReply,\n\tCommentNode,\n\tCommentThreadNode,\n\tTimelineActionContext,\n\tNotebookCellActionContext,\n\tNotebookActionContext,\n\tTerminalContext,\n\tTestItemContext,\n\tDate,\n\tTestMessageMenuArgs,\n\tChatViewContext,\n\tLanguageModelToolResult,\n\tLanguageModelTextPart,\n\tLanguageModelThinkingPart,\n\tLanguageModelPromptTsxPart,\n\tLanguageModelDataPart,\n\tChatSessionContext,\n\tChatResponsePullRequestPart,\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nexport const enum MarshalledId {\n\tUri = 1,\n\tRegexp,\n\tScmResource,\n\tScmResourceGroup,\n\tScmProvider,\n\tCommentController,\n\tCommentThread,\n\tCommentThreadInstance,\n\tCommentThreadReply,\n\tCommentNode,\n\tCommentThreadNode,\n\tTimelineActionContext,\n\tNotebookCellActionContext,\n\tNotebookActionContext,\n\tTerminalContext,\n\tTestItemContext,\n\tDate,\n\tTestMessageMenuArgs,\n\tChatViewContext,\n\tLanguageModelToolResult,\n\tLanguageModelTextPart,\n\tLanguageModelThinkingPart,\n\tLanguageModelPromptTsxPart,\n\tLanguageModelDataPart,\n\tChatSessionContext,\n\tChatResponsePullRequestPart,\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/marshallingIds.ts","vs/base/common/marshallingIds.ts"],"names":[],"mappings":"AAAA;;;gGAGgG","file":"marshallingIds.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\nexport const enum MarshalledId {\n\tUri = 1,\n\tRegexp,\n\tScmResource,\n\tScmResourceGroup,\n\tScmProvider,\n\tCommentController,\n\tCommentThread,\n\tCommentThreadInstance,\n\tCommentThreadReply,\n\tCommentNode,\n\tCommentThreadNode,\n\tTimelineActionContext,\n\tNotebookCellActionContext,\n\tNotebookActionContext,\n\tTerminalContext,\n\tTestItemContext,\n\tDate,\n\tTestMessageMenuArgs,\n\tChatViewContext,\n\tLanguageModelToolResult,\n\tLanguageModelTextPart,\n\tLanguageModelThinkingPart,\n\tLanguageModelPromptTsxPart,\n\tLanguageModelDataPart,\n\tAgentSessionContext,\n\tChatResponsePullRequestPart,\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nexport const enum MarshalledId {\n\tUri = 1,\n\tRegexp,\n\tScmResource,\n\tScmResourceGroup,\n\tScmProvider,\n\tCommentController,\n\tCommentThread,\n\tCommentThreadInstance,\n\tCommentThreadReply,\n\tCommentNode,\n\tCommentThreadNode,\n\tTimelineActionContext,\n\tNotebookCellActionContext,\n\tNotebookActionContext,\n\tTerminalContext,\n\tTestItemContext,\n\tDate,\n\tTestMessageMenuArgs,\n\tChatViewContext,\n\tLanguageModelToolResult,\n\tLanguageModelTextPart,\n\tLanguageModelThinkingPart,\n\tLanguageModelPromptTsxPart,\n\tLanguageModelDataPart,\n\tAgentSessionContext,\n\tChatResponsePullRequestPart,\n}\n"]}
@@ -9,7 +9,7 @@ export { disposableObservableValue } from './observables/observableValue.js';
9
9
  export { derived, derivedDisposable, derivedHandleChanges, derivedOpts, derivedWithSetter } from './observables/derived.js';
10
10
  export { ObservablePromise, PromiseResult } from './utils/promise.js';
11
11
  export { waitForState } from './utils/utilsCancellation.js';
12
- export { debouncedObservable, debouncedObservable2, derivedObservableWithCache, derivedObservableWithWritableCache, keepObserved, mapObservableArrayCached, recomputeInitiallyAndOnChange } from './utils/utils.js';
12
+ export { debouncedObservable, debouncedObservable2, derivedObservableWithCache, derivedObservableWithWritableCache, keepObserved, mapObservableArrayCached, observableFromPromise, recomputeInitiallyAndOnChange, isObservable } from './utils/utils.js';
13
13
  export { recordChanges, recordChangesLazy } from './changeTracker.js';
14
14
  export { constObservable } from './observables/constObservable.js';
15
15
  export { observableSignal } from './observables/observableSignal.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/observableInternal/index.ts","vs/base/common/observableInternal/index.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,6EAA6E;AAE7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,WAAW,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAEnJ,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,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sC,CAAC;AACvG,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,2BAA2B,CAAC,uBAAuB,CAAC,CAAC;AACrD,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;AAE3C,iDAAiD;AACjD,MAAM,aAAa,GAAG,KAAK,CAEzB;AAEF,IAAI,aAAa,EAAE,CAAC;IACnB,SAAS,CAAC,IAAI,uBAAuB,EAAE,CAAC,CAAC;AAC1C,CAAC;AAED,IAAI,GAAG,IAAI,GAAG,CAAC,8BAA8B,CAAC,EAAE,CAAC;IAChD,kFAAkF;IAClF,SAAS,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC,CAAC;AACzC,CAAC","file":"index.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\n// This is a facade for the observable implementation. Only import from here!\n\nexport { observableValueOpts } from './observables/observableValueOpts.js';\nexport { autorun, autorunDelta, autorunHandleChanges, autorunOpts, autorunWithStore, autorunWithStoreHandleChanges } from './reactions/autorun.js';\nexport { type IObservable, type IObservableWithChange, type IObserver, type IReader, type ISettable, type ISettableObservable, type ITransaction } from './base.js';\nexport { disposableObservableValue } from './observables/observableValue.js';\nexport { derived, derivedDisposable, derivedHandleChanges, derivedOpts, derivedWithSetter } from './observables/derived.js';\nexport { type IDerivedReader } from './observables/derivedImpl.js';\nexport { ObservablePromise, PromiseResult } from './utils/promise.js';\nexport { waitForState } from './utils/utilsCancellation.js';\nexport {\n\tdebouncedObservable, debouncedObservable2, derivedObservableWithCache,\n\tderivedObservableWithWritableCache, keepObserved, mapObservableArrayCached,\n\trecomputeInitiallyAndOnChange } from './utils/utils.js';\nexport { type DebugOwner } from './debugName.js';\nexport { type IChangeContext, type IChangeTracker, recordChanges, recordChangesLazy } from './changeTracker.js';\nexport { constObservable } from './observables/constObservable.js';\nexport { type IObservableSignal, observableSignal } from './observables/observableSignal.js';\nexport { observableFromEventOpts } from './observables/observableFromEvent.js';\nexport { observableSignalFromEvent } from './observables/observableSignalFromEvent.js';\nexport { asyncTransaction, globalTransaction, subtransaction, transaction, TransactionImpl } from './transaction.js';\nexport { observableFromValueWithChangeEvent, ValueWithChangeEventFromObservable } from './utils/valueWithChangeEvent.js';\nexport { runOnChange, runOnChangeWithCancellationToken, runOnChangeWithStore, type RemoveUndefined } from './utils/runOnChange.js';\nexport { derivedConstOnceDefined } from './experimental/utils.js';\nexport { observableFromEvent } from './observables/observableFromEvent.js';\nexport { observableValue } from './observables/observableValue.js';\nexport { DebugLocation } from './debugLocation.js';\n\nimport { addLogger, setLogObservableFn } from './logging/logging.js';\nimport { ConsoleObservableLogger, logObservableToConsole } from './logging/consoleObservableLogger.js';\nimport { DevToolsLogger } from './logging/debugger/devToolsLogger.js';\nimport { env } from '../process.js';\nimport { _setDebugGetObservableGraph } from './observables/baseObservable.js';\nimport { debugGetObservableGraph } from './logging/debugGetDependencyGraph.js';\n\n_setDebugGetObservableGraph(debugGetObservableGraph);\nsetLogObservableFn(logObservableToConsole);\n\n// Remove \"//\" in the next line to enable logging\nconst enableLogging = false\n\t// || Boolean(\"true\") // done \"weirdly\" so that a lint warning prevents you from pushing this\n\t;\n\nif (enableLogging) {\n\taddLogger(new ConsoleObservableLogger());\n}\n\nif (env && env['VSCODE_DEV_DEBUG_OBSERVABLES']) {\n\t// To debug observables you also need the extension \"ms-vscode.debug-value-editor\"\n\taddLogger(DevToolsLogger.getInstance());\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n// This is a facade for the observable implementation. Only import from here!\n\nexport { observableValueOpts } from './observables/observableValueOpts.js';\nexport { autorun, autorunDelta, autorunHandleChanges, autorunOpts, autorunWithStore, autorunWithStoreHandleChanges } from './reactions/autorun.js';\nexport { type IObservable, type IObservableWithChange, type IObserver, type IReader, type ISettable, type ISettableObservable, type ITransaction } from './base.js';\nexport { disposableObservableValue } from './observables/observableValue.js';\nexport { derived, derivedDisposable, derivedHandleChanges, derivedOpts, derivedWithSetter } from './observables/derived.js';\nexport { type IDerivedReader } from './observables/derivedImpl.js';\nexport { ObservablePromise, PromiseResult } from './utils/promise.js';\nexport { waitForState } from './utils/utilsCancellation.js';\nexport {\n\tdebouncedObservable, debouncedObservable2, derivedObservableWithCache,\n\tderivedObservableWithWritableCache, keepObserved, mapObservableArrayCached,\n\trecomputeInitiallyAndOnChange } from './utils/utils.js';\nexport { type DebugOwner } from './debugName.js';\nexport { type IChangeContext, type IChangeTracker, recordChanges, recordChangesLazy } from './changeTracker.js';\nexport { constObservable } from './observables/constObservable.js';\nexport { type IObservableSignal, observableSignal } from './observables/observableSignal.js';\nexport { observableFromEventOpts } from './observables/observableFromEvent.js';\nexport { observableSignalFromEvent } from './observables/observableSignalFromEvent.js';\nexport { asyncTransaction, globalTransaction, subtransaction, transaction, TransactionImpl } from './transaction.js';\nexport { observableFromValueWithChangeEvent, ValueWithChangeEventFromObservable } from './utils/valueWithChangeEvent.js';\nexport { runOnChange, runOnChangeWithCancellationToken, runOnChangeWithStore, type RemoveUndefined } from './utils/runOnChange.js';\nexport { derivedConstOnceDefined } from './experimental/utils.js';\nexport { observableFromEvent } from './observables/observableFromEvent.js';\nexport { observableValue } from './observables/observableValue.js';\nexport { DebugLocation } from './debugLocation.js';\n\nimport { addLogger, setLogObservableFn } from './logging/logging.js';\nimport { ConsoleObservableLogger, logObservableToConsole } from './logging/consoleObservableLogger.js';\nimport { DevToolsLogger } from './logging/debugger/devToolsLogger.js';\nimport { env } from '../process.js';\nimport { _setDebugGetObservableGraph } from './observables/baseObservable.js';\nimport { debugGetObservableGraph } from './logging/debugGetDependencyGraph.js';\n\n_setDebugGetObservableGraph(debugGetObservableGraph);\nsetLogObservableFn(logObservableToConsole);\n\n// Remove \"//\" in the next line to enable logging\nconst enableLogging = false\n\t// || Boolean(\"true\") // done \"weirdly\" so that a lint warning prevents you from pushing this\n\t;\n\nif (enableLogging) {\n\taddLogger(new ConsoleObservableLogger());\n}\n\nif (env && env['VSCODE_DEV_DEBUG_OBSERVABLES']) {\n\t// To debug observables you also need the extension \"ms-vscode.debug-value-editor\"\n\taddLogger(DevToolsLogger.getInstance());\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/observableInternal/index.ts","vs/base/common/observableInternal/index.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,6EAA6E;AAE7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,WAAW,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAEnJ,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE5H,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EACN,mBAAmB,EAAE,oBAAoB,EAAE,0BAA0B,EACrE,kCAAkC,EAAE,YAAY,EAAE,wBAAwB,EAAE,qBAAqB,EACjG,6BAA6B,EAC7B,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,EAA4C,aAAa,EAAE,iBA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,uBAAuB,EAAE,CAAC,CAAC;AAC1C,CAAC;AAED,IAAI,GAAG,IAAI,GAAG,CAAC,8BAA8B,CAAC,EAAE,CAAC;IAChD,kFAAkF;IAClF,SAAS,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC,CAAC;AACzC,CAAC","file":"index.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\n// This is a facade for the observable implementation. Only import from here!\n\nexport { observableValueOpts } from './observables/observableValueOpts.js';\nexport { autorun, autorunDelta, autorunHandleChanges, autorunOpts, autorunWithStore, autorunWithStoreHandleChanges } from './reactions/autorun.js';\nexport { type IObservable, type IObservableWithChange, type IObserver, type IReader, type ISettable, type ISettableObservable, type ITransaction } from './base.js';\nexport { disposableObservableValue } from './observables/observableValue.js';\nexport { derived, derivedDisposable, derivedHandleChanges, derivedOpts, derivedWithSetter } from './observables/derived.js';\nexport { type IDerivedReader } from './observables/derivedImpl.js';\nexport { ObservablePromise, PromiseResult } from './utils/promise.js';\nexport { waitForState } from './utils/utilsCancellation.js';\nexport {\n\tdebouncedObservable, debouncedObservable2, derivedObservableWithCache,\n\tderivedObservableWithWritableCache, keepObserved, mapObservableArrayCached, observableFromPromise,\n\trecomputeInitiallyAndOnChange,\n\tisObservable } from './utils/utils.js';\nexport { type DebugOwner } from './debugName.js';\nexport { type IChangeContext, type IChangeTracker, recordChanges, recordChangesLazy } from './changeTracker.js';\nexport { constObservable } from './observables/constObservable.js';\nexport { type IObservableSignal, observableSignal } from './observables/observableSignal.js';\nexport { observableFromEventOpts } from './observables/observableFromEvent.js';\nexport { observableSignalFromEvent } from './observables/observableSignalFromEvent.js';\nexport { asyncTransaction, globalTransaction, subtransaction, transaction, TransactionImpl } from './transaction.js';\nexport { observableFromValueWithChangeEvent, ValueWithChangeEventFromObservable } from './utils/valueWithChangeEvent.js';\nexport { runOnChange, runOnChangeWithCancellationToken, runOnChangeWithStore, type RemoveUndefined } from './utils/runOnChange.js';\nexport { derivedConstOnceDefined } from './experimental/utils.js';\nexport { observableFromEvent } from './observables/observableFromEvent.js';\nexport { observableValue } from './observables/observableValue.js';\nexport { DebugLocation } from './debugLocation.js';\n\nimport { addLogger, setLogObservableFn } from './logging/logging.js';\nimport { ConsoleObservableLogger, logObservableToConsole } from './logging/consoleObservableLogger.js';\nimport { DevToolsLogger } from './logging/debugger/devToolsLogger.js';\nimport { env } from '../process.js';\nimport { _setDebugGetObservableGraph } from './observables/baseObservable.js';\nimport { debugGetObservableGraph } from './logging/debugGetDependencyGraph.js';\n\n_setDebugGetObservableGraph(debugGetObservableGraph);\nsetLogObservableFn(logObservableToConsole);\n\n// Remove \"//\" in the next line to enable logging\nconst enableLogging = false\n\t// || Boolean(\"true\") // done \"weirdly\" so that a lint warning prevents you from pushing this\n\t;\n\nif (enableLogging) {\n\taddLogger(new ConsoleObservableLogger());\n}\n\nif (env && env['VSCODE_DEV_DEBUG_OBSERVABLES']) {\n\t// To debug observables you also need the extension \"ms-vscode.debug-value-editor\"\n\taddLogger(DevToolsLogger.getInstance());\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n// This is a facade for the observable implementation. Only import from here!\n\nexport { observableValueOpts } from './observables/observableValueOpts.js';\nexport { autorun, autorunDelta, autorunHandleChanges, autorunOpts, autorunWithStore, autorunWithStoreHandleChanges } from './reactions/autorun.js';\nexport { type IObservable, type IObservableWithChange, type IObserver, type IReader, type ISettable, type ISettableObservable, type ITransaction } from './base.js';\nexport { disposableObservableValue } from './observables/observableValue.js';\nexport { derived, derivedDisposable, derivedHandleChanges, derivedOpts, derivedWithSetter } from './observables/derived.js';\nexport { type IDerivedReader } from './observables/derivedImpl.js';\nexport { ObservablePromise, PromiseResult } from './utils/promise.js';\nexport { waitForState } from './utils/utilsCancellation.js';\nexport {\n\tdebouncedObservable, debouncedObservable2, derivedObservableWithCache,\n\tderivedObservableWithWritableCache, keepObserved, mapObservableArrayCached, observableFromPromise,\n\trecomputeInitiallyAndOnChange,\n\tisObservable } from './utils/utils.js';\nexport { type DebugOwner } from './debugName.js';\nexport { type IChangeContext, type IChangeTracker, recordChanges, recordChangesLazy } from './changeTracker.js';\nexport { constObservable } from './observables/constObservable.js';\nexport { type IObservableSignal, observableSignal } from './observables/observableSignal.js';\nexport { observableFromEventOpts } from './observables/observableFromEvent.js';\nexport { observableSignalFromEvent } from './observables/observableSignalFromEvent.js';\nexport { asyncTransaction, globalTransaction, subtransaction, transaction, TransactionImpl } from './transaction.js';\nexport { observableFromValueWithChangeEvent, ValueWithChangeEventFromObservable } from './utils/valueWithChangeEvent.js';\nexport { runOnChange, runOnChangeWithCancellationToken, runOnChangeWithStore, type RemoveUndefined } from './utils/runOnChange.js';\nexport { derivedConstOnceDefined } from './experimental/utils.js';\nexport { observableFromEvent } from './observables/observableFromEvent.js';\nexport { observableValue } from './observables/observableValue.js';\nexport { DebugLocation } from './debugLocation.js';\n\nimport { addLogger, setLogObservableFn } from './logging/logging.js';\nimport { ConsoleObservableLogger, logObservableToConsole } from './logging/consoleObservableLogger.js';\nimport { DevToolsLogger } from './logging/debugger/devToolsLogger.js';\nimport { env } from '../process.js';\nimport { _setDebugGetObservableGraph } from './observables/baseObservable.js';\nimport { debugGetObservableGraph } from './logging/debugGetDependencyGraph.js';\n\n_setDebugGetObservableGraph(debugGetObservableGraph);\nsetLogObservableFn(logObservableToConsole);\n\n// Remove \"//\" in the next line to enable logging\nconst enableLogging = false\n\t// || Boolean(\"true\") // done \"weirdly\" so that a lint warning prevents you from pushing this\n\t;\n\nif (enableLogging) {\n\taddLogger(new ConsoleObservableLogger());\n}\n\nif (env && env['VSCODE_DEV_DEBUG_OBSERVABLES']) {\n\t// To debug observables you also need the extension \"ms-vscode.debug-value-editor\"\n\taddLogger(DevToolsLogger.getInstance());\n}\n"]}
@@ -22,7 +22,7 @@ export function observableFromEvent(...args) {
22
22
  return new FromEventObservable(new DebugNameData(owner, undefined, getValue), event, getValue, () => FromEventObservable.globalTransaction, strictEquals, debugLocation ?? DebugLocation.ofCaller());
23
23
  }
24
24
  export function observableFromEventOpts(options, event, getValue, debugLocation = DebugLocation.ofCaller()) {
25
- return new FromEventObservable(new DebugNameData(options.owner, options.debugName, options.debugReferenceFn ?? getValue), event, getValue, () => FromEventObservable.globalTransaction, options.equalsFn ?? strictEquals, debugLocation);
25
+ return new FromEventObservable(new DebugNameData(options.owner, options.debugName, options.debugReferenceFn ?? getValue), event, getValue, () => options.getTransaction?.() ?? FromEventObservable.globalTransaction, options.equalsFn ?? strictEquals, debugLocation);
26
26
  }
27
27
  export class FromEventObservable extends BaseObservable {
28
28
  constructor(_debugNameData, event, _getValue, _getTransaction, _equalityComparator, debugLocation) {
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/observableInternal/observables/observableFromEvent.ts","vs/base/common/observableInternal/observables/observableFromEvent.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAwC,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EAAc,aAAa,EAAkB,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAapD,MAAM,UAAU,mBAAmB,CAAC,GAAG,IAEuB;IAE7D,IAAI,KAAK,CAAC;IACV,IAAI,KAAK,CAAC;IACV,IAAI,QAAQ,CAAC;IACb,IAAI,aAAa,CAAC;IACl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CAAC;IAC5B,CAAC;IAEM,aAAa;QACnB,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;IACzD,CAAC;CACD;AAED,WAAiB,mBAAmB;IACtB,4BAAQ,GAAG,mBAAmB,CAAC;IAE5C,SAAgB,mBAAmB,CAAC,EAAgB,EAAE,EAAc;QACnE,IAAI,MAAM,GAAG,KAAK,CAAC;QACnB,IAAI,mBAAmB,CAAC,iBAAiB,KAAK,SAAS,EAAE,CAAC;YACzD,mBAAmB,CAAC,iBAAiB,GAAG,EAAE,CAAC;YAC3C,MAAM,GAAG,IAAI,CAAC;QACf,CAAC;QACD,IAAI,CAAC;YACJ,EAAE,EAAE,CAAC;QACN,CAAC;gBAAS,CAAC;YACV,IAAI,MAAM,EAAE,CAAC;gBACZ,mBAAmB,CAAC,iBAAiB,GAAG,SAAS,CAAC;YACnD,CAAC;QACF,CAAC;IACF,CAAC;IAbe,uCAAmB,sBAalC,CAAA;AACF,CAAC,EAjBgB,mBAAmB,KAAnB,mBAAmB,QAiBnC","file":"observableFromEvent.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 { IObservable, ITransaction } from '../base.js';\nimport { subtransaction } from '../transaction.js';\nimport { EqualityComparer, Event, IDisposable, strictEquals } from '../commonFacade/deps.js';\nimport { DebugOwner, DebugNameData, IDebugNameData } from '../debugName.js';\nimport { getLogger } from '../logging/logging.js';\nimport { BaseObservable } from './baseObservable.js';\nimport { DebugLocation } from '../debugLocation.js';\n\n\nexport function observableFromEvent<T, TArgs = unknown>(\n\towner: DebugOwner,\n\tevent: Event<TArgs>,\n\tgetValue: (args: TArgs | undefined) => T,\n\tdebugLocation?: DebugLocation,\n): IObservable<T>;\nexport function observableFromEvent<T, TArgs = unknown>(\n\tevent: Event<TArgs>,\n\tgetValue: (args: TArgs | undefined) => T,\n): IObservable<T>;\nexport function observableFromEvent(...args:\n\t[owner: DebugOwner, event: Event<any>, getValue: (args: any | undefined) => any, debugLocation?: DebugLocation] |\n\t[event: Event<any>, getValue: (args: any | undefined) => any]\n): IObservable<any> {\n\tlet owner;\n\tlet event;\n\tlet getValue;\n\tlet debugLocation;\n\tif (args.length === 2) {\n\t\t[event, getValue] = args;\n\t} else {\n\t\t[owner, event, getValue, debugLocation] = args;\n\t}\n\treturn new FromEventObservable(\n\t\tnew DebugNameData(owner, undefined, getValue),\n\t\tevent,\n\t\tgetValue,\n\t\t() => FromEventObservable.globalTransaction,\n\t\tstrictEquals,\n\t\tdebugLocation ?? DebugLocation.ofCaller()\n\t);\n}\n\nexport function observableFromEventOpts<T, TArgs = unknown>(\n\toptions: IDebugNameData & {\n\t\tequalsFn?: EqualityComparer<T>;\n\t},\n\tevent: Event<TArgs>,\n\tgetValue: (args: TArgs | undefined) => T,\n\tdebugLocation = DebugLocation.ofCaller()\n): IObservable<T> {\n\treturn new FromEventObservable(\n\t\tnew DebugNameData(options.owner, options.debugName, options.debugReferenceFn ?? getValue),\n\t\tevent,\n\t\tgetValue, () => FromEventObservable.globalTransaction, options.equalsFn ?? strictEquals, debugLocation\n\t);\n}\n\nexport class FromEventObservable<TArgs, T> extends BaseObservable<T> {\n\tpublic static globalTransaction: ITransaction | undefined;\n\n\tprivate _value: T | undefined;\n\tprivate _hasValue = false;\n\tprivate _subscription: IDisposable | undefined;\n\n\tconstructor(\n\t\tprivate readonly _debugNameData: DebugNameData,\n\t\tprivate readonly event: Event<TArgs>,\n\t\tpublic readonly _getValue: (args: TArgs | undefined) => T,\n\t\tprivate readonly _getTransaction: () => ITransaction | undefined,\n\t\tprivate readonly _equalityComparator: EqualityComparer<T>,\n\t\tdebugLocation: DebugLocation\n\t) {\n\t\tsuper(debugLocation);\n\t}\n\n\tprivate getDebugName(): string | undefined {\n\t\treturn this._debugNameData.getDebugName(this);\n\t}\n\n\tpublic get debugName(): string {\n\t\tconst name = this.getDebugName();\n\t\treturn 'From Event' + (name ? `: ${name}` : '');\n\t}\n\n\tprotected override onFirstObserverAdded(): void {\n\t\tthis._subscription = this.event(this.handleEvent);\n\t}\n\n\tprivate readonly handleEvent = (args: TArgs | undefined) => {\n\t\tconst newValue = this._getValue(args);\n\t\tconst oldValue = this._value;\n\n\t\tconst didChange = !this._hasValue || !(this._equalityComparator(oldValue!, newValue));\n\t\tlet didRunTransaction = false;\n\n\t\tif (didChange) {\n\t\t\tthis._value = newValue;\n\n\t\t\tif (this._hasValue) {\n\t\t\t\tdidRunTransaction = true;\n\t\t\t\tsubtransaction(\n\t\t\t\t\tthis._getTransaction(),\n\t\t\t\t\t(tx) => {\n\t\t\t\t\t\tgetLogger()?.handleObservableUpdated(this, { oldValue, newValue, change: undefined, didChange, hadValue: this._hasValue });\n\n\t\t\t\t\t\tfor (const o of this._observers) {\n\t\t\t\t\t\t\ttx.updateObserver(o, this);\n\t\t\t\t\t\t\to.handleChange(this, undefined);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t() => {\n\t\t\t\t\t\tconst name = this.getDebugName();\n\t\t\t\t\t\treturn 'Event fired' + (name ? `: ${name}` : '');\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis._hasValue = true;\n\t\t}\n\n\t\tif (!didRunTransaction) {\n\t\t\tgetLogger()?.handleObservableUpdated(this, { oldValue, newValue, change: undefined, didChange, hadValue: this._hasValue });\n\t\t}\n\t};\n\n\tprotected override onLastObserverRemoved(): void {\n\t\tthis._subscription!.dispose();\n\t\tthis._subscription = undefined;\n\t\tthis._hasValue = false;\n\t\tthis._value = undefined;\n\t}\n\n\tpublic get(): T {\n\t\tif (this._subscription) {\n\t\t\tif (!this._hasValue) {\n\t\t\t\tthis.handleEvent(undefined);\n\t\t\t}\n\t\t\treturn this._value!;\n\t\t} else {\n\t\t\t// no cache, as there are no subscribers to keep it updated\n\t\t\tconst value = this._getValue(undefined);\n\t\t\treturn value;\n\t\t}\n\t}\n\n\tpublic debugSetValue(value: unknown): void {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tthis._value = value as any;\n\t}\n\n\tpublic debugGetState() {\n\t\treturn { value: this._value, hasValue: this._hasValue };\n\t}\n}\n\nexport namespace observableFromEvent {\n\texport const Observer = FromEventObservable;\n\n\texport function batchEventsGlobally(tx: ITransaction, fn: () => void): void {\n\t\tlet didSet = false;\n\t\tif (FromEventObservable.globalTransaction === undefined) {\n\t\t\tFromEventObservable.globalTransaction = tx;\n\t\t\tdidSet = true;\n\t\t}\n\t\ttry {\n\t\t\tfn();\n\t\t} finally {\n\t\t\tif (didSet) {\n\t\t\t\tFromEventObservable.globalTransaction = undefined;\n\t\t\t}\n\t\t}\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IObservable, ITransaction } from '../base.js';\nimport { subtransaction } from '../transaction.js';\nimport { EqualityComparer, Event, IDisposable, strictEquals } from '../commonFacade/deps.js';\nimport { DebugOwner, DebugNameData, IDebugNameData } from '../debugName.js';\nimport { getLogger } from '../logging/logging.js';\nimport { BaseObservable } from './baseObservable.js';\nimport { DebugLocation } from '../debugLocation.js';\n\n\nexport function observableFromEvent<T, TArgs = unknown>(\n\towner: DebugOwner,\n\tevent: Event<TArgs>,\n\tgetValue: (args: TArgs | undefined) => T,\n\tdebugLocation?: DebugLocation,\n): IObservable<T>;\nexport function observableFromEvent<T, TArgs = unknown>(\n\tevent: Event<TArgs>,\n\tgetValue: (args: TArgs | undefined) => T,\n): IObservable<T>;\nexport function observableFromEvent(...args:\n\t[owner: DebugOwner, event: Event<any>, getValue: (args: any | undefined) => any, debugLocation?: DebugLocation] |\n\t[event: Event<any>, getValue: (args: any | undefined) => any]\n): IObservable<any> {\n\tlet owner;\n\tlet event;\n\tlet getValue;\n\tlet debugLocation;\n\tif (args.length === 2) {\n\t\t[event, getValue] = args;\n\t} else {\n\t\t[owner, event, getValue, debugLocation] = args;\n\t}\n\treturn new FromEventObservable(\n\t\tnew DebugNameData(owner, undefined, getValue),\n\t\tevent,\n\t\tgetValue,\n\t\t() => FromEventObservable.globalTransaction,\n\t\tstrictEquals,\n\t\tdebugLocation ?? DebugLocation.ofCaller()\n\t);\n}\n\nexport function observableFromEventOpts<T, TArgs = unknown>(\n\toptions: IDebugNameData & {\n\t\tequalsFn?: EqualityComparer<T>;\n\t},\n\tevent: Event<TArgs>,\n\tgetValue: (args: TArgs | undefined) => T,\n\tdebugLocation = DebugLocation.ofCaller()\n): IObservable<T> {\n\treturn new FromEventObservable(\n\t\tnew DebugNameData(options.owner, options.debugName, options.debugReferenceFn ?? getValue),\n\t\tevent,\n\t\tgetValue, () => FromEventObservable.globalTransaction, options.equalsFn ?? strictEquals, debugLocation\n\t);\n}\n\nexport class FromEventObservable<TArgs, T> extends BaseObservable<T> {\n\tpublic static globalTransaction: ITransaction | undefined;\n\n\tprivate _value: T | undefined;\n\tprivate _hasValue = false;\n\tprivate _subscription: IDisposable | undefined;\n\n\tconstructor(\n\t\tprivate readonly _debugNameData: DebugNameData,\n\t\tprivate readonly event: Event<TArgs>,\n\t\tpublic readonly _getValue: (args: TArgs | undefined) => T,\n\t\tprivate readonly _getTransaction: () => ITransaction | undefined,\n\t\tprivate readonly _equalityComparator: EqualityComparer<T>,\n\t\tdebugLocation: DebugLocation\n\t) {\n\t\tsuper(debugLocation);\n\t}\n\n\tprivate getDebugName(): string | undefined {\n\t\treturn this._debugNameData.getDebugName(this);\n\t}\n\n\tpublic get debugName(): string {\n\t\tconst name = this.getDebugName();\n\t\treturn 'From Event' + (name ? `: ${name}` : '');\n\t}\n\n\tprotected override onFirstObserverAdded(): void {\n\t\tthis._subscription = this.event(this.handleEvent);\n\t}\n\n\tprivate readonly handleEvent = (args: TArgs | undefined) => {\n\t\tconst newValue = this._getValue(args);\n\t\tconst oldValue = this._value;\n\n\t\tconst didChange = !this._hasValue || !(this._equalityComparator(oldValue!, newValue));\n\t\tlet didRunTransaction = false;\n\n\t\tif (didChange) {\n\t\t\tthis._value = newValue;\n\n\t\t\tif (this._hasValue) {\n\t\t\t\tdidRunTransaction = true;\n\t\t\t\tsubtransaction(\n\t\t\t\t\tthis._getTransaction(),\n\t\t\t\t\t(tx) => {\n\t\t\t\t\t\tgetLogger()?.handleObservableUpdated(this, { oldValue, newValue, change: undefined, didChange, hadValue: this._hasValue });\n\n\t\t\t\t\t\tfor (const o of this._observers) {\n\t\t\t\t\t\t\ttx.updateObserver(o, this);\n\t\t\t\t\t\t\to.handleChange(this, undefined);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t() => {\n\t\t\t\t\t\tconst name = this.getDebugName();\n\t\t\t\t\t\treturn 'Event fired' + (name ? `: ${name}` : '');\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis._hasValue = true;\n\t\t}\n\n\t\tif (!didRunTransaction) {\n\t\t\tgetLogger()?.handleObservableUpdated(this, { oldValue, newValue, change: undefined, didChange, hadValue: this._hasValue });\n\t\t}\n\t};\n\n\tprotected override onLastObserverRemoved(): void {\n\t\tthis._subscription!.dispose();\n\t\tthis._subscription = undefined;\n\t\tthis._hasValue = false;\n\t\tthis._value = undefined;\n\t}\n\n\tpublic get(): T {\n\t\tif (this._subscription) {\n\t\t\tif (!this._hasValue) {\n\t\t\t\tthis.handleEvent(undefined);\n\t\t\t}\n\t\t\treturn this._value!;\n\t\t} else {\n\t\t\t// no cache, as there are no subscribers to keep it updated\n\t\t\tconst value = this._getValue(undefined);\n\t\t\treturn value;\n\t\t}\n\t}\n\n\tpublic debugSetValue(value: unknown): void {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tthis._value = value as any;\n\t}\n\n\tpublic debugGetState() {\n\t\treturn { value: this._value, hasValue: this._hasValue };\n\t}\n}\n\nexport namespace observableFromEvent {\n\texport const Observer = FromEventObservable;\n\n\texport function batchEventsGlobally(tx: ITransaction, fn: () => void): void {\n\t\tlet didSet = false;\n\t\tif (FromEventObservable.globalTransaction === undefined) {\n\t\t\tFromEventObservable.globalTransaction = tx;\n\t\t\tdidSet = true;\n\t\t}\n\t\ttry {\n\t\t\tfn();\n\t\t} finally {\n\t\t\tif (didSet) {\n\t\t\t\tFromEventObservable.globalTransaction = undefined;\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/observableInternal/observables/observableFromEvent.ts","vs/base/common/observableInternal/observables/observableFromEvent.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAwC,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EAAc,aAAa,EAAkB,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAapD,MAAM,UAAU,mBAAmB,CAAC,GAAG,IAEuB;IAE7D,IAAI,KAAK,CAAC;IACV,IAAI,KAAK,CAAC;IACV,IAAI,QAAQ,CAAC;IACb,IAAI,aAAa,CAAC;IAClB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAI,CAAC;IAC1B,CAAC;SAAM,CAAC;QACP,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,aAAa,CAAC,GAAG,IAAI,CAAC;IAChD,CAAC;IACD,OAAO,IAAI,mBAAmB,CAC7B,IAAI,aA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,EAAgB,EAAE,EAAc;QACnE,IAAI,MAAM,GAAG,KAAK,CAAC;QACnB,IAAI,mBAAmB,CAAC,iBAAiB,KAAK,SAAS,EAAE,CAAC;YACzD,mBAAmB,CAAC,iBAAiB,GAAG,EAAE,CAAC;YAC3C,MAAM,GAAG,IAAI,CAAC;QACf,CAAC;QACD,IAAI,CAAC;YACJ,EAAE,EAAE,CAAC;QACN,CAAC;gBAAS,CAAC;YACV,IAAI,MAAM,EAAE,CAAC;gBACZ,mBAAmB,CAAC,iBAAiB,GAAG,SAAS,CAAC;YACnD,CAAC;QACF,CAAC;IACF,CAAC;IAbe,uCAAmB,sBAalC,CAAA;AACF,CAAC,EAjBgB,mBAAmB,KAAnB,mBAAmB,QAiBnC","file":"observableFromEvent.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 { IObservable, ITransaction } from '../base.js';\nimport { subtransaction } from '../transaction.js';\nimport { EqualityComparer, Event, IDisposable, strictEquals } from '../commonFacade/deps.js';\nimport { DebugOwner, DebugNameData, IDebugNameData } from '../debugName.js';\nimport { getLogger } from '../logging/logging.js';\nimport { BaseObservable } from './baseObservable.js';\nimport { DebugLocation } from '../debugLocation.js';\n\n\nexport function observableFromEvent<T, TArgs = unknown>(\n\towner: DebugOwner,\n\tevent: Event<TArgs>,\n\tgetValue: (args: TArgs | undefined) => T,\n\tdebugLocation?: DebugLocation,\n): IObservable<T>;\nexport function observableFromEvent<T, TArgs = unknown>(\n\tevent: Event<TArgs>,\n\tgetValue: (args: TArgs | undefined) => T,\n): IObservable<T>;\nexport function observableFromEvent(...args:\n\t[owner: DebugOwner, event: Event<any>, getValue: (args: any | undefined) => any, debugLocation?: DebugLocation] |\n\t[event: Event<any>, getValue: (args: any | undefined) => any]\n): IObservable<any> {\n\tlet owner;\n\tlet event;\n\tlet getValue;\n\tlet debugLocation;\n\tif (args.length === 2) {\n\t\t[event, getValue] = args;\n\t} else {\n\t\t[owner, event, getValue, debugLocation] = args;\n\t}\n\treturn new FromEventObservable(\n\t\tnew DebugNameData(owner, undefined, getValue),\n\t\tevent,\n\t\tgetValue,\n\t\t() => FromEventObservable.globalTransaction,\n\t\tstrictEquals,\n\t\tdebugLocation ?? DebugLocation.ofCaller()\n\t);\n}\n\nexport function observableFromEventOpts<T, TArgs = unknown>(\n\toptions: IDebugNameData & {\n\t\tequalsFn?: EqualityComparer<T>;\n\t\tgetTransaction?: () => ITransaction | undefined;\n\t},\n\tevent: Event<TArgs>,\n\tgetValue: (args: TArgs | undefined) => T,\n\tdebugLocation = DebugLocation.ofCaller()\n): IObservable<T> {\n\treturn new FromEventObservable(\n\t\tnew DebugNameData(options.owner, options.debugName, options.debugReferenceFn ?? getValue),\n\t\tevent,\n\t\tgetValue,\n\t\t() => options.getTransaction?.() ?? FromEventObservable.globalTransaction,\n\t\toptions.equalsFn ?? strictEquals,\n\t\tdebugLocation\n\t);\n}\n\nexport class FromEventObservable<TArgs, T> extends BaseObservable<T> {\n\tpublic static globalTransaction: ITransaction | undefined;\n\n\tprivate _value: T | undefined;\n\tprivate _hasValue = false;\n\tprivate _subscription: IDisposable | undefined;\n\n\tconstructor(\n\t\tprivate readonly _debugNameData: DebugNameData,\n\t\tprivate readonly event: Event<TArgs>,\n\t\tpublic readonly _getValue: (args: TArgs | undefined) => T,\n\t\tprivate readonly _getTransaction: () => ITransaction | undefined,\n\t\tprivate readonly _equalityComparator: EqualityComparer<T>,\n\t\tdebugLocation: DebugLocation\n\t) {\n\t\tsuper(debugLocation);\n\t}\n\n\tprivate getDebugName(): string | undefined {\n\t\treturn this._debugNameData.getDebugName(this);\n\t}\n\n\tpublic get debugName(): string {\n\t\tconst name = this.getDebugName();\n\t\treturn 'From Event' + (name ? `: ${name}` : '');\n\t}\n\n\tprotected override onFirstObserverAdded(): void {\n\t\tthis._subscription = this.event(this.handleEvent);\n\t}\n\n\tprivate readonly handleEvent = (args: TArgs | undefined) => {\n\t\tconst newValue = this._getValue(args);\n\t\tconst oldValue = this._value;\n\n\t\tconst didChange = !this._hasValue || !(this._equalityComparator(oldValue!, newValue));\n\t\tlet didRunTransaction = false;\n\n\t\tif (didChange) {\n\t\t\tthis._value = newValue;\n\n\t\t\tif (this._hasValue) {\n\t\t\t\tdidRunTransaction = true;\n\t\t\t\tsubtransaction(\n\t\t\t\t\tthis._getTransaction(),\n\t\t\t\t\t(tx) => {\n\t\t\t\t\t\tgetLogger()?.handleObservableUpdated(this, { oldValue, newValue, change: undefined, didChange, hadValue: this._hasValue });\n\n\t\t\t\t\t\tfor (const o of this._observers) {\n\t\t\t\t\t\t\ttx.updateObserver(o, this);\n\t\t\t\t\t\t\to.handleChange(this, undefined);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t() => {\n\t\t\t\t\t\tconst name = this.getDebugName();\n\t\t\t\t\t\treturn 'Event fired' + (name ? `: ${name}` : '');\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis._hasValue = true;\n\t\t}\n\n\t\tif (!didRunTransaction) {\n\t\t\tgetLogger()?.handleObservableUpdated(this, { oldValue, newValue, change: undefined, didChange, hadValue: this._hasValue });\n\t\t}\n\t};\n\n\tprotected override onLastObserverRemoved(): void {\n\t\tthis._subscription!.dispose();\n\t\tthis._subscription = undefined;\n\t\tthis._hasValue = false;\n\t\tthis._value = undefined;\n\t}\n\n\tpublic get(): T {\n\t\tif (this._subscription) {\n\t\t\tif (!this._hasValue) {\n\t\t\t\tthis.handleEvent(undefined);\n\t\t\t}\n\t\t\treturn this._value!;\n\t\t} else {\n\t\t\t// no cache, as there are no subscribers to keep it updated\n\t\t\tconst value = this._getValue(undefined);\n\t\t\treturn value;\n\t\t}\n\t}\n\n\tpublic debugSetValue(value: unknown): void {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tthis._value = value as any;\n\t}\n\n\tpublic debugGetState() {\n\t\treturn { value: this._value, hasValue: this._hasValue };\n\t}\n}\n\nexport namespace observableFromEvent {\n\texport const Observer = FromEventObservable;\n\n\texport function batchEventsGlobally(tx: ITransaction, fn: () => void): void {\n\t\tlet didSet = false;\n\t\tif (FromEventObservable.globalTransaction === undefined) {\n\t\t\tFromEventObservable.globalTransaction = tx;\n\t\t\tdidSet = true;\n\t\t}\n\t\ttry {\n\t\t\tfn();\n\t\t} finally {\n\t\t\tif (didSet) {\n\t\t\t\tFromEventObservable.globalTransaction = undefined;\n\t\t\t}\n\t\t}\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IObservable, ITransaction } from '../base.js';\nimport { subtransaction } from '../transaction.js';\nimport { EqualityComparer, Event, IDisposable, strictEquals } from '../commonFacade/deps.js';\nimport { DebugOwner, DebugNameData, IDebugNameData } from '../debugName.js';\nimport { getLogger } from '../logging/logging.js';\nimport { BaseObservable } from './baseObservable.js';\nimport { DebugLocation } from '../debugLocation.js';\n\n\nexport function observableFromEvent<T, TArgs = unknown>(\n\towner: DebugOwner,\n\tevent: Event<TArgs>,\n\tgetValue: (args: TArgs | undefined) => T,\n\tdebugLocation?: DebugLocation,\n): IObservable<T>;\nexport function observableFromEvent<T, TArgs = unknown>(\n\tevent: Event<TArgs>,\n\tgetValue: (args: TArgs | undefined) => T,\n): IObservable<T>;\nexport function observableFromEvent(...args:\n\t[owner: DebugOwner, event: Event<any>, getValue: (args: any | undefined) => any, debugLocation?: DebugLocation] |\n\t[event: Event<any>, getValue: (args: any | undefined) => any]\n): IObservable<any> {\n\tlet owner;\n\tlet event;\n\tlet getValue;\n\tlet debugLocation;\n\tif (args.length === 2) {\n\t\t[event, getValue] = args;\n\t} else {\n\t\t[owner, event, getValue, debugLocation] = args;\n\t}\n\treturn new FromEventObservable(\n\t\tnew DebugNameData(owner, undefined, getValue),\n\t\tevent,\n\t\tgetValue,\n\t\t() => FromEventObservable.globalTransaction,\n\t\tstrictEquals,\n\t\tdebugLocation ?? DebugLocation.ofCaller()\n\t);\n}\n\nexport function observableFromEventOpts<T, TArgs = unknown>(\n\toptions: IDebugNameData & {\n\t\tequalsFn?: EqualityComparer<T>;\n\t\tgetTransaction?: () => ITransaction | undefined;\n\t},\n\tevent: Event<TArgs>,\n\tgetValue: (args: TArgs | undefined) => T,\n\tdebugLocation = DebugLocation.ofCaller()\n): IObservable<T> {\n\treturn new FromEventObservable(\n\t\tnew DebugNameData(options.owner, options.debugName, options.debugReferenceFn ?? getValue),\n\t\tevent,\n\t\tgetValue,\n\t\t() => options.getTransaction?.() ?? FromEventObservable.globalTransaction,\n\t\toptions.equalsFn ?? strictEquals,\n\t\tdebugLocation\n\t);\n}\n\nexport class FromEventObservable<TArgs, T> extends BaseObservable<T> {\n\tpublic static globalTransaction: ITransaction | undefined;\n\n\tprivate _value: T | undefined;\n\tprivate _hasValue = false;\n\tprivate _subscription: IDisposable | undefined;\n\n\tconstructor(\n\t\tprivate readonly _debugNameData: DebugNameData,\n\t\tprivate readonly event: Event<TArgs>,\n\t\tpublic readonly _getValue: (args: TArgs | undefined) => T,\n\t\tprivate readonly _getTransaction: () => ITransaction | undefined,\n\t\tprivate readonly _equalityComparator: EqualityComparer<T>,\n\t\tdebugLocation: DebugLocation\n\t) {\n\t\tsuper(debugLocation);\n\t}\n\n\tprivate getDebugName(): string | undefined {\n\t\treturn this._debugNameData.getDebugName(this);\n\t}\n\n\tpublic get debugName(): string {\n\t\tconst name = this.getDebugName();\n\t\treturn 'From Event' + (name ? `: ${name}` : '');\n\t}\n\n\tprotected override onFirstObserverAdded(): void {\n\t\tthis._subscription = this.event(this.handleEvent);\n\t}\n\n\tprivate readonly handleEvent = (args: TArgs | undefined) => {\n\t\tconst newValue = this._getValue(args);\n\t\tconst oldValue = this._value;\n\n\t\tconst didChange = !this._hasValue || !(this._equalityComparator(oldValue!, newValue));\n\t\tlet didRunTransaction = false;\n\n\t\tif (didChange) {\n\t\t\tthis._value = newValue;\n\n\t\t\tif (this._hasValue) {\n\t\t\t\tdidRunTransaction = true;\n\t\t\t\tsubtransaction(\n\t\t\t\t\tthis._getTransaction(),\n\t\t\t\t\t(tx) => {\n\t\t\t\t\t\tgetLogger()?.handleObservableUpdated(this, { oldValue, newValue, change: undefined, didChange, hadValue: this._hasValue });\n\n\t\t\t\t\t\tfor (const o of this._observers) {\n\t\t\t\t\t\t\ttx.updateObserver(o, this);\n\t\t\t\t\t\t\to.handleChange(this, undefined);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t() => {\n\t\t\t\t\t\tconst name = this.getDebugName();\n\t\t\t\t\t\treturn 'Event fired' + (name ? `: ${name}` : '');\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis._hasValue = true;\n\t\t}\n\n\t\tif (!didRunTransaction) {\n\t\t\tgetLogger()?.handleObservableUpdated(this, { oldValue, newValue, change: undefined, didChange, hadValue: this._hasValue });\n\t\t}\n\t};\n\n\tprotected override onLastObserverRemoved(): void {\n\t\tthis._subscription!.dispose();\n\t\tthis._subscription = undefined;\n\t\tthis._hasValue = false;\n\t\tthis._value = undefined;\n\t}\n\n\tpublic get(): T {\n\t\tif (this._subscription) {\n\t\t\tif (!this._hasValue) {\n\t\t\t\tthis.handleEvent(undefined);\n\t\t\t}\n\t\t\treturn this._value!;\n\t\t} else {\n\t\t\t// no cache, as there are no subscribers to keep it updated\n\t\t\tconst value = this._getValue(undefined);\n\t\t\treturn value;\n\t\t}\n\t}\n\n\tpublic debugSetValue(value: unknown): void {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tthis._value = value as any;\n\t}\n\n\tpublic debugGetState() {\n\t\treturn { value: this._value, hasValue: this._hasValue };\n\t}\n}\n\nexport namespace observableFromEvent {\n\texport const Observer = FromEventObservable;\n\n\texport function batchEventsGlobally(tx: ITransaction, fn: () => void): void {\n\t\tlet didSet = false;\n\t\tif (FromEventObservable.globalTransaction === undefined) {\n\t\t\tFromEventObservable.globalTransaction = tx;\n\t\t\tdidSet = true;\n\t\t}\n\t\ttry {\n\t\t\tfn();\n\t\t} finally {\n\t\t\tif (didSet) {\n\t\t\t\tFromEventObservable.globalTransaction = undefined;\n\t\t\t}\n\t\t}\n\t}\n}\n"]}