2.0 KiB
2.0 KiB
Running Rustfmt from IntelliJ or CLion
Installation
-
Install CLion, IntelliJ Ultimate or CE through the direct download link or using the JetBrains Toolbox. CLion and IntelliJ Ultimate provide a built-in debugger interface but they are not free like IntelliJ CE.
-
Install the Rust Plugin by navigating to File → Settings → Plugins and searching the plugin in the Marketplace
-
Restart CLion/IntelliJ
Configuration
Run Rustfmt on save
-
Open Rustfmt settings (File → Settings → Languages & Frameworks → Rust → Rustfmt) and enable "Run rustfmt on Save"
-
IntelliJ uses autosave, so now your files will always be formatted according to rustfmt. Alternatively you can use Ctrl+S to reformat file manually