Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2382)

Unified Diff: pkg/analysis_server/lib/src/search/element_references.dart

Issue 1842063003: Start making server strong mode clean (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Remove unintended change Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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]));
}
}
}

Powered by Google App Engine
This is Rietveld 408576698