[Fix] Bazel zsh autocompletion on `run`
This fix stops `:all` being added to autocomplete with `run`. This issue is that `target_type` can be `bin` `test` or `build` and is mistakenly gated on `run`.
Closes #11614.
PiperOrigin-RevId: 317702079
diff --git a/scripts/zsh_completion/_bazel b/scripts/zsh_completion/_bazel
index 827ce54..c34c572 100644
--- a/scripts/zsh_completion/_bazel
+++ b/scripts/zsh_completion/_bazel
@@ -164,7 +164,7 @@
;;
esac
completions=(${$(_bazel_b query "kind(\"${rule_re}\", ${pkg}:all)" 2>/dev/null)##*:})
- if ( (( ${#completions} > 0 )) && [[ $target_type != run ]] ); then
+ if ( (( ${#completions} > 0 )) && [[ $target_type != bin ]] ); then
completions+=(all)
fi
echo ${completions[*]}