-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
LSP: Send replies for malformed and unhandled RPC requests #6058
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
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.
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