aboutsummaryrefslogtreecommitdiff
path: root/docs/user/readme.adoc
diff options
context:
space:
mode:
Diffstat (limited to 'docs/user/readme.adoc')
-rw-r--r--docs/user/readme.adoc41
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
60The 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). 60The server binary is stored in:
61 61
62Note 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
66Note 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
138The `rust-analyzer` binary can be installed from AUR (Arch User Repository): 142The `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
144Install it with AUR helper of your choice, for example: 147Install 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
1593. Run `lsp` in a Rust buffer. 1623. Run `lsp` in a Rust buffer.
1604. (Optionally) bind commands like `lsp-rust-analyzer-join-lines`, `lsp-extend-selection` and `lsp-rust-analyzer-expand-macro` to keys. 1634. (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
164Prerequisites: You have installed the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>. 167Prerequisites: 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
166The are several LSP client implementations for vim: 169The 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
1841. Install LanguageClient-neovim by following the instructions 1871. 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
1882. Configure by adding this to your vim/neovim config file (replacing the existing Rust-specific line if it exists): 1912. 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
219To add the LSP server to https://github.com/dense-analysis/ale[ale]: 222To use the LSP server in https://github.com/dense-analysis/ale[ale]:
220 223
221[source,vim] 224[source,vim]
222---- 225----
223call ale#linter#Define('rust', { 226let 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
253If 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. 250If 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
257Prerequisites: You have installed the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>. 254Prerequisites: You have installed the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>.
258 255