2.9 KiB
14 — Completion, signatures and hover
Status: PLANNED; no implementation claim Requirements: R-011,R-013,R-014 Dependencies: 03,05,09,10,12;15 supplies workspace candidates after its contract freezes.
Ownership and boundaries
Proposed Sol feature adapters; Astra handles compiler-semantic blockers. NEW src/features/completion/, src/features/hover/, tests/completion/, tests/hover/. 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
Completion queries use a position within one immutable document/context and return compiler-proven candidates with replacement ranges, type/signature and provenance. Hover reflects the selected semantic entity/type/value. Workspace index suggestions must be validated against visibility/context rather than treated as binding authority.
Implementation sequence
- Support compiler-native recovery/completion at incomplete expressions, scopes, templates, imports and reflection/splice sites. Preserve the client request position encoding.
- Rank and filter candidates by semantic accessibility, active context, locality and deterministic relevance. Avoid a keyword-only substitute for reflection-generated members.
- Implement documentation/signature/value rendering and deferred completion detail resolution tied to the original candidate identity; bound content and escape editor rendering.
- Measure warm/cold operations on the real corpus, retain warmed compiler state under10's budget, and keep auto-import edits outside initial scope unless separately contracted.
Failure behavior and constraints
Cancelled/stale resolution returns a typed cancelled/stale result rather than details for a different entity. Backend-incomplete states remain visible. Never expose inaccessible module symbols merely because the index contains them.
Acceptance scenarios
- Cover member/scope/template completion, dependent/invalid expressions, reflected/generated members and imported visibility.
- Validate Unicode replacement ranges, stable resolution identities, overload/signature hover and bounded huge values/docs.
- Benchmark warm completion p95 near100ms and hover responsiveness with concurrent background/index/debug work; record hardware and misses.
Verification and integration
Proposed NEW CTest label: completion-hover. Once implemented, register a nonzero suite and run:
dev cpp-gcc -c ctest --test-dir build/bootstrap -L completion-hover --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. Disable optional ranking/detail features while preserving correct compiler candidates. Cache format/identity changes invalidate entries; no stale hover/candidate references survive backend replacement.