diff options
Diffstat (limited to 'docs/user/readme.adoc')
-rw-r--r-- | docs/user/readme.adoc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/docs/user/readme.adoc b/docs/user/readme.adoc index 74fda0abe..11b4aeb0c 100644 --- a/docs/user/readme.adoc +++ b/docs/user/readme.adoc | |||
@@ -6,10 +6,10 @@ | |||
6 | 6 | ||
7 | // Master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository | 7 | // Master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository |
8 | 8 | ||
9 | At it's core, rust-analyzer is a *library* for semantic analysis of the Rust code as it changes over time. | 9 | At its core, rust-analyzer is a *library* for semantic analysis of Rust code as it changes over time. |
10 | This manual focuses on a specific usage of the library -- the implementation of | 10 | This manual focuses on a specific usage of the library -- the implementation of |
11 | https://microsoft.github.io/language-server-protocol/[Language Server Protocol]. | 11 | https://microsoft.github.io/language-server-protocol/[Language Server Protocol]. |
12 | LSP allows various code editors, like VS Code, Emacs or Vim, to implement semantic feature like completion or goto definition by talking to an external language server process. | 12 | LSP allows various code editors, like VS Code, Emacs or Vim, to implement semantic features like completion or goto definition by talking to an external language server process. |
13 | 13 | ||
14 | To improve this document, send a pull request against | 14 | To improve this document, send a pull request against |
15 | https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/readme.adoc[this file]. | 15 | https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/readme.adoc[this file]. |
@@ -36,9 +36,9 @@ https://github.com/rust-analyzer/rust-analyzer/tree/master/editors/code[in tree] | |||
36 | 36 | ||
37 | You can install the latest release of the plugin from | 37 | You can install the latest release of the plugin from |
38 | https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer[the marketplace]. | 38 | https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer[the marketplace]. |
39 | By default, the plugin will download the matching version of the server as well. | 39 | By default, the plugin will prompt you to download the matching version of the server as well: |
40 | 40 | ||
41 | // FIXME: update the image (its text has changed) | 41 | // FIXME: update the image (its text has changed) (TODO: in pr update this then remove this comment.) |
42 | image::https://user-images.githubusercontent.com/36276403/74103174-a40df100-4b52-11ea-81f4-372c70797924.png[] | 42 | image::https://user-images.githubusercontent.com/36276403/74103174-a40df100-4b52-11ea-81f4-372c70797924.png[] |
43 | 43 | ||
44 | The server binary is stored in `~/.config/Code/User/globalStorage/matklad.rust-analyzer`. | 44 | The server binary is stored in `~/.config/Code/User/globalStorage/matklad.rust-analyzer`. |
@@ -60,7 +60,7 @@ $ cargo xtask install | |||
60 | ---- | 60 | ---- |
61 | 61 | ||
62 | You'll need Cargo, nodejs and npm for this. | 62 | You'll need Cargo, nodejs and npm for this. |
63 | To make VS Code use the freshly build server, add this to the settings: | 63 | To make VS Code use the freshly built server, add this to the settings: |
64 | 64 | ||
65 | [source,json] | 65 | [source,json] |
66 | ---- | 66 | ---- |
@@ -72,7 +72,7 @@ Note that installing via `xtask install` does not work for VS Code Remote, inste | |||
72 | === Language Server Binary | 72 | === Language Server Binary |
73 | 73 | ||
74 | Other editors generally require `rust-analyzer` binary to be in `$PATH`. | 74 | Other editors generally require `rust-analyzer` binary to be in `$PATH`. |
75 | You can download pre-build binary from | 75 | You can download the pre-built binary from |
76 | https://github.com/rust-analyzer/rust-analyzer/releases[releases] | 76 | https://github.com/rust-analyzer/rust-analyzer/releases[releases] |
77 | page, or you can install it from source using the following command: | 77 | page, or you can install it from source using the following command: |
78 | 78 | ||
@@ -85,7 +85,7 @@ $ cargo xtask install --server | |||
85 | 85 | ||
86 | Emacs support is maintained https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-rust.el[upstream]. | 86 | Emacs support is maintained https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-rust.el[upstream]. |
87 | 87 | ||
88 | 1. Install recent version of `emacs-lsp` package by following the instructions https://github.com/emacs-lsp/lsp-mode[here]. | 88 | 1. Install the most recent version of `emacs-lsp` package by following the instructions https://github.com/emacs-lsp/lsp-mode[here]. |
89 | 2. Set `lsp-rust-server` to `'rust-analyzer`. | 89 | 2. Set `lsp-rust-server` to `'rust-analyzer`. |
90 | 3. Run `lsp` in a Rust buffer. | 90 | 3. Run `lsp` in a Rust buffer. |
91 | 4. (Optionally) bind commands like `lsp-rust-analyzer-join-lines`, `lsp-extend-selection` and `lsp-rust-analyzer-expand-macro` to keys. | 91 | 4. (Optionally) bind commands like `lsp-rust-analyzer-join-lines`, `lsp-extend-selection` and `lsp-rust-analyzer-expand-macro` to keys. |
@@ -112,7 +112,7 @@ The are several LSP client implementations for vim: | |||
112 | https://github.com/autozimu/LanguageClient-neovim[here] | 112 | https://github.com/autozimu/LanguageClient-neovim[here] |
113 | * The github project wiki has extra tips on configuration | 113 | * The github project wiki has extra tips on configuration |
114 | 114 | ||
115 | 2. Configure by adding this to your vim/neovim config file (replacing the existing rust specific line if it exists): | 115 | 2. Configure by adding this to your vim/neovim config file (replacing the existing Rust-specific line if it exists): |
116 | + | 116 | + |
117 | [source,vim] | 117 | [source,vim] |
118 | ---- | 118 | ---- |
@@ -123,7 +123,7 @@ let g:LanguageClient_serverCommands = { | |||
123 | 123 | ||
124 | ==== nvim-lsp | 124 | ==== nvim-lsp |
125 | 125 | ||
126 | NeoVim 0.5 (not yet released) has built in language server support. | 126 | NeoVim 0.5 (not yet released) has built-in language server support. |
127 | For a quick start configuration of rust-analyzer, use https://github.com/neovim/nvim-lsp#rust_analyzer[neovim/nvim-lsp]. | 127 | For a quick start configuration of rust-analyzer, use https://github.com/neovim/nvim-lsp#rust_analyzer[neovim/nvim-lsp]. |
128 | Once `neovim/nvim-lsp` is installed, use `lua require'nvim_lsp'.rust_analyzer.setup({})` in your `init.vim`. | 128 | Once `neovim/nvim-lsp` is installed, use `lua require'nvim_lsp'.rust_analyzer.setup({})` in your `init.vim`. |
129 | 129 | ||