In Android Studio, while I am working on a Java class when i press Alt + Enter and assign method parameters to class member fields.
But when I use Kotlin there are no suggestions to this functionality.
Could I create a new suggestion for this or is there any way to assign parameters to the fields?
Java class suggestion:

Kotlin class suggestion:

In kotlin you don't have to write a setter method in order to do this, that's probably why you don't get the suggestion.
In your example, if you wanted to have an authPresenter field with getters and setters, you'd declare it as a var and kotlin provides the rest:
class AuthenticationView(...) {
var authPresenter: AuthPresenter? = null
}
This gives us a nullable AuthPresenter. And the idiomatic way to call this:
val view = AuthenticationView(...)
view.authPresenter = AuthPresenter(...)
Under the covers, that call to .authPresenter = someObject is turned into setAuthPresenter(someObject).
If you were to call this from Java, you'd see the getAuthPresenter() and setAuthPresenter() automatically generated for you.
In short: the reason the reason the option isn't there for Kotlin, is because there is a more idiomatic way to do this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With