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 ae2f6f5 commit 8f5626e
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 21 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 @@ -13,7 +13,7 @@ abstract class CommunityIntellijScalaSuite(name: String)
class CommunityIntellijScala_2024_2_Suite
extends CommunityIntellijScalaSuite("intellij-scala-2024.2") {

override protected def totalStatesVisited: Option[Int] = Some(59338368)
override protected def totalStatesVisited: Option[Int] = Some(59338266)

override protected def builds = Seq(getBuild(
"2024.2.28",
Expand Down Expand Up @@ -51,7 +51,7 @@ class CommunityIntellijScala_2024_2_Suite
class CommunityIntellijScala_2024_3_Suite
extends CommunityIntellijScalaSuite("intellij-scala-2024.3") {

override protected def totalStatesVisited: Option[Int] = Some(59555031)
override protected def totalStatesVisited: Option[Int] = Some(59554927)

override protected def builds = Seq(getBuild(
"2024.3.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ abstract class CommunityScala2Suite(name: String)

class CommunityScala2_12Suite extends CommunityScala2Suite("scala-2.12") {

override protected def totalStatesVisited: Option[Int] = Some(42554938)
override protected def totalStatesVisited: Option[Int] = Some(42554853)

override protected def builds =
Seq(getBuild("v2.12.20", dialects.Scala212, 1277))
Expand All @@ -18,7 +18,7 @@ class CommunityScala2_12Suite extends CommunityScala2Suite("scala-2.12") {

class CommunityScala2_13Suite extends CommunityScala2Suite("scala-2.13") {

override protected def totalStatesVisited: Option[Int] = Some(53041273)
override protected def totalStatesVisited: Option[Int] = Some(53041386)

override protected def builds =
Seq(getBuild("v2.13.14", dialects.Scala213, 1287))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ abstract class CommunityScala3Suite(name: String)

class CommunityScala3_2Suite extends CommunityScala3Suite("scala-3.2") {

override protected def totalStatesVisited: Option[Int] = Some(39229069)
override protected def totalStatesVisited: Option[Int] = Some(39228800)

override protected def builds = Seq(getBuild("3.2.2", dialects.Scala32, 791))

}

class CommunityScala3_3Suite extends CommunityScala3Suite("scala-3.3") {

override protected def totalStatesVisited: Option[Int] = Some(42414755)
override protected def totalStatesVisited: Option[Int] = Some(42414545)

override protected def builds = Seq(getBuild("3.3.3", dialects.Scala33, 861))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ abstract class CommunitySparkSuite(name: String)

class CommunitySpark3_4Suite extends CommunitySparkSuite("spark-3.4") {

override protected def totalStatesVisited: Option[Int] = Some(86438964)
override protected def totalStatesVisited: Option[Int] = Some(86438662)

override protected def builds =
Seq(getBuild("v3.4.1", dialects.Scala213, 2585))
Expand All @@ -18,7 +18,7 @@ class CommunitySpark3_4Suite extends CommunitySparkSuite("spark-3.4") {

class CommunitySpark3_5Suite extends CommunitySparkSuite("spark-3.5") {

override protected def totalStatesVisited: Option[Int] = Some(91445316)
override protected def totalStatesVisited: Option[Int] = Some(91444980)

override protected def builds =
Seq(getBuild("v3.5.3", dialects.Scala213, 2756))
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 8f5626e

Please sign in to comment.