View Source

{note}Scala plugin 0.4.595 or later is required ([download|http://confluence.jetbrains.net/display/SCA/Scala+Plugin+Nightly+Builds+for+IDEA+X]){note}

h4. What is type aware highlighting?

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:
{panel:bgColor=white}
!errors.png!
{panel}

Other errors, however, require a knowledge of entities type:
{panel:bgColor=white}
!errors2.png!
{panel}

Type-aware highlighting allows to spot such errors before compilation.

h4. 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.

{info}
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).
{info}

h4. 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.

h4. 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:

!suggestion.png!

You can always toggle type-aware highlighting using Ctrl+Alt+Shift+E shortcut or by clicking the highlighting icon on statusbar:

!bar.png!

There's a notification shown on each highlighting status change:

!change.png!

h4. How to deal with false errors?

So, the truth is you have to remember that sometimes there's no -spoon- error.
To help us to fix a highlighting glitch you may report it to [YouTrack|http://youtrack.jetbrains.net/issues/SCL] as usual or by pressing Alt+Enter on wrong highlight:
{panel:bgColor=white}
!report.png!
{panel}