IntelliJ Scala Plugin 2020.1: Scala 3, Function Literal Highlighting, Unused Parameter Inspection, Smart Step Into, and BSP Support Improvements

Posted on by

While the key feature of the 2020.1 Scala plugin release is, of course, Scala 3 support, there are many features and improvements for all versions of Scala. Let’s take a closer look.

1. Scala 3 support

2. Fine-grained error highlighting for function literals

3. Unused Parameter inspection

4. Smart Step Into

5. BSP support improvements

Scala 3 support

Now that Dotty is destined to become Scala 3, we have started to work on full-fledged Scala 3 support. The Scala plugin now includes preliminary support for Scala 3: the new syntax, error highlighting, navigation, type info, and many other bread-and-butter IDE features:

Because both the language and the language support are still works in progress, we recommend using plugin nightly builds if you want to get new features and bug fixes as quickly as possible. You can use Settings | Languages | Scala | Update channels to switch to nightly builds (and you can revert to a more stable build at any time):

To try Scala 3, you can either create a new project via File | New | Project | Scala | Dotty, or clone the Dotty example project and open it in IntelliJ IDEA. If you have any questions about Scala 3 support, feel free to ask them in our Gitter.

Fine-grained error highlighting for function literals

Functional literals are used a lot in Scala. They are very similar to methods, and like methods they have separate parameters and bodies. But they are often treated as a single expression of function type, making it harder to locate and interpret errors:

In this release, we’ve introduced fine-grained error highlighting for function literals, which can help you pinpoint errors relying on clear and precise messages, instead of possibly obscure messages with function types.

Unused Parameter inspection

The Scala plugin has been able to show unused variables and methods for a long time. Now it can also spot unused parameters. Parameters that are not referenced inside a method or class are highlighted in gray:

In contrast to variables and methods, unused parameters are often the result of programming errors. So not only does this new inspection make your code cleaner, but it can also help you prevent errors.

Smart Step Into

In Scala, we often have multiple method calls on the same line. In such cases, using Step Into in the debugger is hardly convenient – you have to manually step into and then out of many methods before you reach the desired one.

In this release, Step Into has become Smart Step Into. You can simply choose a desired method, and the IDE will do the work:

BSP support improvements

We’ve improved BSP support. It now works more smoothly and with more projects and build tools. You no longer have to manually install Bloop to import sbt projects via BSP – the Scala plugin can convert such projects to Bloop format automatically. It’s now possible to cancel BSP builds from the Build tool window. Finally, you can view and manage BSP connections using the BSP widget:

And more!

There are many more improvements that are not included in this blog post but are included in the release. They make the plugin more polished and more pleasant to work with.

We would like to thank all contributors who helped us to make the Scala plugin better, namely: Krzysztof Romanowski, Tomasz Pasternak, Łukasz Wawrzyk, Ólafur Páll Geirsson, Ciprian Ciubotariu, Arseniy Pendryak, Andrei Ivanyuk, Wiem Zine El Abidine, and others.

Your feedback is very welcome, as always. Feel free to ask any questions in the intellij-scala Gitter. Report any bugs to YouTrack.

Sincerely,

The IntelliJ Scala plugin team