@codingame/monaco-vscode-view-common-service-override 5.3.0 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/viewCommon.js +1 -1
- package/vscode/src/vs/base/browser/ui/centered/centeredViewLayout.js +2 -1
- package/vscode/src/vs/base/browser/ui/grid/grid.js +34 -24
- package/vscode/src/vs/base/browser/ui/grid/gridview.js +35 -34
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +9 -60
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +119 -79
- package/vscode/src/vs/workbench/browser/actions/navigationActions.js +76 -64
- package/vscode/src/vs/workbench/browser/media/style.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +51 -71
- package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +21 -18
- package/vscode/src/vs/workbench/browser/parts/compositeBar.js +6 -6
- package/vscode/src/vs/workbench/browser/parts/compositePart.js +11 -8
- package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +8 -7
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +112 -107
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +36 -30
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +75 -69
- package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +143 -25
- package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +20 -16
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +13 -11
- package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +5 -4
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +8 -5
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarActions.js +9 -6
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +51 -37
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +28 -25
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +23 -13
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +5 -5
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +3 -2
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +2 -1
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +34 -23
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +3 -2
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.js +7 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +3 -2
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +1 -0
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +17 -15
- package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +2 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +2 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +4 -3
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +7 -7
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +2 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +2 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +9 -8
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +2 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +11 -6
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +24 -23
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +3 -2
- package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +5 -4
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +2 -1
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +26 -23
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +23 -13
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +5 -5
- package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +2 -2
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +7 -6
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +8 -6
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +10 -8
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +3 -2
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +4 -3
- package/vscode/src/vs/workbench/services/activity/browser/activityService.js +1 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorPaneService.js +1 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +21 -19
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +73 -63
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +19 -15
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.js +1 -0
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +23 -18
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +20 -14
- package/vscode/src/vs/base/browser/deviceAccess.js +0 -61
- package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +0 -13
- package/vscode/src/vs/workbench/browser/window.js +0 -330
- package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +0 -371
- package/vscode/src/vs/workbench/services/driver/browser/driver.js +0 -188
|
@@ -1,39 +1,45 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
+
import { GroupsOrder, GroupLocation } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
3
4
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
4
5
|
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
5
|
-
import { DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
6
|
+
import { DisposableMap, DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
6
7
|
import { MainEditorPart } from './editorPart.js';
|
|
8
|
+
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
7
9
|
import { firstOrDefault, distinct } from 'vscode/vscode/vs/base/common/arrays';
|
|
8
10
|
import { AuxiliaryEditorPart } from './auxiliaryEditorPart.js';
|
|
9
11
|
import { MultiWindowParts } from 'vscode/vscode/vs/workbench/browser/part';
|
|
10
12
|
import { DeferredPromise } from 'vscode/vscode/vs/base/common/async';
|
|
13
|
+
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
11
14
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
12
15
|
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
|
|
13
16
|
import { IAuxiliaryWindowService } from 'vscode/vscode/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.service';
|
|
14
17
|
import { generateUuid } from 'vscode/vscode/vs/base/common/uuid';
|
|
18
|
+
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
19
|
+
import { isHTMLElement } from 'vscode/vscode/vs/base/browser/dom';
|
|
15
20
|
|
|
16
21
|
var EditorParts_1;
|
|
17
22
|
const _moduleId = "vs/workbench/browser/parts/editor/editorParts";
|
|
18
23
|
let EditorParts = class EditorParts extends MultiWindowParts {
|
|
19
24
|
static { EditorParts_1 = this; }
|
|
20
|
-
constructor(instantiationService, storageService, themeService, auxiliaryWindowService) {
|
|
25
|
+
constructor(instantiationService, storageService, themeService, auxiliaryWindowService, contextKeyService) {
|
|
21
26
|
super('workbench.editorParts', themeService, storageService);
|
|
22
27
|
this.instantiationService = instantiationService;
|
|
23
28
|
this.storageService = storageService;
|
|
24
29
|
this.auxiliaryWindowService = auxiliaryWindowService;
|
|
30
|
+
this.contextKeyService = contextKeyService;
|
|
25
31
|
this.mainPart = this._register(this.createMainEditorPart());
|
|
26
32
|
this.mostRecentActiveParts = [this.mainPart];
|
|
27
33
|
this._onDidCreateAuxiliaryEditorPart = this._register(( (new Emitter())));
|
|
28
34
|
this.onDidCreateAuxiliaryEditorPart = this._onDidCreateAuxiliaryEditorPart.event;
|
|
29
|
-
this.workspaceMemento = this.getMemento(
|
|
35
|
+
this.workspaceMemento = this.getMemento(StorageScope.WORKSPACE, StorageTarget.USER);
|
|
30
36
|
this._isReady = false;
|
|
31
37
|
this.whenReadyPromise = ( (new DeferredPromise()));
|
|
32
38
|
this.whenReady = this.whenReadyPromise.p;
|
|
33
39
|
this.whenRestoredPromise = ( (new DeferredPromise()));
|
|
34
40
|
this.whenRestored = this.whenRestoredPromise.p;
|
|
35
41
|
this.editorWorkingSets = (() => {
|
|
36
|
-
const workingSetsRaw = this.storageService.get(EditorParts_1.EDITOR_WORKING_SETS_STORAGE_KEY,
|
|
42
|
+
const workingSetsRaw = this.storageService.get(EditorParts_1.EDITOR_WORKING_SETS_STORAGE_KEY, StorageScope.WORKSPACE);
|
|
37
43
|
if (workingSetsRaw) {
|
|
38
44
|
return JSON.parse(workingSetsRaw);
|
|
39
45
|
}
|
|
@@ -55,12 +61,18 @@ let EditorParts = class EditorParts extends MultiWindowParts {
|
|
|
55
61
|
this.onDidChangeGroupLocked = this._onDidChangeGroupLocked.event;
|
|
56
62
|
this._onDidChangeGroupMaximized = this._register(( (new Emitter())));
|
|
57
63
|
this.onDidChangeGroupMaximized = this._onDidChangeGroupMaximized.event;
|
|
64
|
+
this.globalContextKeys = ( (new Map()));
|
|
65
|
+
this.scopedContextKeys = ( (new Map()));
|
|
66
|
+
this.contextKeyProviders = ( (new Map()));
|
|
67
|
+
this.registeredContextKeys = ( (new Map()));
|
|
68
|
+
this.contextKeyProviderDisposables = this._register(( (new DisposableMap())));
|
|
58
69
|
this._register(this.registerPart(this.mainPart));
|
|
59
70
|
this.restoreParts();
|
|
60
71
|
this.registerListeners();
|
|
61
72
|
}
|
|
62
73
|
registerListeners() {
|
|
63
|
-
this._register(this.onDidChangeMementoValue(
|
|
74
|
+
this._register(this.onDidChangeMementoValue(StorageScope.WORKSPACE, this._store)(e => this.onDidChangeMementoState(e)));
|
|
75
|
+
this.whenReady.then(() => this.registerGroupsContextKeyListeners());
|
|
64
76
|
}
|
|
65
77
|
createMainEditorPart() {
|
|
66
78
|
return this.instantiationService.createInstance(MainEditorPart, this);
|
|
@@ -118,7 +130,7 @@ let EditorParts = class EditorParts extends MultiWindowParts {
|
|
|
118
130
|
}
|
|
119
131
|
getPart(groupOrElement) {
|
|
120
132
|
if (this._parts.size > 1) {
|
|
121
|
-
if (groupOrElement
|
|
133
|
+
if (isHTMLElement(groupOrElement)) {
|
|
122
134
|
const element = groupOrElement;
|
|
123
135
|
return this.getPartByDocument(element.ownerDocument);
|
|
124
136
|
}
|
|
@@ -203,7 +215,7 @@ let EditorParts = class EditorParts extends MultiWindowParts {
|
|
|
203
215
|
);
|
|
204
216
|
}
|
|
205
217
|
onDidChangeMementoState(e) {
|
|
206
|
-
if (e.external && e.scope ===
|
|
218
|
+
if (e.external && e.scope === StorageScope.WORKSPACE) {
|
|
207
219
|
this.reloadMemento(e.scope);
|
|
208
220
|
const state = this.loadState();
|
|
209
221
|
if (state) {
|
|
@@ -216,7 +228,7 @@ let EditorParts = class EditorParts extends MultiWindowParts {
|
|
|
216
228
|
if (part === this.mainPart) {
|
|
217
229
|
continue;
|
|
218
230
|
}
|
|
219
|
-
for (const group of part.getGroups(
|
|
231
|
+
for (const group of part.getGroups(GroupsOrder.MOST_RECENTLY_ACTIVE)) {
|
|
220
232
|
await group.closeAllEditors({ excludeConfirming: true });
|
|
221
233
|
}
|
|
222
234
|
const closed = part.close();
|
|
@@ -256,7 +268,7 @@ let EditorParts = class EditorParts extends MultiWindowParts {
|
|
|
256
268
|
this.saveWorkingSets();
|
|
257
269
|
}
|
|
258
270
|
}
|
|
259
|
-
async applyWorkingSet(workingSet) {
|
|
271
|
+
async applyWorkingSet(workingSet, options) {
|
|
260
272
|
let workingSetState;
|
|
261
273
|
if (workingSet === 'empty') {
|
|
262
274
|
workingSetState = 'empty';
|
|
@@ -271,11 +283,13 @@ let EditorParts = class EditorParts extends MultiWindowParts {
|
|
|
271
283
|
if (!applied) {
|
|
272
284
|
return false;
|
|
273
285
|
}
|
|
274
|
-
await this.mainPart.applyState(workingSetState === 'empty' ? workingSetState : workingSetState.main);
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
286
|
+
await this.mainPart.applyState(workingSetState === 'empty' ? workingSetState : workingSetState.main, options);
|
|
287
|
+
if (!options?.preserveFocus) {
|
|
288
|
+
const mostRecentActivePart = firstOrDefault(this.mostRecentActiveParts);
|
|
289
|
+
if (mostRecentActivePart) {
|
|
290
|
+
await mostRecentActivePart.whenReady;
|
|
291
|
+
mostRecentActivePart.activeGroup.focus();
|
|
292
|
+
}
|
|
279
293
|
}
|
|
280
294
|
return true;
|
|
281
295
|
}
|
|
@@ -288,7 +302,7 @@ let EditorParts = class EditorParts extends MultiWindowParts {
|
|
|
288
302
|
return undefined;
|
|
289
303
|
}
|
|
290
304
|
saveWorkingSets() {
|
|
291
|
-
this.storageService.store(EditorParts_1.EDITOR_WORKING_SETS_STORAGE_KEY, JSON.stringify(this.editorWorkingSets),
|
|
305
|
+
this.storageService.store(EditorParts_1.EDITOR_WORKING_SETS_STORAGE_KEY, JSON.stringify(this.editorWorkingSets), StorageScope.WORKSPACE, StorageTarget.MACHINE);
|
|
292
306
|
}
|
|
293
307
|
get activeGroup() {
|
|
294
308
|
return this.activePart.activeGroup;
|
|
@@ -302,15 +316,15 @@ let EditorParts = class EditorParts extends MultiWindowParts {
|
|
|
302
316
|
get count() {
|
|
303
317
|
return this.groups.length;
|
|
304
318
|
}
|
|
305
|
-
getGroups(order =
|
|
319
|
+
getGroups(order = GroupsOrder.CREATION_TIME) {
|
|
306
320
|
if (this._parts.size > 1) {
|
|
307
321
|
let parts;
|
|
308
322
|
switch (order) {
|
|
309
|
-
case
|
|
310
|
-
case
|
|
323
|
+
case GroupsOrder.GRID_APPEARANCE:
|
|
324
|
+
case GroupsOrder.CREATION_TIME:
|
|
311
325
|
parts = this.parts;
|
|
312
326
|
break;
|
|
313
|
-
case
|
|
327
|
+
case GroupsOrder.MOST_RECENTLY_ACTIVE:
|
|
314
328
|
parts = distinct([...this.mostRecentActiveParts, ...this.parts]);
|
|
315
329
|
break;
|
|
316
330
|
}
|
|
@@ -378,18 +392,18 @@ let EditorParts = class EditorParts extends MultiWindowParts {
|
|
|
378
392
|
findGroup(scope, source = this.activeGroup, wrap) {
|
|
379
393
|
const sourcePart = this.getPart(source);
|
|
380
394
|
if (this._parts.size > 1) {
|
|
381
|
-
const groups = this.getGroups(
|
|
382
|
-
if (scope.location ===
|
|
383
|
-
return scope.location ===
|
|
395
|
+
const groups = this.getGroups(GroupsOrder.GRID_APPEARANCE);
|
|
396
|
+
if (scope.location === GroupLocation.FIRST || scope.location === GroupLocation.LAST) {
|
|
397
|
+
return scope.location === GroupLocation.FIRST ? groups[0] : groups[groups.length - 1];
|
|
384
398
|
}
|
|
385
399
|
const group = sourcePart.findGroup(scope, source, false);
|
|
386
400
|
if (group) {
|
|
387
401
|
return group;
|
|
388
402
|
}
|
|
389
|
-
if (scope.location ===
|
|
403
|
+
if (scope.location === GroupLocation.NEXT || scope.location === GroupLocation.PREVIOUS) {
|
|
390
404
|
const sourceGroup = this.assertGroupView(source);
|
|
391
405
|
const index = groups.indexOf(sourceGroup);
|
|
392
|
-
if (scope.location ===
|
|
406
|
+
if (scope.location === GroupLocation.NEXT) {
|
|
393
407
|
let nextGroup = groups[index + 1];
|
|
394
408
|
if (!nextGroup && wrap) {
|
|
395
409
|
nextGroup = groups[0];
|
|
@@ -428,6 +442,109 @@ let EditorParts = class EditorParts extends MultiWindowParts {
|
|
|
428
442
|
createEditorDropTarget(container, delegate) {
|
|
429
443
|
return this.getPart(container).createEditorDropTarget(container, delegate);
|
|
430
444
|
}
|
|
445
|
+
registerGroupsContextKeyListeners() {
|
|
446
|
+
this._register(this.onDidChangeActiveGroup(() => this.updateGlobalContextKeys()));
|
|
447
|
+
this.groups.forEach(group => this.registerGroupContextKeyProvidersListeners(group));
|
|
448
|
+
this._register(this.onDidAddGroup(group => this.registerGroupContextKeyProvidersListeners(group)));
|
|
449
|
+
this._register(this.onDidRemoveGroup(group => {
|
|
450
|
+
this.scopedContextKeys.delete(group.id);
|
|
451
|
+
this.registeredContextKeys.delete(group.id);
|
|
452
|
+
this.contextKeyProviderDisposables.deleteAndDispose(group.id);
|
|
453
|
+
}));
|
|
454
|
+
}
|
|
455
|
+
updateGlobalContextKeys() {
|
|
456
|
+
const activeGroupScopedContextKeys = this.scopedContextKeys.get(this.activeGroup.id);
|
|
457
|
+
if (!activeGroupScopedContextKeys) {
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
for (const [key, globalContextKey] of this.globalContextKeys) {
|
|
461
|
+
const scopedContextKey = activeGroupScopedContextKeys.get(key);
|
|
462
|
+
if (scopedContextKey) {
|
|
463
|
+
globalContextKey.set(scopedContextKey.get());
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
466
|
+
globalContextKey.reset();
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
bind(contextKey, group) {
|
|
471
|
+
let globalContextKey = this.globalContextKeys.get(contextKey.key);
|
|
472
|
+
if (!globalContextKey) {
|
|
473
|
+
globalContextKey = contextKey.bindTo(this.contextKeyService);
|
|
474
|
+
this.globalContextKeys.set(contextKey.key, globalContextKey);
|
|
475
|
+
}
|
|
476
|
+
let groupScopedContextKeys = this.scopedContextKeys.get(group.id);
|
|
477
|
+
if (!groupScopedContextKeys) {
|
|
478
|
+
groupScopedContextKeys = ( (new Map()));
|
|
479
|
+
this.scopedContextKeys.set(group.id, groupScopedContextKeys);
|
|
480
|
+
}
|
|
481
|
+
let scopedContextKey = groupScopedContextKeys.get(contextKey.key);
|
|
482
|
+
if (!scopedContextKey) {
|
|
483
|
+
scopedContextKey = contextKey.bindTo(group.scopedContextKeyService);
|
|
484
|
+
groupScopedContextKeys.set(contextKey.key, scopedContextKey);
|
|
485
|
+
}
|
|
486
|
+
const that = this;
|
|
487
|
+
return {
|
|
488
|
+
get() {
|
|
489
|
+
return scopedContextKey.get();
|
|
490
|
+
},
|
|
491
|
+
set(value) {
|
|
492
|
+
if (that.activeGroup === group) {
|
|
493
|
+
globalContextKey.set(value);
|
|
494
|
+
}
|
|
495
|
+
scopedContextKey.set(value);
|
|
496
|
+
},
|
|
497
|
+
reset() {
|
|
498
|
+
if (that.activeGroup === group) {
|
|
499
|
+
globalContextKey.reset();
|
|
500
|
+
}
|
|
501
|
+
scopedContextKey.reset();
|
|
502
|
+
},
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
registerContextKeyProvider(provider) {
|
|
506
|
+
if (( (this.contextKeyProviders.has(provider.contextKey.key))) || ( (this.globalContextKeys.has(provider.contextKey.key)))) {
|
|
507
|
+
throw ( (new Error(
|
|
508
|
+
`A context key provider for key ${provider.contextKey.key} already exists.`
|
|
509
|
+
)));
|
|
510
|
+
}
|
|
511
|
+
this.contextKeyProviders.set(provider.contextKey.key, provider);
|
|
512
|
+
const setContextKeyForGroups = () => {
|
|
513
|
+
for (const group of this.groups) {
|
|
514
|
+
this.updateRegisteredContextKey(group, provider);
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
setContextKeyForGroups();
|
|
518
|
+
const onDidChange = provider.onDidChange?.(() => setContextKeyForGroups());
|
|
519
|
+
return toDisposable(() => {
|
|
520
|
+
onDidChange?.dispose();
|
|
521
|
+
this.globalContextKeys.delete(provider.contextKey.key);
|
|
522
|
+
this.scopedContextKeys.forEach(scopedContextKeys => scopedContextKeys.delete(provider.contextKey.key));
|
|
523
|
+
this.contextKeyProviders.delete(provider.contextKey.key);
|
|
524
|
+
this.registeredContextKeys.forEach(registeredContextKeys => registeredContextKeys.delete(provider.contextKey.key));
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
registerGroupContextKeyProvidersListeners(group) {
|
|
528
|
+
const disposable = group.onDidActiveEditorChange(() => {
|
|
529
|
+
for (const contextKeyProvider of ( (this.contextKeyProviders.values()))) {
|
|
530
|
+
this.updateRegisteredContextKey(group, contextKeyProvider);
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
this.contextKeyProviderDisposables.set(group.id, disposable);
|
|
534
|
+
}
|
|
535
|
+
updateRegisteredContextKey(group, provider) {
|
|
536
|
+
let groupRegisteredContextKeys = this.registeredContextKeys.get(group.id);
|
|
537
|
+
if (!groupRegisteredContextKeys) {
|
|
538
|
+
groupRegisteredContextKeys = ( (new Map()));
|
|
539
|
+
this.scopedContextKeys.set(group.id, groupRegisteredContextKeys);
|
|
540
|
+
}
|
|
541
|
+
let scopedRegisteredContextKey = groupRegisteredContextKeys.get(provider.contextKey.key);
|
|
542
|
+
if (!scopedRegisteredContextKey) {
|
|
543
|
+
scopedRegisteredContextKey = this.bind(provider.contextKey, group);
|
|
544
|
+
groupRegisteredContextKeys.set(provider.contextKey.key, scopedRegisteredContextKey);
|
|
545
|
+
}
|
|
546
|
+
scopedRegisteredContextKey.set(provider.getGroupContextKeyValue(group));
|
|
547
|
+
}
|
|
431
548
|
get partOptions() { return this.mainPart.partOptions; }
|
|
432
549
|
get onDidChangeEditorPartOptions() { return this.mainPart.onDidChangeEditorPartOptions; }
|
|
433
550
|
};
|
|
@@ -435,7 +552,8 @@ EditorParts = EditorParts_1 = ( (__decorate([
|
|
|
435
552
|
( (__param(0, IInstantiationService))),
|
|
436
553
|
( (__param(1, IStorageService))),
|
|
437
554
|
( (__param(2, IThemeService))),
|
|
438
|
-
( (__param(3, IAuxiliaryWindowService)))
|
|
555
|
+
( (__param(3, IAuxiliaryWindowService))),
|
|
556
|
+
( (__param(4, IContextKeyService)))
|
|
439
557
|
], EditorParts)));
|
|
440
558
|
|
|
441
559
|
export { EditorParts };
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
+
import { ActionsOrientation } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar';
|
|
3
4
|
import { IActivityService } from 'vscode/vscode/vs/workbench/services/activity/common/activity.service';
|
|
5
|
+
import { Parts } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
4
6
|
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
5
7
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
6
8
|
import { Disposable, DisposableMap, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
7
9
|
import { CompositeDragAndDrop, CompositeBar } from './compositeBar.js';
|
|
8
10
|
import { asCSSUrl, createCSSRule, Dimension, isMouseEvent } from 'vscode/vscode/vs/base/browser/dom';
|
|
11
|
+
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
9
12
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
10
13
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
11
14
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
12
15
|
import { ToggleCompositePinnedAction, ToggleCompositeBadgeAction, CompositeBarAction } from 'vscode/vscode/vs/workbench/browser/parts/compositeBarActions';
|
|
16
|
+
import { ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
|
|
13
17
|
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views.service';
|
|
14
18
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
15
19
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
@@ -41,15 +45,15 @@ let PaneCompositeBar = class PaneCompositeBar extends Disposable {
|
|
|
41
45
|
this.compositeActions = ( (new Map()));
|
|
42
46
|
this.hasExtensionsRegistered = false;
|
|
43
47
|
this._cachedViewContainers = undefined;
|
|
44
|
-
this.location = paneCompositePart.partId ===
|
|
45
|
-
?
|
|
46
|
-
?
|
|
48
|
+
this.location = paneCompositePart.partId === Parts.PANEL_PART
|
|
49
|
+
? ViewContainerLocation.Panel : paneCompositePart.partId === Parts.AUXILIARYBAR_PART
|
|
50
|
+
? ViewContainerLocation.AuxiliaryBar : ViewContainerLocation.Sidebar;
|
|
47
51
|
this.dndHandler = ( (new CompositeDragAndDrop(
|
|
48
52
|
this.viewDescriptorService,
|
|
49
53
|
this.location,
|
|
50
54
|
this.options.orientation,
|
|
51
55
|
async (id, focus) => { return (await this.paneCompositePart.openPaneComposite(id, focus)) ?? null; },
|
|
52
|
-
(from, to, before) => this.compositeBar.move(from, to, this.options.orientation ===
|
|
56
|
+
(from, to, before) => this.compositeBar.move(from, to, this.options.orientation === ActionsOrientation.VERTICAL ? before?.verticallyBefore : before?.horizontallyBefore),
|
|
53
57
|
() => this.compositeBar.getCompositeBarItems()
|
|
54
58
|
)));
|
|
55
59
|
const cachedItems = ( (this.cachedViewContainers
|
|
@@ -117,7 +121,7 @@ let PaneCompositeBar = class PaneCompositeBar extends Disposable {
|
|
|
117
121
|
}
|
|
118
122
|
this.onDidRegisterExtensions();
|
|
119
123
|
this._register(this.compositeBar.onDidChange(() => this.saveCachedViewContainers()));
|
|
120
|
-
this._register(this.storageService.onDidChangeValue(
|
|
124
|
+
this._register(this.storageService.onDidChangeValue(StorageScope.PROFILE, this.options.pinnedViewContainersKey, this._store)(e => this.onDidPinnedViewContainersStorageValueChange(e)));
|
|
121
125
|
});
|
|
122
126
|
}
|
|
123
127
|
onDidChangeViewContainers(added, removed) {
|
|
@@ -285,7 +289,7 @@ let PaneCompositeBar = class PaneCompositeBar extends Disposable {
|
|
|
285
289
|
return false;
|
|
286
290
|
}
|
|
287
291
|
}
|
|
288
|
-
if (!this.hasExtensionsRegistered && !(this.part ===
|
|
292
|
+
if (!this.hasExtensionsRegistered && !(this.part === Parts.SIDEBAR_PART && this.environmentService.remoteAuthority && isNative)) {
|
|
289
293
|
cachedViewContainer = cachedViewContainer || this.cachedViewContainers.find(({ id }) => id === viewContainerId);
|
|
290
294
|
if (!viewContainer && cachedViewContainer?.isBuiltin && cachedViewContainer?.visible) {
|
|
291
295
|
return false;
|
|
@@ -451,7 +455,7 @@ let PaneCompositeBar = class PaneCompositeBar extends Disposable {
|
|
|
451
455
|
this.setPinnedViewContainers(( (cachedViewContainers.map(({ id, pinned, order }) => ({
|
|
452
456
|
id,
|
|
453
457
|
pinned,
|
|
454
|
-
visible: pinnedViewContainers.find(({ id: pinnedId }) => pinnedId === id)?.visible,
|
|
458
|
+
visible: Boolean(pinnedViewContainers.find(({ id: pinnedId }) => pinnedId === id)?.visible),
|
|
455
459
|
order
|
|
456
460
|
})))));
|
|
457
461
|
this.setPlaceholderViewContainers(( (cachedViewContainers.map(({ id, icon, name, views, isBuiltin }) => ({
|
|
@@ -486,10 +490,10 @@ let PaneCompositeBar = class PaneCompositeBar extends Disposable {
|
|
|
486
490
|
}
|
|
487
491
|
}
|
|
488
492
|
getStoredPinnedViewContainersValue() {
|
|
489
|
-
return this.storageService.get(this.options.pinnedViewContainersKey,
|
|
493
|
+
return this.storageService.get(this.options.pinnedViewContainersKey, StorageScope.PROFILE, '[]');
|
|
490
494
|
}
|
|
491
495
|
setStoredPinnedViewContainersValue(value) {
|
|
492
|
-
this.storageService.store(this.options.pinnedViewContainersKey, value,
|
|
496
|
+
this.storageService.store(this.options.pinnedViewContainersKey, value, StorageScope.PROFILE, StorageTarget.USER);
|
|
493
497
|
}
|
|
494
498
|
getPlaceholderViewContainers() {
|
|
495
499
|
return JSON.parse(this.placeholderViewContainersValue);
|
|
@@ -510,10 +514,10 @@ let PaneCompositeBar = class PaneCompositeBar extends Disposable {
|
|
|
510
514
|
}
|
|
511
515
|
}
|
|
512
516
|
getStoredPlaceholderViewContainersValue() {
|
|
513
|
-
return this.storageService.get(this.options.placeholderViewContainersKey,
|
|
517
|
+
return this.storageService.get(this.options.placeholderViewContainersKey, StorageScope.PROFILE, '[]');
|
|
514
518
|
}
|
|
515
519
|
setStoredPlaceholderViewContainersValue(value) {
|
|
516
|
-
this.storageService.store(this.options.placeholderViewContainersKey, value,
|
|
520
|
+
this.storageService.store(this.options.placeholderViewContainersKey, value, StorageScope.PROFILE, StorageTarget.MACHINE);
|
|
517
521
|
}
|
|
518
522
|
getViewContainersWorkspaceState() {
|
|
519
523
|
return JSON.parse(this.viewContainersWorkspaceStateValue);
|
|
@@ -534,10 +538,10 @@ let PaneCompositeBar = class PaneCompositeBar extends Disposable {
|
|
|
534
538
|
}
|
|
535
539
|
}
|
|
536
540
|
getStoredViewContainersWorkspaceStateValue() {
|
|
537
|
-
return this.storageService.get(this.options.viewContainersWorkspaceStateKey,
|
|
541
|
+
return this.storageService.get(this.options.viewContainersWorkspaceStateKey, StorageScope.WORKSPACE, '[]');
|
|
538
542
|
}
|
|
539
543
|
setStoredViewContainersWorkspaceStateValue(value) {
|
|
540
|
-
this.storageService.store(this.options.viewContainersWorkspaceStateKey, value,
|
|
544
|
+
this.storageService.store(this.options.viewContainersWorkspaceStateKey, value, StorageScope.WORKSPACE, StorageTarget.MACHINE);
|
|
541
545
|
}
|
|
542
546
|
};
|
|
543
547
|
PaneCompositeBar = ( (__decorate([
|
|
@@ -585,8 +589,8 @@ let ViewContainerActivityAction = class ViewContainerActivityAction extends Comp
|
|
|
585
589
|
}
|
|
586
590
|
this.lastRun = now;
|
|
587
591
|
const focus = (event && 'preserveFocus' in event) ? !event.preserveFocus : true;
|
|
588
|
-
if (this.part ===
|
|
589
|
-
const sideBarVisible = this.layoutService.isVisible(
|
|
592
|
+
if (this.part === Parts.ACTIVITYBAR_PART) {
|
|
593
|
+
const sideBarVisible = this.layoutService.isVisible(Parts.SIDEBAR_PART);
|
|
590
594
|
const activeViewlet = this.paneCompositePart.getActivePaneComposite();
|
|
591
595
|
const focusBehavior = this.configurationService.getValue('workbench.activityBar.iconClickBehavior');
|
|
592
596
|
if (sideBarVisible && activeViewlet?.getId() === this.compositeBarActionItem.id) {
|
|
@@ -598,7 +602,7 @@ let ViewContainerActivityAction = class ViewContainerActivityAction extends Comp
|
|
|
598
602
|
case 'toggle':
|
|
599
603
|
default:
|
|
600
604
|
this.logAction('hide');
|
|
601
|
-
this.layoutService.setPartHidden(true,
|
|
605
|
+
this.layoutService.setPartHidden(true, Parts.SIDEBAR_PART);
|
|
602
606
|
break;
|
|
603
607
|
}
|
|
604
608
|
return;
|
|
@@ -3,8 +3,10 @@ import './media/paneCompositePart.css.js';
|
|
|
3
3
|
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
4
4
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
5
5
|
import { Extensions } from 'vscode/vscode/vs/workbench/browser/panecomposite';
|
|
6
|
+
import { ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
|
|
6
7
|
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views.service';
|
|
7
8
|
import { DisposableStore, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
9
|
+
import { Parts } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
8
10
|
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
9
11
|
import { CompositePart } from './compositePart.js';
|
|
10
12
|
import { PaneCompositeBar } from './paneCompositeBar.js';
|
|
@@ -23,14 +25,14 @@ import { EDITOR_DRAG_AND_DROP_BACKGROUND } from 'vscode/vscode/vs/workbench/comm
|
|
|
23
25
|
import { CompositeMenuActions } from 'vscode/vscode/vs/workbench/browser/actions';
|
|
24
26
|
import { MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
25
27
|
import { IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions.service';
|
|
26
|
-
import { prepareActions } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar';
|
|
28
|
+
import { ActionsOrientation, prepareActions } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar';
|
|
27
29
|
import { Gesture, EventType as EventType$1 } from 'vscode/vscode/vs/base/browser/touch';
|
|
28
30
|
import { StandardMouseEvent } from 'vscode/vscode/vs/base/browser/mouseEvent';
|
|
29
31
|
import { SubmenuAction } from 'vscode/vscode/vs/base/common/actions';
|
|
30
32
|
import { ViewsSubMenu } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
|
|
31
33
|
import { createAndFillInActionBarActions } from 'vscode/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
|
|
32
34
|
import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.service';
|
|
33
|
-
import { WorkbenchToolBar } from 'vscode/vscode/vs/platform/actions/browser/toolbar';
|
|
35
|
+
import { WorkbenchToolBar, HiddenItemStrategy } from 'vscode/vscode/vs/platform/actions/browser/toolbar';
|
|
34
36
|
|
|
35
37
|
var AbstractPaneCompositePart_1;
|
|
36
38
|
const _moduleId = "vs/workbench/browser/parts/paneCompositePart";
|
|
@@ -50,16 +52,16 @@ let AbstractPaneCompositePart = class AbstractPaneCompositePart extends Composit
|
|
|
50
52
|
(Event.map(this.onDidCompositeOpen.event, compositeEvent => compositeEvent.composite))
|
|
51
53
|
); }
|
|
52
54
|
constructor(partId, partOptions, activePaneCompositeSettingsKey, activePaneContextKey, paneFocusContextKey, nameForTelemetry, compositeCSSClass, titleForegroundColor, notificationService, storageService, contextMenuService, layoutService, keybindingService, hoverService, instantiationService, themeService, viewDescriptorService, contextKeyService, extensionService, menuService) {
|
|
53
|
-
let location =
|
|
55
|
+
let location = ViewContainerLocation.Sidebar;
|
|
54
56
|
let registryId = Extensions.Viewlets;
|
|
55
57
|
let globalActionsMenuId = MenuId.SidebarTitle;
|
|
56
|
-
if (partId ===
|
|
57
|
-
location =
|
|
58
|
+
if (partId === Parts.PANEL_PART) {
|
|
59
|
+
location = ViewContainerLocation.Panel;
|
|
58
60
|
registryId = Extensions.Panels;
|
|
59
61
|
globalActionsMenuId = MenuId.PanelTitle;
|
|
60
62
|
}
|
|
61
|
-
else if (partId ===
|
|
62
|
-
location =
|
|
63
|
+
else if (partId === Parts.AUXILIARYBAR_PART) {
|
|
64
|
+
location = ViewContainerLocation.AuxiliaryBar;
|
|
63
65
|
registryId = Extensions.Auxiliary;
|
|
64
66
|
globalActionsMenuId = MenuId.AuxiliaryBarTitle;
|
|
65
67
|
}
|
|
@@ -188,12 +190,12 @@ let AbstractPaneCompositePart = class AbstractPaneCompositePart extends Composit
|
|
|
188
190
|
const globalTitleActionsContainer = titleArea.appendChild($('.global-actions'));
|
|
189
191
|
this.globalToolBar = this._register(this.instantiationService.createInstance(WorkbenchToolBar, globalTitleActionsContainer, {
|
|
190
192
|
actionViewItemProvider: (action, options) => this.actionViewItemProvider(action, options),
|
|
191
|
-
orientation:
|
|
193
|
+
orientation: ActionsOrientation.HORIZONTAL,
|
|
192
194
|
getKeyBinding: action => this.keybindingService.lookupKeybinding(action.id),
|
|
193
195
|
anchorAlignmentProvider: () => this.getTitleAreaDropDownAnchorAlignment(),
|
|
194
196
|
toggleMenuTitle: ( localizeWithPath(_moduleId, 1, "More Actions...")),
|
|
195
197
|
hoverDelegate: this.toolbarHoverDelegate,
|
|
196
|
-
hiddenItemStrategy:
|
|
198
|
+
hiddenItemStrategy: HiddenItemStrategy.NoHide
|
|
197
199
|
}));
|
|
198
200
|
this.updateGlobalToolbarActions();
|
|
199
201
|
return titleArea;
|
|
@@ -361,7 +363,7 @@ let AbstractPaneCompositePart = class AbstractPaneCompositePart extends Composit
|
|
|
361
363
|
}
|
|
362
364
|
this.hideActiveComposite();
|
|
363
365
|
}
|
|
364
|
-
|
|
366
|
+
focusCompositeBar() {
|
|
365
367
|
this.paneCompositeBar.value?.focus();
|
|
366
368
|
}
|
|
367
369
|
layout(width, height, top, left) {
|
|
@@ -376,7 +378,7 @@ let AbstractPaneCompositePart = class AbstractPaneCompositePart extends Composit
|
|
|
376
378
|
layoutCompositeBar() {
|
|
377
379
|
if (this.contentDimension && this.dimension && this.paneCompositeBar.value) {
|
|
378
380
|
const padding = this.compositeBarPosition === CompositeBarPosition.TITLE ? 16 : 8;
|
|
379
|
-
const borderWidth = this.partId ===
|
|
381
|
+
const borderWidth = this.partId === Parts.PANEL_PART ? 0 : 1;
|
|
380
382
|
let availableWidth = this.contentDimension.width - padding - borderWidth;
|
|
381
383
|
availableWidth = Math.max(AbstractPaneCompositePart_1.MIN_COMPOSITE_BAR_WIDTH, availableWidth - this.getToolbarWidth());
|
|
382
384
|
this.paneCompositeBar.value.layout(availableWidth, this.dimension.height);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
3
3
|
import { assertIsDefined } from 'vscode/vscode/vs/base/common/types';
|
|
4
|
+
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
4
5
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
5
6
|
import { AuxiliaryBarPart } from './auxiliarybar/auxiliaryBarPart.js';
|
|
6
7
|
import { PanelPart } from './panel/panelPart.js';
|
|
7
8
|
import { SidebarPart } from './sidebar/sidebarPart.js';
|
|
8
|
-
import { ViewContainerLocations } from 'vscode/vscode/vs/workbench/common/views';
|
|
9
|
+
import { ViewContainerLocation, ViewContainerLocations } from 'vscode/vscode/vs/workbench/common/views';
|
|
9
10
|
import { Disposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
10
11
|
|
|
11
12
|
let PaneCompositePartService = class PaneCompositePartService extends Disposable {
|
|
@@ -15,9 +16,9 @@ let PaneCompositePartService = class PaneCompositePartService extends Disposable
|
|
|
15
16
|
const panelPart = instantiationService.createInstance(PanelPart);
|
|
16
17
|
const sideBarPart = instantiationService.createInstance(SidebarPart);
|
|
17
18
|
const auxiliaryBarPart = instantiationService.createInstance(AuxiliaryBarPart);
|
|
18
|
-
this.paneCompositeParts.set(
|
|
19
|
-
this.paneCompositeParts.set(
|
|
20
|
-
this.paneCompositeParts.set(
|
|
19
|
+
this.paneCompositeParts.set(ViewContainerLocation.Panel, panelPart);
|
|
20
|
+
this.paneCompositeParts.set(ViewContainerLocation.Sidebar, sideBarPart);
|
|
21
|
+
this.paneCompositeParts.set(ViewContainerLocation.AuxiliaryBar, auxiliaryBarPart);
|
|
21
22
|
const eventDisposables = this._register(( new DisposableStore()));
|
|
22
23
|
this.onDidPaneCompositeOpen = Event.any(...( ViewContainerLocations.map(loc => ( Event.map(
|
|
23
24
|
this.paneCompositeParts.get(loc).onDidPaneCompositeOpen,
|
|
@@ -2,7 +2,9 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
|
2
2
|
import 'vscode/vscode/vs/workbench/browser/parts/panel/media/panelpart.css';
|
|
3
3
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
4
4
|
import { Separator, SubmenuAction, toAction } from 'vscode/vscode/vs/base/common/actions';
|
|
5
|
+
import { ActionsOrientation } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar';
|
|
5
6
|
import { ActivePanelContext, PanelFocusContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
7
|
+
import { Parts, Position } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
6
8
|
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
7
9
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
8
10
|
import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView.service';
|
|
@@ -28,6 +30,7 @@ import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/
|
|
|
28
30
|
import { assertIsDefined } from 'vscode/vscode/vs/base/common/types';
|
|
29
31
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
30
32
|
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views.service';
|
|
33
|
+
import { HoverPosition } from 'vscode/vscode/vs/base/browser/ui/hover/hoverWidget';
|
|
31
34
|
import { MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
32
35
|
import { IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions.service';
|
|
33
36
|
import { AbstractPaneCompositePart, CompositeBarPosition } from '../paneCompositePart.js';
|
|
@@ -55,7 +58,7 @@ let PanelPart = class PanelPart extends AbstractPaneCompositePart {
|
|
|
55
58
|
}
|
|
56
59
|
static { this.activePanelSettingsKey = 'workbench.panelpart.activepanelid'; }
|
|
57
60
|
constructor(notificationService, storageService, contextMenuService, layoutService, keybindingService, hoverService, instantiationService, themeService, viewDescriptorService, contextKeyService, extensionService, commandService, menuService) {
|
|
58
|
-
super(
|
|
61
|
+
super(Parts.PANEL_PART, { hasTitle: true }, PanelPart_1.activePanelSettingsKey, ActivePanelContext.bindTo(contextKeyService), PanelFocusContext.bindTo(contextKeyService), 'panel', 'panel', undefined, notificationService, storageService, contextMenuService, layoutService, keybindingService, hoverService, instantiationService, themeService, viewDescriptorService, contextKeyService, extensionService, menuService);
|
|
59
62
|
this.commandService = commandService;
|
|
60
63
|
this.minimumWidth = 300;
|
|
61
64
|
this.maximumWidth = Number.POSITIVE_INFINITY;
|
|
@@ -81,10 +84,10 @@ let PanelPart = class PanelPart extends AbstractPaneCompositePart {
|
|
|
81
84
|
placeholderViewContainersKey: 'workbench.panel.placeholderPanels',
|
|
82
85
|
viewContainersWorkspaceStateKey: 'workbench.panel.viewContainersWorkspaceState',
|
|
83
86
|
icon: false,
|
|
84
|
-
orientation:
|
|
87
|
+
orientation: ActionsOrientation.HORIZONTAL,
|
|
85
88
|
recomputeSizes: true,
|
|
86
89
|
activityHoverOptions: {
|
|
87
|
-
position: () => this.layoutService.getPanelPosition() ===
|
|
90
|
+
position: () => this.layoutService.getPanelPosition() === Position.BOTTOM && !this.layoutService.isPanelMaximized() ? HoverPosition.ABOVE : HoverPosition.BELOW,
|
|
88
91
|
},
|
|
89
92
|
fillExtraContextMenuActions: actions => this.fillExtraContextMenuActions(actions),
|
|
90
93
|
compositeSize: 0,
|
|
@@ -120,7 +123,7 @@ let PanelPart = class PanelPart extends AbstractPaneCompositePart {
|
|
|
120
123
|
}
|
|
121
124
|
layout(width, height, top, left) {
|
|
122
125
|
let dimensions;
|
|
123
|
-
if (this.layoutService.getPanelPosition() ===
|
|
126
|
+
if (this.layoutService.getPanelPosition() === Position.RIGHT) {
|
|
124
127
|
dimensions = ( (new Dimension(width - 1, height)));
|
|
125
128
|
}
|
|
126
129
|
else {
|
|
@@ -136,7 +139,7 @@ let PanelPart = class PanelPart extends AbstractPaneCompositePart {
|
|
|
136
139
|
}
|
|
137
140
|
toJSON() {
|
|
138
141
|
return {
|
|
139
|
-
type:
|
|
142
|
+
type: Parts.PANEL_PART
|
|
140
143
|
};
|
|
141
144
|
}
|
|
142
145
|
};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import './media/sidebarpart.css.js';
|
|
2
2
|
import { localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
3
3
|
import { Action2, registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
4
|
+
import { Parts } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
4
5
|
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
6
|
+
import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
7
|
+
import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
5
8
|
import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
|
|
6
9
|
import { IPaneCompositePartService } from 'vscode/vscode/vs/workbench/services/panecomposite/browser/panecomposite.service';
|
|
10
|
+
import { ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
|
|
7
11
|
|
|
8
12
|
const _moduleId = "vs/workbench/browser/parts/sidebar/sidebarActions";
|
|
9
13
|
class FocusSideBarAction extends Action2 {
|
|
@@ -14,20 +18,19 @@ class FocusSideBarAction extends Action2 {
|
|
|
14
18
|
category: Categories.View,
|
|
15
19
|
f1: true,
|
|
16
20
|
keybinding: {
|
|
17
|
-
weight:
|
|
21
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
18
22
|
when: null,
|
|
19
|
-
primary:
|
|
23
|
+
primary: KeyMod.CtrlCmd | KeyCode.Digit0
|
|
20
24
|
}
|
|
21
25
|
});
|
|
22
26
|
}
|
|
23
27
|
async run(accessor) {
|
|
24
28
|
const layoutService = accessor.get(IWorkbenchLayoutService);
|
|
25
29
|
const paneCompositeService = accessor.get(IPaneCompositePartService);
|
|
26
|
-
if (!layoutService.isVisible(
|
|
27
|
-
layoutService.setPartHidden(false,
|
|
28
|
-
return;
|
|
30
|
+
if (!layoutService.isVisible(Parts.SIDEBAR_PART)) {
|
|
31
|
+
layoutService.setPartHidden(false, Parts.SIDEBAR_PART);
|
|
29
32
|
}
|
|
30
|
-
const viewlet = paneCompositeService.getActivePaneComposite(
|
|
33
|
+
const viewlet = paneCompositeService.getActivePaneComposite(ViewContainerLocation.Sidebar);
|
|
31
34
|
viewlet?.focus();
|
|
32
35
|
}
|
|
33
36
|
}
|