Skip to content

Commit

Permalink
FormatOps: extend getSlbEndOnLeft to LeftBrace
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Nov 27, 2024
1 parent 2ae3560 commit f000d9c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,25 @@ class FormatOps(
) start
else null
}
case _: T.LeftBrace => start.left match {
case _: T.RightParen
if start.leftOwner.is[Member.SyntaxValuesClause] &&
start.rightOwner.parent.exists {
case p: Tree.WithBody => p.body eq start.rightOwner
case _ => false
} => null
case _: T.Interpolation.SpliceStart
if style.newlines.inInterpolation eq
Newlines.InInterpolation.allow => null
case _ => start
}
case _: T.LeftBrace if (start.left match {
case _: T.CloseDelim =>
(start.leftOwner match {
case _: Member.SyntaxValuesClause => true
case t: Term.Block => t.parent.is[Term.ArgClause]
case _ => false
}) &&
(start.rightOwner match {
case _: Term.ArgClause => true
case t => t.parent.exists {
case p: Tree.WithBody => p.body eq start.rightOwner
case _: Term.ArgClause => true
case _ => false
}
})
case _: T.Interpolation.SpliceStart =>
style.newlines.inInterpolation eq Newlines.InInterpolation.allow
case _ => false
}) => null
case _: T.RightBracket if start.left.is[T.RightBracket] => null
case _: T.LeftBracket => null
case _: T.Dot => start.rightOwner match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class FormatTests extends FunSuite with CanRunTests with FormatAssertions {
val explored = Debug.explored.get()
logger.debug(s"Total explored: $explored")
if (!onlyUnit && !onlyManual)
assertEquals(explored, 1183844, "total explored")
assertEquals(explored, 1183838, "total explored")
val results = debugResults.result()
// TODO(olafur) don't block printing out test results.
// I don't want to deal with scalaz's Tasks :'(
Expand Down

0 comments on commit f000d9c

Please sign in to comment.