diff --git a/crates/ra_hir/src/diagnostics.rs b/crates/ra_hir/src/diagnostics.rs index dafacba70c3..6db499e0600 100644 --- a/crates/ra_hir/src/diagnostics.rs +++ b/crates/ra_hir/src/diagnostics.rs @@ -39,7 +39,12 @@ pub struct MissingFields { impl Diagnostic for MissingFields { fn message(&self) -> String { - "fill structure fields".to_string() + use std::fmt::Write; + let mut message = String::from("Missing structure fields:\n"); + for field in &self.missed_fields { + write!(message, "- {}\n", field).unwrap(); + } + message } fn source(&self) -> Source { 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 3209c66bd0e..98eb863cb90 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() { assert_snapshot!(diagnostics, @r###" "baz: 62": no such field - "{\n foo: 92,\n baz: 62,\n }": fill structure fields + "{\n foo: 92,\n baz: 62,\n }": Missing structure fields: + - bar "### ); }