| 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 // This file has been automatically generated. Please do not edit it manually. | 5 // This file has been automatically generated. Please do not edit it manually. |
| 6 // To regenerate the file, use the script | 6 // To regenerate the file, use the script |
| 7 // "pkg/analysis_server/tool/spec/generate_files". | 7 // "pkg/analysis_server/tool/spec/generate_files". |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Convenience methods for running integration tests | 10 * Convenience methods for running integration tests |
| 11 */ | 11 */ |
| 12 library test.integration.methods; | 12 library test.integration.methods; |
| 13 | 13 |
| 14 import 'dart:async'; | 14 import 'dart:async'; |
| 15 | 15 |
| 16 import 'package:analysis_server/src/protocol.dart'; |
| 16 import 'package:unittest/unittest.dart'; | 17 import 'package:unittest/unittest.dart'; |
| 17 | 18 |
| 18 import 'integration_tests.dart'; | 19 import 'integration_tests.dart'; |
| 19 import 'protocol_matchers.dart'; | 20 import 'protocol_matchers.dart'; |
| 20 | 21 |
| 21 | 22 |
| 22 /** | 23 /** |
| 23 * Convenience methods for running integration tests | 24 * Convenience methods for running integration tests |
| 24 */ | 25 */ |
| 25 abstract class IntegrationTestMixin { | 26 abstract class IntegrationTestMixin { |
| 26 Server get server; | 27 Server get server; |
| 27 | 28 |
| 28 /** | 29 /** |
| 29 * Return the version number of the analysis server. | 30 * Return the version number of the analysis server. |
| 30 * | 31 * |
| 31 * Returns | 32 * Returns |
| 32 * | 33 * |
| 33 * version ( String ) | 34 * version ( String ) |
| 34 * | 35 * |
| 35 * The version number of the analysis server. | 36 * The version number of the analysis server. |
| 36 */ | 37 */ |
| 37 Future sendServerGetVersion({bool checkTypes: true}) { | 38 Future sendServerGetVersion() { |
| 38 return server.send("server.getVersion", null) | 39 return server.send("server.getVersion", null) |
| 39 .then((result) { | 40 .then((result) { |
| 40 if (checkTypes) { | 41 expect(result, isServerGetVersionResult); |
| 41 expect(result, isServerGetVersionResult); | |
| 42 } | |
| 43 return result; | 42 return result; |
| 44 }); | 43 }); |
| 45 } | 44 } |
| 46 | 45 |
| 47 /** | 46 /** |
| 48 * Cleanly shutdown the analysis server. Requests that are received after | 47 * Cleanly shutdown the analysis server. Requests that are received after |
| 49 * this request will not be processed. Requests that were received before | 48 * this request will not be processed. Requests that were received before |
| 50 * this request, but for which a response has not yet been sent, will not be | 49 * this request, but for which a response has not yet been sent, will not be |
| 51 * responded to. No further responses or notifications will be sent after the | 50 * responded to. No further responses or notifications will be sent after the |
| 52 * response to this request has been sent. | 51 * response to this request has been sent. |
| 53 */ | 52 */ |
| 54 Future sendServerShutdown({bool checkTypes: true}) { | 53 Future sendServerShutdown() { |
| 55 return server.send("server.shutdown", null) | 54 return server.send("server.shutdown", null) |
| 56 .then((result) { | 55 .then((result) { |
| 57 if (checkTypes) { | 56 expect(result, isServerShutdownResult); |
| 58 expect(result, isServerShutdownResult); | |
| 59 } | |
| 60 return result; | 57 return result; |
| 61 }); | 58 }); |
| 62 } | 59 } |
| 63 | 60 |
| 64 /** | 61 /** |
| 65 * Subscribe for services. All previous subscriptions are replaced by the | 62 * Subscribe for services. All previous subscriptions are replaced by the |
| 66 * given set of services. | 63 * given set of services. |
| 67 * | 64 * |
| 68 * It is an error if any of the elements in the list are not valid services. | 65 * It is an error if any of the elements in the list are not valid services. |
| 69 * If there is an error, then the current subscriptions will remain | 66 * If there is an error, then the current subscriptions will remain |
| 70 * unchanged. | 67 * unchanged. |
| 71 * | 68 * |
| 72 * Parameters | 69 * Parameters |
| 73 * | 70 * |
| 74 * subscriptions ( List<ServerService> ) | 71 * subscriptions ( List<ServerService> ) |
| 75 * | 72 * |
| 76 * A list of the services being subscribed to. | 73 * A list of the services being subscribed to. |
| 77 */ | 74 */ |
| 78 Future sendServerSetSubscriptions(List<String> subscriptions, {bool checkTypes
: true}) { | 75 Future sendServerSetSubscriptions(List<ServerService> subscriptions) { |
| 79 Map<String, dynamic> params = {}; | 76 var params = new ServerSetSubscriptionsParams(subscriptions).toJson(); |
| 80 params["subscriptions"] = subscriptions; | |
| 81 if (checkTypes) { | |
| 82 expect(params, isServerSetSubscriptionsParams); | |
| 83 } | |
| 84 return server.send("server.setSubscriptions", params) | 77 return server.send("server.setSubscriptions", params) |
| 85 .then((result) { | 78 .then((result) { |
| 86 if (checkTypes) { | 79 expect(result, isServerSetSubscriptionsResult); |
| 87 expect(result, isServerSetSubscriptionsResult); | |
| 88 } | |
| 89 return result; | 80 return result; |
| 90 }); | 81 }); |
| 91 } | 82 } |
| 92 | 83 |
| 93 /** | 84 /** |
| 94 * Reports that the server is running. This notification is issued once after | 85 * Reports that the server is running. This notification is issued once after |
| 95 * the server has started running but before any requests are processed to | 86 * the server has started running but before any requests are processed to |
| 96 * let the client know that it started correctly. | 87 * let the client know that it started correctly. |
| 97 * | 88 * |
| 98 * It is not possible to subscribe to or unsubscribe from this notification. | 89 * It is not possible to subscribe to or unsubscribe from this notification. |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 * file ( FilePath ) | 173 * file ( FilePath ) |
| 183 * | 174 * |
| 184 * The file for which errors are being requested. | 175 * The file for which errors are being requested. |
| 185 * | 176 * |
| 186 * Returns | 177 * Returns |
| 187 * | 178 * |
| 188 * errors ( List<AnalysisError> ) | 179 * errors ( List<AnalysisError> ) |
| 189 * | 180 * |
| 190 * The errors associated with the file. | 181 * The errors associated with the file. |
| 191 */ | 182 */ |
| 192 Future sendAnalysisGetErrors(String file, {bool checkTypes: true}) { | 183 Future sendAnalysisGetErrors(String file) { |
| 193 Map<String, dynamic> params = {}; | 184 var params = new AnalysisGetErrorsParams(file).toJson(); |
| 194 params["file"] = file; | |
| 195 if (checkTypes) { | |
| 196 expect(params, isAnalysisGetErrorsParams); | |
| 197 } | |
| 198 return server.send("analysis.getErrors", params) | 185 return server.send("analysis.getErrors", params) |
| 199 .then((result) { | 186 .then((result) { |
| 200 if (checkTypes) { | 187 expect(result, isAnalysisGetErrorsResult); |
| 201 expect(result, isAnalysisGetErrorsResult); | |
| 202 } | |
| 203 return result; | 188 return result; |
| 204 }); | 189 }); |
| 205 } | 190 } |
| 206 | 191 |
| 207 /** | 192 /** |
| 208 * Return the hover information associate with the given location. If some or | 193 * Return the hover information associate with the given location. If some or |
| 209 * all of the hover information is not available at the time this request is | 194 * all of the hover information is not available at the time this request is |
| 210 * processed the information will be omitted from the response. | 195 * processed the information will be omitted from the response. |
| 211 * | 196 * |
| 212 * Parameters | 197 * Parameters |
| 213 * | 198 * |
| 214 * file ( FilePath ) | 199 * file ( FilePath ) |
| 215 * | 200 * |
| 216 * The file in which hover information is being requested. | 201 * The file in which hover information is being requested. |
| 217 * | 202 * |
| 218 * offset ( int ) | 203 * offset ( int ) |
| 219 * | 204 * |
| 220 * The offset for which hover information is being requested. | 205 * The offset for which hover information is being requested. |
| 221 * | 206 * |
| 222 * Returns | 207 * Returns |
| 223 * | 208 * |
| 224 * hovers ( List<HoverInformation> ) | 209 * hovers ( List<HoverInformation> ) |
| 225 * | 210 * |
| 226 * The hover information associated with the location. The list will be | 211 * The hover information associated with the location. The list will be |
| 227 * empty if no information could be determined for the location. The list | 212 * empty if no information could be determined for the location. The list |
| 228 * can contain multiple items if the file is being analyzed in multiple | 213 * can contain multiple items if the file is being analyzed in multiple |
| 229 * contexts in conflicting ways (such as a part that is included in | 214 * contexts in conflicting ways (such as a part that is included in |
| 230 * multiple libraries). | 215 * multiple libraries). |
| 231 */ | 216 */ |
| 232 Future sendAnalysisGetHover(String file, int offset, {bool checkTypes: true})
{ | 217 Future sendAnalysisGetHover(String file, int offset) { |
| 233 Map<String, dynamic> params = {}; | 218 var params = new AnalysisGetHoverParams(file, offset).toJson(); |
| 234 params["file"] = file; | |
| 235 params["offset"] = offset; | |
| 236 if (checkTypes) { | |
| 237 expect(params, isAnalysisGetHoverParams); | |
| 238 } | |
| 239 return server.send("analysis.getHover", params) | 219 return server.send("analysis.getHover", params) |
| 240 .then((result) { | 220 .then((result) { |
| 241 if (checkTypes) { | 221 expect(result, isAnalysisGetHoverResult); |
| 242 expect(result, isAnalysisGetHoverResult); | |
| 243 } | |
| 244 return result; | 222 return result; |
| 245 }); | 223 }); |
| 246 } | 224 } |
| 247 | 225 |
| 248 /** | 226 /** |
| 249 * Force the re-analysis of everything contained in the existing analysis | 227 * Force the re-analysis of everything contained in the existing analysis |
| 250 * roots. This will cause all previously computed analysis results to be | 228 * roots. This will cause all previously computed analysis results to be |
| 251 * discarded and recomputed, and will cause all subscribed notifications to | 229 * discarded and recomputed, and will cause all subscribed notifications to |
| 252 * be re-sent. | 230 * be re-sent. |
| 253 */ | 231 */ |
| 254 Future sendAnalysisReanalyze({bool checkTypes: true}) { | 232 Future sendAnalysisReanalyze() { |
| 255 return server.send("analysis.reanalyze", null) | 233 return server.send("analysis.reanalyze", null) |
| 256 .then((result) { | 234 .then((result) { |
| 257 if (checkTypes) { | 235 expect(result, isAnalysisReanalyzeResult); |
| 258 expect(result, isAnalysisReanalyzeResult); | |
| 259 } | |
| 260 return result; | 236 return result; |
| 261 }); | 237 }); |
| 262 } | 238 } |
| 263 | 239 |
| 264 /** | 240 /** |
| 265 * Sets the root paths used to determine which files to analyze. The set of | 241 * Sets the root paths used to determine which files to analyze. The set of |
| 266 * files to be analyzed are all of the files in one of the root paths that | 242 * files to be analyzed are all of the files in one of the root paths that |
| 267 * are not also in one of the excluded paths. | 243 * are not also in one of the excluded paths. |
| 268 * | 244 * |
| 269 * Note that this request determines the set of requested analysis roots. The | 245 * Note that this request determines the set of requested analysis roots. The |
| (...skipping 17 matching lines...) Expand all Loading... |
| 287 * | 263 * |
| 288 * included ( List<FilePath> ) | 264 * included ( List<FilePath> ) |
| 289 * | 265 * |
| 290 * A list of the files and directories that should be analyzed. | 266 * A list of the files and directories that should be analyzed. |
| 291 * | 267 * |
| 292 * excluded ( List<FilePath> ) | 268 * excluded ( List<FilePath> ) |
| 293 * | 269 * |
| 294 * A list of the files and directories within the included directories that | 270 * A list of the files and directories within the included directories that |
| 295 * should not be analyzed. | 271 * should not be analyzed. |
| 296 */ | 272 */ |
| 297 Future sendAnalysisSetAnalysisRoots(List<String> included, List<String> exclud
ed, {bool checkTypes: true}) { | 273 Future sendAnalysisSetAnalysisRoots(List<String> included, List<String> exclud
ed) { |
| 298 Map<String, dynamic> params = {}; | 274 var params = new AnalysisSetAnalysisRootsParams(included, excluded).toJson()
; |
| 299 params["included"] = included; | |
| 300 params["excluded"] = excluded; | |
| 301 if (checkTypes) { | |
| 302 expect(params, isAnalysisSetAnalysisRootsParams); | |
| 303 } | |
| 304 return server.send("analysis.setAnalysisRoots", params) | 275 return server.send("analysis.setAnalysisRoots", params) |
| 305 .then((result) { | 276 .then((result) { |
| 306 if (checkTypes) { | 277 expect(result, isAnalysisSetAnalysisRootsResult); |
| 307 expect(result, isAnalysisSetAnalysisRootsResult); | |
| 308 } | |
| 309 return result; | 278 return result; |
| 310 }); | 279 }); |
| 311 } | 280 } |
| 312 | 281 |
| 313 /** | 282 /** |
| 314 * Set the priority files to the files in the given list. A priority file is | 283 * Set the priority files to the files in the given list. A priority file is |
| 315 * a file that is given priority when scheduling which analysis work to do | 284 * a file that is given priority when scheduling which analysis work to do |
| 316 * first. The list typically contains those files that are visible to the | 285 * first. The list typically contains those files that are visible to the |
| 317 * user and those for which analysis results will have the biggest impact on | 286 * user and those for which analysis results will have the biggest impact on |
| 318 * the user experience. The order of the files within the list is | 287 * the user experience. The order of the files within the list is |
| 319 * significant: the first file will be given higher priority than the second, | 288 * significant: the first file will be given higher priority than the second, |
| 320 * the second higher priority than the third, and so on. | 289 * the second higher priority than the third, and so on. |
| 321 * | 290 * |
| 322 * Note that this request determines the set of requested priority files. The | 291 * Note that this request determines the set of requested priority files. The |
| 323 * actual set of priority files is the intersection of the requested set of | 292 * actual set of priority files is the intersection of the requested set of |
| 324 * priority files with the set of files currently subject to analysis. (See | 293 * priority files with the set of files currently subject to analysis. (See |
| 325 * analysis.setSubscriptions for a description of files that are subject to | 294 * analysis.setSubscriptions for a description of files that are subject to |
| 326 * analysis.) | 295 * analysis.) |
| 327 * | 296 * |
| 328 * If a requested priority file is a directory it is ignored, but remains in | 297 * If a requested priority file is a directory it is ignored, but remains in |
| 329 * the set of requested priority files so that if it later becomes a file it | 298 * the set of requested priority files so that if it later becomes a file it |
| 330 * can be included in the set of actual priority files. | 299 * can be included in the set of actual priority files. |
| 331 * | 300 * |
| 332 * Parameters | 301 * Parameters |
| 333 * | 302 * |
| 334 * files ( List<FilePath> ) | 303 * files ( List<FilePath> ) |
| 335 * | 304 * |
| 336 * The files that are to be a priority for analysis. | 305 * The files that are to be a priority for analysis. |
| 337 */ | 306 */ |
| 338 Future sendAnalysisSetPriorityFiles(List<String> files, {bool checkTypes: true
}) { | 307 Future sendAnalysisSetPriorityFiles(List<String> files) { |
| 339 Map<String, dynamic> params = {}; | 308 var params = new AnalysisSetPriorityFilesParams(files).toJson(); |
| 340 params["files"] = files; | |
| 341 if (checkTypes) { | |
| 342 expect(params, isAnalysisSetPriorityFilesParams); | |
| 343 } | |
| 344 return server.send("analysis.setPriorityFiles", params) | 309 return server.send("analysis.setPriorityFiles", params) |
| 345 .then((result) { | 310 .then((result) { |
| 346 if (checkTypes) { | 311 expect(result, isAnalysisSetPriorityFilesResult); |
| 347 expect(result, isAnalysisSetPriorityFilesResult); | |
| 348 } | |
| 349 return result; | 312 return result; |
| 350 }); | 313 }); |
| 351 } | 314 } |
| 352 | 315 |
| 353 /** | 316 /** |
| 354 * Subscribe for services. All previous subscriptions are replaced by the | 317 * Subscribe for services. All previous subscriptions are replaced by the |
| 355 * current set of subscriptions. If a given service is not included as a key | 318 * current set of subscriptions. If a given service is not included as a key |
| 356 * in the map then no files will be subscribed to the service, exactly as if | 319 * in the map then no files will be subscribed to the service, exactly as if |
| 357 * the service had been included in the map with an explicit empty list of | 320 * the service had been included in the map with an explicit empty list of |
| 358 * files. | 321 * files. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 375 * It is an error if any of the keys in the map are not valid services. If | 338 * It is an error if any of the keys in the map are not valid services. If |
| 376 * there is an error, then the existing subscriptions will remain unchanged. | 339 * there is an error, then the existing subscriptions will remain unchanged. |
| 377 * | 340 * |
| 378 * Parameters | 341 * Parameters |
| 379 * | 342 * |
| 380 * subscriptions ( Map<AnalysisService, List<FilePath>> ) | 343 * subscriptions ( Map<AnalysisService, List<FilePath>> ) |
| 381 * | 344 * |
| 382 * A table mapping services to a list of the files being subscribed to the | 345 * A table mapping services to a list of the files being subscribed to the |
| 383 * service. | 346 * service. |
| 384 */ | 347 */ |
| 385 Future sendAnalysisSetSubscriptions(Map<String, List<String>> subscriptions, {
bool checkTypes: true}) { | 348 Future sendAnalysisSetSubscriptions(Map<AnalysisService, List<String>> subscri
ptions) { |
| 386 Map<String, dynamic> params = {}; | 349 var params = new AnalysisSetSubscriptionsParams(subscriptions).toJson(); |
| 387 params["subscriptions"] = subscriptions; | |
| 388 if (checkTypes) { | |
| 389 expect(params, isAnalysisSetSubscriptionsParams); | |
| 390 } | |
| 391 return server.send("analysis.setSubscriptions", params) | 350 return server.send("analysis.setSubscriptions", params) |
| 392 .then((result) { | 351 .then((result) { |
| 393 if (checkTypes) { | 352 expect(result, isAnalysisSetSubscriptionsResult); |
| 394 expect(result, isAnalysisSetSubscriptionsResult); | |
| 395 } | |
| 396 return result; | 353 return result; |
| 397 }); | 354 }); |
| 398 } | 355 } |
| 399 | 356 |
| 400 /** | 357 /** |
| 401 * Update the content of one or more files. Files that were previously | 358 * Update the content of one or more files. Files that were previously |
| 402 * updated but not included in this update remain unchanged. This effectively | 359 * updated but not included in this update remain unchanged. This effectively |
| 403 * represents an overlay of the filesystem. The files whose content is | 360 * represents an overlay of the filesystem. The files whose content is |
| 404 * overridden are therefore seen by server as being files with the given | 361 * overridden are therefore seen by server as being files with the given |
| 405 * content, even if the files do not exist on the filesystem or if the file | 362 * content, even if the files do not exist on the filesystem or if the file |
| 406 * path represents the path to a directory on the filesystem. | 363 * path represents the path to a directory on the filesystem. |
| 407 * | 364 * |
| 408 * Parameters | 365 * Parameters |
| 409 * | 366 * |
| 410 * files ( Map<FilePath, AddContentOverlay | ChangeContentOverlay | | 367 * files ( Map<FilePath, AddContentOverlay | ChangeContentOverlay | |
| 411 * RemoveContentOverlay> ) | 368 * RemoveContentOverlay> ) |
| 412 * | 369 * |
| 413 * A table mapping the files whose content has changed to a description of | 370 * A table mapping the files whose content has changed to a description of |
| 414 * the content change. | 371 * the content change. |
| 415 */ | 372 */ |
| 416 Future sendAnalysisUpdateContent(Map<String, Object> files, {bool checkTypes:
true}) { | 373 Future sendAnalysisUpdateContent(Map<String, dynamic> files) { |
| 417 Map<String, dynamic> params = {}; | 374 var params = new AnalysisUpdateContentParams(files).toJson(); |
| 418 params["files"] = files; | |
| 419 if (checkTypes) { | |
| 420 expect(params, isAnalysisUpdateContentParams); | |
| 421 } | |
| 422 return server.send("analysis.updateContent", params) | 375 return server.send("analysis.updateContent", params) |
| 423 .then((result) { | 376 .then((result) { |
| 424 if (checkTypes) { | 377 expect(result, isAnalysisUpdateContentResult); |
| 425 expect(result, isAnalysisUpdateContentResult); | |
| 426 } | |
| 427 return result; | 378 return result; |
| 428 }); | 379 }); |
| 429 } | 380 } |
| 430 | 381 |
| 431 /** | 382 /** |
| 432 * Update the options controlling analysis based on the given set of options. | 383 * Update the options controlling analysis based on the given set of options. |
| 433 * Any options that are not included in the analysis options will not be | 384 * Any options that are not included in the analysis options will not be |
| 434 * changed. If there are options in the analysis options that are not valid, | 385 * changed. If there are options in the analysis options that are not valid, |
| 435 * they will be silently ignored. | 386 * they will be silently ignored. |
| 436 * | 387 * |
| 437 * Parameters | 388 * Parameters |
| 438 * | 389 * |
| 439 * options ( AnalysisOptions ) | 390 * options ( AnalysisOptions ) |
| 440 * | 391 * |
| 441 * The options that are to be used to control analysis. | 392 * The options that are to be used to control analysis. |
| 442 */ | 393 */ |
| 443 Future sendAnalysisUpdateOptions(Map<String, dynamic> options, {bool checkType
s: true}) { | 394 Future sendAnalysisUpdateOptions(AnalysisOptions options) { |
| 444 Map<String, dynamic> params = {}; | 395 var params = new AnalysisUpdateOptionsParams(options).toJson(); |
| 445 params["options"] = options; | |
| 446 if (checkTypes) { | |
| 447 expect(params, isAnalysisUpdateOptionsParams); | |
| 448 } | |
| 449 return server.send("analysis.updateOptions", params) | 396 return server.send("analysis.updateOptions", params) |
| 450 .then((result) { | 397 .then((result) { |
| 451 if (checkTypes) { | 398 expect(result, isAnalysisUpdateOptionsResult); |
| 452 expect(result, isAnalysisUpdateOptionsResult); | |
| 453 } | |
| 454 return result; | 399 return result; |
| 455 }); | 400 }); |
| 456 } | 401 } |
| 457 | 402 |
| 458 /** | 403 /** |
| 459 * Reports the errors associated with a given file. The set of errors | 404 * Reports the errors associated with a given file. The set of errors |
| 460 * included in the notification is always a complete list that supersedes any | 405 * included in the notification is always a complete list that supersedes any |
| 461 * previously reported errors. | 406 * previously reported errors. |
| 462 * | 407 * |
| 463 * It is only possible to unsubscribe from this notification by using the | 408 * It is only possible to unsubscribe from this notification by using the |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 * offset ( int ) | 621 * offset ( int ) |
| 677 * | 622 * |
| 678 * The offset within the file at which suggestions are to be made. | 623 * The offset within the file at which suggestions are to be made. |
| 679 * | 624 * |
| 680 * Returns | 625 * Returns |
| 681 * | 626 * |
| 682 * id ( CompletionId ) | 627 * id ( CompletionId ) |
| 683 * | 628 * |
| 684 * The identifier used to associate results with this completion request. | 629 * The identifier used to associate results with this completion request. |
| 685 */ | 630 */ |
| 686 Future sendCompletionGetSuggestions(String file, int offset, {bool checkTypes:
true}) { | 631 Future sendCompletionGetSuggestions(String file, int offset) { |
| 687 Map<String, dynamic> params = {}; | 632 var params = new CompletionGetSuggestionsParams(file, offset).toJson(); |
| 688 params["file"] = file; | |
| 689 params["offset"] = offset; | |
| 690 if (checkTypes) { | |
| 691 expect(params, isCompletionGetSuggestionsParams); | |
| 692 } | |
| 693 return server.send("completion.getSuggestions", params) | 633 return server.send("completion.getSuggestions", params) |
| 694 .then((result) { | 634 .then((result) { |
| 695 if (checkTypes) { | 635 expect(result, isCompletionGetSuggestionsResult); |
| 696 expect(result, isCompletionGetSuggestionsResult); | |
| 697 } | |
| 698 return result; | 636 return result; |
| 699 }); | 637 }); |
| 700 } | 638 } |
| 701 | 639 |
| 702 /** | 640 /** |
| 703 * Reports the completion suggestions that should be presented to the user. | 641 * Reports the completion suggestions that should be presented to the user. |
| 704 * The set of suggestions included in the notification is always a complete | 642 * The set of suggestions included in the notification is always a complete |
| 705 * list that supersedes any previously reported suggestions. | 643 * list that supersedes any previously reported suggestions. |
| 706 * | 644 * |
| 707 * Parameters | 645 * Parameters |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 * notification. | 716 * notification. |
| 779 * | 717 * |
| 780 * element ( optional Element ) | 718 * element ( optional Element ) |
| 781 * | 719 * |
| 782 * The element referenced or defined at the given offset and whose | 720 * The element referenced or defined at the given offset and whose |
| 783 * references will be returned in the search results. | 721 * references will be returned in the search results. |
| 784 * | 722 * |
| 785 * If no element was found at the given location, this field will be | 723 * If no element was found at the given location, this field will be |
| 786 * absent. | 724 * absent. |
| 787 */ | 725 */ |
| 788 Future sendSearchFindElementReferences(String file, int offset, bool includePo
tential, {bool checkTypes: true}) { | 726 Future sendSearchFindElementReferences(String file, int offset, bool includePo
tential) { |
| 789 Map<String, dynamic> params = {}; | 727 var params = new SearchFindElementReferencesParams(file, offset, includePote
ntial).toJson(); |
| 790 params["file"] = file; | |
| 791 params["offset"] = offset; | |
| 792 params["includePotential"] = includePotential; | |
| 793 if (checkTypes) { | |
| 794 expect(params, isSearchFindElementReferencesParams); | |
| 795 } | |
| 796 return server.send("search.findElementReferences", params) | 728 return server.send("search.findElementReferences", params) |
| 797 .then((result) { | 729 .then((result) { |
| 798 if (checkTypes) { | 730 expect(result, isSearchFindElementReferencesResult); |
| 799 expect(result, isSearchFindElementReferencesResult); | |
| 800 } | |
| 801 return result; | 731 return result; |
| 802 }); | 732 }); |
| 803 } | 733 } |
| 804 | 734 |
| 805 /** | 735 /** |
| 806 * Perform a search for declarations of members whose name is equal to the | 736 * Perform a search for declarations of members whose name is equal to the |
| 807 * given name. | 737 * given name. |
| 808 * | 738 * |
| 809 * An identifier is returned immediately, and individual results will be | 739 * An identifier is returned immediately, and individual results will be |
| 810 * returned via the search.results notification as they become available. | 740 * returned via the search.results notification as they become available. |
| 811 * | 741 * |
| 812 * Parameters | 742 * Parameters |
| 813 * | 743 * |
| 814 * name ( String ) | 744 * name ( String ) |
| 815 * | 745 * |
| 816 * The name of the declarations to be found. | 746 * The name of the declarations to be found. |
| 817 * | 747 * |
| 818 * Returns | 748 * Returns |
| 819 * | 749 * |
| 820 * id ( SearchId ) | 750 * id ( SearchId ) |
| 821 * | 751 * |
| 822 * The identifier used to associate results with this search request. | 752 * The identifier used to associate results with this search request. |
| 823 */ | 753 */ |
| 824 Future sendSearchFindMemberDeclarations(String name, {bool checkTypes: true})
{ | 754 Future sendSearchFindMemberDeclarations(String name) { |
| 825 Map<String, dynamic> params = {}; | 755 var params = new SearchFindMemberDeclarationsParams(name).toJson(); |
| 826 params["name"] = name; | |
| 827 if (checkTypes) { | |
| 828 expect(params, isSearchFindMemberDeclarationsParams); | |
| 829 } | |
| 830 return server.send("search.findMemberDeclarations", params) | 756 return server.send("search.findMemberDeclarations", params) |
| 831 .then((result) { | 757 .then((result) { |
| 832 if (checkTypes) { | 758 expect(result, isSearchFindMemberDeclarationsResult); |
| 833 expect(result, isSearchFindMemberDeclarationsResult); | |
| 834 } | |
| 835 return result; | 759 return result; |
| 836 }); | 760 }); |
| 837 } | 761 } |
| 838 | 762 |
| 839 /** | 763 /** |
| 840 * Perform a search for references to members whose name is equal to the | 764 * Perform a search for references to members whose name is equal to the |
| 841 * given name. This search does not check to see that there is a member | 765 * given name. This search does not check to see that there is a member |
| 842 * defined with the given name, so it is able to find references to undefined | 766 * defined with the given name, so it is able to find references to undefined |
| 843 * members as well. | 767 * members as well. |
| 844 * | 768 * |
| 845 * An identifier is returned immediately, and individual results will be | 769 * An identifier is returned immediately, and individual results will be |
| 846 * returned via the search.results notification as they become available. | 770 * returned via the search.results notification as they become available. |
| 847 * | 771 * |
| 848 * Parameters | 772 * Parameters |
| 849 * | 773 * |
| 850 * name ( String ) | 774 * name ( String ) |
| 851 * | 775 * |
| 852 * The name of the references to be found. | 776 * The name of the references to be found. |
| 853 * | 777 * |
| 854 * Returns | 778 * Returns |
| 855 * | 779 * |
| 856 * id ( SearchId ) | 780 * id ( SearchId ) |
| 857 * | 781 * |
| 858 * The identifier used to associate results with this search request. | 782 * The identifier used to associate results with this search request. |
| 859 */ | 783 */ |
| 860 Future sendSearchFindMemberReferences(String name, {bool checkTypes: true}) { | 784 Future sendSearchFindMemberReferences(String name) { |
| 861 Map<String, dynamic> params = {}; | 785 var params = new SearchFindMemberReferencesParams(name).toJson(); |
| 862 params["name"] = name; | |
| 863 if (checkTypes) { | |
| 864 expect(params, isSearchFindMemberReferencesParams); | |
| 865 } | |
| 866 return server.send("search.findMemberReferences", params) | 786 return server.send("search.findMemberReferences", params) |
| 867 .then((result) { | 787 .then((result) { |
| 868 if (checkTypes) { | 788 expect(result, isSearchFindMemberReferencesResult); |
| 869 expect(result, isSearchFindMemberReferencesResult); | |
| 870 } | |
| 871 return result; | 789 return result; |
| 872 }); | 790 }); |
| 873 } | 791 } |
| 874 | 792 |
| 875 /** | 793 /** |
| 876 * Perform a search for declarations of top-level elements (classes, | 794 * Perform a search for declarations of top-level elements (classes, |
| 877 * typedefs, getters, setters, functions and fields) whose name matches the | 795 * typedefs, getters, setters, functions and fields) whose name matches the |
| 878 * given pattern. | 796 * given pattern. |
| 879 * | 797 * |
| 880 * An identifier is returned immediately, and individual results will be | 798 * An identifier is returned immediately, and individual results will be |
| 881 * returned via the search.results notification as they become available. | 799 * returned via the search.results notification as they become available. |
| 882 * | 800 * |
| 883 * Parameters | 801 * Parameters |
| 884 * | 802 * |
| 885 * pattern ( String ) | 803 * pattern ( String ) |
| 886 * | 804 * |
| 887 * The regular expression used to match the names of the declarations to be | 805 * The regular expression used to match the names of the declarations to be |
| 888 * found. | 806 * found. |
| 889 * | 807 * |
| 890 * Returns | 808 * Returns |
| 891 * | 809 * |
| 892 * id ( SearchId ) | 810 * id ( SearchId ) |
| 893 * | 811 * |
| 894 * The identifier used to associate results with this search request. | 812 * The identifier used to associate results with this search request. |
| 895 */ | 813 */ |
| 896 Future sendSearchFindTopLevelDeclarations(String pattern, {bool checkTypes: tr
ue}) { | 814 Future sendSearchFindTopLevelDeclarations(String pattern) { |
| 897 Map<String, dynamic> params = {}; | 815 var params = new SearchFindTopLevelDeclarationsParams(pattern).toJson(); |
| 898 params["pattern"] = pattern; | |
| 899 if (checkTypes) { | |
| 900 expect(params, isSearchFindTopLevelDeclarationsParams); | |
| 901 } | |
| 902 return server.send("search.findTopLevelDeclarations", params) | 816 return server.send("search.findTopLevelDeclarations", params) |
| 903 .then((result) { | 817 .then((result) { |
| 904 if (checkTypes) { | 818 expect(result, isSearchFindTopLevelDeclarationsResult); |
| 905 expect(result, isSearchFindTopLevelDeclarationsResult); | |
| 906 } | |
| 907 return result; | 819 return result; |
| 908 }); | 820 }); |
| 909 } | 821 } |
| 910 | 822 |
| 911 /** | 823 /** |
| 912 * Return the type hierarchy of the class declared or referenced at the given | 824 * Return the type hierarchy of the class declared or referenced at the given |
| 913 * location. | 825 * location. |
| 914 * | 826 * |
| 915 * Parameters | 827 * Parameters |
| 916 * | 828 * |
| (...skipping 13 matching lines...) Expand all Loading... |
| 930 * A list of the types in the requested hierarchy. The first element of the | 842 * A list of the types in the requested hierarchy. The first element of the |
| 931 * list is the item representing the type for which the hierarchy was | 843 * list is the item representing the type for which the hierarchy was |
| 932 * requested. The index of other elements of the list is unspecified, but | 844 * requested. The index of other elements of the list is unspecified, but |
| 933 * correspond to the integers used to reference supertype and subtype items | 845 * correspond to the integers used to reference supertype and subtype items |
| 934 * within the items. | 846 * within the items. |
| 935 * | 847 * |
| 936 * This field will be absent if the code at the given file and offset does | 848 * This field will be absent if the code at the given file and offset does |
| 937 * not represent a type, or if the file has not been sufficiently analyzed | 849 * not represent a type, or if the file has not been sufficiently analyzed |
| 938 * to allow a type hierarchy to be produced. | 850 * to allow a type hierarchy to be produced. |
| 939 */ | 851 */ |
| 940 Future sendSearchGetTypeHierarchy(String file, int offset, {bool checkTypes: t
rue}) { | 852 Future sendSearchGetTypeHierarchy(String file, int offset) { |
| 941 Map<String, dynamic> params = {}; | 853 var params = new SearchGetTypeHierarchyParams(file, offset).toJson(); |
| 942 params["file"] = file; | |
| 943 params["offset"] = offset; | |
| 944 if (checkTypes) { | |
| 945 expect(params, isSearchGetTypeHierarchyParams); | |
| 946 } | |
| 947 return server.send("search.getTypeHierarchy", params) | 854 return server.send("search.getTypeHierarchy", params) |
| 948 .then((result) { | 855 .then((result) { |
| 949 if (checkTypes) { | 856 expect(result, isSearchGetTypeHierarchyResult); |
| 950 expect(result, isSearchGetTypeHierarchyResult); | |
| 951 } | |
| 952 return result; | 857 return result; |
| 953 }); | 858 }); |
| 954 } | 859 } |
| 955 | 860 |
| 956 /** | 861 /** |
| 957 * Reports some or all of the results of performing a requested search. | 862 * Reports some or all of the results of performing a requested search. |
| 958 * Unlike other notifications, this notification contains search results that | 863 * Unlike other notifications, this notification contains search results that |
| 959 * should be added to any previously received search results associated with | 864 * should be added to any previously received search results associated with |
| 960 * the same search id. | 865 * the same search id. |
| 961 * | 866 * |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 * length ( int ) | 905 * length ( int ) |
| 1001 * | 906 * |
| 1002 * The length of the code for which assists are being requested. | 907 * The length of the code for which assists are being requested. |
| 1003 * | 908 * |
| 1004 * Returns | 909 * Returns |
| 1005 * | 910 * |
| 1006 * assists ( List<SourceChange> ) | 911 * assists ( List<SourceChange> ) |
| 1007 * | 912 * |
| 1008 * The assists that are available at the given location. | 913 * The assists that are available at the given location. |
| 1009 */ | 914 */ |
| 1010 Future sendEditGetAssists(String file, int offset, int length, {bool checkType
s: true}) { | 915 Future sendEditGetAssists(String file, int offset, int length) { |
| 1011 Map<String, dynamic> params = {}; | 916 var params = new EditGetAssistsParams(file, offset, length).toJson(); |
| 1012 params["file"] = file; | |
| 1013 params["offset"] = offset; | |
| 1014 params["length"] = length; | |
| 1015 if (checkTypes) { | |
| 1016 expect(params, isEditGetAssistsParams); | |
| 1017 } | |
| 1018 return server.send("edit.getAssists", params) | 917 return server.send("edit.getAssists", params) |
| 1019 .then((result) { | 918 .then((result) { |
| 1020 if (checkTypes) { | 919 expect(result, isEditGetAssistsResult); |
| 1021 expect(result, isEditGetAssistsResult); | |
| 1022 } | |
| 1023 return result; | 920 return result; |
| 1024 }); | 921 }); |
| 1025 } | 922 } |
| 1026 | 923 |
| 1027 /** | 924 /** |
| 1028 * Get a list of the kinds of refactorings that are valid for the given | 925 * Get a list of the kinds of refactorings that are valid for the given |
| 1029 * selection in the given file. | 926 * selection in the given file. |
| 1030 * | 927 * |
| 1031 * Parameters | 928 * Parameters |
| 1032 * | 929 * |
| 1033 * file ( FilePath ) | 930 * file ( FilePath ) |
| 1034 * | 931 * |
| 1035 * The file containing the code on which the refactoring would be based. | 932 * The file containing the code on which the refactoring would be based. |
| 1036 * | 933 * |
| 1037 * offset ( int ) | 934 * offset ( int ) |
| 1038 * | 935 * |
| 1039 * The offset of the code on which the refactoring would be based. | 936 * The offset of the code on which the refactoring would be based. |
| 1040 * | 937 * |
| 1041 * length ( int ) | 938 * length ( int ) |
| 1042 * | 939 * |
| 1043 * The length of the code on which the refactoring would be based. | 940 * The length of the code on which the refactoring would be based. |
| 1044 * | 941 * |
| 1045 * Returns | 942 * Returns |
| 1046 * | 943 * |
| 1047 * kinds ( List<RefactoringKind> ) | 944 * kinds ( List<RefactoringKind> ) |
| 1048 * | 945 * |
| 1049 * The kinds of refactorings that are valid for the given selection. | 946 * The kinds of refactorings that are valid for the given selection. |
| 1050 */ | 947 */ |
| 1051 Future sendEditGetAvailableRefactorings(String file, int offset, int length, {
bool checkTypes: true}) { | 948 Future sendEditGetAvailableRefactorings(String file, int offset, int length) { |
| 1052 Map<String, dynamic> params = {}; | 949 var params = new EditGetAvailableRefactoringsParams(file, offset, length).to
Json(); |
| 1053 params["file"] = file; | |
| 1054 params["offset"] = offset; | |
| 1055 params["length"] = length; | |
| 1056 if (checkTypes) { | |
| 1057 expect(params, isEditGetAvailableRefactoringsParams); | |
| 1058 } | |
| 1059 return server.send("edit.getAvailableRefactorings", params) | 950 return server.send("edit.getAvailableRefactorings", params) |
| 1060 .then((result) { | 951 .then((result) { |
| 1061 if (checkTypes) { | 952 expect(result, isEditGetAvailableRefactoringsResult); |
| 1062 expect(result, isEditGetAvailableRefactoringsResult); | |
| 1063 } | |
| 1064 return result; | 953 return result; |
| 1065 }); | 954 }); |
| 1066 } | 955 } |
| 1067 | 956 |
| 1068 /** | 957 /** |
| 1069 * Return the set of fixes that are available for the errors at a given | 958 * Return the set of fixes that are available for the errors at a given |
| 1070 * offset in a given file. | 959 * offset in a given file. |
| 1071 * | 960 * |
| 1072 * Parameters | 961 * Parameters |
| 1073 * | 962 * |
| 1074 * file ( FilePath ) | 963 * file ( FilePath ) |
| 1075 * | 964 * |
| 1076 * The file containing the errors for which fixes are being requested. | 965 * The file containing the errors for which fixes are being requested. |
| 1077 * | 966 * |
| 1078 * offset ( int ) | 967 * offset ( int ) |
| 1079 * | 968 * |
| 1080 * The offset used to select the errors for which fixes will be returned. | 969 * The offset used to select the errors for which fixes will be returned. |
| 1081 * | 970 * |
| 1082 * Returns | 971 * Returns |
| 1083 * | 972 * |
| 1084 * fixes ( List<AnalysisErrorFixes> ) | 973 * fixes ( List<AnalysisErrorFixes> ) |
| 1085 * | 974 * |
| 1086 * The fixes that are available for the errors at the given offset. | 975 * The fixes that are available for the errors at the given offset. |
| 1087 */ | 976 */ |
| 1088 Future sendEditGetFixes(String file, int offset, {bool checkTypes: true}) { | 977 Future sendEditGetFixes(String file, int offset) { |
| 1089 Map<String, dynamic> params = {}; | 978 var params = new EditGetFixesParams(file, offset).toJson(); |
| 1090 params["file"] = file; | |
| 1091 params["offset"] = offset; | |
| 1092 if (checkTypes) { | |
| 1093 expect(params, isEditGetFixesParams); | |
| 1094 } | |
| 1095 return server.send("edit.getFixes", params) | 979 return server.send("edit.getFixes", params) |
| 1096 .then((result) { | 980 .then((result) { |
| 1097 if (checkTypes) { | 981 expect(result, isEditGetFixesResult); |
| 1098 expect(result, isEditGetFixesResult); | |
| 1099 } | |
| 1100 return result; | 982 return result; |
| 1101 }); | 983 }); |
| 1102 } | 984 } |
| 1103 | 985 |
| 1104 /** | 986 /** |
| 1105 * Get the changes required to perform a refactoring. | 987 * Get the changes required to perform a refactoring. |
| 1106 * | 988 * |
| 1107 * Parameters | 989 * Parameters |
| 1108 * | 990 * |
| 1109 * kind ( RefactoringKind ) | 991 * kind ( RefactoringKind ) |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 * potentialEdits ( optional List<String> ) | 1054 * potentialEdits ( optional List<String> ) |
| 1173 * | 1055 * |
| 1174 * The ids of source edits that are not known to be valid. An edit is not | 1056 * The ids of source edits that are not known to be valid. An edit is not |
| 1175 * known to be valid if there was insufficient type information for the | 1057 * known to be valid if there was insufficient type information for the |
| 1176 * server to be able to determine whether or not the code needs to be | 1058 * server to be able to determine whether or not the code needs to be |
| 1177 * modified, such as when a member is being renamed and there is a | 1059 * modified, such as when a member is being renamed and there is a |
| 1178 * reference to a member from an unknown type. This field will be omitted | 1060 * reference to a member from an unknown type. This field will be omitted |
| 1179 * if the change field is omitted or if there are no potential edits for | 1061 * if the change field is omitted or if there are no potential edits for |
| 1180 * the refactoring. | 1062 * the refactoring. |
| 1181 */ | 1063 */ |
| 1182 Future sendEditGetRefactoring(String kind, String file, int offset, int length
, bool validateOnly, {Map<String, dynamic> options, bool checkTypes: true}) { | 1064 Future sendEditGetRefactoring(RefactoringKind kind, String file, int offset, i
nt length, bool validateOnly, {RefactoringOptions options}) { |
| 1183 Map<String, dynamic> params = {}; | 1065 var params = new EditGetRefactoringParams(kind, file, offset, length, valida
teOnly, options: options).toJson(); |
| 1184 params["kind"] = kind; | |
| 1185 params["file"] = file; | |
| 1186 params["offset"] = offset; | |
| 1187 params["length"] = length; | |
| 1188 params["validateOnly"] = validateOnly; | |
| 1189 if (options != null) { | |
| 1190 params["options"] = options; | |
| 1191 } | |
| 1192 if (checkTypes) { | |
| 1193 expect(params, isEditGetRefactoringParams); | |
| 1194 } | |
| 1195 return server.send("edit.getRefactoring", params) | 1066 return server.send("edit.getRefactoring", params) |
| 1196 .then((result) { | 1067 .then((result) { |
| 1197 if (checkTypes) { | 1068 expect(result, isEditGetRefactoringResult); |
| 1198 expect(result, isEditGetRefactoringResult); | |
| 1199 } | |
| 1200 return result; | 1069 return result; |
| 1201 }); | 1070 }); |
| 1202 } | 1071 } |
| 1203 | 1072 |
| 1204 /** | 1073 /** |
| 1205 * Sort all of the directives, unit and class members of the given Dart file. | 1074 * Sort all of the directives, unit and class members of the given Dart file. |
| 1206 * | 1075 * |
| 1207 * If a request is made for a file that does not exist, does not belong to an | 1076 * If a request is made for a file that does not exist, does not belong to an |
| 1208 * analysis root or is not a Dart file, SORT_MEMBERS_INVALID_FILE will be | 1077 * analysis root or is not a Dart file, SORT_MEMBERS_INVALID_FILE will be |
| 1209 * generated. | 1078 * generated. |
| 1210 * | 1079 * |
| 1211 * If the Dart file has scan or parse errors, SORT_MEMBERS_PARSE_ERRORS will | 1080 * If the Dart file has scan or parse errors, SORT_MEMBERS_PARSE_ERRORS will |
| 1212 * be generated. | 1081 * be generated. |
| 1213 * | 1082 * |
| 1214 * Parameters | 1083 * Parameters |
| 1215 * | 1084 * |
| 1216 * file ( FilePath ) | 1085 * file ( FilePath ) |
| 1217 * | 1086 * |
| 1218 * The Dart file to sort. | 1087 * The Dart file to sort. |
| 1219 * | 1088 * |
| 1220 * Returns | 1089 * Returns |
| 1221 * | 1090 * |
| 1222 * edit ( SourceFileEdit ) | 1091 * edit ( SourceFileEdit ) |
| 1223 * | 1092 * |
| 1224 * The file edit that is to be applied to the given file to effect the | 1093 * The file edit that is to be applied to the given file to effect the |
| 1225 * sorting. | 1094 * sorting. |
| 1226 */ | 1095 */ |
| 1227 Future sendEditSortMembers(String file, {bool checkTypes: true}) { | 1096 Future sendEditSortMembers(String file) { |
| 1228 Map<String, dynamic> params = {}; | 1097 var params = new EditSortMembersParams(file).toJson(); |
| 1229 params["file"] = file; | |
| 1230 if (checkTypes) { | |
| 1231 expect(params, isEditSortMembersParams); | |
| 1232 } | |
| 1233 return server.send("edit.sortMembers", params) | 1098 return server.send("edit.sortMembers", params) |
| 1234 .then((result) { | 1099 .then((result) { |
| 1235 if (checkTypes) { | 1100 expect(result, isEditSortMembersResult); |
| 1236 expect(result, isEditSortMembersResult); | |
| 1237 } | |
| 1238 return result; | 1101 return result; |
| 1239 }); | 1102 }); |
| 1240 } | 1103 } |
| 1241 | 1104 |
| 1242 /** | 1105 /** |
| 1243 * Create an execution context for the executable file with the given path. | 1106 * Create an execution context for the executable file with the given path. |
| 1244 * The context that is created will persist until execution.deleteContext is | 1107 * The context that is created will persist until execution.deleteContext is |
| 1245 * used to delete it. Clients, therefore, are responsible for managing the | 1108 * used to delete it. Clients, therefore, are responsible for managing the |
| 1246 * lifetime of execution contexts. | 1109 * lifetime of execution contexts. |
| 1247 * | 1110 * |
| 1248 * Parameters | 1111 * Parameters |
| 1249 * | 1112 * |
| 1250 * contextRoot ( FilePath ) | 1113 * contextRoot ( FilePath ) |
| 1251 * | 1114 * |
| 1252 * The path of the Dart or HTML file that will be launched. | 1115 * The path of the Dart or HTML file that will be launched. |
| 1253 * | 1116 * |
| 1254 * Returns | 1117 * Returns |
| 1255 * | 1118 * |
| 1256 * id ( ExecutionContextId ) | 1119 * id ( ExecutionContextId ) |
| 1257 * | 1120 * |
| 1258 * The identifier used to refer to the execution context that was created. | 1121 * The identifier used to refer to the execution context that was created. |
| 1259 */ | 1122 */ |
| 1260 Future sendExecutionCreateContext(String contextRoot, {bool checkTypes: true})
{ | 1123 Future sendExecutionCreateContext(String contextRoot) { |
| 1261 Map<String, dynamic> params = {}; | 1124 var params = new ExecutionCreateContextParams(contextRoot).toJson(); |
| 1262 params["contextRoot"] = contextRoot; | |
| 1263 if (checkTypes) { | |
| 1264 expect(params, isExecutionCreateContextParams); | |
| 1265 } | |
| 1266 return server.send("execution.createContext", params) | 1125 return server.send("execution.createContext", params) |
| 1267 .then((result) { | 1126 .then((result) { |
| 1268 if (checkTypes) { | 1127 expect(result, isExecutionCreateContextResult); |
| 1269 expect(result, isExecutionCreateContextResult); | |
| 1270 } | |
| 1271 return result; | 1128 return result; |
| 1272 }); | 1129 }); |
| 1273 } | 1130 } |
| 1274 | 1131 |
| 1275 /** | 1132 /** |
| 1276 * Delete the execution context with the given identifier. The context id is | 1133 * Delete the execution context with the given identifier. The context id is |
| 1277 * no longer valid after this command. The server is allowed to re-use ids | 1134 * no longer valid after this command. The server is allowed to re-use ids |
| 1278 * when they are no longer valid. | 1135 * when they are no longer valid. |
| 1279 * | 1136 * |
| 1280 * Parameters | 1137 * Parameters |
| 1281 * | 1138 * |
| 1282 * id ( ExecutionContextId ) | 1139 * id ( ExecutionContextId ) |
| 1283 * | 1140 * |
| 1284 * The identifier of the execution context that is to be deleted. | 1141 * The identifier of the execution context that is to be deleted. |
| 1285 */ | 1142 */ |
| 1286 Future sendExecutionDeleteContext(String id, {bool checkTypes: true}) { | 1143 Future sendExecutionDeleteContext(String id) { |
| 1287 Map<String, dynamic> params = {}; | 1144 var params = new ExecutionDeleteContextParams(id).toJson(); |
| 1288 params["id"] = id; | |
| 1289 if (checkTypes) { | |
| 1290 expect(params, isExecutionDeleteContextParams); | |
| 1291 } | |
| 1292 return server.send("execution.deleteContext", params) | 1145 return server.send("execution.deleteContext", params) |
| 1293 .then((result) { | 1146 .then((result) { |
| 1294 if (checkTypes) { | 1147 expect(result, isExecutionDeleteContextResult); |
| 1295 expect(result, isExecutionDeleteContextResult); | |
| 1296 } | |
| 1297 return result; | 1148 return result; |
| 1298 }); | 1149 }); |
| 1299 } | 1150 } |
| 1300 | 1151 |
| 1301 /** | 1152 /** |
| 1302 * Map a URI from the execution context to the file that it corresponds to, | 1153 * Map a URI from the execution context to the file that it corresponds to, |
| 1303 * or map a file to the URI that it corresponds to in the execution context. | 1154 * or map a file to the URI that it corresponds to in the execution context. |
| 1304 * | 1155 * |
| 1305 * Exactly one of the file and uri fields must be provided. | 1156 * Exactly one of the file and uri fields must be provided. |
| 1306 * | 1157 * |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1324 * file ( optional FilePath ) | 1175 * file ( optional FilePath ) |
| 1325 * | 1176 * |
| 1326 * The file to which the URI was mapped. This field is omitted if the uri | 1177 * The file to which the URI was mapped. This field is omitted if the uri |
| 1327 * field was not given in the request. | 1178 * field was not given in the request. |
| 1328 * | 1179 * |
| 1329 * uri ( optional String ) | 1180 * uri ( optional String ) |
| 1330 * | 1181 * |
| 1331 * The URI to which the file path was mapped. This field is omitted if the | 1182 * The URI to which the file path was mapped. This field is omitted if the |
| 1332 * file field was not given in the request. | 1183 * file field was not given in the request. |
| 1333 */ | 1184 */ |
| 1334 Future sendExecutionMapUri(String id, {String file, String uri, bool checkType
s: true}) { | 1185 Future sendExecutionMapUri(String id, {String file, String uri}) { |
| 1335 Map<String, dynamic> params = {}; | 1186 var params = new ExecutionMapUriParams(id, file: file, uri: uri).toJson(); |
| 1336 params["id"] = id; | |
| 1337 if (file != null) { | |
| 1338 params["file"] = file; | |
| 1339 } | |
| 1340 if (uri != null) { | |
| 1341 params["uri"] = uri; | |
| 1342 } | |
| 1343 if (checkTypes) { | |
| 1344 expect(params, isExecutionMapUriParams); | |
| 1345 } | |
| 1346 return server.send("execution.mapUri", params) | 1187 return server.send("execution.mapUri", params) |
| 1347 .then((result) { | 1188 .then((result) { |
| 1348 if (checkTypes) { | 1189 expect(result, isExecutionMapUriResult); |
| 1349 expect(result, isExecutionMapUriResult); | |
| 1350 } | |
| 1351 return result; | 1190 return result; |
| 1352 }); | 1191 }); |
| 1353 } | 1192 } |
| 1354 | 1193 |
| 1355 /** | 1194 /** |
| 1356 * Subscribe for services. All previous subscriptions are replaced by the | 1195 * Subscribe for services. All previous subscriptions are replaced by the |
| 1357 * given set of services. | 1196 * given set of services. |
| 1358 * | 1197 * |
| 1359 * It is an error if any of the elements in the list are not valid services. | 1198 * It is an error if any of the elements in the list are not valid services. |
| 1360 * If there is an error, then the current subscriptions will remain | 1199 * If there is an error, then the current subscriptions will remain |
| 1361 * unchanged. | 1200 * unchanged. |
| 1362 * | 1201 * |
| 1363 * Parameters | 1202 * Parameters |
| 1364 * | 1203 * |
| 1365 * subscriptions ( List<ExecutionService> ) | 1204 * subscriptions ( List<ExecutionService> ) |
| 1366 * | 1205 * |
| 1367 * A list of the services being subscribed to. | 1206 * A list of the services being subscribed to. |
| 1368 */ | 1207 */ |
| 1369 Future sendExecutionSetSubscriptions(List<String> subscriptions, {bool checkTy
pes: true}) { | 1208 Future sendExecutionSetSubscriptions(List<ExecutionService> subscriptions) { |
| 1370 Map<String, dynamic> params = {}; | 1209 var params = new ExecutionSetSubscriptionsParams(subscriptions).toJson(); |
| 1371 params["subscriptions"] = subscriptions; | |
| 1372 if (checkTypes) { | |
| 1373 expect(params, isExecutionSetSubscriptionsParams); | |
| 1374 } | |
| 1375 return server.send("execution.setSubscriptions", params) | 1210 return server.send("execution.setSubscriptions", params) |
| 1376 .then((result) { | 1211 .then((result) { |
| 1377 if (checkTypes) { | 1212 expect(result, isExecutionSetSubscriptionsResult); |
| 1378 expect(result, isExecutionSetSubscriptionsResult); | |
| 1379 } | |
| 1380 return result; | 1213 return result; |
| 1381 }); | 1214 }); |
| 1382 } | 1215 } |
| 1383 | 1216 |
| 1384 /** | 1217 /** |
| 1385 * Reports information needed to allow a single file to be launched. | 1218 * Reports information needed to allow a single file to be launched. |
| 1386 * | 1219 * |
| 1387 * This notification is not subscribed to by default. Clients can subscribe | 1220 * This notification is not subscribed to by default. Clients can subscribe |
| 1388 * by including the value "LAUNCH_DATA" in the list of services passed in an | 1221 * by including the value "LAUNCH_DATA" in the list of services passed in an |
| 1389 * execution.setSubscriptions request. | 1222 * execution.setSubscriptions request. |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1508 case "execution.launchData": | 1341 case "execution.launchData": |
| 1509 expect(params, isExecutionLaunchDataParams); | 1342 expect(params, isExecutionLaunchDataParams); |
| 1510 _onExecutionLaunchData.add(params); | 1343 _onExecutionLaunchData.add(params); |
| 1511 break; | 1344 break; |
| 1512 default: | 1345 default: |
| 1513 fail('Unexpected notification: $event'); | 1346 fail('Unexpected notification: $event'); |
| 1514 break; | 1347 break; |
| 1515 } | 1348 } |
| 1516 } | 1349 } |
| 1517 } | 1350 } |
| OLD | NEW |