vivaxy / alfred-open-in-vscode

Alfred workflow to open in VSCode
GNU General Public License v3.0
36 stars 4 forks source link

feat: support glob pattern for wds #11

Closed younho9 closed 3 years ago

younho9 commented 3 years ago

Support glob pattern wds using already imported fast-glob library.

Previously, to search inside directory I had to register with wds as follows:

/Users/younho9/repositories/temp,
/Users/younho9/repositories/github,
/Users/younho9/repositories/github/organization,
/Users/younho9/repositories/github/private,
/Users/younho9/repositories/github/public,
/Users/younho9/repositories/company,
/Users/younho9/repositories/company/foo,
/Users/younho9/repositories/company/bar,
/Users/younho9/repositories/company/baz,
...

Now, I can reduce wds as follows.

/Users/younho9/repositories/*
/Users/younho9/repositories/github/*,
/Users/younho9/repositories/company/*,

⚠️ warning: If a pattern like '*/' is used, it can be extremely slow. (ex. Search all folders inside the node_modules folder.)

resolve #10

vivaxy commented 3 years ago

What if /Users/younho9/repositories/* contains some folder that you don't what to search? Is it possible to have exclude rules configured?

vivaxy commented 3 years ago

Released v1.1.0. Thank you @younho9!

younho9 commented 3 years ago

What if /Users/younho9/repositories/* contains some folder that you don't what to search? Is it possible to have exclude rules configured?

Then I think the whole wds needs to be a glob pattern list to do so. like .gitignore

/Users/younho9/repositories/*
!/Users/younho9/repositories/excluded

Also, I would suggest output wds list, not searching inside wds. How about doing this?

vivaxy commented 3 years ago

Also, I would suggest output wds list, not searching inside wds. How about doing this?

That's a good idea. wds is badly named and not intuitive to understand. Configuring the target folders' glob is a better way.

The ignore pattern seems to be supported by fast-glob.