fix: complete repeated variadic args - #753
Conversation
c74cc7f to
1dc3293
Compare
📝 WalkthroughWalkthroughCompletion now selects the next unfinished positional argument using parsed variadic state, respects ChangesVariadic completion
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Shell
participant complete_word
participant ParseOutput
participant SpecArg
Shell->>complete_word: request completion
complete_word->>ParseOutput: inspect parsed values
complete_word->>SpecArg: select next completable argument
SpecArg-->>complete_word: return missing or available variadic argument
complete_word-->>Shell: return candidates or file completion
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR corrects dynamic completion selection for repeated variadic positional arguments.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (3): Last reviewed commit: "chore: run render" | Re-trigger Greptile |
1dc3293 to
7881839
Compare
Summary
This fixes completions for repeated variadic positional arguments after the first value has already been entered.
complete-wordused the number of parsed positional entries to decide which positional argument to complete next.That works for normal positionals, but not for variadic args as all values for the repeated args are stored under single positional entry. After typing one value, the arg was incorrectly marked done and fell back to file completions.
The fix checks the parsed value for each positional arg instead. If the arg is variadic and has not reached
var_max, it keeps using the same arg's completer. Ifvar_maxis reached, it moves on and normal fallback behavior applies.Also added regression tests for the same.
Related
Validation
mise run test -- complete_word_variadicmise run testSummary by CodeRabbit
Bug Fixes
Tests
Documentation