Bad indentation after annotation in incomplete declaration (KT-22322)
Same behavior is for any modifier in incomplete declaration. #KT-22322 Fixed
This commit is contained in:
@@ -94,6 +94,16 @@ abstract class KotlinCommonBlock(
|
||||
|
||||
fun isLeaf(): Boolean = node.firstChildNode == null
|
||||
|
||||
fun isIncomplete(): Boolean {
|
||||
if (isIncompleteInSuper()) {
|
||||
return true
|
||||
}
|
||||
|
||||
// An incomplete declaration is the reason when modifier list can become a class body child, otherwise
|
||||
// it's going to be a declaration child.
|
||||
return node.elementType == MODIFIER_LIST && node.treeParent?.elementType == CLASS_BODY
|
||||
}
|
||||
|
||||
fun buildChildren(): List<Block> {
|
||||
if (mySubBlocks != null) {
|
||||
return mySubBlocks!!
|
||||
@@ -451,6 +461,11 @@ abstract class KotlinCommonBlock(
|
||||
return blockList.asSequence()
|
||||
}
|
||||
|
||||
if (this.node.elementType == CLASS_BODY && node.elementType == MODIFIER_LIST) {
|
||||
// Some unfinished declaration
|
||||
println()
|
||||
}
|
||||
|
||||
return sequenceOf(buildSubBlock(node, childrenAlignmentStrategy, wrappingStrategy))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user