DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

FOBABS
FOBABS

Posted on • Updated on • Originally published at Medium

How to manually create a workspace in VSCode

The usual convention of creating a workspace in VScode is by adding the working folders you desire in the workspace and saving it with any name of your choice.

For example, we have an existing workspace named β€œcoding.code-workspace” with three working folders: fobabs-app, JavaScript and FOSS as shown below:

But what if you want to do it manually, then you’ll have to create a file named example.code-workspace and add the following code into it.

Take note of the β€œ.code-workspace” extension.

{
  "folders": [
    {
      "path": "JavaScript/fobabs/fobabs-app"
    },
    {
      "path": "JavaScript"
    },
    {
      "path": "JavaScript/FOSS"
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

Looking at the code, you can see they are in JSON format which makes it cool 😎 if you are already familiar with JavaScript Objects. The above code is for folders in the same directory and sub-directories. Let’s say you want to add a folder from a different directory, all you have to do is to do add the file path as shown below depending on your OS installed:

{
  "folders": [
    {
      "path": "JavaScript/fobabs/fobabs-app"
    },
    {
      "path": "JavaScript"
    },
    {
      "path": "JavaScript/FOSS"
    },
    {
      "path": "/home/fobabs/Desktop/facebook-clone"
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

Now, you’re just a few steps to becoming a VSCode Ninja πŸ¦Ήβ€β™€οΈ.

Top comments (0)

🌚 Friends don't let friends browse without dark mode.

Sorry, it's true.