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