-
Notifications
You must be signed in to change notification settings - Fork 200
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
Fix #218: Defer eglot-ensure until window-configuration-change #989
base: master
Are you sure you want to change the base?
Conversation
Some emacs users can open many buffers at a time. Packages like `desktop.el` and `persp-mode` encourage this. A user may also invoke eglot-ensure when each buffer starts. The effect of this - spawning hundreds of language-server processes - can crash the server and lag the system. Now, `eglot-ensure` waits until window-configuration-change time before starting `eglot--managed-mode`. Window-configuration-change time is when the user interacts with the local buffer's window UI. Used João Távora's idea to apply a pattern from flymake: https://github.com/emacs-straight/flymake/blob/6bc8782d9c05d4c9bbba524542d457e6a3b1734b/flymake.el#L1013 Copyright-paperwork-exempt: Yes
This is nice, thanks. Some notes:
|
I just realized that indeed I just suggested this 3 years ago #218 (comment) :-) Well, I didn't think of all the consequences (as one usually doesn't :-) ) |
FWIW, after some time with major mode hooks to run |
Some emacs users can open many buffers at a time.
Packages like
desktop.el
andpersp-mode
encourage this.A user may also invoke eglot-ensure when each buffer starts.
The effect of this - spawning hundreds of language-server processes -
can crash the server and lag the system.
Now,
eglot-ensure
waits until window-configuration-change timebefore starting
eglot--managed-mode
. Window-configuration-changetime is when the user interacts with the local buffer's window UI.
Used João Távora's idea to apply a pattern from flymake:
https://github.com/emacs-straight/flymake/blob/6bc8782d9c05d4c9bbba524542d457e6a3b1734b/flymake.el#L1013
Copyright-paperwork-exempt: Yes