use clap::Args;
#[derive(Args)]
pub struct LspArgs {
#[arg(long, default_value = "true")]
pub stdio: bool,
#[arg(long)]
pub port: Option<u16>,
#[arg(long)]
pub debug: bool,
}
pub fn run(args: LspArgs) {
let runtime = tokio::runtime::Runtime::new().expect("Failed to create tokio runtime");
runtime.block_on(async {
let result = if let Some(port) = args.port {
vize_maestro::serve_tcp(port).await
} else {
vize_maestro::serve().await
};
if let Err(e) = result {
eprintln!("LSP server error: {}", e);
std::process::exit(1);
}
});
}