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

Side by Side Diff: pkg/analysis_server/test/integration/integration_test_methods.dart

Issue 2233633003: Convert to async/await parts that cause strong mode warnings. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
OLDNEW
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
(...skipping 18 matching lines...) Expand all
29 29
30 /** 30 /**
31 * Return the version number of the analysis server. 31 * Return the version number of the analysis server.
32 * 32 *
33 * Returns 33 * Returns
34 * 34 *
35 * version ( String ) 35 * version ( String )
36 * 36 *
37 * The version number of the analysis server. 37 * The version number of the analysis server.
38 */ 38 */
39 Future<ServerGetVersionResult> sendServerGetVersion() { 39 Future<ServerGetVersionResult> sendServerGetVersion() async {
40 return server.send("server.getVersion", null) 40 var result = await server.send("server.getVersion", null);
41 .then((result) { 41 ResponseDecoder decoder = new ResponseDecoder(null);
42 ResponseDecoder decoder = new ResponseDecoder(null); 42 return new ServerGetVersionResult.fromJson(decoder, 'result', result);
43 return new ServerGetVersionResult.fromJson(decoder, 'result', result);
44 });
45 } 43 }
46 44
47 /** 45 /**
48 * Cleanly shutdown the analysis server. Requests that are received after 46 * Cleanly shutdown the analysis server. Requests that are received after
49 * this request will not be processed. Requests that were received before 47 * 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 48 * 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 49 * responded to. No further responses or notifications will be sent after the
52 * response to this request has been sent. 50 * response to this request has been sent.
53 */ 51 */
54 Future sendServerShutdown() { 52 Future sendServerShutdown() async {
55 return server.send("server.shutdown", null) 53 var result = await server.send("server.shutdown", null);
56 .then((result) { 54 expect(result, isNull);
57 expect(result, isNull); 55 return null;
58 return null;
59 });
60 } 56 }
61 57
62 /** 58 /**
63 * Subscribe for services. All previous subscriptions are replaced by the 59 * Subscribe for services. All previous subscriptions are replaced by the
64 * given set of services. 60 * given set of services.
65 * 61 *
66 * It is an error if any of the elements in the list are not valid services. 62 * It is an error if any of the elements in the list are not valid services.
67 * If there is an error, then the current subscriptions will remain 63 * If there is an error, then the current subscriptions will remain
68 * unchanged. 64 * unchanged.
69 * 65 *
70 * Parameters 66 * Parameters
71 * 67 *
72 * subscriptions ( List<ServerService> ) 68 * subscriptions ( List<ServerService> )
73 * 69 *
74 * A list of the services being subscribed to. 70 * A list of the services being subscribed to.
75 */ 71 */
76 Future sendServerSetSubscriptions(List<ServerService> subscriptions) { 72 Future sendServerSetSubscriptions(List<ServerService> subscriptions) async {
77 var params = new ServerSetSubscriptionsParams(subscriptions).toJson(); 73 var params = new ServerSetSubscriptionsParams(subscriptions).toJson();
78 return server.send("server.setSubscriptions", params) 74 var result = await server.send("server.setSubscriptions", params);
79 .then((result) { 75 expect(result, isNull);
80 expect(result, isNull); 76 return null;
81 return null;
82 });
83 } 77 }
84 78
85 /** 79 /**
86 * Reports that the server is running. This notification is issued once after 80 * Reports that the server is running. This notification is issued once after
87 * the server has started running but before any requests are processed to 81 * the server has started running but before any requests are processed to
88 * let the client know that it started correctly. 82 * let the client know that it started correctly.
89 * 83 *
90 * It is not possible to subscribe to or unsubscribe from this notification. 84 * It is not possible to subscribe to or unsubscribe from this notification.
91 * 85 *
92 * Parameters 86 * Parameters
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 * file ( FilePath ) 185 * file ( FilePath )
192 * 186 *
193 * The file for which errors are being requested. 187 * The file for which errors are being requested.
194 * 188 *
195 * Returns 189 * Returns
196 * 190 *
197 * errors ( List<AnalysisError> ) 191 * errors ( List<AnalysisError> )
198 * 192 *
199 * The errors associated with the file. 193 * The errors associated with the file.
200 */ 194 */
201 Future<AnalysisGetErrorsResult> sendAnalysisGetErrors(String file) { 195 Future<AnalysisGetErrorsResult> sendAnalysisGetErrors(String file) async {
202 var params = new AnalysisGetErrorsParams(file).toJson(); 196 var params = new AnalysisGetErrorsParams(file).toJson();
203 return server.send("analysis.getErrors", params) 197 var result = await server.send("analysis.getErrors", params);
204 .then((result) { 198 ResponseDecoder decoder = new ResponseDecoder(null);
205 ResponseDecoder decoder = new ResponseDecoder(null); 199 return new AnalysisGetErrorsResult.fromJson(decoder, 'result', result);
206 return new AnalysisGetErrorsResult.fromJson(decoder, 'result', result);
207 });
208 } 200 }
209 201
210 /** 202 /**
211 * Return the hover information associate with the given location. If some or 203 * Return the hover information associate with the given location. If some or
212 * all of the hover information is not available at the time this request is 204 * all of the hover information is not available at the time this request is
213 * processed the information will be omitted from the response. 205 * processed the information will be omitted from the response.
214 * 206 *
215 * Parameters 207 * Parameters
216 * 208 *
217 * file ( FilePath ) 209 * file ( FilePath )
218 * 210 *
219 * The file in which hover information is being requested. 211 * The file in which hover information is being requested.
220 * 212 *
221 * offset ( int ) 213 * offset ( int )
222 * 214 *
223 * The offset for which hover information is being requested. 215 * The offset for which hover information is being requested.
224 * 216 *
225 * Returns 217 * Returns
226 * 218 *
227 * hovers ( List<HoverInformation> ) 219 * hovers ( List<HoverInformation> )
228 * 220 *
229 * The hover information associated with the location. The list will be 221 * The hover information associated with the location. The list will be
230 * empty if no information could be determined for the location. The list 222 * empty if no information could be determined for the location. The list
231 * can contain multiple items if the file is being analyzed in multiple 223 * can contain multiple items if the file is being analyzed in multiple
232 * contexts in conflicting ways (such as a part that is included in 224 * contexts in conflicting ways (such as a part that is included in
233 * multiple libraries). 225 * multiple libraries).
234 */ 226 */
235 Future<AnalysisGetHoverResult> sendAnalysisGetHover(String file, int offset) { 227 Future<AnalysisGetHoverResult> sendAnalysisGetHover(String file, int offset) a sync {
236 var params = new AnalysisGetHoverParams(file, offset).toJson(); 228 var params = new AnalysisGetHoverParams(file, offset).toJson();
237 return server.send("analysis.getHover", params) 229 var result = await server.send("analysis.getHover", params);
238 .then((result) { 230 ResponseDecoder decoder = new ResponseDecoder(null);
239 ResponseDecoder decoder = new ResponseDecoder(null); 231 return new AnalysisGetHoverResult.fromJson(decoder, 'result', result);
240 return new AnalysisGetHoverResult.fromJson(decoder, 'result', result);
241 });
242 } 232 }
243 233
244 /** 234 /**
245 * Return the transitive closure of reachable sources for a given file. 235 * Return the transitive closure of reachable sources for a given file.
246 * 236 *
247 * If a request is made for a file which does not exist, or which is not 237 * If a request is made for a file which does not exist, or which is not
248 * currently subject to analysis (e.g. because it is not associated with any 238 * currently subject to analysis (e.g. because it is not associated with any
249 * analysis root specified to analysis.setAnalysisRoots), an error of type 239 * analysis root specified to analysis.setAnalysisRoots), an error of type
250 * GET_REACHABLE_SOURCES_INVALID_FILE will be generated. 240 * GET_REACHABLE_SOURCES_INVALID_FILE will be generated.
251 * 241 *
252 * Parameters 242 * Parameters
253 * 243 *
254 * file ( FilePath ) 244 * file ( FilePath )
255 * 245 *
256 * The file for which reachable source information is being requested. 246 * The file for which reachable source information is being requested.
257 * 247 *
258 * Returns 248 * Returns
259 * 249 *
260 * sources ( Map<String, List<String>> ) 250 * sources ( Map<String, List<String>> )
261 * 251 *
262 * A mapping from source URIs to directly reachable source URIs. For 252 * A mapping from source URIs to directly reachable source URIs. For
263 * example, a file "foo.dart" that imports "bar.dart" would have the 253 * example, a file "foo.dart" that imports "bar.dart" would have the
264 * corresponding mapping { "file:///foo.dart" : ["file:///bar.dart"] }. If 254 * corresponding mapping { "file:///foo.dart" : ["file:///bar.dart"] }. If
265 * "bar.dart" has further imports (or exports) there will be a mapping from 255 * "bar.dart" has further imports (or exports) there will be a mapping from
266 * the URI "file:///bar.dart" to them. To check if a specific URI is 256 * the URI "file:///bar.dart" to them. To check if a specific URI is
267 * reachable from a given file, clients can check for its presence in the 257 * reachable from a given file, clients can check for its presence in the
268 * resulting key set. 258 * resulting key set.
269 */ 259 */
270 Future<AnalysisGetReachableSourcesResult> sendAnalysisGetReachableSources(Stri ng file) { 260 Future<AnalysisGetReachableSourcesResult> sendAnalysisGetReachableSources(Stri ng file) async {
271 var params = new AnalysisGetReachableSourcesParams(file).toJson(); 261 var params = new AnalysisGetReachableSourcesParams(file).toJson();
272 return server.send("analysis.getReachableSources", params) 262 var result = await server.send("analysis.getReachableSources", params);
273 .then((result) { 263 ResponseDecoder decoder = new ResponseDecoder(null);
274 ResponseDecoder decoder = new ResponseDecoder(null); 264 return new AnalysisGetReachableSourcesResult.fromJson(decoder, 'result', res ult);
275 return new AnalysisGetReachableSourcesResult.fromJson(decoder, 'result', r esult);
276 });
277 } 265 }
278 266
279 /** 267 /**
280 * Return library dependency information for use in client-side indexing and 268 * Return library dependency information for use in client-side indexing and
281 * package URI resolution. 269 * package URI resolution.
282 * 270 *
283 * Clients that are only using the libraries field should consider using the 271 * Clients that are only using the libraries field should consider using the
284 * analyzedFiles notification instead. 272 * analyzedFiles notification instead.
285 * 273 *
286 * Returns 274 * Returns
287 * 275 *
288 * libraries ( List<FilePath> ) 276 * libraries ( List<FilePath> )
289 * 277 *
290 * A list of the paths of library elements referenced by files in existing 278 * A list of the paths of library elements referenced by files in existing
291 * analysis roots. 279 * analysis roots.
292 * 280 *
293 * packageMap ( Map<String, Map<String, List<FilePath>>> ) 281 * packageMap ( Map<String, Map<String, List<FilePath>>> )
294 * 282 *
295 * A mapping from context source roots to package maps which map package 283 * A mapping from context source roots to package maps which map package
296 * names to source directories for use in client-side package URI 284 * names to source directories for use in client-side package URI
297 * resolution. 285 * resolution.
298 */ 286 */
299 Future<AnalysisGetLibraryDependenciesResult> sendAnalysisGetLibraryDependencie s() { 287 Future<AnalysisGetLibraryDependenciesResult> sendAnalysisGetLibraryDependencie s() async {
300 return server.send("analysis.getLibraryDependencies", null) 288 var result = await server.send("analysis.getLibraryDependencies", null);
301 .then((result) { 289 ResponseDecoder decoder = new ResponseDecoder(null);
302 ResponseDecoder decoder = new ResponseDecoder(null); 290 return new AnalysisGetLibraryDependenciesResult.fromJson(decoder, 'result', result);
303 return new AnalysisGetLibraryDependenciesResult.fromJson(decoder, 'result' , result);
304 });
305 } 291 }
306 292
307 /** 293 /**
308 * Return the navigation information associated with the given region of the 294 * Return the navigation information associated with the given region of the
309 * given file. If the navigation information for the given file has not yet 295 * given file. If the navigation information for the given file has not yet
310 * been computed, or the most recently computed navigation information for 296 * been computed, or the most recently computed navigation information for
311 * the given file is out of date, then the response for this request will be 297 * the given file is out of date, then the response for this request will be
312 * delayed until it has been computed. If the content of the file changes 298 * delayed until it has been computed. If the content of the file changes
313 * after this request was received but before a response could be sent, then 299 * after this request was received but before a response could be sent, then
314 * an error of type CONTENT_MODIFIED will be generated. 300 * an error of type CONTENT_MODIFIED will be generated.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 * targets ( List<NavigationTarget> ) 337 * targets ( List<NavigationTarget> )
352 * 338 *
353 * A list of the navigation targets that are referenced by the navigation 339 * A list of the navigation targets that are referenced by the navigation
354 * regions. 340 * regions.
355 * 341 *
356 * regions ( List<NavigationRegion> ) 342 * regions ( List<NavigationRegion> )
357 * 343 *
358 * A list of the navigation regions within the requested region of the 344 * A list of the navigation regions within the requested region of the
359 * file. 345 * file.
360 */ 346 */
361 Future<AnalysisGetNavigationResult> sendAnalysisGetNavigation(String file, int offset, int length) { 347 Future<AnalysisGetNavigationResult> sendAnalysisGetNavigation(String file, int offset, int length) async {
362 var params = new AnalysisGetNavigationParams(file, offset, length).toJson(); 348 var params = new AnalysisGetNavigationParams(file, offset, length).toJson();
363 return server.send("analysis.getNavigation", params) 349 var result = await server.send("analysis.getNavigation", params);
364 .then((result) { 350 ResponseDecoder decoder = new ResponseDecoder(null);
365 ResponseDecoder decoder = new ResponseDecoder(null); 351 return new AnalysisGetNavigationResult.fromJson(decoder, 'result', result);
366 return new AnalysisGetNavigationResult.fromJson(decoder, 'result', result) ;
367 });
368 } 352 }
369 353
370 /** 354 /**
371 * Force the re-analysis of everything contained in the specified analysis 355 * Force the re-analysis of everything contained in the specified analysis
372 * roots. This will cause all previously computed analysis results to be 356 * roots. This will cause all previously computed analysis results to be
373 * discarded and recomputed, and will cause all subscribed notifications to 357 * discarded and recomputed, and will cause all subscribed notifications to
374 * be re-sent. 358 * be re-sent.
375 * 359 *
376 * If no analysis roots are provided, then all current analysis roots will be 360 * If no analysis roots are provided, then all current analysis roots will be
377 * re-analyzed. If an empty list of analysis roots is provided, then nothing 361 * re-analyzed. If an empty list of analysis roots is provided, then nothing
378 * will be re-analyzed. If the list contains one or more paths that are not 362 * will be re-analyzed. If the list contains one or more paths that are not
379 * currently analysis roots, then an error of type INVALID_ANALYSIS_ROOT will 363 * currently analysis roots, then an error of type INVALID_ANALYSIS_ROOT will
380 * be generated. 364 * be generated.
381 * 365 *
382 * Parameters 366 * Parameters
383 * 367 *
384 * roots ( optional List<FilePath> ) 368 * roots ( optional List<FilePath> )
385 * 369 *
386 * A list of the analysis roots that are to be re-analyzed. 370 * A list of the analysis roots that are to be re-analyzed.
387 */ 371 */
388 Future sendAnalysisReanalyze({List<String> roots}) { 372 Future sendAnalysisReanalyze({List<String> roots}) async {
389 var params = new AnalysisReanalyzeParams(roots: roots).toJson(); 373 var params = new AnalysisReanalyzeParams(roots: roots).toJson();
390 return server.send("analysis.reanalyze", params) 374 var result = await server.send("analysis.reanalyze", params);
391 .then((result) { 375 expect(result, isNull);
392 expect(result, isNull); 376 return null;
393 return null;
394 });
395 } 377 }
396 378
397 /** 379 /**
398 * Sets the root paths used to determine which files to analyze. The set of 380 * Sets the root paths used to determine which files to analyze. The set of
399 * files to be analyzed are all of the files in one of the root paths that 381 * files to be analyzed are all of the files in one of the root paths that
400 * are not either explicitly or implicitly excluded. A file is explicitly 382 * are not either explicitly or implicitly excluded. A file is explicitly
401 * excluded if it is in one of the excluded paths. A file is implicitly 383 * excluded if it is in one of the excluded paths. A file is implicitly
402 * excluded if it is in a subdirectory of one of the root paths where the 384 * excluded if it is in a subdirectory of one of the root paths where the
403 * name of the subdirectory starts with a period (that is, a hidden 385 * name of the subdirectory starts with a period (that is, a hidden
404 * directory). 386 * directory).
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 * If a package root is a file, then the analyzer will behave as though 428 * If a package root is a file, then the analyzer will behave as though
447 * that file is a ".packages" file in the source directory. The effect is 429 * that file is a ".packages" file in the source directory. The effect is
448 * the same as specifying the file as a "--packages" parameter to the Dart 430 * the same as specifying the file as a "--packages" parameter to the Dart
449 * VM when executing any Dart file inside the source directory. 431 * VM when executing any Dart file inside the source directory.
450 * 432 *
451 * Files in any directories that are not overridden by this mapping have 433 * Files in any directories that are not overridden by this mapping have
452 * their package: URI's resolved using the normal pubspec.yaml mechanism. 434 * their package: URI's resolved using the normal pubspec.yaml mechanism.
453 * If this field is absent, or the empty map is specified, that indicates 435 * If this field is absent, or the empty map is specified, that indicates
454 * that the normal pubspec.yaml mechanism should always be used. 436 * that the normal pubspec.yaml mechanism should always be used.
455 */ 437 */
456 Future sendAnalysisSetAnalysisRoots(List<String> included, List<String> exclud ed, {Map<String, String> packageRoots}) { 438 Future sendAnalysisSetAnalysisRoots(List<String> included, List<String> exclud ed, {Map<String, String> packageRoots}) async {
457 var params = new AnalysisSetAnalysisRootsParams(included, excluded, packageR oots: packageRoots).toJson(); 439 var params = new AnalysisSetAnalysisRootsParams(included, excluded, packageR oots: packageRoots).toJson();
458 return server.send("analysis.setAnalysisRoots", params) 440 var result = await server.send("analysis.setAnalysisRoots", params);
459 .then((result) { 441 expect(result, isNull);
460 expect(result, isNull); 442 return null;
461 return null;
462 });
463 } 443 }
464 444
465 /** 445 /**
466 * Subscribe for general services (that is, services that are not specific to 446 * Subscribe for general services (that is, services that are not specific to
467 * individual files). All previous subscriptions are replaced by the given 447 * individual files). All previous subscriptions are replaced by the given
468 * set of services. 448 * set of services.
469 * 449 *
470 * It is an error if any of the elements in the list are not valid services. 450 * It is an error if any of the elements in the list are not valid services.
471 * If there is an error, then the current subscriptions will remain 451 * If there is an error, then the current subscriptions will remain
472 * unchanged. 452 * unchanged.
473 * 453 *
474 * Parameters 454 * Parameters
475 * 455 *
476 * subscriptions ( List<GeneralAnalysisService> ) 456 * subscriptions ( List<GeneralAnalysisService> )
477 * 457 *
478 * A list of the services being subscribed to. 458 * A list of the services being subscribed to.
479 */ 459 */
480 Future sendAnalysisSetGeneralSubscriptions(List<GeneralAnalysisService> subscr iptions) { 460 Future sendAnalysisSetGeneralSubscriptions(List<GeneralAnalysisService> subscr iptions) async {
481 var params = new AnalysisSetGeneralSubscriptionsParams(subscriptions).toJson (); 461 var params = new AnalysisSetGeneralSubscriptionsParams(subscriptions).toJson ();
482 return server.send("analysis.setGeneralSubscriptions", params) 462 var result = await server.send("analysis.setGeneralSubscriptions", params);
483 .then((result) { 463 expect(result, isNull);
484 expect(result, isNull); 464 return null;
485 return null;
486 });
487 } 465 }
488 466
489 /** 467 /**
490 * Set the priority files to the files in the given list. A priority file is 468 * Set the priority files to the files in the given list. A priority file is
491 * a file that is given priority when scheduling which analysis work to do 469 * a file that is given priority when scheduling which analysis work to do
492 * first. The list typically contains those files that are visible to the 470 * first. The list typically contains those files that are visible to the
493 * user and those for which analysis results will have the biggest impact on 471 * user and those for which analysis results will have the biggest impact on
494 * the user experience. The order of the files within the list is 472 * the user experience. The order of the files within the list is
495 * significant: the first file will be given higher priority than the second, 473 * significant: the first file will be given higher priority than the second,
496 * the second higher priority than the third, and so on. 474 * the second higher priority than the third, and so on.
497 * 475 *
498 * Note that this request determines the set of requested priority files. The 476 * Note that this request determines the set of requested priority files. The
499 * actual set of priority files is the intersection of the requested set of 477 * actual set of priority files is the intersection of the requested set of
500 * priority files with the set of files currently subject to analysis. (See 478 * priority files with the set of files currently subject to analysis. (See
501 * analysis.setSubscriptions for a description of files that are subject to 479 * analysis.setSubscriptions for a description of files that are subject to
502 * analysis.) 480 * analysis.)
503 * 481 *
504 * If a requested priority file is a directory it is ignored, but remains in 482 * If a requested priority file is a directory it is ignored, but remains in
505 * the set of requested priority files so that if it later becomes a file it 483 * the set of requested priority files so that if it later becomes a file it
506 * can be included in the set of actual priority files. 484 * can be included in the set of actual priority files.
507 * 485 *
508 * Parameters 486 * Parameters
509 * 487 *
510 * files ( List<FilePath> ) 488 * files ( List<FilePath> )
511 * 489 *
512 * The files that are to be a priority for analysis. 490 * The files that are to be a priority for analysis.
513 */ 491 */
514 Future sendAnalysisSetPriorityFiles(List<String> files) { 492 Future sendAnalysisSetPriorityFiles(List<String> files) async {
515 var params = new AnalysisSetPriorityFilesParams(files).toJson(); 493 var params = new AnalysisSetPriorityFilesParams(files).toJson();
516 return server.send("analysis.setPriorityFiles", params) 494 var result = await server.send("analysis.setPriorityFiles", params);
517 .then((result) { 495 expect(result, isNull);
518 expect(result, isNull); 496 return null;
519 return null;
520 });
521 } 497 }
522 498
523 /** 499 /**
524 * Subscribe for services that are specific to individual files. All previous 500 * Subscribe for services that are specific to individual files. All previous
525 * subscriptions are replaced by the current set of subscriptions. If a given 501 * subscriptions are replaced by the current set of subscriptions. If a given
526 * service is not included as a key in the map then no files will be 502 * service is not included as a key in the map then no files will be
527 * subscribed to the service, exactly as if the service had been included in 503 * subscribed to the service, exactly as if the service had been included in
528 * the map with an explicit empty list of files. 504 * the map with an explicit empty list of files.
529 * 505 *
530 * Note that this request determines the set of requested subscriptions. The 506 * Note that this request determines the set of requested subscriptions. The
(...skipping 14 matching lines...) Expand all
545 * It is an error if any of the keys in the map are not valid services. If 521 * It is an error if any of the keys in the map are not valid services. If
546 * there is an error, then the existing subscriptions will remain unchanged. 522 * there is an error, then the existing subscriptions will remain unchanged.
547 * 523 *
548 * Parameters 524 * Parameters
549 * 525 *
550 * subscriptions ( Map<AnalysisService, List<FilePath>> ) 526 * subscriptions ( Map<AnalysisService, List<FilePath>> )
551 * 527 *
552 * A table mapping services to a list of the files being subscribed to the 528 * A table mapping services to a list of the files being subscribed to the
553 * service. 529 * service.
554 */ 530 */
555 Future sendAnalysisSetSubscriptions(Map<AnalysisService, List<String>> subscri ptions) { 531 Future sendAnalysisSetSubscriptions(Map<AnalysisService, List<String>> subscri ptions) async {
556 var params = new AnalysisSetSubscriptionsParams(subscriptions).toJson(); 532 var params = new AnalysisSetSubscriptionsParams(subscriptions).toJson();
557 return server.send("analysis.setSubscriptions", params) 533 var result = await server.send("analysis.setSubscriptions", params);
558 .then((result) { 534 expect(result, isNull);
559 expect(result, isNull); 535 return null;
560 return null;
561 });
562 } 536 }
563 537
564 /** 538 /**
565 * Update the content of one or more files. Files that were previously 539 * Update the content of one or more files. Files that were previously
566 * updated but not included in this update remain unchanged. This effectively 540 * updated but not included in this update remain unchanged. This effectively
567 * represents an overlay of the filesystem. The files whose content is 541 * represents an overlay of the filesystem. The files whose content is
568 * overridden are therefore seen by server as being files with the given 542 * overridden are therefore seen by server as being files with the given
569 * content, even if the files do not exist on the filesystem or if the file 543 * content, even if the files do not exist on the filesystem or if the file
570 * path represents the path to a directory on the filesystem. 544 * path represents the path to a directory on the filesystem.
571 * 545 *
572 * Parameters 546 * Parameters
573 * 547 *
574 * files ( Map<FilePath, AddContentOverlay | ChangeContentOverlay | 548 * files ( Map<FilePath, AddContentOverlay | ChangeContentOverlay |
575 * RemoveContentOverlay> ) 549 * RemoveContentOverlay> )
576 * 550 *
577 * A table mapping the files whose content has changed to a description of 551 * A table mapping the files whose content has changed to a description of
578 * the content change. 552 * the content change.
579 * 553 *
580 * Returns 554 * Returns
581 */ 555 */
582 Future<AnalysisUpdateContentResult> sendAnalysisUpdateContent(Map<String, dyna mic> files) { 556 Future<AnalysisUpdateContentResult> sendAnalysisUpdateContent(Map<String, dyna mic> files) async {
583 var params = new AnalysisUpdateContentParams(files).toJson(); 557 var params = new AnalysisUpdateContentParams(files).toJson();
584 return server.send("analysis.updateContent", params) 558 var result = await server.send("analysis.updateContent", params);
585 .then((result) { 559 ResponseDecoder decoder = new ResponseDecoder(null);
586 ResponseDecoder decoder = new ResponseDecoder(null); 560 return new AnalysisUpdateContentResult.fromJson(decoder, 'result', result);
587 return new AnalysisUpdateContentResult.fromJson(decoder, 'result', result) ;
588 });
589 } 561 }
590 562
591 /** 563 /**
592 * Update the options controlling analysis based on the given set of options. 564 * Update the options controlling analysis based on the given set of options.
593 * Any options that are not included in the analysis options will not be 565 * Any options that are not included in the analysis options will not be
594 * changed. If there are options in the analysis options that are not valid, 566 * changed. If there are options in the analysis options that are not valid,
595 * they will be silently ignored. 567 * they will be silently ignored.
596 * 568 *
597 * Parameters 569 * Parameters
598 * 570 *
599 * options ( AnalysisOptions ) 571 * options ( AnalysisOptions )
600 * 572 *
601 * The options that are to be used to control analysis. 573 * The options that are to be used to control analysis.
602 */ 574 */
603 Future sendAnalysisUpdateOptions(AnalysisOptions options) { 575 Future sendAnalysisUpdateOptions(AnalysisOptions options) async {
604 var params = new AnalysisUpdateOptionsParams(options).toJson(); 576 var params = new AnalysisUpdateOptionsParams(options).toJson();
605 return server.send("analysis.updateOptions", params) 577 var result = await server.send("analysis.updateOptions", params);
606 .then((result) { 578 expect(result, isNull);
607 expect(result, isNull); 579 return null;
608 return null;
609 });
610 } 580 }
611 581
612 /** 582 /**
613 * Reports the paths of the files that are being analyzed. 583 * Reports the paths of the files that are being analyzed.
614 * 584 *
615 * This notification is not subscribed to by default. Clients can subscribe 585 * This notification is not subscribed to by default. Clients can subscribe
616 * by including the value "ANALYZED_FILES" in the list of services passed in 586 * by including the value "ANALYZED_FILES" in the list of services passed in
617 * an analysis.setGeneralSubscriptions request. 587 * an analysis.setGeneralSubscriptions request.
618 * 588 *
619 * Parameters 589 * Parameters
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 * offset ( int ) 906 * offset ( int )
937 * 907 *
938 * The offset within the file at which suggestions are to be made. 908 * The offset within the file at which suggestions are to be made.
939 * 909 *
940 * Returns 910 * Returns
941 * 911 *
942 * id ( CompletionId ) 912 * id ( CompletionId )
943 * 913 *
944 * The identifier used to associate results with this completion request. 914 * The identifier used to associate results with this completion request.
945 */ 915 */
946 Future<CompletionGetSuggestionsResult> sendCompletionGetSuggestions(String fil e, int offset) { 916 Future<CompletionGetSuggestionsResult> sendCompletionGetSuggestions(String fil e, int offset) async {
947 var params = new CompletionGetSuggestionsParams(file, offset).toJson(); 917 var params = new CompletionGetSuggestionsParams(file, offset).toJson();
948 return server.send("completion.getSuggestions", params) 918 var result = await server.send("completion.getSuggestions", params);
949 .then((result) { 919 ResponseDecoder decoder = new ResponseDecoder(null);
950 ResponseDecoder decoder = new ResponseDecoder(null); 920 return new CompletionGetSuggestionsResult.fromJson(decoder, 'result', result );
951 return new CompletionGetSuggestionsResult.fromJson(decoder, 'result', resu lt);
952 });
953 } 921 }
954 922
955 /** 923 /**
956 * Reports the completion suggestions that should be presented to the user. 924 * Reports the completion suggestions that should be presented to the user.
957 * The set of suggestions included in the notification is always a complete 925 * The set of suggestions included in the notification is always a complete
958 * list that supersedes any previously reported suggestions. 926 * list that supersedes any previously reported suggestions.
959 * 927 *
960 * Parameters 928 * Parameters
961 * 929 *
962 * id ( CompletionId ) 930 * id ( CompletionId )
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 * notification. 999 * notification.
1032 * 1000 *
1033 * element ( optional Element ) 1001 * element ( optional Element )
1034 * 1002 *
1035 * The element referenced or defined at the given offset and whose 1003 * The element referenced or defined at the given offset and whose
1036 * references will be returned in the search results. 1004 * references will be returned in the search results.
1037 * 1005 *
1038 * If no element was found at the given location, this field will be 1006 * If no element was found at the given location, this field will be
1039 * absent. 1007 * absent.
1040 */ 1008 */
1041 Future<SearchFindElementReferencesResult> sendSearchFindElementReferences(Stri ng file, int offset, bool includePotential) { 1009 Future<SearchFindElementReferencesResult> sendSearchFindElementReferences(Stri ng file, int offset, bool includePotential) async {
1042 var params = new SearchFindElementReferencesParams(file, offset, includePote ntial).toJson(); 1010 var params = new SearchFindElementReferencesParams(file, offset, includePote ntial).toJson();
1043 return server.send("search.findElementReferences", params) 1011 var result = await server.send("search.findElementReferences", params);
1044 .then((result) { 1012 ResponseDecoder decoder = new ResponseDecoder(null);
1045 ResponseDecoder decoder = new ResponseDecoder(null); 1013 return new SearchFindElementReferencesResult.fromJson(decoder, 'result', res ult);
1046 return new SearchFindElementReferencesResult.fromJson(decoder, 'result', r esult);
1047 });
1048 } 1014 }
1049 1015
1050 /** 1016 /**
1051 * Perform a search for declarations of members whose name is equal to the 1017 * Perform a search for declarations of members whose name is equal to the
1052 * given name. 1018 * given name.
1053 * 1019 *
1054 * An identifier is returned immediately, and individual results will be 1020 * An identifier is returned immediately, and individual results will be
1055 * returned via the search.results notification as they become available. 1021 * returned via the search.results notification as they become available.
1056 * 1022 *
1057 * Parameters 1023 * Parameters
1058 * 1024 *
1059 * name ( String ) 1025 * name ( String )
1060 * 1026 *
1061 * The name of the declarations to be found. 1027 * The name of the declarations to be found.
1062 * 1028 *
1063 * Returns 1029 * Returns
1064 * 1030 *
1065 * id ( SearchId ) 1031 * id ( SearchId )
1066 * 1032 *
1067 * The identifier used to associate results with this search request. 1033 * The identifier used to associate results with this search request.
1068 */ 1034 */
1069 Future<SearchFindMemberDeclarationsResult> sendSearchFindMemberDeclarations(St ring name) { 1035 Future<SearchFindMemberDeclarationsResult> sendSearchFindMemberDeclarations(St ring name) async {
1070 var params = new SearchFindMemberDeclarationsParams(name).toJson(); 1036 var params = new SearchFindMemberDeclarationsParams(name).toJson();
1071 return server.send("search.findMemberDeclarations", params) 1037 var result = await server.send("search.findMemberDeclarations", params);
1072 .then((result) { 1038 ResponseDecoder decoder = new ResponseDecoder(null);
1073 ResponseDecoder decoder = new ResponseDecoder(null); 1039 return new SearchFindMemberDeclarationsResult.fromJson(decoder, 'result', re sult);
1074 return new SearchFindMemberDeclarationsResult.fromJson(decoder, 'result', result);
1075 });
1076 } 1040 }
1077 1041
1078 /** 1042 /**
1079 * Perform a search for references to members whose name is equal to the 1043 * Perform a search for references to members whose name is equal to the
1080 * given name. This search does not check to see that there is a member 1044 * given name. This search does not check to see that there is a member
1081 * defined with the given name, so it is able to find references to undefined 1045 * defined with the given name, so it is able to find references to undefined
1082 * members as well. 1046 * members as well.
1083 * 1047 *
1084 * An identifier is returned immediately, and individual results will be 1048 * An identifier is returned immediately, and individual results will be
1085 * returned via the search.results notification as they become available. 1049 * returned via the search.results notification as they become available.
1086 * 1050 *
1087 * Parameters 1051 * Parameters
1088 * 1052 *
1089 * name ( String ) 1053 * name ( String )
1090 * 1054 *
1091 * The name of the references to be found. 1055 * The name of the references to be found.
1092 * 1056 *
1093 * Returns 1057 * Returns
1094 * 1058 *
1095 * id ( SearchId ) 1059 * id ( SearchId )
1096 * 1060 *
1097 * The identifier used to associate results with this search request. 1061 * The identifier used to associate results with this search request.
1098 */ 1062 */
1099 Future<SearchFindMemberReferencesResult> sendSearchFindMemberReferences(String name) { 1063 Future<SearchFindMemberReferencesResult> sendSearchFindMemberReferences(String name) async {
1100 var params = new SearchFindMemberReferencesParams(name).toJson(); 1064 var params = new SearchFindMemberReferencesParams(name).toJson();
1101 return server.send("search.findMemberReferences", params) 1065 var result = await server.send("search.findMemberReferences", params);
1102 .then((result) { 1066 ResponseDecoder decoder = new ResponseDecoder(null);
1103 ResponseDecoder decoder = new ResponseDecoder(null); 1067 return new SearchFindMemberReferencesResult.fromJson(decoder, 'result', resu lt);
1104 return new SearchFindMemberReferencesResult.fromJson(decoder, 'result', re sult);
1105 });
1106 } 1068 }
1107 1069
1108 /** 1070 /**
1109 * Perform a search for declarations of top-level elements (classes, 1071 * Perform a search for declarations of top-level elements (classes,
1110 * typedefs, getters, setters, functions and fields) whose name matches the 1072 * typedefs, getters, setters, functions and fields) whose name matches the
1111 * given pattern. 1073 * given pattern.
1112 * 1074 *
1113 * An identifier is returned immediately, and individual results will be 1075 * An identifier is returned immediately, and individual results will be
1114 * returned via the search.results notification as they become available. 1076 * returned via the search.results notification as they become available.
1115 * 1077 *
1116 * Parameters 1078 * Parameters
1117 * 1079 *
1118 * pattern ( String ) 1080 * pattern ( String )
1119 * 1081 *
1120 * The regular expression used to match the names of the declarations to be 1082 * The regular expression used to match the names of the declarations to be
1121 * found. 1083 * found.
1122 * 1084 *
1123 * Returns 1085 * Returns
1124 * 1086 *
1125 * id ( SearchId ) 1087 * id ( SearchId )
1126 * 1088 *
1127 * The identifier used to associate results with this search request. 1089 * The identifier used to associate results with this search request.
1128 */ 1090 */
1129 Future<SearchFindTopLevelDeclarationsResult> sendSearchFindTopLevelDeclaration s(String pattern) { 1091 Future<SearchFindTopLevelDeclarationsResult> sendSearchFindTopLevelDeclaration s(String pattern) async {
1130 var params = new SearchFindTopLevelDeclarationsParams(pattern).toJson(); 1092 var params = new SearchFindTopLevelDeclarationsParams(pattern).toJson();
1131 return server.send("search.findTopLevelDeclarations", params) 1093 var result = await server.send("search.findTopLevelDeclarations", params);
1132 .then((result) { 1094 ResponseDecoder decoder = new ResponseDecoder(null);
1133 ResponseDecoder decoder = new ResponseDecoder(null); 1095 return new SearchFindTopLevelDeclarationsResult.fromJson(decoder, 'result', result);
1134 return new SearchFindTopLevelDeclarationsResult.fromJson(decoder, 'result' , result);
1135 });
1136 } 1096 }
1137 1097
1138 /** 1098 /**
1139 * Return the type hierarchy of the class declared or referenced at the given 1099 * Return the type hierarchy of the class declared or referenced at the given
1140 * location. 1100 * location.
1141 * 1101 *
1142 * Parameters 1102 * Parameters
1143 * 1103 *
1144 * file ( FilePath ) 1104 * file ( FilePath )
1145 * 1105 *
(...skipping 16 matching lines...) Expand all
1162 * A list of the types in the requested hierarchy. The first element of the 1122 * A list of the types in the requested hierarchy. The first element of the
1163 * list is the item representing the type for which the hierarchy was 1123 * list is the item representing the type for which the hierarchy was
1164 * requested. The index of other elements of the list is unspecified, but 1124 * requested. The index of other elements of the list is unspecified, but
1165 * correspond to the integers used to reference supertype and subtype items 1125 * correspond to the integers used to reference supertype and subtype items
1166 * within the items. 1126 * within the items.
1167 * 1127 *
1168 * This field will be absent if the code at the given file and offset does 1128 * This field will be absent if the code at the given file and offset does
1169 * not represent a type, or if the file has not been sufficiently analyzed 1129 * not represent a type, or if the file has not been sufficiently analyzed
1170 * to allow a type hierarchy to be produced. 1130 * to allow a type hierarchy to be produced.
1171 */ 1131 */
1172 Future<SearchGetTypeHierarchyResult> sendSearchGetTypeHierarchy(String file, i nt offset, {bool superOnly}) { 1132 Future<SearchGetTypeHierarchyResult> sendSearchGetTypeHierarchy(String file, i nt offset, {bool superOnly}) async {
1173 var params = new SearchGetTypeHierarchyParams(file, offset, superOnly: super Only).toJson(); 1133 var params = new SearchGetTypeHierarchyParams(file, offset, superOnly: super Only).toJson();
1174 return server.send("search.getTypeHierarchy", params) 1134 var result = await server.send("search.getTypeHierarchy", params);
1175 .then((result) { 1135 ResponseDecoder decoder = new ResponseDecoder(null);
1176 ResponseDecoder decoder = new ResponseDecoder(null); 1136 return new SearchGetTypeHierarchyResult.fromJson(decoder, 'result', result);
1177 return new SearchGetTypeHierarchyResult.fromJson(decoder, 'result', result );
1178 });
1179 } 1137 }
1180 1138
1181 /** 1139 /**
1182 * Reports some or all of the results of performing a requested search. 1140 * Reports some or all of the results of performing a requested search.
1183 * Unlike other notifications, this notification contains search results that 1141 * Unlike other notifications, this notification contains search results that
1184 * should be added to any previously received search results associated with 1142 * should be added to any previously received search results associated with
1185 * the same search id. 1143 * the same search id.
1186 * 1144 *
1187 * Parameters 1145 * Parameters
1188 * 1146 *
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 * empty if the code was already formatted (there are no changes). 1205 * empty if the code was already formatted (there are no changes).
1248 * 1206 *
1249 * selectionOffset ( int ) 1207 * selectionOffset ( int )
1250 * 1208 *
1251 * The offset of the selection after formatting the code. 1209 * The offset of the selection after formatting the code.
1252 * 1210 *
1253 * selectionLength ( int ) 1211 * selectionLength ( int )
1254 * 1212 *
1255 * The length of the selection after formatting the code. 1213 * The length of the selection after formatting the code.
1256 */ 1214 */
1257 Future<EditFormatResult> sendEditFormat(String file, int selectionOffset, int selectionLength, {int lineLength}) { 1215 Future<EditFormatResult> sendEditFormat(String file, int selectionOffset, int selectionLength, {int lineLength}) async {
1258 var params = new EditFormatParams(file, selectionOffset, selectionLength, li neLength: lineLength).toJson(); 1216 var params = new EditFormatParams(file, selectionOffset, selectionLength, li neLength: lineLength).toJson();
1259 return server.send("edit.format", params) 1217 var result = await server.send("edit.format", params);
1260 .then((result) { 1218 ResponseDecoder decoder = new ResponseDecoder(null);
1261 ResponseDecoder decoder = new ResponseDecoder(null); 1219 return new EditFormatResult.fromJson(decoder, 'result', result);
1262 return new EditFormatResult.fromJson(decoder, 'result', result);
1263 });
1264 } 1220 }
1265 1221
1266 /** 1222 /**
1267 * Return the set of assists that are available at the given location. An 1223 * Return the set of assists that are available at the given location. An
1268 * assist is distinguished from a refactoring primarily by the fact that it 1224 * assist is distinguished from a refactoring primarily by the fact that it
1269 * affects a single file and does not require user input in order to be 1225 * affects a single file and does not require user input in order to be
1270 * performed. 1226 * performed.
1271 * 1227 *
1272 * Parameters 1228 * Parameters
1273 * 1229 *
1274 * file ( FilePath ) 1230 * file ( FilePath )
1275 * 1231 *
1276 * The file containing the code for which assists are being requested. 1232 * The file containing the code for which assists are being requested.
1277 * 1233 *
1278 * offset ( int ) 1234 * offset ( int )
1279 * 1235 *
1280 * The offset of the code for which assists are being requested. 1236 * The offset of the code for which assists are being requested.
1281 * 1237 *
1282 * length ( int ) 1238 * length ( int )
1283 * 1239 *
1284 * The length of the code for which assists are being requested. 1240 * The length of the code for which assists are being requested.
1285 * 1241 *
1286 * Returns 1242 * Returns
1287 * 1243 *
1288 * assists ( List<SourceChange> ) 1244 * assists ( List<SourceChange> )
1289 * 1245 *
1290 * The assists that are available at the given location. 1246 * The assists that are available at the given location.
1291 */ 1247 */
1292 Future<EditGetAssistsResult> sendEditGetAssists(String file, int offset, int l ength) { 1248 Future<EditGetAssistsResult> sendEditGetAssists(String file, int offset, int l ength) async {
1293 var params = new EditGetAssistsParams(file, offset, length).toJson(); 1249 var params = new EditGetAssistsParams(file, offset, length).toJson();
1294 return server.send("edit.getAssists", params) 1250 var result = await server.send("edit.getAssists", params);
1295 .then((result) { 1251 ResponseDecoder decoder = new ResponseDecoder(null);
1296 ResponseDecoder decoder = new ResponseDecoder(null); 1252 return new EditGetAssistsResult.fromJson(decoder, 'result', result);
1297 return new EditGetAssistsResult.fromJson(decoder, 'result', result);
1298 });
1299 } 1253 }
1300 1254
1301 /** 1255 /**
1302 * Get a list of the kinds of refactorings that are valid for the given 1256 * Get a list of the kinds of refactorings that are valid for the given
1303 * selection in the given file. 1257 * selection in the given file.
1304 * 1258 *
1305 * Parameters 1259 * Parameters
1306 * 1260 *
1307 * file ( FilePath ) 1261 * file ( FilePath )
1308 * 1262 *
1309 * The file containing the code on which the refactoring would be based. 1263 * The file containing the code on which the refactoring would be based.
1310 * 1264 *
1311 * offset ( int ) 1265 * offset ( int )
1312 * 1266 *
1313 * The offset of the code on which the refactoring would be based. 1267 * The offset of the code on which the refactoring would be based.
1314 * 1268 *
1315 * length ( int ) 1269 * length ( int )
1316 * 1270 *
1317 * The length of the code on which the refactoring would be based. 1271 * The length of the code on which the refactoring would be based.
1318 * 1272 *
1319 * Returns 1273 * Returns
1320 * 1274 *
1321 * kinds ( List<RefactoringKind> ) 1275 * kinds ( List<RefactoringKind> )
1322 * 1276 *
1323 * The kinds of refactorings that are valid for the given selection. 1277 * The kinds of refactorings that are valid for the given selection.
1324 */ 1278 */
1325 Future<EditGetAvailableRefactoringsResult> sendEditGetAvailableRefactorings(St ring file, int offset, int length) { 1279 Future<EditGetAvailableRefactoringsResult> sendEditGetAvailableRefactorings(St ring file, int offset, int length) async {
1326 var params = new EditGetAvailableRefactoringsParams(file, offset, length).to Json(); 1280 var params = new EditGetAvailableRefactoringsParams(file, offset, length).to Json();
1327 return server.send("edit.getAvailableRefactorings", params) 1281 var result = await server.send("edit.getAvailableRefactorings", params);
1328 .then((result) { 1282 ResponseDecoder decoder = new ResponseDecoder(null);
1329 ResponseDecoder decoder = new ResponseDecoder(null); 1283 return new EditGetAvailableRefactoringsResult.fromJson(decoder, 'result', re sult);
1330 return new EditGetAvailableRefactoringsResult.fromJson(decoder, 'result', result);
1331 });
1332 } 1284 }
1333 1285
1334 /** 1286 /**
1335 * Return the set of fixes that are available for the errors at a given 1287 * Return the set of fixes that are available for the errors at a given
1336 * offset in a given file. 1288 * offset in a given file.
1337 * 1289 *
1338 * Parameters 1290 * Parameters
1339 * 1291 *
1340 * file ( FilePath ) 1292 * file ( FilePath )
1341 * 1293 *
1342 * The file containing the errors for which fixes are being requested. 1294 * The file containing the errors for which fixes are being requested.
1343 * 1295 *
1344 * offset ( int ) 1296 * offset ( int )
1345 * 1297 *
1346 * The offset used to select the errors for which fixes will be returned. 1298 * The offset used to select the errors for which fixes will be returned.
1347 * 1299 *
1348 * Returns 1300 * Returns
1349 * 1301 *
1350 * fixes ( List<AnalysisErrorFixes> ) 1302 * fixes ( List<AnalysisErrorFixes> )
1351 * 1303 *
1352 * The fixes that are available for the errors at the given offset. 1304 * The fixes that are available for the errors at the given offset.
1353 */ 1305 */
1354 Future<EditGetFixesResult> sendEditGetFixes(String file, int offset) { 1306 Future<EditGetFixesResult> sendEditGetFixes(String file, int offset) async {
1355 var params = new EditGetFixesParams(file, offset).toJson(); 1307 var params = new EditGetFixesParams(file, offset).toJson();
1356 return server.send("edit.getFixes", params) 1308 var result = await server.send("edit.getFixes", params);
1357 .then((result) { 1309 ResponseDecoder decoder = new ResponseDecoder(null);
1358 ResponseDecoder decoder = new ResponseDecoder(null); 1310 return new EditGetFixesResult.fromJson(decoder, 'result', result);
1359 return new EditGetFixesResult.fromJson(decoder, 'result', result);
1360 });
1361 } 1311 }
1362 1312
1363 /** 1313 /**
1364 * Get the changes required to perform a refactoring. 1314 * Get the changes required to perform a refactoring.
1365 * 1315 *
1366 * If another refactoring request is received during the processing of this 1316 * If another refactoring request is received during the processing of this
1367 * one, an error of type REFACTORING_REQUEST_CANCELLED will be generated. 1317 * one, an error of type REFACTORING_REQUEST_CANCELLED will be generated.
1368 * 1318 *
1369 * Parameters 1319 * Parameters
1370 * 1320 *
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1434 * potentialEdits ( optional List<String> ) 1384 * potentialEdits ( optional List<String> )
1435 * 1385 *
1436 * The ids of source edits that are not known to be valid. An edit is not 1386 * The ids of source edits that are not known to be valid. An edit is not
1437 * known to be valid if there was insufficient type information for the 1387 * known to be valid if there was insufficient type information for the
1438 * server to be able to determine whether or not the code needs to be 1388 * server to be able to determine whether or not the code needs to be
1439 * modified, such as when a member is being renamed and there is a 1389 * modified, such as when a member is being renamed and there is a
1440 * reference to a member from an unknown type. This field will be omitted 1390 * reference to a member from an unknown type. This field will be omitted
1441 * if the change field is omitted or if there are no potential edits for 1391 * if the change field is omitted or if there are no potential edits for
1442 * the refactoring. 1392 * the refactoring.
1443 */ 1393 */
1444 Future<EditGetRefactoringResult> sendEditGetRefactoring(RefactoringKind kind, String file, int offset, int length, bool validateOnly, {RefactoringOptions opti ons}) { 1394 Future<EditGetRefactoringResult> sendEditGetRefactoring(RefactoringKind kind, String file, int offset, int length, bool validateOnly, {RefactoringOptions opti ons}) async {
1445 var params = new EditGetRefactoringParams(kind, file, offset, length, valida teOnly, options: options).toJson(); 1395 var params = new EditGetRefactoringParams(kind, file, offset, length, valida teOnly, options: options).toJson();
1446 return server.send("edit.getRefactoring", params) 1396 var result = await server.send("edit.getRefactoring", params);
1447 .then((result) { 1397 ResponseDecoder decoder = new ResponseDecoder(kind);
1448 ResponseDecoder decoder = new ResponseDecoder(kind); 1398 return new EditGetRefactoringResult.fromJson(decoder, 'result', result);
1449 return new EditGetRefactoringResult.fromJson(decoder, 'result', result);
1450 });
1451 } 1399 }
1452 1400
1453 /** 1401 /**
1454 * Sort all of the directives, unit and class members of the given Dart file. 1402 * Sort all of the directives, unit and class members of the given Dart file.
1455 * 1403 *
1456 * If a request is made for a file that does not exist, does not belong to an 1404 * If a request is made for a file that does not exist, does not belong to an
1457 * analysis root or is not a Dart file, SORT_MEMBERS_INVALID_FILE will be 1405 * analysis root or is not a Dart file, SORT_MEMBERS_INVALID_FILE will be
1458 * generated. 1406 * generated.
1459 * 1407 *
1460 * If the Dart file has scan or parse errors, SORT_MEMBERS_PARSE_ERRORS will 1408 * If the Dart file has scan or parse errors, SORT_MEMBERS_PARSE_ERRORS will
1461 * be generated. 1409 * be generated.
1462 * 1410 *
1463 * Parameters 1411 * Parameters
1464 * 1412 *
1465 * file ( FilePath ) 1413 * file ( FilePath )
1466 * 1414 *
1467 * The Dart file to sort. 1415 * The Dart file to sort.
1468 * 1416 *
1469 * Returns 1417 * Returns
1470 * 1418 *
1471 * edit ( SourceFileEdit ) 1419 * edit ( SourceFileEdit )
1472 * 1420 *
1473 * The file edit that is to be applied to the given file to effect the 1421 * The file edit that is to be applied to the given file to effect the
1474 * sorting. 1422 * sorting.
1475 */ 1423 */
1476 Future<EditSortMembersResult> sendEditSortMembers(String file) { 1424 Future<EditSortMembersResult> sendEditSortMembers(String file) async {
1477 var params = new EditSortMembersParams(file).toJson(); 1425 var params = new EditSortMembersParams(file).toJson();
1478 return server.send("edit.sortMembers", params) 1426 var result = await server.send("edit.sortMembers", params);
1479 .then((result) { 1427 ResponseDecoder decoder = new ResponseDecoder(null);
1480 ResponseDecoder decoder = new ResponseDecoder(null); 1428 return new EditSortMembersResult.fromJson(decoder, 'result', result);
1481 return new EditSortMembersResult.fromJson(decoder, 'result', result);
1482 });
1483 } 1429 }
1484 1430
1485 /** 1431 /**
1486 * Organizes all of the directives - removes unused imports and sorts 1432 * Organizes all of the directives - removes unused imports and sorts
1487 * directives of the given Dart file according to the Dart Style Guide. 1433 * directives of the given Dart file according to the Dart Style Guide.
1488 * 1434 *
1489 * If a request is made for a file that does not exist, does not belong to an 1435 * If a request is made for a file that does not exist, does not belong to an
1490 * analysis root or is not a Dart file, FILE_NOT_ANALYZED will be generated. 1436 * analysis root or is not a Dart file, FILE_NOT_ANALYZED will be generated.
1491 * 1437 *
1492 * If directives of the Dart file cannot be organized, for example because it 1438 * If directives of the Dart file cannot be organized, for example because it
1493 * has scan or parse errors, or by other reasons, ORGANIZE_DIRECTIVES_ERROR 1439 * has scan or parse errors, or by other reasons, ORGANIZE_DIRECTIVES_ERROR
1494 * will be generated. The message will provide details about the reason. 1440 * will be generated. The message will provide details about the reason.
1495 * 1441 *
1496 * Parameters 1442 * Parameters
1497 * 1443 *
1498 * file ( FilePath ) 1444 * file ( FilePath )
1499 * 1445 *
1500 * The Dart file to organize directives in. 1446 * The Dart file to organize directives in.
1501 * 1447 *
1502 * Returns 1448 * Returns
1503 * 1449 *
1504 * edit ( SourceFileEdit ) 1450 * edit ( SourceFileEdit )
1505 * 1451 *
1506 * The file edit that is to be applied to the given file to effect the 1452 * The file edit that is to be applied to the given file to effect the
1507 * organizing. 1453 * organizing.
1508 */ 1454 */
1509 Future<EditOrganizeDirectivesResult> sendEditOrganizeDirectives(String file) { 1455 Future<EditOrganizeDirectivesResult> sendEditOrganizeDirectives(String file) a sync {
1510 var params = new EditOrganizeDirectivesParams(file).toJson(); 1456 var params = new EditOrganizeDirectivesParams(file).toJson();
1511 return server.send("edit.organizeDirectives", params) 1457 var result = await server.send("edit.organizeDirectives", params);
1512 .then((result) { 1458 ResponseDecoder decoder = new ResponseDecoder(null);
1513 ResponseDecoder decoder = new ResponseDecoder(null); 1459 return new EditOrganizeDirectivesResult.fromJson(decoder, 'result', result);
1514 return new EditOrganizeDirectivesResult.fromJson(decoder, 'result', result );
1515 });
1516 } 1460 }
1517 1461
1518 /** 1462 /**
1519 * Create an execution context for the executable file with the given path. 1463 * Create an execution context for the executable file with the given path.
1520 * The context that is created will persist until execution.deleteContext is 1464 * The context that is created will persist until execution.deleteContext is
1521 * used to delete it. Clients, therefore, are responsible for managing the 1465 * used to delete it. Clients, therefore, are responsible for managing the
1522 * lifetime of execution contexts. 1466 * lifetime of execution contexts.
1523 * 1467 *
1524 * Parameters 1468 * Parameters
1525 * 1469 *
1526 * contextRoot ( FilePath ) 1470 * contextRoot ( FilePath )
1527 * 1471 *
1528 * The path of the Dart or HTML file that will be launched, or the path of 1472 * The path of the Dart or HTML file that will be launched, or the path of
1529 * the directory containing the file. 1473 * the directory containing the file.
1530 * 1474 *
1531 * Returns 1475 * Returns
1532 * 1476 *
1533 * id ( ExecutionContextId ) 1477 * id ( ExecutionContextId )
1534 * 1478 *
1535 * The identifier used to refer to the execution context that was created. 1479 * The identifier used to refer to the execution context that was created.
1536 */ 1480 */
1537 Future<ExecutionCreateContextResult> sendExecutionCreateContext(String context Root) { 1481 Future<ExecutionCreateContextResult> sendExecutionCreateContext(String context Root) async {
1538 var params = new ExecutionCreateContextParams(contextRoot).toJson(); 1482 var params = new ExecutionCreateContextParams(contextRoot).toJson();
1539 return server.send("execution.createContext", params) 1483 var result = await server.send("execution.createContext", params);
1540 .then((result) { 1484 ResponseDecoder decoder = new ResponseDecoder(null);
1541 ResponseDecoder decoder = new ResponseDecoder(null); 1485 return new ExecutionCreateContextResult.fromJson(decoder, 'result', result);
1542 return new ExecutionCreateContextResult.fromJson(decoder, 'result', result );
1543 });
1544 } 1486 }
1545 1487
1546 /** 1488 /**
1547 * Delete the execution context with the given identifier. The context id is 1489 * Delete the execution context with the given identifier. The context id is
1548 * no longer valid after this command. The server is allowed to re-use ids 1490 * no longer valid after this command. The server is allowed to re-use ids
1549 * when they are no longer valid. 1491 * when they are no longer valid.
1550 * 1492 *
1551 * Parameters 1493 * Parameters
1552 * 1494 *
1553 * id ( ExecutionContextId ) 1495 * id ( ExecutionContextId )
1554 * 1496 *
1555 * The identifier of the execution context that is to be deleted. 1497 * The identifier of the execution context that is to be deleted.
1556 */ 1498 */
1557 Future sendExecutionDeleteContext(String id) { 1499 Future sendExecutionDeleteContext(String id) async {
1558 var params = new ExecutionDeleteContextParams(id).toJson(); 1500 var params = new ExecutionDeleteContextParams(id).toJson();
1559 return server.send("execution.deleteContext", params) 1501 var result = await server.send("execution.deleteContext", params);
1560 .then((result) { 1502 expect(result, isNull);
1561 expect(result, isNull); 1503 return null;
1562 return null;
1563 });
1564 } 1504 }
1565 1505
1566 /** 1506 /**
1567 * Map a URI from the execution context to the file that it corresponds to, 1507 * Map a URI from the execution context to the file that it corresponds to,
1568 * or map a file to the URI that it corresponds to in the execution context. 1508 * or map a file to the URI that it corresponds to in the execution context.
1569 * 1509 *
1570 * Exactly one of the file and uri fields must be provided. If both fields 1510 * Exactly one of the file and uri fields must be provided. If both fields
1571 * are provided, then an error of type INVALID_PARAMETER will be generated. 1511 * are provided, then an error of type INVALID_PARAMETER will be generated.
1572 * Similarly, if neither field is provided, then an error of type 1512 * Similarly, if neither field is provided, then an error of type
1573 * INVALID_PARAMETER will be generated. 1513 * INVALID_PARAMETER will be generated.
(...skipping 30 matching lines...) Expand all
1604 * file ( optional FilePath ) 1544 * file ( optional FilePath )
1605 * 1545 *
1606 * The file to which the URI was mapped. This field is omitted if the uri 1546 * The file to which the URI was mapped. This field is omitted if the uri
1607 * field was not given in the request. 1547 * field was not given in the request.
1608 * 1548 *
1609 * uri ( optional String ) 1549 * uri ( optional String )
1610 * 1550 *
1611 * The URI to which the file path was mapped. This field is omitted if the 1551 * The URI to which the file path was mapped. This field is omitted if the
1612 * file field was not given in the request. 1552 * file field was not given in the request.
1613 */ 1553 */
1614 Future<ExecutionMapUriResult> sendExecutionMapUri(String id, {String file, Str ing uri}) { 1554 Future<ExecutionMapUriResult> sendExecutionMapUri(String id, {String file, Str ing uri}) async {
1615 var params = new ExecutionMapUriParams(id, file: file, uri: uri).toJson(); 1555 var params = new ExecutionMapUriParams(id, file: file, uri: uri).toJson();
1616 return server.send("execution.mapUri", params) 1556 var result = await server.send("execution.mapUri", params);
1617 .then((result) { 1557 ResponseDecoder decoder = new ResponseDecoder(null);
1618 ResponseDecoder decoder = new ResponseDecoder(null); 1558 return new ExecutionMapUriResult.fromJson(decoder, 'result', result);
1619 return new ExecutionMapUriResult.fromJson(decoder, 'result', result);
1620 });
1621 } 1559 }
1622 1560
1623 /** 1561 /**
1624 * Subscribe for services. All previous subscriptions are replaced by the 1562 * Subscribe for services. All previous subscriptions are replaced by the
1625 * given set of services. 1563 * given set of services.
1626 * 1564 *
1627 * It is an error if any of the elements in the list are not valid services. 1565 * It is an error if any of the elements in the list are not valid services.
1628 * If there is an error, then the current subscriptions will remain 1566 * If there is an error, then the current subscriptions will remain
1629 * unchanged. 1567 * unchanged.
1630 * 1568 *
1631 * Parameters 1569 * Parameters
1632 * 1570 *
1633 * subscriptions ( List<ExecutionService> ) 1571 * subscriptions ( List<ExecutionService> )
1634 * 1572 *
1635 * A list of the services being subscribed to. 1573 * A list of the services being subscribed to.
1636 */ 1574 */
1637 Future sendExecutionSetSubscriptions(List<ExecutionService> subscriptions) { 1575 Future sendExecutionSetSubscriptions(List<ExecutionService> subscriptions) asy nc {
1638 var params = new ExecutionSetSubscriptionsParams(subscriptions).toJson(); 1576 var params = new ExecutionSetSubscriptionsParams(subscriptions).toJson();
1639 return server.send("execution.setSubscriptions", params) 1577 var result = await server.send("execution.setSubscriptions", params);
1640 .then((result) { 1578 expect(result, isNull);
1641 expect(result, isNull); 1579 return null;
1642 return null;
1643 });
1644 } 1580 }
1645 1581
1646 /** 1582 /**
1647 * Reports information needed to allow a single file to be launched. 1583 * Reports information needed to allow a single file to be launched.
1648 * 1584 *
1649 * This notification is not subscribed to by default. Clients can subscribe 1585 * This notification is not subscribed to by default. Clients can subscribe
1650 * by including the value "LAUNCH_DATA" in the list of services passed in an 1586 * by including the value "LAUNCH_DATA" in the list of services passed in an
1651 * execution.setSubscriptions request. 1587 * execution.setSubscriptions request.
1652 * 1588 *
1653 * Parameters 1589 * Parameters
(...skipping 22 matching lines...) Expand all
1676 1612
1677 /** 1613 /**
1678 * Return server diagnostics. 1614 * Return server diagnostics.
1679 * 1615 *
1680 * Returns 1616 * Returns
1681 * 1617 *
1682 * contexts ( List<ContextData> ) 1618 * contexts ( List<ContextData> )
1683 * 1619 *
1684 * The list of analysis contexts. 1620 * The list of analysis contexts.
1685 */ 1621 */
1686 Future<DiagnosticGetDiagnosticsResult> sendDiagnosticGetDiagnostics() { 1622 Future<DiagnosticGetDiagnosticsResult> sendDiagnosticGetDiagnostics() async {
1687 return server.send("diagnostic.getDiagnostics", null) 1623 var result = await server.send("diagnostic.getDiagnostics", null);
1688 .then((result) { 1624 ResponseDecoder decoder = new ResponseDecoder(null);
1689 ResponseDecoder decoder = new ResponseDecoder(null); 1625 return new DiagnosticGetDiagnosticsResult.fromJson(decoder, 'result', result );
1690 return new DiagnosticGetDiagnosticsResult.fromJson(decoder, 'result', resu lt);
1691 });
1692 } 1626 }
1693 1627
1694 /** 1628 /**
1695 * Initialize the fields in InttestMixin, and ensure that notifications will 1629 * Initialize the fields in InttestMixin, and ensure that notifications will
1696 * be handled. 1630 * be handled.
1697 */ 1631 */
1698 void initializeInttestMixin() { 1632 void initializeInttestMixin() {
1699 _onServerConnected = new StreamController<ServerConnectedParams>(sync: true) ; 1633 _onServerConnected = new StreamController<ServerConnectedParams>(sync: true) ;
1700 onServerConnected = _onServerConnected.stream.asBroadcastStream(); 1634 onServerConnected = _onServerConnected.stream.asBroadcastStream();
1701 _onServerError = new StreamController<ServerErrorParams>(sync: true); 1635 _onServerError = new StreamController<ServerErrorParams>(sync: true);
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1806 case "execution.launchData": 1740 case "execution.launchData":
1807 expect(params, isExecutionLaunchDataParams); 1741 expect(params, isExecutionLaunchDataParams);
1808 _onExecutionLaunchData.add(new ExecutionLaunchDataParams.fromJson(decode r, 'params', params)); 1742 _onExecutionLaunchData.add(new ExecutionLaunchDataParams.fromJson(decode r, 'params', params));
1809 break; 1743 break;
1810 default: 1744 default:
1811 fail('Unexpected notification: $event'); 1745 fail('Unexpected notification: $event');
1812 break; 1746 break;
1813 } 1747 }
1814 } 1748 }
1815 } 1749 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698