Skip to content

Conversation

kitbellew
Copy link
Collaborator

Since an infix chain usually looks like one expression, especially when spanning multiple lines, let's get the outer one.

kitbellew added 2 commits May 16, 2025 06:37
Since an infix chain usually looks like one expression, especially when
spanning multiple lines, let's get the outer one.
@kitbellew kitbellew requested a review from tgodzik May 16, 2025 15:26
@kitbellew kitbellew merged commit b6eb995 into scalameta:main May 16, 2025
22 checks passed
@kitbellew kitbellew deleted the 4904 branch May 16, 2025 15:45
kitbellew added a commit to kitbellew/scalafmt that referenced this pull request May 19, 2025
Keep the owner unchanged but apply this special logic mapping operator
(Term.Name) to parent infix tree (Term.ApplyInfix) only when checking
if the operator token is to be aligned using configured matchers.

If an infix expression starts with a multiline subexpression but ends
with a single line of tokens to be aligned, then subsequent single-line
statements are properly aligned with it.

However, in the opposite case, when an infix expression starts with a
single line of tokens to be aligned and continues with a multiline part,
then it was not aligned with previous statements.

By keeping the owner, we fix this inconsistency.

Includes undo of scalameta#4904.
kitbellew added a commit to kitbellew/scalafmt that referenced this pull request May 19, 2025
Keep the owner unchanged but apply this special logic mapping operator
(Term.Name) to parent infix tree (Term.ApplyInfix) only when checking
if the operator token is to be aligned using configured matchers.

If an infix expression starts with a multiline subexpression but ends
with a single line of tokens to be aligned, then subsequent single-line
statements are properly aligned with it.

However, in the opposite case, when an infix expression starts with a
single line of tokens to be aligned and continues with a multiline part,
then it was not aligned with previous statements.

By keeping the owner, we fix this inconsistency.

Includes undo of scalameta#4904.
kitbellew added a commit that referenced this pull request May 19, 2025
Keep the owner unchanged but apply this special logic mapping operator
(Term.Name) to parent infix tree (Term.ApplyInfix) only when checking
if the operator token is to be aligned using configured matchers.

If an infix expression starts with a multiline subexpression but ends
with a single line of tokens to be aligned, then subsequent single-line
statements are properly aligned with it.

However, in the opposite case, when an infix expression starts with a
single line of tokens to be aligned and continues with a multiline part,
then it was not aligned with previous statements.

By keeping the owner, we fix this inconsistency.

Includes undo of #4904.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants