SwiftTreeSitter
Swift API for the tree-sitter incremental parsing system.
- Close to full coverage of the C API
- Swift/Foundation types where possible
- Standard query result mapping for highlights and injections
- Query predicate support via
ResolvingQueryCursor
SwiftTreeSitter is fairly low-level. If you are looking a higher-level system for syntax highlighting and other syntactic operations, you might want to have a look at Neon.
π Documentation is available in DocC format.
Integration
dependencies: [
.package(url: "https://github.com/ChimeHQ/SwiftTreeSitter")
]
Language Parsers
Tree-sitter language parsers are separate projects, and you'll probably need at least one. More details are available in the documentation. How they can be installed an incorporated varies. Since you're here, you might find SPM the most convenient.
Parser | Make | SPM | Official Repo |
---|---|---|---|
Bash | β | β | |
C | β | β | |
C++ | β | β | |
C# | β | β | |
Clojure | |||
CMake | |||
Comment | |||
CSS | β | β | |
D | |||
Dart | |||
Dockerfile | β | β | β |
Diff | β | β | |
Elixir | β | β | β |
Elm | β | β | |
Erlang | |||
Fish | |||
Fortran | |||
gitattributes | |||
gitignore | |||
Go | β | β | β |
GoMod | β | β | β |
GoWork | β | ||
graphql | |||
Hack | |||
Haskell | β | β | |
HCL | β | β | |
HTML | β | ||
Java | β | β | β |
Javascript | β | β | |
JSON | β | β | β |
Json5 | |||
Julia | β | ||
Kotlin | |||
Latex | β | β | |
LLVM | |||
Lua | β | β | |
Make | |||
Markdown | β | β | |
Markdown | β | ||
OCaml | |||
Pascal | |||
Perl | β | β | |
PHP | β | β | β |
PowerShell | |||
Python | β | ||
R | |||
Racket | |||
Regex | |||
Ruby | β | β | β |
Rust | β | β | |
Scala | |||
Scheme | |||
Scss | |||
SQL | β | β | |
Sqlite | |||
SSH | β | β | |
Swift | β | β | β |
TOML | β | ||
Tree-sitter query language | β | β | |
Typescript | |||
Verilog | |||
Vue | |||
YAML | β | ||
Zig | β | β | β |
Suggestions or Feedback
We'd love to hear from you! Get in touch via twitter, an issue, or a pull request.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.