Track spaces between : and <- in record builders

This commit is contained in:
Agustin Zubiaga 2023-05-17 11:49:06 -03:00
parent 23db4a5e87
commit d1feb00170
No known key found for this signature in database
7 changed files with 56 additions and 29 deletions

View file

@ -1541,19 +1541,28 @@ fn format_record_builder_field_multiline(
ann.value.format(buf, indent);
buf.push(',');
}
ApplyValue(name, spaces, ann) => {
ApplyValue(name, colon_spaces, arrow_spaces, ann) => {
buf.newline();
buf.indent(indent);
buf.push_str(name.value);
if !spaces.is_empty() {
fmt_spaces(buf, spaces.iter(), indent);
if !colon_spaces.is_empty() {
fmt_spaces(buf, colon_spaces.iter(), indent);
buf.indent(indent);
}
buf.push_str(separator_prefix);
buf.push_str(": <-");
buf.push(':');
buf.spaces(1);
if !arrow_spaces.is_empty() {
fmt_spaces(buf, arrow_spaces.iter(), indent);
buf.indent(indent);
}
buf.push_str("<-");
buf.spaces(1);
ann.value.format(buf, indent);
buf.push(',');
}