This repository has been archived by the owner on Aug 5, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've started experimenting with LSP (I'm new to using and interacting with language servers) and ran into some difficulties understanding the errors. I tried launching the example with
cargo run --example goto_def
and just copy-pasted some jsonrpc messages and it didn't work out. Here's how an interaction like this might look on master:After doing some digging I can see that the
RecvError
should have some more information, but the way that it's being printed doesn't show me a lot of it. Here's how the same interaction is rendered in this branch:So now I can at least guess that the problem doesn't have to do with parsing, but with the way the input is sent, and it would have to be the first thing to fix (like piping the commands by using a file).
I think this is an improvement, but there might be different ways to make it better -- let me know. I'd also consider using
unreachable!
in cases where aMessage::Request
is expected, but aMessage::Response
is given, for example.