Strange Kotlin autoformatting
I am using IntelliJ IDEA 2024.1.6 (Ultimate Edition). For Kotlin code style, I chose to use drafults from Kotlin Coding Conventions.
I start with this code:
fun rollThreeUnfairDice(minValue: Int, maxValue: Int): Int {
return rollUnfairDie(minValue, maxValue) + rollUnfairDie(minValue, maxValue) + rollUnfairDie(minValue, maxValue)
}
When I do Code > Reformat Code, I get:
fun rollThreeUnfairDice(minValue: Int, maxValue: Int): Int {
return rollUnfairDie(minValue, maxValue) + rollUnfairDie(
minValue,
maxValue
) + rollUnfairDie(minValue, maxValue)
}
If I reformat again (removing custom line breaks), I get:
fun rollThreeUnfairDice(minValue: Int, maxValue: Int): Int {
return rollUnfairDie(minValue, maxValue) + rollUnfairDie(
minValue, maxValue
) + rollUnfairDie(minValue, maxValue)
}
Is this working as intended? I expected the three calls to be formatted the same way.
Please sign in to leave a comment.
Thank you! I failed to reproduce the problem. Can you attach your code style scheme - `Settings | Editor | Code Style | Kotlin | ⚙ | Export`?