-
Notifications
You must be signed in to change notification settings - Fork 326
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
Fixing shutdown routine #53
Conversation
It grows very tiring to manually update extension.js on every new commit.
@@ -282,7 +282,8 @@ class ScalametaLanguageServer( | |||
} catch { | |||
case NonFatal(e) => | |||
onError(e) | |||
ShutdownResult(-1) | |||
// FIXME: server shouldn't send shutdown response if there was no shutdown request | |||
ShutdownResult() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@olafurpg I think something wrong is happening here. Server shouldn't send a shutdown response on completion request failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol, no idea how that got there. feel free to remove the whole try/catch, errors get caught and logged on request now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in f3d9342 (+ same in documentFormattingRequest
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 Thanks for fixing this, it's been annoying to see that shutdown crash on every close
Oh no... 😭 CI release is broken again. Didn't trigger on merge.
|
Fixes #30
The problem is in the scala-json-rpc way of handling commands (requests) and notifications. It doesn't allow them to have an empty or absent
params
key:https://github.com/dhpcs/scala-json-rpc/blob/c25cda4b6a39441bbe4ce25f57ab88e3db5ef635/scala-json-rpc/src/main/scala/com/dhpcs/jsonrpc/MessageCompanions.scala#L66-L71
While the LSP spec for
shutdown
says explicitly:Same about
shutdown
response andexit
notification. These are the only messages in LSP that don't have parameters, so I'm adding a specialread
override to handle these messages.