Reorder
This commit is contained in:
@@ -73,19 +73,6 @@ fun UsageReplacementStrategy.replaceUsagesInWholeProject(
|
||||
})
|
||||
}
|
||||
|
||||
private fun UsageReplacementStrategy.doRefactoringInside(
|
||||
element: KtElement, targetName: String?, targetDescriptor: DeclarationDescriptor?
|
||||
) {
|
||||
element.forEachDescendantOfType<KtSimpleNameExpression> { usage ->
|
||||
if (usage.isValid && usage.getReferencedName() == targetName) {
|
||||
val context = usage.analyze(BodyResolveMode.PARTIAL)
|
||||
if (targetDescriptor == context[BindingContext.REFERENCE_TARGET, usage]) {
|
||||
createReplacer(usage)?.invoke()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun UsageReplacementStrategy.replaceUsages(
|
||||
usages: Collection<KtSimpleNameExpression>,
|
||||
targetPsiElement: PsiElement,
|
||||
@@ -196,3 +183,16 @@ private fun UsageReplacementStrategy.specialUsageProcessing(usage: KtSimpleNameE
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
private fun UsageReplacementStrategy.doRefactoringInside(
|
||||
element: KtElement, targetName: String?, targetDescriptor: DeclarationDescriptor?
|
||||
) {
|
||||
element.forEachDescendantOfType<KtSimpleNameExpression> { usage ->
|
||||
if (usage.isValid && usage.getReferencedName() == targetName) {
|
||||
val context = usage.analyze(BodyResolveMode.PARTIAL)
|
||||
if (targetDescriptor == context[BindingContext.REFERENCE_TARGET, usage]) {
|
||||
createReplacer(usage)?.invoke()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user