Files
Language-Server/docs/roadmap/12-reflection-provenance.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

38 lines
3.4 KiB
Markdown

# 12 — Reflection, meta values and generated-source provenance
Status: PARTIAL; the bounded provenance/value representation library, read-only virtual generated views, splice-origin extraction from the reproduced GCC frontend, LSP-shaped hover/location adapters and the live-DAP reflected-entity projection are implemented with registered suites. `EditorDiagnostics` LSP wiring (the server has no reflection data source) and index/rename integration remain open.
Requirements: R-010,R-013,R-014,R-015,R-016
Dependencies: 08,09,11 for module-crossing cases; shared SymbolIdentity with15/16 and events with17.
## Ownership and boundaries
Proposed Astra: NEW include/vls/reflection/, src/reflection/, tests/reflection/. Root owns provenance/value DTO schemas.
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
Represent real compiler reflection values/entities, splices and expansions with type information and SourceOrigin chains. Distinguish editable spelling, expansion/splice site, original reflected declaration and synthesized entity. Virtual generated views are read-only semantic explanations and may not be compilable text.
## Implementation sequence
1. Maintain a proposal/version capability matrix for the accepted backend, covering P2996 and associated expansion/static-data/annotation facilities actually used by Void projects.
2. Extract reflected entities and generated members from compiler state, preserving context/instantiation identity rather than inventing symbols from source strings.
3. Implement hover/completion/navigation adapters and virtual-source rendering with source links. Bound value expansion depth and represent cycles, unavailable or opaque values honestly.
4. Provide the same provenance/value representation to indexing, rename and debugging. Generated names with no reliable editable origin remain navigable but not automatically renameable.
## Failure behavior and constraints
Unsupported proposals or compiler limitations produce capability errors, not downgraded lexical answers. Avoid replacing compiler-dependent std::meta facilities with guessed host evaluation. Instantiated/generated source locations may be incomplete; preserve the chain and explicitly indicate gaps.
## Acceptance scenarios
1. Use real Void enum helpers, generated data members, dependent splices, expansion statements and template/module combinations.
2. Verify reflected values, original declaration links, synthesized members and invalid-code recovery across edits.
3. Exercise ambiguous/generated name rename rejection, value cycles/size limits, serialization round trips and stable entity identities within a snapshot.
## Verification and integration
Proposed NEW CTest label: `reflection`. Once implemented, register a nonzero suite and run:
```sh
dev cpp-gcc -c ctest --test-dir build/bootstrap -L reflection --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.
Version the provenance/value schema and invalidate derived index/trace renderers on incompatible changes. Retain source snapshots and mark older unsupported renderings rather than fabricate origins.