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

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

Issue 1398293002: Move the wire protocol support into the public API (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add missed files Created 5 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
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.
Paul Berry 2015/10/12 12:32:10 It turns out this is an autogenerated file which i
Paul Berry 2015/10/12 12:44:52 Fix is here: https://codereview.chromium.org/13973
6 // To regenerate the file, use the script 6 // To regenerate the file, use the script
7 // "pkg/analysis_server/tool/spec/generate_files". 7 // "pkg/analysis_server/tool/spec/generate_files".
8 8
9 /** 9 /**
10 * Convenience methods for running integration tests 10 * Convenience methods for running integration tests
11 */ 11 */
12 library test.integration.methods; 12 library test.integration.methods;
13 13
14 import 'dart:async'; 14 import 'dart:async';
15 15
16 import 'package:analysis_server/src/protocol.dart'; 16 import 'package:analysis_server/plugin/protocol/protocol.dart';
17 import 'package:analysis_server/src/protocol/protocol_internal.dart';
17 import 'package:unittest/unittest.dart'; 18 import 'package:unittest/unittest.dart';
18 19
19 import 'integration_tests.dart'; 20 import 'integration_tests.dart';
20 import 'protocol_matchers.dart'; 21 import 'protocol_matchers.dart';
21 22
22
23 /** 23 /**
24 * Convenience methods for running integration tests 24 * Convenience methods for running integration tests
25 */ 25 */
26 abstract class IntegrationTestMixin { 26 abstract class IntegrationTestMixin {
27 Server get server;
28
29 /**
30 * Return the version number of the analysis server.
31 *
32 * Returns
33 *
34 * version ( String )
35 *
36 * The version number of the analysis server.
37 */
38 Future<ServerGetVersionResult> sendServerGetVersion() {
39 return server.send("server.getVersion", null)
40 .then((result) {
41 ResponseDecoder decoder = new ResponseDecoder(null);
42 return new ServerGetVersionResult.fromJson(decoder, 'result', result);
43 });
44 }
45
46 /**
47 * Cleanly shutdown the analysis server. Requests that are received after
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
50 * responded to. No further responses or notifications will be sent after the
51 * response to this request has been sent.
52 */
53 Future sendServerShutdown() {
54 return server.send("server.shutdown", null)
55 .then((result) {
56 expect(result, isNull);
57 return null;
58 });
59 }
60
61 /**
62 * Subscribe for services. All previous subscriptions are replaced by the
63 * given set of services.
64 *
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
67 * unchanged.
68 *
69 * Parameters
70 *
71 * subscriptions ( List<ServerService> )
72 *
73 * A list of the services being subscribed to.
74 */
75 Future sendServerSetSubscriptions(List<ServerService> subscriptions) {
76 var params = new ServerSetSubscriptionsParams(subscriptions).toJson();
77 return server.send("server.setSubscriptions", params)
78 .then((result) {
79 expect(result, isNull);
80 return null;
81 });
82 }
83
84 /** 27 /**
85 * Reports that the server is running. This notification is issued once after 28 * 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 29 * the server has started running but before any requests are processed to
87 * let the client know that it started correctly. 30 * let the client know that it started correctly.
88 * 31 *
89 * It is not possible to subscribe to or unsubscribe from this notification. 32 * It is not possible to subscribe to or unsubscribe from this notification.
90 * 33 *
91 * Parameters 34 * Parameters
92 * 35 *
93 * version ( String ) 36 * version ( String )
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 * running pub. 97 * running pub.
155 */ 98 */
156 Stream<ServerStatusParams> onServerStatus; 99 Stream<ServerStatusParams> onServerStatus;
157 100
158 /** 101 /**
159 * Stream controller for [onServerStatus]. 102 * Stream controller for [onServerStatus].
160 */ 103 */
161 StreamController<ServerStatusParams> _onServerStatus; 104 StreamController<ServerStatusParams> _onServerStatus;
162 105
163 /** 106 /**
107 * Reports the paths of the files that are being analyzed.
108 *
109 * This notification is not subscribed to by default. Clients can subscribe
110 * by including the value "ANALYZED_FILES" in the list of services passed in
111 * an analysis.setGeneralSubscriptions request.
112 *
113 * Parameters
114 *
115 * directories ( List<FilePath> )
116 *
117 * A list of the paths of the files that are being analyzed.
118 */
119 Stream<AnalysisAnalyzedFilesParams> onAnalysisAnalyzedFiles;
120
121 /**
122 * Stream controller for [onAnalysisAnalyzedFiles].
123 */
124 StreamController<AnalysisAnalyzedFilesParams> _onAnalysisAnalyzedFiles;
125
126 /**
127 * Reports the errors associated with a given file. The set of errors
128 * included in the notification is always a complete list that supersedes any
129 * previously reported errors.
130 *
131 * It is only possible to unsubscribe from this notification by using the
132 * command-line flag --no-error-notification.
133 *
134 * Parameters
135 *
136 * file ( FilePath )
137 *
138 * The file containing the errors.
139 *
140 * errors ( List<AnalysisError> )
141 *
142 * The errors contained in the file.
143 */
144 Stream<AnalysisErrorsParams> onAnalysisErrors;
145
146 /**
147 * Stream controller for [onAnalysisErrors].
148 */
149 StreamController<AnalysisErrorsParams> _onAnalysisErrors;
150
151 /**
152 * Reports that any analysis results that were previously associated with the
153 * given files should be considered to be invalid because those files are no
154 * longer being analyzed, either because the analysis root that contained it
155 * is no longer being analyzed or because the file no longer exists.
156 *
157 * If a file is included in this notification and at some later time a
158 * notification with results for the file is received, clients should assume
159 * that the file is once again being analyzed and the information should be
160 * processed.
161 *
162 * It is not possible to subscribe to or unsubscribe from this notification.
163 *
164 * Parameters
165 *
166 * files ( List<FilePath> )
167 *
168 * The files that are no longer being analyzed.
169 */
170 Stream<AnalysisFlushResultsParams> onAnalysisFlushResults;
171
172 /**
173 * Stream controller for [onAnalysisFlushResults].
174 */
175 StreamController<AnalysisFlushResultsParams> _onAnalysisFlushResults;
176
177 /**
178 * Reports the folding regions associated with a given file. Folding regions
179 * can be nested, but will not be overlapping. Nesting occurs when a foldable
180 * element, such as a method, is nested inside another foldable element such
181 * as a class.
182 *
183 * This notification is not subscribed to by default. Clients can subscribe
184 * by including the value "FOLDING" in the list of services passed in an
185 * analysis.setSubscriptions request.
186 *
187 * Parameters
188 *
189 * file ( FilePath )
190 *
191 * The file containing the folding regions.
192 *
193 * regions ( List<FoldingRegion> )
194 *
195 * The folding regions contained in the file.
196 */
197 Stream<AnalysisFoldingParams> onAnalysisFolding;
198
199 /**
200 * Stream controller for [onAnalysisFolding].
201 */
202 StreamController<AnalysisFoldingParams> _onAnalysisFolding;
203
204 /**
205 * Reports the highlight regions associated with a given file.
206 *
207 * This notification is not subscribed to by default. Clients can subscribe
208 * by including the value "HIGHLIGHTS" in the list of services passed in an
209 * analysis.setSubscriptions request.
210 *
211 * Parameters
212 *
213 * file ( FilePath )
214 *
215 * The file containing the highlight regions.
216 *
217 * regions ( List<HighlightRegion> )
218 *
219 * The highlight regions contained in the file. Each highlight region
220 * represents a particular syntactic or semantic meaning associated with
221 * some range. Note that the highlight regions that are returned can
222 * overlap other highlight regions if there is more than one meaning
223 * associated with a particular region.
224 */
225 Stream<AnalysisHighlightsParams> onAnalysisHighlights;
226
227 /**
228 * Stream controller for [onAnalysisHighlights].
229 */
230 StreamController<AnalysisHighlightsParams> _onAnalysisHighlights;
231
232 /**
233 * Reports the classes that are implemented or extended and class members
234 * that are implemented or overridden in a file.
235 *
236 * This notification is not subscribed to by default. Clients can subscribe
237 * by including the value "IMPLEMENTED" in the list of services passed in an
238 * analysis.setSubscriptions request.
239 *
240 * Parameters
241 *
242 * file ( FilePath )
243 *
244 * The file with which the implementations are associated.
245 *
246 * classes ( List<ImplementedClass> )
247 *
248 * The classes defined in the file that are implemented or extended.
249 *
250 * members ( List<ImplementedMember> )
251 *
252 * The member defined in the file that are implemented or overridden.
253 */
254 Stream<AnalysisImplementedParams> onAnalysisImplemented;
255
256 /**
257 * Stream controller for [onAnalysisImplemented].
258 */
259 StreamController<AnalysisImplementedParams> _onAnalysisImplemented;
260
261 /**
262 * Reports that the navigation information associated with a region of a
263 * single file has become invalid and should be re-requested.
264 *
265 * This notification is not subscribed to by default. Clients can subscribe
266 * by including the value "INVALIDATE" in the list of services passed in an
267 * analysis.setSubscriptions request.
268 *
269 * Parameters
270 *
271 * file ( FilePath )
272 *
273 * The file whose information has been invalidated.
274 *
275 * offset ( int )
276 *
277 * The offset of the invalidated region.
278 *
279 * length ( int )
280 *
281 * The length of the invalidated region.
282 *
283 * delta ( int )
284 *
285 * The delta to be applied to the offsets in information that follows the
286 * invalidated region in order to update it so that it doesn't need to be
287 * re-requested.
288 */
289 Stream<AnalysisInvalidateParams> onAnalysisInvalidate;
290
291 /**
292 * Stream controller for [onAnalysisInvalidate].
293 */
294 StreamController<AnalysisInvalidateParams> _onAnalysisInvalidate;
295
296 /**
297 * Reports the navigation targets associated with a given file.
298 *
299 * This notification is not subscribed to by default. Clients can subscribe
300 * by including the value "NAVIGATION" in the list of services passed in an
301 * analysis.setSubscriptions request.
302 *
303 * Parameters
304 *
305 * file ( FilePath )
306 *
307 * The file containing the navigation regions.
308 *
309 * regions ( List<NavigationRegion> )
310 *
311 * The navigation regions contained in the file. The regions are sorted by
312 * their offsets. Each navigation region represents a list of targets
313 * associated with some range. The lists will usually contain a single
314 * target, but can contain more in the case of a part that is included in
315 * multiple libraries or in Dart code that is compiled against multiple
316 * versions of a package. Note that the navigation regions that are
317 * returned do not overlap other navigation regions.
318 *
319 * targets ( List<NavigationTarget> )
320 *
321 * The navigation targets referenced in the file. They are referenced by
322 * NavigationRegions by their index in this array.
323 *
324 * files ( List<FilePath> )
325 *
326 * The files containing navigation targets referenced in the file. They are
327 * referenced by NavigationTargets by their index in this array.
328 */
329 Stream<AnalysisNavigationParams> onAnalysisNavigation;
330
331 /**
332 * Stream controller for [onAnalysisNavigation].
333 */
334 StreamController<AnalysisNavigationParams> _onAnalysisNavigation;
335
336 /**
337 * Reports the occurrences of references to elements within a single file.
338 *
339 * This notification is not subscribed to by default. Clients can subscribe
340 * by including the value "OCCURRENCES" in the list of services passed in an
341 * analysis.setSubscriptions request.
342 *
343 * Parameters
344 *
345 * file ( FilePath )
346 *
347 * The file in which the references occur.
348 *
349 * occurrences ( List<Occurrences> )
350 *
351 * The occurrences of references to elements within the file.
352 */
353 Stream<AnalysisOccurrencesParams> onAnalysisOccurrences;
354
355 /**
356 * Stream controller for [onAnalysisOccurrences].
357 */
358 StreamController<AnalysisOccurrencesParams> _onAnalysisOccurrences;
359
360 /**
361 * Reports the outline associated with a single file.
362 *
363 * This notification is not subscribed to by default. Clients can subscribe
364 * by including the value "OUTLINE" in the list of services passed in an
365 * analysis.setSubscriptions request.
366 *
367 * Parameters
368 *
369 * file ( FilePath )
370 *
371 * The file with which the outline is associated.
372 *
373 * kind ( FileKind )
374 *
375 * The kind of the file.
376 *
377 * libraryName ( optional String )
378 *
379 * The name of the library defined by the file using a "library" directive,
380 * or referenced by a "part of" directive. If both "library" and "part of"
381 * directives are present, then the "library" directive takes precedence.
382 * This field will be omitted if the file has neither "library" nor "part
383 * of" directives.
384 *
385 * outline ( Outline )
386 *
387 * The outline associated with the file.
388 */
389 Stream<AnalysisOutlineParams> onAnalysisOutline;
390
391 /**
392 * Stream controller for [onAnalysisOutline].
393 */
394 StreamController<AnalysisOutlineParams> _onAnalysisOutline;
395
396 /**
397 * Reports the overridding members in a file.
398 *
399 * This notification is not subscribed to by default. Clients can subscribe
400 * by including the value "OVERRIDES" in the list of services passed in an
401 * analysis.setSubscriptions request.
402 *
403 * Parameters
404 *
405 * file ( FilePath )
406 *
407 * The file with which the overrides are associated.
408 *
409 * overrides ( List<Override> )
410 *
411 * The overrides associated with the file.
412 */
413 Stream<AnalysisOverridesParams> onAnalysisOverrides;
414
415 /**
416 * Stream controller for [onAnalysisOverrides].
417 */
418 StreamController<AnalysisOverridesParams> _onAnalysisOverrides;
419
420 /**
421 * Reports the completion suggestions that should be presented to the user.
422 * The set of suggestions included in the notification is always a complete
423 * list that supersedes any previously reported suggestions.
424 *
425 * Parameters
426 *
427 * id ( CompletionId )
428 *
429 * The id associated with the completion.
430 *
431 * replacementOffset ( int )
432 *
433 * The offset of the start of the text to be replaced. This will be
434 * different than the offset used to request the completion suggestions if
435 * there was a portion of an identifier before the original offset. In
436 * particular, the replacementOffset will be the offset of the beginning of
437 * said identifier.
438 *
439 * replacementLength ( int )
440 *
441 * The length of the text to be replaced if the remainder of the identifier
442 * containing the cursor is to be replaced when the suggestion is applied
443 * (that is, the number of characters in the existing identifier).
444 *
445 * results ( List<CompletionSuggestion> )
446 *
447 * The completion suggestions being reported. The notification contains all
448 * possible completions at the requested cursor position, even those that
449 * do not match the characters the user has already typed. This allows the
450 * client to respond to further keystrokes from the user without having to
451 * make additional requests.
452 *
453 * isLast ( bool )
454 *
455 * True if this is that last set of results that will be returned for the
456 * indicated completion.
457 */
458 Stream<CompletionResultsParams> onCompletionResults;
459
460 /**
461 * Stream controller for [onCompletionResults].
462 */
463 StreamController<CompletionResultsParams> _onCompletionResults;
464
465 /**
466 * Reports some or all of the results of performing a requested search.
467 * Unlike other notifications, this notification contains search results that
468 * should be added to any previously received search results associated with
469 * the same search id.
470 *
471 * Parameters
472 *
473 * id ( SearchId )
474 *
475 * The id associated with the search.
476 *
477 * results ( List<SearchResult> )
478 *
479 * The search results being reported.
480 *
481 * isLast ( bool )
482 *
483 * True if this is that last set of results that will be returned for the
484 * indicated search.
485 */
486 Stream<SearchResultsParams> onSearchResults;
487
488 /**
489 * Stream controller for [onSearchResults].
490 */
491 StreamController<SearchResultsParams> _onSearchResults;
492
493 /**
494 * Reports information needed to allow a single file to be launched.
495 *
496 * This notification is not subscribed to by default. Clients can subscribe
497 * by including the value "LAUNCH_DATA" in the list of services passed in an
498 * execution.setSubscriptions request.
499 *
500 * Parameters
501 *
502 * file ( FilePath )
503 *
504 * The file for which launch data is being provided. This will either be a
505 * Dart library or an HTML file.
506 *
507 * kind ( optional ExecutableKind )
508 *
509 * The kind of the executable file. This field is omitted if the file is
510 * not a Dart file.
511 *
512 * referencedFiles ( optional List<FilePath> )
513 *
514 * A list of the Dart files that are referenced by the file. This field is
515 * omitted if the file is not an HTML file.
516 */
517 Stream<ExecutionLaunchDataParams> onExecutionLaunchData;
518
519 /**
520 * Stream controller for [onExecutionLaunchData].
521 */
522 StreamController<ExecutionLaunchDataParams> _onExecutionLaunchData;
523
524 Server get server;
525
526 /**
527 * Dispatch the notification named [event], and containing parameters
528 * [params], to the appropriate stream.
529 */
530 void dispatchNotification(String event, params) {
531 ResponseDecoder decoder = new ResponseDecoder(null);
532 switch (event) {
533 case "server.connected":
534 expect(params, isServerConnectedParams);
535 _onServerConnected
536 .add(new ServerConnectedParams.fromJson(decoder, 'params', params));
537 break;
538 case "server.error":
539 expect(params, isServerErrorParams);
540 _onServerError
541 .add(new ServerErrorParams.fromJson(decoder, 'params', params));
542 break;
543 case "server.status":
544 expect(params, isServerStatusParams);
545 _onServerStatus
546 .add(new ServerStatusParams.fromJson(decoder, 'params', params));
547 break;
548 case "analysis.analyzedFiles":
549 expect(params, isAnalysisAnalyzedFilesParams);
550 _onAnalysisAnalyzedFiles.add(new AnalysisAnalyzedFilesParams.fromJson(
551 decoder, 'params', params));
552 break;
553 case "analysis.errors":
554 expect(params, isAnalysisErrorsParams);
555 _onAnalysisErrors
556 .add(new AnalysisErrorsParams.fromJson(decoder, 'params', params));
557 break;
558 case "analysis.flushResults":
559 expect(params, isAnalysisFlushResultsParams);
560 _onAnalysisFlushResults.add(
561 new AnalysisFlushResultsParams.fromJson(decoder, 'params', params));
562 break;
563 case "analysis.folding":
564 expect(params, isAnalysisFoldingParams);
565 _onAnalysisFolding
566 .add(new AnalysisFoldingParams.fromJson(decoder, 'params', params));
567 break;
568 case "analysis.highlights":
569 expect(params, isAnalysisHighlightsParams);
570 _onAnalysisHighlights.add(
571 new AnalysisHighlightsParams.fromJson(decoder, 'params', params));
572 break;
573 case "analysis.implemented":
574 expect(params, isAnalysisImplementedParams);
575 _onAnalysisImplemented.add(
576 new AnalysisImplementedParams.fromJson(decoder, 'params', params));
577 break;
578 case "analysis.invalidate":
579 expect(params, isAnalysisInvalidateParams);
580 _onAnalysisInvalidate.add(
581 new AnalysisInvalidateParams.fromJson(decoder, 'params', params));
582 break;
583 case "analysis.navigation":
584 expect(params, isAnalysisNavigationParams);
585 _onAnalysisNavigation.add(
586 new AnalysisNavigationParams.fromJson(decoder, 'params', params));
587 break;
588 case "analysis.occurrences":
589 expect(params, isAnalysisOccurrencesParams);
590 _onAnalysisOccurrences.add(
591 new AnalysisOccurrencesParams.fromJson(decoder, 'params', params));
592 break;
593 case "analysis.outline":
594 expect(params, isAnalysisOutlineParams);
595 _onAnalysisOutline
596 .add(new AnalysisOutlineParams.fromJson(decoder, 'params', params));
597 break;
598 case "analysis.overrides":
599 expect(params, isAnalysisOverridesParams);
600 _onAnalysisOverrides.add(
601 new AnalysisOverridesParams.fromJson(decoder, 'params', params));
602 break;
603 case "completion.results":
604 expect(params, isCompletionResultsParams);
605 _onCompletionResults.add(
606 new CompletionResultsParams.fromJson(decoder, 'params', params));
607 break;
608 case "search.results":
609 expect(params, isSearchResultsParams);
610 _onSearchResults
611 .add(new SearchResultsParams.fromJson(decoder, 'params', params));
612 break;
613 case "execution.launchData":
614 expect(params, isExecutionLaunchDataParams);
615 _onExecutionLaunchData.add(
616 new ExecutionLaunchDataParams.fromJson(decoder, 'params', params));
617 break;
618 default:
619 fail('Unexpected notification: $event');
620 break;
621 }
622 }
623
624 /**
625 * Initialize the fields in InttestMixin, and ensure that notifications will
626 * be handled.
627 */
628 void initializeInttestMixin() {
629 _onServerConnected =
630 new StreamController<ServerConnectedParams>(sync: true);
631 onServerConnected = _onServerConnected.stream.asBroadcastStream();
632 _onServerError = new StreamController<ServerErrorParams>(sync: true);
633 onServerError = _onServerError.stream.asBroadcastStream();
634 _onServerStatus = new StreamController<ServerStatusParams>(sync: true);
635 onServerStatus = _onServerStatus.stream.asBroadcastStream();
636 _onAnalysisAnalyzedFiles =
637 new StreamController<AnalysisAnalyzedFilesParams>(sync: true);
638 onAnalysisAnalyzedFiles =
639 _onAnalysisAnalyzedFiles.stream.asBroadcastStream();
640 _onAnalysisErrors = new StreamController<AnalysisErrorsParams>(sync: true);
641 onAnalysisErrors = _onAnalysisErrors.stream.asBroadcastStream();
642 _onAnalysisFlushResults =
643 new StreamController<AnalysisFlushResultsParams>(sync: true);
644 onAnalysisFlushResults = _onAnalysisFlushResults.stream.asBroadcastStream();
645 _onAnalysisFolding =
646 new StreamController<AnalysisFoldingParams>(sync: true);
647 onAnalysisFolding = _onAnalysisFolding.stream.asBroadcastStream();
648 _onAnalysisHighlights =
649 new StreamController<AnalysisHighlightsParams>(sync: true);
650 onAnalysisHighlights = _onAnalysisHighlights.stream.asBroadcastStream();
651 _onAnalysisImplemented =
652 new StreamController<AnalysisImplementedParams>(sync: true);
653 onAnalysisImplemented = _onAnalysisImplemented.stream.asBroadcastStream();
654 _onAnalysisInvalidate =
655 new StreamController<AnalysisInvalidateParams>(sync: true);
656 onAnalysisInvalidate = _onAnalysisInvalidate.stream.asBroadcastStream();
657 _onAnalysisNavigation =
658 new StreamController<AnalysisNavigationParams>(sync: true);
659 onAnalysisNavigation = _onAnalysisNavigation.stream.asBroadcastStream();
660 _onAnalysisOccurrences =
661 new StreamController<AnalysisOccurrencesParams>(sync: true);
662 onAnalysisOccurrences = _onAnalysisOccurrences.stream.asBroadcastStream();
663 _onAnalysisOutline =
664 new StreamController<AnalysisOutlineParams>(sync: true);
665 onAnalysisOutline = _onAnalysisOutline.stream.asBroadcastStream();
666 _onAnalysisOverrides =
667 new StreamController<AnalysisOverridesParams>(sync: true);
668 onAnalysisOverrides = _onAnalysisOverrides.stream.asBroadcastStream();
669 _onCompletionResults =
670 new StreamController<CompletionResultsParams>(sync: true);
671 onCompletionResults = _onCompletionResults.stream.asBroadcastStream();
672 _onSearchResults = new StreamController<SearchResultsParams>(sync: true);
673 onSearchResults = _onSearchResults.stream.asBroadcastStream();
674 _onExecutionLaunchData =
675 new StreamController<ExecutionLaunchDataParams>(sync: true);
676 onExecutionLaunchData = _onExecutionLaunchData.stream.asBroadcastStream();
677 }
678
679 /**
164 * Return the errors associated with the given file. If the errors for the 680 * Return the errors associated with the given file. If the errors for the
165 * given file have not yet been computed, or the most recently computed 681 * given file have not yet been computed, or the most recently computed
166 * errors for the given file are out of date, then the response for this 682 * errors for the given file are out of date, then the response for this
167 * request will be delayed until they have been computed. If some or all of 683 * request will be delayed until they have been computed. If some or all of
168 * the errors for the file cannot be computed, then the subset of the errors 684 * the errors for the file cannot be computed, then the subset of the errors
169 * that can be computed will be returned and the response will contain an 685 * that can be computed will be returned and the response will contain an
170 * error to indicate why the errors could not be computed. If the content of 686 * error to indicate why the errors could not be computed. If the content of
171 * the file changes after this request was received but before a response 687 * the file changes after this request was received but before a response
172 * could be sent, then an error of type CONTENT_MODIFIED will be generated. 688 * could be sent, then an error of type CONTENT_MODIFIED will be generated.
173 * 689 *
(...skipping 14 matching lines...) Expand all
188 * The file for which errors are being requested. 704 * The file for which errors are being requested.
189 * 705 *
190 * Returns 706 * Returns
191 * 707 *
192 * errors ( List<AnalysisError> ) 708 * errors ( List<AnalysisError> )
193 * 709 *
194 * The errors associated with the file. 710 * The errors associated with the file.
195 */ 711 */
196 Future<AnalysisGetErrorsResult> sendAnalysisGetErrors(String file) { 712 Future<AnalysisGetErrorsResult> sendAnalysisGetErrors(String file) {
197 var params = new AnalysisGetErrorsParams(file).toJson(); 713 var params = new AnalysisGetErrorsParams(file).toJson();
198 return server.send("analysis.getErrors", params) 714 return server.send("analysis.getErrors", params).then((result) {
199 .then((result) {
200 ResponseDecoder decoder = new ResponseDecoder(null); 715 ResponseDecoder decoder = new ResponseDecoder(null);
201 return new AnalysisGetErrorsResult.fromJson(decoder, 'result', result); 716 return new AnalysisGetErrorsResult.fromJson(decoder, 'result', result);
202 }); 717 });
203 } 718 }
204 719
205 /** 720 /**
206 * Return the hover information associate with the given location. If some or 721 * Return the hover information associate with the given location. If some or
207 * all of the hover information is not available at the time this request is 722 * all of the hover information is not available at the time this request is
208 * processed the information will be omitted from the response. 723 * processed the information will be omitted from the response.
209 * 724 *
(...skipping 12 matching lines...) Expand all
222 * hovers ( List<HoverInformation> ) 737 * hovers ( List<HoverInformation> )
223 * 738 *
224 * The hover information associated with the location. The list will be 739 * The hover information associated with the location. The list will be
225 * empty if no information could be determined for the location. The list 740 * empty if no information could be determined for the location. The list
226 * can contain multiple items if the file is being analyzed in multiple 741 * can contain multiple items if the file is being analyzed in multiple
227 * contexts in conflicting ways (such as a part that is included in 742 * contexts in conflicting ways (such as a part that is included in
228 * multiple libraries). 743 * multiple libraries).
229 */ 744 */
230 Future<AnalysisGetHoverResult> sendAnalysisGetHover(String file, int offset) { 745 Future<AnalysisGetHoverResult> sendAnalysisGetHover(String file, int offset) {
231 var params = new AnalysisGetHoverParams(file, offset).toJson(); 746 var params = new AnalysisGetHoverParams(file, offset).toJson();
232 return server.send("analysis.getHover", params) 747 return server.send("analysis.getHover", params).then((result) {
233 .then((result) {
234 ResponseDecoder decoder = new ResponseDecoder(null); 748 ResponseDecoder decoder = new ResponseDecoder(null);
235 return new AnalysisGetHoverResult.fromJson(decoder, 'result', result); 749 return new AnalysisGetHoverResult.fromJson(decoder, 'result', result);
236 }); 750 });
237 } 751 }
238 752
239 /** 753 /**
240 * Return library dependency information for use in client-side indexing and 754 * Return library dependency information for use in client-side indexing and
241 * package URI resolution. 755 * package URI resolution.
242 * 756 *
243 * Clients that are only using the libraries field should consider using the 757 * Clients that are only using the libraries field should consider using the
244 * analyzedFiles notification instead. 758 * analyzedFiles notification instead.
245 * 759 *
246 * Returns 760 * Returns
247 * 761 *
248 * libraries ( List<FilePath> ) 762 * libraries ( List<FilePath> )
249 * 763 *
250 * A list of the paths of library elements referenced by files in existing 764 * A list of the paths of library elements referenced by files in existing
251 * analysis roots. 765 * analysis roots.
252 * 766 *
253 * packageMap ( Map<String, Map<String, List<FilePath>>> ) 767 * packageMap ( Map<String, Map<String, List<FilePath>>> )
254 * 768 *
255 * A mapping from context source roots to package maps which map package 769 * A mapping from context source roots to package maps which map package
256 * names to source directories for use in client-side package URI 770 * names to source directories for use in client-side package URI
257 * resolution. 771 * resolution.
258 */ 772 */
259 Future<AnalysisGetLibraryDependenciesResult> sendAnalysisGetLibraryDependencie s() { 773 Future<
260 return server.send("analysis.getLibraryDependencies", null) 774 AnalysisGetLibraryDependenciesResult> sendAnalysisGetLibraryDependencies() {
261 .then((result) { 775 return server.send("analysis.getLibraryDependencies", null).then((result) {
262 ResponseDecoder decoder = new ResponseDecoder(null); 776 ResponseDecoder decoder = new ResponseDecoder(null);
263 return new AnalysisGetLibraryDependenciesResult.fromJson(decoder, 'result' , result); 777 return new AnalysisGetLibraryDependenciesResult.fromJson(
778 decoder, 'result', result);
264 }); 779 });
265 } 780 }
266 781
267 /** 782 /**
268 * Return the navigation information associated with the given region of the 783 * Return the navigation information associated with the given region of the
269 * given file. If the navigation information for the given file has not yet 784 * given file. If the navigation information for the given file has not yet
270 * been computed, or the most recently computed navigation information for 785 * been computed, or the most recently computed navigation information for
271 * the given file is out of date, then the response for this request will be 786 * the given file is out of date, then the response for this request will be
272 * delayed until it has been computed. If the content of the file changes 787 * delayed until it has been computed. If the content of the file changes
273 * after this request was received but before a response could be sent, then 788 * after this request was received but before a response could be sent, then
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 * targets ( List<NavigationTarget> ) 826 * targets ( List<NavigationTarget> )
312 * 827 *
313 * A list of the navigation targets that are referenced by the navigation 828 * A list of the navigation targets that are referenced by the navigation
314 * regions. 829 * regions.
315 * 830 *
316 * regions ( List<NavigationRegion> ) 831 * regions ( List<NavigationRegion> )
317 * 832 *
318 * A list of the navigation regions within the requested region of the 833 * A list of the navigation regions within the requested region of the
319 * file. 834 * file.
320 */ 835 */
321 Future<AnalysisGetNavigationResult> sendAnalysisGetNavigation(String file, int offset, int length) { 836 Future<AnalysisGetNavigationResult> sendAnalysisGetNavigation(
837 String file, int offset, int length) {
322 var params = new AnalysisGetNavigationParams(file, offset, length).toJson(); 838 var params = new AnalysisGetNavigationParams(file, offset, length).toJson();
323 return server.send("analysis.getNavigation", params) 839 return server.send("analysis.getNavigation", params).then((result) {
324 .then((result) {
325 ResponseDecoder decoder = new ResponseDecoder(null); 840 ResponseDecoder decoder = new ResponseDecoder(null);
326 return new AnalysisGetNavigationResult.fromJson(decoder, 'result', result) ; 841 return new AnalysisGetNavigationResult.fromJson(
842 decoder, 'result', result);
327 }); 843 });
328 } 844 }
329 845
330 /** 846 /**
331 * Force the re-analysis of everything contained in the specified analysis 847 * Force the re-analysis of everything contained in the specified analysis
332 * roots. This will cause all previously computed analysis results to be 848 * roots. This will cause all previously computed analysis results to be
333 * discarded and recomputed, and will cause all subscribed notifications to 849 * discarded and recomputed, and will cause all subscribed notifications to
334 * be re-sent. 850 * be re-sent.
335 * 851 *
336 * If no analysis roots are provided, then all current analysis roots will be 852 * If no analysis roots are provided, then all current analysis roots will be
337 * re-analyzed. If an empty list of analysis roots is provided, then nothing 853 * re-analyzed. If an empty list of analysis roots is provided, then nothing
338 * will be re-analyzed. If the list contains one or more paths that are not 854 * will be re-analyzed. If the list contains one or more paths that are not
339 * currently analysis roots, then an error of type INVALID_ANALYSIS_ROOT will 855 * currently analysis roots, then an error of type INVALID_ANALYSIS_ROOT will
340 * be generated. 856 * be generated.
341 * 857 *
342 * Parameters 858 * Parameters
343 * 859 *
344 * roots ( optional List<FilePath> ) 860 * roots ( optional List<FilePath> )
345 * 861 *
346 * A list of the analysis roots that are to be re-analyzed. 862 * A list of the analysis roots that are to be re-analyzed.
347 */ 863 */
348 Future sendAnalysisReanalyze({List<String> roots}) { 864 Future sendAnalysisReanalyze({List<String> roots}) {
349 var params = new AnalysisReanalyzeParams(roots: roots).toJson(); 865 var params = new AnalysisReanalyzeParams(roots: roots).toJson();
350 return server.send("analysis.reanalyze", params) 866 return server.send("analysis.reanalyze", params).then((result) {
351 .then((result) {
352 expect(result, isNull); 867 expect(result, isNull);
353 return null; 868 return null;
354 }); 869 });
355 } 870 }
356 871
357 /** 872 /**
358 * Sets the root paths used to determine which files to analyze. The set of 873 * Sets the root paths used to determine which files to analyze. The set of
359 * files to be analyzed are all of the files in one of the root paths that 874 * files to be analyzed are all of the files in one of the root paths that
360 * are not either explicitly or implicitly excluded. A file is explicitly 875 * are not either explicitly or implicitly excluded. A file is explicitly
361 * excluded if it is in one of the excluded paths. A file is implicitly 876 * excluded if it is in one of the excluded paths. A file is implicitly
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 * pubspec.yaml file which resolves any package: URI to the corresponding 914 * pubspec.yaml file which resolves any package: URI to the corresponding
400 * path within the target directory. The effect is the same as specifying 915 * path within the target directory. The effect is the same as specifying
401 * the target directory as a "--package_root" parameter to the Dart VM when 916 * the target directory as a "--package_root" parameter to the Dart VM when
402 * executing any Dart file inside the source directory. 917 * executing any Dart file inside the source directory.
403 * 918 *
404 * Files in any directories that are not overridden by this mapping have 919 * Files in any directories that are not overridden by this mapping have
405 * their package: URI's resolved using the normal pubspec.yaml mechanism. 920 * their package: URI's resolved using the normal pubspec.yaml mechanism.
406 * If this field is absent, or the empty map is specified, that indicates 921 * If this field is absent, or the empty map is specified, that indicates
407 * that the normal pubspec.yaml mechanism should always be used. 922 * that the normal pubspec.yaml mechanism should always be used.
408 */ 923 */
409 Future sendAnalysisSetAnalysisRoots(List<String> included, List<String> exclud ed, {Map<String, String> packageRoots}) { 924 Future sendAnalysisSetAnalysisRoots(
410 var params = new AnalysisSetAnalysisRootsParams(included, excluded, packageR oots: packageRoots).toJson(); 925 List<String> included, List<String> excluded,
411 return server.send("analysis.setAnalysisRoots", params) 926 {Map<String, String> packageRoots}) {
412 .then((result) { 927 var params = new AnalysisSetAnalysisRootsParams(included, excluded,
928 packageRoots: packageRoots).toJson();
929 return server.send("analysis.setAnalysisRoots", params).then((result) {
413 expect(result, isNull); 930 expect(result, isNull);
414 return null; 931 return null;
415 }); 932 });
416 } 933 }
417 934
418 /** 935 /**
419 * Subscribe for general services (that is, services that are not specific to 936 * Subscribe for general services (that is, services that are not specific to
420 * individual files). All previous subscriptions are replaced by the given 937 * individual files). All previous subscriptions are replaced by the given
421 * set of services. 938 * set of services.
422 * 939 *
423 * It is an error if any of the elements in the list are not valid services. 940 * It is an error if any of the elements in the list are not valid services.
424 * If there is an error, then the current subscriptions will remain 941 * If there is an error, then the current subscriptions will remain
425 * unchanged. 942 * unchanged.
426 * 943 *
427 * Parameters 944 * Parameters
428 * 945 *
429 * subscriptions ( List<GeneralAnalysisService> ) 946 * subscriptions ( List<GeneralAnalysisService> )
430 * 947 *
431 * A list of the services being subscribed to. 948 * A list of the services being subscribed to.
432 */ 949 */
433 Future sendAnalysisSetGeneralSubscriptions(List<GeneralAnalysisService> subscr iptions) { 950 Future sendAnalysisSetGeneralSubscriptions(
434 var params = new AnalysisSetGeneralSubscriptionsParams(subscriptions).toJson (); 951 List<GeneralAnalysisService> subscriptions) {
435 return server.send("analysis.setGeneralSubscriptions", params) 952 var params =
953 new AnalysisSetGeneralSubscriptionsParams(subscriptions).toJson();
954 return server
955 .send("analysis.setGeneralSubscriptions", params)
436 .then((result) { 956 .then((result) {
437 expect(result, isNull); 957 expect(result, isNull);
438 return null; 958 return null;
439 }); 959 });
440 } 960 }
441 961
442 /** 962 /**
443 * Set the priority files to the files in the given list. A priority file is 963 * Set the priority files to the files in the given list. A priority file is
444 * a file that is given priority when scheduling which analysis work to do 964 * a file that is given priority when scheduling which analysis work to do
445 * first. The list typically contains those files that are visible to the 965 * first. The list typically contains those files that are visible to the
(...skipping 13 matching lines...) Expand all
459 * can be included in the set of actual priority files. 979 * can be included in the set of actual priority files.
460 * 980 *
461 * Parameters 981 * Parameters
462 * 982 *
463 * files ( List<FilePath> ) 983 * files ( List<FilePath> )
464 * 984 *
465 * The files that are to be a priority for analysis. 985 * The files that are to be a priority for analysis.
466 */ 986 */
467 Future sendAnalysisSetPriorityFiles(List<String> files) { 987 Future sendAnalysisSetPriorityFiles(List<String> files) {
468 var params = new AnalysisSetPriorityFilesParams(files).toJson(); 988 var params = new AnalysisSetPriorityFilesParams(files).toJson();
469 return server.send("analysis.setPriorityFiles", params) 989 return server.send("analysis.setPriorityFiles", params).then((result) {
470 .then((result) {
471 expect(result, isNull); 990 expect(result, isNull);
472 return null; 991 return null;
473 }); 992 });
474 } 993 }
475 994
476 /** 995 /**
477 * Subscribe for services that are specific to individual files. All previous 996 * Subscribe for services that are specific to individual files. All previous
478 * subscriptions are replaced by the current set of subscriptions. If a given 997 * subscriptions are replaced by the current set of subscriptions. If a given
479 * service is not included as a key in the map then no files will be 998 * service is not included as a key in the map then no files will be
480 * subscribed to the service, exactly as if the service had been included in 999 * subscribed to the service, exactly as if the service had been included in
(...skipping 17 matching lines...) Expand all
498 * It is an error if any of the keys in the map are not valid services. If 1017 * It is an error if any of the keys in the map are not valid services. If
499 * there is an error, then the existing subscriptions will remain unchanged. 1018 * there is an error, then the existing subscriptions will remain unchanged.
500 * 1019 *
501 * Parameters 1020 * Parameters
502 * 1021 *
503 * subscriptions ( Map<AnalysisService, List<FilePath>> ) 1022 * subscriptions ( Map<AnalysisService, List<FilePath>> )
504 * 1023 *
505 * A table mapping services to a list of the files being subscribed to the 1024 * A table mapping services to a list of the files being subscribed to the
506 * service. 1025 * service.
507 */ 1026 */
508 Future sendAnalysisSetSubscriptions(Map<AnalysisService, List<String>> subscri ptions) { 1027 Future sendAnalysisSetSubscriptions(
1028 Map<AnalysisService, List<String>> subscriptions) {
509 var params = new AnalysisSetSubscriptionsParams(subscriptions).toJson(); 1029 var params = new AnalysisSetSubscriptionsParams(subscriptions).toJson();
510 return server.send("analysis.setSubscriptions", params) 1030 return server.send("analysis.setSubscriptions", params).then((result) {
511 .then((result) {
512 expect(result, isNull); 1031 expect(result, isNull);
513 return null; 1032 return null;
514 }); 1033 });
515 } 1034 }
516 1035
517 /** 1036 /**
518 * Update the content of one or more files. Files that were previously 1037 * Update the content of one or more files. Files that were previously
519 * updated but not included in this update remain unchanged. This effectively 1038 * updated but not included in this update remain unchanged. This effectively
520 * represents an overlay of the filesystem. The files whose content is 1039 * represents an overlay of the filesystem. The files whose content is
521 * overridden are therefore seen by server as being files with the given 1040 * overridden are therefore seen by server as being files with the given
522 * content, even if the files do not exist on the filesystem or if the file 1041 * content, even if the files do not exist on the filesystem or if the file
523 * path represents the path to a directory on the filesystem. 1042 * path represents the path to a directory on the filesystem.
524 * 1043 *
525 * Parameters 1044 * Parameters
526 * 1045 *
527 * files ( Map<FilePath, AddContentOverlay | ChangeContentOverlay | 1046 * files ( Map<FilePath, AddContentOverlay | ChangeContentOverlay |
528 * RemoveContentOverlay> ) 1047 * RemoveContentOverlay> )
529 * 1048 *
530 * A table mapping the files whose content has changed to a description of 1049 * A table mapping the files whose content has changed to a description of
531 * the content change. 1050 * the content change.
532 * 1051 *
533 * Returns 1052 * Returns
534 */ 1053 */
535 Future<AnalysisUpdateContentResult> sendAnalysisUpdateContent(Map<String, dyna mic> files) { 1054 Future<AnalysisUpdateContentResult> sendAnalysisUpdateContent(
1055 Map<String, dynamic> files) {
536 var params = new AnalysisUpdateContentParams(files).toJson(); 1056 var params = new AnalysisUpdateContentParams(files).toJson();
537 return server.send("analysis.updateContent", params) 1057 return server.send("analysis.updateContent", params).then((result) {
538 .then((result) {
539 ResponseDecoder decoder = new ResponseDecoder(null); 1058 ResponseDecoder decoder = new ResponseDecoder(null);
540 return new AnalysisUpdateContentResult.fromJson(decoder, 'result', result) ; 1059 return new AnalysisUpdateContentResult.fromJson(
1060 decoder, 'result', result);
541 }); 1061 });
542 } 1062 }
543 1063
544 /** 1064 /**
545 * Update the options controlling analysis based on the given set of options. 1065 * Update the options controlling analysis based on the given set of options.
546 * Any options that are not included in the analysis options will not be 1066 * Any options that are not included in the analysis options will not be
547 * changed. If there are options in the analysis options that are not valid, 1067 * changed. If there are options in the analysis options that are not valid,
548 * they will be silently ignored. 1068 * they will be silently ignored.
549 * 1069 *
550 * Parameters 1070 * Parameters
551 * 1071 *
552 * options ( AnalysisOptions ) 1072 * options ( AnalysisOptions )
553 * 1073 *
554 * The options that are to be used to control analysis. 1074 * The options that are to be used to control analysis.
555 */ 1075 */
556 Future sendAnalysisUpdateOptions(AnalysisOptions options) { 1076 Future sendAnalysisUpdateOptions(AnalysisOptions options) {
557 var params = new AnalysisUpdateOptionsParams(options).toJson(); 1077 var params = new AnalysisUpdateOptionsParams(options).toJson();
558 return server.send("analysis.updateOptions", params) 1078 return server.send("analysis.updateOptions", params).then((result) {
559 .then((result) {
560 expect(result, isNull); 1079 expect(result, isNull);
561 return null; 1080 return null;
562 }); 1081 });
563 } 1082 }
564 1083
565 /** 1084 /**
566 * Reports the paths of the files that are being analyzed.
567 *
568 * This notification is not subscribed to by default. Clients can subscribe
569 * by including the value "ANALYZED_FILES" in the list of services passed in
570 * an analysis.setGeneralSubscriptions request.
571 *
572 * Parameters
573 *
574 * directories ( List<FilePath> )
575 *
576 * A list of the paths of the files that are being analyzed.
577 */
578 Stream<AnalysisAnalyzedFilesParams> onAnalysisAnalyzedFiles;
579
580 /**
581 * Stream controller for [onAnalysisAnalyzedFiles].
582 */
583 StreamController<AnalysisAnalyzedFilesParams> _onAnalysisAnalyzedFiles;
584
585 /**
586 * Reports the errors associated with a given file. The set of errors
587 * included in the notification is always a complete list that supersedes any
588 * previously reported errors.
589 *
590 * It is only possible to unsubscribe from this notification by using the
591 * command-line flag --no-error-notification.
592 *
593 * Parameters
594 *
595 * file ( FilePath )
596 *
597 * The file containing the errors.
598 *
599 * errors ( List<AnalysisError> )
600 *
601 * The errors contained in the file.
602 */
603 Stream<AnalysisErrorsParams> onAnalysisErrors;
604
605 /**
606 * Stream controller for [onAnalysisErrors].
607 */
608 StreamController<AnalysisErrorsParams> _onAnalysisErrors;
609
610 /**
611 * Reports that any analysis results that were previously associated with the
612 * given files should be considered to be invalid because those files are no
613 * longer being analyzed, either because the analysis root that contained it
614 * is no longer being analyzed or because the file no longer exists.
615 *
616 * If a file is included in this notification and at some later time a
617 * notification with results for the file is received, clients should assume
618 * that the file is once again being analyzed and the information should be
619 * processed.
620 *
621 * It is not possible to subscribe to or unsubscribe from this notification.
622 *
623 * Parameters
624 *
625 * files ( List<FilePath> )
626 *
627 * The files that are no longer being analyzed.
628 */
629 Stream<AnalysisFlushResultsParams> onAnalysisFlushResults;
630
631 /**
632 * Stream controller for [onAnalysisFlushResults].
633 */
634 StreamController<AnalysisFlushResultsParams> _onAnalysisFlushResults;
635
636 /**
637 * Reports the folding regions associated with a given file. Folding regions
638 * can be nested, but will not be overlapping. Nesting occurs when a foldable
639 * element, such as a method, is nested inside another foldable element such
640 * as a class.
641 *
642 * This notification is not subscribed to by default. Clients can subscribe
643 * by including the value "FOLDING" in the list of services passed in an
644 * analysis.setSubscriptions request.
645 *
646 * Parameters
647 *
648 * file ( FilePath )
649 *
650 * The file containing the folding regions.
651 *
652 * regions ( List<FoldingRegion> )
653 *
654 * The folding regions contained in the file.
655 */
656 Stream<AnalysisFoldingParams> onAnalysisFolding;
657
658 /**
659 * Stream controller for [onAnalysisFolding].
660 */
661 StreamController<AnalysisFoldingParams> _onAnalysisFolding;
662
663 /**
664 * Reports the highlight regions associated with a given file.
665 *
666 * This notification is not subscribed to by default. Clients can subscribe
667 * by including the value "HIGHLIGHTS" in the list of services passed in an
668 * analysis.setSubscriptions request.
669 *
670 * Parameters
671 *
672 * file ( FilePath )
673 *
674 * The file containing the highlight regions.
675 *
676 * regions ( List<HighlightRegion> )
677 *
678 * The highlight regions contained in the file. Each highlight region
679 * represents a particular syntactic or semantic meaning associated with
680 * some range. Note that the highlight regions that are returned can
681 * overlap other highlight regions if there is more than one meaning
682 * associated with a particular region.
683 */
684 Stream<AnalysisHighlightsParams> onAnalysisHighlights;
685
686 /**
687 * Stream controller for [onAnalysisHighlights].
688 */
689 StreamController<AnalysisHighlightsParams> _onAnalysisHighlights;
690
691 /**
692 * Reports the classes that are implemented or extended and class members
693 * that are implemented or overridden in a file.
694 *
695 * This notification is not subscribed to by default. Clients can subscribe
696 * by including the value "IMPLEMENTED" in the list of services passed in an
697 * analysis.setSubscriptions request.
698 *
699 * Parameters
700 *
701 * file ( FilePath )
702 *
703 * The file with which the implementations are associated.
704 *
705 * classes ( List<ImplementedClass> )
706 *
707 * The classes defined in the file that are implemented or extended.
708 *
709 * members ( List<ImplementedMember> )
710 *
711 * The member defined in the file that are implemented or overridden.
712 */
713 Stream<AnalysisImplementedParams> onAnalysisImplemented;
714
715 /**
716 * Stream controller for [onAnalysisImplemented].
717 */
718 StreamController<AnalysisImplementedParams> _onAnalysisImplemented;
719
720 /**
721 * Reports that the navigation information associated with a region of a
722 * single file has become invalid and should be re-requested.
723 *
724 * This notification is not subscribed to by default. Clients can subscribe
725 * by including the value "INVALIDATE" in the list of services passed in an
726 * analysis.setSubscriptions request.
727 *
728 * Parameters
729 *
730 * file ( FilePath )
731 *
732 * The file whose information has been invalidated.
733 *
734 * offset ( int )
735 *
736 * The offset of the invalidated region.
737 *
738 * length ( int )
739 *
740 * The length of the invalidated region.
741 *
742 * delta ( int )
743 *
744 * The delta to be applied to the offsets in information that follows the
745 * invalidated region in order to update it so that it doesn't need to be
746 * re-requested.
747 */
748 Stream<AnalysisInvalidateParams> onAnalysisInvalidate;
749
750 /**
751 * Stream controller for [onAnalysisInvalidate].
752 */
753 StreamController<AnalysisInvalidateParams> _onAnalysisInvalidate;
754
755 /**
756 * Reports the navigation targets associated with a given file.
757 *
758 * This notification is not subscribed to by default. Clients can subscribe
759 * by including the value "NAVIGATION" in the list of services passed in an
760 * analysis.setSubscriptions request.
761 *
762 * Parameters
763 *
764 * file ( FilePath )
765 *
766 * The file containing the navigation regions.
767 *
768 * regions ( List<NavigationRegion> )
769 *
770 * The navigation regions contained in the file. The regions are sorted by
771 * their offsets. Each navigation region represents a list of targets
772 * associated with some range. The lists will usually contain a single
773 * target, but can contain more in the case of a part that is included in
774 * multiple libraries or in Dart code that is compiled against multiple
775 * versions of a package. Note that the navigation regions that are
776 * returned do not overlap other navigation regions.
777 *
778 * targets ( List<NavigationTarget> )
779 *
780 * The navigation targets referenced in the file. They are referenced by
781 * NavigationRegions by their index in this array.
782 *
783 * files ( List<FilePath> )
784 *
785 * The files containing navigation targets referenced in the file. They are
786 * referenced by NavigationTargets by their index in this array.
787 */
788 Stream<AnalysisNavigationParams> onAnalysisNavigation;
789
790 /**
791 * Stream controller for [onAnalysisNavigation].
792 */
793 StreamController<AnalysisNavigationParams> _onAnalysisNavigation;
794
795 /**
796 * Reports the occurrences of references to elements within a single file.
797 *
798 * This notification is not subscribed to by default. Clients can subscribe
799 * by including the value "OCCURRENCES" in the list of services passed in an
800 * analysis.setSubscriptions request.
801 *
802 * Parameters
803 *
804 * file ( FilePath )
805 *
806 * The file in which the references occur.
807 *
808 * occurrences ( List<Occurrences> )
809 *
810 * The occurrences of references to elements within the file.
811 */
812 Stream<AnalysisOccurrencesParams> onAnalysisOccurrences;
813
814 /**
815 * Stream controller for [onAnalysisOccurrences].
816 */
817 StreamController<AnalysisOccurrencesParams> _onAnalysisOccurrences;
818
819 /**
820 * Reports the outline associated with a single file.
821 *
822 * This notification is not subscribed to by default. Clients can subscribe
823 * by including the value "OUTLINE" in the list of services passed in an
824 * analysis.setSubscriptions request.
825 *
826 * Parameters
827 *
828 * file ( FilePath )
829 *
830 * The file with which the outline is associated.
831 *
832 * kind ( FileKind )
833 *
834 * The kind of the file.
835 *
836 * libraryName ( optional String )
837 *
838 * The name of the library defined by the file using a "library" directive,
839 * or referenced by a "part of" directive. If both "library" and "part of"
840 * directives are present, then the "library" directive takes precedence.
841 * This field will be omitted if the file has neither "library" nor "part
842 * of" directives.
843 *
844 * outline ( Outline )
845 *
846 * The outline associated with the file.
847 */
848 Stream<AnalysisOutlineParams> onAnalysisOutline;
849
850 /**
851 * Stream controller for [onAnalysisOutline].
852 */
853 StreamController<AnalysisOutlineParams> _onAnalysisOutline;
854
855 /**
856 * Reports the overridding members in a file.
857 *
858 * This notification is not subscribed to by default. Clients can subscribe
859 * by including the value "OVERRIDES" in the list of services passed in an
860 * analysis.setSubscriptions request.
861 *
862 * Parameters
863 *
864 * file ( FilePath )
865 *
866 * The file with which the overrides are associated.
867 *
868 * overrides ( List<Override> )
869 *
870 * The overrides associated with the file.
871 */
872 Stream<AnalysisOverridesParams> onAnalysisOverrides;
873
874 /**
875 * Stream controller for [onAnalysisOverrides].
876 */
877 StreamController<AnalysisOverridesParams> _onAnalysisOverrides;
878
879 /**
880 * Request that completion suggestions for the given offset in the given file 1085 * Request that completion suggestions for the given offset in the given file
881 * be returned. 1086 * be returned.
882 * 1087 *
883 * Parameters 1088 * Parameters
884 * 1089 *
885 * file ( FilePath ) 1090 * file ( FilePath )
886 * 1091 *
887 * The file containing the point at which suggestions are to be made. 1092 * The file containing the point at which suggestions are to be made.
888 * 1093 *
889 * offset ( int ) 1094 * offset ( int )
890 * 1095 *
891 * The offset within the file at which suggestions are to be made. 1096 * The offset within the file at which suggestions are to be made.
892 * 1097 *
893 * Returns 1098 * Returns
894 * 1099 *
895 * id ( CompletionId ) 1100 * id ( CompletionId )
896 * 1101 *
897 * The identifier used to associate results with this completion request. 1102 * The identifier used to associate results with this completion request.
898 */ 1103 */
899 Future<CompletionGetSuggestionsResult> sendCompletionGetSuggestions(String fil e, int offset) { 1104 Future<CompletionGetSuggestionsResult> sendCompletionGetSuggestions(
1105 String file, int offset) {
900 var params = new CompletionGetSuggestionsParams(file, offset).toJson(); 1106 var params = new CompletionGetSuggestionsParams(file, offset).toJson();
901 return server.send("completion.getSuggestions", params) 1107 return server.send("completion.getSuggestions", params).then((result) {
902 .then((result) {
903 ResponseDecoder decoder = new ResponseDecoder(null); 1108 ResponseDecoder decoder = new ResponseDecoder(null);
904 return new CompletionGetSuggestionsResult.fromJson(decoder, 'result', resu lt); 1109 return new CompletionGetSuggestionsResult.fromJson(
905 }); 1110 decoder, 'result', result);
906 } 1111 });
907 1112 }
908 /**
909 * Reports the completion suggestions that should be presented to the user.
910 * The set of suggestions included in the notification is always a complete
911 * list that supersedes any previously reported suggestions.
912 *
913 * Parameters
914 *
915 * id ( CompletionId )
916 *
917 * The id associated with the completion.
918 *
919 * replacementOffset ( int )
920 *
921 * The offset of the start of the text to be replaced. This will be
922 * different than the offset used to request the completion suggestions if
923 * there was a portion of an identifier before the original offset. In
924 * particular, the replacementOffset will be the offset of the beginning of
925 * said identifier.
926 *
927 * replacementLength ( int )
928 *
929 * The length of the text to be replaced if the remainder of the identifier
930 * containing the cursor is to be replaced when the suggestion is applied
931 * (that is, the number of characters in the existing identifier).
932 *
933 * results ( List<CompletionSuggestion> )
934 *
935 * The completion suggestions being reported. The notification contains all
936 * possible completions at the requested cursor position, even those that
937 * do not match the characters the user has already typed. This allows the
938 * client to respond to further keystrokes from the user without having to
939 * make additional requests.
940 *
941 * isLast ( bool )
942 *
943 * True if this is that last set of results that will be returned for the
944 * indicated completion.
945 */
946 Stream<CompletionResultsParams> onCompletionResults;
947
948 /**
949 * Stream controller for [onCompletionResults].
950 */
951 StreamController<CompletionResultsParams> _onCompletionResults;
952
953 /**
954 * Perform a search for references to the element defined or referenced at
955 * the given offset in the given file.
956 *
957 * An identifier is returned immediately, and individual results will be
958 * returned via the search.results notification as they become available.
959 *
960 * Parameters
961 *
962 * file ( FilePath )
963 *
964 * The file containing the declaration of or reference to the element used
965 * to define the search.
966 *
967 * offset ( int )
968 *
969 * The offset within the file of the declaration of or reference to the
970 * element.
971 *
972 * includePotential ( bool )
973 *
974 * True if potential matches are to be included in the results.
975 *
976 * Returns
977 *
978 * id ( optional SearchId )
979 *
980 * The identifier used to associate results with this search request.
981 *
982 * If no element was found at the given location, this field will be
983 * absent, and no results will be reported via the search.results
984 * notification.
985 *
986 * element ( optional Element )
987 *
988 * The element referenced or defined at the given offset and whose
989 * references will be returned in the search results.
990 *
991 * If no element was found at the given location, this field will be
992 * absent.
993 */
994 Future<SearchFindElementReferencesResult> sendSearchFindElementReferences(Stri ng file, int offset, bool includePotential) {
995 var params = new SearchFindElementReferencesParams(file, offset, includePote ntial).toJson();
996 return server.send("search.findElementReferences", params)
997 .then((result) {
998 ResponseDecoder decoder = new ResponseDecoder(null);
999 return new SearchFindElementReferencesResult.fromJson(decoder, 'result', r esult);
1000 });
1001 }
1002
1003 /**
1004 * Perform a search for declarations of members whose name is equal to the
1005 * given name.
1006 *
1007 * An identifier is returned immediately, and individual results will be
1008 * returned via the search.results notification as they become available.
1009 *
1010 * Parameters
1011 *
1012 * name ( String )
1013 *
1014 * The name of the declarations to be found.
1015 *
1016 * Returns
1017 *
1018 * id ( SearchId )
1019 *
1020 * The identifier used to associate results with this search request.
1021 */
1022 Future<SearchFindMemberDeclarationsResult> sendSearchFindMemberDeclarations(St ring name) {
1023 var params = new SearchFindMemberDeclarationsParams(name).toJson();
1024 return server.send("search.findMemberDeclarations", params)
1025 .then((result) {
1026 ResponseDecoder decoder = new ResponseDecoder(null);
1027 return new SearchFindMemberDeclarationsResult.fromJson(decoder, 'result', result);
1028 });
1029 }
1030
1031 /**
1032 * Perform a search for references to members whose name is equal to the
1033 * given name. This search does not check to see that there is a member
1034 * defined with the given name, so it is able to find references to undefined
1035 * members as well.
1036 *
1037 * An identifier is returned immediately, and individual results will be
1038 * returned via the search.results notification as they become available.
1039 *
1040 * Parameters
1041 *
1042 * name ( String )
1043 *
1044 * The name of the references to be found.
1045 *
1046 * Returns
1047 *
1048 * id ( SearchId )
1049 *
1050 * The identifier used to associate results with this search request.
1051 */
1052 Future<SearchFindMemberReferencesResult> sendSearchFindMemberReferences(String name) {
1053 var params = new SearchFindMemberReferencesParams(name).toJson();
1054 return server.send("search.findMemberReferences", params)
1055 .then((result) {
1056 ResponseDecoder decoder = new ResponseDecoder(null);
1057 return new SearchFindMemberReferencesResult.fromJson(decoder, 'result', re sult);
1058 });
1059 }
1060
1061 /**
1062 * Perform a search for declarations of top-level elements (classes,
1063 * typedefs, getters, setters, functions and fields) whose name matches the
1064 * given pattern.
1065 *
1066 * An identifier is returned immediately, and individual results will be
1067 * returned via the search.results notification as they become available.
1068 *
1069 * Parameters
1070 *
1071 * pattern ( String )
1072 *
1073 * The regular expression used to match the names of the declarations to be
1074 * found.
1075 *
1076 * Returns
1077 *
1078 * id ( SearchId )
1079 *
1080 * The identifier used to associate results with this search request.
1081 */
1082 Future<SearchFindTopLevelDeclarationsResult> sendSearchFindTopLevelDeclaration s(String pattern) {
1083 var params = new SearchFindTopLevelDeclarationsParams(pattern).toJson();
1084 return server.send("search.findTopLevelDeclarations", params)
1085 .then((result) {
1086 ResponseDecoder decoder = new ResponseDecoder(null);
1087 return new SearchFindTopLevelDeclarationsResult.fromJson(decoder, 'result' , result);
1088 });
1089 }
1090
1091 /**
1092 * Return the type hierarchy of the class declared or referenced at the given
1093 * location.
1094 *
1095 * Parameters
1096 *
1097 * file ( FilePath )
1098 *
1099 * The file containing the declaration or reference to the type for which a
1100 * hierarchy is being requested.
1101 *
1102 * offset ( int )
1103 *
1104 * The offset of the name of the type within the file.
1105 *
1106 * superOnly ( optional bool )
1107 *
1108 * True if the client is only requesting superclasses and interfaces
1109 * hierarchy.
1110 *
1111 * Returns
1112 *
1113 * hierarchyItems ( optional List<TypeHierarchyItem> )
1114 *
1115 * A list of the types in the requested hierarchy. The first element of the
1116 * list is the item representing the type for which the hierarchy was
1117 * requested. The index of other elements of the list is unspecified, but
1118 * correspond to the integers used to reference supertype and subtype items
1119 * within the items.
1120 *
1121 * This field will be absent if the code at the given file and offset does
1122 * not represent a type, or if the file has not been sufficiently analyzed
1123 * to allow a type hierarchy to be produced.
1124 */
1125 Future<SearchGetTypeHierarchyResult> sendSearchGetTypeHierarchy(String file, i nt offset, {bool superOnly}) {
1126 var params = new SearchGetTypeHierarchyParams(file, offset, superOnly: super Only).toJson();
1127 return server.send("search.getTypeHierarchy", params)
1128 .then((result) {
1129 ResponseDecoder decoder = new ResponseDecoder(null);
1130 return new SearchGetTypeHierarchyResult.fromJson(decoder, 'result', result );
1131 });
1132 }
1133
1134 /**
1135 * Reports some or all of the results of performing a requested search.
1136 * Unlike other notifications, this notification contains search results that
1137 * should be added to any previously received search results associated with
1138 * the same search id.
1139 *
1140 * Parameters
1141 *
1142 * id ( SearchId )
1143 *
1144 * The id associated with the search.
1145 *
1146 * results ( List<SearchResult> )
1147 *
1148 * The search results being reported.
1149 *
1150 * isLast ( bool )
1151 *
1152 * True if this is that last set of results that will be returned for the
1153 * indicated search.
1154 */
1155 Stream<SearchResultsParams> onSearchResults;
1156
1157 /**
1158 * Stream controller for [onSearchResults].
1159 */
1160 StreamController<SearchResultsParams> _onSearchResults;
1161 1113
1162 /** 1114 /**
1163 * Format the contents of a single file. The currently selected region of 1115 * Format the contents of a single file. The currently selected region of
1164 * text is passed in so that the selection can be preserved across the 1116 * text is passed in so that the selection can be preserved across the
1165 * formatting operation. The updated selection will be as close to matching 1117 * formatting operation. The updated selection will be as close to matching
1166 * the original as possible, but whitespace at the beginning or end of the 1118 * the original as possible, but whitespace at the beginning or end of the
1167 * selected region will be ignored. If preserving selection information is 1119 * selected region will be ignored. If preserving selection information is
1168 * not required, zero (0) can be specified for both the selection offset and 1120 * not required, zero (0) can be specified for both the selection offset and
1169 * selection length. 1121 * selection length.
1170 * 1122 *
(...skipping 29 matching lines...) Expand all
1200 * empty if the code was already formatted (there are no changes). 1152 * empty if the code was already formatted (there are no changes).
1201 * 1153 *
1202 * selectionOffset ( int ) 1154 * selectionOffset ( int )
1203 * 1155 *
1204 * The offset of the selection after formatting the code. 1156 * The offset of the selection after formatting the code.
1205 * 1157 *
1206 * selectionLength ( int ) 1158 * selectionLength ( int )
1207 * 1159 *
1208 * The length of the selection after formatting the code. 1160 * The length of the selection after formatting the code.
1209 */ 1161 */
1210 Future<EditFormatResult> sendEditFormat(String file, int selectionOffset, int selectionLength, {int lineLength}) { 1162 Future<EditFormatResult> sendEditFormat(
1211 var params = new EditFormatParams(file, selectionOffset, selectionLength, li neLength: lineLength).toJson(); 1163 String file, int selectionOffset, int selectionLength,
1212 return server.send("edit.format", params) 1164 {int lineLength}) {
1213 .then((result) { 1165 var params = new EditFormatParams(file, selectionOffset, selectionLength,
1166 lineLength: lineLength).toJson();
1167 return server.send("edit.format", params).then((result) {
1214 ResponseDecoder decoder = new ResponseDecoder(null); 1168 ResponseDecoder decoder = new ResponseDecoder(null);
1215 return new EditFormatResult.fromJson(decoder, 'result', result); 1169 return new EditFormatResult.fromJson(decoder, 'result', result);
1216 }); 1170 });
1217 } 1171 }
1218 1172
1219 /** 1173 /**
1220 * Return the set of assists that are available at the given location. An 1174 * Return the set of assists that are available at the given location. An
1221 * assist is distinguished from a refactoring primarily by the fact that it 1175 * assist is distinguished from a refactoring primarily by the fact that it
1222 * affects a single file and does not require user input in order to be 1176 * affects a single file and does not require user input in order to be
1223 * performed. 1177 * performed.
(...skipping 11 matching lines...) Expand all
1235 * length ( int ) 1189 * length ( int )
1236 * 1190 *
1237 * The length of the code for which assists are being requested. 1191 * The length of the code for which assists are being requested.
1238 * 1192 *
1239 * Returns 1193 * Returns
1240 * 1194 *
1241 * assists ( List<SourceChange> ) 1195 * assists ( List<SourceChange> )
1242 * 1196 *
1243 * The assists that are available at the given location. 1197 * The assists that are available at the given location.
1244 */ 1198 */
1245 Future<EditGetAssistsResult> sendEditGetAssists(String file, int offset, int l ength) { 1199 Future<EditGetAssistsResult> sendEditGetAssists(
1200 String file, int offset, int length) {
1246 var params = new EditGetAssistsParams(file, offset, length).toJson(); 1201 var params = new EditGetAssistsParams(file, offset, length).toJson();
1247 return server.send("edit.getAssists", params) 1202 return server.send("edit.getAssists", params).then((result) {
1248 .then((result) {
1249 ResponseDecoder decoder = new ResponseDecoder(null); 1203 ResponseDecoder decoder = new ResponseDecoder(null);
1250 return new EditGetAssistsResult.fromJson(decoder, 'result', result); 1204 return new EditGetAssistsResult.fromJson(decoder, 'result', result);
1251 }); 1205 });
1252 } 1206 }
1253 1207
1254 /** 1208 /**
1255 * Get a list of the kinds of refactorings that are valid for the given 1209 * Get a list of the kinds of refactorings that are valid for the given
1256 * selection in the given file. 1210 * selection in the given file.
1257 * 1211 *
1258 * Parameters 1212 * Parameters
1259 * 1213 *
1260 * file ( FilePath ) 1214 * file ( FilePath )
1261 * 1215 *
1262 * The file containing the code on which the refactoring would be based. 1216 * The file containing the code on which the refactoring would be based.
1263 * 1217 *
1264 * offset ( int ) 1218 * offset ( int )
1265 * 1219 *
1266 * The offset of the code on which the refactoring would be based. 1220 * The offset of the code on which the refactoring would be based.
1267 * 1221 *
1268 * length ( int ) 1222 * length ( int )
1269 * 1223 *
1270 * The length of the code on which the refactoring would be based. 1224 * The length of the code on which the refactoring would be based.
1271 * 1225 *
1272 * Returns 1226 * Returns
1273 * 1227 *
1274 * kinds ( List<RefactoringKind> ) 1228 * kinds ( List<RefactoringKind> )
1275 * 1229 *
1276 * The kinds of refactorings that are valid for the given selection. 1230 * The kinds of refactorings that are valid for the given selection.
1277 */ 1231 */
1278 Future<EditGetAvailableRefactoringsResult> sendEditGetAvailableRefactorings(St ring file, int offset, int length) { 1232 Future<EditGetAvailableRefactoringsResult> sendEditGetAvailableRefactorings(
1279 var params = new EditGetAvailableRefactoringsParams(file, offset, length).to Json(); 1233 String file, int offset, int length) {
1280 return server.send("edit.getAvailableRefactorings", params) 1234 var params =
1281 .then((result) { 1235 new EditGetAvailableRefactoringsParams(file, offset, length).toJson();
1236 return server.send("edit.getAvailableRefactorings", params).then((result) {
1282 ResponseDecoder decoder = new ResponseDecoder(null); 1237 ResponseDecoder decoder = new ResponseDecoder(null);
1283 return new EditGetAvailableRefactoringsResult.fromJson(decoder, 'result', result); 1238 return new EditGetAvailableRefactoringsResult.fromJson(
1239 decoder, 'result', result);
1284 }); 1240 });
1285 } 1241 }
1286 1242
1287 /** 1243 /**
1288 * Return the set of fixes that are available for the errors at a given 1244 * Return the set of fixes that are available for the errors at a given
1289 * offset in a given file. 1245 * offset in a given file.
1290 * 1246 *
1291 * Parameters 1247 * Parameters
1292 * 1248 *
1293 * file ( FilePath ) 1249 * file ( FilePath )
1294 * 1250 *
1295 * The file containing the errors for which fixes are being requested. 1251 * The file containing the errors for which fixes are being requested.
1296 * 1252 *
1297 * offset ( int ) 1253 * offset ( int )
1298 * 1254 *
1299 * The offset used to select the errors for which fixes will be returned. 1255 * The offset used to select the errors for which fixes will be returned.
1300 * 1256 *
1301 * Returns 1257 * Returns
1302 * 1258 *
1303 * fixes ( List<AnalysisErrorFixes> ) 1259 * fixes ( List<AnalysisErrorFixes> )
1304 * 1260 *
1305 * The fixes that are available for the errors at the given offset. 1261 * The fixes that are available for the errors at the given offset.
1306 */ 1262 */
1307 Future<EditGetFixesResult> sendEditGetFixes(String file, int offset) { 1263 Future<EditGetFixesResult> sendEditGetFixes(String file, int offset) {
1308 var params = new EditGetFixesParams(file, offset).toJson(); 1264 var params = new EditGetFixesParams(file, offset).toJson();
1309 return server.send("edit.getFixes", params) 1265 return server.send("edit.getFixes", params).then((result) {
1310 .then((result) {
1311 ResponseDecoder decoder = new ResponseDecoder(null); 1266 ResponseDecoder decoder = new ResponseDecoder(null);
1312 return new EditGetFixesResult.fromJson(decoder, 'result', result); 1267 return new EditGetFixesResult.fromJson(decoder, 'result', result);
1313 }); 1268 });
1314 } 1269 }
1315 1270
1316 /** 1271 /**
1317 * Get the changes required to perform a refactoring. 1272 * Get the changes required to perform a refactoring.
1318 * 1273 *
1319 * If another refactoring request is received during the processing of this 1274 * If another refactoring request is received during the processing of this
1320 * one, an error of type REFACTORING_REQUEST_CANCELLED will be generated. 1275 * one, an error of type REFACTORING_REQUEST_CANCELLED will be generated.
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1387 * potentialEdits ( optional List<String> ) 1342 * potentialEdits ( optional List<String> )
1388 * 1343 *
1389 * The ids of source edits that are not known to be valid. An edit is not 1344 * The ids of source edits that are not known to be valid. An edit is not
1390 * known to be valid if there was insufficient type information for the 1345 * known to be valid if there was insufficient type information for the
1391 * server to be able to determine whether or not the code needs to be 1346 * server to be able to determine whether or not the code needs to be
1392 * modified, such as when a member is being renamed and there is a 1347 * modified, such as when a member is being renamed and there is a
1393 * reference to a member from an unknown type. This field will be omitted 1348 * reference to a member from an unknown type. This field will be omitted
1394 * if the change field is omitted or if there are no potential edits for 1349 * if the change field is omitted or if there are no potential edits for
1395 * the refactoring. 1350 * the refactoring.
1396 */ 1351 */
1397 Future<EditGetRefactoringResult> sendEditGetRefactoring(RefactoringKind kind, String file, int offset, int length, bool validateOnly, {RefactoringOptions opti ons}) { 1352 Future<EditGetRefactoringResult> sendEditGetRefactoring(RefactoringKind kind,
1398 var params = new EditGetRefactoringParams(kind, file, offset, length, valida teOnly, options: options).toJson(); 1353 String file, int offset, int length, bool validateOnly,
1399 return server.send("edit.getRefactoring", params) 1354 {RefactoringOptions options}) {
1400 .then((result) { 1355 var params = new EditGetRefactoringParams(
1356 kind, file, offset, length, validateOnly,
1357 options: options).toJson();
1358 return server.send("edit.getRefactoring", params).then((result) {
1401 ResponseDecoder decoder = new ResponseDecoder(kind); 1359 ResponseDecoder decoder = new ResponseDecoder(kind);
1402 return new EditGetRefactoringResult.fromJson(decoder, 'result', result); 1360 return new EditGetRefactoringResult.fromJson(decoder, 'result', result);
1403 }); 1361 });
1404 } 1362 }
1405 1363
1406 /** 1364 /**
1365 * Organizes all of the directives - removes unused imports and sorts
1366 * directives of the given Dart file according to the Dart Style Guide.
1367 *
1368 * If a request is made for a file that does not exist, does not belong to an
1369 * analysis root or is not a Dart file, FILE_NOT_ANALYZED will be generated.
1370 *
1371 * If directives of the Dart file cannot be organized, for example because it
1372 * has scan or parse errors, or by other reasons, ORGANIZE_DIRECTIVES_ERROR
1373 * will be generated. The message will provide datails about the reason.
1374 *
1375 * Parameters
1376 *
1377 * file ( FilePath )
1378 *
1379 * The Dart file to organize directives in.
1380 *
1381 * Returns
1382 *
1383 * edit ( SourceFileEdit )
1384 *
1385 * The file edit that is to be applied to the given file to effect the
1386 * organizing.
1387 */
1388 Future<EditOrganizeDirectivesResult> sendEditOrganizeDirectives(String file) {
1389 var params = new EditOrganizeDirectivesParams(file).toJson();
1390 return server.send("edit.organizeDirectives", params).then((result) {
1391 ResponseDecoder decoder = new ResponseDecoder(null);
1392 return new EditOrganizeDirectivesResult.fromJson(
1393 decoder, 'result', result);
1394 });
1395 }
1396
1397 /**
1407 * Sort all of the directives, unit and class members of the given Dart file. 1398 * Sort all of the directives, unit and class members of the given Dart file.
1408 * 1399 *
1409 * If a request is made for a file that does not exist, does not belong to an 1400 * If a request is made for a file that does not exist, does not belong to an
1410 * analysis root or is not a Dart file, SORT_MEMBERS_INVALID_FILE will be 1401 * analysis root or is not a Dart file, SORT_MEMBERS_INVALID_FILE will be
1411 * generated. 1402 * generated.
1412 * 1403 *
1413 * If the Dart file has scan or parse errors, SORT_MEMBERS_PARSE_ERRORS will 1404 * If the Dart file has scan or parse errors, SORT_MEMBERS_PARSE_ERRORS will
1414 * be generated. 1405 * be generated.
1415 * 1406 *
1416 * Parameters 1407 * Parameters
1417 * 1408 *
1418 * file ( FilePath ) 1409 * file ( FilePath )
1419 * 1410 *
1420 * The Dart file to sort. 1411 * The Dart file to sort.
1421 * 1412 *
1422 * Returns 1413 * Returns
1423 * 1414 *
1424 * edit ( SourceFileEdit ) 1415 * edit ( SourceFileEdit )
1425 * 1416 *
1426 * The file edit that is to be applied to the given file to effect the 1417 * The file edit that is to be applied to the given file to effect the
1427 * sorting. 1418 * sorting.
1428 */ 1419 */
1429 Future<EditSortMembersResult> sendEditSortMembers(String file) { 1420 Future<EditSortMembersResult> sendEditSortMembers(String file) {
1430 var params = new EditSortMembersParams(file).toJson(); 1421 var params = new EditSortMembersParams(file).toJson();
1431 return server.send("edit.sortMembers", params) 1422 return server.send("edit.sortMembers", params).then((result) {
1432 .then((result) {
1433 ResponseDecoder decoder = new ResponseDecoder(null); 1423 ResponseDecoder decoder = new ResponseDecoder(null);
1434 return new EditSortMembersResult.fromJson(decoder, 'result', result); 1424 return new EditSortMembersResult.fromJson(decoder, 'result', result);
1435 }); 1425 });
1436 } 1426 }
1437 1427
1438 /** 1428 /**
1439 * Organizes all of the directives - removes unused imports and sorts
1440 * directives of the given Dart file according to the Dart Style Guide.
1441 *
1442 * If a request is made for a file that does not exist, does not belong to an
1443 * analysis root or is not a Dart file, FILE_NOT_ANALYZED will be generated.
1444 *
1445 * If directives of the Dart file cannot be organized, for example because it
1446 * has scan or parse errors, or by other reasons, ORGANIZE_DIRECTIVES_ERROR
1447 * will be generated. The message will provide datails about the reason.
1448 *
1449 * Parameters
1450 *
1451 * file ( FilePath )
1452 *
1453 * The Dart file to organize directives in.
1454 *
1455 * Returns
1456 *
1457 * edit ( SourceFileEdit )
1458 *
1459 * The file edit that is to be applied to the given file to effect the
1460 * organizing.
1461 */
1462 Future<EditOrganizeDirectivesResult> sendEditOrganizeDirectives(String file) {
1463 var params = new EditOrganizeDirectivesParams(file).toJson();
1464 return server.send("edit.organizeDirectives", params)
1465 .then((result) {
1466 ResponseDecoder decoder = new ResponseDecoder(null);
1467 return new EditOrganizeDirectivesResult.fromJson(decoder, 'result', result );
1468 });
1469 }
1470
1471 /**
1472 * Create an execution context for the executable file with the given path. 1429 * Create an execution context for the executable file with the given path.
1473 * The context that is created will persist until execution.deleteContext is 1430 * The context that is created will persist until execution.deleteContext is
1474 * used to delete it. Clients, therefore, are responsible for managing the 1431 * used to delete it. Clients, therefore, are responsible for managing the
1475 * lifetime of execution contexts. 1432 * lifetime of execution contexts.
1476 * 1433 *
1477 * Parameters 1434 * Parameters
1478 * 1435 *
1479 * contextRoot ( FilePath ) 1436 * contextRoot ( FilePath )
1480 * 1437 *
1481 * The path of the Dart or HTML file that will be launched, or the path of 1438 * The path of the Dart or HTML file that will be launched, or the path of
1482 * the directory containing the file. 1439 * the directory containing the file.
1483 * 1440 *
1484 * Returns 1441 * Returns
1485 * 1442 *
1486 * id ( ExecutionContextId ) 1443 * id ( ExecutionContextId )
1487 * 1444 *
1488 * The identifier used to refer to the execution context that was created. 1445 * The identifier used to refer to the execution context that was created.
1489 */ 1446 */
1490 Future<ExecutionCreateContextResult> sendExecutionCreateContext(String context Root) { 1447 Future<ExecutionCreateContextResult> sendExecutionCreateContext(
1448 String contextRoot) {
1491 var params = new ExecutionCreateContextParams(contextRoot).toJson(); 1449 var params = new ExecutionCreateContextParams(contextRoot).toJson();
1492 return server.send("execution.createContext", params) 1450 return server.send("execution.createContext", params).then((result) {
1493 .then((result) { 1451 ResponseDecoder decoder = new ResponseDecoder(null);
1494 ResponseDecoder decoder = new ResponseDecoder(null); 1452 return new ExecutionCreateContextResult.fromJson(
1495 return new ExecutionCreateContextResult.fromJson(decoder, 'result', result ); 1453 decoder, 'result', result);
1496 }); 1454 });
1497 } 1455 }
1498 1456
1499 /** 1457 /**
1500 * Delete the execution context with the given identifier. The context id is 1458 * Delete the execution context with the given identifier. The context id is
1501 * no longer valid after this command. The server is allowed to re-use ids 1459 * no longer valid after this command. The server is allowed to re-use ids
1502 * when they are no longer valid. 1460 * when they are no longer valid.
1503 * 1461 *
1504 * Parameters 1462 * Parameters
1505 * 1463 *
1506 * id ( ExecutionContextId ) 1464 * id ( ExecutionContextId )
1507 * 1465 *
1508 * The identifier of the execution context that is to be deleted. 1466 * The identifier of the execution context that is to be deleted.
1509 */ 1467 */
1510 Future sendExecutionDeleteContext(String id) { 1468 Future sendExecutionDeleteContext(String id) {
1511 var params = new ExecutionDeleteContextParams(id).toJson(); 1469 var params = new ExecutionDeleteContextParams(id).toJson();
1512 return server.send("execution.deleteContext", params) 1470 return server.send("execution.deleteContext", params).then((result) {
1513 .then((result) {
1514 expect(result, isNull); 1471 expect(result, isNull);
1515 return null; 1472 return null;
1516 }); 1473 });
1517 } 1474 }
1518 1475
1519 /** 1476 /**
1520 * Map a URI from the execution context to the file that it corresponds to, 1477 * Map a URI from the execution context to the file that it corresponds to,
1521 * or map a file to the URI that it corresponds to in the execution context. 1478 * or map a file to the URI that it corresponds to in the execution context.
1522 * 1479 *
1523 * Exactly one of the file and uri fields must be provided. If both fields 1480 * Exactly one of the file and uri fields must be provided. If both fields
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1557 * file ( optional FilePath ) 1514 * file ( optional FilePath )
1558 * 1515 *
1559 * The file to which the URI was mapped. This field is omitted if the uri 1516 * The file to which the URI was mapped. This field is omitted if the uri
1560 * field was not given in the request. 1517 * field was not given in the request.
1561 * 1518 *
1562 * uri ( optional String ) 1519 * uri ( optional String )
1563 * 1520 *
1564 * The URI to which the file path was mapped. This field is omitted if the 1521 * The URI to which the file path was mapped. This field is omitted if the
1565 * file field was not given in the request. 1522 * file field was not given in the request.
1566 */ 1523 */
1567 Future<ExecutionMapUriResult> sendExecutionMapUri(String id, {String file, Str ing uri}) { 1524 Future<ExecutionMapUriResult> sendExecutionMapUri(String id,
1525 {String file, String uri}) {
1568 var params = new ExecutionMapUriParams(id, file: file, uri: uri).toJson(); 1526 var params = new ExecutionMapUriParams(id, file: file, uri: uri).toJson();
1569 return server.send("execution.mapUri", params) 1527 return server.send("execution.mapUri", params).then((result) {
1528 ResponseDecoder decoder = new ResponseDecoder(null);
1529 return new ExecutionMapUriResult.fromJson(decoder, 'result', result);
1530 });
1531 }
1532
1533 /**
1534 * Subscribe for services. All previous subscriptions are replaced by the
1535 * given set of services.
1536 *
1537 * It is an error if any of the elements in the list are not valid services.
1538 * If there is an error, then the current subscriptions will remain
1539 * unchanged.
1540 *
1541 * Parameters
1542 *
1543 * subscriptions ( List<ExecutionService> )
1544 *
1545 * A list of the services being subscribed to.
1546 */
1547 Future sendExecutionSetSubscriptions(List<ExecutionService> subscriptions) {
1548 var params = new ExecutionSetSubscriptionsParams(subscriptions).toJson();
1549 return server.send("execution.setSubscriptions", params).then((result) {
1550 expect(result, isNull);
1551 return null;
1552 });
1553 }
1554
1555 /**
1556 * Perform a search for references to the element defined or referenced at
1557 * the given offset in the given file.
1558 *
1559 * An identifier is returned immediately, and individual results will be
1560 * returned via the search.results notification as they become available.
1561 *
1562 * Parameters
1563 *
1564 * file ( FilePath )
1565 *
1566 * The file containing the declaration of or reference to the element used
1567 * to define the search.
1568 *
1569 * offset ( int )
1570 *
1571 * The offset within the file of the declaration of or reference to the
1572 * element.
1573 *
1574 * includePotential ( bool )
1575 *
1576 * True if potential matches are to be included in the results.
1577 *
1578 * Returns
1579 *
1580 * id ( optional SearchId )
1581 *
1582 * The identifier used to associate results with this search request.
1583 *
1584 * If no element was found at the given location, this field will be
1585 * absent, and no results will be reported via the search.results
1586 * notification.
1587 *
1588 * element ( optional Element )
1589 *
1590 * The element referenced or defined at the given offset and whose
1591 * references will be returned in the search results.
1592 *
1593 * If no element was found at the given location, this field will be
1594 * absent.
1595 */
1596 Future<SearchFindElementReferencesResult> sendSearchFindElementReferences(
1597 String file, int offset, bool includePotential) {
1598 var params = new SearchFindElementReferencesParams(
1599 file, offset, includePotential).toJson();
1600 return server.send("search.findElementReferences", params).then((result) {
1601 ResponseDecoder decoder = new ResponseDecoder(null);
1602 return new SearchFindElementReferencesResult.fromJson(
1603 decoder, 'result', result);
1604 });
1605 }
1606
1607 /**
1608 * Perform a search for declarations of members whose name is equal to the
1609 * given name.
1610 *
1611 * An identifier is returned immediately, and individual results will be
1612 * returned via the search.results notification as they become available.
1613 *
1614 * Parameters
1615 *
1616 * name ( String )
1617 *
1618 * The name of the declarations to be found.
1619 *
1620 * Returns
1621 *
1622 * id ( SearchId )
1623 *
1624 * The identifier used to associate results with this search request.
1625 */
1626 Future<SearchFindMemberDeclarationsResult> sendSearchFindMemberDeclarations(
1627 String name) {
1628 var params = new SearchFindMemberDeclarationsParams(name).toJson();
1629 return server.send("search.findMemberDeclarations", params).then((result) {
1630 ResponseDecoder decoder = new ResponseDecoder(null);
1631 return new SearchFindMemberDeclarationsResult.fromJson(
1632 decoder, 'result', result);
1633 });
1634 }
1635
1636 /**
1637 * Perform a search for references to members whose name is equal to the
1638 * given name. This search does not check to see that there is a member
1639 * defined with the given name, so it is able to find references to undefined
1640 * members as well.
1641 *
1642 * An identifier is returned immediately, and individual results will be
1643 * returned via the search.results notification as they become available.
1644 *
1645 * Parameters
1646 *
1647 * name ( String )
1648 *
1649 * The name of the references to be found.
1650 *
1651 * Returns
1652 *
1653 * id ( SearchId )
1654 *
1655 * The identifier used to associate results with this search request.
1656 */
1657 Future<SearchFindMemberReferencesResult> sendSearchFindMemberReferences(
1658 String name) {
1659 var params = new SearchFindMemberReferencesParams(name).toJson();
1660 return server.send("search.findMemberReferences", params).then((result) {
1661 ResponseDecoder decoder = new ResponseDecoder(null);
1662 return new SearchFindMemberReferencesResult.fromJson(
1663 decoder, 'result', result);
1664 });
1665 }
1666
1667 /**
1668 * Perform a search for declarations of top-level elements (classes,
1669 * typedefs, getters, setters, functions and fields) whose name matches the
1670 * given pattern.
1671 *
1672 * An identifier is returned immediately, and individual results will be
1673 * returned via the search.results notification as they become available.
1674 *
1675 * Parameters
1676 *
1677 * pattern ( String )
1678 *
1679 * The regular expression used to match the names of the declarations to be
1680 * found.
1681 *
1682 * Returns
1683 *
1684 * id ( SearchId )
1685 *
1686 * The identifier used to associate results with this search request.
1687 */
1688 Future<
1689 SearchFindTopLevelDeclarationsResult> sendSearchFindTopLevelDeclarations(
1690 String pattern) {
1691 var params = new SearchFindTopLevelDeclarationsParams(pattern).toJson();
1692 return server
1693 .send("search.findTopLevelDeclarations", params)
1570 .then((result) { 1694 .then((result) {
1571 ResponseDecoder decoder = new ResponseDecoder(null); 1695 ResponseDecoder decoder = new ResponseDecoder(null);
1572 return new ExecutionMapUriResult.fromJson(decoder, 'result', result); 1696 return new SearchFindTopLevelDeclarationsResult.fromJson(
1573 }); 1697 decoder, 'result', result);
1574 } 1698 });
1575 1699 }
1700
1701 /**
1702 * Return the type hierarchy of the class declared or referenced at the given
1703 * location.
1704 *
1705 * Parameters
1706 *
1707 * file ( FilePath )
1708 *
1709 * The file containing the declaration or reference to the type for which a
1710 * hierarchy is being requested.
1711 *
1712 * offset ( int )
1713 *
1714 * The offset of the name of the type within the file.
1715 *
1716 * superOnly ( optional bool )
1717 *
1718 * True if the client is only requesting superclasses and interfaces
1719 * hierarchy.
1720 *
1721 * Returns
1722 *
1723 * hierarchyItems ( optional List<TypeHierarchyItem> )
1724 *
1725 * A list of the types in the requested hierarchy. The first element of the
1726 * list is the item representing the type for which the hierarchy was
1727 * requested. The index of other elements of the list is unspecified, but
1728 * correspond to the integers used to reference supertype and subtype items
1729 * within the items.
1730 *
1731 * This field will be absent if the code at the given file and offset does
1732 * not represent a type, or if the file has not been sufficiently analyzed
1733 * to allow a type hierarchy to be produced.
1734 */
1735 Future<SearchGetTypeHierarchyResult> sendSearchGetTypeHierarchy(
1736 String file, int offset,
1737 {bool superOnly}) {
1738 var params = new SearchGetTypeHierarchyParams(file, offset,
1739 superOnly: superOnly).toJson();
1740 return server.send("search.getTypeHierarchy", params).then((result) {
1741 ResponseDecoder decoder = new ResponseDecoder(null);
1742 return new SearchGetTypeHierarchyResult.fromJson(
1743 decoder, 'result', result);
1744 });
1745 }
1746
1747 /**
1748 * Return the version number of the analysis server.
1749 *
1750 * Returns
1751 *
1752 * version ( String )
1753 *
1754 * The version number of the analysis server.
1755 */
1756 Future<ServerGetVersionResult> sendServerGetVersion() {
1757 return server.send("server.getVersion", null).then((result) {
1758 ResponseDecoder decoder = new ResponseDecoder(null);
1759 return new ServerGetVersionResult.fromJson(decoder, 'result', result);
1760 });
1761 }
1762
1576 /** 1763 /**
1577 * Subscribe for services. All previous subscriptions are replaced by the 1764 * Subscribe for services. All previous subscriptions are replaced by the
1578 * given set of services. 1765 * given set of services.
1579 * 1766 *
1580 * It is an error if any of the elements in the list are not valid services. 1767 * It is an error if any of the elements in the list are not valid services.
1581 * If there is an error, then the current subscriptions will remain 1768 * If there is an error, then the current subscriptions will remain
1582 * unchanged. 1769 * unchanged.
1583 * 1770 *
1584 * Parameters 1771 * Parameters
1585 * 1772 *
1586 * subscriptions ( List<ExecutionService> ) 1773 * subscriptions ( List<ServerService> )
1587 * 1774 *
1588 * A list of the services being subscribed to. 1775 * A list of the services being subscribed to.
1589 */ 1776 */
1590 Future sendExecutionSetSubscriptions(List<ExecutionService> subscriptions) { 1777 Future sendServerSetSubscriptions(List<ServerService> subscriptions) {
1591 var params = new ExecutionSetSubscriptionsParams(subscriptions).toJson(); 1778 var params = new ServerSetSubscriptionsParams(subscriptions).toJson();
1592 return server.send("execution.setSubscriptions", params) 1779 return server.send("server.setSubscriptions", params).then((result) {
1593 .then((result) {
1594 expect(result, isNull); 1780 expect(result, isNull);
1595 return null; 1781 return null;
1596 }); 1782 });
1597 } 1783 }
1598 1784
1599 /** 1785 /**
1600 * Reports information needed to allow a single file to be launched. 1786 * Cleanly shutdown the analysis server. Requests that are received after
1601 * 1787 * this request will not be processed. Requests that were received before
1602 * This notification is not subscribed to by default. Clients can subscribe 1788 * this request, but for which a response has not yet been sent, will not be
1603 * by including the value "LAUNCH_DATA" in the list of services passed in an 1789 * responded to. No further responses or notifications will be sent after the
1604 * execution.setSubscriptions request. 1790 * response to this request has been sent.
1605 *
1606 * Parameters
1607 *
1608 * file ( FilePath )
1609 *
1610 * The file for which launch data is being provided. This will either be a
1611 * Dart library or an HTML file.
1612 *
1613 * kind ( optional ExecutableKind )
1614 *
1615 * The kind of the executable file. This field is omitted if the file is
1616 * not a Dart file.
1617 *
1618 * referencedFiles ( optional List<FilePath> )
1619 *
1620 * A list of the Dart files that are referenced by the file. This field is
1621 * omitted if the file is not an HTML file.
1622 */ 1791 */
1623 Stream<ExecutionLaunchDataParams> onExecutionLaunchData; 1792 Future sendServerShutdown() {
1624 1793 return server.send("server.shutdown", null).then((result) {
1625 /** 1794 expect(result, isNull);
1626 * Stream controller for [onExecutionLaunchData]. 1795 return null;
1627 */ 1796 });
1628 StreamController<ExecutionLaunchDataParams> _onExecutionLaunchData;
1629
1630 /**
1631 * Initialize the fields in InttestMixin, and ensure that notifications will
1632 * be handled.
1633 */
1634 void initializeInttestMixin() {
1635 _onServerConnected = new StreamController<ServerConnectedParams>(sync: true) ;
1636 onServerConnected = _onServerConnected.stream.asBroadcastStream();
1637 _onServerError = new StreamController<ServerErrorParams>(sync: true);
1638 onServerError = _onServerError.stream.asBroadcastStream();
1639 _onServerStatus = new StreamController<ServerStatusParams>(sync: true);
1640 onServerStatus = _onServerStatus.stream.asBroadcastStream();
1641 _onAnalysisAnalyzedFiles = new StreamController<AnalysisAnalyzedFilesParams> (sync: true);
1642 onAnalysisAnalyzedFiles = _onAnalysisAnalyzedFiles.stream.asBroadcastStream( );
1643 _onAnalysisErrors = new StreamController<AnalysisErrorsParams>(sync: true);
1644 onAnalysisErrors = _onAnalysisErrors.stream.asBroadcastStream();
1645 _onAnalysisFlushResults = new StreamController<AnalysisFlushResultsParams>(s ync: true);
1646 onAnalysisFlushResults = _onAnalysisFlushResults.stream.asBroadcastStream();
1647 _onAnalysisFolding = new StreamController<AnalysisFoldingParams>(sync: true) ;
1648 onAnalysisFolding = _onAnalysisFolding.stream.asBroadcastStream();
1649 _onAnalysisHighlights = new StreamController<AnalysisHighlightsParams>(sync: true);
1650 onAnalysisHighlights = _onAnalysisHighlights.stream.asBroadcastStream();
1651 _onAnalysisImplemented = new StreamController<AnalysisImplementedParams>(syn c: true);
1652 onAnalysisImplemented = _onAnalysisImplemented.stream.asBroadcastStream();
1653 _onAnalysisInvalidate = new StreamController<AnalysisInvalidateParams>(sync: true);
1654 onAnalysisInvalidate = _onAnalysisInvalidate.stream.asBroadcastStream();
1655 _onAnalysisNavigation = new StreamController<AnalysisNavigationParams>(sync: true);
1656 onAnalysisNavigation = _onAnalysisNavigation.stream.asBroadcastStream();
1657 _onAnalysisOccurrences = new StreamController<AnalysisOccurrencesParams>(syn c: true);
1658 onAnalysisOccurrences = _onAnalysisOccurrences.stream.asBroadcastStream();
1659 _onAnalysisOutline = new StreamController<AnalysisOutlineParams>(sync: true) ;
1660 onAnalysisOutline = _onAnalysisOutline.stream.asBroadcastStream();
1661 _onAnalysisOverrides = new StreamController<AnalysisOverridesParams>(sync: t rue);
1662 onAnalysisOverrides = _onAnalysisOverrides.stream.asBroadcastStream();
1663 _onCompletionResults = new StreamController<CompletionResultsParams>(sync: t rue);
1664 onCompletionResults = _onCompletionResults.stream.asBroadcastStream();
1665 _onSearchResults = new StreamController<SearchResultsParams>(sync: true);
1666 onSearchResults = _onSearchResults.stream.asBroadcastStream();
1667 _onExecutionLaunchData = new StreamController<ExecutionLaunchDataParams>(syn c: true);
1668 onExecutionLaunchData = _onExecutionLaunchData.stream.asBroadcastStream();
1669 }
1670
1671 /**
1672 * Dispatch the notification named [event], and containing parameters
1673 * [params], to the appropriate stream.
1674 */
1675 void dispatchNotification(String event, params) {
1676 ResponseDecoder decoder = new ResponseDecoder(null);
1677 switch (event) {
1678 case "server.connected":
1679 expect(params, isServerConnectedParams);
1680 _onServerConnected.add(new ServerConnectedParams.fromJson(decoder, 'para ms', params));
1681 break;
1682 case "server.error":
1683 expect(params, isServerErrorParams);
1684 _onServerError.add(new ServerErrorParams.fromJson(decoder, 'params', par ams));
1685 break;
1686 case "server.status":
1687 expect(params, isServerStatusParams);
1688 _onServerStatus.add(new ServerStatusParams.fromJson(decoder, 'params', p arams));
1689 break;
1690 case "analysis.analyzedFiles":
1691 expect(params, isAnalysisAnalyzedFilesParams);
1692 _onAnalysisAnalyzedFiles.add(new AnalysisAnalyzedFilesParams.fromJson(de coder, 'params', params));
1693 break;
1694 case "analysis.errors":
1695 expect(params, isAnalysisErrorsParams);
1696 _onAnalysisErrors.add(new AnalysisErrorsParams.fromJson(decoder, 'params ', params));
1697 break;
1698 case "analysis.flushResults":
1699 expect(params, isAnalysisFlushResultsParams);
1700 _onAnalysisFlushResults.add(new AnalysisFlushResultsParams.fromJson(deco der, 'params', params));
1701 break;
1702 case "analysis.folding":
1703 expect(params, isAnalysisFoldingParams);
1704 _onAnalysisFolding.add(new AnalysisFoldingParams.fromJson(decoder, 'para ms', params));
1705 break;
1706 case "analysis.highlights":
1707 expect(params, isAnalysisHighlightsParams);
1708 _onAnalysisHighlights.add(new AnalysisHighlightsParams.fromJson(decoder, 'params', params));
1709 break;
1710 case "analysis.implemented":
1711 expect(params, isAnalysisImplementedParams);
1712 _onAnalysisImplemented.add(new AnalysisImplementedParams.fromJson(decode r, 'params', params));
1713 break;
1714 case "analysis.invalidate":
1715 expect(params, isAnalysisInvalidateParams);
1716 _onAnalysisInvalidate.add(new AnalysisInvalidateParams.fromJson(decoder, 'params', params));
1717 break;
1718 case "analysis.navigation":
1719 expect(params, isAnalysisNavigationParams);
1720 _onAnalysisNavigation.add(new AnalysisNavigationParams.fromJson(decoder, 'params', params));
1721 break;
1722 case "analysis.occurrences":
1723 expect(params, isAnalysisOccurrencesParams);
1724 _onAnalysisOccurrences.add(new AnalysisOccurrencesParams.fromJson(decode r, 'params', params));
1725 break;
1726 case "analysis.outline":
1727 expect(params, isAnalysisOutlineParams);
1728 _onAnalysisOutline.add(new AnalysisOutlineParams.fromJson(decoder, 'para ms', params));
1729 break;
1730 case "analysis.overrides":
1731 expect(params, isAnalysisOverridesParams);
1732 _onAnalysisOverrides.add(new AnalysisOverridesParams.fromJson(decoder, ' params', params));
1733 break;
1734 case "completion.results":
1735 expect(params, isCompletionResultsParams);
1736 _onCompletionResults.add(new CompletionResultsParams.fromJson(decoder, ' params', params));
1737 break;
1738 case "search.results":
1739 expect(params, isSearchResultsParams);
1740 _onSearchResults.add(new SearchResultsParams.fromJson(decoder, 'params', params));
1741 break;
1742 case "execution.launchData":
1743 expect(params, isExecutionLaunchDataParams);
1744 _onExecutionLaunchData.add(new ExecutionLaunchDataParams.fromJson(decode r, 'params', params));
1745 break;
1746 default:
1747 fail('Unexpected notification: $event');
1748 break;
1749 }
1750 } 1797 }
1751 } 1798 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698