Saturday, February 02, 2008

A *new* Scala Bundle for Textmate

No doubt, the upcoming Scala Module will make Netbeans the No.1 Scala IDE. I use the current pre-release version on my linux box at work without any difficulties. Unfortunately, I have encountered problems running the recommended daily development builds of Netbeans on my private macbook pro. I hoped that I could at least use my favorite editor for MacOS X, Textmate, but the bundle shipped with Scala 2.6.1 still seems to be a dummy/placeholder. Well, instead of falling into a deep depression, I invested half a day to create a new bundle myself.

For those interested, please find the download below:

- The Scala Bundle
- An Example Project (with some sources ripped from scala-lang.org)

The main goal was to have simple syntax highlighting, which actually looks quite good using the 'Cobalt Theme'. (I'm not 100% sure that value:Type is always displayed correctly, but it seemed to work with the samples.)

Further, there is a template for an Ant-Script which includes a compile, run & deploy task. These can be executed as bundle commands (menu or shortcuts), if the file is called 'build.xml'. Customization should be easy with a few properties at the top of the file.

Finally, there are a few snippets to write new code quickly. E.g. typing

trait ->| Adder ->| def ->| add ->| Int ->| 2 ->| left ->| Int ->| right ->| Int

results in
/**
* Adder
*/
trait Adder
{
def add ( left : Int, right : Int ) : Int
}
without pressing two keys at the same time (no SHIFT)!

But of course you can sketch your own (and share them with me =) ) !