UNPKG

lsp-gateway

Version:

Local LSP gateway for development - HTTP JSON-RPC and MCP server for 4 languages

23 lines (17 loc) 828 B
#!/usr/bin/env node const { spawn } = require("child_process"); const path = require("path"); const fs = require("fs"); const binaryName = process.platform === "win32" ? "lsp-gateway.exe" : "lsp-gateway"; const binaryPath = path.join(__dirname, binaryName); if (!fs.existsSync(binaryPath)) { console.error("❌ LSP Gateway binary not found at:", binaryPath); console.error(" Please run \"make local\" to build the binary"); process.exit(1); } const args = process.argv.slice(2); const child = spawn(binaryPath, args, { stdio: "inherit" }); process.on("SIGINT", () => child.kill("SIGINT")); process.on("SIGTERM", () => child.kill("SIGTERM")); child.on("close", (code) => process.exit(code || 0)); child.on("error", (error) => { console.error("❌ Failed to start LSP Gateway:", error.message); process.exit(1); });