Rename: Record new name for Kotlin function which is being renamed via light method

#KT-12732 Fixed
(cherry picked from commit 28b9d3e)
This commit is contained in:
Alexey Sedunov
2016-06-15 14:54:45 +03:00
parent 04f54bee88
commit 46c2dc9895
2 changed files with 4 additions and 0 deletions
@@ -85,6 +85,9 @@ class RenameKotlinFunctionProcessor : RenameKotlinPsiProcessor() {
override fun prepareRenaming(element: PsiElement, newName: String?, allRenames: MutableMap<PsiElement, String>, scope: SearchScope) {
super.prepareRenaming(element, newName, allRenames, scope)
if (element is KtLightMethod && newName != null && getJvmName(element) == null) {
(element.kotlinOrigin as? KtNamedFunction)?.let { allRenames[it] = newName }
}
val psiMethod = wrapPsiMethod(element)
if (psiMethod?.containingClass != null) {
javaMethodProcessorInstance.prepareRenaming(psiMethod, newName, allRenames, scope)