@codingame/monaco-vscode-api 2.0.3-improve-modularity.1 → 2.1.0-update-vscode-1.86.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/api.js +15 -12
- package/extensions.d.ts +4 -7
- package/external/@xterm/xterm/typings/xterm.d.ts +22 -0
- package/missing-services.js +62 -6
- package/package.json +8 -8
- package/service-override/tools/editor.js +14 -0
- package/services.d.ts +3 -2
- package/services.js +6 -4
- package/vscode/src/vs/base/browser/browser.js +45 -30
- package/vscode/src/vs/base/browser/canIUse.js +1 -1
- package/vscode/src/vs/base/browser/defaultWorkerFactory.js +12 -5
- package/vscode/src/vs/base/browser/dom.js +104 -14
- package/vscode/src/vs/base/browser/indexedDB.js +3 -3
- package/vscode/src/vs/base/browser/markdownRenderer.js +29 -1
- package/vscode/src/vs/base/browser/mouseEvent.js +17 -3
- package/vscode/src/vs/base/browser/ui/actionbar/actionbar.js +3 -3
- package/vscode/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.css.js +4 -0
- package/vscode/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.js +287 -0
- package/vscode/src/vs/base/browser/ui/button/button.js +9 -0
- package/vscode/src/vs/base/browser/ui/codicons/codicon/codicon.css.js +1 -1
- package/vscode/src/vs/base/browser/ui/dialog/dialog.js +1 -1
- package/vscode/src/vs/base/browser/ui/iconLabel/iconLabelHover.js +16 -5
- package/vscode/src/vs/base/browser/ui/list/listView.js +31 -11
- package/vscode/src/vs/base/browser/ui/list/listWidget.js +35 -21
- package/vscode/src/vs/base/browser/ui/menu/menu.js +10 -1
- package/vscode/src/vs/base/browser/ui/menu/menubar.js +8 -4
- package/vscode/src/vs/base/browser/ui/scrollbar/scrollableElement.js +6 -5
- package/vscode/src/vs/base/browser/ui/tree/abstractTree.js +469 -95
- package/vscode/src/vs/base/browser/ui/tree/asyncDataTree.js +22 -7
- package/vscode/src/vs/base/browser/ui/tree/indexTreeModel.js +0 -5
- package/vscode/src/vs/base/browser/ui/tree/media/tree.css.js +1 -1
- package/vscode/src/vs/base/browser/ui/tree/objectTree.js +70 -4
- package/vscode/src/vs/base/common/assert.js +6 -1
- package/vscode/src/vs/base/common/async.js +31 -6
- package/vscode/src/vs/base/common/codicons.js +5 -0
- package/vscode/src/vs/base/common/event.d.ts +0 -5
- package/vscode/src/vs/base/common/event.js +0 -15
- package/vscode/src/vs/base/common/filters.d.ts +1 -18
- package/vscode/src/vs/base/common/htmlContent.js +12 -6
- package/vscode/src/vs/base/common/iterator.js +8 -0
- package/vscode/src/vs/base/common/labels.js +2 -1
- package/vscode/src/vs/base/common/map.js +20 -1
- package/vscode/src/vs/base/common/observableInternal/base.d.ts +4 -0
- package/vscode/src/vs/base/common/observableInternal/base.js +16 -8
- package/vscode/src/vs/base/common/observableInternal/derived.js +4 -6
- package/vscode/src/vs/base/common/observableInternal/utils.js +60 -5
- package/vscode/src/vs/base/common/platform.js +20 -20
- package/vscode/src/vs/base/common/prefixTree.js +4 -3
- package/vscode/src/vs/base/common/product.d.ts +5 -2
- package/vscode/src/vs/base/common/strings.js +23 -7
- package/vscode/src/vs/base/common/themables.js +4 -1
- package/vscode/src/vs/base/common/uri.js +11 -1
- package/vscode/src/vs/base/common/worker/simpleWorker.js +1 -1
- package/vscode/src/vs/editor/browser/config/migrateOptions.js +5 -0
- package/vscode/src/vs/editor/browser/controller/mouseHandler.js +1 -0
- package/vscode/src/vs/editor/browser/controller/mouseTarget.js +14 -8
- package/vscode/src/vs/editor/browser/controller/pointerHandler.js +18 -11
- package/vscode/src/vs/editor/browser/controller/textAreaHandler.js +1 -1
- package/vscode/src/vs/editor/browser/controller/textAreaInput.js +3 -3
- package/vscode/src/vs/{workbench/services/hover/browser → editor/browser/services}/hoverService.d.ts +7 -6
- package/vscode/src/vs/editor/browser/services/hoverService.js +195 -0
- package/vscode/src/vs/editor/browser/view.js +29 -39
- package/vscode/src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js +41 -19
- package/vscode/src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.js +1 -1
- package/vscode/src/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +30 -23
- package/vscode/src/vs/editor/browser/viewParts/lineNumbers/lineNumbers.js +23 -8
- package/vscode/src/vs/editor/browser/viewParts/lines/viewLines.js +1 -1
- package/vscode/src/vs/editor/browser/viewParts/linesDecorations/linesDecorations.js +8 -1
- package/vscode/src/vs/editor/browser/viewParts/marginDecorations/marginDecorations.js +7 -1
- package/vscode/src/vs/editor/browser/viewParts/minimap/minimap.js +1 -1
- package/vscode/src/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js +30 -3
- package/vscode/src/vs/editor/browser/widget/codeEditorWidget.js +39 -15
- package/vscode/src/vs/editor/browser/widget/diffEditor/{accessibleDiffViewer.css.js → components/accessibleDiffViewer.css.js} +1 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/{accessibleDiffViewer.js → components/accessibleDiffViewer.js} +43 -43
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorDecorations.js +89 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/{diffEditorEditors.js → components/diffEditorEditors.js} +14 -14
- package/vscode/src/vs/editor/browser/widget/diffEditor/{diffEditorSash.js → components/diffEditorSash.js} +5 -5
- package/vscode/src/vs/editor/browser/widget/diffEditor/{lineAlignment.js → components/diffEditorViewZones/diffEditorViewZones.js} +38 -28
- package/vscode/src/vs/editor/browser/widget/diffEditor/{inlineDiffDeletedCodeMargin.js → components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js} +14 -14
- package/vscode/src/vs/editor/browser/widget/diffEditor/{renderLines.js → components/diffEditorViewZones/renderLines.js} +7 -7
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +29 -38
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorViewModel.js +150 -38
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +17 -16
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js +104 -6
- package/vscode/src/vs/editor/browser/widget/diffEditor/{hideUnchangedRegionsFeature.js → features/hideUnchangedRegionsFeature.js} +51 -78
- package/vscode/src/vs/editor/browser/widget/diffEditor/{movedBlocksLines.js → features/movedBlocksLinesFeature.js} +23 -23
- package/vscode/src/vs/editor/browser/widget/diffEditor/{overviewRulerPart.js → features/overviewRulerFeature.js} +28 -28
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +145 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/{decorations.js → registrations.contribution.js} +18 -2
- package/vscode/src/vs/editor/browser/widget/diffEditor/utils.js +10 -2
- package/vscode/src/vs/editor/browser/widget/hoverWidget/hover.css.js +4 -0
- package/vscode/src/vs/editor/browser/widget/hoverWidget/hoverWidget.js +527 -0
- package/vscode/src/vs/editor/{contrib → browser/widget}/markdownRenderer/browser/markdownRenderer.js +11 -11
- package/vscode/src/vs/editor/{contrib → browser/widget}/markdownRenderer/browser/renderedMarkdown.css.js +1 -1
- package/vscode/src/vs/editor/common/config/editorOptions.d.ts +11 -10
- package/vscode/src/vs/editor/common/config/editorOptions.js +46 -42
- package/vscode/src/vs/editor/common/core/editorColorRegistry.js +3 -3
- package/vscode/src/vs/editor/common/core/offsetRange.d.ts +2 -0
- package/vscode/src/vs/editor/common/core/offsetRange.js +8 -0
- package/vscode/src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.js +9 -0
- package/vscode/src/vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations.js +50 -47
- package/vscode/src/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence.js +4 -1
- package/vscode/src/vs/editor/common/diff/rangeMapping.d.ts +2 -1
- package/vscode/src/vs/editor/common/diff/rangeMapping.js +13 -2
- package/vscode/src/vs/editor/common/languages.d.ts +10 -2
- package/vscode/src/vs/editor/common/model/textModel.js +19 -13
- package/vscode/src/vs/editor/common/model/tokenizationTextModelPart.js +1 -1
- package/vscode/src/vs/editor/common/model.d.ts +19 -1
- package/vscode/src/vs/editor/common/model.js +2 -1
- package/vscode/src/vs/editor/common/services/editorSimpleWorker.js +2 -1
- package/vscode/src/vs/editor/common/services/getIconClasses.js +4 -1
- package/vscode/src/vs/editor/common/services/semanticTokensProviderStyling.js +3 -3
- package/vscode/src/vs/editor/common/standalone/standaloneEnums.js +9 -8
- package/vscode/src/vs/editor/common/standaloneStrings.js +18 -18
- package/vscode/src/vs/editor/common/viewEvents.js +2 -0
- package/vscode/src/vs/editor/common/viewModel/glyphLanesModel.js +55 -0
- package/vscode/src/vs/editor/common/viewModel/viewModelImpl.js +4 -1
- package/vscode/src/vs/editor/contrib/clipboard/browser/clipboard.js +5 -1
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeAction.js +1 -0
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionController.js +46 -20
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionMenu.js +1 -1
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionModel.js +38 -11
- package/vscode/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +56 -101
- package/vscode/src/vs/editor/contrib/codelens/browser/codelensWidget.js +3 -2
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorContributions.js +2 -2
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorHoverParticipant.js +10 -29
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerWidget.js +4 -4
- package/vscode/src/vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution.js +51 -0
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +19 -1
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +38 -10
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +29 -1
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/edit.js +10 -3
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +3 -17
- package/vscode/src/vs/editor/contrib/find/browser/findController.js +3 -35
- package/vscode/src/vs/editor/contrib/folding/browser/foldingDecorations.js +26 -6
- package/vscode/src/vs/editor/contrib/fontZoom/browser/fontZoom.js +6 -6
- package/vscode/src/vs/editor/contrib/format/browser/format.js +9 -9
- package/vscode/src/vs/editor/contrib/format/browser/formatActions.js +5 -5
- package/vscode/src/vs/editor/contrib/gotoError/browser/media/gotoErrorWidget.css.js +1 -1
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +2 -2
- package/vscode/src/vs/editor/contrib/hover/browser/contentHover.js +85 -76
- package/vscode/src/vs/editor/contrib/hover/browser/hover.js +120 -90
- package/vscode/src/vs/editor/contrib/hover/browser/marginHover.js +18 -6
- package/vscode/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +1 -1
- package/vscode/src/vs/editor/contrib/hover/browser/markerHoverParticipant.js +2 -2
- package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHints.js +4 -2
- package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +56 -38
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hoverParticipant.js +1 -1
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController.js +12 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHintsWidget.js +4 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel.js +2 -2
- package/vscode/src/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +50 -53
- package/vscode/src/vs/editor/contrib/message/browser/messageController.js +5 -2
- package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js +5 -1
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.css.js +1 -1
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +4 -4
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +8 -5
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +58 -46
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestController.js +34 -7
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +30 -38
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestModel.js +2 -2
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidget.js +11 -3
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +18 -7
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +8 -10
- package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
- package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +7 -6
- package/vscode/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -0
- package/vscode/src/vs/editor/editor.api.d.ts +82 -11
- package/vscode/src/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js +8 -3
- package/vscode/src/vs/editor/standalone/browser/standaloneLayoutService.js +4 -3
- package/vscode/src/vs/editor/standalone/browser/standaloneServices.js +22 -11
- package/vscode/src/vs/editor/standalone/browser/standaloneThemeService.js +1 -1
- package/vscode/src/vs/nls.d.ts +6 -0
- package/vscode/src/vs/platform/accessibility/browser/accessibilityService.js +4 -1
- package/vscode/src/vs/platform/accessibility/common/accessibility.d.ts +2 -16
- package/vscode/src/vs/platform/accessibility/common/accessibility.js +1 -2
- package/vscode/src/vs/platform/action/common/actionCommonCategories.d.ts +7 -20
- package/vscode/src/vs/platform/action/common/actionCommonCategories.js +8 -8
- package/vscode/src/vs/platform/actionWidget/browser/actionList.js +0 -1
- package/vscode/src/vs/platform/actionWidget/browser/actionWidget.css.js +1 -1
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +2 -0
- package/vscode/src/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem.js +5 -0
- package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.css.js +1 -1
- package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.js +2 -2
- package/vscode/src/vs/platform/actions/common/actions.d.ts +9 -1
- package/vscode/src/vs/platform/actions/common/actions.js +12 -1
- package/vscode/src/vs/platform/audioCues/browser/audioCueService.d.ts +11 -1
- package/vscode/src/vs/platform/audioCues/browser/audioCueService.js +174 -28
- package/vscode/src/vs/platform/clipboard/browser/clipboardService.js +38 -5
- package/vscode/src/vs/platform/configuration/common/configuration.d.ts +0 -1
- package/vscode/src/vs/platform/environment/common/environmentService.js +1 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.d.ts +5 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +24 -5
- package/vscode/src/vs/platform/extensions/common/extensions.d.ts +6 -1
- package/vscode/src/vs/{workbench/services → platform}/hover/browser/hover.d.ts +6 -8
- package/vscode/src/vs/platform/hover/browser/hover.js +3 -0
- package/vscode/src/vs/platform/instantiation/common/instantiationService.js +14 -4
- package/vscode/src/vs/platform/keybinding/common/abstractKeybindingService.js +11 -4
- package/vscode/src/vs/platform/keybinding/common/keybinding.d.ts +7 -0
- package/vscode/src/vs/platform/layout/browser/layoutService.d.ts +6 -0
- package/vscode/src/vs/platform/list/browser/listService.js +7 -5
- package/vscode/src/vs/platform/log/common/bufferLog.js +1 -0
- package/vscode/src/vs/platform/log/common/log.d.ts +0 -1
- package/vscode/src/vs/platform/log/common/log.js +1 -2
- package/vscode/src/vs/platform/notification/common/notification.d.ts +36 -19
- package/vscode/src/vs/platform/notification/common/notification.js +9 -3
- package/vscode/src/vs/platform/quickinput/browser/pickerQuickAccess.js +4 -1
- package/vscode/src/vs/platform/quickinput/browser/quickInput.js +50 -48
- package/vscode/src/vs/platform/quickinput/browser/quickInputController.js +3 -5
- package/vscode/src/vs/platform/quickinput/browser/quickInputList.js +49 -66
- package/vscode/src/vs/platform/quickinput/browser/quickInputService.js +11 -3
- package/vscode/src/vs/platform/quickinput/browser/quickInputUtils.js +16 -2
- package/vscode/src/vs/platform/quickinput/common/quickInput.d.ts +230 -26
- package/vscode/src/vs/platform/remote/common/remoteAuthorityResolver.d.ts +1 -0
- package/vscode/src/vs/platform/telemetry/common/telemetryUtils.js +1 -0
- package/vscode/src/vs/platform/theme/browser/defaultStyles.js +5 -3
- package/vscode/src/vs/platform/theme/common/colorRegistry.js +28 -9
- package/vscode/src/vs/platform/tunnel/common/tunnel.d.ts +2 -0
- package/vscode/src/vs/platform/window/common/window.js +14 -8
- package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +97 -78
- package/vscode/src/vs/workbench/api/common/extHost.protocol.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostAuthentication.js +1 -22
- package/vscode/src/vs/workbench/api/common/extHostChat.js +0 -6
- package/vscode/src/vs/workbench/api/common/extHostChatAgents2.js +31 -36
- package/vscode/src/vs/workbench/api/common/extHostChatVariables.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostComments.js +6 -1
- package/vscode/src/vs/workbench/api/common/extHostConsoleForwarder.js +1 -0
- package/vscode/src/vs/workbench/api/common/extHostDebugService.js +130 -6
- package/vscode/src/vs/workbench/api/common/extHostDocumentContentProviders.js +28 -15
- package/vscode/src/vs/workbench/api/common/extHostDocuments.js +4 -5
- package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +5 -1
- package/vscode/src/vs/workbench/api/common/extHostFileSystem.js +1 -2
- package/vscode/src/vs/workbench/api/common/extHostFileSystemConsumer.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostInlineChat.js +35 -33
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +40 -13
- package/vscode/src/vs/workbench/api/common/extHostMessageService.js +10 -1
- package/vscode/src/vs/workbench/api/common/extHostNotebook.js +11 -7
- package/vscode/src/vs/workbench/api/common/extHostNotebookEditors.js +2 -3
- package/vscode/src/vs/workbench/api/common/extHostNotebookKernels.js +29 -4
- package/vscode/src/vs/workbench/api/common/extHostProfileContentHandler.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostProgress.js +1 -7
- package/vscode/src/vs/workbench/api/common/extHostSCM.js +49 -93
- package/vscode/src/vs/workbench/api/common/extHostSpeech.js +21 -0
- package/vscode/src/vs/workbench/api/common/extHostTask.js +18 -22
- package/vscode/src/vs/workbench/api/common/extHostTelemetry.js +1 -0
- package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +3 -3
- package/vscode/src/vs/workbench/api/common/extHostTesting.js +55 -36
- package/vscode/src/vs/workbench/api/common/extHostTextEditor.js +5 -2
- package/vscode/src/vs/workbench/api/common/extHostTextEditors.js +6 -7
- package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +6 -3
- package/vscode/src/vs/workbench/api/common/extHostTunnelService.js +4 -2
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +74 -12
- package/vscode/src/vs/workbench/api/common/extHostTypes.js +27 -8
- package/vscode/src/vs/workbench/api/worker/extHostConsoleForwarder.js +1 -1
- package/vscode/src/vs/workbench/browser/actions/layoutActions.js +172 -103
- package/vscode/src/vs/workbench/browser/actions/windowActions.js +13 -17
- package/vscode/src/vs/workbench/browser/actions/workspaceActions.js +34 -34
- package/vscode/src/vs/workbench/browser/actions/workspaceCommands.js +4 -4
- package/vscode/src/vs/workbench/browser/dnd.js +2 -2
- package/vscode/src/vs/workbench/browser/labels.js +34 -4
- package/vscode/src/vs/workbench/browser/part.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.js +4 -4
- package/vscode/src/vs/workbench/browser/parts/compositeBarActions.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsControl.js +801 -0
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsModel.js +140 -0
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.js +410 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editor.js +1 -2
- package/vscode/src/vs/workbench/browser/parts/editor/editorActions.js +304 -303
- package/vscode/src/vs/workbench/browser/parts/editor/editorAutoSave.js +101 -47
- package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +114 -47
- package/vscode/src/vs/workbench/browser/parts/editor/editorGroupView.js +1313 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorGroupWatermark.js +190 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorPanes.js +344 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorQuickAccess.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorStatus.js +10 -10
- package/vscode/src/vs/workbench/browser/parts/editor/editorTabsControl.js +27 -42
- package/vscode/src/vs/workbench/browser/parts/editor/editorTitleControl.js +152 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorsObserver.js +8 -8
- package/vscode/src/vs/workbench/browser/parts/editor/media/breadcrumbscontrol.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/editor/media/editorgroupview.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/editor/media/editortitlecontrol.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/editor/media/multieditortabscontrol.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/editor/media/singleeditortabscontrol.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.js +1626 -0
- package/vscode/src/vs/workbench/browser/parts/editor/multiRowEditorTabsControl.js +150 -0
- package/vscode/src/vs/workbench/browser/parts/editor/noEditorTabsControl.js +52 -0
- package/vscode/src/vs/workbench/browser/parts/editor/singleEditorTabsControl.js +260 -0
- package/vscode/src/vs/workbench/browser/parts/editor/textEditor.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/textResourceEditor.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +39 -36
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCommands.js +68 -28
- package/vscode/src/vs/workbench/browser/parts/panel/media/panelpart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/panel/panelActions.js +15 -14
- package/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.js +18 -17
- package/vscode/src/vs/workbench/browser/parts/titlebar/windowTitle.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/views/media/views.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/views/treeView.js +7 -10
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +2 -1
- package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.d.ts +2 -1
- package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +18 -17
- package/vscode/src/vs/workbench/browser/quickaccess.js +33 -1
- package/vscode/src/vs/workbench/browser/web.api.d.ts +6 -0
- package/vscode/src/vs/workbench/browser/window.js +92 -9
- package/vscode/src/vs/workbench/browser/workbench.contribution.js +114 -65
- package/vscode/src/vs/workbench/common/component.d.ts +5 -1
- package/vscode/src/vs/workbench/common/component.js +6 -0
- package/vscode/src/vs/workbench/common/configuration.js +11 -1
- package/vscode/src/vs/workbench/common/contextkeys.js +8 -4
- package/vscode/src/vs/workbench/common/editor/editorInput.d.ts +6 -0
- package/vscode/src/vs/workbench/common/editor/editorInput.js +3 -0
- package/vscode/src/vs/workbench/common/editor/filteredEditorGroupModel.js +107 -0
- package/vscode/src/vs/workbench/common/editor/resourceEditorInput.d.ts +6 -3
- package/vscode/src/vs/workbench/common/editor/resourceEditorInput.js +21 -3
- package/vscode/src/vs/workbench/common/editor/textResourceEditorInput.d.ts +2 -1
- package/vscode/src/vs/workbench/common/editor/textResourceEditorInput.js +9 -6
- package/vscode/src/vs/workbench/common/editor.d.ts +16 -4
- package/vscode/src/vs/workbench/common/editor.js +7 -1
- package/vscode/src/vs/workbench/common/memento.js +33 -12
- package/vscode/src/vs/workbench/common/notifications.js +30 -7
- package/vscode/src/vs/workbench/common/theme.js +61 -1
- package/vscode/src/vs/workbench/common/views.d.ts +1 -28
- package/vscode/src/vs/workbench/common/views.js +1 -2
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +232 -19
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityContributions.js +9 -9
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleView.js +1 -0
- package/vscode/src/vs/workbench/contrib/accessibility/browser/editorAccessibilityHelp.js +19 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +8 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +57 -38
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorInput.js +9 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +31 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +93 -49
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +30 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommandContentWidget.js +24 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +9 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +12 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +21 -43
- package/vscode/src/vs/workbench/contrib/chat/common/chatService.js +6 -6
- package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.js +4 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +0 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/{comments.contribution.js → commentsAccessibility.js} +36 -128
- package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +41 -18
- package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +202 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +27 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +165 -52
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +48 -31
- package/vscode/src/vs/workbench/contrib/debug/browser/debugIcons.js +6 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/media/breakpointWidget.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debug.d.ts +40 -10
- package/vscode/src/vs/workbench/contrib/debug/common/debug.js +28 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debugContext.js +14 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +52 -23
- package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debugVisualizers.js +164 -0
- package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +10 -0
- package/vscode/src/vs/workbench/contrib/debug/common/replModel.js +285 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +123 -78
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.js +10 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorInput.js +326 -0
- package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +1 -2
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +8 -9
- package/vscode/src/vs/workbench/contrib/files/browser/files.configuration.contribution.js +70 -2
- package/vscode/src/vs/workbench/contrib/files/browser/files.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/files/browser/files.fileEditorFactory.contribution.js +13 -0
- package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +2 -2
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerView.js +34 -17
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.js +5 -4
- package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +48 -14
- package/vscode/src/vs/workbench/contrib/format/browser/formatActionsMultiple.js +16 -8
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +317 -321
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget.js +17 -24
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingService.js +3 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +306 -130
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +3 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +385 -613
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +69 -64
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +71 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +39 -44
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +5 -3
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookEditorStickyScroll.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +38 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +36 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +32 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.js +24 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.js +1 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatActions.js +264 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatController.js +60 -27
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +12 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +12 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +6 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +188 -155
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.js +10 -3
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +16 -33
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +9 -7
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +6 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookKernelService.js +2 -1
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +29 -14
- package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +15 -3
- package/vscode/src/vs/workbench/contrib/remote/browser/urlFinder.js +2 -2
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +22 -6
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +1 -1
- package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +16 -17
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetCompletionProvider.js +78 -50
- package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +15 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.d.ts +25 -45
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEditorInput.js +12 -4
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIcon.js +2 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +33 -36
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.js +3 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +5 -8
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +15 -27
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +3 -3
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +38 -22
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverageService.js +5 -2
- package/vscode/src/vs/workbench/contrib/testing/common/testProfileService.js +60 -40
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +2 -2
- package/vscode/src/vs/workbench/contrib/testing/common/testResultStorage.js +15 -11
- package/vscode/src/vs/workbench/contrib/testing/common/testService.js +26 -1
- package/vscode/src/vs/workbench/contrib/testing/common/testTypes.js +24 -23
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.js +1 -1
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +124 -26
- package/vscode/src/vs/workbench/services/authentication/common/authentication.d.ts +68 -0
- package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +76 -36
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolver.js +1 -0
- package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +1 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorService.js +15 -3
- package/vscode/src/vs/workbench/services/editor/common/editorGroupFinder.js +10 -1
- package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.d.ts +51 -43
- package/vscode/src/vs/workbench/services/editor/common/editorService.d.ts +13 -8
- package/vscode/src/vs/workbench/services/editor/common/editorService.js +2 -1
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +10 -10
- package/vscode/src/vs/workbench/services/extensions/browser/extensionUrlHandler.js +8 -8
- package/vscode/src/vs/workbench/services/extensions/common/extensionsApiProposals.js +7 -7
- package/vscode/src/vs/workbench/services/extensions/common/rpcProtocol.js +1 -0
- package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.d.ts +29 -9
- package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +160 -63
- package/vscode/src/vs/workbench/services/host/browser/host.d.ts +8 -0
- package/vscode/src/vs/workbench/services/keybinding/common/keybindingEditing.js +60 -72
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.d.ts +0 -4
- package/vscode/src/vs/workbench/services/notebook/common/notebookDocumentService.js +56 -0
- package/vscode/src/vs/workbench/services/output/common/output.js +2 -2
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +10 -0
- package/vscode/src/vs/workbench/services/preferences/common/preferencesEditorInput.js +10 -0
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.js +2 -1
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +5 -4
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorInput.js +21 -8
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.d.ts +4 -0
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.js +3 -0
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfile.js +4 -4
- package/vscode/src/vs/workbench/{browser/parts/views → services/views/browser}/viewsService.js +20 -15
- package/vscode/src/vs/workbench/services/views/common/viewsService.d.ts +34 -0
- package/vscode/src/vs/workbench/services/{hover/browser/hover.js → views/common/viewsService.js} +2 -2
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.d.ts +6 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.js +5 -2
- package/vscode/src/vs/workbench/services/workspaces/common/workspaceTrust.js +1 -0
- package/vscode-dts/vscode.proposed.chatAgents2.d.ts +112 -47
- package/vscode-dts/vscode.proposed.chatAgents2Additions.d.ts +68 -9
- package/vscode-dts/{vscode.proposed.scmInputBoxActionButton.d.ts → vscode.proposed.codeActionRanges.d.ts} +8 -10
- package/vscode-dts/{vscode.proposed.readonlyMessage.d.ts → vscode.proposed.commentReactor.d.ts} +3 -4
- package/vscode-dts/vscode.proposed.contribMultiDiffEditorMenus.d.ts +6 -0
- package/vscode-dts/vscode.proposed.contribSourceControlHistoryItemGroupMenu.d.ts +8 -0
- package/vscode-dts/vscode.proposed.contribSourceControlHistoryItemMenu.d.ts +8 -0
- package/vscode-dts/vscode.proposed.debugVisualization.d.ts +100 -0
- package/vscode-dts/vscode.proposed.defaultChatAgent.d.ts +1 -1
- package/vscode-dts/vscode.proposed.interactive.d.ts +13 -16
- package/vscode-dts/vscode.proposed.notebookVariableProvider.d.ts +4 -1
- package/vscode-dts/vscode.proposed.resolvers.d.ts +4 -0
- package/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts +4 -10
- package/vscode-dts/vscode.proposed.scmMultiDiffEditor.d.ts +34 -0
- package/vscode-dts/vscode.proposed.speech.d.ts +17 -3
- package/vscode-dts/vscode.proposed.testCoverage.d.ts +7 -1
- package/vscode-dts/vscode.proposed.tunnelFactory.d.ts +4 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/colors.js +0 -17
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorDecorations.js +0 -231
- package/vscode/src/vs/editor/browser/widget/diffEditor/outlineModel.js +0 -299
- package/vscode/src/vs/editor/browser/widget/diffEditor/workerBasedDocumentDiffProvider.js +0 -101
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/suggestAddon.js +0 -390
- package/vscode/src/vs/workbench/services/editor/common/editorGroupColumn.d.ts +0 -10
- package/vscode/src/vs/workbench/services/suggest/browser/media/suggest.css.js +0 -4
- package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionItem.d.ts +0 -28
- package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionItem.js +0 -10
- package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionModel.d.ts +0 -30
- package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionModel.js +0 -98
- package/vscode/src/vs/workbench/services/suggest/browser/simpleSuggestWidget.d.ts +0 -10
- package/vscode/src/vs/workbench/services/suggest/browser/simpleSuggestWidget.js +0 -428
- package/vscode/src/vs/workbench/services/suggest/browser/simpleSuggestWidgetRenderer.js +0 -83
- package/vscode-dts/vscode.proposed.chatVariables.d.ts +0 -39
- package/vscode-dts/vscode.proposed.interactiveUserActions.d.ts +0 -77
- package/vscode-dts/vscode.proposed.saveEditor.d.ts +0 -35
- package/vscode-dts/vscode.proposed.scmInputBoxValueProvider.d.ts +0 -25
- package/vscode-dts/vscode.proposed.testingActiveProfile.d.ts +0 -21
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { append, $, clearNode, createStyleSheet, isActiveElement, hasParentWithClass, h, getWindow } from '../../dom.js';
|
|
1
|
+
import { append, $, clearNode, createStyleSheet, isActiveElement, asCssValueWithDefault, isKeyboardEvent, hasParentWithClass, h, getWindow } from '../../dom.js';
|
|
2
2
|
import { DomEmitter } from '../../event.js';
|
|
3
3
|
import { StandardKeyboardEvent } from '../../keyboardEvent.js';
|
|
4
4
|
import { ActionBar } from '../actionbar/actionbar.js';
|
|
5
5
|
import { FindInput } from '../findinput/findInput.js';
|
|
6
6
|
import { unthemedInboxStyles } from '../inputbox/inputBox.js';
|
|
7
7
|
import { ElementsDragAndDropData } from '../list/listView.js';
|
|
8
|
-
import { isInputElement, List, MouseController, isButton, isMonacoEditor,
|
|
8
|
+
import { isInputElement, isStickyScrollContainer, isStickyScrollElement, List, MouseController, isButton, isMonacoEditor, isMonacoCustomToggle, isActionItem } from '../list/listWidget.js';
|
|
9
9
|
import { Toggle, unthemedToggleStyles } from '../toggle/toggle.js';
|
|
10
10
|
import { isFilterResult, getVisibleState } from './indexTreeModel.js';
|
|
11
11
|
import { TreeMouseEventTarget, TreeError } from './tree.js';
|
|
@@ -59,8 +59,8 @@ class TreeNodeListDragAndDrop {
|
|
|
59
59
|
onDragStart(data, originalEvent) {
|
|
60
60
|
this.dnd.onDragStart?.(asTreeDragAndDropData(data), originalEvent);
|
|
61
61
|
}
|
|
62
|
-
onDragOver(data, targetNode, targetIndex, originalEvent, raw = true) {
|
|
63
|
-
const result = this.dnd.onDragOver(asTreeDragAndDropData(data), targetNode && targetNode.element, targetIndex, originalEvent);
|
|
62
|
+
onDragOver(data, targetNode, targetIndex, targetSector, originalEvent, raw = true) {
|
|
63
|
+
const result = this.dnd.onDragOver(asTreeDragAndDropData(data), targetNode && targetNode.element, targetIndex, targetSector, originalEvent);
|
|
64
64
|
const didChangeAutoExpandNode = this.autoExpandNode !== targetNode;
|
|
65
65
|
if (didChangeAutoExpandNode) {
|
|
66
66
|
this.autoExpandDisposable.dispose();
|
|
@@ -93,7 +93,7 @@ class TreeNodeListDragAndDrop {
|
|
|
93
93
|
const parentRef = model.getParentNodeLocation(ref);
|
|
94
94
|
const parentNode = model.getNode(parentRef);
|
|
95
95
|
const parentIndex = parentRef && model.getListIndex(parentRef);
|
|
96
|
-
return this.onDragOver(data, parentNode, parentIndex, originalEvent, false);
|
|
96
|
+
return this.onDragOver(data, parentNode, parentIndex, targetSector, originalEvent, false);
|
|
97
97
|
}
|
|
98
98
|
const model = this.modelProvider();
|
|
99
99
|
const ref = model.getNodeLocation(targetNode);
|
|
@@ -101,10 +101,10 @@ class TreeNodeListDragAndDrop {
|
|
|
101
101
|
const length = model.getListRenderCount(ref);
|
|
102
102
|
return { ...result, feedback: range(start, start + length) };
|
|
103
103
|
}
|
|
104
|
-
drop(data, targetNode, targetIndex, originalEvent) {
|
|
104
|
+
drop(data, targetNode, targetIndex, targetSector, originalEvent) {
|
|
105
105
|
this.autoExpandDisposable.dispose();
|
|
106
106
|
this.autoExpandNode = undefined;
|
|
107
|
-
this.dnd.drop(asTreeDragAndDropData(data), targetNode && targetNode.element, targetIndex, originalEvent);
|
|
107
|
+
this.dnd.drop(asTreeDragAndDropData(data), targetNode && targetNode.element, targetIndex, targetSector, originalEvent);
|
|
108
108
|
}
|
|
109
109
|
onDragEnd(originalEvent) {
|
|
110
110
|
this.dnd.onDragEnd?.(originalEvent);
|
|
@@ -884,7 +884,7 @@ class FindController {
|
|
|
884
884
|
}
|
|
885
885
|
}
|
|
886
886
|
shouldAllowFocus(node) {
|
|
887
|
-
if (!this.widget || !this.pattern
|
|
887
|
+
if (!this.widget || !this.pattern) {
|
|
888
888
|
return true;
|
|
889
889
|
}
|
|
890
890
|
if (this.filter.totalCount > 0 && this.filter.matchCount <= 1) {
|
|
@@ -903,34 +903,59 @@ class FindController {
|
|
|
903
903
|
this.disposables.dispose();
|
|
904
904
|
}
|
|
905
905
|
}
|
|
906
|
+
function stickyScrollNodeStateEquals(node1, node2) {
|
|
907
|
+
return node1.position === node2.position && stickyScrollNodeEquals(node1, node2);
|
|
908
|
+
}
|
|
906
909
|
function stickyScrollNodeEquals(node1, node2) {
|
|
907
|
-
return node1.
|
|
908
|
-
node1.node.element === node2.node.element &&
|
|
910
|
+
return node1.node.element === node2.node.element &&
|
|
909
911
|
node1.startIndex === node2.startIndex &&
|
|
910
912
|
node1.height === node2.height &&
|
|
911
913
|
node1.endIndex === node2.endIndex;
|
|
912
914
|
}
|
|
913
|
-
class StickyScrollState
|
|
915
|
+
class StickyScrollState {
|
|
914
916
|
constructor(stickyNodes = []) {
|
|
915
|
-
super();
|
|
916
917
|
this.stickyNodes = stickyNodes;
|
|
917
918
|
}
|
|
918
919
|
get count() { return this.stickyNodes.length; }
|
|
919
920
|
equal(state) {
|
|
920
|
-
return equals(this.stickyNodes, state.stickyNodes,
|
|
921
|
+
return equals(this.stickyNodes, state.stickyNodes, stickyScrollNodeStateEquals);
|
|
921
922
|
}
|
|
922
|
-
|
|
923
|
-
this.
|
|
923
|
+
lastNodePartiallyVisible() {
|
|
924
|
+
if (this.count === 0) {
|
|
925
|
+
return false;
|
|
926
|
+
}
|
|
927
|
+
const lastStickyNode = this.stickyNodes[this.count - 1];
|
|
928
|
+
if (this.count === 1) {
|
|
929
|
+
return lastStickyNode.position !== 0;
|
|
930
|
+
}
|
|
931
|
+
const secondLastStickyNode = this.stickyNodes[this.count - 2];
|
|
932
|
+
return secondLastStickyNode.position + secondLastStickyNode.height !== lastStickyNode.position;
|
|
933
|
+
}
|
|
934
|
+
animationStateChanged(previousState) {
|
|
935
|
+
if (!equals(this.stickyNodes, previousState.stickyNodes, stickyScrollNodeEquals)) {
|
|
936
|
+
return false;
|
|
937
|
+
}
|
|
938
|
+
if (this.count === 0) {
|
|
939
|
+
return false;
|
|
940
|
+
}
|
|
941
|
+
const lastStickyNode = this.stickyNodes[this.count - 1];
|
|
942
|
+
const previousLastStickyNode = previousState.stickyNodes[previousState.count - 1];
|
|
943
|
+
return lastStickyNode.position !== previousLastStickyNode.position;
|
|
924
944
|
}
|
|
925
945
|
}
|
|
926
|
-
class
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
946
|
+
class DefaultStickyScrollDelegate {
|
|
947
|
+
constrainStickyScrollNodes(stickyNodes, stickyScrollMaxItemCount, maxWidgetHeight) {
|
|
948
|
+
for (let i = 0; i < stickyNodes.length; i++) {
|
|
949
|
+
const stickyNode = stickyNodes[i];
|
|
950
|
+
const stickyNodeBottom = stickyNode.position + stickyNode.height;
|
|
951
|
+
if (stickyNodeBottom > maxWidgetHeight || i >= stickyScrollMaxItemCount) {
|
|
952
|
+
return stickyNodes.slice(0, i);
|
|
953
|
+
}
|
|
931
954
|
}
|
|
932
|
-
return
|
|
955
|
+
return stickyNodes;
|
|
933
956
|
}
|
|
957
|
+
}
|
|
958
|
+
class StickyScrollController extends Disposable {
|
|
934
959
|
constructor(tree, model, view, renderers, treeDelegate, options = {}) {
|
|
935
960
|
super();
|
|
936
961
|
this.tree = tree;
|
|
@@ -940,7 +965,17 @@ class StickyScrollController extends Disposable {
|
|
|
940
965
|
this.maxWidgetViewRatio = 0.4;
|
|
941
966
|
const stickyScrollOptions = this.validateStickySettings(options);
|
|
942
967
|
this.stickyScrollMaxItemCount = stickyScrollOptions.stickyScrollMaxItemCount;
|
|
943
|
-
this.
|
|
968
|
+
this.stickyScrollDelegate = options.stickyScrollDelegate ?? ( new DefaultStickyScrollDelegate());
|
|
969
|
+
this._widget = this._register(( new StickyScrollWidget(
|
|
970
|
+
view.getScrollableElement(),
|
|
971
|
+
view,
|
|
972
|
+
tree,
|
|
973
|
+
renderers,
|
|
974
|
+
treeDelegate,
|
|
975
|
+
options.accessibilityProvider
|
|
976
|
+
)));
|
|
977
|
+
this.onDidChangeHasFocus = this._widget.onDidChangeHasFocus;
|
|
978
|
+
this.onContextMenu = this._widget.onContextMenu;
|
|
944
979
|
this._register(view.onDidScroll(() => this.update()));
|
|
945
980
|
this._register(view.onDidChangeContentHeight(() => this.update()));
|
|
946
981
|
this._register(tree.onDidChangeCollapseState(() => this.update()));
|
|
@@ -955,8 +990,21 @@ class StickyScrollController extends Disposable {
|
|
|
955
990
|
getNode(node) {
|
|
956
991
|
return this._widget.getNode(node);
|
|
957
992
|
}
|
|
993
|
+
getNodeAtHeight(height) {
|
|
994
|
+
let index;
|
|
995
|
+
if (height === 0) {
|
|
996
|
+
index = this.view.firstVisibleIndex;
|
|
997
|
+
}
|
|
998
|
+
else {
|
|
999
|
+
index = this.view.indexAt(height + this.view.scrollTop);
|
|
1000
|
+
}
|
|
1001
|
+
if (index < 0 || index >= this.view.length) {
|
|
1002
|
+
return undefined;
|
|
1003
|
+
}
|
|
1004
|
+
return this.view.element(index);
|
|
1005
|
+
}
|
|
958
1006
|
update() {
|
|
959
|
-
const firstVisibleNode = this.
|
|
1007
|
+
const firstVisibleNode = this.getNodeAtHeight(0);
|
|
960
1008
|
if (!firstVisibleNode || this.tree.scrollTop === 0) {
|
|
961
1009
|
this._widget.setState(undefined);
|
|
962
1010
|
return;
|
|
@@ -966,31 +1014,25 @@ class StickyScrollController extends Disposable {
|
|
|
966
1014
|
}
|
|
967
1015
|
findStickyState(firstVisibleNode) {
|
|
968
1016
|
const stickyNodes = [];
|
|
969
|
-
const maximumStickyWidgetHeight = this.view.renderHeight * this.maxWidgetViewRatio;
|
|
970
1017
|
let firstVisibleNodeUnderWidget = firstVisibleNode;
|
|
971
1018
|
let stickyNodesHeight = 0;
|
|
972
1019
|
let nextStickyNode = this.getNextStickyNode(firstVisibleNodeUnderWidget, undefined, stickyNodesHeight);
|
|
973
|
-
while (nextStickyNode
|
|
1020
|
+
while (nextStickyNode) {
|
|
974
1021
|
stickyNodes.push(nextStickyNode);
|
|
975
1022
|
stickyNodesHeight += nextStickyNode.height;
|
|
976
|
-
if (stickyNodes.length
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
break;
|
|
1023
|
+
if (stickyNodes.length <= this.stickyScrollMaxItemCount) {
|
|
1024
|
+
firstVisibleNodeUnderWidget = this.getNextVisibleNode(nextStickyNode);
|
|
1025
|
+
if (!firstVisibleNodeUnderWidget) {
|
|
1026
|
+
break;
|
|
1027
|
+
}
|
|
982
1028
|
}
|
|
983
1029
|
nextStickyNode = this.getNextStickyNode(firstVisibleNodeUnderWidget, nextStickyNode.node, stickyNodesHeight);
|
|
984
1030
|
}
|
|
985
|
-
|
|
1031
|
+
const contrainedStickyNodes = this.constrainStickyNodes(stickyNodes);
|
|
1032
|
+
return contrainedStickyNodes.length ? ( new StickyScrollState(contrainedStickyNodes)) : undefined;
|
|
986
1033
|
}
|
|
987
|
-
getNextVisibleNode(
|
|
988
|
-
|
|
989
|
-
if (nodeIndex === -1 || nodeIndex === this.view.length - 1) {
|
|
990
|
-
return undefined;
|
|
991
|
-
}
|
|
992
|
-
const nextNode = this.view.element(nodeIndex + 1);
|
|
993
|
-
return nextNode;
|
|
1034
|
+
getNextVisibleNode(previousStickyNode) {
|
|
1035
|
+
return this.getNodeAtHeight(previousStickyNode.position + previousStickyNode.height);
|
|
994
1036
|
}
|
|
995
1037
|
getNextStickyNode(firstVisibleNodeUnderWidget, previousStickyNode, stickyNodesHeight) {
|
|
996
1038
|
const nextStickyNode = this.getAncestorUnderPrevious(firstVisibleNodeUnderWidget, previousStickyNode);
|
|
@@ -1016,7 +1058,7 @@ class StickyScrollController extends Disposable {
|
|
|
1016
1058
|
createStickyScrollNode(node, currentStickyNodesHeight) {
|
|
1017
1059
|
const height = this.treeDelegate.getHeight(node);
|
|
1018
1060
|
const { startIndex, endIndex } = this.getNodeRange(node);
|
|
1019
|
-
const position = this.calculateStickyNodePosition(endIndex, currentStickyNodesHeight);
|
|
1061
|
+
const position = this.calculateStickyNodePosition(endIndex, currentStickyNodesHeight, height);
|
|
1020
1062
|
return { node, position, height, startIndex, endIndex };
|
|
1021
1063
|
}
|
|
1022
1064
|
getAncestorUnderPrevious(node, previousAncestor = undefined) {
|
|
@@ -1034,7 +1076,7 @@ class StickyScrollController extends Disposable {
|
|
|
1034
1076
|
}
|
|
1035
1077
|
return undefined;
|
|
1036
1078
|
}
|
|
1037
|
-
calculateStickyNodePosition(lastDescendantIndex, stickyRowPositionTop) {
|
|
1079
|
+
calculateStickyNodePosition(lastDescendantIndex, stickyRowPositionTop, stickyNodeHeight) {
|
|
1038
1080
|
let lastChildRelativeTop = this.view.getRelativeTop(lastDescendantIndex);
|
|
1039
1081
|
if (lastChildRelativeTop === null && this.view.firstVisibleIndex === lastDescendantIndex && lastDescendantIndex + 1 < this.view.length) {
|
|
1040
1082
|
const nodeHeight = this.treeDelegate.getHeight(this.view.element(lastDescendantIndex));
|
|
@@ -1048,11 +1090,30 @@ class StickyScrollController extends Disposable {
|
|
|
1048
1090
|
const lastChildHeight = this.treeDelegate.getHeight(lastChildNode);
|
|
1049
1091
|
const topOfLastChild = lastChildRelativeTop * this.view.renderHeight;
|
|
1050
1092
|
const bottomOfLastChild = topOfLastChild + lastChildHeight;
|
|
1051
|
-
if (stickyRowPositionTop >
|
|
1052
|
-
return
|
|
1093
|
+
if (stickyRowPositionTop + stickyNodeHeight > bottomOfLastChild && stickyRowPositionTop <= bottomOfLastChild) {
|
|
1094
|
+
return bottomOfLastChild - stickyNodeHeight;
|
|
1053
1095
|
}
|
|
1054
1096
|
return stickyRowPositionTop;
|
|
1055
1097
|
}
|
|
1098
|
+
constrainStickyNodes(stickyNodes) {
|
|
1099
|
+
if (stickyNodes.length === 0) {
|
|
1100
|
+
return [];
|
|
1101
|
+
}
|
|
1102
|
+
const maximumStickyWidgetHeight = this.view.renderHeight * this.maxWidgetViewRatio;
|
|
1103
|
+
const lastStickyNode = stickyNodes[stickyNodes.length - 1];
|
|
1104
|
+
if (stickyNodes.length <= this.stickyScrollMaxItemCount && lastStickyNode.position + lastStickyNode.height <= maximumStickyWidgetHeight) {
|
|
1105
|
+
return stickyNodes;
|
|
1106
|
+
}
|
|
1107
|
+
const constrainedStickyNodes = this.stickyScrollDelegate.constrainStickyScrollNodes(stickyNodes, this.stickyScrollMaxItemCount, maximumStickyWidgetHeight);
|
|
1108
|
+
if (!constrainedStickyNodes.length) {
|
|
1109
|
+
return [];
|
|
1110
|
+
}
|
|
1111
|
+
const lastConstrainedStickyNode = constrainedStickyNodes[constrainedStickyNodes.length - 1];
|
|
1112
|
+
if (constrainedStickyNodes.length > this.stickyScrollMaxItemCount || lastConstrainedStickyNode.position + lastConstrainedStickyNode.height > maximumStickyWidgetHeight) {
|
|
1113
|
+
throw new Error('stickyScrollDelegate violates constraints');
|
|
1114
|
+
}
|
|
1115
|
+
return constrainedStickyNodes;
|
|
1116
|
+
}
|
|
1056
1117
|
getParentNode(node) {
|
|
1057
1118
|
const nodeLocation = this.model.getNodeLocation(node);
|
|
1058
1119
|
const parentLocation = this.model.getParentNodeLocation(nodeLocation);
|
|
@@ -1062,10 +1123,8 @@ class StickyScrollController extends Disposable {
|
|
|
1062
1123
|
const nodeLocation = this.model.getNodeLocation(node);
|
|
1063
1124
|
return this.model.getListRenderCount(nodeLocation) > 1;
|
|
1064
1125
|
}
|
|
1065
|
-
getNodeIndex(node
|
|
1066
|
-
|
|
1067
|
-
nodeLocation = this.model.getNodeLocation(node);
|
|
1068
|
-
}
|
|
1126
|
+
getNodeIndex(node) {
|
|
1127
|
+
const nodeLocation = this.model.getNodeLocation(node);
|
|
1069
1128
|
const nodeIndex = this.model.getListIndex(nodeLocation);
|
|
1070
1129
|
return nodeIndex;
|
|
1071
1130
|
}
|
|
@@ -1092,7 +1151,19 @@ class StickyScrollController extends Disposable {
|
|
|
1092
1151
|
}
|
|
1093
1152
|
return widgetHeight;
|
|
1094
1153
|
}
|
|
1154
|
+
getFocus() {
|
|
1155
|
+
return this._widget.getFocus();
|
|
1156
|
+
}
|
|
1157
|
+
domFocus() {
|
|
1158
|
+
this._widget.domFocus();
|
|
1159
|
+
}
|
|
1160
|
+
focusedLast() {
|
|
1161
|
+
return this._widget.focusedLast();
|
|
1162
|
+
}
|
|
1095
1163
|
updateOptions(optionsUpdate = {}) {
|
|
1164
|
+
if (!optionsUpdate.stickyScrollMaxItemCount) {
|
|
1165
|
+
return;
|
|
1166
|
+
}
|
|
1096
1167
|
const validatedOptions = this.validateStickySettings(optionsUpdate);
|
|
1097
1168
|
if (this.stickyScrollMaxItemCount !== validatedOptions.stickyScrollMaxItemCount) {
|
|
1098
1169
|
this.stickyScrollMaxItemCount = validatedOptions.stickyScrollMaxItemCount;
|
|
@@ -1100,7 +1171,7 @@ class StickyScrollController extends Disposable {
|
|
|
1100
1171
|
}
|
|
1101
1172
|
}
|
|
1102
1173
|
validateStickySettings(options) {
|
|
1103
|
-
let stickyScrollMaxItemCount =
|
|
1174
|
+
let stickyScrollMaxItemCount = 7;
|
|
1104
1175
|
if (typeof options.stickyScrollMaxItemCount === 'number') {
|
|
1105
1176
|
stickyScrollMaxItemCount = Math.max(options.stickyScrollMaxItemCount, 1);
|
|
1106
1177
|
}
|
|
@@ -1108,14 +1179,21 @@ class StickyScrollController extends Disposable {
|
|
|
1108
1179
|
}
|
|
1109
1180
|
}
|
|
1110
1181
|
class StickyScrollWidget {
|
|
1111
|
-
constructor(container, view,
|
|
1182
|
+
constructor(container, view, tree, treeRenderers, treeDelegate, accessibilityProvider) {
|
|
1112
1183
|
this.view = view;
|
|
1113
|
-
this.
|
|
1184
|
+
this.tree = tree;
|
|
1114
1185
|
this.treeRenderers = treeRenderers;
|
|
1115
1186
|
this.treeDelegate = treeDelegate;
|
|
1116
|
-
this.
|
|
1117
|
-
this.
|
|
1187
|
+
this.accessibilityProvider = accessibilityProvider;
|
|
1188
|
+
this._previousElements = [];
|
|
1189
|
+
this._previousStateDisposables = ( new DisposableStore());
|
|
1190
|
+
this._rootDomNode = $('.monaco-tree-sticky-container.empty');
|
|
1118
1191
|
container.appendChild(this._rootDomNode);
|
|
1192
|
+
const shadow = $('.monaco-tree-sticky-container-shadow');
|
|
1193
|
+
this._rootDomNode.appendChild(shadow);
|
|
1194
|
+
this.stickyScrollFocus = ( new StickyScrollFocus(this._rootDomNode, view));
|
|
1195
|
+
this.onDidChangeHasFocus = this.stickyScrollFocus.onDidChangeHasFocus;
|
|
1196
|
+
this.onContextMenu = this.stickyScrollFocus.onContextMenu;
|
|
1119
1197
|
}
|
|
1120
1198
|
get height() {
|
|
1121
1199
|
if (!this._previousState) {
|
|
@@ -1139,28 +1217,34 @@ class StickyScrollWidget {
|
|
|
1139
1217
|
if (wasVisible !== isVisible) {
|
|
1140
1218
|
this.setVisible(isVisible);
|
|
1141
1219
|
}
|
|
1142
|
-
this._previousState?.dispose();
|
|
1143
|
-
this._previousState = state;
|
|
1144
1220
|
if (!isVisible) {
|
|
1221
|
+
this._previousState = undefined;
|
|
1222
|
+
this._previousElements = [];
|
|
1223
|
+
this._previousStateDisposables.clear();
|
|
1145
1224
|
return;
|
|
1146
1225
|
}
|
|
1147
|
-
for (let stickyIndex = state.count - 1; stickyIndex >= 0; stickyIndex--) {
|
|
1148
|
-
const stickyNode = state.stickyNodes[stickyIndex];
|
|
1149
|
-
const previousStickyNode = stickyIndex ? state.stickyNodes[stickyIndex - 1] : undefined;
|
|
1150
|
-
const currentWidgetHieght = previousStickyNode ? previousStickyNode.position + previousStickyNode.height : 0;
|
|
1151
|
-
const { element, disposable } = this.createElement(stickyNode, currentWidgetHieght);
|
|
1152
|
-
this._rootDomNode.appendChild(element);
|
|
1153
|
-
state.addDisposable(disposable);
|
|
1154
|
-
}
|
|
1155
|
-
const shadow = $('.monaco-tree-sticky-container-shadow');
|
|
1156
|
-
this._rootDomNode.appendChild(shadow);
|
|
1157
|
-
state.addDisposable(toDisposable(() => shadow.remove()));
|
|
1158
1226
|
const lastStickyNode = state.stickyNodes[state.count - 1];
|
|
1227
|
+
if (this._previousState && state.animationStateChanged(this._previousState)) {
|
|
1228
|
+
this._previousElements[this._previousState.count - 1].style.top = `${lastStickyNode.position}px`;
|
|
1229
|
+
}
|
|
1230
|
+
else {
|
|
1231
|
+
this._previousStateDisposables.clear();
|
|
1232
|
+
const elements = Array(state.count);
|
|
1233
|
+
for (let stickyIndex = state.count - 1; stickyIndex >= 0; stickyIndex--) {
|
|
1234
|
+
const stickyNode = state.stickyNodes[stickyIndex];
|
|
1235
|
+
const { element, disposable } = this.createElement(stickyNode, stickyIndex, state.count);
|
|
1236
|
+
elements[stickyIndex] = element;
|
|
1237
|
+
this._rootDomNode.appendChild(element);
|
|
1238
|
+
this._previousStateDisposables.add(disposable);
|
|
1239
|
+
}
|
|
1240
|
+
this.stickyScrollFocus.updateElements(elements, state);
|
|
1241
|
+
this._previousElements = elements;
|
|
1242
|
+
}
|
|
1243
|
+
this._previousState = state;
|
|
1159
1244
|
this._rootDomNode.style.height = `${lastStickyNode.position + lastStickyNode.height}px`;
|
|
1160
1245
|
}
|
|
1161
|
-
createElement(stickyNode,
|
|
1162
|
-
const
|
|
1163
|
-
const nodeIndex = this.model.getListIndex(nodeLocation);
|
|
1246
|
+
createElement(stickyNode, stickyIndex, stickyNodesTotal) {
|
|
1247
|
+
const nodeIndex = stickyNode.startIndex;
|
|
1164
1248
|
const stickyElement = document.createElement('div');
|
|
1165
1249
|
stickyElement.style.top = `${stickyNode.position}px`;
|
|
1166
1250
|
stickyElement.style.height = `${stickyNode.height}px`;
|
|
@@ -1170,12 +1254,16 @@ class StickyScrollWidget {
|
|
|
1170
1254
|
stickyElement.setAttribute('data-index', `${nodeIndex}`);
|
|
1171
1255
|
stickyElement.setAttribute('data-parity', nodeIndex % 2 === 0 ? 'even' : 'odd');
|
|
1172
1256
|
stickyElement.setAttribute('id', this.view.getElementID(nodeIndex));
|
|
1257
|
+
this.setAccessibilityAttributes(stickyElement, stickyNode.node.element, stickyIndex, stickyNodesTotal);
|
|
1173
1258
|
const nodeTemplateId = this.treeDelegate.getTemplateId(stickyNode.node);
|
|
1174
1259
|
const renderer = this.treeRenderers.find((renderer) => renderer.templateId === nodeTemplateId);
|
|
1175
1260
|
if (!renderer) {
|
|
1176
1261
|
throw new Error(`No renderer found for template id ${nodeTemplateId}`);
|
|
1177
1262
|
}
|
|
1178
|
-
|
|
1263
|
+
let nodeCopy = stickyNode.node;
|
|
1264
|
+
if (nodeCopy === this.tree.getNode(this.tree.getNodeLocation(stickyNode.node))) {
|
|
1265
|
+
nodeCopy = ( new Proxy(stickyNode.node, {}));
|
|
1266
|
+
}
|
|
1179
1267
|
const templateData = renderer.renderTemplate(stickyElement);
|
|
1180
1268
|
renderer.renderElement(nodeCopy, stickyNode.startIndex, templateData, stickyNode.height);
|
|
1181
1269
|
const disposable = toDisposable(() => {
|
|
@@ -1185,14 +1273,246 @@ class StickyScrollWidget {
|
|
|
1185
1273
|
});
|
|
1186
1274
|
return { element: stickyElement, disposable };
|
|
1187
1275
|
}
|
|
1276
|
+
setAccessibilityAttributes(container, element, stickyIndex, stickyNodesTotal) {
|
|
1277
|
+
if (!this.accessibilityProvider) {
|
|
1278
|
+
return;
|
|
1279
|
+
}
|
|
1280
|
+
if (this.accessibilityProvider.getSetSize) {
|
|
1281
|
+
container.setAttribute('aria-setsize', String(this.accessibilityProvider.getSetSize(element, stickyIndex, stickyNodesTotal)));
|
|
1282
|
+
}
|
|
1283
|
+
if (this.accessibilityProvider.getPosInSet) {
|
|
1284
|
+
container.setAttribute('aria-posinset', String(this.accessibilityProvider.getPosInSet(element, stickyIndex)));
|
|
1285
|
+
}
|
|
1286
|
+
if (this.accessibilityProvider.getRole) {
|
|
1287
|
+
container.setAttribute('role', this.accessibilityProvider.getRole(element) ?? 'treeitem');
|
|
1288
|
+
}
|
|
1289
|
+
const ariaLabel = this.accessibilityProvider.getAriaLabel(element);
|
|
1290
|
+
if (ariaLabel) {
|
|
1291
|
+
container.setAttribute('aria-label', ariaLabel);
|
|
1292
|
+
}
|
|
1293
|
+
const ariaLevel = this.accessibilityProvider.getAriaLevel && this.accessibilityProvider.getAriaLevel(element);
|
|
1294
|
+
if (typeof ariaLevel === 'number') {
|
|
1295
|
+
container.setAttribute('aria-level', `${ariaLevel}`);
|
|
1296
|
+
}
|
|
1297
|
+
container.setAttribute('aria-selected', String(false));
|
|
1298
|
+
}
|
|
1188
1299
|
setVisible(visible) {
|
|
1189
|
-
this._rootDomNode.
|
|
1300
|
+
this._rootDomNode.classList.toggle('empty', !visible);
|
|
1301
|
+
if (!visible) {
|
|
1302
|
+
this.stickyScrollFocus.updateElements([], undefined);
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
getFocus() {
|
|
1306
|
+
return this.stickyScrollFocus.getFocus();
|
|
1307
|
+
}
|
|
1308
|
+
domFocus() {
|
|
1309
|
+
this.stickyScrollFocus.domFocus();
|
|
1310
|
+
}
|
|
1311
|
+
focusedLast() {
|
|
1312
|
+
return this.stickyScrollFocus.focusedLast();
|
|
1190
1313
|
}
|
|
1191
1314
|
dispose() {
|
|
1192
|
-
this.
|
|
1315
|
+
this.stickyScrollFocus.dispose();
|
|
1316
|
+
this._previousStateDisposables.dispose();
|
|
1193
1317
|
this._rootDomNode.remove();
|
|
1194
1318
|
}
|
|
1195
1319
|
}
|
|
1320
|
+
class StickyScrollFocus extends Disposable {
|
|
1321
|
+
get domHasFocus() { return this._domHasFocus; }
|
|
1322
|
+
set domHasFocus(hasFocus) {
|
|
1323
|
+
if (hasFocus !== this._domHasFocus) {
|
|
1324
|
+
this._onDidChangeHasFocus.fire(hasFocus);
|
|
1325
|
+
this._domHasFocus = hasFocus;
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
constructor(container, view) {
|
|
1329
|
+
super();
|
|
1330
|
+
this.container = container;
|
|
1331
|
+
this.view = view;
|
|
1332
|
+
this.focusedIndex = -1;
|
|
1333
|
+
this.elements = [];
|
|
1334
|
+
this._onDidChangeHasFocus = ( new Emitter());
|
|
1335
|
+
this.onDidChangeHasFocus = this._onDidChangeHasFocus.event;
|
|
1336
|
+
this._onContextMenu = ( new Emitter());
|
|
1337
|
+
this.onContextMenu = this._onContextMenu.event;
|
|
1338
|
+
this._domHasFocus = false;
|
|
1339
|
+
this.container.addEventListener('focus', () => this.onFocus());
|
|
1340
|
+
this.container.addEventListener('blur', () => this.onBlur());
|
|
1341
|
+
this._register(this.view.onDidFocus(() => this.toggleStickyScrollFocused(false)));
|
|
1342
|
+
this._register(this.view.onKeyDown((e) => this.onKeyDown(e)));
|
|
1343
|
+
this._register(this.view.onMouseDown((e) => this.onMouseDown(e)));
|
|
1344
|
+
this._register(this.view.onContextMenu((e) => this.handleContextMenu(e)));
|
|
1345
|
+
}
|
|
1346
|
+
handleContextMenu(e) {
|
|
1347
|
+
const target = e.browserEvent.target;
|
|
1348
|
+
if (!isStickyScrollContainer(target) && !isStickyScrollElement(target)) {
|
|
1349
|
+
if (this.focusedLast()) {
|
|
1350
|
+
this.view.domFocus();
|
|
1351
|
+
}
|
|
1352
|
+
return;
|
|
1353
|
+
}
|
|
1354
|
+
if (!isKeyboardEvent(e.browserEvent)) {
|
|
1355
|
+
if (!this.state) {
|
|
1356
|
+
throw new Error('Context menu should not be triggered when state is undefined');
|
|
1357
|
+
}
|
|
1358
|
+
const stickyIndex = this.state.stickyNodes.findIndex(stickyNode => stickyNode.node.element === e.element?.element);
|
|
1359
|
+
if (stickyIndex === -1) {
|
|
1360
|
+
throw new Error('Context menu should not be triggered when element is not in sticky scroll widget');
|
|
1361
|
+
}
|
|
1362
|
+
this.container.focus();
|
|
1363
|
+
this.setFocus(stickyIndex);
|
|
1364
|
+
return;
|
|
1365
|
+
}
|
|
1366
|
+
if (!this.state || this.focusedIndex < 0) {
|
|
1367
|
+
throw new Error('Context menu key should not be triggered when focus is not in sticky scroll widget');
|
|
1368
|
+
}
|
|
1369
|
+
const stickyNode = this.state.stickyNodes[this.focusedIndex];
|
|
1370
|
+
const element = stickyNode.node.element;
|
|
1371
|
+
const anchor = this.elements[this.focusedIndex];
|
|
1372
|
+
this._onContextMenu.fire({ element, anchor, browserEvent: e.browserEvent, isStickyScroll: true });
|
|
1373
|
+
}
|
|
1374
|
+
onKeyDown(e) {
|
|
1375
|
+
if (this.domHasFocus && this.state) {
|
|
1376
|
+
if (e.key === 'ArrowUp') {
|
|
1377
|
+
this.setFocusedElement(Math.max(0, this.focusedIndex - 1));
|
|
1378
|
+
e.preventDefault();
|
|
1379
|
+
e.stopPropagation();
|
|
1380
|
+
}
|
|
1381
|
+
else if (e.key === 'ArrowDown' || e.key === 'ArrowRight') {
|
|
1382
|
+
if (this.focusedIndex >= this.state.count - 1) {
|
|
1383
|
+
const nodeIndexToFocus = this.state.stickyNodes[this.state.count - 1].startIndex + 1;
|
|
1384
|
+
this.view.domFocus();
|
|
1385
|
+
this.view.setFocus([nodeIndexToFocus]);
|
|
1386
|
+
this.scrollNodeUnderWidget(nodeIndexToFocus, this.state);
|
|
1387
|
+
}
|
|
1388
|
+
else {
|
|
1389
|
+
this.setFocusedElement(this.focusedIndex + 1);
|
|
1390
|
+
}
|
|
1391
|
+
e.preventDefault();
|
|
1392
|
+
e.stopPropagation();
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
onMouseDown(e) {
|
|
1397
|
+
const target = e.browserEvent.target;
|
|
1398
|
+
if (!isStickyScrollContainer(target) && !isStickyScrollElement(target)) {
|
|
1399
|
+
return;
|
|
1400
|
+
}
|
|
1401
|
+
e.browserEvent.preventDefault();
|
|
1402
|
+
e.browserEvent.stopPropagation();
|
|
1403
|
+
}
|
|
1404
|
+
updateElements(elements, state) {
|
|
1405
|
+
if (state && state.count === 0) {
|
|
1406
|
+
throw new Error('Sticky scroll state must be undefined when there are no sticky nodes');
|
|
1407
|
+
}
|
|
1408
|
+
if (state && state.count !== elements.length) {
|
|
1409
|
+
throw new Error('Sticky scroll focus received illigel state');
|
|
1410
|
+
}
|
|
1411
|
+
const previousIndex = this.focusedIndex;
|
|
1412
|
+
this.removeFocus();
|
|
1413
|
+
this.elements = elements;
|
|
1414
|
+
this.state = state;
|
|
1415
|
+
if (state) {
|
|
1416
|
+
const newFocusedIndex = clamp(previousIndex, 0, state.count - 1);
|
|
1417
|
+
this.setFocus(newFocusedIndex);
|
|
1418
|
+
}
|
|
1419
|
+
else {
|
|
1420
|
+
if (this.domHasFocus) {
|
|
1421
|
+
this.view.domFocus();
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
this.container.tabIndex = state ? 0 : -1;
|
|
1425
|
+
}
|
|
1426
|
+
setFocusedElement(stickyIndex) {
|
|
1427
|
+
const state = this.state;
|
|
1428
|
+
if (!state) {
|
|
1429
|
+
throw new Error('Cannot set focus when state is undefined');
|
|
1430
|
+
}
|
|
1431
|
+
this.setFocus(stickyIndex);
|
|
1432
|
+
if (stickyIndex < state.count - 1) {
|
|
1433
|
+
return;
|
|
1434
|
+
}
|
|
1435
|
+
if (state.lastNodePartiallyVisible()) {
|
|
1436
|
+
const lastStickyNode = state.stickyNodes[stickyIndex];
|
|
1437
|
+
this.scrollNodeUnderWidget(lastStickyNode.endIndex + 1, state);
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
scrollNodeUnderWidget(nodeIndex, state) {
|
|
1441
|
+
const lastStickyNode = state.stickyNodes[state.count - 1];
|
|
1442
|
+
const secondLastStickyNode = state.count > 1 ? state.stickyNodes[state.count - 2] : undefined;
|
|
1443
|
+
const elementScrollTop = this.view.getElementTop(nodeIndex);
|
|
1444
|
+
const elementTargetViewTop = secondLastStickyNode ? secondLastStickyNode.position + secondLastStickyNode.height + lastStickyNode.height : lastStickyNode.height;
|
|
1445
|
+
this.view.scrollTop = elementScrollTop - elementTargetViewTop;
|
|
1446
|
+
}
|
|
1447
|
+
getFocus() {
|
|
1448
|
+
if (!this.state || this.focusedIndex === -1) {
|
|
1449
|
+
return undefined;
|
|
1450
|
+
}
|
|
1451
|
+
return this.state.stickyNodes[this.focusedIndex].node.element;
|
|
1452
|
+
}
|
|
1453
|
+
domFocus() {
|
|
1454
|
+
if (!this.state) {
|
|
1455
|
+
throw new Error('Cannot focus when state is undefined');
|
|
1456
|
+
}
|
|
1457
|
+
this.container.focus();
|
|
1458
|
+
}
|
|
1459
|
+
focusedLast() {
|
|
1460
|
+
if (!this.state) {
|
|
1461
|
+
return false;
|
|
1462
|
+
}
|
|
1463
|
+
return this.view.getHTMLElement().classList.contains('sticky-scroll-focused');
|
|
1464
|
+
}
|
|
1465
|
+
removeFocus() {
|
|
1466
|
+
if (this.focusedIndex === -1) {
|
|
1467
|
+
return;
|
|
1468
|
+
}
|
|
1469
|
+
this.toggleElementFocus(this.elements[this.focusedIndex], false);
|
|
1470
|
+
this.focusedIndex = -1;
|
|
1471
|
+
}
|
|
1472
|
+
setFocus(newFocusIndex) {
|
|
1473
|
+
if (0 > newFocusIndex) {
|
|
1474
|
+
throw new Error('addFocus() can not remove focus');
|
|
1475
|
+
}
|
|
1476
|
+
if (!this.state && newFocusIndex >= 0) {
|
|
1477
|
+
throw new Error('Cannot set focus index when state is undefined');
|
|
1478
|
+
}
|
|
1479
|
+
if (this.state && newFocusIndex >= this.state.count) {
|
|
1480
|
+
throw new Error('Cannot set focus index to an index that does not exist');
|
|
1481
|
+
}
|
|
1482
|
+
const oldIndex = this.focusedIndex;
|
|
1483
|
+
if (oldIndex >= 0) {
|
|
1484
|
+
this.toggleElementFocus(this.elements[oldIndex], false);
|
|
1485
|
+
}
|
|
1486
|
+
if (newFocusIndex >= 0) {
|
|
1487
|
+
this.toggleElementFocus(this.elements[newFocusIndex], true);
|
|
1488
|
+
}
|
|
1489
|
+
this.focusedIndex = newFocusIndex;
|
|
1490
|
+
}
|
|
1491
|
+
toggleElementFocus(element, focused) {
|
|
1492
|
+
element.classList.toggle('focused', focused);
|
|
1493
|
+
}
|
|
1494
|
+
toggleStickyScrollFocused(focused) {
|
|
1495
|
+
this.view.getHTMLElement().classList.toggle('sticky-scroll-focused', focused);
|
|
1496
|
+
}
|
|
1497
|
+
onFocus() {
|
|
1498
|
+
if (!this.state || this.elements.length === 0) {
|
|
1499
|
+
throw new Error('Cannot focus when state is undefined or elements are empty');
|
|
1500
|
+
}
|
|
1501
|
+
this.domHasFocus = true;
|
|
1502
|
+
this.toggleStickyScrollFocused(true);
|
|
1503
|
+
if (this.focusedIndex === -1) {
|
|
1504
|
+
this.setFocus(0);
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
onBlur() {
|
|
1508
|
+
this.domHasFocus = false;
|
|
1509
|
+
}
|
|
1510
|
+
dispose() {
|
|
1511
|
+
this.toggleStickyScrollFocused(false);
|
|
1512
|
+
this._onDidChangeHasFocus.fire(false);
|
|
1513
|
+
super.dispose();
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1196
1516
|
function asTreeMouseEvent(event) {
|
|
1197
1517
|
let target = TreeMouseEventTarget.Unknown;
|
|
1198
1518
|
if (hasParentWithClass(event.browserEvent.target, 'monaco-tl-twistie', 'monaco-tl-row')) {
|
|
@@ -1211,10 +1531,12 @@ function asTreeMouseEvent(event) {
|
|
|
1211
1531
|
};
|
|
1212
1532
|
}
|
|
1213
1533
|
function asTreeContextMenuEvent(event) {
|
|
1534
|
+
const isStickyScroll = isStickyScrollContainer(event.browserEvent.target);
|
|
1214
1535
|
return {
|
|
1215
1536
|
element: event.element ? event.element.element : null,
|
|
1216
1537
|
browserEvent: event.browserEvent,
|
|
1217
|
-
anchor: event.anchor
|
|
1538
|
+
anchor: event.anchor,
|
|
1539
|
+
isStickyScroll
|
|
1218
1540
|
};
|
|
1219
1541
|
}
|
|
1220
1542
|
function dfs(node, fn) {
|
|
@@ -1379,6 +1701,7 @@ class TreeNodeListMouseController extends MouseController {
|
|
|
1379
1701
|
const elementScrollTop = this.list.getElementTop(nodeIndex);
|
|
1380
1702
|
const elementTargetViewTop = stickyScrollController.nodePositionTopBelowWidget(node);
|
|
1381
1703
|
this.tree.scrollTop = elementScrollTop - elementTargetViewTop;
|
|
1704
|
+
this.list.domFocus();
|
|
1382
1705
|
this.list.setFocus([nodeIndex]);
|
|
1383
1706
|
this.list.setSelection([nodeIndex]);
|
|
1384
1707
|
}
|
|
@@ -1392,6 +1715,20 @@ class TreeNodeListMouseController extends MouseController {
|
|
|
1392
1715
|
}
|
|
1393
1716
|
super.onDoubleClick(e);
|
|
1394
1717
|
}
|
|
1718
|
+
onMouseDown(e) {
|
|
1719
|
+
const target = e.browserEvent.target;
|
|
1720
|
+
if (!isStickyScrollContainer(target) && !isStickyScrollElement(target)) {
|
|
1721
|
+
super.onMouseDown(e);
|
|
1722
|
+
return;
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
onContextMenu(e) {
|
|
1726
|
+
const target = e.browserEvent.target;
|
|
1727
|
+
if (!isStickyScrollContainer(target) && !isStickyScrollElement(target)) {
|
|
1728
|
+
super.onContextMenu(e);
|
|
1729
|
+
return;
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1395
1732
|
}
|
|
1396
1733
|
class TreeNodeList extends List {
|
|
1397
1734
|
constructor(user, container, virtualDelegate, renderers, focusTrait, selectionTrait, anchorTrait, options) {
|
|
@@ -1462,7 +1799,7 @@ class AbstractTree {
|
|
|
1462
1799
|
get onDidChangeSelection() { return this.eventBufferer.wrapEvent(this.selection.onDidChange); }
|
|
1463
1800
|
get onMouseClick() { return ( Event.map(this.view.onMouseClick, asTreeMouseEvent)); }
|
|
1464
1801
|
get onMouseDblClick() { return Event.filter(( Event.map(this.view.onMouseDblClick, asTreeMouseEvent)), e => e.target !== TreeMouseEventTarget.Filter); }
|
|
1465
|
-
get onContextMenu() { return ( Event.map(this.view.onContextMenu, asTreeContextMenuEvent)); }
|
|
1802
|
+
get onContextMenu() { return Event.any(Event.filter(( Event.map(this.view.onContextMenu, asTreeContextMenuEvent)), e => !e.isStickyScroll), this.stickyScrollController?.onContextMenu ?? Event.None); }
|
|
1466
1803
|
get onTap() { return ( Event.map(this.view.onTap, asTreeMouseEvent)); }
|
|
1467
1804
|
get onPointer() { return ( Event.map(this.view.onPointer, asTreeMouseEvent)); }
|
|
1468
1805
|
get onKeyDown() { return this.view.onKeyDown; }
|
|
@@ -1490,6 +1827,7 @@ class AbstractTree {
|
|
|
1490
1827
|
this._options = _options;
|
|
1491
1828
|
this.eventBufferer = ( new EventBufferer());
|
|
1492
1829
|
this.onDidChangeFindOpenState = Event.None;
|
|
1830
|
+
this.onDidChangeStickyScrollFocused = Event.None;
|
|
1493
1831
|
this.disposables = ( new DisposableStore());
|
|
1494
1832
|
this._onWillRefilter = ( new Emitter());
|
|
1495
1833
|
this.onWillRefilter = this._onWillRefilter.event;
|
|
@@ -1576,6 +1914,7 @@ class AbstractTree {
|
|
|
1576
1914
|
}
|
|
1577
1915
|
if (_options.enableStickyScroll) {
|
|
1578
1916
|
this.stickyScrollController = ( new StickyScrollController(this, this.model, this.view, this.renderers, this.treeDelegate, _options));
|
|
1917
|
+
this.onDidChangeStickyScrollFocused = this.stickyScrollController.onDidChangeHasFocus;
|
|
1579
1918
|
}
|
|
1580
1919
|
this.styleElement = createStyleSheet(this.view.getHTMLElement());
|
|
1581
1920
|
this.getHTMLElement().classList.toggle('always', this._options.renderIndentGuides === RenderIndentGuides.Always);
|
|
@@ -1604,8 +1943,10 @@ class AbstractTree {
|
|
|
1604
1943
|
this.treeDelegate,
|
|
1605
1944
|
this._options
|
|
1606
1945
|
));
|
|
1946
|
+
this.onDidChangeStickyScrollFocused = this.stickyScrollController.onDidChangeHasFocus;
|
|
1607
1947
|
}
|
|
1608
1948
|
else if (this.stickyScrollController && !this._options.enableStickyScroll) {
|
|
1949
|
+
this.onDidChangeStickyScrollFocused = Event.None;
|
|
1609
1950
|
this.stickyScrollController.dispose();
|
|
1610
1951
|
this.stickyScrollController = undefined;
|
|
1611
1952
|
}
|
|
@@ -1677,7 +2018,12 @@ class AbstractTree {
|
|
|
1677
2018
|
return this.selection.getNodes().length;
|
|
1678
2019
|
}
|
|
1679
2020
|
domFocus() {
|
|
1680
|
-
this.
|
|
2021
|
+
if (this.stickyScrollController?.focusedLast()) {
|
|
2022
|
+
this.stickyScrollController.domFocus();
|
|
2023
|
+
}
|
|
2024
|
+
else {
|
|
2025
|
+
this.view.domFocus();
|
|
2026
|
+
}
|
|
1681
2027
|
}
|
|
1682
2028
|
isDOMFocused() {
|
|
1683
2029
|
return isActiveElement(this.getHTMLElement());
|
|
@@ -1699,6 +2045,21 @@ class AbstractTree {
|
|
|
1699
2045
|
content.push(`.monaco-list${suffix} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${styles.listBackground}; }`);
|
|
1700
2046
|
content.push(`.monaco-list${suffix} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${styles.listBackground}; }`);
|
|
1701
2047
|
}
|
|
2048
|
+
if (styles.listFocusForeground) {
|
|
2049
|
+
content.push(`.monaco-list${suffix}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${styles.listFocusForeground}; }`);
|
|
2050
|
+
content.push(`.monaco-list${suffix}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`);
|
|
2051
|
+
}
|
|
2052
|
+
const focusAndSelectionOutline = asCssValueWithDefault(styles.listFocusAndSelectionOutline, asCssValueWithDefault(styles.listSelectionOutline, styles.listFocusOutline ?? ''));
|
|
2053
|
+
if (focusAndSelectionOutline) {
|
|
2054
|
+
content.push(`.monaco-list${suffix}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${focusAndSelectionOutline}; outline-offset: -1px;}`);
|
|
2055
|
+
content.push(`.monaco-list${suffix}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`);
|
|
2056
|
+
}
|
|
2057
|
+
if (styles.listFocusOutline) {
|
|
2058
|
+
content.push(`.monaco-list${suffix}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${styles.listFocusOutline}; outline-offset: -1px; }`);
|
|
2059
|
+
content.push(`.monaco-list${suffix}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`);
|
|
2060
|
+
content.push(`.monaco-workbench.context-menu-visible .monaco-list${suffix}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`);
|
|
2061
|
+
content.push(`.monaco-workbench.context-menu-visible .monaco-list${suffix}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`);
|
|
2062
|
+
}
|
|
1702
2063
|
this.styleElement.textContent = content.join('\n');
|
|
1703
2064
|
this.view.style(styles);
|
|
1704
2065
|
}
|
|
@@ -1760,52 +2121,65 @@ class AbstractTree {
|
|
|
1760
2121
|
if (typeof element === 'undefined') {
|
|
1761
2122
|
return this.view.setAnchor(undefined);
|
|
1762
2123
|
}
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
2124
|
+
this.eventBufferer.bufferEvents(() => {
|
|
2125
|
+
const node = this.model.getNode(element);
|
|
2126
|
+
this.anchor.set([node]);
|
|
2127
|
+
const index = this.model.getListIndex(element);
|
|
2128
|
+
if (index > -1) {
|
|
2129
|
+
this.view.setAnchor(index, true);
|
|
2130
|
+
}
|
|
2131
|
+
});
|
|
1769
2132
|
}
|
|
1770
2133
|
getAnchor() {
|
|
1771
2134
|
return firstOrDefault(this.anchor.get(), undefined);
|
|
1772
2135
|
}
|
|
1773
2136
|
setSelection(elements, browserEvent) {
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
2137
|
+
this.eventBufferer.bufferEvents(() => {
|
|
2138
|
+
const nodes = ( elements.map(e => this.model.getNode(e)));
|
|
2139
|
+
this.selection.set(nodes, browserEvent);
|
|
2140
|
+
const indexes = ( elements.map(e => this.model.getListIndex(e))).filter(i => i > -1);
|
|
2141
|
+
this.view.setSelection(indexes, browserEvent, true);
|
|
2142
|
+
});
|
|
1778
2143
|
}
|
|
1779
2144
|
getSelection() {
|
|
1780
2145
|
return this.selection.get();
|
|
1781
2146
|
}
|
|
1782
2147
|
setFocus(elements, browserEvent) {
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
2148
|
+
this.eventBufferer.bufferEvents(() => {
|
|
2149
|
+
const nodes = ( elements.map(e => this.model.getNode(e)));
|
|
2150
|
+
this.focus.set(nodes, browserEvent);
|
|
2151
|
+
const indexes = ( elements.map(e => this.model.getListIndex(e))).filter(i => i > -1);
|
|
2152
|
+
this.view.setFocus(indexes, browserEvent, true);
|
|
2153
|
+
});
|
|
1787
2154
|
}
|
|
1788
|
-
focusNext(n = 1, loop = false, browserEvent, filter = this.focusNavigationFilter) {
|
|
2155
|
+
focusNext(n = 1, loop = false, browserEvent, filter = (isKeyboardEvent(browserEvent) && browserEvent.altKey) ? undefined : this.focusNavigationFilter) {
|
|
1789
2156
|
this.view.focusNext(n, loop, browserEvent, filter);
|
|
1790
2157
|
}
|
|
1791
|
-
focusPrevious(n = 1, loop = false, browserEvent, filter = this.focusNavigationFilter) {
|
|
2158
|
+
focusPrevious(n = 1, loop = false, browserEvent, filter = (isKeyboardEvent(browserEvent) && browserEvent.altKey) ? undefined : this.focusNavigationFilter) {
|
|
1792
2159
|
this.view.focusPrevious(n, loop, browserEvent, filter);
|
|
1793
2160
|
}
|
|
1794
|
-
focusNextPage(browserEvent, filter = this.focusNavigationFilter) {
|
|
2161
|
+
focusNextPage(browserEvent, filter = (isKeyboardEvent(browserEvent) && browserEvent.altKey) ? undefined : this.focusNavigationFilter) {
|
|
1795
2162
|
return this.view.focusNextPage(browserEvent, filter);
|
|
1796
2163
|
}
|
|
1797
|
-
focusPreviousPage(browserEvent, filter = this.focusNavigationFilter) {
|
|
1798
|
-
return this.view.focusPreviousPage(browserEvent, filter);
|
|
2164
|
+
focusPreviousPage(browserEvent, filter = (isKeyboardEvent(browserEvent) && browserEvent.altKey) ? undefined : this.focusNavigationFilter) {
|
|
2165
|
+
return this.view.focusPreviousPage(browserEvent, filter, () => this.stickyScrollController?.height ?? 0);
|
|
1799
2166
|
}
|
|
1800
|
-
focusLast(browserEvent, filter = this.focusNavigationFilter) {
|
|
2167
|
+
focusLast(browserEvent, filter = (isKeyboardEvent(browserEvent) && browserEvent.altKey) ? undefined : this.focusNavigationFilter) {
|
|
1801
2168
|
this.view.focusLast(browserEvent, filter);
|
|
1802
2169
|
}
|
|
1803
|
-
focusFirst(browserEvent, filter = this.focusNavigationFilter) {
|
|
2170
|
+
focusFirst(browserEvent, filter = (isKeyboardEvent(browserEvent) && browserEvent.altKey) ? undefined : this.focusNavigationFilter) {
|
|
1804
2171
|
this.view.focusFirst(browserEvent, filter);
|
|
1805
2172
|
}
|
|
1806
2173
|
getFocus() {
|
|
1807
2174
|
return this.focus.get();
|
|
1808
2175
|
}
|
|
2176
|
+
getStickyScrollFocus() {
|
|
2177
|
+
const focus = this.stickyScrollController?.getFocus();
|
|
2178
|
+
return focus !== undefined ? [focus] : [];
|
|
2179
|
+
}
|
|
2180
|
+
getFocusedPart() {
|
|
2181
|
+
return this.stickyScrollController?.focusedLast() ? 1 : 0 ;
|
|
2182
|
+
}
|
|
1809
2183
|
reveal(location, relativeTop) {
|
|
1810
2184
|
this.model.expandTo(location);
|
|
1811
2185
|
const index = this.model.getListIndex(location);
|