diff options
author | Galilée 'Bill' Enguehard <[email protected]> | 2020-05-21 22:27:38 +0100 |
---|---|---|
committer | Galilée 'Bill' Enguehard <[email protected]> | 2020-05-21 22:27:38 +0100 |
commit | 7fece3bdd2450c0807f7dd742239cae95f0cc65e (patch) | |
tree | 866c4db826c959e79c63a6727bdb9f2c61e6fc4f /docs/user/readme.adoc | |
parent | db926218b2082077750291f8426ddd28b284cd08 (diff) | |
parent | 59732df8d40dfadc6dcf5951265416576399712a (diff) |
Merge branch 'master' of github.com:rust-analyzer/rust-analyzer into modname_spacing
Diffstat (limited to 'docs/user/readme.adoc')
-rw-r--r-- | docs/user/readme.adoc | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/docs/user/readme.adoc b/docs/user/readme.adoc index b1af72ce6..40ed54809 100644 --- a/docs/user/readme.adoc +++ b/docs/user/readme.adoc | |||
@@ -57,9 +57,13 @@ To disable this notification put the following to `settings.json` | |||
57 | ---- | 57 | ---- |
58 | ==== | 58 | ==== |
59 | 59 | ||
60 | The server binary is stored in `~/.config/Code/User/globalStorage/matklad.rust-analyzer` (Linux) or in `~/.Library/Application Support/Code/User/globalStorage/matklad.rust-analyzer` (macOS) or in `%APPDATA%\Code\User\globalStorage` (Windows). | 60 | The server binary is stored in: |
61 | 61 | ||
62 | Note that we only support the latest version of VS Code. | 62 | * Linux: `~/.config/Code/User/globalStorage/matklad.rust-analyzer` |
63 | * macOS: `~/Library/Application Support/Code/User/globalStorage/matklad.rust-analyzer` | ||
64 | * Windows: `%APPDATA%\Code\User\globalStorage\matklad.rust-analyzer` | ||
65 | |||
66 | Note that we only support two most recent versions of VS Code. | ||
63 | 67 | ||
64 | ==== Updates | 68 | ==== Updates |
65 | 69 | ||
@@ -104,7 +108,7 @@ Here are some useful self-diagnostic commands: | |||
104 | 108 | ||
105 | * **Rust Analyzer: Show RA Version** shows the version of `rust-analyzer` binary | 109 | * **Rust Analyzer: Show RA Version** shows the version of `rust-analyzer` binary |
106 | * **Rust Analyzer: Status** prints some statistics about the server, like the few latest LSP requests | 110 | * **Rust Analyzer: Status** prints some statistics about the server, like the few latest LSP requests |
107 | * To enable server-side logging, run with `env RUST_LOG=info` and see `Output > Rust Analyzer Language Server` in VS Code's panel. | 111 | * To enable server-side logging, run with `env RA_LOG=info` and see `Output > Rust Analyzer Language Server` in VS Code's panel. |
108 | * To log all LSP requests, add `"rust-analyzer.trace.server": "verbose"` to the settings and look for `Server Trace` in the panel. | 112 | * To log all LSP requests, add `"rust-analyzer.trace.server": "verbose"` to the settings and look for `Server Trace` in the panel. |
109 | * To enable client-side logging, add `"rust-analyzer.trace.extension": true` to the settings and open the `Console` tab of VS Code developer tools. | 113 | * To enable client-side logging, add `"rust-analyzer.trace.extension": true` to the settings and open the `Console` tab of VS Code developer tools. |
110 | 114 | ||
@@ -135,17 +139,16 @@ If your editor can't find the binary even though the binary is on your `$PATH`, | |||
135 | 139 | ||
136 | ==== Arch Linux | 140 | ==== Arch Linux |
137 | 141 | ||
138 | The `rust-analyzer` binary can be installed from AUR (Arch User Repository): | 142 | The `rust-analyzer` binary can be installed from the repos or AUR (Arch User Repository): |
139 | 143 | ||
140 | - https://aur.archlinux.org/packages/rust-analyzer-bin[`rust-analyzer-bin`] (binary from GitHub releases) | 144 | - https://www.archlinux.org/packages/community/x86_64/rust-analyzer/[`rust-analyzer`] (built from latest tagged source) |
141 | - https://aur.archlinux.org/packages/rust-analyzer[`rust-analyzer`] (built from latest tagged source) | 145 | - https://aur.archlinux.org/packages/rust-analyzer-git[`rust-analyzer-git`] (latest Git version) |
142 | - https://aur.archlinux.org/packages/rust-analyzer-git[`rust-analyzer-git`] (latest git version) | ||
143 | 146 | ||
144 | Install it with AUR helper of your choice, for example: | 147 | Install it with pacman, for example: |
145 | 148 | ||
146 | [source,bash] | 149 | [source,bash] |
147 | ---- | 150 | ---- |
148 | $ yay -S rust-analyzer-bin | 151 | $ pacman -S rust-analyzer |
149 | ---- | 152 | ---- |
150 | 153 | ||
151 | === Emacs | 154 | === Emacs |
@@ -159,11 +162,11 @@ Emacs support is maintained as part of the https://github.com/emacs-lsp/lsp-mode | |||
159 | 3. Run `lsp` in a Rust buffer. | 162 | 3. Run `lsp` in a Rust buffer. |
160 | 4. (Optionally) bind commands like `lsp-rust-analyzer-join-lines`, `lsp-extend-selection` and `lsp-rust-analyzer-expand-macro` to keys. | 163 | 4. (Optionally) bind commands like `lsp-rust-analyzer-join-lines`, `lsp-extend-selection` and `lsp-rust-analyzer-expand-macro` to keys. |
161 | 164 | ||
162 | === Vim | 165 | === Vim/NeoVim |
163 | 166 | ||
164 | Prerequisites: You have installed the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>. | 167 | Prerequisites: You have installed the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>. Not needed if the extension can install/update it on its own, coc-rust-analyzer is one example. |
165 | 168 | ||
166 | The are several LSP client implementations for vim: | 169 | The are several LSP client implementations for vim or neovim: |
167 | 170 | ||
168 | ==== coc-rust-analyzer | 171 | ==== coc-rust-analyzer |
169 | 172 | ||
@@ -183,7 +186,7 @@ The are several LSP client implementations for vim: | |||
183 | 186 | ||
184 | 1. Install LanguageClient-neovim by following the instructions | 187 | 1. Install LanguageClient-neovim by following the instructions |
185 | https://github.com/autozimu/LanguageClient-neovim[here] | 188 | https://github.com/autozimu/LanguageClient-neovim[here] |
186 | * The github project wiki has extra tips on configuration | 189 | * The GitHub project wiki has extra tips on configuration |
187 | 190 | ||
188 | 2. Configure by adding this to your vim/neovim config file (replacing the existing Rust-specific line if it exists): | 191 | 2. Configure by adding this to your vim/neovim config file (replacing the existing Rust-specific line if it exists): |
189 | + | 192 | + |
@@ -216,17 +219,11 @@ let g:ycm_language_server = | |||
216 | 219 | ||
217 | ==== ALE | 220 | ==== ALE |
218 | 221 | ||
219 | To add the LSP server to https://github.com/dense-analysis/ale[ale]: | 222 | To use the LSP server in https://github.com/dense-analysis/ale[ale]: |
220 | 223 | ||
221 | [source,vim] | 224 | [source,vim] |
222 | ---- | 225 | ---- |
223 | call ale#linter#Define('rust', { | 226 | let g:ale_linters = {'rust': ['analyzer']} |
224 | \ 'name': 'rust-analyzer', | ||
225 | \ 'lsp': 'stdio', | ||
226 | \ 'executable': 'rust-analyzer', | ||
227 | \ 'command': '%e', | ||
228 | \ 'project_root': '.', | ||
229 | \}) | ||
230 | ---- | 227 | ---- |
231 | 228 | ||
232 | ==== nvim-lsp | 229 | ==== nvim-lsp |
@@ -252,7 +249,7 @@ If it worked, you should see "rust-analyzer, Line X, Column Y" on the left side | |||
252 | 249 | ||
253 | If you get an error saying `No such file or directory: 'rust-analyzer'`, see the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>> section on installing the language server binary. | 250 | If you get an error saying `No such file or directory: 'rust-analyzer'`, see the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>> section on installing the language server binary. |
254 | 251 | ||
255 | === Gnome Builder | 252 | === GNOME Builder |
256 | 253 | ||
257 | Prerequisites: You have installed the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>. | 254 | Prerequisites: You have installed the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>. |
258 | 255 | ||