Scala's IDE support is terrible

Published on 2009-07-14

View All Posts

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.