diff options
-rw-r--r-- | docs/user/README.md | 62 |
1 files changed, 40 insertions, 22 deletions
diff --git a/docs/user/README.md b/docs/user/README.md index 1e7d516c5..3f69a1710 100644 --- a/docs/user/README.md +++ b/docs/user/README.md | |||
@@ -1,16 +1,26 @@ | |||
1 | [github-releases]: https://github.com/rust-analyzer/rust-analyzer/releases | ||
2 | |||
1 | The main interface to rust-analyzer is the | 3 | The main interface to rust-analyzer is the |
2 | [LSP](https://microsoft.github.io/language-server-protocol/) implementation. To | 4 | [LSP](https://microsoft.github.io/language-server-protocol/) implementation. To |
3 | install lsp server, clone the repository and then run `cargo xtask install | 5 | install lsp server, you have three options: |
4 | --server` (which is shorthand for `cargo install --path | 6 | |
5 | ./crates/ra_lsp_server`). This will produce a binary named `ra_lsp_server` which | 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). |
6 | you should be able to use it with any LSP-compatible editor. We use custom | 8 | * Manually download prebuilt binaries from [GitHub releases][github-releases] |
7 | extensions to LSP, so special client-side support is required to take full | 9 | * `ra_lsp_server-linux` for Linux |
8 | advantage of rust-analyzer. This repository contains support code for VS Code. | 10 | * `ra_lsp_server-mac` for Mac |
9 | 11 | * `ra_lsp_server-windows.exe` for Windows | |
10 | ``` | 12 | * Clone the repository and build from sources |
13 | ```bash | ||
11 | $ git clone [email protected]:rust-analyzer/rust-analyzer && cd rust-analyzer | 14 | $ 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 |
13 | ``` | 16 | ``` |
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 | |||
14 | Rust Analyzer needs sources of rust standard library to work, so | 24 | Rust Analyzer needs sources of rust standard library to work, so |
15 | you might also need to execute | 25 | you might also need to execute |
16 | 26 | ||
@@ -22,30 +32,38 @@ See [./features.md](./features.md) document for a list of features that are avai | |||
22 | 32 | ||
23 | ## VS Code | 33 | ## VS Code |
24 | 34 | ||
25 | Prerequisites: | 35 | ### Prerequisites |
26 | 36 | ||
27 | In order to build the VS Code plugin, you need to have node.js and npm with | 37 | You will need the most recent version of VS Code: we don't try to |
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 | ||
32 | maintain compatibility with older versions yet. | 38 | maintain compatibility with older versions yet. |
33 | 39 | ||
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 | |||
34 | ### Installation from prebuilt binaries | 44 | ### Installation from prebuilt binaries |
35 | 45 | ||
36 | We ship prebuilt binaries for Linux, Mac and Windows via | 46 | 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]. |
38 | In order to use them you need to install the client VSCode extension. | 48 | In order to use them you need to install the client VSCode extension. |
39 | 49 | ||
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 | |||
41 | ``` | 55 | ``` |
42 | $ git clone https://github.com/rust-analyzer/rust-analyzer.git --depth 1 | 56 | $ code --install-extension rust-analyzer-0.1.0.vsix |
43 | $ cd rust-analyzer | ||
44 | $ cargo xtask install --client-code | ||
45 | ``` | 57 | ``` |
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. | ||
48 | 58 | ||
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. | ||
49 | 67 | ||
50 | <img height="140px" src="https://user-images.githubusercontent.com/36276403/74103174-a40df100-4b52-11ea-81f4-372c70797924.png" alt="Download now message"/> | 68 | <img height="140px" src="https://user-images.githubusercontent.com/36276403/74103174-a40df100-4b52-11ea-81f4-372c70797924.png" alt="Download now message"/> |
51 | 69 | ||