mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-03 06:02:54 +00:00
Ensure we indent before writing implements keyword
This commit is contained in:
parent
d9ad34592c
commit
2f420d8e4e
5 changed files with 68 additions and 0 deletions
|
|
@ -496,6 +496,7 @@ impl<'a> Formattable for TypeDef<'a> {
|
||||||
} => {
|
} => {
|
||||||
header.format_with_options(buf, Parens::NotNeeded, Newlines::No, indent);
|
header.format_with_options(buf, Parens::NotNeeded, Newlines::No, indent);
|
||||||
buf.spaces(1);
|
buf.spaces(1);
|
||||||
|
buf.indent(indent + INDENT);
|
||||||
buf.push_str(roc_parse::keyword::IMPLEMENTS);
|
buf.push_str(roc_parse::keyword::IMPLEMENTS);
|
||||||
buf.spaces(1);
|
buf.spaces(1);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
C
|
||||||
|
4 #
|
||||||
|
implements e : m
|
||||||
|
C
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
@0-22 SpaceAfter(
|
||||||
|
Defs(
|
||||||
|
Defs {
|
||||||
|
tags: [
|
||||||
|
EitherIndex(0),
|
||||||
|
],
|
||||||
|
regions: [
|
||||||
|
@0-20,
|
||||||
|
],
|
||||||
|
space_before: [
|
||||||
|
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||||
|
],
|
||||||
|
space_after: [
|
||||||
|
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||||
|
],
|
||||||
|
spaces: [],
|
||||||
|
type_defs: [
|
||||||
|
Ability {
|
||||||
|
header: TypeHeader {
|
||||||
|
name: @0-1 "C",
|
||||||
|
vars: [
|
||||||
|
@2-3 SpaceAfter(
|
||||||
|
NumLiteral(
|
||||||
|
"4",
|
||||||
|
),
|
||||||
|
[
|
||||||
|
LineComment(
|
||||||
|
"",
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
loc_implements: @6-16 Implements,
|
||||||
|
members: [
|
||||||
|
AbilityMember {
|
||||||
|
name: @17-18 "e",
|
||||||
|
typ: @19-20 BoundVariable(
|
||||||
|
"m",
|
||||||
|
),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
value_defs: [],
|
||||||
|
},
|
||||||
|
@21-22 SpaceBefore(
|
||||||
|
Tag(
|
||||||
|
"C",
|
||||||
|
),
|
||||||
|
[
|
||||||
|
Newline,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
[
|
||||||
|
Newline,
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
C(4#
|
||||||
|
)implements e:m
|
||||||
|
C
|
||||||
|
|
@ -459,6 +459,7 @@ mod test_snapshots {
|
||||||
pass/if_in_record_field_opt_pat.expr,
|
pass/if_in_record_field_opt_pat.expr,
|
||||||
pass/if_newline_then_negate_else_recordupdater.expr,
|
pass/if_newline_then_negate_else_recordupdater.expr,
|
||||||
pass/if_then_weird_indent.expr,
|
pass/if_then_weird_indent.expr,
|
||||||
|
pass/implements_after_parens_comment.expr,
|
||||||
pass/implements_annotation_comment.expr,
|
pass/implements_annotation_comment.expr,
|
||||||
pass/implements_in_pat_after_comment.expr,
|
pass/implements_in_pat_after_comment.expr,
|
||||||
pass/implements_newline_in_fn_ty.expr,
|
pass/implements_newline_in_fn_ty.expr,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue