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

Unified Diff: pkg/analysis_server/test/search/element_references_test.dart

Issue 2518183003: Stop returning declaration matches from search for references. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « pkg/analysis_server/lib/src/search/element_references.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/search/element_references_test.dart
diff --git a/pkg/analysis_server/test/search/element_references_test.dart b/pkg/analysis_server/test/search/element_references_test.dart
index a1c7003dceae1fdb39a113412e8548e6c511651d..ac60cfb561364d4c07f61e261ccd834de2c6db53 100644
--- a/pkg/analysis_server/test/search/element_references_test.dart
+++ b/pkg/analysis_server/test/search/element_references_test.dart
@@ -153,8 +153,7 @@ main(A a) {
''');
await findElementReferences('fff; // declaration', false);
expect(searchElement.kind, ElementKind.FIELD);
- expect(results, hasLength(11));
- assertHasResult(SearchResultKind.DECLARATION, 'fff; // declaration');
+ expect(results, hasLength(10));
assertHasResult(SearchResultKind.WRITE, 'fff); // in constructor');
assertHasResult(SearchResultKind.WRITE, 'fff = 1;');
// m()
@@ -216,8 +215,7 @@ class A {
''');
await findElementReferences('fff); // in constructor', false);
expect(searchElement.kind, ElementKind.FIELD);
- expect(results, hasLength(4));
- assertHasResult(SearchResultKind.DECLARATION, 'fff; // declaration');
+ expect(results, hasLength(3));
assertHasResult(SearchResultKind.WRITE, 'fff); // in constructor');
assertHasResult(SearchResultKind.WRITE, 'fff = 2;');
assertHasResult(SearchResultKind.READ, 'fff); // in m()');
@@ -257,9 +255,6 @@ main() {
''');
await findElementReferences('fff; // in B', false);
expect(searchElement.kind, ElementKind.FIELD);
- assertHasResult(SearchResultKind.DECLARATION, 'fff; // in A');
- assertHasResult(SearchResultKind.DECLARATION, 'fff; // in B');
- assertHasResult(SearchResultKind.DECLARATION, 'fff; // in C');
assertHasResult(SearchResultKind.WRITE, 'fff = 10;');
assertHasResult(SearchResultKind.WRITE, 'fff = 20;');
assertHasResult(SearchResultKind.WRITE, 'fff = 30;');
@@ -326,8 +321,7 @@ myLabel:
''');
await findElementReferences('myLabel; // break', false);
expect(searchElement.kind, ElementKind.LABEL);
- expect(results, hasLength(3));
- assertHasResult(SearchResultKind.DECLARATION, 'myLabel:');
+ expect(results, hasLength(2));
assertHasResult(SearchResultKind.REFERENCE, 'myLabel; // continue');
assertHasResult(SearchResultKind.REFERENCE, 'myLabel; // break');
}
@@ -344,8 +338,7 @@ main() {
''');
await findElementReferences('vvv = 1', false);
expect(searchElement.kind, ElementKind.LOCAL_VARIABLE);
- expect(results, hasLength(5));
- assertHasResult(SearchResultKind.DECLARATION, 'vvv = 1');
+ expect(results, hasLength(4));
assertHasResult(SearchResultKind.READ, 'vvv);');
assertHasResult(SearchResultKind.READ_WRITE, 'vvv += 3');
assertHasResult(SearchResultKind.WRITE, 'vvv = 2');
@@ -426,8 +419,7 @@ main(ppp) {
''');
await findElementReferences('ppp) {', false);
expect(searchElement.kind, ElementKind.PARAMETER);
- expect(results, hasLength(5));
- assertHasResult(SearchResultKind.DECLARATION, 'ppp) {');
+ expect(results, hasLength(4));
assertHasResult(SearchResultKind.READ, 'ppp);');
assertHasResult(SearchResultKind.READ_WRITE, 'ppp += 3');
assertHasResult(SearchResultKind.WRITE, 'ppp = 2');
@@ -594,8 +586,7 @@ main() {
expect(searchElement.kind, ElementKind.PREFIX);
expect(searchElement.name, 'ppp');
expect(searchElement.location.startLine, 1);
- expect(results, hasLength(3));
- assertHasResult(SearchResultKind.DECLARATION, 'ppp;');
+ expect(results, hasLength(2));
assertHasResult(SearchResultKind.REFERENCE, 'ppp.Future');
assertHasResult(SearchResultKind.REFERENCE, 'ppp.Stream');
}
@@ -612,8 +603,7 @@ main() {
''');
await findElementReferences('vvv = 1', false);
expect(searchElement.kind, ElementKind.TOP_LEVEL_VARIABLE);
- expect(results, hasLength(5));
- assertHasResult(SearchResultKind.DECLARATION, 'vvv = 1;');
+ expect(results, hasLength(4));
assertHasResult(SearchResultKind.READ, 'vvv);');
assertHasResult(SearchResultKind.WRITE, 'vvv += 3');
assertHasResult(SearchResultKind.WRITE, 'vvv = 2');
« no previous file with comments | « pkg/analysis_server/lib/src/search/element_references.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698