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 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:convert'; | 6 import 'dart:convert'; |
7 | 7 |
8 import 'package:analyzer/dart/ast/ast.dart'; | 8 import 'package:analyzer/dart/ast/ast.dart'; |
9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
10 import 'package:analyzer/src/dart/analysis/driver.dart'; | 10 import 'package:analyzer/src/dart/analysis/driver.dart'; |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 test_isReferencedBy_CompilationUnitElement_part() async { | 469 test_isReferencedBy_CompilationUnitElement_part() async { |
470 provider.newFile(_p('$testProject/my_unit.dart'), 'part of my_lib;'); | 470 provider.newFile(_p('$testProject/my_unit.dart'), 'part of my_lib;'); |
471 await _indexTestUnit(''' | 471 await _indexTestUnit(''' |
472 library my_lib; | 472 library my_lib; |
473 part 'my_unit.dart'; | 473 part 'my_unit.dart'; |
474 '''); | 474 '''); |
475 CompilationUnitElement element = testLibraryElement.parts[0]; | 475 CompilationUnitElement element = testLibraryElement.parts[0]; |
476 assertThat(element)..isReferencedAt("'my_unit.dart';", true, length: 14); | 476 assertThat(element)..isReferencedAt("'my_unit.dart';", true, length: 14); |
477 } | 477 } |
478 | 478 |
| 479 test_isReferencedBy_CompilationUnitElement_part_inPart() async { |
| 480 provider.newFile(_p('$testProject/a.dart'), 'part of lib;'); |
| 481 provider.newFile( |
| 482 _p('$testProject/b.dart'), |
| 483 ''' |
| 484 library lib; |
| 485 part 'a.dart'; |
| 486 '''); |
| 487 await _indexTestUnit(''' |
| 488 part 'b.dart'; |
| 489 '''); |
| 490 // No exception, even though a.dart is a part of b.dart part. |
| 491 } |
| 492 |
479 test_isReferencedBy_ConstructorElement() async { | 493 test_isReferencedBy_ConstructorElement() async { |
480 await _indexTestUnit(''' | 494 await _indexTestUnit(''' |
481 class A implements B { | 495 class A implements B { |
482 A() {} | 496 A() {} |
483 A.foo() {} | 497 A.foo() {} |
484 } | 498 } |
485 class B extends A { | 499 class B extends A { |
486 B() : super(); // 1 | 500 B() : super(); // 1 |
487 B.foo() : super.foo(); // 2 | 501 B.foo() : super.foo(); // 2 |
488 factory B.bar() = A.foo; // 3 | 502 factory B.bar() = A.foo; // 3 |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1243 final bool isQualified; | 1257 final bool isQualified; |
1244 | 1258 |
1245 _Relation(this.kind, this.offset, this.length, this.isQualified); | 1259 _Relation(this.kind, this.offset, this.length, this.isQualified); |
1246 | 1260 |
1247 @override | 1261 @override |
1248 String toString() { | 1262 String toString() { |
1249 return '_Relation{kind: $kind, offset: $offset, length: $length, ' | 1263 return '_Relation{kind: $kind, offset: $offset, length: $length, ' |
1250 'isQualified: $isQualified}lified)'; | 1264 'isQualified: $isQualified}lified)'; |
1251 } | 1265 } |
1252 } | 1266 } |
OLD | NEW |