Multi-Language Parsing
IGraph uses a tree-sitter-powered 5-pass pipeline to parse source code into structured symbol nodes and relationship edges.
Supported Languages
| Language | Extensions | Extracted |
|---|---|---|
| TypeScript | .ts .tsx .mts .cts | Functions, classes, interfaces, type aliases, components, hooks, variables |
| JavaScript | .js .jsx .mjs .cjs | Functions, classes, components, variables |
| Python | .py .pyi | Functions, classes, decorators, variables |
| Go | .go | Functions, methods (with receiver), types (struct/interface), constants, variables |
| Java | .java | Classes, interfaces, enums, methods, fields |
5-Pass Pipeline
IGraph performs five traversal passes on each source file to incrementally build a complete symbol graph:
- Pass 1 — Exported Symbol Extraction: Uses tree-sitter AST to extract exported functions, classes, components, etc., while collecting
extends/implementsplaceholders - Pass 2 — Internal Symbol Extraction: Extracts non-exported module-level symbols (internal functions, classes, variables)
- Pass 3 — Import Resolution: Resolves
import/requirestatements, buildingimportsdependency edges between files - Pass 4 — Call Analysis: Analyzes call expressions within function bodies, building
callsrelationship edges (priority: same file > imported > same directory > global weak match) - Pass 5 — Reference Resolution: Processes type references and JSX component usage, building
refsrelationship edges
Extracted Node Types
| Type | Description | Example |
|---|---|---|
function | Regular or arrow function | function verify() / const fn = () => {} |
method | Class method or Go method (with receiver) | func (s *Server) Start() / public void handle() |
class | Class definition | class UserService |
component | React / Vue component | function App() (returns JSX) |
hook | React Hook | function useAuth() |
variable | Module-level variable / constant | const CONFIG = {} |
type | Type alias / interface | interface User / type ID = string |
module | File module node (auto-generated per file) | Source node for imports edges |
Extracted Relationship Types
| Relationship | Description |
|---|---|
calls | Function A calls function B |
imports | File A imports file B |
extends | Class A extends class B |
implements | Class A implements interface B |
exports | File exports a symbol |
refs | Type reference or JSX component usage |
Parser Configuration
In the parser section of .igraph/config.json:
json
{
"parser": {
"languages": ["typescript", "javascript", "python", "go", "java"],
"include": ["src/**/*", "lib/**/*"],
"exclude": ["node_modules/**", "dist/**", "**/*.test.*"]
}
}languages: List of enabled languagesinclude: File include glob patterns (default["**/*"])exclude: File exclude glob patterns