diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-12-21 15:16:16 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-21 15:16:16 +0000 |
commit | 04525253a06e0c598fcd91c871bf4f19de6394b7 (patch) | |
tree | cce815b0346259ee8e06fdeabc6b349c78027ef9 /crates | |
parent | ab343e47c6007bd37f192ddcc4a2b5dc46ed3341 (diff) | |
parent | ee8d7a71237888eeddf00b69c46d1fd6db9028df (diff) |
Merge #6978
6978: Filter out empty rustc spans r=lnicola a=jonas-schievink
Hopefully, this fixes https://github.com/rust-analyzer/rust-analyzer/issues/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]>
Diffstat (limited to 'crates')
-rw-r--r-- | crates/rust-analyzer/src/diagnostics/to_proto.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/rust-analyzer/src/diagnostics/to_proto.rs b/crates/rust-analyzer/src/diagnostics/to_proto.rs index f16f97131..540759198 100644 --- a/crates/rust-analyzer/src/diagnostics/to_proto.rs +++ b/crates/rust-analyzer/src/diagnostics/to_proto.rs | |||
@@ -319,6 +319,10 @@ pub(crate) fn map_rust_diagnostic_to_lsp( | |||
319 | message: "original diagnostic".to_string(), | 319 | message: "original diagnostic".to_string(), |
320 | }; | 320 | }; |
321 | for info in &related_information { | 321 | 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 | } | ||
322 | diagnostics.push(MappedRustDiagnostic { | 326 | diagnostics.push(MappedRustDiagnostic { |
323 | url: info.location.uri.clone(), | 327 | url: info.location.uri.clone(), |
324 | fixes: fixes.clone(), // share fixes to make them easier to apply | 328 | fixes: fixes.clone(), // share fixes to make them easier to apply |