mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Filter out empty rustc spans
This commit is contained in:
parent
9bb9fbab3a
commit
ee8d7a7123
1 changed files with 4 additions and 0 deletions
|
@ -319,6 +319,10 @@ pub(crate) fn map_rust_diagnostic_to_lsp(
|
||||||
message: "original diagnostic".to_string(),
|
message: "original diagnostic".to_string(),
|
||||||
};
|
};
|
||||||
for info in &related_information {
|
for info in &related_information {
|
||||||
|
// Filter out empty/non-existent messages, as they greatly confuse VS Code.
|
||||||
|
if info.message.is_empty() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
diagnostics.push(MappedRustDiagnostic {
|
diagnostics.push(MappedRustDiagnostic {
|
||||||
url: info.location.uri.clone(),
|
url: info.location.uri.clone(),
|
||||||
fixes: fixes.clone(), // share fixes to make them easier to apply
|
fixes: fixes.clone(), // share fixes to make them easier to apply
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue