Skip to content
Unofficial community docs. Content pulled on 2026-10-24 from Trail-Code@d205ac3. For the latest, see the official repo.

Supported languages

The graft map parses with tree-sitter at two levels of fidelity, plus an optional compiler-grade layer, all $0 and deterministic (no model, no key).

Twenty-four languages, plus Vue single-file components. A file whose language isn’t listed is skipped, not indexed.

Hand-written extractors with scope-aware, cross-file call and import resolution:

Language Notes
TypeScript / JavaScript Including JSX & TSX
Python
Go
Java
Kotlin
PHP
Swift Classes, structs, enums, actors, protocols; extension members attach to the extended type
R .R/.r: plain functions, S3/S4/R6 classes and methods, roxygen @export, library()/source() imports
Vue single-file components Their <script> blocks go through the TypeScript extractor

Symbols (functions, classes, methods, types, …) plus name-resolved call edges via a generic tree-sitter extractor, one grammar per language:

Rust, C, C++, C#, Ruby, Scala, Elixir, Solidity, Dart, Clojure, Nix, Lua, Gleam.

Symbols only for now, no call edges: OCaml, Zig.

trail build --lsp adds precise lsp_resolved call edges (member calls the static pass can’t type) when a language server is on your PATH. It uses the first one installed, in this order, one server per build:

  1. rust-analyzer (Rust)
  2. clangd (C/C++)
  3. gopls (Go)
  4. pyright (Python)
  5. typescript-language-server (TS/JS)

It’s best-effort: with no server installed the graph is unchanged.

Adding a broad-tier language is a small contribution; see CREDITS.md for the folks who added the current set.