deno: zsh completion is broken

Getting this error:

/usr/local/etc/zsh_completion.d/deno.zsh:478: no matches found: _deno__[SCRIPT]_commands

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 24 (12 by maintainers)

Commits related to this issue

Most upvoted comments

@meSingh try the following commands:

mkdir ~/.oh-my-zsh/custom/plugins/deno
deno completions zsh > ~/.oh-my-zsh/custom/plugins/deno/_deno

After this add deno plugin under plugins tag in .zshrc file.

@vinschess @meSingh please be aware that oh-my-zsh !== zsh. There are people (albeit few I assume) who are using zsh without the framework behind it. They won’t have access to the plugin mechanism. The documentation should imo:

  • most importantly: provide a way to make it work in plain zsh (still unclear to me)
  • optionally, provide a way for oh-my-zsh

for people who are using antigen like I am, the process remains the same, just change the path to ~/.antigen/bundles/robbyrussell/oh-my-zsh/plugins instead of ~/.oh-my-zsh and then add antigen bundle deno to the .zshrc to load the plugin. enjoy!

In case somebody comes across this issue from a search, I am using antigen and followed these instructions and was still getting the following error: “No such file or directory: …/.antigen/bundles/robbyrussell/oh-my-zsh/cache//completions/_deno”. I needed to create the $ZSH_CACHE_DIR/completions directory manually as per https://github.com/ohmyzsh/ohmyzsh/issues/10728#issuecomment-1129786095 to get things working.

for people who are using antigen like I am, the process remains the same, just change the path to ~/.antigen/bundles/robbyrussell/oh-my-zsh/plugins instead of ~/.oh-my-zsh and then add antigen bundle deno to the .zshrc to load the plugin. enjoy!

zsh completions seem to be working as expected with 1.9.2. Here are clear instructions to set up completions for modern shells (including zsh): https://deno.land/manual@v1.9.2/getting_started/setup_your_environment#shell-autocomplete.

I think we can close this issue.

Related https://github.com/denoland/deno/issues/5326

I’m currently not able to get deno completions to work:

deno completions zsh > /tmp/deno_zsh
source /tmp/deno_zsh
>>> _arguments:comparguments:312: can only be called from completion function
deno completions bash > /tmp/deno_bash
source /tmp/deno_bash
>>> /tmp/deno_bash:649: command not found: complete

Both run with: zsh 5.1.1 (x86_64-ubuntu-linux-gnu) deno 1.0.5

It’s working in bash, but I’m not terribly inclined to switch tbh =)

@bartlomieju could this be some kind of regression bug?

Any help much appreciated!

@bartlomieju I have just checked, it works now!