Fix #59922 - changes needed to support a cache in a FileSearchProvider

This commit is contained in:
Rob Lourens
2018-12-03 16:19:26 -08:00
parent 682d684944
commit 6f9b2d7593
5 changed files with 42 additions and 11 deletions

View File

@@ -552,9 +552,9 @@ export class FileIndexSearchManager {
});
}
public clearCache(cacheKey: string): Promise<void> {
public clearCache(cacheKey: string): void {
if (!this.folderCacheKeys.has(cacheKey)) {
return Promise.resolve(undefined);
return undefined;
}
const expandedKeys = this.folderCacheKeys.get(cacheKey);
@@ -562,7 +562,7 @@ export class FileIndexSearchManager {
this.folderCacheKeys.delete(cacheKey);
return Promise.resolve(undefined);
return undefined;
}
private preventCancellation<C>(promise: CancelablePromise<C>): CancelablePromise<C> {

View File

@@ -158,9 +158,10 @@ export class ExtHostSearch implements ExtHostSearchShape {
this._internalFileSearchProvider.clearCache(cacheKey);
}
// Actually called once per provider.
// Only relevant to file index search.
return this._fileIndexSearchManager.clearCache(cacheKey);
this._fileSearchManager.clearCache(cacheKey);
this._fileIndexSearchManager.clearCache(cacheKey);
return Promise.resolve(undefined);
}
$provideTextSearchResults(handle: number, session: number, rawQuery: IRawTextQuery, token: CancellationToken): Thenable<ISearchCompleteStats> {