Skip to content

fix: debug lsp diagnostics cmd for certain lsps#5420

Merged
rekram1-node merged 1 commit into
anomalyco:devfrom
monostop:debug-lsp-diagnostics-delay-fix
Dec 12, 2025
Merged

fix: debug lsp diagnostics cmd for certain lsps#5420
rekram1-node merged 1 commit into
anomalyco:devfrom
monostop:debug-lsp-diagnostics-delay-fix

Conversation

@monostop
Copy link
Copy Markdown
Contributor

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.

@rekram1-node rekram1-node changed the title Added sleep on debug lsp diagnostics to ensure custom lsp servers has… fix: debug lsp diagnostics cmd for certain lsps Dec 12, 2025
@rekram1-node rekram1-node merged commit 7ec48df into anomalyco:dev Dec 12, 2025
3 checks passed
@monostop monostop deleted the debug-lsp-diagnostics-delay-fix branch December 12, 2025 05:45
xywsxp pushed a commit to xywsxp/opencode that referenced this pull request Apr 24, 2026
Rwanbt pushed a commit to Rwanbt/opencode that referenced this pull request May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants