| 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'; | 10 import 'dart:core'; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 import 'package:analyzer/source/sdk_ext.dart'; | 23 import 'package:analyzer/source/sdk_ext.dart'; |
| 24 import 'package:analyzer/src/context/builder.dart'; | 24 import 'package:analyzer/src/context/builder.dart'; |
| 25 import 'package:analyzer/src/context/context.dart' as context; | 25 import 'package:analyzer/src/context/context.dart' as context; |
| 26 import 'package:analyzer/src/dart/analysis/driver.dart'; | 26 import 'package:analyzer/src/dart/analysis/driver.dart'; |
| 27 import 'package:analyzer/src/dart/sdk/sdk.dart'; | 27 import 'package:analyzer/src/dart/sdk/sdk.dart'; |
| 28 import 'package:analyzer/src/generated/engine.dart'; | 28 import 'package:analyzer/src/generated/engine.dart'; |
| 29 import 'package:analyzer/src/generated/java_io.dart'; | 29 import 'package:analyzer/src/generated/java_io.dart'; |
| 30 import 'package:analyzer/src/generated/sdk.dart'; | 30 import 'package:analyzer/src/generated/sdk.dart'; |
| 31 import 'package:analyzer/src/generated/source.dart'; | 31 import 'package:analyzer/src/generated/source.dart'; |
| 32 import 'package:analyzer/src/generated/source_io.dart'; | 32 import 'package:analyzer/src/generated/source_io.dart'; |
| 33 import 'package:analyzer/src/lint/config.dart'; |
| 34 import 'package:analyzer/src/lint/linter.dart'; |
| 35 import 'package:analyzer/src/lint/registry.dart'; |
| 33 import 'package:analyzer/src/task/options.dart'; | 36 import 'package:analyzer/src/task/options.dart'; |
| 34 import 'package:analyzer/src/util/absolute_path.dart'; | 37 import 'package:analyzer/src/util/absolute_path.dart'; |
| 35 import 'package:analyzer/src/util/glob.dart'; | 38 import 'package:analyzer/src/util/glob.dart'; |
| 36 import 'package:analyzer/src/util/yaml.dart'; | 39 import 'package:analyzer/src/util/yaml.dart'; |
| 37 import 'package:linter/src/config.dart'; | |
| 38 import 'package:linter/src/linter.dart'; | |
| 39 import 'package:linter/src/rules.dart'; | |
| 40 import 'package:package_config/packages.dart'; | 40 import 'package:package_config/packages.dart'; |
| 41 import 'package:package_config/packages_file.dart' as pkgfile show parse; | 41 import 'package:package_config/packages_file.dart' as pkgfile show parse; |
| 42 import 'package:package_config/src/packages_impl.dart' show MapPackages; | 42 import 'package:package_config/src/packages_impl.dart' show MapPackages; |
| 43 import 'package:path/path.dart' as pathos; | 43 import 'package:path/path.dart' as pathos; |
| 44 import 'package:watcher/watcher.dart'; | 44 import 'package:watcher/watcher.dart'; |
| 45 import 'package:yaml/yaml.dart'; | 45 import 'package:yaml/yaml.dart'; |
| 46 | 46 |
| 47 /** | 47 /** |
| 48 * Information tracked by the [ContextManager] for each context. | 48 * Information tracked by the [ContextManager] for each context. |
| 49 */ | 49 */ |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 // Check for embedded options. | 707 // Check for embedded options. |
| 708 Map embeddedOptions = _getEmbeddedOptions(info); | 708 Map embeddedOptions = _getEmbeddedOptions(info); |
| 709 if (embeddedOptions != null) { | 709 if (embeddedOptions != null) { |
| 710 options = _toStringMap(new Merger().merge(embeddedOptions, options)); | 710 options = _toStringMap(new Merger().merge(embeddedOptions, options)); |
| 711 } | 711 } |
| 712 } | 712 } |
| 713 | 713 |
| 714 var lintOptions = options['linter']; | 714 var lintOptions = options['linter']; |
| 715 if (lintOptions != null) { | 715 if (lintOptions != null) { |
| 716 LintConfig config = new LintConfig.parseMap(lintOptions); | 716 LintConfig config = new LintConfig.parseMap(lintOptions); |
| 717 Iterable<LintRule> lintRules = ruleRegistry.enabled(config); | 717 Iterable<LintRule> lintRules = Registry.ruleRegistry.enabled(config); |
| 718 if (lintRules.isNotEmpty) { | 718 if (lintRules.isNotEmpty) { |
| 719 analysisOptions.lint = true; | 719 analysisOptions.lint = true; |
| 720 analysisOptions.lintRules = lintRules.toList(); | 720 analysisOptions.lintRules = lintRules.toList(); |
| 721 } | 721 } |
| 722 } | 722 } |
| 723 | 723 |
| 724 applyToAnalysisOptions(analysisOptions, options); | 724 applyToAnalysisOptions(analysisOptions, options); |
| 725 | 725 |
| 726 // Nothing more to do. | 726 // Nothing more to do. |
| 727 if (options == null) { | 727 if (options == null) { |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1931 } | 1931 } |
| 1932 return _embedderLocator; | 1932 return _embedderLocator; |
| 1933 } | 1933 } |
| 1934 | 1934 |
| 1935 @override | 1935 @override |
| 1936 SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) { | 1936 SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) { |
| 1937 return _sdkExtensionFinder ??= | 1937 return _sdkExtensionFinder ??= |
| 1938 new SdkExtensionFinder(buildPackageMap(resourceProvider)); | 1938 new SdkExtensionFinder(buildPackageMap(resourceProvider)); |
| 1939 } | 1939 } |
| 1940 } | 1940 } |
| OLD | NEW |