typst_analyzer_analysis/
node.rsuse typst_syntax::{LinkedNode, SyntaxKind, SyntaxNode};
pub fn node_walker(pos: usize, ast: &SyntaxNode) -> Vec<SyntaxKind> {
let linked_root = LinkedNode::new(ast);
let current_node = linked_root.leaf_at(pos, typst_syntax::Side::Before);
let mut nodes: Vec<SyntaxKind> = Vec::new();
if let Some(node) = current_node {
nodes.push(node.clone().kind());
let mut parent = node.parent();
while let Some(p) = parent {
nodes.push(p.clone().kind());
parent = p.parent();
}
}
nodes
}