| OLD | NEW |
| 1 import 'dart:io' as io; | 1 import 'dart:io' as io; |
| 2 | 2 |
| 3 import 'package:analyzer/dart/element/element.dart'; | 3 import 'package:analyzer/dart/element/element.dart'; |
| 4 import 'package:analyzer/file_system/file_system.dart'; | 4 import 'package:analyzer/file_system/file_system.dart'; |
| 5 import 'package:analyzer/src/context/cache.dart'; | 5 import 'package:analyzer/src/context/cache.dart'; |
| 6 import 'package:analyzer/src/context/context.dart'; | 6 import 'package:analyzer/src/context/context.dart'; |
| 7 import 'package:analyzer/src/dart/element/element.dart'; | 7 import 'package:analyzer/src/dart/element/element.dart'; |
| 8 import 'package:analyzer/src/generated/engine.dart'; | 8 import 'package:analyzer/src/generated/engine.dart'; |
| 9 import 'package:analyzer/src/generated/resolver.dart' show TypeProvider; | 9 import 'package:analyzer/src/generated/resolver.dart' show TypeProvider; |
| 10 import 'package:analyzer/src/generated/source.dart'; | 10 import 'package:analyzer/src/generated/source.dart'; |
| 11 import 'package:analyzer/src/generated/source_io.dart'; | 11 import 'package:analyzer/src/generated/source_io.dart'; |
| 12 import 'package:analyzer/src/generated/utilities_dart.dart'; | 12 import 'package:analyzer/src/generated/utilities_dart.dart'; |
| 13 import 'package:analyzer/src/summary/format.dart'; | 13 import 'package:analyzer/src/summary/format.dart'; |
| 14 import 'package:analyzer/src/summary/idl.dart'; | 14 import 'package:analyzer/src/summary/idl.dart'; |
| 15 import 'package:analyzer/src/summary/resynthesize.dart'; | 15 import 'package:analyzer/src/summary/resynthesize.dart'; |
| 16 import 'package:analyzer/src/task/dart.dart'; | 16 import 'package:analyzer/src/task/dart.dart'; |
| 17 import 'package:analyzer/src/util/fast_uri.dart'; | |
| 18 import 'package:analyzer/task/dart.dart'; | 17 import 'package:analyzer/task/dart.dart'; |
| 19 import 'package:analyzer/task/general.dart'; | 18 import 'package:analyzer/task/general.dart'; |
| 20 import 'package:analyzer/task/model.dart'; | 19 import 'package:analyzer/task/model.dart'; |
| 21 import 'package:front_end/src/base/source.dart'; | 20 import 'package:front_end/src/base/source.dart'; |
| 22 | 21 |
| 23 /** | 22 /** |
| 24 * The [ResultProvider] that provides results from input package summaries. | 23 * The [ResultProvider] that provides results from input package summaries. |
| 25 */ | 24 */ |
| 26 class InputPackagesResultProvider extends ResynthesizerResultProvider { | 25 class InputPackagesResultProvider extends ResynthesizerResultProvider { |
| 27 InputPackagesResultProvider( | 26 InputPackagesResultProvider( |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 /** | 330 /** |
| 332 * Add the given [bundle] loaded from the file with the given [path]. | 331 * Add the given [bundle] loaded from the file with the given [path]. |
| 333 */ | 332 */ |
| 334 void addBundle(String path, PackageBundle bundle) { | 333 void addBundle(String path, PackageBundle bundle) { |
| 335 bundles.add(bundle); | 334 bundles.add(bundle); |
| 336 if (dependencies != null) { | 335 if (dependencies != null) { |
| 337 Set<String> includedPackageNames = new Set<String>(); | 336 Set<String> includedPackageNames = new Set<String>(); |
| 338 bool includesDartUris = false; | 337 bool includesDartUris = false; |
| 339 bool includesFileUris = false; | 338 bool includesFileUris = false; |
| 340 for (String uriString in bundle.unlinkedUnitUris) { | 339 for (String uriString in bundle.unlinkedUnitUris) { |
| 341 Uri uri = FastUri.parse(uriString); | 340 Uri uri = Uri.parse(uriString); |
| 342 String scheme = uri.scheme; | 341 String scheme = uri.scheme; |
| 343 if (scheme == 'package') { | 342 if (scheme == 'package') { |
| 344 List<String> pathSegments = uri.pathSegments; | 343 List<String> pathSegments = uri.pathSegments; |
| 345 includedPackageNames.add(pathSegments.isEmpty ? '' : pathSegments[0]); | 344 includedPackageNames.add(pathSegments.isEmpty ? '' : pathSegments[0]); |
| 346 } else if (scheme == 'file') { | 345 } else if (scheme == 'file') { |
| 347 includesFileUris = true; | 346 includesFileUris = true; |
| 348 } else if (scheme == 'dart') { | 347 } else if (scheme == 'dart') { |
| 349 includesDartUris = true; | 348 includesDartUris = true; |
| 350 } | 349 } |
| 351 } | 350 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 * the given [unitUriString], or `null` if no such library is in the store. | 385 * the given [unitUriString], or `null` if no such library is in the store. |
| 387 */ | 386 */ |
| 388 List<String> getContainingLibraryUris(String unitUriString) { | 387 List<String> getContainingLibraryUris(String unitUriString) { |
| 389 // The unit is the defining unit of a library. | 388 // The unit is the defining unit of a library. |
| 390 if (linkedMap.containsKey(unitUriString)) { | 389 if (linkedMap.containsKey(unitUriString)) { |
| 391 return <String>[unitUriString]; | 390 return <String>[unitUriString]; |
| 392 } | 391 } |
| 393 // Check every unlinked unit whether it uses [unitUri] as a part. | 392 // Check every unlinked unit whether it uses [unitUri] as a part. |
| 394 List<String> libraryUriStrings = <String>[]; | 393 List<String> libraryUriStrings = <String>[]; |
| 395 unlinkedMap.forEach((unlinkedUnitUriString, unlinkedUnit) { | 394 unlinkedMap.forEach((unlinkedUnitUriString, unlinkedUnit) { |
| 396 Uri libraryUri = FastUri.parse(unlinkedUnitUriString); | 395 Uri libraryUri = Uri.parse(unlinkedUnitUriString); |
| 397 for (String partUriString in unlinkedUnit.publicNamespace.parts) { | 396 for (String partUriString in unlinkedUnit.publicNamespace.parts) { |
| 398 Uri partUri = FastUri.parse(partUriString); | 397 Uri partUri = Uri.parse(partUriString); |
| 399 String partAbsoluteUriString = | 398 String partAbsoluteUriString = |
| 400 resolveRelativeUri(libraryUri, partUri).toString(); | 399 resolveRelativeUri(libraryUri, partUri).toString(); |
| 401 if (partAbsoluteUriString == unitUriString) { | 400 if (partAbsoluteUriString == unitUriString) { |
| 402 libraryUriStrings.add(unlinkedUnitUriString); | 401 libraryUriStrings.add(unlinkedUnitUriString); |
| 403 } | 402 } |
| 404 } | 403 } |
| 405 }); | 404 }); |
| 406 return libraryUriStrings.isNotEmpty ? libraryUriStrings : null; | 405 return libraryUriStrings.isNotEmpty ? libraryUriStrings : null; |
| 407 } | 406 } |
| 408 | 407 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 433 UnlinkedUnit getUnlinkedSummary(String uri) { | 432 UnlinkedUnit getUnlinkedSummary(String uri) { |
| 434 return _dataStore.unlinkedMap[uri]; | 433 return _dataStore.unlinkedMap[uri]; |
| 435 } | 434 } |
| 436 | 435 |
| 437 @override | 436 @override |
| 438 bool hasLibrarySummary(String uri) { | 437 bool hasLibrarySummary(String uri) { |
| 439 LinkedLibrary linkedLibrary = _dataStore.linkedMap[uri]; | 438 LinkedLibrary linkedLibrary = _dataStore.linkedMap[uri]; |
| 440 return linkedLibrary != null; | 439 return linkedLibrary != null; |
| 441 } | 440 } |
| 442 } | 441 } |
| OLD | NEW |