Filter out empty rustc spans

This commit is contained in:
Jonas Schievink 2020-12-21 15:38:27 +01:00
parent 9bb9fbab3a
commit ee8d7a7123

View File

@ -319,6 +319,10 @@ pub(crate) fn map_rust_diagnostic_to_lsp(
message: "original diagnostic".to_string(),
};
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 {
url: info.location.uri.clone(),
fixes: fixes.clone(), // share fixes to make them easier to apply