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

1. pk11 -- 2008-05-09 09:00

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

2. Landei -- 2008-05-11 09:00

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

3. -- 2008-05-12 09:00

+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?

4. -- 2008-05-12 09:00

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

5. -- 2008-05-12 09:00

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)

6. ivan_nyc -- 2008-05-14 09:00

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