void (@NotNull PsiElement element) { if (element instanceof PsiComment comment) { removeFromComment(comment); } else { PsiModifierListOwner commentOwner = PsiTreeUtil.getParentOfType(element, PsiModifierListOwner.class, false); if (commentOwner != null) { PsiElement psiElement = JavaSuppressionUtil.getElementMemberSuppressedIn(commentOwner, myID); if (psiElement instanceof PsiAnnotation annotation) { if (!ExternalAnnotationsManager.getInstance(annotation.getProject()).isExternalAnnotation(annotation)) { removeFromAnnotation(annotation); } } else if (psiElement instanceof PsiDocComment docComment) { removeFromJavaDoc(docComment); } else { //try to remove from all comments Set<PsiComment> comments = new HashSet<>(); commentOwner.accept(new PsiRecursiveElementWalkingVisitor() { @Override public void visitComment(@NotNull PsiComment comment) { super.visitComment(comment); if (comment.getText().contains(myID)) { comments.add(comment); } } }); for (PsiComment comment : comments) { try { removeFromComment(comment); } catch (IncorrectOperationException e) { LOG.error(e); } } } } } }