Allow search usages for declarations when correct isEquivalentTo
Now it's possible to do find usages for other languages when light
elements are used.
Revert efb36f4a49 and revise fix of KT-7983:
Don't consider local and non-local class with same fqn equivalent.
#KT-7983 Fixed
This commit is contained in:
@@ -86,7 +86,11 @@ fun PsiReference.matchesTarget(candidateTarget: PsiElement): Boolean {
|
||||
}
|
||||
|
||||
val targets = unwrappedTargets
|
||||
if (unwrappedCandidate in targets) return true
|
||||
|
||||
val manager = candidateTarget.manager
|
||||
if (targets.any { manager.areElementsEquivalent(unwrappedCandidate, it) }) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (element is KtLabelReferenceExpression && (element.parent as? KtContainerNode)?.parent is KtReturnExpression) {
|
||||
targets.forEach {
|
||||
@@ -97,9 +101,6 @@ fun PsiReference.matchesTarget(candidateTarget: PsiElement): Boolean {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Investigate why PsiCompiledElement identity changes
|
||||
if (unwrappedCandidate is PsiCompiledElement && targets.any { it.isEquivalentTo(unwrappedCandidate) }) return true
|
||||
|
||||
if (this is KtReference) {
|
||||
return targets.any {
|
||||
it.isConstructorOf(unwrappedCandidate)
|
||||
|
||||
Reference in New Issue
Block a user