Skip to content

Implement textDocument/diagnostic pull method - #44

Merged
nilskch merged 1 commit into
nilskch:mainfrom
nertzy:implement-pull-diagnostics
Feb 17, 2026
Merged

Implement textDocument/diagnostic pull method#44
nilskch merged 1 commit into
nilskch:mainfrom
nertzy:implement-pull-diagnostics

Conversation

@nertzy

@nertzy nertzy commented Feb 13, 2026

Copy link
Copy Markdown
Contributor

Return stored diagnostics when the client requests them via the pull diagnostic model (LSP 3.17.0+), instead of returning "method not found". This complements the existing push model (publishDiagnostics).

Problem: Editors like Zed that use pull diagnostics log repeated errors:

Get diagnostics via jj_lsp failed: Method not found

The server already advertises diagnostic_provider in its capabilities and computes diagnostics on did_open/did_change, but the diagnostic trait method was not overridden, so the default implementation returned Error::method_not_found().

Fix: Override the diagnostic method to return the already-computed diagnostics for the requested document as a FullDocumentDiagnosticReport. If no diagnostics exist for the URI, an empty report is returned.

Return stored diagnostics when the client requests them via the
pull diagnostic model (LSP 3.17.0+), instead of returning
"method not found". This complements the existing push model
(publishDiagnostics) and fixes errors in editors like Zed that
use pull diagnostics.

@nilskch nilskch left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@nilskch
nilskch merged commit 4b10477 into nilskch:main Feb 17, 2026
3 checks passed
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