rust-analyzer: Error NO_RESULT_CALLBACK_FOUND with Neovim's native LSP

rust-analyzer version: rust-analyzer ad6810e90 2022-06-06 stable

rustc version: rustc 1.62.0-nightly (f4a7ce997 2022-04-08)

neovim version: NVIM v0.8.0-dev 37ee800b519

relevant settings:

CARGO_HOME=/home/tomvd/.local/share/cargo
RUSTUP_HOME=/home/tomvd/.local/share/rustup

Neovim LSP config is done with https://github.com/simrat39/rust-tools.nvim and https://github.com/williamboman/nvim-lsp-installer

Link to (very long) log: https://www.toptal.com/developers/hastebin/ihiguxinej.properties

Ref: neovim/neovim#15844 The above issue told me that the issue is with the language server, not with neovim itself.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 15
  • Comments: 29 (13 by maintainers)

Commits related to this issue

Most upvoted comments

I built a r-a based on the branch for #12508 and the problem appears fixed, thanks for the quick turnaround Veykril!

https://github.com/rust-lang/rust-analyzer/pull/12508 should fix this, we were resetting the cancelled state of requests when retrying them which made us reply for already cancelled requests again.

:LspInstall rust_analyzer@2022-05-30

but i ve got RPC Error sometimes, only RUST related.

@flodiebold I’ll give that a shot — stay tuned!

With that said @justinmk you can probably close the issue on the neovim side again as this was a fault on our part after all. Sorry for that!

I’m getting this error on 2022-05-30 as well (but seems to be less frequently)

I have reopened https://github.com/neovim/neovim/issues/15844 and pasted the helpful comments from here.

How do other LSP clients handle this? Just ignore it?

There isn’t really anything to ignore here, when a reply comes in a client should only mark the request that belongs to that reply as resolved. “Resolving” multiple requests from one reply and then expecting no replies for the other requests to come in won’t work as per spec the server should reply to every request in some form.

This is might seem odd for r-a to do, but to my knowledge the LSP permits this kind of processing. it specifically states that each request has to be replied to, but not in what order.

@Veykril thanks for that analysis. If someone can open a new Nvim issue I have reopened https://github.com/neovim/neovim/issues/15844

Related Nvim LSP client code: https://github.com/neovim/neovim/blob/4d9e2247c939a5df0a79a06f37ab882ff66aeb01/runtime/lua/vim/lsp/rpc.lua#L554

How do other LSP clients handle this? Just ignore it?

neovim/nvim-lspconfig#225 says the configs there are “best-effort” and unsupported

nvim-lspconfig is just configs, it is not the Nvim LSP client.

I downgraded from the 2022-06-06 to 2022-05-30 and everything works perfectly.

Update: This doesn’t occur on Emacs, so I think this issue is nvim-lspconfig specific. Using the normal (non-lsp-installer) version of rust-analyzer doesn’t help. I did update from lspconfig version 84252b0 to eb03999, but downgrading back doesn’t help either. I guess this issue just started appearing all of a sudden, which I find weird.