-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Error NO_RESULT_CALLBACK_FOUND with Neovim's native LSP #12482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This issue is reprocucible with the default require"lspconfig".rust_analyzer.setup {} |
neovim/nvim-lspconfig#225 says the configs there are "best-effort" and unsupported. I don't see anything saying that it's a server issue. The log seems to just be a completion response. If there are some specific steps that lead to the error, it would help if you could name them, and see whether they lead to similar errors with other clients (VSCode, Emacs, ...). If the issue does not happen with older rust-analyzer versions, that would also be interesting. Otherwise I would suggest asking at |
This error just occurs when typing things (at random moments). I have no idea where the issue may be coming from. I'll try without I think the issue started coming up when upgrading from Edit: I won't need to check if it works without rust-tools, as that has been checked by ten3roberts. |
Update: This doesn't occur on Emacs, so I think this issue is |
Another update: (I'm sorry for the spam) The latest version (package in Arch Linux's |
I downgraded from the 2022-06-06 to 2022-05-30 and everything works perfectly. |
Same issue after upgrading rust_analyzer with version 2022-06-06 |
If someone could bisect the issue to a specific commit in that range, that would be helpful. |
@flodiebold I'll give that a shot — stay tuned! |
Hmm, I can only make an assumption here but I imagine that nvim discards requests of a certain kind it sent out if a newer one has been answered. That is if we have requests like
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. Though again, this is a wild guess, I do not know how nvim's lsp implementation works, but if this is the case I would argue that this is an implementation error on nvim's side (even if we try to fix the ordering here). |
@justinmk would love your input here in trying to figure out if this is a rust-analyzer LSP bug, or a bug/missing feature on the neovim LSP side of things. Does what Veykril outlined above match the actual behavior of neovim? |
but i ve got RPC Error sometimes, only RUST related. |
@Veykril thanks for that analysis. 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?
nvim-lspconfig is just configs, it is not the Nvim LSP client. |
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. |
I have reopened neovim/neovim#15844 and pasted the helpful comments from here. |
I'm getting this error on |
Neovim doesn't do that. It clears callbacks only for a given id. |
We'll need to see some neovim logs for r-a here then, because there isn't really a way for r-a to send multiple responses for one request from what I can see (so I'd like to get proven wrong here then). |
Does this mean we don't need to keep this issue around, or do we keep conversation in this repo? |
While trying to look for my lsp log Anyways, if anyone knows where to find (the proper) logs for nvim LSP that would be appreciated. |
Hm, that actually are the proper logs (opened through I guess for now it boils down to working without LSP stuff. |
Regarding logs, we'll need one that shows some more LSP calls prior to the error so we can tell what the server and client exchange that causes the problem. |
I grabbed some logs from the rust-analyzer side as well, see my comment here: neovim/neovim#15844 (comment) Those logs were with Poking through it with no real experience on r-a or the neovim LSP, my guess is that the problem is related to this line:
If anyone wants to reproduce the problem and is familiar with Nix, I've been using this tree to reproduce the problem. Add a line after this one with the contents |
Hmm, so I think what might be happening here is that the client cancels the completion request, we acknowledge that but still return a response. Edit: yep that's it, found the problem I think |
#12508 should fix this, we were resetting the cancelled state of requests when retrying them which made us reply for already cancelled requests again. |
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 built a r-a based on the branch for #12508 and the problem appears fixed, thanks for the quick turnaround Veykril! |
Don't forget to |
rust-analyzer version: rust-analyzer ad6810e 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:
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.
The text was updated successfully, but these errors were encountered: