Skip to content

Commit e18661f

Browse files
author
Veetaha
committed
docs: Freshen docs for prebuilt binaries and raLspServer setting
1 parent 1b9b13b commit e18661f

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

docs/dev/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ relevant test and execute it (VS Code includes an action for running a single
7474
test).
7575

7676
However, launching a VS Code instance with locally build language server is
77-
possible. There's "Run Extension (Dev Server)" launch configuration for this.
77+
possible. There's **"Run Extension (Dev Server)"** launch configuration for this.
7878

7979
In general, I use one of the following workflows for fixing bugs and
8080
implementing features.
@@ -88,7 +88,14 @@ Code to sanity check that the thing works as I expect.
8888

8989
If the problem concerns only the VS Code extension, I use **Run Extension**
9090
launch configuration from `launch.json`. Notably, this uses the usual
91-
`ra_lsp_server` binary from `PATH`. After I am done with the fix, I use `cargo
91+
`ra_lsp_server` binary from `PATH`. For this it is important to have the following
92+
in `setting.json` file:
93+
```json
94+
{
95+
"rust-analyzer.raLspServerPath": "ra_lsp_server"
96+
}
97+
```
98+
After I am done with the fix, I use `cargo
9299
xtask install --client-code` to try the new extension for real.
93100

94101
If I need to fix something in the `ra_lsp_server` crate, I feel sad because it's

docs/user/README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ For updates you need to remove installed binary
5757
rm -rf ${HOME}/.config/Code/User/globalStorage/matklad.rust-analyzer
5858
```
5959

60-
`"Donwload latest language server"` command for VSCode and automatic updates detection is currently WIP.
60+
`"Download latest language server"` command for VSCode and automatic updates detection is currently WIP.
6161

6262

6363
### Installation from sources
@@ -71,6 +71,16 @@ $ cd rust-analyzer
7171
$ cargo xtask install
7272
```
7373

74+
After that you need to amend your `settings.json` file to explicitly specify the
75+
path to `ra_lsp_server` that you've just built.
76+
```json
77+
{
78+
"rust-analyzer.raLspServerPath": "ra_lsp_server"
79+
}
80+
```
81+
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).
82+
83+
7484
The automatic installation is expected to *just work* for common cases, if it
7585
doesn't, report bugs!
7686

@@ -127,7 +137,7 @@ host.
127137
As an example, [Pale Fire](https://github.com/matklad/pale-fire/) color scheme tweaks rust colors.
128138
* `rust-analyzer.enableEnhancedTyping`: by default, rust-analyzer intercepts the
129139
`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
140+
* `rust-analyzer.raLspServerPath`: path to `ra_lsp_server` executable, when absent or `null` defaults to prebuilt binary path
131141
* `rust-analyzer.enableCargoWatchOnStartup`: prompt to install & enable `cargo
132142
watch` for live error highlighting (note, this **does not** use rust-analyzer)
133143
* `rust-analyzer.excludeGlobs`: a list of glob-patterns for exclusion (see globset [docs](https://docs.rs/globset) for syntax).
@@ -232,7 +242,8 @@ Installation:
232242

233243
* 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)
234244

235-
### Setting up the `PATH` variable
245+
246+
### Setting up the `PATH` variable <!-- Update links to this header when changing it! -->
236247

237248
On Unix systems, `rustup` adds `~/.cargo/bin` to `PATH` by modifying the shell's
238249
startup file. Depending on your configuration, your Desktop Environment might not

0 commit comments

Comments
 (0)