News Releases Scala Scala programming

IntelliJ Scala Plugin 2022.2 Is Out!

This release has been again focused on improving Scala 3 support, but there are also a few other improvements.

Better Scala 3 support

As of v.2022.2, IntelliJ IDEA can read match types from .tasty files, properly parse them, resolve type variables, use them as type arguments, support inspections, and show types as text.

On top of that, we’ve added support for Option-less extractors, type lambdas and polymorphic function types, type-level compiler intrinsics, and ? as a wildcard together with _ in Scala 2.13.9 and 2.12.16. Copy-pasted code is also now properly indented.

Compiler-based highlighting for Scala

Configuring a new compiler-based highlighting has been tuned for better resource usage. The IDE now respects the file highlighting settings defined by the user.  Compilation is now triggered in fewer cases and uses fewer background threads. The compilation scope has been reduced to the relevant module and source scope.

New Scala inspections

IntelliJ IDEA 2022.2 now warns you when a return keyword is being used inside an anonymous function to jump out of the function without executing all the code inside it. This is usually not an intended usage, and can lead to leaky implementation and hidden performance costs. 

There’s a new warning triggered when a private or class parameter shadows a superclass variable. Additionally, an error is displayed when you try to override a variable in a way that is forbidden by the compiler. These new warnings can be configured to be displayed if their respective compiler options (-Xlint:nonlocal-return and -Xlint:private-shadow) are present.

Safe Delete is now available for type parameters

The Safe Delete action removes an element from the definition and all of its calls. This action now also works for type parameters.

Splitting a comma-separated list of elements into separate lines

If you have a line of code that is excessively long because it contains a list of arguments or elements in a collection, you can now use the Put arguments on separate lines action from the popup menu to quickly split the list into multiple lines. The opposite is also possible – if you think a multi-line list is short enough, you can use the Put arguments on one line action to make them one line.

As always, your feedback is very welcome. Please report any issues you find to YouTrack. If you have any questions, feel free to ask us on Discord.

Happy developing!

The IntelliJ Scala plugin team