#[cfg(feature = "lsp")]
use async_inspect::lsp::AsyncInspectLanguageServer;
#[cfg(feature = "lsp")]
use tower_lsp::{LspService, Server};
#[cfg(feature = "lsp")]
#[tokio::main]
async fn main() {
eprintln!("async-inspect LSP server starting...");
let stdin = tokio::io::stdin();
let stdout = tokio::io::stdout();
let (service, socket) = LspService::new(AsyncInspectLanguageServer::new);
eprintln!("LSP server listening on stdin/stdout");
Server::new(stdin, stdout, socket).serve(service).await;
eprintln!("async-inspect LSP server stopped");
}
#[cfg(not(feature = "lsp"))]
fn main() {
eprintln!("Error: async-inspect-lsp requires the 'lsp' feature to be enabled");
eprintln!("Build with: cargo build --features lsp --bin async-inspect-lsp");
std::process::exit(1);
}