Files
Language-Server/docs/roadmap/13-diagnostics-recovery.md
T
faumaray da8003f6d4 Implement the VLS roadmap on the native VBS build
Native VBS and CMake builds of the server and every registered suite:
protocol and document sync, VBS/compdb providers, stock GCC diagnostics
(including in-process default profile preparation), the stock occurrence
observer and hover/definition, the bounded Scheduler, C++ module graph,
scan and artifact cache with real CMI production, the context-aware
symbol index with schema-2 snapshot migration, navigation and guarded
rename, reflection provenance with splice-origin extraction, index-backed
completion and signature help, live GCC worker control with a registered
DAP suite, and the Neovim and VS Code clients.

VoidLibrary follows main. The private GCC 16.2.0 frontend is reproduced
from the versioned patches and verified stepping reflection/template code
with projected values 17/34 and 41/82.
2026-12-05 14:06:50 +03:00

3.2 KiB

13 — Diagnostics, freshness and incomplete-edit recovery

The opt-in stock GCC 16.2 worker publishes verified TU ranges and clears recovered errors over LSP. An edited Void source, a header overlay, an appearing optional header and a superseded running compile have stdio coverage. Messages with unproven locations appear in the per-document analysis status. Cross-file publication, richer ranges, module scheduling and wider recovery testing remain open. Requirements: R-004,R-006,R-014,R-021 Dependencies: 03,05,09,10;11/12 for module/reflection cases.

Ownership and boundaries

Proposed Sol for LSP mapping and tests, Astra for compiler recovery fixes within approved backend scope. NEW src/features/diagnostics/, tests/diagnostics/. Future assignments must verify the then-current baseline and exact disjoint paths; these proposed scopes do not authorize work in another repository.

Contracts and data flow

Diagnostic batches carry full AnalysisRevision, severity/code/message, source range, related locations and readiness context. Compiler diagnostics remain distinguishable from stale/missing-build-input status. Only current batches may replace current document diagnostics.

Implementation sequence

  1. Map compiler ranges and related locations through immutable source/encoding maps. Preserve include/import and reflection-origin chains where available.
  2. Debounce edits without starving foreground diagnostics; cancel superseded work and publish complete current batches. Clear obsolete diagnostics on close/context removal according to client lifecycle.
  3. Handle syntax errors around templates, splices, expansions and imports using actual backend recovery. Separate compiler crash from ordinary source errors.
  4. Expose stale-build/generated-input status without pretending old diagnostics describe new text. Keep fix-its internal until the later code-action scope has its own safety contract.

Failure behavior and constraints

Never publish a prior revision over a newer result or label a compiler crash as successful empty diagnostics. Invalid ranges are rejected or explicitly degraded; do not clamp them into unrelated source. Missing generated inputs remain a readiness issue with an explicit build action.

Acceptance scenarios

  1. Rapidly introduce and repair malformed reflection/templates/imports; verify useful current diagnostics and server survival.
  2. Race old/new contexts, document closure and worker crashes; verify clearing/publication rules.
  3. Test macro/Unicode/generated ranges, related locations across files, duplicate diagnostic suppression and absent generated prerequisites.

Verification and integration

Proposed NEW CTest label: diagnostics. Once implemented, register a nonzero suite and run:

dev cpp-gcc -c ctest --test-dir build/bootstrap -L diagnostics --output-on-failure

This future command is not evidence that the label/tests exist now. Before dispatch, bind the fixtures above to actual targets and record prerequisites/side effects. Require fresh independent review of the implemented contract and affected integrations. Switch diagnostic adapter/backend only with revision/capability invalidation. Preserve status/errors needed to explain a failed backend; do not hide failures by suppressing all diagnostics.