void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PyElementGenerator elementGenerator = PyElementGenerator.getInstance(project); final PsiElement element = descriptor.getPsiElement(); if (element != null) { PyExpression expression = elementGenerator.createExpressionFromText(LanguageLevel.forElement(element), newName); element.replace(expression); } }