Files
Language-Server/docs/roadmap/07-compilation-database.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.0 KiB
Markdown

# 07 — Compilation-database compatibility provider
Status: The importer and compatibility provider pass their focused tests. Actual native and CMake command databases retain their alternatives, original command forms and repeated flags. The LSP session integration is being verified.
Requirements: R-007,R-009,R-010
Dependencies: 04,05; may implement in parallel with06 after shared model freeze.
## Ownership and boundaries
Proposed Sol: NEW src/build/compdb/, include/vls/build/compdb/, tests/build/compdb/ and fixtures. No writes to database producer.
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
Read directory/file/arguments or command and optional output per the official schema. Prefer arguments, preserve multiple entries, resolve relative operands against directory, and retain original provenance. Compiler-specific response-file expansion is bounded and contributes content identity. No shell evaluation.
## Implementation sequence
1. Parse complete JSON through bounded ingestion, validate known field types and preserve extra fields without pretending they are standard build metadata.
2. Implement POSIX command tokenization for the Linux release and explicit driver selection; reject unsupported quoting/dialects rather than guess shell semantics.
3. Normalize known driver flags, recursively expand response files with cycle/depth/byte limits, then classify execution-bearing options under04.
4. Observe replacement/content changes, publish a complete new provider generation and retain the previous one as stale on errors. Provide explicit database/alternative selection.
## Failure behavior and constraints
Missing files, malformed JSON/commands, ambiguous driver dialect, unavailable response files and execution-bearing flags yield contextual errors. Native target/module/environment/readiness data absent from the schema stays unknown. Invalid explicit VBS selection does not silently switch to an unrelated database.
## Acceptance scenarios
1. Cover paths/spaces/Unicode/quotes, arguments preference, command escapes, multiple entries, relative directories and optional output.
2. Test nested/cyclic/changed response files and plugin/wrapper markers without any shell execution.
3. Test atomic replacements, partial writes, file deletion and deterministic alternative selection with real CMake-exported fixtures.
## Verification and integration
Proposed NEW CTest label: `compdb`. Once implemented, register a nonzero suite and run:
```sh
dev cpp-gcc -c ctest --test-dir build/bootstrap -L compdb --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.
Provider selection can return to the last verified database generation with stale status. Never rewrite a user-owned compile_commands.json or normalize it in place.