@codingame/monaco-vscode-api 2.1.3 → 2.2.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/contributions.js +1 -0
- package/extensions.d.ts +6 -3
- package/extensions.js +18 -7
- package/lifecycle.js +11 -3
- package/missing-services.js +55 -10
- package/monaco.js +7 -3
- package/package.json +8 -8
- package/service-override/tools/editor.js +3 -1
- package/service-override/tools/views.d.ts +98 -0
- package/service-override/tools/views.js +249 -0
- package/services.d.ts +4 -2
- package/services.js +11 -9
- package/vscode/src/vs/base/browser/deviceAccess.js +60 -0
- package/vscode/src/vs/base/browser/dom.js +18 -1
- package/vscode/src/vs/base/browser/ui/centered/centeredViewLayout.js +178 -0
- package/vscode/src/vs/base/browser/ui/grid/grid.js +492 -0
- package/vscode/src/vs/base/browser/ui/grid/gridview.css.js +4 -0
- package/vscode/src/vs/base/browser/ui/grid/gridview.d.ts +1 -0
- package/vscode/src/vs/base/browser/ui/grid/gridview.js +1109 -0
- package/vscode/src/vs/base/browser/ui/sash/sash.js +9 -1
- package/vscode/src/vs/base/browser/ui/splitview/splitview.d.ts +348 -1
- package/vscode/src/vs/base/common/async.js +46 -2
- package/vscode/src/vs/base/common/codicons.d.ts +579 -0
- package/vscode/src/vs/base/common/event.js +11 -2
- package/vscode/src/vs/base/common/keybindingParser.js +87 -0
- package/vscode/src/vs/base/common/network.js +1 -2
- package/vscode/src/vs/base/common/observableInternal/utils.js +1 -1
- package/vscode/src/vs/base/common/platform.js +2 -1
- package/vscode/src/vs/base/common/scrollable.d.ts +28 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/colors.js +17 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/diffEditorItemTemplate.js +214 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorViewModel.js +84 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorWidget.js +54 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorWidgetImpl.js +324 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/objectPool.js +46 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/style.css.js +4 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/utils.js +11 -0
- package/vscode/src/vs/platform/keyboardLayout/common/keyboardLayout.js +61 -1
- package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +10 -0
- package/vscode/src/vs/platform/log/browser/log.js +24 -0
- package/vscode/src/vs/platform/product/common/product.js +1 -2
- package/vscode/src/vs/platform/userDataSync/common/abstractSynchronizer.js +772 -0
- package/vscode/src/vs/platform/userDataSync/common/userDataSyncStoreService.js +551 -0
- package/vscode/src/vs/platform/webview/common/mimeTypes.js +22 -0
- package/vscode/src/vs/platform/webview/common/webviewPortMapping.js +62 -0
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +788 -0
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +763 -0
- package/vscode/src/vs/workbench/browser/layout.d.ts +26 -0
- package/vscode/src/vs/workbench/browser/media/style.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +610 -0
- package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +148 -0
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/compositeBar.js +603 -0
- package/vscode/src/vs/workbench/browser/parts/compositePart.js +333 -0
- package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +221 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +1406 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +184 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +509 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorPane.d.ts +112 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +1018 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +389 -0
- package/vscode/src/vs/workbench/browser/parts/editor/media/editordroptarget.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/media/compositepart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/media/paneCompositePart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsActions.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsCenter.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsList.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsToasts.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsActions.js +213 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsAlerts.js +73 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCenter.js +307 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsList.js +226 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsStatus.js +218 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsToasts.js +433 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.js +436 -0
- package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +643 -0
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +377 -0
- package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +66 -0
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +144 -0
- package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +220 -0
- package/vscode/src/vs/workbench/browser/window.js +239 -5
- package/vscode/src/vs/workbench/common/configuration.js +11 -1
- package/vscode/src/vs/workbench/common/theme.js +3 -3
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +298 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +363 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +133 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +90 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentMenus.js +43 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentService.js +317 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadRangeDecorator.js +107 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +395 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/comments.js +3 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +1277 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsFilterOptions.js +17 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsModel.js +123 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +342 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +451 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +176 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/comments/common/commentModel.js +35 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +16 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +143 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +212 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/media/customEditor.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +76 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +61 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +117 -0
- package/vscode/src/vs/workbench/contrib/editSessions/common/editSessions.js +62 -0
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +5 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +77 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorHandler.js +72 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +254 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.js +97 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +442 -0
- package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +430 -0
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +784 -0
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +487 -0
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +521 -0
- package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +150 -0
- package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +61 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveDocumentService.js +25 -1
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +178 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +49 -0
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +408 -0
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +145 -0
- package/vscode/src/vs/workbench/contrib/mappedEdits/common/mappedEdits.contribution.js +22 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +691 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +238 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +76 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorSerializer.js +40 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +69 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +346 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +96 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +144 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +103 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +399 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +195 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/fixedZoneWidget.js +39 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.js +126 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/media/mergeEditor.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +611 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +156 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +262 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.js +171 -0
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.js +41 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +317 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.js +56 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +315 -0
- package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +193 -0
- package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +2 -1
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +37 -0
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.js +39 -0
- package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +138 -2
- package/vscode/src/vs/workbench/contrib/tags/browser/workspaceTagsService.js +12 -0
- package/vscode/src/vs/workbench/contrib/tags/common/workspaceTags.js +3 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +281 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +358 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +131 -0
- package/vscode/src/vs/workbench/contrib/update/common/update.js +2 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +288 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +94 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/themeing.js +86 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webview.contribution.js +77 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +646 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +63 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +57 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +140 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js +119 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +67 -0
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +233 -0
- package/vscode/src/vs/workbench/services/activity/browser/activityService.js +143 -0
- package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +0 -3
- package/vscode/src/vs/workbench/services/driver/browser/driver.js +184 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +668 -0
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +1482 -0
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +17 -1
- package/vscode/src/vs/workbench/services/lifecycle/common/lifecycle.js +8 -1
- package/vscode/src/vs/workbench/services/progress/browser/media/progressService.css.js +4 -0
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +521 -0
- package/vscode/src/vs/workbench/services/textMate/common/TMGrammars.js +102 -0
- package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +296 -0
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +99 -0
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +711 -0
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +596 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import './media/compositepart.css.js';
|
|
2
|
+
import { localizeWithPath } from '../../../nls.js';
|
|
3
|
+
import { defaultGenerator } from '../../../base/common/idGenerator.js';
|
|
4
|
+
import { MutableDisposable, dispose, DisposableStore } from '../../../base/common/lifecycle.js';
|
|
5
|
+
import { Emitter } from '../../../base/common/event.js';
|
|
6
|
+
import { isCancellationError } from '../../../base/common/errors.js';
|
|
7
|
+
import { prepareActions } from '../../../base/browser/ui/actionbar/actionbar.js';
|
|
8
|
+
import { ProgressBar } from '../../../base/browser/ui/progressbar/progressbar.js';
|
|
9
|
+
import { Part } from '../part.js';
|
|
10
|
+
import { ServiceCollection } from '../../../platform/instantiation/common/serviceCollection.js';
|
|
11
|
+
import { IEditorProgressService } from '../../../platform/progress/common/progress.js';
|
|
12
|
+
import { $, show, hide, append, Dimension } from '../../../base/browser/dom.js';
|
|
13
|
+
import { assertIsDefined } from '../../../base/common/types.js';
|
|
14
|
+
import { createActionViewItem } from '../../../platform/actions/browser/menuEntryActionViewItem.js';
|
|
15
|
+
import { ScopedProgressIndicator, AbstractProgressScope } from '../../services/progress/browser/progressIndicator.js';
|
|
16
|
+
import { WorkbenchToolBar } from '../../../platform/actions/browser/toolbar.js';
|
|
17
|
+
import { defaultProgressBarStyles } from '../../../platform/theme/browser/defaultStyles.js';
|
|
18
|
+
class CompositePart extends Part {
|
|
19
|
+
constructor(notificationService, storageService, contextMenuService, layoutService, keybindingService, instantiationService, themeService, registry, activeCompositeSettingsKey, defaultCompositeId, nameForTelemetry, compositeCSSClass, titleForegroundColor, id, options) {
|
|
20
|
+
super(id, options, themeService, storageService, layoutService);
|
|
21
|
+
this.notificationService = notificationService;
|
|
22
|
+
this.storageService = storageService;
|
|
23
|
+
this.contextMenuService = contextMenuService;
|
|
24
|
+
this.keybindingService = keybindingService;
|
|
25
|
+
this.instantiationService = instantiationService;
|
|
26
|
+
this.registry = registry;
|
|
27
|
+
this.activeCompositeSettingsKey = activeCompositeSettingsKey;
|
|
28
|
+
this.defaultCompositeId = defaultCompositeId;
|
|
29
|
+
this.nameForTelemetry = nameForTelemetry;
|
|
30
|
+
this.compositeCSSClass = compositeCSSClass;
|
|
31
|
+
this.titleForegroundColor = titleForegroundColor;
|
|
32
|
+
this.onDidCompositeOpen = this._register(( new Emitter()));
|
|
33
|
+
this.onDidCompositeClose = this._register(( new Emitter()));
|
|
34
|
+
this.mapCompositeToCompositeContainer = ( new Map());
|
|
35
|
+
this.mapActionsBindingToComposite = ( new Map());
|
|
36
|
+
this.instantiatedCompositeItems = ( new Map());
|
|
37
|
+
this.actionsListener = this._register(( new MutableDisposable()));
|
|
38
|
+
this.lastActiveCompositeId = storageService.get(activeCompositeSettingsKey, 1 , this.defaultCompositeId);
|
|
39
|
+
}
|
|
40
|
+
openComposite(id, focus) {
|
|
41
|
+
if (this.activeComposite?.getId() === id) {
|
|
42
|
+
if (focus) {
|
|
43
|
+
this.activeComposite.focus();
|
|
44
|
+
}
|
|
45
|
+
return this.activeComposite;
|
|
46
|
+
}
|
|
47
|
+
if (!this.element) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
return this.doOpenComposite(id, focus);
|
|
51
|
+
}
|
|
52
|
+
doOpenComposite(id, focus = false) {
|
|
53
|
+
const currentCompositeOpenToken = defaultGenerator.nextId();
|
|
54
|
+
this.currentCompositeOpenToken = currentCompositeOpenToken;
|
|
55
|
+
if (this.activeComposite) {
|
|
56
|
+
this.hideActiveComposite();
|
|
57
|
+
}
|
|
58
|
+
this.updateTitle(id);
|
|
59
|
+
const composite = this.createComposite(id, true);
|
|
60
|
+
if ((this.currentCompositeOpenToken !== currentCompositeOpenToken) || (this.activeComposite && this.activeComposite.getId() !== composite.getId())) {
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
if (this.activeComposite?.getId() === composite.getId()) {
|
|
64
|
+
if (focus) {
|
|
65
|
+
composite.focus();
|
|
66
|
+
}
|
|
67
|
+
this.onDidCompositeOpen.fire({ composite, focus });
|
|
68
|
+
return composite;
|
|
69
|
+
}
|
|
70
|
+
this.showComposite(composite);
|
|
71
|
+
if (focus) {
|
|
72
|
+
composite.focus();
|
|
73
|
+
}
|
|
74
|
+
if (composite) {
|
|
75
|
+
this.onDidCompositeOpen.fire({ composite, focus });
|
|
76
|
+
}
|
|
77
|
+
return composite;
|
|
78
|
+
}
|
|
79
|
+
createComposite(id, isActive) {
|
|
80
|
+
const compositeItem = this.instantiatedCompositeItems.get(id);
|
|
81
|
+
if (compositeItem) {
|
|
82
|
+
return compositeItem.composite;
|
|
83
|
+
}
|
|
84
|
+
const compositeDescriptor = this.registry.getComposite(id);
|
|
85
|
+
if (compositeDescriptor) {
|
|
86
|
+
const that = this;
|
|
87
|
+
const compositeProgressIndicator = ( new ScopedProgressIndicator(
|
|
88
|
+
assertIsDefined(this.progressBar),
|
|
89
|
+
new (class extends AbstractProgressScope {
|
|
90
|
+
constructor() {
|
|
91
|
+
super(compositeDescriptor.id, !!isActive);
|
|
92
|
+
this._register(that.onDidCompositeOpen.event(e => this.onScopeOpened(e.composite.getId())));
|
|
93
|
+
this._register(that.onDidCompositeClose.event(e => this.onScopeClosed(e.getId())));
|
|
94
|
+
}
|
|
95
|
+
})()
|
|
96
|
+
));
|
|
97
|
+
const compositeInstantiationService = this.instantiationService.createChild(( new ServiceCollection(
|
|
98
|
+
[IEditorProgressService, compositeProgressIndicator]
|
|
99
|
+
)));
|
|
100
|
+
const composite = compositeDescriptor.instantiate(compositeInstantiationService);
|
|
101
|
+
const disposable = ( new DisposableStore());
|
|
102
|
+
this.instantiatedCompositeItems.set(id, { composite, disposable, progress: compositeProgressIndicator });
|
|
103
|
+
disposable.add(composite.onTitleAreaUpdate(() => this.onTitleAreaUpdate(composite.getId()), this));
|
|
104
|
+
return composite;
|
|
105
|
+
}
|
|
106
|
+
throw new Error(`Unable to find composite with id ${id}`);
|
|
107
|
+
}
|
|
108
|
+
showComposite(composite) {
|
|
109
|
+
this.activeComposite = composite;
|
|
110
|
+
const id = this.activeComposite.getId();
|
|
111
|
+
if (id !== this.defaultCompositeId) {
|
|
112
|
+
this.storageService.store(this.activeCompositeSettingsKey, id, 1 , 1 );
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
this.storageService.remove(this.activeCompositeSettingsKey, 1 );
|
|
116
|
+
}
|
|
117
|
+
this.lastActiveCompositeId = this.activeComposite.getId();
|
|
118
|
+
let compositeContainer = this.mapCompositeToCompositeContainer.get(composite.getId());
|
|
119
|
+
if (!compositeContainer) {
|
|
120
|
+
compositeContainer = $('.composite');
|
|
121
|
+
compositeContainer.classList.add(...this.compositeCSSClass.split(' '));
|
|
122
|
+
compositeContainer.id = composite.getId();
|
|
123
|
+
composite.create(compositeContainer);
|
|
124
|
+
composite.updateStyles();
|
|
125
|
+
this.mapCompositeToCompositeContainer.set(composite.getId(), compositeContainer);
|
|
126
|
+
}
|
|
127
|
+
if (!this.activeComposite || composite.getId() !== this.activeComposite.getId()) {
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
const contentArea = this.getContentArea();
|
|
131
|
+
contentArea?.appendChild(compositeContainer);
|
|
132
|
+
show(compositeContainer);
|
|
133
|
+
const toolBar = assertIsDefined(this.toolBar);
|
|
134
|
+
toolBar.actionRunner = composite.getActionRunner();
|
|
135
|
+
const descriptor = this.registry.getComposite(composite.getId());
|
|
136
|
+
if (descriptor && descriptor.name !== composite.getTitle()) {
|
|
137
|
+
this.updateTitle(composite.getId(), composite.getTitle());
|
|
138
|
+
}
|
|
139
|
+
let actionsBinding = this.mapActionsBindingToComposite.get(composite.getId());
|
|
140
|
+
if (!actionsBinding) {
|
|
141
|
+
actionsBinding = this.collectCompositeActions(composite);
|
|
142
|
+
this.mapActionsBindingToComposite.set(composite.getId(), actionsBinding);
|
|
143
|
+
}
|
|
144
|
+
actionsBinding();
|
|
145
|
+
this.actionsListener.value = toolBar.actionRunner.onDidRun(e => {
|
|
146
|
+
if (e.error && !isCancellationError(e.error)) {
|
|
147
|
+
this.notificationService.error(e.error);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
composite.setVisible(true);
|
|
151
|
+
if (!this.activeComposite || composite.getId() !== this.activeComposite.getId()) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
if (this.contentAreaSize) {
|
|
155
|
+
composite.layout(this.contentAreaSize);
|
|
156
|
+
}
|
|
157
|
+
if (this.boundarySashes) {
|
|
158
|
+
composite.setBoundarySashes(this.boundarySashes);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
onTitleAreaUpdate(compositeId) {
|
|
162
|
+
const composite = this.instantiatedCompositeItems.get(compositeId);
|
|
163
|
+
if (composite) {
|
|
164
|
+
this.updateTitle(compositeId, composite.composite.getTitle());
|
|
165
|
+
}
|
|
166
|
+
if (this.activeComposite?.getId() === compositeId) {
|
|
167
|
+
const actionsBinding = this.collectCompositeActions(this.activeComposite);
|
|
168
|
+
this.mapActionsBindingToComposite.set(this.activeComposite.getId(), actionsBinding);
|
|
169
|
+
actionsBinding();
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
this.mapActionsBindingToComposite.delete(compositeId);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
updateTitle(compositeId, compositeTitle) {
|
|
176
|
+
const compositeDescriptor = this.registry.getComposite(compositeId);
|
|
177
|
+
if (!compositeDescriptor || !this.titleLabel) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
if (!compositeTitle) {
|
|
181
|
+
compositeTitle = compositeDescriptor.name;
|
|
182
|
+
}
|
|
183
|
+
const keybinding = this.keybindingService.lookupKeybinding(compositeId);
|
|
184
|
+
this.titleLabel.updateTitle(compositeId, compositeTitle, keybinding?.getLabel() ?? undefined);
|
|
185
|
+
const toolBar = assertIsDefined(this.toolBar);
|
|
186
|
+
toolBar.setAriaLabel(( localizeWithPath(
|
|
187
|
+
'vs/workbench/browser/parts/compositePart',
|
|
188
|
+
'ariaCompositeToolbarLabel',
|
|
189
|
+
"{0} actions",
|
|
190
|
+
compositeTitle
|
|
191
|
+
)));
|
|
192
|
+
}
|
|
193
|
+
collectCompositeActions(composite) {
|
|
194
|
+
const menuIds = composite?.getMenuIds();
|
|
195
|
+
const primaryActions = composite?.getActions().slice(0) || [];
|
|
196
|
+
const secondaryActions = composite?.getSecondaryActions().slice(0) || [];
|
|
197
|
+
const toolBar = assertIsDefined(this.toolBar);
|
|
198
|
+
toolBar.context = this.actionsContextProvider();
|
|
199
|
+
return () => toolBar.setActions(prepareActions(primaryActions), prepareActions(secondaryActions), menuIds);
|
|
200
|
+
}
|
|
201
|
+
getActiveComposite() {
|
|
202
|
+
return this.activeComposite;
|
|
203
|
+
}
|
|
204
|
+
getLastActiveCompositeId() {
|
|
205
|
+
return this.lastActiveCompositeId;
|
|
206
|
+
}
|
|
207
|
+
hideActiveComposite() {
|
|
208
|
+
if (!this.activeComposite) {
|
|
209
|
+
return undefined;
|
|
210
|
+
}
|
|
211
|
+
const composite = this.activeComposite;
|
|
212
|
+
this.activeComposite = undefined;
|
|
213
|
+
const compositeContainer = this.mapCompositeToCompositeContainer.get(composite.getId());
|
|
214
|
+
composite.setVisible(false);
|
|
215
|
+
if (compositeContainer) {
|
|
216
|
+
compositeContainer.remove();
|
|
217
|
+
hide(compositeContainer);
|
|
218
|
+
}
|
|
219
|
+
this.progressBar?.stop().hide();
|
|
220
|
+
if (this.toolBar) {
|
|
221
|
+
this.collectCompositeActions()();
|
|
222
|
+
}
|
|
223
|
+
this.onDidCompositeClose.fire(composite);
|
|
224
|
+
return composite;
|
|
225
|
+
}
|
|
226
|
+
createTitleArea(parent) {
|
|
227
|
+
const titleArea = append(parent, $('.composite'));
|
|
228
|
+
titleArea.classList.add('title');
|
|
229
|
+
this.titleLabel = this.createTitleLabel(titleArea);
|
|
230
|
+
const titleActionsContainer = append(titleArea, $('.title-actions'));
|
|
231
|
+
this.toolBar = this._register(this.instantiationService.createInstance(WorkbenchToolBar, titleActionsContainer, {
|
|
232
|
+
actionViewItemProvider: action => this.actionViewItemProvider(action),
|
|
233
|
+
orientation: 0 ,
|
|
234
|
+
getKeyBinding: action => this.keybindingService.lookupKeybinding(action.id),
|
|
235
|
+
anchorAlignmentProvider: () => this.getTitleAreaDropDownAnchorAlignment(),
|
|
236
|
+
toggleMenuTitle: ( localizeWithPath(
|
|
237
|
+
'vs/workbench/browser/parts/compositePart',
|
|
238
|
+
'viewsAndMoreActions',
|
|
239
|
+
"Views and More Actions..."
|
|
240
|
+
)),
|
|
241
|
+
telemetrySource: this.nameForTelemetry
|
|
242
|
+
}));
|
|
243
|
+
this.collectCompositeActions()();
|
|
244
|
+
return titleArea;
|
|
245
|
+
}
|
|
246
|
+
createTitleLabel(parent) {
|
|
247
|
+
const titleContainer = append(parent, $('.title-label'));
|
|
248
|
+
const titleLabel = append(titleContainer, $('h2'));
|
|
249
|
+
this.titleLabelElement = titleLabel;
|
|
250
|
+
const $this = this;
|
|
251
|
+
return {
|
|
252
|
+
updateTitle: (id, title, keybinding) => {
|
|
253
|
+
if (!this.activeComposite || this.activeComposite.getId() === id) {
|
|
254
|
+
titleLabel.innerText = title;
|
|
255
|
+
titleLabel.title = keybinding ? ( localizeWithPath(
|
|
256
|
+
'vs/workbench/browser/parts/compositePart',
|
|
257
|
+
'titleTooltip',
|
|
258
|
+
"{0} ({1})",
|
|
259
|
+
title,
|
|
260
|
+
keybinding
|
|
261
|
+
)) : title;
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
updateStyles: () => {
|
|
265
|
+
titleLabel.style.color = $this.titleForegroundColor ? $this.getColor($this.titleForegroundColor) || '' : '';
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
updateStyles() {
|
|
270
|
+
super.updateStyles();
|
|
271
|
+
const titleLabel = assertIsDefined(this.titleLabel);
|
|
272
|
+
titleLabel.updateStyles();
|
|
273
|
+
}
|
|
274
|
+
actionViewItemProvider(action) {
|
|
275
|
+
if (this.activeComposite) {
|
|
276
|
+
return this.activeComposite.getActionViewItem(action);
|
|
277
|
+
}
|
|
278
|
+
return createActionViewItem(this.instantiationService, action);
|
|
279
|
+
}
|
|
280
|
+
actionsContextProvider() {
|
|
281
|
+
if (this.activeComposite) {
|
|
282
|
+
return this.activeComposite.getActionsContext();
|
|
283
|
+
}
|
|
284
|
+
return null;
|
|
285
|
+
}
|
|
286
|
+
createContentArea(parent) {
|
|
287
|
+
const contentContainer = append(parent, $('.content'));
|
|
288
|
+
this.progressBar = this._register(( new ProgressBar(contentContainer, defaultProgressBarStyles)));
|
|
289
|
+
this.progressBar.hide();
|
|
290
|
+
return contentContainer;
|
|
291
|
+
}
|
|
292
|
+
getProgressIndicator(id) {
|
|
293
|
+
const compositeItem = this.instantiatedCompositeItems.get(id);
|
|
294
|
+
return compositeItem ? compositeItem.progress : undefined;
|
|
295
|
+
}
|
|
296
|
+
getTitleAreaDropDownAnchorAlignment() {
|
|
297
|
+
return 1 ;
|
|
298
|
+
}
|
|
299
|
+
layout(width, height, top, left) {
|
|
300
|
+
super.layout(width, height, top, left);
|
|
301
|
+
this.contentAreaSize = Dimension.lift(super.layoutContents(width, height).contentSize);
|
|
302
|
+
this.activeComposite?.layout(this.contentAreaSize);
|
|
303
|
+
}
|
|
304
|
+
setBoundarySashes(sashes) {
|
|
305
|
+
this.boundarySashes = sashes;
|
|
306
|
+
this.activeComposite?.setBoundarySashes(sashes);
|
|
307
|
+
}
|
|
308
|
+
removeComposite(compositeId) {
|
|
309
|
+
if (this.activeComposite?.getId() === compositeId) {
|
|
310
|
+
return false;
|
|
311
|
+
}
|
|
312
|
+
this.mapCompositeToCompositeContainer.delete(compositeId);
|
|
313
|
+
this.mapActionsBindingToComposite.delete(compositeId);
|
|
314
|
+
const compositeItem = this.instantiatedCompositeItems.get(compositeId);
|
|
315
|
+
if (compositeItem) {
|
|
316
|
+
compositeItem.composite.dispose();
|
|
317
|
+
dispose(compositeItem.disposable);
|
|
318
|
+
this.instantiatedCompositeItems.delete(compositeId);
|
|
319
|
+
}
|
|
320
|
+
return true;
|
|
321
|
+
}
|
|
322
|
+
dispose() {
|
|
323
|
+
this.mapCompositeToCompositeContainer.clear();
|
|
324
|
+
this.mapActionsBindingToComposite.clear();
|
|
325
|
+
this.instantiatedCompositeItems.forEach(compositeItem => {
|
|
326
|
+
compositeItem.composite.dispose();
|
|
327
|
+
dispose(compositeItem.disposable);
|
|
328
|
+
});
|
|
329
|
+
this.instantiatedCompositeItems.clear();
|
|
330
|
+
super.dispose();
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
export { CompositePart };
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { onDidChangeZoomLevel, onDidChangeFullscreen, isFullscreen } from '../../../../base/browser/browser.js';
|
|
3
|
+
import { show, hide } from '../../../../base/browser/dom.js';
|
|
4
|
+
import { Event, Emitter } from '../../../../base/common/event.js';
|
|
5
|
+
import { DisposableStore } from '../../../../base/common/lifecycle.js';
|
|
6
|
+
import { isNative } from '../../../../base/common/platform.js';
|
|
7
|
+
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';
|
|
8
|
+
import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
|
|
9
|
+
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
|
|
10
|
+
import { ServiceCollection } from '../../../../platform/instantiation/common/serviceCollection.js';
|
|
11
|
+
import { IStorageService } from '../../../../platform/storage/common/storage.js';
|
|
12
|
+
import { IThemeService } from '../../../../platform/theme/common/themeService.js';
|
|
13
|
+
import { hasNativeTitlebar } from '../../../../platform/window/common/window.js';
|
|
14
|
+
import { EditorPart } from './editorPart.js';
|
|
15
|
+
import { WindowTitle } from '../titlebar/windowTitle.js';
|
|
16
|
+
import { IAuxiliaryWindowService } from '../../../services/auxiliaryWindow/browser/auxiliaryWindowService.js';
|
|
17
|
+
import { IEditorService } from '../../../services/editor/common/editorService.js';
|
|
18
|
+
import { IHostService } from '../../../services/host/browser/host.js';
|
|
19
|
+
import { IWorkbenchLayoutService } from '../../../services/layout/browser/layoutService.js';
|
|
20
|
+
import { ILifecycleService } from '../../../services/lifecycle/common/lifecycle.js';
|
|
21
|
+
import { IStatusbarService } from '../../../services/statusbar/browser/statusbar.js';
|
|
22
|
+
import { ITitleService } from '../../../services/title/browser/titleService.js';
|
|
23
|
+
var AuxiliaryEditorPart_1, AuxiliaryEditorPartImpl_1;
|
|
24
|
+
let AuxiliaryEditorPart = class AuxiliaryEditorPart {
|
|
25
|
+
static { AuxiliaryEditorPart_1 = this; }
|
|
26
|
+
static { this.STATUS_BAR_VISIBILITY = 'workbench.statusBar.visible'; }
|
|
27
|
+
constructor(editorPartsView, instantiationService, auxiliaryWindowService, lifecycleService, configurationService, statusbarService, titleService, editorService) {
|
|
28
|
+
this.editorPartsView = editorPartsView;
|
|
29
|
+
this.instantiationService = instantiationService;
|
|
30
|
+
this.auxiliaryWindowService = auxiliaryWindowService;
|
|
31
|
+
this.lifecycleService = lifecycleService;
|
|
32
|
+
this.configurationService = configurationService;
|
|
33
|
+
this.statusbarService = statusbarService;
|
|
34
|
+
this.titleService = titleService;
|
|
35
|
+
this.editorService = editorService;
|
|
36
|
+
}
|
|
37
|
+
async create(label, options) {
|
|
38
|
+
function computeEditorPartHeightOffset() {
|
|
39
|
+
let editorPartHeightOffset = 0;
|
|
40
|
+
if (statusBarVisible) {
|
|
41
|
+
editorPartHeightOffset += statusbarPart.height;
|
|
42
|
+
}
|
|
43
|
+
if (titlebarPart && titlebarPartVisible) {
|
|
44
|
+
editorPartHeightOffset += titlebarPart.height;
|
|
45
|
+
}
|
|
46
|
+
return editorPartHeightOffset;
|
|
47
|
+
}
|
|
48
|
+
function updateStatusbarVisibility(fromEvent) {
|
|
49
|
+
if (statusBarVisible) {
|
|
50
|
+
show(statusbarPart.container);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
hide(statusbarPart.container);
|
|
54
|
+
}
|
|
55
|
+
updateEditorPartHeight(fromEvent);
|
|
56
|
+
}
|
|
57
|
+
function updateEditorPartHeight(fromEvent) {
|
|
58
|
+
editorPartContainer.style.height = `calc(100% - ${computeEditorPartHeightOffset()}px)`;
|
|
59
|
+
if (fromEvent) {
|
|
60
|
+
auxiliaryWindow.layout();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const disposables = ( new DisposableStore());
|
|
64
|
+
const auxiliaryWindow = disposables.add(await this.auxiliaryWindowService.open(options));
|
|
65
|
+
const editorPartContainer = document.createElement('div');
|
|
66
|
+
editorPartContainer.classList.add('part', 'editor');
|
|
67
|
+
editorPartContainer.setAttribute('role', 'main');
|
|
68
|
+
editorPartContainer.style.position = 'relative';
|
|
69
|
+
auxiliaryWindow.container.appendChild(editorPartContainer);
|
|
70
|
+
const editorPart = disposables.add(this.instantiationService.createInstance(AuxiliaryEditorPartImpl, auxiliaryWindow.window.vscodeWindowId, this.editorPartsView, options?.state, label));
|
|
71
|
+
disposables.add(this.editorPartsView.registerPart(editorPart));
|
|
72
|
+
editorPart.create(editorPartContainer);
|
|
73
|
+
let titlebarPart = undefined;
|
|
74
|
+
let titlebarPartVisible = false;
|
|
75
|
+
const useCustomTitle = isNative && !hasNativeTitlebar(this.configurationService);
|
|
76
|
+
if (useCustomTitle) {
|
|
77
|
+
titlebarPart = disposables.add(this.titleService.createAuxiliaryTitlebarPart(auxiliaryWindow.container, editorPart));
|
|
78
|
+
titlebarPartVisible = true;
|
|
79
|
+
disposables.add(titlebarPart.onDidChange(() => updateEditorPartHeight(true)));
|
|
80
|
+
disposables.add(onDidChangeZoomLevel(targetWindowId => {
|
|
81
|
+
if (auxiliaryWindow.window.vscodeWindowId === targetWindowId && titlebarPartVisible) {
|
|
82
|
+
updateEditorPartHeight(true);
|
|
83
|
+
}
|
|
84
|
+
}));
|
|
85
|
+
disposables.add(onDidChangeFullscreen(windowId => {
|
|
86
|
+
if (windowId !== auxiliaryWindow.window.vscodeWindowId) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const fullscreen = isFullscreen(auxiliaryWindow.window);
|
|
90
|
+
const oldTitlebarPartVisible = titlebarPartVisible;
|
|
91
|
+
titlebarPartVisible = !fullscreen;
|
|
92
|
+
if (titlebarPart && oldTitlebarPartVisible !== titlebarPartVisible) {
|
|
93
|
+
titlebarPart.container.style.display = titlebarPartVisible ? '' : 'none';
|
|
94
|
+
updateEditorPartHeight(true);
|
|
95
|
+
}
|
|
96
|
+
}));
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
disposables.add(this.instantiationService.createInstance(WindowTitle, auxiliaryWindow.window, editorPart));
|
|
100
|
+
}
|
|
101
|
+
const statusbarPart = disposables.add(this.statusbarService.createAuxiliaryStatusbarPart(auxiliaryWindow.container));
|
|
102
|
+
let statusBarVisible = this.configurationService.getValue(AuxiliaryEditorPart_1.STATUS_BAR_VISIBILITY) !== false;
|
|
103
|
+
disposables.add(this.configurationService.onDidChangeConfiguration(e => {
|
|
104
|
+
if (e.affectsConfiguration(AuxiliaryEditorPart_1.STATUS_BAR_VISIBILITY)) {
|
|
105
|
+
statusBarVisible = this.configurationService.getValue(AuxiliaryEditorPart_1.STATUS_BAR_VISIBILITY) !== false;
|
|
106
|
+
updateStatusbarVisibility(true);
|
|
107
|
+
}
|
|
108
|
+
}));
|
|
109
|
+
updateStatusbarVisibility(false);
|
|
110
|
+
const editorCloseListener = disposables.add(Event.once(editorPart.onWillClose)(() => auxiliaryWindow.window.close()));
|
|
111
|
+
disposables.add(Event.once(auxiliaryWindow.onUnload)(() => {
|
|
112
|
+
if (disposables.isDisposed) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
editorCloseListener.dispose();
|
|
116
|
+
editorPart.close();
|
|
117
|
+
disposables.dispose();
|
|
118
|
+
}));
|
|
119
|
+
disposables.add(Event.once(this.lifecycleService.onDidShutdown)(() => disposables.dispose()));
|
|
120
|
+
disposables.add(auxiliaryWindow.onDidLayout(dimension => {
|
|
121
|
+
const titlebarPartHeight = titlebarPart?.height ?? 0;
|
|
122
|
+
titlebarPart?.layout(dimension.width, titlebarPartHeight, 0, 0);
|
|
123
|
+
const editorPartHeight = dimension.height - computeEditorPartHeightOffset();
|
|
124
|
+
editorPart.layout(dimension.width, editorPartHeight, titlebarPartHeight, 0);
|
|
125
|
+
statusbarPart.layout(dimension.width, statusbarPart.height, dimension.height - statusbarPart.height, 0);
|
|
126
|
+
}));
|
|
127
|
+
auxiliaryWindow.layout();
|
|
128
|
+
const instantiationService = this.instantiationService.createChild(( new ServiceCollection(
|
|
129
|
+
[IStatusbarService, this.statusbarService.createScoped(statusbarPart, disposables)],
|
|
130
|
+
[IEditorService, this.editorService.createScoped(editorPart, disposables)]
|
|
131
|
+
)));
|
|
132
|
+
return {
|
|
133
|
+
part: editorPart,
|
|
134
|
+
instantiationService,
|
|
135
|
+
disposables
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
AuxiliaryEditorPart = AuxiliaryEditorPart_1 = ( __decorate([
|
|
140
|
+
( __param(1, IInstantiationService)),
|
|
141
|
+
( __param(2, IAuxiliaryWindowService)),
|
|
142
|
+
( __param(3, ILifecycleService)),
|
|
143
|
+
( __param(4, IConfigurationService)),
|
|
144
|
+
( __param(5, IStatusbarService)),
|
|
145
|
+
( __param(6, ITitleService)),
|
|
146
|
+
( __param(7, IEditorService))
|
|
147
|
+
], AuxiliaryEditorPart));
|
|
148
|
+
let AuxiliaryEditorPartImpl = class AuxiliaryEditorPartImpl extends EditorPart {
|
|
149
|
+
static { AuxiliaryEditorPartImpl_1 = this; }
|
|
150
|
+
static { this.COUNTER = 1; }
|
|
151
|
+
constructor(windowId, editorPartsView, state, groupsLabel, instantiationService, themeService, configurationService, storageService, layoutService, hostService, contextKeyService) {
|
|
152
|
+
const id = AuxiliaryEditorPartImpl_1.COUNTER++;
|
|
153
|
+
super(editorPartsView, `workbench.parts.auxiliaryEditor.${id}`, groupsLabel, windowId, instantiationService, themeService, configurationService, storageService, layoutService, hostService, contextKeyService);
|
|
154
|
+
this.state = state;
|
|
155
|
+
this._onWillClose = this._register(( new Emitter()));
|
|
156
|
+
this.onWillClose = this._onWillClose.event;
|
|
157
|
+
}
|
|
158
|
+
removeGroup(group, preserveFocus) {
|
|
159
|
+
const groupView = this.assertGroupView(group);
|
|
160
|
+
if (this.count === 1 && this.activeGroup === groupView) {
|
|
161
|
+
this.doRemoveLastGroup(preserveFocus);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
super.removeGroup(group, preserveFocus);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
doRemoveLastGroup(preserveFocus) {
|
|
168
|
+
const restoreFocus = !preserveFocus && this.shouldRestoreFocus(this.container);
|
|
169
|
+
const mostRecentlyActiveGroups = this.editorPartsView.getGroups(1 );
|
|
170
|
+
const nextActiveGroup = mostRecentlyActiveGroups[1];
|
|
171
|
+
if (nextActiveGroup) {
|
|
172
|
+
nextActiveGroup.groupsView.activateGroup(nextActiveGroup);
|
|
173
|
+
if (restoreFocus) {
|
|
174
|
+
nextActiveGroup.focus();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
this.doClose(false );
|
|
178
|
+
}
|
|
179
|
+
loadState() {
|
|
180
|
+
return this.state;
|
|
181
|
+
}
|
|
182
|
+
saveState() {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
close() {
|
|
186
|
+
this.doClose(true );
|
|
187
|
+
}
|
|
188
|
+
doClose(mergeGroupsToMainPart) {
|
|
189
|
+
if (mergeGroupsToMainPart) {
|
|
190
|
+
this.mergeGroupsToMainPart();
|
|
191
|
+
}
|
|
192
|
+
this._onWillClose.fire();
|
|
193
|
+
}
|
|
194
|
+
mergeGroupsToMainPart() {
|
|
195
|
+
if (!( this.groups.some(group => group.count > 0))) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
let targetGroup = undefined;
|
|
199
|
+
for (const group of this.editorPartsView.mainPart.getGroups(1 )) {
|
|
200
|
+
if (!group.isLocked) {
|
|
201
|
+
targetGroup = group;
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (!targetGroup) {
|
|
206
|
+
targetGroup = this.editorPartsView.mainPart.addGroup(this.editorPartsView.mainPart.activeGroup, this.partOptions.openSideBySideDirection === 'right' ? 3 : 1 );
|
|
207
|
+
}
|
|
208
|
+
this.mergeAllGroups(targetGroup);
|
|
209
|
+
targetGroup.focus();
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
AuxiliaryEditorPartImpl = AuxiliaryEditorPartImpl_1 = ( __decorate([
|
|
213
|
+
( __param(4, IInstantiationService)),
|
|
214
|
+
( __param(5, IThemeService)),
|
|
215
|
+
( __param(6, IConfigurationService)),
|
|
216
|
+
( __param(7, IStorageService)),
|
|
217
|
+
( __param(8, IWorkbenchLayoutService)),
|
|
218
|
+
( __param(9, IHostService)),
|
|
219
|
+
( __param(10, IContextKeyService))
|
|
220
|
+
], AuxiliaryEditorPartImpl));
|
|
221
|
+
export { AuxiliaryEditorPart };
|