Rename: Filter out destructuring references to parameters
They shouldn't be renamed in any case #KT-15039 Fixed
This commit is contained in:
+2
-1
@@ -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<PsiReference> {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user