Any option for formatting multiline concatenated strings like this?

Answered

(I'm using Kotlin, but this could apply to Java too.) Often I write DB driver calls with big strings. For example:

execute("update foo set completed_dt = toTimestamp(now()), " +
"result = 'ok' where id = ?", key)

But when IntelliJ reformats the code, it moves the second line this:

execute("update foo set completed_dt = toTimestamp(now()), " +
"result = 'ok' where id = ?", key)

Is there an option somewhere to keep those concatenated strings aligned? I poked around in the editor code style preferences but I didn't see anything.

0
2 comments

For Java it's controlled by this setting:

Similar setting is available for Kotlin.

2

Perfect, thank you!

0

Please sign in to leave a comment.