Closed rpaquay closed 4 years ago
There may be no need for an escape character if it is only interpreted as negation when it is the first character.
@randomascii
Wondering what should be the behavior if user type -foo.bar
(or a list of exclusions only). I see 3 options:
The pattern means include nothing
(implicit) and exclude "foo.bar"
. This implies an always empty result set.
The pattern means include "-foo.bar"
literally, i.e is a way to escape the "-" character
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?
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.
Fixed in (pre)release 0.9.32 (https://github.com/chromium/vs-chromium/releases/tag/v0.9.32)
It works perfectly, and you were correct to go with option number 3. Thanks!
There is already support for multiple file patterns in Code Search, e.g:
It would be nice to have the ability to allow excluding patterns, e.g.
This would mean: include all files named
service*.cc
, except for the ones ending withtest.cc
This also begs the question of the need for an escape character for "-"