Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 30, 2026

Moves commonly used settings list from productService.commonlyUsedSettings to a hardcoded constant COMMONLY_USED_SETTINGS, adding GitHub.copilot.manageExtension to the list in the contrib layer.

Changes

  • New constant: COMMONLY_USED_SETTINGS in contrib/preferences/common/preferences.ts as a readonly array to prevent accidental mutations:

    export const COMMONLY_USED_SETTINGS: readonly string[] = [
      'editor.fontSize',
      'editor.formatOnSave',
      'files.autoSave',
      'GitHub.copilot.manageExtension',  // Added
      'editor.defaultFormatter',
      'editor.fontFamily',
      'editor.wordWrap',
      'chat.agent.maxRequests',
      'files.exclude',
      'workbench.colorTheme',
      'editor.tabSize',
      'editor.mouseWheelZoom',
      'editor.formatOnPaste'
    ];
  • Removed productService dependency: getExperimentalExtensionToggleData now checks only productService.extensionRecommendations (removed && productService.commonlyUsedSettings condition)

  • Updated files:

    • settingsLayout.ts: Uses COMMONLY_USED_SETTINGS directly as default parameter with readonly type (removed defaultCommonlyUsedSettings variable)
    • preferences.ts: getExperimentalExtensionToggleData uses COMMONLY_USED_SETTINGS directly; ExtensionToggleData.commonlyUsed typed as readonly string[]
    • preferencesService.ts: Updated getMostCommonlyUsedSettings() method with a similar list (excludes GitHub.copilot.manageExtension to maintain proper layering between services and contrib)
  • Type Safety: Made COMMONLY_USED_SETTINGS readonly to prevent accidental mutations that could affect all consumers. Updated all type signatures to use readonly string[] for consistency.

This ensures consistency across the codebase with COMMONLY_USED_SETTINGS as the single source of truth for the contrib layer, while maintaining the existing architecture and proper layering between services and contrib layers.

Original prompt

Change commonly used settings to the following value and don't call productService anymore for it
"commonlyUsedSettings": [
"editor.fontSize",
"editor.formatOnSave",
"files.autoSave",
"GitHub.copilot.manageExtension",
"editor.defaultFormatter",
"editor.fontFamily",
"editor.wordWrap",
"chat.agent.maxRequests",
"files.exclude",
"workbench.colorTheme",
"editor.tabSize",
"editor.mouseWheelZoom",
"editor.formatOnPaste"
]

Created from VS Code.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Change commonly used settings values without calling productService Hardcode commonly used settings and remove productService dependency Jan 30, 2026
Copilot AI requested a review from rzhao271 January 30, 2026 22:16
Copilot AI requested a review from rzhao271 January 30, 2026 22:53
@rzhao271
Copy link
Collaborator

@copilot update src/vs/workbench/services/preferences/browser/preferencesService.ts to also reference new COMMONLY_USED_SETTINGS.

Copy link
Contributor Author

Copilot AI commented Jan 30, 2026

@copilot update src/vs/workbench/services/preferences/browser/preferencesService.ts to also reference new COMMONLY_USED_SETTINGS.

Done in c3e493e. Updated getMostCommonlyUsedSettings() to return COMMONLY_USED_SETTINGS constant instead of maintaining a separate hardcoded list.

@rzhao271
Copy link
Collaborator

@copilot remove getMostCommonlyUsedSettings function and just use the constant

Copy link
Contributor Author

Copilot AI commented Jan 30, 2026

@copilot remove getMostCommonlyUsedSettings function and just use the constant

Done in e495b95. Removed the function and replaced all three calls with COMMONLY_USED_SETTINGS directly.

@rzhao271 rzhao271 marked this pull request as ready for review January 30, 2026 23:29
Copilot AI review requested due to automatic review settings January 30, 2026 23:29
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Jan 30, 2026
@rzhao271
Copy link
Collaborator

@copilot undo the changes in src/vs/workbench/services/preferences/browser/preferencesService.ts but then update the hardcoded list to match the existing one.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR centralizes the “commonly used settings” list into a single hardcoded constant and removes reliance on productService.commonlyUsedSettings, including adding GitHub.copilot.manageExtension to the list.

Changes:

  • Introduced a shared COMMONLY_USED_SETTINGS constant and switched callers to use it.
  • Updated getExperimentalExtensionToggleData to no longer depend on productService.commonlyUsedSettings.
  • Removed the duplicated “most commonly used settings” list from PreferencesService.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/vs/workbench/services/preferences/browser/preferencesService.ts Replaces the local “most commonly used” list with the shared constant (but introduces a services → contrib import).
src/vs/workbench/contrib/preferences/common/preferences.ts Adds COMMONLY_USED_SETTINGS and returns it from getExperimentalExtensionToggleData instead of reading from productService.
src/vs/workbench/contrib/preferences/browser/settingsLayout.ts Removes the local default list and uses COMMONLY_USED_SETTINGS as the default for the “Commonly Used” TOC section.

Comment on lines 118 to 123
export const COMMONLY_USED_SETTINGS: string[] = [
'editor.fontSize',
'editor.formatOnSave',
'files.autoSave',
'GitHub.copilot.manageExtension',
'editor.defaultFormatter',
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

COMMONLY_USED_SETTINGS is exported as a mutable string[] and is returned (and cached) by getExperimentalExtensionToggleData. Since callers receive the same array reference, accidental mutation would affect all subsequent consumers. Consider typing it as readonly string[]/ReadonlyArray<string> and/or returning a defensive copy when exposing it on ExtensionToggleData.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in c001c58. Changed COMMONLY_USED_SETTINGS to readonly string[] and updated ExtensionToggleData.commonlyUsed and function parameters to use readonly string[] to prevent accidental mutations.

Copy link
Contributor Author

Copilot AI commented Jan 30, 2026

@copilot undo the changes in src/vs/workbench/services/preferences/browser/preferencesService.ts but then update the hardcoded list to match the existing one.

Done in 9ba80e3. Reverted preferencesService.ts to keep the getMostCommonlyUsedSettings() function, but updated the hardcoded list to match COMMONLY_USED_SETTINGS.

'editor.fontSize',
'editor.formatOnSave',
'files.autoSave',
'GitHub.copilot.manageExtension',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot remove this setting from this list

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in daf357c. Removed GitHub.copilot.manageExtension from the getMostCommonlyUsedSettings() list in preferencesService.ts.

Copilot AI requested a review from rzhao271 January 30, 2026 23:54
@rzhao271
Copy link
Collaborator

To-do before merge: test in OSS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants