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

@ -419,16 +419,11 @@ impl extension::Extension for WasmExtension {
.await
}
async fn dap_config_to_scenario(
&self,
config: ZedDebugConfig,
worktree: Arc<dyn WorktreeDelegate>,
) -> Result<DebugScenario> {
async fn dap_config_to_scenario(&self, config: ZedDebugConfig) -> Result<DebugScenario> {
self.call(|extension, store| {
async move {
let resource = store.data_mut().table().push(worktree)?;
let kind = extension
.call_dap_config_to_scenario(store, config, resource)
.call_dap_config_to_scenario(store, config)
.await?
.map_err(|err| store.data().extension_error(err))?;
Ok(kind)

View file

@ -950,13 +950,12 @@ impl Extension {
&self,
store: &mut Store<WasmState>,
config: ZedDebugConfig,
resource: Resource<Arc<dyn WorktreeDelegate>>,
) -> Result<Result<DebugScenario, String>> {
match self {
Extension::V0_6_0(ext) => {
let config = config.into();
let dap_binary = ext
.call_dap_config_to_scenario(store, &config, resource)
.call_dap_config_to_scenario(store, &config)
.await?
.map_err(|e| anyhow!("{e:?}"))?;