| Crates.io | llmcc-rust |
| lib.rs | llmcc-rust |
| version | 0.2.65 |
| created_at | 2025-10-25 01:53:34.333112+00 |
| updated_at | 2026-01-13 22:15:25.20113+00 |
| description | llmcc brings multi-depth architecture graphs for code understanding and generation. |
| homepage | https://github.com/allenanswerzq/llmcc |
| repository | https://github.com/allenanswerzq/llmcc.git |
| max_upload_size | |
| id | 1899536 |
| size | 262,498 |
This crate provides Rust language support for the llmcc project. It implements the language-specific logic for parsing, symbol collection, and semantic analysis (binding) of Rust code.
llmcc-rust integrates with the core compiler infrastructure to provide:
tree-sitter-rust to generate an AST.The analysis pipeline consists of three main stages, orchestrated by the LangRust implementation in src/token.rs.
src/token.rs)The entry point for the crate. It defines the LangRust struct which implements the LanguageTraitImpl.
tree-sitter-rust to produce a concrete syntax tree.build.rs.src/collect.rs)The Collection Pass walks the AST to identify and declare definitions.
CollectorVisitor traverses the AST.i32, bool, etc.)Cargo.toml via src/util.rs)let bindings and parameters)pub and pub(crate) modifiers to determine global symbol visibility.src/bind/)The Binding Pass resolves identifiers to their definitions and builds the call graph. This module is split into focused components:
src/bind/visitor.rs): The main driver, BinderVisitor, walks the AST again.src/bind/resolution.rs): SymbolResolver handles complex name lookups, including:
std::collections::HashMap).impl blocks).src/bind/inference.rs): ExprResolver determines the types of expressions to support accurate method resolution.src/bind/linker.rs): SymbolLinker connects usage sites to definition sites, forming the dependency graph used by downstream LLM tasks.src/util.rs)Helper functions for filesystem and project structure analysis:
parse_crate_name: Extracts crate names from Cargo.toml.parse_module_name: Handles Rust's module system conventions (e.g., mod.rs).The crate includes extensive unit tests ensuring correct symbol resolution and dependency tracking.
# Run all tests for this crate
cargo test -p llmcc-rust
src/token.rs (or the build script) if new token types are needed.CollectorVisitor in src/collect.rs to register new symbol kinds.src/bind/ modules to handle new scoping rules or reference types.