Open hongping-quora opened 2 months ago
@nreid260, do you think this is a bug or within your expectations?
This is working as intended, at least for now. The Google Kotlin style committee preferred that single-element lists never got trailing commas. However, there's no technical reason to do this, only aesthetic, so they could be convinced otherwise.
One technical constraint was that I explicitly wanted to remove the "hinting" behaviour or trailing commas. --google-style totally manages trailing commas, based on the rest of the code. If you really want to force a line-break, //
is still available.
Using the ktfmt IntelliJ plugin 1.1.0.47 in Android Studio, setting "Code style" to "Google (internal)"
private class AllowlistedDiskReadsSharedPreferences( private val wrappedPreferences: SharedPreferences, ) : SharedPreferences by wrappedPreferences
import android.content.SharedPreferences
private class AllowlistedDiskReadsSharedPreferences( private val wrappedPreferences: SharedPreferences, private val wrappedPreferences2: SharedPreferences, ) : SharedPreferences by wrappedPreferences