boolean (ASTNode _node) { Function<ASTNode, ASTNode> prevNode = node -> { ASTNode prev = node.getTreePrev(); return prev != null ? TreeUtil.getLastChild(prev) : node.getTreeParent(); }; return JBIterable.generate(_node, prevNode) .skip(1) .takeWhile(e -> e instanceof PsiWhiteSpace || e.getTextLength() == 0) .filter(PsiErrorElement.class) .isNotEmpty(); }