zsh-yarn-completions icon indicating copy to clipboard operation
zsh-yarn-completions copied to clipboard

Autocompletion for file paths and available .bin commands

Open kachkaev opened this issue 3 years ago โ€ข 1 comments

๐Ÿ‘‹ @chrisands, great plugin!

Sorry if Iโ€™m repeating someone elseโ€™s question but I wonder if it is possible to support these two autocompletion sources:

  1. CLI commands added by installed modules, e.g.

    yarn install ts-node
    yarn ts[tab] โ†’ yarn ts-node
    
  2. Local file path, e.g.

    yarn install ts-node
    yarn ts[tab] โ†’ yarn ts-node
    yarn ts-node scr[tab] โ†’ yarn ts-node scripts/
    yarn ts-node scripts/d[tab] โ†’ yarn ts-node scripts/do-something.ts
    

    Alternative use, if ts-node --transpile-only is aliased as exe in package.json โ†’ scripts:

    yarn ex[tab] โ†’ yarn exe
    yarn exe scr[tab] โ†’ yarn exe scripts/
    yarn exe scripts/d[tab] โ†’ yarn exe scripts/do-something.ts
    

Thanks a lot for your work! Autocompletion for scripts and workspaces works like a charm! โœจ

kachkaev avatar Nov 03 '21 13:11 kachkaev

Thanks! Yes, I think it is possible. Maybe complete from .bin only if the command from yarn wasn't matched so we won't parse every time .bin directory.

chrisands avatar Dec 07 '21 13:12 chrisands