New Scala Plugins for NetBeans are Available for Public Test, and Fortress, Erlang

>>> Updated Apr 22
Due to the incompatibly changes of NetBeans underlaying modules, Scala plugins can not be installed/updated on NetBeans 6.1 any more, you should get the latest nightly build to play with Scala plugins.
===

>>> Updated Apr 19

  • Fixed some broken syntax
  • Fixed NPE caused by brace completion
  • Fixed indentation of case class/object
  • Added formatting options ("Preference" -> "Scala" -> "Formatting")
Please update your Scala Editing plugin to version 1.0.19 which will be available after NetBeans hudson building.
===

The new written Scala plugins for NetBeans are available for public test now, which can be installed on NetBeans 6.1 RC, and latest NetBeans nightly build. To get start, please visit http://wiki.netbeans.org/Scala

The following features are ready for test:

  • Syntax highlighting
  • Auto-indentation
  • Brace completion
  • Formatter
  • Outline navigator
  • Occurrences mark for local variables and functions
  • Instance rename for local variables and functions
  • Go-to-declaration for local variables and functions
  • Scala project
  • Basic debugger

And with known issues:

  • Auto-completion it not fully supported yet and not smart
  • There is no parsing errors recovering yet
  • Semantic errors are not checked on editing, but will be noticed when you build project
  • Due to the un-consistent of Scala's grammar reference document, there may be some syntax broken issues

BTW, Fortress editing plugin is also available on "Last Development Build" update center, see the installation part of http://wiki.netbeans.org/Scala to get it installed. It's a very alpha stage plugin.

And, Erlang plugins are also available from "Last Development Build" update center too, that is, you can install and use Erlang plugins with Ruby, Scala, JavaScript on the same NetBeans IDE (6.1 RC or nightly build). Thanks to Tor's work, the indexing performance has been improved a lot.

Erlang plugin will be rewritten in the near future too.

Comments

1. Michael Nischt -- 2008-04-18 09:00

Great work again!

Man, I really hope you are already hired by SUN or some other NB related company. Otherwise they should try get your full-time ASAP!

2. Caoyuan -- 2008-04-18 09:00

Michael,

I code for interesting, and I have a lot of other interesting too.

I don't think I can work in office any more :-)

3. Jesper Nordenberg -- 2008-04-18 09:00

I just tested the plugin. Nice work, I had some issues with it though (using the test code below):

<ul> <li>Goto declaration on doesn't work for Point or test (neither does instant renaming)</li> <li>When formatting the code, the code below case class is indented one level too much</li> <li>When putting a breakpoint at the "var p = ..." line and single stepping through the code, the local variables window shows incorrect toString for p and p2, and you can't inspect the members. However, if you put the breakpoint on the println line, it works fine.</li> <li>Is there a way to change indentation size from 4 to 2?</li> <li>Code completion doesn't work very well as you have written in the post.</li> </ul>

Other than that it looks really good!

<pre> package scalatest

object Main {

case class Point(x : Int, y : Int) {

def test(x2 : Int, y2 : Int) = Point(x + x2, y + y2)

}

def main(args: Array[String]) = {

var p = Point(10, 2) var p2 = p.test(3, 4) println("Hello, world! " + p2)

}

} </pre>

4. Landei -- 2008-04-18 09:00

Totally. Absolutely. Awesome.

The only small problem I have is when creating a new class, I get this:

<pre> package PACKAGE_NAME

class CLASS_NAME {

} </pre>

5. Caoyuan -- 2008-04-19 09:00

Jesper,

Indentation after case class has been fixed. There is also a formatting options panel now, please update Editing plugin to 1.0.19 when it's available.

6. Caoyuan -- 2008-04-19 09:00

Landei,

This has been fixed in Project plugin version 1.2.6

7. Landei -- 2008-04-21 09:00

Hi!

I have problems with updating. I can see the updates for Scala Project and Scala editing, but I get the following error:

<pre> Missing required modules for Plugin Common Scripting Language API: Common Scripting Language Support [module org.netbeans.modules.gsf/2 = 1] Missing required modules for Plugin Common Scripting Language Support: Common Scripting Language Support [module org.netbeans.modules.gsf/2 = 1] </pre>

8. David Bernard -- 2008-04-21 09:00

I try to install the plugin on nb 6.1RC2 (fresh install), add the update center with the url from wiki, but when I try to install I've got :

Missing required modules for Plugin Common Scripting Language API: Common Scripting Language Support [module org.netbeans.modules.gsf/2 = 1] Missing required modules for Plugin Common Scripting Language Platform Support: Common Scripting Language Support [module org.netbeans.modules.gsf/2 = 1] Missing required modules for Plugin Common Scripting Language Support: Common Scripting Language Support [module org.netbeans.modules.gsf/2 = 1]

And I don't see thoses modules in the list.

Help ???

Thanks for your work

PS: replace in the wiki "Reload Category" by "Reload Catalog"

9. Caoyuan -- 2008-04-21 09:00

It's again the module dependency issue, please wait for new modules be ready. I'll notice here after I test it on 6.1RC

10. Landei -- 2008-04-23 09:00

The plugin works MUCH MUCH MUCH better now!

One tiny problem: Could you please check the indentation concerning if statements? When I use it without brackets, I get something like this:

<pre>

if (condition) println("true") else println("false")

</pre>

Would be nice to get that:

<pre>

if (condition)

println("true")

else

println("false")

</pre>

Thank you so much!

11. Caoyuan -- 2008-04-23 09:00

The indentation of if is a known issue, which needs semantic information, I'm still thinking about if there is a better solution, so I leave it there, I'll fix it later.

12. Landei -- 2008-04-23 09:00

No problem. I got another one, also totally harmless:

<pre> class Test {

val s = <html>test</html>.toString()

} </pre>

is marked as a syntax error, but compiles without problems.

13. Caoyuan -- 2008-04-23 09:00

Landei,

Thanks for your report. The above issue has been fixed, please wait for Editing module version 1.0.21