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 context.directory.manager; | 5 library context.directory.manager; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 | 9 |
10 import 'package:analysis_server/src/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
431 } else { | 431 } else { |
432 beginComputePackageMap(); | 432 beginComputePackageMap(); |
433 OptimizingPubPackageMapInfo packageMapInfo; | 433 OptimizingPubPackageMapInfo packageMapInfo; |
434 ServerPerformanceStatistics.pub.makeCurrentWhile(() { | 434 ServerPerformanceStatistics.pub.makeCurrentWhile(() { |
435 packageMapInfo = | 435 packageMapInfo = |
436 _packageMapProvider.computePackageMap(folder, info.packageMapInfo); | 436 _packageMapProvider.computePackageMap(folder, info.packageMapInfo); |
437 }); | 437 }); |
438 endComputePackageMap(); | 438 endComputePackageMap(); |
439 for (String dependencyPath in packageMapInfo.dependencies) { | 439 for (String dependencyPath in packageMapInfo.dependencies) { |
440 Resource resource = resourceProvider.getResource(dependencyPath); | 440 Resource resource = resourceProvider.getResource(dependencyPath); |
441 if (resource is File) { | 441 if (resource is File && resource.exists) { |
Paul Berry
2015/06/22 21:19:31
This introduces a race condition, because it's pos
danrubel
2015/06/22 21:54:46
I tried doing that in an earlier iteration of this
| |
442 info.dependencySubscriptions.add(resource.changes | 442 info.dependencySubscriptions.add(resource.changes |
443 .listen((WatchEvent event) { | 443 .listen((WatchEvent event) { |
444 if (info.packageMapInfo != null && | 444 if (info.packageMapInfo != null && |
445 info.packageMapInfo.isChangedDependency( | 445 info.packageMapInfo.isChangedDependency( |
446 dependencyPath, resourceProvider)) { | 446 dependencyPath, resourceProvider)) { |
447 _recomputePackageUriResolver(info); | 447 _recomputePackageUriResolver(info); |
448 } | 448 } |
449 })); | 449 })); |
450 } | 450 } |
451 } | 451 } |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
827 return excludes(resource.path); | 827 return excludes(resource.path); |
828 } | 828 } |
829 | 829 |
830 /** | 830 /** |
831 * Returns `true` if [path] is the pubspec file of this context. | 831 * Returns `true` if [path] is the pubspec file of this context. |
832 */ | 832 */ |
833 bool isPubspec(String path) { | 833 bool isPubspec(String path) { |
834 return path == pubspecPath; | 834 return path == pubspecPath; |
835 } | 835 } |
836 } | 836 } |
OLD | NEW |