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

Unified Diff: pkg/analyzer/lib/src/context/builder.dart

Issue 2505753002: integrate analysis options include directive into context builder (Closed)
Patch Set: merge Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/context/builder_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/context/builder.dart
diff --git a/pkg/analyzer/lib/src/context/builder.dart b/pkg/analyzer/lib/src/context/builder.dart
index d0d9b1e85f58404960ea7183bf44c4c1dc49367e..75875f709f76d6504cf73ba48225a63745d2fb50 100644
--- a/pkg/analyzer/lib/src/context/builder.dart
+++ b/pkg/analyzer/lib/src/context/builder.dart
@@ -336,9 +336,20 @@ class ContextBuilder {
if (optionsFile != null) {
List<OptionsProcessor> optionsProcessors =
AnalysisEngine.instance.optionsPlugin.optionsProcessors;
+ // TODO(danrubel) restructure so that we don't recalculate the package map
+ // more than once per path.
+ Packages packages = createPackageMap(path);
+ Map<String, List<Folder>> packageMap = convertPackagesToMap(packages);
+ List<UriResolver> resolvers = <UriResolver>[
+ new ResourceUriResolver(resourceProvider),
+ new PackageMapUriResolver(resourceProvider, packageMap),
+ ];
+ SourceFactory sourceFactory =
+ new SourceFactory(resolvers, packages, resourceProvider);
try {
Map<String, YamlNode> optionMap =
- new AnalysisOptionsProvider().getOptionsFromFile(optionsFile);
+ new AnalysisOptionsProvider(sourceFactory)
+ .getOptionsFromFile(optionsFile);
optionsProcessors.forEach(
(OptionsProcessor p) => p.optionsProcessed(context, optionMap));
applyToAnalysisOptions(options, optionMap);
« no previous file with comments | « no previous file | pkg/analyzer/test/src/context/builder_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698