IDEA-371744 Primitive Bean definitions are not handled properly in Logical Structure

GitOrigin-RevId: 45939fff0fcd74ab3f8af0d27e063b0955fd7fa4
This commit is contained in:
Anton Kozub
2025-04-29 17:41:58 +02:00
committed by intellij-monorepo-bot
parent ae234f52bf
commit cb41c9db01

View File

@@ -75,6 +75,7 @@ class LogicalStructureNode(
private val subNodes = mutableListOf<LogicalStructureNode>()
private var childrenDontMatter = false
private var childrenOrderDontMatter = false
private var navigationElementSupplier: (() -> PsiElement?)? = null
fun subNode(subNode: LogicalStructureNode) {
@@ -98,6 +99,10 @@ class LogicalStructureNode(
childrenDontMatter = true
}
fun arbitraryChildrenOrder() {
childrenOrderDontMatter = true
}
fun navigationElement(element: PsiElement) {
navigationElementSupplier = { element }
}
@@ -136,8 +141,15 @@ class LogicalStructureNode(
}
if (!childrenDontMatter) {
if (subNodes.size != other.subNodes.size) return false
for (i in subNodes.indices) {
if (!subNodes[i].isEqualTo(other.subNodes[i], true, availableDepth - 1)) return false
if (childrenOrderDontMatter) {
return subNodes.all {
other.subNodes.any { otherSubNode -> it.isEqualTo(otherSubNode, true, availableDepth - 1) }
}
}
else {
for (i in subNodes.indices) {
if (!subNodes[i].isEqualTo(other.subNodes[i], true, availableDepth - 1)) return false
}
}
}
return true