doomemacs/modules/lang/rust/README.org

68 lines
2 KiB
Org Mode
Raw Normal View History

2019-06-05 09:49:02 +03:00
#+TITLE: lang/rust
#+DATE: June 5, 2019
#+SINCE: {replace with next tagged release version}
#+STARTUP: inlineimages
* Table of Contents :TOC_3:noexport:
- [[#description][Description]]
- [[#module-flags][Module Flags]]
- [[#plugins][Plugins]]
- [[#hacks][Hacks]]
2019-06-05 09:49:02 +03:00
- [[#prerequisites][Prerequisites]]
- [[#features][Features]]
- [[#configuration][Configuration]]
- [[#troubleshooting][Troubleshooting]]
- [[#racer-installation-problems][Racer installation problems]]
* Description
Add support to Rust language and cargo commands inside emacs.
+ Code completion (~racer~)
+ Syntax checking (~flycheck~)
+ Snippets
2019-06-05 09:49:02 +03:00
** Module Flags
+ ~+lsp~ to add support Language server protocol.
** Plugins
+ [[https://github.com/rust-lang/rust-mode][Rust-mode]]
+ [[https://github.com/racer-rust/emacs-racer][Racer-mode]]
** Hacks
{A list of internal modifications to included packages}
2017-11-02 20:00:43 +01:00
2019-06-05 09:49:02 +03:00
* Prerequisites
2017-11-02 20:00:43 +01:00
To get started with Rust, you can either use =rustup= and install rust with:
~curl https://sh.rustup.rs -sSf | sh~
2019-06-05 09:49:02 +03:00
Package manager is not recommended to install Nightly version of Rust what is
2019-06-05 10:28:17 +03:00
required for ~racer~ from [[https://github.com/racer-rust/racer#installation][version 2.1]] (more info in [[#Troubleshooting][Troubleshooting]])
2017-11-02 20:00:43 +01:00
2019-06-05 09:49:02 +03:00
* Features
This module also supports LSP, it requires installation of Rust Language Server
[[https://github.com/rust-lang/rls][~RLS~]]. To enable this you need to enable ~lsp~ in ~:tools~ section in ~init.el~ file.
2017-11-02 20:00:43 +01:00
2019-06-05 09:49:02 +03:00
Keybindings
2017-11-02 20:00:43 +01:00
2019-06-05 09:49:02 +03:00
| Binding | Description |
|---------------------+---------------|
| ~<localleader> b b~ | ~cargo build~ |
| ~<localleader> b c~ | ~cargo check~ |
| ~<localleader> b r~ | ~cargo run~ |
| ~<localleader> b t~ | ~cargo test~ |
2017-11-02 20:00:43 +01:00
2019-06-05 09:49:02 +03:00
* TODO Configuration
How to configure this module, including common problems and how to address them.
2017-11-02 20:00:43 +01:00
2019-06-05 09:49:02 +03:00
* Troubleshooting
** Racer installation problems
Racer need now ([[https://github.com/racer-rust/racer#installation][From 2.1 version]]) nightly version of Rust
2017-11-02 20:00:43 +01:00
2019-06-05 09:49:02 +03:00
If you installed trough rustup
#+BEGIN_SRC sh
rustup toolchain add nightly
cargo +nightly install racer
#+END_SRC