Scala

Scala Plugins for NetBeans

Project Home and Binary Builds available

Project home: http://github.com/dcaoyuan/nbscala

Also, binary builds of the plugin can be found at:

http://sourceforge.net/projects/erlybird/files/nb-scala/

or

http://plugins.netbeans.org

Contents


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 (Window -> Other -> Interactive Scala Shell)
  • 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:

  • Plugins on NetBeans's 7.0
  • Cutting edge plugins on NetBeans nightly build version

Get Started with NetBeans 7.0

You need to get the plugin from the plugin portal: [1]

Get Started with NetBeans 6.9

http://wiki.netbeans.org/Scala69

Get Started with NetBeans 6.8

http://wiki.netbeans.org/Scala68v1

Get Started with NetBeans 6.7

http://wiki.netbeans.org/Scala67

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.

For every nightly built plugin, the following tips may be useful if you find something strange:

  1. Find the netbeans' user configuration path of your OS, it's recorded under PathOfNetBeansInstall/etc/netbeans.conf, for example:
netbeans_default_userdir="${HOME}/.netbeans/dev"
  1. Then remove the directory of ${HOME}/.netbeans/dev, restart netbeans, re-install scala plugin.

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

Maven + 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:

  • Get Maven plugins directly from Update Center. "Tools" -> "Plugins" -> "Available Plugins" (Input "maven" in search box to find it)
  • To download and attach source packages from the maven repository, right-click on the "Libraries" node and select "Download All Library Sources". This can be done from the "Test Libraries" and "Runtime Libraries" nodes as well. Once the source packages are downloaded, you can drill down to a particular class and double-clicking it will open the corresponding source code.

Source code

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

main
  + contrib
      + libs.scala
      + scala.console
      + scala.debug
      + scala.debug.projects
      + scala.editor
      + scala.kit
      + scala.platform
      + scala.project
      + scala.stdplatform
      + xtc

How to build Scala plugin from source

NetBeans' scala pluings are under NetBeans' structured source tree, that is, you should have whole Netbeans main source to build it. The steps are:

# check/set ANT_OPTS, make sure it has enough memory setting, for example:
#    ANT_OPTS='-Xmx1024M -XX:PermSize=1024M -XX:MaxPermSize=1024M'

mkdir nbsrc
cd nbsrc
hg clone http://hg.netbeans.org/main

cd main
hg clone http://hg.netbeans.org/main/contrib

# If you'd like to build a basic NetBeans main (enough for Scala plugin development), create a user.build.properties file under main/nbbuild as:
cluster.config=basic

# make sure you are under nbsrc/main directory, then build NetBeans itself first:
ant clean build

# then, build all scala plugins by:
cd contrib/scala.kit
ant scala-clean
ant scala-build
ant scala-nbm

# after "ant scala-nbm", all scala nbm* will be under directory: contrib/scala.kit/build 

How to debug into Scala's compiler, library sources

If you have a project that want to debug into Scala's compiler, library sources, you could do when in debugging: In debugging, open debugging source windows via: "Windows" -> "Debugging" -> "Sources". Go through the listed source jars, find ".../scala-compiler.jar" and ".../scala-library.jar", check them.

Screenshots

Documentations

1. Users

2. Developers

Developing Blogs

Change Log

Please see Change log for latest progressing.

Community

Use scala-tools mailing list, add [netbeans] as the head of subject for Scala for NetBeans

How To Submit Issues

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

Suggestions

  • 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.
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo