Skip to content
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

textDocument/signatureHelp received after LSP exit #258

Open
kting28 opened this issue Feb 21, 2023 · 5 comments
Open

textDocument/signatureHelp received after LSP exit #258

kting28 opened this issue Feb 21, 2023 · 5 comments

Comments

@kting28
Copy link

kting28 commented Feb 21, 2023

With lsp_signature enabled with clangd, I frequently get these error messages printed on the console:

RPC[Error] code_name = UnknownErrorCode, message = “Failed to parse includes”

After some investigations it seems to be related to LSP exiting before the signature query reply is sent back. Sample steps:

  1. Open a file with LSP is enabled and wait for parsing to start
  2. Exit the editor
  3. Some RPC[Error] messages are printed on the console. From the lsp.log, these seems to be received (or sent?) after the LSP has exited.

For example in the log below, you can see LSP has finished then next line the RPC error is received and printed on stderr

[ERROR][2023-02-20 20:19:36] .../vim/lsp/rpc.lua:733	"rpc"	"clangd"	"stderr"	'V[20:19:36.934] <<< {"jsonrpc":"2.0","method":"exit"}\n\nI[20:19:36.934] <-- exit\nI[20:19:36.934] LSP finished, exiting with status 0\n'
[ERROR][2023-02-20 20:19:36] .../vim/lsp/rpc.lua:733	"rpc"	"clangd"	"stderr"	'I[20:19:36.934] --> reply:textDocument/signatureHelp(4) 3165 ms, error: Failed to parse includes\nV[20:19:36.934] >>> {"error":{"code":-32001,"message":"Failed to parse includes"},"id":4,"jsonrpc":"2.0"}\n\n'
[DEBUG][2023-02-20 20:19:36] .../vim/lsp/rpc.lua:388	"rpc.receive"	{  error = {    code = -32001,    message = "Failed to parse includes"  },  id = 4,  jsonrpc = "2.0"}
[ERROR][2023-02-20 20:19:36] .../vim/lsp/rpc.lua:733	"rpc"	"clangd"	"stderr"	"V[20:19:36.936] ASTWorker rebuilding evicted AST to run DocumentSymbols: <--redacted path to file--> version 0\n"

This is a minor issue as the message are only printed on exit but it's quite annoying. Anyway to supress?

@kting28
Copy link
Author

kting28 commented Feb 21, 2023

btw I don't seem to see the same issue with other signature help plugins such as
cmp-nvim-lsp-signature-help. Is this related to the "async" signature requests this plugin is design to do? I.e. LSP is stopped while there are outstanding queries?

@ray-x
Copy link
Owner

ray-x commented Feb 21, 2023

Do you mean when you quit nvim you saw RPC[Error] code_name = UnknownErrorCode, message = “Failed to parse includes” ?

@kting28
Copy link
Author

kting28 commented Feb 21, 2023

Do you mean when you quit nvim you saw RPC[Error] code_name = UnknownErrorCode, message = “Failed to parse includes” ?

Yup. It's not consistent but for larger files I see multiple lines of these. Does not happen if I waited long enough after opening a file; probably after all queries are made?

@ray-x
Copy link
Owner

ray-x commented Feb 21, 2023

Ok, I think it is related to the async request I sent. But I have not seen the same issue so far. Might be also because the clangd is slow or your project is large.
How you exit your nvim? Do you have a keybind or you do :wq from cmdline? More specifically, are you exit Insert mode before you exit?

@kting28
Copy link
Author

kting28 commented Feb 21, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants