Formatter: support trailing comma in type parameters

#KT-34744
This commit is contained in:
Dmitry Gridin
2019-12-26 20:00:33 +07:00
parent 58058eef21
commit b99c7f8d14
6 changed files with 765 additions and 0 deletions
@@ -615,6 +615,10 @@ abstract class KotlinCommonBlock(
trailingCommaWrappingStrategyWithMultiLineCheck(LBRACKET, RBRACKET)(childElement)
}
elementType === TYPE_PARAMETER_LIST -> return { childElement ->
trailingCommaWrappingStrategyWithMultiLineCheck(LT, GT)(childElement)
}
elementType === SUPER_TYPE_LIST -> {
val wrap = Wrap.createWrap(commonSettings.EXTENDS_LIST_WRAP, false)
return { childElement -> if (childElement.psi is KtSuperTypeListEntry) wrap else null }