Revisit VS Code folder structure for app data, settings, extensions
See original GitHub issueConfig is stored in ~/.config/Code[ - <quality>]/User
. To match platform conventions (lowercase and hyphens for everything) as well as to keep consistency with the cli code[-<quality>]
I propose we change the settings directory one of:
~/.config/code[-<quality>]/user
~/.vscode[-<quality>]
(see https://github.com/Microsoft/vscode/issues/3883)~/.code[-<quality>]
(to prevent using ‘vs’ showing up in the OSS build as it is now)
If we moved this it would probably require some discovery/migration on first launch of a newer version.
The below is a living document.
Proposed folder structure
Notes:
- I don’t think we should be encouraging the use of admin rights within vscode, instead a permissions elevation dialog would probably be better than allowing a specific place for root user data #5561
- I want to clean up the whole
code
vsvscode
thing in this change; only official builds should carry the visual studio branding, that should carry over to the config directories consistently as well. - The CLI args
--user-data-dir
and--extensions-dir
will need to be adjusted for this, something like--config-dir
and--cache-dir
would probably be better.
Windows
Old
Settings: %APPDATA%\Code[ - Variant]\User\settings.json
Keybindings: %APPDATA%\Code[ - Variant]\User\keybindings.json
Snippets: %APPDATA%\Code[ - Variant]\User\snippets\
Workspace storage: %APPDATA%\Code[ - Variant]\User\workspaceStorage\
Chromium user data: %APPDATA%\Code[ - Variant]\
Extensions: %USERPROFILE%\.vscode[-variant]\extensions\
New
Settings: %APPDATA%\Microsoft\[Visual Studio ]Code[ - Variant]\settings.json
Keybindings: %APPDATA%\Microsoft\[Visual Studio ]Code[ - Variant]\keybindings.json
Snippets: %APPDATA%\Microsoft\[Visual Studio ]Code[ - Variant]\snippets\
Workspace storage: %LOCALAPPDATA%\Microsoft\[Visual Studio ]Code[ - Variant]\workspaceStorage\
Chromium user data: %LOCALAPPDATA%\Microsoft\[Visual Studio ]Code[ - Variant]\userdata\
Extensions: %LOCALAPPDATA%\Microsoft\[Visual Studio ]Code[ - Variant]\extensions\
Notes:
- Note that
%APPDATA%
is roaming and%LOCALAPPDATA%
is local, meaning extensions will not be carried across multiple machines until a solution is devised for #15442. An extension manifest, eg.%APPDATA%\Microsoft\[Visual Studio ]Code[ - Variant]\extensions.json
which automatically installs extensions is my thinking of solving this problem.
Linux
Old
Settings: $HOME/.config/Code[ - Variant]/User/settings.json
Keybindings: $HOME/.config/Code[ - Variant]/User/keybindings.json
Snippets: $HOME/.config/Code[ - Variant]/User/snippets/
Workspace storage: $HOME/.config/Code[ - Variant]/User/workspaceStorage/
Chromium user data: $HOME/.config/Code[ - Variant]/
Extensions: $HOME/.vscode[-variant]/extensions/ (not moving)
New
Settings: $XDG_CONFIG_HOME/[vs]code[-variant]/settings.json
Keybindings: $XDG_CONFIG_HOME/[vs]code[-variant]/keybindings.json
Snippets: $XDG_CONFIG_HOME/[vs]code[-variant]/snippets/
Workspace storage: $XDG_CACHE_HOME/[vs]code[-variant]/workspaceStorage/
Chromium user data: $XDG_CACHE_HOME/[vs]code[-variant]/userdata/
Extensions: $XDG_CACHE_HOME/[vs]code[-variant]/extensions/
Notes:
- Thanks to @ollie27 and others for calling out the XDG Base Directory Specification, see that document for fallbacks to the environment variables.
$XDG_CACHE_HOME
would be best for extensions provided there is an extensions manifest in$XDG_CONFIG_HOME
#15442.- Maybe extensions should live in
$XDG_DATA_HOME
?
Mac
Old
Settings: $HOME/Library/Application Support/Code[ - Variant]/User/settings.json
Keybindings: $HOME/Library/Application Support/Code[ - Variant]/User/keybindings.json
Snippets: $HOME/Library/Application Support/Code[ - Variant]/User/snippets/
Workspace storage: $HOME/Library/Application Support/Code[ - Variant]/User/workspaceStorage/
Chromium user data: $HOME/Library/Application Support/Code[ - Variant]/
Extensions: $HOME/.vscode[-variant]/extensions/ (not moving)
New
Settings: $HOME/Library/Application Support/[Visual Studio ]Code[ - Variant]/settings.json
Keybindings: $HOME/Library/Application Support/[Visual Studio ]Code[ - Variant]/keybindings.json
Snippets: $HOME/Library/Application Support/[Visual Studio ]Code[ - Variant]/snippets/
Workspace storage: $HOME/Library/Application Support/[Visual Studio ]Code[ - Variant]/workspaceStorage/
Chromium user data: $HOME/Library/Application Support/[Visual Studio ]Code[ - Variant]/userdata/
Extensions: $HOME/Library/Application Support/[Visual Studio ]Code[ - Variant]/extensions/
Notes:
- Is there a similar standard for dividing cache and config files on Mac? http://stackoverflow.com/a/5084892/1156119
Issue Analytics
- State:
- Created 8 years ago
- Reactions:459
- Comments:174 (46 by maintainers)
Top Results From Across the Web
User and Workspace Settings - Visual Studio Code
The workspace settings file is located under the .vscode folder in your root folder. The File Explorer displaying settings.json under the .vscode folder....
Read more >Visual Studio _Instances folder - Microsoft Q&A
I managed to screw up my Visual Studio 2019 install by trying out some PC cleaner tool thats supposed to clean up temp...
Read more >View and modify files and folders in Files on iPad
Note: Not all document formats are supported by the Files app. Change how files and folders are sorted. From an open location or...
Read more >File Structure : Broad Institute of MIT and Harvard
A successful file structure organizes your data and code with the goal of ... access key parts of your project without looking through...
Read more >25 Extensions That Turn Visual Studio Code Into An ... - P42
When writing tests or creating mockups, it often takes time to come up with good fake data. You can use the vscode-random extension...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can’t believe this hasn’t been fixed in over FOUR YEARS.
Sorry, but I’m tired of trash in my home directory