| 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 import 'dart:core' hide Resource; | 9 import 'dart:core' hide Resource; |
| 10 | 10 |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 } | 508 } |
| 509 | 509 |
| 510 /** | 510 /** |
| 511 * Create a new empty context associated with [folder]. | 511 * Create a new empty context associated with [folder]. |
| 512 */ | 512 */ |
| 513 _ContextInfo _createContext( | 513 _ContextInfo _createContext( |
| 514 Folder folder, File pubspecFile, List<_ContextInfo> children) { | 514 Folder folder, File pubspecFile, List<_ContextInfo> children) { |
| 515 _ContextInfo info = new _ContextInfo( | 515 _ContextInfo info = new _ContextInfo( |
| 516 folder, pubspecFile, children, normalizedPackageRoots[folder.path]); | 516 folder, pubspecFile, children, normalizedPackageRoots[folder.path]); |
| 517 _contexts[folder] = info; | 517 _contexts[folder] = info; |
| 518 try { | 518 var options = analysisOptionsProvider.getOptions(folder); |
| 519 var options = analysisOptionsProvider.getOptions(folder); | 519 processOptionsForContext(folder, options); |
| 520 processOptionsForContext(folder, options); | |
| 521 } catch (_) { | |
| 522 rethrow; | |
| 523 } | |
| 524 info.changeSubscription = folder.changes.listen((WatchEvent event) { | 520 info.changeSubscription = folder.changes.listen((WatchEvent event) { |
| 525 _handleWatchEvent(folder, info, event); | 521 _handleWatchEvent(folder, info, event); |
| 526 }); | 522 }); |
| 527 try { | 523 try { |
| 528 UriResolver packageUriResolver = _computePackageUriResolver(folder, info); | 524 UriResolver packageUriResolver = _computePackageUriResolver(folder, info); |
| 529 info.context = addContext(folder, packageUriResolver); | 525 info.context = addContext(folder, packageUriResolver); |
| 530 info.context.name = folder.path; | 526 info.context.name = folder.path; |
| 531 } catch (_) { | 527 } catch (_) { |
| 532 info.changeSubscription.cancel(); | 528 info.changeSubscription.cancel(); |
| 533 rethrow; | 529 rethrow; |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 995 return excludes(resource.path); | 991 return excludes(resource.path); |
| 996 } | 992 } |
| 997 | 993 |
| 998 /** | 994 /** |
| 999 * Returns `true` if [path] is the pubspec file of this context. | 995 * Returns `true` if [path] is the pubspec file of this context. |
| 1000 */ | 996 */ |
| 1001 bool isPubspec(String path) { | 997 bool isPubspec(String path) { |
| 1002 return path == pubspecPath; | 998 return path == pubspecPath; |
| 1003 } | 999 } |
| 1004 } | 1000 } |
| OLD | NEW |