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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify
_describeis the correct Zsh completion function for branches without descriptions.The code uses
_describe 'branch names' all_optionsto suggest branches, but_describeis typically used when the array has "value:description" entries (like the commands array at lines 7-21). Since branch names lack descriptions,_valuesmay be more appropriate or even direct completion via array expansion. Verify this is correct against the Zsh completion API.If correction is needed, replace line 34 with:
🌐 Web query:
💡 Result:
Use the value:description form. _describe expects the first array to contain entries like "completion:description" (or a first array of value:description and a second parallel array of the actual values). Plain arrays without colon are allowed but won’t supply per-item descriptions. [1][2]
Sources:
[1] zshcompsys manual (man page) — description of _describe and the "completion:description" array format.
[2] Arch/Ubuntu zshcompsys man pages — same explanation and examples.
Based on the search results, examples in Zsh completion documentation show
_valuesused with plain arrays as_values 'profiles' $(_netctl_profiles), confirming this is the idiomatic approach for plain arrays without descriptions. The original review's concern is valid—while_describeallows plain arrays, it won't supply per-item descriptions and is semantically designed for "value:description" entries.Use
_valuesinstead of_describefor branch name completion at line 34.This is a code quality improvement. Replace with:
📝 Committable suggestion
🤖 Prompt for AI Agents