Introduction
A .code-workspace file describes a multi-root workspace in
Visual Studio Code: several folders opened
together, and the settings that apply to them as a group. Opening the file opens the
workspace. A single-folder project keeps its settings in a
.vscode folder instead.
A .code-workspace file dropped on this site opens in the explorer, which
lists its folders and settings.
Structure
The file is JSON, and it may hold comments and trailing commas. The top level is an object with these members:
| Member | Value |
|---|---|
folders | An array of folder objects: path (relative to the file, or absolute) or uri, and an optional display name. |
settings | An object of settings, as in settings.json. |
launch | Debug configurations, as in launch.json. |
tasks | Tasks, as in tasks.json. |
extensions | Recommended extensions, as in extensions.json. |
{
"folders": [
{ "path": "frontend" },
{ "name": "Server", "path": "backend" }
],
"settings": { "editor.tabSize": 2 }
}
Not described
Known, not yet covered
- Viewer: the Overview lists the folders and the settings as written. It does not explain what each setting does, and it does not check them against VS Code’s published settings list.
- Reference: the workspace-level launch, tasks and extensions sections are not described on this page.
Links
Software
- Visual Studio Code – Microsoft’s code editor, which makes these files (Windows, macOS, Linux)
Reference
- Workspaces in VS Code – Microsoft’s documentation of workspace files