private static @Nullable ASTNode findFrom(ASTNode current, IElementType expected, boolean forward) {
    for (ASTNode node = current; node != null; node = forward ? node.getTreeNext() : node.getTreePrev()) {
      if (node.getElementType() == expected) return node;
    }
    return null;
  }
private static @Nullable ASTNode findFrom(ASTNode current, IElementType expected, boolean forward)