Home > Enterprise >  Android Studio : Kotlin autocomplete not working properly
Android Studio : Kotlin autocomplete not working properly

Time:10-17

Kotlin autocomplete in android studio isn't showing all available suggestion.

The same code snippet in Java suggests setErrorEnabled()

Kotlin autocomplete snippet

I tried restarting IDE, invalidate cache but still don't work as it used to do in Java.

How do I fix this?

CodePudding user response:

Use textPasswordInput.isErrorEnabled = true. Kotlin converts Java getters and setters into Kotlin properties. It still allows you to call setErrorEnabled but since the property syntax is preferred, it doesn’t include the setter method in the autocomplete. Notice your use of the setter is highlighted with a warning.

  • Related