@codingame/monaco-vscode-api 1.78.5 → 1.78.6
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/dist/node_modules/tslib/tslib.es6.js +2 -2
- package/dist/vscode/vs/platform/extensionManagement/common/extensionManagement.js +1 -2
- package/dist/vscode/vs/platform/extensionManagement/common/implicitActivationEvents.js +1 -1
- package/dist/vscode/vs/platform/files/common/fileService.js +3 -3
- package/dist/vscode/vs/platform/files/common/inMemoryFilesystemProvider.js +1 -1
- package/dist/vscode/vs/platform/telemetry/common/telemetryUtils.js +1 -1
- package/dist/vscode/vs/platform/workspaces/common/workspaces.js +1 -1
- package/dist/vscode/vs/workbench/api/browser/mainThreadDebugService.js +1 -1
- package/dist/vscode/vs/workbench/api/browser/mainThreadDiagnostics.js +1 -1
- package/dist/vscode/vs/workbench/api/browser/mainThreadDocuments.js +4 -4
- package/dist/vscode/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +1 -1
- package/dist/vscode/vs/workbench/api/browser/mainThreadFileSystem.js +1 -1
- package/dist/vscode/vs/workbench/api/browser/mainThreadQuickOpen.js +1 -1
- package/dist/vscode/vs/workbench/api/common/cache.js +1 -1
- package/dist/vscode/vs/workbench/api/common/configurationExtensionPoint.js +1 -1
- package/dist/vscode/vs/workbench/api/common/extHostApiDeprecationService.js +1 -1
- package/dist/vscode/vs/workbench/api/common/extHostCommands.js +2 -2
- package/dist/vscode/vs/workbench/api/common/extHostDebugService.js +2 -2
- package/dist/vscode/vs/workbench/api/common/extHostDecorations.js +1 -1
- package/dist/vscode/vs/workbench/api/common/extHostDiagnostics.js +3 -3
- package/dist/vscode/vs/workbench/api/common/extHostDocumentsAndEditors.js +3 -3
- package/dist/vscode/vs/workbench/api/common/extHostExtensionActivator.js +1 -1
- package/dist/vscode/vs/workbench/api/common/extHostExtensionService.js +1 -1
- package/dist/vscode/vs/workbench/api/common/extHostFileSystem.js +1 -1
- package/dist/vscode/vs/workbench/api/common/extHostFileSystemInfo.js +1 -1
- package/dist/vscode/vs/workbench/api/common/extHostLanguages.js +1 -1
- package/dist/vscode/vs/workbench/api/common/extHostLocalizationService.js +1 -1
- package/dist/vscode/vs/workbench/api/common/extHostQuickOpen.js +2 -2
- package/dist/vscode/vs/workbench/api/common/extHostTextEditor.js +1 -1
- package/dist/vscode/vs/workbench/api/common/extHostTypeConverters.js +2 -2
- package/dist/vscode/vs/workbench/api/common/extHostTypes.js +4 -4
- package/dist/vscode/vs/workbench/api/common/extHostWorkspace.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/editor.contribution.js +6 -795
- package/dist/vscode/vs/workbench/browser/parts/editor/editorActions.js +110 -1487
- package/dist/vscode/vs/workbench/browser/parts/editor/editorPane.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/editorQuickAccess.js +1 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/editorWithViewState.js +1 -1
- package/dist/vscode/vs/workbench/browser/quickaccess.js +2 -4
- package/dist/vscode/vs/workbench/common/contextkeys.js +1 -30
- package/dist/vscode/vs/workbench/common/editor.js +1 -1
- package/dist/vscode/vs/workbench/common/resources.js +3 -3
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugAdapterManager.js +1 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +1 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugEditorContribution.js +5 -5
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugSession.js +2 -2
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugToolBar.js +1 -1
- package/dist/vscode/vs/workbench/contrib/debug/common/debugModel.js +3 -3
- package/dist/vscode/vs/workbench/contrib/debug/common/debugUtils.js +1 -1
- package/dist/vscode/vs/workbench/contrib/files/common/explorerFileNestingTrie.js +1 -1
- package/dist/vscode/vs/workbench/contrib/snippets/browser/snippetsFile.js +1 -1
- package/dist/vscode/vs/workbench/contrib/snippets/browser/snippetsService.js +5 -3
- package/dist/vscode/vs/workbench/contrib/testing/common/testItemCollection.js +1 -1
- package/dist/vscode/vs/workbench/services/configuration/browser/configurationService.js +1 -1
- package/dist/vscode/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +1 -1
- package/dist/vscode/vs/workbench/services/configurationResolver/common/variableResolver.js +1 -1
- package/dist/vscode/vs/workbench/services/extensions/common/extensionDescriptionRegistry.js +10 -10
- package/dist/vscode/vs/workbench/services/extensions/common/extensionsRegistry.js +3 -3
- package/dist/vscode/vs/workbench/services/keybinding/browser/keybindingService.js +3 -3
- package/dist/vscode/vs/workbench/services/keybinding/browser/unboundCommands.js +1 -1
- package/dist/vscode/vs/workbench/services/languageDetection/common/languageDetectionWorkerService.js +1 -2
- package/dist/vscode/vs/workbench/services/layout/browser/layoutService.js +1 -9
- package/dist/vscode/vs/workbench/services/output/common/output.js +1 -1
- package/dist/vscode/vs/workbench/services/preferences/common/preferencesModels.js +1 -1
- package/dist/vscode/vs/workbench/services/search/common/searchService.js +7 -7
- package/dist/vscode/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.js +2 -2
- package/dist/vscode/vs/workbench/services/textMate/browser/workerHost/textMateWorkerHost.js +1 -1
- package/dist/vscode/vs/workbench/services/textMate/common/TMGrammarFactory.js +1 -1
- package/dist/vscode/vs/workbench/services/textfile/common/textFileEditorModelManager.js +4 -4
- package/dist/vscode/vs/workbench/services/textmodelResolver/common/textModelResolverService.js +3 -3
- package/dist/vscode/vs/workbench/services/themes/browser/workbenchThemeService.js +1 -1
- package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyBackupService.js +11 -7
- package/dist/vscode/vs/workbench/services/workingCopy/common/workingCopyService.js +1 -1
- package/monaco-editor-treemending.patch +531 -531
- package/package.json +1 -1
- package/dist/assets/editorstatus.css +0 -51
- package/dist/assets/panelpart.css +0 -75
- package/dist/vscode/vs/workbench/browser/actions/layoutActions.js +0 -1201
- package/dist/vscode/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.js +0 -146
- package/dist/vscode/vs/workbench/browser/parts/editor/editorStatus.js +0 -460
- package/dist/vscode/vs/workbench/browser/parts/panel/panelActions.js +0 -422
|
@@ -1,1201 +0,0 @@
|
|
|
1
|
-
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
2
|
-
import { registerAction2, Action2, MenuId, MenuRegistry } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
3
|
-
import { Categories } from 'monaco-editor/esm/vs/platform/action/common/actionCommonCategories.js';
|
|
4
|
-
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
5
|
-
import { IWorkbenchLayoutService, positionToString } from '../../services/layout/browser/layoutService.js';
|
|
6
|
-
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
7
|
-
import { KeyChord } from 'monaco-editor/esm/vs/base/common/keyCodes.js';
|
|
8
|
-
import { isWindows, isLinux, isWeb, isMacintosh, isNative } from 'monaco-editor/esm/vs/base/common/platform.js';
|
|
9
|
-
import { IsMacNativeContext } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkeys.js';
|
|
10
|
-
import { KeybindingsRegistry } from 'monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js';
|
|
11
|
-
import { ContextKeyExpr, IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
12
|
-
import { ViewContainerLocationToString, IViewDescriptorService, IViewsService } from '../../common/views.js';
|
|
13
|
-
import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
|
|
14
|
-
import { IDialogService } from 'monaco-editor/esm/vs/platform/dialogs/common/dialogs.js';
|
|
15
|
-
import { IPaneCompositePartService } from '../../services/panecomposite/browser/panecomposite.js';
|
|
16
|
-
import { ToggleAuxiliaryBarAction } from '../parts/auxiliarybar/auxiliaryBarActions.js';
|
|
17
|
-
import { TogglePanelAction } from '../parts/panel/panelActions.js';
|
|
18
|
-
import { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
19
|
-
import { IsCenteredLayoutContext, EditorAreaVisibleContext, PanelAlignmentContext, PanelPositionContext, SideBarVisibleContext, InEditorZenModeContext, FocusedViewContext, AuxiliaryBarVisibleContext, PanelVisibleContext, IsFullscreenContext } from '../../common/contextkeys.js';
|
|
20
|
-
import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
|
|
21
|
-
import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
|
|
22
|
-
import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
23
|
-
import { registerIcon } from 'monaco-editor/esm/vs/platform/theme/common/iconRegistry.js';
|
|
24
|
-
const menubarIcon = ( registerIcon('menuBar', Codicon.layoutMenubar, ( localize('menuBarIcon', "Represents the menu bar"))));
|
|
25
|
-
const activityBarLeftIcon = ( registerIcon('activity-bar-left', Codicon.layoutActivitybarLeft, ( localize('activityBarLeft', "Represents the activity bar in the left position"))));
|
|
26
|
-
const activityBarRightIcon = ( registerIcon('activity-bar-right', Codicon.layoutActivitybarRight, ( localize('activityBarRight', "Represents the activity bar in the right position"))));
|
|
27
|
-
const panelLeftIcon = ( registerIcon('panel-left', Codicon.layoutSidebarLeft, ( localize('panelLeft', "Represents a side bar in the left position"))));
|
|
28
|
-
const panelLeftOffIcon = ( registerIcon('panel-left-off', Codicon.layoutSidebarLeftOff, ( localize('panelLeftOff', "Represents a side bar in the left position toggled off"))));
|
|
29
|
-
const panelRightIcon = ( registerIcon('panel-right', Codicon.layoutSidebarRight, ( localize('panelRight', "Represents side bar in the right position"))));
|
|
30
|
-
const panelRightOffIcon = ( registerIcon('panel-right-off', Codicon.layoutSidebarRightOff, ( localize('panelRightOff', "Represents side bar in the right position toggled off"))));
|
|
31
|
-
const panelIcon = ( registerIcon('panel-bottom', Codicon.layoutPanel, ( localize('panelBottom', "Represents the bottom panel"))));
|
|
32
|
-
const statusBarIcon = ( registerIcon('statusBar', Codicon.layoutStatusbar, ( localize('statusBarIcon', "Represents the status bar"))));
|
|
33
|
-
const panelAlignmentLeftIcon = ( registerIcon('panel-align-left', Codicon.layoutPanelLeft, ( localize('panelBottomLeft', "Represents the bottom panel alignment set to the left"))));
|
|
34
|
-
const panelAlignmentRightIcon = ( registerIcon('panel-align-right', Codicon.layoutPanelRight, ( localize(
|
|
35
|
-
'panelBottomRight',
|
|
36
|
-
"Represents the bottom panel alignment set to the right"
|
|
37
|
-
))));
|
|
38
|
-
const panelAlignmentCenterIcon = ( registerIcon('panel-align-center', Codicon.layoutPanelCenter, ( localize(
|
|
39
|
-
'panelBottomCenter',
|
|
40
|
-
"Represents the bottom panel alignment set to the center"
|
|
41
|
-
))));
|
|
42
|
-
const panelAlignmentJustifyIcon = ( registerIcon('panel-align-justify', Codicon.layoutPanelJustify, ( localize(
|
|
43
|
-
'panelBottomJustify',
|
|
44
|
-
"Represents the bottom panel alignment set to justified"
|
|
45
|
-
))));
|
|
46
|
-
const fullscreenIcon = ( registerIcon('fullscreen', Codicon.screenFull, ( localize('fullScreenIcon', "Represents full screen"))));
|
|
47
|
-
const centerLayoutIcon = ( registerIcon('centerLayoutIcon', Codicon.layoutCentered, ( localize('centerLayoutIcon', "Represents centered layout mode"))));
|
|
48
|
-
const zenModeIcon = ( registerIcon('zenMode', Codicon.target, ( localize('zenModeIcon', "Represents zen mode"))));
|
|
49
|
-
registerAction2(class extends Action2 {
|
|
50
|
-
constructor() {
|
|
51
|
-
super({
|
|
52
|
-
id: 'workbench.action.closeSidebar',
|
|
53
|
-
title: { value: ( localize('closeSidebar', "Close Primary Side Bar")), original: 'Close Primary Side Bar' },
|
|
54
|
-
category: Categories.View,
|
|
55
|
-
f1: true
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
run(accessor) {
|
|
59
|
-
accessor.get(IWorkbenchLayoutService).setPartHidden(true, "workbench.parts.sidebar" );
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
class ToggleActivityBarVisibilityAction extends Action2 {
|
|
63
|
-
constructor() {
|
|
64
|
-
super({
|
|
65
|
-
id: ToggleActivityBarVisibilityAction.ID,
|
|
66
|
-
title: {
|
|
67
|
-
value: ( localize('toggleActivityBar', "Toggle Activity Bar Visibility")),
|
|
68
|
-
mnemonicTitle: ( localize(
|
|
69
|
-
{ key: 'miActivityBar', comment: ['&& denotes a mnemonic'] },
|
|
70
|
-
"&&Activity Bar"
|
|
71
|
-
)),
|
|
72
|
-
original: 'Toggle Activity Bar Visibility'
|
|
73
|
-
},
|
|
74
|
-
category: Categories.View,
|
|
75
|
-
f1: true,
|
|
76
|
-
toggled: ( ContextKeyExpr.equals('config.workbench.activityBar.visible', true)),
|
|
77
|
-
menu: [{
|
|
78
|
-
id: MenuId.MenubarAppearanceMenu,
|
|
79
|
-
group: '2_workbench_layout',
|
|
80
|
-
order: 4
|
|
81
|
-
}]
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
run(accessor) {
|
|
85
|
-
const layoutService = accessor.get(IWorkbenchLayoutService);
|
|
86
|
-
const configurationService = accessor.get(IConfigurationService);
|
|
87
|
-
const visibility = layoutService.isVisible("workbench.parts.activitybar" );
|
|
88
|
-
const newVisibilityValue = !visibility;
|
|
89
|
-
configurationService.updateValue(ToggleActivityBarVisibilityAction.activityBarVisibleKey, newVisibilityValue);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
ToggleActivityBarVisibilityAction.ID = 'workbench.action.toggleActivityBarVisibility';
|
|
93
|
-
ToggleActivityBarVisibilityAction.activityBarVisibleKey = 'workbench.activityBar.visible';
|
|
94
|
-
registerAction2(ToggleActivityBarVisibilityAction);
|
|
95
|
-
registerAction2(class extends Action2 {
|
|
96
|
-
constructor() {
|
|
97
|
-
super({
|
|
98
|
-
id: 'workbench.action.toggleCenteredLayout',
|
|
99
|
-
title: {
|
|
100
|
-
value: ( localize('toggleCenteredLayout', "Toggle Centered Layout")),
|
|
101
|
-
mnemonicTitle: ( localize(
|
|
102
|
-
{ key: 'miToggleCenteredLayout', comment: ['&& denotes a mnemonic'] },
|
|
103
|
-
"&&Centered Layout"
|
|
104
|
-
)),
|
|
105
|
-
original: 'Toggle Centered Layout'
|
|
106
|
-
},
|
|
107
|
-
category: Categories.View,
|
|
108
|
-
f1: true,
|
|
109
|
-
toggled: IsCenteredLayoutContext,
|
|
110
|
-
menu: [{
|
|
111
|
-
id: MenuId.MenubarAppearanceMenu,
|
|
112
|
-
group: '1_toggle_view',
|
|
113
|
-
order: 3
|
|
114
|
-
}]
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
run(accessor) {
|
|
118
|
-
const layoutService = accessor.get(IWorkbenchLayoutService);
|
|
119
|
-
layoutService.centerEditorLayout(!layoutService.isEditorLayoutCentered());
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
const sidebarPositionConfigurationKey = 'workbench.sideBar.location';
|
|
123
|
-
class MoveSidebarPositionAction extends Action2 {
|
|
124
|
-
constructor(id, title, position) {
|
|
125
|
-
super({
|
|
126
|
-
id,
|
|
127
|
-
title,
|
|
128
|
-
f1: false
|
|
129
|
-
});
|
|
130
|
-
this.position = position;
|
|
131
|
-
}
|
|
132
|
-
async run(accessor) {
|
|
133
|
-
const layoutService = accessor.get(IWorkbenchLayoutService);
|
|
134
|
-
const configurationService = accessor.get(IConfigurationService);
|
|
135
|
-
const position = layoutService.getSideBarPosition();
|
|
136
|
-
if (position !== this.position) {
|
|
137
|
-
return configurationService.updateValue(sidebarPositionConfigurationKey, positionToString(this.position));
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
class MoveSidebarRightAction extends MoveSidebarPositionAction {
|
|
142
|
-
constructor() {
|
|
143
|
-
super(MoveSidebarRightAction.ID, {
|
|
144
|
-
value: ( localize('moveSidebarRight', "Move Primary Side Bar Right")),
|
|
145
|
-
original: 'Move Primary Side Bar Right'
|
|
146
|
-
}, 1 );
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
MoveSidebarRightAction.ID = 'workbench.action.moveSideBarRight';
|
|
150
|
-
class MoveSidebarLeftAction extends MoveSidebarPositionAction {
|
|
151
|
-
constructor() {
|
|
152
|
-
super(MoveSidebarLeftAction.ID, {
|
|
153
|
-
value: ( localize('moveSidebarLeft', "Move Primary Side Bar Left")),
|
|
154
|
-
original: 'Move Primary Side Bar Left'
|
|
155
|
-
}, 0 );
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
MoveSidebarLeftAction.ID = 'workbench.action.moveSideBarLeft';
|
|
159
|
-
registerAction2(MoveSidebarRightAction);
|
|
160
|
-
registerAction2(MoveSidebarLeftAction);
|
|
161
|
-
class ToggleSidebarPositionAction extends Action2 {
|
|
162
|
-
static getLabel(layoutService) {
|
|
163
|
-
return layoutService.getSideBarPosition() === 0 ? ( localize('moveSidebarRight', "Move Primary Side Bar Right")) : ( localize('moveSidebarLeft', "Move Primary Side Bar Left"));
|
|
164
|
-
}
|
|
165
|
-
constructor() {
|
|
166
|
-
super({
|
|
167
|
-
id: ToggleSidebarPositionAction.ID,
|
|
168
|
-
title: { value: ( localize('toggleSidebarPosition', "Toggle Primary Side Bar Position")), original: 'Toggle Primary Side Bar Position' },
|
|
169
|
-
category: Categories.View,
|
|
170
|
-
f1: true
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
run(accessor) {
|
|
174
|
-
const layoutService = accessor.get(IWorkbenchLayoutService);
|
|
175
|
-
const configurationService = accessor.get(IConfigurationService);
|
|
176
|
-
const position = layoutService.getSideBarPosition();
|
|
177
|
-
const newPositionValue = ((position === 0) ) ? 'right' : 'left';
|
|
178
|
-
return configurationService.updateValue(sidebarPositionConfigurationKey, newPositionValue);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
ToggleSidebarPositionAction.ID = 'workbench.action.toggleSidebarPosition';
|
|
182
|
-
ToggleSidebarPositionAction.LABEL = ( localize('toggleSidebarPosition', "Toggle Primary Side Bar Position"));
|
|
183
|
-
registerAction2(ToggleSidebarPositionAction);
|
|
184
|
-
const configureLayoutIcon = ( registerIcon('configure-layout-icon', Codicon.layout, ( localize('cofigureLayoutIcon', 'Icon represents workbench layout configuration.'))));
|
|
185
|
-
MenuRegistry.appendMenuItem(MenuId.LayoutControlMenu, {
|
|
186
|
-
submenu: MenuId.LayoutControlMenuSubmenu,
|
|
187
|
-
title: ( localize('configureLayout', "Configure Layout")),
|
|
188
|
-
icon: configureLayoutIcon,
|
|
189
|
-
group: '1_workbench_layout',
|
|
190
|
-
when: ( ContextKeyExpr.equals('config.workbench.layoutControl.type', 'menu'))
|
|
191
|
-
});
|
|
192
|
-
MenuRegistry.appendMenuItems([{
|
|
193
|
-
id: MenuId.ViewContainerTitleContext,
|
|
194
|
-
item: {
|
|
195
|
-
group: '3_workbench_layout_move',
|
|
196
|
-
command: {
|
|
197
|
-
id: ToggleSidebarPositionAction.ID,
|
|
198
|
-
title: ( localize('move side bar right', "Move Primary Side Bar Right"))
|
|
199
|
-
},
|
|
200
|
-
when: ( ContextKeyExpr.and(( ContextKeyExpr.notEquals('config.workbench.sideBar.location', 'right')), ( ContextKeyExpr.equals(
|
|
201
|
-
'viewContainerLocation',
|
|
202
|
-
ViewContainerLocationToString(0 )
|
|
203
|
-
)))),
|
|
204
|
-
order: 1
|
|
205
|
-
}
|
|
206
|
-
}, {
|
|
207
|
-
id: MenuId.ViewTitleContext,
|
|
208
|
-
item: {
|
|
209
|
-
group: '3_workbench_layout_move',
|
|
210
|
-
command: {
|
|
211
|
-
id: ToggleSidebarPositionAction.ID,
|
|
212
|
-
title: ( localize('move sidebar right', "Move Primary Side Bar Right"))
|
|
213
|
-
},
|
|
214
|
-
when: ( ContextKeyExpr.and(( ContextKeyExpr.notEquals('config.workbench.sideBar.location', 'right')), ( ContextKeyExpr.equals(
|
|
215
|
-
'viewLocation',
|
|
216
|
-
ViewContainerLocationToString(0 )
|
|
217
|
-
)))),
|
|
218
|
-
order: 1
|
|
219
|
-
}
|
|
220
|
-
}, {
|
|
221
|
-
id: MenuId.ViewContainerTitleContext,
|
|
222
|
-
item: {
|
|
223
|
-
group: '3_workbench_layout_move',
|
|
224
|
-
command: {
|
|
225
|
-
id: ToggleSidebarPositionAction.ID,
|
|
226
|
-
title: ( localize('move sidebar left', "Move Primary Side Bar Left"))
|
|
227
|
-
},
|
|
228
|
-
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('config.workbench.sideBar.location', 'right')), ( ContextKeyExpr.equals(
|
|
229
|
-
'viewContainerLocation',
|
|
230
|
-
ViewContainerLocationToString(0 )
|
|
231
|
-
)))),
|
|
232
|
-
order: 1
|
|
233
|
-
}
|
|
234
|
-
}, {
|
|
235
|
-
id: MenuId.ViewTitleContext,
|
|
236
|
-
item: {
|
|
237
|
-
group: '3_workbench_layout_move',
|
|
238
|
-
command: {
|
|
239
|
-
id: ToggleSidebarPositionAction.ID,
|
|
240
|
-
title: ( localize('move sidebar left', "Move Primary Side Bar Left"))
|
|
241
|
-
},
|
|
242
|
-
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('config.workbench.sideBar.location', 'right')), ( ContextKeyExpr.equals(
|
|
243
|
-
'viewLocation',
|
|
244
|
-
ViewContainerLocationToString(0 )
|
|
245
|
-
)))),
|
|
246
|
-
order: 1
|
|
247
|
-
}
|
|
248
|
-
}, {
|
|
249
|
-
id: MenuId.ViewTitleContext,
|
|
250
|
-
item: {
|
|
251
|
-
group: '3_workbench_layout_move',
|
|
252
|
-
command: {
|
|
253
|
-
id: ToggleSidebarPositionAction.ID,
|
|
254
|
-
title: ( localize('move second sidebar left', "Move Secondary Side Bar Left"))
|
|
255
|
-
},
|
|
256
|
-
when: ( ContextKeyExpr.and(( ContextKeyExpr.notEquals('config.workbench.sideBar.location', 'right')), ( ContextKeyExpr.equals(
|
|
257
|
-
'viewLocation',
|
|
258
|
-
ViewContainerLocationToString(2 )
|
|
259
|
-
)))),
|
|
260
|
-
order: 1
|
|
261
|
-
}
|
|
262
|
-
}, {
|
|
263
|
-
id: MenuId.ViewTitleContext,
|
|
264
|
-
item: {
|
|
265
|
-
group: '3_workbench_layout_move',
|
|
266
|
-
command: {
|
|
267
|
-
id: ToggleSidebarPositionAction.ID,
|
|
268
|
-
title: ( localize('move second sidebar right', "Move Secondary Side Bar Right"))
|
|
269
|
-
},
|
|
270
|
-
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('config.workbench.sideBar.location', 'right')), ( ContextKeyExpr.equals(
|
|
271
|
-
'viewLocation',
|
|
272
|
-
ViewContainerLocationToString(2 )
|
|
273
|
-
)))),
|
|
274
|
-
order: 1
|
|
275
|
-
}
|
|
276
|
-
}]);
|
|
277
|
-
MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
|
|
278
|
-
group: '3_workbench_layout_move',
|
|
279
|
-
command: {
|
|
280
|
-
id: ToggleSidebarPositionAction.ID,
|
|
281
|
-
title: ( localize(
|
|
282
|
-
{ key: 'miMoveSidebarRight', comment: ['&& denotes a mnemonic'] },
|
|
283
|
-
"&&Move Primary Side Bar Right"
|
|
284
|
-
))
|
|
285
|
-
},
|
|
286
|
-
when: ( ContextKeyExpr.notEquals('config.workbench.sideBar.location', 'right')),
|
|
287
|
-
order: 2
|
|
288
|
-
});
|
|
289
|
-
MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
|
|
290
|
-
group: '3_workbench_layout_move',
|
|
291
|
-
command: {
|
|
292
|
-
id: ToggleSidebarPositionAction.ID,
|
|
293
|
-
title: ( localize(
|
|
294
|
-
{ key: 'miMoveSidebarLeft', comment: ['&& denotes a mnemonic'] },
|
|
295
|
-
"&&Move Primary Side Bar Left"
|
|
296
|
-
))
|
|
297
|
-
},
|
|
298
|
-
when: ( ContextKeyExpr.equals('config.workbench.sideBar.location', 'right')),
|
|
299
|
-
order: 2
|
|
300
|
-
});
|
|
301
|
-
registerAction2(class extends Action2 {
|
|
302
|
-
constructor() {
|
|
303
|
-
super({
|
|
304
|
-
id: 'workbench.action.toggleEditorVisibility',
|
|
305
|
-
title: {
|
|
306
|
-
value: ( localize('toggleEditor', "Toggle Editor Area Visibility")),
|
|
307
|
-
mnemonicTitle: ( localize(
|
|
308
|
-
{ key: 'miShowEditorArea', comment: ['&& denotes a mnemonic'] },
|
|
309
|
-
"Show &&Editor Area"
|
|
310
|
-
)),
|
|
311
|
-
original: 'Toggle Editor Area Visibility'
|
|
312
|
-
},
|
|
313
|
-
category: Categories.View,
|
|
314
|
-
f1: true,
|
|
315
|
-
toggled: EditorAreaVisibleContext,
|
|
316
|
-
precondition: ( ContextKeyExpr.or(( PanelAlignmentContext.isEqualTo('center')), ( PanelPositionContext.notEqualsTo('bottom'))))
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
run(accessor) {
|
|
320
|
-
accessor.get(IWorkbenchLayoutService).toggleMaximizedPanel();
|
|
321
|
-
}
|
|
322
|
-
});
|
|
323
|
-
MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
|
|
324
|
-
group: '2_appearance',
|
|
325
|
-
title: ( localize(
|
|
326
|
-
{ key: 'miAppearance', comment: ['&& denotes a mnemonic'] },
|
|
327
|
-
"&&Appearance"
|
|
328
|
-
)),
|
|
329
|
-
submenu: MenuId.MenubarAppearanceMenu,
|
|
330
|
-
order: 1
|
|
331
|
-
});
|
|
332
|
-
class ToggleSidebarVisibilityAction extends Action2 {
|
|
333
|
-
constructor() {
|
|
334
|
-
super({
|
|
335
|
-
id: ToggleSidebarVisibilityAction.ID,
|
|
336
|
-
title: { value: ( localize('toggleSidebar', "Toggle Primary Side Bar Visibility")), original: 'Toggle Primary Side Bar Visibility' },
|
|
337
|
-
toggled: {
|
|
338
|
-
condition: SideBarVisibleContext,
|
|
339
|
-
title: ( localize('primary sidebar', "Primary Side Bar")),
|
|
340
|
-
mnemonicTitle: ( localize(
|
|
341
|
-
{ key: 'primary sidebar mnemonic', comment: ['&& denotes a mnemonic'] },
|
|
342
|
-
"&&Primary Side Bar"
|
|
343
|
-
)),
|
|
344
|
-
},
|
|
345
|
-
category: Categories.View,
|
|
346
|
-
f1: true,
|
|
347
|
-
keybinding: {
|
|
348
|
-
weight: 200 ,
|
|
349
|
-
primary: 2048 | 32
|
|
350
|
-
},
|
|
351
|
-
menu: [
|
|
352
|
-
{
|
|
353
|
-
id: MenuId.LayoutControlMenuSubmenu,
|
|
354
|
-
group: '0_workbench_layout',
|
|
355
|
-
order: 0
|
|
356
|
-
},
|
|
357
|
-
{
|
|
358
|
-
id: MenuId.MenubarAppearanceMenu,
|
|
359
|
-
group: '2_workbench_layout',
|
|
360
|
-
order: 1
|
|
361
|
-
}
|
|
362
|
-
]
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
|
-
run(accessor) {
|
|
366
|
-
const layoutService = accessor.get(IWorkbenchLayoutService);
|
|
367
|
-
layoutService.setPartHidden(layoutService.isVisible("workbench.parts.sidebar" ), "workbench.parts.sidebar" );
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
ToggleSidebarVisibilityAction.ID = 'workbench.action.toggleSidebarVisibility';
|
|
371
|
-
registerAction2(ToggleSidebarVisibilityAction);
|
|
372
|
-
MenuRegistry.appendMenuItems([
|
|
373
|
-
{
|
|
374
|
-
id: MenuId.ViewContainerTitleContext,
|
|
375
|
-
item: {
|
|
376
|
-
group: '3_workbench_layout_move',
|
|
377
|
-
command: {
|
|
378
|
-
id: ToggleSidebarVisibilityAction.ID,
|
|
379
|
-
title: ( localize('compositePart.hideSideBarLabel', "Hide Primary Side Bar")),
|
|
380
|
-
},
|
|
381
|
-
when: ( ContextKeyExpr.and(SideBarVisibleContext, ( ContextKeyExpr.equals(
|
|
382
|
-
'viewContainerLocation',
|
|
383
|
-
ViewContainerLocationToString(0 )
|
|
384
|
-
)))),
|
|
385
|
-
order: 2
|
|
386
|
-
}
|
|
387
|
-
}, {
|
|
388
|
-
id: MenuId.ViewTitleContext,
|
|
389
|
-
item: {
|
|
390
|
-
group: '3_workbench_layout_move',
|
|
391
|
-
command: {
|
|
392
|
-
id: ToggleSidebarVisibilityAction.ID,
|
|
393
|
-
title: ( localize('compositePart.hideSideBarLabel', "Hide Primary Side Bar")),
|
|
394
|
-
},
|
|
395
|
-
when: ( ContextKeyExpr.and(SideBarVisibleContext, ( ContextKeyExpr.equals(
|
|
396
|
-
'viewLocation',
|
|
397
|
-
ViewContainerLocationToString(0 )
|
|
398
|
-
)))),
|
|
399
|
-
order: 2
|
|
400
|
-
}
|
|
401
|
-
}, {
|
|
402
|
-
id: MenuId.LayoutControlMenu,
|
|
403
|
-
item: {
|
|
404
|
-
group: '0_workbench_toggles',
|
|
405
|
-
command: {
|
|
406
|
-
id: ToggleSidebarVisibilityAction.ID,
|
|
407
|
-
title: ( localize('toggleSideBar', "Toggle Primary Side Bar")),
|
|
408
|
-
icon: panelLeftOffIcon,
|
|
409
|
-
toggled: { condition: SideBarVisibleContext, icon: panelLeftIcon }
|
|
410
|
-
},
|
|
411
|
-
when: ( ContextKeyExpr.and(( ContextKeyExpr.or(( ContextKeyExpr.equals('config.workbench.layoutControl.type', 'toggles')), ( ContextKeyExpr.equals('config.workbench.layoutControl.type', 'both')))), ( ContextKeyExpr.equals('config.workbench.sideBar.location', 'left')))),
|
|
412
|
-
order: 0
|
|
413
|
-
}
|
|
414
|
-
}, {
|
|
415
|
-
id: MenuId.LayoutControlMenu,
|
|
416
|
-
item: {
|
|
417
|
-
group: '0_workbench_toggles',
|
|
418
|
-
command: {
|
|
419
|
-
id: ToggleSidebarVisibilityAction.ID,
|
|
420
|
-
title: ( localize('toggleSideBar', "Toggle Primary Side Bar")),
|
|
421
|
-
icon: panelRightOffIcon,
|
|
422
|
-
toggled: { condition: SideBarVisibleContext, icon: panelRightIcon }
|
|
423
|
-
},
|
|
424
|
-
when: ( ContextKeyExpr.and(( ContextKeyExpr.or(( ContextKeyExpr.equals('config.workbench.layoutControl.type', 'toggles')), ( ContextKeyExpr.equals('config.workbench.layoutControl.type', 'both')))), ( ContextKeyExpr.equals('config.workbench.sideBar.location', 'right')))),
|
|
425
|
-
order: 2
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
]);
|
|
429
|
-
class ToggleStatusbarVisibilityAction extends Action2 {
|
|
430
|
-
constructor() {
|
|
431
|
-
super({
|
|
432
|
-
id: ToggleStatusbarVisibilityAction.ID,
|
|
433
|
-
title: {
|
|
434
|
-
value: ( localize('toggleStatusbar', "Toggle Status Bar Visibility")),
|
|
435
|
-
mnemonicTitle: ( localize({ key: 'miStatusbar', comment: ['&& denotes a mnemonic'] }, "S&&tatus Bar")),
|
|
436
|
-
original: 'Toggle Status Bar Visibility'
|
|
437
|
-
},
|
|
438
|
-
category: Categories.View,
|
|
439
|
-
f1: true,
|
|
440
|
-
toggled: ( ContextKeyExpr.equals('config.workbench.statusBar.visible', true)),
|
|
441
|
-
menu: [{
|
|
442
|
-
id: MenuId.MenubarAppearanceMenu,
|
|
443
|
-
group: '2_workbench_layout',
|
|
444
|
-
order: 3
|
|
445
|
-
}]
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
run(accessor) {
|
|
449
|
-
const layoutService = accessor.get(IWorkbenchLayoutService);
|
|
450
|
-
const configurationService = accessor.get(IConfigurationService);
|
|
451
|
-
const visibility = layoutService.isVisible("workbench.parts.statusbar" );
|
|
452
|
-
const newVisibilityValue = !visibility;
|
|
453
|
-
return configurationService.updateValue(ToggleStatusbarVisibilityAction.statusbarVisibleKey, newVisibilityValue);
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
ToggleStatusbarVisibilityAction.ID = 'workbench.action.toggleStatusbarVisibility';
|
|
457
|
-
ToggleStatusbarVisibilityAction.statusbarVisibleKey = 'workbench.statusBar.visible';
|
|
458
|
-
registerAction2(ToggleStatusbarVisibilityAction);
|
|
459
|
-
class ToggleTabsVisibilityAction extends Action2 {
|
|
460
|
-
constructor() {
|
|
461
|
-
super({
|
|
462
|
-
id: ToggleTabsVisibilityAction.ID,
|
|
463
|
-
title: {
|
|
464
|
-
value: ( localize('toggleTabs', "Toggle Tab Visibility")),
|
|
465
|
-
original: 'Toggle Tab Visibility'
|
|
466
|
-
},
|
|
467
|
-
category: Categories.View,
|
|
468
|
-
f1: true
|
|
469
|
-
});
|
|
470
|
-
}
|
|
471
|
-
run(accessor) {
|
|
472
|
-
const configurationService = accessor.get(IConfigurationService);
|
|
473
|
-
const visibility = configurationService.getValue('workbench.editor.showTabs');
|
|
474
|
-
const newVisibilityValue = !visibility;
|
|
475
|
-
return configurationService.updateValue('workbench.editor.showTabs', newVisibilityValue);
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
ToggleTabsVisibilityAction.ID = 'workbench.action.toggleTabsVisibility';
|
|
479
|
-
registerAction2(ToggleTabsVisibilityAction);
|
|
480
|
-
registerAction2(class extends Action2 {
|
|
481
|
-
constructor() {
|
|
482
|
-
super({
|
|
483
|
-
id: 'workbench.action.toggleZenMode',
|
|
484
|
-
title: {
|
|
485
|
-
value: ( localize('toggleZenMode', "Toggle Zen Mode")),
|
|
486
|
-
mnemonicTitle: ( localize({ key: 'miToggleZenMode', comment: ['&& denotes a mnemonic'] }, "Zen Mode")),
|
|
487
|
-
original: 'Toggle Zen Mode'
|
|
488
|
-
},
|
|
489
|
-
category: Categories.View,
|
|
490
|
-
f1: true,
|
|
491
|
-
keybinding: {
|
|
492
|
-
weight: 200 ,
|
|
493
|
-
primary: KeyChord(2048 | 41 , 56 )
|
|
494
|
-
},
|
|
495
|
-
toggled: InEditorZenModeContext,
|
|
496
|
-
menu: [{
|
|
497
|
-
id: MenuId.MenubarAppearanceMenu,
|
|
498
|
-
group: '1_toggle_view',
|
|
499
|
-
order: 2
|
|
500
|
-
}]
|
|
501
|
-
});
|
|
502
|
-
}
|
|
503
|
-
run(accessor) {
|
|
504
|
-
return accessor.get(IWorkbenchLayoutService).toggleZenMode();
|
|
505
|
-
}
|
|
506
|
-
});
|
|
507
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
508
|
-
id: 'workbench.action.exitZenMode',
|
|
509
|
-
weight: 100 - 1000,
|
|
510
|
-
handler(accessor) {
|
|
511
|
-
const layoutService = accessor.get(IWorkbenchLayoutService);
|
|
512
|
-
const contextKeyService = accessor.get(IContextKeyService);
|
|
513
|
-
if (InEditorZenModeContext.getValue(contextKeyService)) {
|
|
514
|
-
layoutService.toggleZenMode();
|
|
515
|
-
}
|
|
516
|
-
},
|
|
517
|
-
when: InEditorZenModeContext,
|
|
518
|
-
primary: KeyChord(9 , 9 )
|
|
519
|
-
});
|
|
520
|
-
if (isWindows || isLinux || isWeb) {
|
|
521
|
-
registerAction2(class ToggleMenubarAction extends Action2 {
|
|
522
|
-
constructor() {
|
|
523
|
-
super({
|
|
524
|
-
id: 'workbench.action.toggleMenuBar',
|
|
525
|
-
title: {
|
|
526
|
-
value: ( localize('toggleMenuBar', "Toggle Menu Bar")),
|
|
527
|
-
mnemonicTitle: ( localize({ key: 'miMenuBar', comment: ['&& denotes a mnemonic'] }, "Menu &&Bar")),
|
|
528
|
-
original: 'Toggle Menu Bar'
|
|
529
|
-
},
|
|
530
|
-
category: Categories.View,
|
|
531
|
-
f1: true,
|
|
532
|
-
toggled: ( ContextKeyExpr.and(( IsMacNativeContext.toNegated()), ( ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'hidden')), ( ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'toggle')), ( ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'compact')))),
|
|
533
|
-
menu: [{
|
|
534
|
-
id: MenuId.MenubarAppearanceMenu,
|
|
535
|
-
group: '2_workbench_layout',
|
|
536
|
-
order: 0
|
|
537
|
-
}]
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
run(accessor) {
|
|
541
|
-
return accessor.get(IWorkbenchLayoutService).toggleMenuBar();
|
|
542
|
-
}
|
|
543
|
-
});
|
|
544
|
-
MenuRegistry.appendMenuItem(MenuId.TitleBarContext, {
|
|
545
|
-
command: {
|
|
546
|
-
id: 'workbench.action.toggleMenuBar',
|
|
547
|
-
title: ( localize('miMenuBarNoMnemonic', "Menu Bar")),
|
|
548
|
-
toggled: ( ContextKeyExpr.and(( IsMacNativeContext.toNegated()), ( ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'hidden')), ( ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'toggle')), ( ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'compact'))))
|
|
549
|
-
},
|
|
550
|
-
order: 0
|
|
551
|
-
});
|
|
552
|
-
}
|
|
553
|
-
registerAction2(class extends Action2 {
|
|
554
|
-
constructor() {
|
|
555
|
-
super({
|
|
556
|
-
id: 'workbench.action.resetViewLocations',
|
|
557
|
-
title: {
|
|
558
|
-
value: ( localize('resetViewLocations', "Reset View Locations")),
|
|
559
|
-
original: 'Reset View Locations'
|
|
560
|
-
},
|
|
561
|
-
category: Categories.View,
|
|
562
|
-
f1: true
|
|
563
|
-
});
|
|
564
|
-
}
|
|
565
|
-
run(accessor) {
|
|
566
|
-
return accessor.get(IViewDescriptorService).reset();
|
|
567
|
-
}
|
|
568
|
-
});
|
|
569
|
-
registerAction2(class extends Action2 {
|
|
570
|
-
constructor() {
|
|
571
|
-
super({
|
|
572
|
-
id: 'workbench.action.moveView',
|
|
573
|
-
title: {
|
|
574
|
-
value: ( localize('moveView', "Move View")),
|
|
575
|
-
original: 'Move View'
|
|
576
|
-
},
|
|
577
|
-
category: Categories.View,
|
|
578
|
-
f1: true
|
|
579
|
-
});
|
|
580
|
-
}
|
|
581
|
-
async run(accessor) {
|
|
582
|
-
const viewDescriptorService = accessor.get(IViewDescriptorService);
|
|
583
|
-
const instantiationService = accessor.get(IInstantiationService);
|
|
584
|
-
const quickInputService = accessor.get(IQuickInputService);
|
|
585
|
-
const contextKeyService = accessor.get(IContextKeyService);
|
|
586
|
-
const paneCompositePartService = accessor.get(IPaneCompositePartService);
|
|
587
|
-
const focusedViewId = FocusedViewContext.getValue(contextKeyService);
|
|
588
|
-
let viewId;
|
|
589
|
-
if (focusedViewId && viewDescriptorService.getViewDescriptorById(focusedViewId)?.canMoveView) {
|
|
590
|
-
viewId = focusedViewId;
|
|
591
|
-
}
|
|
592
|
-
try {
|
|
593
|
-
viewId = await this.getView(quickInputService, viewDescriptorService, paneCompositePartService, viewId);
|
|
594
|
-
if (!viewId) {
|
|
595
|
-
return;
|
|
596
|
-
}
|
|
597
|
-
const moveFocusedViewAction = ( new MoveFocusedViewAction());
|
|
598
|
-
instantiationService.invokeFunction(accessor => moveFocusedViewAction.run(accessor, viewId));
|
|
599
|
-
}
|
|
600
|
-
catch { }
|
|
601
|
-
}
|
|
602
|
-
getViewItems(viewDescriptorService, paneCompositePartService) {
|
|
603
|
-
const results = [];
|
|
604
|
-
const viewlets = paneCompositePartService.getVisiblePaneCompositeIds(0 );
|
|
605
|
-
viewlets.forEach(viewletId => {
|
|
606
|
-
const container = viewDescriptorService.getViewContainerById(viewletId);
|
|
607
|
-
const containerModel = viewDescriptorService.getViewContainerModel(container);
|
|
608
|
-
let hasAddedView = false;
|
|
609
|
-
containerModel.visibleViewDescriptors.forEach(viewDescriptor => {
|
|
610
|
-
if (viewDescriptor.canMoveView) {
|
|
611
|
-
if (!hasAddedView) {
|
|
612
|
-
results.push({
|
|
613
|
-
type: 'separator',
|
|
614
|
-
label: ( localize('sidebarContainer', "Side Bar / {0}", containerModel.title))
|
|
615
|
-
});
|
|
616
|
-
hasAddedView = true;
|
|
617
|
-
}
|
|
618
|
-
results.push({
|
|
619
|
-
id: viewDescriptor.id,
|
|
620
|
-
label: viewDescriptor.name
|
|
621
|
-
});
|
|
622
|
-
}
|
|
623
|
-
});
|
|
624
|
-
});
|
|
625
|
-
const panels = paneCompositePartService.getPinnedPaneCompositeIds(1 );
|
|
626
|
-
panels.forEach(panel => {
|
|
627
|
-
const container = viewDescriptorService.getViewContainerById(panel);
|
|
628
|
-
const containerModel = viewDescriptorService.getViewContainerModel(container);
|
|
629
|
-
let hasAddedView = false;
|
|
630
|
-
containerModel.visibleViewDescriptors.forEach(viewDescriptor => {
|
|
631
|
-
if (viewDescriptor.canMoveView) {
|
|
632
|
-
if (!hasAddedView) {
|
|
633
|
-
results.push({
|
|
634
|
-
type: 'separator',
|
|
635
|
-
label: ( localize('panelContainer', "Panel / {0}", containerModel.title))
|
|
636
|
-
});
|
|
637
|
-
hasAddedView = true;
|
|
638
|
-
}
|
|
639
|
-
results.push({
|
|
640
|
-
id: viewDescriptor.id,
|
|
641
|
-
label: viewDescriptor.name
|
|
642
|
-
});
|
|
643
|
-
}
|
|
644
|
-
});
|
|
645
|
-
});
|
|
646
|
-
const sidePanels = paneCompositePartService.getPinnedPaneCompositeIds(2 );
|
|
647
|
-
sidePanels.forEach(panel => {
|
|
648
|
-
const container = viewDescriptorService.getViewContainerById(panel);
|
|
649
|
-
const containerModel = viewDescriptorService.getViewContainerModel(container);
|
|
650
|
-
let hasAddedView = false;
|
|
651
|
-
containerModel.visibleViewDescriptors.forEach(viewDescriptor => {
|
|
652
|
-
if (viewDescriptor.canMoveView) {
|
|
653
|
-
if (!hasAddedView) {
|
|
654
|
-
results.push({
|
|
655
|
-
type: 'separator',
|
|
656
|
-
label: ( localize(
|
|
657
|
-
'secondarySideBarContainer',
|
|
658
|
-
"Secondary Side Bar / {0}",
|
|
659
|
-
containerModel.title
|
|
660
|
-
))
|
|
661
|
-
});
|
|
662
|
-
hasAddedView = true;
|
|
663
|
-
}
|
|
664
|
-
results.push({
|
|
665
|
-
id: viewDescriptor.id,
|
|
666
|
-
label: viewDescriptor.name
|
|
667
|
-
});
|
|
668
|
-
}
|
|
669
|
-
});
|
|
670
|
-
});
|
|
671
|
-
return results;
|
|
672
|
-
}
|
|
673
|
-
async getView(quickInputService, viewDescriptorService, paneCompositePartService, viewId) {
|
|
674
|
-
const quickPick = quickInputService.createQuickPick();
|
|
675
|
-
quickPick.placeholder = ( localize('moveFocusedView.selectView', "Select a View to Move"));
|
|
676
|
-
quickPick.items = this.getViewItems(viewDescriptorService, paneCompositePartService);
|
|
677
|
-
quickPick.selectedItems = quickPick.items.filter(item => item.id === viewId);
|
|
678
|
-
return ( new Promise((resolve, reject) => {
|
|
679
|
-
quickPick.onDidAccept(() => {
|
|
680
|
-
const viewId = quickPick.selectedItems[0];
|
|
681
|
-
if (viewId.id) {
|
|
682
|
-
resolve(viewId.id);
|
|
683
|
-
}
|
|
684
|
-
else {
|
|
685
|
-
reject();
|
|
686
|
-
}
|
|
687
|
-
quickPick.hide();
|
|
688
|
-
});
|
|
689
|
-
quickPick.onDidHide(() => reject());
|
|
690
|
-
quickPick.show();
|
|
691
|
-
}));
|
|
692
|
-
}
|
|
693
|
-
});
|
|
694
|
-
class MoveFocusedViewAction extends Action2 {
|
|
695
|
-
constructor() {
|
|
696
|
-
super({
|
|
697
|
-
id: 'workbench.action.moveFocusedView',
|
|
698
|
-
title: {
|
|
699
|
-
value: ( localize('moveFocusedView', "Move Focused View")),
|
|
700
|
-
original: 'Move Focused View'
|
|
701
|
-
},
|
|
702
|
-
category: Categories.View,
|
|
703
|
-
precondition: ( FocusedViewContext.notEqualsTo('')),
|
|
704
|
-
f1: true
|
|
705
|
-
});
|
|
706
|
-
}
|
|
707
|
-
run(accessor, viewId) {
|
|
708
|
-
const viewDescriptorService = accessor.get(IViewDescriptorService);
|
|
709
|
-
const viewsService = accessor.get(IViewsService);
|
|
710
|
-
const quickInputService = accessor.get(IQuickInputService);
|
|
711
|
-
const contextKeyService = accessor.get(IContextKeyService);
|
|
712
|
-
const dialogService = accessor.get(IDialogService);
|
|
713
|
-
const paneCompositePartService = accessor.get(IPaneCompositePartService);
|
|
714
|
-
const focusedViewId = viewId || FocusedViewContext.getValue(contextKeyService);
|
|
715
|
-
if (focusedViewId === undefined || focusedViewId.trim() === '') {
|
|
716
|
-
dialogService.error(( localize(
|
|
717
|
-
'moveFocusedView.error.noFocusedView',
|
|
718
|
-
"There is no view currently focused."
|
|
719
|
-
)));
|
|
720
|
-
return;
|
|
721
|
-
}
|
|
722
|
-
const viewDescriptor = viewDescriptorService.getViewDescriptorById(focusedViewId);
|
|
723
|
-
if (!viewDescriptor || !viewDescriptor.canMoveView) {
|
|
724
|
-
dialogService.error(( localize(
|
|
725
|
-
'moveFocusedView.error.nonMovableView',
|
|
726
|
-
"The currently focused view is not movable."
|
|
727
|
-
)));
|
|
728
|
-
return;
|
|
729
|
-
}
|
|
730
|
-
const quickPick = quickInputService.createQuickPick();
|
|
731
|
-
quickPick.placeholder = ( localize('moveFocusedView.selectDestination', "Select a Destination for the View"));
|
|
732
|
-
quickPick.title = ( localize(
|
|
733
|
-
{ key: 'moveFocusedView.title', comment: ['{0} indicates the title of the view the user has selected to move.'] },
|
|
734
|
-
"View: Move {0}",
|
|
735
|
-
viewDescriptor.name
|
|
736
|
-
));
|
|
737
|
-
const items = [];
|
|
738
|
-
const currentContainer = viewDescriptorService.getViewContainerByViewId(focusedViewId);
|
|
739
|
-
const currentLocation = viewDescriptorService.getViewLocationById(focusedViewId);
|
|
740
|
-
const isViewSolo = viewDescriptorService.getViewContainerModel(currentContainer).allViewDescriptors.length === 1;
|
|
741
|
-
if (!((isViewSolo && currentLocation === 1) )) {
|
|
742
|
-
items.push({
|
|
743
|
-
id: '_.panel.newcontainer',
|
|
744
|
-
label: ( localize(
|
|
745
|
-
{ key: 'moveFocusedView.newContainerInPanel', comment: ['Creates a new top-level tab in the panel.'] },
|
|
746
|
-
"New Panel Entry"
|
|
747
|
-
)),
|
|
748
|
-
});
|
|
749
|
-
}
|
|
750
|
-
if (!((isViewSolo && currentLocation === 0) )) {
|
|
751
|
-
items.push({
|
|
752
|
-
id: '_.sidebar.newcontainer',
|
|
753
|
-
label: ( localize('moveFocusedView.newContainerInSidebar', "New Side Bar Entry"))
|
|
754
|
-
});
|
|
755
|
-
}
|
|
756
|
-
if (!((isViewSolo && currentLocation === 2) )) {
|
|
757
|
-
items.push({
|
|
758
|
-
id: '_.auxiliarybar.newcontainer',
|
|
759
|
-
label: ( localize('moveFocusedView.newContainerInSidePanel', "New Secondary Side Bar Entry"))
|
|
760
|
-
});
|
|
761
|
-
}
|
|
762
|
-
items.push({
|
|
763
|
-
type: 'separator',
|
|
764
|
-
label: ( localize('sidebar', "Side Bar"))
|
|
765
|
-
});
|
|
766
|
-
const pinnedViewlets = paneCompositePartService.getVisiblePaneCompositeIds(0 );
|
|
767
|
-
items.push(...( pinnedViewlets
|
|
768
|
-
.filter(viewletId => {
|
|
769
|
-
if (viewletId === viewDescriptorService.getViewContainerByViewId(focusedViewId).id) {
|
|
770
|
-
return false;
|
|
771
|
-
}
|
|
772
|
-
return !viewDescriptorService.getViewContainerById(viewletId).rejectAddedViews;
|
|
773
|
-
})
|
|
774
|
-
.map(viewletId => {
|
|
775
|
-
return {
|
|
776
|
-
id: viewletId,
|
|
777
|
-
label: viewDescriptorService.getViewContainerModel(viewDescriptorService.getViewContainerById(viewletId)).title
|
|
778
|
-
};
|
|
779
|
-
})));
|
|
780
|
-
items.push({
|
|
781
|
-
type: 'separator',
|
|
782
|
-
label: ( localize('panel', "Panel"))
|
|
783
|
-
});
|
|
784
|
-
const pinnedPanels = paneCompositePartService.getPinnedPaneCompositeIds(1 );
|
|
785
|
-
items.push(...( pinnedPanels
|
|
786
|
-
.filter(panel => {
|
|
787
|
-
if (panel === viewDescriptorService.getViewContainerByViewId(focusedViewId).id) {
|
|
788
|
-
return false;
|
|
789
|
-
}
|
|
790
|
-
return !viewDescriptorService.getViewContainerById(panel).rejectAddedViews;
|
|
791
|
-
})
|
|
792
|
-
.map(panel => {
|
|
793
|
-
return {
|
|
794
|
-
id: panel,
|
|
795
|
-
label: viewDescriptorService.getViewContainerModel(viewDescriptorService.getViewContainerById(panel)).title
|
|
796
|
-
};
|
|
797
|
-
})));
|
|
798
|
-
items.push({
|
|
799
|
-
type: 'separator',
|
|
800
|
-
label: ( localize('secondarySideBar', "Secondary Side Bar"))
|
|
801
|
-
});
|
|
802
|
-
const pinnedAuxPanels = paneCompositePartService.getPinnedPaneCompositeIds(2 );
|
|
803
|
-
items.push(...( pinnedAuxPanels
|
|
804
|
-
.filter(panel => {
|
|
805
|
-
if (panel === viewDescriptorService.getViewContainerByViewId(focusedViewId).id) {
|
|
806
|
-
return false;
|
|
807
|
-
}
|
|
808
|
-
return !viewDescriptorService.getViewContainerById(panel).rejectAddedViews;
|
|
809
|
-
})
|
|
810
|
-
.map(panel => {
|
|
811
|
-
return {
|
|
812
|
-
id: panel,
|
|
813
|
-
label: viewDescriptorService.getViewContainerModel(viewDescriptorService.getViewContainerById(panel)).title
|
|
814
|
-
};
|
|
815
|
-
})));
|
|
816
|
-
quickPick.items = items;
|
|
817
|
-
quickPick.onDidAccept(() => {
|
|
818
|
-
const destination = quickPick.selectedItems[0];
|
|
819
|
-
if (destination.id === '_.panel.newcontainer') {
|
|
820
|
-
viewDescriptorService.moveViewToLocation(viewDescriptor, 1 );
|
|
821
|
-
viewsService.openView(focusedViewId, true);
|
|
822
|
-
}
|
|
823
|
-
else if (destination.id === '_.sidebar.newcontainer') {
|
|
824
|
-
viewDescriptorService.moveViewToLocation(viewDescriptor, 0 );
|
|
825
|
-
viewsService.openView(focusedViewId, true);
|
|
826
|
-
}
|
|
827
|
-
else if (destination.id === '_.auxiliarybar.newcontainer') {
|
|
828
|
-
viewDescriptorService.moveViewToLocation(viewDescriptor, 2 );
|
|
829
|
-
viewsService.openView(focusedViewId, true);
|
|
830
|
-
}
|
|
831
|
-
else if (destination.id) {
|
|
832
|
-
viewDescriptorService.moveViewsToContainer([viewDescriptor], viewDescriptorService.getViewContainerById(destination.id));
|
|
833
|
-
viewsService.openView(focusedViewId, true);
|
|
834
|
-
}
|
|
835
|
-
quickPick.hide();
|
|
836
|
-
});
|
|
837
|
-
quickPick.show();
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
registerAction2(MoveFocusedViewAction);
|
|
841
|
-
registerAction2(class extends Action2 {
|
|
842
|
-
constructor() {
|
|
843
|
-
super({
|
|
844
|
-
id: 'workbench.action.resetFocusedViewLocation',
|
|
845
|
-
title: {
|
|
846
|
-
value: ( localize('resetFocusedViewLocation', "Reset Focused View Location")),
|
|
847
|
-
original: 'Reset Focused View Location'
|
|
848
|
-
},
|
|
849
|
-
category: Categories.View,
|
|
850
|
-
f1: true,
|
|
851
|
-
precondition: ( FocusedViewContext.notEqualsTo(''))
|
|
852
|
-
});
|
|
853
|
-
}
|
|
854
|
-
run(accessor) {
|
|
855
|
-
const viewDescriptorService = accessor.get(IViewDescriptorService);
|
|
856
|
-
const contextKeyService = accessor.get(IContextKeyService);
|
|
857
|
-
const dialogService = accessor.get(IDialogService);
|
|
858
|
-
const viewsService = accessor.get(IViewsService);
|
|
859
|
-
const focusedViewId = FocusedViewContext.getValue(contextKeyService);
|
|
860
|
-
let viewDescriptor = null;
|
|
861
|
-
if (focusedViewId !== undefined && focusedViewId.trim() !== '') {
|
|
862
|
-
viewDescriptor = viewDescriptorService.getViewDescriptorById(focusedViewId);
|
|
863
|
-
}
|
|
864
|
-
if (!viewDescriptor) {
|
|
865
|
-
dialogService.error(( localize(
|
|
866
|
-
'resetFocusedView.error.noFocusedView',
|
|
867
|
-
"There is no view currently focused."
|
|
868
|
-
)));
|
|
869
|
-
return;
|
|
870
|
-
}
|
|
871
|
-
const defaultContainer = viewDescriptorService.getDefaultContainerById(viewDescriptor.id);
|
|
872
|
-
if (!defaultContainer || defaultContainer === viewDescriptorService.getViewContainerByViewId(viewDescriptor.id)) {
|
|
873
|
-
return;
|
|
874
|
-
}
|
|
875
|
-
viewDescriptorService.moveViewsToContainer([viewDescriptor], defaultContainer);
|
|
876
|
-
viewsService.openView(viewDescriptor.id, true);
|
|
877
|
-
}
|
|
878
|
-
});
|
|
879
|
-
class BaseResizeViewAction extends Action2 {
|
|
880
|
-
resizePart(widthChange, heightChange, layoutService, partToResize) {
|
|
881
|
-
let part;
|
|
882
|
-
if (partToResize === undefined) {
|
|
883
|
-
const isEditorFocus = layoutService.hasFocus("workbench.parts.editor" );
|
|
884
|
-
const isSidebarFocus = layoutService.hasFocus("workbench.parts.sidebar" );
|
|
885
|
-
const isPanelFocus = layoutService.hasFocus("workbench.parts.panel" );
|
|
886
|
-
const isAuxiliaryBarFocus = layoutService.hasFocus("workbench.parts.auxiliarybar" );
|
|
887
|
-
if (isSidebarFocus) {
|
|
888
|
-
part = "workbench.parts.sidebar" ;
|
|
889
|
-
}
|
|
890
|
-
else if (isPanelFocus) {
|
|
891
|
-
part = "workbench.parts.panel" ;
|
|
892
|
-
}
|
|
893
|
-
else if (isEditorFocus) {
|
|
894
|
-
part = "workbench.parts.editor" ;
|
|
895
|
-
}
|
|
896
|
-
else if (isAuxiliaryBarFocus) {
|
|
897
|
-
part = "workbench.parts.auxiliarybar" ;
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
else {
|
|
901
|
-
part = partToResize;
|
|
902
|
-
}
|
|
903
|
-
if (part) {
|
|
904
|
-
layoutService.resizePart(part, widthChange, heightChange);
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
BaseResizeViewAction.RESIZE_INCREMENT = 60;
|
|
909
|
-
class IncreaseViewSizeAction extends BaseResizeViewAction {
|
|
910
|
-
constructor() {
|
|
911
|
-
super({
|
|
912
|
-
id: 'workbench.action.increaseViewSize',
|
|
913
|
-
title: { value: ( localize('increaseViewSize', "Increase Current View Size")), original: 'Increase Current View Size' },
|
|
914
|
-
f1: true
|
|
915
|
-
});
|
|
916
|
-
}
|
|
917
|
-
run(accessor) {
|
|
918
|
-
this.resizePart(BaseResizeViewAction.RESIZE_INCREMENT, BaseResizeViewAction.RESIZE_INCREMENT, accessor.get(IWorkbenchLayoutService));
|
|
919
|
-
}
|
|
920
|
-
}
|
|
921
|
-
class IncreaseViewWidthAction extends BaseResizeViewAction {
|
|
922
|
-
constructor() {
|
|
923
|
-
super({
|
|
924
|
-
id: 'workbench.action.increaseViewWidth',
|
|
925
|
-
title: { value: ( localize('increaseEditorWidth', "Increase Editor Width")), original: 'Increase Editor Width' },
|
|
926
|
-
f1: true
|
|
927
|
-
});
|
|
928
|
-
}
|
|
929
|
-
run(accessor) {
|
|
930
|
-
this.resizePart(BaseResizeViewAction.RESIZE_INCREMENT, 0, accessor.get(IWorkbenchLayoutService), "workbench.parts.editor" );
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
class IncreaseViewHeightAction extends BaseResizeViewAction {
|
|
934
|
-
constructor() {
|
|
935
|
-
super({
|
|
936
|
-
id: 'workbench.action.increaseViewHeight',
|
|
937
|
-
title: { value: ( localize('increaseEditorHeight', "Increase Editor Height")), original: 'Increase Editor Height' },
|
|
938
|
-
f1: true
|
|
939
|
-
});
|
|
940
|
-
}
|
|
941
|
-
run(accessor) {
|
|
942
|
-
this.resizePart(0, BaseResizeViewAction.RESIZE_INCREMENT, accessor.get(IWorkbenchLayoutService), "workbench.parts.editor" );
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
class DecreaseViewSizeAction extends BaseResizeViewAction {
|
|
946
|
-
constructor() {
|
|
947
|
-
super({
|
|
948
|
-
id: 'workbench.action.decreaseViewSize',
|
|
949
|
-
title: { value: ( localize('decreaseViewSize', "Decrease Current View Size")), original: 'Decrease Current View Size' },
|
|
950
|
-
f1: true
|
|
951
|
-
});
|
|
952
|
-
}
|
|
953
|
-
run(accessor) {
|
|
954
|
-
this.resizePart(-BaseResizeViewAction.RESIZE_INCREMENT, -BaseResizeViewAction.RESIZE_INCREMENT, accessor.get(IWorkbenchLayoutService));
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
class DecreaseViewWidthAction extends BaseResizeViewAction {
|
|
958
|
-
constructor() {
|
|
959
|
-
super({
|
|
960
|
-
id: 'workbench.action.decreaseViewWidth',
|
|
961
|
-
title: { value: ( localize('decreaseEditorWidth', "Decrease Editor Width")), original: 'Decrease Editor Width' },
|
|
962
|
-
f1: true
|
|
963
|
-
});
|
|
964
|
-
}
|
|
965
|
-
run(accessor) {
|
|
966
|
-
this.resizePart(-BaseResizeViewAction.RESIZE_INCREMENT, 0, accessor.get(IWorkbenchLayoutService), "workbench.parts.editor" );
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
class DecreaseViewHeightAction extends BaseResizeViewAction {
|
|
970
|
-
constructor() {
|
|
971
|
-
super({
|
|
972
|
-
id: 'workbench.action.decreaseViewHeight',
|
|
973
|
-
title: { value: ( localize('decreaseEditorHeight', "Decrease Editor Height")), original: 'Decrease Editor Height' },
|
|
974
|
-
f1: true
|
|
975
|
-
});
|
|
976
|
-
}
|
|
977
|
-
run(accessor) {
|
|
978
|
-
this.resizePart(0, -BaseResizeViewAction.RESIZE_INCREMENT, accessor.get(IWorkbenchLayoutService), "workbench.parts.editor" );
|
|
979
|
-
}
|
|
980
|
-
}
|
|
981
|
-
registerAction2(IncreaseViewSizeAction);
|
|
982
|
-
registerAction2(IncreaseViewWidthAction);
|
|
983
|
-
registerAction2(IncreaseViewHeightAction);
|
|
984
|
-
registerAction2(DecreaseViewSizeAction);
|
|
985
|
-
registerAction2(DecreaseViewWidthAction);
|
|
986
|
-
registerAction2(DecreaseViewHeightAction);
|
|
987
|
-
function isContextualLayoutVisualIcon(icon) {
|
|
988
|
-
return icon.iconA !== undefined;
|
|
989
|
-
}
|
|
990
|
-
const CreateToggleLayoutItem = (id, active, label, visualIcon) => {
|
|
991
|
-
return {
|
|
992
|
-
id,
|
|
993
|
-
active,
|
|
994
|
-
label,
|
|
995
|
-
visualIcon,
|
|
996
|
-
activeIcon: Codicon.eye,
|
|
997
|
-
inactiveIcon: Codicon.eyeClosed,
|
|
998
|
-
activeAriaLabel: ( localize('selectToHide', "Select to Hide")),
|
|
999
|
-
inactiveAriaLabel: ( localize('selectToShow', "Select to Show")),
|
|
1000
|
-
useButtons: true,
|
|
1001
|
-
};
|
|
1002
|
-
};
|
|
1003
|
-
const CreateOptionLayoutItem = (id, active, label, visualIcon) => {
|
|
1004
|
-
return {
|
|
1005
|
-
id,
|
|
1006
|
-
active,
|
|
1007
|
-
label,
|
|
1008
|
-
visualIcon,
|
|
1009
|
-
activeIcon: Codicon.check,
|
|
1010
|
-
activeAriaLabel: ( localize('active', "Active")),
|
|
1011
|
-
useButtons: false
|
|
1012
|
-
};
|
|
1013
|
-
};
|
|
1014
|
-
const MenuBarToggledContext = ( ContextKeyExpr.and(( IsMacNativeContext.toNegated()), ( ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'hidden')), ( ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'toggle')), ( ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'compact'))));
|
|
1015
|
-
const ToggleVisibilityActions = [];
|
|
1016
|
-
if (!isMacintosh || !isNative) {
|
|
1017
|
-
ToggleVisibilityActions.push(CreateToggleLayoutItem('workbench.action.toggleMenuBar', MenuBarToggledContext, ( localize('menuBar', "Menu Bar")), menubarIcon));
|
|
1018
|
-
}
|
|
1019
|
-
ToggleVisibilityActions.push(...[
|
|
1020
|
-
CreateToggleLayoutItem(ToggleActivityBarVisibilityAction.ID, ( ContextKeyExpr.equals('config.workbench.activityBar.visible', true)), ( localize('activityBar', "Activity Bar")), { whenA: ( ContextKeyExpr.equals('config.workbench.sideBar.location', 'left')), iconA: activityBarLeftIcon, iconB: activityBarRightIcon }),
|
|
1021
|
-
CreateToggleLayoutItem(ToggleSidebarVisibilityAction.ID, SideBarVisibleContext, ( localize('sideBar', "Primary Side Bar")), { whenA: ( ContextKeyExpr.equals('config.workbench.sideBar.location', 'left')), iconA: panelLeftIcon, iconB: panelRightIcon }),
|
|
1022
|
-
CreateToggleLayoutItem(ToggleAuxiliaryBarAction.ID, AuxiliaryBarVisibleContext, ( localize('secondarySideBar', "Secondary Side Bar")), { whenA: ( ContextKeyExpr.equals('config.workbench.sideBar.location', 'left')), iconA: panelRightIcon, iconB: panelLeftIcon }),
|
|
1023
|
-
CreateToggleLayoutItem(TogglePanelAction.ID, PanelVisibleContext, ( localize('panel', "Panel")), panelIcon),
|
|
1024
|
-
CreateToggleLayoutItem(ToggleStatusbarVisibilityAction.ID, ( ContextKeyExpr.equals('config.workbench.statusBar.visible', true)), ( localize('statusBar', "Status Bar")), statusBarIcon),
|
|
1025
|
-
]);
|
|
1026
|
-
const MoveSideBarActions = [
|
|
1027
|
-
CreateOptionLayoutItem(MoveSidebarLeftAction.ID, ( ContextKeyExpr.equals('config.workbench.sideBar.location', 'left')), ( localize('leftSideBar', "Left")), panelLeftIcon),
|
|
1028
|
-
CreateOptionLayoutItem(MoveSidebarRightAction.ID, ( ContextKeyExpr.equals('config.workbench.sideBar.location', 'right')), ( localize('rightSideBar', "Right")), panelRightIcon),
|
|
1029
|
-
];
|
|
1030
|
-
const AlignPanelActions = [
|
|
1031
|
-
CreateOptionLayoutItem('workbench.action.alignPanelLeft', ( PanelAlignmentContext.isEqualTo('left')), ( localize('leftPanel', "Left")), panelAlignmentLeftIcon),
|
|
1032
|
-
CreateOptionLayoutItem('workbench.action.alignPanelRight', ( PanelAlignmentContext.isEqualTo('right')), ( localize('rightPanel', "Right")), panelAlignmentRightIcon),
|
|
1033
|
-
CreateOptionLayoutItem('workbench.action.alignPanelCenter', ( PanelAlignmentContext.isEqualTo('center')), ( localize('centerPanel', "Center")), panelAlignmentCenterIcon),
|
|
1034
|
-
CreateOptionLayoutItem('workbench.action.alignPanelJustify', ( PanelAlignmentContext.isEqualTo('justify')), ( localize('justifyPanel', "Justify")), panelAlignmentJustifyIcon),
|
|
1035
|
-
];
|
|
1036
|
-
const MiscLayoutOptions = [
|
|
1037
|
-
CreateOptionLayoutItem('workbench.action.toggleFullScreen', IsFullscreenContext, ( localize('fullscreen', "Full Screen")), fullscreenIcon),
|
|
1038
|
-
CreateOptionLayoutItem('workbench.action.toggleZenMode', InEditorZenModeContext, ( localize('zenMode', "Zen Mode")), zenModeIcon),
|
|
1039
|
-
CreateOptionLayoutItem('workbench.action.toggleCenteredLayout', IsCenteredLayoutContext, ( localize('centeredLayout', "Centered Layout")), centerLayoutIcon),
|
|
1040
|
-
];
|
|
1041
|
-
const LayoutContextKeySet = ( new Set());
|
|
1042
|
-
for (const { active } of [...ToggleVisibilityActions, ...MoveSideBarActions, ...AlignPanelActions, ...MiscLayoutOptions]) {
|
|
1043
|
-
for (const key of ( active.keys())) {
|
|
1044
|
-
LayoutContextKeySet.add(key);
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
1047
|
-
registerAction2(class CustomizeLayoutAction extends Action2 {
|
|
1048
|
-
constructor() {
|
|
1049
|
-
super({
|
|
1050
|
-
id: 'workbench.action.customizeLayout',
|
|
1051
|
-
title: { original: 'Customize Layout...', value: ( localize('customizeLayout', "Customize Layout...")) },
|
|
1052
|
-
f1: true,
|
|
1053
|
-
icon: configureLayoutIcon,
|
|
1054
|
-
menu: [
|
|
1055
|
-
{
|
|
1056
|
-
id: MenuId.LayoutControlMenuSubmenu,
|
|
1057
|
-
group: 'z_end',
|
|
1058
|
-
},
|
|
1059
|
-
{
|
|
1060
|
-
id: MenuId.LayoutControlMenu,
|
|
1061
|
-
when: ( ContextKeyExpr.equals('config.workbench.layoutControl.type', 'both')),
|
|
1062
|
-
group: 'z_end'
|
|
1063
|
-
}
|
|
1064
|
-
]
|
|
1065
|
-
});
|
|
1066
|
-
}
|
|
1067
|
-
getItems(contextKeyService) {
|
|
1068
|
-
const toQuickPickItem = (item) => {
|
|
1069
|
-
const toggled = item.active.evaluate(contextKeyService.getContext(null));
|
|
1070
|
-
let label = item.useButtons ?
|
|
1071
|
-
item.label :
|
|
1072
|
-
item.label + (toggled && item.activeIcon ? ` $(${item.activeIcon.id})` : (!toggled && item.inactiveIcon ? ` $(${item.inactiveIcon.id})` : ''));
|
|
1073
|
-
const ariaLabel = item.label + (toggled && item.activeAriaLabel ? ` (${item.activeAriaLabel})` : (!toggled && item.inactiveAriaLabel ? ` (${item.inactiveAriaLabel})` : ''));
|
|
1074
|
-
if (item.visualIcon) {
|
|
1075
|
-
let icon = item.visualIcon;
|
|
1076
|
-
if (isContextualLayoutVisualIcon(icon)) {
|
|
1077
|
-
const useIconA = icon.whenA.evaluate(contextKeyService.getContext(null));
|
|
1078
|
-
icon = useIconA ? icon.iconA : icon.iconB;
|
|
1079
|
-
}
|
|
1080
|
-
label = `$(${icon.id}) ${label}`;
|
|
1081
|
-
}
|
|
1082
|
-
const icon = toggled ? item.activeIcon : item.inactiveIcon;
|
|
1083
|
-
return {
|
|
1084
|
-
type: 'item',
|
|
1085
|
-
id: item.id,
|
|
1086
|
-
label,
|
|
1087
|
-
ariaLabel,
|
|
1088
|
-
buttons: !item.useButtons ? undefined : [
|
|
1089
|
-
{
|
|
1090
|
-
alwaysVisible: false,
|
|
1091
|
-
tooltip: ariaLabel,
|
|
1092
|
-
iconClass: icon ? ThemeIcon.asClassName(icon) : undefined
|
|
1093
|
-
}
|
|
1094
|
-
]
|
|
1095
|
-
};
|
|
1096
|
-
};
|
|
1097
|
-
return [
|
|
1098
|
-
{
|
|
1099
|
-
type: 'separator',
|
|
1100
|
-
label: ( localize('toggleVisibility', "Visibility"))
|
|
1101
|
-
},
|
|
1102
|
-
...( ToggleVisibilityActions.map(toQuickPickItem)),
|
|
1103
|
-
{
|
|
1104
|
-
type: 'separator',
|
|
1105
|
-
label: ( localize('sideBarPosition', "Primary Side Bar Position"))
|
|
1106
|
-
},
|
|
1107
|
-
...( MoveSideBarActions.map(toQuickPickItem)),
|
|
1108
|
-
{
|
|
1109
|
-
type: 'separator',
|
|
1110
|
-
label: ( localize('panelAlignment', "Panel Alignment"))
|
|
1111
|
-
},
|
|
1112
|
-
...( AlignPanelActions.map(toQuickPickItem)),
|
|
1113
|
-
{
|
|
1114
|
-
type: 'separator',
|
|
1115
|
-
label: ( localize('layoutModes', "Modes")),
|
|
1116
|
-
},
|
|
1117
|
-
...( MiscLayoutOptions.map(toQuickPickItem)),
|
|
1118
|
-
];
|
|
1119
|
-
}
|
|
1120
|
-
run(accessor) {
|
|
1121
|
-
if (this._currentQuickPick) {
|
|
1122
|
-
this._currentQuickPick.hide();
|
|
1123
|
-
return;
|
|
1124
|
-
}
|
|
1125
|
-
const configurationService = accessor.get(IConfigurationService);
|
|
1126
|
-
const contextKeyService = accessor.get(IContextKeyService);
|
|
1127
|
-
const commandService = accessor.get(ICommandService);
|
|
1128
|
-
const quickInputService = accessor.get(IQuickInputService);
|
|
1129
|
-
const quickPick = quickInputService.createQuickPick();
|
|
1130
|
-
this._currentQuickPick = quickPick;
|
|
1131
|
-
quickPick.items = this.getItems(contextKeyService);
|
|
1132
|
-
quickPick.ignoreFocusOut = true;
|
|
1133
|
-
quickPick.hideInput = true;
|
|
1134
|
-
quickPick.title = ( localize('customizeLayoutQuickPickTitle', "Customize Layout"));
|
|
1135
|
-
const closeButton = {
|
|
1136
|
-
alwaysVisible: true,
|
|
1137
|
-
iconClass: ThemeIcon.asClassName(Codicon.close),
|
|
1138
|
-
tooltip: ( localize('close', "Close"))
|
|
1139
|
-
};
|
|
1140
|
-
const resetButton = {
|
|
1141
|
-
alwaysVisible: true,
|
|
1142
|
-
iconClass: ThemeIcon.asClassName(Codicon.discard),
|
|
1143
|
-
tooltip: ( localize('restore defaults', "Restore Defaults"))
|
|
1144
|
-
};
|
|
1145
|
-
quickPick.buttons = [
|
|
1146
|
-
resetButton,
|
|
1147
|
-
closeButton
|
|
1148
|
-
];
|
|
1149
|
-
const disposables = ( new DisposableStore());
|
|
1150
|
-
let selectedItem = undefined;
|
|
1151
|
-
disposables.add(contextKeyService.onDidChangeContext(changeEvent => {
|
|
1152
|
-
if (changeEvent.affectsSome(LayoutContextKeySet)) {
|
|
1153
|
-
quickPick.items = this.getItems(contextKeyService);
|
|
1154
|
-
if (selectedItem) {
|
|
1155
|
-
quickPick.activeItems = quickPick.items.filter(item => item.id === selectedItem?.id);
|
|
1156
|
-
}
|
|
1157
|
-
setTimeout(() => quickInputService.focus(), 0);
|
|
1158
|
-
}
|
|
1159
|
-
}));
|
|
1160
|
-
quickPick.onDidAccept(event => {
|
|
1161
|
-
if (quickPick.selectedItems.length) {
|
|
1162
|
-
selectedItem = quickPick.selectedItems[0];
|
|
1163
|
-
commandService.executeCommand(selectedItem.id);
|
|
1164
|
-
}
|
|
1165
|
-
});
|
|
1166
|
-
quickPick.onDidTriggerItemButton(event => {
|
|
1167
|
-
if (event.item) {
|
|
1168
|
-
selectedItem = event.item;
|
|
1169
|
-
commandService.executeCommand(selectedItem.id);
|
|
1170
|
-
}
|
|
1171
|
-
});
|
|
1172
|
-
quickPick.onDidTriggerButton((button) => {
|
|
1173
|
-
if (button === closeButton) {
|
|
1174
|
-
quickPick.hide();
|
|
1175
|
-
}
|
|
1176
|
-
else if (button === resetButton) {
|
|
1177
|
-
const resetSetting = (id) => {
|
|
1178
|
-
const config = configurationService.inspect(id);
|
|
1179
|
-
configurationService.updateValue(id, config.defaultValue);
|
|
1180
|
-
};
|
|
1181
|
-
resetSetting('workbench.activityBar.visible');
|
|
1182
|
-
resetSetting('workbench.sideBar.location');
|
|
1183
|
-
resetSetting('workbench.statusBar.visible');
|
|
1184
|
-
resetSetting('workbench.panel.defaultLocation');
|
|
1185
|
-
if (!isMacintosh || !isNative) {
|
|
1186
|
-
resetSetting('window.menuBarVisibility');
|
|
1187
|
-
}
|
|
1188
|
-
commandService.executeCommand('workbench.action.alignPanelCenter');
|
|
1189
|
-
}
|
|
1190
|
-
});
|
|
1191
|
-
quickPick.onDidHide(() => {
|
|
1192
|
-
quickPick.dispose();
|
|
1193
|
-
});
|
|
1194
|
-
quickPick.onDispose(() => {
|
|
1195
|
-
this._currentQuickPick = undefined;
|
|
1196
|
-
disposables.dispose();
|
|
1197
|
-
});
|
|
1198
|
-
quickPick.show();
|
|
1199
|
-
}
|
|
1200
|
-
});
|
|
1201
|
-
export { ToggleActivityBarVisibilityAction, ToggleSidebarPositionAction, ToggleStatusbarVisibilityAction, ToggleTabsVisibilityAction };
|