@codingame/monaco-vscode-api 2.0.3 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +3 -19
- 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/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
|
@@ -0,0 +1,1626 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import './media/multieditortabscontrol.css.js';
|
|
3
|
+
import { isWindows, isMacintosh } from '../../../../base/common/platform.js';
|
|
4
|
+
import { shorten } from '../../../../base/common/labels.js';
|
|
5
|
+
import { EditorResourceAccessor, SideBySideEditor, DEFAULT_EDITOR_ASSOCIATION, preventEditorClose, EditorCloseMethod } from '../../../common/editor.js';
|
|
6
|
+
import { computeEditorAriaLabel } from '../../editor.js';
|
|
7
|
+
import { StandardKeyboardEvent } from '../../../../base/browser/keyboardEvent.js';
|
|
8
|
+
import { Gesture, EventType } from '../../../../base/browser/touch.js';
|
|
9
|
+
import { ResourceLabels, DEFAULT_LABELS_CONTAINER } from '../../labels.js';
|
|
10
|
+
import { ActionBar } from '../../../../base/browser/ui/actionbar/actionbar.js';
|
|
11
|
+
import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js';
|
|
12
|
+
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
|
|
13
|
+
import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';
|
|
14
|
+
import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
|
|
15
|
+
import { MenuId } from '../../../../platform/actions/common/actions.js';
|
|
16
|
+
import { EditorTabsControl, EditorCommandsContextActionRunner } from './editorTabsControl.js';
|
|
17
|
+
import { IQuickInputService } from '../../../../platform/quickinput/common/quickInput.js';
|
|
18
|
+
import { MutableDisposable, DisposableStore, dispose, combinedDisposable, toDisposable } from '../../../../base/common/lifecycle.js';
|
|
19
|
+
import { ScrollableElement } from '../../../../base/browser/ui/scrollbar/scrollableElement.js';
|
|
20
|
+
import { getOrSet } from '../../../../base/common/map.js';
|
|
21
|
+
import { registerThemingParticipant, IThemeService } from '../../../../platform/theme/common/themeService.js';
|
|
22
|
+
import { TAB_ACTIVE_BACKGROUND, TAB_INACTIVE_BACKGROUND, EDITOR_DRAG_AND_DROP_BACKGROUND, EDITOR_GROUP_HEADER_TABS_BORDER, TAB_BORDER, TAB_UNFOCUSED_ACTIVE_BACKGROUND, TAB_ACTIVE_BORDER, TAB_UNFOCUSED_ACTIVE_BORDER, TAB_ACTIVE_BORDER_TOP, TAB_UNFOCUSED_ACTIVE_BORDER_TOP, TAB_ACTIVE_FOREGROUND, TAB_UNFOCUSED_ACTIVE_FOREGROUND, TAB_UNFOCUSED_INACTIVE_BACKGROUND, TAB_INACTIVE_FOREGROUND, TAB_UNFOCUSED_INACTIVE_FOREGROUND, TAB_ACTIVE_MODIFIED_BORDER, TAB_INACTIVE_MODIFIED_BORDER, TAB_UNFOCUSED_ACTIVE_MODIFIED_BORDER, TAB_UNFOCUSED_INACTIVE_MODIFIED_BORDER, TAB_LAST_PINNED_BORDER, TAB_HOVER_BACKGROUND, TAB_UNFOCUSED_HOVER_BACKGROUND, TAB_HOVER_FOREGROUND, TAB_UNFOCUSED_HOVER_FOREGROUND, TAB_HOVER_BORDER, TAB_UNFOCUSED_HOVER_BORDER, EDITOR_GROUP_HEADER_TABS_BACKGROUND, WORKBENCH_BACKGROUND } from '../../../common/theme.js';
|
|
23
|
+
import { activeContrastBorder, contrastBorder, editorBackground } from '../../../../platform/theme/common/colorRegistry.js';
|
|
24
|
+
import { DraggedEditorIdentifier, DraggedEditorGroupIdentifier, isWindowDraggedOver, extractTreeDropData, ResourcesDropHandler } from '../../dnd.js';
|
|
25
|
+
import { INotificationService } from '../../../../platform/notification/common/notification.js';
|
|
26
|
+
import { Dimension, addDisposableListener, EventType as EventType$1, DragAndDropObserver, clearNode, scheduleAtNextAnimationFrame, getWindow, isMouseEvent, findParentWithClass, EventHelper } from '../../../../base/browser/dom.js';
|
|
27
|
+
import { localizeWithPath } from '../../../../nls.js';
|
|
28
|
+
import { CloseOneEditorAction, UnpinEditorAction } from './editorActions.js';
|
|
29
|
+
import { assertAllDefined, assertIsDefined } from '../../../../base/common/types.js';
|
|
30
|
+
import { IEditorService } from '../../../services/editor/common/editorService.js';
|
|
31
|
+
import { basenameOrAuthority } from '../../../../base/common/resources.js';
|
|
32
|
+
import { RunOnceScheduler } from '../../../../base/common/async.js';
|
|
33
|
+
import { IPathService } from '../../../services/path/common/pathService.js';
|
|
34
|
+
import { win32, posix } from '../../../../base/common/path.js';
|
|
35
|
+
import { insert, coalesce } from '../../../../base/common/arrays.js';
|
|
36
|
+
import { isHighContrast } from '../../../../platform/theme/common/theme.js';
|
|
37
|
+
import { isSafari } from '../../../../base/browser/browser.js';
|
|
38
|
+
import { equals } from '../../../../base/common/objects.js';
|
|
39
|
+
import { EditorActivation } from '../../../../platform/editor/common/editor.js';
|
|
40
|
+
import { UNLOCK_GROUP_COMMAND_ID } from './editorCommands.js';
|
|
41
|
+
import { StandardMouseEvent } from '../../../../base/browser/mouseEvent.js';
|
|
42
|
+
import { ITreeViewsDnDService } from '../../../../editor/common/services/treeViewsDndService.js';
|
|
43
|
+
import { DraggedTreeItemsIdentifier } from '../../../../editor/common/services/treeViewsDnd.js';
|
|
44
|
+
import { IEditorResolverService } from '../../../services/editor/common/editorResolverService.js';
|
|
45
|
+
import { StickyEditorGroupModel, UnstickyEditorGroupModel } from '../../../common/editor/filteredEditorGroupModel.js';
|
|
46
|
+
import { IHostService } from '../../../services/host/browser/host.js';
|
|
47
|
+
var MultiEditorTabsControl_1;
|
|
48
|
+
let MultiEditorTabsControl = class MultiEditorTabsControl extends EditorTabsControl {
|
|
49
|
+
static { MultiEditorTabsControl_1 = this; }
|
|
50
|
+
static { this.SCROLLBAR_SIZES = {
|
|
51
|
+
default: 3,
|
|
52
|
+
large: 10
|
|
53
|
+
}; }
|
|
54
|
+
static { this.TAB_WIDTH = {
|
|
55
|
+
compact: 38,
|
|
56
|
+
shrink: 80,
|
|
57
|
+
fit: 120
|
|
58
|
+
}; }
|
|
59
|
+
static { this.DRAG_OVER_OPEN_TAB_THRESHOLD = 1500; }
|
|
60
|
+
static { this.MOUSE_WHEEL_EVENT_THRESHOLD = 150; }
|
|
61
|
+
static { this.MOUSE_WHEEL_DISTANCE_THRESHOLD = 1.5; }
|
|
62
|
+
constructor(parent, editorPartsView, groupsView, groupView, tabsModel, contextMenuService, instantiationService, contextKeyService, keybindingService, notificationService, quickInputService, themeService, editorService, pathService, treeViewsDragAndDropService, editorResolverService, hostService) {
|
|
63
|
+
super(parent, editorPartsView, groupsView, groupView, tabsModel, contextMenuService, instantiationService, contextKeyService, keybindingService, notificationService, quickInputService, themeService, editorResolverService, hostService);
|
|
64
|
+
this.editorService = editorService;
|
|
65
|
+
this.pathService = pathService;
|
|
66
|
+
this.treeViewsDragAndDropService = treeViewsDragAndDropService;
|
|
67
|
+
this.closeEditorAction = this._register(this.instantiationService.createInstance(CloseOneEditorAction, CloseOneEditorAction.ID, CloseOneEditorAction.LABEL));
|
|
68
|
+
this.unpinEditorAction = this._register(this.instantiationService.createInstance(UnpinEditorAction, UnpinEditorAction.ID, UnpinEditorAction.LABEL));
|
|
69
|
+
this.tabResourceLabels = this._register(this.instantiationService.createInstance(ResourceLabels, DEFAULT_LABELS_CONTAINER));
|
|
70
|
+
this.tabLabels = [];
|
|
71
|
+
this.tabActionBars = [];
|
|
72
|
+
this.tabDisposables = [];
|
|
73
|
+
this.dimensions = {
|
|
74
|
+
container: Dimension.None,
|
|
75
|
+
available: Dimension.None
|
|
76
|
+
};
|
|
77
|
+
this.layoutScheduler = this._register(( new MutableDisposable()));
|
|
78
|
+
this.path = isWindows ? win32 : posix;
|
|
79
|
+
this.lastMouseWheelEventTime = 0;
|
|
80
|
+
this.isMouseOverTabs = false;
|
|
81
|
+
this.updateEditorLabelScheduler = this._register(( new RunOnceScheduler(() => this.doUpdateEditorLabels(), 0)));
|
|
82
|
+
(async () => this.path = await this.pathService.path)();
|
|
83
|
+
this._register(this.tabResourceLabels.onDidChangeDecorations(() => this.doHandleDecorationsChange()));
|
|
84
|
+
}
|
|
85
|
+
create(parent) {
|
|
86
|
+
super.create(parent);
|
|
87
|
+
this.titleContainer = parent;
|
|
88
|
+
this.tabsAndActionsContainer = document.createElement('div');
|
|
89
|
+
this.tabsAndActionsContainer.classList.add('tabs-and-actions-container');
|
|
90
|
+
this.titleContainer.appendChild(this.tabsAndActionsContainer);
|
|
91
|
+
this.tabsContainer = document.createElement('div');
|
|
92
|
+
this.tabsContainer.setAttribute('role', 'tablist');
|
|
93
|
+
this.tabsContainer.draggable = true;
|
|
94
|
+
this.tabsContainer.classList.add('tabs-container');
|
|
95
|
+
this._register(Gesture.addTarget(this.tabsContainer));
|
|
96
|
+
this.tabSizingFixedDisposables = this._register(( new DisposableStore()));
|
|
97
|
+
this.updateTabSizing(false);
|
|
98
|
+
this.tabsScrollbar = this.createTabsScrollbar(this.tabsContainer);
|
|
99
|
+
this.tabsAndActionsContainer.appendChild(this.tabsScrollbar.getDomNode());
|
|
100
|
+
this.registerTabsContainerListeners(this.tabsContainer, this.tabsScrollbar);
|
|
101
|
+
this.createEditorActionsToolBar(this.tabsAndActionsContainer, ['editor-actions']);
|
|
102
|
+
this.updateTabsControlVisibility();
|
|
103
|
+
}
|
|
104
|
+
createTabsScrollbar(scrollable) {
|
|
105
|
+
const tabsScrollbar = this._register(( new ScrollableElement(scrollable, {
|
|
106
|
+
horizontal: 1 ,
|
|
107
|
+
horizontalScrollbarSize: this.getTabsScrollbarSizing(),
|
|
108
|
+
vertical: 2 ,
|
|
109
|
+
scrollYToX: true,
|
|
110
|
+
useShadows: false
|
|
111
|
+
})));
|
|
112
|
+
this._register(tabsScrollbar.onScroll(e => {
|
|
113
|
+
if (e.scrollLeftChanged) {
|
|
114
|
+
scrollable.scrollLeft = e.scrollLeft;
|
|
115
|
+
}
|
|
116
|
+
}));
|
|
117
|
+
return tabsScrollbar;
|
|
118
|
+
}
|
|
119
|
+
updateTabsScrollbarSizing() {
|
|
120
|
+
this.tabsScrollbar?.updateOptions({
|
|
121
|
+
horizontalScrollbarSize: this.getTabsScrollbarSizing()
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
updateTabSizing(fromEvent) {
|
|
125
|
+
const [tabsContainer, tabSizingFixedDisposables] = assertAllDefined(this.tabsContainer, this.tabSizingFixedDisposables);
|
|
126
|
+
tabSizingFixedDisposables.clear();
|
|
127
|
+
const options = this.groupsView.partOptions;
|
|
128
|
+
if (options.tabSizing === 'fixed') {
|
|
129
|
+
tabsContainer.style.setProperty('--tab-sizing-fixed-min-width', `${options.tabSizingFixedMinWidth}px`);
|
|
130
|
+
tabsContainer.style.setProperty('--tab-sizing-fixed-max-width', `${options.tabSizingFixedMaxWidth}px`);
|
|
131
|
+
tabSizingFixedDisposables.add(addDisposableListener(tabsContainer, EventType$1.MOUSE_ENTER, () => {
|
|
132
|
+
this.isMouseOverTabs = true;
|
|
133
|
+
}));
|
|
134
|
+
tabSizingFixedDisposables.add(addDisposableListener(tabsContainer, EventType$1.MOUSE_LEAVE, () => {
|
|
135
|
+
this.isMouseOverTabs = false;
|
|
136
|
+
this.updateTabsFixedWidth(false);
|
|
137
|
+
}));
|
|
138
|
+
}
|
|
139
|
+
else if (fromEvent) {
|
|
140
|
+
tabsContainer.style.removeProperty('--tab-sizing-fixed-min-width');
|
|
141
|
+
tabsContainer.style.removeProperty('--tab-sizing-fixed-max-width');
|
|
142
|
+
this.updateTabsFixedWidth(false);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
updateTabsFixedWidth(fixed) {
|
|
146
|
+
this.forEachTab((editor, tabIndex, tabContainer) => {
|
|
147
|
+
if (fixed) {
|
|
148
|
+
const { width } = tabContainer.getBoundingClientRect();
|
|
149
|
+
tabContainer.style.setProperty('--tab-sizing-current-width', `${width}px`);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
tabContainer.style.removeProperty('--tab-sizing-current-width');
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
getTabsScrollbarSizing() {
|
|
157
|
+
if (this.groupsView.partOptions.titleScrollbarSizing !== 'large') {
|
|
158
|
+
return MultiEditorTabsControl_1.SCROLLBAR_SIZES.default;
|
|
159
|
+
}
|
|
160
|
+
return MultiEditorTabsControl_1.SCROLLBAR_SIZES.large;
|
|
161
|
+
}
|
|
162
|
+
registerTabsContainerListeners(tabsContainer, tabsScrollbar) {
|
|
163
|
+
this._register(addDisposableListener(tabsContainer, EventType$1.SCROLL, () => {
|
|
164
|
+
if (tabsContainer.classList.contains('scroll')) {
|
|
165
|
+
tabsScrollbar.setScrollPosition({
|
|
166
|
+
scrollLeft: tabsContainer.scrollLeft
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}));
|
|
170
|
+
for (const eventType of [EventType.Tap, EventType$1.DBLCLICK]) {
|
|
171
|
+
this._register(addDisposableListener(tabsContainer, eventType, (e) => {
|
|
172
|
+
if (eventType === EventType$1.DBLCLICK) {
|
|
173
|
+
if (e.target !== tabsContainer) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
if (e.tapCount !== 2) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (e.initialTarget !== tabsContainer) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
EventHelper.stop(e);
|
|
186
|
+
this.editorService.openEditor({
|
|
187
|
+
resource: undefined,
|
|
188
|
+
options: {
|
|
189
|
+
pinned: true,
|
|
190
|
+
index: this.groupView.count,
|
|
191
|
+
override: DEFAULT_EDITOR_ASSOCIATION.id
|
|
192
|
+
}
|
|
193
|
+
}, this.groupView.id);
|
|
194
|
+
}));
|
|
195
|
+
}
|
|
196
|
+
this._register(addDisposableListener(tabsContainer, EventType$1.MOUSE_DOWN, e => {
|
|
197
|
+
if (e.button === 1) {
|
|
198
|
+
e.preventDefault();
|
|
199
|
+
}
|
|
200
|
+
}));
|
|
201
|
+
let lastDragEvent = undefined;
|
|
202
|
+
let isNewWindowOperation = false;
|
|
203
|
+
this._register(( new DragAndDropObserver(tabsContainer, {
|
|
204
|
+
onDragStart: e => {
|
|
205
|
+
isNewWindowOperation = this.onGroupDragStart(e, tabsContainer);
|
|
206
|
+
},
|
|
207
|
+
onDrag: e => {
|
|
208
|
+
lastDragEvent = e;
|
|
209
|
+
},
|
|
210
|
+
onDragEnter: e => {
|
|
211
|
+
tabsContainer.classList.add('scroll');
|
|
212
|
+
if (e.target !== tabsContainer) {
|
|
213
|
+
this.updateDropFeedback(tabsContainer, false);
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
if (!this.isSupportedDropTransfer(e)) {
|
|
217
|
+
if (e.dataTransfer) {
|
|
218
|
+
e.dataTransfer.dropEffect = 'none';
|
|
219
|
+
}
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
let isLocalDragAndDrop = false;
|
|
223
|
+
if (this.editorTransfer.hasData(DraggedEditorIdentifier.prototype)) {
|
|
224
|
+
isLocalDragAndDrop = true;
|
|
225
|
+
const data = this.editorTransfer.getData(DraggedEditorIdentifier.prototype);
|
|
226
|
+
if (Array.isArray(data)) {
|
|
227
|
+
const localDraggedEditor = data[0].identifier;
|
|
228
|
+
if (this.groupView.id === localDraggedEditor.groupId && this.tabsModel.isLast(localDraggedEditor.editor)) {
|
|
229
|
+
if (e.dataTransfer) {
|
|
230
|
+
e.dataTransfer.dropEffect = 'none';
|
|
231
|
+
}
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
if (!isLocalDragAndDrop) {
|
|
237
|
+
if (e.dataTransfer) {
|
|
238
|
+
e.dataTransfer.dropEffect = 'copy';
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
this.updateDropFeedback(tabsContainer, true);
|
|
242
|
+
},
|
|
243
|
+
onDragLeave: e => {
|
|
244
|
+
this.updateDropFeedback(tabsContainer, false);
|
|
245
|
+
tabsContainer.classList.remove('scroll');
|
|
246
|
+
},
|
|
247
|
+
onDragEnd: e => {
|
|
248
|
+
this.updateDropFeedback(tabsContainer, false);
|
|
249
|
+
tabsContainer.classList.remove('scroll');
|
|
250
|
+
this.onGroupDragEnd(e, lastDragEvent, tabsContainer, isNewWindowOperation);
|
|
251
|
+
},
|
|
252
|
+
onDrop: e => {
|
|
253
|
+
this.updateDropFeedback(tabsContainer, false);
|
|
254
|
+
tabsContainer.classList.remove('scroll');
|
|
255
|
+
if (e.target === tabsContainer) {
|
|
256
|
+
const isGroupTransfer = this.groupTransfer.hasData(DraggedEditorGroupIdentifier.prototype);
|
|
257
|
+
this.onDrop(e, isGroupTransfer ? this.groupView.count : this.tabsModel.count, tabsContainer);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
})));
|
|
261
|
+
this._register(addDisposableListener(tabsContainer, EventType$1.MOUSE_WHEEL, (e) => {
|
|
262
|
+
const activeEditor = this.groupView.activeEditor;
|
|
263
|
+
if (!activeEditor || this.groupView.count < 2) {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
if (this.groupsView.partOptions.scrollToSwitchTabs === true) {
|
|
267
|
+
if (e.shiftKey) {
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
if (!e.shiftKey) {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
const now = Date.now();
|
|
277
|
+
if (now - this.lastMouseWheelEventTime < MultiEditorTabsControl_1.MOUSE_WHEEL_EVENT_THRESHOLD - 2 * (Math.abs(e.deltaX) + Math.abs(e.deltaY))) {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
this.lastMouseWheelEventTime = now;
|
|
281
|
+
let tabSwitchDirection;
|
|
282
|
+
if (e.deltaX + e.deltaY < -MultiEditorTabsControl_1.MOUSE_WHEEL_DISTANCE_THRESHOLD) {
|
|
283
|
+
tabSwitchDirection = -1;
|
|
284
|
+
}
|
|
285
|
+
else if (e.deltaX + e.deltaY > MultiEditorTabsControl_1.MOUSE_WHEEL_DISTANCE_THRESHOLD) {
|
|
286
|
+
tabSwitchDirection = 1;
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
const nextEditor = this.groupView.getEditorByIndex(this.groupView.getIndexOfEditor(activeEditor) + tabSwitchDirection);
|
|
292
|
+
if (!nextEditor) {
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
this.groupView.openEditor(nextEditor);
|
|
296
|
+
EventHelper.stop(e, true);
|
|
297
|
+
}));
|
|
298
|
+
const showContextMenu = (e) => {
|
|
299
|
+
EventHelper.stop(e);
|
|
300
|
+
let anchor = tabsContainer;
|
|
301
|
+
if (isMouseEvent(e)) {
|
|
302
|
+
anchor = ( new StandardMouseEvent(getWindow(this.parent), e));
|
|
303
|
+
}
|
|
304
|
+
this.contextMenuService.showContextMenu({
|
|
305
|
+
getAnchor: () => anchor,
|
|
306
|
+
menuId: MenuId.EditorTabsBarContext,
|
|
307
|
+
contextKeyService: this.contextKeyService,
|
|
308
|
+
menuActionOptions: { shouldForwardArgs: true },
|
|
309
|
+
getActionsContext: () => ({ groupId: this.groupView.id }),
|
|
310
|
+
getKeyBinding: action => this.getKeybinding(action),
|
|
311
|
+
onHide: () => this.groupView.focus()
|
|
312
|
+
});
|
|
313
|
+
};
|
|
314
|
+
this._register(addDisposableListener(tabsContainer, EventType.Contextmenu, e => showContextMenu(e)));
|
|
315
|
+
this._register(addDisposableListener(tabsContainer, EventType$1.CONTEXT_MENU, e => showContextMenu(e)));
|
|
316
|
+
}
|
|
317
|
+
doHandleDecorationsChange() {
|
|
318
|
+
this.layout(this.dimensions);
|
|
319
|
+
}
|
|
320
|
+
updateEditorActionsToolbar() {
|
|
321
|
+
super.updateEditorActionsToolbar();
|
|
322
|
+
this.layout(this.dimensions);
|
|
323
|
+
}
|
|
324
|
+
openEditor(editor, options) {
|
|
325
|
+
const changed = this.handleOpenedEditors();
|
|
326
|
+
if (options?.focusTabControl) {
|
|
327
|
+
this.withTab(editor, (editor, tabIndex, tabContainer) => tabContainer.focus());
|
|
328
|
+
}
|
|
329
|
+
return changed;
|
|
330
|
+
}
|
|
331
|
+
openEditors(editors) {
|
|
332
|
+
return this.handleOpenedEditors();
|
|
333
|
+
}
|
|
334
|
+
handleOpenedEditors() {
|
|
335
|
+
this.updateTabsControlVisibility();
|
|
336
|
+
const [tabsContainer, tabsScrollbar] = assertAllDefined(this.tabsContainer, this.tabsScrollbar);
|
|
337
|
+
for (let i = tabsContainer.children.length; i < this.tabsModel.count; i++) {
|
|
338
|
+
tabsContainer.appendChild(this.createTab(i, tabsContainer, tabsScrollbar));
|
|
339
|
+
}
|
|
340
|
+
const activeEditorChanged = this.didActiveEditorChange();
|
|
341
|
+
const oldActiveTabLabel = this.activeTabLabel;
|
|
342
|
+
const oldTabLabelsLength = this.tabLabels.length;
|
|
343
|
+
this.computeTabLabels();
|
|
344
|
+
let didChange = false;
|
|
345
|
+
if (activeEditorChanged ||
|
|
346
|
+
oldTabLabelsLength !== this.tabLabels.length ||
|
|
347
|
+
!this.equalsEditorInputLabel(oldActiveTabLabel, this.activeTabLabel)
|
|
348
|
+
) {
|
|
349
|
+
this.redraw({ forceRevealActiveTab: true });
|
|
350
|
+
didChange = true;
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
this.layout(this.dimensions, { forceRevealActiveTab: true });
|
|
354
|
+
}
|
|
355
|
+
return didChange;
|
|
356
|
+
}
|
|
357
|
+
didActiveEditorChange() {
|
|
358
|
+
if (!this.activeTabLabel?.editor && this.tabsModel.activeEditor ||
|
|
359
|
+
this.activeTabLabel?.editor && !this.tabsModel.activeEditor ||
|
|
360
|
+
(!this.activeTabLabel?.editor || !this.tabsModel.isActive(this.activeTabLabel.editor))
|
|
361
|
+
) {
|
|
362
|
+
return true;
|
|
363
|
+
}
|
|
364
|
+
return false;
|
|
365
|
+
}
|
|
366
|
+
equalsEditorInputLabel(labelA, labelB) {
|
|
367
|
+
if (labelA === labelB) {
|
|
368
|
+
return true;
|
|
369
|
+
}
|
|
370
|
+
if (!labelA || !labelB) {
|
|
371
|
+
return false;
|
|
372
|
+
}
|
|
373
|
+
return labelA.name === labelB.name &&
|
|
374
|
+
labelA.description === labelB.description &&
|
|
375
|
+
labelA.forceDescription === labelB.forceDescription &&
|
|
376
|
+
labelA.title === labelB.title &&
|
|
377
|
+
labelA.ariaLabel === labelB.ariaLabel;
|
|
378
|
+
}
|
|
379
|
+
beforeCloseEditor(editor) {
|
|
380
|
+
if (this.isMouseOverTabs && this.groupsView.partOptions.tabSizing === 'fixed') {
|
|
381
|
+
const closingLastTab = this.tabsModel.isLast(editor);
|
|
382
|
+
this.updateTabsFixedWidth(!closingLastTab);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
closeEditor(editor) {
|
|
386
|
+
this.handleClosedEditors();
|
|
387
|
+
}
|
|
388
|
+
closeEditors(editors) {
|
|
389
|
+
this.handleClosedEditors();
|
|
390
|
+
}
|
|
391
|
+
handleClosedEditors() {
|
|
392
|
+
if (this.tabsModel.count) {
|
|
393
|
+
const tabsContainer = assertIsDefined(this.tabsContainer);
|
|
394
|
+
while (tabsContainer.children.length > this.tabsModel.count) {
|
|
395
|
+
tabsContainer.lastChild?.remove();
|
|
396
|
+
dispose(this.tabDisposables.pop());
|
|
397
|
+
}
|
|
398
|
+
this.computeTabLabels();
|
|
399
|
+
this.redraw({ forceRevealActiveTab: true });
|
|
400
|
+
}
|
|
401
|
+
else {
|
|
402
|
+
if (this.tabsContainer) {
|
|
403
|
+
clearNode(this.tabsContainer);
|
|
404
|
+
}
|
|
405
|
+
this.tabDisposables = dispose(this.tabDisposables);
|
|
406
|
+
this.tabResourceLabels.clear();
|
|
407
|
+
this.tabLabels = [];
|
|
408
|
+
this.activeTabLabel = undefined;
|
|
409
|
+
this.tabActionBars = [];
|
|
410
|
+
this.clearEditorActionsToolbar();
|
|
411
|
+
this.updateTabsControlVisibility();
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
moveEditor(editor, fromTabIndex, targeTabIndex) {
|
|
415
|
+
const editorLabel = this.tabLabels[fromTabIndex];
|
|
416
|
+
this.tabLabels.splice(fromTabIndex, 1);
|
|
417
|
+
this.tabLabels.splice(targeTabIndex, 0, editorLabel);
|
|
418
|
+
this.forEachTab((editor, tabIndex, tabContainer, tabLabelWidget, tabLabel, tabActionBar) => {
|
|
419
|
+
this.redrawTab(editor, tabIndex, tabContainer, tabLabelWidget, tabLabel, tabActionBar);
|
|
420
|
+
}, Math.min(fromTabIndex, targeTabIndex),
|
|
421
|
+
Math.max(fromTabIndex, targeTabIndex)
|
|
422
|
+
);
|
|
423
|
+
this.layout(this.dimensions, { forceRevealActiveTab: true });
|
|
424
|
+
}
|
|
425
|
+
pinEditor(editor) {
|
|
426
|
+
this.withTab(editor, (editor, tabIndex, tabContainer, tabLabelWidget, tabLabel) => this.redrawTabLabel(editor, tabIndex, tabContainer, tabLabelWidget, tabLabel));
|
|
427
|
+
}
|
|
428
|
+
stickEditor(editor) {
|
|
429
|
+
this.doHandleStickyEditorChange(editor);
|
|
430
|
+
}
|
|
431
|
+
unstickEditor(editor) {
|
|
432
|
+
this.doHandleStickyEditorChange(editor);
|
|
433
|
+
}
|
|
434
|
+
doHandleStickyEditorChange(editor) {
|
|
435
|
+
this.withTab(editor, (editor, tabIndex, tabContainer, tabLabelWidget, tabLabel, tabActionBar) => this.redrawTab(editor, tabIndex, tabContainer, tabLabelWidget, tabLabel, tabActionBar));
|
|
436
|
+
this.forEachTab((editor, tabIndex, tabContainer, tabLabelWidget, tabLabel) => {
|
|
437
|
+
this.redrawTabBorders(tabIndex, tabContainer);
|
|
438
|
+
});
|
|
439
|
+
this.layout(this.dimensions, { forceRevealActiveTab: true });
|
|
440
|
+
}
|
|
441
|
+
setActive(isGroupActive) {
|
|
442
|
+
this.forEachTab((editor, tabIndex, tabContainer, tabLabelWidget, tabLabel, tabActionBar) => {
|
|
443
|
+
this.redrawTabActiveAndDirty(isGroupActive, editor, tabContainer, tabActionBar);
|
|
444
|
+
});
|
|
445
|
+
this.updateEditorActionsToolbar();
|
|
446
|
+
this.layout(this.dimensions, { forceRevealActiveTab: true });
|
|
447
|
+
}
|
|
448
|
+
updateEditorLabel(editor) {
|
|
449
|
+
this.updateEditorLabelScheduler.schedule();
|
|
450
|
+
}
|
|
451
|
+
doUpdateEditorLabels() {
|
|
452
|
+
this.computeTabLabels();
|
|
453
|
+
this.forEachTab((editor, tabIndex, tabContainer, tabLabelWidget, tabLabel) => {
|
|
454
|
+
this.redrawTabLabel(editor, tabIndex, tabContainer, tabLabelWidget, tabLabel);
|
|
455
|
+
});
|
|
456
|
+
this.layout(this.dimensions);
|
|
457
|
+
}
|
|
458
|
+
updateEditorDirty(editor) {
|
|
459
|
+
this.withTab(editor, (editor, tabIndex, tabContainer, tabLabelWidget, tabLabel, tabActionBar) => this.redrawTabActiveAndDirty(this.groupsView.activeGroup === this.groupView, editor, tabContainer, tabActionBar));
|
|
460
|
+
}
|
|
461
|
+
updateOptions(oldOptions, newOptions) {
|
|
462
|
+
super.updateOptions(oldOptions, newOptions);
|
|
463
|
+
if (oldOptions.labelFormat !== newOptions.labelFormat) {
|
|
464
|
+
this.computeTabLabels();
|
|
465
|
+
}
|
|
466
|
+
if (oldOptions.titleScrollbarSizing !== newOptions.titleScrollbarSizing) {
|
|
467
|
+
this.updateTabsScrollbarSizing();
|
|
468
|
+
}
|
|
469
|
+
if (oldOptions.tabSizingFixedMinWidth !== newOptions.tabSizingFixedMinWidth ||
|
|
470
|
+
oldOptions.tabSizingFixedMaxWidth !== newOptions.tabSizingFixedMaxWidth ||
|
|
471
|
+
oldOptions.tabSizing !== newOptions.tabSizing) {
|
|
472
|
+
this.updateTabSizing(true);
|
|
473
|
+
}
|
|
474
|
+
if (oldOptions.labelFormat !== newOptions.labelFormat ||
|
|
475
|
+
oldOptions.tabActionLocation !== newOptions.tabActionLocation ||
|
|
476
|
+
oldOptions.tabActionCloseVisibility !== newOptions.tabActionCloseVisibility ||
|
|
477
|
+
oldOptions.tabActionUnpinVisibility !== newOptions.tabActionUnpinVisibility ||
|
|
478
|
+
oldOptions.tabSizing !== newOptions.tabSizing ||
|
|
479
|
+
oldOptions.pinnedTabSizing !== newOptions.pinnedTabSizing ||
|
|
480
|
+
oldOptions.showIcons !== newOptions.showIcons ||
|
|
481
|
+
oldOptions.hasIcons !== newOptions.hasIcons ||
|
|
482
|
+
oldOptions.highlightModifiedTabs !== newOptions.highlightModifiedTabs ||
|
|
483
|
+
oldOptions.wrapTabs !== newOptions.wrapTabs ||
|
|
484
|
+
!equals(oldOptions.decorations, newOptions.decorations)) {
|
|
485
|
+
this.redraw();
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
updateStyles() {
|
|
489
|
+
this.redraw();
|
|
490
|
+
}
|
|
491
|
+
forEachTab(fn, fromTabIndex, toTabIndex) {
|
|
492
|
+
this.tabsModel.getEditors(1 ).forEach((editor, tabIndex) => {
|
|
493
|
+
if (typeof fromTabIndex === 'number' && fromTabIndex > tabIndex) {
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
if (typeof toTabIndex === 'number' && toTabIndex < tabIndex) {
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
this.doWithTab(tabIndex, editor, fn);
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
withTab(editor, fn) {
|
|
503
|
+
this.doWithTab(this.tabsModel.indexOf(editor), editor, fn);
|
|
504
|
+
}
|
|
505
|
+
doWithTab(tabIndex, editor, fn) {
|
|
506
|
+
const tabsContainer = assertIsDefined(this.tabsContainer);
|
|
507
|
+
const tabContainer = tabsContainer.children[tabIndex];
|
|
508
|
+
const tabResourceLabel = this.tabResourceLabels.get(tabIndex);
|
|
509
|
+
const tabLabel = this.tabLabels[tabIndex];
|
|
510
|
+
const tabActionBar = this.tabActionBars[tabIndex];
|
|
511
|
+
if (tabContainer && tabResourceLabel && tabLabel) {
|
|
512
|
+
fn(editor, tabIndex, tabContainer, tabResourceLabel, tabLabel, tabActionBar);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
createTab(tabIndex, tabsContainer, tabsScrollbar) {
|
|
516
|
+
const tabContainer = document.createElement('div');
|
|
517
|
+
tabContainer.draggable = true;
|
|
518
|
+
tabContainer.setAttribute('role', 'tab');
|
|
519
|
+
tabContainer.classList.add('tab');
|
|
520
|
+
this._register(Gesture.addTarget(tabContainer));
|
|
521
|
+
const tabBorderTopContainer = document.createElement('div');
|
|
522
|
+
tabBorderTopContainer.classList.add('tab-border-top-container');
|
|
523
|
+
tabContainer.appendChild(tabBorderTopContainer);
|
|
524
|
+
const editorLabel = this.tabResourceLabels.create(tabContainer);
|
|
525
|
+
const tabActionsContainer = document.createElement('div');
|
|
526
|
+
tabActionsContainer.classList.add('tab-actions');
|
|
527
|
+
tabContainer.appendChild(tabActionsContainer);
|
|
528
|
+
const that = this;
|
|
529
|
+
const tabActionRunner = ( new EditorCommandsContextActionRunner({
|
|
530
|
+
groupId: this.groupView.id,
|
|
531
|
+
get editorIndex() { return that.toEditorIndex(tabIndex); }
|
|
532
|
+
}));
|
|
533
|
+
const tabActionBar = ( new ActionBar(tabActionsContainer, { ariaLabel: ( localizeWithPath(
|
|
534
|
+
'vs/workbench/browser/parts/editor/multiEditorTabsControl',
|
|
535
|
+
'ariaLabelTabActions',
|
|
536
|
+
"Tab actions"
|
|
537
|
+
)), actionRunner: tabActionRunner }));
|
|
538
|
+
const tabActionListener = tabActionBar.onWillRun(e => {
|
|
539
|
+
if (e.action.id === this.closeEditorAction.id) {
|
|
540
|
+
this.blockRevealActiveTabOnce();
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
const tabActionBarDisposable = combinedDisposable(tabActionBar, tabActionListener, toDisposable(insert(this.tabActionBars, tabActionBar)));
|
|
544
|
+
const tabBorderBottomContainer = document.createElement('div');
|
|
545
|
+
tabBorderBottomContainer.classList.add('tab-border-bottom-container');
|
|
546
|
+
tabContainer.appendChild(tabBorderBottomContainer);
|
|
547
|
+
const eventsDisposable = this.registerTabListeners(tabContainer, tabIndex, tabsContainer, tabsScrollbar);
|
|
548
|
+
this.tabDisposables.push(combinedDisposable(eventsDisposable, tabActionBarDisposable, tabActionRunner, editorLabel));
|
|
549
|
+
return tabContainer;
|
|
550
|
+
}
|
|
551
|
+
toEditorIndex(tabIndex) {
|
|
552
|
+
const editor = assertIsDefined(this.tabsModel.getEditorByIndex(tabIndex));
|
|
553
|
+
return this.groupView.getIndexOfEditor(editor);
|
|
554
|
+
}
|
|
555
|
+
registerTabListeners(tab, tabIndex, tabsContainer, tabsScrollbar) {
|
|
556
|
+
const disposables = ( new DisposableStore());
|
|
557
|
+
const handleClickOrTouch = (e, preserveFocus) => {
|
|
558
|
+
tab.blur();
|
|
559
|
+
if (isMouseEvent(e) && (e.button !== 0 || ((isMacintosh && e.ctrlKey) ))) {
|
|
560
|
+
if (e.button === 1) {
|
|
561
|
+
e.preventDefault();
|
|
562
|
+
}
|
|
563
|
+
return undefined;
|
|
564
|
+
}
|
|
565
|
+
if (this.originatesFromTabActionBar(e)) {
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
const editor = this.tabsModel.getEditorByIndex(tabIndex);
|
|
569
|
+
if (editor) {
|
|
570
|
+
this.groupView.openEditor(editor, { preserveFocus, activation: EditorActivation.ACTIVATE });
|
|
571
|
+
}
|
|
572
|
+
return undefined;
|
|
573
|
+
};
|
|
574
|
+
const showContextMenu = (e) => {
|
|
575
|
+
EventHelper.stop(e);
|
|
576
|
+
const editor = this.tabsModel.getEditorByIndex(tabIndex);
|
|
577
|
+
if (editor) {
|
|
578
|
+
this.onTabContextMenu(editor, e, tab);
|
|
579
|
+
}
|
|
580
|
+
};
|
|
581
|
+
disposables.add(addDisposableListener(tab, EventType$1.MOUSE_DOWN, e => handleClickOrTouch(e, false)));
|
|
582
|
+
disposables.add(addDisposableListener(tab, EventType.Tap, (e) => handleClickOrTouch(e, true)));
|
|
583
|
+
disposables.add(addDisposableListener(tab, EventType.Change, (e) => {
|
|
584
|
+
tabsScrollbar.setScrollPosition({ scrollLeft: tabsScrollbar.getScrollPosition().scrollLeft - e.translationX });
|
|
585
|
+
}));
|
|
586
|
+
disposables.add(addDisposableListener(tab, EventType$1.MOUSE_UP, e => {
|
|
587
|
+
EventHelper.stop(e);
|
|
588
|
+
tab.blur();
|
|
589
|
+
}));
|
|
590
|
+
disposables.add(addDisposableListener(tab, EventType$1.AUXCLICK, e => {
|
|
591
|
+
if (e.button === 1 ) {
|
|
592
|
+
EventHelper.stop(e, true );
|
|
593
|
+
const editor = this.tabsModel.getEditorByIndex(tabIndex);
|
|
594
|
+
if (editor) {
|
|
595
|
+
if (preventEditorClose(this.tabsModel, editor, EditorCloseMethod.MOUSE, this.groupsView.partOptions)) {
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
this.blockRevealActiveTabOnce();
|
|
599
|
+
this.closeEditorAction.run({ groupId: this.groupView.id, editorIndex: this.groupView.getIndexOfEditor(editor) });
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
}));
|
|
603
|
+
disposables.add(addDisposableListener(tab, EventType$1.KEY_DOWN, e => {
|
|
604
|
+
const event = ( new StandardKeyboardEvent(e));
|
|
605
|
+
if (event.shiftKey && event.keyCode === 68 ) {
|
|
606
|
+
showContextMenu(e);
|
|
607
|
+
}
|
|
608
|
+
}));
|
|
609
|
+
disposables.add(addDisposableListener(tab, EventType.Contextmenu, (e) => {
|
|
610
|
+
showContextMenu(e);
|
|
611
|
+
}));
|
|
612
|
+
disposables.add(addDisposableListener(tab, EventType$1.KEY_UP, e => {
|
|
613
|
+
const event = ( new StandardKeyboardEvent(e));
|
|
614
|
+
let handled = false;
|
|
615
|
+
if (event.equals(3 ) || event.equals(10 )) {
|
|
616
|
+
handled = true;
|
|
617
|
+
const editor = this.tabsModel.getEditorByIndex(tabIndex);
|
|
618
|
+
if (editor) {
|
|
619
|
+
this.groupView.openEditor(editor);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
else if (( [15 , 17 , 16 , 18 , 14 , 13 ].some(kb => event.equals(kb)))) {
|
|
623
|
+
let editorIndex = this.toEditorIndex(tabIndex);
|
|
624
|
+
if (event.equals(15 ) || event.equals(16 )) {
|
|
625
|
+
editorIndex = editorIndex - 1;
|
|
626
|
+
}
|
|
627
|
+
else if (event.equals(17 ) || event.equals(18 )) {
|
|
628
|
+
editorIndex = editorIndex + 1;
|
|
629
|
+
}
|
|
630
|
+
else if (event.equals(14 )) {
|
|
631
|
+
editorIndex = 0;
|
|
632
|
+
}
|
|
633
|
+
else {
|
|
634
|
+
editorIndex = this.groupView.count - 1;
|
|
635
|
+
}
|
|
636
|
+
const target = this.groupView.getEditorByIndex(editorIndex);
|
|
637
|
+
if (target) {
|
|
638
|
+
handled = true;
|
|
639
|
+
this.groupView.openEditor(target, { preserveFocus: true }, { focusTabControl: true });
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
if (handled) {
|
|
643
|
+
EventHelper.stop(e, true);
|
|
644
|
+
}
|
|
645
|
+
tabsScrollbar.setScrollPosition({
|
|
646
|
+
scrollLeft: tabsContainer.scrollLeft
|
|
647
|
+
});
|
|
648
|
+
}));
|
|
649
|
+
for (const eventType of [EventType.Tap, EventType$1.DBLCLICK]) {
|
|
650
|
+
disposables.add(addDisposableListener(tab, eventType, (e) => {
|
|
651
|
+
if (eventType === EventType$1.DBLCLICK) {
|
|
652
|
+
EventHelper.stop(e);
|
|
653
|
+
}
|
|
654
|
+
else if (e.tapCount !== 2) {
|
|
655
|
+
return;
|
|
656
|
+
}
|
|
657
|
+
const editor = this.tabsModel.getEditorByIndex(tabIndex);
|
|
658
|
+
if (editor && this.tabsModel.isPinned(editor)) {
|
|
659
|
+
switch (this.groupsView.partOptions.doubleClickTabToToggleEditorGroupSizes) {
|
|
660
|
+
case 'maximize':
|
|
661
|
+
this.groupsView.toggleMaximizeGroup(this.groupView);
|
|
662
|
+
break;
|
|
663
|
+
case 'expand':
|
|
664
|
+
this.groupsView.toggleExpandGroup(this.groupView);
|
|
665
|
+
break;
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
else {
|
|
669
|
+
this.groupView.pinEditor(editor);
|
|
670
|
+
}
|
|
671
|
+
}));
|
|
672
|
+
}
|
|
673
|
+
disposables.add(addDisposableListener(tab, EventType$1.CONTEXT_MENU, e => {
|
|
674
|
+
EventHelper.stop(e, true);
|
|
675
|
+
const editor = this.tabsModel.getEditorByIndex(tabIndex);
|
|
676
|
+
if (editor) {
|
|
677
|
+
this.onTabContextMenu(editor, e, tab);
|
|
678
|
+
}
|
|
679
|
+
}, true ));
|
|
680
|
+
let lastDragEvent = undefined;
|
|
681
|
+
let isNewWindowOperation = false;
|
|
682
|
+
disposables.add(( new DragAndDropObserver(tab, {
|
|
683
|
+
onDragStart: e => {
|
|
684
|
+
const editor = this.tabsModel.getEditorByIndex(tabIndex);
|
|
685
|
+
if (!editor) {
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
isNewWindowOperation = this.isNewWindowOperation(e);
|
|
689
|
+
this.editorTransfer.setData([( new DraggedEditorIdentifier({ editor, groupId: this.groupView.id }))], DraggedEditorIdentifier.prototype);
|
|
690
|
+
if (e.dataTransfer) {
|
|
691
|
+
e.dataTransfer.effectAllowed = 'copyMove';
|
|
692
|
+
}
|
|
693
|
+
this.doFillResourceDataTransfers([editor], e, isNewWindowOperation);
|
|
694
|
+
tab.classList.add('dragged');
|
|
695
|
+
scheduleAtNextAnimationFrame(getWindow(this.parent), () => tab.classList.remove('dragged'));
|
|
696
|
+
},
|
|
697
|
+
onDrag: e => {
|
|
698
|
+
lastDragEvent = e;
|
|
699
|
+
},
|
|
700
|
+
onDragEnter: e => {
|
|
701
|
+
tab.classList.add('dragged-over');
|
|
702
|
+
if (!this.isSupportedDropTransfer(e)) {
|
|
703
|
+
if (e.dataTransfer) {
|
|
704
|
+
e.dataTransfer.dropEffect = 'none';
|
|
705
|
+
}
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
708
|
+
let isLocalDragAndDrop = false;
|
|
709
|
+
if (this.editorTransfer.hasData(DraggedEditorIdentifier.prototype)) {
|
|
710
|
+
isLocalDragAndDrop = true;
|
|
711
|
+
const data = this.editorTransfer.getData(DraggedEditorIdentifier.prototype);
|
|
712
|
+
if (Array.isArray(data)) {
|
|
713
|
+
const localDraggedEditor = data[0].identifier;
|
|
714
|
+
if (localDraggedEditor.editor === this.tabsModel.getEditorByIndex(tabIndex) && localDraggedEditor.groupId === this.groupView.id) {
|
|
715
|
+
if (e.dataTransfer) {
|
|
716
|
+
e.dataTransfer.dropEffect = 'none';
|
|
717
|
+
}
|
|
718
|
+
return;
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
if (!isLocalDragAndDrop) {
|
|
723
|
+
if (e.dataTransfer) {
|
|
724
|
+
e.dataTransfer.dropEffect = 'copy';
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
this.updateDropFeedback(tab, true, tabIndex);
|
|
728
|
+
},
|
|
729
|
+
onDragOver: (_, dragDuration) => {
|
|
730
|
+
if (dragDuration >= MultiEditorTabsControl_1.DRAG_OVER_OPEN_TAB_THRESHOLD) {
|
|
731
|
+
const draggedOverTab = this.tabsModel.getEditorByIndex(tabIndex);
|
|
732
|
+
if (draggedOverTab && this.tabsModel.activeEditor !== draggedOverTab) {
|
|
733
|
+
this.groupView.openEditor(draggedOverTab, { preserveFocus: true });
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
},
|
|
737
|
+
onDragLeave: () => {
|
|
738
|
+
tab.classList.remove('dragged-over');
|
|
739
|
+
this.updateDropFeedback(tab, false, tabIndex);
|
|
740
|
+
},
|
|
741
|
+
onDragEnd: async (e) => {
|
|
742
|
+
tab.classList.remove('dragged-over');
|
|
743
|
+
this.updateDropFeedback(tab, false, tabIndex);
|
|
744
|
+
this.editorTransfer.clearData(DraggedEditorIdentifier.prototype);
|
|
745
|
+
const editor = this.tabsModel.getEditorByIndex(tabIndex);
|
|
746
|
+
if (!isNewWindowOperation ||
|
|
747
|
+
isWindowDraggedOver() ||
|
|
748
|
+
!editor) {
|
|
749
|
+
return;
|
|
750
|
+
}
|
|
751
|
+
const auxiliaryEditorPart = await this.maybeCreateAuxiliaryEditorPartAt(e, tab);
|
|
752
|
+
if (!auxiliaryEditorPart) {
|
|
753
|
+
return;
|
|
754
|
+
}
|
|
755
|
+
const targetGroup = auxiliaryEditorPart.activeGroup;
|
|
756
|
+
if (this.isMoveOperation(lastDragEvent ?? e, targetGroup.id, editor)) {
|
|
757
|
+
this.groupView.moveEditor(editor, targetGroup);
|
|
758
|
+
}
|
|
759
|
+
else {
|
|
760
|
+
this.groupView.copyEditor(editor, targetGroup);
|
|
761
|
+
}
|
|
762
|
+
targetGroup.focus();
|
|
763
|
+
},
|
|
764
|
+
onDrop: e => {
|
|
765
|
+
tab.classList.remove('dragged-over');
|
|
766
|
+
this.updateDropFeedback(tab, false, tabIndex);
|
|
767
|
+
this.onDrop(e, tabIndex, tabsContainer);
|
|
768
|
+
}
|
|
769
|
+
})));
|
|
770
|
+
return disposables;
|
|
771
|
+
}
|
|
772
|
+
isSupportedDropTransfer(e) {
|
|
773
|
+
if (this.groupTransfer.hasData(DraggedEditorGroupIdentifier.prototype)) {
|
|
774
|
+
const data = this.groupTransfer.getData(DraggedEditorGroupIdentifier.prototype);
|
|
775
|
+
if (Array.isArray(data)) {
|
|
776
|
+
const group = data[0];
|
|
777
|
+
if (group.identifier === this.groupView.id) {
|
|
778
|
+
return false;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
return true;
|
|
782
|
+
}
|
|
783
|
+
if (this.editorTransfer.hasData(DraggedEditorIdentifier.prototype)) {
|
|
784
|
+
return true;
|
|
785
|
+
}
|
|
786
|
+
if (e.dataTransfer && e.dataTransfer.types.length > 0) {
|
|
787
|
+
return true;
|
|
788
|
+
}
|
|
789
|
+
return false;
|
|
790
|
+
}
|
|
791
|
+
updateDropFeedback(element, isDND, tabIndex) {
|
|
792
|
+
const isTab = (typeof tabIndex === 'number');
|
|
793
|
+
const editor = typeof tabIndex === 'number' ? this.tabsModel.getEditorByIndex(tabIndex) : undefined;
|
|
794
|
+
const isActiveTab = isTab && !!editor && this.tabsModel.isActive(editor);
|
|
795
|
+
const noDNDBackgroundColor = isTab ? this.getColor(isActiveTab ? TAB_ACTIVE_BACKGROUND : TAB_INACTIVE_BACKGROUND) : '';
|
|
796
|
+
element.style.backgroundColor = (isDND ? this.getColor(EDITOR_DRAG_AND_DROP_BACKGROUND) : noDNDBackgroundColor) || '';
|
|
797
|
+
const activeContrastBorderColor = this.getColor(activeContrastBorder);
|
|
798
|
+
if (activeContrastBorderColor && isDND) {
|
|
799
|
+
element.style.outlineWidth = '2px';
|
|
800
|
+
element.style.outlineStyle = 'dashed';
|
|
801
|
+
element.style.outlineColor = activeContrastBorderColor;
|
|
802
|
+
element.style.outlineOffset = isTab ? '-5px' : '-3px';
|
|
803
|
+
}
|
|
804
|
+
else {
|
|
805
|
+
element.style.outlineWidth = '';
|
|
806
|
+
element.style.outlineStyle = '';
|
|
807
|
+
element.style.outlineColor = activeContrastBorderColor || '';
|
|
808
|
+
element.style.outlineOffset = '';
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
computeTabLabels() {
|
|
812
|
+
const { labelFormat } = this.groupsView.partOptions;
|
|
813
|
+
const { verbosity, shortenDuplicates } = this.getLabelConfigFlags(labelFormat);
|
|
814
|
+
const labels = [];
|
|
815
|
+
let activeEditorTabIndex = -1;
|
|
816
|
+
this.tabsModel.getEditors(1 ).forEach((editor, tabIndex) => {
|
|
817
|
+
labels.push({
|
|
818
|
+
editor,
|
|
819
|
+
name: editor.getName(),
|
|
820
|
+
description: editor.getDescription(verbosity),
|
|
821
|
+
forceDescription: editor.hasCapability(64 ),
|
|
822
|
+
title: editor.getTitle(2 ),
|
|
823
|
+
ariaLabel: computeEditorAriaLabel(editor, tabIndex, this.groupView, this.editorPartsView.count)
|
|
824
|
+
});
|
|
825
|
+
if (editor === this.tabsModel.activeEditor) {
|
|
826
|
+
activeEditorTabIndex = tabIndex;
|
|
827
|
+
}
|
|
828
|
+
});
|
|
829
|
+
if (shortenDuplicates) {
|
|
830
|
+
this.shortenTabLabels(labels);
|
|
831
|
+
}
|
|
832
|
+
this.tabLabels = labels;
|
|
833
|
+
this.activeTabLabel = labels[activeEditorTabIndex];
|
|
834
|
+
}
|
|
835
|
+
shortenTabLabels(labels) {
|
|
836
|
+
const mapNameToDuplicates = ( new Map());
|
|
837
|
+
for (const label of labels) {
|
|
838
|
+
if (typeof label.description === 'string') {
|
|
839
|
+
getOrSet(mapNameToDuplicates, label.name, []).push(label);
|
|
840
|
+
}
|
|
841
|
+
else {
|
|
842
|
+
label.description = '';
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
for (const [, duplicateLabels] of mapNameToDuplicates) {
|
|
846
|
+
if (duplicateLabels.length === 1 && !duplicateLabels[0].forceDescription) {
|
|
847
|
+
duplicateLabels[0].description = '';
|
|
848
|
+
continue;
|
|
849
|
+
}
|
|
850
|
+
const mapDescriptionToDuplicates = ( new Map());
|
|
851
|
+
for (const duplicateLabel of duplicateLabels) {
|
|
852
|
+
getOrSet(mapDescriptionToDuplicates, duplicateLabel.description, []).push(duplicateLabel);
|
|
853
|
+
}
|
|
854
|
+
let useLongDescriptions = false;
|
|
855
|
+
for (const [, duplicateLabels] of mapDescriptionToDuplicates) {
|
|
856
|
+
if (!useLongDescriptions && duplicateLabels.length > 1) {
|
|
857
|
+
const [first, ...rest] = ( duplicateLabels.map(({ editor }) => editor.getDescription(2 )));
|
|
858
|
+
useLongDescriptions = ( rest.some(description => description !== first));
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
if (useLongDescriptions) {
|
|
862
|
+
mapDescriptionToDuplicates.clear();
|
|
863
|
+
for (const duplicateLabel of duplicateLabels) {
|
|
864
|
+
duplicateLabel.description = duplicateLabel.editor.getDescription(2 );
|
|
865
|
+
getOrSet(mapDescriptionToDuplicates, duplicateLabel.description, []).push(duplicateLabel);
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
const descriptions = [];
|
|
869
|
+
for (const [description] of mapDescriptionToDuplicates) {
|
|
870
|
+
descriptions.push(description);
|
|
871
|
+
}
|
|
872
|
+
if (descriptions.length === 1) {
|
|
873
|
+
for (const label of mapDescriptionToDuplicates.get(descriptions[0]) || []) {
|
|
874
|
+
if (!label.forceDescription) {
|
|
875
|
+
label.description = '';
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
continue;
|
|
879
|
+
}
|
|
880
|
+
const shortenedDescriptions = shorten(descriptions, this.path.sep);
|
|
881
|
+
descriptions.forEach((description, tabIndex) => {
|
|
882
|
+
for (const label of mapDescriptionToDuplicates.get(description) || []) {
|
|
883
|
+
label.description = shortenedDescriptions[tabIndex];
|
|
884
|
+
}
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
getLabelConfigFlags(value) {
|
|
889
|
+
switch (value) {
|
|
890
|
+
case 'short':
|
|
891
|
+
return { verbosity: 0 , shortenDuplicates: false };
|
|
892
|
+
case 'medium':
|
|
893
|
+
return { verbosity: 1 , shortenDuplicates: false };
|
|
894
|
+
case 'long':
|
|
895
|
+
return { verbosity: 2 , shortenDuplicates: false };
|
|
896
|
+
default:
|
|
897
|
+
return { verbosity: 1 , shortenDuplicates: true };
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
redraw(options) {
|
|
901
|
+
if (this.tabsAndActionsContainer) {
|
|
902
|
+
let tabsContainerBorderColor = this.getColor(EDITOR_GROUP_HEADER_TABS_BORDER);
|
|
903
|
+
if (!tabsContainerBorderColor && isHighContrast(this.theme.type)) {
|
|
904
|
+
tabsContainerBorderColor = this.getColor(TAB_BORDER) || this.getColor(contrastBorder);
|
|
905
|
+
}
|
|
906
|
+
if (tabsContainerBorderColor) {
|
|
907
|
+
this.tabsAndActionsContainer.classList.add('tabs-border-bottom');
|
|
908
|
+
this.tabsAndActionsContainer.style.setProperty('--tabs-border-bottom-color', ( tabsContainerBorderColor.toString()));
|
|
909
|
+
}
|
|
910
|
+
else {
|
|
911
|
+
this.tabsAndActionsContainer.classList.remove('tabs-border-bottom');
|
|
912
|
+
this.tabsAndActionsContainer.style.removeProperty('--tabs-border-bottom-color');
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
this.forEachTab((editor, tabIndex, tabContainer, tabLabelWidget, tabLabel, tabActionBar) => {
|
|
916
|
+
this.redrawTab(editor, tabIndex, tabContainer, tabLabelWidget, tabLabel, tabActionBar);
|
|
917
|
+
});
|
|
918
|
+
this.updateEditorActionsToolbar();
|
|
919
|
+
this.layout(this.dimensions, options);
|
|
920
|
+
}
|
|
921
|
+
redrawTab(editor, tabIndex, tabContainer, tabLabelWidget, tabLabel, tabActionBar) {
|
|
922
|
+
const isTabSticky = this.tabsModel.isSticky(tabIndex);
|
|
923
|
+
const options = this.groupsView.partOptions;
|
|
924
|
+
this.redrawTabLabel(editor, tabIndex, tabContainer, tabLabelWidget, tabLabel);
|
|
925
|
+
const hasUnpinAction = isTabSticky && options.tabActionUnpinVisibility;
|
|
926
|
+
const hasCloseAction = !hasUnpinAction && options.tabActionCloseVisibility;
|
|
927
|
+
const hasAction = hasUnpinAction || hasCloseAction;
|
|
928
|
+
let tabAction;
|
|
929
|
+
if (hasAction) {
|
|
930
|
+
tabAction = hasUnpinAction ? this.unpinEditorAction : this.closeEditorAction;
|
|
931
|
+
}
|
|
932
|
+
else {
|
|
933
|
+
tabAction = isTabSticky ? this.unpinEditorAction : this.closeEditorAction;
|
|
934
|
+
}
|
|
935
|
+
if (!tabActionBar.hasAction(tabAction)) {
|
|
936
|
+
if (!tabActionBar.isEmpty()) {
|
|
937
|
+
tabActionBar.clear();
|
|
938
|
+
}
|
|
939
|
+
tabActionBar.push(tabAction, { icon: true, label: false, keybinding: this.getKeybindingLabel(tabAction) });
|
|
940
|
+
}
|
|
941
|
+
tabContainer.classList.toggle(`pinned-action-off`, isTabSticky && !hasUnpinAction);
|
|
942
|
+
tabContainer.classList.toggle(`close-action-off`, !hasUnpinAction && !hasCloseAction);
|
|
943
|
+
for (const option of ['left', 'right']) {
|
|
944
|
+
tabContainer.classList.toggle(`tab-actions-${option}`, hasAction && options.tabActionLocation === option);
|
|
945
|
+
}
|
|
946
|
+
const tabSizing = isTabSticky && options.pinnedTabSizing === 'shrink' ? 'shrink' : options.tabSizing;
|
|
947
|
+
for (const option of ['fit', 'shrink', 'fixed']) {
|
|
948
|
+
tabContainer.classList.toggle(`sizing-${option}`, tabSizing === option);
|
|
949
|
+
}
|
|
950
|
+
tabContainer.classList.toggle('has-icon', options.showIcons && options.hasIcons);
|
|
951
|
+
tabContainer.classList.toggle('sticky', isTabSticky);
|
|
952
|
+
for (const option of ['normal', 'compact', 'shrink']) {
|
|
953
|
+
tabContainer.classList.toggle(`sticky-${option}`, isTabSticky && options.pinnedTabSizing === option);
|
|
954
|
+
}
|
|
955
|
+
if (!options.wrapTabs && isTabSticky && options.pinnedTabSizing !== 'normal') {
|
|
956
|
+
let stickyTabWidth = 0;
|
|
957
|
+
switch (options.pinnedTabSizing) {
|
|
958
|
+
case 'compact':
|
|
959
|
+
stickyTabWidth = MultiEditorTabsControl_1.TAB_WIDTH.compact;
|
|
960
|
+
break;
|
|
961
|
+
case 'shrink':
|
|
962
|
+
stickyTabWidth = MultiEditorTabsControl_1.TAB_WIDTH.shrink;
|
|
963
|
+
break;
|
|
964
|
+
}
|
|
965
|
+
tabContainer.style.left = `${tabIndex * stickyTabWidth}px`;
|
|
966
|
+
}
|
|
967
|
+
else {
|
|
968
|
+
tabContainer.style.left = 'auto';
|
|
969
|
+
}
|
|
970
|
+
this.redrawTabBorders(tabIndex, tabContainer);
|
|
971
|
+
this.redrawTabActiveAndDirty(this.groupsView.activeGroup === this.groupView, editor, tabContainer, tabActionBar);
|
|
972
|
+
}
|
|
973
|
+
redrawTabLabel(editor, tabIndex, tabContainer, tabLabelWidget, tabLabel) {
|
|
974
|
+
const options = this.groupsView.partOptions;
|
|
975
|
+
let name;
|
|
976
|
+
let forceLabel = false;
|
|
977
|
+
let fileDecorationBadges = Boolean(options.decorations?.badges);
|
|
978
|
+
const fileDecorationColors = Boolean(options.decorations?.colors);
|
|
979
|
+
let description;
|
|
980
|
+
if (options.pinnedTabSizing === 'compact' && this.tabsModel.isSticky(tabIndex)) {
|
|
981
|
+
const isShowingIcons = options.showIcons && options.hasIcons;
|
|
982
|
+
name = isShowingIcons ? '' : tabLabel.name?.charAt(0).toUpperCase();
|
|
983
|
+
description = '';
|
|
984
|
+
forceLabel = true;
|
|
985
|
+
fileDecorationBadges = false;
|
|
986
|
+
}
|
|
987
|
+
else {
|
|
988
|
+
name = tabLabel.name;
|
|
989
|
+
description = tabLabel.description || '';
|
|
990
|
+
}
|
|
991
|
+
if (tabLabel.ariaLabel) {
|
|
992
|
+
tabContainer.setAttribute('aria-label', tabLabel.ariaLabel);
|
|
993
|
+
tabContainer.setAttribute('aria-description', '');
|
|
994
|
+
}
|
|
995
|
+
const title = tabLabel.title || '';
|
|
996
|
+
tabContainer.title = title;
|
|
997
|
+
tabLabelWidget.setResource({ name, description, resource: EditorResourceAccessor.getOriginalUri(editor, { supportSideBySide: SideBySideEditor.BOTH }) }, {
|
|
998
|
+
title,
|
|
999
|
+
extraClasses: coalesce(['tab-label', fileDecorationBadges ? 'tab-label-has-badge' : undefined].concat(editor.getLabelExtraClasses())),
|
|
1000
|
+
italic: !this.tabsModel.isPinned(editor),
|
|
1001
|
+
forceLabel,
|
|
1002
|
+
fileDecorations: {
|
|
1003
|
+
colors: fileDecorationColors,
|
|
1004
|
+
badges: fileDecorationBadges
|
|
1005
|
+
},
|
|
1006
|
+
icon: editor.getIcon(),
|
|
1007
|
+
hideIcon: options.showIcons === false,
|
|
1008
|
+
});
|
|
1009
|
+
const resource = EditorResourceAccessor.getOriginalUri(editor, { supportSideBySide: SideBySideEditor.PRIMARY });
|
|
1010
|
+
if (resource) {
|
|
1011
|
+
tabContainer.setAttribute('data-resource-name', basenameOrAuthority(resource));
|
|
1012
|
+
}
|
|
1013
|
+
else {
|
|
1014
|
+
tabContainer.removeAttribute('data-resource-name');
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
redrawTabActiveAndDirty(isGroupActive, editor, tabContainer, tabActionBar) {
|
|
1018
|
+
const isTabActive = this.tabsModel.isActive(editor);
|
|
1019
|
+
const hasModifiedBorderTop = this.doRedrawTabDirty(isGroupActive, isTabActive, editor, tabContainer);
|
|
1020
|
+
this.doRedrawTabActive(isGroupActive, !hasModifiedBorderTop, editor, tabContainer, tabActionBar);
|
|
1021
|
+
}
|
|
1022
|
+
doRedrawTabActive(isGroupActive, allowBorderTop, editor, tabContainer, tabActionBar) {
|
|
1023
|
+
if (this.tabsModel.isActive(editor)) {
|
|
1024
|
+
tabContainer.classList.add('active');
|
|
1025
|
+
tabContainer.setAttribute('aria-selected', 'true');
|
|
1026
|
+
tabContainer.tabIndex = 0;
|
|
1027
|
+
tabContainer.style.backgroundColor = this.getColor(isGroupActive ? TAB_ACTIVE_BACKGROUND : TAB_UNFOCUSED_ACTIVE_BACKGROUND) || '';
|
|
1028
|
+
const activeTabBorderColorBottom = this.getColor(isGroupActive ? TAB_ACTIVE_BORDER : TAB_UNFOCUSED_ACTIVE_BORDER);
|
|
1029
|
+
if (activeTabBorderColorBottom) {
|
|
1030
|
+
tabContainer.classList.add('tab-border-bottom');
|
|
1031
|
+
tabContainer.style.setProperty('--tab-border-bottom-color', ( activeTabBorderColorBottom.toString()));
|
|
1032
|
+
}
|
|
1033
|
+
else {
|
|
1034
|
+
tabContainer.classList.remove('tab-border-bottom');
|
|
1035
|
+
tabContainer.style.removeProperty('--tab-border-bottom-color');
|
|
1036
|
+
}
|
|
1037
|
+
const activeTabBorderColorTop = allowBorderTop ? this.getColor(isGroupActive ? TAB_ACTIVE_BORDER_TOP : TAB_UNFOCUSED_ACTIVE_BORDER_TOP) : undefined;
|
|
1038
|
+
if (activeTabBorderColorTop) {
|
|
1039
|
+
tabContainer.classList.add('tab-border-top');
|
|
1040
|
+
tabContainer.style.setProperty('--tab-border-top-color', ( activeTabBorderColorTop.toString()));
|
|
1041
|
+
}
|
|
1042
|
+
else {
|
|
1043
|
+
tabContainer.classList.remove('tab-border-top');
|
|
1044
|
+
tabContainer.style.removeProperty('--tab-border-top-color');
|
|
1045
|
+
}
|
|
1046
|
+
tabContainer.style.color = this.getColor(isGroupActive ? TAB_ACTIVE_FOREGROUND : TAB_UNFOCUSED_ACTIVE_FOREGROUND) || '';
|
|
1047
|
+
tabActionBar.setFocusable(true);
|
|
1048
|
+
}
|
|
1049
|
+
else {
|
|
1050
|
+
tabContainer.classList.remove('active');
|
|
1051
|
+
tabContainer.setAttribute('aria-selected', 'false');
|
|
1052
|
+
tabContainer.tabIndex = -1;
|
|
1053
|
+
tabContainer.style.backgroundColor = this.getColor(isGroupActive ? TAB_INACTIVE_BACKGROUND : TAB_UNFOCUSED_INACTIVE_BACKGROUND) || '';
|
|
1054
|
+
tabContainer.style.boxShadow = '';
|
|
1055
|
+
tabContainer.style.color = this.getColor(isGroupActive ? TAB_INACTIVE_FOREGROUND : TAB_UNFOCUSED_INACTIVE_FOREGROUND) || '';
|
|
1056
|
+
tabActionBar.setFocusable(false);
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
doRedrawTabDirty(isGroupActive, isTabActive, editor, tabContainer) {
|
|
1060
|
+
let hasModifiedBorderColor = false;
|
|
1061
|
+
if (editor.isDirty() && !editor.isSaving()) {
|
|
1062
|
+
tabContainer.classList.add('dirty');
|
|
1063
|
+
if (this.groupsView.partOptions.highlightModifiedTabs) {
|
|
1064
|
+
let modifiedBorderColor;
|
|
1065
|
+
if (isGroupActive && isTabActive) {
|
|
1066
|
+
modifiedBorderColor = this.getColor(TAB_ACTIVE_MODIFIED_BORDER);
|
|
1067
|
+
}
|
|
1068
|
+
else if (isGroupActive && !isTabActive) {
|
|
1069
|
+
modifiedBorderColor = this.getColor(TAB_INACTIVE_MODIFIED_BORDER);
|
|
1070
|
+
}
|
|
1071
|
+
else if (!isGroupActive && isTabActive) {
|
|
1072
|
+
modifiedBorderColor = this.getColor(TAB_UNFOCUSED_ACTIVE_MODIFIED_BORDER);
|
|
1073
|
+
}
|
|
1074
|
+
else {
|
|
1075
|
+
modifiedBorderColor = this.getColor(TAB_UNFOCUSED_INACTIVE_MODIFIED_BORDER);
|
|
1076
|
+
}
|
|
1077
|
+
if (modifiedBorderColor) {
|
|
1078
|
+
hasModifiedBorderColor = true;
|
|
1079
|
+
tabContainer.classList.add('dirty-border-top');
|
|
1080
|
+
tabContainer.style.setProperty('--tab-dirty-border-top-color', modifiedBorderColor);
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
else {
|
|
1084
|
+
tabContainer.classList.remove('dirty-border-top');
|
|
1085
|
+
tabContainer.style.removeProperty('--tab-dirty-border-top-color');
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
else {
|
|
1089
|
+
tabContainer.classList.remove('dirty', 'dirty-border-top');
|
|
1090
|
+
tabContainer.style.removeProperty('--tab-dirty-border-top-color');
|
|
1091
|
+
}
|
|
1092
|
+
return hasModifiedBorderColor;
|
|
1093
|
+
}
|
|
1094
|
+
redrawTabBorders(tabIndex, tabContainer) {
|
|
1095
|
+
const isTabSticky = this.tabsModel.isSticky(tabIndex);
|
|
1096
|
+
const isTabLastSticky = isTabSticky && this.tabsModel.stickyCount === tabIndex + 1;
|
|
1097
|
+
const showLastStickyTabBorderColor = this.tabsModel.stickyCount !== this.tabsModel.count;
|
|
1098
|
+
const borderRightColor = ((isTabLastSticky && showLastStickyTabBorderColor ? this.getColor(TAB_LAST_PINNED_BORDER) : undefined) || this.getColor(TAB_BORDER) || this.getColor(contrastBorder));
|
|
1099
|
+
tabContainer.style.borderRight = borderRightColor ? `1px solid ${borderRightColor}` : '';
|
|
1100
|
+
tabContainer.style.outlineColor = this.getColor(activeContrastBorder) || '';
|
|
1101
|
+
}
|
|
1102
|
+
prepareEditorActions(editorActions) {
|
|
1103
|
+
const isGroupActive = this.groupsView.activeGroup === this.groupView;
|
|
1104
|
+
if (isGroupActive) {
|
|
1105
|
+
return editorActions;
|
|
1106
|
+
}
|
|
1107
|
+
else {
|
|
1108
|
+
return {
|
|
1109
|
+
primary: editorActions.primary.filter(action => action.id === UNLOCK_GROUP_COMMAND_ID),
|
|
1110
|
+
secondary: editorActions.secondary
|
|
1111
|
+
};
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
getHeight() {
|
|
1115
|
+
if (this.dimensions.used) {
|
|
1116
|
+
return this.dimensions.used.height;
|
|
1117
|
+
}
|
|
1118
|
+
else {
|
|
1119
|
+
return this.computeHeight();
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
computeHeight() {
|
|
1123
|
+
let height;
|
|
1124
|
+
if (!this.visible) {
|
|
1125
|
+
height = 0;
|
|
1126
|
+
}
|
|
1127
|
+
else if (this.groupsView.partOptions.wrapTabs && this.tabsAndActionsContainer?.classList.contains('wrapping')) {
|
|
1128
|
+
height = this.tabsAndActionsContainer.offsetHeight;
|
|
1129
|
+
}
|
|
1130
|
+
else {
|
|
1131
|
+
height = this.tabHeight;
|
|
1132
|
+
}
|
|
1133
|
+
return height;
|
|
1134
|
+
}
|
|
1135
|
+
layout(dimensions, options) {
|
|
1136
|
+
Object.assign(this.dimensions, dimensions);
|
|
1137
|
+
if (this.visible) {
|
|
1138
|
+
if (!this.layoutScheduler.value) {
|
|
1139
|
+
const disposable = scheduleAtNextAnimationFrame(getWindow(this.parent), () => {
|
|
1140
|
+
this.doLayout(this.dimensions, this.layoutScheduler.value?.options );
|
|
1141
|
+
this.layoutScheduler.clear();
|
|
1142
|
+
});
|
|
1143
|
+
this.layoutScheduler.value = { options, dispose: () => disposable.dispose() };
|
|
1144
|
+
}
|
|
1145
|
+
if (options?.forceRevealActiveTab) {
|
|
1146
|
+
this.layoutScheduler.value.options = {
|
|
1147
|
+
...this.layoutScheduler.value.options,
|
|
1148
|
+
forceRevealActiveTab: true
|
|
1149
|
+
};
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
if (!this.dimensions.used) {
|
|
1153
|
+
this.dimensions.used = ( new Dimension(dimensions.container.width, this.computeHeight()));
|
|
1154
|
+
}
|
|
1155
|
+
return this.dimensions.used;
|
|
1156
|
+
}
|
|
1157
|
+
doLayout(dimensions, options) {
|
|
1158
|
+
if (dimensions.container !== Dimension.None && dimensions.available !== Dimension.None) {
|
|
1159
|
+
this.doLayoutTabs(dimensions, options);
|
|
1160
|
+
}
|
|
1161
|
+
const oldDimension = this.dimensions.used;
|
|
1162
|
+
const newDimension = this.dimensions.used = ( new Dimension(dimensions.container.width, this.computeHeight()));
|
|
1163
|
+
if (oldDimension && oldDimension.height !== newDimension.height) {
|
|
1164
|
+
this.groupView.relayout();
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
doLayoutTabs(dimensions, options) {
|
|
1168
|
+
const tabsWrapMultiLine = this.doLayoutTabsWrapping(dimensions);
|
|
1169
|
+
if (!tabsWrapMultiLine) {
|
|
1170
|
+
this.doLayoutTabsNonWrapping(options);
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
doLayoutTabsWrapping(dimensions) {
|
|
1174
|
+
const [tabsAndActionsContainer, tabsContainer, editorToolbarContainer, tabsScrollbar] = assertAllDefined(this.tabsAndActionsContainer, this.tabsContainer, this.editorActionsToolbarContainer, this.tabsScrollbar);
|
|
1175
|
+
const didTabsWrapMultiLine = tabsAndActionsContainer.classList.contains('wrapping');
|
|
1176
|
+
let tabsWrapMultiLine = didTabsWrapMultiLine;
|
|
1177
|
+
function updateTabsWrapping(enabled) {
|
|
1178
|
+
tabsWrapMultiLine = enabled;
|
|
1179
|
+
tabsAndActionsContainer.classList.toggle('wrapping', tabsWrapMultiLine);
|
|
1180
|
+
tabsContainer.style.setProperty('--last-tab-margin-right', tabsWrapMultiLine ? `${editorToolbarContainer.offsetWidth}px` : '0');
|
|
1181
|
+
}
|
|
1182
|
+
if (this.groupsView.partOptions.wrapTabs) {
|
|
1183
|
+
const visibleTabsWidth = tabsContainer.offsetWidth;
|
|
1184
|
+
const allTabsWidth = tabsContainer.scrollWidth;
|
|
1185
|
+
const lastTabFitsWrapped = () => {
|
|
1186
|
+
const lastTab = this.getLastTab();
|
|
1187
|
+
if (!lastTab) {
|
|
1188
|
+
return true;
|
|
1189
|
+
}
|
|
1190
|
+
const lastTabOverlapWithToolbarWidth = lastTab.offsetWidth + editorToolbarContainer.offsetWidth - dimensions.available.width;
|
|
1191
|
+
if (lastTabOverlapWithToolbarWidth > 1) {
|
|
1192
|
+
return false;
|
|
1193
|
+
}
|
|
1194
|
+
return true;
|
|
1195
|
+
};
|
|
1196
|
+
if (tabsWrapMultiLine || (allTabsWidth > visibleTabsWidth && lastTabFitsWrapped())) {
|
|
1197
|
+
updateTabsWrapping(true);
|
|
1198
|
+
}
|
|
1199
|
+
if (tabsWrapMultiLine) {
|
|
1200
|
+
if ((tabsContainer.offsetHeight > dimensions.available.height) ||
|
|
1201
|
+
(allTabsWidth === visibleTabsWidth && tabsContainer.offsetHeight === this.tabHeight) ||
|
|
1202
|
+
(!lastTabFitsWrapped())
|
|
1203
|
+
) {
|
|
1204
|
+
updateTabsWrapping(false);
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
else if (didTabsWrapMultiLine) {
|
|
1209
|
+
updateTabsWrapping(false);
|
|
1210
|
+
}
|
|
1211
|
+
if (tabsWrapMultiLine && !didTabsWrapMultiLine) {
|
|
1212
|
+
const visibleTabsWidth = tabsContainer.offsetWidth;
|
|
1213
|
+
tabsScrollbar.setScrollDimensions({
|
|
1214
|
+
width: visibleTabsWidth,
|
|
1215
|
+
scrollWidth: visibleTabsWidth
|
|
1216
|
+
});
|
|
1217
|
+
}
|
|
1218
|
+
if (tabsWrapMultiLine) {
|
|
1219
|
+
const tabs = ( new Map());
|
|
1220
|
+
let currentTabsPosY = undefined;
|
|
1221
|
+
let lastTab = undefined;
|
|
1222
|
+
for (const child of tabsContainer.children) {
|
|
1223
|
+
const tab = child;
|
|
1224
|
+
const tabPosY = tab.offsetTop;
|
|
1225
|
+
if (tabPosY !== currentTabsPosY) {
|
|
1226
|
+
currentTabsPosY = tabPosY;
|
|
1227
|
+
if (lastTab) {
|
|
1228
|
+
tabs.set(lastTab, true);
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
lastTab = tab;
|
|
1232
|
+
tabs.set(tab, false);
|
|
1233
|
+
}
|
|
1234
|
+
if (lastTab) {
|
|
1235
|
+
tabs.set(lastTab, true);
|
|
1236
|
+
}
|
|
1237
|
+
for (const [tab, lastInRow] of tabs) {
|
|
1238
|
+
tab.classList.toggle('last-in-row', lastInRow);
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
return tabsWrapMultiLine;
|
|
1242
|
+
}
|
|
1243
|
+
doLayoutTabsNonWrapping(options) {
|
|
1244
|
+
const [tabsContainer, tabsScrollbar] = assertAllDefined(this.tabsContainer, this.tabsScrollbar);
|
|
1245
|
+
const visibleTabsWidth = tabsContainer.offsetWidth;
|
|
1246
|
+
const allTabsWidth = tabsContainer.scrollWidth;
|
|
1247
|
+
let stickyTabsWidth = 0;
|
|
1248
|
+
if (this.tabsModel.stickyCount > 0) {
|
|
1249
|
+
let stickyTabWidth = 0;
|
|
1250
|
+
switch (this.groupsView.partOptions.pinnedTabSizing) {
|
|
1251
|
+
case 'compact':
|
|
1252
|
+
stickyTabWidth = MultiEditorTabsControl_1.TAB_WIDTH.compact;
|
|
1253
|
+
break;
|
|
1254
|
+
case 'shrink':
|
|
1255
|
+
stickyTabWidth = MultiEditorTabsControl_1.TAB_WIDTH.shrink;
|
|
1256
|
+
break;
|
|
1257
|
+
}
|
|
1258
|
+
stickyTabsWidth = this.tabsModel.stickyCount * stickyTabWidth;
|
|
1259
|
+
}
|
|
1260
|
+
const activeTabAndIndex = this.tabsModel.activeEditor ? this.getTabAndIndex(this.tabsModel.activeEditor) : undefined;
|
|
1261
|
+
const [activeTab, activeTabIndex] = activeTabAndIndex ?? [undefined, undefined];
|
|
1262
|
+
let activeTabPositionStatic = this.groupsView.partOptions.pinnedTabSizing !== 'normal' && typeof activeTabIndex === 'number' && this.tabsModel.isSticky(activeTabIndex);
|
|
1263
|
+
let availableTabsContainerWidth = visibleTabsWidth - stickyTabsWidth;
|
|
1264
|
+
if (this.tabsModel.stickyCount > 0 && availableTabsContainerWidth < MultiEditorTabsControl_1.TAB_WIDTH.fit) {
|
|
1265
|
+
tabsContainer.classList.add('disable-sticky-tabs');
|
|
1266
|
+
availableTabsContainerWidth = visibleTabsWidth;
|
|
1267
|
+
stickyTabsWidth = 0;
|
|
1268
|
+
activeTabPositionStatic = false;
|
|
1269
|
+
}
|
|
1270
|
+
else {
|
|
1271
|
+
tabsContainer.classList.remove('disable-sticky-tabs');
|
|
1272
|
+
}
|
|
1273
|
+
let activeTabPosX;
|
|
1274
|
+
let activeTabWidth;
|
|
1275
|
+
if (!this.blockRevealActiveTab && activeTab) {
|
|
1276
|
+
activeTabPosX = activeTab.offsetLeft;
|
|
1277
|
+
activeTabWidth = activeTab.offsetWidth;
|
|
1278
|
+
}
|
|
1279
|
+
const { width: oldVisibleTabsWidth, scrollWidth: oldAllTabsWidth } = tabsScrollbar.getScrollDimensions();
|
|
1280
|
+
tabsScrollbar.setScrollDimensions({
|
|
1281
|
+
width: visibleTabsWidth,
|
|
1282
|
+
scrollWidth: allTabsWidth
|
|
1283
|
+
});
|
|
1284
|
+
const dimensionsChanged = oldVisibleTabsWidth !== visibleTabsWidth || oldAllTabsWidth !== allTabsWidth;
|
|
1285
|
+
if (this.blockRevealActiveTab ||
|
|
1286
|
+
typeof activeTabPosX !== 'number' ||
|
|
1287
|
+
typeof activeTabWidth !== 'number' ||
|
|
1288
|
+
activeTabPositionStatic ||
|
|
1289
|
+
(!dimensionsChanged && !options?.forceRevealActiveTab)
|
|
1290
|
+
) {
|
|
1291
|
+
this.blockRevealActiveTab = false;
|
|
1292
|
+
return;
|
|
1293
|
+
}
|
|
1294
|
+
const tabsContainerScrollPosX = tabsScrollbar.getScrollPosition().scrollLeft;
|
|
1295
|
+
const activeTabFits = activeTabWidth <= availableTabsContainerWidth;
|
|
1296
|
+
const adjustedActiveTabPosX = activeTabPosX - stickyTabsWidth;
|
|
1297
|
+
if (activeTabFits && tabsContainerScrollPosX + availableTabsContainerWidth < adjustedActiveTabPosX + activeTabWidth) {
|
|
1298
|
+
tabsScrollbar.setScrollPosition({
|
|
1299
|
+
scrollLeft: tabsContainerScrollPosX + (((adjustedActiveTabPosX + activeTabWidth) - (tabsContainerScrollPosX + availableTabsContainerWidth)) )
|
|
1300
|
+
});
|
|
1301
|
+
}
|
|
1302
|
+
else if (tabsContainerScrollPosX > adjustedActiveTabPosX || !activeTabFits) {
|
|
1303
|
+
tabsScrollbar.setScrollPosition({
|
|
1304
|
+
scrollLeft: adjustedActiveTabPosX
|
|
1305
|
+
});
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
updateTabsControlVisibility() {
|
|
1309
|
+
const tabsAndActionsContainer = assertIsDefined(this.tabsAndActionsContainer);
|
|
1310
|
+
tabsAndActionsContainer.classList.toggle('empty', !this.visible);
|
|
1311
|
+
if (!this.visible && this.dimensions) {
|
|
1312
|
+
this.dimensions.used = undefined;
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
get visible() {
|
|
1316
|
+
return this.tabsModel.count > 0;
|
|
1317
|
+
}
|
|
1318
|
+
getTabAndIndex(editor) {
|
|
1319
|
+
const tabIndex = this.tabsModel.indexOf(editor);
|
|
1320
|
+
const tab = this.getTabAtIndex(tabIndex);
|
|
1321
|
+
if (tab) {
|
|
1322
|
+
return [tab, tabIndex];
|
|
1323
|
+
}
|
|
1324
|
+
return undefined;
|
|
1325
|
+
}
|
|
1326
|
+
getTabAtIndex(tabIndex) {
|
|
1327
|
+
if (tabIndex >= 0) {
|
|
1328
|
+
const tabsContainer = assertIsDefined(this.tabsContainer);
|
|
1329
|
+
return tabsContainer.children[tabIndex];
|
|
1330
|
+
}
|
|
1331
|
+
return undefined;
|
|
1332
|
+
}
|
|
1333
|
+
getLastTab() {
|
|
1334
|
+
return this.getTabAtIndex(this.tabsModel.count - 1);
|
|
1335
|
+
}
|
|
1336
|
+
blockRevealActiveTabOnce() {
|
|
1337
|
+
this.blockRevealActiveTab = true;
|
|
1338
|
+
}
|
|
1339
|
+
originatesFromTabActionBar(e) {
|
|
1340
|
+
let element;
|
|
1341
|
+
if (isMouseEvent(e)) {
|
|
1342
|
+
element = (e.target || e.srcElement);
|
|
1343
|
+
}
|
|
1344
|
+
else {
|
|
1345
|
+
element = e.initialTarget;
|
|
1346
|
+
}
|
|
1347
|
+
return !!findParentWithClass(element, 'action-item', 'tab');
|
|
1348
|
+
}
|
|
1349
|
+
async onDrop(e, targetTabIndex, tabsContainer) {
|
|
1350
|
+
EventHelper.stop(e, true);
|
|
1351
|
+
this.updateDropFeedback(tabsContainer, false);
|
|
1352
|
+
tabsContainer.classList.remove('scroll');
|
|
1353
|
+
const targetEditorIndex = this.tabsModel instanceof UnstickyEditorGroupModel ? targetTabIndex + this.groupView.stickyCount : targetTabIndex;
|
|
1354
|
+
const options = {
|
|
1355
|
+
sticky: this.tabsModel instanceof StickyEditorGroupModel && this.tabsModel.stickyCount === targetEditorIndex,
|
|
1356
|
+
index: targetEditorIndex
|
|
1357
|
+
};
|
|
1358
|
+
if (this.groupTransfer.hasData(DraggedEditorGroupIdentifier.prototype)) {
|
|
1359
|
+
const data = this.groupTransfer.getData(DraggedEditorGroupIdentifier.prototype);
|
|
1360
|
+
if (Array.isArray(data)) {
|
|
1361
|
+
const sourceGroup = this.editorPartsView.getGroup(data[0].identifier);
|
|
1362
|
+
if (sourceGroup) {
|
|
1363
|
+
const mergeGroupOptions = { index: targetEditorIndex };
|
|
1364
|
+
if (!this.isMoveOperation(e, sourceGroup.id)) {
|
|
1365
|
+
mergeGroupOptions.mode = 0 ;
|
|
1366
|
+
}
|
|
1367
|
+
this.groupsView.mergeGroup(sourceGroup, this.groupView, mergeGroupOptions);
|
|
1368
|
+
}
|
|
1369
|
+
this.groupView.focus();
|
|
1370
|
+
this.groupTransfer.clearData(DraggedEditorGroupIdentifier.prototype);
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
else if (this.editorTransfer.hasData(DraggedEditorIdentifier.prototype)) {
|
|
1374
|
+
const data = this.editorTransfer.getData(DraggedEditorIdentifier.prototype);
|
|
1375
|
+
if (Array.isArray(data)) {
|
|
1376
|
+
const draggedEditor = data[0].identifier;
|
|
1377
|
+
const sourceGroup = this.editorPartsView.getGroup(draggedEditor.groupId);
|
|
1378
|
+
if (sourceGroup) {
|
|
1379
|
+
if (this.isMoveOperation(e, draggedEditor.groupId, draggedEditor.editor)) {
|
|
1380
|
+
sourceGroup.moveEditor(draggedEditor.editor, this.groupView, options);
|
|
1381
|
+
}
|
|
1382
|
+
else {
|
|
1383
|
+
sourceGroup.copyEditor(draggedEditor.editor, this.groupView, options);
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
this.groupView.focus();
|
|
1387
|
+
this.editorTransfer.clearData(DraggedEditorIdentifier.prototype);
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
else if (this.treeItemsTransfer.hasData(DraggedTreeItemsIdentifier.prototype)) {
|
|
1391
|
+
const data = this.treeItemsTransfer.getData(DraggedTreeItemsIdentifier.prototype);
|
|
1392
|
+
if (Array.isArray(data)) {
|
|
1393
|
+
const editors = [];
|
|
1394
|
+
for (const id of data) {
|
|
1395
|
+
const dataTransferItem = await this.treeViewsDragAndDropService.removeDragOperationTransfer(id.identifier);
|
|
1396
|
+
if (dataTransferItem) {
|
|
1397
|
+
const treeDropData = await extractTreeDropData(dataTransferItem);
|
|
1398
|
+
editors.push(...( treeDropData.map(
|
|
1399
|
+
editor => ({ ...editor, options: { ...editor.options, pinned: true, index: targetEditorIndex } })
|
|
1400
|
+
)));
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
this.editorService.openEditors(editors, this.groupView, { validateTrust: true });
|
|
1404
|
+
}
|
|
1405
|
+
this.treeItemsTransfer.clearData(DraggedTreeItemsIdentifier.prototype);
|
|
1406
|
+
}
|
|
1407
|
+
else {
|
|
1408
|
+
const dropHandler = this.instantiationService.createInstance(ResourcesDropHandler, { allowWorkspaceOpen: false });
|
|
1409
|
+
dropHandler.handleDrop(e, getWindow(this.parent), () => this.groupView, () => this.groupView.focus(), options);
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
dispose() {
|
|
1413
|
+
super.dispose();
|
|
1414
|
+
this.tabDisposables = dispose(this.tabDisposables);
|
|
1415
|
+
}
|
|
1416
|
+
};
|
|
1417
|
+
MultiEditorTabsControl = MultiEditorTabsControl_1 = ( __decorate([
|
|
1418
|
+
( __param(5, IContextMenuService)),
|
|
1419
|
+
( __param(6, IInstantiationService)),
|
|
1420
|
+
( __param(7, IContextKeyService)),
|
|
1421
|
+
( __param(8, IKeybindingService)),
|
|
1422
|
+
( __param(9, INotificationService)),
|
|
1423
|
+
( __param(10, IQuickInputService)),
|
|
1424
|
+
( __param(11, IThemeService)),
|
|
1425
|
+
( __param(12, IEditorService)),
|
|
1426
|
+
( __param(13, IPathService)),
|
|
1427
|
+
( __param(14, ITreeViewsDnDService)),
|
|
1428
|
+
( __param(15, IEditorResolverService)),
|
|
1429
|
+
( __param(16, IHostService))
|
|
1430
|
+
], MultiEditorTabsControl));
|
|
1431
|
+
registerThemingParticipant((theme, collector) => {
|
|
1432
|
+
const borderColor = theme.getColor(TAB_BORDER);
|
|
1433
|
+
if (borderColor) {
|
|
1434
|
+
collector.addRule(`
|
|
1435
|
+
.monaco-workbench .part.editor > .content .editor-group-container > .title > .tabs-and-actions-container.wrapping .tabs-container > .tab {
|
|
1436
|
+
border-bottom: 1px solid ${borderColor};
|
|
1437
|
+
}
|
|
1438
|
+
`);
|
|
1439
|
+
}
|
|
1440
|
+
const activeContrastBorderColor = theme.getColor(activeContrastBorder);
|
|
1441
|
+
if (activeContrastBorderColor) {
|
|
1442
|
+
collector.addRule(`
|
|
1443
|
+
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab.active,
|
|
1444
|
+
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab.active:hover {
|
|
1445
|
+
outline: 1px solid;
|
|
1446
|
+
outline-offset: -5px;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab.active:focus {
|
|
1450
|
+
outline-style: dashed;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.active {
|
|
1454
|
+
outline: 1px dotted;
|
|
1455
|
+
outline-offset: -5px;
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab:hover {
|
|
1459
|
+
outline: 1px dashed;
|
|
1460
|
+
outline-offset: -5px;
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.active > .tab-actions .action-label,
|
|
1464
|
+
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.active:hover > .tab-actions .action-label,
|
|
1465
|
+
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dirty > .tab-actions .action-label,
|
|
1466
|
+
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sticky > .tab-actions .action-label,
|
|
1467
|
+
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab:hover > .tab-actions .action-label {
|
|
1468
|
+
opacity: 1 !important;
|
|
1469
|
+
}
|
|
1470
|
+
`);
|
|
1471
|
+
}
|
|
1472
|
+
const contrastBorderColor = theme.getColor(contrastBorder);
|
|
1473
|
+
if (contrastBorderColor) {
|
|
1474
|
+
collector.addRule(`
|
|
1475
|
+
.monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions {
|
|
1476
|
+
outline: 1px solid ${contrastBorderColor}
|
|
1477
|
+
}
|
|
1478
|
+
`);
|
|
1479
|
+
}
|
|
1480
|
+
const tabHoverBackground = theme.getColor(TAB_HOVER_BACKGROUND);
|
|
1481
|
+
if (tabHoverBackground) {
|
|
1482
|
+
collector.addRule(`
|
|
1483
|
+
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab:hover {
|
|
1484
|
+
background-color: ${tabHoverBackground} !important;
|
|
1485
|
+
}
|
|
1486
|
+
`);
|
|
1487
|
+
}
|
|
1488
|
+
const tabUnfocusedHoverBackground = theme.getColor(TAB_UNFOCUSED_HOVER_BACKGROUND);
|
|
1489
|
+
if (tabUnfocusedHoverBackground) {
|
|
1490
|
+
collector.addRule(`
|
|
1491
|
+
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab:hover {
|
|
1492
|
+
background-color: ${tabUnfocusedHoverBackground} !important;
|
|
1493
|
+
}
|
|
1494
|
+
`);
|
|
1495
|
+
}
|
|
1496
|
+
const tabHoverForeground = theme.getColor(TAB_HOVER_FOREGROUND);
|
|
1497
|
+
if (tabHoverForeground) {
|
|
1498
|
+
collector.addRule(`
|
|
1499
|
+
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab:hover {
|
|
1500
|
+
color: ${tabHoverForeground} !important;
|
|
1501
|
+
}
|
|
1502
|
+
`);
|
|
1503
|
+
}
|
|
1504
|
+
const tabUnfocusedHoverForeground = theme.getColor(TAB_UNFOCUSED_HOVER_FOREGROUND);
|
|
1505
|
+
if (tabUnfocusedHoverForeground) {
|
|
1506
|
+
collector.addRule(`
|
|
1507
|
+
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab:hover {
|
|
1508
|
+
color: ${tabUnfocusedHoverForeground} !important;
|
|
1509
|
+
}
|
|
1510
|
+
`);
|
|
1511
|
+
}
|
|
1512
|
+
const tabHoverBorder = theme.getColor(TAB_HOVER_BORDER);
|
|
1513
|
+
if (tabHoverBorder) {
|
|
1514
|
+
collector.addRule(`
|
|
1515
|
+
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab:hover > .tab-border-bottom-container {
|
|
1516
|
+
display: block;
|
|
1517
|
+
position: absolute;
|
|
1518
|
+
left: 0;
|
|
1519
|
+
pointer-events: none;
|
|
1520
|
+
width: 100%;
|
|
1521
|
+
z-index: 10;
|
|
1522
|
+
bottom: 0;
|
|
1523
|
+
height: 1px;
|
|
1524
|
+
background-color: ${tabHoverBorder};
|
|
1525
|
+
}
|
|
1526
|
+
`);
|
|
1527
|
+
}
|
|
1528
|
+
const tabUnfocusedHoverBorder = theme.getColor(TAB_UNFOCUSED_HOVER_BORDER);
|
|
1529
|
+
if (tabUnfocusedHoverBorder) {
|
|
1530
|
+
collector.addRule(`
|
|
1531
|
+
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab:hover > .tab-border-bottom-container {
|
|
1532
|
+
display: block;
|
|
1533
|
+
position: absolute;
|
|
1534
|
+
left: 0;
|
|
1535
|
+
pointer-events: none;
|
|
1536
|
+
width: 100%;
|
|
1537
|
+
z-index: 10;
|
|
1538
|
+
bottom: 0;
|
|
1539
|
+
height: 1px;
|
|
1540
|
+
background-color: ${tabUnfocusedHoverBorder};
|
|
1541
|
+
}
|
|
1542
|
+
`);
|
|
1543
|
+
}
|
|
1544
|
+
if (!isHighContrast(theme.type) && !isSafari && !activeContrastBorderColor) {
|
|
1545
|
+
const workbenchBackground = WORKBENCH_BACKGROUND(theme);
|
|
1546
|
+
const editorBackgroundColor = theme.getColor(editorBackground);
|
|
1547
|
+
const editorGroupHeaderTabsBackground = theme.getColor(EDITOR_GROUP_HEADER_TABS_BACKGROUND);
|
|
1548
|
+
const editorDragAndDropBackground = theme.getColor(EDITOR_DRAG_AND_DROP_BACKGROUND);
|
|
1549
|
+
let adjustedTabBackground;
|
|
1550
|
+
if (editorGroupHeaderTabsBackground && editorBackgroundColor) {
|
|
1551
|
+
adjustedTabBackground = editorGroupHeaderTabsBackground.flatten(editorBackgroundColor, editorBackgroundColor, workbenchBackground);
|
|
1552
|
+
}
|
|
1553
|
+
let adjustedTabDragBackground;
|
|
1554
|
+
if (editorGroupHeaderTabsBackground && editorBackgroundColor && editorDragAndDropBackground && editorBackgroundColor) {
|
|
1555
|
+
adjustedTabDragBackground = editorGroupHeaderTabsBackground.flatten(editorBackgroundColor, editorDragAndDropBackground, editorBackgroundColor, workbenchBackground);
|
|
1556
|
+
}
|
|
1557
|
+
const makeTabHoverBackgroundRule = (color, colorDrag, hasFocus = false) => `
|
|
1558
|
+
.monaco-workbench .part.editor > .content:not(.dragged-over) .editor-group-container${hasFocus ? '.active' : ''} > .title .tabs-container > .tab.sizing-shrink:not(.dragged):not(.sticky-compact):hover > .tab-label > .monaco-icon-label-container::after,
|
|
1559
|
+
.monaco-workbench .part.editor > .content:not(.dragged-over) .editor-group-container${hasFocus ? '.active' : ''} > .title .tabs-container > .tab.sizing-fixed:not(.dragged):not(.sticky-compact):hover > .tab-label > .monaco-icon-label-container::after {
|
|
1560
|
+
background: linear-gradient(to left, ${color}, transparent) !important;
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
.monaco-workbench .part.editor > .content.dragged-over .editor-group-container${hasFocus ? '.active' : ''} > .title .tabs-container > .tab.sizing-shrink:not(.dragged):not(.sticky-compact):hover > .tab-label > .monaco-icon-label-container::after,
|
|
1564
|
+
.monaco-workbench .part.editor > .content.dragged-over .editor-group-container${hasFocus ? '.active' : ''} > .title .tabs-container > .tab.sizing-fixed:not(.dragged):not(.sticky-compact):hover > .tab-label > .monaco-icon-label-container::after {
|
|
1565
|
+
background: linear-gradient(to left, ${colorDrag}, transparent) !important;
|
|
1566
|
+
}
|
|
1567
|
+
`;
|
|
1568
|
+
if (tabHoverBackground && adjustedTabBackground && adjustedTabDragBackground) {
|
|
1569
|
+
const adjustedColor = tabHoverBackground.flatten(adjustedTabBackground);
|
|
1570
|
+
const adjustedColorDrag = tabHoverBackground.flatten(adjustedTabDragBackground);
|
|
1571
|
+
collector.addRule(makeTabHoverBackgroundRule(adjustedColor, adjustedColorDrag, true));
|
|
1572
|
+
}
|
|
1573
|
+
if (tabUnfocusedHoverBackground && adjustedTabBackground && adjustedTabDragBackground) {
|
|
1574
|
+
const adjustedColor = tabUnfocusedHoverBackground.flatten(adjustedTabBackground);
|
|
1575
|
+
const adjustedColorDrag = tabUnfocusedHoverBackground.flatten(adjustedTabDragBackground);
|
|
1576
|
+
collector.addRule(makeTabHoverBackgroundRule(adjustedColor, adjustedColorDrag));
|
|
1577
|
+
}
|
|
1578
|
+
if (editorDragAndDropBackground && adjustedTabDragBackground) {
|
|
1579
|
+
const adjustedColorDrag = editorDragAndDropBackground.flatten(adjustedTabDragBackground);
|
|
1580
|
+
collector.addRule(`
|
|
1581
|
+
.monaco-workbench .part.editor > .content.dragged-over .editor-group-container.active > .title .tabs-container > .tab.sizing-shrink.dragged-over:not(.active):not(.dragged):not(.sticky-compact) > .tab-label > .monaco-icon-label-container::after,
|
|
1582
|
+
.monaco-workbench .part.editor > .content.dragged-over .editor-group-container:not(.active) > .title .tabs-container > .tab.sizing-shrink.dragged-over:not(.dragged):not(.sticky-compact) > .tab-label > .monaco-icon-label-container::after,
|
|
1583
|
+
.monaco-workbench .part.editor > .content.dragged-over .editor-group-container.active > .title .tabs-container > .tab.sizing-fixed.dragged-over:not(.active):not(.dragged):not(.sticky-compact) > .tab-label > .monaco-icon-label-container::after,
|
|
1584
|
+
.monaco-workbench .part.editor > .content.dragged-over .editor-group-container:not(.active) > .title .tabs-container > .tab.sizing-fixed.dragged-over:not(.dragged):not(.sticky-compact) > .tab-label > .monaco-icon-label-container::after {
|
|
1585
|
+
background: linear-gradient(to left, ${adjustedColorDrag}, transparent) !important;
|
|
1586
|
+
}
|
|
1587
|
+
`);
|
|
1588
|
+
}
|
|
1589
|
+
const makeTabBackgroundRule = (color, colorDrag, focused, active) => `
|
|
1590
|
+
.monaco-workbench .part.editor > .content:not(.dragged-over) .editor-group-container${focused ? '.active' : ':not(.active)'} > .title .tabs-container > .tab.sizing-shrink${active ? '.active' : ''}:not(.dragged):not(.sticky-compact) > .tab-label > .monaco-icon-label-container::after,
|
|
1591
|
+
.monaco-workbench .part.editor > .content:not(.dragged-over) .editor-group-container${focused ? '.active' : ':not(.active)'} > .title .tabs-container > .tab.sizing-fixed${active ? '.active' : ''}:not(.dragged):not(.sticky-compact) > .tab-label > .monaco-icon-label-container::after {
|
|
1592
|
+
background: linear-gradient(to left, ${color}, transparent);
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
.monaco-workbench .part.editor > .content.dragged-over .editor-group-container${focused ? '.active' : ':not(.active)'} > .title .tabs-container > .tab.sizing-shrink${active ? '.active' : ''}:not(.dragged):not(.sticky-compact) > .tab-label > .monaco-icon-label-container::after,
|
|
1596
|
+
.monaco-workbench .part.editor > .content.dragged-over .editor-group-container${focused ? '.active' : ':not(.active)'} > .title .tabs-container > .tab.sizing-fixed${active ? '.active' : ''}:not(.dragged):not(.sticky-compact) > .tab-label > .monaco-icon-label-container::after {
|
|
1597
|
+
background: linear-gradient(to left, ${colorDrag}, transparent);
|
|
1598
|
+
}
|
|
1599
|
+
`;
|
|
1600
|
+
const tabActiveBackground = theme.getColor(TAB_ACTIVE_BACKGROUND);
|
|
1601
|
+
if (tabActiveBackground && adjustedTabBackground && adjustedTabDragBackground) {
|
|
1602
|
+
const adjustedColor = tabActiveBackground.flatten(adjustedTabBackground);
|
|
1603
|
+
const adjustedColorDrag = tabActiveBackground.flatten(adjustedTabDragBackground);
|
|
1604
|
+
collector.addRule(makeTabBackgroundRule(adjustedColor, adjustedColorDrag, true, true));
|
|
1605
|
+
}
|
|
1606
|
+
const tabUnfocusedActiveBackground = theme.getColor(TAB_UNFOCUSED_ACTIVE_BACKGROUND);
|
|
1607
|
+
if (tabUnfocusedActiveBackground && adjustedTabBackground && adjustedTabDragBackground) {
|
|
1608
|
+
const adjustedColor = tabUnfocusedActiveBackground.flatten(adjustedTabBackground);
|
|
1609
|
+
const adjustedColorDrag = tabUnfocusedActiveBackground.flatten(adjustedTabDragBackground);
|
|
1610
|
+
collector.addRule(makeTabBackgroundRule(adjustedColor, adjustedColorDrag, false, true));
|
|
1611
|
+
}
|
|
1612
|
+
const tabInactiveBackground = theme.getColor(TAB_INACTIVE_BACKGROUND);
|
|
1613
|
+
if (tabInactiveBackground && adjustedTabBackground && adjustedTabDragBackground) {
|
|
1614
|
+
const adjustedColor = tabInactiveBackground.flatten(adjustedTabBackground);
|
|
1615
|
+
const adjustedColorDrag = tabInactiveBackground.flatten(adjustedTabDragBackground);
|
|
1616
|
+
collector.addRule(makeTabBackgroundRule(adjustedColor, adjustedColorDrag, true, false));
|
|
1617
|
+
}
|
|
1618
|
+
const tabUnfocusedInactiveBackground = theme.getColor(TAB_UNFOCUSED_INACTIVE_BACKGROUND);
|
|
1619
|
+
if (tabUnfocusedInactiveBackground && adjustedTabBackground && adjustedTabDragBackground) {
|
|
1620
|
+
const adjustedColor = tabUnfocusedInactiveBackground.flatten(adjustedTabBackground);
|
|
1621
|
+
const adjustedColorDrag = tabUnfocusedInactiveBackground.flatten(adjustedTabDragBackground);
|
|
1622
|
+
collector.addRule(makeTabBackgroundRule(adjustedColor, adjustedColorDrag, false, false));
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
});
|
|
1626
|
+
export { MultiEditorTabsControl };
|