Skip to content

workspace: Add .code-workspace file support#46225

Open
coopbri wants to merge 21 commits into
zed-industries:mainfrom
coopbri:feature/code-workspace
Open

workspace: Add .code-workspace file support#46225
coopbri wants to merge 21 commits into
zed-industries:mainfrom
coopbri:feature/code-workspace

Conversation

@coopbri

@coopbri coopbri commented Jan 7, 2026

Copy link
Copy Markdown

Closes #9459

Added basic .code-workspace file support. Opening workspace files loads all folders defined in the folders array with CLI support, recent projects integration, and session persistence.

Deferred for future PRs (pending community/Zed team discussion):

  • VS Code settings translation (currently, workspace settings ignored)
    • Also name field parsed but unused
    • extensions field ignored
  • Reload/watch on external changes
  • The big one: native .zed-workspace (or similar naming) support
    • I added structure for it in WorkspaceFileKind enum, but not implemented

Note: It seems multi-root git status only shows first repository (pre-existing limitation, not introduced here).

zed-workspaces.mp4

Release Notes:

  • Added support for opening .code-workspace files

Test Steps:

  • Create a .code-workspace file (note: as above, currently only folders array is processed), e.g.:
{
  "folders": [
    {
      "name": "Bevy",
      "path": "../bevy"
    },
    {
      "name": "Zed",
      "path": "."
    }
  ]
}

Then, options:

  1. Open from terminal: zed demo.code-workspace
  2. Open from File -> Open picker (or Open Recent picker if in recents)
  3. Drag and drop the .code-workspace file onto the Zed window
  4. OS native open (with file association)

@cla-bot

cla-bot Bot commented Jan 7, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @coopbri on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@coopbri

coopbri commented Jan 7, 2026

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jan 7, 2026
@cla-bot

cla-bot Bot commented Jan 7, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@maxdeviant maxdeviant changed the title [WIP] feature(workspace): add code workspace file construct workspace: Add .code-workspace file support Jan 7, 2026
@coopbri
coopbri marked this pull request as ready for review January 10, 2026 18:56
@zed-industries-bot

zed-industries-bot commented Jan 29, 2026

Copy link
Copy Markdown
Contributor
Warnings
⚠️

This PR is missing release notes.

Please add a "Release Notes" section that describes the change:

Release Notes:

- Added/Fixed/Improved ...

If your change is not user-facing, you can use "N/A" for the entry:

Release Notes:

- N/A

Generated by 🚫 dangerJS against 70504ce

@coopbri

coopbri commented Feb 8, 2026

Copy link
Copy Markdown
Author

Warnings
⚠️
This PR is missing release notes.

Please add a "Release Notes" section that describes the change:

Release Notes:

- Added/Fixed/Improved ...

If your change is not user-facing, you can use "N/A" for the entry:

Release Notes:

- N/A

Generated by 🚫 dangerJS against 69c9e33

No it is not

@g5becks

g5becks commented Feb 10, 2026

Copy link
Copy Markdown

Is this feature going to support extension recommendations like vscode?

@rxmarbles

Copy link
Copy Markdown

@coopbri looks like the windows test suite failed, possibly in relation to upstream changes. might have to address conflicts as well. Look forward to seeing this feature get deployed. Its the one thing to help reduce my need for so many open windows 😂

@coopbri

coopbri commented Feb 18, 2026

Copy link
Copy Markdown
Author

@coopbri looks like the windows test suite failed, possibly in relation to upstream changes. might have to address conflicts as well. Look forward to seeing this feature get deployed. Its the one thing to help reduce my need for so many open windows 😂

Yeah I was getting sick of resolving conflicts until hearing back from someone 😂 Will fix today.

# Conflicts:
#	crates/recent_projects/src/recent_projects.rs
#	crates/workspace/src/persistence.rs
#	crates/workspace/src/workspace.rs
#	crates/zed/src/main.rs
#	crates/zed/src/zed/open_listener.rs
@coopbri
coopbri requested review from a team as code owners February 18, 2026 15:59
@coopbri

coopbri commented Feb 18, 2026

Copy link
Copy Markdown
Author

Is this feature going to support extension recommendations like vscode?

I think this is a cool idea, but best scoped for another PR. That way we can incrementally adopt the workspace support with atomic feature branches.

@coopbri

coopbri commented Feb 18, 2026

Copy link
Copy Markdown
Author

@rxmarbles we cookin now! Thanks for bringing that to my attention.

# Conflicts:
#	crates/workspace/src/workspace.rs
# Conflicts:
#	crates/workspace/src/workspace.rs
Apply cargo fmt fixes to recent_projects and persistence crates, and
use path! macro in workspace file tests so paths include the drive
letter on Windows.
@laris

laris commented Feb 28, 2026

Copy link
Copy Markdown

I create a hooked version to manage *.code-workspace and sync with internal sqlite3 workspace_id

laris/zed-project-workspace: Zed workspace sync hook + MCP tools powered by dylib-kit

  1. it can sync the workspace_id with *.code-workspace via .zed/settings.json project_name variable
  2. it can pin the project_name/primary workspace folder name in top of projects pannel entries list
  3. can pin in the zed's menu bar picker list
  4. can pin in the search/open rencent project list

@SomeoneToIgnore
SomeoneToIgnore removed request for a team April 8, 2026 07:28
@smitbarmase smitbarmase added the area:workspace Feedback for workspace management, layout, interactions, etc label Jun 29, 2026
coopbri and others added 2 commits July 17, 2026 17:37
Syncs the .code-workspace PR (zed-industries#46225) with main (3494 commits ahead). Upstream
landed a "project groups" / multi-workspace feature that restructured the same
surfaces this PR touches, so the merge re-integrates the .code-workspace support
into that refactor:

- Kept the LocalFromFile location variant + workspace_file_source OpenOptions
  field alongside upstream's identity_paths, dev-container, and project-group
  additions.
- recent_projects: moved the .code-workspace open path into upstream's extracted
  open_recent_projects(); LocalFromFile treated as local across the picker/sidebar.
- persistence: unioned workspace_file_path/kind with identity_paths across the
  save/read queries (nested the args tuple within sqlez's 10-element Bind limit),
  and moved the workspace_file_* migration to the end of the list so existing
  users' applied-migration indices are preserved.
- open_listener/main: threaded workspace_file_source through the CLI open path;
  added LocalFromFile arms to the match sites the project-groups feature added.

Verified: `cargo check -p zed` clean (no warnings in touched files);
`cargo test -p workspace -p recent_projects --lib` = 308 passed, 0 failed
(incl. all 44 persistence round-trip tests).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:workspace Feedback for workspace management, layout, interactions, etc cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support opening .code-workspace files to open vs code type workspace directly

9 participants