The @codeatlas-ai/parser package parses source code into structured AST symbols, extracts normalized dependency edges, resolves semantic type inheritance, and classifies framework-specific constructs.
CodeAtlas provides native Tree-sitter bindings and semantic extraction for:
| Language / Framework | Extension Patterns | Parsed Entity Types |
|---|---|---|
| TypeScript / TSX | .ts, .tsx, .mts, .cts |
Classes, Interfaces, Enums, Type Aliases, Functions, React Hooks, Next.js Routes, @/* Path Mappings |
| JavaScript / JSX | .js, .jsx, .mjs, .cjs |
Classes, Functions, Variables, CommonJS require, ES Imports, JSX components |
| NestJS | .ts |
Controllers (@Controller), Providers (@Injectable), Modules (@Module) |
| Prisma Schema | .prisma |
Models, Enums, Properties/Fields, Cross-Model Relational Graph Edges |
| Python | .py |
Classes, Methods, Functions, Module Imports (from x import y) |
| PHP | .php, .phtml |
Classes, Traits, Interfaces, Functions, use statements, include/require |
| Go | .go |
Structs, Interfaces, Functions, Methods, Package Imports |
| Rust | .rs |
Structs, Traits, Impl blocks, Enums, Functions, use declarations |
| Dart / Flutter | .dart |
Classes, Enums, Mixins, Async Methods, Package Imports |
| Scala | .scala, .sc |
Case Classes, Traits, Companion Objects, Package Imports |
| Lua | .lua |
Modules, Functions, Methods, require(...) Calls |
| Elixir & Erlang | .ex, .exs, .erl |
Modules, Public/Private Functions, Includes, Aliases |
| Zig | .zig |
Structs, Public Functions, @import(...) |
| GraphQL | .graphql, .gql |
Types, Inputs, Interfaces, Queries, Mutations |
| Vue/Svelte/Astro | .vue, .svelte, .astro |
Script AST Extraction, Component Symbols, Relative Imports |
| SQL Schemas | .sql |
Table Definitions, Views, Stored Procedures/Functions |
| C# / Java | .cs, .java |
Classes, Interfaces, Methods, Namespaces/Packages, Imports |
| C / C++ | .c, .cpp, .h, .hpp |
Functions, Structs, Classes, Header Includes |
| Ruby / Kotlin | .rb, .kt, .kts |
Classes, Modules, Functions, Imports |
| Data & Markup | .json, .yaml, .toml |
Schema validation and structural metadata |
Functions starting with use[A-Z0-9].* (e.g., useAuth, useLocalStorage) are automatically recognized as SymbolKind: 'hook' instead of generic functions.
Files located under app/**/ follow App Router conventions:
page.tsxdefault exports are tagged asSymbolKind: 'page'.layout.tsxdefault exports are tagged asSymbolKind: 'layout'.route.tsHTTP method handlers (GET,POST,PUT,DELETE) are tagged asSymbolKind: 'route_handler'.
Class decorators are parsed to establish dependency injection relationships:
-
@Controller(...)$\rightarrow$ SymbolKind: 'controller' -
@Injectable(...),@Service(...),@Repository(...)$\rightarrow$ SymbolKind: 'provider' -
@Module(...)$\rightarrow$ SymbolKind: 'module'
Parses schema.prisma files to extract database entity definitions (SymbolKind: 'model') and connects cross-model relations as dependency edges in the graph database.
In addition to syntax trees, CodeAtlas performs cross-file semantic analysis:
-
Path Mapping Resolution: Automatically resolves
tsconfig.jsoncompilerOptions.paths(e.g.@/*$\rightarrow$ src/*) to absolute file paths with confidence1.0. -
Type Inheritance & Implementation:
- Detects
class Foo extends Barandclass Foo implements IBaz. - Creates semantic graph dependency edges (
kind: 'type_reference') linking derived classes directly to their base definitions.
- Detects
- Incremental SHA-256 Hashing: Files whose content hashes match stored records in SQLite are bypassed during re-indexing.
- Worker Pool Execution: Parsing operations are batched across concurrent worker threads.
- Fault Tolerance: Syntax errors or incomplete code snippets in active development files are captured gracefully without halting the indexing process.