Structure builder returns wrong name for nested class in an object
class A
object A {
class B {
val a = 2 /* put breakpoint at this line */
}
}
Create a Main app and launch the debugger, the debug session won't stop at the given breakpoint.
It turns out that this issue is caused by the Structure Builder, so it may not be that easy to have a good fix (and this is going to be "risky" - read this as possible regressions in the Java/Scala interoperability).
That the bug is in the Structure Builder can easily be verified by removing the suffixed '$' to the `ScalaModuleElement` at this line https://github.com/scala-ide/scala-ide/blob/master/org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements/ScalaElements.scala#L96 I'm not suggesting this is the right fix, but it does demonstrates that the problem is in the Strucutre Builder.
Would also be interesting to know if this is a regression.
Leave a comment
(In scala-ide:5fb08789ca3e5c6bd4fac63a68ff07c2ae022a44) Breakpoints work even if referencing the wrong nested class
Now uses the name of the top level class as base name to set class prepare request.
This allow to put the breakpoint on any nested classes containing the line.
Fix #1001197, Re #1001367
Branch: master
Now uses the name of the top level class as base name to set class prepare request.
This allow to put the breakpoint on any nested classes containing the line.
Fix #1001197, Re #1001367
Branch: master
on 2013-01-08 11:00 *
By Iulian Dragos
Summary changed from Unable to hit breakpoint inside class nested in an object to Structure builder returns wrong name for nested class in an object