dap_adapters.rs

 1mod codelldb;
 2mod gdb;
 3mod go;
 4mod javascript;
 5mod php;
 6mod python;
 7
 8use std::sync::Arc;
 9
10use anyhow::Result;
11use async_trait::async_trait;
12use codelldb::CodeLldbDebugAdapter;
13use dap::{
14    DapRegistry,
15    adapters::{
16        self, AdapterVersion, DapDelegate, DebugAdapter, DebugAdapterBinary, DebugAdapterName,
17        GithubRepo,
18    },
19    configure_tcp_connection,
20};
21use gdb::GdbDebugAdapter;
22use go::GoDebugAdapter;
23use gpui::{App, BorrowAppContext};
24use javascript::JsDebugAdapter;
25use php::PhpDebugAdapter;
26use python::PythonDebugAdapter;
27use serde_json::json;
28use task::{DebugScenario, ZedDebugConfig};
29
30pub fn init(cx: &mut App) {
31    cx.update_default_global(|registry: &mut DapRegistry, _cx| {
32        registry.add_adapter(Arc::from(CodeLldbDebugAdapter::default()));
33        registry.add_adapter(Arc::from(PythonDebugAdapter::default()));
34        registry.add_adapter(Arc::from(PhpDebugAdapter::default()));
35        registry.add_adapter(Arc::from(JsDebugAdapter::default()));
36        registry.add_adapter(Arc::from(GoDebugAdapter::default()));
37        registry.add_adapter(Arc::from(GdbDebugAdapter));
38
39        #[cfg(any(test, feature = "test-support"))]
40        {
41            registry.add_adapter(Arc::from(dap::FakeAdapter {}));
42        }
43    })
44}