@codingame/monaco-vscode-view-common-service-override 26.2.2 → 27.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/package.json +3 -3
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +56 -56
- package/vscode/src/vs/workbench/browser/actions/helpActions.js +21 -21
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +3 -3
- package/vscode/src/vs/workbench/browser/actions/navigationActions.js +6 -6
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +166 -166
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +8 -8
- package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.d.ts +3 -0
- package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +14 -3
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +12 -12
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +3 -3
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +4 -3
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +10 -10
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.js +7 -7
- package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +8 -8
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +29 -29
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +14 -14
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorAccessibilityHelp.js +5 -5
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +13 -13
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +20 -20
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +3 -3
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +1 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +10 -10
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +3 -3
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +2 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +12 -12
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/scrollLocking/browser/scrollLocking.js +8 -8
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +10 -10
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +3 -3
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +4 -3
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.d.ts +6 -4
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +19 -4
- package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +22 -14
- package/vscode/src/vs/workbench/contrib/webview/browser/themeing.js +11 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +7 -4
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +7 -3
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +5 -5
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +1 -1
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +8 -8
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +9 -9
- package/vscode/src/vs/workbench/services/progress/browser/progressService.d.ts +3 -1
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +14 -11
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.d.ts +7 -1
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +71 -14
- package/vscode/src/vs/workbench/services/views/browser/viewsService.d.ts +75 -0
- package/vscode/src/vs/workbench/services/views/browser/viewsService.js +711 -0
|
@@ -0,0 +1,711 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { Disposable, DisposableMap, toDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { ViewContainerLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views';
|
|
5
|
+
import { IViewDescriptorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views.service';
|
|
6
|
+
import { FocusedViewContext, getVisbileViewContextKey } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contextkeys';
|
|
7
|
+
import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
|
|
8
|
+
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
9
|
+
import { RawContextKey, ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
10
|
+
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
11
|
+
import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
12
|
+
import { isString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
13
|
+
import { registerAction2, Action2, MenuRegistry, MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
14
|
+
import { localize, localize2 } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
15
|
+
import { KeybindingWeight } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
16
|
+
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
|
|
17
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
18
|
+
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
19
|
+
import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
|
|
20
|
+
import { IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
|
|
21
|
+
import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
22
|
+
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
23
|
+
import { PaneComposite, PaneCompositeDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/panecomposite';
|
|
24
|
+
import { Parts } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
25
|
+
import { IWorkbenchLayoutService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
26
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
27
|
+
import { Categories } from '@codingame/monaco-vscode-api/vscode/vs/platform/action/common/actionCommonCategories';
|
|
28
|
+
import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
29
|
+
import { FilterViewPaneContainer } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/views/viewsViewlet';
|
|
30
|
+
import { IPaneCompositePartService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/panecomposite/browser/panecomposite.service';
|
|
31
|
+
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
32
|
+
import { IViewsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
33
|
+
|
|
34
|
+
let ViewsService = class ViewsService extends Disposable {
|
|
35
|
+
constructor(
|
|
36
|
+
viewDescriptorService,
|
|
37
|
+
paneCompositeService,
|
|
38
|
+
contextKeyService,
|
|
39
|
+
layoutService,
|
|
40
|
+
editorService
|
|
41
|
+
) {
|
|
42
|
+
super();
|
|
43
|
+
this.viewDescriptorService = viewDescriptorService;
|
|
44
|
+
this.paneCompositeService = paneCompositeService;
|
|
45
|
+
this.contextKeyService = contextKeyService;
|
|
46
|
+
this.layoutService = layoutService;
|
|
47
|
+
this.editorService = editorService;
|
|
48
|
+
this._onDidChangeViewVisibility = this._register(( new Emitter()));
|
|
49
|
+
this.onDidChangeViewVisibility = this._onDidChangeViewVisibility.event;
|
|
50
|
+
this._onDidChangeViewContainerVisibility = this._register(( new Emitter()));
|
|
51
|
+
this.onDidChangeViewContainerVisibility = this._onDidChangeViewContainerVisibility.event;
|
|
52
|
+
this._onDidChangeFocusedView = this._register(( new Emitter()));
|
|
53
|
+
this.onDidChangeFocusedView = this._onDidChangeFocusedView.event;
|
|
54
|
+
this.viewContainerDisposables = this._register(( new DisposableMap()));
|
|
55
|
+
this.viewDisposable = ( new Map());
|
|
56
|
+
this.enabledViewContainersContextKeys = ( new Map());
|
|
57
|
+
this.visibleViewContextKeys = ( new Map());
|
|
58
|
+
this.viewPaneContainers = ( new Map());
|
|
59
|
+
this._register(toDisposable(() => {
|
|
60
|
+
this.viewDisposable.forEach(disposable => disposable.dispose());
|
|
61
|
+
this.viewDisposable.clear();
|
|
62
|
+
}));
|
|
63
|
+
this.viewDescriptorService.viewContainers.forEach(viewContainer => this.onDidRegisterViewContainer(
|
|
64
|
+
viewContainer,
|
|
65
|
+
this.viewDescriptorService.getViewContainerLocation(viewContainer)
|
|
66
|
+
));
|
|
67
|
+
this._register(this.viewDescriptorService.onDidChangeViewContainers((
|
|
68
|
+
{
|
|
69
|
+
added,
|
|
70
|
+
removed
|
|
71
|
+
}
|
|
72
|
+
) => this.onDidChangeContainers(added, removed)));
|
|
73
|
+
this._register(this.viewDescriptorService.onDidChangeContainerLocation((
|
|
74
|
+
{
|
|
75
|
+
viewContainer,
|
|
76
|
+
from,
|
|
77
|
+
to
|
|
78
|
+
}
|
|
79
|
+
) => this.onDidChangeContainerLocation(viewContainer, from, to)));
|
|
80
|
+
this._register(
|
|
81
|
+
this.paneCompositeService.onDidPaneCompositeOpen(e => this._onDidChangeViewContainerVisibility.fire({
|
|
82
|
+
id: e.composite.getId(),
|
|
83
|
+
visible: true,
|
|
84
|
+
location: e.viewContainerLocation
|
|
85
|
+
}))
|
|
86
|
+
);
|
|
87
|
+
this._register(
|
|
88
|
+
this.paneCompositeService.onDidPaneCompositeClose(e => this._onDidChangeViewContainerVisibility.fire({
|
|
89
|
+
id: e.composite.getId(),
|
|
90
|
+
visible: false,
|
|
91
|
+
location: e.viewContainerLocation
|
|
92
|
+
}))
|
|
93
|
+
);
|
|
94
|
+
this.focusedViewContextKey = FocusedViewContext.bindTo(contextKeyService);
|
|
95
|
+
}
|
|
96
|
+
onViewsAdded(added) {
|
|
97
|
+
for (const view of added) {
|
|
98
|
+
this.onViewsVisibilityChanged(view, view.isBodyVisible());
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
onViewsVisibilityChanged(view, visible) {
|
|
102
|
+
this.getOrCreateActiveViewContextKey(view).set(visible);
|
|
103
|
+
this._onDidChangeViewVisibility.fire({
|
|
104
|
+
id: view.id,
|
|
105
|
+
visible: visible
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
onViewsRemoved(removed) {
|
|
109
|
+
for (const view of removed) {
|
|
110
|
+
this.onViewsVisibilityChanged(view, false);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
getOrCreateActiveViewContextKey(view) {
|
|
114
|
+
const visibleContextKeyId = getVisbileViewContextKey(view.id);
|
|
115
|
+
let contextKey = this.visibleViewContextKeys.get(visibleContextKeyId);
|
|
116
|
+
if (!contextKey) {
|
|
117
|
+
contextKey = ( new RawContextKey(visibleContextKeyId, false)).bindTo(this.contextKeyService);
|
|
118
|
+
this.visibleViewContextKeys.set(visibleContextKeyId, contextKey);
|
|
119
|
+
}
|
|
120
|
+
return contextKey;
|
|
121
|
+
}
|
|
122
|
+
onDidChangeContainers(added, removed) {
|
|
123
|
+
for (const {
|
|
124
|
+
container,
|
|
125
|
+
location
|
|
126
|
+
} of removed) {
|
|
127
|
+
this.onDidDeregisterViewContainer(container, location);
|
|
128
|
+
}
|
|
129
|
+
for (const {
|
|
130
|
+
container,
|
|
131
|
+
location
|
|
132
|
+
} of added) {
|
|
133
|
+
this.onDidRegisterViewContainer(container, location);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
onDidRegisterViewContainer(viewContainer, viewContainerLocation) {
|
|
137
|
+
this.registerPaneComposite(viewContainer, viewContainerLocation);
|
|
138
|
+
const disposables = ( new DisposableStore());
|
|
139
|
+
const viewContainerModel = this.viewDescriptorService.getViewContainerModel(viewContainer);
|
|
140
|
+
this.onViewDescriptorsAdded(viewContainerModel.allViewDescriptors, viewContainer);
|
|
141
|
+
disposables.add(viewContainerModel.onDidChangeAllViewDescriptors((
|
|
142
|
+
{
|
|
143
|
+
added,
|
|
144
|
+
removed
|
|
145
|
+
}
|
|
146
|
+
) => {
|
|
147
|
+
this.onViewDescriptorsAdded(added, viewContainer);
|
|
148
|
+
this.onViewDescriptorsRemoved(removed);
|
|
149
|
+
}));
|
|
150
|
+
this.updateViewContainerEnablementContextKey(viewContainer);
|
|
151
|
+
disposables.add(
|
|
152
|
+
viewContainerModel.onDidChangeActiveViewDescriptors(() => this.updateViewContainerEnablementContextKey(viewContainer))
|
|
153
|
+
);
|
|
154
|
+
disposables.add(this.registerOpenViewContainerAction(viewContainer));
|
|
155
|
+
this.viewContainerDisposables.set(viewContainer.id, disposables);
|
|
156
|
+
}
|
|
157
|
+
onDidDeregisterViewContainer(viewContainer, viewContainerLocation) {
|
|
158
|
+
this.deregisterPaneComposite(viewContainer, viewContainerLocation);
|
|
159
|
+
this.viewContainerDisposables.deleteAndDispose(viewContainer.id);
|
|
160
|
+
}
|
|
161
|
+
onDidChangeContainerLocation(viewContainer, from, to) {
|
|
162
|
+
this.deregisterPaneComposite(viewContainer, from);
|
|
163
|
+
this.registerPaneComposite(viewContainer, to);
|
|
164
|
+
if (this.layoutService.isVisible(this.paneCompositeService.getPartId(to)) && this.viewDescriptorService.getViewContainersByLocation(to).filter(vc => this.isViewContainerActive(vc.id)).length === 1) {
|
|
165
|
+
this.openViewContainer(viewContainer.id);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
onViewDescriptorsAdded(views, container) {
|
|
169
|
+
const location = this.viewDescriptorService.getViewContainerLocation(container);
|
|
170
|
+
if (location === null) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
for (const viewDescriptor of views) {
|
|
174
|
+
const disposables = ( new DisposableStore());
|
|
175
|
+
disposables.add(this.registerOpenViewAction(viewDescriptor));
|
|
176
|
+
disposables.add(this.registerFocusViewAction(viewDescriptor, container.title));
|
|
177
|
+
disposables.add(this.registerResetViewLocationAction(viewDescriptor));
|
|
178
|
+
this.viewDisposable.set(viewDescriptor, disposables);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
onViewDescriptorsRemoved(views) {
|
|
182
|
+
for (const view of views) {
|
|
183
|
+
const disposable = this.viewDisposable.get(view);
|
|
184
|
+
if (disposable) {
|
|
185
|
+
disposable.dispose();
|
|
186
|
+
this.viewDisposable.delete(view);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
updateViewContainerEnablementContextKey(viewContainer) {
|
|
191
|
+
let contextKey = this.enabledViewContainersContextKeys.get(viewContainer.id);
|
|
192
|
+
if (!contextKey) {
|
|
193
|
+
contextKey = this.contextKeyService.createKey(getEnabledViewContainerContextKey(viewContainer.id), false);
|
|
194
|
+
this.enabledViewContainersContextKeys.set(viewContainer.id, contextKey);
|
|
195
|
+
}
|
|
196
|
+
contextKey.set(
|
|
197
|
+
!(viewContainer.hideIfEmpty && this.viewDescriptorService.getViewContainerModel(viewContainer).activeViewDescriptors.length === 0)
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
async openComposite(compositeId, location, focus) {
|
|
201
|
+
return this.paneCompositeService.openPaneComposite(compositeId, location, focus);
|
|
202
|
+
}
|
|
203
|
+
getComposite(compositeId, location) {
|
|
204
|
+
return this.paneCompositeService.getPaneComposite(compositeId, location);
|
|
205
|
+
}
|
|
206
|
+
isViewContainerVisible(id) {
|
|
207
|
+
const viewContainer = this.viewDescriptorService.getViewContainerById(id);
|
|
208
|
+
if (!viewContainer) {
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
211
|
+
const viewContainerLocation = this.viewDescriptorService.getViewContainerLocation(viewContainer);
|
|
212
|
+
if (viewContainerLocation === null) {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
return this.paneCompositeService.getActivePaneComposite(viewContainerLocation)?.getId() === id;
|
|
216
|
+
}
|
|
217
|
+
isViewContainerActive(id) {
|
|
218
|
+
const viewContainer = this.viewDescriptorService.getViewContainerById(id);
|
|
219
|
+
if (!viewContainer) {
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
if (!this.contextKeyService.contextMatchesRules(viewContainer.when)) {
|
|
223
|
+
return false;
|
|
224
|
+
}
|
|
225
|
+
if (!viewContainer.hideIfEmpty) {
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
return this.viewDescriptorService.getViewContainerModel(viewContainer).activeViewDescriptors.length > 0;
|
|
229
|
+
}
|
|
230
|
+
getVisibleViewContainer(location) {
|
|
231
|
+
const viewContainerId = this.paneCompositeService.getActivePaneComposite(location)?.getId();
|
|
232
|
+
return viewContainerId ? this.viewDescriptorService.getViewContainerById(viewContainerId) : null;
|
|
233
|
+
}
|
|
234
|
+
getActiveViewPaneContainerWithId(viewContainerId) {
|
|
235
|
+
const viewContainer = this.viewDescriptorService.getViewContainerById(viewContainerId);
|
|
236
|
+
return viewContainer ? this.getActiveViewPaneContainer(viewContainer) : null;
|
|
237
|
+
}
|
|
238
|
+
async openViewContainer(id, focus) {
|
|
239
|
+
const viewContainer = this.viewDescriptorService.getViewContainerById(id);
|
|
240
|
+
if (viewContainer) {
|
|
241
|
+
const viewContainerLocation = this.viewDescriptorService.getViewContainerLocation(viewContainer);
|
|
242
|
+
if (viewContainerLocation !== null) {
|
|
243
|
+
const paneComposite = await this.paneCompositeService.openPaneComposite(id, viewContainerLocation, focus);
|
|
244
|
+
return paneComposite || null;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return null;
|
|
248
|
+
}
|
|
249
|
+
async closeViewContainer(id) {
|
|
250
|
+
const viewContainer = this.viewDescriptorService.getViewContainerById(id);
|
|
251
|
+
if (viewContainer) {
|
|
252
|
+
const viewContainerLocation = this.viewDescriptorService.getViewContainerLocation(viewContainer);
|
|
253
|
+
const isActive = viewContainerLocation !== null && this.paneCompositeService.getActivePaneComposite(viewContainerLocation);
|
|
254
|
+
if (viewContainerLocation !== null) {
|
|
255
|
+
return isActive ? this.layoutService.setPartHidden(true, this.paneCompositeService.getPartId(viewContainerLocation)) : undefined;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
isViewVisible(id) {
|
|
260
|
+
const activeView = this.getActiveViewWithId(id);
|
|
261
|
+
return activeView?.isBodyVisible() || false;
|
|
262
|
+
}
|
|
263
|
+
getActiveViewWithId(id) {
|
|
264
|
+
const viewContainer = this.viewDescriptorService.getViewContainerByViewId(id);
|
|
265
|
+
if (viewContainer) {
|
|
266
|
+
const activeViewPaneContainer = this.getActiveViewPaneContainer(viewContainer);
|
|
267
|
+
if (activeViewPaneContainer) {
|
|
268
|
+
return activeViewPaneContainer.getView(id);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
return null;
|
|
272
|
+
}
|
|
273
|
+
getViewWithId(id) {
|
|
274
|
+
const viewContainer = this.viewDescriptorService.getViewContainerByViewId(id);
|
|
275
|
+
if (viewContainer) {
|
|
276
|
+
const viewPaneContainer = this.viewPaneContainers.get(viewContainer.id);
|
|
277
|
+
if (viewPaneContainer) {
|
|
278
|
+
return viewPaneContainer.getView(id);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return null;
|
|
282
|
+
}
|
|
283
|
+
getFocusedView() {
|
|
284
|
+
const viewId = this.contextKeyService.getContextKeyValue(FocusedViewContext.key) ?? "";
|
|
285
|
+
return this.viewDescriptorService.getViewDescriptorById(( viewId.toString()));
|
|
286
|
+
}
|
|
287
|
+
getFocusedViewName() {
|
|
288
|
+
const textEditorFocused = this.editorService.activeTextEditorControl?.hasTextFocus() ? ( localize(16131, "Text Editor")) : undefined;
|
|
289
|
+
return this.getFocusedView()?.name?.value ?? textEditorFocused ?? "";
|
|
290
|
+
}
|
|
291
|
+
async openView(id, focus) {
|
|
292
|
+
const viewContainer = this.viewDescriptorService.getViewContainerByViewId(id);
|
|
293
|
+
if (!viewContainer) {
|
|
294
|
+
return null;
|
|
295
|
+
}
|
|
296
|
+
if (!( this.viewDescriptorService.getViewContainerModel(viewContainer).activeViewDescriptors.some(viewDescriptor => viewDescriptor.id === id))) {
|
|
297
|
+
return null;
|
|
298
|
+
}
|
|
299
|
+
const location = this.viewDescriptorService.getViewContainerLocation(viewContainer);
|
|
300
|
+
const compositeDescriptor = this.getComposite(viewContainer.id, location);
|
|
301
|
+
if (compositeDescriptor) {
|
|
302
|
+
const paneComposite = await this.openComposite(compositeDescriptor.id, location);
|
|
303
|
+
if (paneComposite?.openView) {
|
|
304
|
+
return paneComposite.openView(id, focus) || null;
|
|
305
|
+
} else if (focus) {
|
|
306
|
+
paneComposite?.focus();
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
return null;
|
|
310
|
+
}
|
|
311
|
+
closeView(id) {
|
|
312
|
+
const viewContainer = this.viewDescriptorService.getViewContainerByViewId(id);
|
|
313
|
+
if (viewContainer) {
|
|
314
|
+
const activeViewPaneContainer = this.getActiveViewPaneContainer(viewContainer);
|
|
315
|
+
if (activeViewPaneContainer) {
|
|
316
|
+
const view = activeViewPaneContainer.getView(id);
|
|
317
|
+
if (view) {
|
|
318
|
+
if (activeViewPaneContainer.views.length === 1) {
|
|
319
|
+
const location = this.viewDescriptorService.getViewContainerLocation(viewContainer);
|
|
320
|
+
if (location === ViewContainerLocation.Sidebar) {
|
|
321
|
+
this.layoutService.setPartHidden(true, Parts.SIDEBAR_PART);
|
|
322
|
+
} else if (location === ViewContainerLocation.Panel || location === ViewContainerLocation.AuxiliaryBar) {
|
|
323
|
+
this.paneCompositeService.hideActivePaneComposite(location);
|
|
324
|
+
}
|
|
325
|
+
if (this.focusedViewContextKey.get() === id) {
|
|
326
|
+
this.focusedViewContextKey.reset();
|
|
327
|
+
}
|
|
328
|
+
} else {
|
|
329
|
+
view.setExpanded(false);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
getActiveViewPaneContainer(viewContainer) {
|
|
336
|
+
const location = this.viewDescriptorService.getViewContainerLocation(viewContainer);
|
|
337
|
+
if (location === null) {
|
|
338
|
+
return null;
|
|
339
|
+
}
|
|
340
|
+
const activePaneComposite = this.paneCompositeService.getActivePaneComposite(location);
|
|
341
|
+
if (activePaneComposite?.getId() === viewContainer.id) {
|
|
342
|
+
return activePaneComposite.getViewPaneContainer() || null;
|
|
343
|
+
}
|
|
344
|
+
return null;
|
|
345
|
+
}
|
|
346
|
+
getViewProgressIndicator(viewId) {
|
|
347
|
+
const viewContainer = this.viewDescriptorService.getViewContainerByViewId(viewId);
|
|
348
|
+
if (!viewContainer) {
|
|
349
|
+
return undefined;
|
|
350
|
+
}
|
|
351
|
+
const viewPaneContainer = this.viewPaneContainers.get(viewContainer.id);
|
|
352
|
+
if (!viewPaneContainer) {
|
|
353
|
+
return undefined;
|
|
354
|
+
}
|
|
355
|
+
const view = viewPaneContainer.getView(viewId);
|
|
356
|
+
if (!view) {
|
|
357
|
+
return undefined;
|
|
358
|
+
}
|
|
359
|
+
if (viewPaneContainer.isViewMergedWithContainer()) {
|
|
360
|
+
return this.getViewContainerProgressIndicator(viewContainer);
|
|
361
|
+
}
|
|
362
|
+
return view.getProgressIndicator();
|
|
363
|
+
}
|
|
364
|
+
getViewContainerProgressIndicator(viewContainer) {
|
|
365
|
+
const viewContainerLocation = this.viewDescriptorService.getViewContainerLocation(viewContainer);
|
|
366
|
+
if (viewContainerLocation === null) {
|
|
367
|
+
return undefined;
|
|
368
|
+
}
|
|
369
|
+
return this.paneCompositeService.getProgressIndicator(viewContainer.id, viewContainerLocation);
|
|
370
|
+
}
|
|
371
|
+
registerOpenViewContainerAction(viewContainer) {
|
|
372
|
+
const disposables = ( new DisposableStore());
|
|
373
|
+
if (viewContainer.openCommandActionDescriptor) {
|
|
374
|
+
const {
|
|
375
|
+
id,
|
|
376
|
+
mnemonicTitle,
|
|
377
|
+
keybindings,
|
|
378
|
+
order
|
|
379
|
+
} = viewContainer.openCommandActionDescriptor ?? {
|
|
380
|
+
id: viewContainer.id
|
|
381
|
+
};
|
|
382
|
+
const title = viewContainer.openCommandActionDescriptor.title ?? viewContainer.title;
|
|
383
|
+
const that = this;
|
|
384
|
+
disposables.add(registerAction2(class OpenViewContainerAction extends Action2 {
|
|
385
|
+
constructor() {
|
|
386
|
+
super({
|
|
387
|
+
id,
|
|
388
|
+
get title() {
|
|
389
|
+
const viewContainerLocation = that.viewDescriptorService.getViewContainerLocation(viewContainer);
|
|
390
|
+
const localizedTitle = typeof title === "string" ? title : title.value;
|
|
391
|
+
const originalTitle = typeof title === "string" ? title : title.original;
|
|
392
|
+
if (viewContainerLocation === ViewContainerLocation.Sidebar) {
|
|
393
|
+
return {
|
|
394
|
+
value: ( localize(16132, "Show {0}", localizedTitle)),
|
|
395
|
+
original: `Show ${originalTitle}`
|
|
396
|
+
};
|
|
397
|
+
} else {
|
|
398
|
+
return {
|
|
399
|
+
value: ( localize(16133, "Toggle {0}", localizedTitle)),
|
|
400
|
+
original: `Toggle ${originalTitle}`
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
category: Categories.View,
|
|
405
|
+
precondition: ( ContextKeyExpr.has(getEnabledViewContainerContextKey(viewContainer.id))),
|
|
406
|
+
keybinding: keybindings ? {
|
|
407
|
+
...keybindings,
|
|
408
|
+
weight: KeybindingWeight.WorkbenchContrib
|
|
409
|
+
} : undefined,
|
|
410
|
+
f1: true
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
async run(serviceAccessor) {
|
|
414
|
+
const editorGroupService = serviceAccessor.get(IEditorGroupsService);
|
|
415
|
+
const viewDescriptorService = serviceAccessor.get(IViewDescriptorService);
|
|
416
|
+
const layoutService = serviceAccessor.get(IWorkbenchLayoutService);
|
|
417
|
+
const viewsService = serviceAccessor.get(IViewsService);
|
|
418
|
+
const viewContainerLocation = viewDescriptorService.getViewContainerLocation(viewContainer);
|
|
419
|
+
switch (viewContainerLocation) {
|
|
420
|
+
case ViewContainerLocation.AuxiliaryBar:
|
|
421
|
+
case ViewContainerLocation.Sidebar:
|
|
422
|
+
{
|
|
423
|
+
const part = viewContainerLocation === ViewContainerLocation.Sidebar ? Parts.SIDEBAR_PART : Parts.AUXILIARYBAR_PART;
|
|
424
|
+
if (!viewsService.isViewContainerVisible(viewContainer.id) || !layoutService.hasFocus(part)) {
|
|
425
|
+
await viewsService.openViewContainer(viewContainer.id, true);
|
|
426
|
+
} else {
|
|
427
|
+
editorGroupService.activeGroup.focus();
|
|
428
|
+
}
|
|
429
|
+
break;
|
|
430
|
+
}
|
|
431
|
+
case ViewContainerLocation.Panel:
|
|
432
|
+
if (!viewsService.isViewContainerVisible(viewContainer.id) || !layoutService.hasFocus(Parts.PANEL_PART)) {
|
|
433
|
+
await viewsService.openViewContainer(viewContainer.id, true);
|
|
434
|
+
} else {
|
|
435
|
+
viewsService.closeViewContainer(viewContainer.id);
|
|
436
|
+
}
|
|
437
|
+
break;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}));
|
|
441
|
+
if (mnemonicTitle) {
|
|
442
|
+
const defaultLocation = this.viewDescriptorService.getDefaultViewContainerLocation(viewContainer);
|
|
443
|
+
disposables.add(MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
|
|
444
|
+
command: {
|
|
445
|
+
id,
|
|
446
|
+
title: mnemonicTitle
|
|
447
|
+
},
|
|
448
|
+
group: defaultLocation === ViewContainerLocation.Sidebar ? "3_sidebar" : defaultLocation === ViewContainerLocation.AuxiliaryBar ? "4_auxbar" : "5_panel",
|
|
449
|
+
when: ( ContextKeyExpr.has(getEnabledViewContainerContextKey(viewContainer.id))),
|
|
450
|
+
order: order ?? Number.MAX_VALUE
|
|
451
|
+
}));
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
return disposables;
|
|
455
|
+
}
|
|
456
|
+
registerOpenViewAction(viewDescriptor) {
|
|
457
|
+
const disposables = ( new DisposableStore());
|
|
458
|
+
const title = viewDescriptor.openCommandActionDescriptor?.title ?? viewDescriptor.name;
|
|
459
|
+
const commandId = viewDescriptor.openCommandActionDescriptor?.id ?? `${viewDescriptor.id}.open`;
|
|
460
|
+
const that = this;
|
|
461
|
+
disposables.add(registerAction2(class OpenViewAction extends Action2 {
|
|
462
|
+
constructor() {
|
|
463
|
+
super({
|
|
464
|
+
id: commandId,
|
|
465
|
+
get title() {
|
|
466
|
+
const viewContainerLocation = that.viewDescriptorService.getViewLocationById(viewDescriptor.id);
|
|
467
|
+
const localizedTitle = typeof title === "string" ? title : title.value;
|
|
468
|
+
const originalTitle = typeof title === "string" ? title : title.original;
|
|
469
|
+
if (viewContainerLocation === ViewContainerLocation.Sidebar) {
|
|
470
|
+
return {
|
|
471
|
+
value: ( localize(16132, "Show {0}", localizedTitle)),
|
|
472
|
+
original: `Show ${originalTitle}`
|
|
473
|
+
};
|
|
474
|
+
} else {
|
|
475
|
+
return {
|
|
476
|
+
value: ( localize(16133, "Toggle {0}", localizedTitle)),
|
|
477
|
+
original: `Toggle ${originalTitle}`
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
category: Categories.View,
|
|
482
|
+
precondition: ( ContextKeyExpr.has(`${viewDescriptor.id}.active`)),
|
|
483
|
+
keybinding: viewDescriptor.openCommandActionDescriptor?.keybindings ? {
|
|
484
|
+
...viewDescriptor.openCommandActionDescriptor.keybindings,
|
|
485
|
+
weight: KeybindingWeight.WorkbenchContrib
|
|
486
|
+
} : undefined,
|
|
487
|
+
f1: viewDescriptor.openCommandActionDescriptor ? true : undefined,
|
|
488
|
+
metadata: {
|
|
489
|
+
description: ( localize(16134, "Opens view {0}", viewDescriptor.name.value)),
|
|
490
|
+
args: [{
|
|
491
|
+
name: "options",
|
|
492
|
+
schema: {
|
|
493
|
+
type: "object",
|
|
494
|
+
properties: {
|
|
495
|
+
"preserveFocus": {
|
|
496
|
+
type: "boolean",
|
|
497
|
+
default: false,
|
|
498
|
+
description: ( localize(16135, "Whether to preserve the existing focus when opening the view."))
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}]
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
async run(serviceAccessor, options) {
|
|
507
|
+
const editorGroupService = serviceAccessor.get(IEditorGroupsService);
|
|
508
|
+
const viewDescriptorService = serviceAccessor.get(IViewDescriptorService);
|
|
509
|
+
const layoutService = serviceAccessor.get(IWorkbenchLayoutService);
|
|
510
|
+
const viewsService = serviceAccessor.get(IViewsService);
|
|
511
|
+
const contextKeyService = serviceAccessor.get(IContextKeyService);
|
|
512
|
+
const focusedViewId = FocusedViewContext.getValue(contextKeyService);
|
|
513
|
+
if (focusedViewId === viewDescriptor.id && !options?.preserveFocus) {
|
|
514
|
+
const viewLocation = viewDescriptorService.getViewLocationById(viewDescriptor.id);
|
|
515
|
+
if (viewDescriptorService.getViewLocationById(viewDescriptor.id) === ViewContainerLocation.Sidebar) {
|
|
516
|
+
editorGroupService.activeGroup.focus();
|
|
517
|
+
} else if (viewLocation !== null) {
|
|
518
|
+
layoutService.setPartHidden(true, that.paneCompositeService.getPartId(viewLocation));
|
|
519
|
+
}
|
|
520
|
+
} else {
|
|
521
|
+
await viewsService.openView(viewDescriptor.id, !options?.preserveFocus);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}));
|
|
525
|
+
if (viewDescriptor.openCommandActionDescriptor?.mnemonicTitle) {
|
|
526
|
+
const defaultViewContainer = this.viewDescriptorService.getDefaultContainerById(viewDescriptor.id);
|
|
527
|
+
if (defaultViewContainer) {
|
|
528
|
+
const defaultLocation = this.viewDescriptorService.getDefaultViewContainerLocation(defaultViewContainer);
|
|
529
|
+
disposables.add(MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
|
|
530
|
+
command: {
|
|
531
|
+
id: commandId,
|
|
532
|
+
title: viewDescriptor.openCommandActionDescriptor.mnemonicTitle
|
|
533
|
+
},
|
|
534
|
+
group: defaultLocation === ViewContainerLocation.Sidebar ? "3_sidebar" : defaultLocation === ViewContainerLocation.AuxiliaryBar ? "4_auxbar" : "5_panel",
|
|
535
|
+
when: ( ContextKeyExpr.has(`${viewDescriptor.id}.active`)),
|
|
536
|
+
order: viewDescriptor.openCommandActionDescriptor.order ?? Number.MAX_VALUE
|
|
537
|
+
}));
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
return disposables;
|
|
541
|
+
}
|
|
542
|
+
registerFocusViewAction(viewDescriptor, category) {
|
|
543
|
+
return registerAction2(class FocusViewAction extends Action2 {
|
|
544
|
+
constructor() {
|
|
545
|
+
const title = ( localize2(16136, "Focus on {0} View", viewDescriptor.name.value));
|
|
546
|
+
super({
|
|
547
|
+
id: viewDescriptor.focusCommand ? viewDescriptor.focusCommand.id : `${viewDescriptor.id}.focus`,
|
|
548
|
+
title,
|
|
549
|
+
category,
|
|
550
|
+
menu: [{
|
|
551
|
+
id: MenuId.CommandPalette,
|
|
552
|
+
when: viewDescriptor.when
|
|
553
|
+
}],
|
|
554
|
+
keybinding: {
|
|
555
|
+
when: ( ContextKeyExpr.has(`${viewDescriptor.id}.active`)),
|
|
556
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
557
|
+
primary: viewDescriptor.focusCommand?.keybindings?.primary,
|
|
558
|
+
secondary: viewDescriptor.focusCommand?.keybindings?.secondary,
|
|
559
|
+
linux: viewDescriptor.focusCommand?.keybindings?.linux,
|
|
560
|
+
mac: viewDescriptor.focusCommand?.keybindings?.mac,
|
|
561
|
+
win: viewDescriptor.focusCommand?.keybindings?.win
|
|
562
|
+
},
|
|
563
|
+
metadata: {
|
|
564
|
+
description: title.value,
|
|
565
|
+
args: [{
|
|
566
|
+
name: "focusOptions",
|
|
567
|
+
description: "Focus Options",
|
|
568
|
+
schema: {
|
|
569
|
+
type: "object",
|
|
570
|
+
properties: {
|
|
571
|
+
"preserveFocus": {
|
|
572
|
+
type: "boolean",
|
|
573
|
+
default: false
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
}]
|
|
578
|
+
}
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
run(accessor, options) {
|
|
582
|
+
accessor.get(IViewsService).openView(viewDescriptor.id, !options?.preserveFocus);
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
registerResetViewLocationAction(viewDescriptor) {
|
|
587
|
+
return registerAction2(class ResetViewLocationAction extends Action2 {
|
|
588
|
+
constructor() {
|
|
589
|
+
super({
|
|
590
|
+
id: `${viewDescriptor.id}.resetViewLocation`,
|
|
591
|
+
title: ( localize2(16137, "Reset Location")),
|
|
592
|
+
menu: [{
|
|
593
|
+
id: MenuId.ViewTitleContext,
|
|
594
|
+
when: ( ContextKeyExpr.or(( ContextKeyExpr.and(( ContextKeyExpr.equals("view", viewDescriptor.id)), ( ContextKeyExpr.equals(`${viewDescriptor.id}.defaultViewLocation`, false)))))),
|
|
595
|
+
group: "1_hide",
|
|
596
|
+
order: 2
|
|
597
|
+
}]
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
run(accessor) {
|
|
601
|
+
const viewDescriptorService = accessor.get(IViewDescriptorService);
|
|
602
|
+
const defaultContainer = viewDescriptorService.getDefaultContainerById(viewDescriptor.id);
|
|
603
|
+
const containerModel = viewDescriptorService.getViewContainerModel(defaultContainer);
|
|
604
|
+
if (defaultContainer.hideIfEmpty && containerModel.visibleViewDescriptors.length === 0) {
|
|
605
|
+
const defaultLocation = viewDescriptorService.getDefaultViewContainerLocation(defaultContainer);
|
|
606
|
+
viewDescriptorService.moveViewContainerToLocation(defaultContainer, defaultLocation, undefined, this.desc.id);
|
|
607
|
+
}
|
|
608
|
+
viewDescriptorService.moveViewsToContainer([viewDescriptor], defaultContainer, undefined, this.desc.id);
|
|
609
|
+
accessor.get(IViewsService).openView(viewDescriptor.id, true);
|
|
610
|
+
}
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
registerPaneComposite(viewContainer, viewContainerLocation) {
|
|
614
|
+
const that = this;
|
|
615
|
+
let PaneContainer = class PaneContainer extends PaneComposite {
|
|
616
|
+
constructor(
|
|
617
|
+
telemetryService,
|
|
618
|
+
contextService,
|
|
619
|
+
storageService,
|
|
620
|
+
instantiationService,
|
|
621
|
+
themeService,
|
|
622
|
+
contextMenuService,
|
|
623
|
+
extensionService
|
|
624
|
+
) {
|
|
625
|
+
super(
|
|
626
|
+
viewContainer.id,
|
|
627
|
+
telemetryService,
|
|
628
|
+
storageService,
|
|
629
|
+
instantiationService,
|
|
630
|
+
themeService,
|
|
631
|
+
contextMenuService,
|
|
632
|
+
extensionService,
|
|
633
|
+
contextService
|
|
634
|
+
);
|
|
635
|
+
}
|
|
636
|
+
createViewPaneContainer(element) {
|
|
637
|
+
const viewPaneContainerDisposables = this._register(( new DisposableStore()));
|
|
638
|
+
const viewPaneContainer = that.createViewPaneContainer(
|
|
639
|
+
element,
|
|
640
|
+
viewContainer,
|
|
641
|
+
viewContainerLocation,
|
|
642
|
+
viewPaneContainerDisposables,
|
|
643
|
+
this.instantiationService
|
|
644
|
+
);
|
|
645
|
+
if (!(viewPaneContainer instanceof FilterViewPaneContainer)) {
|
|
646
|
+
viewPaneContainerDisposables.add(Event.any(
|
|
647
|
+
viewPaneContainer.onDidAddViews,
|
|
648
|
+
viewPaneContainer.onDidRemoveViews,
|
|
649
|
+
viewPaneContainer.onTitleAreaUpdate
|
|
650
|
+
)(() => {
|
|
651
|
+
this.updateTitleArea();
|
|
652
|
+
}));
|
|
653
|
+
}
|
|
654
|
+
return viewPaneContainer;
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
PaneContainer = ( __decorate([( __param(0, ITelemetryService)), ( __param(1, IWorkspaceContextService)), ( __param(2, IStorageService)), ( __param(3, IInstantiationService)), ( __param(4, IThemeService)), ( __param(5, IContextMenuService)), ( __param(6, IExtensionService))], PaneContainer));
|
|
658
|
+
( Registry.as(this.paneCompositeService.getRegistryId(viewContainerLocation))).registerPaneComposite(PaneCompositeDescriptor.create(
|
|
659
|
+
PaneContainer,
|
|
660
|
+
viewContainer.id,
|
|
661
|
+
typeof viewContainer.title === "string" ? viewContainer.title : viewContainer.title.value,
|
|
662
|
+
isString(viewContainer.icon) ? viewContainer.icon : undefined,
|
|
663
|
+
viewContainer.order,
|
|
664
|
+
viewContainer.requestedIndex,
|
|
665
|
+
viewContainer.icon instanceof URI ? viewContainer.icon : undefined
|
|
666
|
+
));
|
|
667
|
+
}
|
|
668
|
+
deregisterPaneComposite(viewContainer, viewContainerLocation) {
|
|
669
|
+
( Registry.as(this.paneCompositeService.getRegistryId(viewContainerLocation))).deregisterPaneComposite(viewContainer.id);
|
|
670
|
+
}
|
|
671
|
+
createViewPaneContainer(
|
|
672
|
+
element,
|
|
673
|
+
viewContainer,
|
|
674
|
+
viewContainerLocation,
|
|
675
|
+
disposables,
|
|
676
|
+
instantiationService
|
|
677
|
+
) {
|
|
678
|
+
const viewPaneContainer = instantiationService.createInstance(
|
|
679
|
+
viewContainer.ctorDescriptor.ctor,
|
|
680
|
+
...(viewContainer.ctorDescriptor.staticArguments || [])
|
|
681
|
+
);
|
|
682
|
+
this.viewPaneContainers.set(viewPaneContainer.getId(), viewPaneContainer);
|
|
683
|
+
disposables.add(
|
|
684
|
+
toDisposable(() => this.viewPaneContainers.delete(viewPaneContainer.getId()))
|
|
685
|
+
);
|
|
686
|
+
disposables.add(viewPaneContainer.onDidAddViews(views => this.onViewsAdded(views)));
|
|
687
|
+
disposables.add(
|
|
688
|
+
viewPaneContainer.onDidChangeViewVisibility(view => this.onViewsVisibilityChanged(view, view.isBodyVisible()))
|
|
689
|
+
);
|
|
690
|
+
disposables.add(viewPaneContainer.onDidRemoveViews(views => this.onViewsRemoved(views)));
|
|
691
|
+
disposables.add(viewPaneContainer.onDidFocusView(view => {
|
|
692
|
+
if (this.focusedViewContextKey.get() !== view.id) {
|
|
693
|
+
this.focusedViewContextKey.set(view.id);
|
|
694
|
+
this._onDidChangeFocusedView.fire();
|
|
695
|
+
}
|
|
696
|
+
}));
|
|
697
|
+
disposables.add(viewPaneContainer.onDidBlurView(view => {
|
|
698
|
+
if (this.focusedViewContextKey.get() === view.id) {
|
|
699
|
+
this.focusedViewContextKey.reset();
|
|
700
|
+
this._onDidChangeFocusedView.fire();
|
|
701
|
+
}
|
|
702
|
+
}));
|
|
703
|
+
return viewPaneContainer;
|
|
704
|
+
}
|
|
705
|
+
};
|
|
706
|
+
ViewsService = ( __decorate([( __param(0, IViewDescriptorService)), ( __param(1, IPaneCompositePartService)), ( __param(2, IContextKeyService)), ( __param(3, IWorkbenchLayoutService)), ( __param(4, IEditorService))], ViewsService));
|
|
707
|
+
function getEnabledViewContainerContextKey(viewContainerId) {
|
|
708
|
+
return `viewContainer.${viewContainerId}.enabled`;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
export { ViewsService };
|