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

Unified Diff: lib/src/driver.dart

Issue 1412293005: Defer to engine for option-aware context config. (Closed) Base URL: https://github.com/dart-lang/analyzer_cli.git@master
Patch Set: Created 5 years, 2 months 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 | lib/src/options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/driver.dart
diff --git a/lib/src/driver.dart b/lib/src/driver.dart
index 0b6c52641a3189fa44539bf26c203ee36b28d85d..23bc8269a271a9aa45002a7bc28cac1f5453e851 100644
--- a/lib/src/driver.dart
+++ b/lib/src/driver.dart
@@ -26,6 +26,7 @@ import 'package:analyzer/src/generated/sdk_io.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/generated/source_io.dart';
import 'package:analyzer/src/services/lint.dart';
+import 'package:analyzer/src/task/options.dart';
import 'package:analyzer_cli/src/analyzer_impl.dart';
import 'package:analyzer_cli/src/options.dart';
import 'package:linter/src/plugin/linter_plugin.dart';
@@ -135,14 +136,14 @@ class Driver {
sourcePath = sourcePath.trim();
// Check that file exists.
if (!new File(sourcePath).existsSync()) {
- stderr.writeln('File not found: $sourcePath');
+ errorSink.writeln('File not found: $sourcePath');
exitCode = ErrorSeverity.ERROR.ordinal;
//Fail fast; don't analyze more files
return ErrorSeverity.ERROR;
}
// Check that file is Dart file.
if (!AnalysisEngine.isDartFileName(sourcePath)) {
- stderr.writeln('$sourcePath is not a Dart file');
+ errorSink.writeln('$sourcePath is not a Dart file');
exitCode = ErrorSeverity.ERROR.ordinal;
// Fail fast; don't analyze more files.
return ErrorSeverity.ERROR;
@@ -492,6 +493,11 @@ class Driver {
if (options.lints && !containsLintRuleEntry(optionMap)) {
setLints(context, linterPlugin.contributedRules);
}
+
+ // Ask engine to further process options.
+ if (optionMap != null) {
+ configureContextOptions(context, optionMap);
+ }
} on Exception catch (e) {
optionsProcessors.forEach((OptionsProcessor p) => p.onError(e));
}
« no previous file with comments | « no previous file | lib/src/options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698