Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/preferences/browser/settingsLayout.ts
5252 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 { isWeb, isWindows } from '../../../../base/common/platform.js';
7
import { localize } from '../../../../nls.js';
8
import { ISetting, ISettingsGroup } from '../../../services/preferences/common/preferences.js';
9
10
export interface ITOCFilter {
11
include?: {
12
keyPatterns?: string[];
13
tags?: string[];
14
};
15
exclude?: {
16
keyPatterns?: string[];
17
tags?: string[];
18
};
19
}
20
21
export interface ITOCEntry<T> {
22
id: string;
23
label: string;
24
order?: number;
25
children?: ITOCEntry<T>[];
26
settings?: Array<T>;
27
hide?: boolean;
28
}
29
30
const COMMONLY_USED_SETTINGS: readonly string[] = [
31
'editor.fontSize',
32
'editor.formatOnSave',
33
'files.autoSave',
34
'GitHub.copilot-chat.manageExtension',
35
'editor.defaultFormatter',
36
'editor.fontFamily',
37
'editor.wordWrap',
38
'chat.agent.maxRequests',
39
'files.exclude',
40
'workbench.colorTheme',
41
'editor.tabSize',
42
'editor.mouseWheelZoom',
43
'editor.formatOnPaste'
44
];
45
46
export function getCommonlyUsedData(settingGroups: ISettingsGroup[]): ITOCEntry<ISetting> {
47
const allSettings = new Map<string, ISetting>();
48
for (const group of settingGroups) {
49
for (const section of group.sections) {
50
for (const s of section.settings) {
51
allSettings.set(s.key, s);
52
}
53
}
54
}
55
const settings: ISetting[] = [];
56
for (const id of COMMONLY_USED_SETTINGS) {
57
const setting = allSettings.get(id);
58
if (setting) {
59
settings.push(setting);
60
}
61
}
62
return {
63
id: 'commonlyUsed',
64
label: localize('commonlyUsed', "Commonly Used"),
65
settings
66
};
67
}
68
69
export const tocData: ITOCEntry<string> = {
70
id: 'root',
71
label: 'root',
72
children: [
73
{
74
id: 'editor',
75
label: localize('textEditor', "Text Editor"),
76
settings: ['editor.*'],
77
children: [
78
{
79
id: 'editor/cursor',
80
label: localize('cursor', "Cursor"),
81
settings: ['editor.cursor*']
82
},
83
{
84
id: 'editor/find',
85
label: localize('find', "Find"),
86
settings: ['editor.find.*']
87
},
88
{
89
id: 'editor/font',
90
label: localize('font', "Font"),
91
settings: ['editor.font*']
92
},
93
{
94
id: 'editor/format',
95
label: localize('formatting', "Formatting"),
96
settings: ['editor.format*']
97
},
98
{
99
id: 'editor/diffEditor',
100
label: localize('diffEditor', "Diff Editor"),
101
settings: ['diffEditor.*']
102
},
103
{
104
id: 'editor/multiDiffEditor',
105
label: localize('multiDiffEditor', "Multi-File Diff Editor"),
106
settings: ['multiDiffEditor.*']
107
},
108
{
109
id: 'editor/minimap',
110
label: localize('minimap', "Minimap"),
111
settings: ['editor.minimap.*']
112
},
113
{
114
id: 'editor/suggestions',
115
label: localize('suggestions', "Suggestions"),
116
settings: ['editor.*suggest*']
117
},
118
{
119
id: 'editor/files',
120
label: localize('files', "Files"),
121
settings: ['files.*']
122
}
123
]
124
},
125
{
126
id: 'workbench',
127
label: localize('workbench', "Workbench"),
128
settings: ['workbench.*'],
129
children: [
130
{
131
id: 'workbench/appearance',
132
label: localize('appearance', "Appearance"),
133
settings: ['workbench.activityBar.*', 'workbench.*color*', 'workbench.fontAliasing', 'workbench.iconTheme', 'workbench.sidebar.location', 'workbench.*.visible', 'workbench.tips.enabled', 'workbench.tree.*', 'workbench.view.*']
134
},
135
{
136
id: 'workbench/breadcrumbs',
137
label: localize('breadcrumbs', "Breadcrumbs"),
138
settings: ['breadcrumbs.*']
139
},
140
{
141
id: 'workbench/editor',
142
label: localize('editorManagement', "Editor Management"),
143
settings: ['workbench.editor.*']
144
},
145
{
146
id: 'workbench/settings',
147
label: localize('settings', "Settings Editor"),
148
settings: ['workbench.settings.*']
149
},
150
{
151
id: 'workbench/zenmode',
152
label: localize('zenMode', "Zen Mode"),
153
settings: ['zenmode.*']
154
},
155
{
156
id: 'workbench/screencastmode',
157
label: localize('screencastMode', "Screencast Mode"),
158
settings: ['screencastMode.*']
159
}
160
]
161
},
162
{
163
id: 'window',
164
label: localize('window', "Window"),
165
settings: ['window.*'],
166
children: [
167
{
168
id: 'window/newWindow',
169
label: localize('newWindow', "New Window"),
170
settings: ['window.*newwindow*']
171
}
172
]
173
},
174
{
175
id: 'chat',
176
label: localize('chat', "Chat"),
177
settings: ['chat.*'],
178
children: [
179
{
180
id: 'chat/agent',
181
label: localize('chatAgent', "Agent"),
182
settings: [
183
'chat.agent.*',
184
'chat.checkpoints.*',
185
'chat.editRequests',
186
'chat.requestQueuing.*',
187
'chat.undoRequests.*',
188
'chat.customAgentInSubagent.*',
189
'chat.editing.autoAcceptDelay',
190
'chat.editing.confirmEditRequest*'
191
]
192
},
193
{
194
id: 'chat/appearance',
195
label: localize('chatAppearance', "Appearance"),
196
settings: [
197
'chat.editor.*',
198
'chat.fontFamily',
199
'chat.fontSize',
200
'chat.math.*',
201
'chat.agentsControl.*',
202
'chat.alternativeToolAction.*',
203
'chat.codeBlock.*',
204
'chat.editing.explainChanges.enabled',
205
'chat.editMode.hidden',
206
'chat.editorAssociations',
207
'chat.extensionUnification.*',
208
'chat.inlineReferences.*',
209
'chat.notifyWindow*',
210
'chat.statusWidget.*',
211
'chat.tips.*',
212
'chat.unifiedAgentsBar.*'
213
]
214
},
215
{
216
id: 'chat/sessions',
217
label: localize('chatSessions', "Sessions"),
218
settings: [
219
'chat.agentSessionProjection.*',
220
'chat.sessions.*',
221
'chat.viewProgressBadge.*',
222
'chat.viewSessions.*',
223
'chat.restoreLastPanelSession',
224
'chat.exitAfterDelegation',
225
'chat.repoInfo.*'
226
]
227
},
228
{
229
id: 'chat/tools',
230
label: localize('chatTools', "Tools"),
231
settings: [
232
'chat.tools.*',
233
'chat.extensionTools.*',
234
'chat.edits2.enabled'
235
]
236
},
237
{
238
id: 'chat/mcp',
239
label: localize('chatMcp', "MCP"),
240
settings: ['mcp', 'chat.mcp.*', 'mcp.*']
241
},
242
{
243
id: 'chat/context',
244
label: localize('chatContext', "Context"),
245
settings: [
246
'chat.detectParticipant.*',
247
'chat.implicitContext.*',
248
'chat.promptFilesLocations',
249
'chat.instructionsFilesLocations',
250
'chat.modeFilesLocations',
251
'chat.agentFilesLocations',
252
'chat.agentSkillsLocations',
253
'chat.hookFilesLocations',
254
'chat.promptFilesRecommendations',
255
'chat.useAgentsMdFile',
256
'chat.useNestedAgentsMdFiles',
257
'chat.useAgentSkills',
258
'chat.experimental.useSkillAdherencePrompt',
259
'chat.useChatHooks',
260
'chat.includeApplyingInstructions',
261
'chat.includeReferencedInstructions',
262
'chat.sendElementsToChat.*'
263
]
264
},
265
{
266
id: 'chat/inlineChat',
267
label: localize('chatInlineChat', "Inline Chat"),
268
settings: ['inlineChat.*']
269
},
270
{
271
id: 'chat/miscellaneous',
272
label: localize('chatMiscellaneous', "Miscellaneous"),
273
settings: [
274
'chat.disableAIFeatures',
275
'chat.allowAnonymousAccess'
276
]
277
},
278
]
279
},
280
{
281
id: 'features',
282
label: localize('features', "Features"),
283
children: [
284
{
285
id: 'features/accessibilitySignals',
286
label: localize('accessibility.signals', 'Accessibility Signals'),
287
settings: ['accessibility.signal*']
288
},
289
{
290
id: 'features/accessibility',
291
label: localize('accessibility', "Accessibility"),
292
settings: ['accessibility.*']
293
},
294
{
295
id: 'features/explorer',
296
label: localize('fileExplorer', "Explorer"),
297
settings: ['explorer.*', 'outline.*']
298
},
299
{
300
id: 'features/search',
301
label: localize('search', "Search"),
302
settings: ['search.*']
303
},
304
{
305
id: 'features/debug',
306
label: localize('debug', "Debug"),
307
settings: ['debug.*', 'launch']
308
},
309
{
310
id: 'features/testing',
311
label: localize('testing', "Testing"),
312
settings: ['testing.*']
313
},
314
{
315
id: 'features/scm',
316
label: localize('scm', "Source Control"),
317
settings: ['scm.*']
318
},
319
{
320
id: 'features/extensions',
321
label: localize('extensions', "Extensions"),
322
settings: ['extensions.*']
323
},
324
{
325
id: 'features/terminal',
326
label: localize('terminal', "Terminal"),
327
settings: ['terminal.*']
328
},
329
{
330
id: 'features/task',
331
label: localize('task', "Task"),
332
settings: ['task.*']
333
},
334
{
335
id: 'features/problems',
336
label: localize('problems', "Problems"),
337
settings: ['problems.*']
338
},
339
{
340
id: 'features/output',
341
label: localize('output', "Output"),
342
settings: ['output.*']
343
},
344
{
345
id: 'features/comments',
346
label: localize('comments', "Comments"),
347
settings: ['comments.*']
348
},
349
{
350
id: 'features/remote',
351
label: localize('remote', "Remote"),
352
settings: ['remote.*']
353
},
354
{
355
id: 'features/timeline',
356
label: localize('timeline', "Timeline"),
357
settings: ['timeline.*']
358
},
359
{
360
id: 'features/notebook',
361
label: localize('notebook', 'Notebook'),
362
settings: ['notebook.*', 'interactiveWindow.*']
363
},
364
{
365
id: 'features/mergeEditor',
366
label: localize('mergeEditor', 'Merge Editor'),
367
settings: ['mergeEditor.*']
368
},
369
{
370
id: 'features/issueReporter',
371
label: localize('issueReporter', 'Issue Reporter'),
372
settings: ['issueReporter.*'],
373
hide: !isWeb
374
}
375
]
376
},
377
{
378
id: 'application',
379
label: localize('application', "Application"),
380
children: [
381
{
382
id: 'application/http',
383
label: localize('proxy', "Proxy"),
384
settings: ['http.*']
385
},
386
{
387
id: 'application/keyboard',
388
label: localize('keyboard', "Keyboard"),
389
settings: ['keyboard.*']
390
},
391
{
392
id: 'application/update',
393
label: localize('update', "Update"),
394
settings: ['update.*']
395
},
396
{
397
id: 'application/telemetry',
398
label: localize('telemetry', "Telemetry"),
399
settings: ['telemetry.*']
400
},
401
{
402
id: 'application/settingsSync',
403
label: localize('settingsSync', "Settings Sync"),
404
settings: ['settingsSync.*']
405
},
406
{
407
id: 'application/network',
408
label: localize('network', "Network"),
409
settings: ['network.*']
410
},
411
{
412
id: 'application/experimental',
413
label: localize('experimental', "Experimental"),
414
settings: ['application.experimental.*']
415
},
416
{
417
id: 'application/other',
418
label: localize('other', "Other"),
419
settings: ['application.*'],
420
hide: isWindows
421
}
422
]
423
},
424
{
425
id: 'security',
426
label: localize('security', "Security"),
427
settings: ['security.*'],
428
children: [
429
{
430
id: 'security/workspace',
431
label: localize('workspace', "Workspace"),
432
settings: ['security.workspace.*']
433
}
434
]
435
}
436
]
437
};
438
439