Skip to main content

Supported Languages

Rephole uses tree-sitter for intelligent AST-based code chunking. The following 37 programming languages are supported with full AST parsing.

Core Languages​

LanguageExtensionsAST Parsing
TypeScript.ts, .mts, .cts✅ Full support
TSX.tsx✅ Full support
JavaScript.js, .jsx, .mjs, .cjs✅ Full support
Python.py, .pyw, .pyi✅ Full support
Java.java✅ Full support
Kotlin.kt, .kts✅ Full support
Scala.scala, .sc✅ Full support

Systems Programming​

LanguageExtensionsAST Parsing
C.c, .h✅ Full support
C++.cpp, .cc, .cxx, .c++, .hpp, .hxx, .h++, .hh✅ Full support
C#.cs✅ Full support
Objective-C.m, .mm✅ Full support
Go.go✅ Full support
Rust.rs✅ Full support
Zig.zig✅ Full support

Mobile Development​

LanguageExtensionsAST Parsing
Swift.swift✅ Full support
Dart.dart✅ Full support

Scripting Languages​

LanguageExtensionsAST Parsing
Ruby.rb, .rake, .gemspec✅ Full support
PHP.php, .phtml✅ Full support
Lua.lua✅ Full support
Elixir.ex, .exs✅ Full support

Functional Languages​

LanguageExtensionsAST Parsing
OCaml.ml, .mli✅ Full support
ReScript.res, .resi✅ Full support

Web3 / Blockchain​

LanguageExtensionsAST Parsing
Solidity.sol✅ Full support

Web Technologies​

LanguageExtensionsAST Parsing
HTML.html, .htm, .xhtml✅ Full support
CSS.css✅ Full support
Vue.vue✅ Full support
ERB/EJS.erb, .ejs, .eta✅ Full support

Config / Data Languages​

LanguageExtensionsAST Parsing
JSON.json, .jsonc✅ Full support
YAML.yml, .yaml✅ Full support
TOML.toml✅ Full support
Markdown.md, .markdown, .mdx✅ Full support

Shell & Scripting​

LanguageExtensionsAST Parsing
Bash/Shell.sh, .bash, .zsh, .fish✅ Full support
Emacs Lisp.el, .elc✅ Full support

Formal Methods & Verification​

LanguageExtensionsAST Parsing
TLA+.tla✅ Full support
CodeQL.ql✅ Full support

Hardware Description​

LanguageExtensionsAST Parsing
SystemRDL.rdl✅ Full support

How Language Detection Works​

The AST parser automatically detects the programming language based on file extension:

  1. File Extension Detection: When processing a file, Rephole extracts the file extension
  2. Grammar Loading: The appropriate tree-sitter WASM grammar is loaded
  3. AST Parsing: The code is parsed into an Abstract Syntax Tree
  4. Semantic Chunking: Functions, classes, methods, and other semantic blocks are extracted
  5. Embedding: Each chunk is embedded separately for precise retrieval
file.ts → TypeScript Grammar → AST → Semantic Chunks → Embeddings

Adding New Languages​

To add support for a new language:

  1. Add the tree-sitter WASM grammar file to resources/
  2. Create a query in libs/ingestion/ast-parser/src/constants/queries.ts
  3. Add the language config in libs/ingestion/ast-parser/src/config/language-config.ts

Unsupported Files​

Files with unsupported extensions are gracefully skipped during ingestion. The system will:

  • Log a debug message about the unsupported extension
  • Continue processing other files
  • Return an empty array for that file's chunks
Binary Files

Binary files (images, compiled code, etc.) are automatically excluded from processing.