public static boolean containsError(PsiElement element) {
    // check only immediate children, full tree traversal is too expensive
    return PsiUtilCore.hasErrorElementChild(element);
  }
public static boolean containsError(PsiElement element)