Evaluate Expression feature for Scala

Evaluate expression feature is available now in build 0.5.180.

This feature is not fully implemented (and will not be in foreseeable future) and have beta quality, however even now it’s much more usable than it was using Java language.

Supported features:

  • Scala editor with debug context resolve/completion.
  • Add import action.
  • Conditional breakpoints.
  • Local variables evaluation, even from inner functions/classes (you don’t need to use $ anymore).
  • Local function calls.
  • Implicit conversions.
  • Default, named, implicit parameters for method calls.
  • New instance creation.
  • Boxing/unboxing of primitive values.
  • Primitive values calculations.
  • While/do/if statements.
  • Assign statements.

Unsupported features:

  • Pattern matching local value with one usage (It’s probably will be done).
  • Anonymous classes (It’s will not be done as in Java Evaluate Expression)
  • Anonymous functions (the same as for classes, however It’s slightly simpler than for classes, so unlikely, that it will be done, but it’s possible)
  • By-name parameters (it’s anonymous function, however It’s probably will be done)
  • Default, named, implicit parameters for constructors.
  • Pattern matching.
  • Variables/function declarations.
  • Dynamic method calls (I’m sure it will be fixed soon)

Look at this feature in action:

Is it possible using Java?

Posted in Uncategorized | Tagged | 4 Comments

Scaladoc web pages generation

This feature is available from build 0.5.142. Now you can generate Scaladoc html documentation for the entire project or custom scope from the IntelliJ IDEA.

To use it, select “Generate Scaladoc” from Tools menu. Then you will see configuration dialog:

After choosing output directory you can press OK and get documentation for your project.

Posted in Uncategorized | 4 Comments

Show implicit parameters action.

I’m glad to introduce to you new feature of Scala plugin, which is coming with builds 0.4.1480 and 0.5.111 (depends on IntelliJ IDEA version).

This called “Show implicit parameters action”, however it also can be called like “Go to passed implicit value”.

As usual using of this feature is very simple. Look at the following example:

Then you probably want to know, what is actually passed to foo call. So you can press Ctrl+Shift+P, and then you will get the result:

After that you can choose parameter for navigation.

Posted in Uncategorized | 4 Comments

Scala Language Console (Nika builds)

New scala console comes with build 0.5.89 (http://confluence.jetbrains.net/display/SCA/Scala+Plugin+Nightly+Builds+for+Nika).

Now you can use full featured editor for editing code in console (just instead of Enter, use Shift + Enter).

For example:

And after execution:

This comes only with Nika scala plugin builds (this is the first difference between Nika and IDEA X plugins).

Posted in Uncategorized | 6 Comments

Real FSC support

Usual Scala compilation never seems fast enough. There are two main reasons why:

  • It takes a lot of time to start Scala compiler and to process standard libraries.
  • Scala compiler doesn’t support selective recompilation.

The first problem is solved by FSC (Fast Scala Compiler). FSC runs a compilation daemon to avoid subsequent compiler instantiations (at the price of increased memory usage).

However, FSC still re-compiles everything you throw at it (usually – the whole project, even if you’ve changed a single file). To speed up compilation further, we need to use a selective recompilation, that is provided only by third-party tools (like SBT or IDE).

So, the combination of IDEA and FSC can provide lightning-fast Scala compilation.

Scala plugin has been supporting FSC for a long time. Kind of… It was hard to configure and use FSC, settings was vague and compilation daemon was … you know, uncontrollable. Now that things have changed.

We can setup either internal FSC server (per project) or external (possibly remote) one:

Then we may use that server in any module we want:

So we can mix FSC with ordinary Scala compilers (when there are multiple versions of Scala used or when we need special compilation settings for some modules).

IDEA automatically manages internal FSC servers – it starts an instance when needed and stops it on application exit (or project close). Additionally, we can manually start, stop or reset compilation daemon using a menu on FSC status icon:

Besides FSC status icon (a little gear-gauge in the status bar) we are receiving notifications on FSC events:

P. S. Mac users may need to configure the OS X firewall for FSC communication.

Posted in Uncategorized | 16 Comments

IDEA 11 Scala plugin version

Recently we finally published plugin for IDEA 11 (http://plugins.intellij.net/plugin/?idea&id=1347). This post is about current plugin development state.

Now we have two major development branches:

Until IDEA 11 release almost all bugfixes will be in both versions. However I’m sure it’s not the same statement about major features, because of dependency on IDEA.

Nightly builds will be for both plugin versions:

Posted in Uncategorized | 16 Comments

Some Smart Completion

It’s not just “Some Completion”, it’s about scala.Some.

In case if you have expected type Option[AnyType] you possibly have something of type AnyType and you want to use it like Some(anyTypeValue). So now you can invoke smart completion two times and you will see such possibilities

And then you will get

Posted in Uncategorized | 2 Comments

Global members class name completion in Scala

Recently such functionality was implemented in Java editor. And now it’s also available in the latest nightly build of Scala plugin.

This feature is about how to use global names fast. You can invoke Ctrl + Alt + Space (Class Name Completion) on any prefix of known global method or value

Then you can choose member to import it with prefix

Or you can press Alt+Enter and choose importing member statically

 

Posted in Uncategorized | 1 Comment

Update nightlies daily

Generally, we recommend using nightly builds of Scala plugin to stay up to date in cutting-edge features and bug-fixes. Most nightlies are rather stable and may often work even better than “officially stable” releases.

Although we can always download the latest nightly build and update Scala plugin by-hand, there is now a better way to get recent versions.

Just add “http://www.jetbrains.com/idea/plugins/scala-nightly.xml”
into Settings / Updates / Plugin Hosts:

After that, you can receive notifications on new plugin nightlies:

Update with pleasure :)

Posted in Uncategorized | 7 Comments

Scala vs Kotlin vs Scala plugin

There are some concerns in Scala community surrounding the introduction of Kotlin.

Besides arisen Scala vs Kotlin battle, there’s a question on whether JetBrains will continue to develop IntelliJ Scala plugin.

To settle the doubts we would like to announce that despite Kotlin’s claim that “Scala is too complex and it’s very hard to make a good tooling support for it” we will continue to do our best to provide an excellent Scala support in IntelliJ IDEA.

We really love Scala, and we hope that both languages are great enough to rule in their own niches.


Posted in Uncategorized | 13 Comments