zed icon indicating copy to clipboard operation
zed copied to clipboard

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

Open avp1598 opened this issue 1 year ago • 1 comments

Check for existing issues

  • [X] Completed

Describe the feature

I want to be able to open .code-workspace file which opens the workspace with all the folders defined in the file. The file looks something like this

{
  "folders": [
    {
      "name": "ⵣ protocol",
      "path": "."
    },
    {
      "name": "⛓️ blockchain",
      "path": "golang/blockchain"
    },
    {
      "name": "😈 daemon",
      "path": "golang/tribesd"
    },
    {
      "name": "🦀 client",
      "path": "rust/client"
    },
  ],
  "settings": {
    "editor.tabSize": 2,
    "files.exclude": {
      "**/build": true,
      "**/node_modules": true
    },
    "solidity.packageDefaultDependenciesContractsDirectory": "src",
    "solidity.packageDefaultDependenciesDirectory": "lib",
    "solidity.formatter": "forge",
    "solidity.compileUsingRemoteVersion": "v0.8.20",
    "git.detectSubmodules": false,
    "rust-analyzer.showUnlinkedFileNotification": false,
    "rust-analyzer.cargo.target": "wasm32-unknown-unknown",
    "rust-analyzer.inlayHints.chainingHints.enable": false,
    "rust-analyzer.inlayHints.typeHints.enable": false,
    "rust-analyzer.inlayHints.parameterHints.enable": false,
    "editor.codeActionsOnSave": {
      "source.fixAll.eslint": "explicit"
    },
    "editor.formatOnSave": false
  }
}

If applicable, add mockups / screenshots to help present your vision of the feature

No response

avp1598 avatar Mar 17 '24 12:03 avp1598

This is mainly why zed didn’t “stick” for me. What’s the point in being super fast as an editor if you have to have a different window open for each repo OR have to manually reopen the correct folders on startup? It works ok if you always open same set of folders, but not if you have multiple “workspaces”, as vscode refers to them. Project, workspace, whatever is called… it’s a user friendly shortcut that saves mental bandwidth for heavy users.

atljoseph avatar Oct 09 '24 13:10 atljoseph

This is mainly why zed didn’t “stick” for me. What’s the point in being super fast as an editor if you have to have a different window open for each repo OR have to manually reopen the correct folders on startup? It works ok if you always open same set of folders, but not if you have multiple “workspaces”, as vscode refers to them. Project, workspace, whatever is called… it’s a user friendly shortcut that saves mental bandwidth for heavy users.

Same here, seeing as .code-workspace files are for vscode and can have the list of plugins etc. which won't be relevant, having say a .zed-workspace or .zed-project etc. would be fine imo.

saminton avatar Oct 10 '24 09:10 saminton

This is mainly why zed didn’t “stick” for me. What’s the point in being super fast as an editor if you have to have a different window open for each repo OR have to manually reopen the correct folders on startup?

Same here, for the exactly same reasons.

I often maintain multiple .vscode/*.code-workspace-s per project, especially multi-environment DevOps projects in single repo, for example: .vscode/env-dev.code-workspace, .vscode/env-prd.code-workspace, etc. each manually crafted with environment-specific configuration modules.

The simple zed . simply does not cut it.

mloskot avatar Oct 10 '24 11:10 mloskot

use our config .zed/name.workspace and supports .vscode/name.code-workspace

  1. folders same syntax

  2. settings by proxy vscode -> zed: ex. "editor.fontSize": 13 -> "buffer_font_size": 13

ps. It's just an idea

reslear avatar Oct 10 '24 12:10 reslear

Can you link the docs?

On Thu, Oct 10, 2024 at 8:12 AM reslear @.***> wrote:

use our config .zed/name.workspace and supports .vscode/name.code-workspace

folders same syntax 2.

settings by proxy vscode -> zed: ex. "editor.fontSize": 13 -> "buffer_font_size": 13

— Reply to this email directly, view it on GitHub https://github.com/zed-industries/zed/issues/9459#issuecomment-2404923347, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF632FOAHVHRWLERC4SHW4TZ2ZVK3AVCNFSM6AAAAABPUPXHFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBUHEZDGMZUG4 . You are receiving this because you commented.Message ID: @.***>

atljoseph avatar Oct 10 '24 12:10 atljoseph

In my experience, Zed does not keep track of multiple repos (i.e. folders) within a single "Project" as they call it. From what I gather, Zed's concept of a "Project" is the root folder of a single git repo.

So if I start from a fresh Zed window and select File > Add Folder to Project... and open folder A and then do the same for folders B & C (note that A, B and C each have their own .git subfolder because they are each a separate git repo) then the name of the project and the current branch (listed in the upper-left) BOTH reflect the first folder that was opened i.e. A. It doesn't matter if I click or double-click the folder for B or C... It cannot "see" their branches. So you could be on the develop branch for A and actually be on the master branch for B and C but it would never tell you; you'd be editing code in the wrong branch if you trusted that it kept up with the repos-per-folder like VS Code does. To reinforce this, notice that if you click on the branch then the only available branch names are those from A; branches in B and C do not show up AT ALL.

So it's not that "Zed needs to support VS Code workspace documents" as much as it's that Zed needs to support a "workspace" concept altogether. In other words, we need a "Workspace" that can keep track of multiple "Projects" (repos/folders) at the same time. Then and only then can we have a .zed-workspace file (and support its analogue from VS Code).

Please correct if I am wrong (shrug).

jliverman avatar Oct 28 '24 19:10 jliverman

to whom this idea may help, giving zed multiple directories as arguments allows one to open multiple directories in a single command call. so for example if your project consists of directories ~/dir1 and ~/dir2, you may create an alias for opening your project, which executes zed ~/dir1 ~/dir2, and it will open a new zed window with those two directories.

this is, naturally, a temporary solution since i do trust that they will eventually introduce a proper way of managing projects, but i don't think it's worth to discard the entire editor for the lack of this particular feature.

mobismadev avatar Nov 09 '24 18:11 mobismadev

Recently picked up Talon voice, and there are a lot of examples of working with VS code. It is SO useful to those with handicaps, or to those who employ it for power use. Going to go with the familiar. Not because it is better, which can’t really be measured. But because of the maturity of the product, availability of extensions, and the general completeness of the ecosystem around the product and its various forks. Thanks

PS. Vscode git also supports multiple repos and even repos inside of repos, all attached to a single workspace file. That pretty much says it all right there.

atljoseph avatar Nov 09 '24 18:11 atljoseph

Recently picked up Talon voice, and there are a lot of examples of working with VS code. It is SO useful to those with handicaps, or to those who employ it for power use. Going to go with the familiar. Not because it is better, which can’t really be measured. But because of the maturity of the product, availability of extensions, and the general completeness of the ecosystem around the product and its various forks. Thanks

An upvote for workspaces + flagging the above comment ⬆️ as either off-topic | possibly spam.

zachvalenta avatar Nov 13 '24 19:11 zachvalenta

My comment is not spam yo. It is on topic. It is on the topic of usability. You just dont like it

atljoseph avatar Nov 13 '24 19:11 atljoseph

The feature of maintaining settings per workspace/project is very missing.

Personally, I have more than 100 .code-workspace files that help do not worry every time about last state of the certain environment. Missing of such feature like saving Zed workspace with settings and last opened files and folders to e.g. .zed-workspace is stop factor to be main code editor.

If this feature will be developed, please implement remote development, e.g.:

{
	"folders": [
		{
			"uri": "vscode-remote://ssh-remote+w.h/root"
		},
		{
			"uri": "vscode-remote://ssh-remote+w.h/var/log"
		},
		{
			"uri": "vscode-remote://ssh-remote+w.h/etc"
		},
		{
			"uri": "vscode-remote://ssh-remote+w.h/home"
		}
	],
	"remoteAuthority": "ssh-remote+<some IP/hostname or alias from ~/.ssh/config>",
	"settings": {}
}

ww7 avatar Feb 09 '25 18:02 ww7

Zed needs a more robust project/workspace manager. We have the "open recent" option, but it's not enough.

I don't understand how this is not a priority for a Code Editor. Unfortunately, I don't know Rust well enough to have quality code and contribute to the project, otherwise I would do it.

1 - When a workspace has multiple folders, the editor prioritizes the first folder and treats it as the main one.

2 - When we have multiple folders, the "open recent" interface is confusing since we don't define a name for the workspace and the search is done by folder names. If you have many folders added to the project, this is a problem and the UI take to much space.

Image

3 - When adding a remote server, even with a nickname, it doesn't appear in the "open recent" selection, showing all registered folders instead.

Image

4 - When working with a remote server, if your project has several folders added, it doesn't save the state and ALL top-level folders ALWAYS appear open in the explorer panel.

5 - A more robust solution is something like https://github.com/alefragnani/vscode-project-manager where we can add a folder to scan all git repositories and add as a project.

andremacola avatar Feb 26 '25 01:02 andremacola

My current "workaround" is, I create a project.workspace folder, filled with symlinks to folders I want to work on. But, Zed currently bugs a lot across symlinks (e.g., not picking up git repos, git diff stuck at some past state, #25181 , etc etc, just search)... But at least I can have a per workspace .zed folder.

Richardn2002 avatar Mar 25 '25 13:03 Richardn2002

This is very important for us in order to migrate from Cursor / VSCode!

jkampitakis avatar Apr 26 '25 11:04 jkampitakis

+1 vscode workspaces integration would be abig step for zed feature competeness

xidsyed avatar Jul 24 '25 01:07 xidsyed

I've been using this workaround lately (requires Raycast, which i'd heavily recommend for a multitude of reasons):

  • Create custom Script Command in Raycast
  • Name it IDE: Project name

Then in the .sh file for that command, open each folder in the same Zed instance using --add, for example:

zed ~/Desktop/@work/clients/company/project/web/
zed ~/Desktop/@work/clients/company/project/cms/ --add

Then you can just cmd+space and search for the command to open your 'workspace'

haxmart avatar Aug 11 '25 11:08 haxmart

if at the very least we could name a workspace it would a first step but having the workspace state stored outside of the folder is also something I deeply hated since the first time I tried Zed. I have a few workspaces which share a few folders and I frequently open the wrong one.

schmurfy avatar Sep 16 '25 12:09 schmurfy

I'm considering a complete switch from Cursor to Zed, as it's been very promising for me in the past few days, but I'm utterly surprised that such an important feature hasn't been implemented yet. I'm really looking forward to this.

evenfrost avatar Oct 30 '25 19:10 evenfrost

I'm the idiot who just switched over from Sublime + VScode to spend 25 minutes searching for the Save Project as ... button 🤣. But still better than the 2 hours I spent going back and forth on fonts.

I'm glad this feature has so much traction already, very much looking forward to this as well!

bomkamp avatar Nov 16 '25 12:11 bomkamp

+1 for this feature! I'm just now coming to Zed from VSCode and, much like many in this thread, found myself trying to find the workspace command

pieroshka avatar Nov 26 '25 23:11 pieroshka

Another vote for this feature - I switched to Zed for most of my projects and loving it, but the ones using the workspaces setup, I'm stuck with VS Code for now.

zigcccc avatar Dec 03 '25 05:12 zigcccc