Minor. Better code in method.
This commit is contained in:
@@ -54,19 +54,17 @@ public val PsiReference.unwrappedTargets: Set<PsiElement>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun PsiReference.matchesTarget(target: PsiElement): Boolean {
|
public fun PsiReference.matchesTarget(candidateTarget: PsiElement): Boolean {
|
||||||
val unwrapped = target.unwrapped?.getOriginalElement()
|
val unwrappedCandidate = candidateTarget.unwrapped?.getOriginalElement() ?: return false
|
||||||
return when {
|
val targets = unwrappedTargets
|
||||||
unwrapped in unwrappedTargets ->
|
if (unwrappedCandidate in targets) return true
|
||||||
true
|
|
||||||
|
|
||||||
this is JetReference
|
if (this is JetReference) {
|
||||||
&& unwrappedTargets.any { it is PsiMethod && it.isConstructor() && it.getContainingClass() == unwrapped } ->
|
return targets.any {
|
||||||
true
|
it is PsiMethod && it.isConstructor() && it.getContainingClass() == unwrappedCandidate
|
||||||
|
}
|
||||||
else ->
|
|
||||||
false
|
|
||||||
}
|
}
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
fun AbstractJetReference<out JetExpression>.renameImplicitConventionalCall(newName: String?): JetExpression {
|
fun AbstractJetReference<out JetExpression>.renameImplicitConventionalCall(newName: String?): JetExpression {
|
||||||
|
|||||||
Reference in New Issue
Block a user