Skip to main content

Module treesitter

Module treesitter 

Source
Expand description

Tree-sitter wrapper utilities shared across language parsers.

Functionsยง

collect_children_by_kind
Collect all direct children of a node with the given kind.
count_complexity
Count decision points in a subtree for cyclomatic complexity.
find_child_by_kind
Find the first child of a node with the given kind.
get_node_text
Get the text content of a tree-sitter node.
node_to_span
Convert a tree-sitter node to a Span.
parse_with_language
Parse source code with error recovery using tree-sitter.