monaco-editor-core 0.55.0 → 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.
- package/esm/nls.keys.json +1 -1
- package/esm/nls.messages.cs.js +2 -2
- package/esm/nls.messages.de.js +2 -2
- package/esm/nls.messages.es.js +2 -2
- package/esm/nls.messages.fr.js +2 -2
- package/esm/nls.messages.it.js +2 -2
- package/esm/nls.messages.ja.js +2 -2
- package/esm/nls.messages.js +1 -1
- package/esm/nls.messages.json +1 -1
- package/esm/nls.messages.ko.js +2 -2
- package/esm/nls.messages.pl.js +2 -2
- package/esm/nls.messages.pt-br.js +2 -2
- package/esm/nls.messages.ru.js +2 -2
- package/esm/nls.messages.tr.js +2 -2
- package/esm/nls.messages.zh-cn.js +2 -2
- package/esm/nls.messages.zh-tw.js +2 -2
- package/esm/nls.metadata.json +27 -8
- package/esm/vs/base/browser/dom.js +31 -34
- package/esm/vs/base/browser/dom.js.map +1 -1
- package/esm/vs/base/browser/dompurify/dompurify.js +0 -1
- package/esm/vs/base/browser/keyboardEvent.js +3 -3
- package/esm/vs/base/browser/keyboardEvent.js.map +1 -1
- package/esm/vs/base/browser/markdownRenderer.js +5 -2
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/pixelRatio.js +5 -5
- package/esm/vs/base/browser/pixelRatio.js.map +1 -1
- package/esm/vs/base/browser/trustedTypes.js +1 -1
- package/esm/vs/base/browser/trustedTypes.js.map +1 -1
- package/esm/vs/base/browser/ui/actionbar/actionbar.js +3 -0
- package/esm/vs/base/browser/ui/actionbar/actionbar.js.map +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +7 -0
- package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js.map +1 -1
- package/esm/vs/base/browser/ui/hover/hoverWidget.css +0 -13
- package/esm/vs/base/browser/ui/inputbox/inputBox.js +7 -0
- package/esm/vs/base/browser/ui/inputbox/inputBox.js.map +1 -1
- package/esm/vs/base/browser/ui/keybindingLabel/keybindingLabel.css +4 -2
- package/esm/vs/base/browser/ui/list/listView.js +7 -2
- package/esm/vs/base/browser/ui/list/listView.js.map +1 -1
- package/esm/vs/base/browser/ui/selectBox/selectBox.js +4 -0
- package/esm/vs/base/browser/ui/selectBox/selectBox.js.map +1 -1
- package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.css +12 -32
- package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js +8 -18
- package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js.map +1 -1
- package/esm/vs/base/browser/ui/toolbar/toolbar.js +41 -14
- package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js +11 -0
- package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js +1 -0
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/compressedObjectTreeModel.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/dataTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/indexTreeModel.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/objectTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/objectTreeModel.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/tree.js.map +1 -1
- package/esm/vs/base/common/arrays.js +10 -0
- package/esm/vs/base/common/arrays.js.map +1 -1
- package/esm/vs/base/common/async.js +34 -0
- package/esm/vs/base/common/async.js.map +1 -1
- package/esm/vs/base/common/buffer.js +1 -1
- package/esm/vs/base/common/buffer.js.map +1 -1
- package/esm/vs/base/common/cancellation.js.map +1 -1
- package/esm/vs/base/common/codiconsLibrary.js +3 -0
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/base/common/collections.js.map +1 -1
- package/esm/vs/base/common/equals.js.map +1 -1
- package/esm/vs/base/common/event.js +32 -15
- package/esm/vs/base/common/event.js.map +1 -1
- package/esm/vs/base/common/filters.js +22 -3
- package/esm/vs/base/common/filters.js.map +1 -1
- package/esm/vs/base/common/hotReload.js +2 -2
- package/esm/vs/base/common/hotReload.js.map +1 -1
- package/esm/vs/base/common/iterator.js +1 -1
- package/esm/vs/base/common/iterator.js.map +1 -1
- package/esm/vs/base/common/keyCodes.js +7 -6
- package/esm/vs/base/common/keyCodes.js.map +1 -1
- package/esm/vs/base/common/linkedList.js.map +1 -1
- package/esm/vs/base/common/map.js.map +1 -1
- package/esm/vs/base/common/marked/marked.js +0 -1
- package/esm/vs/base/common/network.js +26 -1
- package/esm/vs/base/common/network.js.map +1 -1
- package/esm/vs/base/common/normalization.js +19 -6
- package/esm/vs/base/common/normalization.js.map +1 -1
- package/esm/vs/base/common/observableInternal/debugLocation.js +1 -2
- package/esm/vs/base/common/observableInternal/debugLocation.js.map +1 -1
- package/esm/vs/base/common/observableInternal/debugName.js +0 -1
- package/esm/vs/base/common/observableInternal/debugName.js.map +1 -1
- package/esm/vs/base/common/observableInternal/index.js +4 -4
- package/esm/vs/base/common/observableInternal/index.js.map +1 -1
- package/esm/vs/base/common/observableInternal/logging/debugGetDependencyGraph.js +38 -10
- package/esm/vs/base/common/observableInternal/logging/debugGetDependencyGraph.js.map +1 -1
- package/esm/vs/base/common/observableInternal/observables/baseObservable.js +3 -3
- package/esm/vs/base/common/observableInternal/observables/baseObservable.js.map +1 -1
- package/esm/vs/base/common/observableInternal/utils/utils.js +46 -5
- package/esm/vs/base/common/observableInternal/utils/utils.js.map +1 -1
- package/esm/vs/base/common/path.js +1 -0
- package/esm/vs/base/common/path.js.map +1 -1
- package/esm/vs/base/common/strings.js +27 -19
- package/esm/vs/base/common/strings.js.map +1 -1
- package/esm/vs/editor/browser/config/elementSizeObserver.js +5 -5
- package/esm/vs/editor/browser/config/elementSizeObserver.js.map +1 -1
- package/esm/vs/editor/browser/config/fontMeasurements.js.map +1 -1
- package/esm/vs/editor/browser/config/migrateOptions.js +6 -0
- package/esm/vs/editor/browser/config/migrateOptions.js.map +1 -1
- package/esm/vs/editor/browser/config/tabFocus.js +4 -2
- package/esm/vs/editor/browser/config/tabFocus.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +8 -0
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
- package/esm/vs/editor/browser/coreCommands.js +1 -2
- package/esm/vs/editor/browser/coreCommands.js.map +1 -1
- package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
- package/esm/vs/editor/browser/observableCodeEditor.js +32 -1
- package/esm/vs/editor/browser/observableCodeEditor.js.map +1 -1
- package/esm/vs/editor/browser/services/contribution.js +9 -0
- package/esm/vs/editor/browser/services/contribution.js.map +1 -0
- package/esm/vs/editor/browser/services/editorWorkerService.js +27 -14
- package/esm/vs/editor/browser/services/editorWorkerService.js.map +1 -1
- package/esm/vs/editor/browser/services/openerService.js +5 -1
- package/esm/vs/editor/browser/services/openerService.js.map +1 -1
- package/esm/vs/editor/browser/view/domLineBreaksComputer.js +1 -1
- package/esm/vs/editor/browser/view/domLineBreaksComputer.js.map +1 -1
- package/esm/vs/editor/browser/view/renderingContext.js +1 -1
- package/esm/vs/editor/browser/view/renderingContext.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js +10 -3
- package/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +3 -4
- package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/minimap/minimap.js +1 -1
- package/esm/vs/editor/browser/viewParts/minimap/minimap.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js +1 -1
- package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js +4 -2
- package/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/rulers/rulers.js +1 -3
- package/esm/vs/editor/browser/viewParts/rulers/rulers.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js +1 -1
- package/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/viewLines/domReadingContext.js +2 -1
- package/esm/vs/editor/browser/viewParts/viewLines/domReadingContext.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js +6 -18
- package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/whitespace/whitespace.js +0 -7
- package/esm/vs/editor/browser/viewParts/whitespace/whitespace.js.map +1 -1
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +7 -2
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +1 -0
- package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js.map +1 -1
- package/esm/vs/editor/common/commands/replaceCommand.js +2 -2
- package/esm/vs/editor/common/commands/replaceCommand.js.map +1 -1
- package/esm/vs/editor/common/config/editorOptions.js +374 -360
- package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
- package/esm/vs/editor/common/core/2d/rect.js +7 -0
- package/esm/vs/editor/common/core/2d/rect.js.map +1 -1
- package/esm/vs/editor/common/core/2d/size.js +20 -0
- package/esm/vs/editor/common/core/2d/size.js.map +1 -0
- package/esm/vs/editor/common/core/editorColorRegistry.js +69 -68
- package/esm/vs/editor/common/core/editorColorRegistry.js.map +1 -1
- package/esm/vs/editor/common/core/ranges/offsetRange.js +9 -0
- package/esm/vs/editor/common/core/ranges/offsetRange.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursorMoveCommands.js +4 -4
- package/esm/vs/editor/common/cursor/cursorMoveCommands.js.map +1 -1
- package/esm/vs/editor/common/editorContextKeys.js +47 -47
- package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
- package/esm/vs/editor/common/languages.js +56 -56
- package/esm/vs/editor/common/languages.js.map +1 -1
- package/esm/vs/editor/common/model/editStack.js +1 -1
- package/esm/vs/editor/common/services/languagesAssociations.js +6 -8
- package/esm/vs/editor/common/services/languagesAssociations.js.map +1 -1
- package/esm/vs/editor/common/standaloneStrings.js +11 -10
- package/esm/vs/editor/common/standaloneStrings.js.map +1 -1
- package/esm/vs/editor/common/textModelEditSource.js +1 -1
- package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
- package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
- package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
- package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
- package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +17 -17
- package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
- package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
- package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
- package/esm/vs/editor/contrib/codelens/browser/codelens.js.map +1 -1
- package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
- package/esm/vs/editor/contrib/codelens/browser/codelensController.js.map +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
- package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +10 -10
- package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
- package/esm/vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution.js +14 -0
- package/esm/vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution.js.map +1 -1
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +9 -9
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
- package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
- package/esm/vs/editor/contrib/find/browser/findController.js +17 -17
- package/esm/vs/editor/contrib/find/browser/findController.js.map +1 -1
- package/esm/vs/editor/contrib/find/browser/findWidget.js +26 -26
- package/esm/vs/editor/contrib/floatingMenu/browser/floatingMenu.css +1 -1
- package/esm/vs/editor/contrib/folding/browser/folding.js +20 -20
- package/esm/vs/editor/contrib/folding/browser/folding.js.map +1 -1
- package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
- package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
- package/esm/vs/editor/contrib/format/browser/format.js +21 -6
- package/esm/vs/editor/contrib/format/browser/format.js.map +1 -1
- package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
- package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
- package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
- package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
- package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
- package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
- package/esm/vs/editor/contrib/hover/browser/contentHoverController.js +5 -10
- package/esm/vs/editor/contrib/hover/browser/contentHoverController.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/glyphHoverController.js +11 -6
- package/esm/vs/editor/contrib/hover/browser/glyphHoverController.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
- package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/hoverUtils.js +24 -0
- package/esm/vs/editor/contrib/hover/browser/hoverUtils.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +9 -9
- package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
- package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +20 -20
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +12 -12
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +18 -16
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +42 -37
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js +3 -3
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +8 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +54 -43
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +12 -12
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +74 -48
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +8 -36
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsNewUsers.js +10 -11
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsNewUsers.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +105 -119
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +8 -36
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/debugVisualization.js +95 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/debugVisualization.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js +17 -9
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js +415 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js +253 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/longDistancePreviewEditor.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/flexBoxLayout.js +103 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/flexBoxLayout.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/towersLayout.js +32 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/towersLayout.js.map +1 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js +44 -11
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js +181 -0
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineSuggestionsView.js.map +1 -0
- package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
- package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +32 -31
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js.map +1 -1
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
- package/esm/vs/editor/contrib/links/browser/links.js +10 -10
- package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
- package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
- package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js +2 -2
- package/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js.map +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +18 -13
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js.map +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
- package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
- package/esm/vs/editor/contrib/rename/browser/rename.js +12 -12
- package/esm/vs/editor/contrib/rename/browser/rename.js.map +1 -1
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
- package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +1 -1
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +8 -8
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +10 -10
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +17 -17
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
- package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
- package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
- package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +29 -29
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js.map +1 -1
- package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
- package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +4 -4
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js.map +1 -1
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +1 -1
- package/esm/vs/editor/editor.all.js +1 -0
- package/esm/vs/editor/editor.all.js.map +1 -1
- package/esm/vs/editor/editor.api.d.ts +9 -5
- package/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js +22 -2
- package/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js.map +1 -1
- package/esm/vs/editor/standalone/browser/services/standaloneWebWorkerService.js +39 -0
- package/esm/vs/editor/standalone/browser/services/standaloneWebWorkerService.js.map +1 -0
- package/esm/vs/editor/standalone/browser/standaloneEditor.js +2 -1
- package/esm/vs/editor/standalone/browser/standaloneEditor.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneServices.js +3 -21
- package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneWebWorker.js +4 -4
- package/esm/vs/editor/standalone/browser/standaloneWebWorker.js.map +1 -1
- package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
- package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
- package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +7 -9
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js.map +1 -1
- package/esm/vs/platform/actions/browser/toolbar.js +2 -2
- package/esm/vs/platform/actions/common/actions.js +2 -0
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- package/esm/vs/platform/actions/common/menuService.js +2 -2
- package/esm/vs/platform/configuration/common/configuration.js +5 -4
- package/esm/vs/platform/configuration/common/configuration.js.map +1 -1
- package/esm/vs/platform/configuration/common/configurationModels.js +21 -10
- package/esm/vs/platform/configuration/common/configurationModels.js.map +1 -1
- package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
- package/esm/vs/platform/configuration/common/configurationRegistry.js.map +1 -1
- package/esm/vs/platform/configuration/common/configurations.js.map +1 -1
- package/esm/vs/platform/contextkey/browser/contextKeyService.js +3 -3
- package/esm/vs/platform/contextkey/browser/contextKeyService.js.map +1 -1
- package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
- package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
- package/esm/vs/platform/contextkey/common/scanner.js +5 -5
- package/esm/vs/platform/contextview/browser/contextViewService.js.map +1 -1
- package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
- package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
- package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
- package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
- package/esm/vs/platform/list/browser/listService.js +27 -27
- package/esm/vs/platform/list/browser/listService.js.map +1 -1
- package/esm/vs/platform/markers/common/markerService.js +2 -2
- package/esm/vs/platform/markers/common/markers.js +6 -6
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +11 -32
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
- package/esm/vs/platform/quickinput/browser/media/quickInput.css +9 -3
- package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
- package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
- package/esm/vs/platform/quickinput/browser/quickInputController.js +35 -14
- package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputList.js +4 -1
- package/esm/vs/platform/quickinput/browser/quickInputList.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js +71 -40
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeController.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js +21 -8
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js.map +1 -1
- package/esm/vs/platform/telemetry/common/gdprTypings.js.map +1 -1
- package/esm/vs/platform/telemetry/common/telemetry.js.map +1 -1
- package/esm/vs/platform/theme/common/colorUtils.js +2 -2
- package/esm/vs/platform/theme/common/colors/baseColors.js +17 -17
- package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
- package/esm/vs/platform/theme/common/colors/editorColors.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
- package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
- package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
- package/esm/vs/platform/theme/common/colors/minimapColors.js +11 -11
- package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
- package/esm/vs/platform/theme/common/colors/miscColors.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
- package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
- package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
- package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
- package/esm/vs/platform/webWorker/browser/webWorkerDescriptor.js +12 -0
- package/esm/vs/platform/webWorker/browser/webWorkerDescriptor.js.map +1 -0
- package/esm/vs/platform/webWorker/browser/webWorkerService.js +7 -0
- package/esm/vs/platform/webWorker/browser/webWorkerService.js.map +1 -0
- package/esm/vs/{base/browser/webWorkerFactory.js → platform/webWorker/browser/webWorkerServiceImpl.js} +47 -66
- package/esm/vs/platform/webWorker/browser/webWorkerServiceImpl.js.map +1 -0
- package/esm/vs/platform/workspace/common/workspace.js +1 -1
- package/monaco.d.ts +9 -5
- package/package.json +2 -2
- package/version.txt +1 -1
- package/esm/vs/base/browser/webWorkerFactory.js.map +0 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineCompletionsView.js +0 -82
- 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/debugLocation.ts","vs/base/common/observableInternal/debugLocation.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAIhG,MAAM,KAAW,aAAa,
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/observableInternal/debugLocation.ts","vs/base/common/observableInternal/debugLocation.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAIhG,MAAM,KAAW,aAAa,CAoB7B;AApBD,WAAiB,aAAa;IAC7B,IAAI,OAAO,GAAG,KAAK,CAAC;IAEpB,SAAgB,MAAM;QACrB,OAAO,GAAG,IAAI,CAAC;IAChB,CAAC;IAFe,oBAAM,SAErB,CAAA;IAED,SAAgB,QAAQ;QACvB,IAAI,CAAC,OAAO,EAAE,CAAC;YACd,OAAO,SAAS,CAAC;QAClB,CAAC;QACD,MAAM,GAAG,GAAG,KAAuD,CAAC;QAEpE,MAAM,CAAC,GAAG,GAAG,CAAC,eAAe,CAAC;QAC9B,GAAG,CAAC,eAAe,GAAG,CAAC,CAAC;QACxB,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC,KAAM,CAAC;QACjC,GAAG,CAAC,eAAe,GAAG,CAAC,CAAC;QAExB,OAAO,iBAAiB,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAC9C,CAAC;IAZe,sBAAQ,WAYvB,CAAA;AACF,CAAC,EApBgB,aAAa,KAAb,aAAa,QAoB7B;AAED,MAAM,iBAAiB;IACf,MAAM,CAAC,SAAS,CAAC,KAAa,EAAE,SAAiB;QACvD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC;QACjD,IAAI,QAAQ,EAAE,CAAC;YACd,OAAO,IAAI,iBAAiB,CAC3B,QAAQ,CAAC,QAAQ,EACjB,QAAQ,CAAC,IAAI,EACb,QAAQ,CAAC,MAAM,EACf,QAAQ,CAAC,EAAE,CACX,CAAC;QACH,CAAC;aAAM,CAAC;YACP,OAAO,SAAS,CAAC;QAClB,CAAC;IACF,CAAC;IAED,YACiB,QAAgB,EAChB,IAAY,EACZ,MAAc,EACd,EAAU;QAHV,aAAQ,GAAR,QAAQ,CAAQ;QAChB,SAAI,GAAJ,IAAI,CAAQ;QACZ,WAAM,GAAN,MAAM,CAAQ;QACd,OAAE,GAAF,EAAE,CAAQ;IAE3B,CAAC;CACD;AAUD,SAAS,SAAS,CAAC,SAAiB;IACnC,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACtD,IAAI,KAAK,EAAE,CAAC;QACX,OAAO;YACN,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;YAClB,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACxB,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC1B,EAAE,EAAE,SAAS;SACb,CAAC;IACH,CAAC;IAED,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAE5D,IAAI,MAAM,EAAE,CAAC;QACZ,OAAO;YACN,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;YACnB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACzB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAC3B,EAAE,EAAE,SAAS;SACb,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC","file":"debugLocation.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 type DebugLocation = DebugLocationImpl | undefined;\n\nexport namespace DebugLocation {\n\tlet enabled = false;\n\n\texport function enable(): void {\n\t\tenabled = true;\n\t}\n\n\texport function ofCaller(): DebugLocation {\n\t\tif (!enabled) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst Err = Error as ErrorConstructor & { stackTraceLimit: number };\n\n\t\tconst l = Err.stackTraceLimit;\n\t\tErr.stackTraceLimit = 3;\n\t\tconst stack = new Error().stack!;\n\t\tErr.stackTraceLimit = l;\n\n\t\treturn DebugLocationImpl.fromStack(stack, 2);\n\t}\n}\n\nclass DebugLocationImpl implements ILocation {\n\tpublic static fromStack(stack: string, parentIdx: number): DebugLocationImpl | undefined {\n\t\tconst lines = stack.split('\\n');\n\t\tconst location = parseLine(lines[parentIdx + 1]);\n\t\tif (location) {\n\t\t\treturn new DebugLocationImpl(\n\t\t\t\tlocation.fileName,\n\t\t\t\tlocation.line,\n\t\t\t\tlocation.column,\n\t\t\t\tlocation.id\n\t\t\t);\n\t\t} else {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tconstructor(\n\t\tpublic readonly fileName: string,\n\t\tpublic readonly line: number,\n\t\tpublic readonly column: number,\n\t\tpublic readonly id: string,\n\t) {\n\t}\n}\n\n\nexport interface ILocation {\n\tfileName: string;\n\tline: number;\n\tcolumn: number;\n\tid: string;\n}\n\nfunction parseLine(stackLine: string): ILocation | undefined {\n\tconst match = stackLine.match(/\\((.*):(\\d+):(\\d+)\\)/);\n\tif (match) {\n\t\treturn {\n\t\t\tfileName: match[1],\n\t\t\tline: parseInt(match[2]),\n\t\t\tcolumn: parseInt(match[3]),\n\t\t\tid: stackLine,\n\t\t};\n\t}\n\n\tconst match2 = stackLine.match(/at ([^\\(\\)]*):(\\d+):(\\d+)/);\n\n\tif (match2) {\n\t\treturn {\n\t\t\tfileName: match2[1],\n\t\t\tline: parseInt(match2[2]),\n\t\t\tcolumn: parseInt(match2[3]),\n\t\t\tid: stackLine,\n\t\t};\n\t}\n\n\treturn undefined;\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 type DebugLocation = DebugLocationImpl | undefined;\n\nexport namespace DebugLocation {\n\tlet enabled = false;\n\n\texport function enable(): void {\n\t\tenabled = true;\n\t}\n\n\texport function ofCaller(): DebugLocation {\n\t\tif (!enabled) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst Err = Error as ErrorConstructor & { stackTraceLimit: number };\n\n\t\tconst l = Err.stackTraceLimit;\n\t\tErr.stackTraceLimit = 3;\n\t\tconst stack = new Error().stack!;\n\t\tErr.stackTraceLimit = l;\n\n\t\treturn DebugLocationImpl.fromStack(stack, 2);\n\t}\n}\n\nclass DebugLocationImpl implements ILocation {\n\tpublic static fromStack(stack: string, parentIdx: number): DebugLocationImpl | undefined {\n\t\tconst lines = stack.split('\\n');\n\t\tconst location = parseLine(lines[parentIdx + 1]);\n\t\tif (location) {\n\t\t\treturn new DebugLocationImpl(\n\t\t\t\tlocation.fileName,\n\t\t\t\tlocation.line,\n\t\t\t\tlocation.column,\n\t\t\t\tlocation.id\n\t\t\t);\n\t\t} else {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tconstructor(\n\t\tpublic readonly fileName: string,\n\t\tpublic readonly line: number,\n\t\tpublic readonly column: number,\n\t\tpublic readonly id: string,\n\t) {\n\t}\n}\n\n\nexport interface ILocation {\n\tfileName: string;\n\tline: number;\n\tcolumn: number;\n\tid: string;\n}\n\nfunction parseLine(stackLine: string): ILocation | undefined {\n\tconst match = stackLine.match(/\\((.*):(\\d+):(\\d+)\\)/);\n\tif (match) {\n\t\treturn {\n\t\t\tfileName: match[1],\n\t\t\tline: parseInt(match[2]),\n\t\t\tcolumn: parseInt(match[3]),\n\t\t\tid: stackLine,\n\t\t};\n\t}\n\n\tconst match2 = stackLine.match(/at ([^\\(\\)]*):(\\d+):(\\d+)/);\n\n\tif (match2) {\n\t\treturn {\n\t\t\tfileName: match2[1],\n\t\t\tline: parseInt(match2[2]),\n\t\t\tcolumn: parseInt(match2[3]),\n\t\t\tid: stackLine,\n\t\t};\n\t}\n\n\treturn undefined;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/observableInternal/debugName.ts","vs/base/common/observableInternal/debugName.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAsBhG,MAAM,OAAO,aAAa;IACzB,YACiB,KAA6B,EAC7B,eAA4C,EAC5C,WAAiC;QAFjC,UAAK,GAAL,KAAK,CAAwB;QAC7B,oBAAe,GAAf,eAAe,CAA6B;QAC5C,gBAAW,GAAX,WAAW,CAAsB;IAC9C,CAAC;IAEE,YAAY,CAAC,MAAc;QACjC,OAAO,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;CACD;AASD,MAAM,YAAY,GAAG,IAAI,GAAG,EAAkB,CAAC;AAC/C,MAAM,eAAe,GAAG,IAAI,OAAO,EAAkB,CAAC;AAEtD,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,IAAmB;IAC/D,MAAM,MAAM,GAAG,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,MAAM,EAAE,CAAC;QACZ,OAAO,MAAM,CAAC;IACf,CAAC;IAED,MAAM,OAAO,GAAG,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC/C,IAAI,OAAO,EAAE,CAAC;QACb,IAAI,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC3C,KAAK,EAAE,CAAC;QACR,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACjC,MAAM,MAAM,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,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AE,CAAC;QACV,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC5B,OAAO,SAAS,CAAC;QAClB,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,EAAY;IAC3C,MAAM,KAAK,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;IAC5B,mCAAmC;IACnC,MAAM,MAAM,GAAG,qCAAqC,CAAC;IACrD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjC,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5C,OAAO,MAAM,EAAE,IAAI,EAAE,CAAC;AACvB,CAAC","file":"debugName.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 interface IDebugNameData {\n\t/**\n\t * The owner object of an observable.\n\t * Used for debugging only, such as computing a name for the observable by iterating over the fields of the owner.\n\t */\n\treadonly owner?: DebugOwner | undefined;\n\n\t/**\n\t * A string or function that returns a string that represents the name of the observable.\n\t * Used for debugging only.\n\t */\n\treadonly debugName?: DebugNameSource | undefined;\n\n\t/**\n\t * A function that points to the defining function of the object.\n\t * Used for debugging only.\n\t */\n\treadonly debugReferenceFn?: Function | undefined;\n}\n\nexport class DebugNameData {\n\tconstructor(\n\t\tpublic readonly owner: DebugOwner | undefined,\n\t\tpublic readonly debugNameSource: DebugNameSource | undefined,\n\t\tpublic readonly referenceFn: Function | undefined,\n\t) { }\n\n\tpublic getDebugName(target: object): string | undefined {\n\t\treturn getDebugName(target, this);\n\t}\n}\n\n/**\n * The owning object of an observable.\n * Is only used for debugging purposes, such as computing a name for the observable by iterating over the fields of the owner.\n */\nexport type DebugOwner = object | undefined;\nexport type DebugNameSource = string | (() => string | undefined);\n\nconst countPerName = new Map<string, number>();\nconst cachedDebugName = new WeakMap<object, string>();\n\nexport function getDebugName(target: object, data: DebugNameData): string | undefined {\n\tconst cached = cachedDebugName.get(target);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tconst dbgName = computeDebugName(target, data);\n\tif (dbgName) {\n\t\tlet count = countPerName.get(dbgName) ?? 0;\n\t\tcount++;\n\t\tcountPerName.set(dbgName, count);\n\t\tconst result = count === 1 ? dbgName : `${dbgName}#${count}`;\n\t\tcachedDebugName.set(target, result);\n\t\treturn result;\n\t}\n\treturn undefined;\n}\n\nfunction computeDebugName(self: object, data: DebugNameData): string | undefined {\n\tconst cached = cachedDebugName.get(self);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tconst ownerStr = data.owner ? formatOwner(data.owner) + `.` : '';\n\n\tlet result: string | undefined;\n\tconst debugNameSource = data.debugNameSource;\n\tif (debugNameSource !== undefined) {\n\t\tif (typeof debugNameSource === 'function') {\n\t\t\tresult = debugNameSource();\n\t\t\tif (result !== undefined) {\n\t\t\t\treturn ownerStr + result;\n\t\t\t}\n\t\t} else {\n\t\t\treturn ownerStr + debugNameSource;\n\t\t}\n\t}\n\n\tconst referenceFn = data.referenceFn;\n\tif (referenceFn !== undefined) {\n\t\tresult = getFunctionName(referenceFn);\n\t\tif (result !== undefined) {\n\t\t\treturn ownerStr + result;\n\t\t}\n\t}\n\n\tif (data.owner !== undefined) {\n\t\tconst key = findKey(data.owner, self);\n\t\tif (key !== undefined) {\n\t\t\treturn ownerStr + key;\n\t\t}\n\t}\n\treturn undefined;\n}\n\nfunction findKey(obj: object, value: object): string | undefined {\n\tfor (const key in obj) {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tif ((obj as any)[key] === value) {\n\t\t\treturn key;\n\t\t}\n\t}\n\treturn undefined;\n}\n\nconst countPerClassName = new Map<string, number>();\nconst ownerId = new WeakMap<object, string>();\n\nfunction formatOwner(owner: object): string {\n\tconst id = ownerId.get(owner);\n\tif (id) {\n\t\treturn id;\n\t}\n\tconst className = getClassName(owner) ?? 'Object';\n\tlet count = countPerClassName.get(className) ?? 0;\n\tcount++;\n\tcountPerClassName.set(className, count);\n\tconst result = count === 1 ? className : `${className}#${count}`;\n\townerId.set(owner, result);\n\treturn result;\n}\n\nexport function getClassName(obj: object): string | undefined {\n\tconst ctor = obj.constructor;\n\tif (ctor) {\n\t\tif (ctor.name === 'Object') {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn ctor.name;\n\t}\n\treturn undefined;\n}\n\nexport function getFunctionName(fn: Function): string | undefined {\n\tconst fnSrc = fn.toString();\n\t// Pattern: /** @description ... */\n\tconst regexp = /\\/\\*\\*\\s*@description\\s*([^*]*)\\*\\//;\n\tconst match = regexp.exec(fnSrc);\n\tconst result = match ? match[1] : undefined;\n\treturn result?.trim();\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 interface IDebugNameData {\n\t/**\n\t * The owner object of an observable.\n\t * Used for debugging only, such as computing a name for the observable by iterating over the fields of the owner.\n\t */\n\treadonly owner?: DebugOwner | undefined;\n\n\t/**\n\t * A string or function that returns a string that represents the name of the observable.\n\t * Used for debugging only.\n\t */\n\treadonly debugName?: DebugNameSource | undefined;\n\n\t/**\n\t * A function that points to the defining function of the object.\n\t * Used for debugging only.\n\t */\n\treadonly debugReferenceFn?: Function | undefined;\n}\n\nexport class DebugNameData {\n\tconstructor(\n\t\tpublic readonly owner: DebugOwner | undefined,\n\t\tpublic readonly debugNameSource: DebugNameSource | undefined,\n\t\tpublic readonly referenceFn: Function | undefined,\n\t) { }\n\n\tpublic getDebugName(target: object): string | undefined {\n\t\treturn getDebugName(target, this);\n\t}\n}\n\n/**\n * The owning object of an observable.\n * Is only used for debugging purposes, such as computing a name for the observable by iterating over the fields of the owner.\n */\nexport type DebugOwner = object | undefined;\nexport type DebugNameSource = string | (() => string | undefined);\n\nconst countPerName = new Map<string, number>();\nconst cachedDebugName = new WeakMap<object, string>();\n\nexport function getDebugName(target: object, data: DebugNameData): string | undefined {\n\tconst cached = cachedDebugName.get(target);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tconst dbgName = computeDebugName(target, data);\n\tif (dbgName) {\n\t\tlet count = countPerName.get(dbgName) ?? 0;\n\t\tcount++;\n\t\tcountPerName.set(dbgName, count);\n\t\tconst result = count === 1 ? dbgName : `${dbgName}#${count}`;\n\t\tcachedDebugName.set(target, result);\n\t\treturn result;\n\t}\n\treturn undefined;\n}\n\nfunction computeDebugName(self: object, data: DebugNameData): string | undefined {\n\tconst cached = cachedDebugName.get(self);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tconst ownerStr = data.owner ? formatOwner(data.owner) + `.` : '';\n\n\tlet result: string | undefined;\n\tconst debugNameSource = data.debugNameSource;\n\tif (debugNameSource !== undefined) {\n\t\tif (typeof debugNameSource === 'function') {\n\t\t\tresult = debugNameSource();\n\t\t\tif (result !== undefined) {\n\t\t\t\treturn ownerStr + result;\n\t\t\t}\n\t\t} else {\n\t\t\treturn ownerStr + debugNameSource;\n\t\t}\n\t}\n\n\tconst referenceFn = data.referenceFn;\n\tif (referenceFn !== undefined) {\n\t\tresult = getFunctionName(referenceFn);\n\t\tif (result !== undefined) {\n\t\t\treturn ownerStr + result;\n\t\t}\n\t}\n\n\tif (data.owner !== undefined) {\n\t\tconst key = findKey(data.owner, self);\n\t\tif (key !== undefined) {\n\t\t\treturn ownerStr + key;\n\t\t}\n\t}\n\treturn undefined;\n}\n\nfunction findKey(obj: object, value: object): string | undefined {\n\tfor (const key in obj) {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tif ((obj as any)[key] === value) {\n\t\t\treturn key;\n\t\t}\n\t}\n\treturn undefined;\n}\n\nconst countPerClassName = new Map<string, number>();\nconst ownerId = new WeakMap<object, string>();\n\nfunction formatOwner(owner: object): string {\n\tconst id = ownerId.get(owner);\n\tif (id) {\n\t\treturn id;\n\t}\n\tconst className = getClassName(owner) ?? 'Object';\n\tlet count = countPerClassName.get(className) ?? 0;\n\tcount++;\n\tcountPerClassName.set(className, count);\n\tconst result = count === 1 ? className : `${className}#${count}`;\n\townerId.set(owner, result);\n\treturn result;\n}\n\nexport function getClassName(obj: object): string | undefined {\n\tconst ctor = obj.constructor;\n\tif (ctor) {\n\t\tif (ctor.name === 'Object') {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn ctor.name;\n\t}\n\treturn undefined;\n}\n\nexport function getFunctionName(fn: Function): string | undefined {\n\tconst fnSrc = fn.toString();\n\t// Pattern: /** @description ... */\n\tconst regexp = /\\/\\*\\*\\s*@description\\s*([^*]*)\\*\\//;\n\tconst match = regexp.exec(fnSrc);\n\tconst result = match ? match[1] : undefined;\n\treturn result?.trim();\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/observableInternal/debugName.ts","vs/base/common/observableInternal/debugName.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAsBhG,MAAM,OAAO,aAAa;IACzB,YACiB,KAA6B,EAC7B,eAA4C,EAC5C,WAAiC;QAFjC,UAAK,GAAL,KAAK,CAAwB;QAC7B,oBAAe,GAAf,eAAe,CAA6B;QAC5C,gBAAW,GAAX,WAAW,CAAsB;IAC9C,CAAC;IAEE,YAAY,CAAC,MAAc;QACjC,OAAO,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;CACD;AASD,MAAM,YAAY,GAAG,IAAI,GAAG,EAAkB,CAAC;AAC/C,MAAM,eAAe,GAAG,IAAI,OAAO,EAAkB,CAAC;AAEtD,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,IAAmB;I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C,SAAS,CAAC,IAAI,CAAC,CAAC;IAClD,KAAK,EAAE,CAAC;IACR,iBAAiB,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,KAAK,EAAE,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC3B,OAAO,MAAM,CAAC;AACf,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,GAAW;IACvC,MAAM,IAAI,GAAG,GAAG,CAAC,WAAW,CAAC;IAC7B,IAAI,IAAI,EAAE,CAAC;QACV,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC5B,OAAO,SAAS,CAAC;QAClB,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,EAAY;IAC3C,MAAM,KAAK,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;IAC5B,mCAAmC;IACnC,MAAM,MAAM,GAAG,qCAAqC,CAAC;IACrD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjC,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5C,OAAO,MAAM,EAAE,IAAI,EAAE,CAAC;AACvB,CAAC","file":"debugName.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 interface IDebugNameData {\n\t/**\n\t * The owner object of an observable.\n\t * Used for debugging only, such as computing a name for the observable by iterating over the fields of the owner.\n\t */\n\treadonly owner?: DebugOwner | undefined;\n\n\t/**\n\t * A string or function that returns a string that represents the name of the observable.\n\t * Used for debugging only.\n\t */\n\treadonly debugName?: DebugNameSource | undefined;\n\n\t/**\n\t * A function that points to the defining function of the object.\n\t * Used for debugging only.\n\t */\n\treadonly debugReferenceFn?: Function | undefined;\n}\n\nexport class DebugNameData {\n\tconstructor(\n\t\tpublic readonly owner: DebugOwner | undefined,\n\t\tpublic readonly debugNameSource: DebugNameSource | undefined,\n\t\tpublic readonly referenceFn: Function | undefined,\n\t) { }\n\n\tpublic getDebugName(target: object): string | undefined {\n\t\treturn getDebugName(target, this);\n\t}\n}\n\n/**\n * The owning object of an observable.\n * Is only used for debugging purposes, such as computing a name for the observable by iterating over the fields of the owner.\n */\nexport type DebugOwner = object | undefined;\nexport type DebugNameSource = string | (() => string | undefined);\n\nconst countPerName = new Map<string, number>();\nconst cachedDebugName = new WeakMap<object, string>();\n\nexport function getDebugName(target: object, data: DebugNameData): string | undefined {\n\tconst cached = cachedDebugName.get(target);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tconst dbgName = computeDebugName(target, data);\n\tif (dbgName) {\n\t\tlet count = countPerName.get(dbgName) ?? 0;\n\t\tcount++;\n\t\tcountPerName.set(dbgName, count);\n\t\tconst result = count === 1 ? dbgName : `${dbgName}#${count}`;\n\t\tcachedDebugName.set(target, result);\n\t\treturn result;\n\t}\n\treturn undefined;\n}\n\nfunction computeDebugName(self: object, data: DebugNameData): string | undefined {\n\tconst cached = cachedDebugName.get(self);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tconst ownerStr = data.owner ? formatOwner(data.owner) + `.` : '';\n\n\tlet result: string | undefined;\n\tconst debugNameSource = data.debugNameSource;\n\tif (debugNameSource !== undefined) {\n\t\tif (typeof debugNameSource === 'function') {\n\t\t\tresult = debugNameSource();\n\t\t\tif (result !== undefined) {\n\t\t\t\treturn ownerStr + result;\n\t\t\t}\n\t\t} else {\n\t\t\treturn ownerStr + debugNameSource;\n\t\t}\n\t}\n\n\tconst referenceFn = data.referenceFn;\n\tif (referenceFn !== undefined) {\n\t\tresult = getFunctionName(referenceFn);\n\t\tif (result !== undefined) {\n\t\t\treturn ownerStr + result;\n\t\t}\n\t}\n\n\tif (data.owner !== undefined) {\n\t\tconst key = findKey(data.owner, self);\n\t\tif (key !== undefined) {\n\t\t\treturn ownerStr + key;\n\t\t}\n\t}\n\treturn undefined;\n}\n\nfunction findKey(obj: object, value: object): string | undefined {\n\tfor (const key in obj) {\n\t\tif ((obj as Record<string, unknown>)[key] === value) {\n\t\t\treturn key;\n\t\t}\n\t}\n\treturn undefined;\n}\n\nconst countPerClassName = new Map<string, number>();\nconst ownerId = new WeakMap<object, string>();\n\nfunction formatOwner(owner: object): string {\n\tconst id = ownerId.get(owner);\n\tif (id) {\n\t\treturn id;\n\t}\n\tconst className = getClassName(owner) ?? 'Object';\n\tlet count = countPerClassName.get(className) ?? 0;\n\tcount++;\n\tcountPerClassName.set(className, count);\n\tconst result = count === 1 ? className : `${className}#${count}`;\n\townerId.set(owner, result);\n\treturn result;\n}\n\nexport function getClassName(obj: object): string | undefined {\n\tconst ctor = obj.constructor;\n\tif (ctor) {\n\t\tif (ctor.name === 'Object') {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn ctor.name;\n\t}\n\treturn undefined;\n}\n\nexport function getFunctionName(fn: Function): string | undefined {\n\tconst fnSrc = fn.toString();\n\t// Pattern: /** @description ... */\n\tconst regexp = /\\/\\*\\*\\s*@description\\s*([^*]*)\\*\\//;\n\tconst match = regexp.exec(fnSrc);\n\tconst result = match ? match[1] : undefined;\n\treturn result?.trim();\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 interface IDebugNameData {\n\t/**\n\t * The owner object of an observable.\n\t * Used for debugging only, such as computing a name for the observable by iterating over the fields of the owner.\n\t */\n\treadonly owner?: DebugOwner | undefined;\n\n\t/**\n\t * A string or function that returns a string that represents the name of the observable.\n\t * Used for debugging only.\n\t */\n\treadonly debugName?: DebugNameSource | undefined;\n\n\t/**\n\t * A function that points to the defining function of the object.\n\t * Used for debugging only.\n\t */\n\treadonly debugReferenceFn?: Function | undefined;\n}\n\nexport class DebugNameData {\n\tconstructor(\n\t\tpublic readonly owner: DebugOwner | undefined,\n\t\tpublic readonly debugNameSource: DebugNameSource | undefined,\n\t\tpublic readonly referenceFn: Function | undefined,\n\t) { }\n\n\tpublic getDebugName(target: object): string | undefined {\n\t\treturn getDebugName(target, this);\n\t}\n}\n\n/**\n * The owning object of an observable.\n * Is only used for debugging purposes, such as computing a name for the observable by iterating over the fields of the owner.\n */\nexport type DebugOwner = object | undefined;\nexport type DebugNameSource = string | (() => string | undefined);\n\nconst countPerName = new Map<string, number>();\nconst cachedDebugName = new WeakMap<object, string>();\n\nexport function getDebugName(target: object, data: DebugNameData): string | undefined {\n\tconst cached = cachedDebugName.get(target);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tconst dbgName = computeDebugName(target, data);\n\tif (dbgName) {\n\t\tlet count = countPerName.get(dbgName) ?? 0;\n\t\tcount++;\n\t\tcountPerName.set(dbgName, count);\n\t\tconst result = count === 1 ? dbgName : `${dbgName}#${count}`;\n\t\tcachedDebugName.set(target, result);\n\t\treturn result;\n\t}\n\treturn undefined;\n}\n\nfunction computeDebugName(self: object, data: DebugNameData): string | undefined {\n\tconst cached = cachedDebugName.get(self);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tconst ownerStr = data.owner ? formatOwner(data.owner) + `.` : '';\n\n\tlet result: string | undefined;\n\tconst debugNameSource = data.debugNameSource;\n\tif (debugNameSource !== undefined) {\n\t\tif (typeof debugNameSource === 'function') {\n\t\t\tresult = debugNameSource();\n\t\t\tif (result !== undefined) {\n\t\t\t\treturn ownerStr + result;\n\t\t\t}\n\t\t} else {\n\t\t\treturn ownerStr + debugNameSource;\n\t\t}\n\t}\n\n\tconst referenceFn = data.referenceFn;\n\tif (referenceFn !== undefined) {\n\t\tresult = getFunctionName(referenceFn);\n\t\tif (result !== undefined) {\n\t\t\treturn ownerStr + result;\n\t\t}\n\t}\n\n\tif (data.owner !== undefined) {\n\t\tconst key = findKey(data.owner, self);\n\t\tif (key !== undefined) {\n\t\t\treturn ownerStr + key;\n\t\t}\n\t}\n\treturn undefined;\n}\n\nfunction findKey(obj: object, value: object): string | undefined {\n\tfor (const key in obj) {\n\t\tif ((obj as Record<string, unknown>)[key] === value) {\n\t\t\treturn key;\n\t\t}\n\t}\n\treturn undefined;\n}\n\nconst countPerClassName = new Map<string, number>();\nconst ownerId = new WeakMap<object, string>();\n\nfunction formatOwner(owner: object): string {\n\tconst id = ownerId.get(owner);\n\tif (id) {\n\t\treturn id;\n\t}\n\tconst className = getClassName(owner) ?? 'Object';\n\tlet count = countPerClassName.get(className) ?? 0;\n\tcount++;\n\tcountPerClassName.set(className, count);\n\tconst result = count === 1 ? className : `${className}#${count}`;\n\townerId.set(owner, result);\n\treturn result;\n}\n\nexport function getClassName(obj: object): string | undefined {\n\tconst ctor = obj.constructor;\n\tif (ctor) {\n\t\tif (ctor.name === 'Object') {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn ctor.name;\n\t}\n\treturn undefined;\n}\n\nexport function getFunctionName(fn: Function): string | undefined {\n\tconst fnSrc = fn.toString();\n\t// Pattern: /** @description ... */\n\tconst regexp = /\\/\\*\\*\\s*@description\\s*([^*]*)\\*\\//;\n\tconst match = regexp.exec(fnSrc);\n\tconst result = match ? match[1] : undefined;\n\treturn result?.trim();\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, derivedObservableWithCache, derivedObservableWithWritableCache, keepObserved, mapObservableArrayCached, recomputeInitiallyAndOnChange } from './utils/utils.js';
|
|
12
|
+
export { debouncedObservable, debouncedObservable2, derivedObservableWithCache, derivedObservableWithWritableCache, keepObserved, mapObservableArrayCached, recomputeInitiallyAndOnChange } 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';
|
|
@@ -26,9 +26,9 @@ import { addLogger, setLogObservableFn } from './logging/logging.js';
|
|
|
26
26
|
import { ConsoleObservableLogger, logObservableToConsole } from './logging/consoleObservableLogger.js';
|
|
27
27
|
import { DevToolsLogger } from './logging/debugger/devToolsLogger.js';
|
|
28
28
|
import { env } from '../process.js';
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
|
|
29
|
+
import { _setDebugGetObservableGraph } from './observables/baseObservable.js';
|
|
30
|
+
import { debugGetObservableGraph } from './logging/debugGetDependencyGraph.js';
|
|
31
|
+
_setDebugGetObservableGraph(debugGetObservableGraph);
|
|
32
32
|
setLogObservableFn(logObservableToConsole);
|
|
33
33
|
// Remove "//" in the next line to enable logging
|
|
34
34
|
const enableLogging = false;
|
|
@@ -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,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,
|
|
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,EAC1E,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAA4C,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAChH,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAA0B,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;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","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"]}
|
|
@@ -7,16 +7,21 @@ import { FromEventObservable } from '../observables/observableFromEvent.js';
|
|
|
7
7
|
import { ObservableValue } from '../observables/observableValue.js';
|
|
8
8
|
import { AutorunObserver } from '../reactions/autorunImpl.js';
|
|
9
9
|
import { formatValue } from './consoleObservableLogger.js';
|
|
10
|
-
export function
|
|
10
|
+
export function debugGetObservableGraph(obs, options) {
|
|
11
11
|
const debugNamePostProcessor = options?.debugNamePostProcessor ?? ((str) => str);
|
|
12
12
|
const info = Info.from(obs, debugNamePostProcessor);
|
|
13
13
|
if (!info) {
|
|
14
14
|
return '';
|
|
15
15
|
}
|
|
16
16
|
const alreadyListed = new Set();
|
|
17
|
-
|
|
17
|
+
if (options.type === 'observers') {
|
|
18
|
+
return formatObservableInfoWithObservers(info, 0, alreadyListed, options).trim();
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
return formatObservableInfoWithDependencies(info, 0, alreadyListed, options).trim();
|
|
22
|
+
}
|
|
18
23
|
}
|
|
19
|
-
function
|
|
24
|
+
function formatObservableInfoWithDependencies(info, indentLevel, alreadyListed, options) {
|
|
20
25
|
const indent = '\t\t'.repeat(indentLevel);
|
|
21
26
|
const lines = [];
|
|
22
27
|
const isAlreadyListed = alreadyListed.has(info.sourceObj);
|
|
@@ -31,7 +36,29 @@ function formatObservableInfo(info, indentLevel, alreadyListed) {
|
|
|
31
36
|
if (info.dependencies.length > 0) {
|
|
32
37
|
lines.push(`${indent} dependencies:`);
|
|
33
38
|
for (const dep of info.dependencies) {
|
|
34
|
-
|
|
39
|
+
const info = Info.from(dep, options.debugNamePostProcessor ?? (name => name)) ?? Info.unknown(dep);
|
|
40
|
+
lines.push(formatObservableInfoWithDependencies(info, indentLevel + 1, alreadyListed, options));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return lines.join('\n');
|
|
44
|
+
}
|
|
45
|
+
function formatObservableInfoWithObservers(info, indentLevel, alreadyListed, options) {
|
|
46
|
+
const indent = '\t\t'.repeat(indentLevel);
|
|
47
|
+
const lines = [];
|
|
48
|
+
const isAlreadyListed = alreadyListed.has(info.sourceObj);
|
|
49
|
+
if (isAlreadyListed) {
|
|
50
|
+
lines.push(`${indent}* ${info.type} ${info.name} (already listed)`);
|
|
51
|
+
return lines.join('\n');
|
|
52
|
+
}
|
|
53
|
+
alreadyListed.add(info.sourceObj);
|
|
54
|
+
lines.push(`${indent}* ${info.type} ${info.name}:`);
|
|
55
|
+
lines.push(`${indent} value: ${formatValue(info.value, 50)}`);
|
|
56
|
+
lines.push(`${indent} state: ${info.state}`);
|
|
57
|
+
if (info.observers.length > 0) {
|
|
58
|
+
lines.push(`${indent} observers:`);
|
|
59
|
+
for (const observer of info.observers) {
|
|
60
|
+
const info = Info.from(observer, options.debugNamePostProcessor ?? (name => name)) ?? Info.unknown(observer);
|
|
61
|
+
lines.push(formatObservableInfoWithObservers(info, indentLevel + 1, alreadyListed, options));
|
|
35
62
|
}
|
|
36
63
|
}
|
|
37
64
|
return lines.join('\n');
|
|
@@ -40,32 +67,33 @@ class Info {
|
|
|
40
67
|
static from(obs, debugNamePostProcessor) {
|
|
41
68
|
if (obs instanceof AutorunObserver) {
|
|
42
69
|
const state = obs.debugGetState();
|
|
43
|
-
return new Info(obs, debugNamePostProcessor(obs.debugName), 'autorun', undefined, state.stateStr, Array.from(state.dependencies)
|
|
70
|
+
return new Info(obs, debugNamePostProcessor(obs.debugName), 'autorun', undefined, state.stateStr, Array.from(state.dependencies), []);
|
|
44
71
|
}
|
|
45
72
|
else if (obs instanceof Derived) {
|
|
46
73
|
const state = obs.debugGetState();
|
|
47
|
-
return new Info(obs, debugNamePostProcessor(obs.debugName), 'derived', state.value, state.stateStr, Array.from(state.dependencies)
|
|
74
|
+
return new Info(obs, debugNamePostProcessor(obs.debugName), 'derived', state.value, state.stateStr, Array.from(state.dependencies), Array.from(obs.debugGetObservers()));
|
|
48
75
|
}
|
|
49
76
|
else if (obs instanceof ObservableValue) {
|
|
50
77
|
const state = obs.debugGetState();
|
|
51
|
-
return new Info(obs, debugNamePostProcessor(obs.debugName), 'observableValue', state.value, 'upToDate', []);
|
|
78
|
+
return new Info(obs, debugNamePostProcessor(obs.debugName), 'observableValue', state.value, 'upToDate', [], Array.from(obs.debugGetObservers()));
|
|
52
79
|
}
|
|
53
80
|
else if (obs instanceof FromEventObservable) {
|
|
54
81
|
const state = obs.debugGetState();
|
|
55
|
-
return new Info(obs, debugNamePostProcessor(obs.debugName), 'fromEvent', state.value, state.hasValue ? 'upToDate' : 'initial', []);
|
|
82
|
+
return new Info(obs, debugNamePostProcessor(obs.debugName), 'fromEvent', state.value, state.hasValue ? 'upToDate' : 'initial', [], Array.from(obs.debugGetObservers()));
|
|
56
83
|
}
|
|
57
84
|
return undefined;
|
|
58
85
|
}
|
|
59
86
|
static unknown(obs) {
|
|
60
|
-
return new Info(obs, '(unknown)', 'unknown', undefined, 'unknown', []);
|
|
87
|
+
return new Info(obs, '(unknown)', 'unknown', undefined, 'unknown', [], []);
|
|
61
88
|
}
|
|
62
|
-
constructor(sourceObj, name, type, value, state, dependencies) {
|
|
89
|
+
constructor(sourceObj, name, type, value, state, dependencies, observers) {
|
|
63
90
|
this.sourceObj = sourceObj;
|
|
64
91
|
this.name = name;
|
|
65
92
|
this.type = type;
|
|
66
93
|
this.value = value;
|
|
67
94
|
this.state = state;
|
|
68
95
|
this.dependencies = dependencies;
|
|
96
|
+
this.observers = observers;
|
|
69
97
|
}
|
|
70
98
|
}
|
|
71
99
|
//# sourceMappingURL=debugGetDependencyGraph.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/observableInternal/logging/debugGetDependencyGraph.ts","vs/base/common/observableInternal/logging/debugGetDependencyGraph.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,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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 { IObservable, IObserver } from '../base.js';\nimport { Derived } from '../observables/derivedImpl.js';\nimport { FromEventObservable } from '../observables/observableFromEvent.js';\nimport { ObservableValue } from '../observables/observableValue.js';\nimport { AutorunObserver } from '../reactions/autorunImpl.js';\nimport { formatValue } from './consoleObservableLogger.js';\n\nexport function debugGetDependencyGraph(obs: IObservable<any> | IObserver, options?: { debugNamePostProcessor?: (name: string) => string }): string {\n\tconst debugNamePostProcessor = options?.debugNamePostProcessor ?? ((str: string) => str);\n\tconst info = Info.from(obs, debugNamePostProcessor);\n\tif (!info) {\n\t\treturn '';\n\t}\n\n\tconst alreadyListed = new Set<IObservable<any> | IObserver>();\n\treturn formatObservableInfo(info, 0, alreadyListed).trim();\n}\n\nfunction formatObservableInfo(info: Info, indentLevel: number, alreadyListed: Set<IObservable<any> | IObserver>): string {\n\tconst indent = '\\t\\t'.repeat(indentLevel);\n\tconst lines: string[] = [];\n\n\tconst isAlreadyListed = alreadyListed.has(info.sourceObj);\n\tif (isAlreadyListed) {\n\t\tlines.push(`${indent}* ${info.type} ${info.name} (already listed)`);\n\t\treturn lines.join('\\n');\n\t}\n\n\talreadyListed.add(info.sourceObj);\n\n\tlines.push(`${indent}* ${info.type} ${info.name}:`);\n\tlines.push(`${indent} value: ${formatValue(info.value, 50)}`);\n\tlines.push(`${indent} state: ${info.state}`);\n\n\tif (info.dependencies.length > 0) {\n\t\tlines.push(`${indent} dependencies:`);\n\t\tfor (const dep of info.dependencies) {\n\t\t\tlines.push(formatObservableInfo(dep, indentLevel + 1, alreadyListed));\n\t\t}\n\t}\n\n\treturn lines.join('\\n');\n}\n\nclass Info {\n\tpublic static from(obs: IObservable<any> | IObserver, debugNamePostProcessor: (name: string) => string): Info | undefined {\n\t\tif (obs instanceof AutorunObserver) {\n\t\t\tconst state = obs.debugGetState();\n\t\t\treturn new Info(\n\t\t\t\tobs,\n\t\t\t\tdebugNamePostProcessor(obs.debugName),\n\t\t\t\t'autorun',\n\t\t\t\tundefined,\n\t\t\t\tstate.stateStr,\n\t\t\t\tArray.from(state.dependencies).map(dep => Info.from(dep, debugNamePostProcessor) || Info.unknown(dep))\n\t\t\t);\n\t\t} else if (obs instanceof Derived) {\n\t\t\tconst state = obs.debugGetState();\n\t\t\treturn new Info(\n\t\t\t\tobs,\n\t\t\t\tdebugNamePostProcessor(obs.debugName),\n\t\t\t\t'derived',\n\t\t\t\tstate.value,\n\t\t\t\tstate.stateStr,\n\t\t\t\tArray.from(state.dependencies).map(dep => Info.from(dep, debugNamePostProcessor) || Info.unknown(dep))\n\t\t\t);\n\t\t} else if (obs instanceof ObservableValue) {\n\t\t\tconst state = obs.debugGetState();\n\t\t\treturn new Info(\n\t\t\t\tobs,\n\t\t\t\tdebugNamePostProcessor(obs.debugName),\n\t\t\t\t'observableValue',\n\t\t\t\tstate.value,\n\t\t\t\t'upToDate',\n\t\t\t\t[]\n\t\t\t);\n\t\t} else if (obs instanceof FromEventObservable) {\n\t\t\tconst state = obs.debugGetState();\n\t\t\treturn new Info(\n\t\t\t\tobs,\n\t\t\t\tdebugNamePostProcessor(obs.debugName),\n\t\t\t\t'fromEvent',\n\t\t\t\tstate.value,\n\t\t\t\tstate.hasValue ? 'upToDate' : 'initial',\n\t\t\t\t[]\n\t\t\t);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tpublic static unknown(obs: IObservable<any> | IObserver): Info {\n\t\treturn new Info(\n\t\t\tobs,\n\t\t\t'(unknown)',\n\t\t\t'unknown',\n\t\t\tundefined,\n\t\t\t'unknown',\n\t\t\t[]\n\t\t);\n\t}\n\n\tconstructor(\n\t\tpublic readonly sourceObj: IObservable<any> | IObserver,\n\t\tpublic readonly name: string,\n\t\tpublic readonly type: string,\n\t\tpublic readonly value: any,\n\t\tpublic readonly state: string,\n\t\tpublic readonly dependencies: Info[]\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, IObserver } from '../base.js';\nimport { Derived } from '../observables/derivedImpl.js';\nimport { FromEventObservable } from '../observables/observableFromEvent.js';\nimport { ObservableValue } from '../observables/observableValue.js';\nimport { AutorunObserver } from '../reactions/autorunImpl.js';\nimport { formatValue } from './consoleObservableLogger.js';\n\nexport function debugGetDependencyGraph(obs: IObservable<any> | IObserver, options?: { debugNamePostProcessor?: (name: string) => string }): string {\n\tconst debugNamePostProcessor = options?.debugNamePostProcessor ?? ((str: string) => str);\n\tconst info = Info.from(obs, debugNamePostProcessor);\n\tif (!info) {\n\t\treturn '';\n\t}\n\n\tconst alreadyListed = new Set<IObservable<any> | IObserver>();\n\treturn formatObservableInfo(info, 0, alreadyListed).trim();\n}\n\nfunction formatObservableInfo(info: Info, indentLevel: number, alreadyListed: Set<IObservable<any> | IObserver>): string {\n\tconst indent = '\\t\\t'.repeat(indentLevel);\n\tconst lines: string[] = [];\n\n\tconst isAlreadyListed = alreadyListed.has(info.sourceObj);\n\tif (isAlreadyListed) {\n\t\tlines.push(`${indent}* ${info.type} ${info.name} (already listed)`);\n\t\treturn lines.join('\\n');\n\t}\n\n\talreadyListed.add(info.sourceObj);\n\n\tlines.push(`${indent}* ${info.type} ${info.name}:`);\n\tlines.push(`${indent} value: ${formatValue(info.value, 50)}`);\n\tlines.push(`${indent} state: ${info.state}`);\n\n\tif (info.dependencies.length > 0) {\n\t\tlines.push(`${indent} dependencies:`);\n\t\tfor (const dep of info.dependencies) {\n\t\t\tlines.push(formatObservableInfo(dep, indentLevel + 1, alreadyListed));\n\t\t}\n\t}\n\n\treturn lines.join('\\n');\n}\n\nclass Info {\n\tpublic static from(obs: IObservable<any> | IObserver, debugNamePostProcessor: (name: string) => string): Info | undefined {\n\t\tif (obs instanceof AutorunObserver) {\n\t\t\tconst state = obs.debugGetState();\n\t\t\treturn new Info(\n\t\t\t\tobs,\n\t\t\t\tdebugNamePostProcessor(obs.debugName),\n\t\t\t\t'autorun',\n\t\t\t\tundefined,\n\t\t\t\tstate.stateStr,\n\t\t\t\tArray.from(state.dependencies).map(dep => Info.from(dep, debugNamePostProcessor) || Info.unknown(dep))\n\t\t\t);\n\t\t} else if (obs instanceof Derived) {\n\t\t\tconst state = obs.debugGetState();\n\t\t\treturn new Info(\n\t\t\t\tobs,\n\t\t\t\tdebugNamePostProcessor(obs.debugName),\n\t\t\t\t'derived',\n\t\t\t\tstate.value,\n\t\t\t\tstate.stateStr,\n\t\t\t\tArray.from(state.dependencies).map(dep => Info.from(dep, debugNamePostProcessor) || Info.unknown(dep))\n\t\t\t);\n\t\t} else if (obs instanceof ObservableValue) {\n\t\t\tconst state = obs.debugGetState();\n\t\t\treturn new Info(\n\t\t\t\tobs,\n\t\t\t\tdebugNamePostProcessor(obs.debugName),\n\t\t\t\t'observableValue',\n\t\t\t\tstate.value,\n\t\t\t\t'upToDate',\n\t\t\t\t[]\n\t\t\t);\n\t\t} else if (obs instanceof FromEventObservable) {\n\t\t\tconst state = obs.debugGetState();\n\t\t\treturn new Info(\n\t\t\t\tobs,\n\t\t\t\tdebugNamePostProcessor(obs.debugName),\n\t\t\t\t'fromEvent',\n\t\t\t\tstate.value,\n\t\t\t\tstate.hasValue ? 'upToDate' : 'initial',\n\t\t\t\t[]\n\t\t\t);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tpublic static unknown(obs: IObservable<any> | IObserver): Info {\n\t\treturn new Info(\n\t\t\tobs,\n\t\t\t'(unknown)',\n\t\t\t'unknown',\n\t\t\tundefined,\n\t\t\t'unknown',\n\t\t\t[]\n\t\t);\n\t}\n\n\tconstructor(\n\t\tpublic readonly sourceObj: IObservable<any> | IObserver,\n\t\tpublic readonly name: string,\n\t\tpublic readonly type: string,\n\t\tpublic readonly value: any,\n\t\tpublic readonly state: string,\n\t\tpublic readonly dependencies: Info[]\n\t) { }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/observableInternal/logging/debugGetDependencyGraph.ts","vs/base/common/observableInternal/logging/debugGetDependencyGraph.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAO3D,MAAM,UAAU,uBAAuB,CAAC,GAAiC,EAAE,OAAiB;IAC3F,MAAM,sBAAsB,GAAG,OAAO,EAAE,sBAAsB,IAAI,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;IACzF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,sBAAsB,CAAC,CAAC;IACpD,IAAI,CAAC,IAAI,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;IACX,CAAC;IAED,MAAM,aAAa,GAAG,IAAI,GAAG,EAAgC,CAAC;IAE9D,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,iCAAiC,CAAC,IAAI,EAAE,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;IAClF,CAAC;SAAM,CAAC;QACP,OAAO,oCAAoC,CAAC,IAAI,EAAE,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;IACrF,CAAC;AACF,CAAC;AAED,SAAS,oCAAoC,CAAC,IAAU,EAAE,WAAmB,EAAE,aAAgD,EAA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B,EACjB,KAAK,CAAC,KAAK,EACX,UAAU,EACV,EAAE,EACF,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC,CACnC,CAAC;QACH,CAAC;aAAM,IAAI,GAAG,YAAY,mBAAmB,EAAE,CAAC;YAC/C,MAAM,KAAK,GAAG,GAAG,CAAC,aAAa,EAAE,CAAC;YAClC,OAAO,IAAI,IAAI,CACd,GAAG,EACH,sBAAsB,CAAC,GAAG,CAAC,SAAS,CAAC,EACrC,WAAW,EACX,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EACvC,EAAE,EACF,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC,CACnC,CAAC;QACH,CAAC;QACD,OAAO,SAAS,CAAC;IAClB,CAAC;IAEM,MAAM,CAAC,OAAO,CAAC,GAAiC;QACtD,OAAO,IAAI,IAAI,CACd,GAAG,EACH,WAAW,EACX,SAAS,EACT,SAAS,EACT,SAAS,EACT,EAAE,EACF,EAAE,CACF,CAAC;IACH,CAAC;IAED,YACiB,SAAuC,EACvC,IAAY,EACZ,IAAY,EACZ,KAAU,EACV,KAAa,EACb,YAA8C,EAC9C,SAA2C;QAN3C,cAAS,GAAT,SAAS,CAA8B;QACvC,SAAI,GAAJ,IAAI,CAAQ;QACZ,SAAI,GAAJ,IAAI,CAAQ;QACZ,UAAK,GAAL,KAAK,CAAK;QACV,UAAK,GAAL,KAAK,CAAQ;QACb,iBAAY,GAAZ,YAAY,CAAkC;QAC9C,cAAS,GAAT,SAAS,CAAkC;IACxD,CAAC;CACL","file":"debugGetDependencyGraph.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, IObserver } from '../base.js';\nimport { Derived } from '../observables/derivedImpl.js';\nimport { FromEventObservable } from '../observables/observableFromEvent.js';\nimport { ObservableValue } from '../observables/observableValue.js';\nimport { AutorunObserver } from '../reactions/autorunImpl.js';\nimport { formatValue } from './consoleObservableLogger.js';\n\ninterface IOptions {\n\ttype: 'dependencies' | 'observers';\n\tdebugNamePostProcessor?: (name: string) => string;\n}\n\nexport function debugGetObservableGraph(obs: IObservable<any> | IObserver, options: IOptions): string {\n\tconst debugNamePostProcessor = options?.debugNamePostProcessor ?? ((str: string) => str);\n\tconst info = Info.from(obs, debugNamePostProcessor);\n\tif (!info) {\n\t\treturn '';\n\t}\n\n\tconst alreadyListed = new Set<IObservable<any> | IObserver>();\n\n\tif (options.type === 'observers') {\n\t\treturn formatObservableInfoWithObservers(info, 0, alreadyListed, options).trim();\n\t} else {\n\t\treturn formatObservableInfoWithDependencies(info, 0, alreadyListed, options).trim();\n\t}\n}\n\nfunction formatObservableInfoWithDependencies(info: Info, indentLevel: number, alreadyListed: Set<IObservable<any> | IObserver>, options: IOptions): string {\n\tconst indent = '\\t\\t'.repeat(indentLevel);\n\tconst lines: string[] = [];\n\n\tconst isAlreadyListed = alreadyListed.has(info.sourceObj);\n\tif (isAlreadyListed) {\n\t\tlines.push(`${indent}* ${info.type} ${info.name} (already listed)`);\n\t\treturn lines.join('\\n');\n\t}\n\n\talreadyListed.add(info.sourceObj);\n\n\tlines.push(`${indent}* ${info.type} ${info.name}:`);\n\tlines.push(`${indent} value: ${formatValue(info.value, 50)}`);\n\tlines.push(`${indent} state: ${info.state}`);\n\n\tif (info.dependencies.length > 0) {\n\t\tlines.push(`${indent} dependencies:`);\n\t\tfor (const dep of info.dependencies) {\n\t\t\tconst info = Info.from(dep, options.debugNamePostProcessor ?? (name => name)) ?? Info.unknown(dep);\n\t\t\tlines.push(formatObservableInfoWithDependencies(info, indentLevel + 1, alreadyListed, options));\n\t\t}\n\t}\n\n\treturn lines.join('\\n');\n}\n\nfunction formatObservableInfoWithObservers(info: Info, indentLevel: number, alreadyListed: Set<IObservable<any> | IObserver>, options: IOptions): string {\n\tconst indent = '\\t\\t'.repeat(indentLevel);\n\tconst lines: string[] = [];\n\n\tconst isAlreadyListed = alreadyListed.has(info.sourceObj);\n\tif (isAlreadyListed) {\n\t\tlines.push(`${indent}* ${info.type} ${info.name} (already listed)`);\n\t\treturn lines.join('\\n');\n\t}\n\n\talreadyListed.add(info.sourceObj);\n\n\tlines.push(`${indent}* ${info.type} ${info.name}:`);\n\tlines.push(`${indent} value: ${formatValue(info.value, 50)}`);\n\tlines.push(`${indent} state: ${info.state}`);\n\n\tif (info.observers.length > 0) {\n\t\tlines.push(`${indent} observers:`);\n\t\tfor (const observer of info.observers) {\n\t\t\tconst info = Info.from(observer, options.debugNamePostProcessor ?? (name => name)) ?? Info.unknown(observer);\n\t\t\tlines.push(formatObservableInfoWithObservers(info, indentLevel + 1, alreadyListed, options));\n\t\t}\n\t}\n\n\treturn lines.join('\\n');\n}\n\nclass Info {\n\tpublic static from(obs: IObservable<any> | IObserver, debugNamePostProcessor: (name: string) => string): Info | undefined {\n\t\tif (obs instanceof AutorunObserver) {\n\t\t\tconst state = obs.debugGetState();\n\t\t\treturn new Info(\n\t\t\t\tobs,\n\t\t\t\tdebugNamePostProcessor(obs.debugName),\n\t\t\t\t'autorun',\n\t\t\t\tundefined,\n\t\t\t\tstate.stateStr,\n\t\t\t\tArray.from(state.dependencies),\n\t\t\t\t[]\n\t\t\t);\n\t\t} else if (obs instanceof Derived) {\n\t\t\tconst state = obs.debugGetState();\n\t\t\treturn new Info(\n\t\t\t\tobs,\n\t\t\t\tdebugNamePostProcessor(obs.debugName),\n\t\t\t\t'derived',\n\t\t\t\tstate.value,\n\t\t\t\tstate.stateStr,\n\t\t\t\tArray.from(state.dependencies),\n\t\t\t\tArray.from(obs.debugGetObservers())\n\t\t\t);\n\t\t} else if (obs instanceof ObservableValue) {\n\t\t\tconst state = obs.debugGetState();\n\t\t\treturn new Info(\n\t\t\t\tobs,\n\t\t\t\tdebugNamePostProcessor(obs.debugName),\n\t\t\t\t'observableValue',\n\t\t\t\tstate.value,\n\t\t\t\t'upToDate',\n\t\t\t\t[],\n\t\t\t\tArray.from(obs.debugGetObservers())\n\t\t\t);\n\t\t} else if (obs instanceof FromEventObservable) {\n\t\t\tconst state = obs.debugGetState();\n\t\t\treturn new Info(\n\t\t\t\tobs,\n\t\t\t\tdebugNamePostProcessor(obs.debugName),\n\t\t\t\t'fromEvent',\n\t\t\t\tstate.value,\n\t\t\t\tstate.hasValue ? 'upToDate' : 'initial',\n\t\t\t\t[],\n\t\t\t\tArray.from(obs.debugGetObservers())\n\t\t\t);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tpublic static unknown(obs: IObservable<any> | IObserver): Info {\n\t\treturn new Info(\n\t\t\tobs,\n\t\t\t'(unknown)',\n\t\t\t'unknown',\n\t\t\tundefined,\n\t\t\t'unknown',\n\t\t\t[],\n\t\t\t[]\n\t\t);\n\t}\n\n\tconstructor(\n\t\tpublic readonly sourceObj: IObservable<any> | IObserver,\n\t\tpublic readonly name: string,\n\t\tpublic readonly type: string,\n\t\tpublic readonly value: any,\n\t\tpublic readonly state: string,\n\t\tpublic readonly dependencies: (IObservable<any> | IObserver)[],\n\t\tpublic readonly observers: (IObservable<any> | IObserver)[],\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, IObserver } from '../base.js';\nimport { Derived } from '../observables/derivedImpl.js';\nimport { FromEventObservable } from '../observables/observableFromEvent.js';\nimport { ObservableValue } from '../observables/observableValue.js';\nimport { AutorunObserver } from '../reactions/autorunImpl.js';\nimport { formatValue } from './consoleObservableLogger.js';\n\ninterface IOptions {\n\ttype: 'dependencies' | 'observers';\n\tdebugNamePostProcessor?: (name: string) => string;\n}\n\nexport function debugGetObservableGraph(obs: IObservable<any> | IObserver, options: IOptions): string {\n\tconst debugNamePostProcessor = options?.debugNamePostProcessor ?? ((str: string) => str);\n\tconst info = Info.from(obs, debugNamePostProcessor);\n\tif (!info) {\n\t\treturn '';\n\t}\n\n\tconst alreadyListed = new Set<IObservable<any> | IObserver>();\n\n\tif (options.type === 'observers') {\n\t\treturn formatObservableInfoWithObservers(info, 0, alreadyListed, options).trim();\n\t} else {\n\t\treturn formatObservableInfoWithDependencies(info, 0, alreadyListed, options).trim();\n\t}\n}\n\nfunction formatObservableInfoWithDependencies(info: Info, indentLevel: number, alreadyListed: Set<IObservable<any> | IObserver>, options: IOptions): string {\n\tconst indent = '\\t\\t'.repeat(indentLevel);\n\tconst lines: string[] = [];\n\n\tconst isAlreadyListed = alreadyListed.has(info.sourceObj);\n\tif (isAlreadyListed) {\n\t\tlines.push(`${indent}* ${info.type} ${info.name} (already listed)`);\n\t\treturn lines.join('\\n');\n\t}\n\n\talreadyListed.add(info.sourceObj);\n\n\tlines.push(`${indent}* ${info.type} ${info.name}:`);\n\tlines.push(`${indent} value: ${formatValue(info.value, 50)}`);\n\tlines.push(`${indent} state: ${info.state}`);\n\n\tif (info.dependencies.length > 0) {\n\t\tlines.push(`${indent} dependencies:`);\n\t\tfor (const dep of info.dependencies) {\n\t\t\tconst info = Info.from(dep, options.debugNamePostProcessor ?? (name => name)) ?? Info.unknown(dep);\n\t\t\tlines.push(formatObservableInfoWithDependencies(info, indentLevel + 1, alreadyListed, options));\n\t\t}\n\t}\n\n\treturn lines.join('\\n');\n}\n\nfunction formatObservableInfoWithObservers(info: Info, indentLevel: number, alreadyListed: Set<IObservable<any> | IObserver>, options: IOptions): string {\n\tconst indent = '\\t\\t'.repeat(indentLevel);\n\tconst lines: string[] = [];\n\n\tconst isAlreadyListed = alreadyListed.has(info.sourceObj);\n\tif (isAlreadyListed) {\n\t\tlines.push(`${indent}* ${info.type} ${info.name} (already listed)`);\n\t\treturn lines.join('\\n');\n\t}\n\n\talreadyListed.add(info.sourceObj);\n\n\tlines.push(`${indent}* ${info.type} ${info.name}:`);\n\tlines.push(`${indent} value: ${formatValue(info.value, 50)}`);\n\tlines.push(`${indent} state: ${info.state}`);\n\n\tif (info.observers.length > 0) {\n\t\tlines.push(`${indent} observers:`);\n\t\tfor (const observer of info.observers) {\n\t\t\tconst info = Info.from(observer, options.debugNamePostProcessor ?? (name => name)) ?? Info.unknown(observer);\n\t\t\tlines.push(formatObservableInfoWithObservers(info, indentLevel + 1, alreadyListed, options));\n\t\t}\n\t}\n\n\treturn lines.join('\\n');\n}\n\nclass Info {\n\tpublic static from(obs: IObservable<any> | IObserver, debugNamePostProcessor: (name: string) => string): Info | undefined {\n\t\tif (obs instanceof AutorunObserver) {\n\t\t\tconst state = obs.debugGetState();\n\t\t\treturn new Info(\n\t\t\t\tobs,\n\t\t\t\tdebugNamePostProcessor(obs.debugName),\n\t\t\t\t'autorun',\n\t\t\t\tundefined,\n\t\t\t\tstate.stateStr,\n\t\t\t\tArray.from(state.dependencies),\n\t\t\t\t[]\n\t\t\t);\n\t\t} else if (obs instanceof Derived) {\n\t\t\tconst state = obs.debugGetState();\n\t\t\treturn new Info(\n\t\t\t\tobs,\n\t\t\t\tdebugNamePostProcessor(obs.debugName),\n\t\t\t\t'derived',\n\t\t\t\tstate.value,\n\t\t\t\tstate.stateStr,\n\t\t\t\tArray.from(state.dependencies),\n\t\t\t\tArray.from(obs.debugGetObservers())\n\t\t\t);\n\t\t} else if (obs instanceof ObservableValue) {\n\t\t\tconst state = obs.debugGetState();\n\t\t\treturn new Info(\n\t\t\t\tobs,\n\t\t\t\tdebugNamePostProcessor(obs.debugName),\n\t\t\t\t'observableValue',\n\t\t\t\tstate.value,\n\t\t\t\t'upToDate',\n\t\t\t\t[],\n\t\t\t\tArray.from(obs.debugGetObservers())\n\t\t\t);\n\t\t} else if (obs instanceof FromEventObservable) {\n\t\t\tconst state = obs.debugGetState();\n\t\t\treturn new Info(\n\t\t\t\tobs,\n\t\t\t\tdebugNamePostProcessor(obs.debugName),\n\t\t\t\t'fromEvent',\n\t\t\t\tstate.value,\n\t\t\t\tstate.hasValue ? 'upToDate' : 'initial',\n\t\t\t\t[],\n\t\t\t\tArray.from(obs.debugGetObservers())\n\t\t\t);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tpublic static unknown(obs: IObservable<any> | IObserver): Info {\n\t\treturn new Info(\n\t\t\tobs,\n\t\t\t'(unknown)',\n\t\t\t'unknown',\n\t\t\tundefined,\n\t\t\t'unknown',\n\t\t\t[],\n\t\t\t[]\n\t\t);\n\t}\n\n\tconstructor(\n\t\tpublic readonly sourceObj: IObservable<any> | IObserver,\n\t\tpublic readonly name: string,\n\t\tpublic readonly type: string,\n\t\tpublic readonly value: any,\n\t\tpublic readonly state: string,\n\t\tpublic readonly dependencies: (IObservable<any> | IObserver)[],\n\t\tpublic readonly observers: (IObservable<any> | IObserver)[],\n\t) { }\n}\n"]}
|
|
@@ -21,9 +21,9 @@ let _keepObserved;
|
|
|
21
21
|
export function _setKeepObserved(keepObserved) {
|
|
22
22
|
_keepObserved = keepObserved;
|
|
23
23
|
}
|
|
24
|
-
let
|
|
25
|
-
export function
|
|
26
|
-
|
|
24
|
+
let _debugGetObservableGraph;
|
|
25
|
+
export function _setDebugGetObservableGraph(debugGetObservableGraph) {
|
|
26
|
+
_debugGetObservableGraph = debugGetObservableGraph;
|
|
27
27
|
}
|
|
28
28
|
export class ConvenientObservable {
|
|
29
29
|
get TChange() { return null; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/observableInternal/observables/baseObservable.ts","vs/base/common/observableInternal/observables/baseObservable.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAIhG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAc,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,EAAE,SAAS,E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AAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAC3D,CAAC;IAEM,WAAW,CAAC,QAAmB;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QACjC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC9B,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC;YACf,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC7B,CAAC;QACD,IAAI,GAAG,KAAK,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;YAClC,SAAS,EAAE,EAAE,4BAA4B,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACvE,CAAC;IACF,CAAC;IAEM,cAAc,CAAC,QAAmB;QACxC,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACjD,IAAI,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC9B,CAAC;QACD,IAAI,OAAO,EAAE,CAAC;YACb,SAAS,EAAE,EAAE,4BAA4B,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACvE,CAAC;IACF,CAAC;IAES,oBAAoB,KAAW,CAAC;IAChC,qBAAqB,KAAW,CAAC;IAEpC,iBAAiB;QACvB,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;CACD","file":"baseObservable.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 { IObservableWithChange, IObserver, IReader, IObservable } from '../base.js';\nimport { DisposableStore } from '../commonFacade/deps.js';\nimport { DebugLocation } from '../debugLocation.js';\nimport { DebugOwner, getFunctionName } from '../debugName.js';\nimport { debugGetDependencyGraph } from '../logging/debugGetDependencyGraph.js';\nimport { getLogger } from '../logging/logging.js';\nimport { keepObserved, recomputeInitiallyAndOnChange } from '../utils/utils.js';\nimport { derivedOpts } from './derived.js';\n\nlet _derived: typeof derivedOpts;\n/**\n * @internal\n * This is to allow splitting files.\n*/\nexport function _setDerivedOpts(derived: typeof _derived) {\n\t_derived = derived;\n}\n\nlet _recomputeInitiallyAndOnChange: typeof recomputeInitiallyAndOnChange;\nexport function _setRecomputeInitiallyAndOnChange(recomputeInitiallyAndOnChange: typeof _recomputeInitiallyAndOnChange) {\n\t_recomputeInitiallyAndOnChange = recomputeInitiallyAndOnChange;\n}\n\nlet _keepObserved: typeof keepObserved;\nexport function _setKeepObserved(keepObserved: typeof _keepObserved) {\n\t_keepObserved = keepObserved;\n}\n\nlet _debugGetDependencyGraph: typeof debugGetDependencyGraph;\nexport function _setDebugGetDependencyGraph(debugGetDependencyGraph: typeof _debugGetDependencyGraph) {\n\t_debugGetDependencyGraph = debugGetDependencyGraph;\n}\n\nexport abstract class ConvenientObservable<T, TChange> implements IObservableWithChange<T, TChange> {\n\tget TChange(): TChange { return null!; }\n\n\tpublic abstract get(): T;\n\n\tpublic reportChanges(): void {\n\t\tthis.get();\n\t}\n\n\tpublic abstract addObserver(observer: IObserver): void;\n\tpublic abstract removeObserver(observer: IObserver): void;\n\n\t/** @sealed */\n\tpublic read(reader: IReader | undefined): T {\n\t\tif (reader) {\n\t\t\treturn reader.readObservable(this);\n\t\t} else {\n\t\t\treturn this.get();\n\t\t}\n\t}\n\n\t/** @sealed */\n\tpublic map<TNew>(fn: (value: T, reader: IReader) => TNew): IObservable<TNew>;\n\tpublic map<TNew>(owner: DebugOwner, fn: (value: T, reader: IReader) => TNew): IObservable<TNew>;\n\tpublic map<TNew>(fnOrOwner: DebugOwner | ((value: T, reader: IReader) => TNew), fnOrUndefined?: (value: T, reader: IReader) => TNew, debugLocation: DebugLocation = DebugLocation.ofCaller()): IObservable<TNew> {\n\t\tconst owner = fnOrUndefined === undefined ? undefined : fnOrOwner as DebugOwner;\n\t\tconst fn = fnOrUndefined === undefined ? fnOrOwner as (value: T, reader: IReader) => TNew : fnOrUndefined;\n\n\t\treturn _derived(\n\t\t\t{\n\t\t\t\towner,\n\t\t\t\tdebugName: () => {\n\t\t\t\t\tconst name = getFunctionName(fn);\n\t\t\t\t\tif (name !== undefined) {\n\t\t\t\t\t\treturn name;\n\t\t\t\t\t}\n\n\t\t\t\t\t// regexp to match `x => x.y` or `x => x?.y` where x and y can be arbitrary identifiers (uses backref):\n\t\t\t\t\tconst regexp = /^\\s*\\(?\\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\\s*\\)?\\s*=>\\s*\\1(?:\\??)\\.([a-zA-Z_$][a-zA-Z_$0-9]*)\\s*$/;\n\t\t\t\t\tconst match = regexp.exec(fn.toString());\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\treturn `${this.debugName}.${match[2]}`;\n\t\t\t\t\t}\n\t\t\t\t\tif (!owner) {\n\t\t\t\t\t\treturn `${this.debugName} (mapped)`;\n\t\t\t\t\t}\n\t\t\t\t\treturn undefined;\n\t\t\t\t},\n\t\t\t\tdebugReferenceFn: fn,\n\t\t\t},\n\t\t\t(reader) => fn(this.read(reader), reader),\n\t\t\tdebugLocation,\n\t\t);\n\t}\n\n\t/**\n\t * @sealed\n\t * Converts an observable of an observable value into a direct observable of the value.\n\t*/\n\tpublic flatten<TNew>(this: IObservable<IObservableWithChange<TNew, any>>): IObservable<TNew> {\n\t\treturn _derived(\n\t\t\t{\n\t\t\t\towner: undefined,\n\t\t\t\tdebugName: () => `${this.debugName} (flattened)`,\n\t\t\t},\n\t\t\t(reader) => this.read(reader).read(reader)\n\t\t);\n\t}\n\n\tpublic recomputeInitiallyAndOnChange(store: DisposableStore, handleValue?: (value: T) => void): IObservable<T> {\n\t\tstore.add(_recomputeInitiallyAndOnChange!(this, handleValue));\n\t\treturn this;\n\t}\n\n\tpublic abstract get debugName(): string;\n}\n\nexport abstract class BaseObservable<T, TChange = void> extends ConvenientObservable<T, TChange> {\n\tprotected readonly _observers = new Set<IObserver>();\n\n\tconstructor(debugLocation: DebugLocation) {\n\t\tsuper();\n\t\tgetLogger()?.handleObservableCreated(this, debugLocation);\n\t}\n\n\tpublic addObserver(observer: IObserver): void {\n\t\tconst len = this._observers.size;\n\t\tthis._observers.add(observer);\n\t\tif (len === 0) {\n\t\t\tthis.onFirstObserverAdded();\n\t\t}\n\t\tif (len !== this._observers.size) {\n\t\t\tgetLogger()?.handleOnListenerCountChanged(this, this._observers.size);\n\t\t}\n\t}\n\n\tpublic removeObserver(observer: IObserver): void {\n\t\tconst deleted = this._observers.delete(observer);\n\t\tif (deleted && this._observers.size === 0) {\n\t\t\tthis.onLastObserverRemoved();\n\t\t}\n\t\tif (deleted) {\n\t\t\tgetLogger()?.handleOnListenerCountChanged(this, this._observers.size);\n\t\t}\n\t}\n\n\tprotected onFirstObserverAdded(): void { }\n\tprotected onLastObserverRemoved(): void { }\n\n\tpublic debugGetObservers() {\n\t\treturn this._observers;\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 { IObservableWithChange, IObserver, IReader, IObservable } from '../base.js';\nimport { DisposableStore } from '../commonFacade/deps.js';\nimport { DebugLocation } from '../debugLocation.js';\nimport { DebugOwner, getFunctionName } from '../debugName.js';\nimport { debugGetDependencyGraph } from '../logging/debugGetDependencyGraph.js';\nimport { getLogger } from '../logging/logging.js';\nimport { keepObserved, recomputeInitiallyAndOnChange } from '../utils/utils.js';\nimport { derivedOpts } from './derived.js';\n\nlet _derived: typeof derivedOpts;\n/**\n * @internal\n * This is to allow splitting files.\n*/\nexport function _setDerivedOpts(derived: typeof _derived) {\n\t_derived = derived;\n}\n\nlet _recomputeInitiallyAndOnChange: typeof recomputeInitiallyAndOnChange;\nexport function _setRecomputeInitiallyAndOnChange(recomputeInitiallyAndOnChange: typeof _recomputeInitiallyAndOnChange) {\n\t_recomputeInitiallyAndOnChange = recomputeInitiallyAndOnChange;\n}\n\nlet _keepObserved: typeof keepObserved;\nexport function _setKeepObserved(keepObserved: typeof _keepObserved) {\n\t_keepObserved = keepObserved;\n}\n\nlet _debugGetDependencyGraph: typeof debugGetDependencyGraph;\nexport function _setDebugGetDependencyGraph(debugGetDependencyGraph: typeof _debugGetDependencyGraph) {\n\t_debugGetDependencyGraph = debugGetDependencyGraph;\n}\n\nexport abstract class ConvenientObservable<T, TChange> implements IObservableWithChange<T, TChange> {\n\tget TChange(): TChange { return null!; }\n\n\tpublic abstract get(): T;\n\n\tpublic reportChanges(): void {\n\t\tthis.get();\n\t}\n\n\tpublic abstract addObserver(observer: IObserver): void;\n\tpublic abstract removeObserver(observer: IObserver): void;\n\n\t/** @sealed */\n\tpublic read(reader: IReader | undefined): T {\n\t\tif (reader) {\n\t\t\treturn reader.readObservable(this);\n\t\t} else {\n\t\t\treturn this.get();\n\t\t}\n\t}\n\n\t/** @sealed */\n\tpublic map<TNew>(fn: (value: T, reader: IReader) => TNew): IObservable<TNew>;\n\tpublic map<TNew>(owner: DebugOwner, fn: (value: T, reader: IReader) => TNew): IObservable<TNew>;\n\tpublic map<TNew>(fnOrOwner: DebugOwner | ((value: T, reader: IReader) => TNew), fnOrUndefined?: (value: T, reader: IReader) => TNew, debugLocation: DebugLocation = DebugLocation.ofCaller()): IObservable<TNew> {\n\t\tconst owner = fnOrUndefined === undefined ? undefined : fnOrOwner as DebugOwner;\n\t\tconst fn = fnOrUndefined === undefined ? fnOrOwner as (value: T, reader: IReader) => TNew : fnOrUndefined;\n\n\t\treturn _derived(\n\t\t\t{\n\t\t\t\towner,\n\t\t\t\tdebugName: () => {\n\t\t\t\t\tconst name = getFunctionName(fn);\n\t\t\t\t\tif (name !== undefined) {\n\t\t\t\t\t\treturn name;\n\t\t\t\t\t}\n\n\t\t\t\t\t// regexp to match `x => x.y` or `x => x?.y` where x and y can be arbitrary identifiers (uses backref):\n\t\t\t\t\tconst regexp = /^\\s*\\(?\\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\\s*\\)?\\s*=>\\s*\\1(?:\\??)\\.([a-zA-Z_$][a-zA-Z_$0-9]*)\\s*$/;\n\t\t\t\t\tconst match = regexp.exec(fn.toString());\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\treturn `${this.debugName}.${match[2]}`;\n\t\t\t\t\t}\n\t\t\t\t\tif (!owner) {\n\t\t\t\t\t\treturn `${this.debugName} (mapped)`;\n\t\t\t\t\t}\n\t\t\t\t\treturn undefined;\n\t\t\t\t},\n\t\t\t\tdebugReferenceFn: fn,\n\t\t\t},\n\t\t\t(reader) => fn(this.read(reader), reader),\n\t\t\tdebugLocation,\n\t\t);\n\t}\n\n\t/**\n\t * @sealed\n\t * Converts an observable of an observable value into a direct observable of the value.\n\t*/\n\tpublic flatten<TNew>(this: IObservable<IObservableWithChange<TNew, any>>): IObservable<TNew> {\n\t\treturn _derived(\n\t\t\t{\n\t\t\t\towner: undefined,\n\t\t\t\tdebugName: () => `${this.debugName} (flattened)`,\n\t\t\t},\n\t\t\t(reader) => this.read(reader).read(reader)\n\t\t);\n\t}\n\n\tpublic recomputeInitiallyAndOnChange(store: DisposableStore, handleValue?: (value: T) => void): IObservable<T> {\n\t\tstore.add(_recomputeInitiallyAndOnChange!(this, handleValue));\n\t\treturn this;\n\t}\n\n\tpublic abstract get debugName(): string;\n}\n\nexport abstract class BaseObservable<T, TChange = void> extends ConvenientObservable<T, TChange> {\n\tprotected readonly _observers = new Set<IObserver>();\n\n\tconstructor(debugLocation: DebugLocation) {\n\t\tsuper();\n\t\tgetLogger()?.handleObservableCreated(this, debugLocation);\n\t}\n\n\tpublic addObserver(observer: IObserver): void {\n\t\tconst len = this._observers.size;\n\t\tthis._observers.add(observer);\n\t\tif (len === 0) {\n\t\t\tthis.onFirstObserverAdded();\n\t\t}\n\t\tif (len !== this._observers.size) {\n\t\t\tgetLogger()?.handleOnListenerCountChanged(this, this._observers.size);\n\t\t}\n\t}\n\n\tpublic removeObserver(observer: IObserver): void {\n\t\tconst deleted = this._observers.delete(observer);\n\t\tif (deleted && this._observers.size === 0) {\n\t\t\tthis.onLastObserverRemoved();\n\t\t}\n\t\tif (deleted) {\n\t\t\tgetLogger()?.handleOnListenerCountChanged(this, this._observers.size);\n\t\t}\n\t}\n\n\tprotected onFirstObserverAdded(): void { }\n\tprotected onLastObserverRemoved(): void { }\n\n\tpublic debugGetObservers() {\n\t\treturn this._observers;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/observableInternal/observables/baseObservable.ts","vs/base/common/observableInternal/observables/baseObservable.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAIhG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAc,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIlD,IAAI,QAA4B,CAAC;AACjC;;;EAGE;AACF,MAAM,UAAU,eAAe,CAAC,OAAwB;IACvD,QAAQ,GAAG,OAAO,CAAC;AACpB,CAAC;AAED,IAAI,8BAAoE,CAAC;AACzE,MAAM,UAAU,iCAAiC,CAAC,6BAAoE;IACrH,8BAA8B,GAAG,6BAA6B,CAAC;AAChE,CAAC;AAED,IAAI,aAAkC,CAAC;AACvC,MAAM,UAAU,gBAAgB,CAAC,YAAkC;IAClE,aAAa,GAAG,YAAY,CAAC;AAC9B,CAAC;AAED,IAAI,wBAAwD,CAAC;AAC7D,MAAM,UAAU,2BAA2B,CAAC,uBAAwD;IACnG,wBAAwB,GAAG,uBAAuB,CAAC;AACpD,CAAC;AAED,MAAM,OAAgB,oBAAoB;IACzC,IAAI,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IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACjD,IAAI,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC9B,CAAC;QACD,IAAI,OAAO,EAAE,CAAC;YACb,SAAS,EAAE,EAAE,4BAA4B,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACvE,CAAC;IACF,CAAC;IAES,oBAAoB,KAAW,CAAC;IAChC,qBAAqB,KAAW,CAAC;IAEpC,iBAAiB;QACvB,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;CACD","file":"baseObservable.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 { IObservableWithChange, IObserver, IReader, IObservable } from '../base.js';\nimport { DisposableStore } from '../commonFacade/deps.js';\nimport { DebugLocation } from '../debugLocation.js';\nimport { DebugOwner, getFunctionName } from '../debugName.js';\nimport { debugGetObservableGraph } from '../logging/debugGetDependencyGraph.js';\nimport { getLogger } from '../logging/logging.js';\nimport { keepObserved, recomputeInitiallyAndOnChange } from '../utils/utils.js';\nimport { derivedOpts } from './derived.js';\n\nlet _derived: typeof derivedOpts;\n/**\n * @internal\n * This is to allow splitting files.\n*/\nexport function _setDerivedOpts(derived: typeof _derived) {\n\t_derived = derived;\n}\n\nlet _recomputeInitiallyAndOnChange: typeof recomputeInitiallyAndOnChange;\nexport function _setRecomputeInitiallyAndOnChange(recomputeInitiallyAndOnChange: typeof _recomputeInitiallyAndOnChange) {\n\t_recomputeInitiallyAndOnChange = recomputeInitiallyAndOnChange;\n}\n\nlet _keepObserved: typeof keepObserved;\nexport function _setKeepObserved(keepObserved: typeof _keepObserved) {\n\t_keepObserved = keepObserved;\n}\n\nlet _debugGetObservableGraph: typeof debugGetObservableGraph;\nexport function _setDebugGetObservableGraph(debugGetObservableGraph: typeof _debugGetObservableGraph) {\n\t_debugGetObservableGraph = debugGetObservableGraph;\n}\n\nexport abstract class ConvenientObservable<T, TChange> implements IObservableWithChange<T, TChange> {\n\tget TChange(): TChange { return null!; }\n\n\tpublic abstract get(): T;\n\n\tpublic reportChanges(): void {\n\t\tthis.get();\n\t}\n\n\tpublic abstract addObserver(observer: IObserver): void;\n\tpublic abstract removeObserver(observer: IObserver): void;\n\n\t/** @sealed */\n\tpublic read(reader: IReader | undefined): T {\n\t\tif (reader) {\n\t\t\treturn reader.readObservable(this);\n\t\t} else {\n\t\t\treturn this.get();\n\t\t}\n\t}\n\n\t/** @sealed */\n\tpublic map<TNew>(fn: (value: T, reader: IReader) => TNew): IObservable<TNew>;\n\tpublic map<TNew>(owner: DebugOwner, fn: (value: T, reader: IReader) => TNew): IObservable<TNew>;\n\tpublic map<TNew>(fnOrOwner: DebugOwner | ((value: T, reader: IReader) => TNew), fnOrUndefined?: (value: T, reader: IReader) => TNew, debugLocation: DebugLocation = DebugLocation.ofCaller()): IObservable<TNew> {\n\t\tconst owner = fnOrUndefined === undefined ? undefined : fnOrOwner as DebugOwner;\n\t\tconst fn = fnOrUndefined === undefined ? fnOrOwner as (value: T, reader: IReader) => TNew : fnOrUndefined;\n\n\t\treturn _derived(\n\t\t\t{\n\t\t\t\towner,\n\t\t\t\tdebugName: () => {\n\t\t\t\t\tconst name = getFunctionName(fn);\n\t\t\t\t\tif (name !== undefined) {\n\t\t\t\t\t\treturn name;\n\t\t\t\t\t}\n\n\t\t\t\t\t// regexp to match `x => x.y` or `x => x?.y` where x and y can be arbitrary identifiers (uses backref):\n\t\t\t\t\tconst regexp = /^\\s*\\(?\\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\\s*\\)?\\s*=>\\s*\\1(?:\\??)\\.([a-zA-Z_$][a-zA-Z_$0-9]*)\\s*$/;\n\t\t\t\t\tconst match = regexp.exec(fn.toString());\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\treturn `${this.debugName}.${match[2]}`;\n\t\t\t\t\t}\n\t\t\t\t\tif (!owner) {\n\t\t\t\t\t\treturn `${this.debugName} (mapped)`;\n\t\t\t\t\t}\n\t\t\t\t\treturn undefined;\n\t\t\t\t},\n\t\t\t\tdebugReferenceFn: fn,\n\t\t\t},\n\t\t\t(reader) => fn(this.read(reader), reader),\n\t\t\tdebugLocation,\n\t\t);\n\t}\n\n\t/**\n\t * @sealed\n\t * Converts an observable of an observable value into a direct observable of the value.\n\t*/\n\tpublic flatten<TNew>(this: IObservable<IObservableWithChange<TNew, any>>): IObservable<TNew> {\n\t\treturn _derived(\n\t\t\t{\n\t\t\t\towner: undefined,\n\t\t\t\tdebugName: () => `${this.debugName} (flattened)`,\n\t\t\t},\n\t\t\t(reader) => this.read(reader).read(reader)\n\t\t);\n\t}\n\n\tpublic recomputeInitiallyAndOnChange(store: DisposableStore, handleValue?: (value: T) => void): IObservable<T> {\n\t\tstore.add(_recomputeInitiallyAndOnChange!(this, handleValue));\n\t\treturn this;\n\t}\n\n\tpublic abstract get debugName(): string;\n}\n\nexport abstract class BaseObservable<T, TChange = void> extends ConvenientObservable<T, TChange> {\n\tprotected readonly _observers = new Set<IObserver>();\n\n\tconstructor(debugLocation: DebugLocation) {\n\t\tsuper();\n\t\tgetLogger()?.handleObservableCreated(this, debugLocation);\n\t}\n\n\tpublic addObserver(observer: IObserver): void {\n\t\tconst len = this._observers.size;\n\t\tthis._observers.add(observer);\n\t\tif (len === 0) {\n\t\t\tthis.onFirstObserverAdded();\n\t\t}\n\t\tif (len !== this._observers.size) {\n\t\t\tgetLogger()?.handleOnListenerCountChanged(this, this._observers.size);\n\t\t}\n\t}\n\n\tpublic removeObserver(observer: IObserver): void {\n\t\tconst deleted = this._observers.delete(observer);\n\t\tif (deleted && this._observers.size === 0) {\n\t\t\tthis.onLastObserverRemoved();\n\t\t}\n\t\tif (deleted) {\n\t\t\tgetLogger()?.handleOnListenerCountChanged(this, this._observers.size);\n\t\t}\n\t}\n\n\tprotected onFirstObserverAdded(): void { }\n\tprotected onLastObserverRemoved(): void { }\n\n\tpublic debugGetObservers() {\n\t\treturn this._observers;\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 { IObservableWithChange, IObserver, IReader, IObservable } from '../base.js';\nimport { DisposableStore } from '../commonFacade/deps.js';\nimport { DebugLocation } from '../debugLocation.js';\nimport { DebugOwner, getFunctionName } from '../debugName.js';\nimport { debugGetObservableGraph } from '../logging/debugGetDependencyGraph.js';\nimport { getLogger } from '../logging/logging.js';\nimport { keepObserved, recomputeInitiallyAndOnChange } from '../utils/utils.js';\nimport { derivedOpts } from './derived.js';\n\nlet _derived: typeof derivedOpts;\n/**\n * @internal\n * This is to allow splitting files.\n*/\nexport function _setDerivedOpts(derived: typeof _derived) {\n\t_derived = derived;\n}\n\nlet _recomputeInitiallyAndOnChange: typeof recomputeInitiallyAndOnChange;\nexport function _setRecomputeInitiallyAndOnChange(recomputeInitiallyAndOnChange: typeof _recomputeInitiallyAndOnChange) {\n\t_recomputeInitiallyAndOnChange = recomputeInitiallyAndOnChange;\n}\n\nlet _keepObserved: typeof keepObserved;\nexport function _setKeepObserved(keepObserved: typeof _keepObserved) {\n\t_keepObserved = keepObserved;\n}\n\nlet _debugGetObservableGraph: typeof debugGetObservableGraph;\nexport function _setDebugGetObservableGraph(debugGetObservableGraph: typeof _debugGetObservableGraph) {\n\t_debugGetObservableGraph = debugGetObservableGraph;\n}\n\nexport abstract class ConvenientObservable<T, TChange> implements IObservableWithChange<T, TChange> {\n\tget TChange(): TChange { return null!; }\n\n\tpublic abstract get(): T;\n\n\tpublic reportChanges(): void {\n\t\tthis.get();\n\t}\n\n\tpublic abstract addObserver(observer: IObserver): void;\n\tpublic abstract removeObserver(observer: IObserver): void;\n\n\t/** @sealed */\n\tpublic read(reader: IReader | undefined): T {\n\t\tif (reader) {\n\t\t\treturn reader.readObservable(this);\n\t\t} else {\n\t\t\treturn this.get();\n\t\t}\n\t}\n\n\t/** @sealed */\n\tpublic map<TNew>(fn: (value: T, reader: IReader) => TNew): IObservable<TNew>;\n\tpublic map<TNew>(owner: DebugOwner, fn: (value: T, reader: IReader) => TNew): IObservable<TNew>;\n\tpublic map<TNew>(fnOrOwner: DebugOwner | ((value: T, reader: IReader) => TNew), fnOrUndefined?: (value: T, reader: IReader) => TNew, debugLocation: DebugLocation = DebugLocation.ofCaller()): IObservable<TNew> {\n\t\tconst owner = fnOrUndefined === undefined ? undefined : fnOrOwner as DebugOwner;\n\t\tconst fn = fnOrUndefined === undefined ? fnOrOwner as (value: T, reader: IReader) => TNew : fnOrUndefined;\n\n\t\treturn _derived(\n\t\t\t{\n\t\t\t\towner,\n\t\t\t\tdebugName: () => {\n\t\t\t\t\tconst name = getFunctionName(fn);\n\t\t\t\t\tif (name !== undefined) {\n\t\t\t\t\t\treturn name;\n\t\t\t\t\t}\n\n\t\t\t\t\t// regexp to match `x => x.y` or `x => x?.y` where x and y can be arbitrary identifiers (uses backref):\n\t\t\t\t\tconst regexp = /^\\s*\\(?\\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\\s*\\)?\\s*=>\\s*\\1(?:\\??)\\.([a-zA-Z_$][a-zA-Z_$0-9]*)\\s*$/;\n\t\t\t\t\tconst match = regexp.exec(fn.toString());\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\treturn `${this.debugName}.${match[2]}`;\n\t\t\t\t\t}\n\t\t\t\t\tif (!owner) {\n\t\t\t\t\t\treturn `${this.debugName} (mapped)`;\n\t\t\t\t\t}\n\t\t\t\t\treturn undefined;\n\t\t\t\t},\n\t\t\t\tdebugReferenceFn: fn,\n\t\t\t},\n\t\t\t(reader) => fn(this.read(reader), reader),\n\t\t\tdebugLocation,\n\t\t);\n\t}\n\n\t/**\n\t * @sealed\n\t * Converts an observable of an observable value into a direct observable of the value.\n\t*/\n\tpublic flatten<TNew>(this: IObservable<IObservableWithChange<TNew, any>>): IObservable<TNew> {\n\t\treturn _derived(\n\t\t\t{\n\t\t\t\towner: undefined,\n\t\t\t\tdebugName: () => `${this.debugName} (flattened)`,\n\t\t\t},\n\t\t\t(reader) => this.read(reader).read(reader)\n\t\t);\n\t}\n\n\tpublic recomputeInitiallyAndOnChange(store: DisposableStore, handleValue?: (value: T) => void): IObservable<T> {\n\t\tstore.add(_recomputeInitiallyAndOnChange!(this, handleValue));\n\t\treturn this;\n\t}\n\n\tpublic abstract get debugName(): string;\n}\n\nexport abstract class BaseObservable<T, TChange = void> extends ConvenientObservable<T, TChange> {\n\tprotected readonly _observers = new Set<IObserver>();\n\n\tconstructor(debugLocation: DebugLocation) {\n\t\tsuper();\n\t\tgetLogger()?.handleObservableCreated(this, debugLocation);\n\t}\n\n\tpublic addObserver(observer: IObserver): void {\n\t\tconst len = this._observers.size;\n\t\tthis._observers.add(observer);\n\t\tif (len === 0) {\n\t\t\tthis.onFirstObserverAdded();\n\t\t}\n\t\tif (len !== this._observers.size) {\n\t\t\tgetLogger()?.handleOnListenerCountChanged(this, this._observers.size);\n\t\t}\n\t}\n\n\tpublic removeObserver(observer: IObserver): void {\n\t\tconst deleted = this._observers.delete(observer);\n\t\tif (deleted && this._observers.size === 0) {\n\t\t\tthis.onLastObserverRemoved();\n\t\t}\n\t\tif (deleted) {\n\t\t\tgetLogger()?.handleOnListenerCountChanged(this, this._observers.size);\n\t\t}\n\t}\n\n\tprotected onFirstObserverAdded(): void { }\n\tprotected onLastObserverRemoved(): void { }\n\n\tpublic debugGetObservers() {\n\t\treturn this._observers;\n\t}\n}\n"]}
|
|
@@ -8,14 +8,15 @@ import { derived, derivedOpts } from '../observables/derived.js';
|
|
|
8
8
|
import { observableFromEvent } from '../observables/observableFromEvent.js';
|
|
9
9
|
import { observableSignal } from '../observables/observableSignal.js';
|
|
10
10
|
import { _setKeepObserved, _setRecomputeInitiallyAndOnChange } from '../observables/baseObservable.js';
|
|
11
|
+
import { DebugLocation } from '../debugLocation.js';
|
|
11
12
|
/**
|
|
12
13
|
* Creates an observable that debounces the input observable.
|
|
13
14
|
*/
|
|
14
|
-
export function debouncedObservable(observable, debounceMs) {
|
|
15
|
+
export function debouncedObservable(observable, debounceMs, debugLocation = DebugLocation.ofCaller()) {
|
|
15
16
|
let hasValue = false;
|
|
16
17
|
let lastValue;
|
|
17
18
|
let timeout = undefined;
|
|
18
|
-
return observableFromEvent(cb => {
|
|
19
|
+
return observableFromEvent(undefined, cb => {
|
|
19
20
|
const d = autorun(reader => {
|
|
20
21
|
const value = observable.read(reader);
|
|
21
22
|
if (!hasValue) {
|
|
@@ -26,10 +27,16 @@ export function debouncedObservable(observable, debounceMs) {
|
|
|
26
27
|
if (timeout) {
|
|
27
28
|
clearTimeout(timeout);
|
|
28
29
|
}
|
|
30
|
+
const debounceDuration = typeof debounceMs === 'number' ? debounceMs : debounceMs(lastValue, value);
|
|
31
|
+
if (debounceDuration === 0) {
|
|
32
|
+
lastValue = value;
|
|
33
|
+
cb();
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
29
36
|
timeout = setTimeout(() => {
|
|
30
37
|
lastValue = value;
|
|
31
38
|
cb();
|
|
32
|
-
},
|
|
39
|
+
}, debounceDuration);
|
|
33
40
|
}
|
|
34
41
|
});
|
|
35
42
|
return {
|
|
@@ -46,7 +53,40 @@ export function debouncedObservable(observable, debounceMs) {
|
|
|
46
53
|
else {
|
|
47
54
|
return observable.get();
|
|
48
55
|
}
|
|
49
|
-
});
|
|
56
|
+
}, debugLocation);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Creates an observable that debounces the input observable.
|
|
60
|
+
*/
|
|
61
|
+
export function debouncedObservable2(observable, debounceMs, debugLocation = DebugLocation.ofCaller()) {
|
|
62
|
+
const s = observableSignal('handleTimeout');
|
|
63
|
+
let currentValue = undefined;
|
|
64
|
+
let timeout = undefined;
|
|
65
|
+
const d = derivedOpts({
|
|
66
|
+
owner: undefined,
|
|
67
|
+
onLastObserverRemoved: () => {
|
|
68
|
+
currentValue = undefined;
|
|
69
|
+
}
|
|
70
|
+
}, reader => {
|
|
71
|
+
const val = observable.read(reader);
|
|
72
|
+
s.read(reader);
|
|
73
|
+
if (val !== currentValue) {
|
|
74
|
+
const debounceDuration = typeof debounceMs === 'number' ? debounceMs : debounceMs(currentValue, val);
|
|
75
|
+
if (debounceDuration === 0) {
|
|
76
|
+
currentValue = val;
|
|
77
|
+
return val;
|
|
78
|
+
}
|
|
79
|
+
if (timeout) {
|
|
80
|
+
clearTimeout(timeout);
|
|
81
|
+
}
|
|
82
|
+
timeout = setTimeout(() => {
|
|
83
|
+
currentValue = val;
|
|
84
|
+
s.trigger(undefined);
|
|
85
|
+
}, debounceDuration);
|
|
86
|
+
}
|
|
87
|
+
return currentValue;
|
|
88
|
+
}, debugLocation);
|
|
89
|
+
return d;
|
|
50
90
|
}
|
|
51
91
|
/**
|
|
52
92
|
* This makes sure the observable is being observed and keeps its cache alive.
|
|
@@ -143,7 +183,8 @@ export function mapObservableArrayCached(owner, items, map, keySelector) {
|
|
|
143
183
|
m = new ArrayMap(map);
|
|
144
184
|
}
|
|
145
185
|
}, (reader) => {
|
|
146
|
-
|
|
186
|
+
const i = items.read(reader);
|
|
187
|
+
m.setItems(i);
|
|
147
188
|
return m.getItems();
|
|
148
189
|
});
|
|
149
190
|
return self;
|