gradle-completion
gradle-completion copied to clipboard
Basic installation doesn't work on macOS with zsh
❯ brew install gradle-completion
❯ echo $fpath | grep "/usr/local/share/zsh/site-functions"
/Users/zsweers/.oh-my-zsh/plugins/git /Users/zsweers/.oh-my-zsh/functions /Users/zsweers/.oh-my-zsh/completions /usr/local/share/zsh/site-functions /usr/share/zsh/site-functions /usr/share/zsh/5.7.1/functions
cd <our project>
❯ source ~/.zsh/gradle-completion/_gradle 1>&2 2>/dev/null; __gradle-completion-init
zsh: command not found: __gradle-completion-init
~/.zsh/gradle-completion
doesn't exist, is there some undocumented intermediary step required?
Try quitting Terminal and re-opening it. This was a required step that I had to do to get it to work properly.
The issue is that the manual install step would put the _gradle
file in this spot: ~/.zsh/gradle-completion/_gradle
. However, running brew install gradle-completion
puts the file in /usr/local/share/zsh/site-functions/_gradle
.
So if you run source /usr/local/share/zsh/site-functions/_gradle 1>&2 2>/dev/null; __gradle-completion-init
. Then it'll work.
I ran into this same issue :).
Edit: Running ./gradlew
I am getting this error
% source /usr/local/share/zsh/site-functions/_gradle
_gradle:6: command not found: _arguments
__gradle_tasks:20: command not found: _describe
After which I can't get autocomplete working following the above steps or the troubleshooting steps in readme 😞
I'm running into the same problem! Is homebrew not the recommended way to install gradle-completion
?
just add following snippet to your .zshrc
if [ $commands[brew] ]
then
fpath=("$(brew --prefix)/share/zsh/site-functions" $fpath)
fi
see https://docs.brew.sh/Shell-Completion#configuring-completions-in-zsh