docs(rust): fix links & revise

Ref: #6269
Co-authored-by: Schievel1 <Schievel1@users.noreply.github.com>
This commit is contained in:
Henrik Lissner 2023-07-22 19:02:44 +02:00
parent 1cd2a287f5
commit fecf1f8d28
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -40,22 +40,33 @@ e.g. ~cargo~.
* Installation * Installation
[[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]] [[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]]
This module requires ~rust~, which can be acquired through =rustup=: This module requires a working installation of [[https://www.rust-lang.org/][Rust]] for its more advanced
features, and offer only syntax highlighting otherwise. The simplest way to
install it is through [[https://rustup.rs][rustup]]:
#+begin_src sh #+begin_src sh
curl https://sh.rustup.rs -sSf | sh $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# And can be updated later with:
$ rustup update --no-self-update
#+end_src #+end_src
Note that when the Rust /language/ has updates, you are to run =rustup= such To install and manage Rust on Windows, consult [[https://forge.rust-lang.org/infra/other-installation-methods.html][Rust's official documentation]].
that it doesn't upgrade itself:
#+begin_src sh #+begin_quote
rustup update --no-self-update 📌 Once installed, I recommended that you add Cargo's executable to your
#+end_src ~$PATH~, so that the Emacs utilities that depend on it -- or any tools
installed through it -- can easily locate them (without any added
configuration on your part).
Also, if you have used ~$ doom env~ in the past, changes to your ~$PATH~
won't be visible to Doom until you run it (or ~$ doom sync~) again.
#+end_quote
** Other Requirements ** Other Requirements
- If [[doom-module::editor format]] is enabled, you'll need =rustfmt=: ~$ rustup component add - If [[doom-module::editor format]] is enabled, you'll need =rustfmt=: ~$ rustup component add
rustfmt-preview~. rustfmt-preview~.
- Users with [[doom-module:+lsp]] enabled will need [[https://rust-analyzer.github.io/][rust-analyzer]] (rls is supported, but - Users with [[doom-module:+lsp]] enabled will need [[github:rust-analyzer/rust-analyzer][rust-analyzer]] (rls is supported,
[[https://blog.rust-lang.org/2022/07/01/RLS-deprecation.html][deprecated]]). but [[https://blog.rust-lang.org/2022/07/01/RLS-deprecation.html][deprecated]]).
- Using the following commands requires: - Using the following commands requires:
- ~cargo-process-check~: ~$ cargo install cargo-check~ - ~cargo-process-check~: ~$ cargo install cargo-check~
- ~cargo-process-clippy~: ~$ rustup component add clippy-preview~ - ~cargo-process-clippy~: ~$ rustup component add clippy-preview~
@ -65,17 +76,23 @@ rustup update --no-self-update
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
** LSP support (rls or rust-analyzer) ** LSP support (rust-analyzer)
This module supports LSP integration. For it to work you'll need: This module supports [[https://github.com/rust-lang/rust-analyzer][rust-analyzer]] ([[https://github.com/rust-lang/rls][RLS]] too, but it is [[https://blog.rust-lang.org/2022/07/01/RLS-deprecation.html][deprecated]]), which must be installed outside of Emacs, typically with rustup or your OS package manager.
1. To install [[https://github.com/rust-analyzer/rust-analyzer][rust-analyzer]] through your OS package manager ([[https://github.com/rust-lang/rls][RLS]] is supported Installation through rustup is simplest:
too, but it is [[https://blog.rust-lang.org/2022/07/01/RLS-deprecation.html][deprecated]]). #+begin_src sh
2. To enable the [[doom-module::tools lsp]] module. $ rustup component add rust-analyzer rust-src
3. To enable the [[doom-module:+lsp]] flag on this module. #+end_src
If your needs are more complex, consult [[https://rust-analyzer.github.io/manual.html#installation][rust-analyzer's documentation]].
Finally, enable Doom's [[doom-module::tools lsp]] module, and this module's
[[doom-module:+lsp]] flag ([[id:01cffea4-3329-45e2-a892-95a384ab2338][how to enable modules and their flags]]), and you're good
to go!
** Format on save ** Format on save
Enable [[doom-module::editor format +onsave]] to get formatting on save with =rustfmt=. No Enable [[doom-module::editor format +onsave]] to get formatting on save with
additional configuration is necessary. =rustfmt=. No additional configuration is necessary.
** Keybinds ** Keybinds
| Binding | Description | | Binding | Description |