Volta: Completions for zsh is not working

Created on 11 Jul 2019  路  6Comments  路  Source: volta-cli/volta

Completions for zsh are not working propperly.
I'm getting the following output on my zsh startup script related to the loading of the source <(volta completions zsh):
_arguments:comparguments:325: can only be called from completion function

Using [email protected] on MacOS Mojave with [email protected] (x86_64-apple-darwin18.2.0)

bug

All 6 comments

Thanks for reporting this! One of us will try to dig in soon!

As a bit of help for us, and just to double check: you're running exactly the command source <(volta completions zsh)? What happens if you save them to a file and then source that as part of your .zshrc? (Trying to see if this is a function of sourcing it this way vs. outputting to a file.)

I've done exactly this and the behavior is the same.
If you think it would help I could make a gist with my entire config without the sensitive data and link here tomorrow.

But there's plenty of scripts being loaded in there and I don't know if it would be easy to isolate the problem from it

No worries, I think it鈥檚 unlikely that鈥檚 the issue, but if we can鈥檛 otherwise reproduce it we鈥檒l ask! It鈥檚 more likely there鈥檚 an issue in either our code or the upstream dependency which we use to generate the completions!

I'm having the same problem when sourcing the completion script, I get this error:

_arguments:comparguments:319: can only be called from completion function

I've got the same issue on Zorin OS 15 and Ubuntu 18.04

I was able to reproduce this on my Mac. Based on some discussion in this issue https://github.com/kubernetes-sigs/kind/issues/522, while unrelated to how we generate completions, it looks like zsh takes a different approach to completions. Instead of sourcing the generated script directly, you save it to a file named _volta in the fpath. On my machine, I can do:

volta completions zsh > /usr/local/share/zsh/site-functions/_volta

And then the completions appear to work. That said, there are still some issues with the generated completions, at least I ran into an issue where doing volta list and then hitting tab caused an error:

volta list (eval):1: command not found: all
_arguments:453: command not found: ,

So there's still something that's not being fully generated correctly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

elwayman02 picture elwayman02  路  4Comments

mikrostew picture mikrostew  路  5Comments

jhford picture jhford  路  6Comments

chriskrycho picture chriskrycho  路  4Comments

dherman picture dherman  路  5Comments