Fix formatting in the presence of a package name in TypeAnnotation::Apply

This commit is contained in:
Joshua Warner 2021-11-26 11:03:01 -08:00
parent 2939780638
commit 08e8b93bb6

View file

@ -277,7 +277,7 @@ impl<'a> Formattable<'a> for TypeAnnotation<'a> {
buf.push(')')
}
}
Apply(_, name, arguments) => {
Apply(pkg, name, arguments) => {
// NOTE apply is never multiline
let write_parens = parens == Parens::InApply && !arguments.is_empty();
@ -285,6 +285,11 @@ impl<'a> Formattable<'a> for TypeAnnotation<'a> {
buf.push('(')
}
if !pkg.is_empty() {
buf.push_str(pkg);
buf.push('.');
}
buf.push_str(name);
for argument in *arguments {