g-plane / zsh-yarn-autocompletions

Zsh plugin for Yarn autocompletions.
MIT License
578 stars 18 forks source link

Not working - shows file autocomplete instead #21

Closed anna-sunberg closed 4 years ago

anna-sunberg commented 4 years ago

Is there any way to debug the plugin? If I type yarn run and press tab, I get a list of files in the directory. ~:projects:frontend 2020-04-28 10-23-03

I've installed the latest version, my .zshrc contains plugins=(git yarn-autocompletions) and there's no error when I start the shell.

g-plane commented 4 years ago

How did you install it?

anna-sunberg commented 4 years ago

Manually by running ./install.sh $ZSH_CUSTOM/plugins. It's in the correct folder. I think I'd get an error when opening the shell if a plugin is not found.

g-plane commented 4 years ago

You're using oh-my-zsh, right?

anna-sunberg commented 4 years ago

Yes

g-plane commented 4 years ago

Can you show me the output of command ls $ZSH_CUSTOM/yarn-autocompletions?

anna-sunberg commented 4 years ago

It's not in $ZSH_CUSTOM, but in $ZSH_CUSTOM/plugins

ls $ZSH_CUSTOM/plugins/yarn-autocompletions
yarn-autocompletions            yarn-autocompletions.plugin.zsh
g-plane commented 4 years ago

It's not in $ZSH_CUSTOM, but in $ZSH_CUSTOM/plugins

ls $ZSH_CUSTOM/plugins/yarn-autocompletions
yarn-autocompletions            yarn-autocompletions.plugin.zsh

Oh, that's right. There's a typo in my last comment.

kevinrodriguez-io commented 4 years ago

I'm having the exact same issue after running the install command as listed on the README.md

Plugin Release:

2.0.0 for macOS (I'm using oh-my-zsh)

$ ./install.sh $ZSH_CUSTOM/plugins

And after adding it to :

plugins=(
  # ... your other plugins
+ yarn-autocompletions
)

I wonder if there's another plugin causing conflicts:

plugins=(
  git
  nvm
  npm
  vscode
  osx
  command-not-found
  docker
  bgnotify
  yarn-autocompletions
)
anna-sunberg commented 4 years ago

I tried disabling all other plugins except for yarn-autocompletions and it didn't make a difference

g-plane commented 4 years ago

There shouldn't be conflicts with other plugins.

anna-sunberg commented 4 years ago

Do you have any ideas what could be wrong? Any ways to debug the plugin?

bamboo5 commented 4 years ago
No idea , just play around,please send photo for contact. Sent from Mail for Windows 10 From: Anna OsipovaSent: Thursday, April 30, 2020 8:45 AMTo: g-plane/zsh-yarn-autocompletionsCc: SubscribedSubject: Re: [g-plane/zsh-yarn-autocompletions] Not working - shows file autocomplete instead (#21) Do you have any ideas what could be wrong? Any ways to debug the plugin?—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe. 
g-plane commented 4 years ago

Do you have any ideas what could be wrong? Any ways to debug the plugin?

Try running this: $ZSH_CUSTOM/plugins/yarn-autocompletions/yarn-autocompletions add then show me the output.

anna-sunberg commented 4 years ago

First time I tried that it gave me the MacOS "cannot be open" dialog. Monosnap+2020-04-30+12-11-25

I gave it access in System Preferences and thought that would fix it, but it still doesn't work! It works when I run it (although not with run command), but not when I type and press tab.

anna@Annas-MBP: ~:projects:frontend 2020-04-30 14-25-31

g-plane commented 4 years ago

That's weird. However, I'm not able to make it verified, and I'm not a macOS user so I'm not familiar with that. Sorry.

anna-sunberg commented 4 years ago

As I said, I fixed the security warning, so that's not an issue anymore. See the second screenshot for output from running $ZSH_CUSTOM/plugins/yarn-autocompletions/yarn-autocompletions add

g-plane commented 4 years ago

How about using a zsh plugin manager like zinit or zplug?

anna-sunberg commented 4 years ago

Tried zplug, no luck anna@Annas-MBP: :usr:local:opt:zplug:repos:g-plane:zsh-yarn-autocompletions 2020-04-30 15-41-30

nguymin4 commented 4 years ago

I created a PR to fix this issue. I encountered it when setting up new release Ubuntu 20.04. Please look at the PR for explanation.

To check if the completion works then you can press Ctrl+x h. Currently it shows Screenshot from 2020-05-01 13-57-56 that's why it will display files and folders in the current directory.

If the completion is loaded correctly then actually it should show nothing.

adi518 commented 4 years ago

No solution? it still doesn't work (mac).

GodOfGrandeur commented 4 years ago

I can confirm I have this exact same issue too using the latest release. I get the same output as listed above when I run the commands and same output from the debugging steps.

adi518 commented 4 years ago

@GodOfGrandeur Author doesn't use a Mac so it was never tested on it to work. In another issue, someone posted a plugin that does work, see: https://github.com/chrisands/zsh-yarn-completions.

GodOfGrandeur commented 4 years ago

Hi @adi518

I might try spend some time and see if I can get this working on a mac. I really wanted this for the completion on the yarn run command which the library you linked doesn't seem support so looks like a dead end to me.

adi518 commented 4 years ago

I'm on Catalina and it works just fine. I tried everything with this plugin and reached a dead end.

gbiryukov commented 4 years ago

installing ohmyzsh fixed the issue for me. maybe it is essential for experienced users of zsh but this dependency is not obvious for newbies

Chaoste commented 3 years ago

I have the same issue on MacOs Catalina (10.15.7) with a freshly installed system:

➜ $ yarn add
tags in context :completion::complete:yarn::
    globbed-files  (_files _default)
DanielOrtel commented 3 years ago

FYI, you can manually allow this. Once you see the message appear(you have to have the message appear first), go to the Security and Privacy settings -> General -> and under Allow apps dowloaded from there are two toggles, and under it apps that the firewall blocked. You can allow yarn-autocompletions from there.