extension: Another batch of updates for DAP extension API (#32809)

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-06-16 21:34:05 +02:00 committed by GitHub
parent 4383fee3c1
commit 0f0ff40c6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 142 additions and 107 deletions

View file

@ -816,10 +816,13 @@ impl RunningState {
Self::relativize_paths(None, &mut config, &task_context);
Self::substitute_variables_in_config(&mut config, &task_context);
let request_type = dap_registry
let request_type = match dap_registry
.adapter(&adapter)
.with_context(|| format!("{}: is not a valid adapter name", &adapter))
.and_then(|adapter| adapter.request_kind(&config));
.with_context(|| format!("{}: is not a valid adapter name", &adapter)) {
Ok(adapter) => adapter.request_kind(&config).await,
Err(e) => Err(e)
};
let config_is_valid = request_type.is_ok();
@ -958,8 +961,8 @@ impl RunningState {
let scenario = dap_registry
.adapter(&adapter)
.with_context(|| anyhow!("{}: is not a valid adapter name", &adapter))
.map(|adapter| adapter.config_from_zed_format(zed_config))??;
.with_context(|| anyhow!("{}: is not a valid adapter name", &adapter))?.config_from_zed_format(zed_config)
.await?;
config = scenario.config;
Self::substitute_variables_in_config(&mut config, &task_context);
} else {