Expand description
Code parsing module using tree-sitter.
This module extracts symbols and relationships from source code files using tree-sitter grammars.
Structs§
- Call
Capture Patterns - Capture name patterns for call extraction. Each tuple contains (name_patterns, expr_patterns) that the query captures should match.
- Code
Parser - Code parser that extracts symbols and relationships.
- Symbol
Kind Mapping - Maps a capture name prefix (e.g., “func”, “class”) to a SymbolKind.
Enums§
- Language
- Supported programming languages.
Functions§
- extract_
brief - Extract a brief description from a docstring.
- extract_
call_ edges - Extract call edges from an AST using a tree-sitter query.
- extract_
module_ name - Extract module name from a file path.
- find_
symbol_ kind - Find the SymbolKind for a capture name based on a list of mappings.
- get_
context_ snippet - Get a snippet of context around a line.
- is_
def_ capture - Check if a capture name is a definition capture (ends with “.def”).
- parse_
block_ doc_ comment - Parse a block doc comment (/** … / or /! … */) into clean content.
- truncate_
context - Truncate a string to a maximum length, adding “…” if truncated.