-
Is there a way to get the rust-analyzer lsp plugin to use a rust-analyzer from the path if it's available? I have a problem right now I have my machine on nixpkgs stable, and I'm working on a project using https://github.com/ipetkov/crane to use a more recent rust version, and in my dev shell I have it setup to have these newer versions of cargo, rustc, rust-analyzer etc. However in neovim, it still seems to use the version of rust-analyzer in nixpkgs stable, causing errors like this:
I'd really like for it to just use rust-analyzer from the path, that way if I work on different projects with different rust toolchains, it can pick up the appropriate one to use for that project automatically. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It depends a bit on the way you use rust-analyzer, but if using pure nvim-lspconfig you can set |
Beta Was this translation helpful? Give feedback.
Ohh, I see I was missing a bunch of common settings for lsp servers defined in
plugins/lsp/helpers.nix
. Back on 23.11 branchplugins.lsp.servers.rust-analyzer.package
can't be set to null, but I can set.installLanguageServer = false
and that combined with making sure my dev shell also had a rust toolchain withrust-src
enabled did the trick.