debugger: Mark DapLocator::create_scenario as an async function (#32680)

Paves way for locators in extensions.

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-06-13 13:19:03 +02:00 committed by GitHub
parent 2c491d3a66
commit d5b8c21a75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 290 additions and 218 deletions

View file

@ -855,7 +855,7 @@ impl RunningState {
debug_assert!(!config_is_valid);
Some(locator_name)
} else if !config_is_valid {
dap_store
let task = dap_store
.update(cx, |this, cx| {
this.debug_scenario_for_build_task(
task.original_task().clone(),
@ -863,17 +863,21 @@ impl RunningState {
task.display_label().to_owned().into(),
cx,
)
.and_then(|scenario| {
match scenario.build {
Some(BuildTaskDefinition::Template {
locator_name, ..
}) => locator_name,
_ => None,
}
})
});
if let Ok(t) = task {
t.await.and_then(|scenario| {
match scenario.build {
Some(BuildTaskDefinition::Template {
locator_name, ..
}) => locator_name,
_ => None,
}
})
.ok()
.flatten()
} else {
None
}
} else {
None
};