Scala's IDE support is terrible
by Jay Conrod
posted on 2009-07-14
Over the last few weeks, I've been learning Scala and using it in a new side project. Over all, I really like the language. It elegantly combines functional and object oriented programming while remaining compatible with Java and other JVM languages.
Until last weekend, I'd been doing all my Scala work in Emacs, compiling things from the command line. This works pretty well since I never have to reach the for the mouse. However, now that my project is getting a little bigger, I felt it was time to move to a real IDE with a graphical debugger. I also wanted to experiment with unit testing, something I wish I had been taught in undergrad, and I've heard most IDEs have some form of unit testing integration.
The first IDE I tried was Eclipse 3.5. I have some experience with Eclipse in Java, and it seemed all right, even if the GUI was a bit ugly and slow. I had heard that the Eclipse plugin for Scala was only somewhat less stable than the Netbeans plugin, but it was under more active development. I also decided to go with JUnit 4.6 since it seems to be the canonical unit testing package.
My experience with the Eclipse plugin was good at first but quickly went downhill. Syntax highlighting worked okay, but JUnit couldn't find any tests I wrote in Scala; when I right-clicked on a test, the "Run As" menu didn't include a JUnit option. I had to go to the "Run Configurations" dialog and run the test from there. Annoying but tolerable. However, when I tried to add a timeout to a test annotation, JUnit flat out refused to run the test with the error "No tests found with test runner 'JUnit 4'". Not so tolerable, since my project involves a lot of synchronization and blocking, so I need my tests to time out when a deadlock occurs. The final straw for Eclipse came when I tried to debug a test. When I opened the debugger (after hitting a breakpoint), an error window would pop up with the message "'Debug Source Lookup' has encountered a problem. An internal error occurred during: 'Debug Source Lookup'". Apparently this was due to a NullPointerException. Not only would the debugger not show me the code where the breakpoint was, it would also pop up this same error dialog after every step. Completely unusable.
I gave up and decided to try NetBeans 6.7. There is a nice "Getting Started" page on the NetBeans wiki which provides step-by-step instructions for installing NetBeans and the Scala plugin. The first time I tried this, I got a strange error message after restarting NetBeans that "Scala Editing" required some deprecated module which was not present. Since the ability to edit code is pretty important to me, I reinstalled the plugin, hoping for better luck. After that, NetBeans started up without an error message, but when I tried to create a new Scala project, it gave me the cryptic error message "Called DataObject.find on null" and failed. So I gave up on NetBeans, too.
It's sad. These IDE plugins aren't just somewhat buggy: they're totally unusable. Maybe I'm just unlucky; I haven't read anything that indicated they were this bad. For now, I'm going back to Emacs and the command line.
Comment by Dave posted on Mon Jul 27 22:59:20 2009
I think you got lucky. I've been trying to get both the 2.7.5 final and 2.8 dev build of the Scala IDE running in Eclipse Galileo (3.5) and have had nothing but trouble. I can't even get cut-and-paste working without things falling in a heap. Trying to use the auto-complete functionality results in: java.lang.NullPointerException at scala.tools.nsc.symtab.Types$SingleType.(Types.scala:975) at scala.tools.nsc.symtab.Types$UniqueSingleType$1.(Types.scala:2034) ... at scala.tools.nsc.interactive.Global.recompile(Global.scala:250) at scala.tools.nsc.interactive.Global.scala$tools$nsc$interactive$Global$$backgroundCompile(Global.scala:217) at scala.tools.nsc.interactive.Global$$anon$2.run(Global.scala:187) I've seen assertion errors in the presentation compiler (!?!): java.lang.AssertionError: assertion failed at scala.Predef$.assert(Predef.scala:92) at scala.tools.nsc.interactive.RangePositions$class.scala$tools$nsc$interactive$RangePositions$$insert(RangePositions.scala:95) object scala not found: scala.tools.nsc.FatalError: object scala not found. at scala.tools.nsc.symtab.Definitions$definitions$.getModuleOrClass(Definitions.scala:355) at scala.tools.nsc.symtab.Definitions$definitions$.getModule(Definitions.scala:326) and about 5 or 6 other error messages. All in the space of about 2 minutes of use. Either there's something terribly wrong with my Eclipse installation or this stuff just hasn't been tested AT ALL before pushing it out. I love the idea of using Scala for serious development, but until the tools are even vaguely usable it's just not going to be worth the hassle. Emacs sounds like a good idea.
Comment by NN posted on Thu Aug 6 04:15:00 2009
I just ininstalled the eclipse plugin from my main development eclipse installation because it even slowed down java development. Maybe IDEA for 30days until the eclipse version becomes usable.
Comment by jason braswell posted on Thu May 13 06:59:04 2010
Ugh, that sucks to hear. I used Eclipse for Scala about a year ago and was really disappointed at how bad it was. I thinking recently I'd give it another go to see if it had gotten better. I guess not.
Comment by Matt posted on Tue May 18 23:13:14 2010
@jason -- this post was from almost a year ago too. It might be worth trying out the 2.8 versions. My experience is that it is considerably more stable than a year ago, although not perfect.
Comment by prasanna posted on Tue Jul 20 21:34:45 2010
intellijidea now has a decent support for scala