Skip to content

Commit

Permalink
Move rust-analyzer to DUP_TOOLS
Browse files Browse the repository at this point in the history
The rust-analyzer documentation includes the step `cargo install`
into `~/.cargo/bin` when building from source. Since this has a chance
of accidentally overriding the user's copy, move this to DUP_TOOLS.
  • Loading branch information
ehuss committed Jul 19, 2022
1 parent b5639d3 commit 0bfe623
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ pub static TOOLS: &[&str] = &[
"rust-gdb",
"rust-gdbgui",
"rls",
"rust-analyzer",
"cargo-clippy",
"clippy-driver",
"cargo-miri",
Expand All @@ -36,7 +35,7 @@ pub static TOOLS: &[&str] = &[
// Tools which are commonly installed by Cargo as well as rustup. We take a bit
// more care with these to ensure we don't overwrite the user's previous
// installation.
pub static DUP_TOOLS: &[&str] = &["rustfmt", "cargo-fmt"];
pub static DUP_TOOLS: &[&str] = &["rust-analyzer", "rustfmt", "cargo-fmt"];

// If the given name is one of the tools we proxy.
pub fn is_proxyable_tools(tool: &str) -> Result<()> {
Expand Down Expand Up @@ -112,8 +111,8 @@ mod tests {
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', 'rust-analyzer', \
'cargo-clippy', 'clippy-driver', 'cargo-miri', 'rustfmt', 'cargo-fmt'";
'rustdoc', 'cargo', 'rust-lldb', 'rust-gdb', 'rust-gdbgui', 'rls', \
'cargo-clippy', 'clippy-driver', 'cargo-miri', 'rust-analyzer', 'rustfmt', 'cargo-fmt'";
assert_eq!(
is_proxyable_tools("unknown-tool").unwrap_err().to_string(),
message
Expand Down
4 changes: 2 additions & 2 deletions tests/cli-misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,8 @@ fn rustup_failed_path_search() {
broken,
"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'",
'rls', 'cargo-clippy', 'clippy-driver', 'cargo-miri', \
'rust-analyzer', 'rustfmt', 'cargo-fmt'",
);

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

0 comments on commit 0bfe623

Please sign in to comment.