Bazel generates a bash completion script.
It would be nice if completions were also generated for fish, a fairly popular shell.
Complete bazel commands and package paths in fish.
Linux
Fish has its own completion syntax, described in the documentation. It has a lot of built-in completions that can be used as examples.
Fish also supports running a script or process to get the completions; see this gcloud completion script for fish in python for an example.
Not expecting this anytime soon, but putting this on the radar with links in case anyone wants to pick it up.
I've got basic completions working in fish. Definitely not a fish expert, so there are probably many improvements to be made to the script, but it works reasonably well so far. Hope it helps!
Thanks, that looks nice!
I'm not a fish user myself so I would appreciate if this is also looked at by one who is.
That's what worries me about the PR. It adds a feature that no on on the Bazel team can maintain.
It's a pity we don't have a keyword auto-triage in github so that the mention of fish automatically assigns it to @tmandry. Something like that would reduce the cost of taking it in.
aiuto@ this is one of the most upvoted issues and the code is not entangled with Bazel itself, so I am willing to merge it and give it a try.
Be my guest.
My secondary concern is why are contributions not needed to build bazel or by all users in the bazel repo rather than a contrib repo. Right now, I can only get these command completion scripts with the debian distro. They should be their own package.
But... we can always fork them off another day.
Are there already plans to create a separate contrib / completions repo? Happy to help fork out the completions if needed.
There are no definite plans. I just keep advocating for trimming the bazlebuild/bazel repo to the bare minimum size it need to be. It is much easier to have community contribution in other repos than in bazel
On the other hand, splitting it up also adds more complexity since we need to figure out any compatibility issues.
This is the kind of stuff that makes Bazel more user friendly and lets people move to Bazel from other build systems. IMHO, stuff like this should be baked into the main repository.
Is this issue fixed?
Yes, I consider it fixed. Any further improvement to fish deserves a new issue.
Most helpful comment
I've got basic completions working in fish. Definitely not a fish expert, so there are probably many improvements to be made to the script, but it works reasonably well so far. Hope it helps!