Skip to content

Add support for local settings in configuration editing - #269623

Open
Yordis Prieto (yordis) wants to merge 1 commit into
microsoft:mainfrom
yordis:yordis/fixes-40233-local-workspace-settings
Open

Yordis Prieto (yordis) wants to merge 1 commit into
microsoft:mainfrom
yordis:yordis/fixes-40233-local-workspace-settings

Conversation

@yordis

Copy link
Copy Markdown

Fixes #40233

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds support for local settings files (settings.local.json) in VS Code's configuration system. Local settings take precedence over workspace and user settings, providing developers with a way to override configurations without affecting shared workspace settings.

Key changes include:

  • Added support for settings.local.json files in workspace folders
  • Implemented proper precedence where local settings override workspace and user settings
  • Added comprehensive test coverage for local settings functionality

Reviewed Changes

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

Show a summary per file
File Description
src/vs/workbench/services/configuration/common/configuration.ts Defines constants for local settings file names and schema identifiers
src/vs/workbench/services/configuration/browser/configurationService.ts Registers JSON schema for local settings validation
src/vs/workbench/services/configuration/browser/configuration.ts Core implementation for loading, parsing, and merging local settings with other configuration sources
src/vs/workbench/services/configuration/test/browser/configurationService.test.ts Comprehensive test suite covering local settings loading, precedence, and file operations
extensions/configuration-editing/package.json Adds JSON schema association for settings.local.json files


private consolidate(settingsConfiguration?: ConfigurationModel): void {
this._cache = (settingsConfiguration ?? this._folderSettingsModelParser.configurationModel).merge(...this._standAloneConfigurations);
this._cache = (settingsConfiguration ?? this._folderSettingsModelParser.configurationModel).merge(...this._standAloneConfigurations, this._folderLocalSettingsModelParser.configurationModel);

Copilot AI Oct 3, 2025

Copy link

Choose a reason for hiding this comment

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

The local settings should be merged after standalone configurations to ensure proper precedence. Currently, local settings might be overridden by standalone configurations. Consider moving this._folderLocalSettingsModelParser.configurationModel to be the last parameter in the merge operation.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The merge order is actually correct. Looking at the ConfigurationModel.merge() implementation and tests (specifically the "recursive merge" test at line 533 in src/vs/platform/configuration/test/common/configurationModels.test.ts), the merge method gives precedence to LATER parameters.

In base.merge(add), the add values override base values.

Since localSettings is the last parameter merged, it has the HIGHEST precedence, which is the desired behavior. Local settings will override both standalone configurations and base settings.

The test confirms this:

const base = new ConfigurationModel({ 'a': { 'b': 1 } }, ...);
const add = new ConfigurationModel({ 'a': { 'b': 2 } }, ...);
const result = base.merge(add);
// result.contents = { 'a': { 'b': 2 } } // add wins!


private consolidate(): void {
this.configurationModel = this._folderSettingsModelParser.configurationModel.merge(...this._standAloneConfigurations);
this.configurationModel = this._folderSettingsModelParser.configurationModel.merge(...this._standAloneConfigurations, this._folderLocalSettingsModelParser.configurationModel);

Copilot AI Oct 3, 2025

Copy link

Choose a reason for hiding this comment

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

Same precedence issue as in the FileServiceBasedConfiguration class. Local settings should be merged last to ensure they have the highest precedence over standalone configurations.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Same explanation applies here. The merge order is correct because ConfigurationModel.merge() gives precedence to LATER parameters.

In our implementation:

baseModel.merge(...standAloneConfigs, localSettings)

The localSettings parameter is merged last, giving it the highest precedence over both base settings and standalone configurations. This is the desired behavior as confirmed by the test suite in src/vs/platform/configuration/test/common/configurationModels.test.ts.

@yordis

Copy link
Copy Markdown
Author
Screen.Recording.2025-10-03.at.1.26.54.PM.mov

@yordis Yordis Prieto (yordis) left a comment •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think it is ready to go

@yordis
Yordis Prieto (yordis) force-pushed the yordis/fixes-40233-local-workspace-settings branch from 4b09188 to 738a07e Compare October 4, 2025 01:40
@sandy081

Copy link
Copy Markdown
Member

Thanks for the PR. This is a big feature which involves quite number of design and UX decisions and planning. Therefore we would not take contributions for such big features. Thanks for understanding.

@hverlin

Copy link
Copy Markdown

Sandeep Somavarapu (@sandy081) Is there a way to help? I guess one of the main things missing here is that it requires some update to the settings UI (+ sync)?

This is one of the most requested features. The fact that it is missing leads to numerous clunky workarounds in extensions at the moment. (example: https://github.com/microsoft/vscode-python/wiki/Setting-descriptions)

Meanwhile, it would be nice if the VS Code documentation could indicate that sharing .vscode/settings.json is not a good idea unless:

  • Everyone in a team uses VS Code with the same operating system
  • The extensions don't require absolute paths to be written to settings.json

@Virakal

Copy link
Copy Markdown

Thanks for the PR. This is a big feature which involves quite number of design and UX decisions and planning. Therefore we would not take contributions for such big features. Thanks for understanding.

Sandeep Somavarapu (@sandy081) why let the perfect be the enemy of the good? This at least goes partway to solving one of the most requested features on the entire repo and would be a huge improvement for a lot of users. Certainly more than whatever has been in the last 10 or so major versions.

@SamB

Copy link
Copy Markdown
Contributor

Thanks for the PR. This is a big feature which involves quite number of design and UX decisions and planning. Therefore we would not take contributions for such big features. Thanks for understanding.

It's not really that big, and it doesn't appear to redesign anything. We don't understand a thing.

@sandy081

Copy link
Copy Markdown
Member

👋 Thanks everyone for the feedback and for taking the time to discuss this.

I initially closed this PR because it introduces a fairly large feature that touches on several architectural and UX aspects. Changes of this scope typically require coordination across the VS Code team — including design discussions, user experience validation, and alignment with other planned work. That means we need to allocate dedicated time for it in our planning process to ensure it fits well into the overall product direction.

That said, I completely understand and appreciate the community’s interest in this feature. I’m reopening this PR so that it remains visible and open for discussion. We’ll revisit it when we have the opportunity to plan this work more thoroughly with the team.

Thanks again for your contributions and understanding!

@yordis

Copy link
Copy Markdown
Author

Sandeep Somavarapu (@sandy081) I enjoy the work thus far, and I am willing to take ownership of the situation, and help with the coding aspect.

In the worst case, I can communicate whenever I can unable to support the situation.

@rutexd

rutexd commented Oct 9, 2025 •

Copy link
Copy Markdown

I don't want to be mad, but...

That means we need to allocate dedicated time for it in our planning process to ensure it fits well into the overall product direction.

You want to say you never found a time since working on this(!) problem on releasing not needed multi workspace feature as a "more powerful alternative" to this feature which was intended to close the issue back in 2017/2018?
How does this changes the product direction at all? This is most needed feature which adds single config file with Δ100 LoC......... Noone needs super mega cool UX / UI for editing that file. The needed features are already implemented in this MR...

user experience validation

Just open the original issue and read what people say. Nothing more is needed. Spend 5 min to read everything from your last comment here.

when we have the opportunity

Where the previous opportunity you never reported back leaded the team to? When it will be again? Month? Year?
It sounds like - we keep open it to make visibility we working on it or "will be merged in 10 years".

Your post sounds completely like a robot response with no soul and no thrust to your words. And this is annoying asf...

I happy that there a response from you and I hope you will find resources and time to finish this properly. Please, please, PLEASE do this in near future. Thank you.

@jaskp

Copy link
Copy Markdown

Can't this feature just be merged with an "experimental" feature flag? Then users can enjoy the naive implementation for the following 10 years until the vscode team finishes designing, discussing, aligning and validating.

@davidgomes

Copy link
Copy Markdown

I love this PR, I always felt that user settings should override workspace settings. At the same time, I see this as a bit of a breaking change since the current design is already broken and if we change it now it could have unexpected consequences for users. If the VSCode team doesn't approve this, could we at least have a new type of settings called "User Override Settings" which is a new JSON file (settings.override.json) which override workspace settings?

@yordis

Copy link
Copy Markdown
Author

David Gomes (@davidgomes) I can fix the file name if you want me to 🫣 🍒 <----- :doit:

@jaskp

Copy link
Copy Markdown

How about a user settings option like this?

"workbench.settings.experimentalWorkspaceOverridesPath": "settings.local.json" // relative to .vscode

Then we don't have to bikeshed the name

@yordis

Copy link
Copy Markdown
Author

Peter Jaško (@jaskp) I honestly thought of that as well, the only concern is that we would be all doing whatever, so hard to align, scan for that file and so on without loading the settings to begin with 😄

@Virakal

Copy link
Copy Markdown

A standardised name means it can be gitignored more easily, at least.

@jaskp

Copy link
Copy Markdown

Agreed with you guys 😄

@jaskp

Peter Jaško (jaskp) commented Oct 15, 2025 •

Copy link
Copy Markdown

Sandeep Somavarapu (@sandy081) would the team be willing to relax the requirements for merging this feature if it were disabled by default and had a boolean opt-in flag in settings? Or is there nothing the community can do?

@koenlek

koenlek commented Nov 19, 2025

Copy link
Copy Markdown

Yordis Prieto (@yordis), shall we target Cursor (https://github.com/cursor/cursor) instead? Maybe they're more open to contributions?

Sandeep Somavarapu (@sandy081), mind giving another update from your end? Allowing this to be behind an 'experimental' feature flag for the time being would be great!

@yordis

Copy link
Copy Markdown
Author

shall we target Cursor (https://github.com/cursor/cursor) instead? Maybe they're more open to contributions?

koenlek personally speaking, I only use Cursor. So I suggested them to cherry-pick (to fulfill my ego of contributing to Cursor 😄), I can make it work here however we want, dogfoot a bit.

But I can not do much, other than suggesting to them.

@koenlek

koenlek commented Nov 19, 2025

Copy link
Copy Markdown

shall we target Cursor (https://github.com/cursor/cursor) instead? Maybe they're more open to contributions?

koenlek personally speaking, I only use Cursor. So I suggested them to cherry-pick (to fulfill my ego of contributing to Cursor 😄), I can make it work here however we want, dogfoot a bit.

But I can not do much, other than suggesting to them.

Great. Could you refer me to the issue on Cursor? I'll plus 1 it :)

@lachieh

Lachlan Heywood (lachieh) commented Feb 3, 2026 •

Copy link
Copy Markdown

With more and more tools taking the "ignored .local config" approach, I'm surprised this isn't getting more attention. (it is getting lots of attention, the linked issue has 1300+ reactions and 250+ comments 🫨). I'd love to see some progress, so I'll do my part.

I think there's a few considerations here, particularly relating to the UX of such a feature. I'm going to list a few questions I can think of, not because they all need answers, but to point out that nothing is simple and this is typically why product teams say "not right now". Bike-shedding over naming is just one part of a larger discussion.

  • How will users know that a setting comes from .local? Could/should VSCode ...
    • display a new tab in the settings view for 'Local'?
    • show affordance in the "Settings (JSON)" view to show which takes precedence (such as strikethrough on lines in .vscode/settings.json that are also in .vscode/settings.local.json)?
  • What if someone doesn't have a .gitignore file? Could/should VSCode ...
    • suggest that the .vscode/settings.local.json file be commited?
    • suggest ignoring the file?
    • ignore the settings?
  • What if the folder isn't a git repo at all?
    • [same questions as above]
  • What about team requirements? Could/should VSCode ...
    • provide a way for .local settings to be ignored over workspace settings? (some teams require specific settings from an org/company level and committed settings are an easy way to enforce this)
  • What about multi-root workspaces?

P.S. Yordis Prieto (@yordis), I love you for this. Good to see you outside of wasmcloud!

@N0tExisting

Not Existing (N0tExisting) commented May 29, 2026 •

Copy link
Copy Markdown

Lachlan Heywood (@lachieh) Some thoughts about your points
(To preface this, I try to assume a generic scm)

  • How will users know that a setting comes from .local? Could/should VSCode ...
    • display a new tab in the settings view for 'Local'?
    • show affordance in the "Settings (JSON)" view to show which takes precedence (such as strikethrough on lines in .vscode/settings.json that are also in .vscode/settings.local.json)?
  • Presumably the same as for User (settings.json in vscode's data dir) <-> Workspace (.vscode/settings.json) Settings
    • So show a new tab in the settings view for Workspace (Local)
    • (This is assuming simple single root folder workspaces)
  • What if someone doesn't have a .gitignore file? Could/should VSCode ...
    • suggest that the .vscode/settings.local.json file be commited?
    • suggest ignoring the file?
    • ignore the settings?
  • I see several options:
    1. Don't do anything, assume that the user is smart enough to understand that they shouldn't commit the file
    2. Warn in the source control panel, ie:
    • Render some warning with the filename
    • Warn when trying to stage the file (user might not want to commit nor add the file to the .gitignore)
    • Warn when attempting to create a commit with the file
    1. Place a .gitignore in the .vscode folder that ignores settings.local.json
    • but that wouldn't be scm independent
  • What if the folder isn't a git repo at all?
    • [same questions as above]
  • use the file like normal, no reason to have it randomly not work
  • What about team requirements? Could/should VSCode ...
    • provide a way for .local settings to be ignored over workspace settings? (some teams require specific settings from an org/company level and committed settings are an easy way to enforce this)
  • settings.local.json is meant to be for settings that should not be committed, such as settings with absolute paths / that depend on machine specific things
  • What about multi-root workspaces?
  • Works just like .vscode/settings.json (but takes precedence)

This branch has not been deployed

No deployments
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.

[Feature] Local Workspace settings