项目
在 GitHub 查看 awesome-tree-sitter
HerringtonDarkholme/awesome-tree-sitter
关于
A curated list of tree-sitter resources.
学习与教育实测星标增长
- 24小时
- 0
- 7天
- +1
- 15天
- +1
- 1个月
- +1
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文awesome-tree-sitter 
A curated list of Tree-sitter resources, tools, and learning material.
Pull requests welcome! Please keep entries succinct, sorted, and in the most fitting section.
Contents
- Overview
- Official Resources
- Install Tree-sitter
- Parsers
- Bindings
- Editors
- Tools
- Tutorials
- Playgrounds
- Articles
- Research
- Talks
- Contributing
Overview
Tree-sitter is an incremental parsing system that produces concrete syntax trees suitable for fast syntax highlighting, code navigation, refactoring, and structural search.
Official Resources
- Website: https://tree-sitter.github.io/tree-sitter/ — project home, docs, news.
- Playground: https://tree-sitter.github.io/tree-sitter/playground — inspect parse trees in the browser.
- Documentation: https://tree-sitter.github.io/tree-sitter/using-parsers — parser usage guide.
Install Tree-sitter
- CLI installation: https://tree-sitter.github.io/tree-sitter/creating-parsers#installation — build and install from source.
- Package manager: https://github.com/tspm-io/tspm — install grammars and the CLI via a package manager.
Parsers
- Official parser list: https://tree-sitter.github.io/tree-sitter/#available-parsers — maintained grammars with docs.
- Community grammars: https://github.com/tree-sitter/tree-sitter/wiki/Parsers — additional language support.
Bindings
- JavaScript / TypeScript: https://github.com/tree-sitter/node-tree-sitter — Node.js bindings.
- Rust: https://docs.rs/tree-sitter — Rust crate for parsers.
- Python: https://github.com/tree-sitter/py-tree-sitter — Python bindings.
- Go: https://github.com/smacker/go-tree-sitter — Go bindings.
- Multi-language pack: https://github.com/xberg-io/tree-sitter-language-pack — 300+ pre-built grammars with unified bindings for Python, Node.js, Rust, Go, Java, Ruby, PHP, C#, and more.
Editors
- Emacs: https://emacs-tree-sitter.github.io/ — Tree-sitter integration and modes.
- Helix: https://github.com/helix-editor/helix — modal editor using Tree-sitter everywhere.
- Lapce: https://lapce.dev/ — fast code editor with Tree-sitter highlighting.
- Monaco: https://github.com/Menci/monaco-tree-sitter — Tree-sitter for the Monaco editor.
- NeoVim: https://github.com/nvim-treesitter/nvim-treesitter — Treesitter core (docs: https://neovim.io/doc/user/treesitter.html).
- Notepad++: https://github.com/Thorium/NppTreeSitter — Tree-sitter highlighting, folding and code navigation plugin.
- Pulsar: https://pulsar-edit.dev/ — Atom community fork with Tree-sitter support.
- Zed: https://zed.dev/ — collaborative editor built on Tree-sitter.
Tools
- Analysis / navigation: https://github.com/microsoft/vscode-anycode — VS Code language features without servers.
- Analysis / navigation: https://github.com/BloopAI/bloop/tree/main/server/bleep/src/intelligence — semantic search backed by Tree-sitter.
- Analysis / navigation: https://github.com/bstee615/tree-climber — structural code analysis.
- Analysis / navigation: https://github.com/zizmorcore/zizmor — static analysis via Tree-sitter.
- Analysis / navigation: https://github.com/Goldziher/basemind — Code-map & code-search across 300+ languages built on tree-sitter: symbols, references, callers, and call graphs, served to AI agents over MCP.
- Analysis / navigation: https://github.com/panbanda/omen — code-health analysis (complexity, tech debt, hotspots, clones) via Tree-sitter.
- Analysis / navigation: tolmap – Uses Tree-sitter to map a codebase into districts and trace imports across files. The npm CLI runs on Linux x64.
- Analysis / navigation: https://github.com/vinhnx/VTCode — terminal coding agent using tree-sitter-bash for fail-closed shell safety and bundled grammars for structural search.
- Analysis / navigation: https://github.com/Whq02/MercuryCLI — open-source terminal coding agent bundling 57 web-tree-sitter WASM grammars for structural AstSearch and dry-run AstEdit rewrites.
- Code highlighting: https://github.com/bearcove/arborium — Tree-sitter powered syntax colors.
- Code manipulation: https://github.com/mizlan/iswap.nvim — swap nodes in NeoVim.
- Code manipulation: https://github.com/nvim-treesitter/nvim-treesitter-textobjects — text objects from syntax nodes.
- Code manipulation: https://github.com/mfussenegger/nvim-treehopper — leap through syntax nodes.
- Code manipulation: https://github.com/haritkapadia/ts-movement — navigate code by syntax units.
- Code manipulation: https://github.com/junyi-hou/tree-sitter-fold — folding driven by parse trees.
- Code manipulation: https://github.com/ethan-leba/tree-edit/ — structural editing via Tree-sitter.
- Code manipulation: https://github.com/Goldziher/uncomment — strip comments from source across 30+ languages via Tree-sitter queries.
- Conflict merge: https://mergiraf.org/ — semantic merge tool.
- Diff: https://difftastic.wilfred.me.uk/ — syntax-aware diff viewer.
- Diff: https://github.com/afnanenayet/diffsitter — Tree-sitter based diffing.
- Diff: https://github.com/sshah03/perspica — semantic diff for code review: names each change, sets mechanical noise aside, and orders changes by call flow.
- Diff: https://github.com/naqerl/citydiff — structural diff over a commit range, drawn as a 3D city of packages, declarations and calls.
- Documentation: https://github.com/sourcegraph/doctree — docs explorer using parse trees.
- Formatting: https://topiary.tweag.io/ — formatter built on Tree-sitter grammars.
- Graphs and relations: https://github.com/tree-sitter/tree-sitter-graph — graph queries over syntax trees.
- Graphs and relations: https://github.blog/2021-12-09-introducing-stack-graphs/ — stack graph overview.
- Search / lint: https://ast-grep.github.io/ — structural search and rewrite.
- Search / lint: https://github.com/BrianHicks/tree-grepper — grep syntax nodes.
- Search / lint: https://github.com/maxbrunsfeld/tree-tags — ctags generated from parse trees.
- Secrets / security: https://github.com/mongodb/kingfisher — secret scanning via Tree-sitter.
- Secrets / security: https://github.com/PurCL/RepoAudit — static analysis with Tree-sitter.
- Secrets / security: https://github.com/trailofbits/buttercup — security-oriented parsing.
- Secrets / security: https://github.com/noperator/slice — SAST using Tree-sitter queries.
- Secrets / security: https://semgrep.dev/ — pattern-based SAST.
- Source code representation: https://github.com/IBM/tree-sitter-codeviews — code views from syntax trees.
Tutorials
- Tree-sitter basics: https://siraben.dev/2022/03/01/tree-sitter — intro and examples.
- Q&A collection: https://github.com/sogaiu/ts-questions — common questions and answers.
Playgrounds
- Arborium highlighting playground: https://arborium.bearcove.eu/ — preview syntax colors.
- AST-grep playground: https://ast-grep.github.io/playground.html — test structural queries.
- Official playground: https://tree-sitter.github.io/tree-sitter/playground — inspect grammar outputs.
- TSPM playground: https://tspm.io/ — browse grammars and examples.
Articles
- Building a linter with Tree-sitter: https://siraben.dev/2022/03/22/tree-sitter-linter.html — hands-on linter walkthrough.
- Limitations and considerations: https://blog.jez.io/tree-sitter-limitations/ — trade-offs and pitfalls.
- Pattern matching deep dive (AST-grep): https://medium.com/better-programming/deep-dive-into-ast-greps-pattern-7efc3eefc7c3 — pattern semantics.
- Tooling for tooling: https://uptointerpretation.com/posts/tooling-for-tooling/#fn:2 — Tree-sitter context in tooling.
Research
- Incremental re-parse: https://dl.acm.org/doi/fullHtml/10.1145/3487019.3487022 — original paper on incremental parsing.
- Customized source code representations: https://arxiv.org/abs/2307.04693 — Tree-sitter based embeddings.
Talks
- Tree-sitter beyond syntax highlighting (EmacsConf 2022): https://emacsconf.org/2022/talks/treesitter/ — overview of advanced uses.
Contributing
Please ensure new entries follow the Awesome list guidelines and the awesome manifesto: include only recommendable resources, keep descriptions brief, choose the best section, sort alphabetically, and avoid duplicates. PRs welcome.
探索相关项目
加载中…