Scala Plugin 1.2 RC Introduces Ahead-of-time Code Completion

With the just published Scala Plugin 1.2 RC build, we’re happy to pioneer a new kind of coding assistance, which we like to call “ahead of time” (AOT) code completion.

Have you ever noticed that unlike Java, in Scala we have to spend more time actually typing all the parameter and variable names? In Java we can always do this:

  1. automatically complete a type reference,
  2. then automatically complete a corresponding parameter or variable name.

Which is very quick and really convenient. Unfortunately, this won’t do in Scala directly because of these reasons:

  • order of variable type and name is reversed and,
  • type annotation is optional and therefore may never exist.

So everyone programming Scala was completely denied all of this completion coolness… until now. We’ve changed the rules: now it’s possible to automatically complete both the name and the type before actually adding a type reference (and that is why we call it “ahead of time” completion):


Basically, for class and method parameters you can imagine that autocomplete is invoked one step further, on the type reference, with a search string capitalized, so that:

  • you can start autocomplete either via “auto-popup”, or manually, by pressing Ctrl + Space,
  • you may press Ctrl + Space one more time, to broaden the scope of search,
  • it’s possible to start a search from the middle of type name (“element” for “element: PsiElement”),
  • it’s possible to use CamelHumps (“mEve” for “mouseEvent: MouseEvent”),
  • the type reference is automatically imported, if needed.

As for values and variables, we’ve modified the described algorithm so that no type annotation is inserted (only the name part is completed), and the search scope is reduced to explicitly imported classes:


This algorithm is still work in progress, so the current restrictions may be loosened after we get more intel from people who are actually using it.

The current implementation is available in Scala Plugin 1.2 RC. You may toggle the AOT completion via Settings / Scala / Core page.

So, now we can develop with even more pleasure, and we hope that other languages (yo Kotlin!) and IDEs will follow. Your suggestions are welcome!

About Pavel Fatin

Programming enthusiast, technology advocate. IntelliJ Scala plugin developer at JetBrains,
This entry was posted in EAP, New Features and tagged , . Bookmark the permalink.

9 Responses to Scala Plugin 1.2 RC Introduces Ahead-of-time Code Completion

  1. Kieron Robinson says:

    Great works guys! Can’t wait to try it out…

  2. Pingback: Scala Plugin for IntelliJ IDEA 1.2 RC 发布 | 我爱互联网

  3. Peter Gromov says:


  4. OlegYch says:

    Awesome! works very nicely

  5. Tatarinov Nikolay says:

    First of all, thank you for the work, and the fact that scala developers can enjoy scala coding in Intellij Idea (which is great tool).
    I just wanted to tell about user experience. Recently I hear many complaints about Idea 14 and updated scala plugin. Mostly they are about highlighting errors and integration issues with some popular scala frameworks(like play, shapeless and scalaz). Here is a link to russian-speaiking skype chat intended for scala developers . I think you could collect some valuable feedback directly from users here. It could be valuable and helpful for plugin improvement process.

  6. Randall Schulz says:

    Where is it? There is no 1.2.* on nor does a 1.2 release show up in

    Has the 1.2 plug-in been withdrawn?

    • Andrey Cheptsov says:

      Yes, it’s a bit confusing. Actually 1.1.382.2.RC1 is 1.2 RC1, and “1.1.382.2” here is a build number. Will update the page to eliminate misunderstanding.

  7. Pingback: Scala Plugin 1.2 for IntelliJ IDEA 14 发布 | 我爱互联网

  8. Matt says:

    Congratulations! the Scala plugin is coming along in leap and bounds. The only issue I still have with it is incorrect syntax errors in parboiled2 grammars, no doubt there are still some bugs in the macro expanding.

Leave a Reply

Your email address will not be published. Required fields are marked *