diff options
-rw-r--r-- | crates/ra_hir/src/diagnostics.rs | 7 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/crates/ra_hir/src/diagnostics.rs b/crates/ra_hir/src/diagnostics.rs index dafacba70..6db499e06 100644 --- a/crates/ra_hir/src/diagnostics.rs +++ b/crates/ra_hir/src/diagnostics.rs | |||
@@ -39,7 +39,12 @@ pub struct MissingFields { | |||
39 | 39 | ||
40 | impl Diagnostic for MissingFields { | 40 | impl Diagnostic for MissingFields { |
41 | fn message(&self) -> String { | 41 | fn message(&self) -> String { |
42 | "fill structure fields".to_string() | 42 | use std::fmt::Write; |
43 | let mut message = String::from("Missing structure fields:\n"); | ||
44 | for field in &self.missed_fields { | ||
45 | write!(message, "- {}\n", field).unwrap(); | ||
46 | } | ||
47 | message | ||
43 | } | 48 | } |
44 | fn source(&self) -> Source<SyntaxNodePtr> { | 49 | fn source(&self) -> Source<SyntaxNodePtr> { |
45 | Source { file_id: self.file, value: self.field_list.into() } | 50 | Source { file_id: self.file, value: self.field_list.into() } |
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 3209c66bd..98eb863cb 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -4832,7 +4832,8 @@ fn no_such_field_diagnostics() { | |||
4832 | 4832 | ||
4833 | assert_snapshot!(diagnostics, @r###" | 4833 | assert_snapshot!(diagnostics, @r###" |
4834 | "baz: 62": no such field | 4834 | "baz: 62": no such field |
4835 | "{\n foo: 92,\n baz: 62,\n }": fill structure fields | 4835 | "{\n foo: 92,\n baz: 62,\n }": Missing structure fields: |
4836 | - bar | ||
4836 | "### | 4837 | "### |
4837 | ); | 4838 | ); |
4838 | } | 4839 | } |