diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-14 13:58:34 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-14 13:58:34 +0100 |
commit | ebb4d29d694f60f746a2b7b43980ba89cc9dc807 (patch) | |
tree | 152c05466cc8541efa920688ac4e2197cc6e96c1 /crates/ra_hir_ty/src | |
parent | 92c5036a7cf9dc32fccdf3c831af05b74550a3e1 (diff) | |
parent | abeb003df47de4a1b7aa36a7c4d7987d8cf40ace (diff) |
Merge #5371
5371: Allow multiline annotations r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty/src')
-rw-r--r-- | crates/ra_hir_ty/src/diagnostics.rs | 3 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/diagnostics/match_check.rs | 2 |
2 files changed, 3 insertions, 2 deletions
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) { | |||
261 | // FXIME: macros... | 261 | // FXIME: macros... |
262 | let file_id = d.source().file_id.original_file(&db); | 262 | let file_id = d.source().file_id.original_file(&db); |
263 | let range = d.syntax_node(&db).text_range(); | 263 | let range = d.syntax_node(&db).text_range(); |
264 | // FIXME: support multi-line messages in annotations | 264 | let message = d.message().to_owned(); |
265 | let message = d.message().lines().next().unwrap().to_owned(); | ||
266 | actual.entry(file_id).or_default().push((range, message)); | 265 | actual.entry(file_id).or_default().push((range, message)); |
267 | }); | 266 | }); |
268 | actual.values_mut().for_each(|diags| diags.sort_by_key(|it| it.0.start())); | 267 | 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() { | |||
1162 | match a { | 1162 | match a { |
1163 | Either::A { } => (), | 1163 | Either::A { } => (), |
1164 | //^^^ Missing structure fields: | 1164 | //^^^ Missing structure fields: |
1165 | // | - foo | ||
1165 | Either::B => (), | 1166 | Either::B => (), |
1166 | } | 1167 | } |
1167 | match a { | 1168 | match a { |
1168 | //^ Missing match arm | 1169 | //^ Missing match arm |
1169 | Either::A { } => (), | 1170 | Either::A { } => (), |
1170 | } //^^^ Missing structure fields: | 1171 | } //^^^ Missing structure fields: |
1172 | // | - foo | ||
1171 | 1173 | ||
1172 | match a { | 1174 | match a { |
1173 | Either::A { foo: true } => (), | 1175 | Either::A { foo: true } => (), |