format as aliases with parens

This commit is contained in:
Folkert 2022-01-23 21:45:06 +01:00
parent cbdf3f0378
commit eb08c12099

View file

@ -263,8 +263,9 @@ impl<'a> Formattable for TypeAnnotation<'a> {
}
As(lhs, _spaces, AliasHeader { name, vars }) => {
// TODO use spaces?
lhs.value.format(buf, indent);
// TODO use _spaces?
lhs.value
.format_with_options(buf, Parens::InFunctionType, Newlines::No, indent);
buf.spaces(1);
buf.push_str("as");
buf.spaces(1);