質問

In my file file.scala, I have the following line:

  `file.scala`
    > shapes.foreach({ shape =>
     ...

When I start to debug it using Eclipse 3.7, scala plug-in version 2.1.0mp3, I press F5 to enter the code. It brings me to the following files in order:

  `AbstractFunction1.class`
    > abstract class AbstractFunction1[@specialized(scala.Int, scala.Long, ..
  `Object.class`
      Source code is not found
  `AbstractFunction1.class`
    > abstract class AbstractFunction1[@specialized(scala.Int, scala.Long, ..
  `Function1.class`
    >  trait Function1[@specialized(scala.Int, scala.Long, ...
  `AbstractFunction1.class`
    > abstract class AbstractFunction1[@specialized(scala.Int, scala.Long, ..
  `file.scala`
    > shapes.foreach({ shape =>
  `file.scala`
    > shapes.foreach({ shape =>

And then eventually it shows the body of the foreach method with the while loop, not yet entering the one described in file.scala.

But I am pressing F5 7 times just to get inside a foreach loop. How can I do better ? Is it possible to specify files to be skipped automatically ?

役に立ちましたか?

解決

First, please update your Scala IDE to the latest stable release, i.e., v3.0.0 at the moment of this writing.

Then, you'll be happy to know that the Scala IDE provides a new Scala Debugger that it is specifically tweaked for Scala code. For instance, stepping through a map/foreach/... will work as desired, i.e., you will step inside the closure without being redirected into the classes you mentioned. Have a look at the Scala Debugger documentation for more details and don't miss the screencast.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top