format properly multiline type annotations

This commit is contained in:
Sébastien Besnier 2020-11-25 15:15:32 +01:00
parent 4ed8d3eb79
commit 7361f62902
3 changed files with 50 additions and 10 deletions

View file

@ -36,7 +36,11 @@ impl<'a> Formattable<'a> for Def<'a> {
match self {
Annotation(loc_pattern, loc_annotation) => {
loc_pattern.format(buf, indent);
buf.push_str(" : ");
if loc_annotation.is_multiline() {
buf.push_str(" :");
} else {
buf.push_str(" : ");
}
loc_annotation.format(buf, indent);
}
Alias { name, vars, ann } => {