IDEA-382195 Expand all for Spring bean doesn't expand nodes

GitOrigin-RevId: b86925e4bb46162d9e0ab3253ace379890a440f6
This commit is contained in:
Anton Kozub
2025-11-17 14:34:11 +00:00
committed by intellij-monorepo-bot
parent 3e289e34f5
commit d7b7ab467a
3 changed files with 9 additions and 3 deletions
@@ -35,11 +35,11 @@ internal class StructureViewExpander(val project: Project): TreeExpander {
override fun expandAll() {
val tree = getActualTree() ?: return
val rootFile = (StructureViewComponent.unwrapValue(tree.model.root) as? PsiElement)?.containingFile?.virtualFile
TreeUtil.promiseExpand(tree, Int.Companion.MAX_VALUE) { path ->
TreeUtil.promiseExpand(tree, Int.MAX_VALUE) { path ->
val structureElement = StructureViewComponent.unwrapWrapper(path.lastPathComponent)
if (structureElement is LogicalStructureViewTreeElement<*>) {
val logicalModel = structureElement.getLogicalAssembledModel().model
if (logicalModel is ExtendedLogicalObject) return@promiseExpand false
if (logicalModel is ExtendedLogicalObject && logicalModel.isTargetToExternalElement()) return@promiseExpand false
}
val pathObject = StructureViewComponent.unwrapValue(path.lastPathComponent)
when (pathObject) {
@@ -12,6 +12,7 @@
- f:getTreeElement(java.lang.Object):com.intellij.ide.structureView.StructureViewTreeElement
*:com.intellij.ide.structureView.logical.model.ExtendedLogicalObject
- canRepresentPsiElement(com.intellij.psi.PsiElement):Z
- isTargetToExternalElement():Z
- isTheSameParent(java.lang.Object):Z
*:com.intellij.ide.structureView.logical.model.LogicalContainer
- a:getElements():java.util.List
@@ -5,7 +5,7 @@ import com.intellij.psi.PsiElement
import org.jetbrains.annotations.ApiStatus
/**
* Logical elements have not implement this class, but they can if they want to add some specific logic
* Logical elements don't have to implement this class, but they can if they want to add some specific logic
*/
@ApiStatus.Experimental
interface ExtendedLogicalObject {
@@ -22,4 +22,9 @@ interface ExtendedLogicalObject {
*/
fun canRepresentPsiElement(psiElement: PsiElement): Boolean = false
/**
* If the element is referencing to element from another file
*/
fun isTargetToExternalElement(): Boolean = false
}