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

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

Issue 451483005: Code generate integration test methods for synchronous request/response pairs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4 //
5 // This file has been automatically generated. Please do not edit it manually.
6 // To regenerate the file, use the script
7 // "pkg/analysis_server/spec/generate_files".
8
9 /**
10 * Convenience methods for running integration tests
11 */
12 library test.integration.methods;
13
14 import 'dart:async';
15
16 import 'package:unittest/unittest.dart';
17
18 import 'integration_tests.dart';
19 import 'protocol_matchers.dart';
20
21
22 /**
23 * Convenience methods for running integration tests
24 */
25 abstract class InttestMixin {
26 Server get server;
27
28 /**
29 * Return the version number of the analysis server.
30 *
31 * Returns
32 *
33 * version ( String )
34 *
35 * The version number of the analysis server.
36 */
37 Future sendServerGetVersion({bool checkTypes: true}) {
38 return server.send("server.getVersion", null)
39 .then((result) {
40 if (checkTypes) {
41 expect(result, isServerGetVersionResult);
42 }
43 return result;
44 });
45 }
46
47 /**
48 * Cleanly shutdown the analysis server. Requests that are received after
49 * 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
51 * responded to. No further responses or notifications will be sent after the
52 * response to this request has been sent.
53 */
54 Future sendServerShutdown({bool checkTypes: true}) {
55 return server.send("server.shutdown", null)
56 .then((result) {
57 if (checkTypes) {
58 expect(result, isServerShutdownResult);
59 }
60 return result;
61 });
62 }
63
64 /**
65 * Subscribe for services. All previous subscriptions are replaced by the
66 * given set of services.
67 *
68 * It is an error if any of the elements in the list are not valid services.
69 * If there is an error, then the current subscriptions will remain
70 * unchanged.
71 *
72 * Parameters
73 *
74 * subscriptions ( List<ServerService> )
75 *
76 * A list of the services being subscribed to.
77 */
78 Future sendServerSetSubscriptions(List<String> subscriptions, {bool checkTypes : true}) {
79 Map<String, dynamic> params = {};
80 params["subscriptions"] = subscriptions;
81 if (checkTypes) {
82 expect(params, isServerSetSubscriptionsParams);
83 }
84 return server.send("server.setSubscriptions", params)
85 .then((result) {
86 if (checkTypes) {
87 expect(result, isServerSetSubscriptionsResult);
88 }
89 return result;
90 });
91 }
92
93 /**
94 * Return the errors associated with the given file. If the errors for the
95 * given file have not yet been computed, or the most recently computed
96 * errors for the given file are out of date, then the response for this
97 * request will be delayed until they have been computed. If some or all of
98 * the errors for the file cannot be computed, then the subset of the errors
99 * that can be computed will be returned and the response will contain an
100 * error to indicate why the errors could not be computed.
101 *
102 * This request is intended to be used by clients that cannot asynchronously
103 * apply updated error information. Clients that can apply error information
104 * as it becomes available should use the information provided by the
105 * 'analysis.errors' notification.
106 *
107 * Parameters
108 *
109 * file ( FilePath )
110 *
111 * The file for which errors are being requested.
112 *
113 * Returns
114 *
115 * errors ( List<AnalysisError> )
116 *
117 * The errors associated with the file.
118 */
119 Future sendAnalysisGetErrors(String file, {bool checkTypes: true}) {
120 Map<String, dynamic> params = {};
121 params["file"] = file;
122 if (checkTypes) {
123 expect(params, isAnalysisGetErrorsParams);
124 }
125 return server.send("analysis.getErrors", params)
126 .then((result) {
127 if (checkTypes) {
128 expect(result, isAnalysisGetErrorsResult);
129 }
130 return result;
131 });
132 }
133
134 /**
135 * Return the hover information associate with the given location. If some or
136 * all of the hover information is not available at the time this request is
137 * processed the information will be omitted from the response.
138 *
139 * Parameters
140 *
141 * file ( FilePath )
142 *
143 * The file in which hover information is being requested.
144 *
145 * offset ( int )
146 *
147 * The offset for which hover information is being requested.
148 *
149 * Returns
150 *
151 * hovers ( List<HoverInformation> )
152 *
153 * The hover information associated with the location. The list will be
154 * empty if no information could be determined for the location. The list
155 * can contain multiple items if the file is being analyzed in multiple
156 * contexts in conflicting ways (such as a part that is included in
157 * multiple libraries).
158 */
159 Future sendAnalysisGetHover(String file, int offset, {bool checkTypes: true}) {
160 Map<String, dynamic> params = {};
161 params["file"] = file;
162 params["offset"] = offset;
163 if (checkTypes) {
164 expect(params, isAnalysisGetHoverParams);
165 }
166 return server.send("analysis.getHover", params)
167 .then((result) {
168 if (checkTypes) {
169 expect(result, isAnalysisGetHoverResult);
170 }
171 return result;
172 });
173 }
174
175 /**
176 * Force the re-analysis of everything contained in the existing analysis
177 * roots. This will cause all previously computed analysis results to be
178 * discarded and recomputed, and will cause all subscribed notifications to
179 * be re-sent.
180 */
181 Future sendAnalysisReanalyze({bool checkTypes: true}) {
182 return server.send("analysis.reanalyze", null)
183 .then((result) {
184 if (checkTypes) {
185 expect(result, isAnalysisReanalyzeResult);
186 }
187 return result;
188 });
189 }
190
191 /**
192 * Sets the root paths used to determine which files to analyze. The set of
193 * files to be analyzed are all of the files in one of the root paths that
194 * are not also in one of the excluded paths.
195 *
196 * Note that this request determines the set of requested analysis roots. The
197 * actual set of analysis roots at any given time is the intersection of this
198 * set with the set of files and directories actually present on the
199 * filesystem. When the filesystem changes, the actual set of analysis roots
200 * is automatically updated, but the set of requested analysis roots is
201 * unchanged. This means that if the client sets an analysis root before the
202 * root becomes visible to server in the filesystem, there is no error; once
203 * the server sees the root in the filesystem it will start analyzing it.
204 * Similarly, server will stop analyzing files that are removed from the file
205 * system but they will remain in the set of requested roots.
206 *
207 * If an included path represents a file, then server will look in the
208 * directory containing the file for a pubspec.yaml file. If none is found,
209 * then the parents of the directory will be searched until such a file is
210 * found or the root of the file system is reached. If such a file is found,
211 * it will be used to resolve package: URI’s within the file.
212 *
213 * Parameters
214 *
215 * included ( List<FilePath> )
216 *
217 * A list of the files and directories that should be analyzed.
218 *
219 * excluded ( List<FilePath> )
220 *
221 * A list of the files and directories within the included directories that
222 * should not be analyzed.
223 */
224 Future sendAnalysisSetAnalysisRoots(List<String> included, List<String> exclud ed, {bool checkTypes: true}) {
225 Map<String, dynamic> params = {};
226 params["included"] = included;
227 params["excluded"] = excluded;
228 if (checkTypes) {
229 expect(params, isAnalysisSetAnalysisRootsParams);
230 }
231 return server.send("analysis.setAnalysisRoots", params)
232 .then((result) {
233 if (checkTypes) {
234 expect(result, isAnalysisSetAnalysisRootsResult);
235 }
236 return result;
237 });
238 }
239
240 /**
241 * Set the priority files to the files in the given list. A priority file is
242 * a file that is given priority when scheduling which analysis work to do
243 * first. The list typically contains those files that are visible to the
244 * user and those for which analysis results will have the biggest impact on
245 * the user experience. The order of the files within the list is
246 * significant: the first file will be given higher priority than the second,
247 * the second higher priority than the third, and so on.
248 *
249 * Note that this request determines the set of requested priority files. The
250 * actual set of priority files is the intersection of the requested set of
251 * priority files with the set of files currently subject to analysis. (See
252 * analysis.setSubscriptions for a description of files that are subject to
253 * analysis.)
254 *
255 * If a requested priority file is a directory it is ignored, but remains in
256 * the set of requested priority files so that if it later becomes a file it
257 * can be included in the set of actual priority files.
258 *
259 * Parameters
260 *
261 * files ( List<FilePath> )
262 *
263 * The files that are to be a priority for analysis.
264 */
265 Future sendAnalysisSetPriorityFiles(List<String> files, {bool checkTypes: true }) {
266 Map<String, dynamic> params = {};
267 params["files"] = files;
268 if (checkTypes) {
269 expect(params, isAnalysisSetPriorityFilesParams);
270 }
271 return server.send("analysis.setPriorityFiles", params)
272 .then((result) {
273 if (checkTypes) {
274 expect(result, isAnalysisSetPriorityFilesResult);
275 }
276 return result;
277 });
278 }
279
280 /**
281 * Subscribe for services. All previous subscriptions are replaced by the
282 * current set of subscriptions. If a given service is not included as a key
283 * in the map then no files will be subscribed to the service, exactly as if
284 * the service had been included in the map with an explicit empty list of
285 * files.
286 *
287 * Note that this request determines the set of requested subscriptions. The
288 * actual set of subscriptions at any given time is the intersection of this
289 * set with the set of files currently subject to analysis. The files
290 * currently subject to analysis are the set of files contained within an
291 * actual analysis root but not excluded, plus all of the files transitively
292 * reachable from those files via import, export and part directives. (See
293 * analysis.setAnalysisRoots for an explanation of how the actual analysis
294 * roots are determined.) When the actual analysis roots change, the actual
295 * set of subscriptions is automatically updated, but the set of requested
296 * subscriptions is unchanged.
297 *
298 * If a requested subscription is a directory it is ignored, but remains in
299 * the set of requested subscriptions so that if it later becomes a file it
300 * can be included in the set of actual subscriptions.
301 *
302 * It is an error if any of the keys in the map are not valid services. If
303 * there is an error, then the existing subscriptions will remain unchanged.
304 *
305 * Parameters
306 *
307 * subscriptions ( Map<AnalysisService, List<FilePath>> )
308 *
309 * A table mapping services to a list of the files being subscribed to the
310 * service.
311 */
312 Future sendAnalysisSetSubscriptions(Map<String, List<String>> subscriptions, { bool checkTypes: true}) {
313 Map<String, dynamic> params = {};
314 params["subscriptions"] = subscriptions;
315 if (checkTypes) {
316 expect(params, isAnalysisSetSubscriptionsParams);
317 }
318 return server.send("analysis.setSubscriptions", params)
319 .then((result) {
320 if (checkTypes) {
321 expect(result, isAnalysisSetSubscriptionsResult);
322 }
323 return result;
324 });
325 }
326
327 /**
328 * Update the content of one or more files. Files that were previously
329 * updated but not included in this update remain unchanged. This effectively
330 * represents an overlay of the filesystem. The files whose content is
331 * overridden are therefore seen by server as being files with the given
332 * content, even if the files do not exist on the filesystem or if the file
333 * path represents the path to a directory on the filesystem.
334 *
335 * Parameters
336 *
337 * files ( Map<FilePath, ContentChange> )
338 *
339 * A table mapping the files whose content has changed to a description of
340 * the content.
341 */
342 Future sendAnalysisUpdateContent(Map<String, Map<String, dynamic>> files, {boo l checkTypes: true}) {
343 Map<String, dynamic> params = {};
344 params["files"] = files;
345 if (checkTypes) {
346 expect(params, isAnalysisUpdateContentParams);
347 }
348 return server.send("analysis.updateContent", params)
349 .then((result) {
350 if (checkTypes) {
351 expect(result, isAnalysisUpdateContentResult);
352 }
353 return result;
354 });
355 }
356
357 /**
358 * Update the options controlling analysis based on the given set of options.
359 * Any options that are not included in the analysis options will not be
360 * changed. If there are options in the analysis options that are not valid
361 * an error will be reported but the values of the valid options will still
362 * be updated.
363 *
364 * Parameters
365 *
366 * options ( AnalysisOptions )
367 *
368 * The options that are to be used to control analysis.
369 */
370 Future sendAnalysisUpdateOptions(Map<String, dynamic> options, {bool checkType s: true}) {
371 Map<String, dynamic> params = {};
372 params["options"] = options;
373 if (checkTypes) {
374 expect(params, isAnalysisUpdateOptionsParams);
375 }
376 return server.send("analysis.updateOptions", params)
377 .then((result) {
378 if (checkTypes) {
379 expect(result, isAnalysisUpdateOptionsResult);
380 }
381 return result;
382 });
383 }
384
385 /**
386 * Request that completion suggestions for the given offset in the given file
387 * be returned.
388 *
389 * Parameters
390 *
391 * file ( FilePath )
392 *
393 * The file containing the point at which suggestions are to be made.
394 *
395 * offset ( int )
396 *
397 * The offset within the file at which suggestions are to be made.
398 *
399 * Returns
400 *
401 * id ( CompletionId )
402 *
403 * The identifier used to associate results with this completion request.
404 */
405 Future sendCompletionGetSuggestions(String file, int offset, {bool checkTypes: true}) {
406 Map<String, dynamic> params = {};
407 params["file"] = file;
408 params["offset"] = offset;
409 if (checkTypes) {
410 expect(params, isCompletionGetSuggestionsParams);
411 }
412 return server.send("completion.getSuggestions", params)
413 .then((result) {
414 if (checkTypes) {
415 expect(result, isCompletionGetSuggestionsResult);
416 }
417 return result;
418 });
419 }
420
421 /**
422 * Perform a search for references to the element defined or referenced at
423 * the given offset in the given file.
424 *
425 * An identifier is returned immediately, and individual results will be
426 * returned via the search.results notification as they become available.
427 *
428 * Parameters
429 *
430 * file ( FilePath )
431 *
432 * The file containing the declaration of or reference to the element used
433 * to define the search.
434 *
435 * offset ( int )
436 *
437 * The offset within the file of the declaration of or reference to the
438 * element.
439 *
440 * includePotential ( bool )
441 *
442 * True if potential matches are to be included in the results.
443 *
444 * Returns
445 *
446 * id ( SearchId )
447 *
448 * The identifier used to associate results with this search request.
449 *
450 * element ( Element )
451 *
452 * The element referenced or defined at the given offset and whose
453 * references will be returned in the search results.
454 */
455 Future sendSearchFindElementReferences(String file, int offset, bool includePo tential, {bool checkTypes: true}) {
456 Map<String, dynamic> params = {};
457 params["file"] = file;
458 params["offset"] = offset;
459 params["includePotential"] = includePotential;
460 if (checkTypes) {
461 expect(params, isSearchFindElementReferencesParams);
462 }
463 return server.send("search.findElementReferences", params)
464 .then((result) {
465 if (checkTypes) {
466 expect(result, isSearchFindElementReferencesResult);
467 }
468 return result;
469 });
470 }
471
472 /**
473 * Perform a search for declarations of members whose name is equal to the
474 * given name.
475 *
476 * An identifier is returned immediately, and individual results will be
477 * returned via the search.results notification as they become available.
478 *
479 * Parameters
480 *
481 * name ( String )
482 *
483 * The name of the declarations to be found.
484 *
485 * Returns
486 *
487 * id ( SearchId )
488 *
489 * The identifier used to associate results with this search request.
490 */
491 Future sendSearchFindMemberDeclarations(String name, {bool checkTypes: true}) {
492 Map<String, dynamic> params = {};
493 params["name"] = name;
494 if (checkTypes) {
495 expect(params, isSearchFindMemberDeclarationsParams);
496 }
497 return server.send("search.findMemberDeclarations", params)
498 .then((result) {
499 if (checkTypes) {
500 expect(result, isSearchFindMemberDeclarationsResult);
501 }
502 return result;
503 });
504 }
505
506 /**
507 * Perform a search for references to members whose name is equal to the
508 * given name. This search does not check to see that there is a member
509 * defined with the given name, so it is able to find references to undefined
510 * members as well.
511 *
512 * An identifier is returned immediately, and individual results will be
513 * returned via the search.results notification as they become available.
514 *
515 * Parameters
516 *
517 * name ( String )
518 *
519 * The name of the references to be found.
520 *
521 * Returns
522 *
523 * id ( SearchId )
524 *
525 * The identifier used to associate results with this search request.
526 */
527 Future sendSearchFindMemberReferences(String name, {bool checkTypes: true}) {
528 Map<String, dynamic> params = {};
529 params["name"] = name;
530 if (checkTypes) {
531 expect(params, isSearchFindMemberReferencesParams);
532 }
533 return server.send("search.findMemberReferences", params)
534 .then((result) {
535 if (checkTypes) {
536 expect(result, isSearchFindMemberReferencesResult);
537 }
538 return result;
539 });
540 }
541
542 /**
543 * Perform a search for declarations of top-level elements (classes,
544 * typedefs, getters, setters, functions and fields) whose name matches the
545 * given pattern.
546 *
547 * An identifier is returned immediately, and individual results will be
548 * returned via the search.results notification as they become available.
549 *
550 * Parameters
551 *
552 * pattern ( String )
553 *
554 * The regular expression used to match the names of the declarations to be
555 * found.
556 *
557 * Returns
558 *
559 * id ( SearchId )
560 *
561 * The identifier used to associate results with this search request.
562 */
563 Future sendSearchFindTopLevelDeclarations(String pattern, {bool checkTypes: tr ue}) {
564 Map<String, dynamic> params = {};
565 params["pattern"] = pattern;
566 if (checkTypes) {
567 expect(params, isSearchFindTopLevelDeclarationsParams);
568 }
569 return server.send("search.findTopLevelDeclarations", params)
570 .then((result) {
571 if (checkTypes) {
572 expect(result, isSearchFindTopLevelDeclarationsResult);
573 }
574 return result;
575 });
576 }
577
578 /**
579 * Return the type hierarchy of the class declared or referenced at the given
580 * location.
581 *
582 * Parameters
583 *
584 * file ( FilePath )
585 *
586 * The file containing the declaration or reference to the type for which a
587 * hierarchy is being requested.
588 *
589 * offset ( int )
590 *
591 * The offset of the name of the type within the file.
592 *
593 * Returns
594 *
595 * hierarchyItems ( List<TypeHierarchyItem> )
596 *
597 * A list of the types in the requested hierarchy. The first element of the
598 * list is the item representing the type for which the hierarchy was
599 * requested. The index of other elements of the list is unspecified, but
600 * correspond to the integers used to reference supertype and subtype items
601 * within the items.
602 */
603 Future sendSearchGetTypeHierarchy(String file, int offset, {bool checkTypes: t rue}) {
604 Map<String, dynamic> params = {};
605 params["file"] = file;
606 params["offset"] = offset;
607 if (checkTypes) {
608 expect(params, isSearchGetTypeHierarchyParams);
609 }
610 return server.send("search.getTypeHierarchy", params)
611 .then((result) {
612 if (checkTypes) {
613 expect(result, isSearchGetTypeHierarchyResult);
614 }
615 return result;
616 });
617 }
618
619 /**
620 * Return the set of assists that are available at the given location. An
621 * assist is distinguished from a refactoring primarily by the fact that it
622 * affects a single file and does not require user input in order to be
623 * performed.
624 *
625 * Parameters
626 *
627 * file ( FilePath )
628 *
629 * The file containing the code for which assists are being requested.
630 *
631 * offset ( int )
632 *
633 * The offset of the code for which assists are being requested.
634 *
635 * length ( int )
636 *
637 * The length of the code for which assists are being requested.
638 *
639 * Returns
640 *
641 * assists ( List<SourceChange> )
642 *
643 * The assists that are available at the given location.
644 */
645 Future sendEditGetAssists(String file, int offset, int length, {bool checkType s: true}) {
646 Map<String, dynamic> params = {};
647 params["file"] = file;
648 params["offset"] = offset;
649 params["length"] = length;
650 if (checkTypes) {
651 expect(params, isEditGetAssistsParams);
652 }
653 return server.send("edit.getAssists", params)
654 .then((result) {
655 if (checkTypes) {
656 expect(result, isEditGetAssistsResult);
657 }
658 return result;
659 });
660 }
661
662 /**
663 * Get a list of the kinds of refactorings that are valid for the given
664 * selection in the given file.
665 *
666 * Parameters
667 *
668 * file ( FilePath )
669 *
670 * The file containing the code on which the refactoring would be based.
671 *
672 * offset ( int )
673 *
674 * The offset of the code on which the refactoring would be based.
675 *
676 * length ( int )
677 *
678 * The length of the code on which the refactoring would be based.
679 *
680 * Returns
681 *
682 * kinds ( List<RefactoringKind> )
683 *
684 * The kinds of refactorings that are valid for the given selection.
685 */
686 Future sendEditGetAvailableRefactorings(String file, int offset, int length, { bool checkTypes: true}) {
687 Map<String, dynamic> params = {};
688 params["file"] = file;
689 params["offset"] = offset;
690 params["length"] = length;
691 if (checkTypes) {
692 expect(params, isEditGetAvailableRefactoringsParams);
693 }
694 return server.send("edit.getAvailableRefactorings", params)
695 .then((result) {
696 if (checkTypes) {
697 expect(result, isEditGetAvailableRefactoringsResult);
698 }
699 return result;
700 });
701 }
702
703 /**
704 * Return the set of fixes that are available for the errors at a given
705 * offset in a given file.
706 *
707 * Parameters
708 *
709 * file ( FilePath )
710 *
711 * The file containing the errors for which fixes are being requested.
712 *
713 * offset ( int )
714 *
715 * The offset used to select the errors for which fixes will be returned.
716 *
717 * Returns
718 *
719 * fixes ( List<ErrorFixes> )
720 *
721 * The fixes that are available for each of the analysis errors. There is a
722 * one-to-one correspondence between the analysis errors in the request and
723 * the lists of changes in the response. In particular, it is always the
724 * case that errors.length == fixes.length and that fixes[i] is the list of
725 * fixes for the error in errors[i]. The list of changes corresponding to
726 * an error can be empty if there are no fixes available for that error.
727 */
728 Future sendEditGetFixes(String file, int offset, {bool checkTypes: true}) {
729 Map<String, dynamic> params = {};
730 params["file"] = file;
731 params["offset"] = offset;
732 if (checkTypes) {
733 expect(params, isEditGetFixesParams);
734 }
735 return server.send("edit.getFixes", params)
736 .then((result) {
737 if (checkTypes) {
738 expect(result, isEditGetFixesResult);
739 }
740 return result;
741 });
742 }
743
744 /**
745 * Get the changes required to perform a refactoring.
746 *
747 * Parameters
748 *
749 * kindId ( RefactoringKind )
750 *
751 * The identifier of the kind of refactoring to be performed.
752 *
753 * file ( FilePath )
754 *
755 * The file containing the code involved in the refactoring.
756 *
757 * offset ( int )
758 *
759 * The offset of the region involved in the refactoring.
760 *
761 * length ( int )
762 *
763 * The length of the region involved in the refactoring.
764 *
765 * validateOnly ( bool )
766 *
767 * True if the client is only requesting that the values of the options be
768 * validated and no change be generated.
769 *
770 * options ( optional object )
771 *
772 * Data used to provide values provided by the user. The structure of the
773 * data is dependent on the kind of refactoring being performed. The data
774 * that is expected is documented in the section titled Refactorings,
775 * labeled as “Options”. This field can be omitted if the refactoring does
776 * not require any options or if the values of those options are not known.
777 *
778 * Returns
779 *
780 * status ( List<RefactoringProblem> )
781 *
782 * The status of the refactoring. The array will be empty if there are no
783 * known problems.
784 *
785 * feedback ( optional object )
786 *
787 * Data used to provide feedback to the user. The structure of the data is
788 * dependent on the kind of refactoring being created. The data that is
789 * returned is documented in the section titled Refactorings, labeled as
790 * “Feedback”.
791 *
792 * change ( optional SourceChange )
793 *
794 * The changes that are to be applied to affect the refactoring. This field
795 * will be omitted if there are problems that prevent a set of changed from
796 * being computed, such as having no options specified for a refactoring
797 * that requires them, or if only validation was requested.
798 */
799 Future sendEditGetRefactoring(String kindId, String file, int offset, int leng th, bool validateOnly, {Map<String, dynamic> options, bool checkTypes: true}) {
800 Map<String, dynamic> params = {};
801 params["kindId"] = kindId;
802 params["file"] = file;
803 params["offset"] = offset;
804 params["length"] = length;
805 params["validateOnly"] = validateOnly;
806 if (options != null) {
807 params["options"] = options;
808 }
809 if (checkTypes) {
810 expect(params, isEditGetRefactoringParams);
811 }
812 return server.send("edit.getRefactoring", params)
813 .then((result) {
814 if (checkTypes) {
815 expect(result, isEditGetRefactoringResult);
816 }
817 return result;
818 });
819 }
820
821 /**
822 * Create a debugging context for the executable file with the given path.
823 * The context that is created will persist until debug.deleteContext is used
824 * to delete it. Clients, therefore, are responsible for managing the
825 * lifetime of debugging contexts.
826 *
827 * Parameters
828 *
829 * contextRoot ( FilePath )
830 *
831 * The path of the Dart or HTML file that will be launched.
832 *
833 * Returns
834 *
835 * id ( DebugContextId )
836 *
837 * The identifier used to refer to the debugging context that was created.
838 */
839 Future sendDebugCreateContext(String contextRoot, {bool checkTypes: true}) {
840 Map<String, dynamic> params = {};
841 params["contextRoot"] = contextRoot;
842 if (checkTypes) {
843 expect(params, isDebugCreateContextParams);
844 }
845 return server.send("debug.createContext", params)
846 .then((result) {
847 if (checkTypes) {
848 expect(result, isDebugCreateContextResult);
849 }
850 return result;
851 });
852 }
853
854 /**
855 * Delete the debugging context with the given identifier. The context id is
856 * no longer valid after this command. The server is allowed to re-use ids
857 * when they are no longer valid.
858 *
859 * Parameters
860 *
861 * id ( DebugContextId )
862 *
863 * The identifier of the debugging context that is to be deleted.
864 */
865 Future sendDebugDeleteContext(String id, {bool checkTypes: true}) {
866 Map<String, dynamic> params = {};
867 params["id"] = id;
868 if (checkTypes) {
869 expect(params, isDebugDeleteContextParams);
870 }
871 return server.send("debug.deleteContext", params)
872 .then((result) {
873 if (checkTypes) {
874 expect(result, isDebugDeleteContextResult);
875 }
876 return result;
877 });
878 }
879
880 /**
881 * Map a URI from the debugging context to the file that it corresponds to,
882 * or map a file to the URI that it corresponds to in the debugging context.
883 *
884 * Exactly one of the file and uri fields must be provided.
885 *
886 * Parameters
887 *
888 * id ( DebugContextId )
889 *
890 * The identifier of the debugging context in which the URI is to be
891 * mapped.
892 *
893 * file ( optional FilePath )
894 *
895 * The path of the file to be mapped into a URI.
896 *
897 * uri ( optional String )
898 *
899 * The URI to be mapped into a file path.
900 *
901 * Returns
902 *
903 * file ( optional FilePath )
904 *
905 * The file to which the URI was mapped. This field is omitted if the uri
906 * field was not given in the request.
907 *
908 * uri ( optional String )
909 *
910 * The URI to which the file path was mapped. This field is omitted if the
911 * file field was not given in the request.
912 */
913 Future sendDebugMapUri(String id, {String file, String uri, bool checkTypes: t rue}) {
914 Map<String, dynamic> params = {};
915 params["id"] = id;
916 if (file != null) {
917 params["file"] = file;
918 }
919 if (uri != null) {
920 params["uri"] = uri;
921 }
922 if (checkTypes) {
923 expect(params, isDebugMapUriParams);
924 }
925 return server.send("debug.mapUri", params)
926 .then((result) {
927 if (checkTypes) {
928 expect(result, isDebugMapUriResult);
929 }
930 return result;
931 });
932 }
933
934 /**
935 * Subscribe for services. All previous subscriptions are replaced by the
936 * given set of services.
937 *
938 * It is an error if any of the elements in the list are not valid services.
939 * If there is an error, then the current subscriptions will remain
940 * unchanged.
941 *
942 * Parameters
943 *
944 * subscriptions ( List<DebugService> )
945 *
946 * A list of the services being subscribed to.
947 */
948 Future sendDebugSetSubscriptions(List<String> subscriptions, {bool checkTypes: true}) {
949 Map<String, dynamic> params = {};
950 params["subscriptions"] = subscriptions;
951 if (checkTypes) {
952 expect(params, isDebugSetSubscriptionsParams);
953 }
954 return server.send("debug.setSubscriptions", params)
955 .then((result) {
956 if (checkTypes) {
957 expect(result, isDebugSetSubscriptionsResult);
958 }
959 return result;
960 });
961 }
962 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698