Symbol Search
Symbol search combines Reflex’s full-text trigram search with runtime Tree-sitter parsing to filter results down to symbol definitions — functions, classes, structs, interfaces, and more.
How it works
Section titled “How it works”Reflex uses a two-phase approach:
- Trigram search finds all files containing the query text (fast, milliseconds)
- Tree-sitter parsing runs on each candidate file to identify symbol definitions (lazy, on-demand)
This “runtime symbol detection” architecture means indexing is instant (no parsing during rfx index) while symbol searches are still fast because trigrams narrow the search space first.
Basic symbol search
Section titled “Basic symbol search”Add --symbols (or -s) to any query:
rfx query "authenticate" --symbolssrc/auth/mod.rs:42 [Function] pub fn authenticate(creds: &Credentials) -> Result<Session>1 result in 4msWithout --symbols, this query would also find calls, comments, and string literals containing “authenticate”. With it, only definitions appear.
Filter by symbol kind
Section titled “Filter by symbol kind”Use --kind to restrict to a specific symbol type:
# Only functionsrfx query "handle" --symbols --kind function
# Only structsrfx query "Config" --symbols --kind struct
# Only interfaces (TypeScript, Go)rfx query "Repository" --symbols --kind interfaceAvailable symbol kinds
Section titled “Available symbol kinds”| Kind | Description |
|---|---|
function | Functions, methods |
class | Classes |
struct | Structs (Rust, Go, C) |
enum | Enums |
trait | Traits (Rust) |
interface | Interfaces (TypeScript, Go, Java) |
type | Type aliases |
constant | Constants |
variable | Variables, let bindings |
method | Methods (when distinguishable from functions) |
Symbol kinds vary by language — see Supported Languages for what each language extracts.
Combine with other filters
Section titled “Combine with other filters”Symbol search composes with all other query filters:
# Symbols in a specific languagerfx query "parse" --symbols --lang rust
# Symbols matching a path patternrfx query "Handler" --symbols --paths "src/api/"
# JSON output for toolingrfx query "Config" --symbols --kind struct --jsonPerformance
Section titled “Performance”Symbol search adds Tree-sitter parsing to the query pipeline, but this only runs on files that pass the trigram filter. Typical overhead is 1–5ms on top of the base query time.
On large codebases, symbol search is often faster in practice because it returns fewer results, reducing output formatting time.
Next steps
Section titled “Next steps”- Regex & AST Patterns — structural code pattern matching
- Supported Languages — symbol types by language
- CLI Commands — full
rfx queryreference