src/vs/workbench/services/search/common/textSearchManager.ts/TextSearchManager/searchInFolder
class TextSearchManager:	private async searchInFolder(folderQuery: IFolderQuery<URI>, onResult: (result: TextSearchResult) => void, token: CancellationToken): Promise<TextSearchComplete | null | undefined> {
		const queryTester = new QueryGlobTester(this.query, folderQuery);
		const testingPs: Promise<void>[] = [];
		const progress = {
			report: (result: TextSearchResult) => {
				if (!this.validateProviderResult(result)) {
					return;
				}

				const hasSibling = folderQuery.folder.scheme === Schemas.file ?
					glob.hasSiblingPromiseFn(() => {
						return this.fileUtils.readdir(resources.dirname(result.uri));
					}) :
					undefined;

				const relativePath = resources.relativePath(folderQuery.folder, result.uri);
				if (relativePath) {
					testingPs.push(
						queryTester.includedInQuery(relativePath, path.basename(relativePath), hasSibling)
							.then(included => {
								if (included) {
									onResult(result);
								}
							}));
				}
			}
		};

		const searchOptions = this.getSearchOptionsForFolder(folderQuery);
		const result = await this.provider.provideTextSearchResults(patternInfoToQuery(this.query.contentPattern), searchOptions, progress, token);
		await Promise.all(testingPs);
		return result;
	}