From 4fd221fc0c79cf355187dfae0c10fa8c1f8f2241 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Tue, 27 Feb 2018 17:33:18 +0300 Subject: [PATCH] Rename: Filter out destructuring references to parameters They shouldn't be renamed in any case #KT-15039 Fixed --- .../idea/refactoring/rename/RenameKotlinPropertyProcessor.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/rename/RenameKotlinPropertyProcessor.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/rename/RenameKotlinPropertyProcessor.kt index b97feb4a202..236909d5ea7 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/rename/RenameKotlinPropertyProcessor.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/rename/RenameKotlinPropertyProcessor.kt @@ -46,6 +46,7 @@ import org.jetbrains.kotlin.idea.core.getDeepestSuperDeclarations import org.jetbrains.kotlin.idea.core.isEnumCompanionPropertyWithEntryConflict import org.jetbrains.kotlin.idea.refactoring.checkSuperMethodsWithPopup import org.jetbrains.kotlin.idea.refactoring.dropOverrideKeywordIfNecessary +import org.jetbrains.kotlin.idea.references.KtDestructuringDeclarationReference import org.jetbrains.kotlin.idea.references.KtReference import org.jetbrains.kotlin.idea.references.KtSimpleNameReference import org.jetbrains.kotlin.idea.references.mainReference @@ -91,7 +92,7 @@ class RenameKotlinPropertyProcessor : RenameKotlinPsiProcessor() { } override fun findReferences(element: PsiElement): Collection { - val allReferences = super.findReferences(element) + val allReferences = super.findReferences(element).filterNot { it is KtDestructuringDeclarationReference } val (getterJvmName, setterJvmName) = getJvmNames(element) return when { getterJvmName == null && setterJvmName == null -> allReferences