@codingame/monaco-vscode-api 6.0.3 → 7.0.1
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 +150 -117
- package/api.js +1 -1
- package/debugProtocol.d.ts +10 -1
- package/extensions.d.ts +2 -0
- package/missing-services.js +21 -2
- 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/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
|
@@ -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 };
|
|
@@ -166,6 +166,7 @@ interface IProductConfiguration {
|
|
|
166
166
|
readonly extensionSyncedKeys?: {
|
|
167
167
|
readonly [extensionId: string]: string[];
|
|
168
168
|
};
|
|
169
|
+
readonly extensionsEnabledWithApiProposalVersion?: string[];
|
|
169
170
|
readonly extensionEnabledApiProposals?: {
|
|
170
171
|
readonly [extensionId: string]: string[];
|
|
171
172
|
};
|
|
@@ -283,7 +283,7 @@ class ChannelServer {
|
|
|
283
283
|
id, data: {
|
|
284
284
|
message: err.message,
|
|
285
285
|
name: err.name,
|
|
286
|
-
stack: err.stack ?
|
|
286
|
+
stack: err.stack ? err.stack.split('\n') : undefined
|
|
287
287
|
}, type: ResponseType.PromiseError
|
|
288
288
|
});
|
|
289
289
|
}
|
|
@@ -26,7 +26,7 @@ class DomCharWidthReader {
|
|
|
26
26
|
this._createDomElements();
|
|
27
27
|
targetWindow.document.body.appendChild(this._container);
|
|
28
28
|
this._readFromDomElements();
|
|
29
|
-
|
|
29
|
+
this._container?.remove();
|
|
30
30
|
this._container = null;
|
|
31
31
|
this._testElements = null;
|
|
32
32
|
}
|
|
@@ -720,7 +720,7 @@ function measureText(targetDocument, text, fontInfo, tabSize) {
|
|
|
720
720
|
container.appendChild(regularDomNode);
|
|
721
721
|
targetDocument.body.appendChild(container);
|
|
722
722
|
const res = regularDomNode.offsetWidth;
|
|
723
|
-
|
|
723
|
+
container.remove();
|
|
724
724
|
return res;
|
|
725
725
|
}
|
|
726
726
|
export { TextAreaHandler };
|
|
@@ -20,6 +20,7 @@ import { ContextKeyExpr } from '../../platform/contextkey/common/contextkey.js';
|
|
|
20
20
|
import { KeybindingsRegistry, KeybindingWeight } from '../../platform/keybinding/common/keybindingsRegistry.js';
|
|
21
21
|
import { EditorOption } from '../common/config/editorOptions.js';
|
|
22
22
|
import { getActiveElement } from '../../base/browser/dom.js';
|
|
23
|
+
import { EnterOperation } from '../common/cursor/cursorTypeEditOperations.js';
|
|
23
24
|
const _moduleId = "vs/editor/browser/coreCommands";
|
|
24
25
|
const CORE_WEIGHT = KeybindingWeight.EditorCore;
|
|
25
26
|
class CoreEditorCommand extends EditorCommand {
|
|
@@ -1561,7 +1562,7 @@ var CoreEditingCommands;
|
|
|
1561
1562
|
}
|
|
1562
1563
|
runCoreEditingCommand(editor, viewModel, args) {
|
|
1563
1564
|
editor.pushUndoStop();
|
|
1564
|
-
editor.executeCommands(this.id,
|
|
1565
|
+
editor.executeCommands(this.id, EnterOperation.lineBreakInsert(viewModel.cursorConfig, viewModel.model, ( (viewModel.getCursorStates().map(s => s.modelState.selection)))));
|
|
1565
1566
|
}
|
|
1566
1567
|
}));
|
|
1567
1568
|
CoreEditingCommands.Outdent = registerEditorCommand(new (class extends CoreEditingCommand {
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { equalsIfDefined, itemsEquals } from '../../base/common/equals.js';
|
|
2
|
+
import { Disposable, toDisposable, DisposableStore } from '../../base/common/lifecycle.js';
|
|
3
|
+
import { TransactionImpl, observableValue } from '../../base/common/observableInternal/base.js';
|
|
4
|
+
import { derivedOpts, derivedWithSetter, derived } from '../../base/common/observableInternal/derived.js';
|
|
5
|
+
import { autorunOpts, autorun, autorunWithStoreHandleChanges } from '../../base/common/observableInternal/autorun.js';
|
|
6
|
+
import { observableFromEvent, observableSignal } from '../../base/common/observableInternal/utils.js';
|
|
7
|
+
import '../../base/common/cancellation.js';
|
|
8
|
+
import { observableValueOpts } from '../../base/common/observableInternal/api.js';
|
|
9
|
+
import { EditorOption } from '../common/config/editorOptions.js';
|
|
10
|
+
import { Position } from '../common/core/position.js';
|
|
11
|
+
import { Selection } from '../common/core/selection.js';
|
|
12
|
+
function observableCodeEditor(editor) {
|
|
13
|
+
return ObservableCodeEditor.get(editor);
|
|
14
|
+
}
|
|
15
|
+
class ObservableCodeEditor extends Disposable {
|
|
16
|
+
static { this._map = ( new Map()); }
|
|
17
|
+
static get(editor) {
|
|
18
|
+
let result = ObservableCodeEditor._map.get(editor);
|
|
19
|
+
if (!result) {
|
|
20
|
+
result = ( new ObservableCodeEditor(editor));
|
|
21
|
+
ObservableCodeEditor._map.set(editor, result);
|
|
22
|
+
const d = editor.onDidDispose(() => {
|
|
23
|
+
const item = ObservableCodeEditor._map.get(editor);
|
|
24
|
+
if (item) {
|
|
25
|
+
ObservableCodeEditor._map.delete(editor);
|
|
26
|
+
item.dispose();
|
|
27
|
+
d.dispose();
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
_beginUpdate() {
|
|
34
|
+
this._updateCounter++;
|
|
35
|
+
if (this._updateCounter === 1) {
|
|
36
|
+
this._currentTransaction = ( new TransactionImpl(() => {
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
_endUpdate() {
|
|
41
|
+
this._updateCounter--;
|
|
42
|
+
if (this._updateCounter === 0) {
|
|
43
|
+
const t = this._currentTransaction;
|
|
44
|
+
this._currentTransaction = undefined;
|
|
45
|
+
t.finish();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
constructor(editor) {
|
|
49
|
+
super();
|
|
50
|
+
this.editor = editor;
|
|
51
|
+
this._updateCounter = 0;
|
|
52
|
+
this._currentTransaction = undefined;
|
|
53
|
+
this._model = observableValue(this, this.editor.getModel());
|
|
54
|
+
this.model = this._model;
|
|
55
|
+
this.isReadonly = observableFromEvent(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.readOnly));
|
|
56
|
+
this._versionId = observableValueOpts({ owner: this, lazy: true }, this.editor.getModel()?.getVersionId() ?? null);
|
|
57
|
+
this.versionId = this._versionId;
|
|
58
|
+
this._selections = observableValueOpts({ owner: this, equalsFn: equalsIfDefined(itemsEquals(Selection.selectionsEqual)), lazy: true }, this.editor.getSelections() ?? null);
|
|
59
|
+
this.selections = this._selections;
|
|
60
|
+
this.positions = derivedOpts({ owner: this, equalsFn: equalsIfDefined(itemsEquals(Position.equals)) }, reader => this.selections.read(reader)?.map(s => s.getStartPosition()) ?? null);
|
|
61
|
+
this.isFocused = observableFromEvent(this, e => {
|
|
62
|
+
const d1 = this.editor.onDidFocusEditorWidget(e);
|
|
63
|
+
const d2 = this.editor.onDidBlurEditorWidget(e);
|
|
64
|
+
return {
|
|
65
|
+
dispose() {
|
|
66
|
+
d1.dispose();
|
|
67
|
+
d2.dispose();
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}, () => this.editor.hasWidgetFocus());
|
|
71
|
+
this.value = derivedWithSetter(this, reader => { this.versionId.read(reader); return this.model.read(reader)?.getValue() ?? ''; }, (value, tx) => {
|
|
72
|
+
const model = this.model.get();
|
|
73
|
+
if (model !== null) {
|
|
74
|
+
if (value !== model.getValue()) {
|
|
75
|
+
model.setValue(value);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
this.valueIsEmpty = derived(this, reader => { this.versionId.read(reader); return this.editor.getModel()?.getValueLength() === 0; });
|
|
80
|
+
this.cursorSelection = derivedOpts({ owner: this, equalsFn: equalsIfDefined(Selection.selectionsEqual) }, reader => this.selections.read(reader)?.[0] ?? null);
|
|
81
|
+
this.cursorPosition = derivedOpts({ owner: this, equalsFn: Position.equals }, reader => this.selections.read(reader)?.[0]?.getPosition() ?? null);
|
|
82
|
+
this.onDidType = observableSignal(this);
|
|
83
|
+
this.scrollTop = observableFromEvent(this.editor.onDidScrollChange, () => this.editor.getScrollTop());
|
|
84
|
+
this.scrollLeft = observableFromEvent(this.editor.onDidScrollChange, () => this.editor.getScrollLeft());
|
|
85
|
+
this.layoutInfo = observableFromEvent(this.editor.onDidLayoutChange, () => this.editor.getLayoutInfo());
|
|
86
|
+
this.contentWidth = observableFromEvent(this.editor.onDidContentSizeChange, () => this.editor.getContentWidth());
|
|
87
|
+
this._overlayWidgetCounter = 0;
|
|
88
|
+
this._register(this.editor.onBeginUpdate(() => this._beginUpdate()));
|
|
89
|
+
this._register(this.editor.onEndUpdate(() => this._endUpdate()));
|
|
90
|
+
this._register(this.editor.onDidChangeModel(() => {
|
|
91
|
+
this._beginUpdate();
|
|
92
|
+
try {
|
|
93
|
+
this._model.set(this.editor.getModel(), this._currentTransaction);
|
|
94
|
+
this._forceUpdate();
|
|
95
|
+
}
|
|
96
|
+
finally {
|
|
97
|
+
this._endUpdate();
|
|
98
|
+
}
|
|
99
|
+
}));
|
|
100
|
+
this._register(this.editor.onDidType((e) => {
|
|
101
|
+
this._beginUpdate();
|
|
102
|
+
try {
|
|
103
|
+
this._forceUpdate();
|
|
104
|
+
this.onDidType.trigger(this._currentTransaction, e);
|
|
105
|
+
}
|
|
106
|
+
finally {
|
|
107
|
+
this._endUpdate();
|
|
108
|
+
}
|
|
109
|
+
}));
|
|
110
|
+
this._register(this.editor.onDidChangeModelContent(e => {
|
|
111
|
+
this._beginUpdate();
|
|
112
|
+
try {
|
|
113
|
+
this._versionId.set(this.editor.getModel()?.getVersionId() ?? null, this._currentTransaction, e);
|
|
114
|
+
this._forceUpdate();
|
|
115
|
+
}
|
|
116
|
+
finally {
|
|
117
|
+
this._endUpdate();
|
|
118
|
+
}
|
|
119
|
+
}));
|
|
120
|
+
this._register(this.editor.onDidChangeCursorSelection(e => {
|
|
121
|
+
this._beginUpdate();
|
|
122
|
+
try {
|
|
123
|
+
this._selections.set(this.editor.getSelections(), this._currentTransaction, e);
|
|
124
|
+
this._forceUpdate();
|
|
125
|
+
}
|
|
126
|
+
finally {
|
|
127
|
+
this._endUpdate();
|
|
128
|
+
}
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
forceUpdate(cb) {
|
|
132
|
+
this._beginUpdate();
|
|
133
|
+
try {
|
|
134
|
+
this._forceUpdate();
|
|
135
|
+
if (!cb) {
|
|
136
|
+
return undefined;
|
|
137
|
+
}
|
|
138
|
+
return cb(this._currentTransaction);
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
this._endUpdate();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
_forceUpdate() {
|
|
145
|
+
this._beginUpdate();
|
|
146
|
+
try {
|
|
147
|
+
this._model.set(this.editor.getModel(), this._currentTransaction);
|
|
148
|
+
this._versionId.set(this.editor.getModel()?.getVersionId() ?? null, this._currentTransaction, undefined);
|
|
149
|
+
this._selections.set(this.editor.getSelections(), this._currentTransaction, undefined);
|
|
150
|
+
}
|
|
151
|
+
finally {
|
|
152
|
+
this._endUpdate();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
getOption(id) {
|
|
156
|
+
return observableFromEvent(this, cb => this.editor.onDidChangeConfiguration(e => {
|
|
157
|
+
if (e.hasChanged(id)) {
|
|
158
|
+
cb(undefined);
|
|
159
|
+
}
|
|
160
|
+
}), () => this.editor.getOption(id));
|
|
161
|
+
}
|
|
162
|
+
setDecorations(decorations) {
|
|
163
|
+
const d = ( new DisposableStore());
|
|
164
|
+
const decorationsCollection = this.editor.createDecorationsCollection();
|
|
165
|
+
d.add(autorunOpts({ owner: this, debugName: () => `Apply decorations from ${decorations.debugName}` }, reader => {
|
|
166
|
+
const d = decorations.read(reader);
|
|
167
|
+
decorationsCollection.set(d);
|
|
168
|
+
}));
|
|
169
|
+
d.add({
|
|
170
|
+
dispose: () => {
|
|
171
|
+
decorationsCollection.clear();
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
return d;
|
|
175
|
+
}
|
|
176
|
+
createOverlayWidget(widget) {
|
|
177
|
+
const overlayWidgetId = 'observableOverlayWidget' + (this._overlayWidgetCounter++);
|
|
178
|
+
const w = {
|
|
179
|
+
getDomNode: () => widget.domNode,
|
|
180
|
+
getPosition: () => widget.position.get(),
|
|
181
|
+
getId: () => overlayWidgetId,
|
|
182
|
+
allowEditorOverflow: widget.allowEditorOverflow,
|
|
183
|
+
getMinContentWidthInPx: () => widget.minContentWidthInPx.get(),
|
|
184
|
+
};
|
|
185
|
+
this.editor.addOverlayWidget(w);
|
|
186
|
+
const d = autorun(reader => {
|
|
187
|
+
widget.position.read(reader);
|
|
188
|
+
widget.minContentWidthInPx.read(reader);
|
|
189
|
+
this.editor.layoutOverlayWidget(w);
|
|
190
|
+
});
|
|
191
|
+
return toDisposable(() => {
|
|
192
|
+
d.dispose();
|
|
193
|
+
this.editor.removeOverlayWidget(w);
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
function reactToChange(observable, cb) {
|
|
198
|
+
return autorunWithStoreHandleChanges({
|
|
199
|
+
createEmptyChangeSummary: () => ({ deltas: [], didChange: false }),
|
|
200
|
+
handleChange: (context, changeSummary) => {
|
|
201
|
+
if (context.didChange(observable)) {
|
|
202
|
+
const e = context.change;
|
|
203
|
+
if (e !== undefined) {
|
|
204
|
+
changeSummary.deltas.push(e);
|
|
205
|
+
}
|
|
206
|
+
changeSummary.didChange = true;
|
|
207
|
+
}
|
|
208
|
+
return true;
|
|
209
|
+
},
|
|
210
|
+
}, (reader, changeSummary) => {
|
|
211
|
+
const value = observable.read(reader);
|
|
212
|
+
if (changeSummary.didChange) {
|
|
213
|
+
cb(value, changeSummary.deltas);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
function reactToChangeWithStore(observable, cb) {
|
|
218
|
+
const store = ( new DisposableStore());
|
|
219
|
+
const disposable = reactToChange(observable, (value, deltas) => {
|
|
220
|
+
store.clear();
|
|
221
|
+
cb(value, deltas, store);
|
|
222
|
+
});
|
|
223
|
+
return {
|
|
224
|
+
dispose() {
|
|
225
|
+
disposable.dispose();
|
|
226
|
+
store.dispose();
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
export { ObservableCodeEditor, observableCodeEditor, reactToChange, reactToChangeWithStore };
|
|
@@ -263,7 +263,7 @@ class RefCountedStyleSheet {
|
|
|
263
263
|
unref() {
|
|
264
264
|
this._refCount--;
|
|
265
265
|
if (this._refCount === 0) {
|
|
266
|
-
this._styleSheet.
|
|
266
|
+
this._styleSheet.remove();
|
|
267
267
|
this._parent._removeEditorStyleSheets(this._editorId);
|
|
268
268
|
}
|
|
269
269
|
}
|