Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/browser/workbench.contribution.ts
3294 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 { isStandalone } from '../../base/browser/browser.js';
7
import { isLinux, isMacintosh, isNative, isWeb, isWindows } from '../../base/common/platform.js';
8
import { localize } from '../../nls.js';
9
import { Extensions as ConfigurationExtensions, ConfigurationScope, IConfigurationRegistry } from '../../platform/configuration/common/configurationRegistry.js';
10
import { Registry } from '../../platform/registry/common/platform.js';
11
import { ConfigurationKeyValuePairs, ConfigurationMigrationWorkbenchContribution, DynamicWindowConfiguration, DynamicWorkbenchSecurityConfiguration, Extensions, IConfigurationMigrationRegistry, problemsConfigurationNodeBase, windowConfigurationNodeBase, workbenchConfigurationNodeBase } from '../common/configuration.js';
12
import { WorkbenchPhase, registerWorkbenchContribution2 } from '../common/contributions.js';
13
import { CustomEditorLabelService } from '../services/editor/common/customEditorLabelService.js';
14
import { ActivityBarPosition, EditorActionsLocation, EditorTabsMode, LayoutSettings } from '../services/layout/browser/layoutService.js';
15
import { defaultWindowTitle, defaultWindowTitleSeparator } from './parts/titlebar/windowTitle.js';
16
17
const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration);
18
19
// Configuration
20
(function registerConfiguration(): void {
21
22
// Migration support
23
registerWorkbenchContribution2(ConfigurationMigrationWorkbenchContribution.ID, ConfigurationMigrationWorkbenchContribution, WorkbenchPhase.Eventually);
24
25
// Dynamic Configuration
26
registerWorkbenchContribution2(DynamicWorkbenchSecurityConfiguration.ID, DynamicWorkbenchSecurityConfiguration, WorkbenchPhase.AfterRestored);
27
28
// Workbench
29
registry.registerConfiguration({
30
...workbenchConfigurationNodeBase,
31
'properties': {
32
'workbench.externalBrowser': {
33
type: 'string',
34
markdownDescription: localize('browser', "Configure the browser to use for opening http or https links externally. This can either be the name of the browser (`edge`, `chrome`, `firefox`) or an absolute path to the browser's executable. Will use the system default if not set."),
35
included: isNative,
36
restricted: true
37
},
38
'workbench.editor.titleScrollbarSizing': {
39
type: 'string',
40
enum: ['default', 'large'],
41
enumDescriptions: [
42
localize('workbench.editor.titleScrollbarSizing.default', "The default size."),
43
localize('workbench.editor.titleScrollbarSizing.large', "Increases the size, so it can be grabbed more easily with the mouse.")
44
],
45
description: localize('tabScrollbarHeight', "Controls the height of the scrollbars used for tabs and breadcrumbs in the editor title area."),
46
default: 'default',
47
},
48
'workbench.editor.titleScrollbarVisibility': {
49
type: 'string',
50
enum: ['auto', 'visible', 'hidden'],
51
enumDescriptions: [
52
localize('workbench.editor.titleScrollbarVisibility.auto', "The horizontal scrollbar will be visible only when necessary."),
53
localize('workbench.editor.titleScrollbarVisibility.visible', "The horizontal scrollbar will always be visible."),
54
localize('workbench.editor.titleScrollbarVisibility.hidden', "The horizontal scrollbar will always be hidden.")
55
],
56
description: localize('titleScrollbarVisibility', "Controls the visibility of the scrollbars used for tabs and breadcrumbs in the editor title area."),
57
default: 'auto',
58
},
59
[LayoutSettings.EDITOR_TABS_MODE]: {
60
'type': 'string',
61
'enum': [EditorTabsMode.MULTIPLE, EditorTabsMode.SINGLE, EditorTabsMode.NONE],
62
'enumDescriptions': [
63
localize('workbench.editor.showTabs.multiple', "Each editor is displayed as a tab in the editor title area."),
64
localize('workbench.editor.showTabs.single', "The active editor is displayed as a single large tab in the editor title area."),
65
localize('workbench.editor.showTabs.none', "The editor title area is not displayed."),
66
],
67
'description': localize('showEditorTabs', "Controls whether opened editors should show as individual tabs, one single large tab or if the title area should not be shown."),
68
'default': 'multiple'
69
},
70
[LayoutSettings.EDITOR_ACTIONS_LOCATION]: {
71
'type': 'string',
72
'enum': [EditorActionsLocation.DEFAULT, EditorActionsLocation.TITLEBAR, EditorActionsLocation.HIDDEN],
73
'markdownEnumDescriptions': [
74
localize({ comment: ['{0} will be a setting name rendered as a link'], key: 'workbench.editor.editorActionsLocation.default' }, "Show editor actions in the window title bar when {0} is set to {1}. Otherwise, editor actions are shown in the editor tab bar.", '`#workbench.editor.showTabs#`', '`none`'),
75
localize({ comment: ['{0} will be a setting name rendered as a link'], key: 'workbench.editor.editorActionsLocation.titleBar' }, "Show editor actions in the window title bar. If {0} is set to {1}, editor actions are hidden.", '`#window.customTitleBarVisibility#`', '`never`'),
76
localize('workbench.editor.editorActionsLocation.hidden', "Editor actions are not shown."),
77
],
78
'markdownDescription': localize('editorActionsLocation', "Controls where the editor actions are shown."),
79
'default': 'default'
80
},
81
'workbench.editor.alwaysShowEditorActions': {
82
'type': 'boolean',
83
'markdownDescription': localize('alwaysShowEditorActions', "Controls whether to always show the editor actions, even when the editor group is not active."),
84
'default': false
85
},
86
'workbench.editor.wrapTabs': {
87
'type': 'boolean',
88
'markdownDescription': localize({ comment: ['{0}, {1} will be a setting name rendered as a link'], key: 'wrapTabs' }, "Controls whether tabs should be wrapped over multiple lines when exceeding available space or whether a scrollbar should appear instead. This value is ignored when {0} is not set to '{1}'.", '`#workbench.editor.showTabs#`', '`multiple`'),
89
'default': false
90
},
91
'workbench.editor.scrollToSwitchTabs': {
92
'type': 'boolean',
93
'markdownDescription': localize({ comment: ['{0}, {1} will be a setting name rendered as a link'], key: 'scrollToSwitchTabs' }, "Controls whether scrolling over tabs will open them or not. By default tabs will only reveal upon scrolling, but not open. You can press and hold the Shift-key while scrolling to change this behavior for that duration. This value is ignored when {0} is not set to {1}.", '`#workbench.editor.showTabs#`', '`multiple`'),
94
'default': false
95
},
96
'workbench.editor.highlightModifiedTabs': {
97
'type': 'boolean',
98
'markdownDescription': localize({ comment: ['{0}, {1} will be a setting name rendered as a link'], key: 'highlightModifiedTabs' }, "Controls whether a top border is drawn on tabs for editors that have unsaved changes. This value is ignored when {0} is not set to {1}.", '`#workbench.editor.showTabs#`', `multiple`),
99
'default': false
100
},
101
'workbench.editor.decorations.badges': {
102
'type': 'boolean',
103
'markdownDescription': localize('decorations.badges', "Controls whether editor file decorations should use badges."),
104
'default': true
105
},
106
'workbench.editor.decorations.colors': {
107
'type': 'boolean',
108
'markdownDescription': localize('decorations.colors', "Controls whether editor file decorations should use colors."),
109
'default': true
110
},
111
[CustomEditorLabelService.SETTING_ID_ENABLED]: {
112
'type': 'boolean',
113
'markdownDescription': localize('workbench.editor.label.enabled', "Controls whether the custom workbench editor labels should be applied."),
114
'default': true,
115
},
116
[CustomEditorLabelService.SETTING_ID_PATTERNS]: {
117
'type': 'object',
118
'markdownDescription': (() => {
119
let customEditorLabelDescription = localize('workbench.editor.label.patterns', "Controls the rendering of the editor label. Each __Item__ is a pattern that matches a file path. Both relative and absolute file paths are supported. The relative path must include the WORKSPACE_FOLDER (e.g `WORKSPACE_FOLDER/src/**.tsx` or `*/src/**.tsx`). Absolute patterns must start with a `/`. In case multiple patterns match, the longest matching path will be picked. Each __Value__ is the template for the rendered editor when the __Item__ matches. Variables are substituted based on the context:");
120
customEditorLabelDescription += '\n- ' + [
121
localize('workbench.editor.label.dirname', "`${dirname}`: name of the folder in which the file is located (e.g. `WORKSPACE_FOLDER/folder/file.txt -> folder`)."),
122
localize('workbench.editor.label.nthdirname', "`${dirname(N)}`: name of the nth parent folder in which the file is located (e.g. `N=2: WORKSPACE_FOLDER/static/folder/file.txt -> WORKSPACE_FOLDER`). Folders can be picked from the start of the path by using negative numbers (e.g. `N=-1: WORKSPACE_FOLDER/folder/file.txt -> WORKSPACE_FOLDER`). If the __Item__ is an absolute pattern path, the first folder (`N=-1`) refers to the first folder in the absolute path, otherwise it corresponds to the workspace folder."),
123
localize('workbench.editor.label.filename', "`${filename}`: name of the file without the file extension (e.g. `WORKSPACE_FOLDER/folder/file.txt -> file`)."),
124
localize('workbench.editor.label.extname', "`${extname}`: the file extension (e.g. `WORKSPACE_FOLDER/folder/file.txt -> txt`)."),
125
localize('workbench.editor.label.nthextname', "`${extname(N)}`: the nth extension of the file separated by '.' (e.g. `N=2: WORKSPACE_FOLDER/folder/file.ext1.ext2.ext3 -> ext1`). Extension can be picked from the start of the extension by using negative numbers (e.g. `N=-1: WORKSPACE_FOLDER/folder/file.ext1.ext2.ext3 -> ext2`)."),
126
].join('\n- '); // intentionally concatenated to not produce a string that is too long for translations
127
customEditorLabelDescription += '\n\n' + localize('customEditorLabelDescriptionExample', "Example: `\"**/static/**/*.html\": \"${filename} - ${dirname} (${extname})\"` will render a file `WORKSPACE_FOLDER/static/folder/file.html` as `file - folder (html)`.");
128
129
return customEditorLabelDescription;
130
})(),
131
additionalProperties:
132
{
133
type: ['string', 'null'],
134
markdownDescription: localize('workbench.editor.label.template', "The template which should be rendered when the pattern matches. May include the variables ${dirname}, ${filename} and ${extname}."),
135
minLength: 1,
136
pattern: '.*[a-zA-Z0-9].*'
137
},
138
'default': {}
139
},
140
'workbench.editor.labelFormat': {
141
'type': 'string',
142
'enum': ['default', 'short', 'medium', 'long'],
143
'enumDescriptions': [
144
localize('workbench.editor.labelFormat.default', "Show the name of the file. When tabs are enabled and two files have the same name in one group the distinguishing sections of each file's path are added. When tabs are disabled, the path relative to the workspace folder is shown if the editor is active."),
145
localize('workbench.editor.labelFormat.short', "Show the name of the file followed by its directory name."),
146
localize('workbench.editor.labelFormat.medium', "Show the name of the file followed by its path relative to the workspace folder."),
147
localize('workbench.editor.labelFormat.long', "Show the name of the file followed by its absolute path.")
148
],
149
'default': 'default',
150
'description': localize('tabDescription', "Controls the format of the label for an editor."),
151
},
152
'workbench.editor.untitled.labelFormat': {
153
'type': 'string',
154
'enum': ['content', 'name'],
155
'enumDescriptions': [
156
localize('workbench.editor.untitled.labelFormat.content', "The name of the untitled file is derived from the contents of its first line unless it has an associated file path. It will fallback to the name in case the line is empty or contains no word characters."),
157
localize('workbench.editor.untitled.labelFormat.name', "The name of the untitled file is not derived from the contents of the file."),
158
],
159
'default': 'content',
160
'description': localize('untitledLabelFormat', "Controls the format of the label for an untitled editor."),
161
},
162
'workbench.editor.empty.hint': {
163
'type': 'string',
164
'enum': ['text', 'hidden'],
165
'default': 'text',
166
'markdownDescription': localize("workbench.editor.empty.hint", "Controls if the empty editor text hint should be visible in the editor.")
167
},
168
'workbench.editor.languageDetection': {
169
type: 'boolean',
170
default: true,
171
description: localize('workbench.editor.languageDetection', "Controls whether the language in a text editor is automatically detected unless the language has been explicitly set by the language picker. This can also be scoped by language so you can specify which languages you do not want to be switched off of. This is useful for languages like Markdown that often contain other languages that might trick language detection into thinking it's the embedded language and not Markdown."),
172
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE
173
},
174
'workbench.editor.historyBasedLanguageDetection': {
175
type: 'boolean',
176
default: true,
177
description: localize('workbench.editor.historyBasedLanguageDetection', "Enables use of editor history in language detection. This causes automatic language detection to favor languages that have been recently opened and allows for automatic language detection to operate with smaller inputs."),
178
},
179
'workbench.editor.preferHistoryBasedLanguageDetection': {
180
type: 'boolean',
181
default: false,
182
description: localize('workbench.editor.preferBasedLanguageDetection', "When enabled, a language detection model that takes into account editor history will be given higher precedence."),
183
},
184
'workbench.editor.languageDetectionHints': {
185
type: 'object',
186
default: { 'untitledEditors': true, 'notebookEditors': true },
187
description: localize('workbench.editor.showLanguageDetectionHints', "When enabled, shows a Status bar Quick Fix when the editor language doesn't match detected content language."),
188
additionalProperties: false,
189
properties: {
190
untitledEditors: {
191
type: 'boolean',
192
description: localize('workbench.editor.showLanguageDetectionHints.editors', "Show in untitled text editors"),
193
},
194
notebookEditors: {
195
type: 'boolean',
196
description: localize('workbench.editor.showLanguageDetectionHints.notebook', "Show in notebook editors"),
197
}
198
}
199
},
200
'workbench.editor.tabActionLocation': {
201
type: 'string',
202
enum: ['left', 'right'],
203
default: 'right',
204
markdownDescription: localize({ comment: ['{0} will be a setting name rendered as a link'], key: 'tabActionLocation' }, "Controls the position of the editor's tabs action buttons (close, unpin). This value is ignored when {0} is not set to {1}.", '`#workbench.editor.showTabs#`', '`multiple`')
205
},
206
'workbench.editor.tabActionCloseVisibility': {
207
type: 'boolean',
208
default: true,
209
description: localize('workbench.editor.tabActionCloseVisibility', "Controls the visibility of the tab close action button.")
210
},
211
'workbench.editor.tabActionUnpinVisibility': {
212
type: 'boolean',
213
default: true,
214
description: localize('workbench.editor.tabActionUnpinVisibility', "Controls the visibility of the tab unpin action button.")
215
},
216
'workbench.editor.showTabIndex': {
217
'type': 'boolean',
218
'default': false,
219
'markdownDescription': localize({ comment: ['{0}, {1} will be a setting name rendered as a link'], key: 'showTabIndex' }, "When enabled, will show the tab index. This value is ignored when {0} is not set to {1}.", '`#workbench.editor.showTabs#`', '`multiple`')
220
},
221
'workbench.editor.tabSizing': {
222
'type': 'string',
223
'enum': ['fit', 'shrink', 'fixed'],
224
'default': 'fit',
225
'enumDescriptions': [
226
localize('workbench.editor.tabSizing.fit', "Always keep tabs large enough to show the full editor label."),
227
localize('workbench.editor.tabSizing.shrink', "Allow tabs to get smaller when the available space is not enough to show all tabs at once."),
228
localize('workbench.editor.tabSizing.fixed', "Make all tabs the same size, while allowing them to get smaller when the available space is not enough to show all tabs at once.")
229
],
230
'markdownDescription': localize({ comment: ['{0}, {1} will be a setting name rendered as a link'], key: 'tabSizing' }, "Controls the size of editor tabs. This value is ignored when {0} is not set to {1}.", '`#workbench.editor.showTabs#`', '`multiple`')
231
},
232
'workbench.editor.tabSizingFixedMinWidth': {
233
'type': 'number',
234
'default': 50,
235
'minimum': 38,
236
'markdownDescription': localize({ comment: ['{0}, {1} will be a setting name rendered as a link'], key: 'workbench.editor.tabSizingFixedMinWidth' }, "Controls the minimum width of tabs when {0} size is set to {1}.", '`#workbench.editor.tabSizing#`', '`fixed`')
237
},
238
'workbench.editor.tabSizingFixedMaxWidth': {
239
'type': 'number',
240
'default': 160,
241
'minimum': 38,
242
'markdownDescription': localize({ comment: ['{0}, {1} will be a setting name rendered as a link'], key: 'workbench.editor.tabSizingFixedMaxWidth' }, "Controls the maximum width of tabs when {0} size is set to {1}.", '`#workbench.editor.tabSizing#`', '`fixed`')
243
},
244
'window.density.editorTabHeight': {
245
'type': 'string',
246
'enum': ['default', 'compact'],
247
'default': 'default',
248
'markdownDescription': localize({ comment: ['{0}, {1} will be a setting name rendered as a link'], key: 'workbench.editor.tabHeight' }, "Controls the height of editor tabs. Also applies to the title control bar when {0} is not set to {1}.", '`#workbench.editor.showTabs#`', '`multiple`')
249
},
250
'workbench.editor.pinnedTabSizing': {
251
'type': 'string',
252
'enum': ['normal', 'compact', 'shrink'],
253
'default': 'normal',
254
'enumDescriptions': [
255
localize('workbench.editor.pinnedTabSizing.normal', "A pinned tab inherits the look of non pinned tabs."),
256
localize('workbench.editor.pinnedTabSizing.compact', "A pinned tab will show in a compact form with only icon or first letter of the editor name."),
257
localize('workbench.editor.pinnedTabSizing.shrink', "A pinned tab shrinks to a compact fixed size showing parts of the editor name.")
258
],
259
'markdownDescription': localize({ comment: ['{0}, {1} will be a setting name rendered as a link'], key: 'pinnedTabSizing' }, "Controls the size of pinned editor tabs. Pinned tabs are sorted to the beginning of all opened tabs and typically do not close until unpinned. This value is ignored when {0} is not set to {1}.", '`#workbench.editor.showTabs#`', '`multiple`')
260
},
261
'workbench.editor.pinnedTabsOnSeparateRow': {
262
'type': 'boolean',
263
'default': false,
264
'markdownDescription': localize({ comment: ['{0}, {1} will be a setting name rendered as a link'], key: 'workbench.editor.pinnedTabsOnSeparateRow' }, "When enabled, displays pinned tabs in a separate row above all other tabs. This value is ignored when {0} is not set to {1}.", '`#workbench.editor.showTabs#`', '`multiple`'),
265
},
266
'workbench.editor.preventPinnedEditorClose': {
267
'type': 'string',
268
'enum': ['keyboardAndMouse', 'keyboard', 'mouse', 'never'],
269
'default': 'keyboardAndMouse',
270
'enumDescriptions': [
271
localize('workbench.editor.preventPinnedEditorClose.always', "Always prevent closing the pinned editor when using mouse middle click or keyboard."),
272
localize('workbench.editor.preventPinnedEditorClose.onlyKeyboard', "Prevent closing the pinned editor when using the keyboard."),
273
localize('workbench.editor.preventPinnedEditorClose.onlyMouse', "Prevent closing the pinned editor when using mouse middle click."),
274
localize('workbench.editor.preventPinnedEditorClose.never', "Never prevent closing a pinned editor.")
275
],
276
description: localize('workbench.editor.preventPinnedEditorClose', "Controls whether pinned editors should close when keyboard or middle mouse click is used for closing."),
277
},
278
'workbench.editor.splitSizing': {
279
'type': 'string',
280
'enum': ['auto', 'distribute', 'split'],
281
'default': 'auto',
282
'enumDescriptions': [
283
localize('workbench.editor.splitSizingAuto', "Splits the active editor group to equal parts, unless all editor groups are already in equal parts. In that case, splits all the editor groups to equal parts."),
284
localize('workbench.editor.splitSizingDistribute', "Splits all the editor groups to equal parts."),
285
localize('workbench.editor.splitSizingSplit', "Splits the active editor group to equal parts.")
286
],
287
'description': localize('splitSizing', "Controls the size of editor groups when splitting them.")
288
},
289
'workbench.editor.splitOnDragAndDrop': {
290
'type': 'boolean',
291
'default': true,
292
'description': localize('splitOnDragAndDrop', "Controls if editor groups can be split from drag and drop operations by dropping an editor or file on the edges of the editor area.")
293
},
294
'workbench.editor.dragToOpenWindow': {
295
'type': 'boolean',
296
'default': true,
297
'markdownDescription': localize('dragToOpenWindow', "Controls if editors can be dragged out of the window to open them in a new window. Press and hold the `Alt` key while dragging to toggle this dynamically.")
298
},
299
'workbench.editor.focusRecentEditorAfterClose': {
300
'type': 'boolean',
301
'description': localize('focusRecentEditorAfterClose', "Controls whether editors are closed in most recently used order or from left to right."),
302
'default': true
303
},
304
'workbench.editor.showIcons': {
305
'type': 'boolean',
306
'description': localize('showIcons', "Controls whether opened editors should show with an icon or not. This requires a file icon theme to be enabled as well."),
307
'default': true
308
},
309
'workbench.editor.enablePreview': {
310
'type': 'boolean',
311
'description': localize('enablePreview', "Controls whether preview mode is used when editors open. There is a maximum of one preview mode editor per editor group. This editor displays its filename in italics on its tab or title label and in the Open Editors view. Its contents will be replaced by the next editor opened in preview mode. Making a change in a preview mode editor will persist it, as will a double-click on its label, or the 'Keep Open' option in its label context menu. Opening a file from Explorer with a double-click persists its editor immediately."),
312
'default': true
313
},
314
'workbench.editor.enablePreviewFromQuickOpen': {
315
'type': 'boolean',
316
'markdownDescription': localize({ comment: ['{0}, {1} will be a setting name rendered as a link'], key: 'enablePreviewFromQuickOpen' }, "Controls whether editors opened from Quick Open show as preview editors. Preview editors do not stay open, and are reused until explicitly set to be kept open (via double-click or editing). When enabled, hold Ctrl before selection to open an editor as a non-preview. This value is ignored when {0} is not set to {1}.", '`#workbench.editor.showTabs#`', '`multiple`'),
317
'default': false
318
},
319
'workbench.editor.enablePreviewFromCodeNavigation': {
320
'type': 'boolean',
321
'markdownDescription': localize({ comment: ['{0}, {1} will be a setting name rendered as a link'], key: 'enablePreviewFromCodeNavigation' }, "Controls whether editors remain in preview when a code navigation is started from them. Preview editors do not stay open, and are reused until explicitly set to be kept open (via double-click or editing). This value is ignored when {0} is not set to {1}.", '`#workbench.editor.showTabs#`', '`multiple`'),
322
'default': false
323
},
324
'workbench.editor.closeOnFileDelete': {
325
'type': 'boolean',
326
'description': localize('closeOnFileDelete', "Controls whether editors showing a file that was opened during the session should close automatically when getting deleted or renamed by some other process. Disabling this will keep the editor open on such an event. Note that deleting from within the application will always close the editor and that editors with unsaved changes will never close to preserve your data."),
327
'default': false
328
},
329
'workbench.editor.openPositioning': {
330
'type': 'string',
331
'enum': ['left', 'right', 'first', 'last'],
332
'default': 'right',
333
'markdownDescription': localize({ comment: ['{0}, {1}, {2}, {3} will be a setting name rendered as a link'], key: 'editorOpenPositioning' }, "Controls where editors open. Select {0} or {1} to open editors to the left or right of the currently active one. Select {2} or {3} to open editors independently from the currently active one.", '`left`', '`right`', '`first`', '`last`')
334
},
335
'workbench.editor.openSideBySideDirection': {
336
'type': 'string',
337
'enum': ['right', 'down'],
338
'default': 'right',
339
'markdownDescription': localize('sideBySideDirection', "Controls the default direction of editors that are opened side by side (for example, from the Explorer). By default, editors will open on the right hand side of the currently active one. If changed to `down`, the editors will open below the currently active one. This also impacts the split editor action in the editor toolbar.")
340
},
341
'workbench.editor.closeEmptyGroups': {
342
'type': 'boolean',
343
'description': localize('closeEmptyGroups', "Controls the behavior of empty editor groups when the last tab in the group is closed. When enabled, empty groups will automatically close. When disabled, empty groups will remain part of the grid."),
344
'default': true
345
},
346
'workbench.editor.revealIfOpen': {
347
'type': 'boolean',
348
'description': localize('revealIfOpen', "Controls whether an editor is revealed in any of the visible groups if opened. If disabled, an editor will prefer to open in the currently active editor group. If enabled, an already opened editor will be revealed instead of opened again in the currently active editor group. Note that there are some cases where this setting is ignored, such as when forcing an editor to open in a specific group or to the side of the currently active group."),
349
'default': false
350
},
351
'workbench.editor.mouseBackForwardToNavigate': {
352
'type': 'boolean',
353
'description': localize('mouseBackForwardToNavigate', "Enables the use of mouse buttons four and five for commands 'Go Back' and 'Go Forward'."),
354
'default': true
355
},
356
'workbench.editor.navigationScope': {
357
'type': 'string',
358
'enum': ['default', 'editorGroup', 'editor'],
359
'default': 'default',
360
'markdownDescription': localize('navigationScope', "Controls the scope of history navigation in editors for commands such as 'Go Back' and 'Go Forward'."),
361
'enumDescriptions': [
362
localize('workbench.editor.navigationScopeDefault', "Navigate across all opened editors and editor groups."),
363
localize('workbench.editor.navigationScopeEditorGroup', "Navigate only in editors of the active editor group."),
364
localize('workbench.editor.navigationScopeEditor', "Navigate only in the active editor.")
365
],
366
},
367
'workbench.editor.restoreViewState': {
368
'type': 'boolean',
369
'markdownDescription': localize('restoreViewState', "Restores the last editor view state (such as scroll position) when re-opening editors after they have been closed. Editor view state is stored per editor group and discarded when a group closes. Use the {0} setting to use the last known view state across all editor groups in case no previous view state was found for a editor group.", '`#workbench.editor.sharedViewState#`'),
370
'default': true,
371
'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE
372
},
373
'workbench.editor.sharedViewState': {
374
'type': 'boolean',
375
'description': localize('sharedViewState', "Preserves the most recent editor view state (such as scroll position) across all editor groups and restores that if no specific editor view state is found for the editor group."),
376
'default': false
377
},
378
'workbench.editor.splitInGroupLayout': {
379
'type': 'string',
380
'enum': ['vertical', 'horizontal'],
381
'default': 'horizontal',
382
'markdownDescription': localize('splitInGroupLayout', "Controls the layout for when an editor is split in an editor group to be either vertical or horizontal."),
383
'enumDescriptions': [
384
localize('workbench.editor.splitInGroupLayoutVertical', "Editors are positioned from top to bottom."),
385
localize('workbench.editor.splitInGroupLayoutHorizontal', "Editors are positioned from left to right.")
386
]
387
},
388
'workbench.editor.centeredLayoutAutoResize': {
389
'type': 'boolean',
390
'default': true,
391
'description': localize('centeredLayoutAutoResize', "Controls if the centered layout should automatically resize to maximum width when more than one group is open. Once only one group is open it will resize back to the original centered width.")
392
},
393
'workbench.editor.centeredLayoutFixedWidth': {
394
'type': 'boolean',
395
'default': false,
396
'description': localize('centeredLayoutDynamicWidth', "Controls whether the centered layout tries to maintain constant width when the window is resized.")
397
},
398
'workbench.editor.doubleClickTabToToggleEditorGroupSizes': {
399
'type': 'string',
400
'enum': ['maximize', 'expand', 'off'],
401
'default': 'expand',
402
'markdownDescription': localize({ comment: ['{0}, {1} will be a setting name rendered as a link'], key: 'doubleClickTabToToggleEditorGroupSizes' }, "Controls how the editor group is resized when double clicking on a tab. This value is ignored when {0} is not set to {1}.", '`#workbench.editor.showTabs#`', '`multiple`'),
403
'enumDescriptions': [
404
localize('workbench.editor.doubleClickTabToToggleEditorGroupSizes.maximize', "All other editor groups are hidden and the current editor group is maximized to take up the entire editor area."),
405
localize('workbench.editor.doubleClickTabToToggleEditorGroupSizes.expand', "The editor group takes as much space as possible by making all other editor groups as small as possible."),
406
localize('workbench.editor.doubleClickTabToToggleEditorGroupSizes.off', "No editor group is resized when double clicking on a tab.")
407
]
408
},
409
'workbench.editor.limit.enabled': {
410
'type': 'boolean',
411
'default': false,
412
'description': localize('limitEditorsEnablement', "Controls if the number of opened editors should be limited or not. When enabled, less recently used editors will close to make space for newly opening editors.")
413
},
414
'workbench.editor.limit.value': {
415
'type': 'number',
416
'default': 10,
417
'exclusiveMinimum': 0,
418
'markdownDescription': localize('limitEditorsMaximum', "Controls the maximum number of opened editors. Use the {0} setting to control this limit per editor group or across all groups.", '`#workbench.editor.limit.perEditorGroup#`')
419
},
420
'workbench.editor.limit.excludeDirty': {
421
'type': 'boolean',
422
'default': false,
423
'description': localize('limitEditorsExcludeDirty', "Controls if the maximum number of opened editors should exclude dirty editors for counting towards the configured limit.")
424
},
425
'workbench.editor.limit.perEditorGroup': {
426
'type': 'boolean',
427
'default': false,
428
'description': localize('perEditorGroup', "Controls if the limit of maximum opened editors should apply per editor group or across all editor groups.")
429
},
430
'workbench.localHistory.enabled': {
431
'type': 'boolean',
432
'default': true,
433
'description': localize('localHistoryEnabled', "Controls whether local file history is enabled. When enabled, the file contents of an editor that is saved will be stored to a backup location to be able to restore or review the contents later. Changing this setting has no effect on existing local file history entries."),
434
'scope': ConfigurationScope.RESOURCE
435
},
436
'workbench.localHistory.maxFileSize': {
437
'type': 'number',
438
'default': 256,
439
'minimum': 1,
440
'description': localize('localHistoryMaxFileSize', "Controls the maximum size of a file (in KB) to be considered for local file history. Files that are larger will not be added to the local file history. Changing this setting has no effect on existing local file history entries."),
441
'scope': ConfigurationScope.RESOURCE
442
},
443
'workbench.localHistory.maxFileEntries': {
444
'type': 'number',
445
'default': 50,
446
'minimum': 0,
447
'description': localize('localHistoryMaxFileEntries', "Controls the maximum number of local file history entries per file. When the number of local file history entries exceeds this number for a file, the oldest entries will be discarded."),
448
'scope': ConfigurationScope.RESOURCE
449
},
450
'workbench.localHistory.exclude': {
451
'type': 'object',
452
'patternProperties': {
453
'.*': { 'type': 'boolean' }
454
},
455
'markdownDescription': localize('exclude', "Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) for excluding files from the local file history. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths. Changing this setting has no effect on existing local file history entries."),
456
'scope': ConfigurationScope.RESOURCE
457
},
458
'workbench.localHistory.mergeWindow': {
459
'type': 'number',
460
'default': 10,
461
'minimum': 1,
462
'markdownDescription': localize('mergeWindow', "Configure an interval in seconds during which the last entry in local file history is replaced with the entry that is being added. This helps reduce the overall number of entries that are added, for example when auto save is enabled. This setting is only applied to entries that have the same source of origin. Changing this setting has no effect on existing local file history entries."),
463
'scope': ConfigurationScope.RESOURCE
464
},
465
'workbench.commandPalette.history': {
466
'type': 'number',
467
'description': localize('commandHistory', "Controls the number of recently used commands to keep in history for the command palette. Set to 0 to disable command history."),
468
'default': 50,
469
'minimum': 0
470
},
471
'workbench.commandPalette.preserveInput': {
472
'type': 'boolean',
473
'description': localize('preserveInput', "Controls whether the last typed input to the command palette should be restored when opening it the next time."),
474
'default': false
475
},
476
'workbench.commandPalette.experimental.suggestCommands': {
477
'type': 'boolean',
478
tags: ['experimental'],
479
'description': localize('suggestCommands', "Controls whether the command palette should have a list of commonly used commands."),
480
'default': false
481
},
482
'workbench.commandPalette.experimental.askChatLocation': {
483
'type': 'string',
484
tags: ['experimental'],
485
'description': localize('askChatLocation', "Controls where the command palette should ask chat questions."),
486
'default': 'chatView',
487
enum: ['chatView', 'quickChat'],
488
enumDescriptions: [
489
localize('askChatLocation.chatView', "Ask chat questions in the Chat view."),
490
localize('askChatLocation.quickChat', "Ask chat questions in Quick Chat.")
491
]
492
},
493
'workbench.commandPalette.experimental.enableNaturalLanguageSearch': {
494
'type': 'boolean',
495
tags: ['experimental'],
496
'description': localize('enableNaturalLanguageSearch', "Controls whether the command palette should include similar commands. You must have an extension installed that provides Natural Language support."),
497
'default': true
498
},
499
'workbench.quickOpen.closeOnFocusLost': {
500
'type': 'boolean',
501
'description': localize('closeOnFocusLost', "Controls whether Quick Open should close automatically once it loses focus."),
502
'default': true
503
},
504
'workbench.quickOpen.preserveInput': {
505
'type': 'boolean',
506
'description': localize('workbench.quickOpen.preserveInput', "Controls whether the last typed input to Quick Open should be restored when opening it the next time."),
507
'default': false
508
},
509
'workbench.settings.openDefaultSettings': {
510
'type': 'boolean',
511
'description': localize('openDefaultSettings', "Controls whether opening settings also opens an editor showing all default settings."),
512
'default': false
513
},
514
'workbench.settings.useSplitJSON': {
515
'type': 'boolean',
516
'markdownDescription': localize('useSplitJSON', "Controls whether to use the split JSON editor when editing settings as JSON."),
517
'default': false
518
},
519
'workbench.settings.openDefaultKeybindings': {
520
'type': 'boolean',
521
'description': localize('openDefaultKeybindings', "Controls whether opening keybinding settings also opens an editor showing all default keybindings."),
522
'default': false
523
},
524
'workbench.sideBar.location': {
525
'type': 'string',
526
'enum': ['left', 'right'],
527
'default': 'left',
528
'description': localize('sideBarLocation', "Controls the location of the primary side bar and activity bar. They can either show on the left or right of the workbench. The secondary side bar will show on the opposite side of the workbench.")
529
},
530
'workbench.panel.showLabels': {
531
'type': 'boolean',
532
'default': true,
533
'description': localize('panelShowLabels', "Controls whether activity items in the panel title are shown as label or icon."),
534
},
535
'workbench.panel.defaultLocation': {
536
'type': 'string',
537
'enum': ['left', 'bottom', 'top', 'right'],
538
'default': 'bottom',
539
'description': localize('panelDefaultLocation', "Controls the default location of the panel (Terminal, Debug Console, Output, Problems) in a new workspace. It can either show at the bottom, top, right, or left of the editor area."),
540
},
541
'workbench.panel.opensMaximized': {
542
'type': 'string',
543
'enum': ['always', 'never', 'preserve'],
544
'default': 'preserve',
545
'description': localize('panelOpensMaximized', "Controls whether the panel opens maximized. It can either always open maximized, never open maximized, or open to the last state it was in before being closed."),
546
'enumDescriptions': [
547
localize('workbench.panel.opensMaximized.always', "Always maximize the panel when opening it."),
548
localize('workbench.panel.opensMaximized.never', "Never maximize the panel when opening it."),
549
localize('workbench.panel.opensMaximized.preserve', "Open the panel to the state that it was in, before it was closed.")
550
]
551
},
552
'workbench.secondarySideBar.defaultVisibility': {
553
'type': 'string',
554
'enum': ['hidden', 'visibleInWorkspace', 'visible', 'maximizedInWorkspace', 'maximized'],
555
'default': 'visibleInWorkspace',
556
'description': localize('secondarySideBarDefaultVisibility', "Controls the default visibility of the secondary side bar in workspaces or empty windows that are opened for the first time."),
557
'enumDescriptions': [
558
localize('workbench.secondarySideBar.defaultVisibility.hidden', "The secondary side bar is hidden by default."),
559
localize('workbench.secondarySideBar.defaultVisibility.visibleInWorkspace', "The secondary side bar is visible by default if a workspace is opened."),
560
localize('workbench.secondarySideBar.defaultVisibility.visible', "The secondary side bar is visible by default."),
561
localize('workbench.secondarySideBar.defaultVisibility.maximizedInWorkspace', "The secondary side bar is visible and maximized by default if a workspace is opened."),
562
localize('workbench.secondarySideBar.defaultVisibility.maximized', "The secondary side bar is visible and maximized by default.")
563
]
564
},
565
'workbench.secondarySideBar.showLabels': {
566
'type': 'boolean',
567
'default': true,
568
'markdownDescription': localize('secondarySideBarShowLabels', "Controls whether activity items in the secondary side bar title are shown as label or icon. This setting only has an effect when {0} is not set to {1}.", '`#workbench.activityBar.location#`', '`top`'),
569
},
570
'workbench.statusBar.visible': {
571
'type': 'boolean',
572
'default': true,
573
'description': localize('statusBarVisibility', "Controls the visibility of the status bar at the bottom of the workbench.")
574
},
575
[LayoutSettings.ACTIVITY_BAR_LOCATION]: {
576
'type': 'string',
577
'enum': ['default', 'top', 'bottom', 'hidden'],
578
'default': 'default',
579
'markdownDescription': localize({ comment: ['This is the description for a setting'], key: 'activityBarLocation' }, "Controls the location of the Activity Bar relative to the Primary and Secondary Side Bars."),
580
'enumDescriptions': [
581
localize('workbench.activityBar.location.default', "Show the Activity Bar on the side of the Primary Side Bar and on top of the Secondary Side Bar."),
582
localize('workbench.activityBar.location.top', "Show the Activity Bar on top of the Primary and Secondary Side Bars."),
583
localize('workbench.activityBar.location.bottom', "Show the Activity Bar at the bottom of the Primary and Secondary Side Bars."),
584
localize('workbench.activityBar.location.hide', "Hide the Activity Bar in the Primary and Secondary Side Bars.")
585
],
586
},
587
'workbench.activityBar.iconClickBehavior': {
588
'type': 'string',
589
'enum': ['toggle', 'focus'],
590
'default': 'toggle',
591
'markdownDescription': localize({ comment: ['{0}, {1} will be a setting name rendered as a link'], key: 'activityBarIconClickBehavior' }, "Controls the behavior of clicking an Activity Bar icon in the workbench. This value is ignored when {0} is not set to {1}.", '`#workbench.activityBar.location#`', '`default`'),
592
'enumDescriptions': [
593
localize('workbench.activityBar.iconClickBehavior.toggle', "Hide the Primary Side Bar if the clicked item is already visible."),
594
localize('workbench.activityBar.iconClickBehavior.focus', "Focus the Primary Side Bar if the clicked item is already visible.")
595
]
596
},
597
'workbench.view.alwaysShowHeaderActions': {
598
'type': 'boolean',
599
'default': false,
600
'description': localize('viewVisibility', "Controls the visibility of view header actions. View header actions may either be always visible, or only visible when that view is focused or hovered over.")
601
},
602
'workbench.view.showQuietly': {
603
'type': 'object',
604
'description': localize('workbench.view.showQuietly', "If an extension requests a hidden view to be shown, display a clickable status bar indicator instead."),
605
'scope': ConfigurationScope.WINDOW,
606
'properties': {
607
'workbench.panel.output': {
608
'type': 'boolean',
609
'description': localize('workbench.panel.output', "Output view")
610
}
611
},
612
'additionalProperties': false
613
},
614
'workbench.fontAliasing': {
615
'type': 'string',
616
'enum': ['default', 'antialiased', 'none', 'auto'],
617
'default': 'default',
618
'description':
619
localize('fontAliasing', "Controls font aliasing method in the workbench."),
620
'enumDescriptions': [
621
localize('workbench.fontAliasing.default', "Sub-pixel font smoothing. On most non-retina displays this will give the sharpest text."),
622
localize('workbench.fontAliasing.antialiased', "Smooth the font on the level of the pixel, as opposed to the subpixel. Can make the font appear lighter overall."),
623
localize('workbench.fontAliasing.none', "Disables font smoothing. Text will show with jagged sharp edges."),
624
localize('workbench.fontAliasing.auto', "Applies `default` or `antialiased` automatically based on the DPI of displays.")
625
],
626
'included': isMacintosh
627
},
628
'workbench.settings.editor': {
629
'type': 'string',
630
'enum': ['ui', 'json'],
631
'enumDescriptions': [
632
localize('settings.editor.ui', "Use the settings UI editor."),
633
localize('settings.editor.json', "Use the JSON file editor."),
634
],
635
'description': localize('settings.editor.desc', "Determines which Settings editor to use by default."),
636
'default': 'ui',
637
'scope': ConfigurationScope.WINDOW
638
},
639
'workbench.settings.showAISearchToggle': {
640
'type': 'boolean',
641
'default': true,
642
'description': localize('settings.showAISearchToggle', "Controls whether the AI search results toggle is shown in the search bar in the Settings editor after doing a search and once AI search results are available."),
643
},
644
'workbench.hover.delay': {
645
'type': 'number',
646
'description': localize('workbench.hover.delay', "Controls the delay in milliseconds after which the hover is shown for workbench items (ex. some extension provided tree view items). Already visible items may require a refresh before reflecting this setting change."),
647
// Testing has indicated that on Windows and Linux 500 ms matches the native hovers most closely.
648
// On Mac, the delay is 1500.
649
'default': isMacintosh ? 1500 : 500,
650
'minimum': 0
651
},
652
'workbench.reduceMotion': {
653
type: 'string',
654
description: localize('workbench.reduceMotion', "Controls whether the workbench should render with fewer animations."),
655
'enumDescriptions': [
656
localize('workbench.reduceMotion.on', "Always render with reduced motion."),
657
localize('workbench.reduceMotion.off', "Do not render with reduced motion"),
658
localize('workbench.reduceMotion.auto', "Render with reduced motion based on OS configuration."),
659
],
660
default: 'auto',
661
tags: ['accessibility'],
662
enum: ['on', 'off', 'auto']
663
},
664
'workbench.navigationControl.enabled': {
665
'type': 'boolean',
666
'default': true,
667
'markdownDescription': isWeb ?
668
localize('navigationControlEnabledWeb', "Controls whether the navigation control in the title bar is shown.") :
669
localize({ key: 'navigationControlEnabled', comment: ['{0}, {1} is a placeholder for a setting identifier.'] }, "Controls whether the navigation control is shown in the custom title bar. This setting only has an effect when {0} is not set to {1}.", '`#window.customTitleBarVisibility#`', '`never`')
670
},
671
[LayoutSettings.LAYOUT_ACTIONS]: {
672
'type': 'boolean',
673
'default': true,
674
'markdownDescription': isWeb ?
675
localize('layoutControlEnabledWeb', "Controls whether the layout control in the title bar is shown.") :
676
localize({ key: 'layoutControlEnabled', comment: ['{0}, {1} is a placeholder for a setting identifier.'] }, "Controls whether the layout control is shown in the custom title bar. This setting only has an effect when {0} is not set to {1}.", '`#window.customTitleBarVisibility#`', '`never`')
677
},
678
'workbench.layoutControl.type': {
679
'type': 'string',
680
'enum': ['menu', 'toggles', 'both'],
681
'enumDescriptions': [
682
localize('layoutcontrol.type.menu', "Shows a single button with a dropdown of layout options."),
683
localize('layoutcontrol.type.toggles', "Shows several buttons for toggling the visibility of the panels and side bar."),
684
localize('layoutcontrol.type.both', "Shows both the dropdown and toggle buttons."),
685
],
686
'default': 'both',
687
'description': localize('layoutControlType', "Controls whether the layout control in the custom title bar is displayed as a single menu button or with multiple UI toggles."),
688
},
689
'workbench.tips.enabled': {
690
'type': 'boolean',
691
'default': true,
692
'description': localize('tips.enabled', "When enabled, will show the watermark tips when no editor is open.")
693
},
694
}
695
});
696
697
// Window
698
699
let windowTitleDescription = localize('windowTitle', "Controls the window title based on the current context such as the opened workspace or active editor. Variables are substituted based on the context:");
700
windowTitleDescription += '\n- ' + [
701
localize('activeEditorShort', "`${activeEditorShort}`: the file name (e.g. myFile.txt)."),
702
localize('activeEditorMedium', "`${activeEditorMedium}`: the path of the file relative to the workspace folder (e.g. myFolder/myFileFolder/myFile.txt)."),
703
localize('activeEditorLong', "`${activeEditorLong}`: the full path of the file (e.g. /Users/Development/myFolder/myFileFolder/myFile.txt)."),
704
localize('activeFolderShort', "`${activeFolderShort}`: the name of the folder the file is contained in (e.g. myFileFolder)."),
705
localize('activeFolderMedium', "`${activeFolderMedium}`: the path of the folder the file is contained in, relative to the workspace folder (e.g. myFolder/myFileFolder)."),
706
localize('activeFolderLong', "`${activeFolderLong}`: the full path of the folder the file is contained in (e.g. /Users/Development/myFolder/myFileFolder)."),
707
localize('folderName', "`${folderName}`: name of the workspace folder the file is contained in (e.g. myFolder)."),
708
localize('folderPath', "`${folderPath}`: file path of the workspace folder the file is contained in (e.g. /Users/Development/myFolder)."),
709
localize('rootName', "`${rootName}`: name of the workspace with optional remote name and workspace indicator if applicable (e.g. myFolder, myRemoteFolder [SSH] or myWorkspace (Workspace))."),
710
localize('rootNameShort', "`${rootNameShort}`: shortened name of the workspace without suffixes (e.g. myFolder, myRemoteFolder or myWorkspace)."),
711
localize('rootPath', "`${rootPath}`: file path of the opened workspace or folder (e.g. /Users/Development/myWorkspace)."),
712
localize('profileName', "`${profileName}`: name of the profile in which the workspace is opened (e.g. Data Science (Profile)). Ignored if default profile is used."),
713
localize('appName', "`${appName}`: e.g. VS Code."),
714
localize('remoteName', "`${remoteName}`: e.g. SSH"),
715
localize('dirty', "`${dirty}`: an indicator for when the active editor has unsaved changes."),
716
localize('focusedView', "`${focusedView}`: the name of the view that is currently focused."),
717
localize('activeRepositoryName', "`${activeRepositoryName}`: the name of the active repository (e.g. vscode)."),
718
localize('activeRepositoryBranchName', "`${activeRepositoryBranchName}`: the name of the active branch in the active repository (e.g. main)."),
719
localize('activeEditorState', "`${activeEditorState}`: provides information about the state of the active editor (e.g. modified). This will be appended by default when in screen reader mode with {0} enabled.", '`accessibility.windowTitleOptimized`'),
720
localize('separator', "`${separator}`: a conditional separator (\" - \") that only shows when surrounded by variables with values or static text.")
721
].join('\n- '); // intentionally concatenated to not produce a string that is too long for translations
722
723
registry.registerConfiguration({
724
...windowConfigurationNodeBase,
725
'properties': {
726
'window.title': {
727
'type': 'string',
728
'default': defaultWindowTitle,
729
'markdownDescription': windowTitleDescription
730
},
731
'window.titleSeparator': {
732
'type': 'string',
733
'default': defaultWindowTitleSeparator,
734
'markdownDescription': localize("window.titleSeparator", "Separator used by {0}.", '`#window.title#`')
735
},
736
[LayoutSettings.COMMAND_CENTER]: {
737
type: 'boolean',
738
default: true,
739
markdownDescription: isWeb ?
740
localize('window.commandCenterWeb', "Show command launcher together with the window title.") :
741
localize({ key: 'window.commandCenter', comment: ['{0}, {1} is a placeholder for a setting identifier.'] }, "Show command launcher together with the window title. This setting only has an effect when {0} is not set to {1}.", '`#window.customTitleBarVisibility#`', '`never`')
742
},
743
'window.menuBarVisibility': {
744
'type': 'string',
745
'enum': ['classic', 'visible', 'toggle', 'hidden', 'compact'],
746
'markdownEnumDescriptions': [
747
localize('window.menuBarVisibility.classic', "Menu is displayed at the top of the window and only hidden in full screen mode."),
748
localize('window.menuBarVisibility.visible', "Menu is always visible at the top of the window even in full screen mode."),
749
isMacintosh ?
750
localize('window.menuBarVisibility.toggle.mac', "Menu is hidden but can be displayed at the top of the window by executing the `Focus Application Menu` command.") :
751
localize('window.menuBarVisibility.toggle', "Menu is hidden but can be displayed at the top of the window via the Alt key."),
752
localize('window.menuBarVisibility.hidden', "Menu is always hidden."),
753
isWeb ?
754
localize('window.menuBarVisibility.compact.web', "Menu is displayed as a compact button in the side bar.") :
755
localize({ key: 'window.menuBarVisibility.compact', comment: ['{0}, {1} is a placeholder for a setting identifier.'] }, "Menu is displayed as a compact button in the side bar. This value is ignored when {0} is {1} and {2} is either {3} or {4}.", '`#window.titleBarStyle#`', '`native`', '`#window.menuStyle#`', '`native`', '`inherit`')
756
],
757
'default': isWeb ? 'compact' : 'classic',
758
'scope': ConfigurationScope.APPLICATION,
759
'markdownDescription': isMacintosh ?
760
localize('menuBarVisibility.mac', "Control the visibility of the menu bar. A setting of 'toggle' means that the menu bar is hidden and executing `Focus Application Menu` will show it. A setting of 'compact' will move the menu into the side bar.") :
761
localize('menuBarVisibility', "Control the visibility of the menu bar. A setting of 'toggle' means that the menu bar is hidden and a single press of the Alt key will show it. A setting of 'compact' will move the menu into the side bar."),
762
'included': isWindows || isLinux || isWeb
763
},
764
'window.enableMenuBarMnemonics': {
765
'type': 'boolean',
766
'default': true,
767
'scope': ConfigurationScope.APPLICATION,
768
'description': localize('enableMenuBarMnemonics', "Controls whether the main menus can be opened via Alt-key shortcuts. Disabling mnemonics allows to bind these Alt-key shortcuts to editor commands instead."),
769
'included': isWindows || isLinux
770
},
771
'window.customMenuBarAltFocus': {
772
'type': 'boolean',
773
'default': true,
774
'scope': ConfigurationScope.APPLICATION,
775
'markdownDescription': localize('customMenuBarAltFocus', "Controls whether the menu bar will be focused by pressing the Alt-key. This setting has no effect on toggling the menu bar with the Alt-key."),
776
'included': isWindows || isLinux
777
},
778
'window.openFilesInNewWindow': {
779
'type': 'string',
780
'enum': ['on', 'off', 'default'],
781
'enumDescriptions': [
782
localize('window.openFilesInNewWindow.on', "Files will open in a new window."),
783
localize('window.openFilesInNewWindow.off', "Files will open in the window with the files' folder open or the last active window."),
784
isMacintosh ?
785
localize('window.openFilesInNewWindow.defaultMac', "Files will open in the window with the files' folder open or the last active window unless opened via the Dock or from Finder.") :
786
localize('window.openFilesInNewWindow.default', "Files will open in a new window unless picked from within the application (e.g. via the File menu).")
787
],
788
'default': 'off',
789
'scope': ConfigurationScope.APPLICATION,
790
'markdownDescription':
791
isMacintosh ?
792
localize('openFilesInNewWindowMac', "Controls whether files should open in a new window when using a command line or file dialog.\nNote that there can still be cases where this setting is ignored (e.g. when using the `--new-window` or `--reuse-window` command line option).") :
793
localize('openFilesInNewWindow', "Controls whether files should open in a new window when using a command line or file dialog.\nNote that there can still be cases where this setting is ignored (e.g. when using the `--new-window` or `--reuse-window` command line option).")
794
},
795
'window.openFoldersInNewWindow': {
796
'type': 'string',
797
'enum': ['on', 'off', 'default'],
798
'enumDescriptions': [
799
localize('window.openFoldersInNewWindow.on', "Folders will open in a new window."),
800
localize('window.openFoldersInNewWindow.off', "Folders will replace the last active window."),
801
localize('window.openFoldersInNewWindow.default', "Folders will open in a new window unless a folder is picked from within the application (e.g. via the File menu).")
802
],
803
'default': 'default',
804
'scope': ConfigurationScope.APPLICATION,
805
'markdownDescription': localize('openFoldersInNewWindow', "Controls whether folders should open in a new window or replace the last active window.\nNote that there can still be cases where this setting is ignored (e.g. when using the `--new-window` or `--reuse-window` command line option).")
806
},
807
'window.confirmBeforeClose': {
808
'type': 'string',
809
'enum': ['always', 'keyboardOnly', 'never'],
810
'enumDescriptions': [
811
isWeb ?
812
localize('window.confirmBeforeClose.always.web', "Always try to ask for confirmation. Note that browsers may still decide to close a tab or window without confirmation.") :
813
localize('window.confirmBeforeClose.always', "Always ask for confirmation."),
814
isWeb ?
815
localize('window.confirmBeforeClose.keyboardOnly.web', "Only ask for confirmation if a keybinding was used to close the window. Note that detection may not be possible in some cases.") :
816
localize('window.confirmBeforeClose.keyboardOnly', "Only ask for confirmation if a keybinding was used."),
817
isWeb ?
818
localize('window.confirmBeforeClose.never.web', "Never explicitly ask for confirmation unless data loss is imminent.") :
819
localize('window.confirmBeforeClose.never', "Never explicitly ask for confirmation.")
820
],
821
'default': (isWeb && !isStandalone()) ? 'keyboardOnly' : 'never', // on by default in web, unless PWA, never on desktop
822
'markdownDescription': isWeb ?
823
localize('confirmBeforeCloseWeb', "Controls whether to show a confirmation dialog before closing the browser tab or window. Note that even if enabled, browsers may still decide to close a tab or window without confirmation and that this setting is only a hint that may not work in all cases.") :
824
localize('confirmBeforeClose', "Controls whether to show a confirmation dialog before closing a window or quitting the application."),
825
'scope': ConfigurationScope.APPLICATION
826
}
827
}
828
});
829
830
// Dynamic Window Configuration
831
registerWorkbenchContribution2(DynamicWindowConfiguration.ID, DynamicWindowConfiguration, WorkbenchPhase.Eventually);
832
833
// Problems
834
registry.registerConfiguration({
835
...problemsConfigurationNodeBase,
836
'properties': {
837
'problems.visibility': {
838
'type': 'boolean',
839
'default': true,
840
'description': localize('problems.visibility', "Controls whether the problems are visible throughout the editor and workbench."),
841
},
842
}
843
});
844
845
// Zen Mode
846
registry.registerConfiguration({
847
'id': 'zenMode',
848
'order': 9,
849
'title': localize('zenModeConfigurationTitle', "Zen Mode"),
850
'type': 'object',
851
'properties': {
852
'zenMode.fullScreen': {
853
'type': 'boolean',
854
'default': true,
855
'description': localize('zenMode.fullScreen', "Controls whether turning on Zen Mode also puts the workbench into full screen mode.")
856
},
857
'zenMode.centerLayout': {
858
'type': 'boolean',
859
'default': true,
860
'description': localize('zenMode.centerLayout', "Controls whether turning on Zen Mode also centers the layout.")
861
},
862
'zenMode.showTabs': {
863
'type': 'string',
864
'enum': ['multiple', 'single', 'none'],
865
'description': localize('zenMode.showTabs', "Controls whether turning on Zen Mode should show multiple editor tabs, a single editor tab, or hide the editor title area completely."),
866
'enumDescriptions': [
867
localize('zenMode.showTabs.multiple', "Each editor is displayed as a tab in the editor title area."),
868
localize('zenMode.showTabs.single', "The active editor is displayed as a single large tab in the editor title area."),
869
localize('zenMode.showTabs.none', "The editor title area is not displayed."),
870
],
871
'default': 'multiple'
872
},
873
'zenMode.hideStatusBar': {
874
'type': 'boolean',
875
'default': true,
876
'description': localize('zenMode.hideStatusBar', "Controls whether turning on Zen Mode also hides the status bar at the bottom of the workbench.")
877
},
878
'zenMode.hideActivityBar': {
879
'type': 'boolean',
880
'default': true,
881
'description': localize('zenMode.hideActivityBar', "Controls whether turning on Zen Mode also hides the activity bar either at the left or right of the workbench.")
882
},
883
'zenMode.hideLineNumbers': {
884
'type': 'boolean',
885
'default': true,
886
'description': localize('zenMode.hideLineNumbers', "Controls whether turning on Zen Mode also hides the editor line numbers.")
887
},
888
'zenMode.restore': {
889
'type': 'boolean',
890
'default': true,
891
'description': localize('zenMode.restore', "Controls whether a window should restore to Zen Mode if it was exited in Zen Mode.")
892
},
893
'zenMode.silentNotifications': {
894
'type': 'boolean',
895
'default': true,
896
'description': localize('zenMode.silentNotifications', "Controls whether notifications do not disturb mode should be enabled while in Zen Mode. If true, only error notifications will pop out.")
897
}
898
}
899
});
900
})();
901
902
Registry.as<IConfigurationMigrationRegistry>(Extensions.ConfigurationMigration)
903
.registerConfigurationMigrations([{
904
key: 'workbench.activityBar.visible', migrateFn: (value: any) => {
905
const result: ConfigurationKeyValuePairs = [];
906
if (value !== undefined) {
907
result.push(['workbench.activityBar.visible', { value: undefined }]);
908
}
909
if (value === false) {
910
result.push([LayoutSettings.ACTIVITY_BAR_LOCATION, { value: ActivityBarPosition.HIDDEN }]);
911
}
912
return result;
913
}
914
}]);
915
916
Registry.as<IConfigurationMigrationRegistry>(Extensions.ConfigurationMigration)
917
.registerConfigurationMigrations([{
918
key: LayoutSettings.ACTIVITY_BAR_LOCATION, migrateFn: (value: any) => {
919
const results: ConfigurationKeyValuePairs = [];
920
if (value === 'side') {
921
results.push([LayoutSettings.ACTIVITY_BAR_LOCATION, { value: ActivityBarPosition.DEFAULT }]);
922
}
923
return results;
924
}
925
}]);
926
927
Registry.as<IConfigurationMigrationRegistry>(Extensions.ConfigurationMigration)
928
.registerConfigurationMigrations([{
929
key: 'workbench.editor.doubleClickTabToToggleEditorGroupSizes', migrateFn: (value: any) => {
930
const results: ConfigurationKeyValuePairs = [];
931
if (typeof value === 'boolean') {
932
value = value ? 'expand' : 'off';
933
results.push(['workbench.editor.doubleClickTabToToggleEditorGroupSizes', { value }]);
934
}
935
return results;
936
}
937
}, {
938
key: LayoutSettings.EDITOR_TABS_MODE, migrateFn: (value: any) => {
939
const results: ConfigurationKeyValuePairs = [];
940
if (typeof value === 'boolean') {
941
value = value ? EditorTabsMode.MULTIPLE : EditorTabsMode.SINGLE;
942
results.push([LayoutSettings.EDITOR_TABS_MODE, { value }]);
943
}
944
return results;
945
}
946
}, {
947
key: 'workbench.editor.tabCloseButton', migrateFn: (value: any) => {
948
const result: ConfigurationKeyValuePairs = [];
949
if (value === 'left' || value === 'right') {
950
result.push(['workbench.editor.tabActionLocation', { value }]);
951
} else if (value === 'off') {
952
result.push(['workbench.editor.tabActionCloseVisibility', { value: false }]);
953
}
954
return result;
955
}
956
}, {
957
key: 'zenMode.hideTabs', migrateFn: (value: any) => {
958
const result: ConfigurationKeyValuePairs = [['zenMode.hideTabs', { value: undefined }]];
959
if (value === true) {
960
result.push(['zenMode.showTabs', { value: 'single' }]);
961
}
962
return result;
963
}
964
}]);
965
966