(typedCommand: string)
| 104 | } |
| 105 | |
| 106 | export function parseTypedCommand(typedCommand: string): string[] { |
| 107 | if (!typedCommand.includes(":")) { |
| 108 | // Fallback for old format - simple split by spaces |
| 109 | return typedCommand.split(" "); |
| 110 | } |
| 111 | |
| 112 | const colonIndex = typedCommand.indexOf(":"); |
| 113 | const serverType = typedCommand.substring(0, colonIndex); |
| 114 | const binaryPath = typedCommand.substring(colonIndex + 1); |
| 115 | |
| 116 | switch (serverType) { |
| 117 | case "copilot": |
| 118 | return ["node", binaryPath, "--stdio"]; |
| 119 | case "basedpyright": |
| 120 | return [binaryPath, "--stdio"]; |
| 121 | case "pyrefly": |
| 122 | return [binaryPath, "lsp"]; |
| 123 | case "ty": |
| 124 | return [binaryPath, "server"]; |
| 125 | default: |
| 126 | throw new Error(`Unknown LSP server type: ${serverType}`); |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | function handleWebSocketConnection( |
| 131 | languageServerCommand: string[], |
no test coverage detected
searching dependent graphs…