Skip to content

Commit 0973d78

Browse files
authored
Check for / or \ on windows
1 parent 2e98904 commit 0973d78

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/rust-analyzer/src/handlers/request.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2003,7 +2003,9 @@ fn run_rustfmt(
20032003
// approach: if the command name contains a path seperator, join it with the workspace root.
20042004
// however, if the path is absolute, joining will result in the absolute path being preserved.
20052005
// as a fallback, rely on $PATH-based discovery.
2006-
let cmd_path = if command.contains(std::path::MAIN_SEPARATOR_STR) {
2006+
let cmd_path = if cfg!(windows) && command.contains(&[std::path::MAIN_SEPARATOR_STR, '/']) {
2007+
spec.workspace_root.join(cmd).into()
2008+
} else if command.contains(std::path::MAIN_SEPARATOR_STR) {
20072009
spec.workspace_root.join(cmd).into()
20082010
} else {
20092011
cmd

0 commit comments

Comments
 (0)