| Index: pkg/analysis_server/lib/src/search/element_references.dart
|
| diff --git a/pkg/analysis_server/lib/src/search/element_references.dart b/pkg/analysis_server/lib/src/search/element_references.dart
|
| index 0608764419ffbdbde1663dee9ff048d7fa9b4c9e..74c72ef4ba2a86d1e96ecb29ff3842ed2bab81b3 100644
|
| --- a/pkg/analysis_server/lib/src/search/element_references.dart
|
| +++ b/pkg/analysis_server/lib/src/search/element_references.dart
|
| @@ -46,20 +46,19 @@ class ElementReferencesComputer {
|
| * Returns a [Future] completing with a [List] of references to [element] or
|
| * to the corresponding hierarchy [Element]s.
|
| */
|
| - Future<List<SearchResult>> _findElementsReferences(Element element) {
|
| - return _getRefElements(element).then((Iterable<Element> refElements) {
|
| - var futureGroup = new _ConcatFutureGroup<SearchResult>();
|
| - for (Element refElement in refElements) {
|
| - // add declaration
|
| - if (_isDeclarationInteresting(refElement)) {
|
| - SearchResult searchResult = _newDeclarationResult(refElement);
|
| - futureGroup.add(searchResult);
|
| - }
|
| - // do search
|
| - futureGroup.add(_findSingleElementReferences(refElement));
|
| + Future<List<SearchResult>> _findElementsReferences(Element element) async {
|
| + Iterable<Element> refElements = await _getRefElements(element);
|
| + var futureGroup = new _ConcatFutureGroup<SearchResult>();
|
| + for (Element refElement in refElements) {
|
| + // add declaration
|
| + if (_isDeclarationInteresting(refElement)) {
|
| + SearchResult searchResult = _newDeclarationResult(refElement);
|
| + futureGroup.add(searchResult);
|
| }
|
| - return futureGroup.future;
|
| - });
|
| + // do search
|
| + futureGroup.add(_findSingleElementReferences(refElement));
|
| + }
|
| + return futureGroup.future;
|
| }
|
|
|
| /**
|
| @@ -149,9 +148,9 @@ class _ConcatFutureGroup<E> {
|
| */
|
| void add(value) {
|
| if (value is Future) {
|
| - _futures.add(value);
|
| + _futures.add(value as Future<List<E>>);
|
| } else {
|
| - _futures.add(new Future.value(<E>[value]));
|
| + _futures.add(new Future.value(<E>[value as E]));
|
| }
|
| }
|
| }
|
|
|