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

Remove incorrect textDocument/diagnostic request handler #601

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

muxcmux
Copy link
Contributor

@muxcmux muxcmux commented Jan 30, 2024

The parameters for this request only include a textDocument, which is a TextDocumentIdentifier, an identifier? and a previousResultId?. The TextDocumentIdentifer only has a uri property, which is of type DocumentUri.

According to the LSP spec:

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

this request does not include the contents of the file (which is what the handler was expecting).

I have simply made the handling of this request a no-op, since diagnostics are already sent to the client in textDocument/didChange.

Note: This also fixes formatting problems related to Neovim 0.10 described in #575

The parameters for this request only include a textDocument, which is a
TextDocumentIdentifier, an identifier? and a previousResultId?. The
TextDocumentIdentifer only has a uri property, which is of type
DocumentUri.

According to the LSP spec:

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

this request does not include the contents of the file (which is what
the handler was expecting).

I have simply made the handling of this request a no-op, since
diagnostics are already sent to the client in textDocument/didChange.

Note: This also fixes formatting problems related to Neovim 0.10
described in standardrb#575
@searls
Copy link
Contributor

searls commented Jan 30, 2024

Thanks for submitting this. Since VS Code in particular feels pretty black-box with respect to what it expects (and what it will reject) from an LSP server, I'd be reticent for this to be merged before someone first tested it against https://github.com/standardrb/vscode-standard-ruby

@muxcmux
Copy link
Contributor Author

muxcmux commented Jan 30, 2024

I don't follow. This has nothing to do with vscode.

The handling of textDocument/diagnostic is not correct because the parameters do not include the document text - it's literally in the specs.

@searls
Copy link
Contributor

searls commented Jan 31, 2024

Because I assumed (and just confirmed) this method was added because VS Code was spewing errors without it.

@muxcmux
Copy link
Contributor Author

muxcmux commented Jan 31, 2024

I see. That method is still there though, I only made it a no-op. No errors in vscode as far as I can tell (fresh install of vscode, standardrb running with my patch):

Screen.Recording.2024-01-31.at.09.38.51.mp4

... but I don't use vscode, so might not be a reliable test.

@searls
Copy link
Contributor

searls commented Apr 24, 2024

Gonna take @muxcmux word for it here. We can always revert if we cut a release and this doesn't work. Sorry for taking months to get around to this

@searls searls merged commit 9917773 into standardrb:main Apr 24, 2024
5 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.

3 participants