Skip to content

Workspaces

When using the extension, you will come across two types of different workspaces, VS Code workspaces and west workspaces, and two different types of applications, workspace and freestanding applications. It is important you understand the differences between them before you start creating applications with the nRF Connect for VS Code extension.

Workspace definitions

The VS Code and west workspaces are related to different environments, VS Code and nRF Connect SDK, respectively. The main differences between them in the VS Code context are as follows:

  • A west workspace will always be a VS Code workspace, but not the other way around.
  • A VS Code workspace can be a multi-root workspace, unlike a west workspace.
  • A west workspace can version-control the files in one or more VS Code workspaces if they share the same root.

VS Code workspace

A VS Code workspace is the collection of one or more folders that are opened together in VS Code with associated settings.

You can quickly check where the workspace settings are stored and their current values using the Preferences: Open Workspace Settings (JSON) command from the Command Palette.

For more information about VS Code workspaces, read the official VS Code workspaces documentation page.

VS Code workspace setup

The VS Code workspace is automatically set when you open a folder in VS Code using File > Open Folder.... When you do this, a single-folder workspace is created and the workspace settings are stored in the .vscode/settings.json file.

A single-folder workspace opened inside VS Code

How to create a multi-root VS Code workspace

If a project's code is distributed across several folders, as in the case of an application and library code, you might need a multi-root workspace.

To create a multi-root workspace:

  1. Add new folders using File > Add Folder to Workspace.
  2. Save the multi-root workspace to a .code-workspace file using File > Save Workspace As....

Until saved, the multi-root workspace settings are stored in a temporary file.

Multi-root workspace opened inside VS Code

West workspace

West workspace is a collection of folders that are jointly version-controlled using the west management tool. A west workspace is indicated by a .west folder that contains the west workspace configuration.

Typically, when working with workspace applications, you will open a west workspace as a VS Code workspace.

West workspace opened inside VS Code

For more information about west workspaces, read Zephyr's west basics documentation page.

West workspace setup

The west workspace is set up when you initialize the west module.

Workspace type dependency

The type of workspace has an impact on the extension and application settings. For more information, see the Extension settings overview page.