What Programming Languages Does code-review-graph Support for Parsing Code?

The code-review-graph tool supports parsing for more than 35 programming languages out of the box, including Python, Java, JavaScript/TypeScript, Go, Rust, C/C++, and Ruby, with extensibility via custom TOML configuration.

The code-review-graph repository provides a powerful static analysis tool designed to parse codebases and build queryable graphs. Understanding what programming languages code-review-graph supports is essential for teams evaluating the tool for their polyglot codebases. The project leverages the tree-sitter ecosystem to deliver robust parsing capabilities across dozens of languages without requiring additional configuration.

Built-in Language Support (35+ Languages)

According to the docs/CUSTOM_LANGUAGES.md documentation, code-review-graph ships with built-in parsers for more than 35 languages. The core implementation relies on the tree-sitter parsing ecosystem and the bundled tree-sitter-language-pack to provide language-specific grammars.

In code_review_graph/parser.py, the parser initialization logic automatically loads grammars for all supported languages, mapping file extensions to their respective tree-sitter parsers. This enables automatic language detection based on file extensions and shebang lines.

Core Programming Languages

The parser handles all major system and application languages:

  • Python (.py, .pyi) – Full support for modern Python syntax including type hints
  • Java (.java) – Enterprise Java parsing with package and class hierarchy extraction
  • Go (.go) – Native support for Go modules and goroutine structures
  • Rust (.rs) – Complete Rust syntax parsing including unsafe blocks and macros
  • C/C++ (.c, .h, .cpp, .hpp) – Handles complex header relationships and templates
  • C# (.cs) – .NET ecosystem support with async/await pattern recognition
  • Ruby (.rb) – Ruby metaprogramming constructs and block parsing
  • Swift (.swift) – Apple ecosystem language support
  • Kotlin (.kt, .kts) – Android and server-side Kotlin support
  • Scala (.scala) – JVM functional programming language support
  • Haskell (.hs) – Functional language with complex type system parsing

Web and Configuration Languages

Beyond compiled languages, code-review-graph handles web technologies and data formats:

  • JavaScript (.js, .jsx) and TypeScript (.ts, .tsx) – React and modern TS support
  • PHP (.php, .blade.php) – Including Laravel Blade template syntax
  • Elixir (.ex, .exs) – Erlang VM (BEAM) functional language support
  • Erlang (.erl) – Telecommunications and distributed systems language
  • Bash/Shell (.sh, shebang scripts) – Shell script analysis including POSIX and Bash extensions
  • HTML/XML (.html, .xml) – Markup language parsing for web components
  • JSON (.json) and YAML/Ansible (.yml, .yaml) – Configuration file support
  • Markdown (.md) – Documentation file parsing for API extraction

The complete enumeration appears in diagrams/diagram9_language_coverage.png, which visualizes every out-of-the-box grammar included in the distribution.

How Language Parsing Works

The parsing architecture centers on code_review_graph/parser.py, which orchestrates the tree-sitter grammars. When you execute a build command, the parser:

  1. Discovers files based on registered extensions
  2. Loads the appropriate tree-sitter grammar from the language pack
  3. Generates an Abstract Syntax Tree (AST) for each file
  4. Extracts nodes (functions, classes, imports) into the queryable graph structure

This approach ensures consistent parsing behavior across all 35+ languages while maintaining high performance through tree-sitter's incremental parsing capabilities.

Extending Support with Custom Languages

While the default set covers most popular languages, code_review_graph/custom_languages.py implements a configuration loader for additional grammars. Users can extend support via a .code-review-graph/languages.toml file that maps file extensions to any grammar available in the tree-sitter ecosystem.

Adding a Custom Language Configuration

To add support for a language not included by default, create .code-review-graph/languages.toml in your repository root:

[languages.haskell]
extensions = [".hs"]
grammar = "haskell"
function_node_types = ["function"]

The grammar field references any parser available in the tree-sitter-language-pack. After configuration, rebuild the graph:

uv run code-review-graph build

The custom_languages.py module validates the TOML structure and registers the new extensions with the parser engine during the build phase.

Practical Usage Examples

Running a Full Multi-Language Build

To parse all supported languages in a repository:

uv run code-review-graph build

This command processes every file matching the built-in extension mappings and custom language configurations, constructing a unified graph database.

Querying Parsed Code by Language

Access language-specific nodes through the Python API:

from code_review_graph.graph import Graph

g = Graph.load("my_repo.graph")
python_funcs = g.nodes.filter(language="python", type="function")

The filter() method accepts language and type parameters to narrow results to specific programming languages and AST node types.

Summary

Frequently Asked Questions

How many languages does code-review-graph support natively?

The tool ships with built-in support for more than 35 programming languages. This count includes major languages like Python, Java, Go, Rust, JavaScript, TypeScript, C, C++, C#, Ruby, PHP, Swift, and Kotlin, plus configuration formats like JSON, YAML, and Markdown. The exact number and specific grammar versions are documented in docs/CUSTOM_LANGUAGES.md and visualized in the language coverage diagram.

Can I add support for a language not in the default list?

Yes. You can extend language support by creating a .code-review-graph/languages.toml configuration file. This TOML file maps file extensions to tree-sitter grammars available in the tree-sitter-language-pack. The code_review_graph/custom_languages.py module processes this configuration during the build phase, allowing you to parse additional languages without modifying the core codebase.

What parser engine does code-review-graph use?

The tool uses the tree-sitter parsing ecosystem, specifically the tree-sitter-language-pack, which provides robust, incremental parsers for all supported languages. The code_review_graph/parser.py file contains the core integration logic that loads these grammars and constructs Abstract Syntax Trees (ASTs) for code analysis.

Where can I find the complete list of supported languages?

The definitive source is docs/CUSTOM_LANGUAGES.md in the repository root, which explicitly claims the "35+ languages" support level. Additionally, diagrams/diagram9_language_coverage.png provides a visual enumeration of every included grammar. For programmatic access, you can inspect the language mappings configured in code_review_graph/parser.py or query the graph database's language node attributes after building a project.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →