News Releases Scala Scala programming

IntelliJ Scala Plugin 2024.1 Is Out!

It is nigh impossible to compare how much work goes into different releases of IntelliJ Scala Plugin (just as it is with any software). Sometimes, a lot of work results in only a small number of visible changes, while at the same time, it lays out the foundations for many more improvements in the next release. But even in light of this, the 2024.1 release of IntelliJ Scala Plugin seems bigger than usual. We worked on many fronts and came up with a long list of fixes and improvements.

Better Scala 3 Support

In the new release, we’ve fixed many issues related to how specific syntax cases in Scala 3 are handled. The improvements include the ability to recognize prohibited mixes of modifiers, calculate indentation depth, cut and paste operations without breaking indentation, and associate end markers with their syntax structures. We also improved the Scala 3 support in the debugger, and autocompletion now accurately handles some corner cases, such as when it is used together with the using and given keywords or with unapply signatures.

It's invalid to use the type of an anonymous parameter as an object reference
It’s invalid to use the type of an anonymous parameter as an object reference

And, we managed to solve the issue of correctly resolving Scala 3 classes from Java.

Scaladoc Enhancements

We’ve made a lot of minor improvements and fixes to how classes, traits, and method declarations are highlighted in Scaladoc popups and in the quick documentation popup. Nested generic parameters are now highlighted correctly, and field access modifiers are displayed. Additionally, the code inside Scaladoc blocks with triple braces now highlighted in the same way that standard Scala code is.

Scala code examples embedded in ScalaDoc is now highlighted as standard Scala
Scala code examples embedded in Scaladoc is now highlighted as standard Scala

Improved Compiler-Based Highlighting

With the help of the Scala compiler, we improved the error highlighting, aiming at providing a more stable experience and avoiding the occurrence of correct code being highlighted in red. Double compilation has been eliminated in BSP projects which use compiler error highlighting. We’ve added support for Scala 3 and Scala 2.13 compiler diagnostics. On top of that, you can now preview and apply quick fixes generated by the compiler – just like any other IDEA quick fixes.

Build tools improvements

IntelliJ Scala Plugin now adds a .gitignore file for new SBT projects. We fixed an issue where an exception was thrown when running Scala/JVM applications for the first time with “Use sbt for builds”, and we ensured that all of module’s transitive dependencies are inserted as direct dependencies during import. For BSP, we fixed an issue where the BSP module couldn’t become a dependency of the compiler integration module without causing a circular dependency.

Pinning the X-Ray Mode

We introduced the X-Ray mode in the last release. You can read more about it here. Now, we have added a way to turn X-Ray on and pin it by clicking on an icon in the top-right corner of the editor. If you like the X-Ray mode and use it often, you might find it more comfortable than keeping the Ctrl/Cmd key pressed down.

The project wizard: Scala 3 by default

When creating a new Scala project in IntelliJ Scala Plugin for the last couple of years, we showed the latest Scala 2 version by default. We knew that the support for Scala 3 needed to be improved and decided not to encourage new projects to be started in Scala 3. Nowadays, Scala 3 support in IntelliJ Scala Plugin is much better, and we can safely change that. New projects will now be, by default, started with Scala 3.3.x LTS.

We will now suggest Scala 3 for new Scala projects

Other Improvements

We’ve introduced new icons: one for the Scala language in the New Project wizard and another for SBT in View | Tool windows. Additionally, you’ll notice subtle enhancements in how inlay hints are presented, with rounded corners and improved alignment. Furthermore, we’ve added Scala documentation to the Settings | Editor | CodeStyle help page. In worksheets, compilation errors are once again reported correctly in the build window when using Scala 2.13.12, and imports are no longer incorrectly marked as unused before the first code compilation.

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