-
Notifications
You must be signed in to change notification settings - Fork 325
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
client.needsStop() and client.stop() disagree on whether it's valid to call stop() #1559
Comments
How do you start the server and which transport are you using? Looking through the code I think we need to allow clients to pass in a terminate function into the client#restart() method in case it is not a process started by the client itself. |
See also #725 (comment) |
I didn't realise there was a |
Side note: have you checked that calling |
They're just functions, so I'm not sure why they wouldn't (I just call them directly). I implemented this many years ago and it hasn't had any issues (except some edge cases for LSP noted here and #725).. It was the simplest way to ensure when something fundamental (like the SDK path) changes, we dispose everything old and create new versions without just implementing our own parallel version of disposing and recreating everything. |
I think I'm running into something similar with the F# Ionide plugin. When attempting to restart, I'm getting the error. |
I'm trying to fix some issues with the LSP client showing errors when I try to dispose it. One issue is that I'm getting errors like this:
The problem is that calling
stop()
is invalid when the state isstopping
, however my code looks like this:The implementation of needsStop is:
vscode-languageserver-node/client/src/common/client.ts
Lines 1228 to 1230 in f58f4df
So
needsStop
says that stop is required if the state isstarting
, but callingstop()
throws. It's not clear to me what the correct way of shutting down the server cleanly is.The text was updated successfully, but these errors were encountered: