-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
Documentation on LanguageClient lifecycle #48309
Comments
(Experimental duplicate detection) |
@nrc agree that there is not a lot of documentation for the client itself except the source code and some examples here: https://github.com/Microsoft/vscode-extension-samples Regarding your questions: you need to call stop in the |
Thanks @dbaeumer, it sounds like there are not lifecycle things that I am missing and that there might be a bug in the client. I filed microsoft/vscode-languageserver-node#342 |
I've been looking for documentation on
LanguageClient
, but can't find any either in the source or online (there's lots of information on the language server, but not so much about usingLanguageClient
in the extension. In particular I'm looking for documentation on when/if I should be callingstop
or other lifecycle functions.My motivation here is to properly handle the language server restarting. I run the extension which starts the language server (the Rust Language Server). If I then kill the language server process, then the language server is restarted. However, I'm not clear what happens to the language client or the extension itself - I don't know if there hooks where I'm meant to handle stopping the client.
What happens is that the new language server gets two of every message, so it seems like there are now two clients sending messages to the same server (and if I keep killing the language server, I get n+1 messages after n restarts). I assume this is because I'm not handling something in the extension, but it could be a bug in VSCode itself.
The text was updated successfully, but these errors were encountered: