-
-
Notifications
You must be signed in to change notification settings - Fork 891
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
lsp-mode hangs when parsing system headers #4541
Comments
I know this is a vague issue, but I really don't know how to proceed or find out the cause, I'm willing to investigate if given some direction though. As things stand, it seems that whenever I type a non-trivial (i.e. not in my project) namespace, something hangs and I have to C-g out of it. If I don't it might take anywhere from ~5s to more than several minutes for emacs to become responsive again, and it's making emacs unusable. Nothing like this happens when I'm editing python or rust, for which I've used emacs as a daily driver for a while now, but I've only just come back to C++ after a long time away. As an aside,
|
When such a issue happens, I try to use another editor (typically Visual Studio) and see how it behaves. If it also hangs, then it's likely an issue with LSP server. If not, I would compare the lsp logs of both visual studio and Emacs and see what's the difference between each of them to figure out the bug. |
Closed as opened a more specific one: #4563 |
Thank you for the bug report
lsp-mode
related packages.M-x lsp-start-plain
Bug description
Sometimes, LPS keep hanging while parsing headers when I'm dealing with C++ code. This leaves me unable to interact and I have to C-g to interrupt it, but then it starts again.
This issue has persisted for quite a while, and I do an auto-package-update every week, I've tried quite a lot to fix it.
It will say it's parsing some headers, and keep saying it's connected to
clangd
. It will then get stuck on one header - I can leave it for a few minutes and it hasn't moved on. Then I need to C-g to interrupt it and carry on, though it leaves buffers open (e.g. to a system header that it was parsing) and I find I need to shut them down before I can get on with using emacs, as otherwise a few seconds later it will get back on with parsing the header and get stuck again.An example of this from
*Messages*
, just now:Steps to reproduce
I edit any C++ file - sometimes this will happen, some times it won't. It seems to be worse if I have system headers open, e.g. if I've just gone to a bunch of definitions.
Expected behavior
The headers get parsed in a reasonable time.
Which Language Server did you use?
I'm not entirely sure what this means. I have
(use-package lsp-mode)
and(add-hook 'c++-mode-hook 'lsp)
in my emacs config, and it connects toclangd
.OS
Linux
Error callstack
No response
Anything else?
In addition to the above from
*Messages*
, there's lots of this that seems to indicate it keeps reconnecting toclangd
, from*lsp-log*
:The text was updated successfully, but these errors were encountered: