When working on Android project, you may encounter situations where you’ve declared several variables or functions with direct value.
For instance,
val number = 10
fun getLuckyNumber(from: Int) = Random.Default.nextInt(from)
Here, you are not explicitly stating the type of variable or function.
Meet Inlay Hints
Inlay hints are special markers that appear in the editor and provide you with additional information about your code, like the names of the parameters that a called method expects. Other types of hints inform you about annotations, method parameters, usages, and so on.
To enable Inlay hints for types (or other feature)
1. Press Ctrl+Alt+S (or go to File -> Settings) to launch Settings window.
2. Go to Editor -> Inlay Hints -> Kotlin (or Java)
3. Check every box under Types.