Skip to content
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

Tab completion for targets when on the command line #169

Open
thoughtpolice opened this issue Apr 15, 2023 · 2 comments
Open

Tab completion for targets when on the command line #169

thoughtpolice opened this issue Apr 15, 2023 · 2 comments

Comments

@thoughtpolice
Copy link
Contributor

It would be awesome if buck2 could, on the command line, auto-complete the name of a target given a target pattern prefix such as path/to/module: (completing any target in the BUCK file) or path/to/library:foo (anything with a name prefix of foo). I often find myself wanting this.

I am not sure how much "work" is necessary to resolve all the names in 100% of cases, but it seems like a in theory BUCK files can be parsed for their target outputs without actually constructing the action graph, right? If you can just iterate every name field on every rule in the file, that's probably a good start.

@thoughtpolice thoughtpolice changed the title Tab completion for targets when Tab completion for targets when on the command line Apr 15, 2023
@ndmitchell
Copy link
Contributor

Completely agreed! I would imagine you want to race parsing the Starlark file for name = ... entries and actually run the Starlark code in the equivalent of buck2 targets, and if after 0.5s you don't have the real stuff, you use the Starlark file data. We've had this as an internal request for some time, often being a "nice to have", but never becoming a "we'll do it now". Volunteers most welcome.

@davidbarsky
Copy link
Contributor

For what it's worth, I think this might be blocked on clap-rs/clap#1232.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants