Contributing to nvim-treesitter
The main parts ofnvim-treesitter are:
- A curated list of parsers for various programming languages
- A collection of queries that enable tree-sitter features in Neovim
Prerequisites
Before contributing, we recommend familiarizing yourself with:- Tree-sitter documentation - Understanding how tree-sitter works
- Neovim’s tree-sitter documentation - Neovim-specific implementation details
Getting Help
There are dedicated Matrix channels for questions and general help:- #nvim-treesitter - Questions specific to Neovim’s implementation and the queries
- #tree-sitter - General tree-sitter questions and CLI usage
What Can You Contribute?
Parsers
Add support for new languages by registering parsers that meet the inclusion criteria. See Adding Parsers for detailed instructions.Queries
Improve or create queries for:- highlights.scm - Syntax highlighting
- injections.scm - Multi-language support
- folds.scm - Code folding
- indents.scm - Automatic indentation (experimental)
- locals.scm - Scope tracking (limited support)
Development Workflow
Make Changes
Make your changes to parsers or queries following the guidelines in the respective sections.
Test Locally
Use the testing tools to verify your changes work correctly. See Testing for details.
Quality Standards
For Parsers
For Queries
- Follow standard formatting (2 spaces per nesting level, one node per line)
- Use only valid captures for Neovim (different from Helix or other editors)
- Ensure patterns are valid for the parser version in nvim-treesitter
- Run
make querybefore submitting (formats, lints, and checks)
Tools and Commands
The following commands are available for development:Parser Tiers
nvim-treesitter uses a two-tier system:Tier 1 (Preferred)
Tier 1 parsers provide the best stability and are strongly recommended for new additions:- Make regular releases following semantic versioning:
- Patch - Fixes not affecting queries
- Minor - New nodes or patterns
- Major - Removed nodes or breaking changes
- Provide WASM release artifacts
- Meet all general parser requirements