Skip to content

Commit 1fb0c5b

Browse files
committed
Fix bug where lldb user installed path wasn't used in some cases
We checked if the user passed in an lldb-dap path after we searched for lldb-dap in PATH. I switched around the order so if there's a user_installed_path passed through it takes priority
1 parent ec547b8 commit 1fb0c5b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/dap_adapters/src/lldb.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ impl DebugAdapter for LldbDebugAdapter {
3333
config: &DebugAdapterConfig,
3434
user_installed_path: Option<PathBuf>,
3535
) -> Result<DebugAdapterBinary> {
36-
let lldb_dap_path = if cfg!(target_os = "macos") {
36+
let lldb_dap_path = if let Some(user_installed_path) = user_installed_path {
37+
user_installed_path.to_string_lossy().into()
38+
} else if cfg!(target_os = "macos") {
3739
util::command::new_smol_command("xcrun")
3840
.args(&["-f", "lldb-dap"])
3941
.output()
@@ -42,8 +44,6 @@ impl DebugAdapter for LldbDebugAdapter {
4244
.and_then(|output| String::from_utf8(output.stdout).ok())
4345
.map(|path| path.trim().to_string())
4446
.ok_or(anyhow!("Failed to find lldb-dap in user's path"))?
45-
} else if let Some(user_installed_path) = user_installed_path {
46-
user_installed_path.to_string_lossy().into()
4747
} else {
4848
delegate
4949
.which(OsStr::new("lldb-dap"))

0 commit comments

Comments
 (0)