@codingame/monaco-vscode-view-common-service-override 4.5.1 → 5.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/package.json +3 -3
- package/viewCommon.js +3 -6
- package/vscode/src/vs/base/browser/ui/grid/grid.js +12 -12
- package/vscode/src/vs/base/browser/ui/grid/gridview.js +26 -26
- package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +4 -3
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +142 -221
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +49 -45
- package/vscode/src/vs/workbench/browser/actions/navigationActions.js +7 -30
- package/vscode/src/vs/workbench/browser/media/style.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +67 -138
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +25 -38
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/compositeBar.js +26 -27
- package/vscode/src/vs/workbench/browser/parts/compositePart.js +20 -34
- package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +7 -4
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +216 -765
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +27 -42
- package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +24 -23
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +54 -19
- package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +122 -72
- package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +51 -54
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +44 -44
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +25 -26
- package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarActions.js +2 -5
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +22 -22
- package/vscode/src/vs/workbench/browser/window.js +41 -92
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +41 -78
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +23 -46
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +36 -27
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +14 -15
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.js +10 -11
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +25 -52
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +59 -88
- package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +18 -48
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +61 -150
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +15 -70
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +9 -20
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +14 -65
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +39 -113
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +1 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +13 -19
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +1 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +35 -75
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +16 -37
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +41 -43
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +6 -5
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +13 -11
- package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +24 -61
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +7 -6
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +37 -70
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +23 -46
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +26 -27
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +2 -2
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +50 -52
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +5 -3
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +18 -34
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +7 -10
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +13 -11
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewService.js +2 -2
- package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +79 -49
- package/vscode/src/vs/workbench/services/driver/browser/driver.js +9 -7
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +45 -68
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +95 -98
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +34 -74
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +69 -67
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +52 -47
|
@@ -18,6 +18,7 @@ import { localizeWithPath, localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
|
18
18
|
import { ILoggerService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
19
19
|
|
|
20
20
|
var ViewDescriptorService_1;
|
|
21
|
+
const _moduleId = "vs/workbench/services/views/browser/viewDescriptorService";
|
|
21
22
|
function getViewContainerStorageId(viewContainerId) { return `${viewContainerId}.state`; }
|
|
22
23
|
let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
23
24
|
static { ViewDescriptorService_1 = this; }
|
|
@@ -31,28 +32,28 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
31
32
|
this.storageService = storageService;
|
|
32
33
|
this.extensionService = extensionService;
|
|
33
34
|
this.telemetryService = telemetryService;
|
|
34
|
-
this._onDidChangeContainer = this._register(( new Emitter()));
|
|
35
|
+
this._onDidChangeContainer = this._register(( (new Emitter())));
|
|
35
36
|
this.onDidChangeContainer = this._onDidChangeContainer.event;
|
|
36
|
-
this._onDidChangeLocation = this._register(( new Emitter()));
|
|
37
|
+
this._onDidChangeLocation = this._register(( (new Emitter())));
|
|
37
38
|
this.onDidChangeLocation = this._onDidChangeLocation.event;
|
|
38
|
-
this._onDidChangeContainerLocation = this._register(( new Emitter()));
|
|
39
|
+
this._onDidChangeContainerLocation = this._register(( (new Emitter())));
|
|
39
40
|
this.onDidChangeContainerLocation = this._onDidChangeContainerLocation.event;
|
|
40
|
-
this.viewContainerModels = this._register(( new DisposableMap()));
|
|
41
|
-
this.viewsVisibilityActionDisposables = this._register(( new DisposableMap()));
|
|
41
|
+
this.viewContainerModels = this._register(( (new DisposableMap())));
|
|
42
|
+
this.viewsVisibilityActionDisposables = this._register(( (new DisposableMap())));
|
|
42
43
|
this.canRegisterViewsVisibilityActions = false;
|
|
43
|
-
this._onDidChangeViewContainers = this._register(( new Emitter()));
|
|
44
|
+
this._onDidChangeViewContainers = this._register(( (new Emitter())));
|
|
44
45
|
this.onDidChangeViewContainers = this._onDidChangeViewContainers.event;
|
|
45
46
|
this.logger = loggerService.createLogger(VIEWS_LOG_ID, { name: VIEWS_LOG_NAME, hidden: true });
|
|
46
|
-
this.activeViewContextKeys = ( new Map());
|
|
47
|
-
this.movableViewContextKeys = ( new Map());
|
|
48
|
-
this.defaultViewLocationContextKeys = ( new Map());
|
|
49
|
-
this.defaultViewContainerLocationContextKeys = ( new Map());
|
|
50
|
-
this.viewContainersRegistry = ( Registry.as(Extensions.ViewContainersRegistry));
|
|
51
|
-
this.viewsRegistry = ( Registry.as(Extensions.ViewsRegistry));
|
|
47
|
+
this.activeViewContextKeys = ( (new Map()));
|
|
48
|
+
this.movableViewContextKeys = ( (new Map()));
|
|
49
|
+
this.defaultViewLocationContextKeys = ( (new Map()));
|
|
50
|
+
this.defaultViewContainerLocationContextKeys = ( (new Map()));
|
|
51
|
+
this.viewContainersRegistry = ( (Registry.as(Extensions.ViewContainersRegistry)));
|
|
52
|
+
this.viewsRegistry = ( (Registry.as(Extensions.ViewsRegistry)));
|
|
52
53
|
this.migrateToViewsCustomizationsStorage();
|
|
53
|
-
this.viewContainersCustomLocations = ( new Map(Object.entries(this.viewCustomizations.viewContainerLocations)));
|
|
54
|
-
this.viewDescriptorsCustomLocations = ( new Map(Object.entries(this.viewCustomizations.viewLocations)));
|
|
55
|
-
this.viewContainerBadgeEnablementStates = ( new Map(Object.entries(this.viewCustomizations.viewContainerBadgeEnablementStates)));
|
|
54
|
+
this.viewContainersCustomLocations = ( (new Map(Object.entries(this.viewCustomizations.viewContainerLocations))));
|
|
55
|
+
this.viewDescriptorsCustomLocations = ( (new Map(Object.entries(this.viewCustomizations.viewLocations))));
|
|
56
|
+
this.viewContainerBadgeEnablementStates = ( (new Map(Object.entries(this.viewCustomizations.viewContainerBadgeEnablementStates))));
|
|
56
57
|
this.viewContainers.forEach(viewContainer => this.onDidRegisterViewContainer(viewContainer));
|
|
57
58
|
this._register(this.viewsRegistry.onViewsRegistered(views => this.onDidRegisterViews(views)));
|
|
58
59
|
this._register(this.viewsRegistry.onViewsDeregistered(({ views, viewContainer }) => this.onDidDeregisterViews(views, viewContainer)));
|
|
@@ -65,7 +66,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
65
66
|
this.onDidDeregisterViewContainer(viewContainer);
|
|
66
67
|
this._onDidChangeViewContainers.fire({ removed: [{ container: viewContainer, location: viewContainerLocation }], added: [] });
|
|
67
68
|
}));
|
|
68
|
-
this._register(this.storageService.onDidChangeValue(0 , ViewDescriptorService_1.VIEWS_CUSTOMIZATIONS, this._register(( new DisposableStore())))(() => this.onDidStorageChange()));
|
|
69
|
+
this._register(this.storageService.onDidChangeValue(0 , ViewDescriptorService_1.VIEWS_CUSTOMIZATIONS, this._register(( (new DisposableStore()))))(() => this.onDidStorageChange()));
|
|
69
70
|
this.extensionService.whenInstalledExtensionsRegistered().then(() => this.whenExtensionsRegistered());
|
|
70
71
|
}
|
|
71
72
|
migrateToViewsCustomizationsStorage() {
|
|
@@ -91,7 +92,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
91
92
|
registerGroupedViews(groupedViews) {
|
|
92
93
|
for (const [containerId, views] of groupedViews.entries()) {
|
|
93
94
|
const viewContainer = this.viewContainersRegistry.get(containerId);
|
|
94
|
-
if (!viewContainer || !( this.viewContainerModels.has(viewContainer))) {
|
|
95
|
+
if (!viewContainer || !( (this.viewContainerModels.has(viewContainer)))) {
|
|
95
96
|
if (this.isGeneratedContainerId(containerId)) {
|
|
96
97
|
const viewContainerLocation = this.viewContainersCustomLocations.get(containerId);
|
|
97
98
|
if (viewContainerLocation !== undefined) {
|
|
@@ -107,7 +108,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
107
108
|
deregisterGroupedViews(groupedViews) {
|
|
108
109
|
for (const [viewContainerId, views] of groupedViews.entries()) {
|
|
109
110
|
const viewContainer = this.viewContainersRegistry.get(viewContainerId);
|
|
110
|
-
if (!viewContainer || !( this.viewContainerModels.has(viewContainer))) {
|
|
111
|
+
if (!viewContainer || !( (this.viewContainerModels.has(viewContainer)))) {
|
|
111
112
|
continue;
|
|
112
113
|
}
|
|
113
114
|
this.removeViews(viewContainer, views);
|
|
@@ -127,7 +128,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
127
128
|
}
|
|
128
129
|
whenExtensionsRegistered() {
|
|
129
130
|
this.moveOrphanViewsToDefaultLocation();
|
|
130
|
-
for (const viewContainerId of [...( this.viewContainersCustomLocations.keys())]) {
|
|
131
|
+
for (const viewContainerId of [...( (this.viewContainersCustomLocations.keys()))]) {
|
|
131
132
|
this.cleanUpGeneratedViewContainer(viewContainerId);
|
|
132
133
|
}
|
|
133
134
|
this.saveViewCustomizations();
|
|
@@ -156,7 +157,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
156
157
|
});
|
|
157
158
|
}
|
|
158
159
|
regroupViews(containerId, views) {
|
|
159
|
-
const viewsByContainer = ( new Map());
|
|
160
|
+
const viewsByContainer = ( (new Map()));
|
|
160
161
|
for (const viewDescriptor of views) {
|
|
161
162
|
const correctContainerId = this.viewDescriptorsCustomLocations.get(viewDescriptor.id) ?? containerId;
|
|
162
163
|
let containerViews = viewsByContainer.get(correctContainerId);
|
|
@@ -225,7 +226,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
225
226
|
if (!views.length) {
|
|
226
227
|
return;
|
|
227
228
|
}
|
|
228
|
-
this.logger.info(`moveViewsToContainer: views:${( views.map(view => view.id)).join(',')} viewContainer:${viewContainer.id} reason:${reason}`);
|
|
229
|
+
this.logger.info(`moveViewsToContainer: views:${( (views.map(view => view.id))).join(',')} viewContainer:${viewContainer.id} reason:${reason}`);
|
|
229
230
|
const from = this.getViewContainerByViewId(views[0].id);
|
|
230
231
|
const to = viewContainer;
|
|
231
232
|
if (from && to && from !== to) {
|
|
@@ -257,10 +258,10 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
257
258
|
this.saveViewCustomizations();
|
|
258
259
|
}
|
|
259
260
|
isViewContainerRemovedPermanently(viewContainerId) {
|
|
260
|
-
return this.isGeneratedContainerId(viewContainerId) && !( this.viewContainersCustomLocations.has(viewContainerId));
|
|
261
|
+
return this.isGeneratedContainerId(viewContainerId) && !( (this.viewContainersCustomLocations.has(viewContainerId)));
|
|
261
262
|
}
|
|
262
263
|
onDidChangeDefaultContainer(views, from, to) {
|
|
263
|
-
const viewsToMove = views.filter(view => !( this.viewDescriptorsCustomLocations.has(view.id))
|
|
264
|
+
const viewsToMove = views.filter(view => !( (this.viewDescriptorsCustomLocations.has(view.id)))
|
|
264
265
|
|| (!this.viewContainers.includes(from) && this.viewDescriptorsCustomLocations.get(view.id) === from.id)
|
|
265
266
|
);
|
|
266
267
|
if (viewsToMove.length) {
|
|
@@ -323,7 +324,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
323
324
|
if (viewContainer && this.getViewContainerModel(viewContainer)?.allViewDescriptors.length) {
|
|
324
325
|
return;
|
|
325
326
|
}
|
|
326
|
-
if ([...( this.viewDescriptorsCustomLocations.values())].includes(viewContainerId)) {
|
|
327
|
+
if ([...( (this.viewDescriptorsCustomLocations.values()))].includes(viewContainerId)) {
|
|
327
328
|
return;
|
|
328
329
|
}
|
|
329
330
|
if (viewContainer) {
|
|
@@ -337,7 +338,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
337
338
|
const id = existingId || this.generateContainerId(location);
|
|
338
339
|
const container = this.viewContainersRegistry.registerViewContainer({
|
|
339
340
|
id,
|
|
340
|
-
ctorDescriptor: ( new SyncDescriptor(ViewPaneContainer, [id, { mergeViewWithContainerWhenSingleView: true }])),
|
|
341
|
+
ctorDescriptor: ( (new SyncDescriptor(ViewPaneContainer, [id, { mergeViewWithContainerWhenSingleView: true }]))),
|
|
341
342
|
title: { value: id, original: id },
|
|
342
343
|
icon: location === 0 ? defaultViewIcon : undefined,
|
|
343
344
|
storageId: getViewContainerStorageId(id),
|
|
@@ -356,8 +357,8 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
356
357
|
}
|
|
357
358
|
onDidViewCustomizationsStorageChange() {
|
|
358
359
|
this._viewCustomizations = undefined;
|
|
359
|
-
const newViewContainerCustomizations = ( new Map(Object.entries(this.viewCustomizations.viewContainerLocations)));
|
|
360
|
-
const newViewDescriptorCustomizations = ( new Map(Object.entries(this.viewCustomizations.viewLocations)));
|
|
360
|
+
const newViewContainerCustomizations = ( (new Map(Object.entries(this.viewCustomizations.viewContainerLocations))));
|
|
361
|
+
const newViewDescriptorCustomizations = ( (new Map(Object.entries(this.viewCustomizations.viewLocations))));
|
|
361
362
|
const viewContainersToMove = [];
|
|
362
363
|
const viewsToMove = [];
|
|
363
364
|
for (const [containerId, location] of newViewContainerCustomizations.entries()) {
|
|
@@ -372,7 +373,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
372
373
|
}
|
|
373
374
|
}
|
|
374
375
|
for (const viewContainer of this.viewContainers) {
|
|
375
|
-
if (!( newViewContainerCustomizations.has(viewContainer.id))) {
|
|
376
|
+
if (!( (newViewContainerCustomizations.has(viewContainer.id)))) {
|
|
376
377
|
const currentLocation = this.getViewContainerLocation(viewContainer);
|
|
377
378
|
const defaultLocation = this.getDefaultViewContainerLocation(viewContainer);
|
|
378
379
|
if (currentLocation !== defaultLocation) {
|
|
@@ -393,7 +394,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
393
394
|
for (const viewContainer of this.viewContainers) {
|
|
394
395
|
const viewContainerModel = this.getViewContainerModel(viewContainer);
|
|
395
396
|
for (const viewDescriptor of viewContainerModel.allViewDescriptors) {
|
|
396
|
-
if (!( newViewDescriptorCustomizations.has(viewDescriptor.id))) {
|
|
397
|
+
if (!( (newViewDescriptorCustomizations.has(viewDescriptor.id)))) {
|
|
397
398
|
const currentContainer = this.getViewContainerByViewId(viewDescriptor.id);
|
|
398
399
|
const defaultContainer = this.getDefaultContainerById(viewDescriptor.id);
|
|
399
400
|
if (currentContainer && defaultContainer && currentContainer !== defaultContainer) {
|
|
@@ -489,13 +490,13 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
489
490
|
getOrRegisterViewContainerModel(viewContainer) {
|
|
490
491
|
let viewContainerModel = this.viewContainerModels.get(viewContainer)?.viewContainerModel;
|
|
491
492
|
if (!viewContainerModel) {
|
|
492
|
-
const disposables = ( new DisposableStore());
|
|
493
|
+
const disposables = ( (new DisposableStore()));
|
|
493
494
|
viewContainerModel = disposables.add(this.instantiationService.createInstance(ViewContainerModel, viewContainer));
|
|
494
495
|
this.onDidChangeActiveViews({ added: viewContainerModel.activeViewDescriptors, removed: [] });
|
|
495
496
|
viewContainerModel.onDidChangeActiveViewDescriptors(changed => this.onDidChangeActiveViews(changed), this, disposables);
|
|
496
497
|
this.onDidChangeVisibleViews({ added: [...viewContainerModel.visibleViewDescriptors], removed: [] });
|
|
497
|
-
viewContainerModel.onDidAddVisibleViewDescriptors(added => this.onDidChangeVisibleViews({ added: ( added.map(({ viewDescriptor }) => viewDescriptor)), removed: [] }), this, disposables);
|
|
498
|
-
viewContainerModel.onDidRemoveVisibleViewDescriptors(removed => this.onDidChangeVisibleViews({ added: [], removed: ( removed.map(({ viewDescriptor }) => viewDescriptor)) }), this, disposables);
|
|
498
|
+
viewContainerModel.onDidAddVisibleViewDescriptors(added => this.onDidChangeVisibleViews({ added: ( (added.map(({ viewDescriptor }) => viewDescriptor))), removed: [] }), this, disposables);
|
|
499
|
+
viewContainerModel.onDidRemoveVisibleViewDescriptors(removed => this.onDidChangeVisibleViews({ added: [], removed: ( (removed.map(({ viewDescriptor }) => viewDescriptor))) }), this, disposables);
|
|
499
500
|
disposables.add(toDisposable(() => this.viewsVisibilityActionDisposables.deleteAndDispose(viewContainer)));
|
|
500
501
|
disposables.add(this.registerResetViewContainerAction(viewContainer));
|
|
501
502
|
const value = { viewContainerModel: viewContainerModel, disposables, dispose: () => disposables.dispose() };
|
|
@@ -539,7 +540,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
539
540
|
}));
|
|
540
541
|
}
|
|
541
542
|
registerViewsVisibilityActionsForContainer(viewContainerModel) {
|
|
542
|
-
const disposables = ( new DisposableStore());
|
|
543
|
+
const disposables = ( (new DisposableStore()));
|
|
543
544
|
viewContainerModel.activeViewDescriptors.forEach((viewDescriptor, index) => {
|
|
544
545
|
if (!viewDescriptor.remoteAuthority) {
|
|
545
546
|
disposables.add(registerAction2(class extends ViewPaneContainerAction {
|
|
@@ -547,21 +548,25 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
547
548
|
super({
|
|
548
549
|
id: `${viewDescriptor.id}.toggleVisibility`,
|
|
549
550
|
viewPaneContainerId: viewContainerModel.viewContainer.id,
|
|
550
|
-
precondition: viewDescriptor.canToggleVisibility && (!viewContainerModel.isVisible(viewDescriptor.id) || viewContainerModel.visibleViewDescriptors.length > 1) ? ContextKeyExpr.true() : ( ContextKeyExpr.false()),
|
|
551
|
-
toggled: ( ContextKeyExpr.has(`${viewDescriptor.id}.visible`)),
|
|
551
|
+
precondition: viewDescriptor.canToggleVisibility && (!viewContainerModel.isVisible(viewDescriptor.id) || viewContainerModel.visibleViewDescriptors.length > 1) ? ContextKeyExpr.true() : ( (ContextKeyExpr.false())),
|
|
552
|
+
toggled: ( (ContextKeyExpr.has(`${viewDescriptor.id}.visible`))),
|
|
552
553
|
title: viewDescriptor.name,
|
|
553
554
|
menu: [{
|
|
554
555
|
id: ViewsSubMenu,
|
|
555
|
-
when: ( ContextKeyExpr.equals('viewContainer', viewContainerModel.viewContainer.id)),
|
|
556
|
+
when: ( (ContextKeyExpr.equals('viewContainer', viewContainerModel.viewContainer.id))),
|
|
556
557
|
order: index,
|
|
557
558
|
}, {
|
|
558
559
|
id: MenuId.ViewContainerTitleContext,
|
|
559
|
-
when: ( ContextKeyExpr.and(
|
|
560
|
+
when: ( (ContextKeyExpr.and(
|
|
561
|
+
(ContextKeyExpr.equals('viewContainer', viewContainerModel.viewContainer.id))
|
|
562
|
+
))),
|
|
560
563
|
order: index,
|
|
561
564
|
group: '1_toggleVisibility'
|
|
562
565
|
}, {
|
|
563
566
|
id: MenuId.ViewTitleContext,
|
|
564
|
-
when: ( ContextKeyExpr.and((
|
|
567
|
+
when: ( (ContextKeyExpr.and( (ContextKeyExpr.or(
|
|
568
|
+
...( (viewContainerModel.visibleViewDescriptors.map(v => ( (ContextKeyExpr.equals('view', v.id))))))
|
|
569
|
+
))))),
|
|
565
570
|
order: index,
|
|
566
571
|
group: '2_toggleVisibility'
|
|
567
572
|
}]
|
|
@@ -576,16 +581,14 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
576
581
|
super({
|
|
577
582
|
id: `${viewDescriptor.id}.removeView`,
|
|
578
583
|
viewPaneContainerId: viewContainerModel.viewContainer.id,
|
|
579
|
-
title: ( localizeWithPath(
|
|
580
|
-
|
|
581
|
-
'hideView',
|
|
582
|
-
"Hide '{0}'",
|
|
583
|
-
viewDescriptor.name.value
|
|
584
|
-
)),
|
|
585
|
-
precondition: viewDescriptor.canToggleVisibility && (!viewContainerModel.isVisible(viewDescriptor.id) || viewContainerModel.visibleViewDescriptors.length > 1) ? ContextKeyExpr.true() : ( ContextKeyExpr.false()),
|
|
584
|
+
title: ( localizeWithPath(_moduleId, 0, "Hide '{0}'", viewDescriptor.name.value)),
|
|
585
|
+
precondition: viewDescriptor.canToggleVisibility && (!viewContainerModel.isVisible(viewDescriptor.id) || viewContainerModel.visibleViewDescriptors.length > 1) ? ContextKeyExpr.true() : ( (ContextKeyExpr.false())),
|
|
586
586
|
menu: [{
|
|
587
587
|
id: MenuId.ViewTitleContext,
|
|
588
|
-
when: ( ContextKeyExpr.and(
|
|
588
|
+
when: ( (ContextKeyExpr.and(
|
|
589
|
+
(ContextKeyExpr.equals('view', viewDescriptor.id)),
|
|
590
|
+
(ContextKeyExpr.has(`${viewDescriptor.id}.visible`))
|
|
591
|
+
))),
|
|
589
592
|
group: '1_hide',
|
|
590
593
|
order: 1
|
|
591
594
|
}]
|
|
@@ -605,14 +608,13 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
605
608
|
constructor() {
|
|
606
609
|
super({
|
|
607
610
|
id: `${viewContainer.id}.resetViewContainerLocation`,
|
|
608
|
-
title: ( localize2WithPath(
|
|
609
|
-
'vs/workbench/services/views/browser/viewDescriptorService',
|
|
610
|
-
'resetViewLocation',
|
|
611
|
-
"Reset Location"
|
|
612
|
-
)),
|
|
611
|
+
title: ( localize2WithPath(_moduleId, 1, "Reset Location")),
|
|
613
612
|
menu: [{
|
|
614
613
|
id: MenuId.ViewContainerTitleContext,
|
|
615
|
-
when: ( ContextKeyExpr.or((
|
|
614
|
+
when: ( (ContextKeyExpr.or( (ContextKeyExpr.and(
|
|
615
|
+
(ContextKeyExpr.equals('viewContainer', viewContainer.id)),
|
|
616
|
+
(ContextKeyExpr.equals(`${viewContainer.id}.defaultViewContainerLocation`, false))
|
|
617
|
+
)))))
|
|
616
618
|
}],
|
|
617
619
|
});
|
|
618
620
|
}
|
|
@@ -634,13 +636,13 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
634
636
|
}
|
|
635
637
|
});
|
|
636
638
|
});
|
|
637
|
-
this.getViewContainerModel(container).add(( views.map(view => {
|
|
639
|
+
this.getViewContainerModel(container).add(( (views.map(view => {
|
|
638
640
|
return {
|
|
639
641
|
viewDescriptor: view,
|
|
640
642
|
collapsed: visibilityState === ViewVisibilityState.Default ? undefined : false,
|
|
641
643
|
visible: visibilityState === ViewVisibilityState.Default ? undefined : true
|
|
642
644
|
};
|
|
643
|
-
})));
|
|
645
|
+
}))));
|
|
644
646
|
}
|
|
645
647
|
removeViews(container, views) {
|
|
646
648
|
this.contextKeyService.bufferChangeEvents(() => {
|
|
@@ -657,7 +659,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
657
659
|
const activeContextKeyId = `${viewDescriptor.id}.active`;
|
|
658
660
|
let contextKey = this.activeViewContextKeys.get(activeContextKeyId);
|
|
659
661
|
if (!contextKey) {
|
|
660
|
-
contextKey = ( new RawContextKey(activeContextKeyId, false)).bindTo(this.contextKeyService);
|
|
662
|
+
contextKey = ( (new RawContextKey(activeContextKeyId, false))).bindTo(this.contextKeyService);
|
|
661
663
|
this.activeViewContextKeys.set(activeContextKeyId, contextKey);
|
|
662
664
|
}
|
|
663
665
|
return contextKey;
|
|
@@ -666,7 +668,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
666
668
|
const activeContextKeyId = `${viewDescriptor.id}.visible`;
|
|
667
669
|
let contextKey = this.activeViewContextKeys.get(activeContextKeyId);
|
|
668
670
|
if (!contextKey) {
|
|
669
|
-
contextKey = ( new RawContextKey(activeContextKeyId, false)).bindTo(this.contextKeyService);
|
|
671
|
+
contextKey = ( (new RawContextKey(activeContextKeyId, false))).bindTo(this.contextKeyService);
|
|
670
672
|
this.activeViewContextKeys.set(activeContextKeyId, contextKey);
|
|
671
673
|
}
|
|
672
674
|
return contextKey;
|
|
@@ -675,7 +677,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
675
677
|
const movableViewContextKeyId = `${viewDescriptor.id}.canMove`;
|
|
676
678
|
let contextKey = this.movableViewContextKeys.get(movableViewContextKeyId);
|
|
677
679
|
if (!contextKey) {
|
|
678
|
-
contextKey = ( new RawContextKey(movableViewContextKeyId, false)).bindTo(this.contextKeyService);
|
|
680
|
+
contextKey = ( (new RawContextKey(movableViewContextKeyId, false))).bindTo(this.contextKeyService);
|
|
679
681
|
this.movableViewContextKeys.set(movableViewContextKeyId, contextKey);
|
|
680
682
|
}
|
|
681
683
|
return contextKey;
|
|
@@ -684,7 +686,7 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
684
686
|
const defaultViewLocationContextKeyId = `${viewDescriptor.id}.defaultViewLocation`;
|
|
685
687
|
let contextKey = this.defaultViewLocationContextKeys.get(defaultViewLocationContextKeyId);
|
|
686
688
|
if (!contextKey) {
|
|
687
|
-
contextKey = ( new RawContextKey(defaultViewLocationContextKeyId, false)).bindTo(this.contextKeyService);
|
|
689
|
+
contextKey = ( (new RawContextKey(defaultViewLocationContextKeyId, false))).bindTo(this.contextKeyService);
|
|
688
690
|
this.defaultViewLocationContextKeys.set(defaultViewLocationContextKeyId, contextKey);
|
|
689
691
|
}
|
|
690
692
|
return contextKey;
|
|
@@ -693,19 +695,19 @@ let ViewDescriptorService = class ViewDescriptorService extends Disposable {
|
|
|
693
695
|
const defaultViewContainerLocationContextKeyId = `${viewContainer.id}.defaultViewContainerLocation`;
|
|
694
696
|
let contextKey = this.defaultViewContainerLocationContextKeys.get(defaultViewContainerLocationContextKeyId);
|
|
695
697
|
if (!contextKey) {
|
|
696
|
-
contextKey = ( new RawContextKey(defaultViewContainerLocationContextKeyId, false)).bindTo(this.contextKeyService);
|
|
698
|
+
contextKey = ( (new RawContextKey(defaultViewContainerLocationContextKeyId, false))).bindTo(this.contextKeyService);
|
|
697
699
|
this.defaultViewContainerLocationContextKeys.set(defaultViewContainerLocationContextKeyId, contextKey);
|
|
698
700
|
}
|
|
699
701
|
return contextKey;
|
|
700
702
|
}
|
|
701
703
|
};
|
|
702
|
-
ViewDescriptorService = ViewDescriptorService_1 = ( __decorate([
|
|
703
|
-
( __param(0, IInstantiationService)),
|
|
704
|
-
( __param(1, IContextKeyService)),
|
|
705
|
-
( __param(2, IStorageService)),
|
|
706
|
-
( __param(3, IExtensionService)),
|
|
707
|
-
( __param(4, ITelemetryService)),
|
|
708
|
-
( __param(5, ILoggerService))
|
|
709
|
-
], ViewDescriptorService));
|
|
704
|
+
ViewDescriptorService = ViewDescriptorService_1 = ( (__decorate([
|
|
705
|
+
( (__param(0, IInstantiationService))),
|
|
706
|
+
( (__param(1, IContextKeyService))),
|
|
707
|
+
( (__param(2, IStorageService))),
|
|
708
|
+
( (__param(3, IExtensionService))),
|
|
709
|
+
( (__param(4, ITelemetryService))),
|
|
710
|
+
( (__param(5, ILoggerService)))
|
|
711
|
+
], ViewDescriptorService)));
|
|
710
712
|
|
|
711
713
|
export { ViewDescriptorService };
|
|
@@ -18,15 +18,12 @@ import { IOutputService } from 'vscode/vscode/vs/workbench/services/output/commo
|
|
|
18
18
|
import { CounterSet } from 'vscode/vscode/vs/base/common/map';
|
|
19
19
|
import { localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
20
20
|
|
|
21
|
+
const _moduleId = "vs/workbench/services/views/common/viewContainerModel";
|
|
21
22
|
registerAction2(class extends Action2 {
|
|
22
23
|
constructor() {
|
|
23
24
|
super({
|
|
24
25
|
id: '_workbench.output.showViewsLog',
|
|
25
|
-
title: ( localize2WithPath(
|
|
26
|
-
'vs/workbench/services/views/common/viewContainerModel',
|
|
27
|
-
'showViewsLog',
|
|
28
|
-
"Show Views Log"
|
|
29
|
-
)),
|
|
26
|
+
title: ( localize2WithPath(_moduleId, 0, "Show Views Log")),
|
|
30
27
|
category: Categories.Developer,
|
|
31
28
|
f1: true
|
|
32
29
|
});
|
|
@@ -44,12 +41,12 @@ let ViewDescriptorsState = class ViewDescriptorsState extends Disposable {
|
|
|
44
41
|
super();
|
|
45
42
|
this.viewContainerName = viewContainerName;
|
|
46
43
|
this.storageService = storageService;
|
|
47
|
-
this._onDidChangeStoredState = this._register(( new Emitter()));
|
|
44
|
+
this._onDidChangeStoredState = this._register(( (new Emitter())));
|
|
48
45
|
this.onDidChangeStoredState = this._onDidChangeStoredState.event;
|
|
49
46
|
this.logger = loggerService.createLogger(VIEWS_LOG_ID, { name: VIEWS_LOG_NAME, hidden: true });
|
|
50
47
|
this.globalViewsStateStorageId = getViewsStateStorageId(viewContainerStorageId);
|
|
51
48
|
this.workspaceViewsStateStorageId = viewContainerStorageId;
|
|
52
|
-
this._register(this.storageService.onDidChangeValue(0 , this.globalViewsStateStorageId, this._register(( new DisposableStore())))(() => this.onDidStorageChange()));
|
|
49
|
+
this._register(this.storageService.onDidChangeValue(0 , this.globalViewsStateStorageId, this._register(( (new DisposableStore()))))(() => this.onDidStorageChange()));
|
|
53
50
|
this.state = this.initialize();
|
|
54
51
|
}
|
|
55
52
|
set(id, state) {
|
|
@@ -75,7 +72,7 @@ let ViewDescriptorsState = class ViewDescriptorsState extends Disposable {
|
|
|
75
72
|
};
|
|
76
73
|
}
|
|
77
74
|
}
|
|
78
|
-
if (( Object.keys(storedViewsStates)).length > 0) {
|
|
75
|
+
if (( (Object.keys(storedViewsStates))).length > 0) {
|
|
79
76
|
this.storageService.store(this.workspaceViewsStateStorageId, JSON.stringify(storedViewsStates), 1 , 1 );
|
|
80
77
|
}
|
|
81
78
|
else {
|
|
@@ -134,9 +131,9 @@ let ViewDescriptorsState = class ViewDescriptorsState extends Disposable {
|
|
|
134
131
|
}
|
|
135
132
|
}
|
|
136
133
|
initialize() {
|
|
137
|
-
const viewStates = ( new Map());
|
|
134
|
+
const viewStates = ( (new Map()));
|
|
138
135
|
const workspaceViewsStates = this.getStoredWorkspaceState();
|
|
139
|
-
for (const id of ( Object.keys(workspaceViewsStates))) {
|
|
136
|
+
for (const id of ( (Object.keys(workspaceViewsStates)))) {
|
|
140
137
|
const workspaceViewState = workspaceViewsStates[id];
|
|
141
138
|
viewStates.set(id, {
|
|
142
139
|
active: false,
|
|
@@ -150,7 +147,7 @@ let ViewDescriptorsState = class ViewDescriptorsState extends Disposable {
|
|
|
150
147
|
const value = this.storageService.get(this.globalViewsStateStorageId, 1 , '[]');
|
|
151
148
|
const { state: workspaceVisibilityStates } = this.parseStoredGlobalState(value);
|
|
152
149
|
if (workspaceVisibilityStates.size > 0) {
|
|
153
|
-
for (const { id, isHidden } of ( workspaceVisibilityStates.values())) {
|
|
150
|
+
for (const { id, isHidden } of ( (workspaceVisibilityStates.values()))) {
|
|
154
151
|
const viewState = viewStates.get(id);
|
|
155
152
|
if (viewState) {
|
|
156
153
|
if (isUndefined(viewState.visibleWorkspace)) {
|
|
@@ -172,7 +169,7 @@ let ViewDescriptorsState = class ViewDescriptorsState extends Disposable {
|
|
|
172
169
|
if (hasDuplicates) {
|
|
173
170
|
this.setStoredGlobalState(state);
|
|
174
171
|
}
|
|
175
|
-
for (const { id, isHidden, order } of ( state.values())) {
|
|
172
|
+
for (const { id, isHidden, order } of ( (state.values()))) {
|
|
176
173
|
const viewState = viewStates.get(id);
|
|
177
174
|
if (viewState) {
|
|
178
175
|
viewState.visibleGlobal = !isHidden;
|
|
@@ -199,22 +196,22 @@ let ViewDescriptorsState = class ViewDescriptorsState extends Disposable {
|
|
|
199
196
|
return this.parseStoredGlobalState(this.globalViewsStatesValue).state;
|
|
200
197
|
}
|
|
201
198
|
setStoredGlobalState(storedGlobalState) {
|
|
202
|
-
this.globalViewsStatesValue = JSON.stringify([...( storedGlobalState.values())]);
|
|
199
|
+
this.globalViewsStatesValue = JSON.stringify([...( (storedGlobalState.values()))]);
|
|
203
200
|
}
|
|
204
201
|
parseStoredGlobalState(value) {
|
|
205
202
|
const storedValue = JSON.parse(value);
|
|
206
203
|
let hasDuplicates = false;
|
|
207
204
|
const state = storedValue.reduce((result, storedState) => {
|
|
208
205
|
if (typeof storedState === 'string' ) {
|
|
209
|
-
hasDuplicates = hasDuplicates || ( result.has(storedState));
|
|
206
|
+
hasDuplicates = hasDuplicates || ( (result.has(storedState)));
|
|
210
207
|
result.set(storedState, { id: storedState, isHidden: true });
|
|
211
208
|
}
|
|
212
209
|
else {
|
|
213
|
-
hasDuplicates = hasDuplicates || ( result.has(storedState.id));
|
|
210
|
+
hasDuplicates = hasDuplicates || ( (result.has(storedState.id)));
|
|
214
211
|
result.set(storedState.id, storedState);
|
|
215
212
|
}
|
|
216
213
|
return result;
|
|
217
|
-
}, ( new Map()));
|
|
214
|
+
}, ( (new Map())));
|
|
218
215
|
return { state, hasDuplicates };
|
|
219
216
|
}
|
|
220
217
|
get globalViewsStatesValue() {
|
|
@@ -236,34 +233,40 @@ let ViewDescriptorsState = class ViewDescriptorsState extends Disposable {
|
|
|
236
233
|
this.storageService.store(this.globalViewsStateStorageId, value, 0 , 0 );
|
|
237
234
|
}
|
|
238
235
|
};
|
|
239
|
-
ViewDescriptorsState = ( __decorate([
|
|
240
|
-
( __param(2, IStorageService)),
|
|
241
|
-
( __param(3, ILoggerService))
|
|
242
|
-
], ViewDescriptorsState));
|
|
236
|
+
ViewDescriptorsState = ( (__decorate([
|
|
237
|
+
( (__param(2, IStorageService))),
|
|
238
|
+
( (__param(3, ILoggerService)))
|
|
239
|
+
], ViewDescriptorsState)));
|
|
243
240
|
let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
244
241
|
get title() { return this._title; }
|
|
245
242
|
get icon() { return this._icon; }
|
|
246
243
|
get keybindingId() { return this._keybindingId; }
|
|
247
|
-
get allViewDescriptors() { return (
|
|
248
|
-
|
|
249
|
-
|
|
244
|
+
get allViewDescriptors() { return (
|
|
245
|
+
(this.viewDescriptorItems.map(item => item.viewDescriptor))
|
|
246
|
+
); }
|
|
247
|
+
get activeViewDescriptors() { return (
|
|
248
|
+
(this.viewDescriptorItems.filter(item => item.state.active).map(item => item.viewDescriptor))
|
|
249
|
+
); }
|
|
250
|
+
get visibleViewDescriptors() { return (
|
|
251
|
+
(this.viewDescriptorItems.filter(item => this.isViewDescriptorVisible(item)).map(item => item.viewDescriptor))
|
|
252
|
+
); }
|
|
250
253
|
constructor(viewContainer, instantiationService, contextKeyService, loggerService) {
|
|
251
254
|
super();
|
|
252
255
|
this.viewContainer = viewContainer;
|
|
253
256
|
this.contextKeyService = contextKeyService;
|
|
254
|
-
this.contextKeys = ( new CounterSet());
|
|
257
|
+
this.contextKeys = ( (new CounterSet()));
|
|
255
258
|
this.viewDescriptorItems = [];
|
|
256
|
-
this._onDidChangeContainerInfo = this._register(( new Emitter()));
|
|
259
|
+
this._onDidChangeContainerInfo = this._register(( (new Emitter())));
|
|
257
260
|
this.onDidChangeContainerInfo = this._onDidChangeContainerInfo.event;
|
|
258
|
-
this._onDidChangeAllViewDescriptors = this._register(( new Emitter()));
|
|
261
|
+
this._onDidChangeAllViewDescriptors = this._register(( (new Emitter())));
|
|
259
262
|
this.onDidChangeAllViewDescriptors = this._onDidChangeAllViewDescriptors.event;
|
|
260
|
-
this._onDidChangeActiveViewDescriptors = this._register(( new Emitter()));
|
|
263
|
+
this._onDidChangeActiveViewDescriptors = this._register(( (new Emitter())));
|
|
261
264
|
this.onDidChangeActiveViewDescriptors = this._onDidChangeActiveViewDescriptors.event;
|
|
262
|
-
this._onDidAddVisibleViewDescriptors = this._register(( new Emitter()));
|
|
265
|
+
this._onDidAddVisibleViewDescriptors = this._register(( (new Emitter())));
|
|
263
266
|
this.onDidAddVisibleViewDescriptors = this._onDidAddVisibleViewDescriptors.event;
|
|
264
|
-
this._onDidRemoveVisibleViewDescriptors = this._register(( new Emitter()));
|
|
267
|
+
this._onDidRemoveVisibleViewDescriptors = this._register(( (new Emitter())));
|
|
265
268
|
this.onDidRemoveVisibleViewDescriptors = this._onDidRemoveVisibleViewDescriptors.event;
|
|
266
|
-
this._onDidMoveVisibleViewDescriptors = this._register(( new Emitter()));
|
|
269
|
+
this._onDidMoveVisibleViewDescriptors = this._register(( (new Emitter())));
|
|
267
270
|
this.onDidMoveVisibleViewDescriptors = this._onDidMoveVisibleViewDescriptors.event;
|
|
268
271
|
this.logger = loggerService.createLogger(VIEWS_LOG_ID, { name: VIEWS_LOG_NAME, hidden: true });
|
|
269
272
|
this._register(Event.filter(contextKeyService.onDidChangeContext, e => e.affectsSome(this.contextKeys))(() => this.onDidChangeContext()));
|
|
@@ -272,7 +275,9 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
|
272
275
|
this.updateContainerInfo();
|
|
273
276
|
}
|
|
274
277
|
updateContainerInfo() {
|
|
275
|
-
const useDefaultContainerInfo = this.viewContainer.alwaysUseContainerInfo || this.visibleViewDescriptors.length === 0 || ( this.visibleViewDescriptors.some(
|
|
278
|
+
const useDefaultContainerInfo = this.viewContainer.alwaysUseContainerInfo || this.visibleViewDescriptors.length === 0 || ( (this.visibleViewDescriptors.some(
|
|
279
|
+
v => ( (Registry.as(Extensions.ViewsRegistry))).getViewContainer(v.id) === this.viewContainer
|
|
280
|
+
)));
|
|
276
281
|
const title = useDefaultContainerInfo ? (typeof this.viewContainer.title === 'string' ? this.viewContainer.title : this.viewContainer.title.value) : this.visibleViewDescriptors[0]?.containerTitle || this.visibleViewDescriptors[0]?.name?.value || '';
|
|
277
282
|
let titleChanged = false;
|
|
278
283
|
if (this._title !== title) {
|
|
@@ -307,7 +312,7 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
|
307
312
|
isVisible(id) {
|
|
308
313
|
const viewDescriptorItem = this.viewDescriptorItems.find(v => v.viewDescriptor.id === id);
|
|
309
314
|
if (!viewDescriptorItem) {
|
|
310
|
-
throw new Error(`Unknown view ${id}`);
|
|
315
|
+
throw ( (new Error(`Unknown view ${id}`)));
|
|
311
316
|
}
|
|
312
317
|
return this.isViewDescriptorVisible(viewDescriptorItem);
|
|
313
318
|
}
|
|
@@ -315,8 +320,8 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
|
315
320
|
this.updateVisibility([{ id, visible }]);
|
|
316
321
|
}
|
|
317
322
|
updateVisibility(viewDescriptors) {
|
|
318
|
-
const viewDescriptorItemsToHide = coalesce(( viewDescriptors.filter(({ visible }) => !visible)
|
|
319
|
-
.map(({ id }) => this.findAndIgnoreIfNotFound(id))));
|
|
323
|
+
const viewDescriptorItemsToHide = coalesce(( (viewDescriptors.filter(({ visible }) => !visible)
|
|
324
|
+
.map(({ id }) => this.findAndIgnoreIfNotFound(id)))));
|
|
320
325
|
const removed = [];
|
|
321
326
|
for (const { viewDescriptorItem, visibleIndex } of viewDescriptorItemsToHide) {
|
|
322
327
|
if (this.updateViewDescriptorItemVisibility(viewDescriptorItem, false)) {
|
|
@@ -400,7 +405,7 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
|
400
405
|
for (const addedViewDescriptorState of addedViewDescriptorStates) {
|
|
401
406
|
const viewDescriptor = addedViewDescriptorState.viewDescriptor;
|
|
402
407
|
if (viewDescriptor.when) {
|
|
403
|
-
for (const key of ( viewDescriptor.when.keys())) {
|
|
408
|
+
for (const key of ( (viewDescriptor.when.keys()))) {
|
|
404
409
|
this.contextKeys.add(key);
|
|
405
410
|
}
|
|
406
411
|
}
|
|
@@ -432,7 +437,7 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
|
432
437
|
}
|
|
433
438
|
this.viewDescriptorItems.push(...addedItems);
|
|
434
439
|
this.viewDescriptorItems.sort(this.compareViewDescriptors.bind(this));
|
|
435
|
-
this._onDidChangeAllViewDescriptors.fire({ added: ( addedItems.map(({ viewDescriptor }) => viewDescriptor)), removed: [] });
|
|
440
|
+
this._onDidChangeAllViewDescriptors.fire({ added: ( (addedItems.map(({ viewDescriptor }) => viewDescriptor))), removed: [] });
|
|
436
441
|
const addedActiveItems = [];
|
|
437
442
|
for (const viewDescriptorItem of addedItems) {
|
|
438
443
|
if (viewDescriptorItem.state.active) {
|
|
@@ -440,7 +445,7 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
|
440
445
|
}
|
|
441
446
|
}
|
|
442
447
|
if (addedActiveItems.length) {
|
|
443
|
-
this._onDidChangeActiveViewDescriptors.fire(({ added: ( addedActiveItems.map(({ viewDescriptorItem }) => viewDescriptorItem.viewDescriptor)), removed: [] }));
|
|
448
|
+
this._onDidChangeActiveViewDescriptors.fire(({ added: ( (addedActiveItems.map(({ viewDescriptorItem }) => viewDescriptorItem.viewDescriptor))), removed: [] }));
|
|
444
449
|
}
|
|
445
450
|
const addedVisibleDescriptors = [];
|
|
446
451
|
for (const { viewDescriptorItem, visible } of addedActiveItems) {
|
|
@@ -458,7 +463,7 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
|
458
463
|
const removedVisibleDescriptors = [];
|
|
459
464
|
for (const viewDescriptor of viewDescriptors) {
|
|
460
465
|
if (viewDescriptor.when) {
|
|
461
|
-
for (const key of ( viewDescriptor.when.keys())) {
|
|
466
|
+
for (const key of ( (viewDescriptor.when.keys()))) {
|
|
462
467
|
this.contextKeys.delete(key);
|
|
463
468
|
}
|
|
464
469
|
}
|
|
@@ -511,7 +516,7 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
|
511
516
|
addedActiveItems.forEach(({ item }) => item.state.active = true);
|
|
512
517
|
this.broadCastRemovedVisibleViewDescriptors(removedVisibleDescriptors);
|
|
513
518
|
if (addedActiveItems.length || removedActiveItems.length) {
|
|
514
|
-
this._onDidChangeActiveViewDescriptors.fire(({ added: ( addedActiveItems.map(({ item }) => item.viewDescriptor)), removed: ( removedActiveItems.map(item => item.viewDescriptor)) }));
|
|
519
|
+
this._onDidChangeActiveViewDescriptors.fire(({ added: ( (addedActiveItems.map(({ item }) => item.viewDescriptor))), removed: ( (removedActiveItems.map(item => item.viewDescriptor))) }));
|
|
515
520
|
}
|
|
516
521
|
const addedVisibleDescriptors = [];
|
|
517
522
|
for (const { item, visibleWhenActive } of addedActiveItems) {
|
|
@@ -525,13 +530,13 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
|
525
530
|
broadCastAddedVisibleViewDescriptors(added) {
|
|
526
531
|
if (added.length) {
|
|
527
532
|
this._onDidAddVisibleViewDescriptors.fire(added.sort((a, b) => a.index - b.index));
|
|
528
|
-
this.updateState(`Added views:${( added.map(v => v.viewDescriptor.id)).join(',')} in ${this.viewContainer.id}`);
|
|
533
|
+
this.updateState(`Added views:${( (added.map(v => v.viewDescriptor.id))).join(',')} in ${this.viewContainer.id}`);
|
|
529
534
|
}
|
|
530
535
|
}
|
|
531
536
|
broadCastRemovedVisibleViewDescriptors(removed) {
|
|
532
537
|
if (removed.length) {
|
|
533
538
|
this._onDidRemoveVisibleViewDescriptors.fire(removed.sort((a, b) => b.index - a.index));
|
|
534
|
-
this.updateState(`Removed views:${( removed.map(v => v.viewDescriptor.id)).join(',')} from ${this.viewContainer.id}`);
|
|
539
|
+
this.updateState(`Removed views:${( (removed.map(v => v.viewDescriptor.id))).join(',')} from ${this.viewContainer.id}`);
|
|
535
540
|
}
|
|
536
541
|
}
|
|
537
542
|
broadCastMovedViewDescriptors(from, to) {
|
|
@@ -560,7 +565,7 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
|
560
565
|
if (result) {
|
|
561
566
|
return result;
|
|
562
567
|
}
|
|
563
|
-
throw new Error(`view descriptor ${id} not found`);
|
|
568
|
+
throw ( (new Error(`view descriptor ${id} not found`)));
|
|
564
569
|
}
|
|
565
570
|
findAndIgnoreIfNotFound(id) {
|
|
566
571
|
for (let i = 0, visibleIndex = 0; i < this.viewDescriptorItems.length; i++) {
|
|
@@ -594,10 +599,10 @@ let ViewContainerModel = class ViewContainerModel extends Disposable {
|
|
|
594
599
|
return a.group < b.group ? -1 : 1;
|
|
595
600
|
}
|
|
596
601
|
};
|
|
597
|
-
ViewContainerModel = ( __decorate([
|
|
598
|
-
( __param(1, IInstantiationService)),
|
|
599
|
-
( __param(2, IContextKeyService)),
|
|
600
|
-
( __param(3, ILoggerService))
|
|
601
|
-
], ViewContainerModel));
|
|
602
|
+
ViewContainerModel = ( (__decorate([
|
|
603
|
+
( (__param(1, IInstantiationService))),
|
|
604
|
+
( (__param(2, IContextKeyService))),
|
|
605
|
+
( (__param(3, ILoggerService)))
|
|
606
|
+
], ViewContainerModel)));
|
|
602
607
|
|
|
603
608
|
export { ViewContainerModel, getViewsStateStorageId };
|