zed-industries/zed · error

LSP wait timed out after

Error message

LSP wait timed out after {} minutes

What it means

wait_for_language_servers_to_start loops until all pending language servers report started, racing a timer; when the timer fires first, the remaining servers are abandoned with this timeout error naming the wait duration. LSP startup stalled (heavy project, slow server, deadlock).

Solutions

  1. Increase the LSP startup timeout for very large projects
  2. Check whether a language server process is hung or crashing
  3. Retry context retrieval once the machine is less loaded
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at crates/edit_prediction_cli/src/retrieve_context.rs:435 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/83e9032bfeb6b958. Report an issue: GitHub.

Appendix: source

Thrown at crates/edit_prediction_cli/src/retrieve_context.rs:435

                    ),
                ..
            } => {
                step_progress.set_substatus(message.clone());
            }
            _ => {}
        }
    })];

    // Phase 1: wait for all servers to start.
    while !servers_pending_start.is_empty() {
        futures::select! {
            id = started_rx.next() => {
                if let Some(id) = id {
                    servers_pending_start.remove(&id);
                }
            },
            _ = timeout.clone().fuse() => {
                return Err(anyhow::anyhow!("LSP wait timed out after {} minutes", timeout_duration.as_secs() / 60));
            }
        }
    }

    // Save the buffer so the server sees the current content and kicks off diagnostics.
    project
        .update(cx, |project, cx| project.save_buffer(buffer.clone(), cx))
        .await?;

    // Phase 2: wait for all servers to finish their diagnostic pass.
    while !servers_pending_diagnostics.is_empty() {
        futures::select! {
            id = diag_rx.next() => {
                if let Some(id) = id {
                    servers_pending_diagnostics.remove(&id);
                }
            },
            _ = timeout.clone().fuse() => {

View on GitHub (pinned to f4178619ac)