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

Commit

Permalink
Add installing rls (#181)
Browse files Browse the repository at this point in the history
* Removed max-line-length from tslint.json

* Added a new component File System

* Distinguished Rust's installation via Rustup and not via Rustup

* Find RLS installed via Rustup.
This commit makes the configuration be able to determine if RLS is installed via Rustup and to use it.
After this commit a user don't have to specify `rust.rls.executable`, but if one does, a specified value supersedes an automatic one

* Ability to update Rustup, to install RLS.
After this commit on opening any Rust project the extension will ask a user to install RLS if it is not installed yet.

* Added documentation
  • Loading branch information
KalitaAlexey authored Apr 22, 2017
1 parent c8fe521 commit c5c7d2f
Show file tree
Hide file tree
Showing 10 changed files with 904 additions and 101 deletions.
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

0 comments on commit c5c7d2f

Please sign in to comment.