Supported Languages
Starting in v0.3.0, symtrace provides first-class AST parsing and structural analysis for 9 programming languages and data formats.
Language Support Matrix
Section titled “Language Support Matrix”| Language | Extensions | Key Entity Identifiers Analyzed |
|---|---|---|
| Rust | .rs | function_item, struct_item, enum_item, impl_item, trait_item |
| JavaScript | .js, .jsx, .mjs, .cjs | function_declaration, class_declaration, method_definition, arrow_function |
| TypeScript | .ts, .tsx | function_declaration, class_declaration, interface_declaration, type_alias_declaration |
| Python | .py, .pyi | function_definition, class_definition, async_function_definition |
| Java | .java | method_declaration, class_declaration, interface_declaration, constructor_declaration |
| C | .c, .h | function_definition, struct_specifier, enum_specifier, type_definition |
| C++ | .cpp, .hpp, .cc, .cxx, .h++ | function_definition, class_specifier, namespace_definition, template_declaration |
| Go | .go | function_declaration, method_declaration, type_declaration, type_spec |
| JSON | .json, .jsonc | pair, object, array |
Mixed-Language Repositories
Section titled “Mixed-Language Repositories”Files with unsupported file extensions are automatically skipped gracefully — zero errors, zero clutter. You can safely run symtrace against any repository regardless of content.
Language Detection Logic
Section titled “Language Detection Logic”Language mapping is determined strictly by file extension. There is no runtime shebang parsing or content sniffing, guaranteeing fast and deterministic detection.
Adding a New Language
Section titled “Adding a New Language”New languages are integrated into symtrace using Tree-sitter C grammars:
- Add the Tree-sitter grammar dependency to
Cargo.toml. - Define extension mappings in
src/language.rs. - Configure entity node types and identifier resolution rules in
src/ast_builder.rs. - Add language test cases to
tests/.
See Contributing Guide for details.