-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
A-diagnosticsdiagnostics / error reportingdiagnostics / error reportingA-lspLSP conformance issues and missing featuresLSP conformance issues and missing featuresC-bugCategory: bugCategory: bug
Description
- rust-analyzer
publishDiagnosticsafter open rust file, containing the warning/hint level diagnostics - switch windows in editor, then the client requests
textDocument/diagnosticfor the same file, rust-analyzer returns empty diagnostics
Server trace logs, same logs with VSCode+rust-analzyer too, more logs fannheyward/coc-rust-analyzer#1276 (comment)
[Trace - 14:56:20] Received notification 'textDocument/publishDiagnostics'.
Params: {
"uri": "file:///Users/fannheyward/src/hello-rust/src/main.rs",
"diagnostics": [
{
"range": {...},
"severity": 2,
"code": "unused_imports",
"source": "rustc",
"message": "unused import: `std::env`\n`#[warn(unused_imports)]` on by default",
"relatedInformation": [...],
"tags": [1],
"data": {...}
},
{
"range": {...}
},
"severity": 4,
"code": "unused_imports",
"source": "rustc",
"message": "remove the whole `use` item",
"relatedInformation": [...]
}
],
"version": 1
}
...
[Trace - 14:57:31] Sending request 'textDocument/diagnostic - (18)'.
Params: {
"textDocument": {
"uri": "file:///Users/fannheyward/src/hello-rust/src/main.rs"
}
}
[Trace - 14:57:31] Received response 'textDocument/diagnostic - (18)' in 2ms.
Result: {
"kind": "full",
"items": []
}
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:
use std::env;
fn main() {
println!("Hello, world!");
}ajwerner, kschat, geeker-smallwhite and predragnikolic
Metadata
Metadata
Assignees
Labels
A-diagnosticsdiagnostics / error reportingdiagnostics / error reportingA-lspLSP conformance issues and missing featuresLSP conformance issues and missing featuresC-bugCategory: bugCategory: bug