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
3071: Freshen docs for prebuilt binaries and raLspServer setting r=matklad a=Veetaha
Better documented breaking changes as per an incident in #2988
Follow up for #3053
Co-authored-by: Veetaha <[email protected]>
[LSP](https://microsoft.github.io/language-server-protocol/) implementation. To
3
-
install lsp server, clone the repository and then run `cargo xtask install
4
-
--server` (which is shorthand for `cargo install --path
5
-
./crates/ra_lsp_server`). This will produce a binary named `ra_lsp_server` which
6
-
you should be able to use it with any LSP-compatible editor. We use custom
7
-
extensions to LSP, so special client-side support is required to take full
8
-
advantage of rust-analyzer. This repository contains support code for VS Code.
9
-
10
-
```
5
+
install lsp server, you have three options:
6
+
7
+
***Preferred and default:** install the plugin/extension for your IDE and it will ask your permission to automatically download the latest lsp server for you from [GitHub releases][github-releases]. (See docs to find out whether this is implemented for your editor below).
8
+
* Manually download prebuilt binaries from [GitHub releases][github-releases]
Then open VSCode (or reload the window if it was already running), open some Rust project and you should
47
-
see an info message pop-up.
48
58
59
+
Or open VS Code, press <kbd>Ctrl+Shift+P</kbd>, and search for the following command:
60
+
61
+
<imgwidth="500px"alt="Install from VSIX command"src="https://user-images.githubusercontent.com/36276403/74108225-c0c11d80-4b80-11ea-9b2a-0a43f09e29af.png">
62
+
63
+
Press <kbd>Enter</kbd> and go to `rust-analyzer-0.1.0.vsix` file through the file explorer.
64
+
65
+
Then open some Rust project and you should
66
+
see an info message pop-up.
49
67
50
68
<imgheight="140px"src="https://user-images.githubusercontent.com/36276403/74103174-a40df100-4b52-11ea-81f4-372c70797924.png"alt="Download now message"/>
51
69
@@ -57,7 +75,7 @@ For updates you need to remove installed binary
`"Donwload latest language server"` command for VSCode and automatic updates detection is currently WIP.
78
+
`"Download latest language server"` command for VSCode and automatic updates detection is currently WIP.
61
79
62
80
63
81
### Installation from sources
@@ -71,6 +89,16 @@ $ cd rust-analyzer
71
89
$ cargo xtask install
72
90
```
73
91
92
+
After that you need to amend your `settings.json` file to explicitly specify the
93
+
path to `ra_lsp_server` that you've just built.
94
+
```json
95
+
{
96
+
"rust-analyzer.raLspServerPath": "ra_lsp_server"
97
+
}
98
+
```
99
+
This should work on all platforms, otherwise if installed `ra_lsp_server` is not available through your `$PATH` then see how to configure it [here](#setting-up-the-PATH-variable).
100
+
101
+
74
102
The automatic installation is expected to *just work* for common cases, if it
75
103
doesn't, report bugs!
76
104
@@ -127,7 +155,7 @@ host.
127
155
As an example, [Pale Fire](https://github.com/matklad/pale-fire/) color scheme tweaks rust colors.
128
156
*`rust-analyzer.enableEnhancedTyping`: by default, rust-analyzer intercepts the
129
157
`Enter` key to make it easier to continue comments. Note that it may conflict with VIM emulation plugin.
130
-
*`rust-analyzer.raLspServerPath`: path to `ra_lsp_server` executable
158
+
*`rust-analyzer.raLspServerPath`: path to `ra_lsp_server` executable, when absent or `null` defaults to prebuilt binary path
131
159
*`rust-analyzer.enableCargoWatchOnStartup`: prompt to install & enable `cargo
132
160
watch` for live error highlighting (note, this **does not** use rust-analyzer)
133
161
*`rust-analyzer.excludeGlobs`: a list of glob-patterns for exclusion (see globset [docs](https://docs.rs/globset) for syntax).
@@ -232,6 +260,8 @@ Installation:
232
260
233
261
* You can now invoke the command palette and type LSP enable to locally/globally enable the rust-analyzer LSP (type LSP enable, then choose either locally or globally, then select rust-analyzer)
234
262
263
+
264
+
<!-- Update links to this header when changing it! -->
235
265
### Setting up the `PATH` variable
236
266
237
267
On Unix systems, `rustup` adds `~/.cargo/bin` to `PATH` by modifying the shell's
0 commit comments