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
In our projects we create fairly big string templates to generate our SQL queries. However, autoformatting these strings rarely end up looking good.
Expected Behavior
fun indentTest(ids: List<String>?) = """
SELECT * foo
FROM bar
WHERE
${when (ids) {
null -> "TRUE"
emptyList<String>() -> "FALSE"
else -> "some_ids IN (:doc_ids)"
}}
""".trimIndent()
Observed Behavior
fun indentTest(ids: List<String>?) = """
SELECT * foo
FROM bar
WHERE
${
when (ids) {
null -> "TRUE"
emptyList<String>() -> "FALSE"
else -> "some_ids IN (:doc_ids)"
}
}
""".trimIndent()
Your Environment
Version of ktlint used: 0.42.1
The text was updated successfully, but these errors were encountered:
Right now I am disabling the indent rule for all our files containing SQL-queries. Is there any way to just ignore multiline strings in .editorconfig instead?
There is no way to disable indentations of the multiline strings only. The problem seems to be identical to a situation which I had myself a few weeks ago. A complex ${...} like your example gets additional newline while this does not happen a simple reference of a object property. I am not sure whether that is a regression bug or something which never has been implemented.
In our projects we create fairly big string templates to generate our SQL queries. However, autoformatting these strings rarely end up looking good.
Expected Behavior
Observed Behavior
Your Environment
The text was updated successfully, but these errors were encountered: