void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { final PsiElement element = descriptor.getPsiElement(); final PyWithItem withItem = PsiTreeUtil.getParentOfType(element, PyWithItem.class); if (withItem == null) return; final PyExpression withTarget = withItem.getTarget(); if (withTarget != element) return; final PyExpression withExpr = withItem.getExpression(); withItem.deleteChildRange(withExpr.getNextSibling(), withItem.getLastChild()); }