-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Autocompletion not filling dependencies #4552
Comments
Stages are not auto-completed because of a missing functionality #3743 required for that. Not completing deps is indeed a bug, looks like we are missing Line 67 in 1ca2dc1
https://github.com/iterative/dvc/blob/master/dvc/command/run.py for deps. So we just need to
to make that work. |
Hello @efiop, This is a friendly ping, how is this going? The error persist in the latest releases. Best, |
@geblanco No progress so far. We would be glad to accept a contribution though 🙂 |
@efiop following your guide, here is the fixed code. I have further considerations (I can contribute on that also), also for the run command:
Could it be reasonable to autocomplete in the same way (with FILE/DIR autocompletion?). Both could benefit from autocompleting with already created files/directories. Lastly, the ultimate part of the run command is the actual command/script to run. Is there any way in |
@geblanco Thank you so much for the PR! 🙏 Indeed, those I don't think shtab supports command completion yet 🙁 But could probably be done somehow, not sure about the complexity there though. CC @casperdcl |
|
@efiop okay, I will add two commits to the PR, one for fixing outputs and another for parameters. Is it okay to fill the latter with filenames even though parameters can be outside files? @casperdcl I'm not entirely sure what you mean by whitelist or blacklist completions, I understand the concept but have no idea how it translates into code, also, is there any example of a wrapped |
Yeah, that's okay for now, as we don't even have a command to aid the listing of params in the file, so that will do for now. Thank you! |
@geblanco going off on a tangent, but I mean this sort of thing. Perhaps could be mentioned in def add_argument_wrapper(func, default=shtab.FILE):
@functools.wraps(func)
def inner(*args, **kwargs):
func(*args, **kwargs).complete = default
return inner
add_argument = add_argument_wrapper(parser.add_argument)
# parser.add_argument("-s", "--such-fun", ...).complete = shtab.FILE # old way
add_argument("-s", "--such-fun", ...) # new way |
Okay, I see... Pretty nice library |
Bug Report
Please provide information about your setup
Output of
dvc version
:Additional Information (if any):
I am using zsh, when trying tab-autocompletion for
run
command, it does not fill anything for dependencies.Also, when trying
repro
command, stages do not get offered either, just files and directories in the cwd.Steps to reproduce: I don't think this is a project specific bug, so probably a fresh start could do.
The text was updated successfully, but these errors were encountered: