Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T01:34:27.950Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

extension_locator_adapter.rs

57 lines · 1.6 KB · rust
1use anyhow::Result;
2use async_trait::async_trait;
3use dap::{DapLocator, DebugRequest, adapters::DebugAdapterName};
4use extension::Extension;
5use gpui::{BackgroundExecutor, SharedString};
6use std::sync::Arc;
7use task::{DebugScenario, SpawnInTerminal, TaskTemplate};
8
9pub(crate) struct ExtensionLocatorAdapter {
10    extension: Arc<dyn Extension>,
11    locator_name: SharedString,
12}
13
14impl ExtensionLocatorAdapter {
15    pub(crate) fn new(extension: Arc<dyn extension::Extension>, locator_name: Arc<str>) -> Self {
16        Self {
17            extension,
18            locator_name: SharedString::from(locator_name),
19        }
20    }
21}
22
23#[async_trait]
24impl DapLocator for ExtensionLocatorAdapter {
25    fn name(&self) -> SharedString {
26        self.locator_name.clone()
27    }
28    /// Determines whether this locator can generate debug target for given task.
29    async fn create_scenario(
30        &self,
31        build_config: &TaskTemplate,
32        resolved_label: &str,
33        adapter: &DebugAdapterName,
34    ) -> Option<DebugScenario> {
35        self.extension
36            .dap_locator_create_scenario(
37                self.locator_name.as_ref().to_owned(),
38                build_config.clone(),
39                resolved_label.to_owned(),
40                adapter.0.as_ref().to_owned(),
41            )
42            .await
43            .ok()
44            .flatten()
45    }
46
47    async fn run(
48        &self,
49        build_config: SpawnInTerminal,
50        _executor: BackgroundExecutor,
51    ) -> Result<DebugRequest> {
52        self.extension
53            .run_dap_locator(self.locator_name.as_ref().to_owned(), build_config)
54            .await
55    }
56}
57
Served at tenant.openagents/omega Member data and write actions are omitted.