use of com.jetbrains.python.psi.PyReprExpression in project intellij-community by JetBrains.
the class ReplaceBackquoteExpressionQuickFix method applyFix.
@Override
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
PsiElement problemElement = descriptor.getPsiElement();
if (problemElement instanceof PyReprExpression) {
if (((PyReprExpression) problemElement).getExpression() != null) {
PyElementGenerator elementGenerator = PyElementGenerator.getInstance(project);
problemElement.replace(elementGenerator.createExpressionFromText("repr(" + ((PyReprExpression) problemElement).getExpression().getText() + ")"));
}
}
}
Aggregations