Add ability to extend from other settings files
See original GitHub issueInspired 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.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:567
- Comments:59 (15 by maintainers)
Top GitHub Comments
@bpasero @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:where
.vscode/settings.user.json
is in.gitignore
.launch.json
andtasks.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).Unfortunately no plans at present to implement this. Sorry for saying so.