⏺ Done — 10 tests pass (new predicate_names test included), clippy -D warnings #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "completion"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
and fmt clean.
What changed:
user has defined or declared — clause heads (facts and rule heads, via
Term::functor_arity) plus :- dynamic declarations (from ProgramDirectives) —
resolved to names, sorted and deduped. It reuses the real parser (no shadow
logic), and degrades to empty on a mid-edit parse error.
&preds) instead of the empty slice. So Tab completes session-defined predicates
alongside builtins/stdlib.
Concretely, after defining parent/2 and ancestor/2, typing anc now
completes to ancestor — previously it only worked if the name happened to
collide with a builtin/stdlib predicate. The test pins exactly this: a buffer
of a fact + a rule + a :- dynamic decl + a 0-arity fact yields ["ancestor",
"extra", "parent", "test"].
This closes review #3 (PR #8 checkpoint 7) — completion now covers builtins +
stdlib + buffer predicates, which is the full set the design called for. It
also confirms the value of the per-clause buffer landing first: extracting
predicate names was a clean parse-and-resolve, no string heuristics.
The parked list is now down to :edit (suspend → $EDITOR → recompile) and
;-paging for multiple solutions whenever you want them.