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

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

Issue 628783002: Change integration test send...() methods to return structured objects. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
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 17 matching lines...) Expand all
28 28
29 /** 29 /**
30 * Return the version number of the analysis server. 30 * Return the version number of the analysis server.
31 * 31 *
32 * Returns 32 * Returns
33 * 33 *
34 * version ( String ) 34 * version ( String )
35 * 35 *
36 * The version number of the analysis server. 36 * The version number of the analysis server.
37 */ 37 */
38 Future sendServerGetVersion() { 38 Future<ServerGetVersionResult> sendServerGetVersion() {
39 return server.send("server.getVersion", null) 39 return server.send("server.getVersion", null)
40 .then((result) { 40 .then((result) {
41 expect(result, isServerGetVersionResult); 41 ResponseDecoder decoder = new ResponseDecoder(null);
42 return result; 42 return new ServerGetVersionResult.fromJson(decoder, 'result', result);
43 }); 43 });
44 } 44 }
45 45
46 /** 46 /**
47 * Cleanly shutdown the analysis server. Requests that are received after 47 * Cleanly shutdown the analysis server. Requests that are received after
48 * this request will not be processed. Requests that were received before 48 * this request will not be processed. Requests that were received before
49 * 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
50 * 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
51 * response to this request has been sent. 51 * response to this request has been sent.
52 */ 52 */
53 Future sendServerShutdown() { 53 Future sendServerShutdown() {
54 return server.send("server.shutdown", null) 54 return server.send("server.shutdown", null)
55 .then((result) { 55 .then((result) {
56 expect(result, isServerShutdownResult); 56 expect(result, isNull);
57 return result; 57 return null;
58 }); 58 });
59 } 59 }
60 60
61 /** 61 /**
62 * Subscribe for services. All previous subscriptions are replaced by the 62 * Subscribe for services. All previous subscriptions are replaced by the
63 * given set of services. 63 * given set of services.
64 * 64 *
65 * 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.
66 * If there is an error, then the current subscriptions will remain 66 * If there is an error, then the current subscriptions will remain
67 * unchanged. 67 * unchanged.
68 * 68 *
69 * Parameters 69 * Parameters
70 * 70 *
71 * subscriptions ( List<ServerService> ) 71 * subscriptions ( List<ServerService> )
72 * 72 *
73 * A list of the services being subscribed to. 73 * A list of the services being subscribed to.
74 */ 74 */
75 Future sendServerSetSubscriptions(List<ServerService> subscriptions) { 75 Future sendServerSetSubscriptions(List<ServerService> subscriptions) {
76 var params = new ServerSetSubscriptionsParams(subscriptions).toJson(); 76 var params = new ServerSetSubscriptionsParams(subscriptions).toJson();
77 return server.send("server.setSubscriptions", params) 77 return server.send("server.setSubscriptions", params)
78 .then((result) { 78 .then((result) {
79 expect(result, isServerSetSubscriptionsResult); 79 expect(result, isNull);
80 return result; 80 return null;
81 }); 81 });
82 } 82 }
83 83
84 /** 84 /**
85 * 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
86 * 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
87 * let the client know that it started correctly. 87 * let the client know that it started correctly.
88 * 88 *
89 * 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.
90 */ 90 */
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 * file ( FilePath ) 173 * file ( FilePath )
174 * 174 *
175 * The file for which errors are being requested. 175 * The file for which errors are being requested.
176 * 176 *
177 * Returns 177 * Returns
178 * 178 *
179 * errors ( List<AnalysisError> ) 179 * errors ( List<AnalysisError> )
180 * 180 *
181 * The errors associated with the file. 181 * The errors associated with the file.
182 */ 182 */
183 Future sendAnalysisGetErrors(String file) { 183 Future<AnalysisGetErrorsResult> sendAnalysisGetErrors(String file) {
184 var params = new AnalysisGetErrorsParams(file).toJson(); 184 var params = new AnalysisGetErrorsParams(file).toJson();
185 return server.send("analysis.getErrors", params) 185 return server.send("analysis.getErrors", params)
186 .then((result) { 186 .then((result) {
187 expect(result, isAnalysisGetErrorsResult); 187 ResponseDecoder decoder = new ResponseDecoder(null);
188 return result; 188 return new AnalysisGetErrorsResult.fromJson(decoder, 'result', result);
189 }); 189 });
190 } 190 }
191 191
192 /** 192 /**
193 * 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
194 * 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
195 * processed the information will be omitted from the response. 195 * processed the information will be omitted from the response.
196 * 196 *
197 * Parameters 197 * Parameters
198 * 198 *
199 * file ( FilePath ) 199 * file ( FilePath )
200 * 200 *
201 * The file in which hover information is being requested. 201 * The file in which hover information is being requested.
202 * 202 *
203 * offset ( int ) 203 * offset ( int )
204 * 204 *
205 * The offset for which hover information is being requested. 205 * The offset for which hover information is being requested.
206 * 206 *
207 * Returns 207 * Returns
208 * 208 *
209 * hovers ( List<HoverInformation> ) 209 * hovers ( List<HoverInformation> )
210 * 210 *
211 * The hover information associated with the location. The list will be 211 * The hover information associated with the location. The list will be
212 * 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
213 * 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
214 * 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
215 * multiple libraries). 215 * multiple libraries).
216 */ 216 */
217 Future sendAnalysisGetHover(String file, int offset) { 217 Future<AnalysisGetHoverResult> sendAnalysisGetHover(String file, int offset) {
218 var params = new AnalysisGetHoverParams(file, offset).toJson(); 218 var params = new AnalysisGetHoverParams(file, offset).toJson();
219 return server.send("analysis.getHover", params) 219 return server.send("analysis.getHover", params)
220 .then((result) { 220 .then((result) {
221 expect(result, isAnalysisGetHoverResult); 221 ResponseDecoder decoder = new ResponseDecoder(null);
222 return result; 222 return new AnalysisGetHoverResult.fromJson(decoder, 'result', result);
223 }); 223 });
224 } 224 }
225 225
226 /** 226 /**
227 * Force the re-analysis of everything contained in the existing analysis 227 * Force the re-analysis of everything contained in the existing analysis
228 * roots. This will cause all previously computed analysis results to be 228 * roots. This will cause all previously computed analysis results to be
229 * discarded and recomputed, and will cause all subscribed notifications to 229 * discarded and recomputed, and will cause all subscribed notifications to
230 * be re-sent. 230 * be re-sent.
231 */ 231 */
232 Future sendAnalysisReanalyze() { 232 Future sendAnalysisReanalyze() {
233 return server.send("analysis.reanalyze", null) 233 return server.send("analysis.reanalyze", null)
234 .then((result) { 234 .then((result) {
235 expect(result, isAnalysisReanalyzeResult); 235 expect(result, isNull);
236 return result; 236 return null;
237 }); 237 });
238 } 238 }
239 239
240 /** 240 /**
241 * 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
242 * 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
243 * are not also in one of the excluded paths. 243 * are not also in one of the excluded paths.
244 * 244 *
245 * 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
246 * actual set of analysis roots at any given time is the intersection of this 246 * actual set of analysis roots at any given time is the intersection of this
(...skipping 20 matching lines...) Expand all
267 * 267 *
268 * excluded ( List<FilePath> ) 268 * excluded ( List<FilePath> )
269 * 269 *
270 * 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
271 * should not be analyzed. 271 * should not be analyzed.
272 */ 272 */
273 Future sendAnalysisSetAnalysisRoots(List<String> included, List<String> exclud ed) { 273 Future sendAnalysisSetAnalysisRoots(List<String> included, List<String> exclud ed) {
274 var params = new AnalysisSetAnalysisRootsParams(included, excluded).toJson() ; 274 var params = new AnalysisSetAnalysisRootsParams(included, excluded).toJson() ;
275 return server.send("analysis.setAnalysisRoots", params) 275 return server.send("analysis.setAnalysisRoots", params)
276 .then((result) { 276 .then((result) {
277 expect(result, isAnalysisSetAnalysisRootsResult); 277 expect(result, isNull);
278 return result; 278 return null;
279 }); 279 });
280 } 280 }
281 281
282 /** 282 /**
283 * 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
284 * 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
285 * 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
286 * 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
287 * 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
288 * 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,
(...skipping 12 matching lines...) Expand all
301 * Parameters 301 * Parameters
302 * 302 *
303 * files ( List<FilePath> ) 303 * files ( List<FilePath> )
304 * 304 *
305 * The files that are to be a priority for analysis. 305 * The files that are to be a priority for analysis.
306 */ 306 */
307 Future sendAnalysisSetPriorityFiles(List<String> files) { 307 Future sendAnalysisSetPriorityFiles(List<String> files) {
308 var params = new AnalysisSetPriorityFilesParams(files).toJson(); 308 var params = new AnalysisSetPriorityFilesParams(files).toJson();
309 return server.send("analysis.setPriorityFiles", params) 309 return server.send("analysis.setPriorityFiles", params)
310 .then((result) { 310 .then((result) {
311 expect(result, isAnalysisSetPriorityFilesResult); 311 expect(result, isNull);
312 return result; 312 return null;
313 }); 313 });
314 } 314 }
315 315
316 /** 316 /**
317 * Subscribe for services. All previous subscriptions are replaced by the 317 * Subscribe for services. All previous subscriptions are replaced by the
318 * 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
319 * 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
320 * 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
321 * files. 321 * files.
322 * 322 *
(...skipping 19 matching lines...) Expand all
342 * 342 *
343 * subscriptions ( Map<AnalysisService, List<FilePath>> ) 343 * subscriptions ( Map<AnalysisService, List<FilePath>> )
344 * 344 *
345 * 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
346 * service. 346 * service.
347 */ 347 */
348 Future sendAnalysisSetSubscriptions(Map<AnalysisService, List<String>> subscri ptions) { 348 Future sendAnalysisSetSubscriptions(Map<AnalysisService, List<String>> subscri ptions) {
349 var params = new AnalysisSetSubscriptionsParams(subscriptions).toJson(); 349 var params = new AnalysisSetSubscriptionsParams(subscriptions).toJson();
350 return server.send("analysis.setSubscriptions", params) 350 return server.send("analysis.setSubscriptions", params)
351 .then((result) { 351 .then((result) {
352 expect(result, isAnalysisSetSubscriptionsResult); 352 expect(result, isNull);
353 return result; 353 return null;
354 }); 354 });
355 } 355 }
356 356
357 /** 357 /**
358 * 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
359 * updated but not included in this update remain unchanged. This effectively 359 * updated but not included in this update remain unchanged. This effectively
360 * represents an overlay of the filesystem. The files whose content is 360 * represents an overlay of the filesystem. The files whose content is
361 * 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
362 * 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
363 * path represents the path to a directory on the filesystem. 363 * path represents the path to a directory on the filesystem.
364 * 364 *
365 * Parameters 365 * Parameters
366 * 366 *
367 * files ( Map<FilePath, AddContentOverlay | ChangeContentOverlay | 367 * files ( Map<FilePath, AddContentOverlay | ChangeContentOverlay |
368 * RemoveContentOverlay> ) 368 * RemoveContentOverlay> )
369 * 369 *
370 * 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
371 * the content change. 371 * the content change.
372 */ 372 */
373 Future sendAnalysisUpdateContent(Map<String, dynamic> files) { 373 Future sendAnalysisUpdateContent(Map<String, dynamic> files) {
374 var params = new AnalysisUpdateContentParams(files).toJson(); 374 var params = new AnalysisUpdateContentParams(files).toJson();
375 return server.send("analysis.updateContent", params) 375 return server.send("analysis.updateContent", params)
376 .then((result) { 376 .then((result) {
377 expect(result, isAnalysisUpdateContentResult); 377 expect(result, isNull);
378 return result; 378 return null;
379 }); 379 });
380 } 380 }
381 381
382 /** 382 /**
383 * 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.
384 * 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
385 * 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,
386 * they will be silently ignored. 386 * they will be silently ignored.
387 * 387 *
388 * Parameters 388 * Parameters
389 * 389 *
390 * options ( AnalysisOptions ) 390 * options ( AnalysisOptions )
391 * 391 *
392 * The options that are to be used to control analysis. 392 * The options that are to be used to control analysis.
393 */ 393 */
394 Future sendAnalysisUpdateOptions(AnalysisOptions options) { 394 Future sendAnalysisUpdateOptions(AnalysisOptions options) {
395 var params = new AnalysisUpdateOptionsParams(options).toJson(); 395 var params = new AnalysisUpdateOptionsParams(options).toJson();
396 return server.send("analysis.updateOptions", params) 396 return server.send("analysis.updateOptions", params)
397 .then((result) { 397 .then((result) {
398 expect(result, isAnalysisUpdateOptionsResult); 398 expect(result, isNull);
399 return result; 399 return null;
400 }); 400 });
401 } 401 }
402 402
403 /** 403 /**
404 * 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
405 * 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
406 * previously reported errors. 406 * previously reported errors.
407 * 407 *
408 * 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
409 * command-line flag --no-error-notification. 409 * command-line flag --no-error-notification.
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 * offset ( int ) 621 * offset ( int )
622 * 622 *
623 * 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.
624 * 624 *
625 * Returns 625 * Returns
626 * 626 *
627 * id ( CompletionId ) 627 * id ( CompletionId )
628 * 628 *
629 * The identifier used to associate results with this completion request. 629 * The identifier used to associate results with this completion request.
630 */ 630 */
631 Future sendCompletionGetSuggestions(String file, int offset) { 631 Future<CompletionGetSuggestionsResult> sendCompletionGetSuggestions(String fil e, int offset) {
632 var params = new CompletionGetSuggestionsParams(file, offset).toJson(); 632 var params = new CompletionGetSuggestionsParams(file, offset).toJson();
633 return server.send("completion.getSuggestions", params) 633 return server.send("completion.getSuggestions", params)
634 .then((result) { 634 .then((result) {
635 expect(result, isCompletionGetSuggestionsResult); 635 ResponseDecoder decoder = new ResponseDecoder(null);
636 return result; 636 return new CompletionGetSuggestionsResult.fromJson(decoder, 'result', resu lt);
637 }); 637 });
638 } 638 }
639 639
640 /** 640 /**
641 * Reports the completion suggestions that should be presented to the user. 641 * Reports the completion suggestions that should be presented to the user.
642 * 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
643 * list that supersedes any previously reported suggestions. 643 * list that supersedes any previously reported suggestions.
644 * 644 *
645 * Parameters 645 * Parameters
646 * 646 *
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 * notification. 716 * notification.
717 * 717 *
718 * element ( optional Element ) 718 * element ( optional Element )
719 * 719 *
720 * The element referenced or defined at the given offset and whose 720 * The element referenced or defined at the given offset and whose
721 * references will be returned in the search results. 721 * references will be returned in the search results.
722 * 722 *
723 * 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
724 * absent. 724 * absent.
725 */ 725 */
726 Future sendSearchFindElementReferences(String file, int offset, bool includePo tential) { 726 Future<SearchFindElementReferencesResult> sendSearchFindElementReferences(Stri ng file, int offset, bool includePotential) {
727 var params = new SearchFindElementReferencesParams(file, offset, includePote ntial).toJson(); 727 var params = new SearchFindElementReferencesParams(file, offset, includePote ntial).toJson();
728 return server.send("search.findElementReferences", params) 728 return server.send("search.findElementReferences", params)
729 .then((result) { 729 .then((result) {
730 expect(result, isSearchFindElementReferencesResult); 730 ResponseDecoder decoder = new ResponseDecoder(null);
731 return result; 731 return new SearchFindElementReferencesResult.fromJson(decoder, 'result', r esult);
732 }); 732 });
733 } 733 }
734 734
735 /** 735 /**
736 * 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
737 * given name. 737 * given name.
738 * 738 *
739 * An identifier is returned immediately, and individual results will be 739 * An identifier is returned immediately, and individual results will be
740 * returned via the search.results notification as they become available. 740 * returned via the search.results notification as they become available.
741 * 741 *
742 * Parameters 742 * Parameters
743 * 743 *
744 * name ( String ) 744 * name ( String )
745 * 745 *
746 * The name of the declarations to be found. 746 * The name of the declarations to be found.
747 * 747 *
748 * Returns 748 * Returns
749 * 749 *
750 * id ( SearchId ) 750 * id ( SearchId )
751 * 751 *
752 * The identifier used to associate results with this search request. 752 * The identifier used to associate results with this search request.
753 */ 753 */
754 Future sendSearchFindMemberDeclarations(String name) { 754 Future<SearchFindMemberDeclarationsResult> sendSearchFindMemberDeclarations(St ring name) {
755 var params = new SearchFindMemberDeclarationsParams(name).toJson(); 755 var params = new SearchFindMemberDeclarationsParams(name).toJson();
756 return server.send("search.findMemberDeclarations", params) 756 return server.send("search.findMemberDeclarations", params)
757 .then((result) { 757 .then((result) {
758 expect(result, isSearchFindMemberDeclarationsResult); 758 ResponseDecoder decoder = new ResponseDecoder(null);
759 return result; 759 return new SearchFindMemberDeclarationsResult.fromJson(decoder, 'result', result);
760 }); 760 });
761 } 761 }
762 762
763 /** 763 /**
764 * 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
765 * 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
766 * 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
767 * members as well. 767 * members as well.
768 * 768 *
769 * An identifier is returned immediately, and individual results will be 769 * An identifier is returned immediately, and individual results will be
770 * returned via the search.results notification as they become available. 770 * returned via the search.results notification as they become available.
771 * 771 *
772 * Parameters 772 * Parameters
773 * 773 *
774 * name ( String ) 774 * name ( String )
775 * 775 *
776 * The name of the references to be found. 776 * The name of the references to be found.
777 * 777 *
778 * Returns 778 * Returns
779 * 779 *
780 * id ( SearchId ) 780 * id ( SearchId )
781 * 781 *
782 * The identifier used to associate results with this search request. 782 * The identifier used to associate results with this search request.
783 */ 783 */
784 Future sendSearchFindMemberReferences(String name) { 784 Future<SearchFindMemberReferencesResult> sendSearchFindMemberReferences(String name) {
785 var params = new SearchFindMemberReferencesParams(name).toJson(); 785 var params = new SearchFindMemberReferencesParams(name).toJson();
786 return server.send("search.findMemberReferences", params) 786 return server.send("search.findMemberReferences", params)
787 .then((result) { 787 .then((result) {
788 expect(result, isSearchFindMemberReferencesResult); 788 ResponseDecoder decoder = new ResponseDecoder(null);
789 return result; 789 return new SearchFindMemberReferencesResult.fromJson(decoder, 'result', re sult);
790 }); 790 });
791 } 791 }
792 792
793 /** 793 /**
794 * Perform a search for declarations of top-level elements (classes, 794 * Perform a search for declarations of top-level elements (classes,
795 * typedefs, getters, setters, functions and fields) whose name matches the 795 * typedefs, getters, setters, functions and fields) whose name matches the
796 * given pattern. 796 * given pattern.
797 * 797 *
798 * An identifier is returned immediately, and individual results will be 798 * An identifier is returned immediately, and individual results will be
799 * returned via the search.results notification as they become available. 799 * returned via the search.results notification as they become available.
800 * 800 *
801 * Parameters 801 * Parameters
802 * 802 *
803 * pattern ( String ) 803 * pattern ( String )
804 * 804 *
805 * 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
806 * found. 806 * found.
807 * 807 *
808 * Returns 808 * Returns
809 * 809 *
810 * id ( SearchId ) 810 * id ( SearchId )
811 * 811 *
812 * The identifier used to associate results with this search request. 812 * The identifier used to associate results with this search request.
813 */ 813 */
814 Future sendSearchFindTopLevelDeclarations(String pattern) { 814 Future<SearchFindTopLevelDeclarationsResult> sendSearchFindTopLevelDeclaration s(String pattern) {
815 var params = new SearchFindTopLevelDeclarationsParams(pattern).toJson(); 815 var params = new SearchFindTopLevelDeclarationsParams(pattern).toJson();
816 return server.send("search.findTopLevelDeclarations", params) 816 return server.send("search.findTopLevelDeclarations", params)
817 .then((result) { 817 .then((result) {
818 expect(result, isSearchFindTopLevelDeclarationsResult); 818 ResponseDecoder decoder = new ResponseDecoder(null);
819 return result; 819 return new SearchFindTopLevelDeclarationsResult.fromJson(decoder, 'result' , result);
820 }); 820 });
821 } 821 }
822 822
823 /** 823 /**
824 * 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
825 * location. 825 * location.
826 * 826 *
827 * Parameters 827 * Parameters
828 * 828 *
829 * file ( FilePath ) 829 * file ( FilePath )
(...skipping 12 matching lines...) Expand all
842 * 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
843 * 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
844 * 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
845 * correspond to the integers used to reference supertype and subtype items 845 * correspond to the integers used to reference supertype and subtype items
846 * within the items. 846 * within the items.
847 * 847 *
848 * 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
849 * 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
850 * to allow a type hierarchy to be produced. 850 * to allow a type hierarchy to be produced.
851 */ 851 */
852 Future sendSearchGetTypeHierarchy(String file, int offset) { 852 Future<SearchGetTypeHierarchyResult> sendSearchGetTypeHierarchy(String file, i nt offset) {
853 var params = new SearchGetTypeHierarchyParams(file, offset).toJson(); 853 var params = new SearchGetTypeHierarchyParams(file, offset).toJson();
854 return server.send("search.getTypeHierarchy", params) 854 return server.send("search.getTypeHierarchy", params)
855 .then((result) { 855 .then((result) {
856 expect(result, isSearchGetTypeHierarchyResult); 856 ResponseDecoder decoder = new ResponseDecoder(null);
857 return result; 857 return new SearchGetTypeHierarchyResult.fromJson(decoder, 'result', result );
858 }); 858 });
859 } 859 }
860 860
861 /** 861 /**
862 * 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.
863 * Unlike other notifications, this notification contains search results that 863 * Unlike other notifications, this notification contains search results that
864 * should be added to any previously received search results associated with 864 * should be added to any previously received search results associated with
865 * the same search id. 865 * the same search id.
866 * 866 *
867 * Parameters 867 * Parameters
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 * length ( int ) 905 * length ( int )
906 * 906 *
907 * The length of the code for which assists are being requested. 907 * The length of the code for which assists are being requested.
908 * 908 *
909 * Returns 909 * Returns
910 * 910 *
911 * assists ( List<SourceChange> ) 911 * assists ( List<SourceChange> )
912 * 912 *
913 * The assists that are available at the given location. 913 * The assists that are available at the given location.
914 */ 914 */
915 Future sendEditGetAssists(String file, int offset, int length) { 915 Future<EditGetAssistsResult> sendEditGetAssists(String file, int offset, int l ength) {
916 var params = new EditGetAssistsParams(file, offset, length).toJson(); 916 var params = new EditGetAssistsParams(file, offset, length).toJson();
917 return server.send("edit.getAssists", params) 917 return server.send("edit.getAssists", params)
918 .then((result) { 918 .then((result) {
919 expect(result, isEditGetAssistsResult); 919 ResponseDecoder decoder = new ResponseDecoder(null);
920 return result; 920 return new EditGetAssistsResult.fromJson(decoder, 'result', result);
921 }); 921 });
922 } 922 }
923 923
924 /** 924 /**
925 * 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
926 * selection in the given file. 926 * selection in the given file.
927 * 927 *
928 * Parameters 928 * Parameters
929 * 929 *
930 * file ( FilePath ) 930 * file ( FilePath )
931 * 931 *
932 * 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.
933 * 933 *
934 * offset ( int ) 934 * offset ( int )
935 * 935 *
936 * 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.
937 * 937 *
938 * length ( int ) 938 * length ( int )
939 * 939 *
940 * 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.
941 * 941 *
942 * Returns 942 * Returns
943 * 943 *
944 * kinds ( List<RefactoringKind> ) 944 * kinds ( List<RefactoringKind> )
945 * 945 *
946 * The kinds of refactorings that are valid for the given selection. 946 * The kinds of refactorings that are valid for the given selection.
947 */ 947 */
948 Future sendEditGetAvailableRefactorings(String file, int offset, int length) { 948 Future<EditGetAvailableRefactoringsResult> sendEditGetAvailableRefactorings(St ring file, int offset, int length) {
949 var params = new EditGetAvailableRefactoringsParams(file, offset, length).to Json(); 949 var params = new EditGetAvailableRefactoringsParams(file, offset, length).to Json();
950 return server.send("edit.getAvailableRefactorings", params) 950 return server.send("edit.getAvailableRefactorings", params)
951 .then((result) { 951 .then((result) {
952 expect(result, isEditGetAvailableRefactoringsResult); 952 ResponseDecoder decoder = new ResponseDecoder(null);
953 return result; 953 return new EditGetAvailableRefactoringsResult.fromJson(decoder, 'result', result);
954 }); 954 });
955 } 955 }
956 956
957 /** 957 /**
958 * 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
959 * offset in a given file. 959 * offset in a given file.
960 * 960 *
961 * Parameters 961 * Parameters
962 * 962 *
963 * file ( FilePath ) 963 * file ( FilePath )
964 * 964 *
965 * The file containing the errors for which fixes are being requested. 965 * The file containing the errors for which fixes are being requested.
966 * 966 *
967 * offset ( int ) 967 * offset ( int )
968 * 968 *
969 * 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.
970 * 970 *
971 * Returns 971 * Returns
972 * 972 *
973 * fixes ( List<AnalysisErrorFixes> ) 973 * fixes ( List<AnalysisErrorFixes> )
974 * 974 *
975 * 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.
976 */ 976 */
977 Future sendEditGetFixes(String file, int offset) { 977 Future<EditGetFixesResult> sendEditGetFixes(String file, int offset) {
978 var params = new EditGetFixesParams(file, offset).toJson(); 978 var params = new EditGetFixesParams(file, offset).toJson();
979 return server.send("edit.getFixes", params) 979 return server.send("edit.getFixes", params)
980 .then((result) { 980 .then((result) {
981 expect(result, isEditGetFixesResult); 981 ResponseDecoder decoder = new ResponseDecoder(null);
982 return result; 982 return new EditGetFixesResult.fromJson(decoder, 'result', result);
983 }); 983 });
984 } 984 }
985 985
986 /** 986 /**
987 * Get the changes required to perform a refactoring. 987 * Get the changes required to perform a refactoring.
988 * 988 *
989 * Parameters 989 * Parameters
990 * 990 *
991 * kind ( RefactoringKind ) 991 * kind ( RefactoringKind )
992 * 992 *
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 * potentialEdits ( optional List<String> ) 1054 * potentialEdits ( optional List<String> )
1055 * 1055 *
1056 * 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
1057 * 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
1058 * 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
1059 * 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
1060 * 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
1061 * 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
1062 * the refactoring. 1062 * the refactoring.
1063 */ 1063 */
1064 Future sendEditGetRefactoring(RefactoringKind kind, String file, int offset, i nt length, bool validateOnly, {RefactoringOptions options}) { 1064 Future<EditGetRefactoringResult> sendEditGetRefactoring(RefactoringKind kind, String file, int offset, int length, bool validateOnly, {RefactoringOptions opti ons}) {
1065 var params = new EditGetRefactoringParams(kind, file, offset, length, valida teOnly, options: options).toJson(); 1065 var params = new EditGetRefactoringParams(kind, file, offset, length, valida teOnly, options: options).toJson();
1066 return server.send("edit.getRefactoring", params) 1066 return server.send("edit.getRefactoring", params)
1067 .then((result) { 1067 .then((result) {
1068 expect(result, isEditGetRefactoringResult); 1068 ResponseDecoder decoder = new ResponseDecoder(kind);
1069 return result; 1069 return new EditGetRefactoringResult.fromJson(decoder, 'result', result);
1070 }); 1070 });
1071 } 1071 }
1072 1072
1073 /** 1073 /**
1074 * 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.
1075 * 1075 *
1076 * 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
1077 * 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
1078 * generated. 1078 * generated.
1079 * 1079 *
1080 * 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
1081 * be generated. 1081 * be generated.
1082 * 1082 *
1083 * Parameters 1083 * Parameters
1084 * 1084 *
1085 * file ( FilePath ) 1085 * file ( FilePath )
1086 * 1086 *
1087 * The Dart file to sort. 1087 * The Dart file to sort.
1088 * 1088 *
1089 * Returns 1089 * Returns
1090 * 1090 *
1091 * edit ( SourceFileEdit ) 1091 * edit ( SourceFileEdit )
1092 * 1092 *
1093 * 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
1094 * sorting. 1094 * sorting.
1095 */ 1095 */
1096 Future sendEditSortMembers(String file) { 1096 Future<EditSortMembersResult> sendEditSortMembers(String file) {
1097 var params = new EditSortMembersParams(file).toJson(); 1097 var params = new EditSortMembersParams(file).toJson();
1098 return server.send("edit.sortMembers", params) 1098 return server.send("edit.sortMembers", params)
1099 .then((result) { 1099 .then((result) {
1100 expect(result, isEditSortMembersResult); 1100 ResponseDecoder decoder = new ResponseDecoder(null);
1101 return result; 1101 return new EditSortMembersResult.fromJson(decoder, 'result', result);
1102 }); 1102 });
1103 } 1103 }
1104 1104
1105 /** 1105 /**
1106 * 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.
1107 * The context that is created will persist until execution.deleteContext is 1107 * The context that is created will persist until execution.deleteContext is
1108 * used to delete it. Clients, therefore, are responsible for managing the 1108 * used to delete it. Clients, therefore, are responsible for managing the
1109 * lifetime of execution contexts. 1109 * lifetime of execution contexts.
1110 * 1110 *
1111 * Parameters 1111 * Parameters
1112 * 1112 *
1113 * contextRoot ( FilePath ) 1113 * contextRoot ( FilePath )
1114 * 1114 *
1115 * 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.
1116 * 1116 *
1117 * Returns 1117 * Returns
1118 * 1118 *
1119 * id ( ExecutionContextId ) 1119 * id ( ExecutionContextId )
1120 * 1120 *
1121 * 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.
1122 */ 1122 */
1123 Future sendExecutionCreateContext(String contextRoot) { 1123 Future<ExecutionCreateContextResult> sendExecutionCreateContext(String context Root) {
1124 var params = new ExecutionCreateContextParams(contextRoot).toJson(); 1124 var params = new ExecutionCreateContextParams(contextRoot).toJson();
1125 return server.send("execution.createContext", params) 1125 return server.send("execution.createContext", params)
1126 .then((result) { 1126 .then((result) {
1127 expect(result, isExecutionCreateContextResult); 1127 ResponseDecoder decoder = new ResponseDecoder(null);
1128 return result; 1128 return new ExecutionCreateContextResult.fromJson(decoder, 'result', result );
1129 }); 1129 });
1130 } 1130 }
1131 1131
1132 /** 1132 /**
1133 * 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
1134 * 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
1135 * when they are no longer valid. 1135 * when they are no longer valid.
1136 * 1136 *
1137 * Parameters 1137 * Parameters
1138 * 1138 *
1139 * id ( ExecutionContextId ) 1139 * id ( ExecutionContextId )
1140 * 1140 *
1141 * The identifier of the execution context that is to be deleted. 1141 * The identifier of the execution context that is to be deleted.
1142 */ 1142 */
1143 Future sendExecutionDeleteContext(String id) { 1143 Future sendExecutionDeleteContext(String id) {
1144 var params = new ExecutionDeleteContextParams(id).toJson(); 1144 var params = new ExecutionDeleteContextParams(id).toJson();
1145 return server.send("execution.deleteContext", params) 1145 return server.send("execution.deleteContext", params)
1146 .then((result) { 1146 .then((result) {
1147 expect(result, isExecutionDeleteContextResult); 1147 expect(result, isNull);
1148 return result; 1148 return null;
1149 }); 1149 });
1150 } 1150 }
1151 1151
1152 /** 1152 /**
1153 * 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,
1154 * 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.
1155 * 1155 *
1156 * Exactly one of the file and uri fields must be provided. 1156 * Exactly one of the file and uri fields must be provided.
1157 * 1157 *
1158 * Parameters 1158 * Parameters
(...skipping 16 matching lines...) Expand all
1175 * file ( optional FilePath ) 1175 * file ( optional FilePath )
1176 * 1176 *
1177 * 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
1178 * field was not given in the request. 1178 * field was not given in the request.
1179 * 1179 *
1180 * uri ( optional String ) 1180 * uri ( optional String )
1181 * 1181 *
1182 * 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
1183 * file field was not given in the request. 1183 * file field was not given in the request.
1184 */ 1184 */
1185 Future sendExecutionMapUri(String id, {String file, String uri}) { 1185 Future<ExecutionMapUriResult> sendExecutionMapUri(String id, {String file, Str ing uri}) {
1186 var params = new ExecutionMapUriParams(id, file: file, uri: uri).toJson(); 1186 var params = new ExecutionMapUriParams(id, file: file, uri: uri).toJson();
1187 return server.send("execution.mapUri", params) 1187 return server.send("execution.mapUri", params)
1188 .then((result) { 1188 .then((result) {
1189 expect(result, isExecutionMapUriResult); 1189 ResponseDecoder decoder = new ResponseDecoder(null);
1190 return result; 1190 return new ExecutionMapUriResult.fromJson(decoder, 'result', result);
1191 }); 1191 });
1192 } 1192 }
1193 1193
1194 /** 1194 /**
1195 * Subscribe for services. All previous subscriptions are replaced by the 1195 * Subscribe for services. All previous subscriptions are replaced by the
1196 * given set of services. 1196 * given set of services.
1197 * 1197 *
1198 * 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.
1199 * If there is an error, then the current subscriptions will remain 1199 * If there is an error, then the current subscriptions will remain
1200 * unchanged. 1200 * unchanged.
1201 * 1201 *
1202 * Parameters 1202 * Parameters
1203 * 1203 *
1204 * subscriptions ( List<ExecutionService> ) 1204 * subscriptions ( List<ExecutionService> )
1205 * 1205 *
1206 * A list of the services being subscribed to. 1206 * A list of the services being subscribed to.
1207 */ 1207 */
1208 Future sendExecutionSetSubscriptions(List<ExecutionService> subscriptions) { 1208 Future sendExecutionSetSubscriptions(List<ExecutionService> subscriptions) {
1209 var params = new ExecutionSetSubscriptionsParams(subscriptions).toJson(); 1209 var params = new ExecutionSetSubscriptionsParams(subscriptions).toJson();
1210 return server.send("execution.setSubscriptions", params) 1210 return server.send("execution.setSubscriptions", params)
1211 .then((result) { 1211 .then((result) {
1212 expect(result, isExecutionSetSubscriptionsResult); 1212 expect(result, isNull);
1213 return result; 1213 return null;
1214 }); 1214 });
1215 } 1215 }
1216 1216
1217 /** 1217 /**
1218 * Reports information needed to allow a single file to be launched. 1218 * Reports information needed to allow a single file to be launched.
1219 * 1219 *
1220 * This notification is not subscribed to by default. Clients can subscribe 1220 * This notification is not subscribed to by default. Clients can subscribe
1221 * 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
1222 * execution.setSubscriptions request. 1222 * execution.setSubscriptions request.
1223 * 1223 *
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1341 case "execution.launchData": 1341 case "execution.launchData":
1342 expect(params, isExecutionLaunchDataParams); 1342 expect(params, isExecutionLaunchDataParams);
1343 _onExecutionLaunchData.add(params); 1343 _onExecutionLaunchData.add(params);
1344 break; 1344 break;
1345 default: 1345 default:
1346 fail('Unexpected notification: $event'); 1346 fail('Unexpected notification: $event');
1347 break; 1347 break;
1348 } 1348 }
1349 } 1349 }
1350 } 1350 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698