eliben / pss

pss is a power-tool for searching inside source code files.
Other
327 stars 46 forks source link

Listing "all" file types should include regex matches #2

Closed eliben closed 11 years ago

eliben commented 11 years ago

When running:

pss PATTERN

I expect to search in all files recognized by pss, but it seems that only those with TypeValue.EXTENSION are searched. TypeValue.PATTERN files should also appear.

eliben commented 11 years ago

There is a slight design problem in FileFinder which causes this (and related) problem. FileFinder currently understands two separate concepts: extensions and patterns. The relationship between them is AND. To be found, a file has to first match the extensions and then match the pattern. In other words, patterns are used as originally designed - for the -G flag and for IGNORED_DIRS.

But since types are now regexes as well as actual extensions, a different model is required. Regex types should not go into FileFinder's "file patterns", because they're treated as OR with each other.

Possible FileFinder should also accept typed "extensions" which can be regexes.

eliben commented 11 years ago

Fixed in trunk.