Rename: Fix exception on attempt to rename KtConstructorDelegationReference

#KT-21536 Fixed
This commit is contained in:
Alexey Sedunov
2017-12-04 16:14:29 +03:00
parent ec85b708c9
commit e1ed74008f
7 changed files with 86 additions and 0 deletions
@@ -17,7 +17,9 @@
package org.jetbrains.kotlin.idea.references;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.name.Name;
import org.jetbrains.kotlin.psi.KtConstructorDelegationReferenceExpression;
@@ -39,4 +41,11 @@ public class KtConstructorDelegationReference extends KtSimpleReference<KtConstr
public Collection<Name> getResolvesByNames() {
return Collections.emptyList();
}
@Nullable
@Override
public PsiElement handleElementRename(@Nullable String newElementName) {
// Class rename never affects this reference, so there is no need to fail with exception
return getExpression();
}
}