Chromium Code Reviews| 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. |