fix(complete): derive command completion from the runtime builtin table - #663
Merged
Conversation
Interactive completion built its builtin candidates from builtin_names_sorted(), the bash-compatible LISTING view (compgen -b, `enable', complete -A builtin) that deliberately omits gnash's own `personality' -- so the builtin never TAB-completed. Completion (and command_is_valid highlighting) now use the dispatchable view: the full runtime table plus personality-conditional names (zsh's `emulate'), minus `enable -n'd builtins. The bash-compatible listings are unchanged. Closes #662
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TAB completion never offered the
personalitybuiltin (user report).command_completions()sourced its builtin candidates frombuiltin_names_sorted()— the bash-compatible listing view that deliberately omitspersonalitysocompgen -b/complete -A builtin/enablestay byte-identical to bash. Reusing the filtered listing for interactive completion silently dropped gnash's own builtin.Closes #662
Changes
core/src/builtins.cpp: completion candidates now come from adispatchable_builtin_names(sh)view — the full runtime builtin table (what dispatch actually accepts), plus personality-conditional names (emulateunder the zsh personality), minusenable -n'd builtins. A builtin added to the table is completable with no second list to update.command_is_valid(syntax highlighting) recognizes zsh-modeemulatetoo. The bash-compatible listings are untouched.tests/command_complete_test.cpp: assertspersonalitycompletes,emulatecompletes exactly when the zsh personality is active, and the listing exclusion still holds.Verification
gnash_command_completion) calls; ctest 23/23.compgen -bstill omitspersonality(bash byte-compat preserved);complete/builtins/typescoreboard suites all 0; run_diff 525/525.