(line: string)
| 229 | // in-process so the host always gets a reply. |
| 230 | const inflight = new Map<unknown, string>(); |
| 231 | const trackInflight = (line: string): void => { |
| 232 | try { |
| 233 | const m = JSON.parse(line) as JsonRpc; |
| 234 | if (m && m.id !== undefined && typeof m.method === 'string' && m.method !== 'initialize') { |
| 235 | inflight.set(m.id, line); |
| 236 | } |
| 237 | } catch { /* unparseable — nothing we could re-serve anyway */ } |
| 238 | }; |
| 239 | |
| 240 | const writeClient = (obj: JsonRpc | string): void => { |
| 241 | try { process.stdout.write((typeof obj === 'string' ? obj : JSON.stringify(obj)) + '\n'); } catch { /* host gone */ } |
no test coverage detected