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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of textDocument/diagnostic #12664

Merged
merged 1 commit into from Apr 24, 2024
Merged

Fix handling of textDocument/diagnostic #12664

merged 1 commit into from Apr 24, 2024

Conversation

muxcmux
Copy link
Contributor

@muxcmux muxcmux commented Jan 31, 2024

The textDocument parameter for the textDocument/diagnostic request is of type TextDocumentIdentifier, which has a single property uri of type DocumentUri.

Ref: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_diagnostic

According to the spec the DocumentUri type does not hold the contents of the document, which the handler currently relies on in order to publish diagnostics to the client.

This breaks the LSP mode in Neovim 0.10, which now supports pull diagnostics, and possibly other editors too. The same problem exists in standardrb (standardrb/standard#575)

I have made the textDocument/diagnostic hander a no-op, since diagnostics are already being pushed to clients on textDocument/didChange.

Let me know if you want to merge this in, and I'll add a changelog entry 馃憤

  • Add changelog entry

@koic
Copy link
Member

koic commented Feb 2, 2024

Thank you for opening this PR. Whether to merge or not will be determined based on the verification of standardrb/standard#601, but for now, please add a changelog entry file and squash the commits into one.

The `textDocument` parameter for the `textDocument/diagnostic` request
is of type `TextDocumentIdentifier`, which has a single property `uri`
of type `DocumentUri`.

Ref: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_diagnostic

According to the spec the `DocumentUri` type does not hold the contents
of the document, which the handler currently relies on in order to
publish diagnostics to the client.

This breaks the LSP mode in Neovim 0.10, which now supports pull
diagnostics, and possibly other editors too. The same problem exists in
`standardrb` (standardrb/standard#575)

I have made the `textDocument/diagnostic` hander a no-op, since
diagnostics are already being pushed to clients on
`textDocument/didChange`.
@muxcmux
Copy link
Contributor Author

muxcmux commented Feb 2, 2024

Cheers mate, I've added a changelog entry.

@koic koic merged commit 84877a3 into rubocop:master Apr 24, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants