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

@ -368,7 +368,7 @@ pub trait DebugAdapter: 'static + Send + Sync {
}
}
async fn dap_schema(&self) -> serde_json::Value;
fn dap_schema(&self) -> serde_json::Value;
fn label_for_child_session(&self, _args: &StartDebuggingRequestArguments) -> Option<String> {
None
@ -394,7 +394,7 @@ impl DebugAdapter for FakeAdapter {
DebugAdapterName(Self::ADAPTER_NAME.into())
}
async fn dap_schema(&self) -> serde_json::Value {
fn dap_schema(&self) -> serde_json::Value {
serde_json::Value::Null
}

View file

@ -14,7 +14,7 @@ use crate::{
};
use std::{collections::BTreeMap, sync::Arc};
/// Given a user build configuration, locator creates a fill-in debug target ([DebugRequest]) on behalf of the user.
/// Given a user build configuration, locator creates a fill-in debug target ([DebugScenario]) on behalf of the user.
#[async_trait]
pub trait DapLocator: Send + Sync {
fn name(&self) -> SharedString;
@ -67,13 +67,12 @@ impl DapRegistry {
pub async fn adapters_schema(&self) -> task::AdapterSchemas {
let mut schemas = AdapterSchemas(vec![]);
// Clone to avoid holding lock over await points
let adapters = self.0.read().adapters.clone();
for (name, adapter) in adapters.into_iter() {
schemas.0.push(AdapterSchema {
adapter: name.into(),
schema: adapter.dap_schema().await,
schema: adapter.dap_schema(),
});
}