From 3ebbeb46d42dd45f7769fe3e62f4ecf6a06d8409 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sun, 9 Feb 2020 21:25:24 +0200 Subject: docs: more documentation on prebuilt binaries all-editors-wise --- docs/user/README.md | 62 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 22 deletions(-) (limited to 'docs/user') 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 @@ +[github-releases]: https://github.com/rust-analyzer/rust-analyzer/releases + The main interface to rust-analyzer is the [LSP](https://microsoft.github.io/language-server-protocol/) implementation. To -install lsp server, clone the repository and then run `cargo xtask install ---server` (which is shorthand for `cargo install --path -./crates/ra_lsp_server`). This will produce a binary named `ra_lsp_server` which -you should be able to use it with any LSP-compatible editor. We use custom -extensions to LSP, so special client-side support is required to take full -advantage of rust-analyzer. This repository contains support code for VS Code. - -``` +install lsp server, you have three options: + +* **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). +* Manually download prebuilt binaries from [GitHub releases][github-releases] + * `ra_lsp_server-linux` for Linux + * `ra_lsp_server-mac` for Mac + * `ra_lsp_server-windows.exe` for Windows +* Clone the repository and build from sources +```bash $ git clone git@github.com:rust-analyzer/rust-analyzer && cd rust-analyzer -$ cargo xtask install --server +$ cargo xtask install --server # or cargo install --path ./crates/ra_lsp_server ``` + +This way you will get a binary named `ra_lsp_server` (with os suffix for prebuilt binaries) +which you should be able to use with any LSP-compatible editor. + +We make use of custom extensions to LSP, so special client-side support is required to take full +advantage of rust-analyzer. This repository contains support code for VS Code. + Rust Analyzer needs sources of rust standard library to work, so you might also need to execute @@ -22,30 +32,38 @@ See [./features.md](./features.md) document for a list of features that are avai ## VS Code -Prerequisites: +### Prerequisites -In order to build the VS Code plugin, you need to have node.js and npm with -a minimum version of 10 installed. Please refer to -[node.js and npm documentation](https://nodejs.org) for installation instructions. - -You will also need the most recent version of VS Code: we don't try to +You will need the most recent version of VS Code: we don't try to maintain compatibility with older versions yet. +In order to build the VS Code plugin from sources, you need to have node.js and npm with +a minimum version of 12 installed. Please refer to +[node.js and npm documentation](https://nodejs.org) for installation instructions. + ### Installation from prebuilt binaries We ship prebuilt binaries for Linux, Mac and Windows via -[GitHub releases](https://github.com/rust-analyzer/rust-analyzer/releases). +[GitHub releases][github-releases]. In order to use them you need to install the client VSCode extension. -Publishing to VSCode marketplace is currently WIP. Thus, you need to clone the repository and install **only** the client extension via +Publishing to VS Code marketplace is currently WIP. Thus, you need to manually download +`rust-analyzer-0.1.0.vsix` file from latest [GitHub release][github-releases]. + +After you downloaded the `.vsix` file you can install it from the terminal + ``` -$ git clone https://github.com/rust-analyzer/rust-analyzer.git --depth 1 -$ cd rust-analyzer -$ cargo xtask install --client-code +$ code --install-extension rust-analyzer-0.1.0.vsix ``` -Then open VSCode (or reload the window if it was already running), open some Rust project and you should -see an info message pop-up. +Or open VS Code, press Ctrl+Shift+P, and search for the following command: + +Install from VSIX command + +Press Enter and go to `rust-analyzer-0.1.0.vsix` file through the file explorer. + +Then open some Rust project and you should +see an info message pop-up. Download now message -- cgit v1.2.3