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

Unified Diff: pkg/analysis_server/lib/src/context_manager.dart

Issue 1503353002: Embedded option processing fixes (#25115). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « DEPS ('k') | pkg/analysis_server/test/context_manager_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/context_manager.dart
diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart
index 061cc23c2ace658ad2bdc58b004dd1f0b7c985ef..15e3c806df3cacd347c151badfe1d64cfaf39f66 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -539,7 +539,7 @@ class ContextManagerImpl implements ContextManager {
*/
void processOptionsForContext(ContextInfo info, Folder folder,
{bool optionsRemoved: false}) {
- Map<String, YamlNode> options;
+ Map<String, Object> options;
try {
options = analysisOptionsProvider.getOptions(folder);
} catch (_) {
@@ -550,6 +550,24 @@ class ContextManagerImpl implements ContextManager {
return;
}
+ // In case options files are removed, revert to defaults.
+ if (optionsRemoved) {
+ // Start with defaults.
+ info.context.analysisOptions = new AnalysisOptionsImpl();
+
+ // Apply inherited options.
+ options = _getEmbeddedOptions(info.context);
+ if (options != null) {
+ configureContextOptions(info.context, options);
+ }
+ } else {
+ // Check for embedded options.
+ YamlMap embeddedOptions = _getEmbeddedOptions(info.context);
+ if (embeddedOptions != null) {
+ options = new Merger().merge(embeddedOptions, options);
+ }
+ }
+
// Notify options processors.
AnalysisEngine.instance.optionsPlugin.optionsProcessors
.forEach((OptionsProcessor p) {
@@ -562,34 +580,19 @@ class ContextManagerImpl implements ContextManager {
}
});
- // In case options files are removed, revert to defaults.
- if (optionsRemoved) {
- // Start with defaults.
- info.context.analysisOptions = new AnalysisOptionsImpl();
+ configureContextOptions(info.context, options);
- // Apply inherited options.
- YamlMap embeddedOptions = _getEmbeddedOptions(info.context);
- if (embeddedOptions != null) {
- configureContextOptions(info.context, embeddedOptions);
- }
+ // Nothing more to do.
+ if (options == null) {
return;
}
- // Check for embedded options.
- YamlMap embeddedOptions = _getEmbeddedOptions(info.context);
- if (embeddedOptions != null) {
- options = new Merger().merge(embeddedOptions, options);
- }
-
- // Analysis options are processed 'in-line'.
var analyzer = options[AnalyzerOptions.analyzer];
if (analyzer is! Map) {
- // No options for analyzer.
+ // Done.
return;
}
- configureContextOptions(info.context, options);
-
// Set ignore patterns.
YamlList exclude = analyzer[AnalyzerOptions.exclude];
if (exclude != null) {
« no previous file with comments | « DEPS ('k') | pkg/analysis_server/test/context_manager_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698