diff --git a/extensions/search-rg/src/cachedSearchProvider.ts b/extensions/search-rg/src/cachedSearchProvider.ts index 201a279123feec341a5531950e8414453783117d..78932b5deb48c212fe8791c16553fa003070bf4f 100644 --- a/extensions/search-rg/src/cachedSearchProvider.ts +++ b/extensions/search-rg/src/cachedSearchProvider.ts @@ -5,9 +5,9 @@ import * as path from 'path'; import * as vscode from 'vscode'; -import * as arrays from './arrays'; -import { compareItemsByScore, IItemAccessor, prepareQuery, ScorerCache } from './fileSearchScorer'; -import * as strings from './strings'; +import * as arrays from './common/arrays'; +import { compareItemsByScore, IItemAccessor, prepareQuery, ScorerCache } from './common/fileSearchScorer'; +import * as strings from './common/strings'; interface IProviderArgs { query: vscode.FileSearchQuery; @@ -119,7 +119,7 @@ export class CachedSearchProvider { const preparedQuery = prepareQuery(args.query.pattern); const compare = (matchA: IInternalFileMatch, matchB: IInternalFileMatch) => compareItemsByScore(matchA, matchB, preparedQuery, true, FileMatchItemAccessor, scorerCache); - return arrays.topAsync(results, compare, args.options.maxResults, 10000); + return arrays.topAsync(results, compare, args.options.maxResults || 10000, 10000); } private getResultsFromCache(cache: Cache, searchValue: string, onResult: (results: IInternalFileMatch) => void): Promise<[IInternalFileMatch[], CacheStats]> { @@ -199,7 +199,7 @@ export class CachedSearchProvider { } }; - provider.provideFileSearchResults(args.query, args.options, { report: onProviderResult }, args.token).then(() => { + provider.provideFileSearchResults(args.query, args.options, { report: onProviderResult }, args.token).then(() => { if (batch.length) { onResult(batch); } diff --git a/extensions/search-rg/src/arrays.ts b/extensions/search-rg/src/common/arrays.ts similarity index 99% rename from extensions/search-rg/src/arrays.ts rename to extensions/search-rg/src/common/arrays.ts index 145ea2fd2a4875230c9581438c19c18955e65f94..d06d185dfa5ee155f96a2a5f0d9624bf15b71da5 100644 --- a/extensions/search-rg/src/arrays.ts +++ b/extensions/search-rg/src/common/arrays.ts @@ -72,4 +72,4 @@ export function findFirstInSorted(array: T[], p: (x: T) => boolean): number { } } return low; -} \ No newline at end of file +} diff --git a/extensions/search-rg/src/charCode.ts b/extensions/search-rg/src/common/charCode.ts similarity index 100% rename from extensions/search-rg/src/charCode.ts rename to extensions/search-rg/src/common/charCode.ts diff --git a/extensions/search-rg/src/comparers.ts b/extensions/search-rg/src/common/comparers.ts similarity index 92% rename from extensions/search-rg/src/comparers.ts rename to extensions/search-rg/src/common/comparers.ts index 1eb9632131d68d855a1ec97aedbcd24cfbef90eb..fc6022526db26d4784a0883461ab99037584a02d 100644 --- a/extensions/search-rg/src/comparers.ts +++ b/extensions/search-rg/src/common/comparers.ts @@ -9,6 +9,13 @@ import * as strings from './strings'; let intlFileNameCollator: Intl.Collator; let intlFileNameCollatorIsNumeric: boolean; +setFileNameComparer(new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' })); + +export function setFileNameComparer(collator: Intl.Collator): void { + intlFileNameCollator = collator; + intlFileNameCollatorIsNumeric = collator.resolvedOptions().numeric; +} + export function compareFileNames(one: string, other: string, caseSensitive = false): number { if (intlFileNameCollator) { const a = one || ''; diff --git a/extensions/search-rg/src/fileSearchScorer.ts b/extensions/search-rg/src/common/fileSearchScorer.ts similarity index 98% rename from extensions/search-rg/src/fileSearchScorer.ts rename to extensions/search-rg/src/common/fileSearchScorer.ts index c2c9d8b68d8ff96a6b215a4b3e3fa7b586fb70a7..d73d7c77f415b716e6c4246d1e96330a47dc0ce4 100644 --- a/extensions/search-rg/src/fileSearchScorer.ts +++ b/extensions/search-rg/src/common/fileSearchScorer.ts @@ -1,7 +1,8 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the MIT License. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + 'use strict'; import { stripWildcards, equalsIgnoreCase } from './strings'; diff --git a/extensions/search-rg/src/filters.ts b/extensions/search-rg/src/common/filters.ts similarity index 100% rename from extensions/search-rg/src/filters.ts rename to extensions/search-rg/src/common/filters.ts diff --git a/extensions/search-rg/src/normalization.ts b/extensions/search-rg/src/common/normalization.ts similarity index 100% rename from extensions/search-rg/src/normalization.ts rename to extensions/search-rg/src/common/normalization.ts diff --git a/extensions/search-rg/src/strings.ts b/extensions/search-rg/src/common/strings.ts similarity index 92% rename from extensions/search-rg/src/strings.ts rename to extensions/search-rg/src/common/strings.ts index a72fd6f4c1940dedb079c7a57595ef45e7f162c2..2678aff1e0f724dcd712623d58596087a9fd2fbe 100644 --- a/extensions/search-rg/src/strings.ts +++ b/extensions/search-rg/src/common/strings.ts @@ -1,7 +1,7 @@ /*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the MIT License. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ 'use strict'; diff --git a/extensions/search-rg/src/extension.ts b/extensions/search-rg/src/extension.ts index 0490b59d9d4085bf90a77d9886a50d0304db4895..079ae5f12158d07c8d73535eff35da0554dd8b5a 100644 --- a/extensions/search-rg/src/extension.ts +++ b/extensions/search-rg/src/extension.ts @@ -17,7 +17,10 @@ export function activate(): void { } class RipgrepSearchProvider implements vscode.SearchProvider { + private cachedProvider: CachedSearchProvider; + constructor(private outputChannel: vscode.OutputChannel) { + this.cachedProvider = new CachedSearchProvider(this.outputChannel); } provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { @@ -26,8 +29,7 @@ class RipgrepSearchProvider implements vscode.SearchProvider { } provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.SearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { - const cachedProvider = new CachedSearchProvider(this.outputChannel); const engine = new RipgrepFileSearch(this.outputChannel); - return cachedProvider.provideFileSearchResults(engine, query, options, progress, token); + return this.cachedProvider.provideFileSearchResults(engine, query, options, progress, token); } } \ No newline at end of file diff --git a/extensions/search-rg/src/ripgrepFileSearch.ts b/extensions/search-rg/src/ripgrepFileSearch.ts index 026238d1a93fa34bee00e572eb40137552b69429..dd0efaa0ed6e887ed952e995b89c7eb402ceeb4b 100644 --- a/extensions/search-rg/src/ripgrepFileSearch.ts +++ b/extensions/search-rg/src/ripgrepFileSearch.ts @@ -7,7 +7,7 @@ import * as cp from 'child_process'; import { Readable } from 'stream'; import { NodeStringDecoder, StringDecoder } from 'string_decoder'; import * as vscode from 'vscode'; -import { normalizeNFC, normalizeNFD } from './normalization'; +import { normalizeNFC, normalizeNFD } from './common/normalization'; import { rgPath } from './ripgrep'; import { anchorGlob } from './ripgrepHelpers'; import { rgErrorMsgForDisplay } from './ripgrepTextSearch'; diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index ff7897f0cb4535b4a6d415fc6153f9d49f289274..e299a3abf1caae997e6ecd6a4670dec88728eac2 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -28,7 +28,7 @@ declare module 'vscode' { excludes: string[]; useIgnoreFiles?: boolean; followSymlinks?: boolean; - maxResults: number; + maxResults?: number; } export interface TextSearchOptions extends SearchOptions { diff --git a/src/vs/workbench/api/electron-browser/mainThreadSearch.ts b/src/vs/workbench/api/electron-browser/mainThreadSearch.ts index 6e692f064b79a96868b6dfc5ffc6410faa9622f3..08e831aa48152145a3b9aab3ab270a83ea2a0b47 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadSearch.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadSearch.ts @@ -42,7 +42,11 @@ export class MainThreadSearch implements MainThreadSearchShape { this._searchProvider.delete(handle); } - $handleFindMatch(handle: number, session, data: UriComponents | IRawFileMatch2[]): void { + $handleFileMatch(handle: number, session, data: UriComponents[]): void { + this._searchProvider.get(handle).handleFindMatch(session, data); + } + + $handleTextMatch(handle: number, session, data: IRawFileMatch2[]): void { this._searchProvider.get(handle).handleFindMatch(session, data); } @@ -134,22 +138,24 @@ class RemoteSearchProvider implements ISearchResultProvider { }); } - handleFindMatch(session: number, dataOrUri: UriComponents | IRawFileMatch2[]): void { + handleFindMatch(session: number, dataOrUri: (UriComponents | IRawFileMatch2)[]): void { if (!this._searches.has(session)) { // ignore... return; } const searchOp = this._searches.get(session); - if (Array.isArray(dataOrUri)) { - dataOrUri.forEach(m => { + dataOrUri.forEach(result => { + if ((result).lineMatches) { searchOp.addMatch({ - resource: URI.revive(m.resource), - lineMatches: m.lineMatches + resource: URI.revive((result).resource), + lineMatches: (result).lineMatches }); - }); - } else { - searchOp.addMatch({ resource: URI.revive(dataOrUri) }); - } + } else { + searchOp.addMatch({ + resource: URI.revive(result) + }); + } + }); } } diff --git a/src/vs/workbench/api/node/extHost.protocol.ts b/src/vs/workbench/api/node/extHost.protocol.ts index 21850c7ed3a96d3793dd785520d9e38fde3d2b30..980fbcefb9ae2955d7c822aea6afca1031558c5e 100644 --- a/src/vs/workbench/api/node/extHost.protocol.ts +++ b/src/vs/workbench/api/node/extHost.protocol.ts @@ -483,7 +483,8 @@ export interface MainThreadFileSystemShape extends IDisposable { export interface MainThreadSearchShape extends IDisposable { $registerSearchProvider(handle: number, scheme: string): void; $unregisterProvider(handle: number): void; - $handleFindMatch(handle: number, session: number, data: UriComponents | IRawFileMatch2[]): void; + $handleFileMatch(handle: number, session: number, data: UriComponents | UriComponents[]): void; + $handleTextMatch(handle: number, session: number, data: IRawFileMatch2[]): void; $handleTelemetry(eventName: string, data: any): void; } diff --git a/src/vs/workbench/api/node/extHostSearch.ts b/src/vs/workbench/api/node/extHostSearch.ts index 9f2baf368a143c41de9138b2e6318b2d9ebbfd5f..57f5e8362ca315719ae0af1e9d6c9fc27f24df99 100644 --- a/src/vs/workbench/api/node/extHostSearch.ts +++ b/src/vs/workbench/api/node/extHostSearch.ts @@ -18,8 +18,6 @@ import { IFileMatch, IFolderQuery, IPatternInfo, IRawFileMatch2, IRawSearchQuery import * as vscode from 'vscode'; import { ExtHostSearchShape, IMainContext, MainContext, MainThreadSearchShape } from './extHost.protocol'; -type OneOrMore = T | T[]; - export interface ISchemeTransformer { transformOutgoing(scheme: string): string; } @@ -67,13 +65,7 @@ export class ExtHostSearch implements ExtHostSearchShape { null, null, progress => { - if (Array.isArray(progress)) { - progress.forEach(p => { - this._proxy.$handleFindMatch(handle, session, p.resource); - }); - } else { - this._proxy.$handleFindMatch(handle, session, progress.resource); - } + this._proxy.$handleFileMatch(handle, session, progress.map(p => p.resource)); }); } @@ -89,7 +81,7 @@ export class ExtHostSearch implements ExtHostSearchShape { null, null, progress => { - this._proxy.$handleFindMatch(handle, session, progress); + this._proxy.$handleTextMatch(handle, session, progress); }); } } @@ -512,16 +504,12 @@ class FileSearchEngine { private includePattern: glob.ParsedExpression; private maxResults: number; private exists: boolean; - // private maxFilesize: number; private isLimitHit: boolean; private resultCount: number; private isCanceled: boolean; private activeCancellationTokens: Set; - // private filesWalked: number; - // private directoriesWalked: number; - private globalExcludePattern: glob.ParsedExpression; constructor(private config: ISearchQuery, private provider: vscode.SearchProvider, private _pfs: typeof pfs) { @@ -529,14 +517,10 @@ class FileSearchEngine { this.includePattern = config.includePattern && glob.parse(config.includePattern); this.maxResults = config.maxResults || null; this.exists = config.exists; - // this.maxFilesize = config.maxFileSize || null; this.resultCount = 0; this.isLimitHit = false; this.activeCancellationTokens = new Set(); - // this.filesWalked = 0; - // this.directoriesWalked = 0; - if (this.filePattern) { this.normalizedFilePatternLowercase = strings.stripWildcards(this.filePattern).toLowerCase(); } @@ -644,7 +628,7 @@ class FileSearchEngine { .then(() => { this.activeCancellationTokens.add(cancellation); return this.provider.provideFileSearchResults( - { cacheKey: this.config.cacheKey, pattern: this.config.filePattern }, + { cacheKey: this.config.cacheKey, pattern: this.config.filePattern || '' }, options, { report: onProviderResult }, cancellation.token); @@ -736,7 +720,6 @@ class FileSearchEngine { const self = this; const filePattern = this.filePattern; function matchDirectory(entries: IDirectoryEntry[]) { - // self.directoriesWalked++; for (let i = 0, n = entries.length; i < n; i++) { const entry = entries[i]; const { relativePath, basename } = entry; @@ -753,7 +736,6 @@ class FileSearchEngine { if (sub) { matchDirectory(sub); } else { - // self.filesWalked++; if (relativePath === filePattern) { continue; // ignore file if its path matches with the file pattern because that is already matched above } @@ -769,25 +751,9 @@ class FileSearchEngine { matchDirectory(rootEntries); } - public getStats(): any { - return null; - // return { - // fromCache: false, - // traversal: Traversal[this.traversal], - // errors: this.errors, - // fileWalkStartTime: this.fileWalkStartTime, - // fileWalkResultTime: Date.now(), - // directoriesWalked: this.directoriesWalked, - // filesWalked: this.filesWalked, - // resultCount: this.resultCount, - // cmdForkResultTime: this.cmdForkResultTime, - // cmdResultCount: this.cmdResultCount - // }; - } - /** * Return whether the file pattern is an absolute path to a file that exists. - * TODO@roblou should use FS provider? + * TODO@roblou delete to match fileSearch.ts */ private checkFilePatternAbsoluteMatch(): TPromise<{ exists: boolean, size?: number }> { if (!this.filePattern || !path.isAbsolute(this.filePattern)) { @@ -859,16 +825,12 @@ class FileSearchManager { constructor(private _pfs: typeof pfs) { } - public fileSearch(config: ISearchQuery, provider: vscode.SearchProvider): PPromise> { + public fileSearch(config: ISearchQuery, provider: vscode.SearchProvider): PPromise { let searchP: PPromise; - return new PPromise>((c, e, p) => { + return new PPromise((c, e, p) => { const engine = new FileSearchEngine(config, provider, this._pfs); searchP = this.doSearch(engine, provider, FileSearchManager.BATCH_SIZE).then(c, e, progress => { - if (Array.isArray(progress)) { - p(progress.map(m => this.rawMatchToSearchItem(m))); - } else if ((progress).relativePath) { - p(this.rawMatchToSearchItem(progress)); - } + p(progress.map(m => this.rawMatchToSearchItem(m))); }); }, () => { if (searchP) { @@ -883,8 +845,8 @@ class FileSearchManager { }; } - private doSearch(engine: FileSearchEngine, provider: vscode.SearchProvider, batchSize?: number): PPromise> { - return new PPromise>((c, e, p) => { + private doSearch(engine: FileSearchEngine, provider: vscode.SearchProvider, batchSize: number): PPromise { + return new PPromise((c, e, p) => { let batch: IInternalFileMatch[] = []; engine.search().then(result => { if (batch.length) { @@ -892,8 +854,7 @@ class FileSearchManager { } c({ - limitHit: result.isLimitHit, - stats: engine.getStats() // TODO@roblou + limitHit: result.isLimitHit }); }, error => { if (batch.length) { @@ -903,14 +864,10 @@ class FileSearchManager { e(error); }, match => { if (match) { - if (batchSize) { - batch.push(match); - if (batchSize > 0 && batch.length >= batchSize) { - p(batch); - batch = []; - } - } else { - p(match); + batch.push(match); + if (batchSize > 0 && batch.length >= batchSize) { + p(batch); + batch = []; } } }); diff --git a/src/vs/workbench/test/electron-browser/api/extHostSearch.test.ts b/src/vs/workbench/test/electron-browser/api/extHostSearch.test.ts index 7cb103589ca5ef2c6642e9d8b61ec0dbd160ad09..5ace3f232cd3df23bf475a058e2d8f02287dc59e 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostSearch.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostSearch.test.ts @@ -155,7 +155,7 @@ suite('ExtHostSearch', () => { test('no results', async () => { await registerTestSearchProvider({ - provideFileSearchResults(options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { + provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { return TPromise.wrap(null); } }); @@ -173,7 +173,7 @@ suite('ExtHostSearch', () => { ]; await registerTestSearchProvider({ - provideFileSearchResults(options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { + provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { reportedResults.forEach(r => progress.report(path.basename(r.fsPath))); return TPromise.wrap(null); } @@ -188,7 +188,7 @@ suite('ExtHostSearch', () => { test('Search canceled', async () => { let cancelRequested = false; await registerTestSearchProvider({ - provideFileSearchResults(options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { + provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { return new TPromise((resolve, reject) => { token.onCancellationRequested(() => { cancelRequested = true; @@ -213,7 +213,7 @@ suite('ExtHostSearch', () => { ]; await registerTestSearchProvider({ - provideFileSearchResults(options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { + provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { reportedResults.forEach(r => progress.report(r)); throw new Error('I broke'); } @@ -229,7 +229,7 @@ suite('ExtHostSearch', () => { test('provider returns null', async () => { await registerTestSearchProvider({ - provideFileSearchResults(options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { + provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { return null; } }); @@ -244,7 +244,7 @@ suite('ExtHostSearch', () => { test('all provider calls get global include/excludes', async () => { await registerTestSearchProvider({ - provideFileSearchResults(options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { + provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { assert(options.excludes.length === 2 && options.includes.length === 2, 'Missing global include/excludes'); return TPromise.wrap(null); } @@ -273,7 +273,7 @@ suite('ExtHostSearch', () => { test('global/local include/excludes combined', async () => { await registerTestSearchProvider({ - provideFileSearchResults(options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { + provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { if (options.folder.toString() === rootFolderA.toString()) { assert.deepEqual(options.includes.sort(), ['*.ts', 'foo']); assert.deepEqual(options.excludes.sort(), ['*.js', 'bar']); @@ -315,7 +315,7 @@ suite('ExtHostSearch', () => { test('include/excludes resolved correctly', async () => { await registerTestSearchProvider({ - provideFileSearchResults(options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { + provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { assert.deepEqual(options.includes.sort(), ['*.jsx', '*.ts']); assert.deepEqual(options.excludes.sort(), []); @@ -358,7 +358,7 @@ suite('ExtHostSearch', () => { ]; await registerTestSearchProvider({ - provideFileSearchResults(options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { + provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { reportedResults.forEach(r => progress.report(r)); return TPromise.wrap(null); } @@ -389,7 +389,7 @@ suite('ExtHostSearch', () => { test('multiroot sibling exclude clause', async () => { await registerTestSearchProvider({ - provideFileSearchResults(options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { + provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { let reportedResults; if (options.folder.fsPath === rootFolderA.fsPath) { reportedResults = [ @@ -460,7 +460,7 @@ suite('ExtHostSearch', () => { let wasCanceled = false; await registerTestSearchProvider({ - provideFileSearchResults(options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { + provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { reportedResults.forEach(r => progress.report(path.basename(r.fsPath))); token.onCancellationRequested(() => wasCanceled = true); @@ -497,7 +497,7 @@ suite('ExtHostSearch', () => { let wasCanceled = false; await registerTestSearchProvider({ - provideFileSearchResults(options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { + provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { reportedResults.forEach(r => progress.report(path.basename(r.fsPath))); token.onCancellationRequested(() => wasCanceled = true); @@ -533,7 +533,7 @@ suite('ExtHostSearch', () => { let wasCanceled = false; await registerTestSearchProvider({ - provideFileSearchResults(options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { + provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { reportedResults.forEach(r => progress.report(path.basename(r.fsPath))); token.onCancellationRequested(() => wasCanceled = true); @@ -564,7 +564,7 @@ suite('ExtHostSearch', () => { test('multiroot max results', async () => { let cancels = 0; await registerTestSearchProvider({ - provideFileSearchResults(options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { + provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { token.onCancellationRequested(() => cancels++); // Provice results async so it has a chance to invoke every provider @@ -610,7 +610,7 @@ suite('ExtHostSearch', () => { ]; await registerTestSearchProvider({ - provideFileSearchResults(options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { + provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { reportedResults.forEach(r => progress.report(path.basename(r.fsPath))); return TPromise.wrap(null); } @@ -642,7 +642,7 @@ suite('ExtHostSearch', () => { ]; await registerTestSearchProvider({ - provideFileSearchResults(options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { + provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, progress: vscode.Progress, token: vscode.CancellationToken): Thenable { reportedResults.forEach(r => progress.report(path.basename(r.fsPath))); return TPromise.wrap(null); }