Friday Jan 11, 2008
Scala Supporting for NetBeans Updated#1 - 20080110
Features:
- Syntax checking, highlighting, code folding, navigator, basic indent
- Basic completion, In-place refactoring, occurrences marks
- Interactive Scala shell. [Windows] -> [Interactive Scala Shell]
- Basic Scala project management with file locator for compile Errors
- Requires newest NetBeans Nightly build (get from: http://bits.netbeans.org/download/trunk/nightly/latest/)
- Don't forget to set your SCALA_HOME environment first, or append "-J-Dscala.home=scalahomepath" to the end of "netbeans_default_options" in your netbeans.conf file, where, "scalahomepath" is your Scala home's absolute path. For example: /Users/dcaoyuan/apps/scala/share/scala/
The netbeans.conf is located at "pathToNetBeansInstallationDirectory/etc", in Mac OSX, it could be:
/Applications/NetBeans/NetBeans\ 6.0.app/Contents/Resources/NetBeans/etc
Known Issues:
- Do not write old-style ForComprehension "for (val i <- ...)", instead, use "for(i <- ...)". Please see Scala Spec 2.6.0+
- Do not put infix/postfix operator at the beginning of new line even in a parenthesis expression
- When "<" is an operator, put a space after "<" to identify it from a xml element
Download:
- http://sourceforge.net/project/showfiles.php?group_id=192439&package_id=256544
Installation:
- Upzip to some where, there will be several *.nbm files
- Run NetBeans, install these *.nbm files via [Tools] -> [Plugins] -> "Downloaded"
Posted at 01:16PM Jan 11, 2008 by dcaoyuan in NetBeans | Comments[12]

I can't get this working, and the problem appears to be in my Scala installation. I installed 2.6.1 from DarwinPorts, and scala, scalac, etc. are all in /opt/local/bin/.
If I point SCALA_HOME to that, then try to use the plugin to build a script, I get: "Could not load definitions from resource scala/tools/ant/antlib.xml. It could not be found."
Sure enough, I have no scala tools directory anywhere. Tried to redo the install, but the result was unchanged.
Any suggestions?
Thanks, David
Posted by David Coldrick on January 11, 2008 at 06:12 PM PST #
If so, it may be a problem for different Scala installation directory tree.
I'll try to fix this. But before that, you may have to install a new Scala from scala's download page.
I'm thinking to wrap a default Scala installation into the package.
Posted by caoyuan on January 11, 2008 at 06:20 PM PST #
Well, I just downloaded http://www.scala-lang.org/downloads/distrib/files/scala-2.6.1-final.tar.gz, and it doesn't appear to have any ant stuff in it.
Do I need to download source?
Thanks, David
Posted by David Coldrick on January 11, 2008 at 06:39 PM PST #
Need no source files, the cala/tools/ant/antlib.xml is packaged in a jar file, so just make sure scala_home pointing to the ..../scala/share/scala/ (which contains sub-dir: bin, lib etc.)
Posted by caoyuan on January 11, 2008 at 06:50 PM PST #
Just answered my own question: the antlib.xml is only in the Scala *source*.
Don't understand why this is required.
Thanks, David
Posted by David Coldrick on January 11, 2008 at 07:02 PM PST #
Ah, I see. Thanks.
Regards,
David
Posted by David Coldrick on January 11, 2008 at 07:07 PM PST #
Ah ah, I'm a newbie to Scala, so you also answered the question for me :-)
Posted by Caoyuan on January 11, 2008 at 07:08 PM PST #
It appears that I have to point to the directory you suggest (...scala/share/scala) in *both* the env variable SCALA_HOME and as a -J switch in netbeans.conf. Once I'd done that, it worked.
Thanks for your help,
David
Posted by David Coldrick on January 11, 2008 at 07:43 PM PST #
Great work and I am really interesting in trying it out.
The thing that is putting me off at the moment is that you say it needs the latest build. Are you planning to release it for NB6.0 or will I have to wait for NB6.1 before I can get your module and a stable IDE?
Posted by Howard Lovatt on January 11, 2008 at 08:42 PM PST #
Hi David,
Thanks for your information. It was also mentioned by another comment, that for Windows, all SCALA_HOME and -j option should be set properly.
Howard,
I tested on NetBeans 6.0, there seems to be some issues, if these issues can be resolved, these modules should also work.
Posted by Caoyuan on January 11, 2008 at 08:48 PM PST #
Plugin breaks on operators like << (it assumes << is start of XML code. See http://scala.sygneca.com/code/simplifying-jdbc for example. Otherwise, great work.
Posted by Aleksander Bandelj on January 14, 2008 at 04:14 AM PST #
Hi Aleksander
Thanks for your report, I just fixed it in trunk.
Posted by Caoyuan Deng on January 14, 2008 at 11:53 AM PST #