Repository navigation
Add expected type guidance to shtab zsh completions - #1024
Merged
Merged
Conversation
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryAdds expected-type messages to zsh completions for typed arguments and subclass parameters.
Reviews (1) · Last reviewed commit: "Add expected type guidance to shtab zsh ..." · Reviewed by Greptile |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1024 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 27 27
Lines 9950 9962 +12
=========================================
+ Hits 9950 9962 +12 ☔ View full report in Codecov by Harness. |
This branch was successfully deployed
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.



What does this PR do?
Brings the expected type guidance of
shtabbash completions to zsh. When completing a value, zsh now shows a message likeExpected type: bool | Noneabove the choices, formatted with the user'sdescriptionsstyle if one is configured. This covers options, positionals, subclass selection and subclassinit_args, the last of these saying which subclasses accept them. For types that also accept values other than the choices, e.g.nullforint | None, the choices are listed but not inserted until a prefix is typed, same as in bash.It also fixes zsh completion script generation, which failed with
TypeError: vars() argument must have __dict__ attributefor parsers that have subcommands added withouthelp.Before submitting