705
706
constructor(config: ISearchQuery, folderQuery: IFolderQuery) {
707
>
const globOptions = config.ignoreGlobCase || folderQuery.ignoreGlobCase ? { ignoreCase: true } : undefined;
search.ts
708
>
709
>
// todo: try to incorporate folderQuery.excludePattern.folder if available
710
>
this._excludeExpression = folderQuery.excludePattern?.map(excludePattern => {
711
return {
712
...(config.excludePattern || {}),
713
...(excludePattern.pattern || {})
714
} satisfies glob.IExpression;
716
>
717
>
if (this._excludeExpression.length === 0) {
718
// even if there are no folderQueries, we want to observe the global excludes
719
this._excludeExpression = [config.excludePattern || {}];
720
}
722
>
this._parsedExcludeExpression = this._excludeExpression.map(e => glob.parse(e, globOptions));
723
>
724
>
// Empty includeExpression means include nothing, so no {} shortcuts
725
>
let includeExpression: glob.IExpression | undefined = config.includePattern;
726
>
if (folderQuery.includePattern) {
727
if (includeExpression) {
728
includeExpression = {