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

Avoid strict unmarshaling of responses #118

Closed
radeksimko opened this issue May 26, 2020 · 2 comments · Fixed by #309
Closed

Avoid strict unmarshaling of responses #118

radeksimko opened this issue May 26, 2020 · 2 comments · Fixed by #309
Labels
enhancement New feature or request
Milestone

Comments

@radeksimko
Copy link
Member

Current Version

0.2.1

Context

As mentioned in #117 go-lsp currently provides us structs which represent requests/responses, but regardless of what library we use, it will inevitably be behind at some point.

Even if the library stays on top of spec changes, there's the long tail of:

a) language servers actually updating in time, and
b) end-users of these LS updating in time

Generally the problem is that clients will move at a different pace to servers and neither side has any way of controlling that pace, because the protocol doesn't do any version negotiation.

Attempted Solutions

The upstream jrpc2 library implements strict JSON unmarshaling, which motivated sourcegraph/go-lsp#8 to implement "loose" unmarshaling, which came with a flaw related to unmarshalers in embedded structs.

Proposal

Turn off the strict mode in jrpc2. This will require reopening creachadair/jrpc2#5 in some form or shape.

@radeksimko radeksimko added the enhancement New feature or request label May 26, 2020
@radeksimko
Copy link
Member Author

This was resolved as part of creachadair/jrpc2#32 - unknown fields are now ignored by default, which is also the default behaviour of the native Go JSON decoder, we can upgrade to the latest version.

@ghost
Copy link

ghost commented Dec 18, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the context necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant