LSP: Send replies for malformed and unhandled RPC requests - #6058
Conversation
Previously we did not respond to malformed or unhandled LSP requests. The JSONRPC spec says that all non-notification requests must have responses: > When a rpc call is made, the Server MUST reply with a Response, > except for in the case of Notifications (Note that Helix is the "Server" in this case. Also from the spec: "The Server is defined as the origin of Response objects and the handler of Request objects.") So this change sends error replies for requests which can't be parsed or handled. Request IDs are also now added to the log messages for unhandled requests.
83e554b to
fdc7774
Compare
pascalkuthe
left a comment
There was a problem hiding this comment.
Even tough this turned out to be solvable upstream after all it's still good to adhere to the spec here and avoid accidently locking up servers 👍 LGTM
|
This change is still needed separately from the change upstream: pyright will lock up if we don't respond to the The first |
Ah right I rember now pyright was sending two separate invalid requests. One for dynamic registration and an invalid condiguration request. Sorry I had mixed those two up just now! |
…tor#6058) Previously we did not respond to malformed or unhandled LSP requests. The JSONRPC spec says that all non-notification requests must have responses: > When a rpc call is made, the Server MUST reply with a Response, > except for in the case of Notifications (Note that Helix is the "Server" in this case. Also from the spec: "The Server is defined as the origin of Response objects and the handler of Request objects.") So this change sends error replies for requests which can't be parsed or handled. Request IDs are also now added to the log messages for unhandled requests.
…tor#6058) Previously we did not respond to malformed or unhandled LSP requests. The JSONRPC spec says that all non-notification requests must have responses: > When a rpc call is made, the Server MUST reply with a Response, > except for in the case of Notifications (Note that Helix is the "Server" in this case. Also from the spec: "The Server is defined as the origin of Response objects and the handler of Request objects.") So this change sends error replies for requests which can't be parsed or handled. Request IDs are also now added to the log messages for unhandled requests.
Previously we did not respond to malformed or unhandled LSP requests. The JSONRPC spec says that all non-notification requests must have responses:
(Note that Helix is the "Server" in this case. Also from the spec: "The Server is defined as the origin of Response objects and the handler of Request objects.")
So this change sends error replies for requests which can't be parsed or handled. Request IDs are also now added to the log messages for unhandled requests.
Fixes #5958