I had a similar problem in Intellij with my Scala code, where is the following:
import ExecutionContext.Implicits.global // TODO use own execution context
Formatted to:
import ExecutionContext.Implicits.global
// TODO use own execution context
I managed to stop this by noting Comment at first columnunder Keep when formatting:
