gsscoder
gsscoder

Reputation: 3392

What are ALL configuration files used by Visual Studio Code, and where does it store memory of what notifications to not show again?

VS Code from what I know handles User and Workspace configurations in JSON format. It creates .vscode folder in the working directory (when necessary) and another in user home (e.g. used to store marketplace extensions).

I'm wondering if there's also another place.

For example, if you create a file without using New File button, e.g. from terminal:

echo "dummy" >dummy.abc

And then you open it in the editor, you will be prompted with a dialog like this:

VS Code marketplace dialog

If you hit Don't Show Again... and repeat the same experiment in the same directory or in another, VS Code will remember it (it will not present the dialog a second time).

I know it's not an important thing... But I want to know where this is stored.

So, are there any other config file that VS Code uses?

Upvotes: 34

Views: 43911

Answers (5)

daparic
daparic

Reputation: 4444

I can prove beyond reasonable doubt that too much reliance of an IDE menu system leads to pain and suffering.

The global settings in vscode in Ubuntu is here:

$HOME/.config/Code/User/settings.json

Upvotes: 0

starball
starball

Reputation: 50014

Global things are in the SQLite database under User/globalStorage/state.vscdb in the same directory where user settings files are stored. Workspaces also have a SQL database in that directory, under User/workspaceStorage.

If you want to have an easier way to reset what things you have told VS Code not to show you again, see Allow to reset “Don't Show Again” preference #24815. Give it a thumbs up to show support for it. You can subscribe to it to get notified about discussion and progress. Please avoid making noisy comments there like "+1" / "bump".

Upvotes: 0

Gino Mempin
Gino Mempin

Reputation: 29536

The VS Code docs mention the location for the settings files:

Depending on your platform, the user settings file is located here:

  • Windows %APPDATA%\Code\User\settings.json
  • macOS $HOME/Library/Application Support/Code/User/settings.json
  • Linux $HOME/.config/Code/User/settings.json

If you take a look at the Code folder, there are a bunch of other files stored there:

Code$ tree -L 1
.
├── Backups
├── Cache
├── CachedData
├── CachedExtensions
├── Code\ Cache
├── Cookies
├── Cookies-journal
├── GPUCache
├── Local\ Storage
├── Network\ Persistent\ State
├── Preferences
├── User
├── Workspaces
├── blob_storage
├── languagepacks.json
├── logs
├── machineid
├── rapid_render.json
├── storage.json
└── webrtc_event_logs

Those contain all the settings/configurations that VS Code maintains (apart from the .vscode folder in your workspace). If you delete the Code folder, your VS Code would then behave like it was freshly installed.

Most of them aren't easily readable like JSON though, and most are stored in SQL DB files (.vscdb). For example, for remembering that "Don't Show Again" prompt for files with .abc extensions, it's stored in User/globalStorage/state.vscdb. Use a SQLite browser (like this) to open up that file, and you'll see this:

enter image description here

...which stores the setting to not prompt me again for .csv and .abc files. (Try removing the "abc" from the DB value, and VS Code will prompt you again.)

For workspace-specific settings, they are stored in User/workspaceStorage, where each workspace is organized into folders like this:

workspaceStorage$ tree -L 1
.
├── 145974865976a98123d05b3b96dbf2c5
├── 20159dfdb7c4cda12efaac5f8e64a954
├── 33fd12012abefa2f7f2f0a3f185999cf
├── 34a3fbd8b284b6cfb29882db362faa4e
├── 44b251d79bd7f8f49c350d022bf7d03d
├── 63d838186f19687db224f4f7a27c62ab
...

Go into any one, and check the workspace.json to know which workspace the DB file is for. Then again open the state.vscdb to see something like this:

enter image description here

...which shows settings for remembering which files are opened, etc..

Upvotes: 36

rollingtatoo
rollingtatoo

Reputation: 55

I'm under the impression that nobody else got your question right...

There are at least 3 different configurations files that i know of that can be transfered quickly to a new VSCode setup to reproduce all your configurations:

  1. settings.json
  2. keybindings.json
  3. snippet.code_snippets (last one needing to be created by the user first for his own custom snippets if needed; there could be more then one of those)

On Windows, you can find them under the path: C:\Users\YourUserName\AppData\Roaming\Code\User

You can also create list your extensions by using the code CLI. There's also a CLI command to install your extensions. code --help will give you more info if necessary. You can also take a look at this thread: How can you export the Visual Studio Code extension list?

code --list-extensions > ^
C:\Users\YourUserName\AppData\Roaming\Code\User\my_extensions.md

Be aware that if you are using Remote SSH, this command will give you different results depending on whether you are on your local VSCode or on a remote development workspace.

Upvotes: 1

André Casal
André Casal

Reputation: 1210

You have default settings, user settings, workspace settings, single folder settings (legacy) and repository settings.

You can access your defaultSettings.json by typing "default settings" in the command palette (Shift+Cmd+P or Shift+Ctrl+P in Windows/Linux).

You can access your user settings.json file by pressing Cmd+, (or Ctrl+, in Windows/Linux).

The workspace settings go inside a .code-workspace file in the "settings" key, like so:

{
    "settings": {
        "breadcrumbs.enabled": true // Settings here
    }
}

The single-folder settings go into the /.vscode/settings.json file. The single-folder state is a legacy feature. You can insert both repository-wide and workspace-wide settings inside the /.vscode/settings.json file when in a single-folder state but workspace settings stop working if you turn that into a workspace. This can be confusing because VS Code creates an implicit/unsaved workspace if you choose the "Remove folder from Workspace" or the "Add folder to workspace" options in your file explorer. enter image description here

The repository settings go into the /.vscode/settings.json file.

I've recorded a video on where settings are applied that contains a slight misconception, which I'm hoping to correct soon, around the single-folder legacy functionality that I was not aware of at the time of the recording. I hope this helps :)

Upvotes: 28

Related Questions