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

(cherry picked from commit 45939fff0fcd74ab3f8af0d27e063b0955fd7fa4)

IJ-CR-162775

GitOrigin-RevId: 9266de7006088022ae51c5fced0a3718183a513b
This commit is contained in:
Anton Kozub
2025-04-29 17:41:58 +02:00
committed by intellij-monorepo-bot
parent 903b720631
commit d53847d2cf

View File

@@ -74,6 +74,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) {
@@ -97,6 +98,10 @@ class LogicalStructureNode(
childrenDontMatter = true
}
fun arbitraryChildrenOrder() {
childrenOrderDontMatter = true
}
fun navigationElement(element: PsiElement) {
navigationElementSupplier = { element }
}
@@ -135,8 +140,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