mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
Fix outdenting in closures
This commit is contained in:
parent
54a0456c30
commit
7b9aa59d64
5 changed files with 63 additions and 1 deletions
|
@ -1872,7 +1872,6 @@ fn fmt_closure<'a>(
|
|||
};
|
||||
|
||||
if should_outdent {
|
||||
buf.spaces(1);
|
||||
sub_expr.format_with_options(buf, Parens::NotNeeded, Newlines::Yes, indent);
|
||||
} else {
|
||||
loc_ret.format_with_options(buf, Parens::NotNeeded, Newlines::Yes, body_indent);
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
\L -> {
|
||||
}
|
||||
Θ
|
|
@ -0,0 +1,55 @@
|
|||
@0-12 SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
EitherIndex(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-9,
|
||||
],
|
||||
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: [],
|
||||
value_defs: [
|
||||
Stmt(
|
||||
@0-9 Closure(
|
||||
[
|
||||
@1-2 Tag(
|
||||
"L",
|
||||
),
|
||||
],
|
||||
@6-9 SpaceBefore(
|
||||
Record(
|
||||
Collection {
|
||||
items: [],
|
||||
final_comments: [
|
||||
Newline,
|
||||
],
|
||||
},
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@10-12 SpaceBefore(
|
||||
Tag(
|
||||
"Θ",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
|
@ -0,0 +1,4 @@
|
|||
\L->
|
||||
{
|
||||
}
|
||||
Θ
|
|
@ -344,6 +344,7 @@ mod test_snapshots {
|
|||
pass/closure_complex_pattern_indent_issue.expr,
|
||||
pass/closure_in_apply_in_binop.expr,
|
||||
pass/closure_in_binop_with_spaces.expr,
|
||||
pass/closure_newline_empty_record_newline.expr,
|
||||
pass/closure_pat_reccord_comment.expr,
|
||||
pass/closure_with_underscores.expr,
|
||||
pass/comma_prefixed_indented_record.expr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue