boolean (@Nullable PsiElement e) { if (e == null) return false; for (PsiElement child = e.getFirstChild(); child != null; child = child.getNextSibling()) { if (child instanceof PsiErrorElement) return true; } return false; }