-
-
Notifications
You must be signed in to change notification settings - Fork 904
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
completing React components with Corfu causes Emacs to freeze #3720
Comments
@justinbarclay Can you try to replace https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-completion.el#L505-L510 with these to see if it improves your situation? (lambda (probe pred action)
(cond
((eq action 'metadata)
'(metadata (category . lsp-capf)
(display-sort-function . identity)
(cycle-sort-function . identity)))
((eq (car-safe action) 'boundaries) nil)
(t
(complete-with-action action (funcall candidates) probe pred)))) |
It's been a busy week, but I will get back to you tonight or tomorrow night. |
Actually can you try that on the latest lsp-mode as well? |
Thanks for the suggestion, @kiennq; unfortunately, Emacs still has occasional hangs during autocomplete. |
Can you update to the latest (define-advice lsp-request-while-no-input (:around (func &rest args) no-block)
(let ((non-essential t))
(apply func args))) |
Sure thing, this is from typing CPU Profile
Memory ProfilerI'd share my whole memory profile but it was like 1000+ lines, so I focused on the highest percentage section
I tried this too but it would still occasionally freeze |
Can you toggle the io trace with I saw there's |
No, no garbage collector, just a high GC threshold I guess? Looking at my config it's at 100mb, which is way higher than the 10 I thought I set it at (years ago).
Company mode works great :)
I will try both of these, but I am having trouble getting |
So I did some more digging into this. The issue I ran into with For reference, I am on Arch Linux running in WSL2. Normally I run emacs with pgtk but I was running into this issue #3738. So I downgraded to Emacs 28.2 and could not recreate this issue. I then tried upgrading to a plain version of Emacs 29, one without pgtk, and failed to recreate this issue. Finally, I tried Emacs 29 with pgtk one more time and was able to recreate this issue. So, I believe that this issue is some edge case of Emacs 29, pgtk, and Corfu and maybe LSP because I haven't been able to recreate this using any of the 4 in isolation. I am switching my Emacs 29 to one without pgtk. I'm going to close this issue, because its doesn't appear to be an issue with LSP but some other system (childframes in pgtk maybe?). |
Thank you for the bug report
lsp-mode
related packages.M-x lsp-start-plain
Bug description
When using Corfu's auto-complete and LSP within a React application, Emacs will occasionally hang for several seconds if I start typing out a component. After waiting for several seconds, the correct list of completions will appear.
Generally, this freeze is the first character after
<
. So, if I entered<B
, I would see<
for several seconds and then<Button
would show up as a completion. I've also noticed this occurs with/
,>
, and.
but with a much lower frequency. (or I am triggering auto-complete less there)I suspect Corfu and LSP are not playing well together because, through my limited use, I haven't been able to get Eglot to hang the same way.
Steps to reproduce
lsp-start-plain
defined in this gistjira_clone
this would happen in theclient
directory<I
or<S
Expected behavior
I expect that Emacs will not freeze and that instead I within several hundred milliseconds I will get a completion.
Which Language Server did you use?
ts-ls
OS
Linux
Error callstack
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: