Feature Request: Pull-Based Diagnostics (LSP 3.17)
Description
The Angular Language Service should implement Pull-Based Diagnostics (LSP 3.17) to allow VS Code to request diagnostics on-demand rather than having the server push them on every change.
Current Behavior
Currently, the Angular Language Service uses push-based diagnostics via textDocument/publishDiagnostics. The server pushes diagnostics to the client on every file change, which can cause:
- Redundant computations: Diagnostics are recomputed even for unchanged files
- Server-driven timing: No control over when diagnostics are computed
- Unnecessary updates: Switching between tabs triggers diagnostic recomputation
Expected Behavior
Pull-Based Diagnostics (LSP 3.17) should:
- Cache results: Return
Unchanged report in ~0.2ms when file hasn't changed
- Client-controlled timing: Let VS Code decide when to request diagnostics
- Workspace batching: Support
workspace/diagnostic for all open files
- Refresh signal: Support
workspace/diagnostic/refresh for server-initiated refresh
Protocol Flow
Client Server
| |
|-- textDocument/diagnostic ---->|
| (with previousResultId) |
| |
|<-- Unchanged (resultId match)--| <- Cache hit: ~0.2ms
| OR |
|<-- Full (new diagnostics) ----| <- Cache miss: compute
Motivation
This feature works together with #66668 (Client-Side File Watching) to provide comprehensive performance improvements:
| Phase |
Optimization |
Benefit |
| Project Open |
#66668 File Watching |
Fast initialization |
| File Editing |
Pull Diagnostics |
Cached results, reduced CPU |
| Tab Switching |
Pull Diagnostics |
Instant cached responses |
Implementation Notes
- Requires LSP 3.17 support (vscode-languageserver v9.0.1+)
- Should fall back to push-based diagnostics for older clients
- Cache should be keyed by
resultId and document version
Labels
area: language-service
feature
vscode-extension
Feature Request: Pull-Based Diagnostics (LSP 3.17)
Description
The Angular Language Service should implement Pull-Based Diagnostics (LSP 3.17) to allow VS Code to request diagnostics on-demand rather than having the server push them on every change.
Current Behavior
Currently, the Angular Language Service uses push-based diagnostics via
textDocument/publishDiagnostics. The server pushes diagnostics to the client on every file change, which can cause:Expected Behavior
Pull-Based Diagnostics (LSP 3.17) should:
Unchangedreport in ~0.2ms when file hasn't changedworkspace/diagnosticfor all open filesworkspace/diagnostic/refreshfor server-initiated refreshProtocol Flow
Motivation
This feature works together with #66668 (Client-Side File Watching) to provide comprehensive performance improvements:
Implementation Notes
resultIdand document versionLabels
area: language-servicefeaturevscode-extension