(check: () => boolean)
| 224 | const reply = (id: number) => |
| 225 | out.split('\n').filter((l) => l.startsWith('{')).map((l) => JSON.parse(l)).find((m) => m.id === id); |
| 226 | const until = async (check: () => boolean) => { |
| 227 | const deadline = Date.now() + 15_000; |
| 228 | while (!check()) { |
| 229 | if (Date.now() > deadline) throw new Error(`no reply: ${out}\n${err}`); |
| 230 | await new Promise((r) => setTimeout(r, 25)); |
| 231 | } |
| 232 | }; |
| 233 | try { |
| 234 | send({ id: 1, method: 'initialize', params: initializeParams(clientInfo, indexedDir) }); |
| 235 | send({ id: 2, method: 'tools/list', params: {} }); |
no test coverage detected