Skip to content

Commit c5ab165

Browse files
committed
mention LSP support
1 parent 1b3db88 commit c5ab165

File tree

1 file changed

+48
-4
lines changed

1 file changed

+48
-4
lines changed

README.md

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,23 @@
55
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc -->
66
**Table of Contents**
77

8-
- [Installation via MELPA](#installation-via-melpa)
9-
- [Manual Installation](#manual-installation)
8+
- [Installation](#installation)
9+
- [Melpa](#melpa)
10+
- [use-package and straight](#use-package-and-straight)
11+
- [Manual Installation](#manual-installation)
1012
- [Indentation](#indentation)
1113
- [rustfmt](#rustfmt)
1214
- [Tests](#tests)
15+
- [LSP](#lsp)
16+
- [eglot](#eglot)
17+
- [lsp-mode](#lsp-mode)
1318
- [Other useful packages](#other-useful-packages)
1419

1520
<!-- markdown-toc end -->
1621

17-
# Installation via MELPA
22+
# Installation
23+
24+
## Melpa
1825

1926
`rust-mode` makes editing [Rust](http://rust-lang.org) code with Emacs
2027
enjoyable. It requires Emacs 24 or later.
@@ -36,7 +43,26 @@ And put this in your config to load rust-mode automatically:
3643

3744
`(require 'rust-mode)`
3845

39-
# Manual Installation
46+
## use-package and straight
47+
48+
```elisp
49+
(defvar bootstrap-version)
50+
(let ((bootstrap-file
51+
(expand-file-name "~/tmp/git/straight.el/bootstrap.el" user-emacs-directory))
52+
(bootstrap-version 5))
53+
(unless (file-exists-p bootstrap-file)
54+
(with-current-buffer
55+
(url-retrieve-synchronously
56+
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
57+
'silent 'inhibit-cookies)
58+
(goto-char (point-max))
59+
(eval-print-last-sexp)))
60+
(load bootstrap-file nil 'nomessage))
61+
62+
(use-package rust-mode)
63+
```
64+
65+
## Manual Installation
4066

4167
Add this to your init.el:
4268

@@ -71,6 +97,24 @@ The file `rust-mode-tests.el` contains tests that can be run via
7197
You can use `run_rust_emacs_tests.sh` to run them in batch mode, if
7298
you set the environment variable EMACS to a program that runs emacs.
7399

100+
# LSP
101+
102+
## eglot
103+
104+
```elisp
105+
(require 'eglot)
106+
(add-hook 'rust-mode-hook 'eglot-ensure)
107+
```
108+
109+
## lsp-mode
110+
111+
```elisp
112+
(require 'lsp-mode)
113+
(add-hook 'rust-mode-hook #'lsp)
114+
```
115+
116+
You can find more information in the [lsp-mode wiki](https://github.com/emacs-lsp/lsp-mode/wiki/Rust).
117+
74118
# Other useful packages
75119

76120
* [cargo.el](https://github.com/kwrooijen/cargo.el) Emacs Minor Mode for Cargo, Rust's Package Manager

0 commit comments

Comments
 (0)