Skip to content

Commit

Permalink
allow step into in classes with special names
Browse files Browse the repository at this point in the history
  • Loading branch information
iusildra committed Jul 21, 2023
1 parent 493ea0f commit e484975
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class Scala2Unpickler(
.foldRight(Option(javaClass.name)) { (sym, acc) =>
for (javaName <- acc if javaName.contains(sym.name))
yield javaName
.split(sym.name)
.split(sym.name.replaceAll("\\$", "\\\\\\$"))
.drop(1)
.mkString(sym.name)
}
Expand Down
2 changes: 1 addition & 1 deletion modules/java-debug
Submodule java-debug updated 0 files
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,31 @@ class Scala213StepFilterTests extends StepFilterTests(ScalaVersion.`2.13`) {
implicit val debuggee: TestingDebuggee = TestingDebuggee.mainClass(source, "example.Main", ScalaVersion.`2.13`)
check(Breakpoint(14), StepIn.line(9), Breakpoint(16), StepIn.line(10))
}

test("should step into method of local class") {
val source =
"""|package example
|
|class `A+B` {
| val foo = 42
| object && {
| def x = {
| println(foo)
| 42
| }
| }
|}
|
|object Main {
| def main(args: Array[String]): Unit = {
| val ab = new `A+B`
| println(ab.&&.x)
| }
|}
|""".stripMargin
implicit val debuggee: TestingDebuggee = TestingDebuggee.mainClass(source, "example.Main", ScalaVersion.`2.13`)
check(Breakpoint(8), Evaluation.success("foo", 42))
}
}

abstract class StepFilterTests(protected val scalaVersion: ScalaVersion) extends DebugTestSuite {
Expand Down

0 comments on commit e484975

Please sign in to comment.