Filter out empty rustc spans
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user