@codingame/monaco-vscode-api 2.0.3-improve-modularity.1 → 2.1.0-update-vscode-1.86.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.js +15 -12
- package/extensions.d.ts +4 -7
- package/external/@xterm/xterm/typings/xterm.d.ts +22 -0
- package/missing-services.js +62 -6
- package/package.json +8 -8
- package/service-override/tools/editor.js +14 -0
- package/services.d.ts +3 -2
- package/services.js +6 -4
- package/vscode/src/vs/base/browser/browser.js +45 -30
- package/vscode/src/vs/base/browser/canIUse.js +1 -1
- package/vscode/src/vs/base/browser/defaultWorkerFactory.js +12 -5
- package/vscode/src/vs/base/browser/dom.js +104 -14
- package/vscode/src/vs/base/browser/indexedDB.js +3 -3
- package/vscode/src/vs/base/browser/markdownRenderer.js +29 -1
- package/vscode/src/vs/base/browser/mouseEvent.js +17 -3
- package/vscode/src/vs/base/browser/ui/actionbar/actionbar.js +3 -3
- package/vscode/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.css.js +4 -0
- package/vscode/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.js +287 -0
- package/vscode/src/vs/base/browser/ui/button/button.js +9 -0
- package/vscode/src/vs/base/browser/ui/codicons/codicon/codicon.css.js +1 -1
- package/vscode/src/vs/base/browser/ui/dialog/dialog.js +1 -1
- package/vscode/src/vs/base/browser/ui/iconLabel/iconLabelHover.js +16 -5
- package/vscode/src/vs/base/browser/ui/list/listView.js +31 -11
- package/vscode/src/vs/base/browser/ui/list/listWidget.js +35 -21
- package/vscode/src/vs/base/browser/ui/menu/menu.js +10 -1
- package/vscode/src/vs/base/browser/ui/menu/menubar.js +8 -4
- package/vscode/src/vs/base/browser/ui/scrollbar/scrollableElement.js +6 -5
- package/vscode/src/vs/base/browser/ui/tree/abstractTree.js +469 -95
- package/vscode/src/vs/base/browser/ui/tree/asyncDataTree.js +22 -7
- package/vscode/src/vs/base/browser/ui/tree/indexTreeModel.js +0 -5
- package/vscode/src/vs/base/browser/ui/tree/media/tree.css.js +1 -1
- package/vscode/src/vs/base/browser/ui/tree/objectTree.js +70 -4
- package/vscode/src/vs/base/common/assert.js +6 -1
- package/vscode/src/vs/base/common/async.js +31 -6
- package/vscode/src/vs/base/common/codicons.js +5 -0
- package/vscode/src/vs/base/common/event.d.ts +0 -5
- package/vscode/src/vs/base/common/event.js +0 -15
- package/vscode/src/vs/base/common/filters.d.ts +1 -18
- package/vscode/src/vs/base/common/htmlContent.js +12 -6
- package/vscode/src/vs/base/common/iterator.js +8 -0
- package/vscode/src/vs/base/common/labels.js +2 -1
- package/vscode/src/vs/base/common/map.js +20 -1
- package/vscode/src/vs/base/common/observableInternal/base.d.ts +4 -0
- package/vscode/src/vs/base/common/observableInternal/base.js +16 -8
- package/vscode/src/vs/base/common/observableInternal/derived.js +4 -6
- package/vscode/src/vs/base/common/observableInternal/utils.js +60 -5
- package/vscode/src/vs/base/common/platform.js +20 -20
- package/vscode/src/vs/base/common/prefixTree.js +4 -3
- package/vscode/src/vs/base/common/product.d.ts +5 -2
- package/vscode/src/vs/base/common/strings.js +23 -7
- package/vscode/src/vs/base/common/themables.js +4 -1
- package/vscode/src/vs/base/common/uri.js +11 -1
- package/vscode/src/vs/base/common/worker/simpleWorker.js +1 -1
- package/vscode/src/vs/editor/browser/config/migrateOptions.js +5 -0
- package/vscode/src/vs/editor/browser/controller/mouseHandler.js +1 -0
- package/vscode/src/vs/editor/browser/controller/mouseTarget.js +14 -8
- package/vscode/src/vs/editor/browser/controller/pointerHandler.js +18 -11
- package/vscode/src/vs/editor/browser/controller/textAreaHandler.js +1 -1
- package/vscode/src/vs/editor/browser/controller/textAreaInput.js +3 -3
- package/vscode/src/vs/{workbench/services/hover/browser → editor/browser/services}/hoverService.d.ts +7 -6
- package/vscode/src/vs/editor/browser/services/hoverService.js +195 -0
- package/vscode/src/vs/editor/browser/view.js +29 -39
- package/vscode/src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js +41 -19
- package/vscode/src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.js +1 -1
- package/vscode/src/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +30 -23
- package/vscode/src/vs/editor/browser/viewParts/lineNumbers/lineNumbers.js +23 -8
- package/vscode/src/vs/editor/browser/viewParts/lines/viewLines.js +1 -1
- package/vscode/src/vs/editor/browser/viewParts/linesDecorations/linesDecorations.js +8 -1
- package/vscode/src/vs/editor/browser/viewParts/marginDecorations/marginDecorations.js +7 -1
- package/vscode/src/vs/editor/browser/viewParts/minimap/minimap.js +1 -1
- package/vscode/src/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js +30 -3
- package/vscode/src/vs/editor/browser/widget/codeEditorWidget.js +39 -15
- package/vscode/src/vs/editor/browser/widget/diffEditor/{accessibleDiffViewer.css.js → components/accessibleDiffViewer.css.js} +1 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/{accessibleDiffViewer.js → components/accessibleDiffViewer.js} +43 -43
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorDecorations.js +89 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/{diffEditorEditors.js → components/diffEditorEditors.js} +14 -14
- package/vscode/src/vs/editor/browser/widget/diffEditor/{diffEditorSash.js → components/diffEditorSash.js} +5 -5
- package/vscode/src/vs/editor/browser/widget/diffEditor/{lineAlignment.js → components/diffEditorViewZones/diffEditorViewZones.js} +38 -28
- package/vscode/src/vs/editor/browser/widget/diffEditor/{inlineDiffDeletedCodeMargin.js → components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js} +14 -14
- package/vscode/src/vs/editor/browser/widget/diffEditor/{renderLines.js → components/diffEditorViewZones/renderLines.js} +7 -7
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +29 -38
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorViewModel.js +150 -38
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +17 -16
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js +104 -6
- package/vscode/src/vs/editor/browser/widget/diffEditor/{hideUnchangedRegionsFeature.js → features/hideUnchangedRegionsFeature.js} +51 -78
- package/vscode/src/vs/editor/browser/widget/diffEditor/{movedBlocksLines.js → features/movedBlocksLinesFeature.js} +23 -23
- package/vscode/src/vs/editor/browser/widget/diffEditor/{overviewRulerPart.js → features/overviewRulerFeature.js} +28 -28
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +145 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/{decorations.js → registrations.contribution.js} +18 -2
- package/vscode/src/vs/editor/browser/widget/diffEditor/utils.js +10 -2
- package/vscode/src/vs/editor/browser/widget/hoverWidget/hover.css.js +4 -0
- package/vscode/src/vs/editor/browser/widget/hoverWidget/hoverWidget.js +527 -0
- package/vscode/src/vs/editor/{contrib → browser/widget}/markdownRenderer/browser/markdownRenderer.js +11 -11
- package/vscode/src/vs/editor/{contrib → browser/widget}/markdownRenderer/browser/renderedMarkdown.css.js +1 -1
- package/vscode/src/vs/editor/common/config/editorOptions.d.ts +11 -10
- package/vscode/src/vs/editor/common/config/editorOptions.js +46 -42
- package/vscode/src/vs/editor/common/core/editorColorRegistry.js +3 -3
- package/vscode/src/vs/editor/common/core/offsetRange.d.ts +2 -0
- package/vscode/src/vs/editor/common/core/offsetRange.js +8 -0
- package/vscode/src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.js +9 -0
- package/vscode/src/vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations.js +50 -47
- package/vscode/src/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence.js +4 -1
- package/vscode/src/vs/editor/common/diff/rangeMapping.d.ts +2 -1
- package/vscode/src/vs/editor/common/diff/rangeMapping.js +13 -2
- package/vscode/src/vs/editor/common/languages.d.ts +10 -2
- package/vscode/src/vs/editor/common/model/textModel.js +19 -13
- package/vscode/src/vs/editor/common/model/tokenizationTextModelPart.js +1 -1
- package/vscode/src/vs/editor/common/model.d.ts +19 -1
- package/vscode/src/vs/editor/common/model.js +2 -1
- package/vscode/src/vs/editor/common/services/editorSimpleWorker.js +2 -1
- package/vscode/src/vs/editor/common/services/getIconClasses.js +4 -1
- package/vscode/src/vs/editor/common/services/semanticTokensProviderStyling.js +3 -3
- package/vscode/src/vs/editor/common/standalone/standaloneEnums.js +9 -8
- package/vscode/src/vs/editor/common/standaloneStrings.js +18 -18
- package/vscode/src/vs/editor/common/viewEvents.js +2 -0
- package/vscode/src/vs/editor/common/viewModel/glyphLanesModel.js +55 -0
- package/vscode/src/vs/editor/common/viewModel/viewModelImpl.js +4 -1
- package/vscode/src/vs/editor/contrib/clipboard/browser/clipboard.js +5 -1
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeAction.js +1 -0
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionController.js +46 -20
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionMenu.js +1 -1
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionModel.js +38 -11
- package/vscode/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +56 -101
- package/vscode/src/vs/editor/contrib/codelens/browser/codelensWidget.js +3 -2
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorContributions.js +2 -2
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorHoverParticipant.js +10 -29
- package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerWidget.js +4 -4
- package/vscode/src/vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution.js +51 -0
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +19 -1
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +38 -10
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +29 -1
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/edit.js +10 -3
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +3 -17
- package/vscode/src/vs/editor/contrib/find/browser/findController.js +3 -35
- package/vscode/src/vs/editor/contrib/folding/browser/foldingDecorations.js +26 -6
- package/vscode/src/vs/editor/contrib/fontZoom/browser/fontZoom.js +6 -6
- package/vscode/src/vs/editor/contrib/format/browser/format.js +9 -9
- package/vscode/src/vs/editor/contrib/format/browser/formatActions.js +5 -5
- package/vscode/src/vs/editor/contrib/gotoError/browser/media/gotoErrorWidget.css.js +1 -1
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +2 -2
- package/vscode/src/vs/editor/contrib/hover/browser/contentHover.js +85 -76
- package/vscode/src/vs/editor/contrib/hover/browser/hover.js +120 -90
- package/vscode/src/vs/editor/contrib/hover/browser/marginHover.js +18 -6
- package/vscode/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +1 -1
- package/vscode/src/vs/editor/contrib/hover/browser/markerHoverParticipant.js +2 -2
- package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHints.js +4 -2
- package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +56 -38
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hoverParticipant.js +1 -1
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController.js +12 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHintsWidget.js +4 -0
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel.js +2 -2
- package/vscode/src/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +50 -53
- package/vscode/src/vs/editor/contrib/message/browser/messageController.js +5 -2
- package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +1 -1
- package/vscode/src/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js +5 -1
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.css.js +1 -1
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +4 -4
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +8 -5
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +58 -46
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestController.js +34 -7
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +30 -38
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestModel.js +2 -2
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidget.js +11 -3
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +18 -7
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +8 -10
- package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
- package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +7 -6
- package/vscode/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -0
- package/vscode/src/vs/editor/editor.api.d.ts +82 -11
- package/vscode/src/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js +8 -3
- package/vscode/src/vs/editor/standalone/browser/standaloneLayoutService.js +4 -3
- package/vscode/src/vs/editor/standalone/browser/standaloneServices.js +22 -11
- package/vscode/src/vs/editor/standalone/browser/standaloneThemeService.js +1 -1
- package/vscode/src/vs/nls.d.ts +6 -0
- package/vscode/src/vs/platform/accessibility/browser/accessibilityService.js +4 -1
- package/vscode/src/vs/platform/accessibility/common/accessibility.d.ts +2 -16
- package/vscode/src/vs/platform/accessibility/common/accessibility.js +1 -2
- package/vscode/src/vs/platform/action/common/actionCommonCategories.d.ts +7 -20
- package/vscode/src/vs/platform/action/common/actionCommonCategories.js +8 -8
- package/vscode/src/vs/platform/actionWidget/browser/actionList.js +0 -1
- package/vscode/src/vs/platform/actionWidget/browser/actionWidget.css.js +1 -1
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +2 -0
- package/vscode/src/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem.js +5 -0
- package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.css.js +1 -1
- package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.js +2 -2
- package/vscode/src/vs/platform/actions/common/actions.d.ts +9 -1
- package/vscode/src/vs/platform/actions/common/actions.js +12 -1
- package/vscode/src/vs/platform/audioCues/browser/audioCueService.d.ts +11 -1
- package/vscode/src/vs/platform/audioCues/browser/audioCueService.js +174 -28
- package/vscode/src/vs/platform/clipboard/browser/clipboardService.js +38 -5
- package/vscode/src/vs/platform/configuration/common/configuration.d.ts +0 -1
- package/vscode/src/vs/platform/environment/common/environmentService.js +1 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.d.ts +5 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +24 -5
- package/vscode/src/vs/platform/extensions/common/extensions.d.ts +6 -1
- package/vscode/src/vs/{workbench/services → platform}/hover/browser/hover.d.ts +6 -8
- package/vscode/src/vs/platform/hover/browser/hover.js +3 -0
- package/vscode/src/vs/platform/instantiation/common/instantiationService.js +14 -4
- package/vscode/src/vs/platform/keybinding/common/abstractKeybindingService.js +11 -4
- package/vscode/src/vs/platform/keybinding/common/keybinding.d.ts +7 -0
- package/vscode/src/vs/platform/layout/browser/layoutService.d.ts +6 -0
- package/vscode/src/vs/platform/list/browser/listService.js +7 -5
- package/vscode/src/vs/platform/log/common/bufferLog.js +1 -0
- package/vscode/src/vs/platform/log/common/log.d.ts +0 -1
- package/vscode/src/vs/platform/log/common/log.js +1 -2
- package/vscode/src/vs/platform/notification/common/notification.d.ts +36 -19
- package/vscode/src/vs/platform/notification/common/notification.js +9 -3
- package/vscode/src/vs/platform/quickinput/browser/pickerQuickAccess.js +4 -1
- package/vscode/src/vs/platform/quickinput/browser/quickInput.js +50 -48
- package/vscode/src/vs/platform/quickinput/browser/quickInputController.js +3 -5
- package/vscode/src/vs/platform/quickinput/browser/quickInputList.js +49 -66
- package/vscode/src/vs/platform/quickinput/browser/quickInputService.js +11 -3
- package/vscode/src/vs/platform/quickinput/browser/quickInputUtils.js +16 -2
- package/vscode/src/vs/platform/quickinput/common/quickInput.d.ts +230 -26
- package/vscode/src/vs/platform/remote/common/remoteAuthorityResolver.d.ts +1 -0
- package/vscode/src/vs/platform/telemetry/common/telemetryUtils.js +1 -0
- package/vscode/src/vs/platform/theme/browser/defaultStyles.js +5 -3
- package/vscode/src/vs/platform/theme/common/colorRegistry.js +28 -9
- package/vscode/src/vs/platform/tunnel/common/tunnel.d.ts +2 -0
- package/vscode/src/vs/platform/window/common/window.js +14 -8
- package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +97 -78
- package/vscode/src/vs/workbench/api/common/extHost.protocol.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostAuthentication.js +1 -22
- package/vscode/src/vs/workbench/api/common/extHostChat.js +0 -6
- package/vscode/src/vs/workbench/api/common/extHostChatAgents2.js +31 -36
- package/vscode/src/vs/workbench/api/common/extHostChatVariables.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostComments.js +6 -1
- package/vscode/src/vs/workbench/api/common/extHostConsoleForwarder.js +1 -0
- package/vscode/src/vs/workbench/api/common/extHostDebugService.js +130 -6
- package/vscode/src/vs/workbench/api/common/extHostDocumentContentProviders.js +28 -15
- package/vscode/src/vs/workbench/api/common/extHostDocuments.js +4 -5
- package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +5 -1
- package/vscode/src/vs/workbench/api/common/extHostFileSystem.js +1 -2
- package/vscode/src/vs/workbench/api/common/extHostFileSystemConsumer.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostInlineChat.js +35 -33
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +40 -13
- package/vscode/src/vs/workbench/api/common/extHostMessageService.js +10 -1
- package/vscode/src/vs/workbench/api/common/extHostNotebook.js +11 -7
- package/vscode/src/vs/workbench/api/common/extHostNotebookEditors.js +2 -3
- package/vscode/src/vs/workbench/api/common/extHostNotebookKernels.js +29 -4
- package/vscode/src/vs/workbench/api/common/extHostProfileContentHandler.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostProgress.js +1 -7
- package/vscode/src/vs/workbench/api/common/extHostSCM.js +49 -93
- package/vscode/src/vs/workbench/api/common/extHostSpeech.js +21 -0
- package/vscode/src/vs/workbench/api/common/extHostTask.js +18 -22
- package/vscode/src/vs/workbench/api/common/extHostTelemetry.js +1 -0
- package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +3 -3
- package/vscode/src/vs/workbench/api/common/extHostTesting.js +55 -36
- package/vscode/src/vs/workbench/api/common/extHostTextEditor.js +5 -2
- package/vscode/src/vs/workbench/api/common/extHostTextEditors.js +6 -7
- package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +6 -3
- package/vscode/src/vs/workbench/api/common/extHostTunnelService.js +4 -2
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +74 -12
- package/vscode/src/vs/workbench/api/common/extHostTypes.js +27 -8
- package/vscode/src/vs/workbench/api/worker/extHostConsoleForwarder.js +1 -1
- package/vscode/src/vs/workbench/browser/actions/layoutActions.js +172 -103
- package/vscode/src/vs/workbench/browser/actions/windowActions.js +13 -17
- package/vscode/src/vs/workbench/browser/actions/workspaceActions.js +34 -34
- package/vscode/src/vs/workbench/browser/actions/workspaceCommands.js +4 -4
- package/vscode/src/vs/workbench/browser/dnd.js +2 -2
- package/vscode/src/vs/workbench/browser/labels.js +34 -4
- package/vscode/src/vs/workbench/browser/part.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.js +4 -4
- package/vscode/src/vs/workbench/browser/parts/compositeBarActions.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsControl.js +801 -0
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsModel.js +140 -0
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.js +410 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editor.js +1 -2
- package/vscode/src/vs/workbench/browser/parts/editor/editorActions.js +304 -303
- package/vscode/src/vs/workbench/browser/parts/editor/editorAutoSave.js +101 -47
- package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +114 -47
- package/vscode/src/vs/workbench/browser/parts/editor/editorGroupView.js +1313 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorGroupWatermark.js +190 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorPanes.js +344 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorQuickAccess.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorStatus.js +10 -10
- package/vscode/src/vs/workbench/browser/parts/editor/editorTabsControl.js +27 -42
- package/vscode/src/vs/workbench/browser/parts/editor/editorTitleControl.js +152 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorsObserver.js +8 -8
- package/vscode/src/vs/workbench/browser/parts/editor/media/breadcrumbscontrol.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/editor/media/editorgroupview.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/editor/media/editortitlecontrol.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/editor/media/multieditortabscontrol.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/editor/media/singleeditortabscontrol.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.js +1626 -0
- package/vscode/src/vs/workbench/browser/parts/editor/multiRowEditorTabsControl.js +150 -0
- package/vscode/src/vs/workbench/browser/parts/editor/noEditorTabsControl.js +52 -0
- package/vscode/src/vs/workbench/browser/parts/editor/singleEditorTabsControl.js +260 -0
- package/vscode/src/vs/workbench/browser/parts/editor/textEditor.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/textResourceEditor.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +39 -36
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCommands.js +68 -28
- package/vscode/src/vs/workbench/browser/parts/panel/media/panelpart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/panel/panelActions.js +15 -14
- package/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.js +18 -17
- package/vscode/src/vs/workbench/browser/parts/titlebar/windowTitle.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/views/media/views.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/views/treeView.js +7 -10
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +2 -1
- package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.d.ts +2 -1
- package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +18 -17
- package/vscode/src/vs/workbench/browser/quickaccess.js +33 -1
- package/vscode/src/vs/workbench/browser/web.api.d.ts +6 -0
- package/vscode/src/vs/workbench/browser/window.js +92 -9
- package/vscode/src/vs/workbench/browser/workbench.contribution.js +114 -65
- package/vscode/src/vs/workbench/common/component.d.ts +5 -1
- package/vscode/src/vs/workbench/common/component.js +6 -0
- package/vscode/src/vs/workbench/common/configuration.js +11 -1
- package/vscode/src/vs/workbench/common/contextkeys.js +8 -4
- package/vscode/src/vs/workbench/common/editor/editorInput.d.ts +6 -0
- package/vscode/src/vs/workbench/common/editor/editorInput.js +3 -0
- package/vscode/src/vs/workbench/common/editor/filteredEditorGroupModel.js +107 -0
- package/vscode/src/vs/workbench/common/editor/resourceEditorInput.d.ts +6 -3
- package/vscode/src/vs/workbench/common/editor/resourceEditorInput.js +21 -3
- package/vscode/src/vs/workbench/common/editor/textResourceEditorInput.d.ts +2 -1
- package/vscode/src/vs/workbench/common/editor/textResourceEditorInput.js +9 -6
- package/vscode/src/vs/workbench/common/editor.d.ts +16 -4
- package/vscode/src/vs/workbench/common/editor.js +7 -1
- package/vscode/src/vs/workbench/common/memento.js +33 -12
- package/vscode/src/vs/workbench/common/notifications.js +30 -7
- package/vscode/src/vs/workbench/common/theme.js +61 -1
- package/vscode/src/vs/workbench/common/views.d.ts +1 -28
- package/vscode/src/vs/workbench/common/views.js +1 -2
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +232 -19
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityContributions.js +9 -9
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleView.js +1 -0
- package/vscode/src/vs/workbench/contrib/accessibility/browser/editorAccessibilityHelp.js +19 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +8 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +57 -38
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorInput.js +9 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +31 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +93 -49
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +30 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommandContentWidget.js +24 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +9 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +12 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +21 -43
- package/vscode/src/vs/workbench/contrib/chat/common/chatService.js +6 -6
- package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.js +4 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +0 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/{comments.contribution.js → commentsAccessibility.js} +36 -128
- package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +41 -18
- package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +202 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +27 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +165 -52
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +48 -31
- package/vscode/src/vs/workbench/contrib/debug/browser/debugIcons.js +6 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/media/breakpointWidget.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debug.d.ts +40 -10
- package/vscode/src/vs/workbench/contrib/debug/common/debug.js +28 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debugContext.js +14 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +52 -23
- package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debugVisualizers.js +164 -0
- package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +10 -0
- package/vscode/src/vs/workbench/contrib/debug/common/replModel.js +285 -0
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +123 -78
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.js +10 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorInput.js +326 -0
- package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +1 -2
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +8 -9
- package/vscode/src/vs/workbench/contrib/files/browser/files.configuration.contribution.js +70 -2
- package/vscode/src/vs/workbench/contrib/files/browser/files.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/files/browser/files.fileEditorFactory.contribution.js +13 -0
- package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +2 -2
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerView.js +34 -17
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.js +5 -4
- package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +48 -14
- package/vscode/src/vs/workbench/contrib/format/browser/formatActionsMultiple.js +16 -8
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +317 -321
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget.js +17 -24
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingService.js +3 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +306 -130
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +3 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +385 -613
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +69 -64
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +71 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +39 -44
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +5 -3
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookEditorStickyScroll.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +38 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +36 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +32 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.js +24 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.js +1 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatActions.js +264 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatController.js +60 -27
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +12 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +12 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +6 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +188 -155
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.js +10 -3
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +16 -33
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +9 -7
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +6 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookKernelService.js +2 -1
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +29 -14
- package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +15 -3
- package/vscode/src/vs/workbench/contrib/remote/browser/urlFinder.js +2 -2
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +22 -6
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +1 -1
- package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +16 -17
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetCompletionProvider.js +78 -50
- package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +15 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.d.ts +25 -45
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEditorInput.js +12 -4
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIcon.js +2 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +33 -36
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.js +3 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +5 -8
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +15 -27
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +3 -3
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +38 -22
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverageService.js +5 -2
- package/vscode/src/vs/workbench/contrib/testing/common/testProfileService.js +60 -40
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +2 -2
- package/vscode/src/vs/workbench/contrib/testing/common/testResultStorage.js +15 -11
- package/vscode/src/vs/workbench/contrib/testing/common/testService.js +26 -1
- package/vscode/src/vs/workbench/contrib/testing/common/testTypes.js +24 -23
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.js +1 -1
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +124 -26
- package/vscode/src/vs/workbench/services/authentication/common/authentication.d.ts +68 -0
- package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +76 -36
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolver.js +1 -0
- package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +1 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorService.js +15 -3
- package/vscode/src/vs/workbench/services/editor/common/editorGroupFinder.js +10 -1
- package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.d.ts +51 -43
- package/vscode/src/vs/workbench/services/editor/common/editorService.d.ts +13 -8
- package/vscode/src/vs/workbench/services/editor/common/editorService.js +2 -1
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +10 -10
- package/vscode/src/vs/workbench/services/extensions/browser/extensionUrlHandler.js +8 -8
- package/vscode/src/vs/workbench/services/extensions/common/extensionsApiProposals.js +7 -7
- package/vscode/src/vs/workbench/services/extensions/common/rpcProtocol.js +1 -0
- package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.d.ts +29 -9
- package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +160 -63
- package/vscode/src/vs/workbench/services/host/browser/host.d.ts +8 -0
- package/vscode/src/vs/workbench/services/keybinding/common/keybindingEditing.js +60 -72
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.d.ts +0 -4
- package/vscode/src/vs/workbench/services/notebook/common/notebookDocumentService.js +56 -0
- package/vscode/src/vs/workbench/services/output/common/output.js +2 -2
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +10 -0
- package/vscode/src/vs/workbench/services/preferences/common/preferencesEditorInput.js +10 -0
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.js +2 -1
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +5 -4
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorInput.js +21 -8
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.d.ts +4 -0
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.js +3 -0
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfile.js +4 -4
- package/vscode/src/vs/workbench/{browser/parts/views → services/views/browser}/viewsService.js +20 -15
- package/vscode/src/vs/workbench/services/views/common/viewsService.d.ts +34 -0
- package/vscode/src/vs/workbench/services/{hover/browser/hover.js → views/common/viewsService.js} +2 -2
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.d.ts +6 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.js +5 -2
- package/vscode/src/vs/workbench/services/workspaces/common/workspaceTrust.js +1 -0
- package/vscode-dts/vscode.proposed.chatAgents2.d.ts +112 -47
- package/vscode-dts/vscode.proposed.chatAgents2Additions.d.ts +68 -9
- package/vscode-dts/{vscode.proposed.scmInputBoxActionButton.d.ts → vscode.proposed.codeActionRanges.d.ts} +8 -10
- package/vscode-dts/{vscode.proposed.readonlyMessage.d.ts → vscode.proposed.commentReactor.d.ts} +3 -4
- package/vscode-dts/vscode.proposed.contribMultiDiffEditorMenus.d.ts +6 -0
- package/vscode-dts/vscode.proposed.contribSourceControlHistoryItemGroupMenu.d.ts +8 -0
- package/vscode-dts/vscode.proposed.contribSourceControlHistoryItemMenu.d.ts +8 -0
- package/vscode-dts/vscode.proposed.debugVisualization.d.ts +100 -0
- package/vscode-dts/vscode.proposed.defaultChatAgent.d.ts +1 -1
- package/vscode-dts/vscode.proposed.interactive.d.ts +13 -16
- package/vscode-dts/vscode.proposed.notebookVariableProvider.d.ts +4 -1
- package/vscode-dts/vscode.proposed.resolvers.d.ts +4 -0
- package/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts +4 -10
- package/vscode-dts/vscode.proposed.scmMultiDiffEditor.d.ts +34 -0
- package/vscode-dts/vscode.proposed.speech.d.ts +17 -3
- package/vscode-dts/vscode.proposed.testCoverage.d.ts +7 -1
- package/vscode-dts/vscode.proposed.tunnelFactory.d.ts +4 -0
- package/vscode/src/vs/editor/browser/widget/diffEditor/colors.js +0 -17
- package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorDecorations.js +0 -231
- package/vscode/src/vs/editor/browser/widget/diffEditor/outlineModel.js +0 -299
- package/vscode/src/vs/editor/browser/widget/diffEditor/workerBasedDocumentDiffProvider.js +0 -101
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/suggestAddon.js +0 -390
- package/vscode/src/vs/workbench/services/editor/common/editorGroupColumn.d.ts +0 -10
- package/vscode/src/vs/workbench/services/suggest/browser/media/suggest.css.js +0 -4
- package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionItem.d.ts +0 -28
- package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionItem.js +0 -10
- package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionModel.d.ts +0 -30
- package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionModel.js +0 -98
- package/vscode/src/vs/workbench/services/suggest/browser/simpleSuggestWidget.d.ts +0 -10
- package/vscode/src/vs/workbench/services/suggest/browser/simpleSuggestWidget.js +0 -428
- package/vscode/src/vs/workbench/services/suggest/browser/simpleSuggestWidgetRenderer.js +0 -83
- package/vscode-dts/vscode.proposed.chatVariables.d.ts +0 -39
- package/vscode-dts/vscode.proposed.interactiveUserActions.d.ts +0 -77
- package/vscode-dts/vscode.proposed.saveEditor.d.ts +0 -35
- package/vscode-dts/vscode.proposed.scmInputBoxValueProvider.d.ts +0 -25
- package/vscode-dts/vscode.proposed.testingActiveProfile.d.ts +0 -21
|
@@ -0,0 +1,1313 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import './media/editorgroupview.css.js';
|
|
3
|
+
import { isSerializedEditorGroupModel, EditorGroupModel, isGroupEditorCloseEvent, isGroupEditorOpenEvent } from '../../../common/editor/editorGroupModel.js';
|
|
4
|
+
import { DEFAULT_EDITOR_ASSOCIATION, SideBySideEditor, EditorResourceAccessor, EditorCloseContext } from '../../../common/editor.js';
|
|
5
|
+
import { ResourceContextKey, ActiveEditorDirtyContext, ActiveEditorPinnedContext, ActiveEditorFirstInGroupContext, ActiveEditorLastInGroupContext, ActiveEditorStickyContext, EditorGroupEditorsCountContext, ActiveEditorGroupLockedContext, ActiveEditorAvailableEditorIdsContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, applyAvailableEditorIds } from '../../../common/contextkeys.js';
|
|
6
|
+
import { SideBySideEditorInput } from '../../../common/editor/sideBySideEditorInput.js';
|
|
7
|
+
import { Emitter, Relay } from '../../../../base/common/event.js';
|
|
8
|
+
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
|
|
9
|
+
import { addDisposableListener, EventHelper, EventType, getWindow, trackFocus, getActiveElement, isActiveElement, focusWindow, isAncestor, Dimension, isMouseEvent, findParentWithClass } from '../../../../base/browser/dom.js';
|
|
10
|
+
import { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js';
|
|
11
|
+
import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
|
|
12
|
+
import { ProgressBar } from '../../../../base/browser/ui/progressbar/progressbar.js';
|
|
13
|
+
import { Themable, IThemeService } from '../../../../platform/theme/common/themeService.js';
|
|
14
|
+
import { contrastBorder, editorBackground } from '../../../../platform/theme/common/colorRegistry.js';
|
|
15
|
+
import { EDITOR_GROUP_EMPTY_BACKGROUND, EDITOR_GROUP_HEADER_BORDER, EDITOR_GROUP_HEADER_TABS_BACKGROUND, EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND } from '../../../common/theme.js';
|
|
16
|
+
import { EditorPanes } from './editorPanes.js';
|
|
17
|
+
import { IEditorProgressService } from '../../../../platform/progress/common/progress.js';
|
|
18
|
+
import { EditorProgressIndicator } from '../../../services/progress/browser/progressIndicator.js';
|
|
19
|
+
import { localizeWithPath } from '../../../../nls.js';
|
|
20
|
+
import { coalesce, firstOrDefault } from '../../../../base/common/arrays.js';
|
|
21
|
+
import { MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js';
|
|
22
|
+
import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';
|
|
23
|
+
import { RunOnceWorker, DeferredPromise, Promises } from '../../../../base/common/async.js';
|
|
24
|
+
import { EventType as EventType$1 } from '../../../../base/browser/touch.js';
|
|
25
|
+
import { fillActiveEditorViewState } from './editor.js';
|
|
26
|
+
import { ActionBar } from '../../../../base/browser/ui/actionbar/actionbar.js';
|
|
27
|
+
import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';
|
|
28
|
+
import { MenuId, IMenuService } from '../../../../platform/actions/common/actions.js';
|
|
29
|
+
import { StandardMouseEvent } from '../../../../base/browser/mouseEvent.js';
|
|
30
|
+
import { createAndFillInActionBarActions } from '../../../../platform/actions/browser/menuEntryActionViewItem.js';
|
|
31
|
+
import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js';
|
|
32
|
+
import { IEditorService } from '../../../services/editor/common/editorService.js';
|
|
33
|
+
import { hash } from '../../../../base/common/hash.js';
|
|
34
|
+
import { getMimeTypes } from '../../../../editor/common/services/languagesAssociations.js';
|
|
35
|
+
import { extname, isEqual } from '../../../../base/common/resources.js';
|
|
36
|
+
import { Schemas } from '../../../../base/common/network.js';
|
|
37
|
+
import { EditorActivation } from '../../../../platform/editor/common/editor.js';
|
|
38
|
+
import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
39
|
+
import { IFilesConfigurationService } from '../../../services/filesConfiguration/common/filesConfigurationService.js';
|
|
40
|
+
import { IUriIdentityService } from '../../../../platform/uriIdentity/common/uriIdentity.js';
|
|
41
|
+
import { isNative, isWindows, isLinux, isMacintosh } from '../../../../base/common/platform.js';
|
|
42
|
+
import { ILogService } from '../../../../platform/log/common/log.js';
|
|
43
|
+
import { TelemetryTrustedValue } from '../../../../platform/telemetry/common/telemetryUtils.js';
|
|
44
|
+
import { defaultProgressBarStyles } from '../../../../platform/theme/browser/defaultStyles.js';
|
|
45
|
+
import { EditorGroupWatermark } from './editorGroupWatermark.js';
|
|
46
|
+
import { EditorTitleControl } from './editorTitleControl.js';
|
|
47
|
+
import { EditorPane } from './editorPane.js';
|
|
48
|
+
import { IEditorResolverService } from '../../../services/editor/common/editorResolverService.js';
|
|
49
|
+
import { IHostService } from '../../../services/host/browser/host.js';
|
|
50
|
+
import { IFileDialogService } from '../../../../platform/dialogs/common/dialogs.js';
|
|
51
|
+
var EditorGroupView_1;
|
|
52
|
+
let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable {
|
|
53
|
+
static createNew(editorPartsView, groupsView, groupsLabel, groupIndex, instantiationService) {
|
|
54
|
+
return instantiationService.createInstance(EditorGroupView_1, null, editorPartsView, groupsView, groupsLabel, groupIndex);
|
|
55
|
+
}
|
|
56
|
+
static createFromSerialized(serialized, editorPartsView, groupsView, groupsLabel, groupIndex, instantiationService) {
|
|
57
|
+
return instantiationService.createInstance(EditorGroupView_1, serialized, editorPartsView, groupsView, groupsLabel, groupIndex);
|
|
58
|
+
}
|
|
59
|
+
static createCopy(copyFrom, editorPartsView, groupsView, groupsLabel, groupIndex, instantiationService) {
|
|
60
|
+
return instantiationService.createInstance(EditorGroupView_1, copyFrom, editorPartsView, groupsView, groupsLabel, groupIndex);
|
|
61
|
+
}
|
|
62
|
+
constructor(from, editorPartsView, groupsView, groupsLabel, _index, instantiationService, contextKeyService, themeService, telemetryService, keybindingService, menuService, contextMenuService, fileDialogService, editorService, filesConfigurationService, uriIdentityService, logService, editorResolverService, hostService) {
|
|
63
|
+
super(themeService);
|
|
64
|
+
this.editorPartsView = editorPartsView;
|
|
65
|
+
this.groupsView = groupsView;
|
|
66
|
+
this.groupsLabel = groupsLabel;
|
|
67
|
+
this._index = _index;
|
|
68
|
+
this.instantiationService = instantiationService;
|
|
69
|
+
this.contextKeyService = contextKeyService;
|
|
70
|
+
this.telemetryService = telemetryService;
|
|
71
|
+
this.keybindingService = keybindingService;
|
|
72
|
+
this.menuService = menuService;
|
|
73
|
+
this.contextMenuService = contextMenuService;
|
|
74
|
+
this.fileDialogService = fileDialogService;
|
|
75
|
+
this.editorService = editorService;
|
|
76
|
+
this.filesConfigurationService = filesConfigurationService;
|
|
77
|
+
this.uriIdentityService = uriIdentityService;
|
|
78
|
+
this.logService = logService;
|
|
79
|
+
this.editorResolverService = editorResolverService;
|
|
80
|
+
this.hostService = hostService;
|
|
81
|
+
this._onDidFocus = this._register(( new Emitter()));
|
|
82
|
+
this.onDidFocus = this._onDidFocus.event;
|
|
83
|
+
this._onWillDispose = this._register(( new Emitter()));
|
|
84
|
+
this.onWillDispose = this._onWillDispose.event;
|
|
85
|
+
this._onDidModelChange = this._register(( new Emitter()));
|
|
86
|
+
this.onDidModelChange = this._onDidModelChange.event;
|
|
87
|
+
this._onDidActiveEditorChange = this._register(( new Emitter()));
|
|
88
|
+
this.onDidActiveEditorChange = this._onDidActiveEditorChange.event;
|
|
89
|
+
this._onDidOpenEditorFail = this._register(( new Emitter()));
|
|
90
|
+
this.onDidOpenEditorFail = this._onDidOpenEditorFail.event;
|
|
91
|
+
this._onWillCloseEditor = this._register(( new Emitter()));
|
|
92
|
+
this.onWillCloseEditor = this._onWillCloseEditor.event;
|
|
93
|
+
this._onDidCloseEditor = this._register(( new Emitter()));
|
|
94
|
+
this.onDidCloseEditor = this._onDidCloseEditor.event;
|
|
95
|
+
this._onWillMoveEditor = this._register(( new Emitter()));
|
|
96
|
+
this.onWillMoveEditor = this._onWillMoveEditor.event;
|
|
97
|
+
this._onWillOpenEditor = this._register(( new Emitter()));
|
|
98
|
+
this.onWillOpenEditor = this._onWillOpenEditor.event;
|
|
99
|
+
this.disposedEditorsWorker = this._register(( new RunOnceWorker(editors => this.handleDisposedEditors(editors), 0)));
|
|
100
|
+
this.mapEditorToPendingConfirmation = ( new Map());
|
|
101
|
+
this.containerToolBarMenuDisposable = this._register(( new MutableDisposable()));
|
|
102
|
+
this.whenRestoredPromise = ( new DeferredPromise());
|
|
103
|
+
this.whenRestored = this.whenRestoredPromise.p;
|
|
104
|
+
this._disposed = false;
|
|
105
|
+
this.element = document.createElement('div');
|
|
106
|
+
this._onDidChange = this._register(( new Relay()));
|
|
107
|
+
this.onDidChange = this._onDidChange.event;
|
|
108
|
+
if (from instanceof EditorGroupView_1) {
|
|
109
|
+
this.model = this._register(from.model.clone());
|
|
110
|
+
}
|
|
111
|
+
else if (isSerializedEditorGroupModel(from)) {
|
|
112
|
+
this.model = this._register(instantiationService.createInstance(EditorGroupModel, from));
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
this.model = this._register(instantiationService.createInstance(EditorGroupModel, undefined));
|
|
116
|
+
}
|
|
117
|
+
{
|
|
118
|
+
this.scopedContextKeyService = this._register(this.contextKeyService.createScoped(this.element));
|
|
119
|
+
this.element.classList.add(...coalesce(['editor-group-container', this.model.isLocked ? 'locked' : undefined]));
|
|
120
|
+
this.registerContainerListeners();
|
|
121
|
+
this.createContainerToolbar();
|
|
122
|
+
this.createContainerContextMenu();
|
|
123
|
+
this._register(this.instantiationService.createInstance(EditorGroupWatermark, this.element));
|
|
124
|
+
this.progressBar = this._register(( new ProgressBar(this.element, defaultProgressBarStyles)));
|
|
125
|
+
this.progressBar.hide();
|
|
126
|
+
this.scopedInstantiationService = this.instantiationService.createChild(( new ServiceCollection(
|
|
127
|
+
[IContextKeyService, this.scopedContextKeyService],
|
|
128
|
+
[IEditorProgressService, this._register(( new EditorProgressIndicator(this.progressBar, this)))]
|
|
129
|
+
)));
|
|
130
|
+
this.resourceContext = this._register(this.scopedInstantiationService.createInstance(ResourceContextKey));
|
|
131
|
+
this.handleGroupContextKeys();
|
|
132
|
+
this.titleContainer = document.createElement('div');
|
|
133
|
+
this.titleContainer.classList.add('title');
|
|
134
|
+
this.element.appendChild(this.titleContainer);
|
|
135
|
+
this.titleControl = this._register(this.scopedInstantiationService.createInstance(EditorTitleControl, this.titleContainer, this.editorPartsView, this.groupsView, this, this.model));
|
|
136
|
+
this.editorContainer = document.createElement('div');
|
|
137
|
+
this.editorContainer.classList.add('editor-container');
|
|
138
|
+
this.element.appendChild(this.editorContainer);
|
|
139
|
+
this.editorPane = this._register(this.scopedInstantiationService.createInstance(EditorPanes, this.element, this.editorContainer, this));
|
|
140
|
+
this._onDidChange.input = this.editorPane.onDidChangeSizeConstraints;
|
|
141
|
+
this.doTrackFocus();
|
|
142
|
+
this.updateTitleContainer();
|
|
143
|
+
this.updateContainer();
|
|
144
|
+
this.updateStyles();
|
|
145
|
+
}
|
|
146
|
+
const restoreEditorsPromise = this.restoreEditors(from) ?? Promise.resolve();
|
|
147
|
+
restoreEditorsPromise.finally(() => {
|
|
148
|
+
this.whenRestoredPromise.complete();
|
|
149
|
+
});
|
|
150
|
+
this.registerListeners();
|
|
151
|
+
}
|
|
152
|
+
handleGroupContextKeys() {
|
|
153
|
+
const groupActiveEditorDirtyContext = ActiveEditorDirtyContext.bindTo(this.scopedContextKeyService);
|
|
154
|
+
const groupActiveEditorPinnedContext = ActiveEditorPinnedContext.bindTo(this.scopedContextKeyService);
|
|
155
|
+
const groupActiveEditorFirstContext = ActiveEditorFirstInGroupContext.bindTo(this.scopedContextKeyService);
|
|
156
|
+
const groupActiveEditorLastContext = ActiveEditorLastInGroupContext.bindTo(this.scopedContextKeyService);
|
|
157
|
+
const groupActiveEditorStickyContext = ActiveEditorStickyContext.bindTo(this.scopedContextKeyService);
|
|
158
|
+
const groupEditorsCountContext = EditorGroupEditorsCountContext.bindTo(this.scopedContextKeyService);
|
|
159
|
+
const groupLockedContext = ActiveEditorGroupLockedContext.bindTo(this.scopedContextKeyService);
|
|
160
|
+
const groupActiveEditorAvailableEditorIds = ActiveEditorAvailableEditorIdsContext.bindTo(this.scopedContextKeyService);
|
|
161
|
+
const groupActiveEditorCanSplitInGroupContext = ActiveEditorCanSplitInGroupContext.bindTo(this.scopedContextKeyService);
|
|
162
|
+
const sideBySideEditorContext = SideBySideEditorActiveContext.bindTo(this.scopedContextKeyService);
|
|
163
|
+
const activeEditorListener = this._register(( new MutableDisposable()));
|
|
164
|
+
const observeActiveEditor = () => {
|
|
165
|
+
activeEditorListener.clear();
|
|
166
|
+
this.scopedContextKeyService.bufferChangeEvents(() => {
|
|
167
|
+
const activeEditor = this.activeEditor;
|
|
168
|
+
this.resourceContext.set(EditorResourceAccessor.getOriginalUri(activeEditor, { supportSideBySide: SideBySideEditor.PRIMARY } ?? null));
|
|
169
|
+
applyAvailableEditorIds(groupActiveEditorAvailableEditorIds, activeEditor, this.editorResolverService);
|
|
170
|
+
groupActiveEditorCanSplitInGroupContext.set(activeEditor ? activeEditor.hasCapability(32 ) : false);
|
|
171
|
+
sideBySideEditorContext.set(activeEditor?.typeId === SideBySideEditorInput.ID);
|
|
172
|
+
if (activeEditor) {
|
|
173
|
+
groupActiveEditorDirtyContext.set(activeEditor.isDirty() && !activeEditor.isSaving());
|
|
174
|
+
activeEditorListener.value = activeEditor.onDidChangeDirty(() => {
|
|
175
|
+
groupActiveEditorDirtyContext.set(activeEditor.isDirty() && !activeEditor.isSaving());
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
groupActiveEditorDirtyContext.set(false);
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
const updateGroupContextKeys = (e) => {
|
|
184
|
+
switch (e.kind) {
|
|
185
|
+
case 3 :
|
|
186
|
+
groupLockedContext.set(this.isLocked);
|
|
187
|
+
break;
|
|
188
|
+
case 7 :
|
|
189
|
+
groupActiveEditorFirstContext.set(this.model.isFirst(this.model.activeEditor));
|
|
190
|
+
groupActiveEditorLastContext.set(this.model.isLast(this.model.activeEditor));
|
|
191
|
+
groupActiveEditorPinnedContext.set(this.model.activeEditor ? this.model.isPinned(this.model.activeEditor) : false);
|
|
192
|
+
groupActiveEditorStickyContext.set(this.model.activeEditor ? this.model.isSticky(this.model.activeEditor) : false);
|
|
193
|
+
break;
|
|
194
|
+
case 5 :
|
|
195
|
+
case 4 :
|
|
196
|
+
case 6 :
|
|
197
|
+
groupActiveEditorFirstContext.set(this.model.isFirst(this.model.activeEditor));
|
|
198
|
+
groupActiveEditorLastContext.set(this.model.isLast(this.model.activeEditor));
|
|
199
|
+
break;
|
|
200
|
+
case 10 :
|
|
201
|
+
if (e.editor && e.editor === this.model.activeEditor) {
|
|
202
|
+
groupActiveEditorPinnedContext.set(this.model.isPinned(this.model.activeEditor));
|
|
203
|
+
}
|
|
204
|
+
break;
|
|
205
|
+
case 11 :
|
|
206
|
+
if (e.editor && e.editor === this.model.activeEditor) {
|
|
207
|
+
groupActiveEditorStickyContext.set(this.model.isSticky(this.model.activeEditor));
|
|
208
|
+
}
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
groupEditorsCountContext.set(this.count);
|
|
212
|
+
};
|
|
213
|
+
this._register(this.onDidModelChange(e => updateGroupContextKeys(e)));
|
|
214
|
+
this._register(this.onDidActiveEditorChange(() => observeActiveEditor()));
|
|
215
|
+
observeActiveEditor();
|
|
216
|
+
updateGroupContextKeys({ kind: 7 });
|
|
217
|
+
updateGroupContextKeys({ kind: 3 });
|
|
218
|
+
}
|
|
219
|
+
registerContainerListeners() {
|
|
220
|
+
this._register(addDisposableListener(this.element, EventType.DBLCLICK, e => {
|
|
221
|
+
if (this.isEmpty) {
|
|
222
|
+
EventHelper.stop(e);
|
|
223
|
+
this.editorService.openEditor({
|
|
224
|
+
resource: undefined,
|
|
225
|
+
options: {
|
|
226
|
+
pinned: true,
|
|
227
|
+
override: DEFAULT_EDITOR_ASSOCIATION.id
|
|
228
|
+
}
|
|
229
|
+
}, this.id);
|
|
230
|
+
}
|
|
231
|
+
}));
|
|
232
|
+
this._register(addDisposableListener(this.element, EventType.AUXCLICK, e => {
|
|
233
|
+
if (this.isEmpty && e.button === 1 ) {
|
|
234
|
+
EventHelper.stop(e, true);
|
|
235
|
+
this.groupsView.removeGroup(this);
|
|
236
|
+
}
|
|
237
|
+
}));
|
|
238
|
+
}
|
|
239
|
+
createContainerToolbar() {
|
|
240
|
+
const toolbarContainer = document.createElement('div');
|
|
241
|
+
toolbarContainer.classList.add('editor-group-container-toolbar');
|
|
242
|
+
this.element.appendChild(toolbarContainer);
|
|
243
|
+
const containerToolbar = this._register(( new ActionBar(toolbarContainer, {
|
|
244
|
+
ariaLabel: ( localizeWithPath(
|
|
245
|
+
'vs/workbench/browser/parts/editor/editorGroupView',
|
|
246
|
+
'ariaLabelGroupActions',
|
|
247
|
+
"Empty editor group actions"
|
|
248
|
+
)),
|
|
249
|
+
highlightToggledItems: true
|
|
250
|
+
})));
|
|
251
|
+
const containerToolbarMenu = this._register(this.menuService.createMenu(MenuId.EmptyEditorGroup, this.scopedContextKeyService));
|
|
252
|
+
const updateContainerToolbar = () => {
|
|
253
|
+
const actions = { primary: [], secondary: [] };
|
|
254
|
+
this.containerToolBarMenuDisposable.value = toDisposable(() => containerToolbar.clear());
|
|
255
|
+
createAndFillInActionBarActions(containerToolbarMenu, { arg: { groupId: this.id }, shouldForwardArgs: true }, actions, 'navigation');
|
|
256
|
+
for (const action of [...actions.primary, ...actions.secondary]) {
|
|
257
|
+
const keybinding = this.keybindingService.lookupKeybinding(action.id);
|
|
258
|
+
containerToolbar.push(action, { icon: true, label: false, keybinding: keybinding?.getLabel() });
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
updateContainerToolbar();
|
|
262
|
+
this._register(containerToolbarMenu.onDidChange(updateContainerToolbar));
|
|
263
|
+
}
|
|
264
|
+
createContainerContextMenu() {
|
|
265
|
+
this._register(addDisposableListener(this.element, EventType.CONTEXT_MENU, e => this.onShowContainerContextMenu(e)));
|
|
266
|
+
this._register(addDisposableListener(this.element, EventType$1.Contextmenu, () => this.onShowContainerContextMenu()));
|
|
267
|
+
}
|
|
268
|
+
onShowContainerContextMenu(e) {
|
|
269
|
+
if (!this.isEmpty) {
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
let anchor = this.element;
|
|
273
|
+
if (e) {
|
|
274
|
+
anchor = ( new StandardMouseEvent(getWindow(this.element), e));
|
|
275
|
+
}
|
|
276
|
+
this.contextMenuService.showContextMenu({
|
|
277
|
+
menuId: MenuId.EmptyEditorGroupContext,
|
|
278
|
+
contextKeyService: this.contextKeyService,
|
|
279
|
+
getAnchor: () => anchor,
|
|
280
|
+
onHide: () => {
|
|
281
|
+
this.focus();
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
doTrackFocus() {
|
|
286
|
+
const containerFocusTracker = this._register(trackFocus(this.element));
|
|
287
|
+
this._register(containerFocusTracker.onDidFocus(() => {
|
|
288
|
+
if (this.isEmpty) {
|
|
289
|
+
this._onDidFocus.fire();
|
|
290
|
+
}
|
|
291
|
+
}));
|
|
292
|
+
const handleTitleClickOrTouch = (e) => {
|
|
293
|
+
let target;
|
|
294
|
+
if (isMouseEvent(e)) {
|
|
295
|
+
if (e.button !== 0 || ((isMacintosh && e.ctrlKey) )) {
|
|
296
|
+
return undefined;
|
|
297
|
+
}
|
|
298
|
+
target = e.target;
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
target = e.initialTarget;
|
|
302
|
+
}
|
|
303
|
+
if (findParentWithClass(target, 'monaco-action-bar', this.titleContainer) ||
|
|
304
|
+
findParentWithClass(target, 'monaco-breadcrumb-item', this.titleContainer)) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
setTimeout(() => {
|
|
308
|
+
this.focus();
|
|
309
|
+
});
|
|
310
|
+
};
|
|
311
|
+
this._register(addDisposableListener(this.titleContainer, EventType.MOUSE_DOWN, e => handleTitleClickOrTouch(e)));
|
|
312
|
+
this._register(addDisposableListener(this.titleContainer, EventType$1.Tap, e => handleTitleClickOrTouch(e)));
|
|
313
|
+
this._register(this.editorPane.onDidFocus(() => {
|
|
314
|
+
this._onDidFocus.fire();
|
|
315
|
+
}));
|
|
316
|
+
}
|
|
317
|
+
updateContainer() {
|
|
318
|
+
if (this.isEmpty) {
|
|
319
|
+
this.element.classList.add('empty');
|
|
320
|
+
this.element.tabIndex = 0;
|
|
321
|
+
this.element.setAttribute('aria-label', ( localizeWithPath(
|
|
322
|
+
'vs/workbench/browser/parts/editor/editorGroupView',
|
|
323
|
+
'emptyEditorGroup',
|
|
324
|
+
"{0} (empty)",
|
|
325
|
+
this.ariaLabel
|
|
326
|
+
)));
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
this.element.classList.remove('empty');
|
|
330
|
+
this.element.removeAttribute('tabIndex');
|
|
331
|
+
this.element.removeAttribute('aria-label');
|
|
332
|
+
}
|
|
333
|
+
this.updateStyles();
|
|
334
|
+
}
|
|
335
|
+
updateTitleContainer() {
|
|
336
|
+
this.titleContainer.classList.toggle('tabs', this.groupsView.partOptions.showTabs === 'multiple');
|
|
337
|
+
this.titleContainer.classList.toggle('show-file-icons', this.groupsView.partOptions.showIcons);
|
|
338
|
+
}
|
|
339
|
+
restoreEditors(from) {
|
|
340
|
+
if (this.count === 0) {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
let options;
|
|
344
|
+
if (from instanceof EditorGroupView_1) {
|
|
345
|
+
options = fillActiveEditorViewState(from);
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
options = Object.create(null);
|
|
349
|
+
}
|
|
350
|
+
const activeEditor = this.model.activeEditor;
|
|
351
|
+
if (!activeEditor) {
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
options.pinned = this.model.isPinned(activeEditor);
|
|
355
|
+
options.sticky = this.model.isSticky(activeEditor);
|
|
356
|
+
options.preserveFocus = true;
|
|
357
|
+
const internalOptions = {
|
|
358
|
+
preserveWindowOrder: true
|
|
359
|
+
};
|
|
360
|
+
const activeElement = getActiveElement();
|
|
361
|
+
return this.doShowEditor(activeEditor, { active: true, isNew: false }, options, internalOptions).then(() => {
|
|
362
|
+
if (this.groupsView.activeGroup === this && activeElement && isActiveElement(activeElement)) {
|
|
363
|
+
this.focus();
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
registerListeners() {
|
|
368
|
+
this._register(this.model.onDidModelChange(e => this.onDidGroupModelChange(e)));
|
|
369
|
+
this._register(this.groupsView.onDidChangeEditorPartOptions(e => this.onDidChangeEditorPartOptions(e)));
|
|
370
|
+
this._register(this.groupsView.onDidVisibilityChange(e => this.onDidVisibilityChange(e)));
|
|
371
|
+
}
|
|
372
|
+
onDidGroupModelChange(e) {
|
|
373
|
+
this._onDidModelChange.fire(e);
|
|
374
|
+
if (e.kind === 3 ) {
|
|
375
|
+
this.element.classList.toggle('locked', this.isLocked);
|
|
376
|
+
}
|
|
377
|
+
if (!e.editor) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
switch (e.kind) {
|
|
381
|
+
case 4 :
|
|
382
|
+
if (isGroupEditorOpenEvent(e)) {
|
|
383
|
+
this.onDidOpenEditor(e.editor, e.editorIndex);
|
|
384
|
+
}
|
|
385
|
+
break;
|
|
386
|
+
case 5 :
|
|
387
|
+
if (isGroupEditorCloseEvent(e)) {
|
|
388
|
+
this.handleOnDidCloseEditor(e.editor, e.editorIndex, e.context, e.sticky);
|
|
389
|
+
}
|
|
390
|
+
break;
|
|
391
|
+
case 13 :
|
|
392
|
+
this.onWillDisposeEditor(e.editor);
|
|
393
|
+
break;
|
|
394
|
+
case 12 :
|
|
395
|
+
this.onDidChangeEditorDirty(e.editor);
|
|
396
|
+
break;
|
|
397
|
+
case 8 :
|
|
398
|
+
this.onDidChangeEditorLabel(e.editor);
|
|
399
|
+
break;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
onDidOpenEditor(editor, editorIndex) {
|
|
403
|
+
this.telemetryService.publicLog('editorOpened', this.toEditorTelemetryDescriptor(editor));
|
|
404
|
+
this.updateContainer();
|
|
405
|
+
}
|
|
406
|
+
handleOnDidCloseEditor(editor, editorIndex, context, sticky) {
|
|
407
|
+
this._onWillCloseEditor.fire({ groupId: this.id, editor, context, index: editorIndex, sticky });
|
|
408
|
+
const editorsToClose = [editor];
|
|
409
|
+
if (editor instanceof SideBySideEditorInput) {
|
|
410
|
+
editorsToClose.push(editor.primary, editor.secondary);
|
|
411
|
+
}
|
|
412
|
+
for (const editor of editorsToClose) {
|
|
413
|
+
if (this.canDispose(editor)) {
|
|
414
|
+
editor.dispose();
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
this.telemetryService.publicLog('editorClosed', this.toEditorTelemetryDescriptor(editor));
|
|
418
|
+
this.updateContainer();
|
|
419
|
+
this._onDidCloseEditor.fire({ groupId: this.id, editor, context, index: editorIndex, sticky });
|
|
420
|
+
}
|
|
421
|
+
canDispose(editor) {
|
|
422
|
+
for (const groupView of this.editorPartsView.groups) {
|
|
423
|
+
if (groupView instanceof EditorGroupView_1 && groupView.model.contains(editor, {
|
|
424
|
+
strictEquals: true,
|
|
425
|
+
supportSideBySide: SideBySideEditor.ANY
|
|
426
|
+
})) {
|
|
427
|
+
return false;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
return true;
|
|
431
|
+
}
|
|
432
|
+
toEditorTelemetryDescriptor(editor) {
|
|
433
|
+
const descriptor = editor.getTelemetryDescriptor();
|
|
434
|
+
const resource = EditorResourceAccessor.getOriginalUri(editor);
|
|
435
|
+
const path = resource ? resource.scheme === Schemas.file ? resource.fsPath : resource.path : undefined;
|
|
436
|
+
if (resource && path) {
|
|
437
|
+
let resourceExt = extname(resource);
|
|
438
|
+
const queryStringLocation = resourceExt.indexOf('?');
|
|
439
|
+
resourceExt = queryStringLocation !== -1 ? resourceExt.substr(0, queryStringLocation) : resourceExt;
|
|
440
|
+
descriptor['resource'] = { mimeType: ( new TelemetryTrustedValue(getMimeTypes(resource).join(', '))), scheme: resource.scheme, ext: resourceExt, path: hash(path) };
|
|
441
|
+
return descriptor;
|
|
442
|
+
}
|
|
443
|
+
return descriptor;
|
|
444
|
+
}
|
|
445
|
+
onWillDisposeEditor(editor) {
|
|
446
|
+
this.disposedEditorsWorker.work(editor);
|
|
447
|
+
}
|
|
448
|
+
handleDisposedEditors(disposedEditors) {
|
|
449
|
+
let activeEditor;
|
|
450
|
+
const inactiveEditors = [];
|
|
451
|
+
for (const disposedEditor of disposedEditors) {
|
|
452
|
+
const editorFindResult = this.model.findEditor(disposedEditor);
|
|
453
|
+
if (!editorFindResult) {
|
|
454
|
+
continue;
|
|
455
|
+
}
|
|
456
|
+
const editor = editorFindResult[0];
|
|
457
|
+
if (!editor.isDisposed()) {
|
|
458
|
+
continue;
|
|
459
|
+
}
|
|
460
|
+
if (this.model.isActive(editor)) {
|
|
461
|
+
activeEditor = editor;
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
inactiveEditors.push(editor);
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
for (const inactiveEditor of inactiveEditors) {
|
|
468
|
+
this.doCloseEditor(inactiveEditor, true);
|
|
469
|
+
}
|
|
470
|
+
if (activeEditor) {
|
|
471
|
+
this.doCloseEditor(activeEditor);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
onDidChangeEditorPartOptions(event) {
|
|
475
|
+
this.updateTitleContainer();
|
|
476
|
+
this.titleControl.updateOptions(event.oldPartOptions, event.newPartOptions);
|
|
477
|
+
if (event.oldPartOptions.showTabs !== event.newPartOptions.showTabs ||
|
|
478
|
+
event.oldPartOptions.tabHeight !== event.newPartOptions.tabHeight ||
|
|
479
|
+
(event.oldPartOptions.showTabs === 'multiple' && event.oldPartOptions.pinnedTabsOnSeparateRow !== event.newPartOptions.pinnedTabsOnSeparateRow)) {
|
|
480
|
+
this.relayout();
|
|
481
|
+
if (this.model.activeEditor) {
|
|
482
|
+
this.titleControl.openEditor(this.model.activeEditor);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
this.updateStyles();
|
|
486
|
+
if (event.oldPartOptions.enablePreview && !event.newPartOptions.enablePreview) {
|
|
487
|
+
if (this.model.previewEditor) {
|
|
488
|
+
this.pinEditor(this.model.previewEditor);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
onDidChangeEditorDirty(editor) {
|
|
493
|
+
this.pinEditor(editor);
|
|
494
|
+
this.titleControl.updateEditorDirty(editor);
|
|
495
|
+
}
|
|
496
|
+
onDidChangeEditorLabel(editor) {
|
|
497
|
+
this.titleControl.updateEditorLabel(editor);
|
|
498
|
+
}
|
|
499
|
+
onDidVisibilityChange(visible) {
|
|
500
|
+
this.editorPane.setVisible(visible);
|
|
501
|
+
}
|
|
502
|
+
get index() {
|
|
503
|
+
return this._index;
|
|
504
|
+
}
|
|
505
|
+
get label() {
|
|
506
|
+
if (this.groupsLabel) {
|
|
507
|
+
return ( localizeWithPath(
|
|
508
|
+
'vs/workbench/browser/parts/editor/editorGroupView',
|
|
509
|
+
'groupLabelLong',
|
|
510
|
+
"{0}: Group {1}",
|
|
511
|
+
this.groupsLabel,
|
|
512
|
+
this._index + 1
|
|
513
|
+
));
|
|
514
|
+
}
|
|
515
|
+
return ( localizeWithPath(
|
|
516
|
+
'vs/workbench/browser/parts/editor/editorGroupView',
|
|
517
|
+
'groupLabel',
|
|
518
|
+
"Group {0}",
|
|
519
|
+
this._index + 1
|
|
520
|
+
));
|
|
521
|
+
}
|
|
522
|
+
get ariaLabel() {
|
|
523
|
+
if (this.groupsLabel) {
|
|
524
|
+
return ( localizeWithPath(
|
|
525
|
+
'vs/workbench/browser/parts/editor/editorGroupView',
|
|
526
|
+
'groupAriaLabelLong',
|
|
527
|
+
"{0}: Editor Group {1}",
|
|
528
|
+
this.groupsLabel,
|
|
529
|
+
this._index + 1
|
|
530
|
+
));
|
|
531
|
+
}
|
|
532
|
+
return ( localizeWithPath(
|
|
533
|
+
'vs/workbench/browser/parts/editor/editorGroupView',
|
|
534
|
+
'groupAriaLabel',
|
|
535
|
+
"Editor Group {0}",
|
|
536
|
+
this._index + 1
|
|
537
|
+
));
|
|
538
|
+
}
|
|
539
|
+
get disposed() {
|
|
540
|
+
return this._disposed;
|
|
541
|
+
}
|
|
542
|
+
get isEmpty() {
|
|
543
|
+
return this.count === 0;
|
|
544
|
+
}
|
|
545
|
+
get titleHeight() {
|
|
546
|
+
return this.titleControl.getHeight();
|
|
547
|
+
}
|
|
548
|
+
notifyIndexChanged(newIndex) {
|
|
549
|
+
if (this._index !== newIndex) {
|
|
550
|
+
this._index = newIndex;
|
|
551
|
+
this.model.setIndex(newIndex);
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
notifyLabelChanged(newLabel) {
|
|
555
|
+
if (this.groupsLabel !== newLabel) {
|
|
556
|
+
this.groupsLabel = newLabel;
|
|
557
|
+
this.model.setLabel(newLabel);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
setActive(isActive) {
|
|
561
|
+
this.active = isActive;
|
|
562
|
+
this.element.classList.toggle('active', isActive);
|
|
563
|
+
this.element.classList.toggle('inactive', !isActive);
|
|
564
|
+
this.titleControl.setActive(isActive);
|
|
565
|
+
this.updateStyles();
|
|
566
|
+
this.model.setActive(undefined );
|
|
567
|
+
}
|
|
568
|
+
get id() {
|
|
569
|
+
return this.model.id;
|
|
570
|
+
}
|
|
571
|
+
get windowId() {
|
|
572
|
+
return this.groupsView.windowId;
|
|
573
|
+
}
|
|
574
|
+
get editors() {
|
|
575
|
+
return this.model.getEditors(1 );
|
|
576
|
+
}
|
|
577
|
+
get count() {
|
|
578
|
+
return this.model.count;
|
|
579
|
+
}
|
|
580
|
+
get stickyCount() {
|
|
581
|
+
return this.model.stickyCount;
|
|
582
|
+
}
|
|
583
|
+
get activeEditorPane() {
|
|
584
|
+
return this.editorPane ? this.editorPane.activeEditorPane ?? undefined : undefined;
|
|
585
|
+
}
|
|
586
|
+
get activeEditor() {
|
|
587
|
+
return this.model.activeEditor;
|
|
588
|
+
}
|
|
589
|
+
get previewEditor() {
|
|
590
|
+
return this.model.previewEditor;
|
|
591
|
+
}
|
|
592
|
+
isPinned(editorOrIndex) {
|
|
593
|
+
return this.model.isPinned(editorOrIndex);
|
|
594
|
+
}
|
|
595
|
+
isSticky(editorOrIndex) {
|
|
596
|
+
return this.model.isSticky(editorOrIndex);
|
|
597
|
+
}
|
|
598
|
+
isActive(editor) {
|
|
599
|
+
return this.model.isActive(editor);
|
|
600
|
+
}
|
|
601
|
+
contains(candidate, options) {
|
|
602
|
+
return this.model.contains(candidate, options);
|
|
603
|
+
}
|
|
604
|
+
getEditors(order, options) {
|
|
605
|
+
return this.model.getEditors(order, options);
|
|
606
|
+
}
|
|
607
|
+
findEditors(resource, options) {
|
|
608
|
+
const canonicalResource = this.uriIdentityService.asCanonicalUri(resource);
|
|
609
|
+
return this.getEditors(1 ).filter(editor => {
|
|
610
|
+
if (editor.resource && isEqual(editor.resource, canonicalResource)) {
|
|
611
|
+
return true;
|
|
612
|
+
}
|
|
613
|
+
if (options?.supportSideBySide === SideBySideEditor.PRIMARY || options?.supportSideBySide === SideBySideEditor.ANY) {
|
|
614
|
+
const primaryResource = EditorResourceAccessor.getCanonicalUri(editor, { supportSideBySide: SideBySideEditor.PRIMARY });
|
|
615
|
+
if (primaryResource && isEqual(primaryResource, canonicalResource)) {
|
|
616
|
+
return true;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
if (options?.supportSideBySide === SideBySideEditor.SECONDARY || options?.supportSideBySide === SideBySideEditor.ANY) {
|
|
620
|
+
const secondaryResource = EditorResourceAccessor.getCanonicalUri(editor, { supportSideBySide: SideBySideEditor.SECONDARY });
|
|
621
|
+
if (secondaryResource && isEqual(secondaryResource, canonicalResource)) {
|
|
622
|
+
return true;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
return false;
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
getEditorByIndex(index) {
|
|
629
|
+
return this.model.getEditorByIndex(index);
|
|
630
|
+
}
|
|
631
|
+
getIndexOfEditor(editor) {
|
|
632
|
+
return this.model.indexOf(editor);
|
|
633
|
+
}
|
|
634
|
+
isFirst(editor) {
|
|
635
|
+
return this.model.isFirst(editor);
|
|
636
|
+
}
|
|
637
|
+
isLast(editor) {
|
|
638
|
+
return this.model.isLast(editor);
|
|
639
|
+
}
|
|
640
|
+
focus() {
|
|
641
|
+
focusWindow(this.element);
|
|
642
|
+
if (this.activeEditorPane) {
|
|
643
|
+
this.activeEditorPane.focus();
|
|
644
|
+
}
|
|
645
|
+
else {
|
|
646
|
+
this.element.focus();
|
|
647
|
+
}
|
|
648
|
+
this._onDidFocus.fire();
|
|
649
|
+
}
|
|
650
|
+
pinEditor(candidate = this.activeEditor || undefined) {
|
|
651
|
+
if (candidate && !this.model.isPinned(candidate)) {
|
|
652
|
+
const editor = this.model.pin(candidate);
|
|
653
|
+
if (editor) {
|
|
654
|
+
this.titleControl.pinEditor(editor);
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
stickEditor(candidate = this.activeEditor || undefined) {
|
|
659
|
+
this.doStickEditor(candidate, true);
|
|
660
|
+
}
|
|
661
|
+
unstickEditor(candidate = this.activeEditor || undefined) {
|
|
662
|
+
this.doStickEditor(candidate, false);
|
|
663
|
+
}
|
|
664
|
+
doStickEditor(candidate, sticky) {
|
|
665
|
+
if (candidate && this.model.isSticky(candidate) !== sticky) {
|
|
666
|
+
const oldIndexOfEditor = this.getIndexOfEditor(candidate);
|
|
667
|
+
const editor = sticky ? this.model.stick(candidate) : this.model.unstick(candidate);
|
|
668
|
+
if (!editor) {
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
const newIndexOfEditor = this.getIndexOfEditor(editor);
|
|
672
|
+
if (newIndexOfEditor !== oldIndexOfEditor) {
|
|
673
|
+
this.titleControl.moveEditor(editor, oldIndexOfEditor, newIndexOfEditor, true);
|
|
674
|
+
}
|
|
675
|
+
if (sticky) {
|
|
676
|
+
this.titleControl.stickEditor(editor);
|
|
677
|
+
}
|
|
678
|
+
else {
|
|
679
|
+
this.titleControl.unstickEditor(editor);
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
async openEditor(editor, options, internalOptions) {
|
|
684
|
+
return this.doOpenEditor(editor, options, {
|
|
685
|
+
...internalOptions,
|
|
686
|
+
supportSideBySide: SideBySideEditor.BOTH
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
async doOpenEditor(editor, options, internalOptions) {
|
|
690
|
+
if (!editor || editor.isDisposed()) {
|
|
691
|
+
return;
|
|
692
|
+
}
|
|
693
|
+
this._onWillOpenEditor.fire({ editor, groupId: this.id });
|
|
694
|
+
const pinned = options?.sticky
|
|
695
|
+
|| !this.groupsView.partOptions.enablePreview
|
|
696
|
+
|| editor.isDirty()
|
|
697
|
+
|| ((options?.pinned ?? typeof options?.index === 'number') )
|
|
698
|
+
|| (typeof options?.index === 'number' && this.model.isSticky(options.index))
|
|
699
|
+
|| editor.hasCapability(512 );
|
|
700
|
+
const openEditorOptions = {
|
|
701
|
+
index: options ? options.index : undefined,
|
|
702
|
+
pinned,
|
|
703
|
+
sticky: options?.sticky || (typeof options?.index === 'number' && this.model.isSticky(options.index)),
|
|
704
|
+
active: this.count === 0 || !options || !options.inactive,
|
|
705
|
+
supportSideBySide: internalOptions?.supportSideBySide
|
|
706
|
+
};
|
|
707
|
+
if (!openEditorOptions.active && !openEditorOptions.pinned && this.model.activeEditor && !this.model.isPinned(this.model.activeEditor)) {
|
|
708
|
+
openEditorOptions.active = true;
|
|
709
|
+
}
|
|
710
|
+
let activateGroup = false;
|
|
711
|
+
let restoreGroup = false;
|
|
712
|
+
if (options?.activation === EditorActivation.ACTIVATE) {
|
|
713
|
+
activateGroup = true;
|
|
714
|
+
}
|
|
715
|
+
else if (options?.activation === EditorActivation.RESTORE) {
|
|
716
|
+
restoreGroup = true;
|
|
717
|
+
}
|
|
718
|
+
else if (options?.activation === EditorActivation.PRESERVE) {
|
|
719
|
+
activateGroup = false;
|
|
720
|
+
restoreGroup = false;
|
|
721
|
+
}
|
|
722
|
+
else if (openEditorOptions.active) {
|
|
723
|
+
activateGroup = !options || !options.preserveFocus;
|
|
724
|
+
restoreGroup = !activateGroup;
|
|
725
|
+
}
|
|
726
|
+
if (typeof openEditorOptions.index === 'number') {
|
|
727
|
+
const indexOfEditor = this.model.indexOf(editor);
|
|
728
|
+
if (indexOfEditor !== -1 && indexOfEditor !== openEditorOptions.index) {
|
|
729
|
+
this.doMoveEditorInsideGroup(editor, openEditorOptions);
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
const { editor: openedEditor, isNew } = this.model.openEditor(editor, openEditorOptions);
|
|
733
|
+
if (isNew &&
|
|
734
|
+
this.count === 1 &&
|
|
735
|
+
this.editorPartsView.groups.length > 1
|
|
736
|
+
) {
|
|
737
|
+
if (openedEditor.editorId && this.groupsView.partOptions.autoLockGroups?.has(openedEditor.editorId)) {
|
|
738
|
+
this.lock(true);
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
const showEditorResult = this.doShowEditor(openedEditor, { active: !!openEditorOptions.active, isNew }, options, internalOptions);
|
|
742
|
+
if (activateGroup) {
|
|
743
|
+
this.groupsView.activateGroup(this);
|
|
744
|
+
}
|
|
745
|
+
else if (restoreGroup) {
|
|
746
|
+
this.groupsView.restoreGroup(this);
|
|
747
|
+
}
|
|
748
|
+
return showEditorResult;
|
|
749
|
+
}
|
|
750
|
+
doShowEditor(editor, context, options, internalOptions) {
|
|
751
|
+
let openEditorPromise;
|
|
752
|
+
if (context.active) {
|
|
753
|
+
openEditorPromise = (async () => {
|
|
754
|
+
const { pane, changed, cancelled, error } = await this.editorPane.openEditor(editor, options, internalOptions, { newInGroup: context.isNew });
|
|
755
|
+
if (cancelled) {
|
|
756
|
+
return undefined;
|
|
757
|
+
}
|
|
758
|
+
if (changed) {
|
|
759
|
+
this._onDidActiveEditorChange.fire({ editor });
|
|
760
|
+
}
|
|
761
|
+
if (error) {
|
|
762
|
+
this._onDidOpenEditorFail.fire(editor);
|
|
763
|
+
}
|
|
764
|
+
if (!pane && this.activeEditor === editor) {
|
|
765
|
+
this.doCloseEditor(editor, options?.preserveFocus, { fromError: true });
|
|
766
|
+
}
|
|
767
|
+
return pane;
|
|
768
|
+
})();
|
|
769
|
+
}
|
|
770
|
+
else {
|
|
771
|
+
openEditorPromise = Promise.resolve(undefined);
|
|
772
|
+
}
|
|
773
|
+
if (!internalOptions?.skipTitleUpdate) {
|
|
774
|
+
this.titleControl.openEditor(editor, internalOptions);
|
|
775
|
+
}
|
|
776
|
+
return openEditorPromise;
|
|
777
|
+
}
|
|
778
|
+
async openEditors(editors) {
|
|
779
|
+
const editorsToOpen = coalesce(editors).filter(({ editor }) => !editor.isDisposed());
|
|
780
|
+
const firstEditor = firstOrDefault(editorsToOpen);
|
|
781
|
+
if (!firstEditor) {
|
|
782
|
+
return;
|
|
783
|
+
}
|
|
784
|
+
const openEditorsOptions = {
|
|
785
|
+
supportSideBySide: SideBySideEditor.BOTH
|
|
786
|
+
};
|
|
787
|
+
await this.doOpenEditor(firstEditor.editor, firstEditor.options, openEditorsOptions);
|
|
788
|
+
const inactiveEditors = editorsToOpen.slice(1);
|
|
789
|
+
const startingIndex = this.getIndexOfEditor(firstEditor.editor) + 1;
|
|
790
|
+
await Promises.settled(( inactiveEditors.map(({ editor, options }, index) => {
|
|
791
|
+
return this.doOpenEditor(editor, {
|
|
792
|
+
...options,
|
|
793
|
+
inactive: true,
|
|
794
|
+
pinned: true,
|
|
795
|
+
index: startingIndex + index
|
|
796
|
+
}, {
|
|
797
|
+
...openEditorsOptions,
|
|
798
|
+
skipTitleUpdate: true
|
|
799
|
+
});
|
|
800
|
+
})));
|
|
801
|
+
this.titleControl.openEditors(( inactiveEditors.map(({ editor }) => editor)));
|
|
802
|
+
return this.editorPane.activeEditorPane ?? undefined;
|
|
803
|
+
}
|
|
804
|
+
moveEditors(editors, target) {
|
|
805
|
+
const internalOptions = {
|
|
806
|
+
skipTitleUpdate: this !== target
|
|
807
|
+
};
|
|
808
|
+
for (const { editor, options } of editors) {
|
|
809
|
+
this.moveEditor(editor, target, options, internalOptions);
|
|
810
|
+
}
|
|
811
|
+
if (internalOptions.skipTitleUpdate) {
|
|
812
|
+
const movedEditors = ( editors.map(({ editor }) => editor));
|
|
813
|
+
target.titleControl.openEditors(movedEditors);
|
|
814
|
+
this.titleControl.closeEditors(movedEditors);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
moveEditor(editor, target, options, internalOptions) {
|
|
818
|
+
if (this === target) {
|
|
819
|
+
this.doMoveEditorInsideGroup(editor, options);
|
|
820
|
+
}
|
|
821
|
+
else {
|
|
822
|
+
this.doMoveOrCopyEditorAcrossGroups(editor, target, options, { ...internalOptions, keepCopy: false });
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
doMoveEditorInsideGroup(candidate, options) {
|
|
826
|
+
const moveToIndex = options ? options.index : undefined;
|
|
827
|
+
if (typeof moveToIndex !== 'number') {
|
|
828
|
+
return;
|
|
829
|
+
}
|
|
830
|
+
const currentIndex = this.model.indexOf(candidate);
|
|
831
|
+
const editor = this.model.getEditorByIndex(currentIndex);
|
|
832
|
+
if (!editor) {
|
|
833
|
+
return;
|
|
834
|
+
}
|
|
835
|
+
if (currentIndex !== moveToIndex) {
|
|
836
|
+
const oldStickyCount = this.model.stickyCount;
|
|
837
|
+
this.model.moveEditor(editor, moveToIndex);
|
|
838
|
+
this.model.pin(editor);
|
|
839
|
+
this.titleControl.moveEditor(editor, currentIndex, moveToIndex, oldStickyCount !== this.model.stickyCount);
|
|
840
|
+
this.titleControl.pinEditor(editor);
|
|
841
|
+
}
|
|
842
|
+
if (options?.sticky) {
|
|
843
|
+
this.stickEditor(editor);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
doMoveOrCopyEditorAcrossGroups(editor, target, openOptions, internalOptions) {
|
|
847
|
+
const keepCopy = internalOptions?.keepCopy;
|
|
848
|
+
const options = fillActiveEditorViewState(this, editor, {
|
|
849
|
+
...openOptions,
|
|
850
|
+
pinned: true,
|
|
851
|
+
sticky: openOptions?.sticky ?? (!keepCopy && this.model.isSticky(editor))
|
|
852
|
+
});
|
|
853
|
+
if (!keepCopy) {
|
|
854
|
+
this._onWillMoveEditor.fire({
|
|
855
|
+
groupId: this.id,
|
|
856
|
+
editor,
|
|
857
|
+
target: target.id
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
target.doOpenEditor(keepCopy ? editor.copy() : editor, options, internalOptions);
|
|
861
|
+
if (!keepCopy) {
|
|
862
|
+
this.doCloseEditor(editor, true , { ...internalOptions, context: EditorCloseContext.MOVE });
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
copyEditors(editors, target) {
|
|
866
|
+
const internalOptions = {
|
|
867
|
+
skipTitleUpdate: this !== target
|
|
868
|
+
};
|
|
869
|
+
for (const { editor, options } of editors) {
|
|
870
|
+
this.copyEditor(editor, target, options, internalOptions);
|
|
871
|
+
}
|
|
872
|
+
if (internalOptions.skipTitleUpdate) {
|
|
873
|
+
const copiedEditors = ( editors.map(({ editor }) => editor));
|
|
874
|
+
target.titleControl.openEditors(copiedEditors);
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
copyEditor(editor, target, options, internalOptions) {
|
|
878
|
+
if (this === target) {
|
|
879
|
+
this.doMoveEditorInsideGroup(editor, options);
|
|
880
|
+
}
|
|
881
|
+
else {
|
|
882
|
+
this.doMoveOrCopyEditorAcrossGroups(editor, target, options, { ...internalOptions, keepCopy: true });
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
async closeEditor(editor = this.activeEditor || undefined, options) {
|
|
886
|
+
return this.doCloseEditorWithConfirmationHandling(editor, options);
|
|
887
|
+
}
|
|
888
|
+
async doCloseEditorWithConfirmationHandling(editor = this.activeEditor || undefined, options, internalOptions) {
|
|
889
|
+
if (!editor) {
|
|
890
|
+
return false;
|
|
891
|
+
}
|
|
892
|
+
const veto = await this.handleCloseConfirmation([editor]);
|
|
893
|
+
if (veto) {
|
|
894
|
+
return false;
|
|
895
|
+
}
|
|
896
|
+
this.doCloseEditor(editor, options?.preserveFocus, internalOptions);
|
|
897
|
+
return true;
|
|
898
|
+
}
|
|
899
|
+
doCloseEditor(editor, preserveFocus = (this.groupsView.activeGroup !== this), internalOptions) {
|
|
900
|
+
if (!internalOptions?.skipTitleUpdate) {
|
|
901
|
+
this.titleControl.beforeCloseEditor(editor);
|
|
902
|
+
}
|
|
903
|
+
if (this.model.isActive(editor)) {
|
|
904
|
+
this.doCloseActiveEditor(preserveFocus, internalOptions);
|
|
905
|
+
}
|
|
906
|
+
else {
|
|
907
|
+
this.doCloseInactiveEditor(editor, internalOptions);
|
|
908
|
+
}
|
|
909
|
+
if (!internalOptions?.skipTitleUpdate) {
|
|
910
|
+
this.titleControl.closeEditor(editor);
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
doCloseActiveEditor(preserveFocus = (this.groupsView.activeGroup !== this), internalOptions) {
|
|
914
|
+
const editorToClose = this.activeEditor;
|
|
915
|
+
const restoreFocus = !preserveFocus && this.shouldRestoreFocus(this.element);
|
|
916
|
+
const closeEmptyGroup = this.groupsView.partOptions.closeEmptyGroups;
|
|
917
|
+
if (closeEmptyGroup && this.active && this.count === 1) {
|
|
918
|
+
const mostRecentlyActiveGroups = this.groupsView.getGroups(1 );
|
|
919
|
+
const nextActiveGroup = mostRecentlyActiveGroups[1];
|
|
920
|
+
if (nextActiveGroup) {
|
|
921
|
+
if (restoreFocus) {
|
|
922
|
+
nextActiveGroup.focus();
|
|
923
|
+
}
|
|
924
|
+
else {
|
|
925
|
+
this.groupsView.activateGroup(nextActiveGroup, true);
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
if (editorToClose) {
|
|
930
|
+
this.model.closeEditor(editorToClose, internalOptions?.context);
|
|
931
|
+
}
|
|
932
|
+
const nextActiveEditor = this.model.activeEditor;
|
|
933
|
+
if (nextActiveEditor) {
|
|
934
|
+
let activation = undefined;
|
|
935
|
+
if (preserveFocus && this.groupsView.activeGroup !== this) {
|
|
936
|
+
activation = EditorActivation.PRESERVE;
|
|
937
|
+
}
|
|
938
|
+
const options = {
|
|
939
|
+
preserveFocus,
|
|
940
|
+
activation,
|
|
941
|
+
ignoreError: internalOptions?.fromError
|
|
942
|
+
};
|
|
943
|
+
const internalEditorOpenOptions = {
|
|
944
|
+
preserveWindowOrder: true
|
|
945
|
+
};
|
|
946
|
+
this.doOpenEditor(nextActiveEditor, options, internalEditorOpenOptions);
|
|
947
|
+
}
|
|
948
|
+
else {
|
|
949
|
+
if (editorToClose) {
|
|
950
|
+
this.editorPane.closeEditor(editorToClose);
|
|
951
|
+
}
|
|
952
|
+
if (restoreFocus && !closeEmptyGroup) {
|
|
953
|
+
this.focus();
|
|
954
|
+
}
|
|
955
|
+
this._onDidActiveEditorChange.fire({ editor: undefined });
|
|
956
|
+
if (closeEmptyGroup) {
|
|
957
|
+
this.groupsView.removeGroup(this, preserveFocus);
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
shouldRestoreFocus(target) {
|
|
962
|
+
const activeElement = getActiveElement();
|
|
963
|
+
if (activeElement === target.ownerDocument.body) {
|
|
964
|
+
return true;
|
|
965
|
+
}
|
|
966
|
+
return isAncestor(activeElement, target);
|
|
967
|
+
}
|
|
968
|
+
doCloseInactiveEditor(editor, internalOptions) {
|
|
969
|
+
this.model.closeEditor(editor, internalOptions?.context);
|
|
970
|
+
}
|
|
971
|
+
async handleCloseConfirmation(editors) {
|
|
972
|
+
if (!editors.length) {
|
|
973
|
+
return false;
|
|
974
|
+
}
|
|
975
|
+
const editor = editors.shift();
|
|
976
|
+
let handleCloseConfirmationPromise = this.mapEditorToPendingConfirmation.get(editor);
|
|
977
|
+
if (!handleCloseConfirmationPromise) {
|
|
978
|
+
handleCloseConfirmationPromise = this.doHandleCloseConfirmation(editor);
|
|
979
|
+
this.mapEditorToPendingConfirmation.set(editor, handleCloseConfirmationPromise);
|
|
980
|
+
}
|
|
981
|
+
let veto;
|
|
982
|
+
try {
|
|
983
|
+
veto = await handleCloseConfirmationPromise;
|
|
984
|
+
}
|
|
985
|
+
finally {
|
|
986
|
+
this.mapEditorToPendingConfirmation.delete(editor);
|
|
987
|
+
}
|
|
988
|
+
if (veto) {
|
|
989
|
+
return veto;
|
|
990
|
+
}
|
|
991
|
+
return this.handleCloseConfirmation(editors);
|
|
992
|
+
}
|
|
993
|
+
async doHandleCloseConfirmation(editor, options) {
|
|
994
|
+
if (!this.shouldConfirmClose(editor)) {
|
|
995
|
+
return false;
|
|
996
|
+
}
|
|
997
|
+
if (editor instanceof SideBySideEditorInput && this.model.contains(editor.primary)) {
|
|
998
|
+
return false;
|
|
999
|
+
}
|
|
1000
|
+
if (( this.editorPartsView.groups.some(groupView => {
|
|
1001
|
+
if (groupView === this) {
|
|
1002
|
+
return false;
|
|
1003
|
+
}
|
|
1004
|
+
const otherGroup = groupView;
|
|
1005
|
+
if (otherGroup.contains(editor, { supportSideBySide: SideBySideEditor.BOTH })) {
|
|
1006
|
+
return true;
|
|
1007
|
+
}
|
|
1008
|
+
if (editor instanceof SideBySideEditorInput && otherGroup.contains(editor.primary)) {
|
|
1009
|
+
return true;
|
|
1010
|
+
}
|
|
1011
|
+
return false;
|
|
1012
|
+
}))) {
|
|
1013
|
+
return false;
|
|
1014
|
+
}
|
|
1015
|
+
let confirmation = 2 ;
|
|
1016
|
+
let saveReason = 1 ;
|
|
1017
|
+
let autoSave = false;
|
|
1018
|
+
if (!editor.hasCapability(4 ) && !options?.skipAutoSave && !editor.closeHandler) {
|
|
1019
|
+
if (this.filesConfigurationService.getAutoSaveMode(editor).mode === 3 ) {
|
|
1020
|
+
autoSave = true;
|
|
1021
|
+
confirmation = 0 ;
|
|
1022
|
+
saveReason = 3 ;
|
|
1023
|
+
}
|
|
1024
|
+
else if ((isNative && (isWindows || isLinux)) && this.filesConfigurationService.getAutoSaveMode(editor).mode === 4 ) {
|
|
1025
|
+
autoSave = true;
|
|
1026
|
+
confirmation = 0 ;
|
|
1027
|
+
saveReason = 4 ;
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
if (!autoSave) {
|
|
1031
|
+
if (!this.activeEditor || !this.activeEditor.matches(editor)) {
|
|
1032
|
+
await this.doOpenEditor(editor);
|
|
1033
|
+
}
|
|
1034
|
+
await this.hostService.focus(getWindow(this.element));
|
|
1035
|
+
if (typeof editor.closeHandler?.confirm === 'function') {
|
|
1036
|
+
confirmation = await editor.closeHandler.confirm([{ editor, groupId: this.id }]);
|
|
1037
|
+
}
|
|
1038
|
+
else {
|
|
1039
|
+
let name;
|
|
1040
|
+
if (editor instanceof SideBySideEditorInput) {
|
|
1041
|
+
name = editor.primary.getName();
|
|
1042
|
+
}
|
|
1043
|
+
else {
|
|
1044
|
+
name = editor.getName();
|
|
1045
|
+
}
|
|
1046
|
+
confirmation = await this.fileDialogService.showSaveConfirm([name]);
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
if (!editor.closeHandler && !this.shouldConfirmClose(editor)) {
|
|
1050
|
+
return confirmation === 2 ? true : false;
|
|
1051
|
+
}
|
|
1052
|
+
switch (confirmation) {
|
|
1053
|
+
case 0 : {
|
|
1054
|
+
const result = await editor.save(this.id, { reason: saveReason });
|
|
1055
|
+
if (!result && autoSave) {
|
|
1056
|
+
return this.doHandleCloseConfirmation(editor, { skipAutoSave: true });
|
|
1057
|
+
}
|
|
1058
|
+
return editor.isDirty();
|
|
1059
|
+
}
|
|
1060
|
+
case 1 :
|
|
1061
|
+
try {
|
|
1062
|
+
await editor.revert(this.id);
|
|
1063
|
+
return editor.isDirty();
|
|
1064
|
+
}
|
|
1065
|
+
catch (error) {
|
|
1066
|
+
this.logService.error(error);
|
|
1067
|
+
await editor.revert(this.id, { soft: true });
|
|
1068
|
+
return editor.isDirty();
|
|
1069
|
+
}
|
|
1070
|
+
case 2 :
|
|
1071
|
+
return true;
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
shouldConfirmClose(editor) {
|
|
1075
|
+
if (editor.closeHandler) {
|
|
1076
|
+
return editor.closeHandler.showConfirm();
|
|
1077
|
+
}
|
|
1078
|
+
return editor.isDirty() && !editor.isSaving();
|
|
1079
|
+
}
|
|
1080
|
+
async closeEditors(args, options) {
|
|
1081
|
+
if (this.isEmpty) {
|
|
1082
|
+
return true;
|
|
1083
|
+
}
|
|
1084
|
+
const editors = this.doGetEditorsToClose(args);
|
|
1085
|
+
const veto = await this.handleCloseConfirmation(editors.slice(0));
|
|
1086
|
+
if (veto) {
|
|
1087
|
+
return false;
|
|
1088
|
+
}
|
|
1089
|
+
this.doCloseEditors(editors, options);
|
|
1090
|
+
return true;
|
|
1091
|
+
}
|
|
1092
|
+
doGetEditorsToClose(args) {
|
|
1093
|
+
if (Array.isArray(args)) {
|
|
1094
|
+
return args;
|
|
1095
|
+
}
|
|
1096
|
+
const filter = args;
|
|
1097
|
+
const hasDirection = typeof filter.direction === 'number';
|
|
1098
|
+
let editorsToClose = this.model.getEditors(hasDirection ? 1 : 0 , filter);
|
|
1099
|
+
if (filter.savedOnly) {
|
|
1100
|
+
editorsToClose = editorsToClose.filter(editor => !editor.isDirty() || editor.isSaving());
|
|
1101
|
+
}
|
|
1102
|
+
else if (hasDirection && filter.except) {
|
|
1103
|
+
editorsToClose = ((filter.direction === 0) ) ?
|
|
1104
|
+
editorsToClose.slice(0, this.model.indexOf(filter.except, editorsToClose)) :
|
|
1105
|
+
editorsToClose.slice(this.model.indexOf(filter.except, editorsToClose) + 1);
|
|
1106
|
+
}
|
|
1107
|
+
else if (filter.except) {
|
|
1108
|
+
editorsToClose = editorsToClose.filter(editor => filter.except && !editor.matches(filter.except));
|
|
1109
|
+
}
|
|
1110
|
+
return editorsToClose;
|
|
1111
|
+
}
|
|
1112
|
+
doCloseEditors(editors, options) {
|
|
1113
|
+
let closeActiveEditor = false;
|
|
1114
|
+
for (const editor of editors) {
|
|
1115
|
+
if (!this.isActive(editor)) {
|
|
1116
|
+
this.doCloseInactiveEditor(editor);
|
|
1117
|
+
}
|
|
1118
|
+
else {
|
|
1119
|
+
closeActiveEditor = true;
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
if (closeActiveEditor) {
|
|
1123
|
+
this.doCloseActiveEditor(options?.preserveFocus);
|
|
1124
|
+
}
|
|
1125
|
+
if (editors.length) {
|
|
1126
|
+
this.titleControl.closeEditors(editors);
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
async closeAllEditors(options) {
|
|
1130
|
+
if (this.isEmpty) {
|
|
1131
|
+
if (this.groupsView.partOptions.closeEmptyGroups) {
|
|
1132
|
+
this.groupsView.removeGroup(this);
|
|
1133
|
+
}
|
|
1134
|
+
return true;
|
|
1135
|
+
}
|
|
1136
|
+
const veto = await this.handleCloseConfirmation(this.model.getEditors(0 , options));
|
|
1137
|
+
if (veto) {
|
|
1138
|
+
return false;
|
|
1139
|
+
}
|
|
1140
|
+
this.doCloseAllEditors(options);
|
|
1141
|
+
return true;
|
|
1142
|
+
}
|
|
1143
|
+
doCloseAllEditors(options) {
|
|
1144
|
+
const editorsToClose = [];
|
|
1145
|
+
for (const editor of this.model.getEditors(1 , options)) {
|
|
1146
|
+
if (!this.isActive(editor)) {
|
|
1147
|
+
this.doCloseInactiveEditor(editor);
|
|
1148
|
+
}
|
|
1149
|
+
editorsToClose.push(editor);
|
|
1150
|
+
}
|
|
1151
|
+
if (this.activeEditor && editorsToClose.includes(this.activeEditor)) {
|
|
1152
|
+
this.doCloseActiveEditor();
|
|
1153
|
+
}
|
|
1154
|
+
if (editorsToClose.length) {
|
|
1155
|
+
this.titleControl.closeEditors(editorsToClose);
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
async replaceEditors(editors) {
|
|
1159
|
+
let activeReplacement;
|
|
1160
|
+
const inactiveReplacements = [];
|
|
1161
|
+
for (let { editor, replacement, forceReplaceDirty, options } of editors) {
|
|
1162
|
+
const index = this.getIndexOfEditor(editor);
|
|
1163
|
+
if (index >= 0) {
|
|
1164
|
+
const isActiveEditor = this.isActive(editor);
|
|
1165
|
+
if (options) {
|
|
1166
|
+
options.index = index;
|
|
1167
|
+
}
|
|
1168
|
+
else {
|
|
1169
|
+
options = { index };
|
|
1170
|
+
}
|
|
1171
|
+
options.inactive = !isActiveEditor;
|
|
1172
|
+
options.pinned = options.pinned ?? true;
|
|
1173
|
+
const editorToReplace = { editor, replacement, forceReplaceDirty, options };
|
|
1174
|
+
if (isActiveEditor) {
|
|
1175
|
+
activeReplacement = editorToReplace;
|
|
1176
|
+
}
|
|
1177
|
+
else {
|
|
1178
|
+
inactiveReplacements.push(editorToReplace);
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
for (const { editor, replacement, forceReplaceDirty, options } of inactiveReplacements) {
|
|
1183
|
+
await this.doOpenEditor(replacement, options);
|
|
1184
|
+
if (!editor.matches(replacement)) {
|
|
1185
|
+
let closed = false;
|
|
1186
|
+
if (forceReplaceDirty) {
|
|
1187
|
+
this.doCloseEditor(editor, true, { context: EditorCloseContext.REPLACE });
|
|
1188
|
+
closed = true;
|
|
1189
|
+
}
|
|
1190
|
+
else {
|
|
1191
|
+
closed = await this.doCloseEditorWithConfirmationHandling(editor, { preserveFocus: true }, { context: EditorCloseContext.REPLACE });
|
|
1192
|
+
}
|
|
1193
|
+
if (!closed) {
|
|
1194
|
+
return;
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
if (activeReplacement) {
|
|
1199
|
+
const openEditorResult = this.doOpenEditor(activeReplacement.replacement, activeReplacement.options);
|
|
1200
|
+
if (!activeReplacement.editor.matches(activeReplacement.replacement)) {
|
|
1201
|
+
if (activeReplacement.forceReplaceDirty) {
|
|
1202
|
+
this.doCloseEditor(activeReplacement.editor, true, { context: EditorCloseContext.REPLACE });
|
|
1203
|
+
}
|
|
1204
|
+
else {
|
|
1205
|
+
await this.doCloseEditorWithConfirmationHandling(activeReplacement.editor, { preserveFocus: true }, { context: EditorCloseContext.REPLACE });
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
await openEditorResult;
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
get isLocked() {
|
|
1212
|
+
return this.model.isLocked;
|
|
1213
|
+
}
|
|
1214
|
+
lock(locked) {
|
|
1215
|
+
this.model.lock(locked);
|
|
1216
|
+
}
|
|
1217
|
+
createEditorActions(disposables) {
|
|
1218
|
+
const primary = [];
|
|
1219
|
+
const secondary = [];
|
|
1220
|
+
let onDidChange;
|
|
1221
|
+
const activeEditorPane = this.activeEditorPane;
|
|
1222
|
+
if (activeEditorPane instanceof EditorPane) {
|
|
1223
|
+
const editorScopedContextKeyService = activeEditorPane.scopedContextKeyService ?? this.scopedContextKeyService;
|
|
1224
|
+
const editorTitleMenu = disposables.add(this.menuService.createMenu(MenuId.EditorTitle, editorScopedContextKeyService, { emitEventsForSubmenuChanges: true, eventDebounceDelay: 0 }));
|
|
1225
|
+
onDidChange = editorTitleMenu.onDidChange;
|
|
1226
|
+
const shouldInlineGroup = (action, group) => group === 'navigation' && action.actions.length <= 1;
|
|
1227
|
+
createAndFillInActionBarActions(editorTitleMenu, { arg: this.resourceContext.get(), shouldForwardArgs: true }, { primary, secondary }, 'navigation', shouldInlineGroup);
|
|
1228
|
+
}
|
|
1229
|
+
else {
|
|
1230
|
+
const _onDidChange = disposables.add(( new Emitter()));
|
|
1231
|
+
onDidChange = _onDidChange.event;
|
|
1232
|
+
disposables.add(this.onDidActiveEditorChange(() => _onDidChange.fire()));
|
|
1233
|
+
}
|
|
1234
|
+
return { actions: { primary, secondary }, onDidChange };
|
|
1235
|
+
}
|
|
1236
|
+
updateStyles() {
|
|
1237
|
+
const isEmpty = this.isEmpty;
|
|
1238
|
+
if (isEmpty) {
|
|
1239
|
+
this.element.style.backgroundColor = this.getColor(EDITOR_GROUP_EMPTY_BACKGROUND) || '';
|
|
1240
|
+
}
|
|
1241
|
+
else {
|
|
1242
|
+
this.element.style.backgroundColor = '';
|
|
1243
|
+
}
|
|
1244
|
+
const borderColor = this.getColor(EDITOR_GROUP_HEADER_BORDER) || this.getColor(contrastBorder);
|
|
1245
|
+
if (!isEmpty && borderColor) {
|
|
1246
|
+
this.titleContainer.classList.add('title-border-bottom');
|
|
1247
|
+
this.titleContainer.style.setProperty('--title-border-bottom-color', borderColor);
|
|
1248
|
+
}
|
|
1249
|
+
else {
|
|
1250
|
+
this.titleContainer.classList.remove('title-border-bottom');
|
|
1251
|
+
this.titleContainer.style.removeProperty('--title-border-bottom-color');
|
|
1252
|
+
}
|
|
1253
|
+
const { showTabs } = this.groupsView.partOptions;
|
|
1254
|
+
this.titleContainer.style.backgroundColor = this.getColor(showTabs === 'multiple' ? EDITOR_GROUP_HEADER_TABS_BACKGROUND : EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND) || '';
|
|
1255
|
+
this.editorContainer.style.backgroundColor = this.getColor(editorBackground) || '';
|
|
1256
|
+
}
|
|
1257
|
+
get minimumWidth() { return this.editorPane.minimumWidth; }
|
|
1258
|
+
get minimumHeight() { return this.editorPane.minimumHeight; }
|
|
1259
|
+
get maximumWidth() { return this.editorPane.maximumWidth; }
|
|
1260
|
+
get maximumHeight() { return this.editorPane.maximumHeight; }
|
|
1261
|
+
get proportionalLayout() {
|
|
1262
|
+
if (!this.lastLayout) {
|
|
1263
|
+
return true;
|
|
1264
|
+
}
|
|
1265
|
+
return !(this.lastLayout.width === this.minimumWidth || this.lastLayout.height === this.minimumHeight);
|
|
1266
|
+
}
|
|
1267
|
+
layout(width, height, top, left) {
|
|
1268
|
+
this.lastLayout = { width, height, top, left };
|
|
1269
|
+
this.element.classList.toggle('max-height-478px', height <= 478);
|
|
1270
|
+
const titleControlSize = this.titleControl.layout({
|
|
1271
|
+
container: ( new Dimension(width, height)),
|
|
1272
|
+
available: ( new Dimension(width, height - this.editorPane.minimumHeight))
|
|
1273
|
+
});
|
|
1274
|
+
this.progressBar.getContainer().style.top = `${Math.max(this.titleHeight.offset - 2, 0)}px`;
|
|
1275
|
+
const editorHeight = Math.max(0, height - titleControlSize.height);
|
|
1276
|
+
this.editorContainer.style.height = `${editorHeight}px`;
|
|
1277
|
+
this.editorPane.layout({ width, height: editorHeight, top: top + titleControlSize.height, left });
|
|
1278
|
+
}
|
|
1279
|
+
relayout() {
|
|
1280
|
+
if (this.lastLayout) {
|
|
1281
|
+
const { width, height, top, left } = this.lastLayout;
|
|
1282
|
+
this.layout(width, height, top, left);
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
setBoundarySashes(sashes) {
|
|
1286
|
+
this.editorPane.setBoundarySashes(sashes);
|
|
1287
|
+
}
|
|
1288
|
+
toJSON() {
|
|
1289
|
+
return this.model.serialize();
|
|
1290
|
+
}
|
|
1291
|
+
dispose() {
|
|
1292
|
+
this._disposed = true;
|
|
1293
|
+
this._onWillDispose.fire();
|
|
1294
|
+
super.dispose();
|
|
1295
|
+
}
|
|
1296
|
+
};
|
|
1297
|
+
EditorGroupView = EditorGroupView_1 = ( __decorate([
|
|
1298
|
+
( __param(5, IInstantiationService)),
|
|
1299
|
+
( __param(6, IContextKeyService)),
|
|
1300
|
+
( __param(7, IThemeService)),
|
|
1301
|
+
( __param(8, ITelemetryService)),
|
|
1302
|
+
( __param(9, IKeybindingService)),
|
|
1303
|
+
( __param(10, IMenuService)),
|
|
1304
|
+
( __param(11, IContextMenuService)),
|
|
1305
|
+
( __param(12, IFileDialogService)),
|
|
1306
|
+
( __param(13, IEditorService)),
|
|
1307
|
+
( __param(14, IFilesConfigurationService)),
|
|
1308
|
+
( __param(15, IUriIdentityService)),
|
|
1309
|
+
( __param(16, ILogService)),
|
|
1310
|
+
( __param(17, IEditorResolverService)),
|
|
1311
|
+
( __param(18, IHostService))
|
|
1312
|
+
], EditorGroupView));
|
|
1313
|
+
export { EditorGroupView };
|