| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library domain.analysis; | 5 library domain.analysis; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/analysis_server.dart'; | 9 import 'package:analysis_server/src/analysis_server.dart'; |
| 10 import 'package:analysis_server/src/computer/computer_hover.dart'; | 10 import 'package:analysis_server/src/computer/computer_hover.dart'; |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 } | 168 } |
| 169 | 169 |
| 170 /** | 170 /** |
| 171 * Implement the 'analysis.updateOptions' request. | 171 * Implement the 'analysis.updateOptions' request. |
| 172 */ | 172 */ |
| 173 Response updateOptions(Request request) { | 173 Response updateOptions(Request request) { |
| 174 // options | 174 // options |
| 175 var params = new AnalysisUpdateOptionsParams.fromRequest(request); | 175 var params = new AnalysisUpdateOptionsParams.fromRequest(request); |
| 176 AnalysisOptions newOptions = params.options; | 176 AnalysisOptions newOptions = params.options; |
| 177 List<OptionUpdater> updaters = new List<OptionUpdater>(); | 177 List<OptionUpdater> updaters = new List<OptionUpdater>(); |
| 178 if (newOptions.enableDeferredLoading != null) { | |
| 179 updaters.add((engine.AnalysisOptionsImpl options) { | |
| 180 options.enableDeferredLoading = newOptions.enableDeferredLoading; | |
| 181 }); | |
| 182 } | |
| 183 if (newOptions.enableEnums != null) { | |
| 184 updaters.add((engine.AnalysisOptionsImpl options) { | |
| 185 options.enableEnum = newOptions.enableEnums; | |
| 186 }); | |
| 187 } | |
| 188 if (newOptions.generateDart2jsHints != null) { | 178 if (newOptions.generateDart2jsHints != null) { |
| 189 updaters.add((engine.AnalysisOptionsImpl options) { | 179 updaters.add((engine.AnalysisOptionsImpl options) { |
| 190 options.dart2jsHint = newOptions.generateDart2jsHints; | 180 options.dart2jsHint = newOptions.generateDart2jsHints; |
| 191 }); | 181 }); |
| 192 } | 182 } |
| 193 if (newOptions.generateHints != null) { | 183 if (newOptions.generateHints != null) { |
| 194 updaters.add((engine.AnalysisOptionsImpl options) { | 184 updaters.add((engine.AnalysisOptionsImpl options) { |
| 195 options.hint = newOptions.generateHints; | 185 options.hint = newOptions.generateHints; |
| 196 }); | 186 }); |
| 197 } | 187 } |
| 198 server.updateOptions(updaters); | 188 server.updateOptions(updaters); |
| 199 return new AnalysisUpdateOptionsResult().toResponse(request.id); | 189 return new AnalysisUpdateOptionsResult().toResponse(request.id); |
| 200 } | 190 } |
| 201 } | 191 } |
| OLD | NEW |