-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Send exit
notification to not-yet-initialized language servers instead of shutdown
#5732
Comments
You stopped reading at the first relevant item but the more important part is the second paragraph:
Helix follows the spec and sending any notication earlier is pointless as helix just drops any notification that occur before the server has initialized. There is really nothing we can do about this as there is fundementally no way to cancel the initialization currently. This is actually a current shortcoming of the LSP spec microsoft/language-server-protocol#246. Helix does about aswell we could here. Timing out is exactly the right behavior here |
Maybe that is something that could be improved in |
I did not "stop reading", but I took that first mention of allowing I do agree though that this would not be an issue if the |
Closed by #7449. Now we don't send / await the shutdown response from the server when shutting down, we just exit. We could add an extra check to send 'exit' if we haven't sent the initialize request yet but we send that basically immediately so it's probably not worth it. |
Weee, fast open & close of julia files, here we come :) Thanks so much! |
Summary
Per the spec for the initialization of an LS:
So during initialization, a conforming LS should still respect the
exit
notification and exit (almost) immediately. Right now we send (as far as I can tell)shutdown
here:helix/helix-view/src/editor.rs
Lines 1456 to 1466 in 4d548a0
helix/helix-lsp/src/client.rs
Lines 409 to 414 in 4d548a0
which should check whether the language server is initialized and send
exit
directly instead, if it isn't.Reproduction Steps
I tried this:
hx -vvvvv some_julia_file.jl
:q
as soon as the editor is up.It should be reproducible with any LS that takes a long time to initialize, the julia one without a sysimage is just "perfect" for this. Takes about 6 seconds to initialize.
Helix log
~/.cache/helix/helix.log
Platform
Linux tower 6.1.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Tue, 24 Jan 2023 21:07:04 +0000 x86_64 GNU/Linux
Terminal Emulator
foot version: 1.13.1 +pgo +ime +graphemes -assertions
Helix Version
helix 22.12
The text was updated successfully, but these errors were encountered: