dap_adapters.rs

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