-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
alias
rule run bash completion
#22347
Comments
Initial impression: For this to be technically possible, |
I see. So basically we would need to know when doing the completion if the alias'ed thing is executable, so by default we assume that it isn't? If this is the case, might it be more useful to assume that it is, so that completion happens? |
Essentially. The completion script is not fancy. When you type
Sounds like you want to disable that simple heuristic. We could but then I think we'd get GH issues in the opposite direction: "Why is Bazel's bash completion suggesting things that don't work?". I'd be open to the script conditionally doing what you want, controlled by an environment variable (default being the current behavior). Footnotes
|
Understood, thank you. My reasoning for assuming aliases are executable by default is simply to err on the side of listing targets (when you actually try to run it, Bazel will complain), but I understand that this is not always desired. If it helps, my envisioned use case is a |
In case it's useful for you: I'm working on a small ruleset that gives you a Bazel-managed PATH entry to launch tools from. |
Description of the bug:
Alias rule targets aren't available in bash completion for
bazel run
, only forbazel build
.[BASH] For example, with the setup below, typing
bazel build //tool: <TAB>
provides autocomplete forbazel build //tool:venv
, but typingbazel run //tool: <TAB>
does not.Which category does this issue belong to?
Core
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
In
//tool/BUILD.bazel
:In
//tool/development/BUILD.bazel
:Which operating system are you running Bazel on?
Ubuntu
What is the output of
bazel info release
?release 7.1.1
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse HEAD
?Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
No response
Have you found anything relevant by searching the web?
No
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: