fix: increase LSP initialize timeout for JDTLS and KotlinLS#23988
fix: increase LSP initialize timeout for JDTLS and KotlinLS#23988norbu35 wants to merge 1 commit into
Conversation
JDTLS (Eclipse JDT Language Server) and KotlinLS are JVM-based language servers that must perform Gradle project sync and workspace indexing during LSP initialize. For real-world projects this routinely takes 60-180 seconds, well above the default 45 s timeout. Add an optional field to the LSP server Handle interface so built-in servers can declare their timeout needs. Use it in the client with the existing 45 s constant as the default. Set 180 s for JDTLS and KotlinLS, both of which run on the JVM and trigger Gradle sync during initialization. Closes anomalyco#23982
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found two potentially related PRs:
However, PR #23988 (the current PR) appears to be the most recent and focused fix specifically targeting JDTLS and KotlinLS timeout issues. The other PRs may be earlier attempts or related investigations into the same underlying problem. |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
|
@norbu35, could you proceed with this MR? This will be super useful, and we have no moral rights to steal your place among the contributors 😄 |
|
Reopened with the full PR template here: #25649 |
Problem
JDTLS (Eclipse JDT Language Server) and KotlinLS are JVM-based language servers that must perform Gradle project sync and workspace indexing during the LSP
initializehandshake. For real-world projects this routinely takes 60–180 seconds, well above the default 45 s timeout — causing everylsp_diagnosticscall to fail withLSP request timeout (method: initialize).See #23982 for full diagnosis.
Changes
initializeTimeoutfield to theLSPServer.Handleinterface so built-in servers can declare their timeout needsclient.tswith the existingINITIALIZE_TIMEOUT_MS(45 s) as the default — no behavior change for any other serverinitializeTimeout: 180_000(3 min) for JDTLS and KotlinLS, both of which are JVM-based and trigger Gradle sync during initializationTesting
All existing LSP tests pass:
Before / After
Closes #23982