Skip to content

Commit 3ebbeb4

Browse files
author
Veetaha
committed
docs: more documentation on prebuilt binaries all-editors-wise
1 parent e18661f commit 3ebbeb4

File tree

1 file changed

+40
-22
lines changed

1 file changed

+40
-22
lines changed

docs/user/README.md

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
1+
[github-releases]: https://github.com/rust-analyzer/rust-analyzer/releases
2+
13
The main interface to rust-analyzer is the
24
[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]
9+
* `ra_lsp_server-linux` for Linux
10+
* `ra_lsp_server-mac` for Mac
11+
* `ra_lsp_server-windows.exe` for Windows
12+
* Clone the repository and build from sources
13+
```bash
1114
$ git clone [email protected]:rust-analyzer/rust-analyzer && cd rust-analyzer
12-
$ cargo xtask install --server
15+
$ cargo xtask install --server # or cargo install --path ./crates/ra_lsp_server
1316
```
17+
18+
This way you will get a binary named `ra_lsp_server` (with os suffix for prebuilt binaries)
19+
which you should be able to use with any LSP-compatible editor.
20+
21+
We make use of custom extensions to LSP, so special client-side support is required to take full
22+
advantage of rust-analyzer. This repository contains support code for VS Code.
23+
1424
Rust Analyzer needs sources of rust standard library to work, so
1525
you might also need to execute
1626

@@ -22,30 +32,38 @@ See [./features.md](./features.md) document for a list of features that are avai
2232

2333
## VS Code
2434

25-
Prerequisites:
35+
### Prerequisites
2636

27-
In order to build the VS Code plugin, you need to have node.js and npm with
28-
a minimum version of 10 installed. Please refer to
29-
[node.js and npm documentation](https://nodejs.org) for installation instructions.
30-
31-
You will also need the most recent version of VS Code: we don't try to
37+
You will need the most recent version of VS Code: we don't try to
3238
maintain compatibility with older versions yet.
3339

40+
In order to build the VS Code plugin from sources, you need to have node.js and npm with
41+
a minimum version of 12 installed. Please refer to
42+
[node.js and npm documentation](https://nodejs.org) for installation instructions.
43+
3444
### Installation from prebuilt binaries
3545

3646
We ship prebuilt binaries for Linux, Mac and Windows via
37-
[GitHub releases](https://github.com/rust-analyzer/rust-analyzer/releases).
47+
[GitHub releases][github-releases].
3848
In order to use them you need to install the client VSCode extension.
3949

40-
Publishing to VSCode marketplace is currently WIP. Thus, you need to clone the repository and install **only** the client extension via
50+
Publishing to VS Code marketplace is currently WIP. Thus, you need to manually download
51+
`rust-analyzer-0.1.0.vsix` file from latest [GitHub release][github-releases].
52+
53+
After you downloaded the `.vsix` file you can install it from the terminal
54+
4155
```
42-
$ git clone https://github.com/rust-analyzer/rust-analyzer.git --depth 1
43-
$ cd rust-analyzer
44-
$ cargo xtask install --client-code
56+
$ code --install-extension rust-analyzer-0.1.0.vsix
4557
```
46-
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.
4858

59+
Or open VS Code, press <kbd>Ctrl+Shift+P</kbd>, and search for the following command:
60+
61+
<img width="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.
4967

5068
<img height="140px" src="https://user-images.githubusercontent.com/36276403/74103174-a40df100-4b52-11ea-81f4-372c70797924.png" alt="Download now message"/>
5169

0 commit comments

Comments
 (0)