I installed deno with brew.
$ brew install deno
...
...
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
zsh completions have been installed to:
/usr/local/share/zsh/site-functions
==> Summary
馃嵑 /usr/local/Cellar/deno/1.0.0: 9 files, 41.7MB
$ deno --version
deno 1.0.0
v8 8.4.300
typescript 3.9.2
$ deno --help
After created /usr/local/etc/zsh_completion.d/:
$ deno completions zsh > /usr/local/etc/zsh_completion.d/deno.zsh
$ source /usr/local/etc/zsh_completion.d/deno.zsh
_arguments:comparguments:325: can only be called from completion function
So how can I add shell completion?
I tried this but get the same output.
$ deno completions zsh > /usr/local/share/zsh/site-functions/_deno
$ source /usr/local/share/zsh/site-functions/_deno
_arguments:comparguments:325: can only be called from completion function
I miss understood the instruction doc
First I should generate zsh autocompletion script then put it in right path.
So what I am confused right now is that
isn't it the install script already said
zsh completions have been installed to:
/usr/local/share/zsh/site-functions
So why bother generate new zsh autocompletion script manually?
If indeed need manually do so, what is the right path to redirect file?
Hi, I got some simlar problem.
After install deno, it mentions:
zsh completions have been installed to:
/usr/local/share/zsh/site-functions
So I try do auto completion as
deno completions zsh > /usr/local/share/zsh/site-functions/_deno@
But it does not match or similar to the instructions of autocompletion for bash
which looks like
deno completions bash > /usr/local/etc/bash_completion.d/deno.bash
source /usr/local/etc/bash_completion.d/deno.bash
And I supposed bash shell autocomplete script should be pretty similar to zsh shell and there should be deno.zsh file ?
Anyone knows the right script for zsh shell for autocomplete feature in deno?
I think brew install deno handles the installing of completions for respective shells automatically. On the other hand, I did a manual install via curl with zsh as my shell.
deno completions zsh > /usr/share/zsh/site-functions/_deno
Running the above line of code was enough and completion is working now.
for me
$ deno completions bash >> ~/.zshrc
is working and I get deno auto completion
I installed deno with brew. The installation output did say that completions have been installed in in /usr/local/share/zsh/site-functions/_deno. I tried restarting the terminal app but still autocomplete is not working.
@leabstrait I tried doing deno completions zsh > /usr/share/zsh/site-functions/_deno, but I get:
zsh: operation not permitted: /usr/share/zsh/site-functions/_deno
Is it safe to change the permissions?
I installed deno with brew. The installation output did say that completions have been installed in in
/usr/local/share/zsh/site-functions/_deno. I tried restarting the terminal app but still autocomplete is not working.@leabstrait I tried doing
deno completions zsh > /usr/share/zsh/site-functions/_deno, but I get:zsh: operation not permitted: /usr/share/zsh/site-functions/_denoIs it safe to change the permissions?
It's because writing into usr/share/zsh/ will need root permission.
Run this as root
# deno completions zsh > /usr/share/zsh/site-functions/_deno
I think this should work.
@leabstrait I forgot to mention that I tried using sudo but still it was giving error. Sorry for a dumb seeming question 馃槄
I was facing this issue on my laptop due to macOS System Integrity Protection.
% sudo deno completions zsh > /usr/share/zsh/site-functions/_deno
zsh: operation not permitted: /usr/share/zsh/site-functions/_deno
It needs to be removed if the above operation needs to be done on a mac. Just in case someone needs: https://stackoverflow.com/questions/32659348/operation-not-permitted-when-on-root-el-capitan-rootless-disabled
/usr/local/share/zsh/site-functions/_deno,deno completions does not work,autoload -U compinit && compinit it works as expected :|,zsh runs autoload -Uz compinit && compinit from settings.zsh (to early, especialy if you're using oh-my-zsh) moving to plugins_after.zsh fixed my issue.For all oh-my-zsh users:
I assume $ZSH points to your ...../.oh-my-zsh/ installation.
The completion script needs to live in the $FPATH.
Ensure that $ZSH/completions is in $FPATH with echo $FPATH. This should be the case by default.
mkdir -p $ZSH/completions
deno completions zsh > $ZSH/completions/_deno
rm -f ~/.zcompdump*
@zemse This should also solve your permissions problem, because there are normally no root permissions required for this approach.
@marekkaczkowski rm the .zcompdump files could solve your problem
Most helpful comment
For all
oh-my-zshusers:I assume $ZSH points to your
...../.oh-my-zsh/installation.The completion script needs to live in the $FPATH.
Ensure that
$ZSH/completionsis in $FPATH withecho $FPATH. This should be the case by default.@zemse This should also solve your permissions problem, because there are normally no root permissions required for this approach.
@marekkaczkowski rm the
.zcompdumpfiles could solve your problem