What is Workspace in Visual Studio Code

Asked

Viewed 4,031 times

5

What is a Workspace in Visual Studio Code and what’s the difference between working with Folder Structure and work with Workspace?

Workspace Visual Studio Code

2 answers

5


Workspace is not just a Folder that you grab and drag to VS Code. In WS (Workspace) you can make numerous settings, plus manage path of the archives etc.

Update 04/02/21: Latest article on Workspace in the official VS Code documentation https://code.visualstudio.com/docs/editor/workspaces

Imagine that you opened a Folder in Vscode, after that you have to save this Folder as a WS. After you can for example:

  • Change the Color Theme
  • Swap Keyboard Shortcuts
  • Enable or disable extensions
  • Add folders to that Folder, but are actually in another path

All these changes are saved in your WS and it is configured like this, whenever you open it will come with these configs.

If you want for example a different theme for a particular WS, you can put in the config file the code below. (have to choose the theme before saving WS)

"settings": {
      // Specifies the color theme used in the workbench.
      "workbench.colorTheme": "Default Dark+"
}

Two extra interesting factors is possible to give a Find in Folders just inside what is in WS. And more interesting yet this file that saved from your WS can be shared, yes, that’s right, you can set up an entire WS and share the file with your team.

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

NOTE: Here is the official VS Code documentation about Workspace https://code.visualstudio.com/docs/getstarted/settings

2

The workspace is basically a project with one or more root folders where you can store everything related to the project (settings, extensions, etc). This option Save Workspace As... will generate a file .code-workspace with some default settings. You can edit the file settings as you wish. For more information about Workspace and other settings, just have a look at Visual Studio Code documentation.

In case you’ve closed yours workspace, you can simply click on the option Open Workspace... and select the file .code-workspace created. This way you will open again the workspace of your project.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.