aboutsummaryrefslogtreecommitdiff
path: root/docs/user/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/user/README.md')
-rw-r--r--docs/user/README.md77
1 files changed, 77 insertions, 0 deletions
diff --git a/docs/user/README.md b/docs/user/README.md
new file mode 100644
index 000000000..439c4e6ae
--- /dev/null
+++ b/docs/user/README.md
@@ -0,0 +1,77 @@
1The main interface to rust-analyzer is the
2[LSP](https://microsoft.github.io/language-server-protocol/) implementation. To
3install lsp server, use `cargo install-lsp`, which is a shorthand for `cargo
4install --package ra_lsp_server`. The binary is named `ra_lsp_server`, you
5should be able to use it with any LSP-compatible editor. We use custom
6extensions to LSP, so special client-side support is required to take full
7advantage of rust-analyzer. This repository contains support code for VS Code
8and Emacs.
9
10Rust Analyzer needs sources of rust standard library to work, so you might need
11to execute
12
13```
14$ rustup component add rust-src
15```
16
17See [./features.md](./features.md) document for a list of features that are available.
18
19## VS Code
20
21Prerequisites:
22
23In order to build the VS Code plugin, you need to have node.js and npm with
24a minimum version of 10 installed. Please refer to
25[node.js and npm documentation](https://nodejs.org) for installation instructions.
26
27You will also need the most recent version of VS Code: we don't try to
28maintain compatibility with older versions yet.
29
30The experimental VS Code plugin can then be built and installed by executing the
31following commands:
32
33```
34$ git clone https://github.com/rust-analyzer/rust-analyzer.git --depth 1
35$ cd rust-analyzer
36$ cargo install-code
37```
38
39This will run `cargo install --package ra_lsp_server` to install the server
40binary into `~/.cargo/bin`, and then will build and install plugin from
41`editors/code`. See
42[this](https://github.com/rust-analyzer/rust-analyzer/blob/69ee5c9c5ef212f7911028c9ddf581559e6565c3/crates/tools/src/main.rs#L37-L56)
43for details. The installation is expected to *just work*, if it doesn't, report
44bugs!
45
46It's better to remove existing Rust plugins to avoid interference.
47
48Beyond basic LSP features, there are some extension commands which you can
49invoke via <kbd>Ctrl+Shift+P</kbd> or bind to a shortcut. See [./features.md](./features.md)
50for details.
51
52### Settings
53
54* `rust-analyzer.highlightingOn`: enables experimental syntax highlighting
55* `rust-analyzer.showWorkspaceLoadedNotification`: to ease troubleshooting, a
56 notification is shown by default when a workspace is loaded
57* `rust-analyzer.enableEnhancedTyping`: by default, rust-analyzer intercepts
58 `Enter` key to make it easier to continue comments
59* `rust-analyzer.raLspServerPath`: path to `ra_lsp_server` executable
60* `rust-analyzer.enableCargoWatchOnStartup`: prompt to install & enable `cargo
61 watch` for live error highlighting (note, this **does not** use rust-analyzer)
62* `rust-analyzer.trace.server`: enables internal logging
63
64
65## Emacs
66
67Prerequisites:
68
69`emacs-lsp`, `dash` and `ht` packages.
70
71Installation:
72
73* add
74[ra-emacs-lsp.el](https://github.com/rust-analyzer/rust-analyzer/blob/69ee5c9c5ef212f7911028c9ddf581559e6565c3/editors/emacs/ra-emacs-lsp.el)
75to load path and require it in `init.el`
76* run `lsp` in a rust buffer
77* (Optionally) bind commands like `rust-analyzer-join-lines` or `rust-analyzer-extend-selection` to keys