Skip to main content

Module api

Module api 

Source
Expand description

Programmatic entry point to the AST builtins. Embedders typically go through the registered builtins, but tests and tools that want strongly-typed access can use these helpers directly.

Functionsยง

outline
Parse path and return a hierarchical outline.
parse_tree
Parse a source str for language and return the raw tree-sitter tree. Used by the typed symbol graph in [crate::code_index::symbol_graph] to sweep for call sites without re-doing the work the AST symbol extractor already did.
parse_with_symbols
Parse source once, then return the tree plus the symbol list extracted from it. Lets a caller (e.g. the typed symbol graph) avoid paying the parse cost twice when it needs both products.
symbols
Parse path (with optional language hint) and return its symbols.
symbols_from_source
Parse a source str for language and return its symbols. Useful for unit tests where the input lives in-memory rather than on disk.