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

Side by Side Diff: pkg/analyzer_plugin/test/integration/support/integration_test_methods.dart

Issue 2746333008: Run dartfmt on dart2js codebase. (Closed)
Patch Set: Format all analyzer packages Created 3 years, 9 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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 * Information that the user can use to use to contact the maintainers of 63 * Information that the user can use to use to contact the maintainers of
64 * the plugin when there is a problem. 64 * the plugin when there is a problem.
65 * 65 *
66 * interestingFiles (List<String>) 66 * interestingFiles (List<String>)
67 * 67 *
68 * The glob patterns of the files for which the plugin will provide 68 * The glob patterns of the files for which the plugin will provide
69 * information. This value is ignored if the isCompatible field is false. 69 * information. This value is ignored if the isCompatible field is false.
70 * Otherwise, it will be used to identify the files for which the plugin 70 * Otherwise, it will be used to identify the files for which the plugin
71 * should be notified of changes. 71 * should be notified of changes.
72 */ 72 */
73 Future<PluginVersionCheckResult> sendPluginVersionCheck(String byteStorePath, String version) async { 73 Future<PluginVersionCheckResult> sendPluginVersionCheck(
74 String byteStorePath, String version) async {
74 var params = new PluginVersionCheckParams(byteStorePath, version).toJson(); 75 var params = new PluginVersionCheckParams(byteStorePath, version).toJson();
75 var result = await server.send("plugin.versionCheck", params); 76 var result = await server.send("plugin.versionCheck", params);
76 ResponseDecoder decoder = new ResponseDecoder(null); 77 ResponseDecoder decoder = new ResponseDecoder(null);
77 return new PluginVersionCheckResult.fromJson(decoder, 'result', result); 78 return new PluginVersionCheckResult.fromJson(decoder, 'result', result);
78 } 79 }
79 80
80 /** 81 /**
81 * Used to request that the plugin exit. The server will not send any other 82 * Used to request that the plugin exit. The server will not send any other
82 * requests after this request. The plugin should not send any responses or 83 * requests after this request. The plugin should not send any responses or
83 * notifications after sending the response to this request. 84 * notifications after sending the response to this request.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 /** 164 /**
164 * Used to set the options used to build analysis contexts. This request will 165 * Used to set the options used to build analysis contexts. This request will
165 * be sent exactly once before any context roots have been specified. 166 * be sent exactly once before any context roots have been specified.
166 * 167 *
167 * Parameters 168 * Parameters
168 * 169 *
169 * options (ContextBuilderOptions) 170 * options (ContextBuilderOptions)
170 * 171 *
171 * The options used to build the analysis contexts. 172 * The options used to build the analysis contexts.
172 */ 173 */
173 Future sendAnalysisSetContextBuilderOptions(ContextBuilderOptions options) asy nc { 174 Future sendAnalysisSetContextBuilderOptions(
175 ContextBuilderOptions options) async {
174 var params = new AnalysisSetContextBuilderOptionsParams(options).toJson(); 176 var params = new AnalysisSetContextBuilderOptionsParams(options).toJson();
175 var result = await server.send("analysis.setContextBuilderOptions", params); 177 var result = await server.send("analysis.setContextBuilderOptions", params);
176 outOfTestExpect(result, isNull); 178 outOfTestExpect(result, isNull);
177 return null; 179 return null;
178 } 180 }
179 181
180 /** 182 /**
181 * Set the list of context roots that should be analyzed. 183 * Set the list of context roots that should be analyzed.
182 * 184 *
183 * Parameters 185 * Parameters
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 * no files should be subscribed to the service, exactly as if the service 224 * no files should be subscribed to the service, exactly as if the service
223 * had been included in the map with an explicit empty list of files. 225 * had been included in the map with an explicit empty list of files.
224 * 226 *
225 * Parameters 227 * Parameters
226 * 228 *
227 * subscriptions (Map<AnalysisService, List<FilePath>>) 229 * subscriptions (Map<AnalysisService, List<FilePath>>)
228 * 230 *
229 * A table mapping services to a list of the files being subscribed to the 231 * A table mapping services to a list of the files being subscribed to the
230 * service. 232 * service.
231 */ 233 */
232 Future sendAnalysisSetSubscriptions(Map<AnalysisService, List<String>> subscri ptions) async { 234 Future sendAnalysisSetSubscriptions(
235 Map<AnalysisService, List<String>> subscriptions) async {
233 var params = new AnalysisSetSubscriptionsParams(subscriptions).toJson(); 236 var params = new AnalysisSetSubscriptionsParams(subscriptions).toJson();
234 var result = await server.send("analysis.setSubscriptions", params); 237 var result = await server.send("analysis.setSubscriptions", params);
235 outOfTestExpect(result, isNull); 238 outOfTestExpect(result, isNull);
236 return null; 239 return null;
237 } 240 }
238 241
239 /** 242 /**
240 * Used to update the content of one or more files. Files that were 243 * Used to update the content of one or more files. Files that were
241 * previously updated but not included in this update remain unchanged. This 244 * previously updated but not included in this update remain unchanged. This
242 * effectively represents an overlay of the filesystem. The files whose 245 * effectively represents an overlay of the filesystem. The files whose
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 * (that is, the number of characters in the existing identifier). 477 * (that is, the number of characters in the existing identifier).
475 * 478 *
476 * results (List<CompletionSuggestion>) 479 * results (List<CompletionSuggestion>)
477 * 480 *
478 * The completion suggestions being reported. The notification contains all 481 * The completion suggestions being reported. The notification contains all
479 * possible completions at the requested cursor position, even those that 482 * possible completions at the requested cursor position, even those that
480 * do not match the characters the user has already typed. This allows the 483 * do not match the characters the user has already typed. This allows the
481 * client to respond to further keystrokes from the user without having to 484 * client to respond to further keystrokes from the user without having to
482 * make additional requests. 485 * make additional requests.
483 */ 486 */
484 Future<CompletionGetSuggestionsResult> sendCompletionGetSuggestions(String fil e, int offset) async { 487 Future<CompletionGetSuggestionsResult> sendCompletionGetSuggestions(
488 String file, int offset) async {
485 var params = new CompletionGetSuggestionsParams(file, offset).toJson(); 489 var params = new CompletionGetSuggestionsParams(file, offset).toJson();
486 var result = await server.send("completion.getSuggestions", params); 490 var result = await server.send("completion.getSuggestions", params);
487 ResponseDecoder decoder = new ResponseDecoder(null); 491 ResponseDecoder decoder = new ResponseDecoder(null);
488 return new CompletionGetSuggestionsResult.fromJson(decoder, 'result', result ); 492 return new CompletionGetSuggestionsResult.fromJson(
493 decoder, 'result', result);
489 } 494 }
490 495
491 /** 496 /**
492 * Used to request the set of assists that are available at the given 497 * Used to request the set of assists that are available at the given
493 * location. An assist is distinguished from a refactoring primarily by the 498 * location. An assist is distinguished from a refactoring primarily by the
494 * fact that it affects a single file and does not require user input in 499 * fact that it affects a single file and does not require user input in
495 * order to be performed. 500 * order to be performed.
496 * 501 *
497 * Parameters 502 * Parameters
498 * 503 *
499 * file (FilePath) 504 * file (FilePath)
500 * 505 *
501 * The file containing the code for which assists are being requested. 506 * The file containing the code for which assists are being requested.
502 * 507 *
503 * offset (int) 508 * offset (int)
504 * 509 *
505 * The offset of the code for which assists are being requested. 510 * The offset of the code for which assists are being requested.
506 * 511 *
507 * length (int) 512 * length (int)
508 * 513 *
509 * The length of the code for which assists are being requested. 514 * The length of the code for which assists are being requested.
510 * 515 *
511 * Returns 516 * Returns
512 * 517 *
513 * assists (List<PrioritizedSourceChange>) 518 * assists (List<PrioritizedSourceChange>)
514 * 519 *
515 * The assists that are available at the given location. 520 * The assists that are available at the given location.
516 */ 521 */
517 Future<EditGetAssistsResult> sendEditGetAssists(String file, int offset, int l ength) async { 522 Future<EditGetAssistsResult> sendEditGetAssists(
523 String file, int offset, int length) async {
518 var params = new EditGetAssistsParams(file, offset, length).toJson(); 524 var params = new EditGetAssistsParams(file, offset, length).toJson();
519 var result = await server.send("edit.getAssists", params); 525 var result = await server.send("edit.getAssists", params);
520 ResponseDecoder decoder = new ResponseDecoder(null); 526 ResponseDecoder decoder = new ResponseDecoder(null);
521 return new EditGetAssistsResult.fromJson(decoder, 'result', result); 527 return new EditGetAssistsResult.fromJson(decoder, 'result', result);
522 } 528 }
523 529
524 /** 530 /**
525 * Used to request a list of the kinds of refactorings that are valid for the 531 * Used to request a list of the kinds of refactorings that are valid for the
526 * given selection in the given file. 532 * given selection in the given file.
527 * 533 *
(...skipping 15 matching lines...) Expand all
543 * 549 *
544 * kinds (List<RefactoringKind>) 550 * kinds (List<RefactoringKind>)
545 * 551 *
546 * The kinds of refactorings that are valid for the given selection. 552 * The kinds of refactorings that are valid for the given selection.
547 * 553 *
548 * The list of refactoring kinds is currently limited to those defined by 554 * The list of refactoring kinds is currently limited to those defined by
549 * the server API, preventing plugins from adding their own refactorings. 555 * the server API, preventing plugins from adding their own refactorings.
550 * However, plugins can support pre-defined refactorings, such as a rename 556 * However, plugins can support pre-defined refactorings, such as a rename
551 * refactoring, at locations not supported by server. 557 * refactoring, at locations not supported by server.
552 */ 558 */
553 Future<EditGetAvailableRefactoringsResult> sendEditGetAvailableRefactorings(St ring file, int offset, int length) async { 559 Future<EditGetAvailableRefactoringsResult> sendEditGetAvailableRefactorings(
554 var params = new EditGetAvailableRefactoringsParams(file, offset, length).to Json(); 560 String file, int offset, int length) async {
561 var params =
562 new EditGetAvailableRefactoringsParams(file, offset, length).toJson();
555 var result = await server.send("edit.getAvailableRefactorings", params); 563 var result = await server.send("edit.getAvailableRefactorings", params);
556 ResponseDecoder decoder = new ResponseDecoder(null); 564 ResponseDecoder decoder = new ResponseDecoder(null);
557 return new EditGetAvailableRefactoringsResult.fromJson(decoder, 'result', re sult); 565 return new EditGetAvailableRefactoringsResult.fromJson(
566 decoder, 'result', result);
558 } 567 }
559 568
560 /** 569 /**
561 * Used to request the set of fixes that are available for the errors at a 570 * Used to request the set of fixes that are available for the errors at a
562 * given offset in a given file. 571 * given offset in a given file.
563 * 572 *
564 * Parameters 573 * Parameters
565 * 574 *
566 * file (FilePath) 575 * file (FilePath)
567 * 576 *
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 * potentialEdits (optional List<String>) 664 * potentialEdits (optional List<String>)
656 * 665 *
657 * The ids of source edits that are not known to be valid. An edit is not 666 * The ids of source edits that are not known to be valid. An edit is not
658 * known to be valid if there was insufficient type information for the 667 * known to be valid if there was insufficient type information for the
659 * plugin to be able to determine whether or not the code needs to be 668 * plugin to be able to determine whether or not the code needs to be
660 * modified, such as when a member is being renamed and there is a 669 * modified, such as when a member is being renamed and there is a
661 * reference to a member from an unknown type. This field can be omitted if 670 * reference to a member from an unknown type. This field can be omitted if
662 * the change field is omitted or if there are no potential edits for the 671 * the change field is omitted or if there are no potential edits for the
663 * refactoring. 672 * refactoring.
664 */ 673 */
665 Future<EditGetRefactoringResult> sendEditGetRefactoring(RefactoringKind kind, String file, int offset, int length, bool validateOnly, {RefactoringOptions opti ons}) async { 674 Future<EditGetRefactoringResult> sendEditGetRefactoring(RefactoringKind kind,
666 var params = new EditGetRefactoringParams(kind, file, offset, length, valida teOnly, options: options).toJson(); 675 String file, int offset, int length, bool validateOnly,
676 {RefactoringOptions options}) async {
677 var params = new EditGetRefactoringParams(
678 kind, file, offset, length, validateOnly,
679 options: options)
680 .toJson();
667 var result = await server.send("edit.getRefactoring", params); 681 var result = await server.send("edit.getRefactoring", params);
668 ResponseDecoder decoder = new ResponseDecoder(kind); 682 ResponseDecoder decoder = new ResponseDecoder(kind);
669 return new EditGetRefactoringResult.fromJson(decoder, 'result', result); 683 return new EditGetRefactoringResult.fromJson(decoder, 'result', result);
670 } 684 }
671 685
672 /** 686 /**
673 * Initialize the fields in InttestMixin, and ensure that notifications will 687 * Initialize the fields in InttestMixin, and ensure that notifications will
674 * be handled. 688 * be handled.
675 */ 689 */
676 void initializeInttestMixin() { 690 void initializeInttestMixin() {
677 _onPluginError = new StreamController<PluginErrorParams>(sync: true); 691 _onPluginError = new StreamController<PluginErrorParams>(sync: true);
678 onPluginError = _onPluginError.stream.asBroadcastStream(); 692 onPluginError = _onPluginError.stream.asBroadcastStream();
679 _onAnalysisErrors = new StreamController<AnalysisErrorsParams>(sync: true); 693 _onAnalysisErrors = new StreamController<AnalysisErrorsParams>(sync: true);
680 onAnalysisErrors = _onAnalysisErrors.stream.asBroadcastStream(); 694 onAnalysisErrors = _onAnalysisErrors.stream.asBroadcastStream();
681 _onAnalysisFolding = new StreamController<AnalysisFoldingParams>(sync: true) ; 695 _onAnalysisFolding =
696 new StreamController<AnalysisFoldingParams>(sync: true);
682 onAnalysisFolding = _onAnalysisFolding.stream.asBroadcastStream(); 697 onAnalysisFolding = _onAnalysisFolding.stream.asBroadcastStream();
683 _onAnalysisHighlights = new StreamController<AnalysisHighlightsParams>(sync: true); 698 _onAnalysisHighlights =
699 new StreamController<AnalysisHighlightsParams>(sync: true);
684 onAnalysisHighlights = _onAnalysisHighlights.stream.asBroadcastStream(); 700 onAnalysisHighlights = _onAnalysisHighlights.stream.asBroadcastStream();
685 _onAnalysisNavigation = new StreamController<AnalysisNavigationParams>(sync: true); 701 _onAnalysisNavigation =
702 new StreamController<AnalysisNavigationParams>(sync: true);
686 onAnalysisNavigation = _onAnalysisNavigation.stream.asBroadcastStream(); 703 onAnalysisNavigation = _onAnalysisNavigation.stream.asBroadcastStream();
687 _onAnalysisOccurrences = new StreamController<AnalysisOccurrencesParams>(syn c: true); 704 _onAnalysisOccurrences =
705 new StreamController<AnalysisOccurrencesParams>(sync: true);
688 onAnalysisOccurrences = _onAnalysisOccurrences.stream.asBroadcastStream(); 706 onAnalysisOccurrences = _onAnalysisOccurrences.stream.asBroadcastStream();
689 _onAnalysisOutline = new StreamController<AnalysisOutlineParams>(sync: true) ; 707 _onAnalysisOutline =
708 new StreamController<AnalysisOutlineParams>(sync: true);
690 onAnalysisOutline = _onAnalysisOutline.stream.asBroadcastStream(); 709 onAnalysisOutline = _onAnalysisOutline.stream.asBroadcastStream();
691 } 710 }
692 711
693 /** 712 /**
694 * Dispatch the notification named [event], and containing parameters 713 * Dispatch the notification named [event], and containing parameters
695 * [params], to the appropriate stream. 714 * [params], to the appropriate stream.
696 */ 715 */
697 void dispatchNotification(String event, params) { 716 void dispatchNotification(String event, params) {
698 ResponseDecoder decoder = new ResponseDecoder(null); 717 ResponseDecoder decoder = new ResponseDecoder(null);
699 switch (event) { 718 switch (event) {
700 case "plugin.error": 719 case "plugin.error":
701 outOfTestExpect(params, isPluginErrorParams); 720 outOfTestExpect(params, isPluginErrorParams);
702 _onPluginError.add(new PluginErrorParams.fromJson(decoder, 'params', par ams)); 721 _onPluginError
722 .add(new PluginErrorParams.fromJson(decoder, 'params', params));
703 break; 723 break;
704 case "analysis.errors": 724 case "analysis.errors":
705 outOfTestExpect(params, isAnalysisErrorsParams); 725 outOfTestExpect(params, isAnalysisErrorsParams);
706 _onAnalysisErrors.add(new AnalysisErrorsParams.fromJson(decoder, 'params ', params)); 726 _onAnalysisErrors
727 .add(new AnalysisErrorsParams.fromJson(decoder, 'params', params));
707 break; 728 break;
708 case "analysis.folding": 729 case "analysis.folding":
709 outOfTestExpect(params, isAnalysisFoldingParams); 730 outOfTestExpect(params, isAnalysisFoldingParams);
710 _onAnalysisFolding.add(new AnalysisFoldingParams.fromJson(decoder, 'para ms', params)); 731 _onAnalysisFolding
732 .add(new AnalysisFoldingParams.fromJson(decoder, 'params', params));
711 break; 733 break;
712 case "analysis.highlights": 734 case "analysis.highlights":
713 outOfTestExpect(params, isAnalysisHighlightsParams); 735 outOfTestExpect(params, isAnalysisHighlightsParams);
714 _onAnalysisHighlights.add(new AnalysisHighlightsParams.fromJson(decoder, 'params', params)); 736 _onAnalysisHighlights.add(
737 new AnalysisHighlightsParams.fromJson(decoder, 'params', params));
715 break; 738 break;
716 case "analysis.navigation": 739 case "analysis.navigation":
717 outOfTestExpect(params, isAnalysisNavigationParams); 740 outOfTestExpect(params, isAnalysisNavigationParams);
718 _onAnalysisNavigation.add(new AnalysisNavigationParams.fromJson(decoder, 'params', params)); 741 _onAnalysisNavigation.add(
742 new AnalysisNavigationParams.fromJson(decoder, 'params', params));
719 break; 743 break;
720 case "analysis.occurrences": 744 case "analysis.occurrences":
721 outOfTestExpect(params, isAnalysisOccurrencesParams); 745 outOfTestExpect(params, isAnalysisOccurrencesParams);
722 _onAnalysisOccurrences.add(new AnalysisOccurrencesParams.fromJson(decode r, 'params', params)); 746 _onAnalysisOccurrences.add(
747 new AnalysisOccurrencesParams.fromJson(decoder, 'params', params));
723 break; 748 break;
724 case "analysis.outline": 749 case "analysis.outline":
725 outOfTestExpect(params, isAnalysisOutlineParams); 750 outOfTestExpect(params, isAnalysisOutlineParams);
726 _onAnalysisOutline.add(new AnalysisOutlineParams.fromJson(decoder, 'para ms', params)); 751 _onAnalysisOutline
752 .add(new AnalysisOutlineParams.fromJson(decoder, 'params', params));
727 break; 753 break;
728 default: 754 default:
729 fail('Unexpected notification: $event'); 755 fail('Unexpected notification: $event');
730 break; 756 break;
731 } 757 }
732 } 758 }
733 } 759 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698