use color_eyre::eyre::Result;
pub async fn execute_lsp(port: u16, stdio: bool) -> Result<()> {
if stdio {
println!("🚀 Starting Nargo LSP over stdio...");
nargo_lsp::run_stdio().await.map_err(|e| color_eyre::eyre::eyre!(e))?;
}
else {
println!("🚀 Starting Nargo LSP on http://127.0.0.1:{}...", port);
nargo_lsp::run_stdio().await.map_err(|e| color_eyre::eyre::eyre!(e))?;
}
Ok(())
}
pub async fn execute_mcp(port: u16, stdio: bool) -> Result<()> {
if stdio {
println!("🚀 Starting Nargo MCP over stdio...");
nargo_mcp::run_stdio().await.map_err(|e| color_eyre::eyre::eyre!(e))?;
}
else {
println!("🚀 Starting Nargo MCP on http://127.0.0.1:{}...", port);
nargo_mcp::run_stdio().await.map_err(|e| color_eyre::eyre::eyre!(e))?;
}
Ok(())
}