summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/atom.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/tools/rustfmt/atom.md
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/rustfmt/atom.md')
-rw-r--r--src/tools/rustfmt/atom.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/tools/rustfmt/atom.md b/src/tools/rustfmt/atom.md
new file mode 100644
index 000000000..f77ac1490
--- /dev/null
+++ b/src/tools/rustfmt/atom.md
@@ -0,0 +1,31 @@
+# Running Rustfmt from Atom
+
+## RLS
+
+Rustfmt is included with the Rust Language Server, itself provided by [ide-rust](https://atom.io/packages/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](https://atom.io/packages/atom-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](README.md).
+- 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](https://cloud.githubusercontent.com/assets/6623285/11147685/c8ade16c-8a3d-11e5-9da5-bd3d998d97f9.png)
+
+- 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](https://cloud.githubusercontent.com/assets/6623285/11147718/f4d10224-8a3d-11e5-9f69-9e900cbe0278.png)