Skip to main content

Module extract

Module extract 

Source
Expand description

Shared symbol extraction from source code.

This module provides the core AST traversal logic for extracting symbols, imports, and other facts from source files.

§Extraction paths

Symbol extraction uses the tags path: a *.tags.scm query is run against the tree-sitter parse tree. The query groups @definition.* + @name captures per match, reconstructs nesting by line-range containment, and returns a Vec<Symbol>.

After extraction, post-processing steps apply (Rust impl-block merging, TypeScript/JavaScript interface marking).

Structs§

ExtractOptions
Options for symbol extraction.
ExtractResult
Result of extracting symbols from a file.
Extractor
Shared symbol extractor using the Language trait.
OnDemandResolver
Resolver that parses files on-demand for cross-file interface lookups. This is the fallback when no index is available.

Traits§

InterfaceResolver
Resolver for cross-file interface method lookups. Used to find interface/class method signatures from other files.

Functions§

compute_complexity
Compute cyclomatic complexity for a function node using the .complexity.scm query. Returns 1 (base complexity) for languages without a complexity query.