diff --git a/Cargo.toml b/Cargo.toml index bfb1c1a..5c2f9c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,25 +23,27 @@ path = "src/bin/john-slop-fmt.rs" [[bin]] name = "john-slop-lsp" path = "src/bin/john-slop-lsp.rs" +required-features = ["lsp"] [features] -default = ["fancy-diagnostics"] +default = ["fancy-diagnostics", "lsp"] fancy-diagnostics = ["miette/fancy"] +lsp = ["dep:john-slop-lsp-engine", "dep:tokio", "dep:tower-lsp-server"] [dependencies] clap = { version = "4.6.7", default-features = false, features = ["derive", "error-context", "help", "std", "suggestions", "usage"] } globset = { version = "0.4.20", default-features = false } john-slop-core = { path = "crates/john-slop-core" } -john-slop-lsp-engine = { package = "john-slop-lsp", path = "crates/john-slop-lsp" } +john-slop-lsp-engine = { package = "john-slop-lsp", path = "crates/john-slop-lsp", optional = true } miette = { version = "7.6.0", default-features = false, features = ["derive"] } serde = { version = "1.0.229", features = ["derive"] } serde_json = "1.0.151" similar = "2.7.0" tempfile = "3.27.0" thiserror = "2.0.21" -tokio = { version = "1.53.1", default-features = false, features = ["io-std", "macros", "rt-multi-thread", "sync"] } +tokio = { version = "1.53.1", default-features = false, features = ["io-std", "macros", "rt-multi-thread", "sync"], optional = true } toml = "1.1.6" -tower-lsp-server = { version = "0.23.0", default-features = false, features = ["runtime-tokio"] } +tower-lsp-server = { version = "0.23.0", default-features = false, features = ["runtime-tokio"], optional = true } [dev-dependencies] criterion = { version = "0.8.2", default-features = false } diff --git a/docs/development.md b/docs/development.md index 09cb976..c4fa042 100644 --- a/docs/development.md +++ b/docs/development.md @@ -21,8 +21,10 @@ cargo deny --locked check ``` The default `fancy-diagnostics` feature enables the detector's colored Miette -renderer and default output mode. The no-default-features test run ensures the -shared library and all binaries remain valid with the plain fallback. Focused +renderer and default output mode. The default `lsp` feature exposes the +compatibility facade's protocol module and builds the LSP binary. The +no-default-features test run exercises the core, detector, and formatter without +the async protocol dependency graph and with the plain diagnostic fallback. Focused unit and integration tests cover domain invariants, input failures, archives, CLI exit behavior, and feature configurations. diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index e197f4c..279007a 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -8,7 +8,7 @@ edition = "2024" cargo-fuzz = true [dependencies] -john_slop = { path = "..", default-features = false } +john_slop = { path = "..", default-features = false, features = ["lsp"] } libfuzzer-sys = "0.4.13" tempfile = "3.27.0" toml = "1.1.6" diff --git a/src/lib.rs b/src/lib.rs index 23c9480..dc2d4d7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,4 +3,5 @@ #![warn(missing_docs)] pub use john_slop_core::*; +#[cfg(feature = "lsp")] pub use john_slop_lsp_engine as lsp; diff --git a/tests/lsp.rs b/tests/lsp.rs index 432320a..d3fb591 100644 --- a/tests/lsp.rs +++ b/tests/lsp.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "lsp")] + use std::{fs, ops::Range as ByteRange, path::PathBuf}; use futures::{FutureExt, StreamExt};