What landed #48

Merged
navicore merged 1 commit from completion-improvements into main 2026-07-05 02:20:35 +00:00
Owner

Command completion — a :-prefixed line (that isn't the :- directive) now
completes against REPL command names instead of predicates. :l→:list/:load,
:e→:edit, bare :→Tab offers all commands. Completion returns canonical names
(never aliases), so :l yields list/load, not ls.

Stdlib completion (the append/3 gap) — predicate completion now draws on
builtins + the embedded stdlib + session predicates. append, member, length,
reverse, nth0, nth1, last all complete without the user defining them.

Files

  • crates/repl/src/session.rs — CommandSpec + COMMANDS const as the single
    source; parse_meta refactored to resolve against it.
  • crates/frontend/src/lib.rs — new stdlib_predicates() -> &'static [(String,
    usize)] (OnceLock-cached, parses STDLIB_PL).
  • crates/repl/src/completion.rs — new command_candidates(); candidates() now
    folds in stdlib names.
  • crates/repl/src/app.rs — complete() dispatches via a factored-out pure
    completion_mode(text) -> Mode.
  • docs/repl-guide.md — completion bullet updated (now accurate + documents the
    behavior and the cycling-is-planned note).
  • docs/design/done/REPL_TAB_COMPLETION.md — decision record.

Tests (+12, 511 total, all green; fmt + clippy clean)

  • command_candidates by prefix / empty-prefix-all / canonical-not-aliases
  • candidates includes the 7 stdlib predicates + prefix filtering
  • COMMANDS↔parse_meta sync (every canonical + alias resolves correctly;
    unknown → Unknown)
  • completion_mode: :→Command, :-→Predicate, ?-/plain→Predicate
  • stdlib_predicates includes (append,3)/(member,2) etc., and is cached/stable
Command completion — a :-prefixed line (that isn't the :- directive) now completes against REPL command names instead of predicates. :l→:list/:load, :e→:edit, bare :→Tab offers all commands. Completion returns canonical names (never aliases), so :l yields list/load, not ls. Stdlib completion (the append/3 gap) — predicate completion now draws on builtins + the embedded stdlib + session predicates. append, member, length, reverse, nth0, nth1, last all complete without the user defining them. Files - crates/repl/src/session.rs — CommandSpec + COMMANDS const as the single source; parse_meta refactored to resolve against it. - crates/frontend/src/lib.rs — new stdlib_predicates() -> &'static [(String, usize)] (OnceLock-cached, parses STDLIB_PL). - crates/repl/src/completion.rs — new command_candidates(); candidates() now folds in stdlib names. - crates/repl/src/app.rs — complete() dispatches via a factored-out pure completion_mode(text) -> Mode. - docs/repl-guide.md — completion bullet updated (now accurate + documents the : behavior and the cycling-is-planned note). - docs/design/done/REPL_TAB_COMPLETION.md — decision record. Tests (+12, 511 total, all green; fmt + clippy clean) - command_candidates by prefix / empty-prefix-all / canonical-not-aliases - candidates includes the 7 stdlib predicates + prefix filtering - COMMANDS↔parse_meta sync (every canonical + alias resolves correctly; unknown → Unknown) - completion_mode: :→Command, :-→Predicate, ?-/plain→Predicate - stdlib_predicates includes (append,3)/(member,2) etc., and is cached/stable
What landed
All checks were successful
WASM Gates / WASM gates (Tier 1 wasi + Tier 2 reactor) (pull_request) Successful in 28s
CI - Linux / CI - Linux x86_64 (pull_request) Successful in 1m31s
811a9bf9dd
Command completion — a :-prefixed line (that isn't the :- directive) now
 completes against REPL command names instead of predicates. :l→:list/:load,
 :e→:edit, bare :→Tab offers all commands. Completion returns canonical names
 (never aliases), so :l yields list/load, not ls.

 Stdlib completion (the append/3 gap) — predicate completion now draws on
 builtins + the embedded stdlib + session predicates. append, member, length,
 reverse, nth0, nth1, last all complete without the user defining them.

 Files

 - crates/repl/src/session.rs — CommandSpec + COMMANDS const as the single
   source; parse_meta refactored to resolve against it.
 - crates/frontend/src/lib.rs — new stdlib_predicates() -> &'static [(String,
   usize)] (OnceLock-cached, parses STDLIB_PL).
 - crates/repl/src/completion.rs — new command_candidates(); candidates() now
   folds in stdlib names.
 - crates/repl/src/app.rs — complete() dispatches via a factored-out pure
   completion_mode(text) -> Mode.
 - docs/repl-guide.md — completion bullet updated (now accurate + documents the
   : behavior and the cycling-is-planned note).
 - docs/design/done/REPL_TAB_COMPLETION.md — decision record.

 Tests (+12, 511 total, all green; fmt + clippy clean)

 - command_candidates by prefix / empty-prefix-all / canonical-not-aliases
 - candidates includes the 7 stdlib predicates + prefix filtering
 - COMMANDS↔parse_meta sync (every canonical + alias resolves correctly;
   unknown → Unknown)
 - completion_mode: :→Command, :-→Predicate, ?-/plain→Predicate
 - stdlib_predicates includes (append,3)/(member,2) etc., and is cached/stable
navicore deleted branch completion-improvements 2026-07-05 02:20:35 +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!48
No description provided.