monaco-editor-core 0.55.1 → 0.56.0-dev-20251121

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 (415) 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 +27 -8
  18. package/esm/vs/base/browser/dom.js +31 -34
  19. package/esm/vs/base/browser/dom.js.map +1 -1
  20. package/esm/vs/base/browser/dompurify/dompurify.js +0 -1
  21. package/esm/vs/base/browser/keyboardEvent.js +3 -3
  22. package/esm/vs/base/browser/keyboardEvent.js.map +1 -1
  23. package/esm/vs/base/browser/markdownRenderer.js +5 -2
  24. package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
  25. package/esm/vs/base/browser/pixelRatio.js +5 -5
  26. package/esm/vs/base/browser/pixelRatio.js.map +1 -1
  27. package/esm/vs/base/browser/trustedTypes.js +1 -1
  28. package/esm/vs/base/browser/trustedTypes.js.map +1 -1
  29. package/esm/vs/base/browser/ui/actionbar/actionbar.js +3 -0
  30. package/esm/vs/base/browser/ui/actionbar/actionbar.js.map +1 -1
  31. package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  32. package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +7 -0
  33. package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js.map +1 -1
  34. package/esm/vs/base/browser/ui/hover/hoverWidget.css +0 -13
  35. package/esm/vs/base/browser/ui/inputbox/inputBox.js +7 -0
  36. package/esm/vs/base/browser/ui/inputbox/inputBox.js.map +1 -1
  37. package/esm/vs/base/browser/ui/keybindingLabel/keybindingLabel.css +4 -2
  38. package/esm/vs/base/browser/ui/list/listView.js +7 -2
  39. package/esm/vs/base/browser/ui/list/listView.js.map +1 -1
  40. package/esm/vs/base/browser/ui/selectBox/selectBox.js +4 -0
  41. package/esm/vs/base/browser/ui/selectBox/selectBox.js.map +1 -1
  42. package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.css +12 -32
  43. package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js +8 -18
  44. package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js.map +1 -1
  45. package/esm/vs/base/browser/ui/toolbar/toolbar.js +41 -14
  46. package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
  47. package/esm/vs/base/browser/ui/tree/abstractTree.js +11 -0
  48. package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
  49. package/esm/vs/base/browser/ui/tree/asyncDataTree.js +1 -0
  50. package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
  51. package/esm/vs/base/browser/ui/tree/compressedObjectTreeModel.js.map +1 -1
  52. package/esm/vs/base/browser/ui/tree/dataTree.js.map +1 -1
  53. package/esm/vs/base/browser/ui/tree/indexTreeModel.js.map +1 -1
  54. package/esm/vs/base/browser/ui/tree/objectTree.js.map +1 -1
  55. package/esm/vs/base/browser/ui/tree/objectTreeModel.js.map +1 -1
  56. package/esm/vs/base/browser/ui/tree/tree.js.map +1 -1
  57. package/esm/vs/base/common/arrays.js +10 -0
  58. package/esm/vs/base/common/arrays.js.map +1 -1
  59. package/esm/vs/base/common/async.js +34 -0
  60. package/esm/vs/base/common/async.js.map +1 -1
  61. package/esm/vs/base/common/buffer.js +1 -1
  62. package/esm/vs/base/common/buffer.js.map +1 -1
  63. package/esm/vs/base/common/cancellation.js.map +1 -1
  64. package/esm/vs/base/common/codiconsLibrary.js +3 -0
  65. package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
  66. package/esm/vs/base/common/collections.js.map +1 -1
  67. package/esm/vs/base/common/equals.js.map +1 -1
  68. package/esm/vs/base/common/event.js +32 -15
  69. package/esm/vs/base/common/event.js.map +1 -1
  70. package/esm/vs/base/common/filters.js +22 -3
  71. package/esm/vs/base/common/filters.js.map +1 -1
  72. package/esm/vs/base/common/hotReload.js +2 -2
  73. package/esm/vs/base/common/hotReload.js.map +1 -1
  74. package/esm/vs/base/common/iterator.js +1 -1
  75. package/esm/vs/base/common/iterator.js.map +1 -1
  76. package/esm/vs/base/common/keyCodes.js +7 -6
  77. package/esm/vs/base/common/keyCodes.js.map +1 -1
  78. package/esm/vs/base/common/linkedList.js.map +1 -1
  79. package/esm/vs/base/common/map.js.map +1 -1
  80. package/esm/vs/base/common/marked/marked.js +0 -1
  81. package/esm/vs/base/common/network.js +26 -1
  82. package/esm/vs/base/common/network.js.map +1 -1
  83. package/esm/vs/base/common/normalization.js +19 -6
  84. package/esm/vs/base/common/normalization.js.map +1 -1
  85. package/esm/vs/base/common/observableInternal/debugLocation.js +1 -2
  86. package/esm/vs/base/common/observableInternal/debugLocation.js.map +1 -1
  87. package/esm/vs/base/common/observableInternal/debugName.js +0 -1
  88. package/esm/vs/base/common/observableInternal/debugName.js.map +1 -1
  89. package/esm/vs/base/common/observableInternal/index.js +4 -4
  90. package/esm/vs/base/common/observableInternal/index.js.map +1 -1
  91. package/esm/vs/base/common/observableInternal/logging/debugGetDependencyGraph.js +38 -10
  92. package/esm/vs/base/common/observableInternal/logging/debugGetDependencyGraph.js.map +1 -1
  93. package/esm/vs/base/common/observableInternal/observables/baseObservable.js +3 -3
  94. package/esm/vs/base/common/observableInternal/observables/baseObservable.js.map +1 -1
  95. package/esm/vs/base/common/observableInternal/utils/utils.js +46 -5
  96. package/esm/vs/base/common/observableInternal/utils/utils.js.map +1 -1
  97. package/esm/vs/base/common/path.js +1 -0
  98. package/esm/vs/base/common/path.js.map +1 -1
  99. package/esm/vs/base/common/strings.js +27 -19
  100. package/esm/vs/base/common/strings.js.map +1 -1
  101. package/esm/vs/editor/browser/config/elementSizeObserver.js +5 -5
  102. package/esm/vs/editor/browser/config/elementSizeObserver.js.map +1 -1
  103. package/esm/vs/editor/browser/config/fontMeasurements.js.map +1 -1
  104. package/esm/vs/editor/browser/config/migrateOptions.js +6 -0
  105. package/esm/vs/editor/browser/config/migrateOptions.js.map +1 -1
  106. package/esm/vs/editor/browser/config/tabFocus.js +4 -2
  107. package/esm/vs/editor/browser/config/tabFocus.js.map +1 -1
  108. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +8 -0
  109. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
  110. package/esm/vs/editor/browser/coreCommands.js +1 -2
  111. package/esm/vs/editor/browser/coreCommands.js.map +1 -1
  112. package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
  113. package/esm/vs/editor/browser/observableCodeEditor.js +32 -1
  114. package/esm/vs/editor/browser/observableCodeEditor.js.map +1 -1
  115. package/esm/vs/editor/browser/services/contribution.js +9 -0
  116. package/esm/vs/editor/browser/services/contribution.js.map +1 -0
  117. package/esm/vs/editor/browser/services/editorWorkerService.js +27 -14
  118. package/esm/vs/editor/browser/services/editorWorkerService.js.map +1 -1
  119. package/esm/vs/editor/browser/services/openerService.js +5 -1
  120. package/esm/vs/editor/browser/services/openerService.js.map +1 -1
  121. package/esm/vs/editor/browser/view/domLineBreaksComputer.js +1 -1
  122. package/esm/vs/editor/browser/view/domLineBreaksComputer.js.map +1 -1
  123. package/esm/vs/editor/browser/view/renderingContext.js +1 -1
  124. package/esm/vs/editor/browser/view/renderingContext.js.map +1 -1
  125. package/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js +10 -3
  126. package/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js.map +1 -1
  127. package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +3 -4
  128. package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js.map +1 -1
  129. package/esm/vs/editor/browser/viewParts/minimap/minimap.js +1 -1
  130. package/esm/vs/editor/browser/viewParts/minimap/minimap.js.map +1 -1
  131. package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js +1 -1
  132. package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js.map +1 -1
  133. package/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js +4 -2
  134. package/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js.map +1 -1
  135. package/esm/vs/editor/browser/viewParts/rulers/rulers.js +1 -3
  136. package/esm/vs/editor/browser/viewParts/rulers/rulers.js.map +1 -1
  137. package/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js +1 -1
  138. package/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js.map +1 -1
  139. package/esm/vs/editor/browser/viewParts/viewLines/domReadingContext.js +2 -1
  140. package/esm/vs/editor/browser/viewParts/viewLines/domReadingContext.js.map +1 -1
  141. package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js +6 -18
  142. package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js.map +1 -1
  143. package/esm/vs/editor/browser/viewParts/whitespace/whitespace.js +0 -7
  144. package/esm/vs/editor/browser/viewParts/whitespace/whitespace.js.map +1 -1
  145. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +7 -2
  146. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
  147. package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +1 -0
  148. package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js.map +1 -1
  149. package/esm/vs/editor/common/commands/replaceCommand.js +2 -2
  150. package/esm/vs/editor/common/commands/replaceCommand.js.map +1 -1
  151. package/esm/vs/editor/common/config/editorOptions.js +374 -360
  152. package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
  153. package/esm/vs/editor/common/core/2d/rect.js +7 -0
  154. package/esm/vs/editor/common/core/2d/rect.js.map +1 -1
  155. package/esm/vs/editor/common/core/2d/size.js +20 -0
  156. package/esm/vs/editor/common/core/2d/size.js.map +1 -0
  157. package/esm/vs/editor/common/core/editorColorRegistry.js +69 -68
  158. package/esm/vs/editor/common/core/editorColorRegistry.js.map +1 -1
  159. package/esm/vs/editor/common/core/ranges/offsetRange.js +9 -0
  160. package/esm/vs/editor/common/core/ranges/offsetRange.js.map +1 -1
  161. package/esm/vs/editor/common/cursor/cursorMoveCommands.js +4 -4
  162. package/esm/vs/editor/common/cursor/cursorMoveCommands.js.map +1 -1
  163. package/esm/vs/editor/common/editorContextKeys.js +47 -47
  164. package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
  165. package/esm/vs/editor/common/languages.js +56 -56
  166. package/esm/vs/editor/common/languages.js.map +1 -1
  167. package/esm/vs/editor/common/model/editStack.js +1 -1
  168. package/esm/vs/editor/common/services/languagesAssociations.js +6 -8
  169. package/esm/vs/editor/common/services/languagesAssociations.js.map +1 -1
  170. package/esm/vs/editor/common/standaloneStrings.js +11 -10
  171. package/esm/vs/editor/common/standaloneStrings.js.map +1 -1
  172. package/esm/vs/editor/common/textModelEditSource.js +1 -1
  173. package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
  174. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
  175. package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
  176. package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
  177. package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
  178. package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
  179. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +17 -17
  180. package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
  181. package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
  182. package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
  183. package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
  184. package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
  185. package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
  186. package/esm/vs/editor/contrib/codelens/browser/codelens.js.map +1 -1
  187. package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
  188. package/esm/vs/editor/contrib/codelens/browser/codelensController.js.map +1 -1
  189. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
  190. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
  191. package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +1 -1
  192. package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
  193. package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
  194. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +10 -10
  195. package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
  196. package/esm/vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution.js +14 -0
  197. package/esm/vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution.js.map +1 -1
  198. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
  199. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +9 -9
  200. package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
  201. package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
  202. package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
  203. package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
  204. package/esm/vs/editor/contrib/find/browser/findController.js +17 -17
  205. package/esm/vs/editor/contrib/find/browser/findController.js.map +1 -1
  206. package/esm/vs/editor/contrib/find/browser/findWidget.js +26 -26
  207. package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +1 -1
  208. package/esm/vs/editor/contrib/folding/browser/folding.js +20 -20
  209. package/esm/vs/editor/contrib/folding/browser/folding.js.map +1 -1
  210. package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
  211. package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
  212. package/esm/vs/editor/contrib/format/browser/format.js +21 -6
  213. package/esm/vs/editor/contrib/format/browser/format.js.map +1 -1
  214. package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
  215. package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
  216. package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
  217. package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
  218. package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
  219. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
  220. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
  221. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
  222. package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
  223. package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
  224. package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
  225. package/esm/vs/editor/contrib/hover/browser/contentHoverController.js +5 -10
  226. package/esm/vs/editor/contrib/hover/browser/contentHoverController.js.map +1 -1
  227. package/esm/vs/editor/contrib/hover/browser/glyphHoverController.js +11 -6
  228. package/esm/vs/editor/contrib/hover/browser/glyphHoverController.js.map +1 -1
  229. package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
  230. package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
  231. package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
  232. package/esm/vs/editor/contrib/hover/browser/hoverUtils.js +24 -0
  233. package/esm/vs/editor/contrib/hover/browser/hoverUtils.js.map +1 -1
  234. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +9 -9
  235. package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
  236. package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
  237. package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
  238. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
  239. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +20 -20
  240. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +12 -12
  241. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +18 -16
  242. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js.map +1 -1
  243. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
  244. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
  245. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +42 -37
  246. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
  247. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js +3 -3
  248. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js.map +1 -1
  249. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +8 -8
  250. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js.map +1 -1
  251. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +54 -43
  252. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js.map +1 -1
  253. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +12 -12
  254. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js.map +1 -1
  255. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +74 -48
  256. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
  257. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +8 -36
  258. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js.map +1 -1
  259. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsNewUsers.js +10 -11
  260. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsNewUsers.js.map +1 -1
  261. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +105 -119
  262. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
  263. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js.map +1 -1
  264. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +8 -36
  265. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js.map +1 -1
  266. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/debugVisualization.js +95 -0
  267. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/debugVisualization.js.map +1 -0
  268. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js +17 -9
  269. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js.map +1 -1
  270. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js +415 -0
  271. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js.map +1 -0
  272. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js +253 -0
  273. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js.map +1 -0
  274. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
  275. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/flexBoxLayout.js +103 -0
  276. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/flexBoxLayout.js.map +1 -0
  277. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/towersLayout.js +32 -0
  278. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/towersLayout.js.map +1 -0
  279. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js +44 -11
  280. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js.map +1 -1
  281. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js +181 -0
  282. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js.map +1 -0
  283. package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
  284. package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
  285. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +32 -31
  286. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js.map +1 -1
  287. package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
  288. package/esm/vs/editor/contrib/links/browser/links.js +10 -10
  289. package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
  290. package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
  291. package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
  292. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
  293. package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
  294. package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
  295. package/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js +2 -2
  296. package/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js.map +1 -1
  297. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +18 -13
  298. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js.map +1 -1
  299. package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
  300. package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
  301. package/esm/vs/editor/contrib/rename/browser/rename.js +12 -12
  302. package/esm/vs/editor/contrib/rename/browser/rename.js.map +1 -1
  303. package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
  304. package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
  305. package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
  306. package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
  307. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  308. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +1 -1
  309. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js.map +1 -1
  310. package/esm/vs/editor/contrib/suggest/browser/suggest.js +8 -8
  311. package/esm/vs/editor/contrib/suggest/browser/suggestController.js +10 -10
  312. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +17 -17
  313. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
  314. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
  315. package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
  316. package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
  317. package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  318. package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  319. package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  320. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +29 -29
  321. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js.map +1 -1
  322. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
  323. package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  324. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +4 -4
  325. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js.map +1 -1
  326. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +1 -1
  327. package/esm/vs/editor/editor.all.js +1 -0
  328. package/esm/vs/editor/editor.all.js.map +1 -1
  329. package/esm/vs/editor/editor.api.d.ts +9 -5
  330. package/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js +22 -2
  331. package/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js.map +1 -1
  332. package/esm/vs/editor/standalone/browser/services/standaloneWebWorkerService.js +39 -0
  333. package/esm/vs/editor/standalone/browser/services/standaloneWebWorkerService.js.map +1 -0
  334. package/esm/vs/editor/standalone/browser/standaloneEditor.js +2 -1
  335. package/esm/vs/editor/standalone/browser/standaloneEditor.js.map +1 -1
  336. package/esm/vs/editor/standalone/browser/standaloneServices.js +3 -21
  337. package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
  338. package/esm/vs/editor/standalone/browser/standaloneWebWorker.js +4 -4
  339. package/esm/vs/editor/standalone/browser/standaloneWebWorker.js.map +1 -1
  340. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
  341. package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
  342. package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
  343. package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
  344. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +7 -9
  345. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js.map +1 -1
  346. package/esm/vs/platform/actions/browser/toolbar.js +2 -2
  347. package/esm/vs/platform/actions/common/actions.js +2 -0
  348. package/esm/vs/platform/actions/common/actions.js.map +1 -1
  349. package/esm/vs/platform/actions/common/menuService.js +2 -2
  350. package/esm/vs/platform/configuration/common/configuration.js +5 -4
  351. package/esm/vs/platform/configuration/common/configuration.js.map +1 -1
  352. package/esm/vs/platform/configuration/common/configurationModels.js +21 -10
  353. package/esm/vs/platform/configuration/common/configurationModels.js.map +1 -1
  354. package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
  355. package/esm/vs/platform/configuration/common/configurationRegistry.js.map +1 -1
  356. package/esm/vs/platform/configuration/common/configurations.js.map +1 -1
  357. package/esm/vs/platform/contextkey/browser/contextKeyService.js +3 -3
  358. package/esm/vs/platform/contextkey/browser/contextKeyService.js.map +1 -1
  359. package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
  360. package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
  361. package/esm/vs/platform/contextkey/common/scanner.js +5 -5
  362. package/esm/vs/platform/contextview/browser/contextViewService.js.map +1 -1
  363. package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  364. package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
  365. package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
  366. package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
  367. package/esm/vs/platform/list/browser/listService.js +27 -27
  368. package/esm/vs/platform/list/browser/listService.js.map +1 -1
  369. package/esm/vs/platform/markers/common/markerService.js +2 -2
  370. package/esm/vs/platform/markers/common/markers.js +6 -6
  371. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +11 -32
  372. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js.map +1 -1
  373. package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
  374. package/esm/vs/platform/quickinput/browser/media/quickInput.css +9 -3
  375. package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
  376. package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
  377. package/esm/vs/platform/quickinput/browser/quickInputController.js +35 -14
  378. package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
  379. package/esm/vs/platform/quickinput/browser/quickInputList.js +4 -1
  380. package/esm/vs/platform/quickinput/browser/quickInputList.js.map +1 -1
  381. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  382. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
  383. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js +71 -40
  384. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js.map +1 -1
  385. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js +21 -8
  386. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js.map +1 -1
  387. package/esm/vs/platform/telemetry/common/gdprTypings.js.map +1 -1
  388. package/esm/vs/platform/telemetry/common/telemetry.js.map +1 -1
  389. package/esm/vs/platform/theme/common/colorUtils.js +2 -2
  390. package/esm/vs/platform/theme/common/colors/baseColors.js +17 -17
  391. package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
  392. package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
  393. package/esm/vs/platform/theme/common/colors/editorColors.js.map +1 -1
  394. package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
  395. package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
  396. package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
  397. package/esm/vs/platform/theme/common/colors/minimapColors.js +11 -11
  398. package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
  399. package/esm/vs/platform/theme/common/colors/miscColors.js.map +1 -1
  400. package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
  401. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  402. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  403. package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
  404. package/esm/vs/platform/webWorker/browser/webWorkerDescriptor.js +12 -0
  405. package/esm/vs/platform/webWorker/browser/webWorkerDescriptor.js.map +1 -0
  406. package/esm/vs/platform/webWorker/browser/webWorkerService.js +7 -0
  407. package/esm/vs/platform/webWorker/browser/webWorkerService.js.map +1 -0
  408. package/esm/vs/{base/browser/webWorkerFactory.js → platform/webWorker/browser/webWorkerServiceImpl.js} +47 -66
  409. package/esm/vs/platform/webWorker/browser/webWorkerServiceImpl.js.map +1 -0
  410. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  411. package/monaco.d.ts +9 -5
  412. package/package.json +2 -2
  413. package/esm/vs/base/browser/webWorkerFactory.js.map +0 -1
  414. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineCompletionsView.js +0 -82
  415. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineCompletionsView.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/observableInternal/utils/utils.ts","vs/base/common/observableInternal/utils/utils.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAGlD,OAAO,EAAE,eAAe,EAAe,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,OAAO,EAAE,WA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AAa,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAElD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YAC1B,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAuB,CAAC;YAElF,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACjC,IAAI,CAAC,KAAK,EAAE,CAAC;gBACZ,MAAM,KAAK,GAAG,IAAI,eAAe,EAAE,CAAC;gBACpC,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gBACnC,KAAK,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;gBACvB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YAC7B,CAAC;iBAAM,CAAC;gBACP,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC3B,CAAC;YACD,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;QAED,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;YAClC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;YACrC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACtB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC;IACxB,CAAC;IAEM,QAAQ;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;CACD","file":"utils.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 { autorun } from '../reactions/autorun.js';\nimport { IObservable, IObservableWithChange, IObserver, IReader, ITransaction } from '../base.js';\nimport { DebugOwner } from '../debugName.js';\nimport { DisposableStore, IDisposable, toDisposable } from '../commonFacade/deps.js';\nimport { derived, derivedOpts } from '../observables/derived.js';\nimport { observableFromEvent } from '../observables/observableFromEvent.js';\nimport { observableSignal } from '../observables/observableSignal.js';\nimport { _setKeepObserved, _setRecomputeInitiallyAndOnChange } from '../observables/baseObservable.js';\n\n/**\n * Creates an observable that debounces the input observable.\n */\nexport function debouncedObservable<T>(observable: IObservable<T>, debounceMs: number): IObservable<T> {\n\tlet hasValue = false;\n\tlet lastValue: T | undefined;\n\n\tlet timeout: Timeout | undefined = undefined;\n\n\treturn observableFromEvent<T, void>(cb => {\n\t\tconst d = autorun(reader => {\n\t\t\tconst value = observable.read(reader);\n\n\t\t\tif (!hasValue) {\n\t\t\t\thasValue = true;\n\t\t\t\tlastValue = value;\n\t\t\t} else {\n\t\t\t\tif (timeout) {\n\t\t\t\t\tclearTimeout(timeout);\n\t\t\t\t}\n\t\t\t\ttimeout = setTimeout(() => {\n\t\t\t\t\tlastValue = value;\n\t\t\t\t\tcb();\n\t\t\t\t}, debounceMs);\n\t\t\t}\n\t\t});\n\t\treturn {\n\t\t\tdispose() {\n\t\t\t\td.dispose();\n\t\t\t\thasValue = false;\n\t\t\t\tlastValue = undefined;\n\t\t\t},\n\t\t};\n\t}, () => {\n\t\tif (hasValue) {\n\t\t\treturn lastValue!;\n\t\t} else {\n\t\t\treturn observable.get();\n\t\t}\n\t});\n}\n\n/**\n * This makes sure the observable is being observed and keeps its cache alive.\n */\nexport function keepObserved<T>(observable: IObservable<T>): IDisposable {\n\tconst o = new KeepAliveObserver(false, undefined);\n\tobservable.addObserver(o);\n\treturn toDisposable(() => {\n\t\tobservable.removeObserver(o);\n\t});\n}\n\n_setKeepObserved(keepObserved);\n\n/**\n * This converts the given observable into an autorun.\n */\nexport function recomputeInitiallyAndOnChange<T>(observable: IObservable<T>, handleValue?: (value: T) => void): IDisposable {\n\tconst o = new KeepAliveObserver(true, handleValue);\n\tobservable.addObserver(o);\n\ttry {\n\t\to.beginUpdate(observable);\n\t} finally {\n\t\to.endUpdate(observable);\n\t}\n\n\treturn toDisposable(() => {\n\t\tobservable.removeObserver(o);\n\t});\n}\n\n_setRecomputeInitiallyAndOnChange(recomputeInitiallyAndOnChange);\n\nexport class KeepAliveObserver implements IObserver {\n\tprivate _counter = 0;\n\n\tconstructor(\n\t\tprivate readonly _forceRecompute: boolean,\n\t\tprivate readonly _handleValue: ((value: any) => void) | undefined,\n\t) { }\n\n\tbeginUpdate<T>(observable: IObservable<T>): void {\n\t\tthis._counter++;\n\t}\n\n\tendUpdate<T>(observable: IObservable<T>): void {\n\t\tif (this._counter === 1 && this._forceRecompute) {\n\t\t\tif (this._handleValue) {\n\t\t\t\tthis._handleValue(observable.get());\n\t\t\t} else {\n\t\t\t\tobservable.reportChanges();\n\t\t\t}\n\t\t}\n\t\tthis._counter--;\n\t}\n\n\thandlePossibleChange<T>(observable: IObservable<T>): void {\n\t\t// NO OP\n\t}\n\n\thandleChange<T, TChange>(observable: IObservableWithChange<T, TChange>, change: TChange): void {\n\t\t// NO OP\n\t}\n}\n\nexport function derivedObservableWithCache<T>(owner: DebugOwner, computeFn: (reader: IReader, lastValue: T | undefined) => T): IObservable<T> {\n\tlet lastValue: T | undefined = undefined;\n\tconst observable = derivedOpts({ owner, debugReferenceFn: computeFn }, reader => {\n\t\tlastValue = computeFn(reader, lastValue);\n\t\treturn lastValue;\n\t});\n\treturn observable;\n}\n\nexport function derivedObservableWithWritableCache<T>(owner: object, computeFn: (reader: IReader, lastValue: T | undefined) => T): IObservable<T>\n\t& { clearCache(transaction: ITransaction): void; setCache(newValue: T | undefined, tx: ITransaction | undefined): void } {\n\tlet lastValue: T | undefined = undefined;\n\tconst onChange = observableSignal('derivedObservableWithWritableCache');\n\tconst observable = derived(owner, reader => {\n\t\tonChange.read(reader);\n\t\tlastValue = computeFn(reader, lastValue);\n\t\treturn lastValue;\n\t});\n\treturn Object.assign(observable, {\n\t\tclearCache: (tx: ITransaction) => {\n\t\t\tlastValue = undefined;\n\t\t\tonChange.trigger(tx);\n\t\t},\n\t\tsetCache: (newValue: T | undefined, tx: ITransaction | undefined) => {\n\t\t\tlastValue = newValue;\n\t\t\tonChange.trigger(tx);\n\t\t}\n\t});\n}\n\n/**\n * When the items array changes, referential equal items are not mapped again.\n */\nexport function mapObservableArrayCached<TIn, TOut, TKey = TIn>(owner: DebugOwner, items: IObservable<readonly TIn[]>, map: (input: TIn, store: DisposableStore) => TOut, keySelector?: (input: TIn) => TKey): IObservable<readonly TOut[]> {\n\tlet m = new ArrayMap(map, keySelector);\n\tconst self = derivedOpts({\n\t\tdebugReferenceFn: map,\n\t\towner,\n\t\tonLastObserverRemoved: () => {\n\t\t\tm.dispose();\n\t\t\tm = new ArrayMap(map);\n\t\t}\n\t}, (reader) => {\n\t\tm.setItems(items.read(reader));\n\t\treturn m.getItems();\n\t});\n\treturn self;\n}\n\nclass ArrayMap<TIn, TOut, TKey> implements IDisposable {\n\tprivate readonly _cache = new Map<TKey, { out: TOut; store: DisposableStore }>();\n\tprivate _items: TOut[] = [];\n\tconstructor(\n\t\tprivate readonly _map: (input: TIn, store: DisposableStore) => TOut,\n\t\tprivate readonly _keySelector?: (input: TIn) => TKey,\n\t) {\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._cache.forEach(entry => entry.store.dispose());\n\t\tthis._cache.clear();\n\t}\n\n\tpublic setItems(items: readonly TIn[]): void {\n\t\tconst newItems: TOut[] = [];\n\t\tconst itemsToRemove = new Set(this._cache.keys());\n\n\t\tfor (const item of items) {\n\t\t\tconst key = this._keySelector ? this._keySelector(item) : item as unknown as TKey;\n\n\t\t\tlet entry = this._cache.get(key);\n\t\t\tif (!entry) {\n\t\t\t\tconst store = new DisposableStore();\n\t\t\t\tconst out = this._map(item, store);\n\t\t\t\tentry = { out, store };\n\t\t\t\tthis._cache.set(key, entry);\n\t\t\t} else {\n\t\t\t\titemsToRemove.delete(key);\n\t\t\t}\n\t\t\tnewItems.push(entry.out);\n\t\t}\n\n\t\tfor (const item of itemsToRemove) {\n\t\t\tconst entry = this._cache.get(item)!;\n\t\t\tentry.store.dispose();\n\t\t\tthis._cache.delete(item);\n\t\t}\n\n\t\tthis._items = newItems;\n\t}\n\n\tpublic getItems(): TOut[] {\n\t\treturn this._items;\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 { autorun } from '../reactions/autorun.js';\nimport { IObservable, IObservableWithChange, IObserver, IReader, ITransaction } from '../base.js';\nimport { DebugOwner } from '../debugName.js';\nimport { DisposableStore, IDisposable, toDisposable } from '../commonFacade/deps.js';\nimport { derived, derivedOpts } from '../observables/derived.js';\nimport { observableFromEvent } from '../observables/observableFromEvent.js';\nimport { observableSignal } from '../observables/observableSignal.js';\nimport { _setKeepObserved, _setRecomputeInitiallyAndOnChange } from '../observables/baseObservable.js';\n\n/**\n * Creates an observable that debounces the input observable.\n */\nexport function debouncedObservable<T>(observable: IObservable<T>, debounceMs: number): IObservable<T> {\n\tlet hasValue = false;\n\tlet lastValue: T | undefined;\n\n\tlet timeout: Timeout | undefined = undefined;\n\n\treturn observableFromEvent<T, void>(cb => {\n\t\tconst d = autorun(reader => {\n\t\t\tconst value = observable.read(reader);\n\n\t\t\tif (!hasValue) {\n\t\t\t\thasValue = true;\n\t\t\t\tlastValue = value;\n\t\t\t} else {\n\t\t\t\tif (timeout) {\n\t\t\t\t\tclearTimeout(timeout);\n\t\t\t\t}\n\t\t\t\ttimeout = setTimeout(() => {\n\t\t\t\t\tlastValue = value;\n\t\t\t\t\tcb();\n\t\t\t\t}, debounceMs);\n\t\t\t}\n\t\t});\n\t\treturn {\n\t\t\tdispose() {\n\t\t\t\td.dispose();\n\t\t\t\thasValue = false;\n\t\t\t\tlastValue = undefined;\n\t\t\t},\n\t\t};\n\t}, () => {\n\t\tif (hasValue) {\n\t\t\treturn lastValue!;\n\t\t} else {\n\t\t\treturn observable.get();\n\t\t}\n\t});\n}\n\n/**\n * This makes sure the observable is being observed and keeps its cache alive.\n */\nexport function keepObserved<T>(observable: IObservable<T>): IDisposable {\n\tconst o = new KeepAliveObserver(false, undefined);\n\tobservable.addObserver(o);\n\treturn toDisposable(() => {\n\t\tobservable.removeObserver(o);\n\t});\n}\n\n_setKeepObserved(keepObserved);\n\n/**\n * This converts the given observable into an autorun.\n */\nexport function recomputeInitiallyAndOnChange<T>(observable: IObservable<T>, handleValue?: (value: T) => void): IDisposable {\n\tconst o = new KeepAliveObserver(true, handleValue);\n\tobservable.addObserver(o);\n\ttry {\n\t\to.beginUpdate(observable);\n\t} finally {\n\t\to.endUpdate(observable);\n\t}\n\n\treturn toDisposable(() => {\n\t\tobservable.removeObserver(o);\n\t});\n}\n\n_setRecomputeInitiallyAndOnChange(recomputeInitiallyAndOnChange);\n\nexport class KeepAliveObserver implements IObserver {\n\tprivate _counter = 0;\n\n\tconstructor(\n\t\tprivate readonly _forceRecompute: boolean,\n\t\tprivate readonly _handleValue: ((value: any) => void) | undefined,\n\t) { }\n\n\tbeginUpdate<T>(observable: IObservable<T>): void {\n\t\tthis._counter++;\n\t}\n\n\tendUpdate<T>(observable: IObservable<T>): void {\n\t\tif (this._counter === 1 && this._forceRecompute) {\n\t\t\tif (this._handleValue) {\n\t\t\t\tthis._handleValue(observable.get());\n\t\t\t} else {\n\t\t\t\tobservable.reportChanges();\n\t\t\t}\n\t\t}\n\t\tthis._counter--;\n\t}\n\n\thandlePossibleChange<T>(observable: IObservable<T>): void {\n\t\t// NO OP\n\t}\n\n\thandleChange<T, TChange>(observable: IObservableWithChange<T, TChange>, change: TChange): void {\n\t\t// NO OP\n\t}\n}\n\nexport function derivedObservableWithCache<T>(owner: DebugOwner, computeFn: (reader: IReader, lastValue: T | undefined) => T): IObservable<T> {\n\tlet lastValue: T | undefined = undefined;\n\tconst observable = derivedOpts({ owner, debugReferenceFn: computeFn }, reader => {\n\t\tlastValue = computeFn(reader, lastValue);\n\t\treturn lastValue;\n\t});\n\treturn observable;\n}\n\nexport function derivedObservableWithWritableCache<T>(owner: object, computeFn: (reader: IReader, lastValue: T | undefined) => T): IObservable<T>\n\t& { clearCache(transaction: ITransaction): void; setCache(newValue: T | undefined, tx: ITransaction | undefined): void } {\n\tlet lastValue: T | undefined = undefined;\n\tconst onChange = observableSignal('derivedObservableWithWritableCache');\n\tconst observable = derived(owner, reader => {\n\t\tonChange.read(reader);\n\t\tlastValue = computeFn(reader, lastValue);\n\t\treturn lastValue;\n\t});\n\treturn Object.assign(observable, {\n\t\tclearCache: (tx: ITransaction) => {\n\t\t\tlastValue = undefined;\n\t\t\tonChange.trigger(tx);\n\t\t},\n\t\tsetCache: (newValue: T | undefined, tx: ITransaction | undefined) => {\n\t\t\tlastValue = newValue;\n\t\t\tonChange.trigger(tx);\n\t\t}\n\t});\n}\n\n/**\n * When the items array changes, referential equal items are not mapped again.\n */\nexport function mapObservableArrayCached<TIn, TOut, TKey = TIn>(owner: DebugOwner, items: IObservable<readonly TIn[]>, map: (input: TIn, store: DisposableStore) => TOut, keySelector?: (input: TIn) => TKey): IObservable<readonly TOut[]> {\n\tlet m = new ArrayMap(map, keySelector);\n\tconst self = derivedOpts({\n\t\tdebugReferenceFn: map,\n\t\towner,\n\t\tonLastObserverRemoved: () => {\n\t\t\tm.dispose();\n\t\t\tm = new ArrayMap(map);\n\t\t}\n\t}, (reader) => {\n\t\tm.setItems(items.read(reader));\n\t\treturn m.getItems();\n\t});\n\treturn self;\n}\n\nclass ArrayMap<TIn, TOut, TKey> implements IDisposable {\n\tprivate readonly _cache = new Map<TKey, { out: TOut; store: DisposableStore }>();\n\tprivate _items: TOut[] = [];\n\tconstructor(\n\t\tprivate readonly _map: (input: TIn, store: DisposableStore) => TOut,\n\t\tprivate readonly _keySelector?: (input: TIn) => TKey,\n\t) {\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._cache.forEach(entry => entry.store.dispose());\n\t\tthis._cache.clear();\n\t}\n\n\tpublic setItems(items: readonly TIn[]): void {\n\t\tconst newItems: TOut[] = [];\n\t\tconst itemsToRemove = new Set(this._cache.keys());\n\n\t\tfor (const item of items) {\n\t\t\tconst key = this._keySelector ? this._keySelector(item) : item as unknown as TKey;\n\n\t\t\tlet entry = this._cache.get(key);\n\t\t\tif (!entry) {\n\t\t\t\tconst store = new DisposableStore();\n\t\t\t\tconst out = this._map(item, store);\n\t\t\t\tentry = { out, store };\n\t\t\t\tthis._cache.set(key, entry);\n\t\t\t} else {\n\t\t\t\titemsToRemove.delete(key);\n\t\t\t}\n\t\t\tnewItems.push(entry.out);\n\t\t}\n\n\t\tfor (const item of itemsToRemove) {\n\t\t\tconst entry = this._cache.get(item)!;\n\t\t\tentry.store.dispose();\n\t\t\tthis._cache.delete(item);\n\t\t}\n\n\t\tthis._items = newItems;\n\t}\n\n\tpublic getItems(): TOut[] {\n\t\treturn this._items;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/observableInternal/utils/utils.ts","vs/base/common/observableInternal/utils/utils.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAGlD,OAAO,EAAE,eAAe,EAAe,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAA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AI,CAAC,MAAM,GAAG,QAAQ,CAAC;IACxB,CAAC;IAEM,QAAQ;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;CACD","file":"utils.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 { autorun } from '../reactions/autorun.js';\nimport { IObservable, IObservableWithChange, IObserver, IReader, ITransaction } from '../base.js';\nimport { DebugOwner } from '../debugName.js';\nimport { DisposableStore, IDisposable, toDisposable } from '../commonFacade/deps.js';\nimport { derived, derivedOpts } from '../observables/derived.js';\nimport { observableFromEvent } from '../observables/observableFromEvent.js';\nimport { observableSignal } from '../observables/observableSignal.js';\nimport { _setKeepObserved, _setRecomputeInitiallyAndOnChange } from '../observables/baseObservable.js';\nimport { DebugLocation } from '../debugLocation.js';\n\n/**\n * Creates an observable that debounces the input observable.\n */\nexport function debouncedObservable<T>(observable: IObservable<T>, debounceMs: number | ((lastValue: T | undefined, newValue: T) => number), debugLocation = DebugLocation.ofCaller()): IObservable<T> {\n\tlet hasValue = false;\n\tlet lastValue: T | undefined;\n\n\tlet timeout: Timeout | undefined = undefined;\n\n\treturn observableFromEvent<T, void>(undefined, cb => {\n\t\tconst d = autorun(reader => {\n\t\t\tconst value = observable.read(reader);\n\n\t\t\tif (!hasValue) {\n\t\t\t\thasValue = true;\n\t\t\t\tlastValue = value;\n\t\t\t} else {\n\t\t\t\tif (timeout) {\n\t\t\t\t\tclearTimeout(timeout);\n\t\t\t\t}\n\t\t\t\tconst debounceDuration = typeof debounceMs === 'number' ? debounceMs : debounceMs(lastValue, value);\n\t\t\t\tif (debounceDuration === 0) {\n\t\t\t\t\tlastValue = value;\n\t\t\t\t\tcb();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttimeout = setTimeout(() => {\n\t\t\t\t\tlastValue = value;\n\t\t\t\t\tcb();\n\t\t\t\t}, debounceDuration);\n\t\t\t}\n\t\t});\n\t\treturn {\n\t\t\tdispose() {\n\t\t\t\td.dispose();\n\t\t\t\thasValue = false;\n\t\t\t\tlastValue = undefined;\n\t\t\t},\n\t\t};\n\t}, () => {\n\t\tif (hasValue) {\n\t\t\treturn lastValue!;\n\t\t} else {\n\t\t\treturn observable.get();\n\t\t}\n\t}, debugLocation);\n}\n\n/**\n * Creates an observable that debounces the input observable.\n */\nexport function debouncedObservable2<T>(observable: IObservable<T>, debounceMs: number | ((currentValue: T | undefined, newValue: T) => number), debugLocation = DebugLocation.ofCaller()): IObservable<T> {\n\tconst s = observableSignal('handleTimeout');\n\n\tlet currentValue: T | undefined = undefined;\n\tlet timeout: Timeout | undefined = undefined;\n\n\tconst d = derivedOpts({\n\t\towner: undefined,\n\t\tonLastObserverRemoved: () => {\n\t\t\tcurrentValue = undefined;\n\t\t}\n\t}, reader => {\n\t\tconst val = observable.read(reader);\n\t\ts.read(reader);\n\n\t\tif (val !== currentValue) {\n\t\t\tconst debounceDuration = typeof debounceMs === 'number' ? debounceMs : debounceMs(currentValue, val);\n\n\t\t\tif (debounceDuration === 0) {\n\t\t\t\tcurrentValue = val;\n\t\t\t\treturn val;\n\t\t\t}\n\n\t\t\tif (timeout) {\n\t\t\t\tclearTimeout(timeout);\n\t\t\t}\n\t\t\ttimeout = setTimeout(() => {\n\t\t\t\tcurrentValue = val;\n\t\t\t\ts.trigger(undefined);\n\t\t\t}, debounceDuration);\n\t\t}\n\n\t\treturn currentValue!;\n\t}, debugLocation);\n\n\treturn d;\n}\n\n/**\n * This makes sure the observable is being observed and keeps its cache alive.\n */\nexport function keepObserved<T>(observable: IObservable<T>): IDisposable {\n\tconst o = new KeepAliveObserver(false, undefined);\n\tobservable.addObserver(o);\n\treturn toDisposable(() => {\n\t\tobservable.removeObserver(o);\n\t});\n}\n\n_setKeepObserved(keepObserved);\n\n/**\n * This converts the given observable into an autorun.\n */\nexport function recomputeInitiallyAndOnChange<T>(observable: IObservable<T>, handleValue?: (value: T) => void): IDisposable {\n\tconst o = new KeepAliveObserver(true, handleValue);\n\tobservable.addObserver(o);\n\ttry {\n\t\to.beginUpdate(observable);\n\t} finally {\n\t\to.endUpdate(observable);\n\t}\n\n\treturn toDisposable(() => {\n\t\tobservable.removeObserver(o);\n\t});\n}\n\n_setRecomputeInitiallyAndOnChange(recomputeInitiallyAndOnChange);\n\nexport class KeepAliveObserver implements IObserver {\n\tprivate _counter = 0;\n\n\tconstructor(\n\t\tprivate readonly _forceRecompute: boolean,\n\t\tprivate readonly _handleValue: ((value: any) => void) | undefined,\n\t) { }\n\n\tbeginUpdate<T>(observable: IObservable<T>): void {\n\t\tthis._counter++;\n\t}\n\n\tendUpdate<T>(observable: IObservable<T>): void {\n\t\tif (this._counter === 1 && this._forceRecompute) {\n\t\t\tif (this._handleValue) {\n\t\t\t\tthis._handleValue(observable.get());\n\t\t\t} else {\n\t\t\t\tobservable.reportChanges();\n\t\t\t}\n\t\t}\n\t\tthis._counter--;\n\t}\n\n\thandlePossibleChange<T>(observable: IObservable<T>): void {\n\t\t// NO OP\n\t}\n\n\thandleChange<T, TChange>(observable: IObservableWithChange<T, TChange>, change: TChange): void {\n\t\t// NO OP\n\t}\n}\n\nexport function derivedObservableWithCache<T>(owner: DebugOwner, computeFn: (reader: IReader, lastValue: T | undefined) => T): IObservable<T> {\n\tlet lastValue: T | undefined = undefined;\n\tconst observable = derivedOpts({ owner, debugReferenceFn: computeFn }, reader => {\n\t\tlastValue = computeFn(reader, lastValue);\n\t\treturn lastValue;\n\t});\n\treturn observable;\n}\n\nexport function derivedObservableWithWritableCache<T>(owner: object, computeFn: (reader: IReader, lastValue: T | undefined) => T): IObservable<T>\n\t& { clearCache(transaction: ITransaction): void; setCache(newValue: T | undefined, tx: ITransaction | undefined): void } {\n\tlet lastValue: T | undefined = undefined;\n\tconst onChange = observableSignal('derivedObservableWithWritableCache');\n\tconst observable = derived(owner, reader => {\n\t\tonChange.read(reader);\n\t\tlastValue = computeFn(reader, lastValue);\n\t\treturn lastValue;\n\t});\n\treturn Object.assign(observable, {\n\t\tclearCache: (tx: ITransaction) => {\n\t\t\tlastValue = undefined;\n\t\t\tonChange.trigger(tx);\n\t\t},\n\t\tsetCache: (newValue: T | undefined, tx: ITransaction | undefined) => {\n\t\t\tlastValue = newValue;\n\t\t\tonChange.trigger(tx);\n\t\t}\n\t});\n}\n\n/**\n * When the items array changes, referential equal items are not mapped again.\n */\nexport function mapObservableArrayCached<TIn, TOut, TKey = TIn>(owner: DebugOwner, items: IObservable<readonly TIn[]>, map: (input: TIn, store: DisposableStore) => TOut, keySelector?: (input: TIn) => TKey): IObservable<readonly TOut[]> {\n\tlet m = new ArrayMap(map, keySelector);\n\tconst self = derivedOpts({\n\t\tdebugReferenceFn: map,\n\t\towner,\n\t\tonLastObserverRemoved: () => {\n\t\t\tm.dispose();\n\t\t\tm = new ArrayMap(map);\n\t\t}\n\t}, (reader) => {\n\t\tconst i = items.read(reader);\n\t\tm.setItems(i);\n\t\treturn m.getItems();\n\t});\n\treturn self;\n}\n\nclass ArrayMap<TIn, TOut, TKey> implements IDisposable {\n\tprivate readonly _cache = new Map<TKey, { out: TOut; store: DisposableStore }>();\n\tprivate _items: TOut[] = [];\n\tconstructor(\n\t\tprivate readonly _map: (input: TIn, store: DisposableStore) => TOut,\n\t\tprivate readonly _keySelector?: (input: TIn) => TKey,\n\t) {\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._cache.forEach(entry => entry.store.dispose());\n\t\tthis._cache.clear();\n\t}\n\n\tpublic setItems(items: readonly TIn[]): void {\n\t\tconst newItems: TOut[] = [];\n\t\tconst itemsToRemove = new Set(this._cache.keys());\n\n\t\tfor (const item of items) {\n\t\t\tconst key = this._keySelector ? this._keySelector(item) : item as unknown as TKey;\n\n\t\t\tlet entry = this._cache.get(key);\n\t\t\tif (!entry) {\n\t\t\t\tconst store = new DisposableStore();\n\t\t\t\tconst out = this._map(item, store);\n\t\t\t\tentry = { out, store };\n\t\t\t\tthis._cache.set(key, entry);\n\t\t\t} else {\n\t\t\t\titemsToRemove.delete(key);\n\t\t\t}\n\t\t\tnewItems.push(entry.out);\n\t\t}\n\n\t\tfor (const item of itemsToRemove) {\n\t\t\tconst entry = this._cache.get(item)!;\n\t\t\tentry.store.dispose();\n\t\t\tthis._cache.delete(item);\n\t\t}\n\n\t\tthis._items = newItems;\n\t}\n\n\tpublic getItems(): TOut[] {\n\t\treturn this._items;\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 { autorun } from '../reactions/autorun.js';\nimport { IObservable, IObservableWithChange, IObserver, IReader, ITransaction } from '../base.js';\nimport { DebugOwner } from '../debugName.js';\nimport { DisposableStore, IDisposable, toDisposable } from '../commonFacade/deps.js';\nimport { derived, derivedOpts } from '../observables/derived.js';\nimport { observableFromEvent } from '../observables/observableFromEvent.js';\nimport { observableSignal } from '../observables/observableSignal.js';\nimport { _setKeepObserved, _setRecomputeInitiallyAndOnChange } from '../observables/baseObservable.js';\nimport { DebugLocation } from '../debugLocation.js';\n\n/**\n * Creates an observable that debounces the input observable.\n */\nexport function debouncedObservable<T>(observable: IObservable<T>, debounceMs: number | ((lastValue: T | undefined, newValue: T) => number), debugLocation = DebugLocation.ofCaller()): IObservable<T> {\n\tlet hasValue = false;\n\tlet lastValue: T | undefined;\n\n\tlet timeout: Timeout | undefined = undefined;\n\n\treturn observableFromEvent<T, void>(undefined, cb => {\n\t\tconst d = autorun(reader => {\n\t\t\tconst value = observable.read(reader);\n\n\t\t\tif (!hasValue) {\n\t\t\t\thasValue = true;\n\t\t\t\tlastValue = value;\n\t\t\t} else {\n\t\t\t\tif (timeout) {\n\t\t\t\t\tclearTimeout(timeout);\n\t\t\t\t}\n\t\t\t\tconst debounceDuration = typeof debounceMs === 'number' ? debounceMs : debounceMs(lastValue, value);\n\t\t\t\tif (debounceDuration === 0) {\n\t\t\t\t\tlastValue = value;\n\t\t\t\t\tcb();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttimeout = setTimeout(() => {\n\t\t\t\t\tlastValue = value;\n\t\t\t\t\tcb();\n\t\t\t\t}, debounceDuration);\n\t\t\t}\n\t\t});\n\t\treturn {\n\t\t\tdispose() {\n\t\t\t\td.dispose();\n\t\t\t\thasValue = false;\n\t\t\t\tlastValue = undefined;\n\t\t\t},\n\t\t};\n\t}, () => {\n\t\tif (hasValue) {\n\t\t\treturn lastValue!;\n\t\t} else {\n\t\t\treturn observable.get();\n\t\t}\n\t}, debugLocation);\n}\n\n/**\n * Creates an observable that debounces the input observable.\n */\nexport function debouncedObservable2<T>(observable: IObservable<T>, debounceMs: number | ((currentValue: T | undefined, newValue: T) => number), debugLocation = DebugLocation.ofCaller()): IObservable<T> {\n\tconst s = observableSignal('handleTimeout');\n\n\tlet currentValue: T | undefined = undefined;\n\tlet timeout: Timeout | undefined = undefined;\n\n\tconst d = derivedOpts({\n\t\towner: undefined,\n\t\tonLastObserverRemoved: () => {\n\t\t\tcurrentValue = undefined;\n\t\t}\n\t}, reader => {\n\t\tconst val = observable.read(reader);\n\t\ts.read(reader);\n\n\t\tif (val !== currentValue) {\n\t\t\tconst debounceDuration = typeof debounceMs === 'number' ? debounceMs : debounceMs(currentValue, val);\n\n\t\t\tif (debounceDuration === 0) {\n\t\t\t\tcurrentValue = val;\n\t\t\t\treturn val;\n\t\t\t}\n\n\t\t\tif (timeout) {\n\t\t\t\tclearTimeout(timeout);\n\t\t\t}\n\t\t\ttimeout = setTimeout(() => {\n\t\t\t\tcurrentValue = val;\n\t\t\t\ts.trigger(undefined);\n\t\t\t}, debounceDuration);\n\t\t}\n\n\t\treturn currentValue!;\n\t}, debugLocation);\n\n\treturn d;\n}\n\n/**\n * This makes sure the observable is being observed and keeps its cache alive.\n */\nexport function keepObserved<T>(observable: IObservable<T>): IDisposable {\n\tconst o = new KeepAliveObserver(false, undefined);\n\tobservable.addObserver(o);\n\treturn toDisposable(() => {\n\t\tobservable.removeObserver(o);\n\t});\n}\n\n_setKeepObserved(keepObserved);\n\n/**\n * This converts the given observable into an autorun.\n */\nexport function recomputeInitiallyAndOnChange<T>(observable: IObservable<T>, handleValue?: (value: T) => void): IDisposable {\n\tconst o = new KeepAliveObserver(true, handleValue);\n\tobservable.addObserver(o);\n\ttry {\n\t\to.beginUpdate(observable);\n\t} finally {\n\t\to.endUpdate(observable);\n\t}\n\n\treturn toDisposable(() => {\n\t\tobservable.removeObserver(o);\n\t});\n}\n\n_setRecomputeInitiallyAndOnChange(recomputeInitiallyAndOnChange);\n\nexport class KeepAliveObserver implements IObserver {\n\tprivate _counter = 0;\n\n\tconstructor(\n\t\tprivate readonly _forceRecompute: boolean,\n\t\tprivate readonly _handleValue: ((value: any) => void) | undefined,\n\t) { }\n\n\tbeginUpdate<T>(observable: IObservable<T>): void {\n\t\tthis._counter++;\n\t}\n\n\tendUpdate<T>(observable: IObservable<T>): void {\n\t\tif (this._counter === 1 && this._forceRecompute) {\n\t\t\tif (this._handleValue) {\n\t\t\t\tthis._handleValue(observable.get());\n\t\t\t} else {\n\t\t\t\tobservable.reportChanges();\n\t\t\t}\n\t\t}\n\t\tthis._counter--;\n\t}\n\n\thandlePossibleChange<T>(observable: IObservable<T>): void {\n\t\t// NO OP\n\t}\n\n\thandleChange<T, TChange>(observable: IObservableWithChange<T, TChange>, change: TChange): void {\n\t\t// NO OP\n\t}\n}\n\nexport function derivedObservableWithCache<T>(owner: DebugOwner, computeFn: (reader: IReader, lastValue: T | undefined) => T): IObservable<T> {\n\tlet lastValue: T | undefined = undefined;\n\tconst observable = derivedOpts({ owner, debugReferenceFn: computeFn }, reader => {\n\t\tlastValue = computeFn(reader, lastValue);\n\t\treturn lastValue;\n\t});\n\treturn observable;\n}\n\nexport function derivedObservableWithWritableCache<T>(owner: object, computeFn: (reader: IReader, lastValue: T | undefined) => T): IObservable<T>\n\t& { clearCache(transaction: ITransaction): void; setCache(newValue: T | undefined, tx: ITransaction | undefined): void } {\n\tlet lastValue: T | undefined = undefined;\n\tconst onChange = observableSignal('derivedObservableWithWritableCache');\n\tconst observable = derived(owner, reader => {\n\t\tonChange.read(reader);\n\t\tlastValue = computeFn(reader, lastValue);\n\t\treturn lastValue;\n\t});\n\treturn Object.assign(observable, {\n\t\tclearCache: (tx: ITransaction) => {\n\t\t\tlastValue = undefined;\n\t\t\tonChange.trigger(tx);\n\t\t},\n\t\tsetCache: (newValue: T | undefined, tx: ITransaction | undefined) => {\n\t\t\tlastValue = newValue;\n\t\t\tonChange.trigger(tx);\n\t\t}\n\t});\n}\n\n/**\n * When the items array changes, referential equal items are not mapped again.\n */\nexport function mapObservableArrayCached<TIn, TOut, TKey = TIn>(owner: DebugOwner, items: IObservable<readonly TIn[]>, map: (input: TIn, store: DisposableStore) => TOut, keySelector?: (input: TIn) => TKey): IObservable<readonly TOut[]> {\n\tlet m = new ArrayMap(map, keySelector);\n\tconst self = derivedOpts({\n\t\tdebugReferenceFn: map,\n\t\towner,\n\t\tonLastObserverRemoved: () => {\n\t\t\tm.dispose();\n\t\t\tm = new ArrayMap(map);\n\t\t}\n\t}, (reader) => {\n\t\tconst i = items.read(reader);\n\t\tm.setItems(i);\n\t\treturn m.getItems();\n\t});\n\treturn self;\n}\n\nclass ArrayMap<TIn, TOut, TKey> implements IDisposable {\n\tprivate readonly _cache = new Map<TKey, { out: TOut; store: DisposableStore }>();\n\tprivate _items: TOut[] = [];\n\tconstructor(\n\t\tprivate readonly _map: (input: TIn, store: DisposableStore) => TOut,\n\t\tprivate readonly _keySelector?: (input: TIn) => TKey,\n\t) {\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._cache.forEach(entry => entry.store.dispose());\n\t\tthis._cache.clear();\n\t}\n\n\tpublic setItems(items: readonly TIn[]): void {\n\t\tconst newItems: TOut[] = [];\n\t\tconst itemsToRemove = new Set(this._cache.keys());\n\n\t\tfor (const item of items) {\n\t\t\tconst key = this._keySelector ? this._keySelector(item) : item as unknown as TKey;\n\n\t\t\tlet entry = this._cache.get(key);\n\t\t\tif (!entry) {\n\t\t\t\tconst store = new DisposableStore();\n\t\t\t\tconst out = this._map(item, store);\n\t\t\t\tentry = { out, store };\n\t\t\t\tthis._cache.set(key, entry);\n\t\t\t} else {\n\t\t\t\titemsToRemove.delete(key);\n\t\t\t}\n\t\t\tnewItems.push(entry.out);\n\t\t}\n\n\t\tfor (const item of itemsToRemove) {\n\t\t\tconst entry = this._cache.get(item)!;\n\t\t\tentry.store.dispose();\n\t\t\tthis._cache.delete(item);\n\t\t}\n\n\t\tthis._items = newItems;\n\t}\n\n\tpublic getItems(): TOut[] {\n\t\treturn this._items;\n\t}\n}\n"]}
@@ -1442,6 +1442,7 @@ export const posix = {
1442
1442
  posix.win32 = win32.win32 = win32;
1443
1443
  posix.posix = win32.posix = posix;
1444
1444
  export const normalize = (platformIsWin32 ? win32.normalize : posix.normalize);
1445
+ export const join = (platformIsWin32 ? win32.join : posix.join);
1445
1446
  export const resolve = (platformIsWin32 ? win32.resolve : posix.resolve);
1446
1447
  export const relative = (platformIsWin32 ? win32.relative : posix.relative);
1447
1448
  export const dirname = (platformIsWin32 ? win32.dirname : posix.dirname);