Kotlin: Why are most variables underlined in Android Studio and how do I turn that off?

Android StudioSyntax HighlightingKotlin

Android Studio Problem Overview


I wanted to know why most variables in Kotlin are underlined. Some files contain a lot of underlining which is very annoying. If I hover my mouse over a variable it doesn't give any information most of the time. But on some it says "This property has a backing field" or "Value captured in a closure". Does anybody know how to disable those underlines? Here is a screenshot with what I mean: enter image description here

And realm is then underlined throughout the entire file.

Android Studio Solutions


Solution 1 - Android Studio

It's just Editor Preferences.

Edit:

This is moved to

Preferences -> Editor -> Color Scheme -> Kotlin -> Properties and Variables

enter image description here

Thanks rmirabelle for the comment

For the old plugin, you can go to

Preferences -> Editor -> Color Scheme -> Kotlin

Then find Var (mutable variable, parameter or property) and remove Underscored effect.

I guess they just try to discourage using var by adding the annoying underscored. :P

old plugin

Solution 2 - Android Studio

In Android Studio 3.1.2 this has been moved to -

Settings > Editor > Color Scheme > Kotlin

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionKevin van MierloView Question on Stackoverflow
Solution 1 - Android Studiopt2121View Answer on Stackoverflow
Solution 2 - Android StudioHrishikesh KadamView Answer on Stackoverflow