extension: Update DAP extension API (#32448)

- DAP schemas will be stored in `debug_adapters_schemas` subdirectory in
extension work dir.
- Added Debug Config integration and such.

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-06-16 16:25:32 +02:00 committed by GitHub
parent 41e9f3148c
commit 8df6ce2aac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 620 additions and 47 deletions

View file

@ -14,6 +14,7 @@ use fs::normalize_path;
use gpui::{App, Task};
use language::LanguageName;
use semantic_version::SemanticVersion;
use task::{SpawnInTerminal, ZedDebugConfig};
pub use crate::extension_events::*;
pub use crate::extension_host_proxy::*;
@ -144,7 +145,30 @@ pub trait Extension: Send + Sync + 'static {
worktree: Arc<dyn WorktreeDelegate>,
) -> Result<DebugAdapterBinary>;
async fn get_dap_schema(&self) -> Result<serde_json::Value>;
async fn dap_request_kind(
&self,
dap_name: Arc<str>,
config: serde_json::Value,
) -> Result<StartDebuggingRequestArgumentsRequest>;
async fn dap_config_to_scenario(
&self,
config: ZedDebugConfig,
worktree: Arc<dyn WorktreeDelegate>,
) -> Result<DebugScenario>;
async fn dap_locator_create_scenario(
&self,
locator_name: String,
build_config_template: BuildTaskTemplate,
resolved_label: String,
debug_adapter_name: String,
) -> Result<Option<DebugScenario>>;
async fn run_dap_locator(
&self,
locator_name: String,
config: SpawnInTerminal,
) -> Result<DebugRequest>;
}
pub fn parse_wasm_extension_version(