Skip to content

howto have rust-analyzer work with different Rust projects #5889

Answered by pascalkuthe
tshepang asked this question in Q&A
Discussion options

You must be logged in to vote

The reason this doesn't work is a bit nuanced. Rust analyzer does support multiple projects roots, however there are some problems with that:

  • Helix automatically detects project roots that means it can not know all projects in a workspace ahead of time
  • On master helix simply uses the root of the first file opened for a language (and root discovery is also limited).
  • #5748 improves on this by rediscovering the LSP root and notifying.the sever of the nee roots when necessary. For LSPs that support multi workspaces this is really seamless, for LSPs that don't, it automatically spawns multiple LS instances instead.
  • In theory rust-analyzer does support multiple workspaces internally but that d…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by tshepang
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants