Scala Plugin
Scala Plugin for IntelliJ IDEA and Android Studio
IntelliJ Scala Plugin 2021.2 Is Out!
This release has been focused on significantly improving our plugin’s Scala 3 support. There are also several new features, including a Package Search integration and optional compiler-based error highlighting.
Better Scala 3 support
Indexing of Scala 3 libraries is now fast, precise, and version-agnostic. You can now create both sbt and .idea-based Scala 3 projects, and create Scala 3 SDKs the normal way:
The editor can handle significant indentation better:
There are improvements in the debugger, formatter, REPL, auto-import, enums, extension methods, and many other areas:
That said, please keep in mind Scala 3 support is still a work in progress and not yet perfect.
-Xsource:3 option in Scala 2
The Scala plugin now supports Scala 3 constructs in Scala 2 projects – the -Xsource:3 compiler option (more info):
While this option is intended primarily to enable cross-compilation, you can use it for a gentle translation to Scala 3, or to future-proof your Scala 2 code.
Package Search for sbt
IntelliJ IDEA now comes with the Package Search plugin and sbt projects are supported. You can locate, add, upgrade, or remove library dependencies using the Dependencies tool window:
The integration also provides completion for dependencies, and can tell you when a new version of a library is available:
You can read more about Package Search support in our previous blog post.
Compiler-based highlighting
As is customary in the IntelliJ Platform, the Scala plugin has built-in error highlighting. It’s fast, lightweight, and supports all the standard IntelliJ IDEA features. However, because the Scala type system is so complex, the algorithm can sometimes report false errors. Although we’re constantly working on improving the implementation, the ability to use the Scala compiler for error highlighting may come in useful in some code bases:
Please note that, even though the compiler-based approach is more precise, it is slower, requires more resources, and doesn’t support features such as type diffs, quick-fixes, and inspections. So unless there are lots of false errors in the code, the built-in error highlighting is recommended.
Your feedback is very welcome, as always. Please report any issues you find to YouTrack. If you have any questions, feel free to ask us on Gitter.
Sincerely,
The IntelliJ Scala Plugin team