Skip to content

Commit

Permalink
Print the binary required by the debug adapter (helix-editor#5195)
Browse files Browse the repository at this point in the history
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!
  • Loading branch information
hyderix authored and gibbz00 committed Dec 17, 2022
1 parent e785bdf commit 28fe51d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helix-term/src/health.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ fn probe_protocol(protocol_name: &str, server_cmd: Option<String>) -> std::io::R
writeln!(stdout, "Configured {}: {}", protocol_name, cmd_name)?;

if let Some(cmd) = server_cmd {
let path = match which::which(cmd) {
let path = match which::which(&cmd) {
Ok(path) => path.display().to_string().green(),
Err(_) => "Not found in $PATH".to_string().red(),
Err(_) => format!("'{}' not found in $PATH", cmd).red(),
};
writeln!(stdout, "Binary for {}: {}", protocol_name, path)?;
}
Expand Down

0 comments on commit 28fe51d

Please sign in to comment.