You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is recommended to disable the Rust plugin when using the rust-analyzer extension.
51
51
52
52
By default, the plugin will prompt you to download the matching version of the server as well:
53
53
@@ -74,18 +74,21 @@ Note that we only support two most recent versions of VS Code.
74
74
75
75
==== Updates
76
76
77
-
The extension will be updated automatically as new versions become available. It will ask your permission to download the matching language server version binary if needed.
77
+
The extension will be updated automatically as new versions become available.
78
+
It will ask your permission to download the matching language server version binary if needed.
78
79
79
80
===== Nightly
80
81
81
-
We ship nightly releases for VS Code. To help us out with testing the newest code and follow the bleeding edge of our `master`, please use the following config:
82
+
We ship nightly releases for VS Code.
83
+
To help us out with testing the newest code and follow the bleeding edge of our `master`, please use the following config:
82
84
83
85
[source,json]
84
86
----
85
87
{ "rust-analyzer.updates.channel": "nightly" }
86
88
----
87
89
88
-
You will be prompted to install the `nightly` extension version. Just click `Download now` and from that moment you will get automatic updates every 24 hours.
90
+
You will be prompted to install the `nightly` extension version.
91
+
Just click `Download now` and from that moment you will get automatic updates every 24 hours.
89
92
90
93
If you don't want to be asked for `Download now` every day when the new nightly version is released add the following to your `settings.json`:
Ensure `~/.local/bin` is listed in the `$PATH` variable.
162
165
163
-
Alternatively, you can install it from source using the command below. You'll need the latest stable version of the Rust toolchain.
166
+
Alternatively, you can install it from source using the command below.
167
+
You'll need the latest stable version of the Rust toolchain.
164
168
165
169
[source,bash]
166
170
----
@@ -198,7 +202,8 @@ Emacs support is maintained as part of the https://github.com/emacs-lsp/lsp-mode
198
202
199
203
=== Vim/NeoVim
200
204
201
-
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.
205
+
Prerequisites: You have installed the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>.
206
+
Not needed if the extension can install/update it on its own, coc-rust-analyzer is one example.
202
207
203
208
The are several LSP client implementations for vim or neovim:
204
209
@@ -270,22 +275,25 @@ Once `neovim/nvim-lspconfig` is installed, use `+lua require'nvim_lsp'.rust_anal
270
275
271
276
Prerequisites: You have installed the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>.
272
277
273
-
You also need the `LSP` package. To install it:
278
+
You also need the `LSP` package.
279
+
To install it:
274
280
275
281
1. If you've never installed a Sublime Text package, install Package Control:
276
282
* Open the command palette (Win/Linux: `ctrl+shift+p`, Mac: `cmd+shift+p`)
277
283
* Type `Install Package Control`, press enter
278
284
2. In the command palette, run `Package control: Install package`, and in the list that pops up, type `LSP` and press enter.
279
285
280
-
Finally, with your Rust project open, in the command palette, run `LSP: Enable Language Server In Project` or `LSP: Enable Language Server Globally`, then select `rust-analyzer` in the list that pops up to enable the rust-analyzer LSP. The latter means that rust-analyzer is enabled by default in Rust projects.
286
+
Finally, with your Rust project open, in the command palette, run `LSP: Enable Language Server In Project` or `LSP: Enable Language Server Globally`, then select `rust-analyzer` in the list that pops up to enable the rust-analyzer LSP.
287
+
The latter means that rust-analyzer is enabled by default in Rust projects.
281
288
282
289
If it worked, you should see "rust-analyzer, Line X, Column Y" on the left side of the bottom bar, and after waiting a bit, functionality like tooltips on hovering over variables should become available.
283
290
284
291
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.
285
292
286
293
=== GNOME Builder
287
294
288
-
GNOME Builder 3.37.1 and newer has native `rust-analyzer` support. If the LSP binary is not available, GNOME Builder can install it when opening a Rust file.
295
+
GNOME Builder 3.37.1 and newer has native `rust-analyzer` support.
296
+
If the LSP binary is not available, GNOME Builder can install it when opening a Rust file.
It is possible to change the foreground/background color of inlay hints. Just add this to your
417
-
`settings.json`:
424
+
It is possible to change the foreground/background color of inlay hints.
425
+
Just add this to your `settings.json`:
418
426
419
427
[source,jsonc]
420
428
----
@@ -436,7 +444,8 @@ It is possible to change the foreground/background color of inlay hints. Just ad
436
444
437
445
==== Semantic style customizations
438
446
439
-
You can customize the look of different semantic elements in the source code. For example, mutable bindings are underlined by default and you can override this behavior by adding the following section to your `settings.json`:
447
+
You can customize the look of different semantic elements in the source code.
448
+
For example, mutable bindings are underlined by default and you can override this behavior by adding the following section to your `settings.json`:
440
449
441
450
[source,jsonc]
442
451
----
@@ -452,7 +461,9 @@ You can customize the look of different semantic elements in the source code. Fo
452
461
----
453
462
454
463
==== Special `when` clause context for keybindings.
455
-
You may use `inRustProject` context to configure keybindings for rust projects only. For example:
464
+
You may use `inRustProject` context to configure keybindings for rust projects only.
465
+
For example:
466
+
456
467
[source,json]
457
468
----
458
469
{
@@ -491,7 +502,8 @@ Or it is possible to specify vars more granularly:
491
502
]
492
503
```
493
504
494
-
You can use any valid RegExp as a mask. Also note that a full runnable name is something like *run bin_or_example_name*, *test some::mod::test_name* or *test-mod some::mod*, so it is possible to distinguish binaries, single tests, and test modules with this masks: `"^run"`, `"^test "` (the trailing space matters!), and `"^test-mod"` respectively.
505
+
You can use any valid regular expression as a mask.
506
+
Also note that a full runnable name is something like *run bin_or_example_name*, *test some::mod::test_name* or *test-mod some::mod*, so it is possible to distinguish binaries, single tests, and test modules with this masks: `"^run"`, `"^test "` (the trailing space matters!), and `"^test-mod"` respectively.
0 commit comments