Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>vscode-rustfmtNew to Visual Studio Code? Get it now.
vscode-rustfmt

vscode-rustfmt

statiolake

|
61,675 installs
| (2) | Free
document formatter for single rust file
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

vscode-rustfmt

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).

Features

  • Format when editing .rs file.

Configurations

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
    }

Requirements

You must have rustfmt in your PATH.

Release Notes

Version 0.1.3

Make edition flag configurable (defaults to 2021).

Version 0.1.2

Add --edition 2018 flag.

Version 0.1.1

Fix and issue related to not picking the local rustfmt.toml. (#2)

Version 0.1.0

(This version is lost)

Version 0.0.1

Initial release.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft