| 60 | } |
| 61 | |
| 62 | function parseWebSocketUrl(value) { |
| 63 | const normalized = String(value || "").trim(); |
| 64 | if (!normalized) { |
| 65 | throw new Error( |
| 66 | strings["lsp-error-websocket-url-required"] || |
| 67 | "WebSocket URL is required", |
| 68 | ); |
| 69 | } |
| 70 | if (!/^wss?:\/\//i.test(normalized)) { |
| 71 | throw new Error( |
| 72 | strings["lsp-error-websocket-url-invalid"] || |
| 73 | "WebSocket URL must start with ws:// or wss://", |
| 74 | ); |
| 75 | } |
| 76 | return normalized; |
| 77 | } |
| 78 | |
| 79 | function buildDefaultCheckCommand(binaryCommand, installer) { |
| 80 | const executable = String( |