Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/tree-sitter/tree-sitter/llms.txt

Use this file to discover all available pages before exploring further.

Tree-sitter has a growing ecosystem of parsers for many programming languages. Parsers are maintained both by the core team and by the community.

Finding Parsers

The most comprehensive list of available parsers is maintained on the Tree-sitter Wiki:

List of Parsers

Community-maintained list of all known Tree-sitter parsers

Official Parsers

The following parsers are maintained in the official tree-sitter organization on GitHub:

Agda

Bash

C

C++

C#

CSS

ERB / EJS

Go

Haskell

HTML

Java

JavaScript

JSDoc

JSON

Julia

OCaml

PHP

Python

Regex

Ruby

Rust

Scala

TypeScript

Verilog

Installing Parsers

How you install and use parsers depends on your use case:

For the CLI

The Tree-sitter CLI can automatically download and build parsers. See CLI Configuration for details on configuring parser directories.

For Language Bindings

Each language binding has its own way of loading parsers:
Add the parser as a dependency in your Cargo.toml:
[dependencies]
tree-sitter = "0.24"
tree-sitter-rust = "0.23"
Then use it in your code:
use tree_sitter::Parser;
use tree_sitter_rust::language;

let mut parser = Parser::new();
parser.set_language(&language()).unwrap();
See the Getting Started guide for more details.

Community Parsers

The community has created parsers for many more languages. Some notable sources:

tree-sitter-grammars Organization

Many high-quality community parsers are maintained in the tree-sitter-grammars organization:
The tree-sitter-grammars organization hosts community-maintained parsers that follow consistent quality standards and best practices.

Individual Repositories

Many developers maintain their own Tree-sitter parsers. Check the Parser List Wiki for a complete catalog.

Creating Your Own Parser

Don’t see a parser for your language? You can create one yourself!

Creating Parsers

Learn how to write a Tree-sitter parser from scratch
The process involves:
  1. Install the CLI: Get the tree-sitter command-line tool
  2. Initialize your parser: Run tree-sitter init to set up the project
  3. Write the grammar: Define the syntax rules in grammar.js
  4. Generate the parser: Run tree-sitter generate to create the parser code
  5. Test your parser: Write and run tests to validate the parser
  6. Publish: Share your parser with the community
See the Creating Parsers section for a complete guide.

Parser Quality

When choosing a parser, consider:
  • Maintenance: Is it actively maintained?
  • Completeness: Does it cover the full language specification?
  • Test Coverage: Are there comprehensive tests?
  • Community: Is it widely used?
  • Performance: How fast is it on typical code?
Official parsers in the tree-sitter organization are generally well-maintained and follow best practices, but many community parsers are also excellent quality.

Query Files

Many parsers include query files for syntax highlighting, code navigation, and more:
  • queries/highlights.scm: Syntax highlighting
  • queries/tags.scm: Code navigation and symbol tagging
  • queries/locals.scm: Local variable tracking
  • queries/injections.scm: Embedded language detection
See Syntax Highlighting and Code Navigation for more information.

Publishing Your Parser

Once you’ve created a parser, you can share it with the community:

Add to Wiki

Add your parser to the community list

Publishing Guide

Learn how to publish your parser to package registries

Getting Help

If you need help with a parser:
  • Check the parser’s repository for issues and documentation
  • Ask in Discord or Matrix
  • Open an issue in the parser’s repository
  • See the Community & Support page for more ways to get help