mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Fix pnc args multiine in the presence of final comments
This commit is contained in:
parent
158691fb27
commit
0438c17503
5 changed files with 40 additions and 5 deletions
|
@ -521,10 +521,7 @@ pub fn expr_is_multiline(me: &Expr<'_>, comments_only: bool) -> bool {
|
||||||
.any(|loc_arg| expr_is_multiline(&loc_arg.value, comments_only))
|
.any(|loc_arg| expr_is_multiline(&loc_arg.value, comments_only))
|
||||||
}
|
}
|
||||||
Expr::PncApply(loc_expr, args) => {
|
Expr::PncApply(loc_expr, args) => {
|
||||||
expr_is_multiline(&loc_expr.value, comments_only)
|
expr_is_multiline(&loc_expr.value, comments_only) || is_collection_multiline(args)
|
||||||
|| args
|
|
||||||
.iter()
|
|
||||||
.any(|loc_arg| expr_is_multiline(&loc_arg.value, comments_only))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Expr::DbgStmt { .. } => true,
|
Expr::DbgStmt { .. } => true,
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
i(
|
||||||
|
i,
|
||||||
|
)
|
||||||
|
t
|
|
@ -0,0 +1,31 @@
|
||||||
|
@0-7 SpaceAfter(
|
||||||
|
Apply(
|
||||||
|
@0-6 PncApply(
|
||||||
|
@0-1 Var {
|
||||||
|
module_name: "",
|
||||||
|
ident: "i",
|
||||||
|
},
|
||||||
|
Collection {
|
||||||
|
items: [
|
||||||
|
@2-3 Var {
|
||||||
|
module_name: "",
|
||||||
|
ident: "i",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
final_comments: [
|
||||||
|
Newline,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
),
|
||||||
|
[
|
||||||
|
@6-7 Var {
|
||||||
|
module_name: "",
|
||||||
|
ident: "t",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
Space,
|
||||||
|
),
|
||||||
|
[
|
||||||
|
Newline,
|
||||||
|
],
|
||||||
|
)
|
|
@ -0,0 +1,2 @@
|
||||||
|
i(i,
|
||||||
|
)t
|
|
@ -189,8 +189,8 @@ mod test_snapshots {
|
||||||
fail/ability_demands_not_indented_with_first.expr,
|
fail/ability_demands_not_indented_with_first.expr,
|
||||||
fail/ability_first_demand_not_indented_enough.expr,
|
fail/ability_first_demand_not_indented_enough.expr,
|
||||||
fail/ability_non_signature_expression.expr,
|
fail/ability_non_signature_expression.expr,
|
||||||
fail/all_the_bangs.expr,
|
|
||||||
fail/alias_or_opaque_fail.expr,
|
fail/alias_or_opaque_fail.expr,
|
||||||
|
fail/all_the_bangs.expr,
|
||||||
fail/bound_variable.expr,
|
fail/bound_variable.expr,
|
||||||
fail/comment_with_tab.expr,
|
fail/comment_with_tab.expr,
|
||||||
fail/d_assign_return_bang.expr,
|
fail/d_assign_return_bang.expr,
|
||||||
|
@ -631,6 +631,7 @@ mod test_snapshots {
|
||||||
pass/pizza_question.moduledefs,
|
pass/pizza_question.moduledefs,
|
||||||
pass/plus_if.expr,
|
pass/plus_if.expr,
|
||||||
pass/plus_when.expr,
|
pass/plus_when.expr,
|
||||||
|
pass/pnc_apply_comment_after_newline.expr,
|
||||||
pass/pos_inf_float.expr,
|
pass/pos_inf_float.expr,
|
||||||
pass/positive_float.expr,
|
pass/positive_float.expr,
|
||||||
pass/positive_int.expr,
|
pass/positive_int.expr,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue