Type-aware highlighting is a part of error highlighting that relies on type system.
Some errors can be found without using type information, for example:
Other errors, however, require a knowledge of entities type:
Type-aware highlighting allows to spot such errors before compilation.
Why isn’t it enabled by default?
The feature is in beta (or maybe in alpha) and sometimes may report “false errors” in regular code. Usually, such “errors” “found” only in a truly complex code, and, normally, everything works just fine.
Scala plugin doesn’t rely on compiler to analyze code. We’re implementing our own model of the language, and sometimes it’s challenging, especially when it comes to Scala’s type system and type inference (to size up the problem, you may try to formally “infer” a type of “foo”.map(_ + 1) expression by hand).
Should you enable it?
Unless such highlighting produces too much false “red code” in your project, you can benefit from better code analysis. It’s recommend to try type-aware highlighting in a particular project to evaluate whether it’s good there.
How to configure it?
In every project (with at least one Scala facet used) IDEA initially suggest to try type-aware highlighting, so you may configure it right off the bat:
You can always toggle type-aware highlighting using Ctrl+Alt+Shift+E shortcut or by clicking the highlighting icon on statusbar:
So, the truth is you have to remember that sometimes there’s no
To help us to fix a highlighting glitch you may report it to YouTrack as usual or by pressing Alt+Enter on wrong highlight:
IntelliJScala @ Scala Days 2023 Madrid
On September 12 – 14, the Scala Plugin team was in Madrid for the Scala Days conference. JetBrains was a Gold Sponsor for the event and we are very proud of it. We came to Madrid with a booth, merchandise, and a talk about the IntelliJ Scala Plugin. The Scala Plugin has seen a lot of improvements…
IntelliJ Scala Plugin 2023.2 Is Out!
Better Scala 3 Support IntelliJ IDEA 2023.2 brings enhanced Scala 3 support, with a focus on providing a streamlined development experience. Notable improvements include fixes for Scala 3 enum highlighting, navigation to enum definitions, and the correct resolution of enum cases in various contex…
IntelliJ Scala Plugin 2023.1 Is Out!
Improved support for braceless Scala syntax IntelliJ IDEA can now desugar braceless Scala code properly, and it handles refactorings where the “fewer braces” feature is used. It also supports braceless syntax in worksheets and correctly interprets indentation when you move extensions methods up a…
IntelliJ Scala Plugin 2022.3 Is Out!
This release has been again focused on Scala 3, but there are also quite a few other improvements. Better Scala 3 support In v2022.3, we’ve introduced a large number of upgrades to provide better Scala 3 support. The IDE now supports parameter untupling and quoted patterns, and it features man…