-
Notifications
You must be signed in to change notification settings - Fork 663
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
Language Server Shutdown message throws exception #5997
Comments
Hey @tm1000, can you reproduce the issue on https://psalm.dev ? |
@tm1000 does your client also send |
@weirdan if I send exit then yes the server exits. The issue is that when sending shutdown there are only two responses that should be sent according to the language sever protocol (the same one you linked). That being either a null or an error. I get an error thrown then immediately analyzing messages. This means the shutdown command was not executed because of an error. In the case of my IDE (vscode) it will never send exit because shutdown returned an error followed by analyzing messages. Hence shutdown is broken. I haven't tried yet but I believe shutdown needs to return the new Success(null) response at the end of the method instead of returning null to the yield. Additionally I can cause this crash/error by sending any invalid message to the language server. I believe to fix this you just need to see if the response from dispatch is a null. If it's a null then return null instead of yielding null |
Can you provide steps to follow to reproduce the issue? |
@weirdan Sure. I'm also going to work up a PR for this as well |
Fab, thanks! |
@weirdan I tested #6007 and it successfully fixes the issues.. Additionally I work on https://github.com/psalm/psalm-vscode-plugin thanks to @muglug |
I had to do some Psalm related cleanup so I reissues the PR with cleaner commits. |
Fixes #5997 by intentionally sending Success responses from shutdown method
Additionally the language server does not shutdown but continues to run in a broken state
Message:
Response
Since the error is caught the server does not shutdown
The text was updated successfully, but these errors were encountered: