Skip to content

Add ability to extend from other settings files #15909

Open

Description

Inspired by TSLint's ability to extend configuration files, it would be nice if .vscode/settings.json could behave the same way.

So if I have some global settings set up:

~/example-repo/.vscode/my-company-settings.json:

{
  "editor.tabSize": 2,
  "editor.insertSpaces": true,
  "editor.formatOnSave": false
}

I can use them in another file, without having to duplicate the settings:

~/example-repo/my-project/.vscode/settings.json:

{
  "extends": "../../.vscode/my-company-settings.json",
  "editor.formatOnSave": true,
  "editor.fontLigatures": true
}

And the computed settings for ~/example-repo/my-project/.vscode/settings.json would be:

{
  "editor.tabSize": 2,
  "editor.insertSpaces": true,
  "editor.formatOnSave": true,
  "editor.fontLigatures": true
}

Scenario:

Multi-root workspace doesn't solve this for our use case. We have a bunch of npm modules each in their own git repository. We have a package which contains our shared tsconfig.json and tslint.json settings that all the other packages include with extends. We don't use a multi-root workspace since the idea is that people can clone the specific package(s) they need to work on. Every repository contains the exact same .vscode directory which is essentially copy&pasted all over the place. Maintaining the .vscode settings for the projects is "not pretty" compared to the tsconfig.json and tslint.json which only require the settings package to be updated with for example yarn upgrade.

Activity

  1. added
    feature-request
    on Nov 23, 2016
  2. mweststrate commented on Jun 30, 2017

    @mweststrate

    +1: Our mono repo consists of six projects which have largely, but not entirely the same settings.json files

  3. maxdeviant commented on Jun 30, 2017

    @maxdeviant
    Author

    Michel Weststrate (@mweststrate) A monorepo is exactly why we desire this as well 😄

  4. andreineculau commented on Aug 18, 2017

    @andreineculau

    Sandeep Somavarapu (@sandy081) am I correct in saying that you're advocating that large groups that share common settings should create their own extension? #15162 (comment)

    If you know of such an extension that would be a great reference. Thanks!

    LATER EDIT: for instance, I can only think of https://github.com/editorconfig/editorconfig-vscode to be on the same line as what we are trying to achieve here, and that one applies configuration to each editor (each tab). Overall, if this is accurate, the effort (boilerplating) seems quite high for a common goal of settings reuse.

  5. sandy081 commented on Aug 21, 2017

    @sandy081
    Member

    Andrei Neculau (@andreineculau) No, I did not mean that. I was mentioning about settings contributed by extensions.

  6. mmkal commented on Sep 28, 2017

    @mmkal

    Benjamin Pasero (@bpasero) Johannes Rieken (@jrieken) any update on this? Would the team be open to PRs?

    IMO the lack of this feature is the reason that questions like should I commit the .vscode folder to source control? are controversial/asked at all. This isn't just useful for monorepos - it could allow having settings specific to a project and user.

    Say you have team settings checked in to .vscode/settings.json, but you want to set something to some specific value, only for a single project. Currently you'd have to make that change in the team .vscode/settings.json file, which sucks because you'd the either have to check it in to source control for the whole team, or add the file to .git/info/exclude (in which case every time you do need to update the file in source control, you have to undo the exclusion, remove your personal settings, apply the team changes, check-in, re-apply your personal settings and redo the exclusion).

    If settings/tasks/launch.json supported extends, you could have a .vscode/settings.team.json with the team settings, then .vscode/settings.json could be:

    {
        "extends": ["./settings.team.json", "./settings.user.json"]
    }

    where .vscode/settings.user.json is in .gitignore. launch.json and tasks.json could work in exactly the same way (I guess this feature would probably need to be implemented so it can handle the ./settings.user.json not existing).

  7. bpasero commented on Sep 29, 2017

    @bpasero
    Contributor

    Misha Kaletsky (@mmkal) with multi root workspaces we have a new way of defining settings without having to check them in. Currently only available in insiders (https://code.visualstudio.com/insiders/) you can save a workspace with any number of folders (File > Save Workspace As) and this will create a *.code-workspace file where you can add workspace settings into. All settings are scoped to this workspace and they will not get checked in to SCM.

    The only downside of this approach is that settings defined within the folders will still override the workspace settings. But I think that is fair because a setting that is checked into SCM should always have higher importance imho.

  8. added
    settings-editor
    and removed on Nov 16, 2017
  9. amp343 commented on Jan 26, 2018

    @amp343

    Benjamin Pasero (@bpasero) that feature doesn't really address the use case that Misha Kaletsky (@mmkal) described though, where a base settings.json (presumably tracked) would be extendable/overridable by a settings.user.json (presumably untracked).

    The use case for this is that a team may want to track and distribute shared settings for a folder (using the existing settings.json), but give individual users the flexibility to opt out of those settings (via settings.user.json).

    The pattern I'm thinking of is similar to the one used in docker-compose, (https://docs.docker.com/compose/extends/) where you might have a tracked docker-compose.yml (shared base/prod config), and an untracked docker-compose.override.yml (local development overrides) that automatically extends from the base config.

    I think something like this could be a powerful feature, especially for adoption across larger teams.

    (edit - Oversimplistic example: https://github.com/amp343/vscode/pull/1/files)

  10. mmkal commented on Feb 1, 2018

    @mmkal

    Benjamin Pasero (@bpasero) Andrew Peters (@amp343) is right, multi-root workspaces are great, but they only really solve problems to do with having related projects, not so much version control/different developers working on a repo - or tasks/launch.json.

    One approach that would solve for almost all use cases would be to allow tasks.js, launch.js and settings.js, as well as .json files in the .vscode folder. That would allow for this, and many other features too. Similar to how jest allows defining a jest.config.js file where you just put module.exports = { ... }.

    That way if a team needed to have default settings, overridable by individual developers locally they could define whatever custom extension logic they liked insettings.js:

    const { existsSync } = require('fs')
    const localPath = __dirname + '/settings.local.js'
    const userOverrides = existsSync(localPath) ? require(localPath) : {}
    module.exports = {
      // team settings
       'tslint.enable': true,
       ‎...userOverrides,
    }

    If you wanted to get fancy, you could use lodash.defaultsDeep. For very complex or widely-used configs, people could even publish their configs to npm and they could be intalled as npm dev dependencies, and used by others with very little effort.

    Again, would the team be happy to accept PRs for something like this? It seems like multiple people would be willing to help, (including me).

  11. ilius commented on May 30, 2018

    @ilius

    I also want to sync my vscode config directory (including settings.json, but excluding some specific paths like Cache*) between home and work (using git), but there are few things I don't want to sync (like window.zoomLevel which i change depending on display size). If we could import / extend another json file in settings.json, that would solve my problem.

  12. 161 remaining items

  13. jonmchan commented on Feb 23, 2026

    @jonmchan

    6th highest requested feature btw, but AI seems to have priority 🥀

    Maybe we can get the AI to fix this problem for us. 😆

  14. tomoglavas commented on Feb 23, 2026

    @tomoglavas

    It's 2026. This issue is 10 years old.

    Time to move on from MSlop.

  15. jeske commented on Feb 28, 2026

    @jeske

    I got annoyed enough with this problem to write an extension to solve it that uses a different approach than i've seen.

    Shared Settings Manager - is an extension which treats settings.json as your local untracked user settings file, and settings.shared.json as your git tracked team/project settings. Whenever either one of them change, it does a sync-merge of the settings.shared.json into a block at the bottom of your untracked settings.json - forcing you to adopt project settings while preserving the ability for tools that just edit your settings.json file to "work like normal" by writing to your user settings. It tries to preserve your user-comments, and to keep the team settings in a block at the bottom. YMMV. Though I can promise you will get faster response posting on my Extension's issue tracker than here.

  16. kerrickstaley commented on Mar 4, 2026

    @kerrickstaley

    Update May 7
    I've been using Layered Settings for the past 2 months and I'm quite happy with it; it solves this issue for me. I'd recommend trying it if you find yourself here!

    Previous comment
    I also recently created an extension to solve this problem 🙂

    Layered Settings addresses all the use-cases people have mentioned:

    • Checking your settings into your dotfiles repo, without checking in machine-specific settings or bits of state that shouldn't be tracked.
    • Having separate team and user settings in a workspace.
    • Having project settings that override team settings in a monorepo with multiple projects (via symlinks).
    • Sharding settings into multiple files by theme.

    Here's a comparison with Shared Settings Manager based on my understanding:

    • Layered Settings supports more use-cases (Shared Settings Manager just supports the use-case of splitting team and user workspace settings).
    • Layered Settings is more flexible (Jsonnet is a Turing-complete language, and you can have as many config layers as you want).
    • Layered Settings doesn't clobber settings.json—manual changes made through the GUI are preserved and take precedence.
    • Layered Settings has an external dependency (the jsonnet binary) whereas Shared Settings Manager has no deps.
  17. LukasWillin commented on Jun 10, 2026

    @LukasWillin

    Please Microsoft. Make this happen. I just ran into this creating team-shared launch-configurations. However some settings will be different depending on the users dev environment. And as far as I can see atm, it is simply not possible without sending json files around to other developers and them having to rename things manually.

  18. Wiktorro commented on Jun 10, 2026

    @Wiktorro

    Got here independently when having same issues as above, please Microsoft Do Consider such feature!
    Marking VS Code Prebuilds Bot (@vscode-prebuilds-bot) for attention , won't make it more ignored at point of 10 years freezer....

  19. orimay commented on Jun 10, 2026

    @orimay

    Sandeep Somavarapu (@sandy081), I see this issue is assigned to you. Are you the right person to bother?

  20. tanishqmanuja commented on Jun 10, 2026

    @tanishqmanuja

    People say software development is sorted after AI, yet issues like this remain open xD

  21. Also, if there's a way to switch settings.json to settings.jsonc, that would be really helpful. Since JSONC supports comments, it makes it much easier to add notes about why certain settings are there, include descriptions, or organize things into sections. It seems like comments are already being ignored, but the editor still complains because it's treating the file as plain JSON instead of JSONC.

  22. Wiktorro commented on Jul 1, 2026

    @Wiktorro

    It seems like comments are already being ignored,

    yep there's not problem in using // comments, at least I don't have any issues , never had since my first edits.
    However it might be nice to accept some formats that in their nature handle config addition/overwriting/concat - hope you get the idea - like mentioned above jsonnet. maybe there's more options, I didn't know any json-like alternative formats till now.
    Just highlighting topic, feel free to discuss :)

    Layered Settings addresses all the use-cases people have mentioned:

  23. nk-tedo-001 commented on Jul 14, 2026

    @nk-tedo-001

    My ideal scenario:

    1. I have a local settings.json that customizes my workspace.
    2. We want to have a separate, Git-tracked settings.json that everyone on the team can share, while still allowing each developer to reference it from their local settings.json.
  24. kerrickstaley commented on Jul 14, 2026

    @kerrickstaley

    Nikolay Kulakov (@nk-tedo-001) ND c2 MT c2 Nj k2 ZT Zm Mj A0 Nj Y1 Nm M2 OT c4 (@bytebeast) Tanishq Manuja (@tanishqmanuja) Dmitrii Baranov (@orimay) Lukas Willin (@LukasWillin) I would encourage you to try my plugin Layered Settings. This plugin allows you to have multiple settings files that get merged into the final settings.json. More details in the previous comment (re-posting because it's now too far up that it doesn't automatically load). Hope this is helpful!

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

Metadata

Metadata

Labels

configfeature-request

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions