rust-lang / rust-lang/rust-mode
Failed to discover workspace
Nobody has claimed this yet.
- Dominant language
- Emacs Lisp
- Stars
- 1.3k
- Forks
- 198
- PR merge metrics
- No merged PRs in 30d
Description
Hi folks, thank you so much for making rust-mode, I use it every day together with rustic-mode.
I filled https://github.com/emacs-rustic/rustic/issues/110 yesterday, but the issue might actually belong here?
The tl;dr is that rust-analyzer isn't able to auto-discover the Cargo workspace if what Emacs/Eglot considers the projects root — computed with (project-root (project-current)) — doesn't match what Cargo considers the root.
By default, the Emacs project root is defined by the VCS folder, typically a .git directory. So this project layout works fine:
project/
.git/
Cargo.toml
src/
lib.rs
as does this layout since rust-analyzer recurses one level deep in its auto-discovery:
project/
.git/
rust/
Cargo.toml
src/
lib.rs
However, this one fails:
project/
.git/
rust/
foo/
Cargo.toml
src/
lib.rs
I've added my own function to project-find-functions and it seems to work okay (see https://github.com/emacs-rustic/rustic/issues/110). I would love an expert to look it over, and if possible, include it in rust-mode or rustic-mode.
Feel free to close either issue since they're effectively duplicates of each other (I just didn't know where to file this).
Thanks!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the project-find-functions customization and the related rustic-mode issue 110, then inspect how rust-mode and rustic-mode determine project roots for Cargo workspaces. Done means supporting the deeper workspace layout described here or clearly documenting why the proposed discovery function cannot be included.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- emacs, emacs-lisp, rust
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100