Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

Commit

Permalink
Describe how to install the Rust Language Server (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
torkleyy authored and KalitaAlexey committed Feb 20, 2017
1 parent c3572ad commit c88c065
Showing 1 changed file with 70 additions and 13 deletions.
83 changes: 70 additions & 13 deletions doc/rls_mode/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,96 @@ The type of the parameter is an object with the following fields:

By default, it is `null`.

### Debugging
## Setting up

There is an output channel named "Rust Language Server" which is used to show messages from RLS.
First of all, you have to download the [RLS](https://github.com/rust-lang-nursery/rls) sources:

To open it, perform the following steps:
```bash
git clone https://github.com/rust-lang-nursery/rls
```

* Click "View" on the menu
* Click "Output" on submenu
* Click on the listbox which is to the right of the shown panel
* Choose "Rust Language Server"
Depending on whether you have rustup or not, there are different ways you can set up this plugin.

* [Setting up with rustup](#with-rustup)
* [Setting up without rustup](#without-rustup)

#### With rustup

Make sure you do have [rustup](https://github.com/rust-lang-nursery/rustup.rs) with nightly toolchain.

You can use RLS either installed or by running it from the source code.

For making RLS print more data, refer the "Debug RLS" section below.
If you want use RLS installed, but RLS hasn't been installed yet, perform the following steps in order to install RLS:

### Examples
```bash
cd /path/to/rls
cargo install
```

#### RLS is installed
Because at the moment RLS links to the compiler and it assumes the compiler to be globally installed, one has to use rustup to start the `rls` (rustup will configure the environment accordingly):

```json
"rust.rls": {
"executable": "rustup",
"args": ["run", "nightly", "rls"]
}
```

--

You can also run from source by passing `+nightly` to rustup's cargo proxy:

```json
"rust.rls": {
"executable": "cargo",
"args": ["+nightly", "run", "--manifest-path=/path/to/rls/Cargo.toml", "--release"]
}
```

#### Without rustup

**Note:** You should do this only if you do not have rustup because otherwise rustup will not work anymore.

After you have cloned the sources, you need to download the latest nightly compiler. See the [Building section of the Rust repository](https://github.com/rust-lang/rust#building-from-source) for how to do this.

You can now install the Rust Language Server globally with

```bash
cd /path/to/rls
cargo install
```

and set `"executable"` to `"rls"`:

```json
"rust.rls": {
"executable": "rls"
}
```

#### Source code of RLS is available
--

If you don't want to have it installed you can also run it from sources:

```json
"rust.rls": {
"executable": "cargo",
"args": ["run", "--manifest-path=/path/to/rls/Cargo.toml"]
"args": ["run", "--manifest-path=/path/to/rls/Cargo.toml", "--release"]
}
```

#### Debug RLS
## Debugging

There is an output channel named "Rust Language Server" which is used to show messages from RLS.

To open it, perform the following steps:

* Click "View" on the menu
* Click "Output" on submenu
* Click on the listbox which is to the right of the shown panel
* Choose "Rust Language Server"

For making RLS print more data, you have to add the following lines to your `"rust.rls"` configuration:

```json
"rust.rls": {
Expand Down

0 comments on commit c88c065

Please sign in to comment.