Friday May 09, 2008

Scala for NetBeans Screenshot#12: Better Completion with More Types Inferred

>>> Updated May 11
Mostly, infix expressions can be type inferred now. CTRL+Click on infix op name, it will bring you to declaration (since 1.0.29.0)
===

Well, the type inference work is not so easy (with performance in mind), but anyway, I've got a bit more progress, at least, the chained member call can now be correctly inferred in a lot of cases. It's some level as Tor's JavaScript for NetBeans now.

First, let's create a val "node", which is a "scala.xml.Node"

nn

Then, input '.' to invoke completion, as I know which type is of "node", the proposal items look good.

nn

I choose "descendant" function (which returns a "List"), and input '.' again, we can see the proposal items look still good.

nn

These features also work on Java's class.

Known issues:

  • It seems the indexing/scanning for Scala standard library source will perform twice when you first installed Scala plugins
  • The type inference is not consistence yet, so don't be strange for the strange behavior sometimes

Again, don't forget to download scala standard library's source jars and unzip to $SCALA_HOME/src, per sub-folder per jar

Comments:

just wanted to thank you for your hard work! sun should hire you!

Posted by pk11 on May 10, 2008 at 03:06 AM PDT #

The progress in the last month was impressive, thank you so much!

Posted by Landei on May 11, 2008 at 11:20 PM PDT #

+1 on the impressive work.

I'm still unable to get the Scala interactive window to start - always get the array index out of bounds error.

Any tips?

Posted by 99.201.162.53 on May 13, 2008 at 03:21 AM PDT #

... just saw your note on a prior blog post.... I'll try the latest nightly build and see if the Scala Interactive Windows works - will post stack trace if it doesn't work on Vista.

Posted by 99.201.162.53 on May 13, 2008 at 04:16 AM PDT #

Interactive Scala window on Vista with NetBeans IDE Dev 200805121203 and JDK1.6.0_06 upon attempting to open Interactive Scala window:

java.lang.ArrayIndexOutOfBoundsException: 0
at java.lang.ProcessBuilder.start(ProcessBuilder.java:443)
at org.netbeans.modules.languages.execution.ExecutionService$2.run(ExecutionService.java:362)
[catch] at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)

Posted by 99.201.162.53 on May 13, 2008 at 09:53 AM PDT #

thank you for your great work
Im using ur plugin and at this point you're making a tool that the whole community will be using to get things off the ground.
your focus is refreshing and appreciated.

thank you

Posted by ivan_nyc on May 15, 2008 at 02:41 AM PDT #

Post a Comment:
Comments are closed for this entry.