Skip to main content

Module parser

Module parser 

Source
Expand description

Code parsing module using tree-sitter.

This module extracts symbols and relationships from source code files using tree-sitter grammars.

Structs§

CallCapturePatterns
Capture name patterns for call extraction. Each tuple contains (name_patterns, expr_patterns) that the query captures should match.
CodeParser
Code parser that extracts symbols and relationships.
SymbolKindMapping
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.