Files
Language-Server/docs/roadmap/03-documents-positions.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
2.9 KiB
Markdown

# 03 — Versioned documents, positions and overlays
Status: Implemented and tested through stdio and the 17-case document suite. Integrated review and performance evidence are tracked separately.
Requirements: R-006,R-011
Dependencies: 02; shared revision identity with05 and09 before semantic integration.
## Ownership and boundaries
Proposed Sol package: NEW include/vls/documents/, src/documents/, tests/documents/. Root owns shared revision schema.
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
DocumentSnapshot contains URI, immutable bytes, version/content identity and line/encoding map. DocumentStore accepts open/change/close and returns snapshots. UTF-16 is the LSP default; negotiated UTF-8 is explicit. A snapshot's positions and text never refer to different revisions.
## Implementation sequence
1. Normalize URI identity without confusing encoded separators, symlinks or platform path spelling; retain display URI separately. Establish workspace ownership from04.
2. Implement ordered incremental edits against the exact preceding version, including multiple edits in one notification; keep old snapshots alive for outstanding requests.
3. Maintain line indexes and UTF-8/UTF-16 conversion with Void Unicode primitives; validate boundaries, CRLF and non-BMP characters without splitting scalars.
4. Expose overlay reads to compiler workers and dependency snapshots. Close releases the live overlay but does not invalidate references to immutable completed snapshots.
## Failure behavior and constraints
Reject impossible ranges and nonmonotonic changes; mark the document desynchronized until full replacement or reopen instead of guessing content. Do not fabricate a standard LSP request for resynchronization. Missing disk data and invalid encoding remain typed readiness failures.
## Acceptance scenarios
1. Round-trip positions across ASCII, combining characters, astral code points, CRLF, empty final lines and mixed edits.
2. Race edits/close with snapshot acquisition and prove every consumer sees a coherent revision.
3. Test malformed ranges, stale notifications, URI aliases, reopen and full-text recovery; benchmark large-file edit/index updates.
## Verification and integration
Proposed NEW CTest label: `documents`. Once implemented, register a nonzero suite and run:
```sh
dev cpp-gcc -c ctest --test-dir build/bootstrap -L documents --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.
Keep version/store changes behind the document interface. Invalidate derived caches on encoding/identity policy changes; never overwrite user buffers to repair state.