| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'package:analysis_server/src/services/index2/index2.dart'; | 5 import 'package:analysis_server/src/services/index2/index2.dart'; |
| 6 import 'package:analyzer/dart/ast/ast.dart'; | 6 import 'package:analyzer/dart/ast/ast.dart'; |
| 7 import 'package:analyzer/dart/element/element.dart'; | 7 import 'package:analyzer/dart/element/element.dart'; |
| 8 import 'package:analyzer/src/generated/source.dart'; | 8 import 'package:analyzer/src/generated/source.dart'; |
| 9 import 'package:analyzer/src/summary/idl.dart'; | 9 import 'package:analyzer/src/summary/idl.dart'; |
| 10 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 10 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 } | 161 } |
| 162 main(A a, p) { | 162 main(A a, p) { |
| 163 a.test(); // a-inv-r-q | 163 a.test(); // a-inv-r-q |
| 164 a.test = 1; // a-ref-r-q | 164 a.test = 1; // a-ref-r-q |
| 165 a.test += 2; // a-ref-r-q | 165 a.test += 2; // a-ref-r-q |
| 166 print(a.test); // a-ref-r-q | 166 print(a.test); // a-ref-r-q |
| 167 p.test(); // p-inv-ur-q | 167 p.test(); // p-inv-ur-q |
| 168 p.test = 1; // p-ref-ur-q | 168 p.test = 1; // p-ref-ur-q |
| 169 p.test += 2; // p-ref-ur-q | 169 p.test += 2; // p-ref-ur-q |
| 170 print(p.test); // p-ref-ur-q | 170 print(p.test); // p-ref-ur-q |
| 171 print(p.test2); // not requested |
| 171 } | 172 } |
| 172 '''); | 173 '''); |
| 173 List<Location> locations = | 174 List<Location> locations = |
| 174 await index.getUnresolvedMemberReferences('test'); | 175 await index.getUnresolvedMemberReferences('test'); |
| 175 expect(locations, hasLength(4)); | 176 expect(locations, hasLength(4)); |
| 176 findLocationTest(locations, 'test(); // p-inv-ur-q'); | 177 findLocationTest(locations, 'test(); // p-inv-ur-q'); |
| 177 findLocationTest(locations, 'test = 1; // p-ref-ur-q'); | 178 findLocationTest(locations, 'test = 1; // p-ref-ur-q'); |
| 178 findLocationTest(locations, 'test += 2; // p-ref-ur-q'); | 179 findLocationTest(locations, 'test += 2; // p-ref-ur-q'); |
| 179 findLocationTest(locations, 'test); // p-ref-ur-q'); | 180 findLocationTest(locations, 'test); // p-ref-ur-q'); |
| 180 } | 181 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 203 index.indexUnit(testUnit); | 204 index.indexUnit(testUnit); |
| 204 } | 205 } |
| 205 | 206 |
| 206 Source _indexUnit(String path, String code) { | 207 Source _indexUnit(String path, String code) { |
| 207 Source source = addSource(path, code); | 208 Source source = addSource(path, code); |
| 208 CompilationUnit unit = resolveLibraryUnit(source); | 209 CompilationUnit unit = resolveLibraryUnit(source); |
| 209 index.indexUnit(unit); | 210 index.indexUnit(unit); |
| 210 return source; | 211 return source; |
| 211 } | 212 } |
| 212 } | 213 } |
| OLD | NEW |