Light Classes: Fix equivalence check
Do not consider PsiClass equiavent to KtLightClass if it's not a light class as well #KT-16180 Fixed
This commit is contained in:
+1
-1
@@ -200,7 +200,7 @@ class KtLightClassForFacade private constructor(
|
||||
override fun getNavigationElement() = files.iterator().next()
|
||||
|
||||
override fun isEquivalentTo(another: PsiElement?): Boolean {
|
||||
return another is PsiClass && Comparing.equal(another.qualifiedName, qualifiedName)
|
||||
return another is KtLightClassForFacade && Comparing.equal(another.qualifiedName, qualifiedName)
|
||||
}
|
||||
|
||||
override fun getElementIcon(flags: Int): Icon? = throw UnsupportedOperationException("This should be done by JetIconProvider")
|
||||
|
||||
+2
-2
@@ -138,7 +138,7 @@ abstract class KtLightClassForSourceDeclaration(protected val classOrObject: KtC
|
||||
override fun getNavigationElement(): PsiElement = classOrObject
|
||||
|
||||
override fun isEquivalentTo(another: PsiElement?): Boolean {
|
||||
return another is PsiClass && Comparing.equal(another.qualifiedName, qualifiedName)
|
||||
return another is KtLightClassForSourceDeclaration && Comparing.equal(another.qualifiedName, qualifiedName)
|
||||
}
|
||||
|
||||
override fun getElementIcon(flags: Int): Icon? {
|
||||
@@ -506,4 +506,4 @@ fun KtClassOrObject.defaultJavaAncestorQualifiedName(): String? {
|
||||
isInterface() -> CommonClassNames.JAVA_LANG_OBJECT // see com.intellij.psi.impl.PsiClassImplUtil.getSuperClass
|
||||
else -> CommonClassNames.JAVA_LANG_OBJECT
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user