void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { final PsiElement call = descriptor.getPsiElement(); assert call instanceof PyCallExpression; if (call instanceof PyDecorator) { call.delete(); } else { final PyArgumentList argumentList = ((PyCallExpression)call).getArgumentList(); assert argumentList != null; argumentList.delete(); final PyElementGenerator elementGenerator = PyElementGenerator.getInstance(project); // regenerate element for Psi consistency, because it isn't PyCallExpression anymore final PyExpression expression = elementGenerator.createExpressionFromText(LanguageLevel.forElement(call), call.getText()); call.replace(expression); } }