Which Programming Languages Does Code-Graph-RAG Support?
Code-Graph-RAG fully supports 13 programming languages including Python, JavaScript, TypeScript, Rust, Go, Java, C, C++, PHP, Lua, C#, and Dart, with Scala and SQL (PostgreSQL) currently in development, all defined in the SupportedLanguage enumeration in codebase_rag/constants/languages.py.
Code-Graph-RAG is an open-source retrieval-augmented generation framework for codebase intelligence maintained at vitali87/code-graph-rag. Understanding which programming languages Code-Graph-RAG supports is essential for developers looking to index and query their repositories using graph-based RAG techniques. The system leverages Tree-Sitter grammars to parse source code into queryable AST structures across multiple language ecosystems.
Complete List of Code-Graph-RAG Supported Languages
The canonical source of truth for language support resides in codebase_rag/constants/languages.py, which defines the SupportedLanguage enumeration and associated metadata. Each language maps to specific Tree-Sitter grammar configurations and parser front-ends that enable AST-based code understanding.
Fully Supported Languages
These 13 languages have complete grammar support, type inference capabilities, and dedicated AST node handlers:
- Python (
SupportedLanguage.PYTHON): Handles type inference, decorators, and nested functions. - JavaScript (
SupportedLanguage.JS): Supports ES6 modules, CommonJS, prototype methods, and arrow functions. - TypeScript (
SupportedLanguage.TS): Includes interfaces, type aliases, enums, namespaces, and module systems. - TypeScript JSX (
SupportedLanguage.TSX): Extends TypeScript support with JSX elements and React components. - Rust (
SupportedLanguage.RUST): Coversimplblocks, associated functions, and macro-rules macros. - Go (
SupportedLanguage.GO): Handles receiver methods, structs, interfaces, and function-local types. - Java (
SupportedLanguage.JAVA): Supports generics, annotations, records, sealed classes, and reflection. - C (
SupportedLanguage.C): Includes functions, structs, unions, enums, and preprocessor directives. - C++ (
SupportedLanguage.CPP): Covers constructors, destructors, templates, lambdas, C++20 modules, and operator overloading. - PHP (
SupportedLanguage.PHP): Handles classes, interfaces, traits, enums, namespaces, and PHP 8 attributes. - Lua (
SupportedLanguage.LUA): Supports local/global functions, metatables, closures, and coroutines. - C# (
SupportedLanguage.CSHARP): Includes namespaces, classes, structs, records, generics, and overload resolution. - Dart (
SupportedLanguage.DART): Covers classes, mixins, extensions, enhanced enums, and Flutter widgets.
Languages In Development
Two languages have partial implementation:
- Scala (
SupportedLanguage.SCALA): Currently supports case classes and objects. - SQL (PostgreSQL) (
SupportedLanguage.SQL): Supports stored functions and schema-qualified names; full PL/pgSQL support is pending.
Querying Language Support Programmatically
Developers can inspect supported languages at runtime using the constants module. The LANGUAGE_METADATA dictionary maps each SupportedLanguage enum to its configuration, while LanguageStatus distinguishes between fully supported and in-development variants.
Listing All Fully Supported Languages
from codebase_rag.constants.languages import SupportedLanguage, LANGUAGE_METADATA, LanguageStatus
full_languages = [
lang.value
for lang, meta in LANGUAGE_METADATA.items()
if meta.status == LanguageStatus.FULL
]
print("Fully supported languages:", full_languages)
# Output: ['python', 'javascript', 'typescript', 'tsx', 'rust',
# 'go', 'java', 'c', 'cpp', 'php', 'lua',
# 'c_sharp', 'dart']
Retrieving Language-Specific Metadata
Access display names and feature flags for any supported language:
from codebase_rag.constants.languages import SupportedLanguage, LANGUAGE_METADATA
lang = SupportedLanguage.JAVA
meta = LANGUAGE_METADATA[lang]
print(f"{meta.display_name} ({lang.value}): {meta.additional_features}")
# Output: Java (java): Generics, annotations, modern features (records/sealed classes),
# concurrency, reflection
Detecting Languages from File Extensions
The constants module provides extension mappings for automatic language detection:
from pathlib import Path
from codebase_rag.constants.languages import (
PY_EXTENSIONS, JS_EXTENSIONS, TS_EXTENSIONS,
RS_EXTENSIONS, GO_EXTENSIONS,
)
def language_from_path(path: str):
suffix = Path(path).suffix.lower()
if suffix in PY_EXTENSIONS:
return "python"
if suffix in JS_EXTENSIONS:
return "javascript"
if suffix in TS_EXTENSIONS:
return "typescript"
if suffix in RS_EXTENSIONS:
return "rust"
if suffix in GO_EXTENSIONS:
return "go"
return "unknown"
print(language_from_path("src/main.rs")) # → rust
print(language_from_path("app.js")) # → javascript
Architecture and Key Implementation Files
Language support extends beyond simple enumeration definitions. The repository implements a multi-layered parsing strategy across several core modules:
codebase_rag/constants/languages.py: Defines theSupportedLanguageenum, file extension mappings (e.g.,PY_EXTENSIONS,RS_EXTENSIONS), and parser front-end selections.codebase_rag/graph_loader.py: Core loader that instantiates the appropriate Tree-Sitter parser based on the language enum value.codebase_rag/constants/ast_*.py: Language-specific AST definition files (e.g.,ast_python.py,ast_cpp.py) containing Tree-Sitter grammar specifications.codebase_rag/embedder.py: Generates embeddings for language-specific AST nodes to enable semantic code retrieval.codebase_rag/tools/language.py: CLI utility for reporting supported languages and their current development status.
Summary
- Code-Graph-RAG supports 15 total languages: 13 fully supported and 2 in development (Scala and SQL).
- Language definitions are centralized in
codebase_rag/constants/languages.pyvia theSupportedLanguageenum. - Each language features dedicated Tree-Sitter grammar configurations and AST node handlers.
- Runtime querying is available through
LANGUAGE_METADATAandLanguageStatusclasses. - File extension constants enable automatic language detection for repository indexing.
Frequently Asked Questions
How can I programmatically check if a specific language is supported?
Import the SupportedLanguage enum from codebase_rag.constants.languages and check if your language string matches any enum member's value, or query the LANGUAGE_METADATA dictionary to verify the language status and available features.
What distinguishes "fully supported" from "in development" languages?
Fully supported languages have complete Tree-Sitter grammar integration, type inference capabilities, and full AST node coverage for graph construction, while in-development languages like Scala and SQL currently offer limited parsing capabilities with ongoing work to expand feature parity.
Does Code-Graph-RAG support React/JSX files?
Yes, TypeScript JSX (TSX) is fully supported through the SupportedLanguage.TSX enum member, which extends standard TypeScript support to include JSX elements and React component syntax alongside ES6 and CommonJS modules.
How does the system handle mixed-language repositories?
The graph_loader.py module selects the appropriate parser for each file based on file extension mappings defined in codebase_rag/constants/languages.py (such as PY_EXTENSIONS or RS_EXTENSIONS), enabling simultaneous indexing of multi-language codebases.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →