Using Workspaces in Visual Studio Code

Johan
3 min readMay 30, 2023

--

Visual Studio Code (VSCode from now on) is my go-to tool for code editing. One of my favourite features is the use of Workspaces.

A Workspace is a collection of one ore more folders with code. How do you create a Workspace ? The Workspace operations are under the File menu. Easiest is to add some folders to the Workspace. When you do this on a higher level (for instance the folder containing all you GIT repo’s), all subfolders are automatically added to the Workspace.

Here you see the GIT symbol on the left hand menu, having added several folders and recognized 16 GIT repo’s inside with 38 pending changes.

This is where for me the first advantage shows up: being able to search in all code in the Workspace folders.

On the other hand, 20000 results in 2644 files is not very useful. Therefore, organising folders into multiple Workspaces is recommended.

The second thing I use a lot is to find files based on filenames:

Use Ctrl-P and type or paste a filename and you will find all occurences of this filename in your entire Workspace.

Let’s now touch a more “controversial” topic, a potential third use case of VSCode: doing GIT operations. Although this is not primarily related to the use of workspaces ……….

I don’t do GIT operations in VSCode. Why not ? Because VSCode generates way too much logging.

The output below, for instance, is or one “add” command in GIT. I prefer the clean logging in GIT Bash for these purposes. But, a lot off people use this, it does work, so not a real hard preference from my side.

What other cases do you use in VSCode ? Please respond to my LinkedIn post or in the reply of this Medium post.

--

--

Johan

I am a freelance data engineer. My main focus is Snowflake, but I am always eager to learn new things. Python and AWS are my main side interests