lsp: Add limited implementation of pull-based diagnostics #23639
+117
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Limited implementation of the diagnostic pull strategy using
textDocument/diagnostic
rpc callLsp server implementors are starting to support a new diagnostic pull strategy. In the case of the most recent release of rust-analyzer, this improves diagnostic reporting in the active document substantially.
Without commenting on the implementation details of #19230, I agree that using the diagnostic pull strategy is useful, but this implementation significantly reduces the complexity of the changes by utilizing existing code paths that normally handle 'textDocument/publishDiagnostics'.
Some work is still needed around implementing this for downstream clients, but I'm definitely open to feedback/support in the current implementation and further developing the feature set.My implementation is high enough above the collab buffer abstractions that I don't need to implement any new rpc features to enable itI'm open to this being modified/rejected, but from my experience using this branch locally, it drastically decreases latency in diagnostic reporting when working in the zed codebase, in combination with bumping the rust toolchain channel to 1.84 (necessary since RA devs only implemented the diagnostic pull rpcs 3 months ago)
Closes #23566
Release Notes: