@codingame/monaco-vscode-api 6.0.2 → 7.0.0
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/README.md +93 -73
- package/api.js +1 -1
- package/debugProtocol.d.ts +10 -1
- package/extensions.d.ts +2 -0
- package/missing-services.js +21 -2
- package/monaco.d.ts +1 -1
- package/monaco.js +1 -1
- package/package.json +9 -9
- package/service-override/extensions.d.ts +1 -2
- package/services.js +4 -2
- package/vscode/src/vs/base/browser/dnd.js +1 -1
- package/vscode/src/vs/base/browser/dom.js +116 -5
- package/vscode/src/vs/base/browser/domObservable.js +16 -0
- package/vscode/src/vs/base/browser/markdownRenderer.js +5 -3
- package/vscode/src/vs/base/browser/trustedTypes.js +1 -2
- package/vscode/src/vs/base/browser/ui/actionbar/actionViewItems.js +1 -1
- package/vscode/src/vs/base/browser/ui/actionbar/actionbar.js +1 -1
- package/vscode/src/vs/base/browser/ui/button/button.js +2 -2
- package/vscode/src/vs/base/browser/ui/contextview/contextview.js +1 -4
- package/vscode/src/vs/base/browser/ui/dropdown/dropdown.js +1 -1
- package/vscode/src/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +1 -1
- package/vscode/src/vs/base/browser/ui/highlightedlabel/highlightedLabel.js +1 -1
- package/vscode/src/vs/base/browser/ui/hover/hover.d.ts +32 -16
- package/vscode/src/vs/base/browser/ui/hover/hoverDelegate.d.ts +2 -2
- package/vscode/src/vs/base/browser/ui/hover/hoverDelegate2.js +2 -2
- package/vscode/src/vs/base/browser/ui/hover/hoverWidget.css.js +1 -1
- package/vscode/src/vs/base/browser/ui/hover/hoverWidget.js +2 -0
- package/vscode/src/vs/base/browser/ui/iconLabel/iconLabel.js +1 -1
- package/vscode/src/vs/base/browser/ui/iconLabel/simpleIconLabel.js +1 -1
- package/vscode/src/vs/base/browser/ui/inputbox/inputBox.js +1 -1
- package/vscode/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.js +1 -1
- package/vscode/src/vs/base/browser/ui/list/listView.js +3 -5
- package/vscode/src/vs/base/browser/ui/list/rowCache.js +1 -8
- package/vscode/src/vs/base/browser/ui/sash/sash.js +1 -1
- package/vscode/src/vs/base/browser/ui/selectBox/selectBoxCustom.js +7 -11
- package/vscode/src/vs/base/browser/ui/splitview/paneview.js +1 -1
- package/vscode/src/vs/base/browser/ui/splitview/splitview.js +1 -1
- package/vscode/src/vs/base/browser/ui/table/tableWidget.js +1 -1
- package/vscode/src/vs/base/browser/ui/toggle/toggle.js +1 -1
- package/vscode/src/vs/base/browser/ui/toolbar/toolbar.d.ts +8 -1
- package/vscode/src/vs/base/browser/ui/toolbar/toolbar.js +2 -3
- package/vscode/src/vs/base/browser/ui/tree/abstractTree.js +1 -1
- package/vscode/src/vs/base/browser/ui/tree/asyncDataTree.js +0 -3
- package/vscode/src/vs/base/common/assert.js +1 -1
- package/vscode/src/vs/base/common/collections.js +49 -1
- package/vscode/src/vs/base/common/equals.js +55 -5
- package/vscode/src/vs/base/common/errors.js +14 -1
- package/vscode/src/vs/base/common/event.js +2 -1
- package/vscode/src/vs/base/common/history.js +7 -4
- package/vscode/src/vs/base/common/iterator.js +9 -1
- package/vscode/src/vs/base/common/map.d.ts +41 -0
- package/vscode/src/vs/base/common/numbers.js +18 -1
- package/vscode/src/vs/base/common/observableInternal/api.js +11 -0
- package/vscode/src/vs/base/common/observableInternal/autorun.js +18 -1
- package/vscode/src/vs/base/common/observableInternal/base.d.ts +8 -1
- package/vscode/src/vs/base/common/observableInternal/base.js +2 -5
- package/vscode/src/vs/base/common/observableInternal/derived.js +13 -3
- package/vscode/src/vs/base/common/observableInternal/lazyObservableValue.js +109 -0
- package/vscode/src/vs/base/common/observableInternal/promise.js +3 -0
- package/vscode/src/vs/base/common/observableInternal/utils.d.ts +7 -0
- package/vscode/src/vs/base/common/observableInternal/utils.js +64 -12
- package/vscode/src/vs/base/common/prefixTree.d.ts +52 -0
- package/vscode/src/vs/base/common/product.d.ts +1 -0
- package/vscode/src/vs/base/parts/ipc/common/ipc.js +1 -1
- package/vscode/src/vs/editor/browser/config/charWidthReader.js +1 -1
- package/vscode/src/vs/editor/browser/controller/textAreaHandler.js +1 -1
- package/vscode/src/vs/editor/browser/coreCommands.js +2 -1
- package/vscode/src/vs/editor/browser/observableCodeEditor.js +230 -0
- package/vscode/src/vs/editor/browser/services/abstractCodeEditorService.js +1 -1
- package/vscode/src/vs/editor/browser/services/hoverService/hoverService.js +26 -26
- package/vscode/src/vs/editor/browser/services/hoverService/updatableHoverWidget.js +2 -2
- package/vscode/src/vs/editor/browser/view/domLineBreaksComputer.js +1 -1
- package/vscode/src/vs/editor/browser/view/viewLayer.js +4 -12
- package/vscode/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +1 -1
- package/vscode/src/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +1 -1
- package/vscode/src/vs/editor/browser/viewParts/viewZones/viewZones.js +2 -2
- package/vscode/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +15 -4
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +8 -8
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +4 -4
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorOptions.js +1 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorViewModel.js +1 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +14 -2
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +1 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
- package/vscode/src/vs/editor/browser/widget/diffEditor/registrations.contribution.js +2 -2
- package/vscode/src/vs/editor/browser/widget/diffEditor/utils/editorGutter.js +3 -3
- package/vscode/src/vs/editor/browser/widget/diffEditor/utils.js +2 -2
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/colors.js +1 -1
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +2 -2
- package/vscode/src/vs/editor/common/config/editorOptions.d.ts +5 -0
- package/vscode/src/vs/editor/common/config/editorOptions.js +83 -65
- package/vscode/src/vs/editor/common/core/editorColorRegistry.js +43 -43
- package/vscode/src/vs/editor/common/cursor/cursor.js +3 -2
- package/vscode/src/vs/editor/common/cursor/cursorTypeEditOperations.js +911 -0
- package/vscode/src/vs/editor/common/cursor/cursorTypeOperations.js +36 -799
- package/vscode/src/vs/editor/common/cursor/cursorWordOperations.js +6 -5
- package/vscode/src/vs/editor/common/languageFeatureRegistry.d.ts +1 -0
- package/vscode/src/vs/editor/common/languageFeatureRegistry.js +3 -0
- package/vscode/src/vs/editor/common/languages/autoIndent.js +23 -1
- package/vscode/src/vs/editor/common/languages.d.ts +20 -3
- package/vscode/src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsImpl.js +6 -6
- package/vscode/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.js +19 -0
- package/vscode/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.js +3 -0
- package/vscode/src/vs/editor/common/model/textModel.js +6 -2
- package/vscode/src/vs/editor/common/model/tokenizationTextModelPart.js +5 -5
- package/vscode/src/vs/editor/common/model.d.ts +4 -0
- package/vscode/src/vs/editor/common/services/getIconClasses.js +1 -1
- package/vscode/src/vs/editor/common/services/semanticTokensProviderStyling.js +2 -15
- package/vscode/src/vs/editor/common/standalone/standaloneEnums.js +63 -62
- package/vscode/src/vs/editor/common/viewModel/viewModelImpl.js +11 -8
- package/vscode/src/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +1 -1
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionController.js +2 -17
- package/vscode/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.css.js +1 -1
- package/vscode/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +18 -5
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorHoverParticipant.js +55 -27
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerWidget.js +7 -4
- package/vscode/src/vs/editor/contrib/colorPicker/browser/standaloneColorPickerWidget.js +9 -9
- package/vscode/src/vs/editor/contrib/contextmenu/browser/contextmenu.js +1 -1
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +103 -47
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -2
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +18 -10
- package/vscode/src/vs/editor/contrib/find/browser/findWidget.js +2 -4
- package/vscode/src/vs/editor/contrib/folding/browser/folding.css.js +1 -1
- package/vscode/src/vs/editor/contrib/folding/browser/folding.js +33 -13
- package/vscode/src/vs/editor/contrib/folding/browser/foldingDecorations.js +12 -7
- package/vscode/src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +2 -2
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverController.js +161 -185
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverRendered.js +321 -0
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverStatusBar.js +4 -1
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverTypes.js +6 -21
- package/vscode/src/vs/editor/contrib/hover/browser/contentHoverWidget.js +39 -40
- package/vscode/src/vs/editor/contrib/hover/browser/hoverAccessibleViews.js +55 -46
- package/vscode/src/vs/editor/contrib/hover/browser/hoverActions.js +12 -2
- package/vscode/src/vs/editor/contrib/hover/browser/hoverController.js +15 -9
- package/vscode/src/vs/editor/contrib/hover/browser/hoverTypes.js +11 -1
- package/vscode/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +141 -93
- package/vscode/src/vs/editor/contrib/hover/browser/markerHoverParticipant.js +24 -7
- package/vscode/src/vs/editor/contrib/indentation/browser/indentation.js +36 -1
- package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +5 -3
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hoverParticipant.js +25 -12
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController.js +88 -118
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHintsWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel.js +34 -33
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsSource.js +2 -2
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/provideInlineCompletions.js +11 -4
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/suggestWidgetInlineCompletionProvider.js +10 -19
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/ghostTextWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/hoverParticipant.js +45 -27
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/inlineEditController.js +4 -4
- package/vscode/src/vs/editor/contrib/inlineEdit/browser/inlineEditHintsWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/commands.js +126 -0
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/consts.js +9 -0
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/inlineEdits.contribution.js +9 -0
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/inlineEditsController.js +82 -0
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/inlineEditsModel.js +240 -0
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/inlineEditsWidget.css.js +4 -0
- package/vscode/src/vs/editor/contrib/inlineEdits/browser/inlineEditsWidget.js +322 -0
- package/vscode/src/vs/editor/contrib/inlineProgress/browser/inlineProgress.js +8 -4
- package/vscode/src/vs/editor/contrib/linesOperations/browser/linesOperations.js +3 -2
- package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/peekView/browser/peekView.js +2 -2
- package/vscode/src/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +60 -0
- package/vscode/src/vs/editor/contrib/placeholderText/browser/placeholderText.css.js +4 -0
- package/vscode/src/vs/editor/contrib/rename/browser/renameWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.css.js +1 -1
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +38 -20
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +3 -0
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidget.js +9 -9
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetStatus.js +10 -32
- package/vscode/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +23 -138
- package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +3 -0
- package/vscode/src/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +5 -5
- package/vscode/src/vs/editor/contrib/wordOperations/browser/wordOperations.js +13 -12
- package/vscode/src/vs/editor/contrib/wordPartOperations/browser/wordPartOperations.js +3 -3
- package/vscode/src/vs/editor/editor.api.d.ts +31 -5
- package/vscode/src/vs/platform/accessibility/browser/accessibilityService.js +21 -0
- package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +5 -6
- package/vscode/src/vs/platform/actionWidget/browser/actionWidget.js +1 -1
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +27 -6
- package/vscode/src/vs/platform/actions/browser/floatingMenu.js +1 -1
- package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.css.js +1 -1
- package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.js +33 -3
- package/vscode/src/vs/platform/actions/browser/toolbar.js +2 -1
- package/vscode/src/vs/platform/actions/common/actions.d.ts +3 -0
- package/vscode/src/vs/platform/actions/common/actions.js +3 -0
- package/vscode/src/vs/platform/actions/common/menuService.js +3 -2
- package/vscode/src/vs/platform/clipboard/browser/clipboardService.js +1 -1
- package/vscode/src/vs/platform/configuration/common/configurationRegistry.d.ts +7 -5
- package/vscode/src/vs/platform/configuration/common/configurationRegistry.js +109 -13
- package/vscode/src/vs/platform/diagnostics/common/diagnostics.d.ts +2 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.d.ts +12 -6
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +2 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.service.d.ts +3 -3
- package/vscode/src/vs/platform/extensionManagement/common/extensionsScannerService.js +20 -10
- package/vscode/src/vs/platform/extensions/common/extensionValidator.js +46 -8
- package/vscode/src/vs/platform/extensions/common/extensions.d.ts +1 -1
- package/vscode/src/vs/platform/extensions/common/extensions.js +12 -3
- package/vscode/src/vs/platform/extensions/common/extensionsApiProposals.js +368 -0
- package/vscode/src/vs/platform/files/common/watcher.js +21 -24
- package/vscode/src/vs/platform/list/browser/listService.js +2 -1
- package/vscode/src/vs/platform/observable/common/platformObservableUtils.js +2 -2
- package/vscode/src/vs/platform/opener/browser/link.js +1 -1
- package/vscode/src/vs/platform/product/common/product.js +1 -1
- package/vscode/src/vs/platform/quickinput/browser/quickInputTree.js +1 -1
- package/vscode/src/vs/platform/remote/common/remoteExtensionsScanner.service.d.ts +0 -2
- package/vscode/src/vs/platform/request/common/request.js +18 -8
- package/vscode/src/vs/platform/terminal/common/capabilities/capabilities.d.ts +2 -6
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetection/promptInputModel.d.ts +8 -1
- package/vscode/src/vs/platform/theme/common/colorUtils.d.ts +1 -1
- package/vscode/src/vs/platform/theme/common/colorUtils.js +25 -5
- package/vscode/src/vs/platform/theme/common/colors/baseColors.js +1 -1
- package/vscode/src/vs/platform/theme/common/colors/chartsColors.js +6 -6
- package/vscode/src/vs/platform/theme/common/colors/editorColors.js +35 -35
- package/vscode/src/vs/platform/theme/common/colors/inputColors.js +9 -9
- package/vscode/src/vs/platform/theme/common/colors/listColors.js +11 -11
- package/vscode/src/vs/platform/theme/common/colors/menuColors.js +4 -4
- package/vscode/src/vs/platform/theme/common/colors/minimapColors.js +5 -5
- package/vscode/src/vs/platform/theme/common/colors/miscColors.js +1 -1
- package/vscode/src/vs/platform/theme/common/colors/quickpickColors.js +5 -5
- package/vscode/src/vs/platform/tunnel/common/tunnel.js +4 -1
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.js +75 -19
- package/vscode/src/vs/platform/window/common/window.d.ts +2 -2
- package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +32 -25
- package/vscode/src/vs/workbench/api/common/extHost.common.services.js +2 -0
- package/vscode/src/vs/workbench/api/common/extHost.protocol.js +2 -0
- package/vscode/src/vs/workbench/api/common/extHostAuthentication.js +5 -11
- package/vscode/src/vs/workbench/api/common/extHostChatAgents2.js +5 -15
- package/vscode/src/vs/workbench/api/common/extHostChatVariables.js +2 -5
- package/vscode/src/vs/workbench/api/common/extHostComments.js +9 -3
- package/vscode/src/vs/workbench/api/common/extHostDebugService.js +32 -22
- package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +3 -3
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +109 -40
- package/vscode/src/vs/workbench/api/common/extHostLanguageModelTools.js +46 -0
- package/vscode/src/vs/workbench/api/common/extHostLanguageModels.js +84 -35
- package/vscode/src/vs/workbench/api/common/extHostNotebook.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostSCM.js +50 -41
- package/vscode/src/vs/workbench/api/common/extHostSearch.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostSecrets.js +11 -8
- package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +7 -6
- package/vscode/src/vs/workbench/api/common/extHostTesting.js +63 -70
- package/vscode/src/vs/workbench/api/common/extHostTextEditors.js +5 -3
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +75 -16
- package/vscode/src/vs/workbench/api/common/extHostTypes.js +29 -4
- package/vscode/src/vs/workbench/api/common/extHostWorkspace.js +1 -1
- package/vscode/src/vs/workbench/browser/actions/developerActions.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorActions.js +127 -107
- package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/editor/editorPanes.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorStatus.js +33 -21
- package/vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +5 -5
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsToasts.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/views/treeView.js +23 -6
- package/vscode/src/vs/workbench/browser/parts/views/viewFilter.js +3 -1
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +3 -3
- package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +1 -1
- package/vscode/src/vs/workbench/browser/web.api.js +8 -0
- package/vscode/src/vs/workbench/browser/workbench.contribution.js +199 -194
- package/vscode/src/vs/workbench/common/configuration.js +1 -1
- package/vscode/src/vs/workbench/common/contributions.js +8 -1
- package/vscode/src/vs/workbench/common/editor.js +5 -1
- package/vscode/src/vs/workbench/common/theme.js +79 -454
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +221 -239
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +17 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAgentHover.js +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollections.js +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCommandContentPart.js +35 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationContentPart.js +51 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/{chatConfirmationWidget.js → chatContentParts/chatConfirmationWidget.js} +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownContentPart.js +131 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatProgressContentPart.js +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.js +263 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTaskContentPart.js +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.js +160 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTreeContentPart.js +171 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatWarningContentPart.js +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/{media → chatContentParts/media}/chatConfirmationWidget.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +91 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +292 -1019
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownRenderer.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +22 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +61 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +23 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatAgentHover.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.js +8 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatColors.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatWordCounter.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/common/codeBlockModelCollection.js +16 -0
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelToolsService.service.js +3 -0
- package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +43 -16
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +1 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.js +7 -5
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +7 -7
- package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +3 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +2 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +2 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +2 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +8 -5
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +1 -1
- package/vscode/src/vs/workbench/contrib/contextmenu/browser/contextmenu.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +14 -7
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +8 -7
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +19 -16
- package/vscode/src/vs/workbench/contrib/debug/browser/debugColors.js +13 -12
- package/vscode/src/vs/workbench/contrib/debug/common/debug.d.ts +19 -2
- package/vscode/src/vs/workbench/contrib/debug/common/debug.js +9 -4
- package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +10 -5
- package/vscode/src/vs/workbench/contrib/debug/common/replModel.js +4 -4
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +235 -173
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionActions.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/common/extensions.js +2 -1
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +17 -5
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._configuration.js +62 -44
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._editorPane.js +2 -2
- package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +114 -107
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatContentWidget.js +33 -25
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +71 -101
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +38 -43
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +11 -33
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +3 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +49 -86
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +60 -71
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatContentWidget.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +116 -113
- package/vscode/src/vs/workbench/contrib/markdown/browser/markdownDocumentRenderer.js +6 -10
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput.js +1 -0
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findFilters.js +12 -23
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +0 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findModel.js +7 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +88 -61
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +1 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +39 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +2 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.js +12 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookBrowser.js +3 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +40 -105
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +27 -26
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +14 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +43 -46
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +12 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +19 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +9 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +5 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +16 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.js +8 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineDataSourceFactory.service.js +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +11 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +12 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.js +5 -3
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +9 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +37 -36
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +18 -8
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.js +1 -1
- package/vscode/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.js +14 -5
- package/vscode/src/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +17 -22
- package/vscode/src/vs/workbench/contrib/remote/browser/media/tunnelView.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +7 -10
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +7 -27
- package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +3 -4
- package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchService.js +2 -2
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +4 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +13 -37
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.d.ts +88 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +48 -31
- package/vscode/src/vs/workbench/contrib/testing/common/testId.d.ts +115 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.d.ts +226 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testTypes.d.ts +319 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testTypes.js +2 -3
- package/vscode/src/vs/workbench/contrib/testing/common/testingStates.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewWindowDragMonitor.js +21 -2
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewIconManager.js +7 -8
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +3 -3
- package/vscode/src/vs/workbench/services/authentication/common/authentication.d.ts +10 -5
- package/vscode/src/vs/workbench/services/editor/common/customEditorLabelService.js +54 -21
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.service.d.ts +1 -0
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.d.ts +1 -2
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +2 -4
- package/vscode/src/vs/workbench/services/extensions/common/extensions.js +5 -3
- package/vscode/src/vs/workbench/services/extensions/common/extensions.service.d.ts +3 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsRegistry.js +59 -41
- package/vscode/src/vs/workbench/services/extensions/common/rpcProtocol.js +1 -1
- package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +3 -2
- package/vscode/src/vs/workbench/services/host/browser/host.service.d.ts +1 -0
- package/vscode/src/vs/workbench/services/language/common/languageService.js +7 -0
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +1 -1
- package/vscode/src/vs/workbench/services/preferences/common/preferences.d.ts +2 -2
- package/vscode/src/vs/workbench/services/search/common/search.js +2 -1
- package/vscode/src/vs/workbench/services/search/common/textSearchManager.js +2 -2
- package/vscode/src/vs/workbench/services/statusbar/browser/statusbar.d.ts +2 -2
- package/vscode/src/vs/workbench/services/textfile/common/encoding.js +69 -26
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +23 -4
- package/vscode/src/vs/workbench/services/textfile/common/textfiles.d.ts +5 -1
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +1 -1
- package/vscode/src/vs/workbench/services/views/browser/viewsService.js +12 -5
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.js +38 -19
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyFileService.service.d.ts +2 -1
- package/vscode-dts/vscode.proposed.aiTextSearchProvider.d.ts +0 -196
- package/vscode-dts/vscode.proposed.attributableCoverage.d.ts +28 -10
- package/vscode-dts/vscode.proposed.authGetSessions.d.ts +30 -22
- package/vscode-dts/vscode.proposed.chatProvider.d.ts +17 -8
- package/vscode-dts/vscode.proposed.chatVariableResolver.d.ts +0 -9
- package/vscode-dts/vscode.proposed.commentReveal.d.ts +32 -0
- package/vscode-dts/vscode.proposed.commentThreadApplicability.d.ts +10 -0
- package/vscode-dts/vscode.proposed.createFileSystemWatcher.d.ts +1 -1
- package/vscode-dts/vscode.proposed.fileComments.d.ts +12 -53
- package/vscode-dts/vscode.proposed.fileSearchProvider.d.ts +6 -0
- package/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts +6 -0
- package/vscode-dts/vscode.proposed.lmTools.d.ts +91 -0
- package/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts +1 -1
- package/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts +10 -6
- package/vscode-dts/vscode.proposed.terminalShellIntegration.d.ts +38 -13
- package/vscode/src/vs/editor/browser/observableUtilities.js +0 -58
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProviderFactory.service.js +0 -3
- package/vscode/src/vs/workbench/services/extensions/common/extensionsApiProposals.js +0 -122
|
@@ -6,11 +6,61 @@ function itemsEquals(itemEquals = strictEquals) {
|
|
|
6
6
|
function itemEquals() {
|
|
7
7
|
return (a, b) => a.equals(b);
|
|
8
8
|
}
|
|
9
|
-
function equalsIfDefined(
|
|
10
|
-
if (
|
|
11
|
-
|
|
9
|
+
function equalsIfDefined(equalsOrV1, v2, equals) {
|
|
10
|
+
if (equals !== undefined) {
|
|
11
|
+
const v1 = equalsOrV1;
|
|
12
|
+
if (v1 === undefined || v1 === null || v2 === undefined || v2 === null) {
|
|
13
|
+
return v2 === v1;
|
|
14
|
+
}
|
|
15
|
+
return equals(v1, v2);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
const equals = equalsOrV1;
|
|
19
|
+
return (v1, v2) => {
|
|
20
|
+
if (v1 === undefined || v1 === null || v2 === undefined || v2 === null) {
|
|
21
|
+
return v2 === v1;
|
|
22
|
+
}
|
|
23
|
+
return equals(v1, v2);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function structuralEquals(a, b) {
|
|
28
|
+
if (a === b) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
32
|
+
if (a.length !== b.length) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
for (let i = 0; i < a.length; i++) {
|
|
36
|
+
if (!structuralEquals(a[i], b[i])) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
if (a && typeof a === 'object' && b && typeof b === 'object') {
|
|
43
|
+
if (Object.getPrototypeOf(a) === Object.prototype && Object.getPrototypeOf(b) === Object.prototype) {
|
|
44
|
+
const aObj = a;
|
|
45
|
+
const bObj = b;
|
|
46
|
+
const keysA = ( Object.keys(aObj));
|
|
47
|
+
const keysB = ( Object.keys(bObj));
|
|
48
|
+
const keysBSet = ( new Set(keysB));
|
|
49
|
+
if (keysA.length !== keysB.length) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
for (const key of keysA) {
|
|
53
|
+
if (!( keysBSet.has(key))) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
if (!structuralEquals(aObj[key], bObj[key])) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
12
62
|
}
|
|
13
|
-
return
|
|
63
|
+
return false;
|
|
14
64
|
}
|
|
15
65
|
function getStructuralKey(t) {
|
|
16
66
|
return JSON.stringify(toNormalizedJsonStructure(t));
|
|
@@ -41,4 +91,4 @@ function toNormalizedJsonStructure(t) {
|
|
|
41
91
|
}
|
|
42
92
|
return t;
|
|
43
93
|
}
|
|
44
|
-
export { equalsIfDefined, getStructuralKey, itemEquals, itemsEquals, strictEquals };
|
|
94
|
+
export { equalsIfDefined, getStructuralKey, itemEquals, itemsEquals, strictEquals, structuralEquals };
|
|
@@ -71,6 +71,19 @@ function transformErrorForSerialization(error) {
|
|
|
71
71
|
}
|
|
72
72
|
return error;
|
|
73
73
|
}
|
|
74
|
+
function transformErrorFromSerialization(data) {
|
|
75
|
+
let error;
|
|
76
|
+
if (data.noTelemetry) {
|
|
77
|
+
error = ( new ErrorNoTelemetry());
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
error = ( new Error());
|
|
81
|
+
error.name = data.name;
|
|
82
|
+
}
|
|
83
|
+
error.message = data.message;
|
|
84
|
+
error.stack = data.stack;
|
|
85
|
+
return error;
|
|
86
|
+
}
|
|
74
87
|
const canceledName = 'Canceled';
|
|
75
88
|
function isCancellationError(error) {
|
|
76
89
|
if (error instanceof CancellationError) {
|
|
@@ -162,4 +175,4 @@ class BugIndicatingError extends Error {
|
|
|
162
175
|
Object.setPrototypeOf(this, BugIndicatingError.prototype);
|
|
163
176
|
}
|
|
164
177
|
}
|
|
165
|
-
export { BugIndicatingError, CancellationError, ErrorHandler, ErrorNoTelemetry, NotImplementedError, NotSupportedError, ReadonlyError, canceled, errorHandler, getErrorMessage, illegalArgument, illegalState, isCancellationError, onUnexpectedError, onUnexpectedExternalError, setUnexpectedErrorHandler, transformErrorForSerialization };
|
|
178
|
+
export { BugIndicatingError, CancellationError, ErrorHandler, ErrorNoTelemetry, NotImplementedError, NotSupportedError, ReadonlyError, canceled, errorHandler, getErrorMessage, illegalArgument, illegalState, isCancellationError, onUnexpectedError, onUnexpectedExternalError, setUnexpectedErrorHandler, transformErrorForSerialization, transformErrorFromSerialization };
|
|
@@ -439,7 +439,8 @@ function setGlobalLeakWarningThreshold(n) {
|
|
|
439
439
|
};
|
|
440
440
|
}
|
|
441
441
|
class LeakageMonitor {
|
|
442
|
-
|
|
442
|
+
static { this._idPool = 1; }
|
|
443
|
+
constructor(_errorHandler, threshold, name = ( (LeakageMonitor._idPool++).toString(16)).padStart(3, '0')) {
|
|
443
444
|
this._errorHandler = _errorHandler;
|
|
444
445
|
this.threshold = threshold;
|
|
445
446
|
this.name = name;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SetWithKey } from './collections.js';
|
|
1
2
|
import { ArrayNavigator } from './navigator.js';
|
|
2
3
|
class HistoryNavigator {
|
|
3
4
|
constructor(history = [], limit = 10) {
|
|
@@ -79,8 +80,9 @@ class HistoryNavigator {
|
|
|
79
80
|
}
|
|
80
81
|
class HistoryNavigator2 {
|
|
81
82
|
get size() { return this._size; }
|
|
82
|
-
constructor(history, capacity = 10) {
|
|
83
|
+
constructor(history, capacity = 10, identityFn = t => t) {
|
|
83
84
|
this.capacity = capacity;
|
|
85
|
+
this.identityFn = identityFn;
|
|
84
86
|
if (history.length < 1) {
|
|
85
87
|
throw ( new Error('not supported'));
|
|
86
88
|
}
|
|
@@ -90,7 +92,7 @@ class HistoryNavigator2 {
|
|
|
90
92
|
previous: undefined,
|
|
91
93
|
next: undefined
|
|
92
94
|
};
|
|
93
|
-
this.valueSet = ( new
|
|
95
|
+
this.valueSet = ( new SetWithKey([history[0]], identityFn));
|
|
94
96
|
for (let i = 1; i < history.length; i++) {
|
|
95
97
|
this.add(history[i]);
|
|
96
98
|
}
|
|
@@ -119,7 +121,7 @@ class HistoryNavigator2 {
|
|
|
119
121
|
}
|
|
120
122
|
}
|
|
121
123
|
replaceLast(value) {
|
|
122
|
-
if (this.tail.value === value) {
|
|
124
|
+
if (this.identityFn(this.tail.value) === this.identityFn(value)) {
|
|
123
125
|
return value;
|
|
124
126
|
}
|
|
125
127
|
const oldValue = this.tail.value;
|
|
@@ -181,8 +183,9 @@ class HistoryNavigator2 {
|
|
|
181
183
|
}
|
|
182
184
|
_deleteFromList(value) {
|
|
183
185
|
let temp = this.head;
|
|
186
|
+
const valueKey = this.identityFn(value);
|
|
184
187
|
while (temp !== this.tail) {
|
|
185
|
-
if (temp.value ===
|
|
188
|
+
if (this.identityFn(temp.value) === valueKey) {
|
|
186
189
|
if (temp === this.head) {
|
|
187
190
|
this.head = this.head.next;
|
|
188
191
|
this.head.previous = undefined;
|
|
@@ -41,8 +41,9 @@ var Iterable;
|
|
|
41
41
|
}
|
|
42
42
|
Iterable.first = first;
|
|
43
43
|
function some(iterable, predicate) {
|
|
44
|
+
let i = 0;
|
|
44
45
|
for (const element of iterable) {
|
|
45
|
-
if (predicate(element)) {
|
|
46
|
+
if (predicate(element, i++)) {
|
|
46
47
|
return true;
|
|
47
48
|
}
|
|
48
49
|
}
|
|
@@ -73,6 +74,13 @@ var Iterable;
|
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
Iterable.map = map;
|
|
77
|
+
function* flatMap(iterable, fn) {
|
|
78
|
+
let index = 0;
|
|
79
|
+
for (const element of iterable) {
|
|
80
|
+
yield* fn(element, index++);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
Iterable.flatMap = flatMap;
|
|
76
84
|
function* concat(...iterables) {
|
|
77
85
|
for (const iterable of iterables) {
|
|
78
86
|
yield* iterable;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { URI } from './uri.js';
|
|
2
|
+
|
|
3
|
+
interface ResourceMapKeyFn {
|
|
4
|
+
(resource: URI): string;
|
|
5
|
+
}
|
|
6
|
+
declare class ResourceMap<T> implements Map<URI, T> {
|
|
7
|
+
private static readonly defaultToKey;
|
|
8
|
+
readonly [Symbol.toStringTag] = "ResourceMap";
|
|
9
|
+
private readonly map;
|
|
10
|
+
private readonly toKey;
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @param toKey Custom uri identity function, e.g use an existing `IExtUri#getComparison`-util
|
|
14
|
+
*/
|
|
15
|
+
constructor(toKey?: ResourceMapKeyFn);
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @param other Another resource which this maps is created from
|
|
19
|
+
* @param toKey Custom uri identity function, e.g use an existing `IExtUri#getComparison`-util
|
|
20
|
+
*/
|
|
21
|
+
constructor(other?: ResourceMap<T>, toKey?: ResourceMapKeyFn);
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param other Another resource which this maps is created from
|
|
25
|
+
* @param toKey Custom uri identity function, e.g use an existing `IExtUri#getComparison`-util
|
|
26
|
+
*/
|
|
27
|
+
constructor(entries?: readonly (readonly [URI, T])[], toKey?: ResourceMapKeyFn);
|
|
28
|
+
set(resource: URI, value: T): this;
|
|
29
|
+
get(resource: URI): T | undefined;
|
|
30
|
+
has(resource: URI): boolean;
|
|
31
|
+
get size(): number;
|
|
32
|
+
clear(): void;
|
|
33
|
+
delete(resource: URI): boolean;
|
|
34
|
+
forEach(clb: (value: T, key: URI, map: Map<URI, T>) => void, thisArg?: any): void;
|
|
35
|
+
values(): IterableIterator<T>;
|
|
36
|
+
keys(): IterableIterator<URI>;
|
|
37
|
+
entries(): IterableIterator<[URI, T]>;
|
|
38
|
+
[Symbol.iterator](): IterableIterator<[URI, T]>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { ResourceMap };
|
|
@@ -52,4 +52,21 @@ class SlidingWindowAverage {
|
|
|
52
52
|
return this._val;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
function isPointWithinTriangle(x, y, ax, ay, bx, by, cx, cy) {
|
|
56
|
+
const v0x = cx - ax;
|
|
57
|
+
const v0y = cy - ay;
|
|
58
|
+
const v1x = bx - ax;
|
|
59
|
+
const v1y = by - ay;
|
|
60
|
+
const v2x = x - ax;
|
|
61
|
+
const v2y = y - ay;
|
|
62
|
+
const dot00 = v0x * v0x + v0y * v0y;
|
|
63
|
+
const dot01 = v0x * v1x + v0y * v1y;
|
|
64
|
+
const dot02 = v0x * v2x + v0y * v2y;
|
|
65
|
+
const dot11 = v1x * v1x + v1y * v1y;
|
|
66
|
+
const dot12 = v1x * v2x + v1y * v2y;
|
|
67
|
+
const invDenom = 1 / (dot00 * dot11 - dot01 * dot01);
|
|
68
|
+
const u = (dot11 * dot02 - dot01 * dot12) * invDenom;
|
|
69
|
+
const v = (dot00 * dot12 - dot01 * dot02) * invDenom;
|
|
70
|
+
return u >= 0 && v >= 0 && u + v < 1;
|
|
71
|
+
}
|
|
72
|
+
export { Counter, MovingAverage, SlidingWindowAverage, clamp, isPointWithinTriangle, rot };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { strictEquals } from '../equals.js';
|
|
2
|
+
import { ObservableValue } from './base.js';
|
|
3
|
+
import { DebugNameData } from './debugName.js';
|
|
4
|
+
import { LazyObservableValue } from './lazyObservableValue.js';
|
|
5
|
+
function observableValueOpts(options, initialValue) {
|
|
6
|
+
if (options.lazy) {
|
|
7
|
+
return ( new LazyObservableValue(( new DebugNameData(options.owner, options.debugName, undefined)), initialValue, options.equalsFn ?? strictEquals));
|
|
8
|
+
}
|
|
9
|
+
return ( new ObservableValue(( new DebugNameData(options.owner, options.debugName, undefined)), initialValue, options.equalsFn ?? strictEquals));
|
|
10
|
+
}
|
|
11
|
+
export { observableValueOpts };
|
|
@@ -10,6 +10,23 @@ function autorunOpts(options, fn) {
|
|
|
10
10
|
function autorunHandleChanges(options, fn) {
|
|
11
11
|
return ( new AutorunObserver(( new DebugNameData(options.owner, options.debugName, options.debugReferenceFn ?? fn)), fn, options.createEmptyChangeSummary, options.handleChange));
|
|
12
12
|
}
|
|
13
|
+
function autorunWithStoreHandleChanges(options, fn) {
|
|
14
|
+
const store = ( new DisposableStore());
|
|
15
|
+
const disposable = autorunHandleChanges({
|
|
16
|
+
owner: options.owner,
|
|
17
|
+
debugName: options.debugName,
|
|
18
|
+
debugReferenceFn: options.debugReferenceFn ?? fn,
|
|
19
|
+
createEmptyChangeSummary: options.createEmptyChangeSummary,
|
|
20
|
+
handleChange: options.handleChange,
|
|
21
|
+
}, (reader, changeSummary) => {
|
|
22
|
+
store.clear();
|
|
23
|
+
fn(reader, changeSummary, store);
|
|
24
|
+
});
|
|
25
|
+
return toDisposable(() => {
|
|
26
|
+
disposable.dispose();
|
|
27
|
+
store.dispose();
|
|
28
|
+
});
|
|
29
|
+
}
|
|
13
30
|
function autorunWithStore(fn) {
|
|
14
31
|
const store = ( new DisposableStore());
|
|
15
32
|
const disposable = autorunOpts({
|
|
@@ -138,4 +155,4 @@ class AutorunObserver {
|
|
|
138
155
|
( (function(autorun) {
|
|
139
156
|
autorun.Observer = AutorunObserver;
|
|
140
157
|
})(autorun || (autorun = {})));
|
|
141
|
-
export { AutorunObserver, autorun, autorunHandleChanges, autorunOpts, autorunWithStore };
|
|
158
|
+
export { AutorunObserver, autorun, autorunHandleChanges, autorunOpts, autorunWithStore, autorunWithStoreHandleChanges };
|
|
@@ -114,5 +114,12 @@ interface IObserver {
|
|
|
114
114
|
*/
|
|
115
115
|
handleChange<T, TChange>(observable: IObservable<T, TChange>, change: TChange): void;
|
|
116
116
|
}
|
|
117
|
+
interface ITransaction {
|
|
118
|
+
/**
|
|
119
|
+
* Calls {@link Observer.beginUpdate} immediately
|
|
120
|
+
* and {@link Observer.endUpdate} when the transaction ends.
|
|
121
|
+
*/
|
|
122
|
+
updateObserver(observer: IObserver, observable: IObservable<any, any>): void;
|
|
123
|
+
}
|
|
117
124
|
|
|
118
|
-
export type { IObservable, IObserver, IReader };
|
|
125
|
+
export type { IObservable, IObserver, IReader, ITransaction };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { strictEquals } from '../equals.js';
|
|
2
|
-
import {
|
|
2
|
+
import { getFunctionName, DebugNameData } from './debugName.js';
|
|
3
3
|
let _recomputeInitiallyAndOnChange;
|
|
4
4
|
function _setRecomputeInitiallyAndOnChange(recomputeInitiallyAndOnChange) {
|
|
5
5
|
_recomputeInitiallyAndOnChange = recomputeInitiallyAndOnChange;
|
|
@@ -159,9 +159,6 @@ function observableValue(nameOrOwner, initialValue) {
|
|
|
159
159
|
}
|
|
160
160
|
return ( new ObservableValue(debugNameData, initialValue, strictEquals));
|
|
161
161
|
}
|
|
162
|
-
function observableValueOpts(options, initialValue) {
|
|
163
|
-
return ( new ObservableValue(( new DebugNameData(options.owner, options.debugName, undefined)), initialValue, options.equalsFn ?? strictEquals));
|
|
164
|
-
}
|
|
165
162
|
class ObservableValue extends BaseObservable {
|
|
166
163
|
get debugName() {
|
|
167
164
|
return this._debugNameData.getDebugName(this) ?? 'ObservableValue';
|
|
@@ -227,4 +224,4 @@ class DisposableObservableValue extends ObservableValue {
|
|
|
227
224
|
this._value?.dispose();
|
|
228
225
|
}
|
|
229
226
|
}
|
|
230
|
-
export { BaseObservable, ConvenientObservable, DisposableObservableValue, ObservableValue, TransactionImpl, _setDerivedOpts, _setKeepObserved, _setRecomputeInitiallyAndOnChange, asyncTransaction, disposableObservableValue, globalTransaction, observableValue,
|
|
227
|
+
export { BaseObservable, ConvenientObservable, DisposableObservableValue, ObservableValue, TransactionImpl, _setDerivedOpts, _setKeepObserved, _setRecomputeInitiallyAndOnChange, asyncTransaction, disposableObservableValue, globalTransaction, observableValue, subtransaction, transaction };
|
|
@@ -47,15 +47,25 @@ function derivedDisposable(computeFnOrOwner, computeFnOrUndefined) {
|
|
|
47
47
|
owner = computeFnOrOwner;
|
|
48
48
|
computeFn = computeFnOrUndefined;
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
let store = undefined;
|
|
51
51
|
return ( new Derived(( new DebugNameData(owner, undefined, computeFn)), r => {
|
|
52
|
-
store
|
|
52
|
+
if (!store) {
|
|
53
|
+
store = ( new DisposableStore());
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
store.clear();
|
|
57
|
+
}
|
|
53
58
|
const result = computeFn(r);
|
|
54
59
|
if (result) {
|
|
55
60
|
store.add(result);
|
|
56
61
|
}
|
|
57
62
|
return result;
|
|
58
|
-
}, undefined, undefined, () =>
|
|
63
|
+
}, undefined, undefined, () => {
|
|
64
|
+
if (store) {
|
|
65
|
+
store.dispose();
|
|
66
|
+
store = undefined;
|
|
67
|
+
}
|
|
68
|
+
}, strictEquals));
|
|
59
69
|
}
|
|
60
70
|
var DerivedState;
|
|
61
71
|
( (function(DerivedState) {
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { BaseObservable, TransactionImpl } from './base.js';
|
|
2
|
+
class LazyObservableValue extends BaseObservable {
|
|
3
|
+
get debugName() {
|
|
4
|
+
return this._debugNameData.getDebugName(this) ?? 'LazyObservableValue';
|
|
5
|
+
}
|
|
6
|
+
constructor(_debugNameData, initialValue, _equalityComparator) {
|
|
7
|
+
super();
|
|
8
|
+
this._debugNameData = _debugNameData;
|
|
9
|
+
this._equalityComparator = _equalityComparator;
|
|
10
|
+
this._isUpToDate = true;
|
|
11
|
+
this._deltas = [];
|
|
12
|
+
this._updateCounter = 0;
|
|
13
|
+
this._value = initialValue;
|
|
14
|
+
}
|
|
15
|
+
get() {
|
|
16
|
+
this._update();
|
|
17
|
+
return this._value;
|
|
18
|
+
}
|
|
19
|
+
_update() {
|
|
20
|
+
if (this._isUpToDate) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
this._isUpToDate = true;
|
|
24
|
+
if (this._deltas.length > 0) {
|
|
25
|
+
for (const observer of this.observers) {
|
|
26
|
+
for (const change of this._deltas) {
|
|
27
|
+
observer.handleChange(this, change);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
this._deltas.length = 0;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
for (const observer of this.observers) {
|
|
34
|
+
observer.handleChange(this, undefined);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
_beginUpdate() {
|
|
39
|
+
this._updateCounter++;
|
|
40
|
+
if (this._updateCounter === 1) {
|
|
41
|
+
for (const observer of this.observers) {
|
|
42
|
+
observer.beginUpdate(this);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
_endUpdate() {
|
|
47
|
+
this._updateCounter--;
|
|
48
|
+
if (this._updateCounter === 0) {
|
|
49
|
+
this._update();
|
|
50
|
+
const observers = [...this.observers];
|
|
51
|
+
for (const r of observers) {
|
|
52
|
+
r.endUpdate(this);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
addObserver(observer) {
|
|
57
|
+
const shouldCallBeginUpdate = !( this.observers.has(observer)) && this._updateCounter > 0;
|
|
58
|
+
super.addObserver(observer);
|
|
59
|
+
if (shouldCallBeginUpdate) {
|
|
60
|
+
observer.beginUpdate(this);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
removeObserver(observer) {
|
|
64
|
+
const shouldCallEndUpdate = ( this.observers.has(observer)) && this._updateCounter > 0;
|
|
65
|
+
super.removeObserver(observer);
|
|
66
|
+
if (shouldCallEndUpdate) {
|
|
67
|
+
observer.endUpdate(this);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
set(value, tx, change) {
|
|
71
|
+
if (change === undefined && this._equalityComparator(this._value, value)) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
let _tx;
|
|
75
|
+
if (!tx) {
|
|
76
|
+
tx = _tx = ( new TransactionImpl(() => { }, () => `Setting ${this.debugName}`));
|
|
77
|
+
}
|
|
78
|
+
try {
|
|
79
|
+
this._isUpToDate = false;
|
|
80
|
+
this._setValue(value);
|
|
81
|
+
if (change !== undefined) {
|
|
82
|
+
this._deltas.push(change);
|
|
83
|
+
}
|
|
84
|
+
tx.updateObserver({
|
|
85
|
+
beginUpdate: () => this._beginUpdate(),
|
|
86
|
+
endUpdate: () => this._endUpdate(),
|
|
87
|
+
handleChange: (observable, change) => { },
|
|
88
|
+
handlePossibleChange: (observable) => { },
|
|
89
|
+
}, this);
|
|
90
|
+
if (this._updateCounter > 1) {
|
|
91
|
+
for (const observer of this.observers) {
|
|
92
|
+
observer.handlePossibleChange(this);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
finally {
|
|
97
|
+
if (_tx) {
|
|
98
|
+
_tx.finish();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
toString() {
|
|
103
|
+
return `${this.debugName}: ${this._value}`;
|
|
104
|
+
}
|
|
105
|
+
_setValue(newValue) {
|
|
106
|
+
this._value = newValue;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
export { LazyObservableValue };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Event } from '../event.js';
|
|
2
2
|
import { toDisposable, DisposableStore } from '../lifecycle.js';
|
|
3
|
-
import './autorun.js';
|
|
3
|
+
import { autorunOpts } from './autorun.js';
|
|
4
4
|
import { ConvenientObservable, BaseObservable, subtransaction, transaction, _setKeepObserved, _setRecomputeInitiallyAndOnChange, observableValue } from './base.js';
|
|
5
|
-
import {
|
|
5
|
+
import { DebugNameData, getDebugName } from './debugName.js';
|
|
6
6
|
import { derivedOpts, derived } from './derived.js';
|
|
7
|
+
import { BugIndicatingError } from '../errors.js';
|
|
8
|
+
import { strictEquals } from '../equals.js';
|
|
7
9
|
function constObservable(value) {
|
|
8
10
|
return ( new ConstObservable(value));
|
|
9
11
|
}
|
|
@@ -33,23 +35,38 @@ function observableFromPromise(promise) {
|
|
|
33
35
|
});
|
|
34
36
|
return observable;
|
|
35
37
|
}
|
|
36
|
-
function observableFromEvent(
|
|
37
|
-
|
|
38
|
+
function observableFromEvent(...args) {
|
|
39
|
+
let owner;
|
|
40
|
+
let event;
|
|
41
|
+
let getValue;
|
|
42
|
+
if (args.length === 3) {
|
|
43
|
+
[owner, event, getValue] = args;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
[event, getValue] = args;
|
|
47
|
+
}
|
|
48
|
+
return ( new FromEventObservable(( new DebugNameData(owner, undefined, getValue)), event, getValue, () => FromEventObservable.globalTransaction, strictEquals));
|
|
49
|
+
}
|
|
50
|
+
function observableFromEventOpts(options, event, getValue) {
|
|
51
|
+
return ( new FromEventObservable(( new DebugNameData(options.owner, options.debugName, options.debugReferenceFn ?? getValue)), event, getValue, () => FromEventObservable.globalTransaction, options.equalsFn ?? strictEquals));
|
|
38
52
|
}
|
|
39
53
|
class FromEventObservable extends BaseObservable {
|
|
40
|
-
constructor(event, _getValue) {
|
|
54
|
+
constructor(_debugNameData, event, _getValue, _getTransaction, _equalityComparator) {
|
|
41
55
|
super();
|
|
56
|
+
this._debugNameData = _debugNameData;
|
|
42
57
|
this.event = event;
|
|
43
58
|
this._getValue = _getValue;
|
|
59
|
+
this._getTransaction = _getTransaction;
|
|
60
|
+
this._equalityComparator = _equalityComparator;
|
|
44
61
|
this.hasValue = false;
|
|
45
62
|
this.handleEvent = (args) => {
|
|
46
63
|
const newValue = this._getValue(args);
|
|
47
64
|
const oldValue = this.value;
|
|
48
|
-
const didChange = !this.hasValue || oldValue
|
|
65
|
+
const didChange = !this.hasValue || !(this._equalityComparator(oldValue, newValue));
|
|
49
66
|
if (didChange) {
|
|
50
67
|
this.value = newValue;
|
|
51
68
|
if (this.hasValue) {
|
|
52
|
-
subtransaction(
|
|
69
|
+
subtransaction(this._getTransaction(), (tx) => {
|
|
53
70
|
for (const o of this.observers) {
|
|
54
71
|
tx.updateObserver(o, this);
|
|
55
72
|
o.handleChange(this, undefined);
|
|
@@ -64,7 +81,7 @@ class FromEventObservable extends BaseObservable {
|
|
|
64
81
|
};
|
|
65
82
|
}
|
|
66
83
|
getDebugName() {
|
|
67
|
-
return
|
|
84
|
+
return this._debugNameData.getDebugName(this);
|
|
68
85
|
}
|
|
69
86
|
get debugName() {
|
|
70
87
|
const name = this.getDebugName();
|
|
@@ -150,6 +167,9 @@ class ObservableSignal extends BaseObservable {
|
|
|
150
167
|
get debugName() {
|
|
151
168
|
return ( new DebugNameData(this._owner, this._debugName, undefined)).getDebugName(this) ?? 'Observable Signal';
|
|
152
169
|
}
|
|
170
|
+
toString() {
|
|
171
|
+
return this.debugName;
|
|
172
|
+
}
|
|
153
173
|
constructor(_debugName, _owner) {
|
|
154
174
|
super();
|
|
155
175
|
this._debugName = _debugName;
|
|
@@ -233,7 +253,7 @@ class KeepAliveObserver {
|
|
|
233
253
|
}
|
|
234
254
|
function derivedObservableWithCache(owner, computeFn) {
|
|
235
255
|
let lastValue = undefined;
|
|
236
|
-
const observable =
|
|
256
|
+
const observable = derivedOpts({ owner, debugReferenceFn: computeFn }, reader => {
|
|
237
257
|
lastValue = computeFn(reader, lastValue);
|
|
238
258
|
return lastValue;
|
|
239
259
|
});
|
|
@@ -323,10 +343,42 @@ class ValueWithChangeEventFromObservable {
|
|
|
323
343
|
return this.observable.get();
|
|
324
344
|
}
|
|
325
345
|
}
|
|
326
|
-
function observableFromValueWithChangeEvent(
|
|
346
|
+
function observableFromValueWithChangeEvent(owner, value) {
|
|
327
347
|
if (value instanceof ValueWithChangeEventFromObservable) {
|
|
328
348
|
return value.observable;
|
|
329
349
|
}
|
|
330
|
-
return observableFromEvent(value.onDidChange, () => value.value);
|
|
350
|
+
return observableFromEvent(owner, value.onDidChange, () => value.value);
|
|
351
|
+
}
|
|
352
|
+
function latestChangedValue(owner, observables) {
|
|
353
|
+
if (observables.length === 0) {
|
|
354
|
+
throw ( new BugIndicatingError());
|
|
355
|
+
}
|
|
356
|
+
let hasLastChangedValue = false;
|
|
357
|
+
let lastChangedValue = undefined;
|
|
358
|
+
const result = observableFromEvent(owner, cb => {
|
|
359
|
+
const store = ( new DisposableStore());
|
|
360
|
+
for (const o of observables) {
|
|
361
|
+
store.add(autorunOpts({ debugName: () => getDebugName(result, ( new DebugNameData(owner, undefined, undefined))) + '.updateLastChangedValue' }, reader => {
|
|
362
|
+
hasLastChangedValue = true;
|
|
363
|
+
lastChangedValue = o.read(reader);
|
|
364
|
+
cb();
|
|
365
|
+
}));
|
|
366
|
+
}
|
|
367
|
+
store.add({
|
|
368
|
+
dispose() {
|
|
369
|
+
hasLastChangedValue = false;
|
|
370
|
+
lastChangedValue = undefined;
|
|
371
|
+
},
|
|
372
|
+
});
|
|
373
|
+
return store;
|
|
374
|
+
}, () => {
|
|
375
|
+
if (hasLastChangedValue) {
|
|
376
|
+
return lastChangedValue;
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
return observables[observables.length - 1].get();
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
return result;
|
|
331
383
|
}
|
|
332
|
-
export { FromEventObservable, KeepAliveObserver, ValueWithChangeEventFromObservable, constObservable, derivedObservableWithCache, derivedObservableWithWritableCache, keepObserved, mapObservableArrayCached, observableFromEvent, observableFromPromise, observableFromValueWithChangeEvent, observableSignal, observableSignalFromEvent, recomputeInitiallyAndOnChange, wasEventTriggeredRecently };
|
|
384
|
+
export { FromEventObservable, KeepAliveObserver, ValueWithChangeEventFromObservable, constObservable, derivedObservableWithCache, derivedObservableWithWritableCache, keepObserved, latestChangedValue, mapObservableArrayCached, observableFromEvent, observableFromEventOpts, observableFromPromise, observableFromValueWithChangeEvent, observableSignal, observableSignalFromEvent, recomputeInitiallyAndOnChange, wasEventTriggeredRecently };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
declare const unset: unique symbol;
|
|
2
|
+
interface IPrefixTreeNode<T> {
|
|
3
|
+
/** Possible children of the node. */
|
|
4
|
+
children?: ReadonlyMap<string, Node<T>>;
|
|
5
|
+
/** The value if data exists for this node in the tree. Mutable. */
|
|
6
|
+
value: T | undefined;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A simple prefix tree implementation where a value is stored based on
|
|
10
|
+
* well-defined prefix segments.
|
|
11
|
+
*/
|
|
12
|
+
declare class WellDefinedPrefixTree<V> {
|
|
13
|
+
private readonly root;
|
|
14
|
+
private _size;
|
|
15
|
+
get size(): number;
|
|
16
|
+
/** Gets the top-level nodes of the tree */
|
|
17
|
+
get nodes(): Iterable<IPrefixTreeNode<V>>;
|
|
18
|
+
/**
|
|
19
|
+
* Inserts a new value in the prefix tree.
|
|
20
|
+
* @param onNode - called for each node as we descend to the insertion point,
|
|
21
|
+
* including the insertion point itself.
|
|
22
|
+
*/
|
|
23
|
+
insert(key: Iterable<string>, value: V, onNode?: (n: IPrefixTreeNode<V>) => void): void;
|
|
24
|
+
/** Mutates a value in the prefix tree. */
|
|
25
|
+
mutate(key: Iterable<string>, mutate: (value?: V) => V): void;
|
|
26
|
+
/** Mutates nodes along the path in the prefix tree. */
|
|
27
|
+
mutatePath(key: Iterable<string>, mutate: (node: IPrefixTreeNode<V>) => void): void;
|
|
28
|
+
/** Deletes a node from the prefix tree, returning the value it contained. */
|
|
29
|
+
delete(key: Iterable<string>): V | undefined;
|
|
30
|
+
/** Deletes a subtree from the prefix tree, returning the values they contained. */
|
|
31
|
+
deleteRecursive(key: Iterable<string>): Iterable<V>;
|
|
32
|
+
/** Gets a value from the tree. */
|
|
33
|
+
find(key: Iterable<string>): V | undefined;
|
|
34
|
+
/** Gets whether the tree has the key, or a parent of the key, already inserted. */
|
|
35
|
+
hasKeyOrParent(key: Iterable<string>): boolean;
|
|
36
|
+
/** Gets whether the tree has the given key or any children. */
|
|
37
|
+
hasKeyOrChildren(key: Iterable<string>): boolean;
|
|
38
|
+
/** Gets whether the tree has the given key. */
|
|
39
|
+
hasKey(key: Iterable<string>): boolean;
|
|
40
|
+
private getPathToKey;
|
|
41
|
+
private opNode;
|
|
42
|
+
/** Returns an iterable of the tree values in no defined order. */
|
|
43
|
+
values(): Generator<V, void, unknown>;
|
|
44
|
+
}
|
|
45
|
+
declare class Node<T> implements IPrefixTreeNode<T> {
|
|
46
|
+
children?: Map<string, Node<T>>;
|
|
47
|
+
get value(): T | undefined;
|
|
48
|
+
set value(value: T | undefined);
|
|
49
|
+
_value: T | typeof unset;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { type IPrefixTreeNode, WellDefinedPrefixTree };
|