Capture import params location for better errors

This commit is contained in:
Agus Zubiaga 2024-07-01 18:03:42 -03:00
parent f0fe0a3ea6
commit 90c7745989
No known key found for this signature in database
6 changed files with 24 additions and 16 deletions

View file

@ -252,14 +252,14 @@ impl<'a> Formattable for ModuleImportParams<'a> {
fn is_multiline(&self) -> bool {
let ModuleImportParams { before, params } = self;
!before.is_empty() || is_collection_multiline(params)
!before.is_empty() || is_collection_multiline(&params.value)
}
fn format_with_options(&self, buf: &mut Buf, _parens: Parens, newlines: Newlines, indent: u16) {
let ModuleImportParams { before, params } = self;
fmt_default_spaces(buf, before, indent);
fmt_collection(buf, indent, Braces::Curly, *params, newlines);
fmt_collection(buf, indent, Braces::Curly, params.value, newlines);
}
}