You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a property wraps to two lines and has a custom getter or setter it should have the following indents:
private var savedAdapterState: PerformanceSpinnerSelections? =
savedStateHandle.get<PerformanceSpinnerSelections>(SAVED_ADAPTER_STATE)
set(value) {
field = value
savedStateHandle.set(SAVED_ADAPTER_STATE, value)
}
Observed Behavior
That's what ktlint wants:
private var savedAdapterState: PerformanceSpinnerSelections? =
savedStateHandle.get<PerformanceSpinnerSelections>(SAVED_ADAPTER_STATE)
set(value) {
field = value
savedStateHandle.set(SAVED_ADAPTER_STATE, value)
}
That's what Android Studio wants:
private var savedAdapterState: PerformanceSpinnerSelections? =
savedStateHandle.get<PerformanceSpinnerSelections>(SAVED_ADAPTER_STATE)
set(value) {
field = value
savedStateHandle.set(SAVED_ADAPTER_STATE, value)
}
Steps to Reproduce
The code above or really any code where a property is very long and has a custom setter/getter would work.
Your Environment
Version of ktlint used: 0.43.0
Name and version (or code for custom task) of integration used (Gradle plugin, Maven plugin, command line, custom Gradle task): custom gradle task from the ktlint documentation
Version of Gradle used (if applicable): Android tools build gradle 4.2.2, gradle 7.0.1
Operating System and version: mac os big sur (11.6)
The text was updated successfully, but these errors were encountered:
)
* Fix indentation of the body block/expression of the getter/setter of a property when that property is followed by an initializer on a separate line.
Closes#1335
* cleanup
Closes#1335
* Remove tests related to other (yet unresolved) issue
* Remove unused import
* merge master
Co-authored-by: = <=>
Expected Behavior
When a property wraps to two lines and has a custom getter or setter it should have the following indents:
Observed Behavior
That's what ktlint wants:
That's what Android Studio wants:
Steps to Reproduce
The code above or really any code where a property is very long and has a custom setter/getter would work.
Your Environment
The text was updated successfully, but these errors were encountered: