Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/browser/actions/layoutActions.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { ILocalizedString, localize, localize2 } from '../../../nls.js';
7
import { MenuId, MenuRegistry, registerAction2, Action2 } from '../../../platform/actions/common/actions.js';
8
import { Categories } from '../../../platform/action/common/actionCommonCategories.js';
9
import { IConfigurationService } from '../../../platform/configuration/common/configuration.js';
10
import { alert } from '../../../base/browser/ui/aria/aria.js';
11
import { EditorActionsLocation, EditorTabsMode, IWorkbenchLayoutService, LayoutSettings, Parts, Position, ZenModeSettings, positionToString } from '../../services/layout/browser/layoutService.js';
12
import { ServicesAccessor, IInstantiationService } from '../../../platform/instantiation/common/instantiation.js';
13
import { KeyMod, KeyCode, KeyChord } from '../../../base/common/keyCodes.js';
14
import { isWindows, isLinux, isWeb, isMacintosh, isNative } from '../../../base/common/platform.js';
15
import { IsMacNativeContext } from '../../../platform/contextkey/common/contextkeys.js';
16
import { KeybindingsRegistry, KeybindingWeight } from '../../../platform/keybinding/common/keybindingsRegistry.js';
17
import { ContextKeyExpr, ContextKeyExpression, IContextKeyService } from '../../../platform/contextkey/common/contextkey.js';
18
import { IViewDescriptorService, ViewContainerLocation, IViewDescriptor, ViewContainerLocationToString } from '../../common/views.js';
19
import { IViewsService } from '../../services/views/common/viewsService.js';
20
import { QuickPickItem, IQuickInputService, IQuickPickItem, IQuickPickSeparator, IQuickPick } from '../../../platform/quickinput/common/quickInput.js';
21
import { IDialogService } from '../../../platform/dialogs/common/dialogs.js';
22
import { IPaneCompositePartService } from '../../services/panecomposite/browser/panecomposite.js';
23
import { ToggleAuxiliaryBarAction } from '../parts/auxiliarybar/auxiliaryBarActions.js';
24
import { TogglePanelAction } from '../parts/panel/panelActions.js';
25
import { ICommandService } from '../../../platform/commands/common/commands.js';
26
import { AuxiliaryBarVisibleContext, PanelAlignmentContext, PanelVisibleContext, SideBarVisibleContext, FocusedViewContext, InEditorZenModeContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, IsMainWindowFullscreenContext, PanelPositionContext, IsAuxiliaryWindowFocusedContext, TitleBarStyleContext, IsAuxiliaryWindowContext } from '../../common/contextkeys.js';
27
import { Codicon } from '../../../base/common/codicons.js';
28
import { ThemeIcon } from '../../../base/common/themables.js';
29
import { DisposableStore } from '../../../base/common/lifecycle.js';
30
import { registerIcon } from '../../../platform/theme/common/iconRegistry.js';
31
import { ICommandActionTitle } from '../../../platform/action/common/action.js';
32
import { mainWindow } from '../../../base/browser/window.js';
33
import { IKeybindingService } from '../../../platform/keybinding/common/keybinding.js';
34
import { MenuSettings, TitlebarStyle } from '../../../platform/window/common/window.js';
35
import { IPreferencesService } from '../../services/preferences/common/preferences.js';
36
import { QuickInputAlignmentContextKey } from '../../../platform/quickinput/browser/quickInput.js';
37
import { IEditorGroupsService } from '../../services/editor/common/editorGroupsService.js';
38
39
// Register Icons
40
const menubarIcon = registerIcon('menuBar', Codicon.layoutMenubar, localize('menuBarIcon', "Represents the menu bar"));
41
const activityBarLeftIcon = registerIcon('activity-bar-left', Codicon.layoutActivitybarLeft, localize('activityBarLeft', "Represents the activity bar in the left position"));
42
const activityBarRightIcon = registerIcon('activity-bar-right', Codicon.layoutActivitybarRight, localize('activityBarRight', "Represents the activity bar in the right position"));
43
const panelLeftIcon = registerIcon('panel-left', Codicon.layoutSidebarLeft, localize('panelLeft', "Represents a side bar in the left position"));
44
const panelLeftOffIcon = registerIcon('panel-left-off', Codicon.layoutSidebarLeftOff, localize('panelLeftOff', "Represents a side bar in the left position toggled off"));
45
const panelRightIcon = registerIcon('panel-right', Codicon.layoutSidebarRight, localize('panelRight', "Represents side bar in the right position"));
46
const panelRightOffIcon = registerIcon('panel-right-off', Codicon.layoutSidebarRightOff, localize('panelRightOff', "Represents side bar in the right position toggled off"));
47
const panelIcon = registerIcon('panel-bottom', Codicon.layoutPanel, localize('panelBottom', "Represents the bottom panel"));
48
const statusBarIcon = registerIcon('statusBar', Codicon.layoutStatusbar, localize('statusBarIcon', "Represents the status bar"));
49
50
const panelAlignmentLeftIcon = registerIcon('panel-align-left', Codicon.layoutPanelLeft, localize('panelBottomLeft', "Represents the bottom panel alignment set to the left"));
51
const panelAlignmentRightIcon = registerIcon('panel-align-right', Codicon.layoutPanelRight, localize('panelBottomRight', "Represents the bottom panel alignment set to the right"));
52
const panelAlignmentCenterIcon = registerIcon('panel-align-center', Codicon.layoutPanelCenter, localize('panelBottomCenter', "Represents the bottom panel alignment set to the center"));
53
const panelAlignmentJustifyIcon = registerIcon('panel-align-justify', Codicon.layoutPanelJustify, localize('panelBottomJustify', "Represents the bottom panel alignment set to justified"));
54
55
const quickInputAlignmentTopIcon = registerIcon('quickInputAlignmentTop', Codicon.arrowUp, localize('quickInputAlignmentTop', "Represents quick input alignment set to the top"));
56
const quickInputAlignmentCenterIcon = registerIcon('quickInputAlignmentCenter', Codicon.circle, localize('quickInputAlignmentCenter', "Represents quick input alignment set to the center"));
57
58
const fullscreenIcon = registerIcon('fullscreen', Codicon.screenFull, localize('fullScreenIcon', "Represents full screen"));
59
const centerLayoutIcon = registerIcon('centerLayoutIcon', Codicon.layoutCentered, localize('centerLayoutIcon', "Represents centered layout mode"));
60
const zenModeIcon = registerIcon('zenMode', Codicon.target, localize('zenModeIcon', "Represents zen mode"));
61
62
export const ToggleActivityBarVisibilityActionId = 'workbench.action.toggleActivityBarVisibility';
63
64
// --- Toggle Centered Layout
65
66
registerAction2(class extends Action2 {
67
68
constructor() {
69
super({
70
id: 'workbench.action.toggleCenteredLayout',
71
title: {
72
...localize2('toggleCenteredLayout', "Toggle Centered Layout"),
73
mnemonicTitle: localize({ key: 'miToggleCenteredLayout', comment: ['&& denotes a mnemonic'] }, "&&Centered Layout"),
74
},
75
precondition: IsAuxiliaryWindowFocusedContext.toNegated(),
76
category: Categories.View,
77
f1: true,
78
toggled: IsMainEditorCenteredLayoutContext,
79
menu: [{
80
id: MenuId.MenubarAppearanceMenu,
81
group: '1_toggle_view',
82
order: 3
83
}]
84
});
85
}
86
87
run(accessor: ServicesAccessor): void {
88
const layoutService = accessor.get(IWorkbenchLayoutService);
89
const editorGroupService = accessor.get(IEditorGroupsService);
90
91
layoutService.centerMainEditorLayout(!layoutService.isMainEditorLayoutCentered());
92
editorGroupService.activeGroup.focus();
93
}
94
});
95
96
// --- Set Sidebar Position
97
const sidebarPositionConfigurationKey = 'workbench.sideBar.location';
98
99
class MoveSidebarPositionAction extends Action2 {
100
constructor(id: string, title: ICommandActionTitle, private readonly position: Position) {
101
super({
102
id,
103
title,
104
f1: false
105
});
106
}
107
108
async run(accessor: ServicesAccessor): Promise<void> {
109
const layoutService = accessor.get(IWorkbenchLayoutService);
110
const configurationService = accessor.get(IConfigurationService);
111
112
const position = layoutService.getSideBarPosition();
113
if (position !== this.position) {
114
return configurationService.updateValue(sidebarPositionConfigurationKey, positionToString(this.position));
115
}
116
}
117
}
118
119
class MoveSidebarRightAction extends MoveSidebarPositionAction {
120
static readonly ID = 'workbench.action.moveSideBarRight';
121
122
constructor() {
123
super(MoveSidebarRightAction.ID, localize2('moveSidebarRight', "Move Primary Side Bar Right"), Position.RIGHT);
124
}
125
}
126
127
class MoveSidebarLeftAction extends MoveSidebarPositionAction {
128
static readonly ID = 'workbench.action.moveSideBarLeft';
129
130
constructor() {
131
super(MoveSidebarLeftAction.ID, localize2('moveSidebarLeft', "Move Primary Side Bar Left"), Position.LEFT);
132
}
133
}
134
135
registerAction2(MoveSidebarRightAction);
136
registerAction2(MoveSidebarLeftAction);
137
138
// --- Toggle Sidebar Position
139
140
export class ToggleSidebarPositionAction extends Action2 {
141
142
static readonly ID = 'workbench.action.toggleSidebarPosition';
143
static readonly LABEL = localize('toggleSidebarPosition', "Toggle Primary Side Bar Position");
144
145
static getLabel(layoutService: IWorkbenchLayoutService): string {
146
return layoutService.getSideBarPosition() === Position.LEFT ? localize('moveSidebarRight', "Move Primary Side Bar Right") : localize('moveSidebarLeft', "Move Primary Side Bar Left");
147
}
148
149
constructor() {
150
super({
151
id: ToggleSidebarPositionAction.ID,
152
title: localize2('toggleSidebarPosition', "Toggle Primary Side Bar Position"),
153
category: Categories.View,
154
f1: true
155
});
156
}
157
158
run(accessor: ServicesAccessor): Promise<void> {
159
const layoutService = accessor.get(IWorkbenchLayoutService);
160
const configurationService = accessor.get(IConfigurationService);
161
162
const position = layoutService.getSideBarPosition();
163
const newPositionValue = (position === Position.LEFT) ? 'right' : 'left';
164
165
return configurationService.updateValue(sidebarPositionConfigurationKey, newPositionValue);
166
}
167
}
168
169
registerAction2(ToggleSidebarPositionAction);
170
171
const configureLayoutIcon = registerIcon('configure-layout-icon', Codicon.layout, localize('cofigureLayoutIcon', 'Icon represents workbench layout configuration.'));
172
MenuRegistry.appendMenuItem(MenuId.LayoutControlMenu, {
173
submenu: MenuId.LayoutControlMenuSubmenu,
174
title: localize('configureLayout', "Configure Layout"),
175
icon: configureLayoutIcon,
176
group: '1_workbench_layout',
177
when: ContextKeyExpr.and(
178
IsAuxiliaryWindowContext.negate(),
179
ContextKeyExpr.equals('config.workbench.layoutControl.type', 'menu')
180
)
181
});
182
183
184
MenuRegistry.appendMenuItems([{
185
id: MenuId.ViewContainerTitleContext,
186
item: {
187
group: '3_workbench_layout_move',
188
command: {
189
id: ToggleSidebarPositionAction.ID,
190
title: localize('move side bar right', "Move Primary Side Bar Right")
191
},
192
when: ContextKeyExpr.and(ContextKeyExpr.notEquals('config.workbench.sideBar.location', 'right'), ContextKeyExpr.equals('viewContainerLocation', ViewContainerLocationToString(ViewContainerLocation.Sidebar))),
193
order: 1
194
}
195
}, {
196
id: MenuId.ViewContainerTitleContext,
197
item: {
198
group: '3_workbench_layout_move',
199
command: {
200
id: ToggleSidebarPositionAction.ID,
201
title: localize('move sidebar left', "Move Primary Side Bar Left")
202
},
203
when: ContextKeyExpr.and(ContextKeyExpr.equals('config.workbench.sideBar.location', 'right'), ContextKeyExpr.equals('viewContainerLocation', ViewContainerLocationToString(ViewContainerLocation.Sidebar))),
204
order: 1
205
}
206
}, {
207
id: MenuId.ViewContainerTitleContext,
208
item: {
209
group: '3_workbench_layout_move',
210
command: {
211
id: ToggleSidebarPositionAction.ID,
212
title: localize('move second sidebar left', "Move Secondary Side Bar Left")
213
},
214
when: ContextKeyExpr.and(ContextKeyExpr.notEquals('config.workbench.sideBar.location', 'right'), ContextKeyExpr.equals('viewContainerLocation', ViewContainerLocationToString(ViewContainerLocation.AuxiliaryBar))),
215
order: 1
216
}
217
}, {
218
id: MenuId.ViewContainerTitleContext,
219
item: {
220
group: '3_workbench_layout_move',
221
command: {
222
id: ToggleSidebarPositionAction.ID,
223
title: localize('move second sidebar right', "Move Secondary Side Bar Right")
224
},
225
when: ContextKeyExpr.and(ContextKeyExpr.equals('config.workbench.sideBar.location', 'right'), ContextKeyExpr.equals('viewContainerLocation', ViewContainerLocationToString(ViewContainerLocation.AuxiliaryBar))),
226
order: 1
227
}
228
}]);
229
230
MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
231
group: '3_workbench_layout_move',
232
command: {
233
id: ToggleSidebarPositionAction.ID,
234
title: localize({ key: 'miMoveSidebarRight', comment: ['&& denotes a mnemonic'] }, "&&Move Primary Side Bar Right")
235
},
236
when: ContextKeyExpr.notEquals('config.workbench.sideBar.location', 'right'),
237
order: 2
238
});
239
240
MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
241
group: '3_workbench_layout_move',
242
command: {
243
id: ToggleSidebarPositionAction.ID,
244
title: localize({ key: 'miMoveSidebarLeft', comment: ['&& denotes a mnemonic'] }, "&&Move Primary Side Bar Left")
245
},
246
when: ContextKeyExpr.equals('config.workbench.sideBar.location', 'right'),
247
order: 2
248
});
249
250
// --- Toggle Editor Visibility
251
252
registerAction2(class extends Action2 {
253
254
constructor() {
255
super({
256
id: 'workbench.action.toggleEditorVisibility',
257
title: {
258
...localize2('toggleEditor', "Toggle Editor Area Visibility"),
259
mnemonicTitle: localize({ key: 'miShowEditorArea', comment: ['&& denotes a mnemonic'] }, "Show &&Editor Area"),
260
},
261
category: Categories.View,
262
f1: true,
263
toggled: MainEditorAreaVisibleContext,
264
// the workbench grid currently prevents us from supporting panel maximization with non-center panel alignment
265
precondition: ContextKeyExpr.and(IsAuxiliaryWindowFocusedContext.toNegated(), ContextKeyExpr.or(PanelAlignmentContext.isEqualTo('center'), PanelPositionContext.notEqualsTo('bottom')))
266
});
267
}
268
269
run(accessor: ServicesAccessor): void {
270
accessor.get(IWorkbenchLayoutService).toggleMaximizedPanel();
271
}
272
});
273
274
MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
275
group: '2_appearance',
276
title: localize({ key: 'miAppearance', comment: ['&& denotes a mnemonic'] }, "&&Appearance"),
277
submenu: MenuId.MenubarAppearanceMenu,
278
order: 1
279
});
280
281
// Toggle Sidebar Visibility
282
283
export class ToggleSidebarVisibilityAction extends Action2 {
284
285
static readonly ID = 'workbench.action.toggleSidebarVisibility';
286
static readonly LABEL = localize('compositePart.hideSideBarLabel', "Hide Primary Side Bar");
287
288
constructor() {
289
super({
290
id: ToggleSidebarVisibilityAction.ID,
291
title: localize2('toggleSidebar', 'Toggle Primary Side Bar Visibility'),
292
toggled: {
293
condition: SideBarVisibleContext,
294
title: localize('primary sidebar', "Primary Side Bar"),
295
mnemonicTitle: localize({ key: 'primary sidebar mnemonic', comment: ['&& denotes a mnemonic'] }, "&&Primary Side Bar"),
296
},
297
metadata: {
298
description: localize('openAndCloseSidebar', 'Open/Show and Close/Hide Sidebar'),
299
},
300
category: Categories.View,
301
f1: true,
302
keybinding: {
303
weight: KeybindingWeight.WorkbenchContrib,
304
primary: KeyMod.CtrlCmd | KeyCode.KeyB
305
},
306
menu: [
307
{
308
id: MenuId.LayoutControlMenuSubmenu,
309
group: '0_workbench_layout',
310
order: 0
311
},
312
{
313
id: MenuId.MenubarAppearanceMenu,
314
group: '2_workbench_layout',
315
order: 1
316
}
317
]
318
});
319
}
320
321
run(accessor: ServicesAccessor): void {
322
const layoutService = accessor.get(IWorkbenchLayoutService);
323
const isCurrentlyVisible = layoutService.isVisible(Parts.SIDEBAR_PART);
324
325
layoutService.setPartHidden(isCurrentlyVisible, Parts.SIDEBAR_PART);
326
327
// Announce visibility change to screen readers
328
const alertMessage = isCurrentlyVisible
329
? localize('sidebarHidden', "Primary Side Bar hidden")
330
: localize('sidebarVisible', "Primary Side Bar shown");
331
alert(alertMessage);
332
}
333
}
334
335
registerAction2(ToggleSidebarVisibilityAction);
336
337
MenuRegistry.appendMenuItems([
338
{
339
id: MenuId.ViewContainerTitleContext,
340
item: {
341
group: '3_workbench_layout_move',
342
command: {
343
id: ToggleSidebarVisibilityAction.ID,
344
title: localize('compositePart.hideSideBarLabel', "Hide Primary Side Bar"),
345
},
346
when: ContextKeyExpr.and(SideBarVisibleContext, ContextKeyExpr.equals('viewContainerLocation', ViewContainerLocationToString(ViewContainerLocation.Sidebar))),
347
order: 2
348
}
349
}, {
350
id: MenuId.LayoutControlMenu,
351
item: {
352
group: '2_pane_toggles',
353
command: {
354
id: ToggleSidebarVisibilityAction.ID,
355
title: localize('toggleSideBar', "Toggle Primary Side Bar"),
356
icon: panelLeftOffIcon,
357
toggled: { condition: SideBarVisibleContext, icon: panelLeftIcon }
358
},
359
when: ContextKeyExpr.and(
360
IsAuxiliaryWindowContext.negate(),
361
ContextKeyExpr.or(
362
ContextKeyExpr.equals('config.workbench.layoutControl.type', 'toggles'),
363
ContextKeyExpr.equals('config.workbench.layoutControl.type', 'both')),
364
ContextKeyExpr.equals('config.workbench.sideBar.location', 'left')
365
),
366
order: 0
367
}
368
}, {
369
id: MenuId.LayoutControlMenu,
370
item: {
371
group: '2_pane_toggles',
372
command: {
373
id: ToggleSidebarVisibilityAction.ID,
374
title: localize('toggleSideBar', "Toggle Primary Side Bar"),
375
icon: panelRightOffIcon,
376
toggled: { condition: SideBarVisibleContext, icon: panelRightIcon }
377
},
378
when: ContextKeyExpr.and(
379
IsAuxiliaryWindowContext.negate(),
380
ContextKeyExpr.or(
381
ContextKeyExpr.equals('config.workbench.layoutControl.type', 'toggles'),
382
ContextKeyExpr.equals('config.workbench.layoutControl.type', 'both')),
383
ContextKeyExpr.equals('config.workbench.sideBar.location', 'right')
384
),
385
order: 2
386
}
387
}
388
]);
389
390
// --- Toggle Statusbar Visibility
391
392
export class ToggleStatusbarVisibilityAction extends Action2 {
393
394
static readonly ID = 'workbench.action.toggleStatusbarVisibility';
395
396
private static readonly statusbarVisibleKey = 'workbench.statusBar.visible';
397
398
constructor() {
399
super({
400
id: ToggleStatusbarVisibilityAction.ID,
401
title: {
402
...localize2('toggleStatusbar', "Toggle Status Bar Visibility"),
403
mnemonicTitle: localize({ key: 'miStatusbar', comment: ['&& denotes a mnemonic'] }, "S&&tatus Bar"),
404
},
405
category: Categories.View,
406
f1: true,
407
toggled: ContextKeyExpr.equals('config.workbench.statusBar.visible', true),
408
menu: [{
409
id: MenuId.MenubarAppearanceMenu,
410
group: '2_workbench_layout',
411
order: 3
412
}]
413
});
414
}
415
416
run(accessor: ServicesAccessor): Promise<void> {
417
const layoutService = accessor.get(IWorkbenchLayoutService);
418
const configurationService = accessor.get(IConfigurationService);
419
420
const visibility = layoutService.isVisible(Parts.STATUSBAR_PART, mainWindow);
421
const newVisibilityValue = !visibility;
422
423
return configurationService.updateValue(ToggleStatusbarVisibilityAction.statusbarVisibleKey, newVisibilityValue);
424
}
425
}
426
427
registerAction2(ToggleStatusbarVisibilityAction);
428
429
// ------------------- Editor Tabs Layout --------------------------------
430
431
abstract class AbstractSetShowTabsAction extends Action2 {
432
433
constructor(private readonly settingName: string, private readonly value: string, title: ICommandActionTitle, id: string, precondition: ContextKeyExpression, description: string | ILocalizedString | undefined) {
434
super({
435
id,
436
title,
437
category: Categories.View,
438
precondition,
439
metadata: description ? { description } : undefined,
440
f1: true
441
});
442
}
443
444
run(accessor: ServicesAccessor): Promise<void> {
445
const configurationService = accessor.get(IConfigurationService);
446
return configurationService.updateValue(this.settingName, this.value);
447
}
448
}
449
450
// --- Hide Editor Tabs
451
452
export class HideEditorTabsAction extends AbstractSetShowTabsAction {
453
454
static readonly ID = 'workbench.action.hideEditorTabs';
455
456
constructor() {
457
const precondition = ContextKeyExpr.and(ContextKeyExpr.equals(`config.${LayoutSettings.EDITOR_TABS_MODE}`, EditorTabsMode.NONE).negate(), InEditorZenModeContext.negate())!;
458
const title = localize2('hideEditorTabs', 'Hide Editor Tabs');
459
super(LayoutSettings.EDITOR_TABS_MODE, EditorTabsMode.NONE, title, HideEditorTabsAction.ID, precondition, localize2('hideEditorTabsDescription', "Hide Tab Bar"));
460
}
461
}
462
463
export class ZenHideEditorTabsAction extends AbstractSetShowTabsAction {
464
465
static readonly ID = 'workbench.action.zenHideEditorTabs';
466
467
constructor() {
468
const precondition = ContextKeyExpr.and(ContextKeyExpr.equals(`config.${ZenModeSettings.SHOW_TABS}`, EditorTabsMode.NONE).negate(), InEditorZenModeContext)!;
469
const title = localize2('hideEditorTabsZenMode', 'Hide Editor Tabs in Zen Mode');
470
super(ZenModeSettings.SHOW_TABS, EditorTabsMode.NONE, title, ZenHideEditorTabsAction.ID, precondition, localize2('hideEditorTabsZenModeDescription', "Hide Tab Bar in Zen Mode"));
471
}
472
}
473
474
// --- Show Multiple Editor Tabs
475
476
export class ShowMultipleEditorTabsAction extends AbstractSetShowTabsAction {
477
478
static readonly ID = 'workbench.action.showMultipleEditorTabs';
479
480
constructor() {
481
const precondition = ContextKeyExpr.and(ContextKeyExpr.equals(`config.${LayoutSettings.EDITOR_TABS_MODE}`, EditorTabsMode.MULTIPLE).negate(), InEditorZenModeContext.negate())!;
482
const title = localize2('showMultipleEditorTabs', 'Show Multiple Editor Tabs');
483
484
super(LayoutSettings.EDITOR_TABS_MODE, EditorTabsMode.MULTIPLE, title, ShowMultipleEditorTabsAction.ID, precondition, localize2('showMultipleEditorTabsDescription', "Show Tab Bar with multiple tabs"));
485
}
486
}
487
488
export class ZenShowMultipleEditorTabsAction extends AbstractSetShowTabsAction {
489
490
static readonly ID = 'workbench.action.zenShowMultipleEditorTabs';
491
492
constructor() {
493
const precondition = ContextKeyExpr.and(ContextKeyExpr.equals(`config.${ZenModeSettings.SHOW_TABS}`, EditorTabsMode.MULTIPLE).negate(), InEditorZenModeContext)!;
494
const title = localize2('showMultipleEditorTabsZenMode', 'Show Multiple Editor Tabs in Zen Mode');
495
496
super(ZenModeSettings.SHOW_TABS, EditorTabsMode.MULTIPLE, title, ZenShowMultipleEditorTabsAction.ID, precondition, localize2('showMultipleEditorTabsZenModeDescription', "Show Tab Bar in Zen Mode"));
497
}
498
}
499
500
// --- Show Single Editor Tab
501
502
export class ShowSingleEditorTabAction extends AbstractSetShowTabsAction {
503
504
static readonly ID = 'workbench.action.showEditorTab';
505
506
constructor() {
507
const precondition = ContextKeyExpr.and(ContextKeyExpr.equals(`config.${LayoutSettings.EDITOR_TABS_MODE}`, EditorTabsMode.SINGLE).negate(), InEditorZenModeContext.negate())!;
508
const title = localize2('showSingleEditorTab', 'Show Single Editor Tab');
509
510
super(LayoutSettings.EDITOR_TABS_MODE, EditorTabsMode.SINGLE, title, ShowSingleEditorTabAction.ID, precondition, localize2('showSingleEditorTabDescription', "Show Tab Bar with one Tab"));
511
}
512
}
513
514
export class ZenShowSingleEditorTabAction extends AbstractSetShowTabsAction {
515
516
static readonly ID = 'workbench.action.zenShowEditorTab';
517
518
constructor() {
519
const precondition = ContextKeyExpr.and(ContextKeyExpr.equals(`config.${ZenModeSettings.SHOW_TABS}`, EditorTabsMode.SINGLE).negate(), InEditorZenModeContext)!;
520
const title = localize2('showSingleEditorTabZenMode', 'Show Single Editor Tab in Zen Mode');
521
522
super(ZenModeSettings.SHOW_TABS, EditorTabsMode.SINGLE, title, ZenShowSingleEditorTabAction.ID, precondition, localize2('showSingleEditorTabZenModeDescription', "Show Tab Bar in Zen Mode with one Tab"));
523
}
524
}
525
526
registerAction2(HideEditorTabsAction);
527
registerAction2(ZenHideEditorTabsAction);
528
registerAction2(ShowMultipleEditorTabsAction);
529
registerAction2(ZenShowMultipleEditorTabsAction);
530
registerAction2(ShowSingleEditorTabAction);
531
registerAction2(ZenShowSingleEditorTabAction);
532
533
// --- Tab Bar Submenu in View Appearance Menu
534
535
MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
536
submenu: MenuId.EditorTabsBarShowTabsSubmenu,
537
title: localize('tabBar', "Tab Bar"),
538
group: '3_workbench_layout_move',
539
order: 10,
540
when: InEditorZenModeContext.negate()
541
});
542
543
MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
544
submenu: MenuId.EditorTabsBarShowTabsZenModeSubmenu,
545
title: localize('tabBar', "Tab Bar"),
546
group: '3_workbench_layout_move',
547
order: 10,
548
when: InEditorZenModeContext
549
});
550
551
// --- Show Editor Actions in Title Bar
552
553
export class EditorActionsTitleBarAction extends Action2 {
554
555
static readonly ID = 'workbench.action.editorActionsTitleBar';
556
557
constructor() {
558
super({
559
id: EditorActionsTitleBarAction.ID,
560
title: localize2('moveEditorActionsToTitleBar', "Move Editor Actions to Title Bar"),
561
category: Categories.View,
562
precondition: ContextKeyExpr.equals(`config.${LayoutSettings.EDITOR_ACTIONS_LOCATION}`, EditorActionsLocation.TITLEBAR).negate(),
563
metadata: { description: localize2('moveEditorActionsToTitleBarDescription', "Move Editor Actions from the tab bar to the title bar") },
564
f1: true
565
});
566
}
567
568
run(accessor: ServicesAccessor): Promise<void> {
569
const configurationService = accessor.get(IConfigurationService);
570
return configurationService.updateValue(LayoutSettings.EDITOR_ACTIONS_LOCATION, EditorActionsLocation.TITLEBAR);
571
}
572
}
573
registerAction2(EditorActionsTitleBarAction);
574
575
// --- Editor Actions Default Position
576
577
export class EditorActionsDefaultAction extends Action2 {
578
579
static readonly ID = 'workbench.action.editorActionsDefault';
580
581
constructor() {
582
super({
583
id: EditorActionsDefaultAction.ID,
584
title: localize2('moveEditorActionsToTabBar', "Move Editor Actions to Tab Bar"),
585
category: Categories.View,
586
precondition: ContextKeyExpr.and(
587
ContextKeyExpr.equals(`config.${LayoutSettings.EDITOR_ACTIONS_LOCATION}`, EditorActionsLocation.DEFAULT).negate(),
588
ContextKeyExpr.equals(`config.${LayoutSettings.EDITOR_TABS_MODE}`, EditorTabsMode.NONE).negate(),
589
),
590
metadata: { description: localize2('moveEditorActionsToTabBarDescription', "Move Editor Actions from the title bar to the tab bar") },
591
f1: true
592
});
593
}
594
595
run(accessor: ServicesAccessor): Promise<void> {
596
const configurationService = accessor.get(IConfigurationService);
597
return configurationService.updateValue(LayoutSettings.EDITOR_ACTIONS_LOCATION, EditorActionsLocation.DEFAULT);
598
}
599
}
600
registerAction2(EditorActionsDefaultAction);
601
602
// --- Hide Editor Actions
603
604
export class HideEditorActionsAction extends Action2 {
605
606
static readonly ID = 'workbench.action.hideEditorActions';
607
608
constructor() {
609
super({
610
id: HideEditorActionsAction.ID,
611
title: localize2('hideEditorActons', "Hide Editor Actions"),
612
category: Categories.View,
613
precondition: ContextKeyExpr.equals(`config.${LayoutSettings.EDITOR_ACTIONS_LOCATION}`, EditorActionsLocation.HIDDEN).negate(),
614
metadata: { description: localize2('hideEditorActonsDescription', "Hide Editor Actions in the tab and title bar") },
615
f1: true
616
});
617
}
618
619
run(accessor: ServicesAccessor): Promise<void> {
620
const configurationService = accessor.get(IConfigurationService);
621
return configurationService.updateValue(LayoutSettings.EDITOR_ACTIONS_LOCATION, EditorActionsLocation.HIDDEN);
622
}
623
}
624
registerAction2(HideEditorActionsAction);
625
626
// --- Hide Editor Actions
627
628
export class ShowEditorActionsAction extends Action2 {
629
630
static readonly ID = 'workbench.action.showEditorActions';
631
632
constructor() {
633
super({
634
id: ShowEditorActionsAction.ID,
635
title: localize2('showEditorActons', "Show Editor Actions"),
636
category: Categories.View,
637
precondition: ContextKeyExpr.equals(`config.${LayoutSettings.EDITOR_ACTIONS_LOCATION}`, EditorActionsLocation.HIDDEN),
638
metadata: { description: localize2('showEditorActonsDescription', "Make Editor Actions visible.") },
639
f1: true
640
});
641
}
642
643
run(accessor: ServicesAccessor): Promise<void> {
644
const configurationService = accessor.get(IConfigurationService);
645
return configurationService.updateValue(LayoutSettings.EDITOR_ACTIONS_LOCATION, EditorActionsLocation.DEFAULT);
646
}
647
}
648
registerAction2(ShowEditorActionsAction);
649
650
// --- Editor Actions Position Submenu in View Appearance Menu
651
652
MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
653
submenu: MenuId.EditorActionsPositionSubmenu,
654
title: localize('editorActionsPosition', "Editor Actions Position"),
655
group: '3_workbench_layout_move',
656
order: 11
657
});
658
659
// --- Configure Tabs Layout
660
661
export class ConfigureEditorTabsAction extends Action2 {
662
663
static readonly ID = 'workbench.action.configureEditorTabs';
664
665
constructor() {
666
super({
667
id: ConfigureEditorTabsAction.ID,
668
title: localize2('configureTabs', "Configure Tabs"),
669
category: Categories.View,
670
});
671
}
672
673
run(accessor: ServicesAccessor) {
674
const preferencesService = accessor.get(IPreferencesService);
675
preferencesService.openSettings({ jsonEditor: false, query: 'workbench.editor tab' });
676
}
677
}
678
registerAction2(ConfigureEditorTabsAction);
679
680
// --- Configure Editor
681
682
export class ConfigureEditorAction extends Action2 {
683
684
static readonly ID = 'workbench.action.configureEditor';
685
686
constructor() {
687
super({
688
id: ConfigureEditorAction.ID,
689
title: localize2('configureEditors', "Configure Editors"),
690
category: Categories.View,
691
});
692
}
693
694
run(accessor: ServicesAccessor) {
695
const preferencesService = accessor.get(IPreferencesService);
696
preferencesService.openSettings({ jsonEditor: false, query: 'workbench.editor' });
697
}
698
}
699
registerAction2(ConfigureEditorAction);
700
701
// --- Toggle Pinned Tabs On Separate Row
702
703
registerAction2(class extends Action2 {
704
705
constructor() {
706
super({
707
id: 'workbench.action.toggleSeparatePinnedEditorTabs',
708
title: localize2('toggleSeparatePinnedEditorTabs', "Separate Pinned Editor Tabs"),
709
category: Categories.View,
710
precondition: ContextKeyExpr.equals(`config.${LayoutSettings.EDITOR_TABS_MODE}`, EditorTabsMode.MULTIPLE),
711
metadata: { description: localize2('toggleSeparatePinnedEditorTabsDescription', "Toggle whether pinned editor tabs are shown on a separate row above unpinned tabs.") },
712
f1: true
713
});
714
}
715
716
run(accessor: ServicesAccessor): Promise<void> {
717
const configurationService = accessor.get(IConfigurationService);
718
719
const oldettingValue = configurationService.getValue<string>('workbench.editor.pinnedTabsOnSeparateRow');
720
const newSettingValue = !oldettingValue;
721
722
return configurationService.updateValue('workbench.editor.pinnedTabsOnSeparateRow', newSettingValue);
723
}
724
});
725
726
// --- Toggle Zen Mode
727
728
registerAction2(class extends Action2 {
729
730
constructor() {
731
super({
732
id: 'workbench.action.toggleZenMode',
733
title: {
734
...localize2('toggleZenMode', "Toggle Zen Mode"),
735
mnemonicTitle: localize({ key: 'miToggleZenMode', comment: ['&& denotes a mnemonic'] }, "Zen Mode"),
736
},
737
precondition: IsAuxiliaryWindowFocusedContext.toNegated(),
738
category: Categories.View,
739
f1: true,
740
keybinding: {
741
weight: KeybindingWeight.WorkbenchContrib,
742
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.KeyZ)
743
},
744
toggled: InEditorZenModeContext,
745
menu: [{
746
id: MenuId.MenubarAppearanceMenu,
747
group: '1_toggle_view',
748
order: 2
749
}]
750
});
751
}
752
753
run(accessor: ServicesAccessor): void {
754
return accessor.get(IWorkbenchLayoutService).toggleZenMode();
755
}
756
});
757
758
KeybindingsRegistry.registerCommandAndKeybindingRule({
759
id: 'workbench.action.exitZenMode',
760
weight: KeybindingWeight.EditorContrib - 1000,
761
handler(accessor: ServicesAccessor) {
762
const layoutService = accessor.get(IWorkbenchLayoutService);
763
const contextKeyService = accessor.get(IContextKeyService);
764
if (InEditorZenModeContext.getValue(contextKeyService)) {
765
layoutService.toggleZenMode();
766
}
767
},
768
when: InEditorZenModeContext,
769
primary: KeyChord(KeyCode.Escape, KeyCode.Escape)
770
});
771
772
// --- Toggle Menu Bar
773
774
if (isWindows || isLinux || isWeb) {
775
registerAction2(class ToggleMenubarAction extends Action2 {
776
777
constructor() {
778
super({
779
id: 'workbench.action.toggleMenuBar',
780
title: {
781
...localize2('toggleMenuBar', "Toggle Menu Bar"),
782
mnemonicTitle: localize({ key: 'miMenuBar', comment: ['&& denotes a mnemonic'] }, "Menu &&Bar"),
783
},
784
category: Categories.View,
785
f1: true,
786
toggled: ContextKeyExpr.and(IsMacNativeContext.toNegated(), ContextKeyExpr.notEquals(`config.${MenuSettings.MenuBarVisibility}`, 'hidden'), ContextKeyExpr.notEquals(`config.${MenuSettings.MenuBarVisibility}`, 'toggle'), ContextKeyExpr.notEquals(`config.${MenuSettings.MenuBarVisibility}`, 'compact')),
787
menu: [{
788
id: MenuId.MenubarAppearanceMenu,
789
group: '2_workbench_layout',
790
order: 0
791
}]
792
});
793
}
794
795
run(accessor: ServicesAccessor): void {
796
return accessor.get(IWorkbenchLayoutService).toggleMenuBar();
797
}
798
});
799
800
// Add separately to title bar context menu so we can use a different title
801
for (const menuId of [MenuId.TitleBarContext, MenuId.TitleBarTitleContext]) {
802
MenuRegistry.appendMenuItem(menuId, {
803
command: {
804
id: 'workbench.action.toggleMenuBar',
805
title: localize('miMenuBarNoMnemonic', "Menu Bar"),
806
toggled: ContextKeyExpr.and(IsMacNativeContext.toNegated(), ContextKeyExpr.notEquals(`config.${MenuSettings.MenuBarVisibility}`, 'hidden'), ContextKeyExpr.notEquals(`config.${MenuSettings.MenuBarVisibility}`, 'toggle'), ContextKeyExpr.notEquals(`config.${MenuSettings.MenuBarVisibility}`, 'compact'))
807
},
808
when: ContextKeyExpr.and(IsAuxiliaryWindowFocusedContext.toNegated(), ContextKeyExpr.notEquals(TitleBarStyleContext.key, TitlebarStyle.NATIVE), IsMainWindowFullscreenContext.negate()),
809
group: '2_config',
810
order: 0
811
});
812
}
813
}
814
815
// --- Reset View Locations
816
817
registerAction2(class extends Action2 {
818
819
constructor() {
820
super({
821
id: 'workbench.action.resetViewLocations',
822
title: localize2('resetViewLocations', "Reset View Locations"),
823
category: Categories.View,
824
f1: true
825
});
826
}
827
828
run(accessor: ServicesAccessor): void {
829
return accessor.get(IViewDescriptorService).reset();
830
}
831
});
832
833
// --- Move View
834
835
registerAction2(class extends Action2 {
836
837
constructor() {
838
super({
839
id: 'workbench.action.moveView',
840
title: localize2('moveView', "Move View"),
841
category: Categories.View,
842
f1: true
843
});
844
}
845
846
async run(accessor: ServicesAccessor): Promise<void> {
847
const viewDescriptorService = accessor.get(IViewDescriptorService);
848
const instantiationService = accessor.get(IInstantiationService);
849
const quickInputService = accessor.get(IQuickInputService);
850
const contextKeyService = accessor.get(IContextKeyService);
851
const paneCompositePartService = accessor.get(IPaneCompositePartService);
852
853
const focusedViewId = FocusedViewContext.getValue(contextKeyService);
854
let viewId: string;
855
856
if (focusedViewId && viewDescriptorService.getViewDescriptorById(focusedViewId)?.canMoveView) {
857
viewId = focusedViewId;
858
}
859
860
try {
861
viewId = await this.getView(quickInputService, viewDescriptorService, paneCompositePartService, viewId!);
862
if (!viewId) {
863
return;
864
}
865
866
const moveFocusedViewAction = new MoveFocusedViewAction();
867
instantiationService.invokeFunction(accessor => moveFocusedViewAction.run(accessor, viewId));
868
} catch { }
869
}
870
871
private getViewItems(viewDescriptorService: IViewDescriptorService, paneCompositePartService: IPaneCompositePartService): Array<QuickPickItem> {
872
const results: Array<QuickPickItem> = [];
873
874
const viewlets = paneCompositePartService.getVisiblePaneCompositeIds(ViewContainerLocation.Sidebar);
875
viewlets.forEach(viewletId => {
876
const container = viewDescriptorService.getViewContainerById(viewletId)!;
877
const containerModel = viewDescriptorService.getViewContainerModel(container);
878
879
let hasAddedView = false;
880
containerModel.visibleViewDescriptors.forEach(viewDescriptor => {
881
if (viewDescriptor.canMoveView) {
882
if (!hasAddedView) {
883
results.push({
884
type: 'separator',
885
label: localize('sidebarContainer', "Side Bar / {0}", containerModel.title)
886
});
887
hasAddedView = true;
888
}
889
890
results.push({
891
id: viewDescriptor.id,
892
label: viewDescriptor.name.value
893
});
894
}
895
});
896
});
897
898
const panels = paneCompositePartService.getPinnedPaneCompositeIds(ViewContainerLocation.Panel);
899
panels.forEach(panel => {
900
const container = viewDescriptorService.getViewContainerById(panel)!;
901
const containerModel = viewDescriptorService.getViewContainerModel(container);
902
903
let hasAddedView = false;
904
containerModel.visibleViewDescriptors.forEach(viewDescriptor => {
905
if (viewDescriptor.canMoveView) {
906
if (!hasAddedView) {
907
results.push({
908
type: 'separator',
909
label: localize('panelContainer', "Panel / {0}", containerModel.title)
910
});
911
hasAddedView = true;
912
}
913
914
results.push({
915
id: viewDescriptor.id,
916
label: viewDescriptor.name.value
917
});
918
}
919
});
920
});
921
922
923
const sidePanels = paneCompositePartService.getPinnedPaneCompositeIds(ViewContainerLocation.AuxiliaryBar);
924
sidePanels.forEach(panel => {
925
const container = viewDescriptorService.getViewContainerById(panel)!;
926
const containerModel = viewDescriptorService.getViewContainerModel(container);
927
928
let hasAddedView = false;
929
containerModel.visibleViewDescriptors.forEach(viewDescriptor => {
930
if (viewDescriptor.canMoveView) {
931
if (!hasAddedView) {
932
results.push({
933
type: 'separator',
934
label: localize('secondarySideBarContainer', "Secondary Side Bar / {0}", containerModel.title)
935
});
936
hasAddedView = true;
937
}
938
939
results.push({
940
id: viewDescriptor.id,
941
label: viewDescriptor.name.value
942
});
943
}
944
});
945
});
946
947
return results;
948
}
949
950
private async getView(quickInputService: IQuickInputService, viewDescriptorService: IViewDescriptorService, paneCompositePartService: IPaneCompositePartService, viewId?: string): Promise<string> {
951
const disposables = new DisposableStore();
952
const quickPick = disposables.add(quickInputService.createQuickPick({ useSeparators: true }));
953
quickPick.placeholder = localize('moveFocusedView.selectView', "Select a View to Move");
954
quickPick.items = this.getViewItems(viewDescriptorService, paneCompositePartService);
955
quickPick.selectedItems = quickPick.items.filter(item => (item as IQuickPickItem).id === viewId) as IQuickPickItem[];
956
957
return new Promise((resolve, reject) => {
958
disposables.add(quickPick.onDidAccept(() => {
959
const viewId = quickPick.selectedItems[0];
960
if (viewId.id) {
961
resolve(viewId.id);
962
} else {
963
reject();
964
}
965
966
quickPick.hide();
967
}));
968
969
disposables.add(quickPick.onDidHide(() => {
970
disposables.dispose();
971
reject();
972
}));
973
974
quickPick.show();
975
});
976
}
977
});
978
979
// --- Move Focused View
980
981
class MoveFocusedViewAction extends Action2 {
982
983
constructor() {
984
super({
985
id: 'workbench.action.moveFocusedView',
986
title: localize2('moveFocusedView', "Move Focused View"),
987
category: Categories.View,
988
precondition: FocusedViewContext.notEqualsTo(''),
989
f1: true
990
});
991
}
992
993
run(accessor: ServicesAccessor, viewId?: string): void {
994
const viewDescriptorService = accessor.get(IViewDescriptorService);
995
const viewsService = accessor.get(IViewsService);
996
const quickInputService = accessor.get(IQuickInputService);
997
const contextKeyService = accessor.get(IContextKeyService);
998
const dialogService = accessor.get(IDialogService);
999
const paneCompositePartService = accessor.get(IPaneCompositePartService);
1000
1001
const focusedViewId = viewId || FocusedViewContext.getValue(contextKeyService);
1002
1003
if (focusedViewId === undefined || focusedViewId.trim() === '') {
1004
dialogService.error(localize('moveFocusedView.error.noFocusedView', "There is no view currently focused."));
1005
return;
1006
}
1007
1008
const viewDescriptor = viewDescriptorService.getViewDescriptorById(focusedViewId);
1009
if (!viewDescriptor || !viewDescriptor.canMoveView) {
1010
dialogService.error(localize('moveFocusedView.error.nonMovableView', "The currently focused view is not movable."));
1011
return;
1012
}
1013
1014
const disposables = new DisposableStore();
1015
const quickPick = disposables.add(quickInputService.createQuickPick({ useSeparators: true }));
1016
quickPick.placeholder = localize('moveFocusedView.selectDestination', "Select a Destination for the View");
1017
quickPick.title = localize({ key: 'moveFocusedView.title', comment: ['{0} indicates the title of the view the user has selected to move.'] }, "View: Move {0}", viewDescriptor.name.value);
1018
1019
const items: Array<IQuickPickItem | IQuickPickSeparator> = [];
1020
const currentContainer = viewDescriptorService.getViewContainerByViewId(focusedViewId)!;
1021
const currentLocation = viewDescriptorService.getViewLocationById(focusedViewId)!;
1022
const isViewSolo = viewDescriptorService.getViewContainerModel(currentContainer).allViewDescriptors.length === 1;
1023
1024
if (!(isViewSolo && currentLocation === ViewContainerLocation.Panel)) {
1025
items.push({
1026
id: '_.panel.newcontainer',
1027
label: localize({ key: 'moveFocusedView.newContainerInPanel', comment: ['Creates a new top-level tab in the panel.'] }, "New Panel Entry"),
1028
});
1029
}
1030
1031
if (!(isViewSolo && currentLocation === ViewContainerLocation.Sidebar)) {
1032
items.push({
1033
id: '_.sidebar.newcontainer',
1034
label: localize('moveFocusedView.newContainerInSidebar', "New Side Bar Entry")
1035
});
1036
}
1037
1038
if (!(isViewSolo && currentLocation === ViewContainerLocation.AuxiliaryBar)) {
1039
items.push({
1040
id: '_.auxiliarybar.newcontainer',
1041
label: localize('moveFocusedView.newContainerInSidePanel', "New Secondary Side Bar Entry")
1042
});
1043
}
1044
1045
items.push({
1046
type: 'separator',
1047
label: localize('sidebar', "Side Bar")
1048
});
1049
1050
const pinnedViewlets = paneCompositePartService.getVisiblePaneCompositeIds(ViewContainerLocation.Sidebar);
1051
items.push(...pinnedViewlets
1052
.filter(viewletId => {
1053
if (viewletId === viewDescriptorService.getViewContainerByViewId(focusedViewId)!.id) {
1054
return false;
1055
}
1056
1057
return !viewDescriptorService.getViewContainerById(viewletId)!.rejectAddedViews;
1058
})
1059
.map(viewletId => {
1060
return {
1061
id: viewletId,
1062
label: viewDescriptorService.getViewContainerModel(viewDescriptorService.getViewContainerById(viewletId)!)!.title
1063
};
1064
}));
1065
1066
items.push({
1067
type: 'separator',
1068
label: localize('panel', "Panel")
1069
});
1070
1071
const pinnedPanels = paneCompositePartService.getPinnedPaneCompositeIds(ViewContainerLocation.Panel);
1072
items.push(...pinnedPanels
1073
.filter(panel => {
1074
if (panel === viewDescriptorService.getViewContainerByViewId(focusedViewId)!.id) {
1075
return false;
1076
}
1077
1078
return !viewDescriptorService.getViewContainerById(panel)!.rejectAddedViews;
1079
})
1080
.map(panel => {
1081
return {
1082
id: panel,
1083
label: viewDescriptorService.getViewContainerModel(viewDescriptorService.getViewContainerById(panel)!)!.title
1084
};
1085
}));
1086
1087
items.push({
1088
type: 'separator',
1089
label: localize('secondarySideBar', "Secondary Side Bar")
1090
});
1091
1092
const pinnedAuxPanels = paneCompositePartService.getPinnedPaneCompositeIds(ViewContainerLocation.AuxiliaryBar);
1093
items.push(...pinnedAuxPanels
1094
.filter(panel => {
1095
if (panel === viewDescriptorService.getViewContainerByViewId(focusedViewId)!.id) {
1096
return false;
1097
}
1098
1099
return !viewDescriptorService.getViewContainerById(panel)!.rejectAddedViews;
1100
})
1101
.map(panel => {
1102
return {
1103
id: panel,
1104
label: viewDescriptorService.getViewContainerModel(viewDescriptorService.getViewContainerById(panel)!)!.title
1105
};
1106
}));
1107
1108
quickPick.items = items;
1109
1110
disposables.add(quickPick.onDidAccept(() => {
1111
const destination = quickPick.selectedItems[0];
1112
1113
if (destination.id === '_.panel.newcontainer') {
1114
viewDescriptorService.moveViewToLocation(viewDescriptor, ViewContainerLocation.Panel, this.desc.id);
1115
viewsService.openView(focusedViewId, true);
1116
} else if (destination.id === '_.sidebar.newcontainer') {
1117
viewDescriptorService.moveViewToLocation(viewDescriptor, ViewContainerLocation.Sidebar, this.desc.id);
1118
viewsService.openView(focusedViewId, true);
1119
} else if (destination.id === '_.auxiliarybar.newcontainer') {
1120
viewDescriptorService.moveViewToLocation(viewDescriptor, ViewContainerLocation.AuxiliaryBar, this.desc.id);
1121
viewsService.openView(focusedViewId, true);
1122
} else if (destination.id) {
1123
viewDescriptorService.moveViewsToContainer([viewDescriptor], viewDescriptorService.getViewContainerById(destination.id)!, undefined, this.desc.id);
1124
viewsService.openView(focusedViewId, true);
1125
}
1126
1127
quickPick.hide();
1128
}));
1129
1130
disposables.add(quickPick.onDidHide(() => disposables.dispose()));
1131
1132
quickPick.show();
1133
}
1134
}
1135
1136
registerAction2(MoveFocusedViewAction);
1137
1138
// --- Reset Focused View Location
1139
1140
registerAction2(class extends Action2 {
1141
1142
constructor() {
1143
super({
1144
id: 'workbench.action.resetFocusedViewLocation',
1145
title: localize2('resetFocusedViewLocation', "Reset Focused View Location"),
1146
category: Categories.View,
1147
f1: true,
1148
precondition: FocusedViewContext.notEqualsTo('')
1149
});
1150
}
1151
1152
run(accessor: ServicesAccessor): void {
1153
const viewDescriptorService = accessor.get(IViewDescriptorService);
1154
const contextKeyService = accessor.get(IContextKeyService);
1155
const dialogService = accessor.get(IDialogService);
1156
const viewsService = accessor.get(IViewsService);
1157
1158
const focusedViewId = FocusedViewContext.getValue(contextKeyService);
1159
1160
let viewDescriptor: IViewDescriptor | null = null;
1161
if (focusedViewId !== undefined && focusedViewId.trim() !== '') {
1162
viewDescriptor = viewDescriptorService.getViewDescriptorById(focusedViewId);
1163
}
1164
1165
if (!viewDescriptor) {
1166
dialogService.error(localize('resetFocusedView.error.noFocusedView', "There is no view currently focused."));
1167
return;
1168
}
1169
1170
const defaultContainer = viewDescriptorService.getDefaultContainerById(viewDescriptor.id);
1171
if (!defaultContainer || defaultContainer === viewDescriptorService.getViewContainerByViewId(viewDescriptor.id)) {
1172
return;
1173
}
1174
1175
viewDescriptorService.moveViewsToContainer([viewDescriptor], defaultContainer, undefined, this.desc.id);
1176
viewsService.openView(viewDescriptor.id, true);
1177
}
1178
});
1179
1180
// --- Resize View
1181
1182
abstract class BaseResizeViewAction extends Action2 {
1183
1184
protected static readonly RESIZE_INCREMENT = 60; // This is a css pixel size
1185
1186
protected resizePart(widthChange: number, heightChange: number, layoutService: IWorkbenchLayoutService, partToResize?: Parts): void {
1187
1188
let part: Parts | undefined;
1189
if (partToResize === undefined) {
1190
const isEditorFocus = layoutService.hasFocus(Parts.EDITOR_PART);
1191
const isSidebarFocus = layoutService.hasFocus(Parts.SIDEBAR_PART);
1192
const isPanelFocus = layoutService.hasFocus(Parts.PANEL_PART);
1193
const isAuxiliaryBarFocus = layoutService.hasFocus(Parts.AUXILIARYBAR_PART);
1194
1195
if (isSidebarFocus) {
1196
part = Parts.SIDEBAR_PART;
1197
} else if (isPanelFocus) {
1198
part = Parts.PANEL_PART;
1199
} else if (isEditorFocus) {
1200
part = Parts.EDITOR_PART;
1201
} else if (isAuxiliaryBarFocus) {
1202
part = Parts.AUXILIARYBAR_PART;
1203
}
1204
} else {
1205
part = partToResize;
1206
}
1207
1208
if (part) {
1209
layoutService.resizePart(part, widthChange, heightChange);
1210
}
1211
}
1212
}
1213
1214
class IncreaseViewSizeAction extends BaseResizeViewAction {
1215
1216
constructor() {
1217
super({
1218
id: 'workbench.action.increaseViewSize',
1219
title: localize2('increaseViewSize', 'Increase Current View Size'),
1220
f1: true,
1221
precondition: IsAuxiliaryWindowFocusedContext.toNegated()
1222
});
1223
}
1224
1225
run(accessor: ServicesAccessor): void {
1226
this.resizePart(BaseResizeViewAction.RESIZE_INCREMENT, BaseResizeViewAction.RESIZE_INCREMENT, accessor.get(IWorkbenchLayoutService));
1227
}
1228
}
1229
1230
class IncreaseViewWidthAction extends BaseResizeViewAction {
1231
1232
constructor() {
1233
super({
1234
id: 'workbench.action.increaseViewWidth',
1235
title: localize2('increaseEditorWidth', 'Increase Editor Width'),
1236
f1: true,
1237
precondition: IsAuxiliaryWindowFocusedContext.toNegated()
1238
});
1239
}
1240
1241
run(accessor: ServicesAccessor): void {
1242
this.resizePart(BaseResizeViewAction.RESIZE_INCREMENT, 0, accessor.get(IWorkbenchLayoutService), Parts.EDITOR_PART);
1243
}
1244
}
1245
1246
class IncreaseViewHeightAction extends BaseResizeViewAction {
1247
1248
constructor() {
1249
super({
1250
id: 'workbench.action.increaseViewHeight',
1251
title: localize2('increaseEditorHeight', 'Increase Editor Height'),
1252
f1: true,
1253
precondition: IsAuxiliaryWindowFocusedContext.toNegated()
1254
});
1255
}
1256
1257
run(accessor: ServicesAccessor): void {
1258
this.resizePart(0, BaseResizeViewAction.RESIZE_INCREMENT, accessor.get(IWorkbenchLayoutService), Parts.EDITOR_PART);
1259
}
1260
}
1261
1262
class DecreaseViewSizeAction extends BaseResizeViewAction {
1263
1264
constructor() {
1265
super({
1266
id: 'workbench.action.decreaseViewSize',
1267
title: localize2('decreaseViewSize', 'Decrease Current View Size'),
1268
f1: true,
1269
precondition: IsAuxiliaryWindowFocusedContext.toNegated()
1270
});
1271
}
1272
1273
run(accessor: ServicesAccessor): void {
1274
this.resizePart(-BaseResizeViewAction.RESIZE_INCREMENT, -BaseResizeViewAction.RESIZE_INCREMENT, accessor.get(IWorkbenchLayoutService));
1275
}
1276
}
1277
1278
class DecreaseViewWidthAction extends BaseResizeViewAction {
1279
constructor() {
1280
super({
1281
id: 'workbench.action.decreaseViewWidth',
1282
title: localize2('decreaseEditorWidth', 'Decrease Editor Width'),
1283
f1: true,
1284
precondition: IsAuxiliaryWindowFocusedContext.toNegated()
1285
});
1286
}
1287
1288
run(accessor: ServicesAccessor): void {
1289
this.resizePart(-BaseResizeViewAction.RESIZE_INCREMENT, 0, accessor.get(IWorkbenchLayoutService), Parts.EDITOR_PART);
1290
}
1291
}
1292
1293
class DecreaseViewHeightAction extends BaseResizeViewAction {
1294
1295
constructor() {
1296
super({
1297
id: 'workbench.action.decreaseViewHeight',
1298
title: localize2('decreaseEditorHeight', 'Decrease Editor Height'),
1299
f1: true,
1300
precondition: IsAuxiliaryWindowFocusedContext.toNegated()
1301
});
1302
}
1303
1304
run(accessor: ServicesAccessor): void {
1305
this.resizePart(0, -BaseResizeViewAction.RESIZE_INCREMENT, accessor.get(IWorkbenchLayoutService), Parts.EDITOR_PART);
1306
}
1307
}
1308
1309
registerAction2(IncreaseViewSizeAction);
1310
registerAction2(IncreaseViewWidthAction);
1311
registerAction2(IncreaseViewHeightAction);
1312
1313
registerAction2(DecreaseViewSizeAction);
1314
registerAction2(DecreaseViewWidthAction);
1315
registerAction2(DecreaseViewHeightAction);
1316
1317
//#region Quick Input Alignment Actions
1318
1319
registerAction2(class AlignQuickInputTopAction extends Action2 {
1320
1321
constructor() {
1322
super({
1323
id: 'workbench.action.alignQuickInputTop',
1324
title: localize2('alignQuickInputTop', 'Align Quick Input Top'),
1325
f1: false
1326
});
1327
}
1328
1329
run(accessor: ServicesAccessor): void {
1330
const quickInputService = accessor.get(IQuickInputService);
1331
quickInputService.setAlignment('top');
1332
}
1333
});
1334
1335
registerAction2(class AlignQuickInputCenterAction extends Action2 {
1336
1337
constructor() {
1338
super({
1339
id: 'workbench.action.alignQuickInputCenter',
1340
title: localize2('alignQuickInputCenter', 'Align Quick Input Center'),
1341
f1: false
1342
});
1343
}
1344
1345
run(accessor: ServicesAccessor): void {
1346
const quickInputService = accessor.get(IQuickInputService);
1347
quickInputService.setAlignment('center');
1348
}
1349
});
1350
1351
//#endregion
1352
1353
type ContextualLayoutVisualIcon = { iconA: ThemeIcon; iconB: ThemeIcon; whenA: ContextKeyExpression };
1354
type LayoutVisualIcon = ThemeIcon | ContextualLayoutVisualIcon;
1355
1356
function isContextualLayoutVisualIcon(icon: LayoutVisualIcon): icon is ContextualLayoutVisualIcon {
1357
return (icon as ContextualLayoutVisualIcon).iconA !== undefined;
1358
}
1359
1360
interface CustomizeLayoutItem {
1361
id: string;
1362
active: ContextKeyExpression;
1363
label: string;
1364
activeIcon: ThemeIcon;
1365
visualIcon?: LayoutVisualIcon;
1366
activeAriaLabel: string;
1367
inactiveIcon?: ThemeIcon;
1368
inactiveAriaLabel?: string;
1369
useButtons: boolean;
1370
}
1371
1372
const CreateToggleLayoutItem = (id: string, active: ContextKeyExpression, label: string, visualIcon?: LayoutVisualIcon): CustomizeLayoutItem => {
1373
return {
1374
id,
1375
active,
1376
label,
1377
visualIcon,
1378
activeIcon: Codicon.eye,
1379
inactiveIcon: Codicon.eyeClosed,
1380
activeAriaLabel: localize('selectToHide', "Select to Hide"),
1381
inactiveAriaLabel: localize('selectToShow', "Select to Show"),
1382
useButtons: true,
1383
};
1384
};
1385
1386
const CreateOptionLayoutItem = (id: string, active: ContextKeyExpression, label: string, visualIcon?: LayoutVisualIcon): CustomizeLayoutItem => {
1387
return {
1388
id,
1389
active,
1390
label,
1391
visualIcon,
1392
activeIcon: Codicon.check,
1393
activeAriaLabel: localize('active', "Active"),
1394
useButtons: false
1395
};
1396
};
1397
1398
const MenuBarToggledContext = ContextKeyExpr.and(IsMacNativeContext.toNegated(), ContextKeyExpr.notEquals(`config.${MenuSettings.MenuBarVisibility}`, 'hidden'), ContextKeyExpr.notEquals(`config.${MenuSettings.MenuBarVisibility}`, 'toggle'), ContextKeyExpr.notEquals(`config.${MenuSettings.MenuBarVisibility}`, 'compact')) as ContextKeyExpression;
1399
const ToggleVisibilityActions: CustomizeLayoutItem[] = [];
1400
if (!isMacintosh || !isNative) {
1401
ToggleVisibilityActions.push(CreateToggleLayoutItem('workbench.action.toggleMenuBar', MenuBarToggledContext, localize('menuBar', "Menu Bar"), menubarIcon));
1402
}
1403
1404
ToggleVisibilityActions.push(...[
1405
CreateToggleLayoutItem(ToggleActivityBarVisibilityActionId, ContextKeyExpr.notEquals('config.workbench.activityBar.location', 'hidden'), localize('activityBar', "Activity Bar"), { whenA: ContextKeyExpr.equals('config.workbench.sideBar.location', 'left'), iconA: activityBarLeftIcon, iconB: activityBarRightIcon }),
1406
CreateToggleLayoutItem(ToggleSidebarVisibilityAction.ID, SideBarVisibleContext, localize('sideBar', "Primary Side Bar"), { whenA: ContextKeyExpr.equals('config.workbench.sideBar.location', 'left'), iconA: panelLeftIcon, iconB: panelRightIcon }),
1407
CreateToggleLayoutItem(ToggleAuxiliaryBarAction.ID, AuxiliaryBarVisibleContext, localize('secondarySideBar', "Secondary Side Bar"), { whenA: ContextKeyExpr.equals('config.workbench.sideBar.location', 'left'), iconA: panelRightIcon, iconB: panelLeftIcon }),
1408
CreateToggleLayoutItem(TogglePanelAction.ID, PanelVisibleContext, localize('panel', "Panel"), panelIcon),
1409
CreateToggleLayoutItem(ToggleStatusbarVisibilityAction.ID, ContextKeyExpr.equals('config.workbench.statusBar.visible', true), localize('statusBar', "Status Bar"), statusBarIcon),
1410
]);
1411
1412
const MoveSideBarActions: CustomizeLayoutItem[] = [
1413
CreateOptionLayoutItem(MoveSidebarLeftAction.ID, ContextKeyExpr.equals('config.workbench.sideBar.location', 'left'), localize('leftSideBar', "Left"), panelLeftIcon),
1414
CreateOptionLayoutItem(MoveSidebarRightAction.ID, ContextKeyExpr.equals('config.workbench.sideBar.location', 'right'), localize('rightSideBar', "Right"), panelRightIcon),
1415
];
1416
1417
const AlignPanelActions: CustomizeLayoutItem[] = [
1418
CreateOptionLayoutItem('workbench.action.alignPanelLeft', PanelAlignmentContext.isEqualTo('left'), localize('leftPanel', "Left"), panelAlignmentLeftIcon),
1419
CreateOptionLayoutItem('workbench.action.alignPanelRight', PanelAlignmentContext.isEqualTo('right'), localize('rightPanel', "Right"), panelAlignmentRightIcon),
1420
CreateOptionLayoutItem('workbench.action.alignPanelCenter', PanelAlignmentContext.isEqualTo('center'), localize('centerPanel', "Center"), panelAlignmentCenterIcon),
1421
CreateOptionLayoutItem('workbench.action.alignPanelJustify', PanelAlignmentContext.isEqualTo('justify'), localize('justifyPanel', "Justify"), panelAlignmentJustifyIcon),
1422
];
1423
1424
const QuickInputActions: CustomizeLayoutItem[] = [
1425
CreateOptionLayoutItem('workbench.action.alignQuickInputTop', QuickInputAlignmentContextKey.isEqualTo('top'), localize('top', "Top"), quickInputAlignmentTopIcon),
1426
CreateOptionLayoutItem('workbench.action.alignQuickInputCenter', QuickInputAlignmentContextKey.isEqualTo('center'), localize('center', "Center"), quickInputAlignmentCenterIcon),
1427
];
1428
1429
const MiscLayoutOptions: CustomizeLayoutItem[] = [
1430
CreateOptionLayoutItem('workbench.action.toggleFullScreen', IsMainWindowFullscreenContext, localize('fullscreen', "Full Screen"), fullscreenIcon),
1431
CreateOptionLayoutItem('workbench.action.toggleZenMode', InEditorZenModeContext, localize('zenMode', "Zen Mode"), zenModeIcon),
1432
CreateOptionLayoutItem('workbench.action.toggleCenteredLayout', IsMainEditorCenteredLayoutContext, localize('centeredLayout', "Centered Layout"), centerLayoutIcon),
1433
];
1434
1435
const LayoutContextKeySet = new Set<string>();
1436
for (const { active } of [...ToggleVisibilityActions, ...MoveSideBarActions, ...AlignPanelActions, ...QuickInputActions, ...MiscLayoutOptions]) {
1437
for (const key of active.keys()) {
1438
LayoutContextKeySet.add(key);
1439
}
1440
}
1441
1442
registerAction2(class CustomizeLayoutAction extends Action2 {
1443
1444
private _currentQuickPick?: IQuickPick<IQuickPickItem, { useSeparators: true }>;
1445
1446
constructor() {
1447
super({
1448
id: 'workbench.action.customizeLayout',
1449
title: localize2('customizeLayout', "Customize Layout..."),
1450
f1: true,
1451
icon: configureLayoutIcon,
1452
menu: [
1453
{
1454
id: MenuId.LayoutControlMenuSubmenu,
1455
group: 'z_end',
1456
},
1457
{
1458
id: MenuId.LayoutControlMenu,
1459
when: ContextKeyExpr.and(
1460
IsAuxiliaryWindowContext.toNegated(),
1461
ContextKeyExpr.equals('config.workbench.layoutControl.type', 'both')
1462
),
1463
group: '1_layout'
1464
}
1465
]
1466
});
1467
}
1468
1469
getItems(contextKeyService: IContextKeyService, keybindingService: IKeybindingService): QuickPickItem[] {
1470
const toQuickPickItem = (item: CustomizeLayoutItem): IQuickPickItem => {
1471
const toggled = item.active.evaluate(contextKeyService.getContext(null));
1472
let label = item.useButtons ?
1473
item.label :
1474
item.label + (toggled && item.activeIcon ? ` $(${item.activeIcon.id})` : (!toggled && item.inactiveIcon ? ` $(${item.inactiveIcon.id})` : ''));
1475
const ariaLabel =
1476
item.label + (toggled && item.activeAriaLabel ? ` (${item.activeAriaLabel})` : (!toggled && item.inactiveAriaLabel ? ` (${item.inactiveAriaLabel})` : ''));
1477
1478
if (item.visualIcon) {
1479
let icon = item.visualIcon;
1480
if (isContextualLayoutVisualIcon(icon)) {
1481
const useIconA = icon.whenA.evaluate(contextKeyService.getContext(null));
1482
icon = useIconA ? icon.iconA : icon.iconB;
1483
}
1484
1485
label = `$(${icon.id}) ${label}`;
1486
}
1487
1488
const icon = toggled ? item.activeIcon : item.inactiveIcon;
1489
1490
return {
1491
type: 'item',
1492
id: item.id,
1493
label,
1494
ariaLabel,
1495
keybinding: keybindingService.lookupKeybinding(item.id, contextKeyService),
1496
buttons: !item.useButtons ? undefined : [
1497
{
1498
alwaysVisible: false,
1499
tooltip: ariaLabel,
1500
iconClass: icon ? ThemeIcon.asClassName(icon) : undefined
1501
}
1502
]
1503
};
1504
};
1505
return [
1506
{
1507
type: 'separator',
1508
label: localize('toggleVisibility', "Visibility")
1509
},
1510
...ToggleVisibilityActions.map(toQuickPickItem),
1511
{
1512
type: 'separator',
1513
label: localize('sideBarPosition', "Primary Side Bar Position")
1514
},
1515
...MoveSideBarActions.map(toQuickPickItem),
1516
{
1517
type: 'separator',
1518
label: localize('panelAlignment', "Panel Alignment")
1519
},
1520
...AlignPanelActions.map(toQuickPickItem),
1521
{
1522
type: 'separator',
1523
label: localize('quickOpen', "Quick Input Position")
1524
},
1525
...QuickInputActions.map(toQuickPickItem),
1526
{
1527
type: 'separator',
1528
label: localize('layoutModes', "Modes"),
1529
},
1530
...MiscLayoutOptions.map(toQuickPickItem),
1531
];
1532
}
1533
1534
run(accessor: ServicesAccessor): void {
1535
if (this._currentQuickPick) {
1536
this._currentQuickPick.hide();
1537
return;
1538
}
1539
1540
const configurationService = accessor.get(IConfigurationService);
1541
const contextKeyService = accessor.get(IContextKeyService);
1542
const commandService = accessor.get(ICommandService);
1543
const quickInputService = accessor.get(IQuickInputService);
1544
const keybindingService = accessor.get(IKeybindingService);
1545
1546
const disposables = new DisposableStore();
1547
1548
const quickPick = disposables.add(quickInputService.createQuickPick({ useSeparators: true }));
1549
1550
this._currentQuickPick = quickPick;
1551
quickPick.items = this.getItems(contextKeyService, keybindingService);
1552
quickPick.ignoreFocusOut = true;
1553
quickPick.hideInput = true;
1554
quickPick.title = localize('customizeLayoutQuickPickTitle', "Customize Layout");
1555
1556
const closeButton = {
1557
alwaysVisible: true,
1558
iconClass: ThemeIcon.asClassName(Codicon.close),
1559
tooltip: localize('close', "Close")
1560
};
1561
1562
const resetButton = {
1563
alwaysVisible: true,
1564
iconClass: ThemeIcon.asClassName(Codicon.discard),
1565
tooltip: localize('restore defaults', "Restore Defaults")
1566
};
1567
1568
quickPick.buttons = [
1569
resetButton,
1570
closeButton
1571
];
1572
1573
let selectedItem: CustomizeLayoutItem | undefined = undefined;
1574
disposables.add(contextKeyService.onDidChangeContext(changeEvent => {
1575
if (changeEvent.affectsSome(LayoutContextKeySet)) {
1576
quickPick.items = this.getItems(contextKeyService, keybindingService);
1577
if (selectedItem) {
1578
quickPick.activeItems = quickPick.items.filter(item => (item as CustomizeLayoutItem).id === selectedItem?.id) as IQuickPickItem[];
1579
}
1580
1581
setTimeout(() => quickInputService.focus(), 0);
1582
}
1583
}));
1584
1585
disposables.add(quickPick.onDidAccept(event => {
1586
if (quickPick.selectedItems.length) {
1587
selectedItem = quickPick.selectedItems[0] as CustomizeLayoutItem;
1588
commandService.executeCommand(selectedItem.id);
1589
}
1590
}));
1591
1592
disposables.add(quickPick.onDidTriggerItemButton(event => {
1593
if (event.item) {
1594
selectedItem = event.item as CustomizeLayoutItem;
1595
commandService.executeCommand(selectedItem.id);
1596
}
1597
}));
1598
1599
disposables.add(quickPick.onDidTriggerButton((button) => {
1600
if (button === closeButton) {
1601
quickPick.hide();
1602
} else if (button === resetButton) {
1603
1604
const resetSetting = (id: string) => {
1605
const config = configurationService.inspect(id);
1606
configurationService.updateValue(id, config.defaultValue);
1607
};
1608
1609
// Reset all layout options
1610
resetSetting('workbench.activityBar.location');
1611
resetSetting('workbench.sideBar.location');
1612
resetSetting('workbench.statusBar.visible');
1613
resetSetting('workbench.panel.defaultLocation');
1614
1615
if (!isMacintosh || !isNative) {
1616
resetSetting('window.menuBarVisibility');
1617
}
1618
1619
commandService.executeCommand('workbench.action.alignPanelCenter');
1620
commandService.executeCommand('workbench.action.alignQuickInputTop');
1621
}
1622
}));
1623
1624
disposables.add(quickPick.onDidHide(() => {
1625
quickPick.dispose();
1626
}));
1627
1628
disposables.add(quickPick.onDispose(() => {
1629
this._currentQuickPick = undefined;
1630
disposables.dispose();
1631
}));
1632
1633
quickPick.show();
1634
}
1635
});
1636
1637