提交 c64d97d9 编写于 作者: R Rob Lourens

EH search - fix lost error messages when multiple search providers are run

上级 a015dc90
...@@ -121,17 +121,20 @@ export class SearchService implements ISearchService { ...@@ -121,17 +121,20 @@ export class SearchService implements ISearchService {
// TODO@roblou this is not properly waiting for search-rg to finish registering itself // TODO@roblou this is not properly waiting for search-rg to finish registering itself
if (this.searchProvider.length) { if (this.searchProvider.length) {
return TPromise.join(this.searchProvider.map(p => searchWithProvider(p))) return TPromise.join(this.searchProvider.map(p => searchWithProvider(p)))
.then(complete => { .then(completes => {
complete = complete.filter(c => !!c); completes = completes.filter(c => !!c);
if (!complete.length) { if (!completes.length) {
return null; return null;
} }
return <ISearchComplete>{ return <ISearchComplete>{
limitHit: complete[0] && complete[0].limitHit, limitHit: completes[0] && completes[0].limitHit,
stats: complete[0].stats, stats: completes[0].stats,
results: arrays.flatten(complete.map(c => c.results)) results: arrays.flatten(completes.map(c => c.results))
}; };
}, errs => {
errs = errs.filter(e => !!e);
return TPromise.wrapError(errs[0]);
}); });
} else { } else {
return searchWithProvider(this.diskSearch); return searchWithProvider(this.diskSearch);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册