Skip to content

Commit 08e36fb

Browse files
rami3ldjc
authored andcommitted
feat(toolchain): notify the user when proxy fallback is activated
1 parent c15bb35 commit 08e36fb

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/toolchain.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,12 @@ impl<'a> Toolchain<'a> {
333333
// Should push the cargo fallback into a custom toolchain type? And then
334334
// perhaps a trait that create command layers on?
335335
if let Some(cmd) = self.maybe_do_cargo_fallback(binary)? {
336+
info!("`cargo` is unavailable for the active toolchain");
337+
info!("falling back to {:?}", cmd.get_program());
336338
return Ok(cmd);
337339
} else if let Some(cmd) = self.maybe_do_rust_analyzer_fallback(binary)? {
340+
info!("`rust-analyzer` is unavailable for the active toolchain");
341+
info!("falling back to {:?}", cmd.get_program());
338342
return Ok(cmd);
339343
}
340344

tests/suite/cli_misc.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1343,7 +1343,10 @@ async fn rust_analyzer_proxy_falls_back_external() {
13431343
&["rust-analyzer", "--echo-current-exe"],
13441344
&[("PATH", &extern_dir.to_string_lossy())],
13451345
"",
1346-
&format!("{}\n", extern_path.display()),
1346+
&format!(
1347+
"info: `rust-analyzer` is unavailable for the active toolchain\ninfo: falling back to {:?}\n{}\n",
1348+
extern_path.as_os_str(), extern_path.display()
1349+
),
13471350
)
13481351
.await;
13491352
}

0 commit comments

Comments
 (0)