| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:analysis_server/protocol/protocol.dart'; | 7 import 'package:analysis_server/protocol/protocol.dart'; |
| 8 import 'package:analysis_server/protocol/protocol_generated.dart'; | 8 import 'package:analysis_server/protocol/protocol_generated.dart'; |
| 9 import 'package:analysis_server/src/search/search_domain.dart'; | 9 import 'package:analysis_server/src/search/search_domain.dart'; |
| 10 import 'package:analyzer_plugin/protocol/protocol_common.dart'; | 10 import 'package:analyzer_plugin/protocol/protocol_common.dart'; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 'interfaces': [], | 158 'interfaces': [], |
| 159 'mixins': [], | 159 'mixins': [], |
| 160 'subclasses': [] | 160 'subclasses': [] |
| 161 }, | 161 }, |
| 162 ]); | 162 ]); |
| 163 } | 163 } |
| 164 | 164 |
| 165 test_class_extends_fileAndPackageUris() async { | 165 test_class_extends_fileAndPackageUris() async { |
| 166 // prepare packages | 166 // prepare packages |
| 167 String pkgFile = '/packages/pkgA/lib/libA.dart'; | 167 String pkgFile = '/packages/pkgA/lib/libA.dart'; |
| 168 resourceProvider.newFile( | 168 resourceProvider.newFile(pkgFile, ''' |
| 169 pkgFile, | |
| 170 ''' | |
| 171 library lib_a; | 169 library lib_a; |
| 172 class A {} | 170 class A {} |
| 173 class B extends A {} | 171 class B extends A {} |
| 174 '''); | 172 '''); |
| 175 resourceProvider.newFile( | 173 resourceProvider.newFile( |
| 176 '/packages/pkgA/.packages', 'pkgA:file:///packages/pkgA/lib'); | 174 '/packages/pkgA/.packages', 'pkgA:file:///packages/pkgA/lib'); |
| 177 // reference the package from a project | 175 // reference the package from a project |
| 178 resourceProvider.newFile( | 176 resourceProvider.newFile( |
| 179 '$projectPath/.packages', 'pkgA:file:///packages/pkgA/lib'); | 177 '$projectPath/.packages', 'pkgA:file:///packages/pkgA/lib'); |
| 180 addTestFile(''' | 178 addTestFile(''' |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 expect( | 689 expect( |
| 692 itemA.memberElement.location.offset, findOffset('test() {} // in A')); | 690 itemA.memberElement.location.offset, findOffset('test() {} // in A')); |
| 693 expect( | 691 expect( |
| 694 itemB.memberElement.location.offset, findOffset('test() {} // in B')); | 692 itemB.memberElement.location.offset, findOffset('test() {} // in B')); |
| 695 expect(itemC.memberElement, isNull); | 693 expect(itemC.memberElement, isNull); |
| 696 expect( | 694 expect( |
| 697 itemD.memberElement.location.offset, findOffset('test() {} // in D')); | 695 itemD.memberElement.location.offset, findOffset('test() {} // in D')); |
| 698 } | 696 } |
| 699 | 697 |
| 700 test_member_method_private_differentLib() async { | 698 test_member_method_private_differentLib() async { |
| 701 addFile( | 699 addFile('$testFolder/lib.dart', r''' |
| 702 '$testFolder/lib.dart', | |
| 703 r''' | |
| 704 import 'test.dart'; | 700 import 'test.dart'; |
| 705 class A { | 701 class A { |
| 706 void _m() {} | 702 void _m() {} |
| 707 } | 703 } |
| 708 class C extends B { | 704 class C extends B { |
| 709 void _m() {} | 705 void _m() {} |
| 710 } | 706 } |
| 711 '''); | 707 '''); |
| 712 addTestFile(''' | 708 addTestFile(''' |
| 713 import 'lib.dart'; | 709 import 'lib.dart'; |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 List _toJson(List<TypeHierarchyItem> items) { | 1046 List _toJson(List<TypeHierarchyItem> items) { |
| 1051 return items.map((item) => item.toJson()).toList(); | 1047 return items.map((item) => item.toJson()).toList(); |
| 1052 } | 1048 } |
| 1053 | 1049 |
| 1054 static Set<String> _toClassNames(List<TypeHierarchyItem> items) { | 1050 static Set<String> _toClassNames(List<TypeHierarchyItem> items) { |
| 1055 return items.map((TypeHierarchyItem item) { | 1051 return items.map((TypeHierarchyItem item) { |
| 1056 return item.classElement.name; | 1052 return item.classElement.name; |
| 1057 }).toSet(); | 1053 }).toSet(); |
| 1058 } | 1054 } |
| 1059 } | 1055 } |
| OLD | NEW |