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
Copy file name to clipboardExpand all lines: manual.adoc
+58-15Lines changed: 58 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,20 @@ To add the sources manually, run the following command:
40
40
$ rustup component add rust-src
41
41
```
42
42
43
+
=== Toolchain
44
+
45
+
Only the latest stable standard library source is officially supported for use with rust-analyzer.
46
+
If you are using an older toolchain or have an override set, rust-analyzer may fail to understand the Rust source.
47
+
You will either need to update your toolchain or use an older version of rust-analyzer that is compatible with your toolchain.
48
+
49
+
If you are using an override in your project, you can still force rust-analyzer to use the stable toolchain via the environment variable `RUSTUP_TOOLCHAIN`.
@@ -86,8 +100,7 @@ It will ask your permission to download the matching language server version bin
86
100
===== Nightly
87
101
88
102
We ship nightly releases for VS Code.
89
-
You can opt in to these by switching to the pre-release version in the Code extension page or settings.
90
-
To help us out with testing the newest code and follow the bleeding edge of our `master`, please use the following config:
103
+
To help us out by testing the newest code, you can enable pre-release versions in the Code extension page.
91
104
92
105
==== Manual installation
93
106
@@ -240,7 +253,6 @@ The are several LSP client implementations for vim or neovim:
240
253
* same configurations as VSCode extension, `rust-analyzer.server.path`, `rust-analyzer.cargo.features` etc.
241
254
* same commands too, `rust-analyzer.analyzerStatus`, `rust-analyzer.ssr` etc.
242
255
* inlay hints for variables and method chaining, _Neovim Only_
243
-
* semantic highlighting is not implemented yet
244
256
245
257
Note: for code actions, use `coc-codeaction-cursor` and `coc-codeaction-selected`; `coc-codeaction` and `coc-codeaction-line` are unlikely to be useful.
246
258
@@ -362,22 +374,19 @@ if executable('rust-analyzer')
362
374
endif
363
375
----
364
376
365
-
=== Sublime Text 3
366
-
367
-
Prerequisites: You have installed the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>.
377
+
=== Sublime Text
368
378
369
-
You also need the `LSP` package.
370
-
To install it:
379
+
==== Sublime Text 4:
380
+
* Follow the instructions in link:https://github.com/sublimelsp/LSP-rust-analyzer[LSP-rust-analyzer].
371
381
372
-
1. If you've never installed a Sublime Text package, install Package Control:
373
-
* Open the command palette (Win/Linux: `ctrl+shift+p`, Mac: `cmd+shift+p`)
374
-
* Type `Install Package Control`, press enter
375
-
2. In the command palette, run `Package control: Install package`, and in the list that pops up, type `LSP` and press enter.
382
+
NOTE: Install link:https://packagecontrol.io/packages/LSP-file-watcher-chokidar[LSP-file-watcher-chokidar] to enable file watching (`workspace/didChangeWatchedFiles`).
376
383
377
-
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.
378
-
The latter means that rust-analyzer is enabled by default in Rust projects.
384
+
==== Sublime Text 3:
385
+
* Install the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>.
386
+
* Install the link:https://packagecontrol.io/packages/LSP[LSP package].
387
+
* From the command palette, run `LSP: Enable Language Server Globally` and select `rust-analyzer`.
379
388
380
-
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.
389
+
If it worked, you should see "rust-analyzer, Line X, Column Y" on the left side of the status bar, and after waiting a bit, functionalities like tooltips on hovering over variables should become available.
381
390
382
391
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.
383
392
@@ -427,6 +436,40 @@ Then click on apply, and restart the LSP server for your rust project.
427
436
428
437
https://gitlab.com/cppit/jucipp[juCi++] has built-in support for the language server protocol, and since version 1.7.0 offers installation of both Rust and rust-analyzer when opening a Rust file.
429
438
439
+
=== Kakoune
440
+
441
+
https://kakoune.org/[Kakoune] supports LSP with the help of https://github.com/kak-lsp/kak-lsp[`kak-lsp`].
442
+
Follow the https://github.com/kak-lsp/kak-lsp#installation[instructions] to install `kak-lsp`.
443
+
To configure `kak-lsp`, refer to the https://github.com/kak-lsp/kak-lsp#configuring-kak-lsp[configuration section] which is basically about copying the https://github.com/kak-lsp/kak-lsp/blob/master/kak-lsp.toml[configuration file] in the right place (latest versions should use `rust-analyzer` by default).
444
+
445
+
Finally, you need to configure Kakoune to talk to `kak-lsp` (see https://github.com/kak-lsp/kak-lsp#usage[Usage section]).
446
+
A basic configuration will only get you LSP but you can also activate inlay diagnostics and auto-formatting on save.
447
+
The following might help you get all of this.
448
+
449
+
[source,txt]
450
+
----
451
+
eval %sh{kak-lsp --kakoune -s $kak_session} # Not needed if you load it with plug.kak.
0 commit comments