-
Notifications
You must be signed in to change notification settings - Fork 842
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
Disallow JSON-RPC batch messages #1651
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dbaeumer
requested changes
Jan 26, 2023
JSON-RPC 2.0 has a feature called "batch" where multiple requests and notifications can be grouped together into one message. As an LSP server author, I have never seen an LSP client send these batch messages. I suspect that most LSP clients do not support receiving batch messages either, but I have not tried. The TypeScript type definitions in the LSP do not mention batch messages either. Furthermore, disallowing batch messages has a few benefits: * improves compatibility between servers and clients * reduces the risk of LSP servers triggering bugs (including security bugs) in LSP clients, and vice versa * reduces development time for conforming LSP servers and clients Make the LSP match the status quo: Explicitly state in the language server protocol specification that batch messages are not allowed.
dbaeumer
approved these changes
Jan 27, 2023
aeschli
approved these changes
Jan 27, 2023
strager
added a commit
to quick-lint/quick-lint-js
that referenced
this pull request
Jan 27, 2023
The Language Server Protocol dropped support for JSON-RPC 2.0 batch messages: microsoft/language-server-protocol#1651 Such messages were poorly supported by LSP clients anyway, so quick-lint-js only accepted batched messages, never sent batch messages. Drop support for batch messages entirely. This will let us simplify the design of our LSP code in the future. BREAKING CHANGE: LSP clients which send batched requests and notifications will now receive a parse error from quick-lint-js' LSP server (code -32700).
strager
added a commit
to quick-lint/quick-lint-js
that referenced
this pull request
Jan 27, 2023
The Language Server Protocol dropped support for JSON-RPC 2.0 batch messages: microsoft/language-server-protocol#1651 Such messages were poorly supported by LSP clients anyway, so quick-lint-js only accepted batched messages, never sent batch messages. Drop support for batch messages entirely. This will let us simplify the design of our LSP code in the future. BREAKING CHANGE: LSP clients which send batched requests and notifications will now receive a parse error from quick-lint-js' LSP server (code -32700).
strager
added a commit
to quick-lint/quick-lint-js
that referenced
this pull request
Jan 27, 2023
The Language Server Protocol dropped support for JSON-RPC 2.0 batch messages: microsoft/language-server-protocol#1651 Such messages were poorly supported by LSP clients anyway, so quick-lint-js only accepted batched messages, never sent batch messages. Drop support for batch messages entirely. This will let us simplify the design of our LSP code in the future. BREAKING CHANGE: LSP clients which send batched requests and notifications will now receive a parse error from quick-lint-js' LSP server (code -32700).
strager
added a commit
to quick-lint/quick-lint-js
that referenced
this pull request
Jan 27, 2023
The Language Server Protocol dropped support for JSON-RPC 2.0 batch messages: microsoft/language-server-protocol#1651 Such messages were poorly supported by LSP clients anyway, so quick-lint-js only accepted batched messages, never sent batch messages. Drop support for batch messages entirely. This will let us simplify the design of our LSP code in the future. BREAKING CHANGE: LSP clients which send batched requests and notifications will now receive a parse error from quick-lint-js' LSP server (code -32700).
strager
added a commit
to quick-lint/quick-lint-js
that referenced
this pull request
Jan 27, 2023
The Language Server Protocol dropped support for JSON-RPC 2.0 batch messages: microsoft/language-server-protocol#1651 Such messages were poorly supported by LSP clients anyway, so quick-lint-js only accepted batched messages, never sent batch messages. Drop support for batch messages entirely. This will let us simplify the design of our LSP code in the future. BREAKING CHANGE: LSP clients which send batched requests and notifications will now receive a parse error from quick-lint-js' LSP server (code -32700).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
JSON-RPC 2.0 has a feature called "batch" where multiple requests and notifications can be grouped together into one message.
As an LSP server author, I have never seen an LSP client send these batch messages. I suspect that most LSP clients do not support receiving batch messages either, but I have not tried. The TypeScript type definitions in the LSP do not mention batch messages either.
Furthermore, disallowing batch messages has a few benefits:
Make the LSP match the status quo: Explicitly state in the language server protocol specification that batch messages are not allowed.