void (@NotNull PsiElement element) { grabCommentsOnDelete(element); PsiElement anchor = element; while (anchor.getParent() != null && !(anchor.getParent() instanceof PsiFile) && anchor.getParent().getFirstChild() == anchor) { anchor = anchor.getParent(); } insertCommentsBefore(anchor); element.delete(); }