Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for excluding filenames for searches #55

Closed
rpaquay opened this issue Feb 6, 2020 · 5 comments
Closed

Add support for excluding filenames for searches #55

rpaquay opened this issue Feb 6, 2020 · 5 comments
Assignees

Comments

@rpaquay
Copy link
Contributor

rpaquay commented Feb 6, 2020

There is already support for multiple file patterns in Code Search, e.g:

service_directory.cc;service_directory_client.cc

It would be nice to have the ability to allow excluding patterns, e.g.

service*.cc;-*test.cc

This would mean: include all files named service*.cc, except for the ones ending with test.cc

This also begs the question of the need for an escape character for "-"

@randomascii
Copy link

There may be no need for an escape character if it is only interpreted as negation when it is the first character.

@rpaquay
Copy link
Contributor Author

rpaquay commented Feb 7, 2020

@randomascii

Wondering what should be the behavior if user type -foo.bar (or a list of exclusions only). I see 3 options:

  1. The pattern means include nothing (implicit) and exclude "foo.bar". This implies an always empty result set.

  2. The pattern means include "-foo.bar" literally, i.e is a way to escape the "-" character

  3. The pattern means include everything except for files named -foo.bar. Basically, we add an implicit * when there are only exclusions.

Option 1 sounds silly. Option 2 is a weird way to escape the "-" character. I think option 3 is the most intuitive.

Thoughts?

@rpaquay rpaquay self-assigned this Feb 7, 2020
@randomascii
Copy link

I'm not sure it matters to much. Option 1 isn't useful, but it is consistent and not harmful. Option 3 would be fine, and is probably better.

rpaquay added a commit that referenced this issue Feb 10, 2020
rpaquay added a commit that referenced this issue Feb 10, 2020
@rpaquay
Copy link
Contributor Author

rpaquay commented Feb 12, 2020

Fixed in (pre)release 0.9.32 (https://github.com/chromium/vs-chromium/releases/tag/v0.9.32)

tcwz pushed a commit to tcwz/vs-chromium that referenced this issue Feb 14, 2020
tcwz pushed a commit to tcwz/vs-chromium that referenced this issue Feb 14, 2020
@randomascii
Copy link

It works perfectly, and you were correct to go with option number 3. Thanks!

rpaquay added a commit that referenced this issue Jun 9, 2020
@rpaquay rpaquay closed this as completed Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants