Search provider - clean up file index search, remove PPromise

This commit is contained in:
Rob Lourens
2018-07-26 11:20:59 -07:00
parent d36a3d2395
commit 28fd1cc007
2 changed files with 93 additions and 169 deletions

View File

@@ -80,14 +80,14 @@ export class ExtHostSearch implements ExtHostSearchShape {
const provider = this._fileSearchProvider.get(handle);
const query = reviveQuery(rawQuery);
if (provider) {
return this._fileSearchManager.fileSearch(query, provider, progress => {
this._proxy.$handleFileMatch(handle, session, progress.map(p => p.resource));
return this._fileSearchManager.fileSearch(query, provider, batch => {
this._proxy.$handleFileMatch(handle, session, batch.map(p => p.resource));
});
} else {
const indexProvider = this._fileIndexProvider.get(handle);
if (indexProvider) {
return this._fileIndexSearchManager.fileSearch(query, indexProvider, progress => {
this._proxy.$handleFileMatch(handle, session, progress.map(p => p.resource));
return this._fileIndexSearchManager.fileSearch(query, indexProvider, batch => {
this._proxy.$handleFileMatch(handle, session, batch.map(p => p.resource));
});
} else {
throw new Error('something went wrong');