Files
Language-Server/docs/roadmap/14-completion-hover.md
T
faumaray ca04975d54 bootstrap
Signed-off-by: faumaray <faumaray@gmail.com>
2026-11-25 02:11:19 +03:00

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

  1. Support compiler-native recovery/completion at incomplete expressions, scopes, templates, imports and reflection/splice sites. Preserve the client request position encoding.
  2. Rank and filter candidates by semantic accessibility, active context, locality and deterministic relevance. Avoid a keyword-only substitute for reflection-generated members.
  3. Implement documentation/signature/value rendering and deferred completion detail resolution tied to the original candidate identity; bound content and escape editor rendering.
  4. 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

  1. Cover member/scope/template completion, dependent/invalid expressions, reflected/generated members and imported visibility.
  2. Validate Unicode replacement ranges, stable resolution identities, overload/signature hover and bounded huge values/docs.
  3. 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.