Replies: 1 comment 13 replies
-
@flodiebold @brotzeit is rust-analyzer multi-root ready? If yes, then I guess we should simply mark it as such. |
Beta Was this translation helpful? Give feedback.
13 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! I'm working in Rust with
lsp-mode
, usingrust-analyzer
as the LSP server. So far I've been able to set up almost everything to my liking, but there's one thing VSCode does correctly out of the box and emacs doesn't. I'm not sure how I can fix it, but it's finally bugged me enough to make me dig further into this. I really don't want to go back to VSCode 😬. Let me explain:I have two Rust projects (crates) I maintain set up as two independent git repositories, and on the emacs side, these map to two separate projectile projects. And one project (let's call it
crate_a
) depends on the other (crate_b
). During development, I like being able to develop both projects at the same time, so I temporarily set up a dependency using apath
declaration on myCargo.toml
:Doing this allows jumping to definition and finding references across the two crates, and it creates a very seamless development experience. But when I do this on emacs with
lsp-mode
, it starts two separate instances ofrust-analyzer
, one per project. This means changes I make incrate_b
are not visible incrate_a
unless I runlsp-restart-workspace
(which takes a couple of minutes). For instance, if I add a new function or method incrate_b
, the other crate won't suggest it as an auto-completion until I restart.When calling lsp-describe session, I see two different sessions, one for each project
What I would like instead, is that all the folders are managed by the same LSP instance, regardless of the directory structure.
Is there a way I can achieve this?
Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions