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