rust/atom.md
Lucian 8cd8ab5f4b Fix minor typos and grammar
Signed-off-by: Lucian <lucian.buzzo@gmail.com>
2018-12-06 15:31:43 +00:00

1.3 KiB

Running Rustfmt from Atom

RLS

Rustfmt is included with the Rust Language Server, itself provided by ide-rust.

apm install ide-rust

Once installed a file is formatted with ctrl-shift-c or cmd-shift-c, also available in context menu.

atom-beautify

Another way is to install Beautify, you can do this by running apm install atom-beautify.

There are 2 settings that need to be configured in the atom beautifier configuration.

  • Install rustfmt as per the readme.

  • Open the atom beautifier settings

    Go to Edit->Preferences. Click the packages on the left side and click on setting for atom-beautifier

  • Set rustfmt as the beautifier

    Find the setting labeled Language Config - Rust - Default Beautifier and make sure it is set to rustfmt as shown below. You can also set the beautifier to auto format on save here. image

  • Set the path to your rustfmt location

    Find the setting labeled Rust - Rustfmt Path. This setting is towards the bottom and you will need to scroll a bit. Set it to the path for your rustfmt executable. image