[RSS]

Scala Plugins for NetBeans

Features

  • Full featured Scala editor
    • syntax and semantic coloring
    • outline navigator
    • code folding
    • mark occurrences
    • go to declaration
    • instant rename
    • indentation
    • formatting
    • pair matching
    • error annotations
    • code completion
  • Project management (build/run/debug project)
  • Debugger
  • Interactive console
  • JUnit integration
  • Maven integration

Get Started

Plugins for Scala are currently under development. Here is an overview of what you can currently do with Scala in NetBeans IDE, as well as instructions for getting started.

There are two ways to get started with Scala plugin for NetBeans:

  • Beta plugins on NetBeans's 6.5 beta+
  • Cutting edge plugins on NetBeans nightly build version

1. Get Started with NetBeans 6.5 beta+

  1. Get the NetBeans 6.5 beta or later version from: http://download.netbeans.org/netbeans/6.5/beta/
  2. Get the Scala plugins beta binary from: http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=11854
  3. Unzip Scala plugin binary to somewhere
  4. Open NetBeans, go to "Tools" -> "Plugins", click on "Downloaded" tab title, click on "Add Plugins..." button, choose the directory where the Scala plugins are unzipped, select all listed *.nbm files, following the instructions. Restart IDE.

2. Adventure with NetBeans Nightly Build

Scala modules are experimental and under active developing, other than the beta binary, you can also try cutting edge features via development version of NetBeans. Development versions are nightly built and change rapidly, please check updates frequently too via "Tool"->"Plugins"->"Reload Catalog" (update all available modules, including those not relating to Scala). Sometime, the underlying APIs changed, and things are broken, you have to re-download a new nightly build and try ...

  1. Get the latest nightly build NetBeans from: http://bits.netbeans.org/download/trunk/nightly/latest/
  2. Open NetBeans, go to "Tools" -> "Plugins", check "Setting" to ensure "Last Development Build" is in the list of Update Centers, which with url: http://deadlock.netbeans.org/hudson/job/nbms-and-javadoc/lastStableBuild/artifact/nbbuild/nbms/updates.xml.gz
  3. Then in the "Available Plugins" tab, you can find the "Scala" category (or, you can click on "Name" in "Available Plugins" tab to find them. You may need to click "Reload Catalog" to get the latest available modules), check "Scala Kit" and click "Install", following the instructions. Restart IDE.

Get Maven Plugins working with Scala plugins

The Maven plugins for NetBeans works with Scala plugins, thus, Lift web application development is supported under NetBeans now.

To get Maven plugins for NetBeans, you can:

Do I Need to Set SCALA_HOME ?

The plugin kit has packaged a most recent stable Scala Development Kit (2.7.1 currently), if you'd like to build your Scala application via other Scala Development Kit, please follow steps:

1. Set SCALA_HOME

Set your SCALA_HOME environment variable, for example: /Users/dcaoyuan/apps/scala/share/scala/ (which contains sub-directory: bin, lib etc), to tell NetBeans using which Scala library to build your project.

1a. Set SCALA_HOME for MacOS X Applications

If you SCALA_HOME environment variable is not visible for your Applications/NetBeans, see Here

2. Set scala.home property

If you've set SCALA_HOME properly, but still encounter path error, you can try to set scala.home property: append "-J-Dscala.home=/path/to/your/scala/home" (for Windows users, try to append "-J-Dscala.home=%SCALA_HOME%") to the end of "netbeans_default_options" in your netbeans.conf file, where, "/path/to/your/scala/home" is your Scala home's absolute path. netbeans.conf is located at "pathToNetBeansInstallationDirectory/etc", in Mac OSX, it could be: /Applications/NetBeans/NetBeans\ 6.0.app/Contents/Resources/NetBeans/etc, or ~/SomePath/netbeans/etc

3. Download Scala standard source files

Download Scala standard source jar files via http://www.scala-lang.org/downloads/index.html, unpack it (do not unzip source jar files any more). Will look like

+ src
   + sbaz-src.jar
   + scala-compiler-src.jar
   + scala-dbc-src.jar
   + scala-decoder-src.jar
   + scala-library-src.jar

Screenshots

This is the caption of a resized image, click me

Documentations

1. Users

2. Developers

Developing Blogs

Source code

All source code is available at: http://hg.netbeans.org/main/contrib, under directories:

  • libs.scala
  • scala.console
  • scala.debug
  • scala.debug.projects
  • scala.editing
  • scala.kit
  • scala.platform
  • scala.project
  • scala.stdplatform
  • xtc

Change Log

Please see Change log for latest progressing.

Community

There is a Google group for Scala for NetBeans

How To Submit Issues

Check/Submit issues under top-level Component "languages" and "scala" subcomponent in NetBeans Issuezilla

Suggestions

  • I guess the module should be written in Scala, here is a sketch of the build infrastructure
    • Caoyuan: Done, there is a properly configured module at scala.core, which is start point to support writing in Scala
  • The scala needs to be packaged as a NetBeans module, create *libs.scala* just like libs.freemarker, etc.
    • Caoyuan: Done.

Attachments

ScalaBuild.diff Info on ScalaBuild.diff 11713 bytes
ScalaEditor_080729.png Info on ScalaEditor_080729.png 234136 bytes