{"record":{"id":"83e9032bfeb6b958","repo":"zed-industries/zed","slug":"lsp-wait-timed-out-after-minutes","errorCode":null,"errorMessage":"LSP wait timed out after {} minutes","messagePattern":"LSP wait timed out after (.+?) minutes","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/edit_prediction_cli/src/retrieve_context.rs","lineNumber":435,"sourceCode":"                    ),\n                ..\n            } => {\n                step_progress.set_substatus(message.clone());\n            }\n            _ => {}\n        }\n    })];\n\n    // Phase 1: wait for all servers to start.\n    while !servers_pending_start.is_empty() {\n        futures::select! {\n            id = started_rx.next() => {\n                if let Some(id) = id {\n                    servers_pending_start.remove(&id);\n                }\n            },\n            _ = timeout.clone().fuse() => {\n                return Err(anyhow::anyhow!(\"LSP wait timed out after {} minutes\", timeout_duration.as_secs() / 60));\n            }\n        }\n    }\n\n    // Save the buffer so the server sees the current content and kicks off diagnostics.\n    project\n        .update(cx, |project, cx| project.save_buffer(buffer.clone(), cx))\n        .await?;\n\n    // Phase 2: wait for all servers to finish their diagnostic pass.\n    while !servers_pending_diagnostics.is_empty() {\n        futures::select! {\n            id = diag_rx.next() => {\n                if let Some(id) = id {\n                    servers_pending_diagnostics.remove(&id);\n                }\n            },\n            _ = timeout.clone().fuse() => {","sourceCodeStart":417,"sourceCodeEnd":453,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/edit_prediction_cli/src/retrieve_context.rs#L417-L453","documentation":"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).","triggerScenarios":"Thrown at crates/edit_prediction_cli/src/retrieve_context.rs:435 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Increase the LSP startup timeout for very large projects","Check whether a language server process is hung or crashing","Retry context retrieval once the machine is less loaded"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}