This extension provides a TextMate grammar for Rust, with the following goals:
This grammar is being evaluated in VS Code Nightly, and may become the default Rust grammar for VS Code in the future. However, for the moment this extension is the most current version. Feedback is ongoing, so the current scopes may change.
The grammar in Rust Analyzer is temporarily being kept in sync with this one while we wait on a merge into VS Code Stable. If you have an issue or PR, please submit it here.
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
Along with your 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.
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
If you need a theme that works out of the box with this grammar, please check out Yarra Valley: