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

Unified Diff: pkg/analyzer_cli/lib/src/driver.dart

Issue 2541933002: update analyzer cli to support include directive in analysis options file (Closed)
Patch Set: merge Created 4 years 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
Index: pkg/analyzer_cli/lib/src/driver.dart
diff --git a/pkg/analyzer_cli/lib/src/driver.dart b/pkg/analyzer_cli/lib/src/driver.dart
index 16ec22d2fa3fef2e01cbda424fa23f7a06ce69eb..35caf046d2348363a35ba16652b8ea31bd50460b 100644
--- a/pkg/analyzer_cli/lib/src/driver.dart
+++ b/pkg/analyzer_cli/lib/src/driver.dart
@@ -491,13 +491,6 @@ class Driver implements CommandLineStarter {
// Create a context.
_context = AnalysisEngine.instance.createAnalysisContext();
- AnalyzeFunctionBodiesPredicate dietParsingPolicy =
- _chooseDietParsingPolicy(options);
- setAnalysisContextOptions(resourceProvider, _context, options,
- (AnalysisOptionsImpl contextOptions) {
- contextOptions.analyzeFunctionBodiesPredicate = dietParsingPolicy;
- });
-
// Find package info.
_PackageInfo packageInfo = _findPackages(options);
@@ -528,6 +521,14 @@ class Driver implements CommandLineStarter {
SourceFactory sourceFactory = _chooseUriResolutionPolicy(
options, embedderMap, packageInfo, summaryDataStore);
+ AnalyzeFunctionBodiesPredicate dietParsingPolicy =
+ _chooseDietParsingPolicy(options);
+ setAnalysisContextOptions(
+ resourceProvider, sourceFactory, _context, options,
+ (AnalysisOptionsImpl contextOptions) {
+ contextOptions.analyzeFunctionBodiesPredicate = dietParsingPolicy;
+ });
+
_context.sourceFactory = sourceFactory;
_context.resultProvider =
new InputPackagesResultProvider(_context, summaryDataStore);
@@ -680,6 +681,7 @@ class Driver implements CommandLineStarter {
static void setAnalysisContextOptions(
file_system.ResourceProvider resourceProvider,
+ SourceFactory sourceFactory,
AnalysisContext context,
CommandLineOptions options,
void configureContextOptions(AnalysisOptionsImpl contextOptions)) {
@@ -704,7 +706,7 @@ class Driver implements CommandLineStarter {
context.analysisOptions = contextOptions;
// Process analysis options file (and notify all interested parties).
- _processAnalysisOptions(resourceProvider, context, options);
+ _processAnalysisOptions(resourceProvider, sourceFactory, context, options);
}
/// Perform a deep comparison of two string lists.
@@ -761,14 +763,16 @@ class Driver implements CommandLineStarter {
static void _processAnalysisOptions(
file_system.ResourceProvider resourceProvider,
+ SourceFactory sourceFactory,
AnalysisContext context,
CommandLineOptions options) {
file_system.File file = _getOptionsFile(resourceProvider, options);
List<OptionsProcessor> optionsProcessors =
AnalysisEngine.instance.optionsPlugin.optionsProcessors;
+
try {
AnalysisOptionsProvider analysisOptionsProvider =
- new AnalysisOptionsProvider();
+ new AnalysisOptionsProvider(sourceFactory);
Map<String, YamlNode> optionMap =
analysisOptionsProvider.getOptionsFromFile(file);
optionsProcessors.forEach(

Powered by Google App Engine
This is Rietveld 408576698