From abeb003df47de4a1b7aa36a7c4d7987d8cf40ace Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 14 Jul 2020 14:57:33 +0200 Subject: Allow multiline annotations --- crates/ra_hir_ty/src/diagnostics.rs | 3 +-- crates/ra_hir_ty/src/diagnostics/match_check.rs | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir_ty/src') diff --git a/crates/ra_hir_ty/src/diagnostics.rs b/crates/ra_hir_ty/src/diagnostics.rs index 3016ca3bd..3870c6d9c 100644 --- a/crates/ra_hir_ty/src/diagnostics.rs +++ b/crates/ra_hir_ty/src/diagnostics.rs @@ -261,8 +261,7 @@ fn check_diagnostics(ra_fixture: &str) { // FXIME: macros... let file_id = d.source().file_id.original_file(&db); let range = d.syntax_node(&db).text_range(); - // FIXME: support multi-line messages in annotations - let message = d.message().lines().next().unwrap().to_owned(); + let message = d.message().to_owned(); actual.entry(file_id).or_default().push((range, message)); }); actual.values_mut().for_each(|diags| diags.sort_by_key(|it| it.0.start())); diff --git a/crates/ra_hir_ty/src/diagnostics/match_check.rs b/crates/ra_hir_ty/src/diagnostics/match_check.rs index ba48b51b5..95f272811 100644 --- a/crates/ra_hir_ty/src/diagnostics/match_check.rs +++ b/crates/ra_hir_ty/src/diagnostics/match_check.rs @@ -1162,12 +1162,14 @@ fn main() { match a { Either::A { } => (), //^^^ Missing structure fields: + // | - foo Either::B => (), } match a { //^ Missing match arm Either::A { } => (), } //^^^ Missing structure fields: + // | - foo match a { Either::A { foo: true } => (), -- cgit v1.2.3