Hey folks, I know it's been a while, but I finally got around to finishing the update to the TS syntax for roc.
Should support all syntax in the existing rust compiler. (except WSA)
https://github.com/faldor20/tree-sitter-roc
For those testing the new compiler, I got a bit ahead and implemented the new syntax here:
https://github.com/roc-lang/roc/issues/7106
You can find that version here:
https://github.com/faldor20/tree-sitter-roc/tree/new-syntax
Something I spent quite a while making work was being able to color effectful and shadowable idents:
(identifier "!")@ident.effectful
(identifier "_")@ident.shadowable
It parses the "!" and "_" separate, so we can then query only effectful/shadowable idents
Thanks for working on this!
Thank you for your hard work Eli, especially on the new syntax support!
I wonder selfishly how hard it would be to create a .snapshot.roc
grammar that has embeds for the new Roc grammar and the SExpr syntax (as just Scheme or basic LISP) in our snapshot files
And also treat the section dividers as comments (with maybe some highlighting for the section header text
Not hard at all! Embeds are super easy. If you make a discussion with some syntax examples I can offer advice or if it's simple just do it this arvy
Cool, yeah I'll probably take a shot at it sometime soon
It'll be great for snapshots to be easy to read unlike our old snapshots
I just made an update to the syntax to fix some issues @JanCVanB noticed.
Daniel Schierbeck has marked this topic as resolved.
Last updated: Jul 26 2025 at 12:14 UTC