Update KotlinClassInnerStuffCache implementation

'KotlinClassInnerStuffCache' was copy-pasted from the platform's
'ClassInnerStuffCache' several years ago. After J2K and other changes,
it became quite dirty.

Besides cleaning things up, enum synthetic method handling have
significantly improved. Before, such methods were handled only in
'processDeclarationsInEnum', and 'getMethods()' didn't return them.
This led to inconsistent behavior and was reason for providing special
ad-hoc support in '1b6ded600518176b21cc308ed3e032ef8d04cc90'.
This commit is contained in:
Yan Zhulanow
2022-03-03 19:13:02 +09:00
parent 955d0841bd
commit fa4dadf9b7
12 changed files with 323 additions and 145 deletions
@@ -95,9 +95,6 @@ open class KtLightClassForDecompiledDeclaration(
lastParent: PsiElement?,
place: PsiElement
): Boolean {
if (isEnum) {
if (!KotlinClassInnerStuffCache.processDeclarationsInEnum(processor, state, myInnersCache)) return false
}
return PsiClassImplUtil.processDeclarationsInClass(
this, processor, state, null,
lastParent, place, PsiUtil.getLanguageLevel(place), false
@@ -4,8 +4,7 @@ package org.jetbrains.kotlin.analysis.decompiled.light.classes
import com.intellij.psi.PsiClass
import com.intellij.psi.PsiElement
import com.intellij.psi.impl.source.PsiExtensibleClass
import org.jetbrains.kotlin.asJava.classes.KtLightClass
import org.jetbrains.kotlin.asJava.classes.KtExtensibleLightClass
import org.jetbrains.kotlin.asJava.elements.KtLightElementBase
import org.jetbrains.kotlin.psi.KtClassOrObject
@@ -13,4 +12,4 @@ abstract class KtLightClassForDecompiledDeclarationBase(
override val clsDelegate: PsiClass,
clsParent: PsiElement,
final override val kotlinOrigin: KtClassOrObject?
) : KtLightElementBase(clsParent), PsiClass, KtLightClass, PsiExtensibleClass
) : KtLightElementBase(clsParent), PsiClass, KtExtensibleLightClass