-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rust-analyzer: Failed to load workspaces. #21762
Comments
Does the problem disappear if you run |
I do that regularly, like once or twice every week. I should also add that this problem seems random. I don't see it happening all the time and it will just randomly pop up as I'm editing my files. Sometimes restarting the LSP or zed makes it go away. |
@jansol this is still happening and very annoying. Any updates? |
I don't have much time for my Rust projects, but I took a quick look just now and did not encounter the error. Then again I have a somewhat convoluted setup for rust-analyzer in an effort to pick up dependencies via nix: "rust-analyzer": {
"binary": {
"path": "/run/current-system/sw/bin/bash",
"arguments": [
"-c",
"if [ -e flake.nix ]; then nix develop --command rust-analyzer; else rust-analyzer; fi"
]
}
} It seems to also be fine if I leave out the logic and just make bash invoke rust-analyzer directly. |
I have a weird setup ass well 🤷 "rust-analyzer": {
"initialization_options": {
"cargo": {
"allFeatures": true,
"buildScripts": {
"rebuildOnSave": true
}
},
"procMacro": {
"enable": true
},
"checkOnSave": {
"command": "clippy" // rust-analyzer.checkOnSave.command
},
"hover": {
"references": {
"enabled": true
}
},
"imports": {
"prefix": "crate",
"preferPrelude": true,
"granularity": {
"enforce": true
}
},
"inlayHints": {
"bindingModeHints": {
"enable": true
},
"closingBraceHints": {
"minLines": 0
},
"closureCaptureHints": {
"enable": true
},
"maxLength": null,
"lifetimeElisionHints": {
"useParameterNames": true,
"enable": "skip_trivial"
},
"closureReturnTypeHints": {
"enable": "always"
}
}
}
} |
I'm experiencing the same issue on Arch, rust-anayzer is installed by pacman. Here is the error I get: And it's solved by the same solution mentioned in comments above of specifying binary location manually. |
Check for existing issues
Describe the bug / provide steps to reproduce it
The
rust-analyzer
provided by from myPATH
always fails to run. Yet when I run it manually via the command line it works fine.Zed then default to its own
rust-analyzer
but this behavior isn't ideal.Environment
Zed: v0.164.2 (Zed)
OS: macOS 15.1.1
Memory: 96 GiB
Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
Running
which rust-analyzer
gives:/Users/<USER>/.cargo/bin/rust-analyzer
Running a command like
rust-analyzer --version
givesrust-analyzer 1.83.0 (90b35a62 2024-11-26)
.If applicable, attach your Zed.log file to this issue.
Zed.log
The text was updated successfully, but these errors were encountered: