Hi there, people!!
I would like to announce my new package
language-rust-treesitter. It’s a package that uses
tree-sitter-rust to get fast and powerful rust syntax highlight with much better tokennization than
The key features of it are:
- Contextualized tokennization using
- Backup TextMate language support, just in case Tree Sitter one doesn’t work on your machine.
- Several snippets.
- Expose much more classes to make better syntax theme stylization.
What is “contextualized tokennization”?
tree-sitter, one can use and abuse the generated tree to get more accurate tokennization. That means that we can have equal symbols being tokennized into different things depending of the source code context. That means we have 2 consequences, considering a theme with proper styling:
- Easy to know the meaning of a symbol in the code (e.g. If “|” is a bitwise or or a closure definition || If “*” is a deference or a pointer definition or multiplication operator || If “…” is a range or a match remaining)
- Easy to get wrong syntax: since it will be tokennized only if in the right context (e.g. “@” will not be tokennized if it’s not in the right || “&” will not be tokennized if the following lifetime has no name (
&') or of there is no type specified (
I would be more than happy if people at lest test it and give feedback
Github repository: https://github.com/GrayJack/language-rust-treesitter
P.S.: I made my theme support this, it you’re interested, the package is monokai-grayjack-syntax