| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library test.services.src.index.dart_index_contributor; | 5 library test.services.src.index.dart_index_contributor; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/services/index/index.dart'; | 7 import 'package:analysis_server/src/services/index/index.dart'; |
| 8 import 'package:analysis_server/src/services/index/index_contributor.dart'; | 8 import 'package:analysis_server/src/services/index/index_contributor.dart'; |
| 9 import 'package:analysis_server/src/services/index/index_store.dart'; | 9 import 'package:analysis_server/src/services/index/index_store.dart'; |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 void test_NameElement_isDefinedBy_localVariable_inForEach() { | 125 void test_NameElement_isDefinedBy_localVariable_inForEach() { |
| 126 _indexTestUnit(''' | 126 _indexTestUnit(''' |
| 127 class A { | 127 class A { |
| 128 main() { | 128 main() { |
| 129 for (int test in []) { | 129 for (int test in []) { |
| 130 } | 130 } |
| 131 } | 131 } |
| 132 } | 132 } |
| 133 '''); | 133 '''); |
| 134 // prepare elements | 134 // prepare elements |
| 135 Element mainElement = findElement('main'); | |
| 136 LocalVariableElement testElement = findElement('test'); | 135 LocalVariableElement testElement = findElement('test'); |
| 137 Element nameElement = new NameElement('test'); | 136 Element nameElement = new NameElement('test'); |
| 138 // verify | 137 // verify |
| 139 _assertRecordedRelation( | 138 _assertRecordedRelation( |
| 140 nameElement, | 139 nameElement, |
| 141 IndexConstants.NAME_IS_DEFINED_BY, | 140 IndexConstants.NAME_IS_DEFINED_BY, |
| 142 _expectedLocation(testElement, 'test in []')); | 141 _expectedLocation(testElement, 'test in []')); |
| 143 } | 142 } |
| 144 | 143 |
| 145 void test_NameElement_method() { | 144 void test_NameElement_method() { |
| (...skipping 1609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1755 | 1754 |
| 1756 RecordedRelation(this.element, this.relationship, this.location); | 1755 RecordedRelation(this.element, this.relationship, this.location); |
| 1757 | 1756 |
| 1758 @override | 1757 @override |
| 1759 String toString() { | 1758 String toString() { |
| 1760 return 'RecordedRelation(element=$element; relationship=$relationship; ' | 1759 return 'RecordedRelation(element=$element; relationship=$relationship; ' |
| 1761 'location=$location; flags=' '${location.isQualified ? "Q" : ""}' | 1760 'location=$location; flags=' '${location.isQualified ? "Q" : ""}' |
| 1762 '${location.isResolved ? "R" : ""})'; | 1761 '${location.isResolved ? "R" : ""})'; |
| 1763 } | 1762 } |
| 1764 } | 1763 } |
| OLD | NEW |