From d39baa3b4e1f5bc1a03533e7b22af0043ec1eac9 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Mon, 16 Aug 2021 18:16:06 +0900 Subject: Start integrating into the editor's event loop --- helix-view/Cargo.toml | 2 ++ helix-view/src/document.rs | 2 ++ helix-view/src/editor.rs | 5 +++++ 3 files changed, 9 insertions(+) (limited to 'helix-view') diff --git a/helix-view/Cargo.toml b/helix-view/Cargo.toml index 29cfe047..b3991584 100644 --- a/helix-view/Cargo.toml +++ b/helix-view/Cargo.toml @@ -18,6 +18,7 @@ bitflags = "1.3" anyhow = "1" helix-core = { version = "0.4", path = "../helix-core" } helix-lsp = { version = "0.4", path = "../helix-lsp"} +helix-dap = { version = "0.4", path = "../helix-dap"} crossterm = { version = "0.20", optional = true } # Conversion traits @@ -25,6 +26,7 @@ once_cell = "1.8" url = "2" tokio = { version = "1", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot"] } +tokio-stream = "0.1" futures-util = { version = "0.3", features = ["std", "async-await"], default-features = false } slotmap = "1" diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index ff0c8bf4..3e8ed21c 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -100,6 +100,7 @@ pub struct Document { diagnostics: Vec, language_server: Option>, + pub debugger: Option, } use std::fmt; @@ -425,6 +426,7 @@ impl Document { history: Cell::new(History::default()), last_saved_revision: 0, language_server: None, + debugger: None, line_ending: DEFAULT_LINE_ENDING, } } diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index ec80580e..7b9f34fc 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -7,6 +7,9 @@ use crate::{ }; use futures_util::future; +use futures_util::stream::select_all::SelectAll; +use tokio_stream::wrappers::UnboundedReceiverStream; + use std::{ path::{Path, PathBuf}, sync::Arc, @@ -70,6 +73,7 @@ pub struct Editor { pub registers: Registers, pub theme: Theme, pub language_servers: helix_lsp::Registry, + pub debuggers: SelectAll>, pub clipboard_provider: Box, pub syn_loader: Arc, @@ -107,6 +111,7 @@ impl Editor { selected_register: RegisterSelection::default(), theme: themes.default(), language_servers, + debuggers: SelectAll::new(), syn_loader: config_loader, theme_loader: themes, registers: Registers::default(), -- cgit v1.2.3-70-g09d2