Rename: Add quotes to declaration name if necessary

#KT-22708 Fixed
This commit is contained in:
Alexey Sedunov
2018-02-06 19:22:46 +03:00
parent 428b086458
commit e88f1467eb
4 changed files with 16 additions and 1 deletions
@@ -104,7 +104,8 @@ abstract class KtNamedDeclarationStub<T extends KotlinStubWithFqName<?>> extends
}
}
PsiElement newIdentifier = KtPsiFactory(this).createNameIdentifierIfPossible(name);
PsiElement newIdentifier =
KtPsiFactory(this).createNameIdentifierIfPossible(KtPsiUtilKt.quoteIfNeeded(name));
if (newIdentifier != null) {
KtPsiUtilKt.astReplace(identifier, newIdentifier);
}