More accurate Go syntax coloring for VSCode

If you, like me, are annoyed by VSCode’s inaccurate syntax coloring of Go code, help is on the way. I have created an extension that uses tree-sitter to accurately color Go syntax.

For those not familiar, Tree-sitter is a really cool project created at Github, to make a real parser that can update the parse tree on every keystroke. VSCode’s builtin parser that get used for syntax coloring is based on regular expressions, which is why it’s so inaccurate.

Additionally, because tree-sitter produces a full syntax tree, it’s possible to do cool things like underline local vars that get modified after being created:

You can download this extension from the VSCode marketplace:

https://marketplace.visualstudio.com/items?itemName=georgewfraser.vscode-tree-sitter

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.