Introduce Variable: Use name entered in template as a variable name
#KT-8358 Fixed
This commit is contained in:
+3
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user