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
|
@ -1,4 +1,5 @@
|
|||
mod extension_dap_adapter;
|
||||
mod extension_locator_adapter;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
|
@ -6,6 +7,9 @@ use dap::DapRegistry;
|
|||
use extension::{ExtensionDebugAdapterProviderProxy, ExtensionHostProxy};
|
||||
use extension_dap_adapter::ExtensionDapAdapter;
|
||||
use gpui::App;
|
||||
use util::ResultExt;
|
||||
|
||||
use crate::extension_locator_adapter::ExtensionLocatorAdapter;
|
||||
|
||||
pub fn init(extension_host_proxy: Arc<ExtensionHostProxy>, cx: &mut App) {
|
||||
let language_server_registry_proxy = DebugAdapterRegistryProxy::new(cx);
|
||||
|
@ -30,11 +34,21 @@ impl ExtensionDebugAdapterProviderProxy for DebugAdapterRegistryProxy {
|
|||
&self,
|
||||
extension: Arc<dyn extension::Extension>,
|
||||
debug_adapter_name: Arc<str>,
|
||||
) {
|
||||
if let Some(adapter) = ExtensionDapAdapter::new(extension, debug_adapter_name).log_err() {
|
||||
self.debug_adapter_registry.add_adapter(Arc::new(adapter));
|
||||
}
|
||||
}
|
||||
|
||||
fn register_debug_locator(
|
||||
&self,
|
||||
extension: Arc<dyn extension::Extension>,
|
||||
locator_name: Arc<str>,
|
||||
) {
|
||||
self.debug_adapter_registry
|
||||
.add_adapter(Arc::new(ExtensionDapAdapter::new(
|
||||
.add_locator(Arc::new(ExtensionLocatorAdapter::new(
|
||||
extension,
|
||||
debug_adapter_name,
|
||||
locator_name,
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue