This extension provides a TextMate grammar for Rust, with the following goals:
This grammar has been upstreamed as the default Rust grammar for VS Code (issues and PRs should be submitted here). It takes approximately 4 weeks for new changes to be scraped, so you'll need the extension if you want to see changes immediately.
Not all themes are specifically optimized for Rust.
We have tried to provide sensible default scopes that will work with most themes.
If you want to modify the colors in a particular theme, you can do so in your
The VS Code command
Rust Syntax is compatible with Rust Analyzer, but the scopes provided by Rust Syntax will only be visible if you choose to disable semantic highlighting in your
The grammar is maintained as YAML, using tasks to generate JSON on save (please don't edit the JSON grammar directly).
You can regenerate the JSON manually from the command palette using
Tests have not yet been implemented for the grammar, but the framework is in place to do this when time allows.
If you submit new changes, please add (or modify) a unit test with a brief code snippet that demonstrates the scopes affected by your PR.
Instructions for writing tests are available in @PanAeon's vscode-tmgrammar-test repo.
You can run the tests from the command palette using
A PR with a failing test is the preferred way of filing an issue, as it ensures there is a code snippet to work on.