MCPcopy Index your code
hub / github.com/anomalyco/opencode / waitForFullDiagnostics

Function waitForFullDiagnostics

packages/opencode/src/lsp/client.ts:521–541  ·  view source on GitHub ↗
(request: { path: string; version: number; after?: number })

Source from the content-addressed store, hash-verified

519 }
520
521 async function waitForFullDiagnostics(request: { path: string; version: number; after?: number }) {
522 const startedAt = request.after ?? Date.now()
523 const pushWait = waitForFreshPush({
524 path: request.path,
525 version: request.version,
526 after: startedAt,
527 timeout: DIAGNOSTICS_FULL_WAIT_TIMEOUT_MS,
528 })
529
530 while (Date.now() - startedAt < DIAGNOSTICS_FULL_WAIT_TIMEOUT_MS) {
531 const result = await requestFullDiagnostics(request.path)
532 if (result.handled || result.matched) return
533 const remaining = DIAGNOSTICS_FULL_WAIT_TIMEOUT_MS - (Date.now() - startedAt)
534 if (remaining <= 0) return
535 const next = await Promise.race([
536 pushWait.then((ready) => (ready ? "push" : ("timeout" as const))),
537 waitForRegistrationChange(remaining).then((changed) => (changed ? "registration" : ("timeout" as const))),
538 ])
539 if (next !== "registration") return
540 }
541 }
542
543 // --- Public API ---
544

Callers 1

waitForDiagnosticsFunction · 0.85

Calls 3

waitForFreshPushFunction · 0.85
requestFullDiagnosticsFunction · 0.85

Tested by

no test coverage detected