Done. Tab cycling implemented, tested, documented, and the design doc moved to #50

Merged
navicore merged 1 commit from repl-completion-cycling into main 2026-07-05 03:11:15 +00:00
Owner

done/.

What landed

  • CompletionState { base, candidates, idx } added to App (sibling to Paging).
    I dropped the prefix field the design sketched — it was flagged as
    non-load-bearing ("retained only to document"), and keeping a write-only
    field would trip the dead_code lint. base + candidates[idx] is all the cycle
    needs.
  • complete() rewritten: if a session is active and the line still equals the
    last-applied candidate, advance idx (wrap to 0) and reapply; otherwise
    compute fresh candidates (command or predicate via completion_mode), apply
    the first, and stash the session. Empty-candidate Tab is a no-op (no session
    created).
  • handle_key clears the session on any non-Tab key — the load-bearing
    correctness guard so cycling can never apply to edited text. (Cursor moves,
    typing, submit, cancel, Ctrl-C/D all end the cycle.)
  • Works uniformly for command and predicate modes.

Files

  • crates/repl/src/app.rs — CompletionState, the completion field, the non-Tab
    clear, the cycling complete(), + 5 tests.
  • docs/repl-guide.md — completion bullet updated ("repeated Tab cycles… any
    other key ends the cycle").
  • docs/design/done/REPL_COMPLETION_CYCLING.md — decision record.

Tests (+5, 516 total, all green; fmt + clippy clean)

  • :l → :list → :load → wraps to :list
  • predicate cycling (atom → advances through
    atom/atom_chars/atom_concat/atom_length)
  • non-Tab key (cursor move) ends the cycle (session dropped)
  • empty-candidate Tab (:zzz) is a no-op, no session
  • edit-after-Tab recomputes from scratch (:l→:list, then :e→:edit)
done/. What landed - CompletionState { base, candidates, idx } added to App (sibling to Paging). I dropped the prefix field the design sketched — it was flagged as non-load-bearing ("retained only to document"), and keeping a write-only field would trip the dead_code lint. base + candidates[idx] is all the cycle needs. - complete() rewritten: if a session is active and the line still equals the last-applied candidate, advance idx (wrap to 0) and reapply; otherwise compute fresh candidates (command or predicate via completion_mode), apply the first, and stash the session. Empty-candidate Tab is a no-op (no session created). - handle_key clears the session on any non-Tab key — the load-bearing correctness guard so cycling can never apply to edited text. (Cursor moves, typing, submit, cancel, Ctrl-C/D all end the cycle.) - Works uniformly for command and predicate modes. Files - crates/repl/src/app.rs — CompletionState, the completion field, the non-Tab clear, the cycling complete(), + 5 tests. - docs/repl-guide.md — completion bullet updated ("repeated Tab cycles… any other key ends the cycle"). - docs/design/done/REPL_COMPLETION_CYCLING.md — decision record. Tests (+5, 516 total, all green; fmt + clippy clean) - :l → :list → :load → wraps to :list - predicate cycling (atom → advances through atom/atom_chars/atom_concat/atom_length) - non-Tab key (cursor move) ends the cycle (session dropped) - empty-candidate Tab (:zzz) is a no-op, no session - edit-after-Tab recomputes from scratch (:l→:list, then :e→:edit)
Done. Tab cycling implemented, tested, documented, and the design doc moved to
All checks were successful
WASM Gates / WASM gates (Tier 1 wasi + Tier 2 reactor) (pull_request) Successful in 9s
CI - Linux / CI - Linux x86_64 (pull_request) Successful in 1m2s
918d843bd0
done/.

 What landed

 - CompletionState { base, candidates, idx } added to App (sibling to Paging).
   I dropped the prefix field the design sketched — it was flagged as
   non-load-bearing ("retained only to document"), and keeping a write-only
   field would trip the dead_code lint. base + candidates[idx] is all the cycle
   needs.
 - complete() rewritten: if a session is active and the line still equals the
   last-applied candidate, advance idx (wrap to 0) and reapply; otherwise
   compute fresh candidates (command or predicate via completion_mode), apply
   the first, and stash the session. Empty-candidate Tab is a no-op (no session
   created).
 - handle_key clears the session on any non-Tab key — the load-bearing
   correctness guard so cycling can never apply to edited text. (Cursor moves,
   typing, submit, cancel, Ctrl-C/D all end the cycle.)
 - Works uniformly for command and predicate modes.

 Files

 - crates/repl/src/app.rs — CompletionState, the completion field, the non-Tab
   clear, the cycling complete(), + 5 tests.
 - docs/repl-guide.md — completion bullet updated ("repeated Tab cycles… any
   other key ends the cycle").
 - docs/design/done/REPL_COMPLETION_CYCLING.md — decision record.

 Tests (+5, 516 total, all green; fmt + clippy clean)

 - :l → :list → :load → wraps to :list
 - predicate cycling (atom → advances through
   atom/atom_chars/atom_concat/atom_length)
 - non-Tab key (cursor move) ends the cycle (session dropped)
 - empty-candidate Tab (:zzz) is a no-op, no session
 - edit-after-Tab recomputes from scratch (:l→:list, then :e→:edit)
navicore deleted branch repl-completion-cycling 2026-07-05 03:11:15 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
navicore/patch-prolog!50
No description provided.