-
Notifications
You must be signed in to change notification settings - Fork 1.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
rust-analyzer didn't return warning/hint diagnostics on textDocument/diagnostic
#18709
Comments
We use cc @rchl @jwortmann tagging you because of your comments in #18404 (I forgot about this sorry) |
This problem is not that RA is us ing push and pull mode at same time, but: RA can publish diagnostics at pushing mode, but no diagnostics at pulling mode. |
From the tracking logs in VSCode, |
We use the push mode for cargo diagnostics where as pull only pull rust-analyzer native ones. So as currently implemented in r-a there is no overlap between the two (pull diagnostics will never list cargo check ones, push diagnostics will never list rust-analyzer native ones). So clients (except for VSCode for some reason?) will naturally replace push results for a document with the pull results for the given document (as we don't even populate the result-id #18717 fixes that part so there is no distinguishing to be done either way). I personally do think using both pull and push is valid, but the spec leaves that (+ how to handle such a case) completely unspecified. |
See my previous comment, VSCode also pulls empty result, just that it didn't replace/update the PROBLEMS list. |
It is correct that the pull there is empty, because the pull only pulls rust-analyzer native diagnostics (the ones we compute), so they do not include the diagnostic computed by us via cargo check (triggered when you save a file). It is intentional by our implementation that pull and push diagnostics do not yield the same set of diagnostics for a document. |
I see, thank you for the clarification. Maybe I can make an improvement in the client side for the both modes. |
publishDiagnostics
after open rust file, containing the warning/hint level diagnosticstextDocument/diagnostic
for the same file, rust-analyzer returns empty diagnosticsServer trace logs, same logs with VSCode+rust-analzyer too, more logs fannheyward/coc-rust-analyzer#1276 (comment)
rust-analyzer version: rust-analyzer 0.0.0 (27e824f 2024-12-15)
rustc version: rustc 1.83.0 (90b35a623 2024-11-26)
editor or extension: nvim + coc.nvim
code snippet to reproduce:
The text was updated successfully, but these errors were encountered: