void (@NotNull final PsiElement element, @NotNull final String newName, final UsageInfo @NotNull [] usages, @Nullable final RefactoringElementListener listener) { Preconditions.checkArgument(canProcessElement(element), "Element can't be renamed, call #canProcessElement first " + element); element.replace(PyElementGenerator.getInstance(element.getProject()).createStringLiteral((PyStringLiteralExpression)element, newName)); for (final UsageInfo usage : usages) { final PsiReference reference = usage.getReference(); if (reference != null) { reference.handleElementRename(newName); } } }