Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: pkg/analysis_server/lib/src/context_manager.dart

Issue 1198423002: gracefully degrade if package map input file cannot be watched (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: rework patch Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698