You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Formatted once:
---
if (
# 1
x := # 2.5 # 2 # 3
# 3.5
y # 4
):
pass
---
Formatted twice:
---
if (
# 1
x := # 3.5 # 2.5 # 2 # 3
y # 4
):
pass
i think the issue is that we use a space() around the operator (:=) and not a soft_line_break_or_space so nothing is inserting the newline before the leading ownline comment
The text was updated successfully, but these errors were encountered:
The use of space might be intentional to avoid breaking after the operator. But it might be necessary to emit a soft line break if the right side has a leading comment
konstin
changed the title
formatter: bug in named expr (and dict, others)
formatter: comment formatting instability in named expr (and dict, others)
Jul 16, 2023
## Summary
Attaches comments around the `:=` operator in a named expression as
dangling, and formats them manually in the `named_expr.rs` formatter.
Closes#5695.
## Test Plan
`cargo test`
input
i think the issue is that we use a
space()
around the operator (:=
) and not asoft_line_break_or_space
so nothing is inserting the newline before the leading ownline commentThe text was updated successfully, but these errors were encountered: