FileASTNode (@NotNull ASTNode element) { ASTNode parent = element; while (parent != null && !(parent instanceof FileASTNode)) { parent = parent.getTreeParent(); } if (parent == null) { parent = element.getUserData(CONTAINING_FILE_KEY_AFTER_REPARSE); } return (FileASTNode)parent; }