void (@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) { final PsiElement element = descriptor.getPsiElement(); if (!(element instanceof PyExpression expression)) return; final PsiElement nextSibling = PsiTreeUtil.skipWhitespacesForward(expression); final PsiElement prevSibling = PsiTreeUtil.skipWhitespacesBackward(expression); expression.delete(); if (nextSibling != null && nextSibling.getNode().getElementType().equals(PyTokenTypes.COMMA)) { nextSibling.delete(); return; } if (prevSibling != null && prevSibling.getNode().getElementType().equals(PyTokenTypes.COMMA)) { prevSibling.delete(); } }