
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 =) ) !
7 comments:
Thanks a lot! Have you thought about submitting it to the textmate folks to get it into their bundle repository?
thanks for sharing this!
i'm constantly getting this error:
Searching for build.xml ...
Buildfile: /Users/oleksandr/projects/illinois/ScalaExamples.project/build.xml
init:
[taskdef] Could not load definitions from resource scala/tools/ant/antlib.xml. It could not be found.
compile:
BUILD FAILED
build.xml:80: Problem: failed to create task or type fsc
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any / declarations have taken place.
do you have any idea why does it happen?
thank you
The build.xml defines a scala.home property, I bet it doesn't point to your scala installation. Look for
<property name="scala.home" value="/usr/local/scala/"/>
Thank you Michael!
I've fixed this one, but another appeared: "Could not connect to compilation daemon. java.lang.Exception: fsc failure"
Should i have launched FSC as a service somehow?.. thank you!
Hm no, the fsc 'service' is started the first time it's called... sounds more that the specific port is blocked on your machine. Does fsc work when you call it form the SCALA_HOME/bin/ from the terminal?
Anyhow, the simplest work-around is to replace <fsc ...>..</fsc> with <scalac ...>..</scalac> in the build.xml.
That way the standard scalac is used which means subsequent compilation might be a bit slower =(
THANK YOU
(saved me spending the day doing this - much appreciated)
Post a Comment