Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't examine variables in scala code in Eclipse

When I debug a Scala application in eclipse I get a dialog with this message on start up: Unable to set breakpoints in Main due to missing line number artifacts.

When I try to examine variables I get this error in the expressions window: " [in Main [in [Working copy] Main.scala [in [in src [in Scala1]]]]] does not exist"

I've tried setting various debug level settings for the Scala compiler including "line" and the highest setting but it doesn't seem to make any difference. I was able to see the contents once after messing with settings but was unable to do again so am wondering if there is a bug to do with bad cached state somewhere.

I am using the Indigo service release of Eclipse with version 2.0.0v2_09 of the Scala plugin.

like image 602
Shane Avatar asked Jun 25 '12 02:06

Shane


People also ask

How do I view variables in Eclipse?

Variables/Expression view – Shows the declared variables and their values. Press Ctrl+Shift+d or Ctrl+Shift+i on a selected variable or expression to show its value. You can also add a permanent watch on an expression/variable that will then be shown in the Expressions view when debugging is on.

How do I run Scala code in Eclipse?

If you installed Scala plugin for Eclipse, open the Scala perspective. Then right-click on your project and select "Add Scala Nature" in "Configure" menu. You should now be able to run your Scala applications.

Does Scala work on Eclipse?

Scala IDE. The Scala IDE for Eclipse is centered around seamless integration with the Eclipse Java tools, providing many of the features Eclipse users have come to expect including, Support for mixed ...


1 Answers

You should upgrade to the new version of the Scala IDE !

(Strictly) Prior to 3.0.0, the debugger was the Java debugger, with no particular Scala support. But ScalaIDE 3.0.0 shipped with a Scala Debugger that should alleviate the problems you mention, specifically well-positioned breakpoints. You can read the release notes of 3.0.0 describing the debugger.

You should even try the release candidate version of 3.0.1, it contains fixes for the debugger, specifically skipping breakpoints. Try it, and if any issues remain, you can engage the IDE team on the mailing list, or file an issue, or ask another SO question!

like image 163
Francois G Avatar answered Oct 06 '22 22:10

Francois G