-
Notifications
You must be signed in to change notification settings - Fork 14
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
How to get rid of Error from the language Server (Server Not Initialized error)? #45
Comments
My config is fine. There's no reason enabling a lsp language server in a mode hook should result in an error. |
@wyuenho Try this in your config (add-hook 'lsp-after-open-hook 'lsp-ui-mode) |
That's what I used to have. Same problem. |
This error happened to me today for the first time but the plugin worked properly. |
I can ignore it mentally but not practically. Anything printed into the echo area may cover up the previous one which you really care about. This is an endemic problem across all kinds of language servers. This problem smells like a critical design flaw to me that I haven't had the time to dig into yet. |
I also decide to ignore it mentally. |
Wait, I found this warning only occur when the file was just edited. jacobdufault/cquery#206 . You can try reopen emacs/file, then the warning will disappear(at least for me). |
I see this when there are C++ standard headers that take time to index. It can be reproduced by creating compile_commands.json (and deleting any existing .cquery_cached_index directory) then calling emacs to edit the file. The following doesn't exhibit the error message because there's very little to index:
But if I add standard headers (again deleting .cquery_cached_index before executing emacs) then I do see the message until indexing of the headers is complete:
Note that the message itself actually comes from lsp-mode:
It looks like lsp sends initialize, server sends $cquery/progress, server sends initialize result, lsp sends initialized, lsp sends textDocument/didOpen, lsp sends textDocument/codeAction then the server responds with the 32002 error and a message stating that the file is being indexed. lsp-mode appears to just display the message to the user. I'm not sure if 32002 is the appropriate error message or whether lsp should do any error handling for this. Since it is an indexing issue it would be nice to get an indicator that indexing is still ongoing rather than an error message.
If you simply want to filter out the message you can tweak cquery.el as follows then set the custom variable cquery-ignore-regexps to '("is being indexed")
$cquery/progress seems to always be zero or that might be a way to see that things are still being indexed. It seems it is intentionally always zero though per the following pull request? |
I keep getting this error for some reason:
Error from the Language Server: /path/to/src.c is being indexed. (Server Not Initialized) [11 times]
How do I wait for the server to be fully initialized before turning on lsp-ui-mode?
The text was updated successfully, but these errors were encountered: