refactor: Extract builtin completions from hardcoded array #214
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
refactor
rust
technical-debt
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
navicore/patch-seq#214
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem
crates/repl/src/app.rs(lines 1327-1535) contains a 200+ element hardcoded array of builtin word names for completions:Impact
Related Issues
This is closely related to the stack effects extraction issue - both should ideally share a single source of truth for builtin words.
Proposed Solution
Option 1: Generate from compiler
The compiler already knows all builtins. Export this list and consume it in the REPL:
Option 2: External data file
Build-time codegen creates both compiler definitions and REPL completions.
Option 3: Query LSP for completions
If the LSP server already provides completions, remove the hardcoded fallback entirely and rely on LSP.
Files Affected
crates/repl/src/app.rs(lines 1327-1535)crates/compiler/src/builtins.rs(new)Acceptance Criteria
Labels
refactor, technical-debt, medium-priority
https://github.com/navicore/patch-seq/pull/220