workspace: Add .code-workspace file support#46225
Conversation
|
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'. |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
.code-workspace file support
|
Is this feature going to support extension recommendations like vscode? |
|
@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
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. |
|
@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.
|
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
|
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).
Closes #9459
Added basic
.code-workspacefile support. Opening workspace files loads all folders defined in thefoldersarray with CLI support, recent projects integration, and session persistence.Deferred for future PRs (pending community/Zed team discussion):
namefield parsed but unusedextensionsfield ignored.zed-workspace(or similar naming) supportWorkspaceFileKindenum, but not implementedNote: It seems multi-root git status only shows first repository (pre-existing limitation, not introduced here).
zed-workspaces.mp4
Release Notes:
.code-workspacefilesTest Steps:
.code-workspacefile (note: as above, currently onlyfoldersarray is processed), e.g.:{ "folders": [ { "name": "Bevy", "path": "../bevy" }, { "name": "Zed", "path": "." } ] }Then, options:
zed demo.code-workspace.code-workspacefile onto the Zed window