Skip to content

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 ​

LanguageExtensionsExtracted
TypeScript.ts .tsx .mts .ctsFunctions, classes, interfaces, type aliases, components, hooks, variables
JavaScript.js .jsx .mjs .cjsFunctions, classes, components, variables
Python.py .pyiFunctions, classes, decorators, variables
Go.goFunctions, methods (with receiver), types (struct/interface), constants, variables
Java.javaClasses, interfaces, enums, methods, fields

5-Pass Pipeline ​

IGraph performs five traversal passes on each source file to incrementally build a complete symbol graph:

  1. Pass 1 — Exported Symbol Extraction: Uses tree-sitter AST to extract exported functions, classes, components, etc., while collecting extends / implements placeholders
  2. Pass 2 — Internal Symbol Extraction: Extracts non-exported module-level symbols (internal functions, classes, variables)
  3. Pass 3 — Import Resolution: Resolves import / require statements, building imports dependency edges between files
  4. Pass 4 — Call Analysis: Analyzes call expressions within function bodies, building calls relationship edges (priority: same file > imported > same directory > global weak match)
  5. Pass 5 — Reference Resolution: Processes type references and JSX component usage, building refs relationship edges

Extracted Node Types ​

TypeDescriptionExample
functionRegular or arrow functionfunction verify() / const fn = () => {}
methodClass method or Go method (with receiver)func (s *Server) Start() / public void handle()
classClass definitionclass UserService
componentReact / Vue componentfunction App() (returns JSX)
hookReact Hookfunction useAuth()
variableModule-level variable / constantconst CONFIG = {}
typeType alias / interfaceinterface User / type ID = string
moduleFile module node (auto-generated per file)Source node for imports edges

Extracted Relationship Types ​

RelationshipDescription
callsFunction A calls function B
importsFile A imports file B
extendsClass A extends class B
implementsClass A implements interface B
exportsFile exports a symbol
refsType 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 languages
  • include: File include glob patterns (default ["**/*"])
  • exclude: File exclude glob patterns

Released under the MIT License