(LightClass) KotlinShortNamesCacheTest fix for methods, referenced from companions and classes
This commit is contained in:
@@ -128,18 +128,10 @@ object LightClassUtil {
|
|||||||
return getPsiMethodWrappers(declaration).firstOrNull()
|
return getPsiMethodWrappers(declaration).firstOrNull()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getPsiMethodWrappers(declaration: KtDeclaration): Sequence<KtLightMethod> {
|
private fun getPsiMethodWrappers(declaration: KtDeclaration): Sequence<KtLightMethod> =
|
||||||
val classes = getWrappingClasses(declaration)
|
getWrappingClasses(declaration).flatMap { it.methods.asSequence() }
|
||||||
for (clazz in classes) {
|
.filterIsInstance<KtLightMethod>()
|
||||||
// the first class with methods found should contain all methods with kotlinOrigin, so no need to look after
|
.filter { it.kotlinOrigin === declaration }
|
||||||
val methods = clazz.methods
|
|
||||||
.filterIsInstance<KtLightMethod>()
|
|
||||||
.filter { it.kotlinOrigin === declaration }
|
|
||||||
if (methods.isNotEmpty())
|
|
||||||
return methods.asSequence()
|
|
||||||
}
|
|
||||||
return emptySequence()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun getWrappingClass(declaration: KtDeclaration): PsiClass? {
|
private fun getWrappingClass(declaration: KtDeclaration): PsiClass? {
|
||||||
if (declaration is KtParameter) {
|
if (declaration is KtParameter) {
|
||||||
|
|||||||
Reference in New Issue
Block a user