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

@ -6,8 +6,11 @@ use std::{
use anyhow::{Context, Result};
use async_trait::async_trait;
use dap::adapters::{
DapDelegate, DebugAdapter, DebugAdapterBinary, DebugAdapterName, DebugTaskDefinition,
use dap::{
StartDebuggingRequestArgumentsRequest,
adapters::{
DapDelegate, DebugAdapter, DebugAdapterBinary, DebugAdapterName, DebugTaskDefinition,
},
};
use extension::{Extension, WorktreeDelegate};
use gpui::AsyncApp;
@ -95,7 +98,16 @@ impl DebugAdapter for ExtensionDapAdapter {
.await
}
fn config_from_zed_format(&self, _zed_scenario: ZedDebugConfig) -> Result<DebugScenario> {
Err(anyhow::anyhow!("DAP extensions are not implemented yet"))
async fn config_from_zed_format(&self, zed_scenario: ZedDebugConfig) -> Result<DebugScenario> {
self.extension.dap_config_to_scenario(zed_scenario).await
}
async fn request_kind(
&self,
config: &serde_json::Value,
) -> Result<StartDebuggingRequestArgumentsRequest> {
self.extension
.dap_request_kind(self.debug_adapter_name.clone(), config.clone())
.await
}
}