Skip to content

Commit

Permalink
move to classes to skip
Browse files Browse the repository at this point in the history
  • Loading branch information
iusildra committed Sep 20, 2023
1 parent fc6847a commit 8974974
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ import com.sun.jdi.Location
import ch.epfl.scala.debugadapter.ScalaVersion

private[internal] class RuntimeStepFilter(classesToSkip: Set[String], methodsToSkip: Set[String]) extends StepFilter {
override def shouldSkipOver(method: Method): Boolean = shouldSkipOut(method) || isBoxingMethod(method)
override def shouldSkipOver(method: Method): Boolean = shouldSkipOut(method)
override def shouldSkipOut(upperLocation: Location, method: Method): Boolean = shouldSkipOut(method)
private def shouldSkipOut(method: Method): Boolean =
classesToSkip.contains(method.declaringType.name) || methodsToSkip.contains(method.toString)
private def isBoxingMethod(method: Method): Boolean = {
method.declaringType().name().startsWith("scala.runtime.BoxesRunTime")
}
}

private[internal] object RuntimeStepFilter {
Expand All @@ -30,7 +27,8 @@ private[internal] object RuntimeStepFilter {
"scala.runtime.LazyLong",
"scala.runtime.LazyFloat",
"scala.runtime.LazyDouble",
"scala.runtime.LazyUnit"
"scala.runtime.LazyUnit",
"scala.runtime.BoxesRunTime"
)
private val scala3ClassesToSkip = scalaClassesToSkip ++ Set("scala.runtime.LazyVals$")
private val scala2ClassesToSkip = scalaClassesToSkip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Scala3StepFilterTests extends StepFilterTests(ScalaVersion.`3.1+`) {
| }
|}""".stripMargin
implicit val debuggee: TestingDebuggee = TestingDebuggee.mainClass(source, "example.Main", scalaVersion)
check(Breakpoint(6), StepIn.method("Integer.valueOf(int): Integer"))
check(Breakpoint(6), StepIn.line(5))
}

test("skip exported methods") {
Expand Down

0 comments on commit 8974974

Please sign in to comment.