Skip to content
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

Kill LSP gracefully #3482

Closed
dead10ck opened this issue Aug 19, 2022 · 4 comments
Closed

Kill LSP gracefully #3482

dead10ck opened this issue Aug 19, 2022 · 4 comments
Labels
A-language-server Area: Language server client C-enhancement Category: Improvements

Comments

@dead10ck
Copy link
Member

dead10ck commented Aug 19, 2022

https://github.com/helix-editor/helix/blob/master/helix-lsp/src/client.rs#L62

It seems kill_on_drop sends a SIGKILL which is kind of aggressive, and could cause corruption. It's occurring to me that this may be why rust-analyzer has to reindex everything every time it runs. It also looks like there isn't a way to send a SIGTERM through the built-in tokio API. It looks like we'd have to add platform-specific code to handle this properly.

Originally posted by @dead10ck in #3435 (comment)

@the-mikedavis the-mikedavis added C-enhancement Category: Improvements A-language-server Area: Language server client labels Aug 19, 2022
@mangas
Copy link
Contributor

mangas commented Aug 19, 2022

https://docs.rs/nix/latest/nix/ may have some useful stuff for this

@pascalkuthe
Copy link
Member

Pretty sure this is fixed now wooth us giving lsps a ti.eout to close before force closing them

@dead10ck
Copy link
Member Author

dead10ck commented Apr 7, 2024

Are LS's supposed to terminate themselves? Or is it common to have to send them a SIGTERM?

@pascalkuthe
Copy link
Member

There is a multiphase shutdown but in the end they are supposed to do it kn their own https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#exit

I think we have a timeout that waits for them to shutdown if they don't we kill

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-server Area: Language server client C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

4 participants