Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Redirect
locationhttps://www.jetbrains.com/help/idea/working-with-type-aware-highlighting.html
 
Scala type-aware highlighting lets you get an error analysis based on the Scala's type system before you start a compilation process.

...

  • On the project level, by selecting the appropriate check box on the first page of the project wizard or by clicking the  icon on the status bar.
  • On the file level of your project, by clicking the   icon on the status bar. 
  • Locally in Editor, by using  

    Wiki Markup
    {span:class=shortcut}Surround With{span}
     action.

1.How to Enable or Disable Type-Aware Highlighting on the Project Level

On the first page of the new project wizard, you can see a check box 

Wiki Markup
{span:class=shortcut}Enable type-aware highlighting{span}
, by default, it is selected.  If you need to disable the type-aware highlighting, simply uncheck this option.

 You can always enable or disable a type-aware highlighting for your project by clicking  icon on the status bar or using a

Wiki Markup
{span:class=shortcut}Ctrl{span}
+
Wiki Markup
{span:class=shortcut}Alt{span}
+
Wiki Markup
{span:class=shortcut}Shift{span}
+
Wiki Markup
{span:class=shortcut}E{span}
 shortcut.

...

 You can enable or disable the type-aware highlighting for the specific file in your project. To do that, open the file and on the status bar click  Hector icon. If you disable Hector, then the type-aware highlighting will be also disabled. 

 

Each time you enable or disable the type-aware highlighting, you can see the notification of the status's change in the Event log:

3. How It Works

Let's see how it works:

 

...

You can also enable the higlighting based on expression type inference. Consider the following example:


 As the pop-up message suggests, the expression type is wrong and is highlighted.

4. How to Disable Type-Aware Highlighting Locally

You can disable the type-aware highlighting locally using Surround With action. To do that, highlight the code and on the main menu select

Wiki Markup
{span:class=shortcut}Code{span}
Wiki Markup
{span:class=shortcut}Surround With{span}
.  When
Wiki Markup
{span:class=shortcut}Surround With{span}
 window opens, select
Wiki Markup
{span:class=shortcut}/ * _ * /.../ * _ * /{span}
 option from the list. Consider the following example:

After you've selected the apporpriate option your code looks like this :

As a result, the error is not highlighted.