Skip to content

Latest commit

 

History

History
85 lines (67 loc) · 2.97 KB

README.org

File metadata and controls

85 lines (67 loc) · 2.97 KB

lang/rust

Table of Contents

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.

Plugins

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 features have additional dependencies:

  • The :editor format module uses rustfmt for rust files: rustup component add rustfmt-preview
  • The following commands require:
    • cargo-process-check: cargo install cargo-check
    • cargo-process-clippy: rustup component add clippy-preview
    • cargo-process-{add,rm,upgrade}: cargo install 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

BindingDescription
<localleader> b acargo add
<localleader> b bcargo build
<localleader> b Bcargo bench
<localleader> b ccargo check
<localleader> b Ccargo clippy
<localleader> b dcargo doc
<localleader> b rcargo run
<localleader> b scargo search
<localleader> b ucargo update
<localleader> t acargo test
<localleader> t frun tests in current file
<localleader> t trun current test

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