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.refactoring.move_files; | 5 library test.services.refactoring.move_files; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/src/services/refactoring/refactoring.dart'; | 9 import 'package:analysis_server/src/services/refactoring/refactoring.dart'; |
10 import 'package:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 98 |
99 test_file_importedLibrary_package() async { | 99 test_file_importedLibrary_package() async { |
100 // configure packages | 100 // configure packages |
101 testFile = '/packages/my_pkg/aaa/test.dart'; | 101 testFile = '/packages/my_pkg/aaa/test.dart'; |
102 provider.newFile(testFile, ''); | 102 provider.newFile(testFile, ''); |
103 Map<String, List<Folder>> packageMap = { | 103 Map<String, List<Folder>> packageMap = { |
104 'my_pkg': [provider.getResource('/packages/my_pkg')] | 104 'my_pkg': [provider.getResource('/packages/my_pkg')] |
105 }; | 105 }; |
106 context.sourceFactory = new SourceFactory([ | 106 context.sourceFactory = new SourceFactory([ |
107 AbstractContextTest.SDK_RESOLVER, | 107 AbstractContextTest.SDK_RESOLVER, |
108 resourceResolver, | 108 new PackageMapUriResolver(provider, packageMap), |
109 new PackageMapUriResolver(provider, packageMap) | 109 resourceResolver |
110 ]); | 110 ]); |
111 // do testing | 111 // do testing |
112 String pathA = '/project/bin/a.dart'; | 112 String pathA = '/project/bin/a.dart'; |
113 addSource(pathA, ''' | 113 addSource(pathA, ''' |
114 import 'package:my_pkg/aaa/test.dart'; | 114 import 'package:my_pkg/aaa/test.dart'; |
115 '''); | 115 '''); |
116 addTestSource(''); | 116 addTestSource(''); |
117 _performAnalysis(); | 117 _performAnalysis(); |
118 // perform refactoring | 118 // perform refactoring |
119 _createRefactoring('/packages/my_pkg/bbb/ccc/new_name.dart'); | 119 _createRefactoring('/packages/my_pkg/bbb/ccc/new_name.dart'); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 break; | 242 break; |
243 } | 243 } |
244 for (ChangeNotice notice in result.changeNotices) { | 244 for (ChangeNotice notice in result.changeNotices) { |
245 if (notice.source.fullName.startsWith('/project/')) { | 245 if (notice.source.fullName.startsWith('/project/')) { |
246 index.indexUnit(context, notice.resolvedDartUnit); | 246 index.indexUnit(context, notice.resolvedDartUnit); |
247 } | 247 } |
248 } | 248 } |
249 } | 249 } |
250 } | 250 } |
251 } | 251 } |
OLD | NEW |