From 83a816740268ec527bf2f908cf752cfcbedc81f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Sun, 17 Oct 2021 13:58:11 +0900 Subject: [PATCH] Invert core -> dap dependency --- Cargo.lock | 2 +- helix-core/Cargo.toml | 1 - helix-core/src/syntax.rs | 8 +++++++- helix-dap/Cargo.toml | 1 + helix-dap/src/client.rs | 10 ++-------- helix-dap/src/lib.rs | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9631ba8e6..ef9d74bda 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -362,7 +362,6 @@ version = "0.4.1" dependencies = [ "arc-swap", "etcetera", - "helix-dap", "helix-syntax", "once_cell", "quickcheck", @@ -386,6 +385,7 @@ version = "0.4.1" dependencies = [ "anyhow", "fern", + "helix-core", "log", "serde", "serde_json", diff --git a/helix-core/Cargo.toml b/helix-core/Cargo.toml index 20ba47e95..510964536 100644 --- a/helix-core/Cargo.toml +++ b/helix-core/Cargo.toml @@ -14,7 +14,6 @@ include = ["src/**/*", "README.md"] [dependencies] helix-syntax = { version = "0.4", path = "../helix-syntax" } -helix-dap = { version = "0.4", path = "../helix-dap" } ropey = "1.3" smallvec = "1.7" diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index 00c09ea2f..822d31814 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -5,7 +5,6 @@ use crate::{ Rope, RopeSlice, Tendril, }; -use helix_dap::DebuggerQuirks; pub use helix_syntax::get_language; use arc_swap::ArcSwap; @@ -129,6 +128,13 @@ pub struct DebugAdapterConfig { pub quirks: DebuggerQuirks, } +// Different workarounds for adapters' differences +#[derive(Debug, Default, PartialEq, Clone, Serialize, Deserialize)] +pub struct DebuggerQuirks { + #[serde(default)] + pub absolute_paths: bool, +} + #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "kebab-case")] pub struct IndentationConfiguration { diff --git a/helix-dap/Cargo.toml b/helix-dap/Cargo.toml index 60115447f..2b922e84a 100644 --- a/helix-dap/Cargo.toml +++ b/helix-dap/Cargo.toml @@ -12,6 +12,7 @@ homepage = "https://helix-editor.com" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +helix-core = { version = "0.4", path = "../helix-core" } anyhow = "1.0" log = "0.4" serde = { version = "1.0", features = ["derive"] } diff --git a/helix-dap/src/client.rs b/helix-dap/src/client.rs index 72aff5d25..62557951d 100644 --- a/helix-dap/src/client.rs +++ b/helix-dap/src/client.rs @@ -3,9 +3,10 @@ use crate::{ types::*, Error, Result, }; +use helix_core::syntax::DebuggerQuirks; + use anyhow::anyhow; pub use log::{error, info}; -use serde::{Deserialize, Serialize}; use std::{ collections::HashMap, net::{IpAddr, Ipv4Addr, SocketAddr}, @@ -21,13 +22,6 @@ use tokio::{ time, }; -// Different workarounds for adapters' differences -#[derive(Debug, Default, PartialEq, Clone, Serialize, Deserialize)] -pub struct DebuggerQuirks { - #[serde(default)] - pub absolute_paths: bool, -} - #[derive(Debug)] pub struct Client { id: usize, diff --git a/helix-dap/src/lib.rs b/helix-dap/src/lib.rs index 100c0c606..f60b102c0 100644 --- a/helix-dap/src/lib.rs +++ b/helix-dap/src/lib.rs @@ -2,7 +2,7 @@ mod client; mod transport; mod types; -pub use client::{Client, DebuggerQuirks}; +pub use client::Client; pub use events::Event; pub use transport::{Payload, Response, Transport}; pub use types::*;