Skip to content

Commit

Permalink
Add rust-analyzer proxy.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Jul 6, 2022
1 parent 20ed5d9 commit 8756598
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion ci/snapcraft.bash
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fi
# as rustup.$PROXY. If we have an alias which is not a supported proxy name
# then rustup might get sad.

PROXIES="cargo cargo-clippy cargo-fmt cargo-miri clippy-driver rls rustc rustdoc rustfmt"
PROXIES="cargo cargo-clippy cargo-fmt cargo-miri clippy-driver rls rustc rustdoc rustfmt rust-analyzer"

# From now on, things should be automagic

Expand Down
7 changes: 5 additions & 2 deletions doc/src/concepts/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ toolchains. The following is an overview of the different components:
* `rust-docs` — This is a local copy of the [Rust documentation]. Use the
`rustup doc` command to open the documentation in a web browser. Run `rustup
doc --help` for more options.
* `rls` — [RLS] is a language server that provides support for editors and
IDEs.
* `rust-analyzer`[rust-analyzer] is a language server that provides support
for editors and IDEs.
* `rls`[RLS] is a language server that is deprecated and has been replaced
by rust-analyzer.
* `clippy` — [Clippy] is a lint tool that provides extra checks for common
mistakes and stylistic choices.
* `miri` — [Miri] is an experimental Rust interpreter, which can be used for
Expand Down Expand Up @@ -76,6 +78,7 @@ details.
[build-std]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std
[miri]: https://github.com/rust-lang/miri/
[RLS]: https://github.com/rust-lang/rls
[rust-analyzer]: https://rust-analyzer.github.io/
[rustdoc]: https://doc.rust-lang.org/rustdoc/
[cargo]: https://doc.rust-lang.org/cargo/
[clippy]: https://github.com/rust-lang/rust-clippy
Expand Down
2 changes: 1 addition & 1 deletion doc/src/concepts/profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ available at this time are `minimal`, `default`, and `complete`:
`rustup`. This should never be used, as it includes *every* component ever
included in the metadata and thus will almost always fail. If you are
looking for a way to install devtools such as `miri` or IDE integration
tools (`rls`), you should use the `default` profile and
tools (`rust-analyzer`), you should use the `default` profile and
install the needed additional components manually, either by using `rustup
component add` or by using `-c` when installing the toolchain.

Expand Down
4 changes: 3 additions & 1 deletion doc/src/concepts/proxies.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ The list of proxies is currently static in `rustup` and is as follows:

- `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.

- `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.
- `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.

- `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.

- `cargo-miri` is an experimental interpreter for Rust's mid-level intermediate representation (MIR) and it comes from the `miri` component.

- `rls` is a deprecated IDE tool that has been replaced by `rust-analyzer`. It comes from the `rls` component.
15 changes: 8 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub static TOOLS: &[&str] = &[
"rust-gdb",
"rust-gdbgui",
"rls",
"rust-analyzer",
"cargo-clippy",
"clippy-driver",
"cargo-miri",
Expand Down Expand Up @@ -110,12 +111,12 @@ mod tests {
for tool in DUP_TOOLS {
assert!(is_proxyable_tools(tool).is_ok());
}
let message = &"unknown proxy name: 'unknown-tool'; valid proxy names are 'rustc', \
'rustdoc', 'cargo', 'rust-lldb', 'rust-gdb', 'rust-gdbgui', 'rls', 'cargo-clippy', \
'clippy-driver', 'cargo-miri', 'rustfmt', 'cargo-fmt'";
assert!(is_proxyable_tools("unknown-tool")
.unwrap_err()
.to_string()
.eq(message));
let message = "unknown proxy name: 'unknown-tool'; valid proxy names are 'rustc', \
'rustdoc', 'cargo', 'rust-lldb', 'rust-gdb', 'rust-gdbgui', 'rls', 'rust-analyzer', \
'cargo-clippy', 'clippy-driver', 'cargo-miri', 'rustfmt', 'cargo-fmt'";
assert_eq!(
is_proxyable_tools("unknown-tool").unwrap_err().to_string(),
message
);
}
}
5 changes: 4 additions & 1 deletion tests/cli-misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,10 @@ fn rustup_failed_path_search() {
expect_err(
config,
broken,
"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'",
"unknown proxy name: 'fake_proxy'; valid proxy names are \
'rustc', 'rustdoc', 'cargo', 'rust-lldb', 'rust-gdb', 'rust-gdbgui', \
'rls', 'rust-analyzer', 'cargo-clippy', 'clippy-driver', 'cargo-miri', \
'rustfmt', 'cargo-fmt'",
);

// Hardlink will be automatically cleaned up by test setup code
Expand Down

0 comments on commit 8756598

Please sign in to comment.