-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Allow both integer and string request IDs in LSP #7662
Allow both integer and string request IDs in LSP #7662
Conversation
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.
Thank you for separating it out of the Scala PR, this seems quite a fundamental change indeed to have it mixed with the other ones.
I'm curious to know how Scala LSP is supposed to react to our integer IDs sent and mixed with the string ones?
I expect no issues as long as those are unique and there's no overlap with the server ones (that we do not ensure anyway now, so seems tolerable), but is it true?
Metals works just fine with the integer IDs generated by Zed, it returns the integer back correctly. |
ee12d47
to
c3a7b73
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.
Beautiful, thank you for finally making us spec-compliant on that front.
I see an odd CI error and wondering if you could rebase on a fresh main
?
If that would not fix it, I'll just merge it since it seems unrelated, but let's be on a safe side.
Yes, here's the commit we want to pull into: #7803 |
e37bd92
to
50aeead
Compare
The LSP specification allows both integer and string: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage
Per specification, the ID is a 32bit integer. https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#integer
50aeead
to
48f1fdd
Compare
Rebased, and improved the commit messages while I've been at it. |
Zed's LSP support expects request messages to have integer ID, Metals LSP uses string. According to specification, both is acceptable:
interface RequestMessage extends Message {
...
This pull requests modifies the types and serialization/deserialization so that string IDs are accepted.