No workspace settings in VSCode json settings editor

Viewed 598

I created a VSCode workspace

I then saved it as golang.code-workspace file (say) on my Desktop

When double clicking the file, VSCode opens with the expected files on the explorer sidebar.

I now want to edit the particular Workspace's settings, so I hit Command + , on my keyboard.

I am then presented with the following json file(s)

enter image description here

What troubles me is that according to the breadcrump (Users > pantelis > Library > Application Support > Code > User {} settings.json), it seems as if are some kind of global, and not workspace-specific settings.

How can I edit the settings for just the particular workspace I created?

In the UI, the distinction is more clear as you can see in the image below.

Also, in the UI, why do I get (apart from the User settings tab), 2 additional tabs (Workspace and the name of the workspace (golang) I just created?) what is the difference between these two?

enter image description here

1 Answers

There's the command "Preferences: Open Workspace Settings (JSON)" (workbench.action.openWorkspaceSettingsFile) which opens the workspace-specific settings (optionally creating the file ./.vscode/settings.json relative to the workspace root if it doesn't exist yet). The order in which settings are overridden is as follows (from more important to less important):

  1. Workspace settings
  2. Global settings
  3. Default settings

... i.e. if you have a certain setting in your workspace settings, it will override the same setting in your global settings; in the same manner your global settings override the defaults (and the defaults are just what VSCode ships with and what's in force if you don't change anything).

Related