Scala Plugin EAP Speeds Up Coding Assistance

Because of its nature, Scala code is really difficult to edit without proper coding assistance. And sometimes said assistance is too slow which makes it not that useful. That’s why we never stop improving our Scala plugin performance. This time we’ve reduced the time needed to provide coding assistance within methods with a defined return type. As a result, code completion and inspections in our latest EAP build now work much faster.



After (see how much faster it is, the animation is 100% real time snapshot):


To give the new EAP build a try, download it from the EAP page, or if you use the EAP plugin upgrade channel, upgrade from the IDE.

Develop with Pleasure!

Posted in EAP, New Features | Tagged , , , | 4 Comments

IntelliJ API to Build Scala Macros Support

Today we’ve released a new Scala plugin EAP build. With this build, we’re happy to introduce an API that extends the IDE coding assistance to custom Scala macros.

A macro is executed at compile-time and modifies the AST of your code: e.g. it can extend the class or its companion object with new methods or other code represented by the AST returned by the macro. Since IntelliJ IDEA’s coding assistance is based on static code analysis, the IDE is not aware of AST changes, and can’t provide appropriate code completion and inspections for the generated code.

Since macros are heavily used in some projects and libraries, we’ve added a special API to the platform that lets build IntelliJ plugins supporting particular macros. Using this API, we earlier added support for Monocle, and now Simulacrum:


Now, everyone can use this API to make their macros more friendly to their favorite IDE. To do that, you have to implement SyntheticMembersInjector, and register it in the plugin.xml file:

The Monocle and Simulacrum implementations will help you understand how to use the API. To help you with setting up a project, we’ve prepared a skeleton. You’re welcome to fork it, and add your implementation.

Once you’ve built a working plugin, it can be installed to the IDE via SettingsPluginsInstall plugin from disk…. If you want to share your plugin with other IntelliJ IDEA users, feel free to upload it to our plugin repository.

We’re eager to hear your feedback on the API. Feel free to share it either here in comments, on our discussion forum, or in the issue tracker.

In case you’d like to have particular macros supported by the Scala plugin, send us pull requests.

Develop with Pleasure!

Posted in EAP, New Features | Tagged , , , , , | 5 Comments

IntelliJ IDEA 15 EAP Adds Postfix Code Completion for Scala

For Java, in addition to the regular completion, IntelliJ IDEA provides so-called Postfix completion: it lets you modify a previously entered expression by adding a “postfix” to it and pressing Tab. This way you can transform your code without unnecessary backward caret jumps.

Many users’ve asked us to support this feature for Scala as well. You asked, we did it:


When a transformation can be applied to several expressions, the IDE will offer you a choice:


Postfix completion suggestions are included in the common completion list, and if you want to see only postfix completion applicable in the context, press Ctrl + J (Cmd + J for OS X):


To see the full list of postfix completion templates, go to Settings → Editor → General → Postfix Completion:


Remember, we welcome your feedback on our discussion forum and your bug reports in the issue tracker.

Develop with Pleasure!

Posted in EAP, New Features | Tagged , , | 3 Comments

Testing Improvements

We’ve recently improved the support for Scala tests in IntelliJ IDEA 15 EAP a bit. Read on to find out more details.

Statically computed expressions in scalaTest/specs2/uTest2 test names are now supported, which means that along with string constants you can use constructions like immutable string variables, concatenation, substring, stripSuffix, stripPrefix, toLowerCase, replace, or trim.


scalaTest/specs2/uTest2 tests and their hierarchy is displayed in the File Structure view when you click Show scala tests.


Don’t forget that your feedback is always welcome in our discussion forum and issue tracker.

Develop with Pleasure!

Posted in EAP, New Features | Tagged , , | 6 Comments

Debugging Lambdas and Macro Expansion Extractor

We have released a new EAP version of the Scala plugin for IntelliJ IDEA 15 EAP. Here is a couple of new features we have added:

Debugging: stopping at Lambda Expressions

When you add a breakpoint to a line that contains a lambda expression, the IDE offers you several options where it should stop. Choose any lambda expression if there are several of them, or stop at the whole line. You can use the Run to cursor function on a lambda expression as well.


You can use Ctrl+F8 to add a breakpoint. Then the lambda expression that the cursor is placed on will be selected in the list. Pressing Ctrl+F8 again will complete creating a breakpoint on the selected lambda.

Macro Expansion Extractor

Sometimes it’s useful to extract a macro expansion in the place where you are using it, which can help you debug the macro. Before using this, compile the code with “-Ymacro-debug-lite”.


Press Ctrl+Alt+Shift+Z with the cursor placed on the macro.


If the cursor is not on a particular macro, all macros in your file will be expanded.

Please, share your feedback in our discussion forums and issue tracker.

Develop with Pleasure!

Posted in EAP, New Features | Tagged , , | 6 Comments

Inline Refactoring for Type Aliases and Kind Projector Support

Scala Plugin 1.7 for IntelliJ IDEA 15 EAP brings you a number of new features and improvements, among which we’d like to highlight these two:

Inline refactoring for type aliases

Invoked just as any other inline refactoring, by placing the caret on an alias you want to inline and pressing Ctrl+Alt+N.
For now this refactoring is only available for non-parameterized types and for aliases that are used inside of the same class.

Kind projector support

Kind Projector is a Scala compiler plugin that provides an easy way to create type lambdas. Scala 1.7 plugin includes inspection that suggests to rewrite existing lambdas using the Kind Projector function syntax.
You can use the settings under Settings | Editor | Code Style to select whether you want to denote lambdas with the Lambda keyword, or the λ symbol.
Feel free to share your feedback in our discussion forums and issue tracker.

Develop with Pleasure!

Posted in EAP, New Features | Tagged , , | 2 Comments

Try Experimental SAM in Scala Plugin 1.7 for IntelliJ IDEA 15 EAP

If you being in the forefront of it all, and all includes the latest language and IDE features, you’re welcome to download IntelliJ IDEA 15 EAP, a very early preview of what the next big Java IDE is going to be like. Among other things, it brings you an update to the Scala plugin 1.7 we released yesterday.

One of the 1.7 highlights is the support for experimental single abstract method types (SAM) added in Scala 2.11:


This is the first version of the plugin available exclusively for IntelliJ IDEA 15 EAP. More new features are coming soon, so stay tuned. If you have feedback to share, please do so in our discussion forum and issue tracker.

Develop with Pleasure!

Posted in New Features | Tagged | 3 Comments

Scala 1.5 EAP: Coding Assistance for Interpolated Strings, New Inspections and Better SBT Support

If you’re using the EAP update channel, you might’ve noticed a new version of the  Scala plugin available. In addition to a bunch of bugfixes inside the new update you’ll also find a few nice new features.

Coding assistance for interpolated strings

Interpolated strings is a great feature of the Scala language. Better coding assistance for writing those interpolated strings is a new feature of IntelliJ IDEA. Now it’s possible to quickly turn a string to an interpolated string simply by adding a variable reference. Notice  that the IDE will take care of adding brackets:


We hope this additional coding assistance will save you some time.

New inspections for Scala Collections

Inspections help you spot potential problems in your code and find the code that smells. This is why we never stop adding new inspections: this time we’ve added several more that will ensure you treat Scala Collections properly:


SBT project auto-import

The SBT project auto-import (when enabled) has been triggered by any change in your SBT files, even if you just pressed a single keystroke. In our latest update we’ve changed it so the auto-import is now triggered only when your changes are physically saved (usually on frame deactivation).

We hope you’ll find all these changes useful. Please share your feedback on our discussion forum and submit found issues directly to the tracker.

To give this EAP update a try, just go to Settings (Preferences for OS X) → Languages & Frameworks → Scala → Updates → Plugin update channel, switch the EAP channel, and update the plugin.

 Develop with Pleasure!

Posted in EAP, New Features | Tagged , | 6 Comments

What to Check Out in Scala Plugin 1.4.x for IntelliJ IDEA 14 & 14.1

If you’ve already upgraded to IntelliJ IDEA 14.1 (released just a few days ago), you might’ve noticed (in addition to all of its awesome new features), a new Scala plugin update: v1.4.15.

The update brings you quite a few improvements for the Play framework support: fixed problems with running of the applications, and better yet, JavaScript injection to Play templates. 1.4.15 is the first of the planned series of Scala plugin updates that will be available exclusively for IntelliJ IDEA 14.1, because at this moment IntelliJ IDEA 14 only receives bug fixes, whereas the new feature development is entirely focused on 14.1. This also means more new features and improvements are on the way for it, so getting the 14.1 is a good idea (if you haven’t done this already.)

Now that I’ve already got your attention, I’d also like to review what’s exactly new in this Scala plugin version (in case you haven’t followed the EAP news.)

Continue reading

Posted in Uncategorized | Tagged , , , , | 35 Comments

Scala 1.4 EAP Brings Advanced Implicits Analyzer and Faster Play Compiler

We’re working on our next update for the Scala plugin, and today I want to share with you a fresh EAP build that brings two noticeable improvements: advanced analysis for implicit parameters and faster compilation for Play Framework.

Advanced Implicit Parameters Analyser

Now, when you call the Implicit Parameters action, in addition to the list of applicable implicit parameters you will see those that can’t be found:

Screen Shot 2015-03-02 at 20.20.51

Under the “Parameter not found” label you’ll find the list of possible implicits for this location. It distinguishes the following cases:

  • Fewer applicable implicits are found
  • Somewhere deep an implicit is not found or diverging
  • No applicable implicits found for this parameter

Compiler Server for Play Framework

Another improvement makes the compilation for Play applications blazingly fast, thanks to moving it to a separate process. Now every time we compile the project we don’t have to start SBT.

For the complete list of changes refer to Release Notes.

We hope you’ll find these changes useful. Don’t forget to write us back on our discussion forum or report any found bugs directly to the tracker.

In case you’d like to give a preview build a try, but don’t know how, switch to the EAP update channel via Settings (Preferences for OS X) → Languages & Frameworks → Scala → Updates → Plugin update channel.

 Develop with Pleasure!

Posted in EAP, New Features | Tagged , , | 7 Comments