Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Commit 687af89

Browse files
committed
Reword the README.md
To de-emphasize the current RLS and emphasize that we use either RLS or Rust Analyzer as our underlying language server.
1 parent 260a464 commit 687af89

File tree

1 file changed

+49
-37
lines changed

1 file changed

+49
-37
lines changed

README.md

Lines changed: 49 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,41 @@ Adds language support for Rust to Visual Studio Code. Supports:
1414
* snippets
1515
* build tasks
1616

17+
Rust support is powered by a separate [language server](https://microsoft.github.io/language-server-protocol/overviews/lsp/overview/)
18+
- either by the official [Rust Language Server](https://github.com/rust-lang/rls) (RLS) or
19+
[rust-analyzer](https://github.com/rust-lang/rls), depending on the user's
20+
preference. If you don't have it installed, the extension will install it for
21+
you (with permission).
1722

18-
Rust support is powered by the [Rust Language Server](https://github.com/rust-lang/rls)
19-
(RLS). If you don't have it installed, the extension will install it for you.
20-
21-
This extension is built and maintained by the RLS team, part of the Rust
23+
This extension is built and maintained by the Rust
2224
[IDEs and editors team](https://www.rust-lang.org/en-US/team.html#Dev-tools-team).
23-
It is the reference client implementation for the RLS. Our focus is on providing
24-
a stable, high quality extension that makes best use of the RLS. We aim to
25-
support as many features as possible, but our priority is supporting the
26-
essential features as well as possible.
25+
Our focus is on providing
26+
a stable, high quality extension that makes the best use of the respective language
27+
server. We aim to support as many features as possible, but our priority is
28+
supporting the essential features as well as possible.
29+
30+
For support, please file an
31+
[issue on the repo](https://github.com/rust-lang/rls-vscode/issues/new)
32+
or talk to us [on Discord](https://discordapp.com/invite/rust-lang).
33+
For RLS, there is also some [troubleshooting and debugging](https://github.com/rust-lang/rls/blob/master/debugging.md) advice.
2734

28-
For support, please file an [issue on the repo](https://github.com/rust-lang/rls-vscode/issues/new)
29-
or talk to us [on Discord](https://discordapp.com/invite/rust-lang). There is also some
30-
[troubleshooting and debugging](https://github.com/rust-lang/rls/blob/master/debugging.md)
31-
advice.
35+
## Contribution
3236

3337
Contributing code, tests, documentation, and bug reports is appreciated! For
34-
more details on building and debugging, etc., see [contributing.md](contributing.md).
38+
more details see [contributing.md](contributing.md).
3539

3640

3741
## Quick start
3842

39-
* Install [rustup](https://www.rustup.rs/) (Rust toolchain manager).
40-
* Install this extension from [the VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust)
43+
1. Install [rustup](https://www.rustup.rs/) (Rust toolchain manager).
44+
2. Install this extension from [the VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust)
4145
(or by entering `ext install rust-lang.rust` at the command palette <kbd>Ctrl</kbd>+<kbd>P</kbd>).
42-
* (Skip this step if you already have Rust projects that you'd like to work on.)
46+
3. (Skip this step if you already have Rust projects that you'd like to work on.)
4347
Create a new Rust project by following [these instructions](https://doc.rust-lang.org/book/ch01-03-hello-cargo.html).
44-
* Open a Rust project (`File > Add Folder to Workspace...`). Open the folder for the whole
45-
project (i.e., the folder containing 'Cargo.toml'), not the 'src' folder.
46-
* You'll be prompted to install the RLS. Once installed, the RLS should start
47-
building your project.
48+
4. Open a Rust project (`File > Add Folder to Workspace...`). Open the folder for the whole
49+
project (i.e., the folder containing `Cargo.toml`, not the `src` folder).
50+
5. You'll be prompted to install the Rust server. Once installed, it should start
51+
analyzing your project (RLS will also have to to build the project).
4852

4953

5054
## Configuration
@@ -53,24 +57,25 @@ This extension provides options in VSCode's configuration settings. These
5357
include `rust.*`, which are passed directly to RLS, and the `rust-client.*`
5458
, which mostly deal with how to spawn it or debug it.
5559
You can find the settings under `File > Preferences > Settings`; they all
56-
have Intellisense help.
60+
have IntelliSense help.
5761

58-
Some highlights:
62+
Examples:
5963

6064
* `rust.show_warnings` - set to false to silence warnings in the editor.
6165
* `rust.all_targets` - build and index code for all targets (i.e., integration tests, examples, and benches)
6266
* `rust.cfg_test` - build and index test code (i.e., code with `#[cfg(test)]`/`#[test]`)
63-
6467
* `rust-client.channel` - specifies from which toolchain the RLS should be spawned
6568

69+
> **_TIP:_** To select the underlying language server, set `rust-client.engine` accordingly!
70+
6671
## Features
6772

6873
### Snippets
6974

70-
Snippets are code templates which expand into common boilerplate. Intellisense
71-
includes snippet names as options when you type; select one by pressing 'enter'.
72-
You can move to the next 'hole' in the template by pressing 'tab'. We provide
73-
the following snippets:
75+
Snippets are code templates which expand into common boilerplate. IntelliSense
76+
includes snippet names as options when you type; select one by pressing
77+
<kbd>enter</kbd>. You can move to the next snippet 'hole' in the template by
78+
pressing <kbd>tab</kbd>. We provide the following snippets:
7479

7580
* `for` - a for loop
7681
* `macro_rules` - declare a macro
@@ -102,18 +107,25 @@ to `true`. Find it under `File > Preferences > Settings`.
102107
## Requirements
103108

104109
* [Rustup](https://www.rustup.rs/),
105-
* A Rust toolchain (the extension will configure this for you, with
106-
permission),
107-
* `rls`, `rust-src`, and `rust-analysis` components (the
108-
extension will install these for you, with permission).
110+
* A Rust toolchain (the extension will configure this for you, with permission),
111+
* `rls`, `rust-src`, and `rust-analysis` components (the extension will install
112+
these for you, with permission). Only `rust-src` is required when using
113+
rust-analyzer.
109114

110115

111116
## Implementation
112117

113-
This extension almost exclusively uses the RLS for its feature support (syntax
114-
highlighting, snippets, and build tasks are provided client-side). The RLS uses
115-
the Rust compiler (`rustc`) to get data about Rust programs. It uses Cargo to
116-
manage building. Both Cargo and `rustc` are run in-process by the RLS. Formatting
117-
and code completion are provided by `rustfmt` and Racer, again both of these are
118-
run in-process by the RLS.
118+
Both language servers can use Cargo to get more information about Rust projects
119+
and both use [`rustfmt`](https://github.com/rust-lang/rustfmt/) extensively to
120+
format the code.
121+
122+
[RLS](https://github.com/rust-lang/rls) uses Cargo and also the Rust compiler
123+
([`rustc`](https://github.com/rust-lang/rust/)) in a more direct fashion, where
124+
it builds the project and reuses the data computed by the compiler itself. To
125+
provide code completion it uses a separate tool called
126+
[`racer`](https://github.com/racer-rust/racer).
119127

128+
[Rust Analyzer](https://github.com/rust-analyzer/rust-analyzer) is a separate
129+
compiler frontend for the Rust language that doesn't use the Rust compiler
130+
([`rustc`](https://github.com/rust-lang/rust/)) directly but rather performs its
131+
own analysis that's tailor-fitted to the editor/IDE use case.

0 commit comments

Comments
 (0)