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

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

Issue 335123008: Implement analysis.updateOptions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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/analysis_server/lib/src/analysis_server.dart
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index 6e7f35d45d2812fcc38d8e7333e4eba6b3449dbc..5fc76c81fbe380e47cf8319bc244560fdc301829 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -210,6 +210,23 @@ class AnalysisServer {
}
/**
+ * Use the given updaters to update the values of the options in every
+ * existing analysis context.
+ */
+ void updateOptions(List<OptionUpdater> optionUpdaters) {
Paul Berry 2014/06/17 20:40:54 Passing in a list of closures seems like overkill
Brian Wilkerson 2014/06/17 21:30:12 That was my first thought as well. Unfortunately,
Paul Berry 2014/06/17 22:24:56 Actually I was thinking of something along these l
Brian Wilkerson 2014/06/18 17:01:30 Unfortunately, every context needs its own separat
+ // TODO(brianwilkerson) Figure out how to update the defaults for newly
Paul Berry 2014/06/17 20:40:54 You should be able to take care of this in Analysi
Brian Wilkerson 2014/06/17 21:30:12 Thanks. Done, but not tested. This solved one test
+ // create contexts.
+ folderMap.forEach((Folder folder, ContextDirectory directory) {
+ AnalysisContext context = directory.context;
+ AnalysisOptionsImpl options = new AnalysisOptionsImpl.con1(context.analysisOptions);
+ optionUpdaters.forEach((OptionUpdater optionUpdater) {
+ optionUpdater(options);
+ });
+ context.analysisOptions = options;
+ });
+ }
+
+ /**
* Adds the given [ServerOperation] to the queue, but does not schedule
* operations execution.
*/
@@ -540,6 +557,7 @@ class ContextDirectory {
AnalysisContext get context => _context;
}
+typedef void OptionUpdater(AnalysisOptionsImpl options);
/**
* An enumeration of the services provided by the server domain.
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/constants.dart » ('j') | pkg/analysis_server/lib/src/protocol.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698