code-analyze-core
Core library for code structure analysis using tree-sitter.
Features
- Directory analysis - File tree with LOC, function, and class counts
- File analysis - Functions, classes, and imports with signatures and line ranges
- Symbol call graphs - Callers and callees across a directory with configurable depth
- Module index - Lightweight function and import index (~75% smaller than full file analysis)
- Multi-language - Rust, Python, TypeScript, TSX, Go, Java, Fortran, JavaScript, C/C++, C#
- Pagination - Cursor-based pagination for large outputs
- Caching - LRU cache for parsed results with mtime-based invalidation
- Parallel - Rayon-based parallel file analysis
Installation
Add to your Cargo.toml:
[]
= "0.2"
Example
use ;
use Result;
async
Supported Languages
| Language | Extensions | Feature flag |
|---|---|---|
| Rust | .rs |
lang-rust |
| Python | .py |
lang-python |
| TypeScript | .ts |
lang-typescript |
| TSX | .tsx |
lang-tsx |
| Go | .go |
lang-go |
| Java | .java |
lang-java |
| Fortran | .f, .f77, .f90, .f95, .f03, .f08, .for, .ftn |
lang-fortran |
| JavaScript | .js, .mjs, .cjs |
lang-javascript |
| C/C++ | .c, .cc, .cpp, .cxx, .h, .hpp, .hxx |
lang-cpp |
| C# | .cs |
lang-csharp |
Configuration
AnalysisConfig provides resource limits for library consumers:
use AnalysisConfig;
let config = AnalysisConfig ;
Support
For questions and support, visit clouatre.ca.
License
Apache-2.0. See LICENSE.