Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

rls does not cope with non-numeric strings as request ids #360

Closed
Trolldemorted opened this issue Jun 20, 2017 · 6 comments · Fixed by #361
Closed

rls does not cope with non-numeric strings as request ids #360

Trolldemorted opened this issue Jun 20, 2017 · 6 comments · Fixed by #361

Comments

@Trolldemorted
Copy link
Contributor

According to the protocol, request ids may either be numbers or strings.

rls panics here because serde_json returns none if the value is a string.

@Trolldemorted Trolldemorted changed the title rls panics if request id is a strings rls panics if request id is a string Jun 20, 2017
@nrc
Copy link
Member

nrc commented Jun 20, 2017

Hmm, I thought we fixed this ages ago, but it must be my imagination - I can't even find another issue.

Trolldemorted added a commit to Trolldemorted/rls that referenced this issue Jun 20, 2017
@Trolldemorted
Copy link
Contributor Author

Maybe it was at some other place in the code?

Sent you a PR, appears to work fine (at least on W10).

Trolldemorted added a commit to Trolldemorted/rls that referenced this issue Jun 30, 2017
mitigates rust-lang#360 (for numeric strings)
@Xanewok
Copy link
Member

Xanewok commented Jul 4, 2017

This would probably by fixed when gluon-lang/lsp-types#19 and related serialization lands.

Trolldemorted added a commit to Trolldemorted/rls that referenced this issue Jul 4, 2017
@nrc nrc closed this as completed in #361 Jul 5, 2017
@Trolldemorted Trolldemorted changed the title rls panics if request id is a string rls does not cope with non-numeric strings as request ids Jul 5, 2017
@Trolldemorted
Copy link
Contributor Author

👍, lsp4j is now working with rls out-of-the-box!

However, sending a non-numeric string id to rls does not work (#361 (comment)).

@sophiajt
Copy link

sophiajt commented Jul 6, 2017

@Trolldemorted - I think this is expected? I thought the string vs number was so that numbers could be sent in either format, not that arbitrary strings would be accepted.

@Trolldemorted
Copy link
Contributor Author

The protocol does not say numeric strings, just number or strings. I think that it is very unlikely that someone sends foo as an id, but according to the protocol specification it would be ok.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants