Register rustfmt
as a formatter for Rust code.
Note: You basically doesn't need this extension since now you can use official Rust Analyzer extension to run formatter (even for single Rust file).
- Format when editing
.rs
file.
Include the following setting to your settings.json
:
"[rust]": {
"editor.defaultFormatter": "statiolake.vscode-rustfmt",
"editor.formatOnSave": true //optional
}
Alternatively, you can use official formatter:
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust",
"editor.formatOnSave": true //optional
}
You must have rustfmt
in your PATH.
Make edition
flag configurable (defaults to 2021).
Add --edition 2018
flag.
Fix and issue related to not picking the local rustfmt.toml. (#2)
(This version is lost)
Initial release.