Skip to main content

Module parser

Module parser 

Source

Modules§

dead_code_facts
Per-file syntax facts persisted in content records and consumed by inspect.
outline_facts
Syntax facts shared by the parser cache and outline renderer.
todo_markers
TODO marker extraction from syntax-tree comments and lexical headers.

Structs§

CachedOutline
A fresh cache entry with everything a multi-file outline needs to render a file without reading or parsing it again.
FileParser
Core parsing engine. Handles language detection, parse tree caching, symbol table caching, and query pattern execution via tree-sitter.
ParsedFile
A request-local source and tree captured together, for read-only consumers.
RustAttributeEntryPoint
RustModule
Outline-only module containers; these never enter the extracted symbol table.
SymbolCache
Shared symbol cache that can be pre-warmed in a background thread and read by all parser instances.
TreeSitterProvider
Provider that uses tree-sitter for real symbol extraction. Implements the LanguageProvider trait from language.rs.

Enums§

LangId
Supported language identifier.

Constants§

MARKDOWN_MAX_OPEN_BLOCKS
The most container blocks (block quotes and list items) a Markdown file may hold open at once and still be parsed. The Markdown grammar’s block scanner saves its open blocks into tree-sitter’s fixed 1024-byte state buffer without a bounds check, 4 bytes per block after a 5-byte header, so 255 open blocks overrun it and tree-sitter aborts the whole process (tree-sitter-md 0.5.3 under tree-sitter 0.26). Half that leaves room for the overestimate markdown_too_deep_to_parse makes.
MARKDOWN_TOO_DEEP
Why a Markdown file over MARKDOWN_MAX_OPEN_BLOCKS is not parsed. Tools report it after the file’s path, as <path>: <reason>.
MAX_SIGNATURE_BYTES
Upper bound on the bytes kept for one symbol’s signature.
RUST_ENTRY_POINT_ATTRIBUTES
Rust function attributes that expose the function to code outside the Rust call graph. This list is deliberately conservative: it covers known ABI, wasm, constructor/destructor, and Tauri command entry points, but it does not guess route macro shapes from web frameworks.

Functions§

cached_header_tree
Reuse a resolved header tree in path-free extraction without changing the caller’s already-resolved language.
cached_symbol_count_shared
complete_rust_trait_members
Navigation includes trait members already known to the call graph without changing the parser table persisted in content records. Both stored and freshly parsed tables use the same ownership and duplicate checks.
content_hash_for_source
The content hash a symbol-cache entry records for source: none (zero) past the hashing size cap.
detect_language
Detect a file’s language, resolving ambiguous headers from their contents.
detect_language_any
Dynamic extensions are opt-in per handling context. Detection never reads stored grammars and never starts a download.
detect_language_from_source
Detect against the caller’s source snapshot rather than reopening the file.
dynamic_language_for_extension
Resolve the extractor for a downloaded grammar without opening the file.
extract_symbols_from_tree
Extract symbols from an already-parsed tree without reparsing.
extract_symbols_from_tree_with
extract_symbols_from_tree, with nav walking a Rust tree and answering its parent and sibling lookups. Other languages run tree-sitter queries, which walk the tree themselves.
grammar_for
Select a linked grammar or load a stored downloaded grammar, without requesting it.
initialize_parser
A Wasm language must have a store attached before set_language can run it.
json_document_value
Return the first non-comment value in a JSON document.
language_for_extension
Classify by name without reading the file. A .h result is provisional C; the parser resolves C, C++ or Objective-C from the header’s contents.
list_symbols_shared
Share the production provider’s immutable table, while retaining the owned trait API for alternate providers and callers that need to modify symbols.
luau_parse_deadline
The process’s Luau budget, also used to describe persisted timeout gaps.
luau_symbol
markdown_too_deep_to_parse
Whether source, to be parsed as lang, is Markdown that could hold more than MARKDOWN_MAX_OPEN_BLOCKS container blocks open at once, and so must not reach the Markdown grammar. Every place that parses Markdown checks this first.
node_range
Build a Range from a tree-sitter Node.
node_range_with_decorators
Build a Range from a tree-sitter Node, expanding upward to include preceding attributes, decorators, and doc comments that belong to the symbol.
node_range_with_decorators_with
node_range_with_decorators, looking up parents and siblings with nav.
node_text
Extract the text of a node from source.
parse_resolved_source
parse_source_with_cached_parser
Parse source with a parser retained by the current worker thread.
parse_with_parser
One parsing boundary for fresh and reused dynamic-language parsers.
read_source
rust_attribute_entry_points
Return Rust functions whose attributes make them external entry points.
rust_attribute_entry_points_with
rust_attribute_entry_points, walking and looking up with nav.
rust_modules
symbols_estimated_bytes
truncate_signature
Cut a signature to MAX_SIGNATURE_BYTES on a character boundary and mark the cut with an ellipsis so readers can tell it was shortened.

Type Aliases§

SharedSymbolCache