Skip to content

Commit 0452525

Browse files
Merge #6978
6978: Filter out empty rustc spans r=lnicola a=jonas-schievink Hopefully, this fixes #6892 (I couldn't test it since r-a currently requires a too recent version of VS Code) Co-authored-by: Jonas Schievink <[email protected]>
2 parents ab343e4 + ee8d7a7 commit 0452525

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/rust-analyzer/src/diagnostics/to_proto.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,10 @@ pub(crate) fn map_rust_diagnostic_to_lsp(
319319
message: "original diagnostic".to_string(),
320320
};
321321
for info in &related_information {
322+
// Filter out empty/non-existent messages, as they greatly confuse VS Code.
323+
if info.message.is_empty() {
324+
continue;
325+
}
322326
diagnostics.push(MappedRustDiagnostic {
323327
url: info.location.uri.clone(),
324328
fixes: fixes.clone(), // share fixes to make them easier to apply

0 commit comments

Comments
 (0)