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

Unified Diff: pkg/analyzer/lib/source/analysis_options_provider.dart

Issue 1411013003: Analysis Options error notifications. (Closed) Base URL: git@github.com:dart-lang/sdk.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
Index: pkg/analyzer/lib/source/analysis_options_provider.dart
diff --git a/pkg/analyzer/lib/source/analysis_options_provider.dart b/pkg/analyzer/lib/source/analysis_options_provider.dart
index 2c5dfdcc49a9fe7b4f2533e0b45cb32ae899a2e9..29062a26a41de8dbc6aa34f3471f16d98ad893a7 100644
--- a/pkg/analyzer/lib/source/analysis_options_provider.dart
+++ b/pkg/analyzer/lib/source/analysis_options_provider.dart
@@ -33,12 +33,14 @@ class AnalysisOptionsProvider {
if (optionsSource == null) {
return options;
}
- var doc = loadYaml(optionsSource);
+ YamlNode doc = loadYamlNode(optionsSource);
+ // Empty options.
+ if (doc is YamlScalar && doc.value == null) {
+ return options;
+ }
if ((doc != null) && (doc is! YamlMap)) {
throw new OptionsFormatException(
- 'Bad options file format (expected map, got ${doc.runtimeType})\n'
- 'contents of options file:\n'
- '$optionsSource\n',
+ 'Bad options file format (expected map, got ${doc.runtimeType})',
doc.span);
}
if (doc is YamlMap) {

Powered by Google App Engine
This is Rietveld 408576698