Skip to content

Supported Languages

Reflex parses 15 languages for symbol extraction and dependency tracking. Full-text and regex search go further: they cover every non-binary file in your project, using the same rules as ripgrep.

LanguageExtensionsSymbol typesDependency tracking
Rust.rsFunction, Struct, Enum, Trait, Type, Constant, Variable, Method, Module, Macro, AttributeYes
TypeScript.ts, .tsx, .mts, .ctsFunction, Class, Interface, Type, Enum, Constant, Variable, MethodYes
JavaScript.js, .jsx, .mjs, .cjsFunction, Class, Constant, Variable, MethodYes
Python.pyFunction, Class, Method, Constant, VariableYes
Go.goFunction, Struct, Interface, Method, Constant, VariableYes
Java.javaClass, Interface, Enum, Method, Variable, AttributeYes
C.c, .hFunction, Struct, Enum, Type, Macro, VariableYes
C++.cpp, .cc, .cxx, .hpp, .hxx, .C, .HFunction, Class, Struct, Enum, Namespace, Method, Type, VariableYes
C#.csClass, Struct, Interface, Enum, Method, Property, Variable, Namespace, Type, Event, AttributeYes
PHP.phpFunction, Class, Interface, Trait, Method, Constant, Variable, Namespace, Enum, AttributeYes
Ruby.rb, .rake, .gemspecClass, Module, Method, Constant, Property, VariableYes
Kotlin.kt, .ktsClass, Interface, Method, Variable, Constant, AttributeYes
Vue.vueFunction, Constant, Variable (from <script> blocks)Yes
Svelte.svelteFunction, Constant, Variable (from <script> blocks)Yes
Zig.zigFunction, Struct, Enum, Constant, VariableYes

Reflex uses Tree-sitter 0.26. The grammars are the 0.23 releases, except tree-sitter-kotlin-ng 1.1.0 and tree-sitter-zig 1.1.2. JavaScript shares the TypeScript parser, and Vue and Svelte <script> blocks are extracted with regex-based parsers.

Symbols aren’t extracted during rfx index itself. A background pass right after indexing parses each file once and caches its symbols, so symbol queries don’t have to re-parse. rfx index status shows its progress.

.swift files are recognized and indexed for full-text and regex search, but the Swift parser is currently disabled (its queries are out of date with the current grammar). Symbol search, AST queries and dependency analysis skip Swift files.

Beyond code: text, lock and generated files

Section titled “Beyond code: text, lock and generated files”

By default ([index] mode = "tracked"), Reflex indexes every file that isn’t gitignored, isn’t under a dot-directory, and isn’t binary (a NUL byte marks a file as binary). Files that aren’t in a parsed language fall into one of three tiers:

Tier--lang valueWhat’s in itSearched by default
TexttextDocs, config, templates, and extensionless files (README, Makefile, Dockerfile, .md, .yaml, .toml, .json, .sql, …)Yes
LocklockCargo.lock, package-lock.json, yarn.lock, pnpm-lock.yaml, poetry.lock, Gemfile.lock, go.sum, and any *.lock or *-lock.jsonNo: pass --include-locks or --lang lock
Generatedgenerated*.pb.go, *.min.js, *.min.css, *.map, *_generated.*, *.generated.*No: pass --include-generated or --lang generated

These tiers get full-text and regex search only. They’re never parsed for symbols or dependencies.

To index only code plus a fixed list of docs and config extensions (no lock or generated files), set mode = "allowlist" in the [index] section of .reflex/config.toml.

Each language’s import statements are parsed for dependency tracking:

LanguageImport syntax
Rustuse crate::path, mod name, extern crate
TypeScript/JavaScriptimport x from 'y', require('y')
Pythonimport x, from x import y
Goimport "path"
Javaimport com.example.Class
Kotlinimport com.example.Class
C/C++#include <header>, #include "header"
C#using Namespace
PHPuse Namespace\\Class, require/require_once, include/include_once
Rubyrequire 'gem', require_relative 'file'
Vue/Svelteimport from <script> blocks
Zig@import("file")

Only static imports (string literals) are tracked. Dynamic imports are filtered out.

Every detected dependency is classified as one of:

TypeDescriptionExample
InternalFiles within your projectuse crate::auth::handler
ExternalThird-party packagesimport express from 'express'
StdlibStandard library modulesuse std::collections::HashMap

Rust mod name; declarations are recorded as a fourth type, mod_decl. They describe parent-to-child module ownership, not usage.

JSX and TSX files are handled by the JavaScript and TypeScript parsers respectively. Component definitions are extracted as symbols.

Single-file components (.vue, .svelte) are parsed for:

  • Functions, constants and variables declared in <script> blocks
  • Import statements from <script> blocks for dependency tracking

Reflex uses Tree-sitter grammars for parsing. Each language has a dedicated parser in src/parsers/, and file extensions are mapped in src/models.rs. See Contributing for how to add support for new languages.