[LL FIR] FileStructure: avoid redundant bodies visiting
We shouldn't try to find structure elements inside non-local declarations Only classes and scripts can have an inner structure ^KT-60611
This commit is contained in:
committed by
Space Team
parent
8832865e9a
commit
420b6d48c3
+6
-1
@@ -136,7 +136,12 @@ internal class FileStructure private constructor(
|
||||
override fun visitDeclaration(dcl: KtDeclaration) {
|
||||
val structureElement = getStructureElementFor(dcl)
|
||||
structureElements += structureElement
|
||||
dcl.acceptChildren(this)
|
||||
|
||||
// Go down only in the case of container declaration
|
||||
val canHaveInnerStructure = dcl is KtClassOrObject || dcl is KtScript
|
||||
if (canHaveInnerStructure) {
|
||||
dcl.acceptChildren(this)
|
||||
}
|
||||
}
|
||||
|
||||
override fun visitModifierList(list: KtModifierList) {
|
||||
|
||||
Reference in New Issue
Block a user