Skip to content
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 should return id for unhandled requests #487

Closed
tgolsson opened this issue Apr 19, 2023 · 3 comments
Closed

Language server should return id for unhandled requests #487

tgolsson opened this issue Apr 19, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@tgolsson
Copy link
Contributor

This'd make it easier to handle failed requests as a client when using async. Right now it's hard to close the loop between a future waiting for a response with a log notification if it failed.

I can't find anything in the LSP specification (v3.17) that specifies whether one approach or another; I just think it'd be "easier". The JSON-RPC 2.0 spec does suggest it should be the following format:

rpc call of non-existent method:

--> {"jsonrpc": "2.0", "method": "foobar", "id": "1"}
<-- {"jsonrpc": "2.0", "error": {"code": -32601, "message": "Method not found"}, "id": "1"}
@udoprog udoprog added the enhancement New feature or request label Apr 20, 2023
@udoprog
Copy link
Collaborator

udoprog commented Apr 20, 2023

Out of curiosity, what would you be using this for in practice right now?

@tgolsson
Copy link
Contributor Author

Haha, fair question. I'm figured I need one more side project so I'm building my own emacsy editor where I want to eventually use Rune as a plugin language! And of course the best way to get to that point is to make sure Rune has a nice developer experience - so it's my test bed for building my own LSP client.

@tgolsson
Copy link
Contributor Author

This seems to work as expected; closing! Thanks again :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants