public static @Nullable MemberModel create(@NotNull PsiErrorElement errorElement) {
    if (inClass(errorElement) || hasClassesWithUnclosedBraces(errorElement.getContainingFile())) return null;
    List<PsiElement> children = new ArrayList<>();
    PsiElement prevSibling = errorElement.getPrevSibling();
    while (isMemberPart(prevSibling)) {
      if (prevSibling instanceof PsiErrorElement) {
        StreamEx.ofReversed(prevSibling.getChildren()).forEach(c -> children.add(c));
      }
      else {
        children.add(prevSibling);
        if (prevSibling instanceof PsiField || prevSibling instanceof PsiMethod) break;
      }
      prevSibling = prevSibling.getPrevSibling();
    }
    Collections.reverse(children);
    Collections.addAll(children, errorElement.getChildren());
    return new MemberParser(ContainerUtil.filter(children, c -> !isWsOrComment(c))).parse();
  }
public static @Nullable MemberModel create(@NotNull PsiErrorElement errorElement)