This project is no longer supported. Check out https://rust-analyzer.github.io/
Simple VSCode diagnostic integration. Provides: code diagnostics, formatting, and snippets.
This extension is for if the RLS is causing you issues. If it is not, I recommend trying out the official Rust VSCode Extension.
This extension automatically provides inline diagnostics for Rust by calling cargo check
and parsing the output. As a result, it avoids using the RLS. This isn't ideal in the long term, but currently the nightly RLS preview has trouble on some projects and crashes frequently.
By default, this runs on save and on startup.
Formatting is supported through the rustfmt
tool. Formatting style can be configured by creating a rustfmt.toml
file in the same directory as your Cargo.toml
file. Possible configuration settings can be found here. More information about the rustfmt
tool can be found here.
By default, formatting is not enabled.
It supports multiple rust projects in the same workspace. The extension will search for Cargo.toml
files in the workspace and use them as the root directories to generate diagnostics for.
Basic snippets are provided for Rust.
rustfmt
Make sure you have rustup installed. Instructions for installing rustup can be found here.
If you have already installed rustfmt
via cargo, you will need to delete it from your cargo bin directory. Using rustfmt
through cargo may break when switching toolchains or updating the compiler.
Install rustfmt
by running:
rustup component add rustfmt-preview
This extension contributes the following settings:
Setting | Description | Default |
---|---|---|
rust-assist.diagnosticsOnStartup |
Specifies if diagnostics should be generated on startup. | true |
rust-assist.diagnosticsOnSave |
Specifies if diagnostics should be generated on save. | true |
rust-assist.formatOnSave |
Specifies if the file should be formatted on save. | false |
rust-assist.formatMode |
The format mode to write in. Backup generates backups, overwrite does not. | overwrite |
If a Cargo.toml
file is not found, the extension will not provide diagnostic data.
rustfmt.toml
.