diff options
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r-- | helix-view/src/editor.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 83822c1d..2e6121bc 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -10,6 +10,9 @@ use crate::{ }; use futures_util::future; +use futures_util::stream::select_all::SelectAll; +use tokio_stream::wrappers::UnboundedReceiverStream; + use std::{ collections::{BTreeMap, HashMap}, io::stdin, @@ -27,6 +30,7 @@ pub use helix_core::diagnostic::Severity; pub use helix_core::register::Registers; use helix_core::syntax; use helix_core::{Position, Selection}; +use helix_dap as dap; use serde::{ser::SerializeMap, Deserialize, Deserializer, Serialize}; @@ -246,6 +250,19 @@ impl std::fmt::Debug for Motion { } } +#[derive(Debug, Clone, Default)] +pub struct Breakpoint { + pub id: Option<usize>, + pub verified: bool, + pub message: Option<String>, + + pub line: usize, + pub column: Option<usize>, + pub condition: Option<String>, + pub hit_condition: Option<String>, + pub log_message: Option<String>, +} + #[derive(Debug)] pub struct Editor { pub tree: Tree, @@ -257,6 +274,11 @@ pub struct Editor { pub macro_recording: Option<(char, Vec<KeyEvent>)>, pub theme: Theme, pub language_servers: helix_lsp::Registry, + + pub debugger: Option<dap::Client>, + pub debugger_events: SelectAll<UnboundedReceiverStream<dap::Payload>>, + pub breakpoints: HashMap<PathBuf, Vec<Breakpoint>>, + pub clipboard_provider: Box<dyn ClipboardProvider>, pub syn_loader: Arc<syntax::Loader>, @@ -302,6 +324,9 @@ impl Editor { macro_recording: None, theme: theme_loader.default(), language_servers, + debugger: None, + debugger_events: SelectAll::new(), + breakpoints: HashMap::new(), syn_loader, theme_loader, registers: Registers::default(), |