coc-rust-analyzer: Failure with Latest Rust-Analyzer

After updating to the December 21st version of rust-analyzer, I get the following:

[coc.nvim] The "rust-analyzer" server crashed 5 times in the last 3 minutes. The server will not be restarted.

:CocCommand rust-analyzer.serverVersion returns [coc.nvim] rust-analyzer 5e2935e

Not really sure how to get any more useful info. If there is some other info that would be useful, feel free to ask.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 27
  • Comments: 24 (4 by maintainers)

Most upvoted comments

Try v0.24.0

@Iniesta8 my workaround is to install an older release (i’ve done it via homebrew) and set a custom serverPath in "~/.config/nvim/coc-settings.json" via :CocConfig:

{
  "rust-analyzer.serverPath": "/usr/local/bin/rust-analyzer",
}

You can also build it from source:

$ git clone https://github.com/rust-analyzer/rust-analyzer.git && cd rust-analyzer
$ git checkout tags/2020-12-14
$ cargo xtask install

It should build the rust-analyzer and install it to ~/.cargo/bin/rust-analyzer by default.

Afterwards open your CocConfig (:CocConfig) and insert: { "rust-analyzer.serverPath": "~/.cargo/bin/rust-analyzer" }

At last, restart neovim!

I’ve opted to use the nightly version for the moment to get it working again by adding: {"rust-analyzer.updates.channel": "nightly"} to "~/.config/nvim/coc-settings.json"

Then run CocCommand rust-analyzer.upgrade to get the latest nightly version.

Edit: Vim restart is required after modifying the json file!

You can also build it from source:

$ git clone https://github.com/rust-analyzer/rust-analyzer.git && cd rust-analyzer
$ git checkout tags/2020-12-14
$ cargo xtask install

It should build the rust-analyzer and install it to ~/.cargo/bin/rust-analyzer by default.

Afterwards open your CocConfig (:CocConfig) and insert: { "rust-analyzer.serverPath": "~/.cargo/bin/rust-analyzer" }

At last, restart neovim!

Thank you. This finally worked for me.

Here you can download the executable you need for the version of last week: https://github.com/rust-analyzer/rust-analyzer/releases/tag/2020-12-14 and put it anywhere you want (need to chmod +x it also)

@nerdthatnoonelikes Make sure to double-check that the rust-analyzer at the path you put in your config is indeed a different/lower version. Mine works fine with the version from last week (December 14th instead of 21st).

For Arch/Manjaro folks: rust-analyzer 20201130-1 from the community repo + the above adjustment to the CoC config works as a workaround.

Thanks a lot for the workaround @mnbbrown.

Not sure if this is useful but I ran :CocCommand workspace.showOutput and see

Failed to deserialize InitializeParams: missing field `changeAnnotationSupport`;