Index: pkg/analyzer/test/src/dart/analysis/search_test.dart |
diff --git a/pkg/analyzer/test/src/dart/analysis/search_test.dart b/pkg/analyzer/test/src/dart/analysis/search_test.dart |
index 8872ebd28c6c8ac2d7cf3f217c42ff1d728e8d59..e473ffc15d4b64fa589c9faed7731e3c3ce72665 100644 |
--- a/pkg/analyzer/test/src/dart/analysis/search_test.dart |
+++ b/pkg/analyzer/test/src/dart/analysis/search_test.dart |
@@ -38,6 +38,7 @@ class ExpectedResult { |
result.isResolved == this.isResolved && |
result.isQualified == this.isQualified && |
result.offset == this.offset && |
+ result.length == this.length && |
result.enclosingElement == this.enclosingElement; |
} |
@@ -510,6 +511,34 @@ main() { |
await _verifyReferences(element, expected); |
} |
+ test_searchReferences_PrefixElement() async { |
+ String partCode = r''' |
+part of my_lib; |
+ppp.Future c; |
+'''; |
+ provider.newFile(_p('$testProject/my_part.dart'), partCode); |
+ await _resolveTestUnit(''' |
+library my_lib; |
+import 'dart:async' as ppp; |
+part 'my_part.dart'; |
+main() { |
+ ppp.Future a; |
+ ppp.Stream b; |
+} |
+'''); |
+ PrefixElement element = _findElementAtString('ppp;'); |
+ Element a = _findElement('a'); |
+ Element b = _findElement('b'); |
+ Element c = findChildElement(testLibraryElement, 'c'); |
+ var expected = [ |
+ _expectId(a, SearchResultKind.REFERENCE, 'ppp.Future'), |
+ _expectId(b, SearchResultKind.REFERENCE, 'ppp.Stream'), |
+ new ExpectedResult(c, SearchResultKind.REFERENCE, |
+ partCode.indexOf('ppp.Future c'), 'ppp'.length) |
+ ]; |
+ await _verifyReferences(element, expected); |
+ } |
+ |
test_searchReferences_PropertyAccessorElement_getter() async { |
await _resolveTestUnit(''' |
class A { |