Friday Apr 18, 2008

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:

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!

Posted by Michael Nischt on April 18, 2008 at 12:36 PM PDT #

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 :-)

Posted by Caoyuan on April 18, 2008 at 01:50 PM PDT #

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


  • Goto declaration on doesn't work for Point or test (neither does instant renaming)

  • When formatting the code, the code below case class is indented one level too much

  • 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.

  • Is there a way to change indentation size from 4 to 2?

  • Code completion doesn't work very well as you have written in the post.

Other than that it looks really good!


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)
}

}

Posted by Jesper Nordenberg on April 18, 2008 at 02:57 PM PDT #

Totally. Absolutely. Awesome.

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


package __PACKAGE_NAME__

class __CLASS_NAME__ {

}

Posted by Landei on April 18, 2008 at 07:39 PM PDT #

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.

Posted by Caoyuan on April 19, 2008 at 02:13 PM PDT #

Landei,

This has been fixed in Project plugin version 1.2.6

Posted by Caoyuan on April 19, 2008 at 02:37 PM PDT #

Hi!

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


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]

Posted by Landei on April 21, 2008 at 09:20 AM PDT #

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"

Posted by David Bernard on April 21, 2008 at 09:36 AM PDT #

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

Posted by Caoyuan on April 21, 2008 at 10:01 AM PDT #

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:


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

Would be nice to get that:


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

Thank you so much!

Posted by Landei on April 23, 2008 at 12:54 PM PDT #

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.

Posted by Caoyuan on April 23, 2008 at 01:25 PM PDT #

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


class Test {
val s = <html>test</html>.toString()
}

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

Posted by Landei on April 23, 2008 at 09:19 PM PDT #

Landei,

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

Posted by Caoyuan on April 24, 2008 at 04:29 AM PDT #

Post a Comment:
Comments are closed for this entry.