Skip to content

Commit 8f6b536

Browse files
authored
Merge pull request #3022 from ehuss/rust-analyzer
Add rust-analyzer proxy.
2 parents b109e60 + 0bfe623 commit 8f6b536

File tree

5 files changed

+21
-13
lines changed

5 files changed

+21
-13
lines changed

doc/src/concepts/components.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ toolchains. The following is an overview of the different components:
4040
* `rust-docs` — This is a local copy of the [Rust documentation]. Use the
4141
`rustup doc` command to open the documentation in a web browser. Run `rustup
4242
doc --help` for more options.
43-
* `rls` — [RLS] is a language server that provides support for editors and
44-
IDEs.
43+
* `rust-analyzer`[rust-analyzer] is a language server that provides support
44+
for editors and IDEs.
45+
* `rls`[RLS] is a language server that is deprecated and has been replaced
46+
by rust-analyzer.
4547
* `clippy` — [Clippy] is a lint tool that provides extra checks for common
4648
mistakes and stylistic choices.
4749
* `miri` — [Miri] is an experimental Rust interpreter, which can be used for
@@ -76,6 +78,7 @@ details.
7678
[build-std]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std
7779
[miri]: https://github.com/rust-lang/miri/
7880
[RLS]: https://github.com/rust-lang/rls
81+
[rust-analyzer]: https://rust-analyzer.github.io/
7982
[rustdoc]: https://doc.rust-lang.org/rustdoc/
8083
[cargo]: https://doc.rust-lang.org/cargo/
8184
[clippy]: https://github.com/rust-lang/rust-clippy

doc/src/concepts/profiles.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ available at this time are `minimal`, `default`, and `complete`:
1616
`rustup`. This should never be used, as it includes *every* component ever
1717
included in the metadata and thus will almost always fail. If you are
1818
looking for a way to install devtools such as `miri` or IDE integration
19-
tools (`rls`), you should use the `default` profile and
19+
tools (`rust-analyzer`), you should use the `default` profile and
2020
install the needed additional components manually, either by using `rustup
2121
component add` or by using `-c` when installing the toolchain.
2222

doc/src/concepts/proxies.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ The list of proxies is currently static in `rustup` and is as follows:
1616

1717
- `rust-lldb`, `rust-gdb`, and `rust-gdbgui` are simple wrappers around the `lldb`, `gdb`, and `gdbgui` debuggers respectively. The wrappers enable some pretty-printing of Rust values and add some convenience features to the debuggers by means of their scripting interfaces.
1818

19-
- `rls` is part of the Rust IDE integration tooling. It implements the language-server protocol to permit IDEs and editors such as Visual Studio Code, ViM, or Emacs, access to the semantics of the Rust code you are editing. It comes from the `rls` component.
19+
- `rust-analyzer` is part of the Rust IDE integration tooling. It implements the language-server protocol to permit IDEs and editors such as Visual Studio Code, ViM, or Emacs, access to the semantics of the Rust code you are editing. It comes from the `rust-analyzer` component.
2020

2121
- `cargo-clippy` and `clippy-driver` are related to the `clippy` linting tool which provides extra checks for common mistakes and stylistic choices and it comes from the `clippy` component.
2222

2323
- `cargo-miri` is an experimental interpreter for Rust's mid-level intermediate representation (MIR) and it comes from the `miri` component.
24+
25+
- `rls` is a deprecated IDE tool that has been replaced by `rust-analyzer`. It comes from the `rls` component.

src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub static TOOLS: &[&str] = &[
3535
// Tools which are commonly installed by Cargo as well as rustup. We take a bit
3636
// more care with these to ensure we don't overwrite the user's previous
3737
// installation.
38-
pub static DUP_TOOLS: &[&str] = &["rustfmt", "cargo-fmt"];
38+
pub static DUP_TOOLS: &[&str] = &["rust-analyzer", "rustfmt", "cargo-fmt"];
3939

4040
// If the given name is one of the tools we proxy.
4141
pub fn is_proxyable_tools(tool: &str) -> Result<()> {
@@ -110,12 +110,12 @@ mod tests {
110110
for tool in DUP_TOOLS {
111111
assert!(is_proxyable_tools(tool).is_ok());
112112
}
113-
let message = &"unknown proxy name: 'unknown-tool'; valid proxy names are 'rustc', \
114-
'rustdoc', 'cargo', 'rust-lldb', 'rust-gdb', 'rust-gdbgui', 'rls', 'cargo-clippy', \
115-
'clippy-driver', 'cargo-miri', 'rustfmt', 'cargo-fmt'";
116-
assert!(is_proxyable_tools("unknown-tool")
117-
.unwrap_err()
118-
.to_string()
119-
.eq(message));
113+
let message = "unknown proxy name: 'unknown-tool'; valid proxy names are 'rustc', \
114+
'rustdoc', 'cargo', 'rust-lldb', 'rust-gdb', 'rust-gdbgui', 'rls', \
115+
'cargo-clippy', 'clippy-driver', 'cargo-miri', 'rust-analyzer', 'rustfmt', 'cargo-fmt'";
116+
assert_eq!(
117+
is_proxyable_tools("unknown-tool").unwrap_err().to_string(),
118+
message
119+
);
120120
}
121121
}

tests/cli-misc.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,10 @@ fn rustup_failed_path_search() {
411411
expect_err(
412412
config,
413413
broken,
414-
"unknown proxy name: 'fake_proxy'; valid proxy names are 'rustc', 'rustdoc', 'cargo', 'rust-lldb', 'rust-gdb', 'rust-gdbgui', 'rls', 'cargo-clippy', 'clippy-driver', 'cargo-miri', 'rustfmt', 'cargo-fmt'",
414+
"unknown proxy name: 'fake_proxy'; valid proxy names are \
415+
'rustc', 'rustdoc', 'cargo', 'rust-lldb', 'rust-gdb', 'rust-gdbgui', \
416+
'rls', 'cargo-clippy', 'clippy-driver', 'cargo-miri', \
417+
'rust-analyzer', 'rustfmt', 'cargo-fmt'",
415418
);
416419

417420
// Hardlink will be automatically cleaned up by test setup code

0 commit comments

Comments
 (0)