What is a Visual Studio Code Workspace

In this VS code tutorial, we will discuss what is a visual studio workspace. How to create a workspace in vs code? Also, we will see how to add a folder to a workspace in visual studio code and how to Open and Close a workspace.

What is visual studio code workspace

  • A Visual Studio Code workspace can contain multiple files and folders. It allows customizing the settings and preferences of a workspace.
  • A VS Code workspace contains one or more root folders with a configurations file (.code-workspace)
  • .code-workspace is a JSON file contains configuration information with the location of all root folders belonging to a workspace.

How to create a workspace in visual studio code

Now, let us see how to create a workspace in vs code.

Here, first I have created few folders in my E drive. It looks like below:

Visual Studio Code Workspace

Now Open visual studio code, then go to File -> Open Folder…

create a workspace in visual studio code

Then select the Development folder like below:

How to create a workspace in visual studio code

Now click on File -> Save Workspace As…

create workspace vs code

Then you can provide a name for the workspace like below, click on Save.

how to create workspace vs code

Now, you can see in the VS code, the workspace will reflect like below:

vs code workspace

If you will open the physical file location, you can see the file got created.

create vs code workspace

You can open the code workspace file in a notepad also. You can see it contains the path of the folder and also settings section.

This is just a JSON file.

open vs code workspace file

Anytime you can double click on the file to open the workspace in visual studio code.

open visual studio code workspace file

This is how we can create a workspace in vs code.

How to add a folder to a workspace in visual studio code

Now, we will see how to add a folder to a workspace in code?

Open the workspace in vs code and then File -> Add folder to workspace…

add folder to a workspace in visual studio code

Then you can select the folder which you want to add, and then your workspace will looks like below having both the folders.

add folder to a workspace in vs code

This is how we can add folder to a workspace in visual studio code.

How to Open and Close a workspace in VS Code

Now we will see how to open and close a workspace in vs code.

You can directly open a workspace by double clicking on the code-workspace file like below:

open visual studio code workspace

Or you can open vs code, go to File -> Open Workspace…

Then select the workspace file from the folder above and click on Open.

how to open visual studio code workspace

Similarly, to close a workspace from visual studio code, go to File -> Close workspace like below:

close workspace in visual studio code

You may like following vs code tutorials:

In this tutorial we learned:

  • What is visual studio code workspace
  • How to create a workspace in visual studio code
  • How to add a folder to a workspace in visual studio code
  • How to Open and Close a workspace in VS Code
Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SPGuides.com

>