When using the extension, you will come across both two different types of 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.
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
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:
- Add new folders using File > Add Folder to Workspace.
- Save the multi-root workspace to a
.code-workspacefile using File > Save Workspace As....
Until saved, the multi-root workspace settings are stored in a temporary file.
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, your west workspace will be a VS Code workspace.
For more information about west workspaces, read Zephyr's west basics documentation page.
West workspace setup¶
Alternatively, a west workspace can be created when you use the West Init command to initialize the west module, for example when you download and open an application that comes with a west manifest file.
When you work with a west workspace, the Manage SDKs action is replaced by Open west manifest.
You manage the SDK version manually from the west manifest file and you need to use the
West Update command to update the SDK version.
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.