Skip to main content

Crate lean_ctx_syntax

Crate lean_ctx_syntax 

Source
Expand description

Tree-sitter based code-structure layer for LeanCTX | OSS.

Signature extraction (tree-sitter primary, regex fallback), deep AST queries (imports, calls, type definitions and uses), import-to-file resolution, the post-edit syntax gate and stack-safe AST traversal. Everything here is a pure function of source text and, for import resolution, the project files. Engine concerns (persistent telemetry, configuration, sessions) stay in the engine, which reaches this crate through facades under core::, so this crate never depends on the engine.

The tree-sitter feature compiles the grammars in. Without it, signature extraction uses the regex fallback and the AST queries return nothing. grammar-ocaml, grammar-haskell and grammar-julia (or grammars-long-tail) add the opt-in long-tail grammars.

Modules§

ast_walk
Stack-safe traversal of tree-sitter ASTs.
deep_queries
Tree-sitter deep queries for extracting imports, call sites, and type definitions.
import_resolver
Import-to-file resolution (AST-driven import strings → project paths).
signatures
Signature extraction — regex fallback layer.
syntax_validate
Post-edit syntax gate (#1008): a tree-sitter parse check used to reject an edit that turns a cleanly parsing file into a broken one.