mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Show missing struct fields in the error message
This commit is contained in:
parent
ac9ba5eb32
commit
66f04e6be5
2 changed files with 8 additions and 2 deletions
|
@ -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<SyntaxNodePtr> {
|
||||
Source { file_id: self.file, value: self.field_list.into() }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue