| 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:convert'; | 9 import 'dart:convert'; |
| 10 import 'dart:core' hide Resource; | 10 import 'dart:core' hide Resource; |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 } | 460 } |
| 461 // no | 461 // no |
| 462 return false; | 462 return false; |
| 463 } | 463 } |
| 464 | 464 |
| 465 /** | 465 /** |
| 466 * Process [options] for the context having info [info]. | 466 * Process [options] for the context having info [info]. |
| 467 */ | 467 */ |
| 468 void processOptionsForContext( | 468 void processOptionsForContext( |
| 469 ContextInfo info, Map<String, YamlNode> options) { | 469 ContextInfo info, Map<String, YamlNode> options) { |
| 470 //TODO(pquitslund): push handling into an options processor plugin contribut
ed to engine. | |
| 471 //AnalysisEngine.instance.optionsPlugin.optionsProcessors | |
| 472 // .forEach((OptionsProcessor p) => p.optionsProcessed(options)); | |
| 473 if (options == null) { | 470 if (options == null) { |
| 474 return; | 471 return; |
| 475 } | 472 } |
| 473 |
| 474 // Notify options processors. |
| 475 AnalysisEngine.instance.optionsPlugin.optionsProcessors |
| 476 .forEach( |
| 477 (OptionsProcessor p) => p.optionsProcessed(options, info.context)); |
| 478 |
| 479 // Analysis options are processed 'in-line'. |
| 480 // TODO(pq): consider pushing exclude handling into a plugin. |
| 476 YamlMap analyzer = options['analyzer']; | 481 YamlMap analyzer = options['analyzer']; |
| 477 if (analyzer == null) { | 482 if (analyzer == null) { |
| 478 // No options for analyzer. | 483 // No options for analyzer. |
| 479 return; | 484 return; |
| 480 } | 485 } |
| 481 | 486 |
| 482 // Set ignore patterns. | 487 // Set ignore patterns. |
| 483 YamlList exclude = analyzer['exclude']; | 488 YamlList exclude = analyzer['exclude']; |
| 484 if (exclude != null) { | 489 if (exclude != null) { |
| 485 setIgnorePatternsForContext(info, exclude); | 490 setIgnorePatternsForContext(info, exclude); |
| (...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1421 var path = resourceProvider.pathContext.fromUri(uri); | 1426 var path = resourceProvider.pathContext.fromUri(uri); |
| 1422 packageMap[name] = <Folder>[resourceProvider.getFolder(path)]; | 1427 packageMap[name] = <Folder>[resourceProvider.getFolder(path)]; |
| 1423 } | 1428 } |
| 1424 }); | 1429 }); |
| 1425 return <UriResolver>[new SdkExtUriResolver(packageMap)]; | 1430 return <UriResolver>[new SdkExtUriResolver(packageMap)]; |
| 1426 } else { | 1431 } else { |
| 1427 return const <UriResolver>[]; | 1432 return const <UriResolver>[]; |
| 1428 } | 1433 } |
| 1429 } | 1434 } |
| 1430 } | 1435 } |
| OLD | NEW |