[PR #5420] fix: debug lsp diagnostics cmd for certain lsps #11394

Closed
opened 2026-02-16 18:16:13 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/5420

State: closed
Merged: Yes


Some LSPs (e.g., https://github.com/cucumber/language-server) require configuration from the client and re-indexing of the files after the initial handshake has been established before they can produce relevant diagnostics. This results in invalid diagnostics returned for about a fraction of a second after the handshake has been initialized. After the code has been re-indexed the server sends another (correct) diagnostics response, so this is not a problem for a code editor or the coding agent.

The debug LSP command sends a diagnostic request right after the handshake has been initialized and will exit after the first response (which in this case will not be correct because of lacking configuration). The simple fix is to add a short timeout after the server has been initialized so that it has had time to receive configuration and do any required re-indexing.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/5420 **State:** closed **Merged:** Yes --- Some LSPs (e.g., https://github.com/cucumber/language-server) require configuration from the client and re-indexing of the files after the initial handshake has been established before they can produce relevant diagnostics. This results in invalid diagnostics returned for about a fraction of a second after the handshake has been initialized. After the code has been re-indexed the server sends another (correct) diagnostics response, so this is not a problem for a code editor or the coding agent. The debug LSP command sends a diagnostic request right after the handshake has been initialized and will exit after the first response (which in this case will not be correct because of lacking configuration). The simple fix is to add a short timeout after the server has been initialized so that it has had time to receive configuration and do any required re-indexing.
yindo added the pull-request label 2026-02-16 18:16:13 -05:00
yindo closed this issue 2026-02-16 18:16:13 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11394