[LC] Fix for light classes equivalence
This commit is contained in:
+3
-3
@@ -190,9 +190,9 @@ open class KtLightClassForFacade constructor(
|
||||
|
||||
override fun getNavigationElement() = firstFileInFacade
|
||||
|
||||
override fun isEquivalentTo(another: PsiElement?): Boolean {
|
||||
return another is KtLightClassForFacade && Comparing.equal(another.qualifiedName, qualifiedName)
|
||||
}
|
||||
override fun isEquivalentTo(another: PsiElement?): Boolean =
|
||||
equals(another) ||
|
||||
(another is KtLightClassForFacade && another.facadeClassFqName == facadeClassFqName)
|
||||
|
||||
override fun getElementIcon(flags: Int): Icon? = throw UnsupportedOperationException("This should be done by JetIconProvider")
|
||||
|
||||
|
||||
+5
-3
@@ -123,9 +123,11 @@ open class KtLightClassForScript(val script: KtScript) : KtLazyLightClass(script
|
||||
override fun getNavigationElement() = script
|
||||
|
||||
override fun isEquivalentTo(another: PsiElement?): Boolean =
|
||||
another is PsiClass && Comparing.equal(another.qualifiedName, qualifiedName)
|
||||
equals(another) ||
|
||||
(another is KtLightClassForScript && fqName == another.fqName)
|
||||
|
||||
override fun getElementIcon(flags: Int): Icon? = throw UnsupportedOperationException("This should be done by JetIconProvider")
|
||||
override fun getElementIcon(flags: Int): Icon? =
|
||||
throw UnsupportedOperationException("This should be done by JetIconProvider")
|
||||
|
||||
override val originKind: LightClassOriginKind get() = LightClassOriginKind.SOURCE
|
||||
|
||||
@@ -174,7 +176,7 @@ open class KtLightClassForScript(val script: KtScript) : KtLazyLightClass(script
|
||||
return false
|
||||
}
|
||||
|
||||
val lightClass = other as KtLightClassForScript
|
||||
val lightClass = other as? KtLightClassForScript ?: return false
|
||||
if (this === other) return true
|
||||
|
||||
if (this.hashCode != lightClass.hashCode) return false
|
||||
|
||||
+5
-6
@@ -152,14 +152,13 @@ abstract class KtLightClassForSourceDeclaration(
|
||||
|
||||
override fun getNavigationElement(): PsiElement = classOrObject
|
||||
|
||||
override fun isEquivalentTo(another: PsiElement?): Boolean {
|
||||
return kotlinOrigin.isEquivalentTo(another) ||
|
||||
another is KtLightClassForSourceDeclaration && Comparing.equal(another.qualifiedName, qualifiedName)
|
||||
}
|
||||
override fun isEquivalentTo(another: PsiElement?): Boolean =
|
||||
kotlinOrigin.isEquivalentTo(another) ||
|
||||
equals(another) ||
|
||||
(qualifiedName != null && another is KtLightClassForSourceDeclaration && qualifiedName == another.qualifiedName)
|
||||
|
||||
override fun getElementIcon(flags: Int): Icon? {
|
||||
override fun getElementIcon(flags: Int): Icon? =
|
||||
throw UnsupportedOperationException("This should be done by JetIconProvider")
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
|
||||
Reference in New Issue
Block a user