question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Revisit VS Code folder structure for app data, settings, extensions

See original GitHub issue

Config 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:

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 vs vscode 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:

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:459
  • Comments:174 (46 by maintainers)

github_iconTop GitHub Comments

71reactions
Alumniminiumcommented, Mar 26, 2020

I can’t believe this hasn’t been fixed in over FOUR YEARS.

64reactions
ZerdoX-xcommented, Dec 3, 2020

Sorry, but I’m tired of trash in my home directory

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found