doomemacs/modules/lang/rust
Henrik Lissner 82ae3a73f3
def-advice!->defadvice! & conform to new advice conventions
This commit does two things:

- Renames def-advice! to defadvice!, in the spirit of naming convenience
  macros after the function/macro they enhance or replace.
- Correct the names of advice functions to indicate visibility and
  intent. A public advice function like doom-set-jump-a is meant to be
  used elsewhere. A private one like +dired--cleanup-header-line-a
  shouldn't -- it likely won't work anywhere but the function(s) it was
  made to advise.
2019-07-23 17:24:56 +02:00
..
autoload.el use keybindings from cargo mode 2019-07-04 20:58:44 +02:00
config.el def-advice!->defadvice! & conform to new advice conventions 2019-07-23 17:24:56 +02:00
doctor.el lang/rust: add doctor checks for lsp servers 2019-07-09 20:35:09 +02:00
packages.el lang/rust: use rustic-mode instead on Emacs 26+ 2019-07-09 17:54:18 +02:00
README.org add b prefix back 2019-07-05 16:15:05 +02:00

lang/rust

Description

Add support to Rust language and cargo commands inside emacs.

  • Code completion (racer)
  • Syntax checking (flycheck)
  • Snippets

Module Flags

  • +lsp to add support Language server protocol.

Hacks

{A list of internal modifications to included packages}

Prerequisites

To get started with Rust, you can either use rustup and install rust with:

curl https://sh.rustup.rs -sSf | sh

Package manager is not recommended to install Nightly version of Rust what is required for racer from version 2.1 (more info in Troubleshooting)

Some commands require additional crates to be installed to work, e.g. cargo add.

rustup component add rustfmt
rustup component add cargo-check
rustup component add cargo-edit

Features

This module also supports LSP, it requires installation of Rust Language Server RLS. To enable this you need to enable lsp in :tools section in init.el file.

Keybindings

Binding Description
<localleader> b a cargo add
<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 r cargo run
<localleader> b s cargo search
<localleader> b u cargo update
<localleader> t a cargo test
<localleader> t f run tests in current file
<localleader> t t run current test

TODO Configuration

How to configure this module, including common problems and how to address them.

Troubleshooting

Racer installation problems

Racer need now (From 2.1 version) nightly version of Rust

If you installed trough rustup

rustup toolchain add nightly

cargo +nightly install racer