Closed evanunderscore closed 6 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
d696194
) 81.12% compared to head (6095cde
) 81.12%. Report is 1 commits behind head on develop.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@evanunderscore as far as I know, we can't source the file directly (at least not without making our installation process a lot less general). Zsh has no default facility to source completion scripts at startup - instead it scans the first lines of these files for compdef declarations. The actual scripts are sourced on demand according to those declarations.
By the way, we will be facing something similar with bash soon. Bash completion v1 (which is what we use for global completion installation) sources entire scripts, but it's deprecated. Bash completion v2 uses a similar lazy-load pattern that does not allow registering a global completion fallback (complete -D
, which is what we use).
We could always use the alternative strategy of telling the user to source the file directly in their rc script, but that's not a systemwide installation method and it's brittle in other ways.
Testing this branch now.
Testing looks good, I agree this approach seems to be the best.
Released in v3.2.0.
This fixes zsh global completion breakage introduced in #463, and updates the test to use a similar method as
activate-global-python-argcomplete
for zsh.The zsh global completion script was previously mixing paradigms; it seems that you are supposed to use a file with a
#compdef
comment which is autoloaded, or manually callcompdef
yourself. I've updated this to only use the#compdef
comment, but it does feel like everything would be simpler if we went the other way and sourced the file directly as we do with bash. The only catch with that is we would probably have to append this to~/.zshrc
instead of~/.zshenv
since we needcompdef
to be available, and it seems undesirable toautoload compdef
on the user's behalf.