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

Add installing rls #181

Merged
merged 6 commits into from
Apr 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ The extension can function in one of two modes:
* [Legacy Mode](legacy_mode/main.md)
* [Rust Language Server Mode](rls_mode/main.md)

The first mode is called *Legacy* because this mode does its best, but the second one is better.
The second one is recommended and at some point the first one will be removed.

But Legacy Mode should work just fine and if it doesn't, open an issue.

Each mode is described in detail on its own page.

Furthermore, the extension provides:
Expand Down
14 changes: 14 additions & 0 deletions doc/rls_mode/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ The possible values are:

## Setting up

The recommended way to set RLS up is using rustup. You should use rustup unless rustup does not suit you.

If you can't answer if rustup suits you, then it suits you.

### Using rustup

If rustup is installed on your computer, then when the extension activates it checks if RLS is installed and if it is not, then the extension asks your permission to update rustup and install RLS.

If you agree with this, the extension will do it and start itself in RLS mode.

You don't have to specify either settings to make RLS work because the extension will do it automatically.

### Using source

First of all, you have to download the [RLS](https://github.com/rust-lang-nursery/rls) sources:

```bash
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -512,11 +512,13 @@
"typescript": "2.2.1",
"vscode": "1.1.0",
"@types/node": "7.0.11",
"@types/mocha": "2.2.40"
"@types/mocha": "2.2.40",
"@types/open": "0.0.29"
},
"dependencies": {
"expand-tilde": "2.0.2",
"tmp": "0.0.31",
"open": "0.0.5",
"tree-kill": "1.1.0",
"find-up": "2.1.0",
"elegant-spinner": "1.0.1",
Expand Down
6 changes: 3 additions & 3 deletions src/components/completion/completion_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import { fileSync } from 'tmp';

import { Configuration } from '../configuration/Configuration';

import { Rustup } from '../configuration/Rustup';

import getDocumentFilter from '../configuration/mod';

import ChildLogger from '../logging/child_logger';
Expand Down Expand Up @@ -127,9 +129,7 @@ export default class CompletionManager {
return true;
}

const rustcSysRoot = this.configuration.getRustcSysRoot();

if (rustcSysRoot && rustcSysRoot.includes('.rustup')) {
if (this.configuration.getRustInstallation() instanceof Rustup) {
// tslint:disable-next-line
const message = 'You are using rustup, but don\'t have installed source code. Do you want to install it?';
window.showErrorMessage(message, 'Yes').then(chosenItem => {
Expand Down
Loading