Formatter: fix line break before value parameter with annotation
#KT-23811 Fixed
This commit is contained in:
@@ -594,12 +594,7 @@ abstract class KotlinCommonBlock(
|
||||
parentElementType === SECONDARY_CONSTRUCTOR
|
||||
) {
|
||||
val wrap = Wrap.createWrap(commonSettings.METHOD_PARAMETERS_WRAP, false)
|
||||
return { childElement ->
|
||||
if (childElement.elementType === VALUE_PARAMETER && !childElement.startsWithAnnotation())
|
||||
wrap
|
||||
else
|
||||
null
|
||||
}
|
||||
return { childElement -> wrap.takeIf { childElement.elementType === VALUE_PARAMETER } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -701,8 +696,6 @@ abstract class KotlinCommonBlock(
|
||||
}
|
||||
}
|
||||
|
||||
private fun ASTNode.startsWithAnnotation() = firstChildNode?.firstChildNode?.elementType == ANNOTATION_ENTRY
|
||||
|
||||
private fun ASTNode.isFirstParameter(): Boolean = treePrev?.elementType == LPAR
|
||||
|
||||
private fun wrapAfterAnnotation(wrapType: Int): WrappingStrategy {
|
||||
|
||||
Reference in New Issue
Block a user