Workspaces & Multi-Root Projects
VS Code workspaces let you group multiple project folders together, share settings between them, and manage a monorepo or microservices setup from a single editor window.
1Single-Folder vs Multi-Root Workspaces
When you open a single folder (code .), you're in single-folder mode. For projects with multiple packages or services, use a .code-workspace file to combine several folders into one window with a shared configuration.
2Creating a .code-workspace File
{ "folders": [ { "path": "packages/api" }, { "path": "packages/web" }, { "path": "packages/shared" } ], "settings": { "editor.formatOnSave": true } }
3Workspace-Specific Settings & Extensions
Each folder can have its own .vscode/settings.json and .vscode/extensions.json. The workspace file itself can also carry top-level settings that apply across all folders.
4Recommended Extensions for a Workspace
Add a .vscode/extensions.json to prompt teammates to install required extensions when they open the project:
{ "recommendations": [ "esbenp.prettier-vscode", "dbaeumer.vscode-eslint", "github.copilot" ] }
5Trusted Workspaces
VS Code asks you to trust a workspace before running code from it. This sandbox helps protect against malicious projects. You can always view the workspace trust level in the Status Bar and adjust it in Manage Workspace Trust.