mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 19:48:09 +00:00
Revert "Fix rawSearchService to handle maxResults=0 correctly"
This reverts commit 5f36b0ea9a
.
This commit is contained in:
parent
bfa3db2f07
commit
191ecb92f8
2 changed files with 1 additions and 20 deletions
|
@ -254,7 +254,7 @@ export class SearchService implements IRawSearchService {
|
|||
const query = prepareQuery(config.filePattern || '');
|
||||
const compare = (matchA: IRawFileMatch, matchB: IRawFileMatch) => compareItemsByScore(matchA, matchB, query, true, FileMatchItemAccessor, scorerCache);
|
||||
|
||||
const maxResults = typeof config.maxResults === 'number' ? config.maxResults : Number.MAX_VALUE;
|
||||
const maxResults = config.maxResults || Number.MAX_VALUE;
|
||||
return arrays.topAsync(results, compare, maxResults, 10000, token);
|
||||
}
|
||||
|
||||
|
|
|
@ -185,25 +185,6 @@ suite('RawSearchService', () => {
|
|||
assert.strictEqual(result.results.length, 1, 'Result');
|
||||
});
|
||||
|
||||
test('Handles maxResults=0 correctly', async function () {
|
||||
this.timeout(testTimeout);
|
||||
const service = new RawSearchService();
|
||||
|
||||
const query: IFileQuery = {
|
||||
type: QueryType.File,
|
||||
folderQueries: MULTIROOT_QUERIES,
|
||||
maxResults: 0,
|
||||
sortByScore: true,
|
||||
includePattern: {
|
||||
'*.txt': true,
|
||||
'*.js': true
|
||||
},
|
||||
};
|
||||
|
||||
const result = await DiskSearch.collectResultsFromEvent(service.fileSearch(query));
|
||||
assert.strictEqual(result.results.length, 0, 'Result');
|
||||
});
|
||||
|
||||
test('Multi-root with include pattern and exists', async function () {
|
||||
this.timeout(testTimeout);
|
||||
const service = new RawSearchService();
|
||||
|
|
Loading…
Reference in a new issue