Try to postpone activating decompiler from light element equivalence
This commit is contained in:
+8
-1
@@ -54,7 +54,10 @@ interface LightMemberOrigin : LightElementOrigin {
|
||||
val auxiliaryOriginalElement: KtDeclaration? get() = null
|
||||
|
||||
fun isValid(): Boolean
|
||||
|
||||
fun isEquivalentTo(other: LightMemberOrigin?): Boolean
|
||||
fun isEquivalentTo(other: PsiElement?): Boolean
|
||||
|
||||
fun copy(): LightMemberOrigin
|
||||
}
|
||||
|
||||
@@ -68,7 +71,11 @@ data class LightMemberOriginForDeclaration(
|
||||
|
||||
override fun isEquivalentTo(other: LightMemberOrigin?): Boolean {
|
||||
if (other !is LightMemberOriginForDeclaration) return false
|
||||
return originalElement.isEquivalentTo(other.originalElement)
|
||||
return isEquivalentTo(other.originalElement)
|
||||
}
|
||||
|
||||
override fun isEquivalentTo(other: PsiElement?): Boolean {
|
||||
return originalElement.isEquivalentTo(other)
|
||||
}
|
||||
|
||||
override fun copy(): LightMemberOrigin {
|
||||
|
||||
+3
-7
@@ -70,13 +70,9 @@ abstract class KtLightMemberImpl<out D : PsiMember>(
|
||||
}
|
||||
|
||||
override fun isEquivalentTo(another: PsiElement?): Boolean {
|
||||
if (lightMemberOrigin?.originalElement?.isEquivalentTo(another) == true) return true
|
||||
|
||||
val isEquivalentByOrigin =
|
||||
another is KtLightMember<*> &&
|
||||
lightMemberOrigin?.isEquivalentTo(another.lightMemberOrigin) == true
|
||||
|
||||
return isEquivalentByOrigin || this == another
|
||||
return this == another ||
|
||||
lightMemberOrigin?.isEquivalentTo(another) == true ||
|
||||
another is KtLightMember<*> && lightMemberOrigin?.isEquivalentTo(another.lightMemberOrigin) == true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+9
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.idea.caches.lightClasses
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.PsiField
|
||||
import com.intellij.psi.PsiMember
|
||||
import com.intellij.psi.PsiMethod
|
||||
@@ -48,6 +49,14 @@ interface LightMemberOriginForCompiledElement<T : PsiMember> : LightMemberOrigin
|
||||
override val originKind: JvmDeclarationOriginKind
|
||||
get() = JvmDeclarationOriginKind.OTHER
|
||||
|
||||
override fun isEquivalentTo(other: PsiElement?): Boolean {
|
||||
return when (other) {
|
||||
is KtDeclaration -> originalElement?.isEquivalentTo(other) ?: false
|
||||
is PsiMember -> member.isEquivalentTo(other)
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
|
||||
override fun isValid(): Boolean = member.isValid
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user