Introduce Variable: Use name entered in template as a variable name

#KT-8358 Fixed
This commit is contained in:
Alexey Sedunov
2015-06-29 17:45:46 +03:00
parent e135b6ae96
commit c66a4d53fd
@@ -147,7 +147,9 @@ public class KotlinVariableInplaceIntroducer(
override fun getComponent() = myWholePanel
override fun performIntroduce() {
val replacement = JetPsiFactory(myProject).createExpression(addedVariable.getName() ?: return)
val newName = getInputName() ?: return
addedVariable.setName(newName)
val replacement = JetPsiFactory(myProject).createExpression(newName)
getOccurrences().forEach {
if (it.isValid()) {
it.replace(replacement)