Skip to content

Commit

Permalink
RewriteTrailingCommas: allow tuples as well
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Oct 19, 2023
1 parent a1d3be8 commit 829c0e5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ private class RewriteTrailingCommas(ftoks: FormatTokens)

// comma and paren/bracket/brace need to have the same owner
(rightOwner eq nft.meta.rightOwner) && (nft.right match {
case _: Token.RightBracket | _: Token.RightParen =>
case _: Token.RightParen =>
rightOwner.isAny[Member.SyntaxValuesClause, Member.Tuple]

case _: Token.RightBracket =>
rightOwner.is[Member.SyntaxValuesClause]

case _: Token.RightBrace =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,4 @@ val x = (
"b",
)
>>>
test does not parse
val x = ("a", "b", )
^
val x = ("a", "b")
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,4 @@ val x = (
"b",
)
>>>
test does not parse
val x = ("a", "b", )
^
val x = ("a", "b")

0 comments on commit 829c0e5

Please sign in to comment.