Hi folks, thank you so much for making rust-mode, I use it every day together with rustic-mode.
I filled emacs-rustic/rustic#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 emacs-rustic/rustic#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!
Hi folks, thank you so much for making
rust-mode, I use it every day together withrustic-mode.I filled emacs-rustic/rustic#110 yesterday, but the issue might actually belong here?
The tl;dr is that
rust-analyzerisn'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
.gitdirectory. So this project layout works fine:as does this layout since
rust-analyzerrecurses one level deep in its auto-discovery:However, this one fails:
I've added my own function to
project-find-functionsand it seems to work okay (see emacs-rustic/rustic#110). I would love an expert to look it over, and if possible, include it inrust-modeorrustic-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!