Skip to content

Commit

Permalink
Router: fix beforeOpenParenDefnSite = unfold
Browse files Browse the repository at this point in the history
Exclude the trailing comment.
  • Loading branch information
kitbellew committed Mar 14, 2023
1 parent 93a0f2a commit ff4527f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,9 @@ class Router(formatOps: FormatOps) {
case Newlines.unfold =>
val rightParent = rightOwner.parent.get
val slbEnd =
if (defn) beforeDefRhs.fold(getLastToken(rightParent))(_.left)
if (defn)
beforeDefRhs
.fold(getLastToken(rightParent))(prevNonComment(_).left)
else getLastToken(getLastCall(rightParent))
val multipleArgs = isSeqMulti(getArgs(next(ft).meta.leftOwner))
val nft = tokens.tokenAfter(close)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4741,8 +4741,7 @@ extension (s: String)
def foo(): Unit = ???
def bar(): Unit = ???
>>>
extension
(s: String)
extension(s: String)
/** ... */
def foo(): Unit = ???
def bar(): Unit = ???

0 comments on commit ff4527f

Please sign in to comment.