debugger: Fix Rust debugger runnable (#28801)

We ran the locator after configuring the debugger binary which cause the
binary to never use the configuration from the cargo locator. This PR
fixes this by correcting the order of configuration.


co-authored-by Anthony Eid <anthony@zed.dev>

Release Notes:

- N/A

---------

Co-authored-by: piotr <piotr@zed.dev>
This commit is contained in:
Anthony Eid 2025-04-15 17:10:06 -04:00 committed by GitHub
parent dad6067e18
commit e34fee55a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 30 additions and 47 deletions

View file

@ -1482,6 +1482,18 @@ impl Project {
.update(cx, |dap_store, cx| dap_store.delegate(&worktree, cx))
})?;
let task = this.update(cx, |project, cx| {
project.dap_store.read(cx).as_local().and_then(|local| {
config.locator.is_some().then(|| {
local.locate_binary(config.clone(), cx.background_executor().clone())
})
})
})?;
let config = if let Some(task) = task {
task.await
} else {
config
};
let binary = adapter
.get_binary(&delegate, &config, user_installed_path, cx)
.await?;