debugger: Fix up Rust test tasks definitions (#30232)

Closes #ISSUE

Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
Piotr Osiewicz 2025-05-08 14:39:56 +02:00 committed by GitHub
parent 3cc8850a58
commit ee56706d15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 53 additions and 27 deletions

View file

@ -731,19 +731,30 @@ impl RunningState {
(task, None)
}
};
let Some(task) = task.resolve_task("debug-build-task", &task_context) else {
anyhow::bail!("Could not resolve task variables within a debug scenario");
};
let locator_name = if let Some(locator_name) = locator_name {
debug_assert!(request.is_none());
Some(locator_name)
} else if request.is_none() {
dap_store
.update(cx, |this, cx| {
this.debug_scenario_for_build_task(task.clone(), adapter.clone(), cx)
.and_then(|scenario| match scenario.build {
this.debug_scenario_for_build_task(
task.original_task().clone(),
adapter.clone().into(),
task.display_label().to_owned().into(),
cx,
)
.and_then(|scenario| {
match scenario.build {
Some(BuildTaskDefinition::Template {
locator_name, ..
}) => locator_name,
_ => None,
})
}
})
})
.ok()
.flatten()
@ -751,10 +762,6 @@ impl RunningState {
None
};
let Some(task) = task.resolve_task("debug-build-task", &task_context) else {
anyhow::bail!("Could not resolve task variables within a debug scenario");
};
let builder = ShellBuilder::new(is_local, &task.resolved.shell);
let command_label = builder.command_label(&task.resolved.command_label);
let (command, args) =