Code completion in scala console

Are there any plans to extend the scala console with code completion?
I find myself using the console more than I initially expected.

8 comments
Comment actions Permalink

Slightly off topic, but do the interactive consoles for any of the language plugins provide features like command history and completion? I haven't seen any, and it seriously limits their usefulness IMO. A good example of how to do this would be excellent.

I suspect that completion is a different beast in the console than when editing, since it requires knowledge of both the language and also the current state of the interpreter environment. Without some sort of agent in the environment (as SLIME for EMACS uses) I suspect this may not be possible to do totally correctly. Still, just language completion would probably be a big step.

Cheers,
Colin

0
Comment actions Permalink

For all language consoles in IDEA this features will be implemented in version 10. Sorry for this big delay. It's possible that I implement completion for Scala like in IntelliJ IDEA 8 scala plugin, where it was implemented.

Best regards,
Alexander Podkhalyuzin.

0
Comment actions Permalink

Hi Alexander,

That's great to hear - I guess that makes it the first "unofficially disclosed" IDEA 10 feature ;-)

By the way, the improved type resolving in recent builds is really great.
Having improved performance in the future will make Scala support in IDEA a pleasure to use.

-tt

0
Comment actions Permalink

I don't know if it fits in with IDEA but Scala's build in REPL (console) has completion features in the soon to be released 2.8 version:

http://www.scala-lang.org/node/2097

Maybe you could just use that?

Thanks, Nick.

0
Comment actions Permalink

I wasn't aware of that feature coming with 2.8.
Is it already included in recent nightly builds?

Thinking about using it from IDEA, tab key for completion will probably not work very well inside the IDEA UI.

Apart from that, there are a few IDEA-specific features that could be provided:
* Go to declaration (Ctrl-B)
* Class name completion (Ctrl-Alt-Space)
* Smart completion
* Ctrl-Shift-I / Ctrl-Q / etc

Also IDEA already has internal index structure, while the scala console will implement its own.
-tt

0
Comment actions Permalink

I am virtually certain that completion will not work when the Scala REPL is running embedded in IDEA.

I'd be happy to be shown wrong, though. (I can't test it 'cause I'm still using IDEA 8.1.x and Scala 2.7.)


Randall Schulz

0
Comment actions Permalink

TarasT wrote:

I wasn't aware of that feature coming with 2.8.
Is it already included in recent nightly builds?


Yes, it has been available for several months in the nightly builds of 2.8.


Randall Schulz

0
Comment actions Permalink

Hi.

It certainly doesn't work at the moment in idea. I was really just suggesting that if you require code completion on the console, you should use scala's built in REPL once 2.8 is released.

The disadvantage of this is that you have to set up your classpath manually.

Thanks, Nick.

0

Please sign in to leave a comment.