Andersbakken/rtags@db39790fda -> Andersbakken/rtags@9e442e5b30 ananthakumaran/tide@b93e555858 -> ananthakumaran/tide@29475d9eee asok/projectile-rails@772f4766b5 -> asok/projectile-rails@701784df7b brotzeit/rustic@6eec971387 -> brotzeit/rustic@39423d1cf4 dgutov/robe@11207bd549 -> dgutov/robe@b9d5ab549f emacs-lsp/emacs-ccls@675a5704c1 -> emacs-lsp/emacs-ccls@29d231590f emacs-lsp/lsp-haskell@485c1148ce -> emacs-lsp/lsp-haskell@3249cde75f emacs-typescript/typescript.el@88f317f0b6 -> emacs-typescript/typescript.el@4fcb459481 emacsmirror/cmake-mode@d5d77de8c4 -> emacsmirror/cmake-mode@6ce5633144 haskell/haskell-mode@90503413f4 -> haskell/haskell-mode@a34ccdc54b jart/disaster@10a785facc -> jart/disaster@0c13bd244c nonsequitur/inf-ruby@dbf4386bac -> nonsequitur/inf-ruby@0ce7f4049e pd/yard-mode.el@ba74a47463 -> pd/yard-mode.el@ef3426ff55 pezra/rspec-mode@4215ff1f2d -> pezra/rspec-mode@62853a428b senny/rvm.el@c1f2642434 -> senny/rvm.el@e1e83b5466 - (#7070) lsp-haskell update should address lag and errors in haskell-mode when using LSP. Ref: #7070
:lang rust
Description unfold
This module adds support for the Rust language and integration for its tools,
e.g. cargo
.
- Code completion (doom-package:racer or an LSP server)
- Syntax checking (doom-package:flycheck)
- LSP support (for rust-analyzer and rls) (doom-package:rustic)
- Snippets
Maintainers
- @hlissner
Module flags
- +lsp
-
Enable LSP support for
rustic-mode
. Requires doom-module::tools lsp and a langserver (supports rust-analyzer and rls). - +tree-sitter
- Leverages tree-sitter for better syntax highlighting and structural text editing. Requires doom-module::tools tree-sitter.
Packages
Hacks
- rustic has been modified not to automatically install lsp-mode or eglot if they're missing. Doom expects you to have enabled the doom-module::tools lsp module yourself.
TODO Changelog
This module does not have a changelog yet.
Installation
Enable this module in your doom!
block.
This module requires rust
, which can be acquired through rustup
:
curl https://sh.rustup.rs -sSf | sh
Note that when the Rust language has updates, you are to run rustup
such
that it doesn't upgrade itself:
rustup update --no-self-update
Other Requirements
- If doom-module::editor format is enabled, you'll need
rustfmt
:$ rustup component add rustfmt-preview
. - Users with doom-module:+lsp enabled will need rust-analyzer (rls is supported, but deprecated).
-
Using the following commands requires:
cargo-process-check
:$ cargo install cargo-check
cargo-process-clippy
:$ rustup component add clippy-preview
TODO Usage
🔨 This module's usage documentation is incomplete. Complete it?
LSP support (rls or rust-analyzer)
This module supports LSP integration. For it to work you'll need:
- To install rust-analyzer through your OS package manager (RLS is supported too, but it is deprecated).
- To enable the doom-module::tools lsp module.
- To enable the doom-module:+lsp flag on this module.
Format on save
Enable doom-module::editor format +onsave to get formatting on save with rustfmt
. No
additional configuration is necessary.
Keybinds
Binding | Description |
---|---|
<localleader> b a |
cargo audit |
<localleader> b b |
cargo build |
<localleader> b B |
cargo bench |
<localleader> b c |
cargo check |
<localleader> b C |
cargo clippy |
<localleader> b d |
cargo doc |
<localleader> b n |
cargo update |
<localleader> b o |
cargo outdated |
<localleader> b r |
cargo run |
<localleader> t a |
cargo test |
<localleader> t t |
run current test |
TODO Configuration
🔨 This module's configuration documentation is incomplete. Complete it?
Enabling eglot support for Rust
Doom's doom-module::tools lsp module has an doom-module:+eglot flag. Enable it and this module will use eglot instead.
Troubleshooting
error[E0670]: `async fn` is not permitted in the 2015 edition
You may be seeing this error, despite having edition = "2018"
in your
Cargo.toml
. This error actually originates from rustfmt
, which the LSP
server tries to invoke on save (if you have rustic-format-trigger
or [[doom-module::editor
format]] enabled).
To fix this your project needs a rustfmt.toml
with edition = "2018"
in it.
Frequently asked questions
This module has no FAQs yet. Ask one?
TODO Appendix
🔨 This module has no appendix yet. Write one?