on master help sign in
Print the binary required by the debug adapter (#5195)

This commit addresses issue 5193, where the author requested that the name of the binary needed is printed along with the rest of the health information. This commit adds a format! macro which formats in the name of the binary and then it will be printed along with the rest of the debug information. The value in cmd is referenced to the call to which, and then consumed upon the call to format!

commitb12c65678aacc577b070c70307ef6fce528e4d85 authorEric Thorburn <60004386+hyderix@users.noreply.github.com> dateSat 17 Dec 2022, 20:03 (4 years ago) parent9c9c775
1 file changed+2−2
helix-term/src/health.rs+2−2
helix-term/src/health.rs+2−2
@@ -281,9 +281,9 @@ fn probe_protocol(protocol_name: &str, server_cmd: Option<String>) -> std::io::R
281281 writeln!(stdout, "Configured {}: {}", protocol_name, cmd_name)?;
282282
283283 if let Some(cmd) = server_cmd {
284− let path = match which::which(cmd) {
284+ let path = match which::which(&cmd) {
285285 Ok(path) => path.display().to_string().green(),
286− Err(_) => "Not found in $PATH".to_string().red(),
286+ Err(_) => format!("'{}' not found in $PATH", cmd).red(),
287287 };
288288 writeln!(stdout, "Binary for {}: {}", protocol_name, path)?;
289289 }