Anyone knows if it's possible to teach IntelliJ to...
# intellij
f
Anyone knows if it's possible to teach IntelliJ to stop weirdly reformatting function:
Copy code
callSomeFun("first argument", buildString {
    append("...")
    append("...")
})
I think that this is perfectly readable, but it always turns it into something else no matter the setting (well, except the don't do anything). Currently it would turn the above into:
Copy code
callSomeFun(
    "first argument",
    buildString {
        append("...")
        append("...")
    },
)
😞
âž• 1
e
but would Settings » Editor » Code Style » Kotlin » Wrapping and Braces » (Function declaration parameters | Function call arguments) be what you're looking for?
f
That's the one I tried, but with it I'm not even able to get the official style set. I use the following in the right pane to test things:
Copy code
fun f(a: String, b: String) {
    f("a", buildString {
        append("x")
        append("y")
        append("z")
    })
)
It always formats it like this:
Copy code
fun f(a: String, b: String) {
    f("arg",
        builsString {
            append("x")
            append("y")
            append("z")
        })
}
Which is yet again different. 😛
I also tried
ij_kotlin_call_parameters_wrap
in
.editorconfig
(and a few others) but none had any effect. I just removed the
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
to see if that helps, but to no avail.