Skip to repository content62 lines · 2.2 KB · rust
tenant.openagents/omega
No repository description is available.
OpenAgents Git authority 2026-07-28T02:33:25.647Z Public web read
NIP-34 coordinate
30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omegaMaintainersHidden in public view
References2 branches · 1 tag
Read-only clone
git clone https://openagents.com/git/tenant.openagents/omega.gitBrowse files
debugger_settings.rs
1use dap_types::SteppingGranularity;
2use settings::{RegisterSetting, Settings, SettingsContent};
3
4#[derive(Debug, RegisterSetting)]
5pub struct DebuggerSettings {
6 /// Determines the stepping granularity.
7 ///
8 /// Default: line
9 pub stepping_granularity: SteppingGranularity,
10 /// Whether the breakpoints should be reused across Zed sessions.
11 ///
12 /// Default: true
13 pub save_breakpoints: bool,
14 /// Whether to show the debug button in the status bar.
15 ///
16 /// Default: true
17 pub button: bool,
18 /// Time in milliseconds until timeout error when connecting to a TCP debug adapter
19 ///
20 /// Default: 2000ms
21 pub timeout: u64,
22 /// Whether to log messages between active debug adapters and Zed
23 ///
24 /// Default: true
25 pub log_dap_communications: bool,
26 /// Whether to format dap messages in when adding them to debug adapter logger
27 ///
28 /// Default: true
29 pub format_dap_log_messages: bool,
30 /// The dock position of the debug panel
31 ///
32 /// Default: Bottom
33 pub dock: settings::DockPosition,
34}
35
36impl Settings for DebuggerSettings {
37 fn from_settings(content: &SettingsContent) -> Self {
38 let content = content.debugger.clone().unwrap();
39 Self {
40 stepping_granularity: dap_granularity_from_settings(
41 content.stepping_granularity.unwrap(),
42 ),
43 save_breakpoints: content.save_breakpoints.unwrap(),
44 button: content.button.unwrap(),
45 timeout: content.timeout.unwrap(),
46 log_dap_communications: content.log_dap_communications.unwrap(),
47 format_dap_log_messages: content.format_dap_log_messages.unwrap(),
48 dock: content.dock.unwrap(),
49 }
50 }
51}
52
53fn dap_granularity_from_settings(
54 granularity: settings::SteppingGranularity,
55) -> dap_types::SteppingGranularity {
56 match granularity {
57 settings::SteppingGranularity::Instruction => dap_types::SteppingGranularity::Instruction,
58 settings::SteppingGranularity::Line => dap_types::SteppingGranularity::Line,
59 settings::SteppingGranularity::Statement => dap_types::SteppingGranularity::Statement,
60 }
61}
62