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:
parent
41e9f3148c
commit
8df6ce2aac
28 changed files with 620 additions and 47 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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(),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue