feat(language-service): integrate progressive init with pull-based diagnostics #66967
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.
PR: feat(language-service): integrate progressive init with pull-based diagnostics
Description
Integrates Progressive Project Initialization (#66966) with Pull-Based Diagnostics (#66700) so they work optimally together.
When pull-based diagnostics (LSP 3.17) is active, progressive project initialization now sends a single
workspace/diagnostic/refreshnotification instead of computing and pushing diagnostics for each open file. This eliminates wasted computation since the pull-based client would discard pushed diagnostics anyway.Falls back to the chunked push-based approach when pull diagnostics is not supported by the client.
Problem
Without this integration, when both features are active:
getSemanticDiagnostics) and pushes them viaconnection.sendDiagnostics()textDocument/diagnosticto request them on-demand)Solution
When
usePullDiagnosticsis true, the method:workspace/diagnostic/refreshto the clientThe client then pulls diagnostics on its own schedule, using the pull diagnostics handler which has its own caching via
resultId.Changes
vscode-ng-language-service/server/src/session.tsusePullDiagnosticsininitializeProjectProgressively(), send refresh notification instead of computing diagnosticsDependencies
This PR must be merged AFTER both base PRs:
usePullDiagnosticsflag andworkspace/diagnostic/refresh)initializeProjectProgressively())Testing
Breaking Changes
None
AI Disclosure
This PR was developed using Claude Opus 4 AI assistant under human orchestration and review by @kbrilla.