Miha-x64 / Mikes_IDEA_extensions

IntelliJ IDEA: missing parts.
Apache License 2.0
34 stars 7 forks source link

Request: offer styling intention of function returning value directly, making the code shorter #34

Closed AndroidDeveloperLB closed 1 year ago

AndroidDeveloperLB commented 2 years ago

Requested this here too:

https://youtrack.jetbrains.com/issue/KTIJ-22314/Request-offer-styling-intention-of-returning-value-directly-making-the-code-shorter

Miha-x64 commented 2 years ago

to be offered globally

@AndroidDeveloperLB, what you mean?

AndroidDeveloperLB commented 2 years ago

@Miha-x64 I mean to offer to change to:

fun getSomeString(): String = "someString"

or

fun getSomeString() = "someString"

Of course, this should be optional.

Miha-x64 commented 1 year ago

I believe that having explicit types (especially for public declarations) is good.

AndroidDeveloperLB commented 1 year ago

It's a styling inspection. It's subjective if it is good or not. The IDE already shows the type.