Skip to content

Commit ee8d7a7

Browse files
Filter out empty rustc spans
1 parent 9bb9fba commit ee8d7a7

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)