in core/src/main/java/com/facebook/ktfmt/format/KotlinInputAstVisitor.kt [1618:1641]
override fun visitModifierList(list: KtModifierList) {
builder.sync(list)
var onlyAnnotationsSoFar = true
for (child in list.node.children()) {
val psi = child.psi
if (psi is PsiWhiteSpace) {
continue
}
if (child.elementType is KtModifierKeywordToken) {
onlyAnnotationsSoFar = false
builder.token(child.text)
} else {
visit(psi)
}
if (onlyAnnotationsSoFar) {
builder.breakOp(Doc.FillMode.UNIFIED, " ", ZERO)
} else {
builder.space()
}
}
}