Just a random thought, but I would like the bang suffix to be highlighted a distinct color. Just wanted to mention it while I thought of It. I might get time later to look into it, but have a few priority bugs I want to fix.
For example in the below VS Code snippet, I'd love the ! to stand out a bit more.
Screenshot-2024-04-21-at-12.15.59.png
I'll add it to tree sitter :), maybe the same colour as other builtins?
I guess it is an operator, but we don't currently highlight any of the operators in my VS Code...
The tree-sitter grammar recognizes ! as an operator and it gets highlighted in editors that use tree-sitter syntax highlighting (e.g. helix).
VSCode highlighting uses their own tmLanguage.json setup. There are at least two roc community packages and the one with the more recent commits looks like it was written against an older version of the language or maybe it's from Elm with some updates. Doing the update would only be a few minutes but it's not clear to me where a PR would even go and I'm not actively using VSCode...
@Ivan Demchenko
Does VS Code use tree-sitter in that setup? I'm not familiar with it
I just assumed it did
https://github.com/microsoft/vscode/issues/50140
TIL that VS Code uses TextMate grammar for syntax highlighting.
Yup, it's pretty sad really. It would be great.
I believe because microsoft has semantic highlighting in the language server protocol they just decided they didn't want it. But that is way slower than TS and doesn't let you do semantic selection and navigation (select this function, move up one function, move to the next parameter etc)
Just looking at the https://www.roc-lang.org/install page... and it doesn't mention TS. @Eli Dowling do you thinkk we should link to your repo from this page? Or maybe have a bit of an explainer for setting up with common editors?
@Luke Boswell I'm hoping we should have a zed extension soon, and I'll get around to doing a PR for helix soon, now that tree sitter roc is pretty much battle tested.
Ican add the Emacs extension there.
I haven't found a neovim extension yet, but I know there is support in tree-sitter.nvim I'll see about adding to to mason and nvim-lsp.
I'll update that page in the next couple weeks, once there is some progress on all that :)
I think @nat-418 was working on neovim
Luke Boswell said:
I think nat-418 was working on neovim
Yeah but if @Eli Dowling wants to lead on the LSP I am happy to review / help as needed.
I maintain a fork of https://github.com/faldor20/tree-sitter-roc for my needs in terms of nvim integration. It's just on my GitHub.
I think we will also need regex parsers for vim as well so that Roc can at least have some syntax highlighting out of the box.
nat-418 has marked this topic as resolved.
Last updated: Jun 16 2026 at 16:19 UTC