OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | |
2 // for details. All rights reserved. Use of this source code is governed by a | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 // | |
5 // This file has been automatically generated. Please do not edit it manually. | |
6 // To regenerate the file, use the script | |
7 // "pkg/analysis_server/spec/generate_files". | |
8 | |
9 part of protocol2; | |
10 | |
11 /** | |
12 * server.getVersion result | |
13 * | |
14 * { | |
15 * "version": String | |
16 * } | |
17 */ | |
18 class ServerGetVersionResult { | |
19 /** | |
20 * The version number of the analysis server. | |
21 */ | |
22 final String version; | |
23 | |
24 ServerGetVersionResult(this.version); | |
25 | |
26 Map<String, dynamic> toJson() { | |
27 Map<String, dynamic> result = {}; | |
28 result["version"] = version; | |
29 return result; | |
30 } | |
31 | |
32 String toString() => JSON.encode(toJson()); | |
Brian Wilkerson
2014/08/18 14:10:16
It would be nice to add @override annotations wher
Paul Berry
2014/08/18 21:58:02
Done.
| |
33 | |
34 bool operator==(other) { | |
35 if (other is ServerGetVersionResult) { | |
36 return version == other.version; | |
37 } | |
38 return false; | |
39 } | |
40 | |
41 int get hashCode { | |
42 int hash = 0; | |
43 hash = _JenkinsSmiHash.combine(hash, version.hashCode); | |
44 return _JenkinsSmiHash.finish(hash); | |
45 } | |
46 } | |
47 | |
48 /** | |
49 * server.setSubscriptions params | |
50 * | |
51 * { | |
52 * "subscriptions": List<ServerService> | |
53 * } | |
54 */ | |
55 class ServerSetSubscriptionsParams { | |
56 /** | |
57 * A list of the services being subscribed to. | |
58 */ | |
59 final List<ServerService> subscriptions; | |
60 | |
61 ServerSetSubscriptionsParams(this.subscriptions); | |
62 | |
63 Map<String, dynamic> toJson() { | |
64 Map<String, dynamic> result = {}; | |
65 result["subscriptions"] = subscriptions.map((ServerService value) => value.t oJson()); | |
66 return result; | |
67 } | |
68 | |
69 String toString() => JSON.encode(toJson()); | |
70 | |
71 bool operator==(other) { | |
72 if (other is ServerSetSubscriptionsParams) { | |
73 return subscriptions == other.subscriptions; | |
74 } | |
75 return false; | |
76 } | |
77 | |
78 int get hashCode { | |
79 int hash = 0; | |
80 hash = _JenkinsSmiHash.combine(hash, subscriptions.hashCode); | |
81 return _JenkinsSmiHash.finish(hash); | |
82 } | |
83 } | |
84 | |
85 /** | |
86 * server.error params | |
87 * | |
88 * { | |
89 * "fatal": bool | |
90 * "message": String | |
91 * "stackTrace": String | |
92 * } | |
93 */ | |
94 class ServerErrorParams { | |
95 /** | |
96 * True if the error is a fatal error, meaning that the server will shutdown | |
97 * automatically after sending this notification. | |
98 */ | |
99 final bool fatal; | |
100 | |
101 /** | |
102 * The error message indicating what kind of error was encountered. | |
103 */ | |
104 final String message; | |
105 | |
106 /** | |
107 * The stack trace associated with the generation of the error, used for | |
108 * debugging the server. | |
109 */ | |
110 final String stackTrace; | |
111 | |
112 ServerErrorParams(this.fatal, this.message, this.stackTrace); | |
113 | |
114 Map<String, dynamic> toJson() { | |
115 Map<String, dynamic> result = {}; | |
116 result["fatal"] = fatal; | |
117 result["message"] = message; | |
118 result["stackTrace"] = stackTrace; | |
119 return result; | |
120 } | |
121 | |
122 String toString() => JSON.encode(toJson()); | |
123 | |
124 bool operator==(other) { | |
125 if (other is ServerErrorParams) { | |
126 return fatal == other.fatal && | |
127 message == other.message && | |
128 stackTrace == other.stackTrace; | |
129 } | |
130 return false; | |
131 } | |
132 | |
133 int get hashCode { | |
134 int hash = 0; | |
135 hash = _JenkinsSmiHash.combine(hash, fatal.hashCode); | |
136 hash = _JenkinsSmiHash.combine(hash, message.hashCode); | |
137 hash = _JenkinsSmiHash.combine(hash, stackTrace.hashCode); | |
138 return _JenkinsSmiHash.finish(hash); | |
139 } | |
140 } | |
141 | |
142 /** | |
143 * server.status params | |
144 * | |
145 * { | |
146 * "analysis": optional AnalysisStatus | |
147 * } | |
148 */ | |
149 class ServerStatusParams { | |
150 /** | |
151 * The current status of analysis, including whether analysis is being | |
152 * performed and if so what is being analyzed. | |
153 */ | |
154 final AnalysisStatus analysis; | |
155 | |
156 ServerStatusParams({this.analysis}); | |
157 | |
158 Map<String, dynamic> toJson() { | |
159 Map<String, dynamic> result = {}; | |
160 if (analysis != null) { | |
161 result["analysis"] = analysis.toJson(); | |
162 } | |
163 return result; | |
164 } | |
165 | |
166 String toString() => JSON.encode(toJson()); | |
167 | |
168 bool operator==(other) { | |
169 if (other is ServerStatusParams) { | |
170 return analysis == other.analysis; | |
171 } | |
172 return false; | |
173 } | |
174 | |
175 int get hashCode { | |
176 int hash = 0; | |
177 hash = _JenkinsSmiHash.combine(hash, analysis.hashCode); | |
178 return _JenkinsSmiHash.finish(hash); | |
179 } | |
180 } | |
181 | |
182 /** | |
183 * analysis.getErrors params | |
184 * | |
185 * { | |
186 * "file": FilePath | |
187 * } | |
188 */ | |
189 class AnalysisGetErrorsParams { | |
190 /** | |
191 * The file for which errors are being requested. | |
192 */ | |
193 final String file; | |
194 | |
195 AnalysisGetErrorsParams(this.file); | |
196 | |
197 Map<String, dynamic> toJson() { | |
198 Map<String, dynamic> result = {}; | |
199 result["file"] = file; | |
200 return result; | |
201 } | |
202 | |
203 String toString() => JSON.encode(toJson()); | |
204 | |
205 bool operator==(other) { | |
206 if (other is AnalysisGetErrorsParams) { | |
207 return file == other.file; | |
208 } | |
209 return false; | |
210 } | |
211 | |
212 int get hashCode { | |
213 int hash = 0; | |
214 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
215 return _JenkinsSmiHash.finish(hash); | |
216 } | |
217 } | |
218 | |
219 /** | |
220 * analysis.getErrors result | |
221 * | |
222 * { | |
223 * "errors": List<AnalysisError> | |
224 * } | |
225 */ | |
226 class AnalysisGetErrorsResult { | |
227 /** | |
228 * The errors associated with the file. | |
229 */ | |
230 final List<AnalysisError> errors; | |
231 | |
232 AnalysisGetErrorsResult(this.errors); | |
233 | |
234 Map<String, dynamic> toJson() { | |
235 Map<String, dynamic> result = {}; | |
236 result["errors"] = errors.map((AnalysisError value) => value.toJson()); | |
237 return result; | |
238 } | |
239 | |
240 String toString() => JSON.encode(toJson()); | |
241 | |
242 bool operator==(other) { | |
243 if (other is AnalysisGetErrorsResult) { | |
244 return errors == other.errors; | |
245 } | |
246 return false; | |
247 } | |
248 | |
249 int get hashCode { | |
250 int hash = 0; | |
251 hash = _JenkinsSmiHash.combine(hash, errors.hashCode); | |
252 return _JenkinsSmiHash.finish(hash); | |
253 } | |
254 } | |
255 | |
256 /** | |
257 * analysis.getHover params | |
258 * | |
259 * { | |
260 * "file": FilePath | |
261 * "offset": int | |
262 * } | |
263 */ | |
264 class AnalysisGetHoverParams { | |
265 /** | |
266 * The file in which hover information is being requested. | |
267 */ | |
268 final String file; | |
269 | |
270 /** | |
271 * The offset for which hover information is being requested. | |
272 */ | |
273 final int offset; | |
274 | |
275 AnalysisGetHoverParams(this.file, this.offset); | |
276 | |
277 Map<String, dynamic> toJson() { | |
278 Map<String, dynamic> result = {}; | |
279 result["file"] = file; | |
280 result["offset"] = offset; | |
281 return result; | |
282 } | |
283 | |
284 String toString() => JSON.encode(toJson()); | |
285 | |
286 bool operator==(other) { | |
287 if (other is AnalysisGetHoverParams) { | |
288 return file == other.file && | |
289 offset == other.offset; | |
290 } | |
291 return false; | |
292 } | |
293 | |
294 int get hashCode { | |
295 int hash = 0; | |
296 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
297 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
298 return _JenkinsSmiHash.finish(hash); | |
299 } | |
300 } | |
301 | |
302 /** | |
303 * analysis.getHover result | |
304 * | |
305 * { | |
306 * "hovers": List<HoverInformation> | |
307 * } | |
308 */ | |
309 class AnalysisGetHoverResult { | |
310 /** | |
311 * The hover information associated with the location. The list will be empty | |
312 * if no information could be determined for the location. The list can | |
313 * contain multiple items if the file is being analyzed in multiple contexts | |
314 * in conflicting ways (such as a part that is included in multiple | |
315 * libraries). | |
316 */ | |
317 final List<HoverInformation> hovers; | |
318 | |
319 AnalysisGetHoverResult(this.hovers); | |
320 | |
321 Map<String, dynamic> toJson() { | |
322 Map<String, dynamic> result = {}; | |
323 result["hovers"] = hovers.map((HoverInformation value) => value.toJson()); | |
324 return result; | |
325 } | |
326 | |
327 String toString() => JSON.encode(toJson()); | |
328 | |
329 bool operator==(other) { | |
330 if (other is AnalysisGetHoverResult) { | |
331 return hovers == other.hovers; | |
332 } | |
333 return false; | |
334 } | |
335 | |
336 int get hashCode { | |
337 int hash = 0; | |
338 hash = _JenkinsSmiHash.combine(hash, hovers.hashCode); | |
339 return _JenkinsSmiHash.finish(hash); | |
340 } | |
341 } | |
342 | |
343 /** | |
344 * analysis.setAnalysisRoots params | |
345 * | |
346 * { | |
347 * "included": List<FilePath> | |
348 * "excluded": List<FilePath> | |
349 * } | |
350 */ | |
351 class AnalysisSetAnalysisRootsParams { | |
352 /** | |
353 * A list of the files and directories that should be analyzed. | |
354 */ | |
355 final List<String> included; | |
356 | |
357 /** | |
358 * A list of the files and directories within the included directories that | |
359 * should not be analyzed. | |
360 */ | |
361 final List<String> excluded; | |
362 | |
363 AnalysisSetAnalysisRootsParams(this.included, this.excluded); | |
364 | |
365 Map<String, dynamic> toJson() { | |
366 Map<String, dynamic> result = {}; | |
367 result["included"] = included; | |
368 result["excluded"] = excluded; | |
369 return result; | |
370 } | |
371 | |
372 String toString() => JSON.encode(toJson()); | |
373 | |
374 bool operator==(other) { | |
375 if (other is AnalysisSetAnalysisRootsParams) { | |
376 return included == other.included && | |
377 excluded == other.excluded; | |
378 } | |
379 return false; | |
380 } | |
381 | |
382 int get hashCode { | |
383 int hash = 0; | |
384 hash = _JenkinsSmiHash.combine(hash, included.hashCode); | |
385 hash = _JenkinsSmiHash.combine(hash, excluded.hashCode); | |
386 return _JenkinsSmiHash.finish(hash); | |
387 } | |
388 } | |
389 | |
390 /** | |
391 * analysis.setPriorityFiles params | |
392 * | |
393 * { | |
394 * "files": List<FilePath> | |
395 * } | |
396 */ | |
397 class AnalysisSetPriorityFilesParams { | |
398 /** | |
399 * The files that are to be a priority for analysis. | |
400 */ | |
401 final List<String> files; | |
402 | |
403 AnalysisSetPriorityFilesParams(this.files); | |
404 | |
405 Map<String, dynamic> toJson() { | |
406 Map<String, dynamic> result = {}; | |
407 result["files"] = files; | |
408 return result; | |
409 } | |
410 | |
411 String toString() => JSON.encode(toJson()); | |
412 | |
413 bool operator==(other) { | |
414 if (other is AnalysisSetPriorityFilesParams) { | |
415 return files == other.files; | |
416 } | |
417 return false; | |
418 } | |
419 | |
420 int get hashCode { | |
421 int hash = 0; | |
422 hash = _JenkinsSmiHash.combine(hash, files.hashCode); | |
423 return _JenkinsSmiHash.finish(hash); | |
424 } | |
425 } | |
426 | |
427 /** | |
428 * analysis.setSubscriptions params | |
429 * | |
430 * { | |
431 * "subscriptions": Map<AnalysisService, List<FilePath>> | |
432 * } | |
433 */ | |
434 class AnalysisSetSubscriptionsParams { | |
435 /** | |
436 * A table mapping services to a list of the files being subscribed to the | |
437 * service. | |
438 */ | |
439 final Map<AnalysisService, List<String>> subscriptions; | |
440 | |
441 AnalysisSetSubscriptionsParams(this.subscriptions); | |
442 | |
443 Map<String, dynamic> toJson() { | |
444 Map<String, dynamic> result = {}; | |
445 result["subscriptions"] = _mapMap(subscriptions, keyCallback: (AnalysisServi ce value) => value.toJson()); | |
446 return result; | |
447 } | |
448 | |
449 String toString() => JSON.encode(toJson()); | |
450 | |
451 bool operator==(other) { | |
452 if (other is AnalysisSetSubscriptionsParams) { | |
453 return subscriptions == other.subscriptions; | |
454 } | |
455 return false; | |
456 } | |
457 | |
458 int get hashCode { | |
459 int hash = 0; | |
460 hash = _JenkinsSmiHash.combine(hash, subscriptions.hashCode); | |
461 return _JenkinsSmiHash.finish(hash); | |
462 } | |
463 } | |
464 | |
465 /** | |
466 * analysis.updateContent params | |
467 * | |
468 * { | |
469 * "files": Map<FilePath, AddContentOverlay | ChangeContentOverlay | RemoveCon tentOverlay> | |
470 * } | |
471 */ | |
472 class AnalysisUpdateContentParams { | |
473 /** | |
474 * A table mapping the files whose content has changed to a description of | |
475 * the content change. | |
476 */ | |
477 final Map<String, dynamic> files; | |
478 | |
479 AnalysisUpdateContentParams(this.files); | |
480 | |
481 Map<String, dynamic> toJson() { | |
482 Map<String, dynamic> result = {}; | |
483 result["files"] = _mapMap(files, valueCallback: (dynamic value) => value.toJ son()); | |
484 return result; | |
485 } | |
486 | |
487 String toString() => JSON.encode(toJson()); | |
488 | |
489 bool operator==(other) { | |
490 if (other is AnalysisUpdateContentParams) { | |
491 return files == other.files; | |
492 } | |
493 return false; | |
494 } | |
495 | |
496 int get hashCode { | |
497 int hash = 0; | |
498 hash = _JenkinsSmiHash.combine(hash, files.hashCode); | |
499 return _JenkinsSmiHash.finish(hash); | |
500 } | |
501 } | |
502 | |
503 /** | |
504 * analysis.updateOptions params | |
505 * | |
506 * { | |
507 * "options": AnalysisOptions | |
508 * } | |
509 */ | |
510 class AnalysisUpdateOptionsParams { | |
511 /** | |
512 * The options that are to be used to control analysis. | |
513 */ | |
514 final AnalysisOptions options; | |
515 | |
516 AnalysisUpdateOptionsParams(this.options); | |
517 | |
518 Map<String, dynamic> toJson() { | |
519 Map<String, dynamic> result = {}; | |
520 result["options"] = options.toJson(); | |
521 return result; | |
522 } | |
523 | |
524 String toString() => JSON.encode(toJson()); | |
525 | |
526 bool operator==(other) { | |
527 if (other is AnalysisUpdateOptionsParams) { | |
528 return options == other.options; | |
529 } | |
530 return false; | |
531 } | |
532 | |
533 int get hashCode { | |
534 int hash = 0; | |
535 hash = _JenkinsSmiHash.combine(hash, options.hashCode); | |
536 return _JenkinsSmiHash.finish(hash); | |
537 } | |
538 } | |
539 | |
540 /** | |
541 * analysis.errors params | |
542 * | |
543 * { | |
544 * "file": FilePath | |
545 * "errors": List<AnalysisError> | |
546 * } | |
547 */ | |
548 class AnalysisErrorsParams { | |
549 /** | |
550 * The file containing the errors. | |
551 */ | |
552 final String file; | |
553 | |
554 /** | |
555 * The errors contained in the file. | |
556 */ | |
557 final List<AnalysisError> errors; | |
558 | |
559 AnalysisErrorsParams(this.file, this.errors); | |
560 | |
561 Map<String, dynamic> toJson() { | |
562 Map<String, dynamic> result = {}; | |
563 result["file"] = file; | |
564 result["errors"] = errors.map((AnalysisError value) => value.toJson()); | |
565 return result; | |
566 } | |
567 | |
568 String toString() => JSON.encode(toJson()); | |
569 | |
570 bool operator==(other) { | |
571 if (other is AnalysisErrorsParams) { | |
572 return file == other.file && | |
573 errors == other.errors; | |
574 } | |
575 return false; | |
576 } | |
577 | |
578 int get hashCode { | |
579 int hash = 0; | |
580 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
581 hash = _JenkinsSmiHash.combine(hash, errors.hashCode); | |
582 return _JenkinsSmiHash.finish(hash); | |
583 } | |
584 } | |
585 | |
586 /** | |
587 * analysis.flushResults params | |
588 * | |
589 * { | |
590 * "files": List<FilePath> | |
591 * } | |
592 */ | |
593 class AnalysisFlushResultsParams { | |
594 /** | |
595 * The files that are no longer being analyzed. | |
596 */ | |
597 final List<String> files; | |
598 | |
599 AnalysisFlushResultsParams(this.files); | |
600 | |
601 Map<String, dynamic> toJson() { | |
602 Map<String, dynamic> result = {}; | |
603 result["files"] = files; | |
604 return result; | |
605 } | |
606 | |
607 String toString() => JSON.encode(toJson()); | |
608 | |
609 bool operator==(other) { | |
610 if (other is AnalysisFlushResultsParams) { | |
611 return files == other.files; | |
612 } | |
613 return false; | |
614 } | |
615 | |
616 int get hashCode { | |
617 int hash = 0; | |
618 hash = _JenkinsSmiHash.combine(hash, files.hashCode); | |
619 return _JenkinsSmiHash.finish(hash); | |
620 } | |
621 } | |
622 | |
623 /** | |
624 * analysis.folding params | |
625 * | |
626 * { | |
627 * "file": FilePath | |
628 * "regions": List<FoldingRegion> | |
629 * } | |
630 */ | |
631 class AnalysisFoldingParams { | |
632 /** | |
633 * The file containing the folding regions. | |
634 */ | |
635 final String file; | |
636 | |
637 /** | |
638 * The folding regions contained in the file. | |
639 */ | |
640 final List<FoldingRegion> regions; | |
641 | |
642 AnalysisFoldingParams(this.file, this.regions); | |
643 | |
644 Map<String, dynamic> toJson() { | |
645 Map<String, dynamic> result = {}; | |
646 result["file"] = file; | |
647 result["regions"] = regions.map((FoldingRegion value) => value.toJson()); | |
648 return result; | |
649 } | |
650 | |
651 String toString() => JSON.encode(toJson()); | |
652 | |
653 bool operator==(other) { | |
654 if (other is AnalysisFoldingParams) { | |
655 return file == other.file && | |
656 regions == other.regions; | |
657 } | |
658 return false; | |
659 } | |
660 | |
661 int get hashCode { | |
662 int hash = 0; | |
663 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
664 hash = _JenkinsSmiHash.combine(hash, regions.hashCode); | |
665 return _JenkinsSmiHash.finish(hash); | |
666 } | |
667 } | |
668 | |
669 /** | |
670 * analysis.highlights params | |
671 * | |
672 * { | |
673 * "file": FilePath | |
674 * "regions": List<HighlightRegion> | |
675 * } | |
676 */ | |
677 class AnalysisHighlightsParams { | |
678 /** | |
679 * The file containing the highlight regions. | |
680 */ | |
681 final String file; | |
682 | |
683 /** | |
684 * The highlight regions contained in the file. Each highlight region | |
685 * represents a particular syntactic or semantic meaning associated with some | |
686 * range. Note that the highlight regions that are returned can overlap other | |
687 * highlight regions if there is more than one meaning associated with a | |
688 * particular region. | |
689 */ | |
690 final List<HighlightRegion> regions; | |
691 | |
692 AnalysisHighlightsParams(this.file, this.regions); | |
693 | |
694 Map<String, dynamic> toJson() { | |
695 Map<String, dynamic> result = {}; | |
696 result["file"] = file; | |
697 result["regions"] = regions.map((HighlightRegion value) => value.toJson()); | |
698 return result; | |
699 } | |
700 | |
701 String toString() => JSON.encode(toJson()); | |
702 | |
703 bool operator==(other) { | |
704 if (other is AnalysisHighlightsParams) { | |
705 return file == other.file && | |
706 regions == other.regions; | |
707 } | |
708 return false; | |
709 } | |
710 | |
711 int get hashCode { | |
712 int hash = 0; | |
713 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
714 hash = _JenkinsSmiHash.combine(hash, regions.hashCode); | |
715 return _JenkinsSmiHash.finish(hash); | |
716 } | |
717 } | |
718 | |
719 /** | |
720 * analysis.navigation params | |
721 * | |
722 * { | |
723 * "file": FilePath | |
724 * "regions": List<NavigationRegion> | |
725 * } | |
726 */ | |
727 class AnalysisNavigationParams { | |
728 /** | |
729 * The file containing the navigation regions. | |
730 */ | |
731 final String file; | |
732 | |
733 /** | |
734 * The navigation regions contained in the file. Each navigation region | |
735 * represents a list of targets associated with some range. The lists will | |
736 * usually contain a single target, but can contain more in the case of a | |
737 * part that is included in multiple libraries or in Dart code that is | |
738 * compiled against multiple versions of a package. Note that the navigation | |
739 * regions that are returned do not overlap other navigation regions. | |
740 */ | |
741 final List<NavigationRegion> regions; | |
742 | |
743 AnalysisNavigationParams(this.file, this.regions); | |
744 | |
745 Map<String, dynamic> toJson() { | |
746 Map<String, dynamic> result = {}; | |
747 result["file"] = file; | |
748 result["regions"] = regions.map((NavigationRegion value) => value.toJson()); | |
749 return result; | |
750 } | |
751 | |
752 String toString() => JSON.encode(toJson()); | |
753 | |
754 bool operator==(other) { | |
755 if (other is AnalysisNavigationParams) { | |
756 return file == other.file && | |
757 regions == other.regions; | |
758 } | |
759 return false; | |
760 } | |
761 | |
762 int get hashCode { | |
763 int hash = 0; | |
764 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
765 hash = _JenkinsSmiHash.combine(hash, regions.hashCode); | |
766 return _JenkinsSmiHash.finish(hash); | |
767 } | |
768 } | |
769 | |
770 /** | |
771 * analysis.occurrences params | |
772 * | |
773 * { | |
774 * "file": FilePath | |
775 * "occurrences": List<Occurrences> | |
776 * } | |
777 */ | |
778 class AnalysisOccurrencesParams { | |
779 /** | |
780 * The file in which the references occur. | |
781 */ | |
782 final String file; | |
783 | |
784 /** | |
785 * The occurrences of references to elements within the file. | |
786 */ | |
787 final List<Occurrences> occurrences; | |
788 | |
789 AnalysisOccurrencesParams(this.file, this.occurrences); | |
790 | |
791 Map<String, dynamic> toJson() { | |
792 Map<String, dynamic> result = {}; | |
793 result["file"] = file; | |
794 result["occurrences"] = occurrences.map((Occurrences value) => value.toJson( )); | |
795 return result; | |
796 } | |
797 | |
798 String toString() => JSON.encode(toJson()); | |
799 | |
800 bool operator==(other) { | |
801 if (other is AnalysisOccurrencesParams) { | |
802 return file == other.file && | |
803 occurrences == other.occurrences; | |
804 } | |
805 return false; | |
806 } | |
807 | |
808 int get hashCode { | |
809 int hash = 0; | |
810 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
811 hash = _JenkinsSmiHash.combine(hash, occurrences.hashCode); | |
812 return _JenkinsSmiHash.finish(hash); | |
813 } | |
814 } | |
815 | |
816 /** | |
817 * analysis.outline params | |
818 * | |
819 * { | |
820 * "file": FilePath | |
821 * "outline": Outline | |
822 * } | |
823 */ | |
824 class AnalysisOutlineParams { | |
825 /** | |
826 * The file with which the outline is associated. | |
827 */ | |
828 final String file; | |
829 | |
830 /** | |
831 * The outline associated with the file. | |
832 */ | |
833 final Outline outline; | |
834 | |
835 AnalysisOutlineParams(this.file, this.outline); | |
836 | |
837 Map<String, dynamic> toJson() { | |
838 Map<String, dynamic> result = {}; | |
839 result["file"] = file; | |
840 result["outline"] = outline.toJson(); | |
841 return result; | |
842 } | |
843 | |
844 String toString() => JSON.encode(toJson()); | |
845 | |
846 bool operator==(other) { | |
847 if (other is AnalysisOutlineParams) { | |
848 return file == other.file && | |
849 outline == other.outline; | |
850 } | |
851 return false; | |
852 } | |
853 | |
854 int get hashCode { | |
855 int hash = 0; | |
856 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
857 hash = _JenkinsSmiHash.combine(hash, outline.hashCode); | |
858 return _JenkinsSmiHash.finish(hash); | |
859 } | |
860 } | |
861 | |
862 /** | |
863 * analysis.overrides params | |
864 * | |
865 * { | |
866 * "file": FilePath | |
867 * "overrides": List<Override> | |
868 * } | |
869 */ | |
870 class AnalysisOverridesParams { | |
871 /** | |
872 * The file with which the overrides are associated. | |
873 */ | |
874 final String file; | |
875 | |
876 /** | |
877 * The overrides associated with the file. | |
878 */ | |
879 final List<Override> overrides; | |
880 | |
881 AnalysisOverridesParams(this.file, this.overrides); | |
882 | |
883 Map<String, dynamic> toJson() { | |
884 Map<String, dynamic> result = {}; | |
885 result["file"] = file; | |
886 result["overrides"] = overrides.map((Override value) => value.toJson()); | |
887 return result; | |
888 } | |
889 | |
890 String toString() => JSON.encode(toJson()); | |
891 | |
892 bool operator==(other) { | |
893 if (other is AnalysisOverridesParams) { | |
894 return file == other.file && | |
895 overrides == other.overrides; | |
896 } | |
897 return false; | |
898 } | |
899 | |
900 int get hashCode { | |
901 int hash = 0; | |
902 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
903 hash = _JenkinsSmiHash.combine(hash, overrides.hashCode); | |
904 return _JenkinsSmiHash.finish(hash); | |
905 } | |
906 } | |
907 | |
908 /** | |
909 * completion.getSuggestions params | |
910 * | |
911 * { | |
912 * "file": FilePath | |
913 * "offset": int | |
914 * } | |
915 */ | |
916 class CompletionGetSuggestionsParams { | |
917 /** | |
918 * The file containing the point at which suggestions are to be made. | |
919 */ | |
920 final String file; | |
921 | |
922 /** | |
923 * The offset within the file at which suggestions are to be made. | |
924 */ | |
925 final int offset; | |
926 | |
927 CompletionGetSuggestionsParams(this.file, this.offset); | |
928 | |
929 Map<String, dynamic> toJson() { | |
930 Map<String, dynamic> result = {}; | |
931 result["file"] = file; | |
932 result["offset"] = offset; | |
933 return result; | |
934 } | |
935 | |
936 String toString() => JSON.encode(toJson()); | |
937 | |
938 bool operator==(other) { | |
939 if (other is CompletionGetSuggestionsParams) { | |
940 return file == other.file && | |
941 offset == other.offset; | |
942 } | |
943 return false; | |
944 } | |
945 | |
946 int get hashCode { | |
947 int hash = 0; | |
948 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
949 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
950 return _JenkinsSmiHash.finish(hash); | |
951 } | |
952 } | |
953 | |
954 /** | |
955 * completion.getSuggestions result | |
956 * | |
957 * { | |
958 * "id": CompletionId | |
959 * } | |
960 */ | |
961 class CompletionGetSuggestionsResult { | |
962 /** | |
963 * The identifier used to associate results with this completion request. | |
964 */ | |
965 final String id; | |
966 | |
967 CompletionGetSuggestionsResult(this.id); | |
968 | |
969 Map<String, dynamic> toJson() { | |
970 Map<String, dynamic> result = {}; | |
971 result["id"] = id; | |
972 return result; | |
973 } | |
974 | |
975 String toString() => JSON.encode(toJson()); | |
976 | |
977 bool operator==(other) { | |
978 if (other is CompletionGetSuggestionsResult) { | |
979 return id == other.id; | |
980 } | |
981 return false; | |
982 } | |
983 | |
984 int get hashCode { | |
985 int hash = 0; | |
986 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
987 return _JenkinsSmiHash.finish(hash); | |
988 } | |
989 } | |
990 | |
991 /** | |
992 * completion.results params | |
993 * | |
994 * { | |
995 * "id": CompletionId | |
996 * "replacementOffset": int | |
997 * "replacementLength": int | |
998 * "results": List<CompletionSuggestion> | |
999 * "last": bool | |
1000 * } | |
1001 */ | |
1002 class CompletionResultsParams { | |
1003 /** | |
1004 * The id associated with the completion. | |
1005 */ | |
1006 final String id; | |
1007 | |
1008 /** | |
1009 * The offset of the start of the text to be replaced. This will be different | |
1010 * than the offset used to request the completion suggestions if there was a | |
1011 * portion of an identifier before the original offset. In particular, the | |
1012 * replacementOffset will be the offset of the beginning of said identifier. | |
1013 */ | |
1014 final int replacementOffset; | |
1015 | |
1016 /** | |
1017 * The length of the text to be replaced if the remainder of the identifier | |
1018 * containing the cursor is to be replaced when the suggestion is applied | |
1019 * (that is, the number of characters in the existing identifier). | |
1020 */ | |
1021 final int replacementLength; | |
1022 | |
1023 /** | |
1024 * The completion suggestions being reported. The notification contains all | |
1025 * possible completions at the requested cursor position, even those that do | |
1026 * not match the characters the user has already typed. This allows the | |
1027 * client to respond to further keystrokes from the user without having to | |
1028 * make additional requests. | |
1029 */ | |
1030 final List<CompletionSuggestion> results; | |
1031 | |
1032 /** | |
1033 * True if this is that last set of results that will be returned for the | |
1034 * indicated completion. | |
1035 */ | |
1036 final bool last; | |
1037 | |
1038 CompletionResultsParams(this.id, this.replacementOffset, this.replacementLengt h, this.results, this.last); | |
1039 | |
1040 Map<String, dynamic> toJson() { | |
1041 Map<String, dynamic> result = {}; | |
1042 result["id"] = id; | |
1043 result["replacementOffset"] = replacementOffset; | |
1044 result["replacementLength"] = replacementLength; | |
1045 result["results"] = results.map((CompletionSuggestion value) => value.toJson ()); | |
1046 result["last"] = last; | |
1047 return result; | |
1048 } | |
1049 | |
1050 String toString() => JSON.encode(toJson()); | |
1051 | |
1052 bool operator==(other) { | |
1053 if (other is CompletionResultsParams) { | |
1054 return id == other.id && | |
1055 replacementOffset == other.replacementOffset && | |
1056 replacementLength == other.replacementLength && | |
1057 results == other.results && | |
1058 last == other.last; | |
1059 } | |
1060 return false; | |
1061 } | |
1062 | |
1063 int get hashCode { | |
1064 int hash = 0; | |
1065 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
1066 hash = _JenkinsSmiHash.combine(hash, replacementOffset.hashCode); | |
1067 hash = _JenkinsSmiHash.combine(hash, replacementLength.hashCode); | |
1068 hash = _JenkinsSmiHash.combine(hash, results.hashCode); | |
1069 hash = _JenkinsSmiHash.combine(hash, last.hashCode); | |
1070 return _JenkinsSmiHash.finish(hash); | |
1071 } | |
1072 } | |
1073 | |
1074 /** | |
1075 * search.findElementReferences params | |
1076 * | |
1077 * { | |
1078 * "file": FilePath | |
1079 * "offset": int | |
1080 * "includePotential": bool | |
1081 * } | |
1082 */ | |
1083 class SearchFindElementReferencesParams { | |
1084 /** | |
1085 * The file containing the declaration of or reference to the element used to | |
1086 * define the search. | |
1087 */ | |
1088 final String file; | |
1089 | |
1090 /** | |
1091 * The offset within the file of the declaration of or reference to the | |
1092 * element. | |
1093 */ | |
1094 final int offset; | |
1095 | |
1096 /** | |
1097 * True if potential matches are to be included in the results. | |
1098 */ | |
1099 final bool includePotential; | |
1100 | |
1101 SearchFindElementReferencesParams(this.file, this.offset, this.includePotentia l); | |
1102 | |
1103 Map<String, dynamic> toJson() { | |
1104 Map<String, dynamic> result = {}; | |
1105 result["file"] = file; | |
1106 result["offset"] = offset; | |
1107 result["includePotential"] = includePotential; | |
1108 return result; | |
1109 } | |
1110 | |
1111 String toString() => JSON.encode(toJson()); | |
1112 | |
1113 bool operator==(other) { | |
1114 if (other is SearchFindElementReferencesParams) { | |
1115 return file == other.file && | |
1116 offset == other.offset && | |
1117 includePotential == other.includePotential; | |
1118 } | |
1119 return false; | |
1120 } | |
1121 | |
1122 int get hashCode { | |
1123 int hash = 0; | |
1124 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
1125 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
1126 hash = _JenkinsSmiHash.combine(hash, includePotential.hashCode); | |
1127 return _JenkinsSmiHash.finish(hash); | |
1128 } | |
1129 } | |
1130 | |
1131 /** | |
1132 * search.findElementReferences result | |
1133 * | |
1134 * { | |
1135 * "id": SearchId | |
1136 * "element": Element | |
1137 * } | |
1138 */ | |
1139 class SearchFindElementReferencesResult { | |
1140 /** | |
1141 * The identifier used to associate results with this search request. | |
1142 */ | |
1143 final String id; | |
1144 | |
1145 /** | |
1146 * The element referenced or defined at the given offset and whose references | |
1147 * will be returned in the search results. | |
1148 */ | |
1149 final Element element; | |
1150 | |
1151 SearchFindElementReferencesResult(this.id, this.element); | |
1152 | |
1153 Map<String, dynamic> toJson() { | |
1154 Map<String, dynamic> result = {}; | |
1155 result["id"] = id; | |
1156 result["element"] = element.toJson(); | |
1157 return result; | |
1158 } | |
1159 | |
1160 String toString() => JSON.encode(toJson()); | |
1161 | |
1162 bool operator==(other) { | |
1163 if (other is SearchFindElementReferencesResult) { | |
1164 return id == other.id && | |
1165 element == other.element; | |
1166 } | |
1167 return false; | |
1168 } | |
1169 | |
1170 int get hashCode { | |
1171 int hash = 0; | |
1172 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
1173 hash = _JenkinsSmiHash.combine(hash, element.hashCode); | |
1174 return _JenkinsSmiHash.finish(hash); | |
1175 } | |
1176 } | |
1177 | |
1178 /** | |
1179 * search.findMemberDeclarations params | |
1180 * | |
1181 * { | |
1182 * "name": String | |
1183 * } | |
1184 */ | |
1185 class SearchFindMemberDeclarationsParams { | |
1186 /** | |
1187 * The name of the declarations to be found. | |
1188 */ | |
1189 final String name; | |
1190 | |
1191 SearchFindMemberDeclarationsParams(this.name); | |
1192 | |
1193 Map<String, dynamic> toJson() { | |
1194 Map<String, dynamic> result = {}; | |
1195 result["name"] = name; | |
1196 return result; | |
1197 } | |
1198 | |
1199 String toString() => JSON.encode(toJson()); | |
1200 | |
1201 bool operator==(other) { | |
1202 if (other is SearchFindMemberDeclarationsParams) { | |
1203 return name == other.name; | |
1204 } | |
1205 return false; | |
1206 } | |
1207 | |
1208 int get hashCode { | |
1209 int hash = 0; | |
1210 hash = _JenkinsSmiHash.combine(hash, name.hashCode); | |
1211 return _JenkinsSmiHash.finish(hash); | |
1212 } | |
1213 } | |
1214 | |
1215 /** | |
1216 * search.findMemberDeclarations result | |
1217 * | |
1218 * { | |
1219 * "id": SearchId | |
1220 * } | |
1221 */ | |
1222 class SearchFindMemberDeclarationsResult { | |
1223 /** | |
1224 * The identifier used to associate results with this search request. | |
1225 */ | |
1226 final String id; | |
1227 | |
1228 SearchFindMemberDeclarationsResult(this.id); | |
1229 | |
1230 Map<String, dynamic> toJson() { | |
1231 Map<String, dynamic> result = {}; | |
1232 result["id"] = id; | |
1233 return result; | |
1234 } | |
1235 | |
1236 String toString() => JSON.encode(toJson()); | |
1237 | |
1238 bool operator==(other) { | |
1239 if (other is SearchFindMemberDeclarationsResult) { | |
1240 return id == other.id; | |
1241 } | |
1242 return false; | |
1243 } | |
1244 | |
1245 int get hashCode { | |
1246 int hash = 0; | |
1247 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
1248 return _JenkinsSmiHash.finish(hash); | |
1249 } | |
1250 } | |
1251 | |
1252 /** | |
1253 * search.findMemberReferences params | |
1254 * | |
1255 * { | |
1256 * "name": String | |
1257 * } | |
1258 */ | |
1259 class SearchFindMemberReferencesParams { | |
1260 /** | |
1261 * The name of the references to be found. | |
1262 */ | |
1263 final String name; | |
1264 | |
1265 SearchFindMemberReferencesParams(this.name); | |
1266 | |
1267 Map<String, dynamic> toJson() { | |
1268 Map<String, dynamic> result = {}; | |
1269 result["name"] = name; | |
1270 return result; | |
1271 } | |
1272 | |
1273 String toString() => JSON.encode(toJson()); | |
1274 | |
1275 bool operator==(other) { | |
1276 if (other is SearchFindMemberReferencesParams) { | |
1277 return name == other.name; | |
1278 } | |
1279 return false; | |
1280 } | |
1281 | |
1282 int get hashCode { | |
1283 int hash = 0; | |
1284 hash = _JenkinsSmiHash.combine(hash, name.hashCode); | |
1285 return _JenkinsSmiHash.finish(hash); | |
1286 } | |
1287 } | |
1288 | |
1289 /** | |
1290 * search.findMemberReferences result | |
1291 * | |
1292 * { | |
1293 * "id": SearchId | |
1294 * } | |
1295 */ | |
1296 class SearchFindMemberReferencesResult { | |
1297 /** | |
1298 * The identifier used to associate results with this search request. | |
1299 */ | |
1300 final String id; | |
1301 | |
1302 SearchFindMemberReferencesResult(this.id); | |
1303 | |
1304 Map<String, dynamic> toJson() { | |
1305 Map<String, dynamic> result = {}; | |
1306 result["id"] = id; | |
1307 return result; | |
1308 } | |
1309 | |
1310 String toString() => JSON.encode(toJson()); | |
1311 | |
1312 bool operator==(other) { | |
1313 if (other is SearchFindMemberReferencesResult) { | |
1314 return id == other.id; | |
1315 } | |
1316 return false; | |
1317 } | |
1318 | |
1319 int get hashCode { | |
1320 int hash = 0; | |
1321 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
1322 return _JenkinsSmiHash.finish(hash); | |
1323 } | |
1324 } | |
1325 | |
1326 /** | |
1327 * search.findTopLevelDeclarations params | |
1328 * | |
1329 * { | |
1330 * "pattern": String | |
1331 * } | |
1332 */ | |
1333 class SearchFindTopLevelDeclarationsParams { | |
1334 /** | |
1335 * The regular expression used to match the names of the declarations to be | |
1336 * found. | |
1337 */ | |
1338 final String pattern; | |
1339 | |
1340 SearchFindTopLevelDeclarationsParams(this.pattern); | |
1341 | |
1342 Map<String, dynamic> toJson() { | |
1343 Map<String, dynamic> result = {}; | |
1344 result["pattern"] = pattern; | |
1345 return result; | |
1346 } | |
1347 | |
1348 String toString() => JSON.encode(toJson()); | |
1349 | |
1350 bool operator==(other) { | |
1351 if (other is SearchFindTopLevelDeclarationsParams) { | |
1352 return pattern == other.pattern; | |
1353 } | |
1354 return false; | |
1355 } | |
1356 | |
1357 int get hashCode { | |
1358 int hash = 0; | |
1359 hash = _JenkinsSmiHash.combine(hash, pattern.hashCode); | |
1360 return _JenkinsSmiHash.finish(hash); | |
1361 } | |
1362 } | |
1363 | |
1364 /** | |
1365 * search.findTopLevelDeclarations result | |
1366 * | |
1367 * { | |
1368 * "id": SearchId | |
1369 * } | |
1370 */ | |
1371 class SearchFindTopLevelDeclarationsResult { | |
1372 /** | |
1373 * The identifier used to associate results with this search request. | |
1374 */ | |
1375 final String id; | |
1376 | |
1377 SearchFindTopLevelDeclarationsResult(this.id); | |
1378 | |
1379 Map<String, dynamic> toJson() { | |
1380 Map<String, dynamic> result = {}; | |
1381 result["id"] = id; | |
1382 return result; | |
1383 } | |
1384 | |
1385 String toString() => JSON.encode(toJson()); | |
1386 | |
1387 bool operator==(other) { | |
1388 if (other is SearchFindTopLevelDeclarationsResult) { | |
1389 return id == other.id; | |
1390 } | |
1391 return false; | |
1392 } | |
1393 | |
1394 int get hashCode { | |
1395 int hash = 0; | |
1396 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
1397 return _JenkinsSmiHash.finish(hash); | |
1398 } | |
1399 } | |
1400 | |
1401 /** | |
1402 * search.getTypeHierarchy params | |
1403 * | |
1404 * { | |
1405 * "file": FilePath | |
1406 * "offset": int | |
1407 * } | |
1408 */ | |
1409 class SearchGetTypeHierarchyParams { | |
1410 /** | |
1411 * The file containing the declaration or reference to the type for which a | |
1412 * hierarchy is being requested. | |
1413 */ | |
1414 final String file; | |
1415 | |
1416 /** | |
1417 * The offset of the name of the type within the file. | |
1418 */ | |
1419 final int offset; | |
1420 | |
1421 SearchGetTypeHierarchyParams(this.file, this.offset); | |
1422 | |
1423 Map<String, dynamic> toJson() { | |
1424 Map<String, dynamic> result = {}; | |
1425 result["file"] = file; | |
1426 result["offset"] = offset; | |
1427 return result; | |
1428 } | |
1429 | |
1430 String toString() => JSON.encode(toJson()); | |
1431 | |
1432 bool operator==(other) { | |
1433 if (other is SearchGetTypeHierarchyParams) { | |
1434 return file == other.file && | |
1435 offset == other.offset; | |
1436 } | |
1437 return false; | |
1438 } | |
1439 | |
1440 int get hashCode { | |
1441 int hash = 0; | |
1442 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
1443 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
1444 return _JenkinsSmiHash.finish(hash); | |
1445 } | |
1446 } | |
1447 | |
1448 /** | |
1449 * search.getTypeHierarchy result | |
1450 * | |
1451 * { | |
1452 * "hierarchyItems": optional List<TypeHierarchyItem> | |
1453 * } | |
1454 */ | |
1455 class SearchGetTypeHierarchyResult { | |
1456 /** | |
1457 * A list of the types in the requested hierarchy. The first element of the | |
1458 * list is the item representing the type for which the hierarchy was | |
1459 * requested. The index of other elements of the list is unspecified, but | |
1460 * correspond to the integers used to reference supertype and subtype items | |
1461 * within the items. | |
1462 * | |
1463 * This field will be absent if the code at the given file and offset does | |
1464 * not represent a type, or if the file has not been sufficiently analyzed to | |
1465 * allow a type hierarchy to be produced. | |
1466 */ | |
1467 final List<TypeHierarchyItem> hierarchyItems; | |
1468 | |
1469 SearchGetTypeHierarchyResult({this.hierarchyItems}); | |
1470 | |
1471 Map<String, dynamic> toJson() { | |
1472 Map<String, dynamic> result = {}; | |
1473 if (hierarchyItems != null) { | |
1474 result["hierarchyItems"] = hierarchyItems.map((TypeHierarchyItem value) => value.toJson()); | |
1475 } | |
1476 return result; | |
1477 } | |
1478 | |
1479 String toString() => JSON.encode(toJson()); | |
1480 | |
1481 bool operator==(other) { | |
1482 if (other is SearchGetTypeHierarchyResult) { | |
1483 return hierarchyItems == other.hierarchyItems; | |
1484 } | |
1485 return false; | |
1486 } | |
1487 | |
1488 int get hashCode { | |
1489 int hash = 0; | |
1490 hash = _JenkinsSmiHash.combine(hash, hierarchyItems.hashCode); | |
1491 return _JenkinsSmiHash.finish(hash); | |
1492 } | |
1493 } | |
1494 | |
1495 /** | |
1496 * search.results params | |
1497 * | |
1498 * { | |
1499 * "id": SearchId | |
1500 * "results": List<SearchResult> | |
1501 * "last": bool | |
1502 * } | |
1503 */ | |
1504 class SearchResultsParams { | |
1505 /** | |
1506 * The id associated with the search. | |
1507 */ | |
1508 final String id; | |
1509 | |
1510 /** | |
1511 * The search results being reported. | |
1512 */ | |
1513 final List<SearchResult> results; | |
1514 | |
1515 /** | |
1516 * True if this is that last set of results that will be returned for the | |
1517 * indicated search. | |
1518 */ | |
1519 final bool last; | |
1520 | |
1521 SearchResultsParams(this.id, this.results, this.last); | |
1522 | |
1523 Map<String, dynamic> toJson() { | |
1524 Map<String, dynamic> result = {}; | |
1525 result["id"] = id; | |
1526 result["results"] = results.map((SearchResult value) => value.toJson()); | |
1527 result["last"] = last; | |
1528 return result; | |
1529 } | |
1530 | |
1531 String toString() => JSON.encode(toJson()); | |
1532 | |
1533 bool operator==(other) { | |
1534 if (other is SearchResultsParams) { | |
1535 return id == other.id && | |
1536 results == other.results && | |
1537 last == other.last; | |
1538 } | |
1539 return false; | |
1540 } | |
1541 | |
1542 int get hashCode { | |
1543 int hash = 0; | |
1544 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
1545 hash = _JenkinsSmiHash.combine(hash, results.hashCode); | |
1546 hash = _JenkinsSmiHash.combine(hash, last.hashCode); | |
1547 return _JenkinsSmiHash.finish(hash); | |
1548 } | |
1549 } | |
1550 | |
1551 /** | |
1552 * edit.getAssists params | |
1553 * | |
1554 * { | |
1555 * "file": FilePath | |
1556 * "offset": int | |
1557 * "length": int | |
1558 * } | |
1559 */ | |
1560 class EditGetAssistsParams { | |
1561 /** | |
1562 * The file containing the code for which assists are being requested. | |
1563 */ | |
1564 final String file; | |
1565 | |
1566 /** | |
1567 * The offset of the code for which assists are being requested. | |
1568 */ | |
1569 final int offset; | |
1570 | |
1571 /** | |
1572 * The length of the code for which assists are being requested. | |
1573 */ | |
1574 final int length; | |
1575 | |
1576 EditGetAssistsParams(this.file, this.offset, this.length); | |
1577 | |
1578 Map<String, dynamic> toJson() { | |
1579 Map<String, dynamic> result = {}; | |
1580 result["file"] = file; | |
1581 result["offset"] = offset; | |
1582 result["length"] = length; | |
1583 return result; | |
1584 } | |
1585 | |
1586 String toString() => JSON.encode(toJson()); | |
1587 | |
1588 bool operator==(other) { | |
1589 if (other is EditGetAssistsParams) { | |
1590 return file == other.file && | |
1591 offset == other.offset && | |
1592 length == other.length; | |
1593 } | |
1594 return false; | |
1595 } | |
1596 | |
1597 int get hashCode { | |
1598 int hash = 0; | |
1599 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
1600 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
1601 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
1602 return _JenkinsSmiHash.finish(hash); | |
1603 } | |
1604 } | |
1605 | |
1606 /** | |
1607 * edit.getAssists result | |
1608 * | |
1609 * { | |
1610 * "assists": List<SourceChange> | |
1611 * } | |
1612 */ | |
1613 class EditGetAssistsResult { | |
1614 /** | |
1615 * The assists that are available at the given location. | |
1616 */ | |
1617 final List<SourceChange> assists; | |
1618 | |
1619 EditGetAssistsResult(this.assists); | |
1620 | |
1621 Map<String, dynamic> toJson() { | |
1622 Map<String, dynamic> result = {}; | |
1623 result["assists"] = assists.map((SourceChange value) => value.toJson()); | |
1624 return result; | |
1625 } | |
1626 | |
1627 String toString() => JSON.encode(toJson()); | |
1628 | |
1629 bool operator==(other) { | |
1630 if (other is EditGetAssistsResult) { | |
1631 return assists == other.assists; | |
1632 } | |
1633 return false; | |
1634 } | |
1635 | |
1636 int get hashCode { | |
1637 int hash = 0; | |
1638 hash = _JenkinsSmiHash.combine(hash, assists.hashCode); | |
1639 return _JenkinsSmiHash.finish(hash); | |
1640 } | |
1641 } | |
1642 | |
1643 /** | |
1644 * edit.getAvailableRefactorings params | |
1645 * | |
1646 * { | |
1647 * "file": FilePath | |
1648 * "offset": int | |
1649 * "length": int | |
1650 * } | |
1651 */ | |
1652 class EditGetAvailableRefactoringsParams { | |
1653 /** | |
1654 * The file containing the code on which the refactoring would be based. | |
1655 */ | |
1656 final String file; | |
1657 | |
1658 /** | |
1659 * The offset of the code on which the refactoring would be based. | |
1660 */ | |
1661 final int offset; | |
1662 | |
1663 /** | |
1664 * The length of the code on which the refactoring would be based. | |
1665 */ | |
1666 final int length; | |
1667 | |
1668 EditGetAvailableRefactoringsParams(this.file, this.offset, this.length); | |
1669 | |
1670 Map<String, dynamic> toJson() { | |
1671 Map<String, dynamic> result = {}; | |
1672 result["file"] = file; | |
1673 result["offset"] = offset; | |
1674 result["length"] = length; | |
1675 return result; | |
1676 } | |
1677 | |
1678 String toString() => JSON.encode(toJson()); | |
1679 | |
1680 bool operator==(other) { | |
1681 if (other is EditGetAvailableRefactoringsParams) { | |
1682 return file == other.file && | |
1683 offset == other.offset && | |
1684 length == other.length; | |
1685 } | |
1686 return false; | |
1687 } | |
1688 | |
1689 int get hashCode { | |
1690 int hash = 0; | |
1691 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
1692 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
1693 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
1694 return _JenkinsSmiHash.finish(hash); | |
1695 } | |
1696 } | |
1697 | |
1698 /** | |
1699 * edit.getAvailableRefactorings result | |
1700 * | |
1701 * { | |
1702 * "kinds": List<RefactoringKind> | |
1703 * } | |
1704 */ | |
1705 class EditGetAvailableRefactoringsResult { | |
1706 /** | |
1707 * The kinds of refactorings that are valid for the given selection. | |
1708 */ | |
1709 final List<RefactoringKind> kinds; | |
1710 | |
1711 EditGetAvailableRefactoringsResult(this.kinds); | |
1712 | |
1713 Map<String, dynamic> toJson() { | |
1714 Map<String, dynamic> result = {}; | |
1715 result["kinds"] = kinds.map((RefactoringKind value) => value.toJson()); | |
1716 return result; | |
1717 } | |
1718 | |
1719 String toString() => JSON.encode(toJson()); | |
1720 | |
1721 bool operator==(other) { | |
1722 if (other is EditGetAvailableRefactoringsResult) { | |
1723 return kinds == other.kinds; | |
1724 } | |
1725 return false; | |
1726 } | |
1727 | |
1728 int get hashCode { | |
1729 int hash = 0; | |
1730 hash = _JenkinsSmiHash.combine(hash, kinds.hashCode); | |
1731 return _JenkinsSmiHash.finish(hash); | |
1732 } | |
1733 } | |
1734 | |
1735 /** | |
1736 * edit.getFixes params | |
1737 * | |
1738 * { | |
1739 * "file": FilePath | |
1740 * "offset": int | |
1741 * } | |
1742 */ | |
1743 class EditGetFixesParams { | |
1744 /** | |
1745 * The file containing the errors for which fixes are being requested. | |
1746 */ | |
1747 final String file; | |
1748 | |
1749 /** | |
1750 * The offset used to select the errors for which fixes will be returned. | |
1751 */ | |
1752 final int offset; | |
1753 | |
1754 EditGetFixesParams(this.file, this.offset); | |
1755 | |
1756 Map<String, dynamic> toJson() { | |
1757 Map<String, dynamic> result = {}; | |
1758 result["file"] = file; | |
1759 result["offset"] = offset; | |
1760 return result; | |
1761 } | |
1762 | |
1763 String toString() => JSON.encode(toJson()); | |
1764 | |
1765 bool operator==(other) { | |
1766 if (other is EditGetFixesParams) { | |
1767 return file == other.file && | |
1768 offset == other.offset; | |
1769 } | |
1770 return false; | |
1771 } | |
1772 | |
1773 int get hashCode { | |
1774 int hash = 0; | |
1775 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
1776 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
1777 return _JenkinsSmiHash.finish(hash); | |
1778 } | |
1779 } | |
1780 | |
1781 /** | |
1782 * edit.getFixes result | |
1783 * | |
1784 * { | |
1785 * "fixes": List<ErrorFixes> | |
1786 * } | |
1787 */ | |
1788 class EditGetFixesResult { | |
1789 /** | |
1790 * The fixes that are available for each of the analysis errors. There is a | |
1791 * one-to-one correspondence between the analysis errors in the request and | |
1792 * the lists of changes in the response. In particular, it is always the case | |
1793 * that errors.length == fixes.length and that fixes[i] is the list of fixes | |
1794 * for the error in errors[i]. The list of changes corresponding to an error | |
1795 * can be empty if there are no fixes available for that error. | |
1796 */ | |
1797 final List<ErrorFixes> fixes; | |
1798 | |
1799 EditGetFixesResult(this.fixes); | |
1800 | |
1801 Map<String, dynamic> toJson() { | |
1802 Map<String, dynamic> result = {}; | |
1803 result["fixes"] = fixes.map((ErrorFixes value) => value.toJson()); | |
1804 return result; | |
1805 } | |
1806 | |
1807 String toString() => JSON.encode(toJson()); | |
1808 | |
1809 bool operator==(other) { | |
1810 if (other is EditGetFixesResult) { | |
1811 return fixes == other.fixes; | |
1812 } | |
1813 return false; | |
1814 } | |
1815 | |
1816 int get hashCode { | |
1817 int hash = 0; | |
1818 hash = _JenkinsSmiHash.combine(hash, fixes.hashCode); | |
1819 return _JenkinsSmiHash.finish(hash); | |
1820 } | |
1821 } | |
1822 | |
1823 /** | |
1824 * edit.getRefactoring params | |
1825 * | |
1826 * { | |
1827 * "kindId": RefactoringKind | |
1828 * "file": FilePath | |
1829 * "offset": int | |
1830 * "length": int | |
1831 * "validateOnly": bool | |
1832 * "options": optional object | |
1833 * } | |
1834 */ | |
1835 class EditGetRefactoringParams { | |
1836 /** | |
1837 * The identifier of the kind of refactoring to be performed. | |
1838 */ | |
1839 final RefactoringKind kindId; | |
1840 | |
1841 /** | |
1842 * The file containing the code involved in the refactoring. | |
1843 */ | |
1844 final String file; | |
1845 | |
1846 /** | |
1847 * The offset of the region involved in the refactoring. | |
1848 */ | |
1849 final int offset; | |
1850 | |
1851 /** | |
1852 * The length of the region involved in the refactoring. | |
1853 */ | |
1854 final int length; | |
1855 | |
1856 /** | |
1857 * True if the client is only requesting that the values of the options be | |
1858 * validated and no change be generated. | |
1859 */ | |
1860 final bool validateOnly; | |
1861 | |
1862 /** | |
1863 * Data used to provide values provided by the user. The structure of the | |
1864 * data is dependent on the kind of refactoring being performed. The data | |
1865 * that is expected is documented in the section titled Refactorings, labeled | |
1866 * as “Options”. This field can be omitted if the refactoring does not | |
1867 * require any options or if the values of those options are not known. | |
1868 */ | |
1869 final Object options; | |
1870 | |
1871 EditGetRefactoringParams(this.kindId, this.file, this.offset, this.length, thi s.validateOnly, {this.options}); | |
1872 | |
1873 Map<String, dynamic> toJson() { | |
1874 Map<String, dynamic> result = {}; | |
1875 result["kindId"] = kindId.toJson(); | |
1876 result["file"] = file; | |
1877 result["offset"] = offset; | |
1878 result["length"] = length; | |
1879 result["validateOnly"] = validateOnly; | |
1880 if (options != null) { | |
1881 result["options"] = options; | |
1882 } | |
1883 return result; | |
1884 } | |
1885 | |
1886 String toString() => JSON.encode(toJson()); | |
1887 | |
1888 bool operator==(other) { | |
1889 if (other is EditGetRefactoringParams) { | |
1890 return kindId == other.kindId && | |
1891 file == other.file && | |
1892 offset == other.offset && | |
1893 length == other.length && | |
1894 validateOnly == other.validateOnly && | |
1895 options == other.options; | |
1896 } | |
1897 return false; | |
1898 } | |
1899 | |
1900 int get hashCode { | |
1901 int hash = 0; | |
1902 hash = _JenkinsSmiHash.combine(hash, kindId.hashCode); | |
1903 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
1904 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
1905 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
1906 hash = _JenkinsSmiHash.combine(hash, validateOnly.hashCode); | |
1907 hash = _JenkinsSmiHash.combine(hash, options.hashCode); | |
1908 return _JenkinsSmiHash.finish(hash); | |
1909 } | |
1910 } | |
1911 | |
1912 /** | |
1913 * edit.getRefactoring result | |
1914 * | |
1915 * { | |
1916 * "status": List<RefactoringProblem> | |
1917 * "feedback": optional object | |
1918 * "change": optional SourceChange | |
1919 * "potentialEdits": optional List<String> | |
1920 * } | |
1921 */ | |
1922 class EditGetRefactoringResult { | |
1923 /** | |
1924 * The status of the refactoring. The array will be empty if there are no | |
1925 * known problems. | |
1926 */ | |
1927 final List<RefactoringProblem> status; | |
1928 | |
1929 /** | |
1930 * Data used to provide feedback to the user. The structure of the data is | |
1931 * dependent on the kind of refactoring being created. The data that is | |
1932 * returned is documented in the section titled Refactorings, labeled as | |
1933 * “Feedback”. | |
1934 */ | |
1935 final Object feedback; | |
1936 | |
1937 /** | |
1938 * The changes that are to be applied to affect the refactoring. This field | |
1939 * will be omitted if there are problems that prevent a set of changes from | |
1940 * being computed, such as having no options specified for a refactoring that | |
1941 * requires them, or if only validation was requested. | |
1942 */ | |
1943 final SourceChange change; | |
1944 | |
1945 /** | |
1946 * The ids of source edits that are not known to be valid. An edit is not | |
1947 * known to be valid if there was insufficient type information for the | |
1948 * server to be able to determine whether or not the code needs to be | |
1949 * modified, such as when a member is being renamed and there is a reference | |
1950 * to a member from an unknown type. This field will be omitted if the change | |
1951 * field is omitted or if there are no potential edits for the refactoring. | |
1952 */ | |
1953 final List<String> potentialEdits; | |
1954 | |
1955 EditGetRefactoringResult(this.status, {this.feedback, this.change, this.potent ialEdits}); | |
1956 | |
1957 Map<String, dynamic> toJson() { | |
1958 Map<String, dynamic> result = {}; | |
1959 result["status"] = status.map((RefactoringProblem value) => value.toJson()); | |
1960 if (feedback != null) { | |
1961 result["feedback"] = feedback; | |
1962 } | |
1963 if (change != null) { | |
1964 result["change"] = change.toJson(); | |
1965 } | |
1966 if (potentialEdits != null) { | |
1967 result["potentialEdits"] = potentialEdits; | |
1968 } | |
1969 return result; | |
1970 } | |
1971 | |
1972 String toString() => JSON.encode(toJson()); | |
1973 | |
1974 bool operator==(other) { | |
1975 if (other is EditGetRefactoringResult) { | |
1976 return status == other.status && | |
1977 feedback == other.feedback && | |
1978 change == other.change && | |
1979 potentialEdits == other.potentialEdits; | |
1980 } | |
1981 return false; | |
1982 } | |
1983 | |
1984 int get hashCode { | |
1985 int hash = 0; | |
1986 hash = _JenkinsSmiHash.combine(hash, status.hashCode); | |
1987 hash = _JenkinsSmiHash.combine(hash, feedback.hashCode); | |
1988 hash = _JenkinsSmiHash.combine(hash, change.hashCode); | |
1989 hash = _JenkinsSmiHash.combine(hash, potentialEdits.hashCode); | |
1990 return _JenkinsSmiHash.finish(hash); | |
1991 } | |
1992 } | |
1993 | |
1994 /** | |
1995 * debug.createContext params | |
1996 * | |
1997 * { | |
1998 * "contextRoot": FilePath | |
1999 * } | |
2000 */ | |
2001 class DebugCreateContextParams { | |
2002 /** | |
2003 * The path of the Dart or HTML file that will be launched. | |
2004 */ | |
2005 final String contextRoot; | |
2006 | |
2007 DebugCreateContextParams(this.contextRoot); | |
2008 | |
2009 Map<String, dynamic> toJson() { | |
2010 Map<String, dynamic> result = {}; | |
2011 result["contextRoot"] = contextRoot; | |
2012 return result; | |
2013 } | |
2014 | |
2015 String toString() => JSON.encode(toJson()); | |
2016 | |
2017 bool operator==(other) { | |
2018 if (other is DebugCreateContextParams) { | |
2019 return contextRoot == other.contextRoot; | |
2020 } | |
2021 return false; | |
2022 } | |
2023 | |
2024 int get hashCode { | |
2025 int hash = 0; | |
2026 hash = _JenkinsSmiHash.combine(hash, contextRoot.hashCode); | |
2027 return _JenkinsSmiHash.finish(hash); | |
2028 } | |
2029 } | |
2030 | |
2031 /** | |
2032 * debug.createContext result | |
2033 * | |
2034 * { | |
2035 * "id": DebugContextId | |
2036 * } | |
2037 */ | |
2038 class DebugCreateContextResult { | |
2039 /** | |
2040 * The identifier used to refer to the debugging context that was created. | |
2041 */ | |
2042 final String id; | |
2043 | |
2044 DebugCreateContextResult(this.id); | |
2045 | |
2046 Map<String, dynamic> toJson() { | |
2047 Map<String, dynamic> result = {}; | |
2048 result["id"] = id; | |
2049 return result; | |
2050 } | |
2051 | |
2052 String toString() => JSON.encode(toJson()); | |
2053 | |
2054 bool operator==(other) { | |
2055 if (other is DebugCreateContextResult) { | |
2056 return id == other.id; | |
2057 } | |
2058 return false; | |
2059 } | |
2060 | |
2061 int get hashCode { | |
2062 int hash = 0; | |
2063 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
2064 return _JenkinsSmiHash.finish(hash); | |
2065 } | |
2066 } | |
2067 | |
2068 /** | |
2069 * debug.deleteContext params | |
2070 * | |
2071 * { | |
2072 * "id": DebugContextId | |
2073 * } | |
2074 */ | |
2075 class DebugDeleteContextParams { | |
2076 /** | |
2077 * The identifier of the debugging context that is to be deleted. | |
2078 */ | |
2079 final String id; | |
2080 | |
2081 DebugDeleteContextParams(this.id); | |
2082 | |
2083 Map<String, dynamic> toJson() { | |
2084 Map<String, dynamic> result = {}; | |
2085 result["id"] = id; | |
2086 return result; | |
2087 } | |
2088 | |
2089 String toString() => JSON.encode(toJson()); | |
2090 | |
2091 bool operator==(other) { | |
2092 if (other is DebugDeleteContextParams) { | |
2093 return id == other.id; | |
2094 } | |
2095 return false; | |
2096 } | |
2097 | |
2098 int get hashCode { | |
2099 int hash = 0; | |
2100 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
2101 return _JenkinsSmiHash.finish(hash); | |
2102 } | |
2103 } | |
2104 | |
2105 /** | |
2106 * debug.mapUri params | |
2107 * | |
2108 * { | |
2109 * "id": DebugContextId | |
2110 * "file": optional FilePath | |
2111 * "uri": optional String | |
2112 * } | |
2113 */ | |
2114 class DebugMapUriParams { | |
2115 /** | |
2116 * The identifier of the debugging context in which the URI is to be mapped. | |
2117 */ | |
2118 final String id; | |
2119 | |
2120 /** | |
2121 * The path of the file to be mapped into a URI. | |
2122 */ | |
2123 final String file; | |
2124 | |
2125 /** | |
2126 * The URI to be mapped into a file path. | |
2127 */ | |
2128 final String uri; | |
2129 | |
2130 DebugMapUriParams(this.id, {this.file, this.uri}); | |
2131 | |
2132 Map<String, dynamic> toJson() { | |
2133 Map<String, dynamic> result = {}; | |
2134 result["id"] = id; | |
2135 if (file != null) { | |
2136 result["file"] = file; | |
2137 } | |
2138 if (uri != null) { | |
2139 result["uri"] = uri; | |
2140 } | |
2141 return result; | |
2142 } | |
2143 | |
2144 String toString() => JSON.encode(toJson()); | |
2145 | |
2146 bool operator==(other) { | |
2147 if (other is DebugMapUriParams) { | |
2148 return id == other.id && | |
2149 file == other.file && | |
2150 uri == other.uri; | |
2151 } | |
2152 return false; | |
2153 } | |
2154 | |
2155 int get hashCode { | |
2156 int hash = 0; | |
2157 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
2158 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
2159 hash = _JenkinsSmiHash.combine(hash, uri.hashCode); | |
2160 return _JenkinsSmiHash.finish(hash); | |
2161 } | |
2162 } | |
2163 | |
2164 /** | |
2165 * debug.mapUri result | |
2166 * | |
2167 * { | |
2168 * "file": optional FilePath | |
2169 * "uri": optional String | |
2170 * } | |
2171 */ | |
2172 class DebugMapUriResult { | |
2173 /** | |
2174 * The file to which the URI was mapped. This field is omitted if the uri | |
2175 * field was not given in the request. | |
2176 */ | |
2177 final String file; | |
2178 | |
2179 /** | |
2180 * The URI to which the file path was mapped. This field is omitted if the | |
2181 * file field was not given in the request. | |
2182 */ | |
2183 final String uri; | |
2184 | |
2185 DebugMapUriResult({this.file, this.uri}); | |
2186 | |
2187 Map<String, dynamic> toJson() { | |
2188 Map<String, dynamic> result = {}; | |
2189 if (file != null) { | |
2190 result["file"] = file; | |
2191 } | |
2192 if (uri != null) { | |
2193 result["uri"] = uri; | |
2194 } | |
2195 return result; | |
2196 } | |
2197 | |
2198 String toString() => JSON.encode(toJson()); | |
2199 | |
2200 bool operator==(other) { | |
2201 if (other is DebugMapUriResult) { | |
2202 return file == other.file && | |
2203 uri == other.uri; | |
2204 } | |
2205 return false; | |
2206 } | |
2207 | |
2208 int get hashCode { | |
2209 int hash = 0; | |
2210 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
2211 hash = _JenkinsSmiHash.combine(hash, uri.hashCode); | |
2212 return _JenkinsSmiHash.finish(hash); | |
2213 } | |
2214 } | |
2215 | |
2216 /** | |
2217 * debug.setSubscriptions params | |
2218 * | |
2219 * { | |
2220 * "subscriptions": List<DebugService> | |
2221 * } | |
2222 */ | |
2223 class DebugSetSubscriptionsParams { | |
2224 /** | |
2225 * A list of the services being subscribed to. | |
2226 */ | |
2227 final List<DebugService> subscriptions; | |
2228 | |
2229 DebugSetSubscriptionsParams(this.subscriptions); | |
2230 | |
2231 Map<String, dynamic> toJson() { | |
2232 Map<String, dynamic> result = {}; | |
2233 result["subscriptions"] = subscriptions.map((DebugService value) => value.to Json()); | |
2234 return result; | |
2235 } | |
2236 | |
2237 String toString() => JSON.encode(toJson()); | |
2238 | |
2239 bool operator==(other) { | |
2240 if (other is DebugSetSubscriptionsParams) { | |
2241 return subscriptions == other.subscriptions; | |
2242 } | |
2243 return false; | |
2244 } | |
2245 | |
2246 int get hashCode { | |
2247 int hash = 0; | |
2248 hash = _JenkinsSmiHash.combine(hash, subscriptions.hashCode); | |
2249 return _JenkinsSmiHash.finish(hash); | |
2250 } | |
2251 } | |
2252 | |
2253 /** | |
2254 * debug.launchData params | |
2255 * | |
2256 * { | |
2257 * "executables": List<ExecutableFile> | |
2258 * "dartToHtml": Map<FilePath, List<FilePath>> | |
2259 * "htmlToDart": Map<FilePath, List<FilePath>> | |
2260 * } | |
2261 */ | |
2262 class DebugLaunchDataParams { | |
2263 /** | |
2264 * A list of the files that are executable in the given context. This list | |
2265 * replaces any previous list provided for the given context. | |
2266 */ | |
2267 final List<ExecutableFile> executables; | |
2268 | |
2269 /** | |
2270 * A mapping from the paths of Dart files that are referenced by HTML files | |
2271 * to a list of the HTML files that reference the Dart files. | |
2272 */ | |
2273 final Map<String, List<String>> dartToHtml; | |
2274 | |
2275 /** | |
2276 * A mapping from the paths of HTML files that reference Dart files to a list | |
2277 * of the Dart files they reference. | |
2278 */ | |
2279 final Map<String, List<String>> htmlToDart; | |
2280 | |
2281 DebugLaunchDataParams(this.executables, this.dartToHtml, this.htmlToDart); | |
2282 | |
2283 Map<String, dynamic> toJson() { | |
2284 Map<String, dynamic> result = {}; | |
2285 result["executables"] = executables.map((ExecutableFile value) => value.toJs on()); | |
2286 result["dartToHtml"] = dartToHtml; | |
2287 result["htmlToDart"] = htmlToDart; | |
2288 return result; | |
2289 } | |
2290 | |
2291 String toString() => JSON.encode(toJson()); | |
2292 | |
2293 bool operator==(other) { | |
2294 if (other is DebugLaunchDataParams) { | |
2295 return executables == other.executables && | |
2296 dartToHtml == other.dartToHtml && | |
2297 htmlToDart == other.htmlToDart; | |
2298 } | |
2299 return false; | |
2300 } | |
2301 | |
2302 int get hashCode { | |
2303 int hash = 0; | |
2304 hash = _JenkinsSmiHash.combine(hash, executables.hashCode); | |
2305 hash = _JenkinsSmiHash.combine(hash, dartToHtml.hashCode); | |
2306 hash = _JenkinsSmiHash.combine(hash, htmlToDart.hashCode); | |
2307 return _JenkinsSmiHash.finish(hash); | |
2308 } | |
2309 } | |
2310 | |
2311 /** | |
2312 * AddContentOverlay | |
2313 * | |
2314 * { | |
2315 * "type": "add" | |
2316 * "content": String | |
2317 * } | |
2318 */ | |
2319 class AddContentOverlay { | |
2320 /** | |
2321 * The new content of the file. | |
2322 */ | |
2323 final String content; | |
2324 | |
2325 AddContentOverlay(this.content); | |
2326 | |
2327 Map<String, dynamic> toJson() { | |
2328 Map<String, dynamic> result = {}; | |
2329 result["type"] = "add"; | |
2330 result["content"] = content; | |
2331 return result; | |
2332 } | |
2333 | |
2334 String toString() => JSON.encode(toJson()); | |
2335 | |
2336 bool operator==(other) { | |
2337 if (other is AddContentOverlay) { | |
2338 return content == other.content; | |
2339 } | |
2340 return false; | |
2341 } | |
2342 | |
2343 int get hashCode { | |
2344 int hash = 0; | |
2345 hash = _JenkinsSmiHash.combine(hash, 704418402); | |
2346 hash = _JenkinsSmiHash.combine(hash, content.hashCode); | |
2347 return _JenkinsSmiHash.finish(hash); | |
2348 } | |
2349 } | |
2350 | |
2351 /** | |
2352 * AnalysisError | |
2353 * | |
2354 * { | |
2355 * "severity": ErrorSeverity | |
2356 * "type": ErrorType | |
2357 * "location": Location | |
2358 * "message": String | |
2359 * "correction": optional String | |
2360 * } | |
2361 */ | |
2362 class AnalysisError { | |
2363 /** | |
2364 * The severity of the error. | |
2365 */ | |
2366 final ErrorSeverity severity; | |
2367 | |
2368 /** | |
2369 * The type of the error. | |
2370 */ | |
2371 final ErrorType type; | |
2372 | |
2373 /** | |
2374 * The location associated with the error. | |
2375 */ | |
2376 final Location location; | |
2377 | |
2378 /** | |
2379 * The message to be displayed for this error. The message should indicate | |
2380 * what is wrong with the code and why it is wrong. | |
2381 */ | |
2382 final String message; | |
2383 | |
2384 /** | |
2385 * The correction message to be displayed for this error. The correction | |
2386 * message should indicate how the user can fix the error. The field is | |
2387 * omitted if there is no correction message associated with the error code. | |
2388 */ | |
2389 final String correction; | |
2390 | |
2391 AnalysisError(this.severity, this.type, this.location, this.message, {this.cor rection}); | |
2392 | |
2393 Map<String, dynamic> toJson() { | |
2394 Map<String, dynamic> result = {}; | |
2395 result["severity"] = severity.toJson(); | |
2396 result["type"] = type.toJson(); | |
2397 result["location"] = location.toJson(); | |
2398 result["message"] = message; | |
2399 if (correction != null) { | |
2400 result["correction"] = correction; | |
2401 } | |
2402 return result; | |
2403 } | |
2404 | |
2405 String toString() => JSON.encode(toJson()); | |
2406 | |
2407 bool operator==(other) { | |
2408 if (other is AnalysisError) { | |
2409 return severity == other.severity && | |
2410 type == other.type && | |
2411 location == other.location && | |
2412 message == other.message && | |
2413 correction == other.correction; | |
2414 } | |
2415 return false; | |
2416 } | |
2417 | |
2418 int get hashCode { | |
2419 int hash = 0; | |
2420 hash = _JenkinsSmiHash.combine(hash, severity.hashCode); | |
2421 hash = _JenkinsSmiHash.combine(hash, type.hashCode); | |
2422 hash = _JenkinsSmiHash.combine(hash, location.hashCode); | |
2423 hash = _JenkinsSmiHash.combine(hash, message.hashCode); | |
2424 hash = _JenkinsSmiHash.combine(hash, correction.hashCode); | |
2425 return _JenkinsSmiHash.finish(hash); | |
2426 } | |
2427 } | |
2428 | |
2429 /** | |
2430 * AnalysisOptions | |
2431 * | |
2432 * { | |
2433 * "enableAsync": optional bool | |
2434 * "enableDeferredLoading": optional bool | |
2435 * "enableEnums": optional bool | |
2436 * "generateDart2jsHints": optional bool | |
2437 * "generateHints": optional bool | |
2438 * } | |
2439 */ | |
2440 class AnalysisOptions { | |
2441 /** | |
2442 * True if the client wants to enable support for the proposed async feature. | |
2443 */ | |
2444 final bool enableAsync; | |
2445 | |
2446 /** | |
2447 * True if the client wants to enable support for the proposed deferred | |
2448 * loading feature. | |
2449 */ | |
2450 final bool enableDeferredLoading; | |
2451 | |
2452 /** | |
2453 * True if the client wants to enable support for the proposed enum feature. | |
2454 */ | |
2455 final bool enableEnums; | |
2456 | |
2457 /** | |
2458 * True if hints that are specific to dart2js should be generated. This | |
2459 * option is ignored if generateHints is false. | |
2460 */ | |
2461 final bool generateDart2jsHints; | |
2462 | |
2463 /** | |
2464 * True is hints should be generated as part of generating errors and | |
2465 * warnings. | |
2466 */ | |
2467 final bool generateHints; | |
2468 | |
2469 AnalysisOptions({this.enableAsync, this.enableDeferredLoading, this.enableEnum s, this.generateDart2jsHints, this.generateHints}); | |
2470 | |
2471 Map<String, dynamic> toJson() { | |
2472 Map<String, dynamic> result = {}; | |
2473 if (enableAsync != null) { | |
2474 result["enableAsync"] = enableAsync; | |
2475 } | |
2476 if (enableDeferredLoading != null) { | |
2477 result["enableDeferredLoading"] = enableDeferredLoading; | |
2478 } | |
2479 if (enableEnums != null) { | |
2480 result["enableEnums"] = enableEnums; | |
2481 } | |
2482 if (generateDart2jsHints != null) { | |
2483 result["generateDart2jsHints"] = generateDart2jsHints; | |
2484 } | |
2485 if (generateHints != null) { | |
2486 result["generateHints"] = generateHints; | |
2487 } | |
2488 return result; | |
2489 } | |
2490 | |
2491 String toString() => JSON.encode(toJson()); | |
2492 | |
2493 bool operator==(other) { | |
2494 if (other is AnalysisOptions) { | |
2495 return enableAsync == other.enableAsync && | |
2496 enableDeferredLoading == other.enableDeferredLoading && | |
2497 enableEnums == other.enableEnums && | |
2498 generateDart2jsHints == other.generateDart2jsHints && | |
2499 generateHints == other.generateHints; | |
2500 } | |
2501 return false; | |
2502 } | |
2503 | |
2504 int get hashCode { | |
2505 int hash = 0; | |
2506 hash = _JenkinsSmiHash.combine(hash, enableAsync.hashCode); | |
2507 hash = _JenkinsSmiHash.combine(hash, enableDeferredLoading.hashCode); | |
2508 hash = _JenkinsSmiHash.combine(hash, enableEnums.hashCode); | |
2509 hash = _JenkinsSmiHash.combine(hash, generateDart2jsHints.hashCode); | |
2510 hash = _JenkinsSmiHash.combine(hash, generateHints.hashCode); | |
2511 return _JenkinsSmiHash.finish(hash); | |
2512 } | |
2513 } | |
2514 | |
2515 /** | |
2516 * AnalysisService | |
2517 * | |
2518 * enum { | |
2519 * FOLDING | |
2520 * HIGHLIGHTS | |
2521 * NAVIGATION | |
2522 * OCCURRENCES | |
2523 * OUTLINE | |
2524 * OVERRIDES | |
2525 * } | |
2526 */ | |
2527 class AnalysisService { | |
2528 static const FOLDING = const AnalysisService._("FOLDING"); | |
2529 | |
2530 static const HIGHLIGHTS = const AnalysisService._("HIGHLIGHTS"); | |
2531 | |
2532 static const NAVIGATION = const AnalysisService._("NAVIGATION"); | |
2533 | |
2534 static const OCCURRENCES = const AnalysisService._("OCCURRENCES"); | |
2535 | |
2536 static const OUTLINE = const AnalysisService._("OUTLINE"); | |
2537 | |
2538 static const OVERRIDES = const AnalysisService._("OVERRIDES"); | |
2539 | |
2540 final String name; | |
2541 | |
2542 const AnalysisService._(this.name); | |
2543 | |
2544 factory AnalysisService(String name) { | |
2545 switch (name) { | |
2546 case "FOLDING": | |
2547 return FOLDING; | |
2548 case "HIGHLIGHTS": | |
2549 return HIGHLIGHTS; | |
2550 case "NAVIGATION": | |
2551 return NAVIGATION; | |
2552 case "OCCURRENCES": | |
2553 return OCCURRENCES; | |
2554 case "OUTLINE": | |
2555 return OUTLINE; | |
2556 case "OVERRIDES": | |
2557 return OVERRIDES; | |
2558 } | |
2559 throw new Exception('Illegal enum value: $name'); | |
2560 } | |
2561 | |
2562 String toString() => "AnalysisService.$name"; | |
2563 | |
2564 String toJson() => name; | |
2565 } | |
2566 | |
2567 /** | |
2568 * AnalysisStatus | |
2569 * | |
2570 * { | |
2571 * "analyzing": bool | |
2572 * "analysisTarget": optional String | |
2573 * } | |
2574 */ | |
2575 class AnalysisStatus { | |
2576 /** | |
2577 * True if analysis is currently being performed. | |
2578 */ | |
2579 final bool analyzing; | |
2580 | |
2581 /** | |
2582 * The name of the current target of analysis. This field is omitted if | |
2583 * analyzing is false. | |
2584 */ | |
2585 final String analysisTarget; | |
2586 | |
2587 AnalysisStatus(this.analyzing, {this.analysisTarget}); | |
2588 | |
2589 Map<String, dynamic> toJson() { | |
2590 Map<String, dynamic> result = {}; | |
2591 result["analyzing"] = analyzing; | |
2592 if (analysisTarget != null) { | |
2593 result["analysisTarget"] = analysisTarget; | |
2594 } | |
2595 return result; | |
2596 } | |
2597 | |
2598 String toString() => JSON.encode(toJson()); | |
2599 | |
2600 bool operator==(other) { | |
2601 if (other is AnalysisStatus) { | |
2602 return analyzing == other.analyzing && | |
2603 analysisTarget == other.analysisTarget; | |
2604 } | |
2605 return false; | |
2606 } | |
2607 | |
2608 int get hashCode { | |
2609 int hash = 0; | |
2610 hash = _JenkinsSmiHash.combine(hash, analyzing.hashCode); | |
2611 hash = _JenkinsSmiHash.combine(hash, analysisTarget.hashCode); | |
2612 return _JenkinsSmiHash.finish(hash); | |
2613 } | |
2614 } | |
2615 | |
2616 /** | |
2617 * ChangeContentOverlay | |
2618 * | |
2619 * { | |
2620 * "type": "change" | |
2621 * "edits": List<SourceEdit> | |
2622 * } | |
2623 */ | |
2624 class ChangeContentOverlay { | |
2625 /** | |
2626 * The edits to be applied to the file. | |
2627 */ | |
2628 final List<SourceEdit> edits; | |
2629 | |
2630 ChangeContentOverlay(this.edits); | |
2631 | |
2632 Map<String, dynamic> toJson() { | |
2633 Map<String, dynamic> result = {}; | |
2634 result["type"] = "change"; | |
2635 result["edits"] = edits.map((SourceEdit value) => value.toJson()); | |
2636 return result; | |
2637 } | |
2638 | |
2639 String toString() => JSON.encode(toJson()); | |
2640 | |
2641 bool operator==(other) { | |
2642 if (other is ChangeContentOverlay) { | |
2643 return edits == other.edits; | |
2644 } | |
2645 return false; | |
2646 } | |
2647 | |
2648 int get hashCode { | |
2649 int hash = 0; | |
2650 hash = _JenkinsSmiHash.combine(hash, 873118866); | |
2651 hash = _JenkinsSmiHash.combine(hash, edits.hashCode); | |
2652 return _JenkinsSmiHash.finish(hash); | |
2653 } | |
2654 } | |
2655 | |
2656 /** | |
2657 * CompletionRelevance | |
2658 * | |
2659 * enum { | |
2660 * LOW | |
2661 * DEFAULT | |
2662 * HIGH | |
2663 * } | |
2664 */ | |
2665 class CompletionRelevance { | |
2666 static const LOW = const CompletionRelevance._("LOW"); | |
2667 | |
2668 static const DEFAULT = const CompletionRelevance._("DEFAULT"); | |
2669 | |
2670 static const HIGH = const CompletionRelevance._("HIGH"); | |
2671 | |
2672 final String name; | |
2673 | |
2674 const CompletionRelevance._(this.name); | |
2675 | |
2676 factory CompletionRelevance(String name) { | |
2677 switch (name) { | |
2678 case "LOW": | |
2679 return LOW; | |
2680 case "DEFAULT": | |
2681 return DEFAULT; | |
2682 case "HIGH": | |
2683 return HIGH; | |
2684 } | |
2685 throw new Exception('Illegal enum value: $name'); | |
2686 } | |
2687 | |
2688 String toString() => "CompletionRelevance.$name"; | |
2689 | |
2690 String toJson() => name; | |
2691 } | |
2692 | |
2693 /** | |
2694 * CompletionSuggestion | |
2695 * | |
2696 * { | |
2697 * "kind": CompletionSuggestionKind | |
2698 * "relevance": CompletionRelevance | |
2699 * "completion": String | |
2700 * "selectionOffset": int | |
2701 * "selectionLength": int | |
2702 * "isDeprecated": bool | |
2703 * "isPotential": bool | |
2704 * "docSummary": optional String | |
2705 * "docComplete": optional String | |
2706 * "declaringType": optional String | |
2707 * "returnType": optional String | |
2708 * "parameterNames": optional List<String> | |
2709 * "parameterTypes": optional List<String> | |
2710 * "requiredParameterCount": optional int | |
2711 * "positionalParameterCount": optional int | |
2712 * "parameterName": optional String | |
2713 * "parameterType": optional String | |
2714 * } | |
2715 */ | |
2716 class CompletionSuggestion { | |
2717 /** | |
2718 * The kind of element being suggested. | |
2719 */ | |
2720 final CompletionSuggestionKind kind; | |
2721 | |
2722 /** | |
2723 * The relevance of this completion suggestion. | |
2724 */ | |
2725 final CompletionRelevance relevance; | |
2726 | |
2727 /** | |
2728 * The identifier to be inserted if the suggestion is selected. If the | |
2729 * suggestion is for a method or function, the client might want to | |
2730 * additionally insert a template for the parameters. The information | |
2731 * required in order to do so is contained in other fields. | |
2732 */ | |
2733 final String completion; | |
2734 | |
2735 /** | |
2736 * The offset, relative to the beginning of the completion, of where the | |
2737 * selection should be placed after insertion. | |
2738 */ | |
2739 final int selectionOffset; | |
2740 | |
2741 /** | |
2742 * The number of characters that should be selected after insertion. | |
2743 */ | |
2744 final int selectionLength; | |
2745 | |
2746 /** | |
2747 * True if the suggested element is deprecated. | |
2748 */ | |
2749 final bool isDeprecated; | |
2750 | |
2751 /** | |
2752 * True if the element is not known to be valid for the target. This happens | |
2753 * if the type of the target is dynamic. | |
2754 */ | |
2755 final bool isPotential; | |
2756 | |
2757 /** | |
2758 * An abbreviated version of the Dartdoc associated with the element being | |
2759 * suggested, This field is omitted if there is no Dartdoc associated with | |
2760 * the element. | |
2761 */ | |
2762 final String docSummary; | |
2763 | |
2764 /** | |
2765 * The Dartdoc associated with the element being suggested, This field is | |
2766 * omitted if there is no Dartdoc associated with the element. | |
2767 */ | |
2768 final String docComplete; | |
2769 | |
2770 /** | |
2771 * The class that declares the element being suggested. This field is omitted | |
2772 * if the suggested element is not a member of a class. | |
2773 */ | |
2774 final String declaringType; | |
2775 | |
2776 /** | |
2777 * The return type of the getter, function or method being suggested. This | |
2778 * field is omitted if the suggested element is not a getter, function or | |
2779 * method. | |
2780 */ | |
2781 final String returnType; | |
2782 | |
2783 /** | |
2784 * The names of the parameters of the function or method being suggested. | |
2785 * This field is omitted if the suggested element is not a setter, function | |
2786 * or method. | |
2787 */ | |
2788 final List<String> parameterNames; | |
2789 | |
2790 /** | |
2791 * The types of the parameters of the function or method being suggested. | |
2792 * This field is omitted if the parameterNames field is omitted. | |
2793 */ | |
2794 final List<String> parameterTypes; | |
2795 | |
2796 /** | |
2797 * The number of required parameters for the function or method being | |
2798 * suggested. This field is omitted if the parameterNames field is omitted. | |
2799 */ | |
2800 final int requiredParameterCount; | |
2801 | |
2802 /** | |
2803 * The number of positional parameters for the function or method being | |
2804 * suggested. This field is omitted if the parameterNames field is omitted. | |
2805 */ | |
2806 final int positionalParameterCount; | |
2807 | |
2808 /** | |
2809 * The name of the optional parameter being suggested. This field is omitted | |
2810 * if the suggestion is not the addition of an optional argument within an | |
2811 * argument list. | |
2812 */ | |
2813 final String parameterName; | |
2814 | |
2815 /** | |
2816 * The type of the options parameter being suggested. This field is omitted | |
2817 * if the parameterName field is omitted. | |
2818 */ | |
2819 final String parameterType; | |
2820 | |
2821 CompletionSuggestion(this.kind, this.relevance, this.completion, this.selectio nOffset, this.selectionLength, this.isDeprecated, this.isPotential, {this.docSum mary, this.docComplete, this.declaringType, this.returnType, this.parameterNames , this.parameterTypes, this.requiredParameterCount, this.positionalParameterCoun t, this.parameterName, this.parameterType}); | |
2822 | |
2823 Map<String, dynamic> toJson() { | |
2824 Map<String, dynamic> result = {}; | |
2825 result["kind"] = kind.toJson(); | |
2826 result["relevance"] = relevance.toJson(); | |
2827 result["completion"] = completion; | |
2828 result["selectionOffset"] = selectionOffset; | |
2829 result["selectionLength"] = selectionLength; | |
2830 result["isDeprecated"] = isDeprecated; | |
2831 result["isPotential"] = isPotential; | |
2832 if (docSummary != null) { | |
2833 result["docSummary"] = docSummary; | |
2834 } | |
2835 if (docComplete != null) { | |
2836 result["docComplete"] = docComplete; | |
2837 } | |
2838 if (declaringType != null) { | |
2839 result["declaringType"] = declaringType; | |
2840 } | |
2841 if (returnType != null) { | |
2842 result["returnType"] = returnType; | |
2843 } | |
2844 if (parameterNames != null) { | |
2845 result["parameterNames"] = parameterNames; | |
2846 } | |
2847 if (parameterTypes != null) { | |
2848 result["parameterTypes"] = parameterTypes; | |
2849 } | |
2850 if (requiredParameterCount != null) { | |
2851 result["requiredParameterCount"] = requiredParameterCount; | |
2852 } | |
2853 if (positionalParameterCount != null) { | |
2854 result["positionalParameterCount"] = positionalParameterCount; | |
2855 } | |
2856 if (parameterName != null) { | |
2857 result["parameterName"] = parameterName; | |
2858 } | |
2859 if (parameterType != null) { | |
2860 result["parameterType"] = parameterType; | |
2861 } | |
2862 return result; | |
2863 } | |
2864 | |
2865 String toString() => JSON.encode(toJson()); | |
2866 | |
2867 bool operator==(other) { | |
2868 if (other is CompletionSuggestion) { | |
2869 return kind == other.kind && | |
2870 relevance == other.relevance && | |
2871 completion == other.completion && | |
2872 selectionOffset == other.selectionOffset && | |
2873 selectionLength == other.selectionLength && | |
2874 isDeprecated == other.isDeprecated && | |
2875 isPotential == other.isPotential && | |
2876 docSummary == other.docSummary && | |
2877 docComplete == other.docComplete && | |
2878 declaringType == other.declaringType && | |
2879 returnType == other.returnType && | |
2880 parameterNames == other.parameterNames && | |
2881 parameterTypes == other.parameterTypes && | |
2882 requiredParameterCount == other.requiredParameterCount && | |
2883 positionalParameterCount == other.positionalParameterCount && | |
2884 parameterName == other.parameterName && | |
2885 parameterType == other.parameterType; | |
2886 } | |
2887 return false; | |
2888 } | |
2889 | |
2890 int get hashCode { | |
2891 int hash = 0; | |
2892 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); | |
2893 hash = _JenkinsSmiHash.combine(hash, relevance.hashCode); | |
2894 hash = _JenkinsSmiHash.combine(hash, completion.hashCode); | |
2895 hash = _JenkinsSmiHash.combine(hash, selectionOffset.hashCode); | |
2896 hash = _JenkinsSmiHash.combine(hash, selectionLength.hashCode); | |
2897 hash = _JenkinsSmiHash.combine(hash, isDeprecated.hashCode); | |
2898 hash = _JenkinsSmiHash.combine(hash, isPotential.hashCode); | |
2899 hash = _JenkinsSmiHash.combine(hash, docSummary.hashCode); | |
2900 hash = _JenkinsSmiHash.combine(hash, docComplete.hashCode); | |
2901 hash = _JenkinsSmiHash.combine(hash, declaringType.hashCode); | |
2902 hash = _JenkinsSmiHash.combine(hash, returnType.hashCode); | |
2903 hash = _JenkinsSmiHash.combine(hash, parameterNames.hashCode); | |
2904 hash = _JenkinsSmiHash.combine(hash, parameterTypes.hashCode); | |
2905 hash = _JenkinsSmiHash.combine(hash, requiredParameterCount.hashCode); | |
2906 hash = _JenkinsSmiHash.combine(hash, positionalParameterCount.hashCode); | |
2907 hash = _JenkinsSmiHash.combine(hash, parameterName.hashCode); | |
2908 hash = _JenkinsSmiHash.combine(hash, parameterType.hashCode); | |
2909 return _JenkinsSmiHash.finish(hash); | |
2910 } | |
2911 } | |
2912 | |
2913 /** | |
2914 * CompletionSuggestionKind | |
2915 * | |
2916 * enum { | |
2917 * ARGUMENT_LIST | |
2918 * CLASS | |
2919 * CLASS_ALIAS | |
2920 * CONSTRUCTOR | |
2921 * FIELD | |
2922 * FUNCTION | |
2923 * FUNCTION_TYPE_ALIAS | |
2924 * GETTER | |
2925 * IMPORT | |
2926 * KEYWORD | |
2927 * LIBRARY_PREFIX | |
2928 * LOCAL_VARIABLE | |
2929 * METHOD | |
2930 * METHOD_NAME | |
2931 * NAMED_ARGUMENT | |
2932 * OPTIONAL_ARGUMENT | |
2933 * PARAMETER | |
2934 * SETTER | |
2935 * TOP_LEVEL_VARIABLE | |
2936 * TYPE_PARAMETER | |
2937 * } | |
2938 */ | |
2939 class CompletionSuggestionKind { | |
2940 static const ARGUMENT_LIST = const CompletionSuggestionKind._("ARGUMENT_LIST") ; | |
2941 | |
2942 static const CLASS = const CompletionSuggestionKind._("CLASS"); | |
2943 | |
2944 static const CLASS_ALIAS = const CompletionSuggestionKind._("CLASS_ALIAS"); | |
2945 | |
2946 static const CONSTRUCTOR = const CompletionSuggestionKind._("CONSTRUCTOR"); | |
2947 | |
2948 static const FIELD = const CompletionSuggestionKind._("FIELD"); | |
2949 | |
2950 static const FUNCTION = const CompletionSuggestionKind._("FUNCTION"); | |
2951 | |
2952 static const FUNCTION_TYPE_ALIAS = const CompletionSuggestionKind._("FUNCTION_ TYPE_ALIAS"); | |
2953 | |
2954 static const GETTER = const CompletionSuggestionKind._("GETTER"); | |
2955 | |
2956 static const IMPORT = const CompletionSuggestionKind._("IMPORT"); | |
2957 | |
2958 static const KEYWORD = const CompletionSuggestionKind._("KEYWORD"); | |
2959 | |
2960 static const LIBRARY_PREFIX = const CompletionSuggestionKind._("LIBRARY_PREFIX "); | |
2961 | |
2962 static const LOCAL_VARIABLE = const CompletionSuggestionKind._("LOCAL_VARIABLE "); | |
2963 | |
2964 static const METHOD = const CompletionSuggestionKind._("METHOD"); | |
2965 | |
2966 static const METHOD_NAME = const CompletionSuggestionKind._("METHOD_NAME"); | |
2967 | |
2968 static const NAMED_ARGUMENT = const CompletionSuggestionKind._("NAMED_ARGUMENT "); | |
2969 | |
2970 static const OPTIONAL_ARGUMENT = const CompletionSuggestionKind._("OPTIONAL_AR GUMENT"); | |
2971 | |
2972 static const PARAMETER = const CompletionSuggestionKind._("PARAMETER"); | |
2973 | |
2974 static const SETTER = const CompletionSuggestionKind._("SETTER"); | |
2975 | |
2976 static const TOP_LEVEL_VARIABLE = const CompletionSuggestionKind._("TOP_LEVEL_ VARIABLE"); | |
2977 | |
2978 static const TYPE_PARAMETER = const CompletionSuggestionKind._("TYPE_PARAMETER "); | |
2979 | |
2980 final String name; | |
2981 | |
2982 const CompletionSuggestionKind._(this.name); | |
2983 | |
2984 factory CompletionSuggestionKind(String name) { | |
2985 switch (name) { | |
2986 case "ARGUMENT_LIST": | |
2987 return ARGUMENT_LIST; | |
2988 case "CLASS": | |
2989 return CLASS; | |
2990 case "CLASS_ALIAS": | |
2991 return CLASS_ALIAS; | |
2992 case "CONSTRUCTOR": | |
2993 return CONSTRUCTOR; | |
2994 case "FIELD": | |
2995 return FIELD; | |
2996 case "FUNCTION": | |
2997 return FUNCTION; | |
2998 case "FUNCTION_TYPE_ALIAS": | |
2999 return FUNCTION_TYPE_ALIAS; | |
3000 case "GETTER": | |
3001 return GETTER; | |
3002 case "IMPORT": | |
3003 return IMPORT; | |
3004 case "KEYWORD": | |
3005 return KEYWORD; | |
3006 case "LIBRARY_PREFIX": | |
3007 return LIBRARY_PREFIX; | |
3008 case "LOCAL_VARIABLE": | |
3009 return LOCAL_VARIABLE; | |
3010 case "METHOD": | |
3011 return METHOD; | |
3012 case "METHOD_NAME": | |
3013 return METHOD_NAME; | |
3014 case "NAMED_ARGUMENT": | |
3015 return NAMED_ARGUMENT; | |
3016 case "OPTIONAL_ARGUMENT": | |
3017 return OPTIONAL_ARGUMENT; | |
3018 case "PARAMETER": | |
3019 return PARAMETER; | |
3020 case "SETTER": | |
3021 return SETTER; | |
3022 case "TOP_LEVEL_VARIABLE": | |
3023 return TOP_LEVEL_VARIABLE; | |
3024 case "TYPE_PARAMETER": | |
3025 return TYPE_PARAMETER; | |
3026 } | |
3027 throw new Exception('Illegal enum value: $name'); | |
3028 } | |
3029 | |
3030 String toString() => "CompletionSuggestionKind.$name"; | |
3031 | |
3032 String toJson() => name; | |
3033 } | |
3034 | |
3035 /** | |
3036 * DebugService | |
3037 * | |
3038 * enum { | |
3039 * LAUNCH_DATA | |
3040 * } | |
3041 */ | |
3042 class DebugService { | |
3043 static const LAUNCH_DATA = const DebugService._("LAUNCH_DATA"); | |
3044 | |
3045 final String name; | |
3046 | |
3047 const DebugService._(this.name); | |
3048 | |
3049 factory DebugService(String name) { | |
3050 switch (name) { | |
3051 case "LAUNCH_DATA": | |
3052 return LAUNCH_DATA; | |
3053 } | |
3054 throw new Exception('Illegal enum value: $name'); | |
3055 } | |
3056 | |
3057 String toString() => "DebugService.$name"; | |
3058 | |
3059 String toJson() => name; | |
3060 } | |
3061 | |
3062 /** | |
3063 * Element | |
3064 * | |
3065 * { | |
3066 * "kind": ElementKind | |
3067 * "name": String | |
3068 * "location": optional Location | |
3069 * "flags": int | |
3070 * "parameters": optional String | |
3071 * "returnType": optional String | |
3072 * } | |
3073 */ | |
3074 class Element { | |
Brian Wilkerson
2014/08/18 14:10:16
The Java generator generates utility methods such
Paul Berry
2014/08/18 21:58:03
Acknowledged. I will address this in a future CL
| |
3075 /** | |
3076 * The kind of the element. | |
3077 */ | |
3078 final ElementKind kind; | |
3079 | |
3080 /** | |
3081 * The name of the element. This is typically used as the label in the | |
3082 * outline. | |
3083 */ | |
3084 final String name; | |
3085 | |
3086 /** | |
3087 * The location of the name in the declaration of the element. | |
3088 */ | |
3089 final Location location; | |
3090 | |
3091 /** | |
3092 * A bit-map containing the following flags: | |
3093 * | |
3094 * - 0x01 - set if the element is explicitly or implicitly abstract | |
3095 * - 0x02 - set if the element was declared to be ‘const’ | |
3096 * - 0x04 - set if the element was declared to be ‘final’ | |
3097 * - 0x08 - set if the element is a static member of a class or is a | |
3098 * top-level function or field | |
3099 * - 0x10 - set if the element is private | |
3100 * - 0x20 - set if the element is deprecated | |
3101 */ | |
3102 final int flags; | |
3103 | |
3104 /** | |
3105 * The parameter list for the element. If the element is not a method or | |
3106 * function this field will not be defined. If the element has zero | |
3107 * parameters, this field will have a value of "()". | |
3108 */ | |
3109 final String parameters; | |
3110 | |
3111 /** | |
3112 * The return type of the element. If the element is not a method or function | |
3113 * this field will not be defined. If the element does not have a declared | |
3114 * return type, this field will contain an empty string. | |
3115 */ | |
3116 final String returnType; | |
3117 | |
3118 Element(this.kind, this.name, this.flags, {this.location, this.parameters, thi s.returnType}); | |
3119 | |
3120 Map<String, dynamic> toJson() { | |
3121 Map<String, dynamic> result = {}; | |
3122 result["kind"] = kind.toJson(); | |
3123 result["name"] = name; | |
3124 if (location != null) { | |
3125 result["location"] = location.toJson(); | |
3126 } | |
3127 result["flags"] = flags; | |
3128 if (parameters != null) { | |
3129 result["parameters"] = parameters; | |
3130 } | |
3131 if (returnType != null) { | |
3132 result["returnType"] = returnType; | |
3133 } | |
3134 return result; | |
3135 } | |
3136 | |
3137 String toString() => JSON.encode(toJson()); | |
3138 | |
3139 bool operator==(other) { | |
3140 if (other is Element) { | |
3141 return kind == other.kind && | |
3142 name == other.name && | |
3143 location == other.location && | |
3144 flags == other.flags && | |
3145 parameters == other.parameters && | |
3146 returnType == other.returnType; | |
3147 } | |
3148 return false; | |
3149 } | |
3150 | |
3151 int get hashCode { | |
3152 int hash = 0; | |
3153 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); | |
3154 hash = _JenkinsSmiHash.combine(hash, name.hashCode); | |
3155 hash = _JenkinsSmiHash.combine(hash, location.hashCode); | |
3156 hash = _JenkinsSmiHash.combine(hash, flags.hashCode); | |
3157 hash = _JenkinsSmiHash.combine(hash, parameters.hashCode); | |
3158 hash = _JenkinsSmiHash.combine(hash, returnType.hashCode); | |
3159 return _JenkinsSmiHash.finish(hash); | |
3160 } | |
3161 } | |
3162 | |
3163 /** | |
3164 * ElementKind | |
3165 * | |
3166 * enum { | |
3167 * CLASS | |
3168 * CLASS_TYPE_ALIAS | |
3169 * COMPILATION_UNIT | |
3170 * CONSTRUCTOR | |
3171 * FIELD | |
3172 * FUNCTION | |
3173 * FUNCTION_TYPE_ALIAS | |
3174 * GETTER | |
3175 * LIBRARY | |
3176 * LOCAL_VARIABLE | |
3177 * METHOD | |
3178 * PARAMETER | |
3179 * SETTER | |
3180 * TOP_LEVEL_VARIABLE | |
3181 * TYPE_PARAMETER | |
3182 * UNIT_TEST_GROUP | |
3183 * UNIT_TEST_TEST | |
3184 * UNKNOWN | |
3185 * } | |
3186 */ | |
3187 class ElementKind { | |
3188 static const CLASS = const ElementKind._("CLASS"); | |
3189 | |
3190 static const CLASS_TYPE_ALIAS = const ElementKind._("CLASS_TYPE_ALIAS"); | |
3191 | |
3192 static const COMPILATION_UNIT = const ElementKind._("COMPILATION_UNIT"); | |
3193 | |
3194 static const CONSTRUCTOR = const ElementKind._("CONSTRUCTOR"); | |
3195 | |
3196 static const FIELD = const ElementKind._("FIELD"); | |
3197 | |
3198 static const FUNCTION = const ElementKind._("FUNCTION"); | |
3199 | |
3200 static const FUNCTION_TYPE_ALIAS = const ElementKind._("FUNCTION_TYPE_ALIAS"); | |
3201 | |
3202 static const GETTER = const ElementKind._("GETTER"); | |
3203 | |
3204 static const LIBRARY = const ElementKind._("LIBRARY"); | |
3205 | |
3206 static const LOCAL_VARIABLE = const ElementKind._("LOCAL_VARIABLE"); | |
3207 | |
3208 static const METHOD = const ElementKind._("METHOD"); | |
3209 | |
3210 static const PARAMETER = const ElementKind._("PARAMETER"); | |
3211 | |
3212 static const SETTER = const ElementKind._("SETTER"); | |
3213 | |
3214 static const TOP_LEVEL_VARIABLE = const ElementKind._("TOP_LEVEL_VARIABLE"); | |
3215 | |
3216 static const TYPE_PARAMETER = const ElementKind._("TYPE_PARAMETER"); | |
3217 | |
3218 static const UNIT_TEST_GROUP = const ElementKind._("UNIT_TEST_GROUP"); | |
3219 | |
3220 static const UNIT_TEST_TEST = const ElementKind._("UNIT_TEST_TEST"); | |
3221 | |
3222 static const UNKNOWN = const ElementKind._("UNKNOWN"); | |
3223 | |
3224 final String name; | |
3225 | |
3226 const ElementKind._(this.name); | |
3227 | |
3228 factory ElementKind(String name) { | |
3229 switch (name) { | |
3230 case "CLASS": | |
3231 return CLASS; | |
3232 case "CLASS_TYPE_ALIAS": | |
3233 return CLASS_TYPE_ALIAS; | |
3234 case "COMPILATION_UNIT": | |
3235 return COMPILATION_UNIT; | |
3236 case "CONSTRUCTOR": | |
3237 return CONSTRUCTOR; | |
3238 case "FIELD": | |
3239 return FIELD; | |
3240 case "FUNCTION": | |
3241 return FUNCTION; | |
3242 case "FUNCTION_TYPE_ALIAS": | |
3243 return FUNCTION_TYPE_ALIAS; | |
3244 case "GETTER": | |
3245 return GETTER; | |
3246 case "LIBRARY": | |
3247 return LIBRARY; | |
3248 case "LOCAL_VARIABLE": | |
3249 return LOCAL_VARIABLE; | |
3250 case "METHOD": | |
3251 return METHOD; | |
3252 case "PARAMETER": | |
3253 return PARAMETER; | |
3254 case "SETTER": | |
3255 return SETTER; | |
3256 case "TOP_LEVEL_VARIABLE": | |
3257 return TOP_LEVEL_VARIABLE; | |
3258 case "TYPE_PARAMETER": | |
3259 return TYPE_PARAMETER; | |
3260 case "UNIT_TEST_GROUP": | |
3261 return UNIT_TEST_GROUP; | |
3262 case "UNIT_TEST_TEST": | |
3263 return UNIT_TEST_TEST; | |
3264 case "UNKNOWN": | |
3265 return UNKNOWN; | |
3266 } | |
3267 throw new Exception('Illegal enum value: $name'); | |
3268 } | |
3269 | |
3270 String toString() => "ElementKind.$name"; | |
3271 | |
3272 String toJson() => name; | |
3273 } | |
3274 | |
3275 /** | |
3276 * Error | |
3277 * | |
3278 * { | |
3279 * "code": String | |
3280 * "message": String | |
3281 * "data": optional object | |
3282 * } | |
3283 */ | |
3284 class Error { | |
3285 /** | |
3286 * A code that uniquely identifies the error that occurred. | |
3287 */ | |
3288 final String code; | |
3289 | |
3290 /** | |
3291 * A short description of the error. | |
3292 */ | |
3293 final String message; | |
3294 | |
3295 /** | |
3296 * Additional data related to the error. This field is omitted if there is no | |
3297 * additional data available. | |
3298 */ | |
3299 final Object data; | |
3300 | |
3301 Error(this.code, this.message, {this.data}); | |
3302 | |
3303 Map<String, dynamic> toJson() { | |
3304 Map<String, dynamic> result = {}; | |
3305 result["code"] = code; | |
3306 result["message"] = message; | |
3307 if (data != null) { | |
3308 result["data"] = data; | |
3309 } | |
3310 return result; | |
3311 } | |
3312 | |
3313 String toString() => JSON.encode(toJson()); | |
3314 | |
3315 bool operator==(other) { | |
3316 if (other is Error) { | |
3317 return code == other.code && | |
3318 message == other.message && | |
3319 data == other.data; | |
3320 } | |
3321 return false; | |
3322 } | |
3323 | |
3324 int get hashCode { | |
3325 int hash = 0; | |
3326 hash = _JenkinsSmiHash.combine(hash, code.hashCode); | |
3327 hash = _JenkinsSmiHash.combine(hash, message.hashCode); | |
3328 hash = _JenkinsSmiHash.combine(hash, data.hashCode); | |
3329 return _JenkinsSmiHash.finish(hash); | |
3330 } | |
3331 } | |
3332 | |
3333 /** | |
3334 * ErrorFixes | |
3335 * | |
3336 * { | |
3337 * "error": AnalysisError | |
3338 * "fixes": List<SourceChange> | |
3339 * } | |
3340 */ | |
3341 class ErrorFixes { | |
3342 /** | |
3343 * The error with which the fixes are associated. | |
3344 */ | |
3345 final AnalysisError error; | |
3346 | |
3347 /** | |
3348 * The fixes associated with the error. | |
3349 */ | |
3350 final List<SourceChange> fixes; | |
3351 | |
3352 ErrorFixes(this.error, this.fixes); | |
3353 | |
3354 Map<String, dynamic> toJson() { | |
3355 Map<String, dynamic> result = {}; | |
3356 result["error"] = error.toJson(); | |
3357 result["fixes"] = fixes.map((SourceChange value) => value.toJson()); | |
3358 return result; | |
3359 } | |
3360 | |
3361 String toString() => JSON.encode(toJson()); | |
3362 | |
3363 bool operator==(other) { | |
3364 if (other is ErrorFixes) { | |
3365 return error == other.error && | |
3366 fixes == other.fixes; | |
3367 } | |
3368 return false; | |
3369 } | |
3370 | |
3371 int get hashCode { | |
3372 int hash = 0; | |
3373 hash = _JenkinsSmiHash.combine(hash, error.hashCode); | |
3374 hash = _JenkinsSmiHash.combine(hash, fixes.hashCode); | |
3375 return _JenkinsSmiHash.finish(hash); | |
3376 } | |
3377 } | |
3378 | |
3379 /** | |
3380 * ErrorSeverity | |
3381 * | |
3382 * enum { | |
3383 * INFO | |
3384 * WARNING | |
3385 * ERROR | |
3386 * } | |
3387 */ | |
3388 class ErrorSeverity { | |
3389 static const INFO = const ErrorSeverity._("INFO"); | |
3390 | |
3391 static const WARNING = const ErrorSeverity._("WARNING"); | |
3392 | |
3393 static const ERROR = const ErrorSeverity._("ERROR"); | |
3394 | |
3395 final String name; | |
3396 | |
3397 const ErrorSeverity._(this.name); | |
3398 | |
3399 factory ErrorSeverity(String name) { | |
3400 switch (name) { | |
3401 case "INFO": | |
3402 return INFO; | |
3403 case "WARNING": | |
3404 return WARNING; | |
3405 case "ERROR": | |
3406 return ERROR; | |
3407 } | |
3408 throw new Exception('Illegal enum value: $name'); | |
3409 } | |
3410 | |
3411 String toString() => "ErrorSeverity.$name"; | |
3412 | |
3413 String toJson() => name; | |
3414 } | |
3415 | |
3416 /** | |
3417 * ErrorType | |
3418 * | |
3419 * enum { | |
3420 * COMPILE_TIME_ERROR | |
3421 * HINT | |
3422 * STATIC_TYPE_WARNING | |
3423 * STATIC_WARNING | |
3424 * SYNTACTIC_ERROR | |
3425 * TODO | |
3426 * } | |
3427 */ | |
3428 class ErrorType { | |
3429 static const COMPILE_TIME_ERROR = const ErrorType._("COMPILE_TIME_ERROR"); | |
3430 | |
3431 static const HINT = const ErrorType._("HINT"); | |
3432 | |
3433 static const STATIC_TYPE_WARNING = const ErrorType._("STATIC_TYPE_WARNING"); | |
3434 | |
3435 static const STATIC_WARNING = const ErrorType._("STATIC_WARNING"); | |
3436 | |
3437 static const SYNTACTIC_ERROR = const ErrorType._("SYNTACTIC_ERROR"); | |
3438 | |
3439 static const TODO = const ErrorType._("TODO"); | |
3440 | |
3441 final String name; | |
3442 | |
3443 const ErrorType._(this.name); | |
3444 | |
3445 factory ErrorType(String name) { | |
3446 switch (name) { | |
3447 case "COMPILE_TIME_ERROR": | |
3448 return COMPILE_TIME_ERROR; | |
3449 case "HINT": | |
3450 return HINT; | |
3451 case "STATIC_TYPE_WARNING": | |
3452 return STATIC_TYPE_WARNING; | |
3453 case "STATIC_WARNING": | |
3454 return STATIC_WARNING; | |
3455 case "SYNTACTIC_ERROR": | |
3456 return SYNTACTIC_ERROR; | |
3457 case "TODO": | |
3458 return TODO; | |
3459 } | |
3460 throw new Exception('Illegal enum value: $name'); | |
3461 } | |
3462 | |
3463 String toString() => "ErrorType.$name"; | |
3464 | |
3465 String toJson() => name; | |
3466 } | |
3467 | |
3468 /** | |
3469 * ExecutableFile | |
3470 * | |
3471 * { | |
3472 * "file": FilePath | |
3473 * "offset": ExecutableKind | |
3474 * } | |
3475 */ | |
3476 class ExecutableFile { | |
3477 /** | |
3478 * The path of the executable file. | |
3479 */ | |
3480 final String file; | |
3481 | |
3482 /** | |
3483 * The offset of the region to be highlighted. | |
3484 */ | |
3485 final ExecutableKind offset; | |
3486 | |
3487 ExecutableFile(this.file, this.offset); | |
3488 | |
3489 Map<String, dynamic> toJson() { | |
3490 Map<String, dynamic> result = {}; | |
3491 result["file"] = file; | |
3492 result["offset"] = offset.toJson(); | |
3493 return result; | |
3494 } | |
3495 | |
3496 String toString() => JSON.encode(toJson()); | |
3497 | |
3498 bool operator==(other) { | |
3499 if (other is ExecutableFile) { | |
3500 return file == other.file && | |
3501 offset == other.offset; | |
3502 } | |
3503 return false; | |
3504 } | |
3505 | |
3506 int get hashCode { | |
3507 int hash = 0; | |
3508 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
3509 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
3510 return _JenkinsSmiHash.finish(hash); | |
3511 } | |
3512 } | |
3513 | |
3514 /** | |
3515 * ExecutableKind | |
3516 * | |
3517 * enum { | |
3518 * CLIENT | |
3519 * EITHER | |
3520 * SERVER | |
3521 * } | |
3522 */ | |
3523 class ExecutableKind { | |
3524 static const CLIENT = const ExecutableKind._("CLIENT"); | |
3525 | |
3526 static const EITHER = const ExecutableKind._("EITHER"); | |
3527 | |
3528 static const SERVER = const ExecutableKind._("SERVER"); | |
3529 | |
3530 final String name; | |
3531 | |
3532 const ExecutableKind._(this.name); | |
3533 | |
3534 factory ExecutableKind(String name) { | |
3535 switch (name) { | |
3536 case "CLIENT": | |
3537 return CLIENT; | |
3538 case "EITHER": | |
3539 return EITHER; | |
3540 case "SERVER": | |
3541 return SERVER; | |
3542 } | |
3543 throw new Exception('Illegal enum value: $name'); | |
3544 } | |
3545 | |
3546 String toString() => "ExecutableKind.$name"; | |
3547 | |
3548 String toJson() => name; | |
3549 } | |
3550 | |
3551 /** | |
3552 * FoldingKind | |
3553 * | |
3554 * enum { | |
3555 * COMMENT | |
3556 * CLASS_MEMBER | |
3557 * DIRECTIVES | |
3558 * DOCUMENTATION_COMMENT | |
3559 * TOP_LEVEL_DECLARATION | |
3560 * } | |
3561 */ | |
3562 class FoldingKind { | |
3563 static const COMMENT = const FoldingKind._("COMMENT"); | |
3564 | |
3565 static const CLASS_MEMBER = const FoldingKind._("CLASS_MEMBER"); | |
3566 | |
3567 static const DIRECTIVES = const FoldingKind._("DIRECTIVES"); | |
3568 | |
3569 static const DOCUMENTATION_COMMENT = const FoldingKind._("DOCUMENTATION_COMMEN T"); | |
3570 | |
3571 static const TOP_LEVEL_DECLARATION = const FoldingKind._("TOP_LEVEL_DECLARATIO N"); | |
3572 | |
3573 final String name; | |
3574 | |
3575 const FoldingKind._(this.name); | |
3576 | |
3577 factory FoldingKind(String name) { | |
3578 switch (name) { | |
3579 case "COMMENT": | |
3580 return COMMENT; | |
3581 case "CLASS_MEMBER": | |
3582 return CLASS_MEMBER; | |
3583 case "DIRECTIVES": | |
3584 return DIRECTIVES; | |
3585 case "DOCUMENTATION_COMMENT": | |
3586 return DOCUMENTATION_COMMENT; | |
3587 case "TOP_LEVEL_DECLARATION": | |
3588 return TOP_LEVEL_DECLARATION; | |
3589 } | |
3590 throw new Exception('Illegal enum value: $name'); | |
3591 } | |
3592 | |
3593 String toString() => "FoldingKind.$name"; | |
3594 | |
3595 String toJson() => name; | |
3596 } | |
3597 | |
3598 /** | |
3599 * FoldingRegion | |
3600 * | |
3601 * { | |
3602 * "kind": FoldingKind | |
3603 * "offset": int | |
3604 * "length": int | |
3605 * } | |
3606 */ | |
3607 class FoldingRegion { | |
3608 /** | |
3609 * The kind of the region. | |
3610 */ | |
3611 final FoldingKind kind; | |
3612 | |
3613 /** | |
3614 * The offset of the region to be folded. | |
3615 */ | |
3616 final int offset; | |
3617 | |
3618 /** | |
3619 * The length of the region to be folded. | |
3620 */ | |
3621 final int length; | |
3622 | |
3623 FoldingRegion(this.kind, this.offset, this.length); | |
3624 | |
3625 Map<String, dynamic> toJson() { | |
3626 Map<String, dynamic> result = {}; | |
3627 result["kind"] = kind.toJson(); | |
3628 result["offset"] = offset; | |
3629 result["length"] = length; | |
3630 return result; | |
3631 } | |
3632 | |
3633 String toString() => JSON.encode(toJson()); | |
3634 | |
3635 bool operator==(other) { | |
3636 if (other is FoldingRegion) { | |
3637 return kind == other.kind && | |
3638 offset == other.offset && | |
3639 length == other.length; | |
3640 } | |
3641 return false; | |
3642 } | |
3643 | |
3644 int get hashCode { | |
3645 int hash = 0; | |
3646 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); | |
3647 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
3648 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
3649 return _JenkinsSmiHash.finish(hash); | |
3650 } | |
3651 } | |
3652 | |
3653 /** | |
3654 * HighlightRegion | |
3655 * | |
3656 * { | |
3657 * "type": HighlightRegionType | |
3658 * "offset": int | |
3659 * "length": int | |
3660 * } | |
3661 */ | |
3662 class HighlightRegion { | |
3663 /** | |
3664 * The type of highlight associated with the region. | |
3665 */ | |
3666 final HighlightRegionType type; | |
3667 | |
3668 /** | |
3669 * The offset of the region to be highlighted. | |
3670 */ | |
3671 final int offset; | |
3672 | |
3673 /** | |
3674 * The length of the region to be highlighted. | |
3675 */ | |
3676 final int length; | |
3677 | |
3678 HighlightRegion(this.type, this.offset, this.length); | |
3679 | |
3680 Map<String, dynamic> toJson() { | |
3681 Map<String, dynamic> result = {}; | |
3682 result["type"] = type.toJson(); | |
3683 result["offset"] = offset; | |
3684 result["length"] = length; | |
3685 return result; | |
3686 } | |
3687 | |
3688 String toString() => JSON.encode(toJson()); | |
3689 | |
3690 bool operator==(other) { | |
3691 if (other is HighlightRegion) { | |
3692 return type == other.type && | |
3693 offset == other.offset && | |
3694 length == other.length; | |
3695 } | |
3696 return false; | |
3697 } | |
3698 | |
3699 int get hashCode { | |
3700 int hash = 0; | |
3701 hash = _JenkinsSmiHash.combine(hash, type.hashCode); | |
3702 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
3703 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
3704 return _JenkinsSmiHash.finish(hash); | |
3705 } | |
3706 } | |
3707 | |
3708 /** | |
3709 * HighlightRegionType | |
3710 * | |
3711 * enum { | |
3712 * ANNOTATION | |
3713 * BUILT_IN | |
3714 * CLASS | |
3715 * COMMENT_BLOCK | |
3716 * COMMENT_DOCUMENTATION | |
3717 * COMMENT_END_OF_LINE | |
3718 * CONSTRUCTOR | |
3719 * DIRECTIVE | |
3720 * DYNAMIC_TYPE | |
3721 * FIELD | |
3722 * FIELD_STATIC | |
3723 * FUNCTION | |
3724 * FUNCTION_DECLARATION | |
3725 * FUNCTION_TYPE_ALIAS | |
3726 * GETTER_DECLARATION | |
3727 * IDENTIFIER_DEFAULT | |
3728 * IMPORT_PREFIX | |
3729 * KEYWORD | |
3730 * LITERAL_BOOLEAN | |
3731 * LITERAL_DOUBLE | |
3732 * LITERAL_INTEGER | |
3733 * LITERAL_LIST | |
3734 * LITERAL_MAP | |
3735 * LITERAL_STRING | |
3736 * LOCAL_VARIABLE | |
3737 * LOCAL_VARIABLE_DECLARATION | |
3738 * METHOD | |
3739 * METHOD_DECLARATION | |
3740 * METHOD_DECLARATION_STATIC | |
3741 * METHOD_STATIC | |
3742 * PARAMETER | |
3743 * SETTER_DECLARATION | |
3744 * TOP_LEVEL_VARIABLE | |
3745 * TYPE_NAME_DYNAMIC | |
3746 * TYPE_PARAMETER | |
3747 * } | |
3748 */ | |
3749 class HighlightRegionType { | |
3750 static const ANNOTATION = const HighlightRegionType._("ANNOTATION"); | |
3751 | |
3752 static const BUILT_IN = const HighlightRegionType._("BUILT_IN"); | |
3753 | |
3754 static const CLASS = const HighlightRegionType._("CLASS"); | |
3755 | |
3756 static const COMMENT_BLOCK = const HighlightRegionType._("COMMENT_BLOCK"); | |
3757 | |
3758 static const COMMENT_DOCUMENTATION = const HighlightRegionType._("COMMENT_DOCU MENTATION"); | |
3759 | |
3760 static const COMMENT_END_OF_LINE = const HighlightRegionType._("COMMENT_END_OF _LINE"); | |
3761 | |
3762 static const CONSTRUCTOR = const HighlightRegionType._("CONSTRUCTOR"); | |
3763 | |
3764 static const DIRECTIVE = const HighlightRegionType._("DIRECTIVE"); | |
3765 | |
3766 static const DYNAMIC_TYPE = const HighlightRegionType._("DYNAMIC_TYPE"); | |
3767 | |
3768 static const FIELD = const HighlightRegionType._("FIELD"); | |
3769 | |
3770 static const FIELD_STATIC = const HighlightRegionType._("FIELD_STATIC"); | |
3771 | |
3772 static const FUNCTION = const HighlightRegionType._("FUNCTION"); | |
3773 | |
3774 static const FUNCTION_DECLARATION = const HighlightRegionType._("FUNCTION_DECL ARATION"); | |
3775 | |
3776 static const FUNCTION_TYPE_ALIAS = const HighlightRegionType._("FUNCTION_TYPE_ ALIAS"); | |
3777 | |
3778 static const GETTER_DECLARATION = const HighlightRegionType._("GETTER_DECLARAT ION"); | |
3779 | |
3780 static const IDENTIFIER_DEFAULT = const HighlightRegionType._("IDENTIFIER_DEFA ULT"); | |
3781 | |
3782 static const IMPORT_PREFIX = const HighlightRegionType._("IMPORT_PREFIX"); | |
3783 | |
3784 static const KEYWORD = const HighlightRegionType._("KEYWORD"); | |
3785 | |
3786 static const LITERAL_BOOLEAN = const HighlightRegionType._("LITERAL_BOOLEAN"); | |
3787 | |
3788 static const LITERAL_DOUBLE = const HighlightRegionType._("LITERAL_DOUBLE"); | |
3789 | |
3790 static const LITERAL_INTEGER = const HighlightRegionType._("LITERAL_INTEGER"); | |
3791 | |
3792 static const LITERAL_LIST = const HighlightRegionType._("LITERAL_LIST"); | |
3793 | |
3794 static const LITERAL_MAP = const HighlightRegionType._("LITERAL_MAP"); | |
3795 | |
3796 static const LITERAL_STRING = const HighlightRegionType._("LITERAL_STRING"); | |
3797 | |
3798 static const LOCAL_VARIABLE = const HighlightRegionType._("LOCAL_VARIABLE"); | |
3799 | |
3800 static const LOCAL_VARIABLE_DECLARATION = const HighlightRegionType._("LOCAL_V ARIABLE_DECLARATION"); | |
3801 | |
3802 static const METHOD = const HighlightRegionType._("METHOD"); | |
3803 | |
3804 static const METHOD_DECLARATION = const HighlightRegionType._("METHOD_DECLARAT ION"); | |
3805 | |
3806 static const METHOD_DECLARATION_STATIC = const HighlightRegionType._("METHOD_D ECLARATION_STATIC"); | |
3807 | |
3808 static const METHOD_STATIC = const HighlightRegionType._("METHOD_STATIC"); | |
3809 | |
3810 static const PARAMETER = const HighlightRegionType._("PARAMETER"); | |
3811 | |
3812 static const SETTER_DECLARATION = const HighlightRegionType._("SETTER_DECLARAT ION"); | |
3813 | |
3814 static const TOP_LEVEL_VARIABLE = const HighlightRegionType._("TOP_LEVEL_VARIA BLE"); | |
3815 | |
3816 static const TYPE_NAME_DYNAMIC = const HighlightRegionType._("TYPE_NAME_DYNAMI C"); | |
3817 | |
3818 static const TYPE_PARAMETER = const HighlightRegionType._("TYPE_PARAMETER"); | |
3819 | |
3820 final String name; | |
3821 | |
3822 const HighlightRegionType._(this.name); | |
3823 | |
3824 factory HighlightRegionType(String name) { | |
3825 switch (name) { | |
3826 case "ANNOTATION": | |
3827 return ANNOTATION; | |
3828 case "BUILT_IN": | |
3829 return BUILT_IN; | |
3830 case "CLASS": | |
3831 return CLASS; | |
3832 case "COMMENT_BLOCK": | |
3833 return COMMENT_BLOCK; | |
3834 case "COMMENT_DOCUMENTATION": | |
3835 return COMMENT_DOCUMENTATION; | |
3836 case "COMMENT_END_OF_LINE": | |
3837 return COMMENT_END_OF_LINE; | |
3838 case "CONSTRUCTOR": | |
3839 return CONSTRUCTOR; | |
3840 case "DIRECTIVE": | |
3841 return DIRECTIVE; | |
3842 case "DYNAMIC_TYPE": | |
3843 return DYNAMIC_TYPE; | |
3844 case "FIELD": | |
3845 return FIELD; | |
3846 case "FIELD_STATIC": | |
3847 return FIELD_STATIC; | |
3848 case "FUNCTION": | |
3849 return FUNCTION; | |
3850 case "FUNCTION_DECLARATION": | |
3851 return FUNCTION_DECLARATION; | |
3852 case "FUNCTION_TYPE_ALIAS": | |
3853 return FUNCTION_TYPE_ALIAS; | |
3854 case "GETTER_DECLARATION": | |
3855 return GETTER_DECLARATION; | |
3856 case "IDENTIFIER_DEFAULT": | |
3857 return IDENTIFIER_DEFAULT; | |
3858 case "IMPORT_PREFIX": | |
3859 return IMPORT_PREFIX; | |
3860 case "KEYWORD": | |
3861 return KEYWORD; | |
3862 case "LITERAL_BOOLEAN": | |
3863 return LITERAL_BOOLEAN; | |
3864 case "LITERAL_DOUBLE": | |
3865 return LITERAL_DOUBLE; | |
3866 case "LITERAL_INTEGER": | |
3867 return LITERAL_INTEGER; | |
3868 case "LITERAL_LIST": | |
3869 return LITERAL_LIST; | |
3870 case "LITERAL_MAP": | |
3871 return LITERAL_MAP; | |
3872 case "LITERAL_STRING": | |
3873 return LITERAL_STRING; | |
3874 case "LOCAL_VARIABLE": | |
3875 return LOCAL_VARIABLE; | |
3876 case "LOCAL_VARIABLE_DECLARATION": | |
3877 return LOCAL_VARIABLE_DECLARATION; | |
3878 case "METHOD": | |
3879 return METHOD; | |
3880 case "METHOD_DECLARATION": | |
3881 return METHOD_DECLARATION; | |
3882 case "METHOD_DECLARATION_STATIC": | |
3883 return METHOD_DECLARATION_STATIC; | |
3884 case "METHOD_STATIC": | |
3885 return METHOD_STATIC; | |
3886 case "PARAMETER": | |
3887 return PARAMETER; | |
3888 case "SETTER_DECLARATION": | |
3889 return SETTER_DECLARATION; | |
3890 case "TOP_LEVEL_VARIABLE": | |
3891 return TOP_LEVEL_VARIABLE; | |
3892 case "TYPE_NAME_DYNAMIC": | |
3893 return TYPE_NAME_DYNAMIC; | |
3894 case "TYPE_PARAMETER": | |
3895 return TYPE_PARAMETER; | |
3896 } | |
3897 throw new Exception('Illegal enum value: $name'); | |
3898 } | |
3899 | |
3900 String toString() => "HighlightRegionType.$name"; | |
3901 | |
3902 String toJson() => name; | |
3903 } | |
3904 | |
3905 /** | |
3906 * HoverInformation | |
3907 * | |
3908 * { | |
3909 * "offset": int | |
3910 * "length": int | |
3911 * "containingLibraryPath": optional String | |
3912 * "containingLibraryName": optional String | |
3913 * "dartdoc": optional String | |
3914 * "elementDescription": optional String | |
3915 * "elementKind": optional String | |
3916 * "parameter": optional String | |
3917 * "propagatedType": optional String | |
3918 * "staticType": optional String | |
3919 * } | |
3920 */ | |
3921 class HoverInformation { | |
3922 /** | |
3923 * The offset of the range of characters that encompases the cursor position | |
3924 * and has the same hover information as the cursor position. | |
3925 */ | |
3926 final int offset; | |
3927 | |
3928 /** | |
3929 * The length of the range of characters that encompases the cursor position | |
3930 * and has the same hover information as the cursor position. | |
3931 */ | |
3932 final int length; | |
3933 | |
3934 /** | |
3935 * The path to the defining compilation unit of the library in which the | |
3936 * referenced element is declared. This data is omitted if there is no | |
3937 * referenced element. | |
3938 */ | |
3939 final String containingLibraryPath; | |
3940 | |
3941 /** | |
3942 * The name of the library in which the referenced element is declared. This | |
3943 * data is omitted if there is no referenced element. | |
3944 */ | |
3945 final String containingLibraryName; | |
3946 | |
3947 /** | |
3948 * The dartdoc associated with the referenced element. Other than the removal | |
3949 * of the comment delimiters, including leading asterisks in the case of a | |
3950 * block comment, the dartdoc is unprocessed markdown. This data is omitted | |
3951 * if there is no referenced element. | |
3952 */ | |
3953 final String dartdoc; | |
3954 | |
3955 /** | |
3956 * A human-readable description of the element being referenced. This data is | |
3957 * omitted if there is no referenced element. | |
3958 */ | |
3959 final String elementDescription; | |
3960 | |
3961 /** | |
3962 * A human-readable description of the kind of element being referenced (such | |
3963 * as “class” or “function type alias”). This data is omitted if there is no | |
3964 * referenced element. | |
3965 */ | |
3966 final String elementKind; | |
3967 | |
3968 /** | |
3969 * A human-readable description of the parameter corresponding to the | |
3970 * expression being hovered over. This data is omitted if the location is not | |
3971 * in an argument to a function. | |
3972 */ | |
3973 final String parameter; | |
3974 | |
3975 /** | |
3976 * The name of the propagated type of the expression. This data is omitted if | |
3977 * the location does not correspond to an expression or if there is no | |
3978 * propagated type information. | |
3979 */ | |
3980 final String propagatedType; | |
3981 | |
3982 /** | |
3983 * The name of the static type of the expression. This data is omitted if the | |
3984 * location does not correspond to an expression. | |
3985 */ | |
3986 final String staticType; | |
3987 | |
3988 HoverInformation(this.offset, this.length, {this.containingLibraryPath, this.c ontainingLibraryName, this.dartdoc, this.elementDescription, this.elementKind, t his.parameter, this.propagatedType, this.staticType}); | |
3989 | |
3990 Map<String, dynamic> toJson() { | |
3991 Map<String, dynamic> result = {}; | |
3992 result["offset"] = offset; | |
3993 result["length"] = length; | |
3994 if (containingLibraryPath != null) { | |
3995 result["containingLibraryPath"] = containingLibraryPath; | |
3996 } | |
3997 if (containingLibraryName != null) { | |
3998 result["containingLibraryName"] = containingLibraryName; | |
3999 } | |
4000 if (dartdoc != null) { | |
4001 result["dartdoc"] = dartdoc; | |
4002 } | |
4003 if (elementDescription != null) { | |
4004 result["elementDescription"] = elementDescription; | |
4005 } | |
4006 if (elementKind != null) { | |
4007 result["elementKind"] = elementKind; | |
4008 } | |
4009 if (parameter != null) { | |
4010 result["parameter"] = parameter; | |
4011 } | |
4012 if (propagatedType != null) { | |
4013 result["propagatedType"] = propagatedType; | |
4014 } | |
4015 if (staticType != null) { | |
4016 result["staticType"] = staticType; | |
4017 } | |
4018 return result; | |
4019 } | |
4020 | |
4021 String toString() => JSON.encode(toJson()); | |
4022 | |
4023 bool operator==(other) { | |
4024 if (other is HoverInformation) { | |
4025 return offset == other.offset && | |
4026 length == other.length && | |
4027 containingLibraryPath == other.containingLibraryPath && | |
4028 containingLibraryName == other.containingLibraryName && | |
4029 dartdoc == other.dartdoc && | |
4030 elementDescription == other.elementDescription && | |
4031 elementKind == other.elementKind && | |
4032 parameter == other.parameter && | |
4033 propagatedType == other.propagatedType && | |
4034 staticType == other.staticType; | |
4035 } | |
4036 return false; | |
4037 } | |
4038 | |
4039 int get hashCode { | |
4040 int hash = 0; | |
4041 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
4042 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
4043 hash = _JenkinsSmiHash.combine(hash, containingLibraryPath.hashCode); | |
4044 hash = _JenkinsSmiHash.combine(hash, containingLibraryName.hashCode); | |
4045 hash = _JenkinsSmiHash.combine(hash, dartdoc.hashCode); | |
4046 hash = _JenkinsSmiHash.combine(hash, elementDescription.hashCode); | |
4047 hash = _JenkinsSmiHash.combine(hash, elementKind.hashCode); | |
4048 hash = _JenkinsSmiHash.combine(hash, parameter.hashCode); | |
4049 hash = _JenkinsSmiHash.combine(hash, propagatedType.hashCode); | |
4050 hash = _JenkinsSmiHash.combine(hash, staticType.hashCode); | |
4051 return _JenkinsSmiHash.finish(hash); | |
4052 } | |
4053 } | |
4054 | |
4055 /** | |
4056 * LinkedEditGroup | |
4057 * | |
4058 * { | |
4059 * "positions": List<Position> | |
4060 * "length": int | |
4061 * "suggestions": List<LinkedEditSuggestion> | |
4062 * } | |
4063 */ | |
4064 class LinkedEditGroup { | |
4065 /** | |
4066 * The positions of the regions that should be edited simultaneously. | |
4067 */ | |
4068 final List<Position> positions; | |
4069 | |
4070 /** | |
4071 * The length of the regions that should be edited simultaneously. | |
4072 */ | |
4073 final int length; | |
4074 | |
4075 /** | |
4076 * Pre-computed suggestions for what every region might want to be changed | |
4077 * to. | |
4078 */ | |
4079 final List<LinkedEditSuggestion> suggestions; | |
4080 | |
4081 LinkedEditGroup(this.positions, this.length, this.suggestions); | |
4082 | |
4083 Map<String, dynamic> toJson() { | |
4084 Map<String, dynamic> result = {}; | |
4085 result["positions"] = positions.map((Position value) => value.toJson()); | |
4086 result["length"] = length; | |
4087 result["suggestions"] = suggestions.map((LinkedEditSuggestion value) => valu e.toJson()); | |
4088 return result; | |
4089 } | |
4090 | |
4091 String toString() => JSON.encode(toJson()); | |
4092 | |
4093 bool operator==(other) { | |
4094 if (other is LinkedEditGroup) { | |
4095 return positions == other.positions && | |
4096 length == other.length && | |
4097 suggestions == other.suggestions; | |
4098 } | |
4099 return false; | |
4100 } | |
4101 | |
4102 int get hashCode { | |
4103 int hash = 0; | |
4104 hash = _JenkinsSmiHash.combine(hash, positions.hashCode); | |
4105 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
4106 hash = _JenkinsSmiHash.combine(hash, suggestions.hashCode); | |
4107 return _JenkinsSmiHash.finish(hash); | |
4108 } | |
4109 } | |
4110 | |
4111 /** | |
4112 * LinkedEditSuggestion | |
4113 * | |
4114 * { | |
4115 * "value": String | |
4116 * "kind": LinkedEditSuggestionKind | |
4117 * } | |
4118 */ | |
4119 class LinkedEditSuggestion { | |
4120 /** | |
4121 * The value that could be used to replace all of the linked edit regions. | |
4122 */ | |
4123 final String value; | |
4124 | |
4125 /** | |
4126 * The kind of value being proposed. | |
4127 */ | |
4128 final LinkedEditSuggestionKind kind; | |
4129 | |
4130 LinkedEditSuggestion(this.value, this.kind); | |
4131 | |
4132 Map<String, dynamic> toJson() { | |
4133 Map<String, dynamic> result = {}; | |
4134 result["value"] = value; | |
4135 result["kind"] = kind.toJson(); | |
4136 return result; | |
4137 } | |
4138 | |
4139 String toString() => JSON.encode(toJson()); | |
4140 | |
4141 bool operator==(other) { | |
4142 if (other is LinkedEditSuggestion) { | |
4143 return value == other.value && | |
4144 kind == other.kind; | |
4145 } | |
4146 return false; | |
4147 } | |
4148 | |
4149 int get hashCode { | |
4150 int hash = 0; | |
4151 hash = _JenkinsSmiHash.combine(hash, value.hashCode); | |
4152 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); | |
4153 return _JenkinsSmiHash.finish(hash); | |
4154 } | |
4155 } | |
4156 | |
4157 /** | |
4158 * LinkedEditSuggestionKind | |
4159 * | |
4160 * enum { | |
4161 * METHOD | |
4162 * PARAMETER | |
4163 * TYPE | |
4164 * VARIABLE | |
4165 * } | |
4166 */ | |
4167 class LinkedEditSuggestionKind { | |
4168 static const METHOD = const LinkedEditSuggestionKind._("METHOD"); | |
4169 | |
4170 static const PARAMETER = const LinkedEditSuggestionKind._("PARAMETER"); | |
4171 | |
4172 static const TYPE = const LinkedEditSuggestionKind._("TYPE"); | |
4173 | |
4174 static const VARIABLE = const LinkedEditSuggestionKind._("VARIABLE"); | |
4175 | |
4176 final String name; | |
4177 | |
4178 const LinkedEditSuggestionKind._(this.name); | |
4179 | |
4180 factory LinkedEditSuggestionKind(String name) { | |
4181 switch (name) { | |
4182 case "METHOD": | |
4183 return METHOD; | |
4184 case "PARAMETER": | |
4185 return PARAMETER; | |
4186 case "TYPE": | |
4187 return TYPE; | |
4188 case "VARIABLE": | |
4189 return VARIABLE; | |
4190 } | |
4191 throw new Exception('Illegal enum value: $name'); | |
4192 } | |
4193 | |
4194 String toString() => "LinkedEditSuggestionKind.$name"; | |
4195 | |
4196 String toJson() => name; | |
4197 } | |
4198 | |
4199 /** | |
4200 * Location | |
4201 * | |
4202 * { | |
4203 * "file": FilePath | |
4204 * "offset": int | |
4205 * "length": int | |
4206 * "startLine": int | |
4207 * "startColumn": int | |
4208 * } | |
4209 */ | |
4210 class Location { | |
4211 /** | |
4212 * The file containing the range. | |
4213 */ | |
4214 final String file; | |
4215 | |
4216 /** | |
4217 * The offset of the range. | |
4218 */ | |
4219 final int offset; | |
4220 | |
4221 /** | |
4222 * The length of the range. | |
4223 */ | |
4224 final int length; | |
4225 | |
4226 /** | |
4227 * The one-based index of the line containing the first character of the | |
4228 * range. | |
4229 */ | |
4230 final int startLine; | |
4231 | |
4232 /** | |
4233 * The one-based index of the column containing the first character of the | |
4234 * range. | |
4235 */ | |
4236 final int startColumn; | |
4237 | |
4238 Location(this.file, this.offset, this.length, this.startLine, this.startColumn ); | |
4239 | |
4240 Map<String, dynamic> toJson() { | |
4241 Map<String, dynamic> result = {}; | |
4242 result["file"] = file; | |
4243 result["offset"] = offset; | |
4244 result["length"] = length; | |
4245 result["startLine"] = startLine; | |
4246 result["startColumn"] = startColumn; | |
4247 return result; | |
4248 } | |
4249 | |
4250 String toString() => JSON.encode(toJson()); | |
4251 | |
4252 bool operator==(other) { | |
4253 if (other is Location) { | |
4254 return file == other.file && | |
4255 offset == other.offset && | |
4256 length == other.length && | |
4257 startLine == other.startLine && | |
4258 startColumn == other.startColumn; | |
4259 } | |
4260 return false; | |
4261 } | |
4262 | |
4263 int get hashCode { | |
4264 int hash = 0; | |
4265 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
4266 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
4267 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
4268 hash = _JenkinsSmiHash.combine(hash, startLine.hashCode); | |
4269 hash = _JenkinsSmiHash.combine(hash, startColumn.hashCode); | |
4270 return _JenkinsSmiHash.finish(hash); | |
4271 } | |
4272 } | |
4273 | |
4274 /** | |
4275 * NavigationRegion | |
4276 * | |
4277 * { | |
4278 * "offset": int | |
4279 * "length": int | |
4280 * "targets": List<Element> | |
4281 * } | |
4282 */ | |
4283 class NavigationRegion { | |
4284 /** | |
4285 * The offset of the region from which the user can navigate. | |
4286 */ | |
4287 final int offset; | |
4288 | |
4289 /** | |
4290 * The length of the region from which the user can navigate. | |
4291 */ | |
4292 final int length; | |
4293 | |
4294 /** | |
4295 * The elements to which the given region is bound. By opening the | |
4296 * declaration of the elements, clients can implement one form of navigation. | |
4297 */ | |
4298 final List<Element> targets; | |
4299 | |
4300 NavigationRegion(this.offset, this.length, this.targets); | |
4301 | |
4302 Map<String, dynamic> toJson() { | |
4303 Map<String, dynamic> result = {}; | |
4304 result["offset"] = offset; | |
4305 result["length"] = length; | |
4306 result["targets"] = targets.map((Element value) => value.toJson()); | |
4307 return result; | |
4308 } | |
4309 | |
4310 String toString() => JSON.encode(toJson()); | |
4311 | |
4312 bool operator==(other) { | |
4313 if (other is NavigationRegion) { | |
4314 return offset == other.offset && | |
4315 length == other.length && | |
4316 targets == other.targets; | |
4317 } | |
4318 return false; | |
4319 } | |
4320 | |
4321 int get hashCode { | |
4322 int hash = 0; | |
4323 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
4324 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
4325 hash = _JenkinsSmiHash.combine(hash, targets.hashCode); | |
4326 return _JenkinsSmiHash.finish(hash); | |
4327 } | |
4328 } | |
4329 | |
4330 /** | |
4331 * Occurrences | |
4332 * | |
4333 * { | |
4334 * "element": Element | |
4335 * "offsets": List<int> | |
4336 * "length": int | |
4337 * } | |
4338 */ | |
4339 class Occurrences { | |
4340 /** | |
4341 * The element that was referenced. | |
4342 */ | |
4343 final Element element; | |
4344 | |
4345 /** | |
4346 * The offsets of the name of the referenced element within the file. | |
4347 */ | |
4348 final List<int> offsets; | |
4349 | |
4350 /** | |
4351 * The length of the name of the referenced element. | |
4352 */ | |
4353 final int length; | |
4354 | |
4355 Occurrences(this.element, this.offsets, this.length); | |
4356 | |
4357 Map<String, dynamic> toJson() { | |
4358 Map<String, dynamic> result = {}; | |
4359 result["element"] = element.toJson(); | |
4360 result["offsets"] = offsets; | |
4361 result["length"] = length; | |
4362 return result; | |
4363 } | |
4364 | |
4365 String toString() => JSON.encode(toJson()); | |
4366 | |
4367 bool operator==(other) { | |
4368 if (other is Occurrences) { | |
4369 return element == other.element && | |
4370 offsets == other.offsets && | |
scheglov
2014/08/17 19:21:06
This code prints "false".
main() {
var a = [1,
Paul Berry
2014/08/17 23:47:07
Whoops. Good catch. I'll remedy this tomorrow.
Paul Berry
2014/08/18 21:58:03
Fixed.
| |
4371 length == other.length; | |
4372 } | |
4373 return false; | |
4374 } | |
4375 | |
4376 int get hashCode { | |
4377 int hash = 0; | |
4378 hash = _JenkinsSmiHash.combine(hash, element.hashCode); | |
4379 hash = _JenkinsSmiHash.combine(hash, offsets.hashCode); | |
4380 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
4381 return _JenkinsSmiHash.finish(hash); | |
4382 } | |
4383 } | |
4384 | |
4385 /** | |
4386 * Outline | |
4387 * | |
4388 * { | |
4389 * "element": Element | |
4390 * "offset": int | |
4391 * "length": int | |
4392 * "children": optional List<Outline> | |
4393 * } | |
4394 */ | |
4395 class Outline { | |
4396 /** | |
4397 * A description of the element represented by this node. | |
4398 */ | |
4399 final Element element; | |
4400 | |
4401 /** | |
4402 * The offset of the first character of the element. This is different than | |
4403 * the offset in the Element, which if the offset of the name of the element. | |
4404 * It can be used, for example, to map locations in the file back to an | |
4405 * outline. | |
4406 */ | |
4407 final int offset; | |
4408 | |
4409 /** | |
4410 * The length of the element. | |
4411 */ | |
4412 final int length; | |
4413 | |
4414 /** | |
4415 * The children of the node. The field will be omitted if the node has no | |
4416 * children. | |
4417 */ | |
4418 final List<Outline> children; | |
4419 | |
4420 Outline(this.element, this.offset, this.length, {this.children}); | |
4421 | |
4422 Map<String, dynamic> toJson() { | |
4423 Map<String, dynamic> result = {}; | |
4424 result["element"] = element.toJson(); | |
4425 result["offset"] = offset; | |
4426 result["length"] = length; | |
4427 if (children != null) { | |
4428 result["children"] = children.map((Outline value) => value.toJson()); | |
4429 } | |
4430 return result; | |
4431 } | |
4432 | |
4433 String toString() => JSON.encode(toJson()); | |
4434 | |
4435 bool operator==(other) { | |
4436 if (other is Outline) { | |
4437 return element == other.element && | |
4438 offset == other.offset && | |
4439 length == other.length && | |
4440 children == other.children; | |
4441 } | |
4442 return false; | |
4443 } | |
4444 | |
4445 int get hashCode { | |
4446 int hash = 0; | |
4447 hash = _JenkinsSmiHash.combine(hash, element.hashCode); | |
4448 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
4449 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
4450 hash = _JenkinsSmiHash.combine(hash, children.hashCode); | |
4451 return _JenkinsSmiHash.finish(hash); | |
4452 } | |
4453 } | |
4454 | |
4455 /** | |
4456 * Override | |
4457 * | |
4458 * { | |
4459 * "offset": int | |
4460 * "length": int | |
4461 * "superclassMember": optional OverriddenMember | |
4462 * "interfaceMembers": optional List<OverriddenMember> | |
4463 * } | |
4464 */ | |
4465 class Override { | |
4466 /** | |
4467 * The offset of the name of the overriding member. | |
4468 */ | |
4469 final int offset; | |
4470 | |
4471 /** | |
4472 * The length of the name of the overriding member. | |
4473 */ | |
4474 final int length; | |
4475 | |
4476 /** | |
4477 * The member inherited from a superclass that is overridden by the | |
4478 * overriding member. The field is omitted if there is no superclass member, | |
4479 * in which case there must be at least one interface member. | |
4480 */ | |
4481 final OverriddenMember superclassMember; | |
4482 | |
4483 /** | |
4484 * The members inherited from interfaces that are overridden by the | |
4485 * overriding member. The field is omitted if there are no interface members, | |
4486 * in which case there must be a superclass member. | |
4487 */ | |
4488 final List<OverriddenMember> interfaceMembers; | |
4489 | |
4490 Override(this.offset, this.length, {this.superclassMember, this.interfaceMembe rs}); | |
4491 | |
4492 Map<String, dynamic> toJson() { | |
4493 Map<String, dynamic> result = {}; | |
4494 result["offset"] = offset; | |
4495 result["length"] = length; | |
4496 if (superclassMember != null) { | |
4497 result["superclassMember"] = superclassMember.toJson(); | |
4498 } | |
4499 if (interfaceMembers != null) { | |
4500 result["interfaceMembers"] = interfaceMembers.map((OverriddenMember value) => value.toJson()); | |
4501 } | |
4502 return result; | |
4503 } | |
4504 | |
4505 String toString() => JSON.encode(toJson()); | |
4506 | |
4507 bool operator==(other) { | |
4508 if (other is Override) { | |
4509 return offset == other.offset && | |
4510 length == other.length && | |
4511 superclassMember == other.superclassMember && | |
4512 interfaceMembers == other.interfaceMembers; | |
4513 } | |
4514 return false; | |
4515 } | |
4516 | |
4517 int get hashCode { | |
4518 int hash = 0; | |
4519 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
4520 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
4521 hash = _JenkinsSmiHash.combine(hash, superclassMember.hashCode); | |
4522 hash = _JenkinsSmiHash.combine(hash, interfaceMembers.hashCode); | |
4523 return _JenkinsSmiHash.finish(hash); | |
4524 } | |
4525 } | |
4526 | |
4527 /** | |
4528 * OverriddenMember | |
4529 * | |
4530 * { | |
4531 * "element": Element | |
4532 * "className": String | |
4533 * } | |
4534 */ | |
4535 class OverriddenMember { | |
4536 /** | |
4537 * The element that is being overridden. | |
4538 */ | |
4539 final Element element; | |
4540 | |
4541 /** | |
4542 * The name of the class in which the member is defined. | |
4543 */ | |
4544 final String className; | |
4545 | |
4546 OverriddenMember(this.element, this.className); | |
4547 | |
4548 Map<String, dynamic> toJson() { | |
4549 Map<String, dynamic> result = {}; | |
4550 result["element"] = element.toJson(); | |
4551 result["className"] = className; | |
4552 return result; | |
4553 } | |
4554 | |
4555 String toString() => JSON.encode(toJson()); | |
4556 | |
4557 bool operator==(other) { | |
4558 if (other is OverriddenMember) { | |
4559 return element == other.element && | |
4560 className == other.className; | |
4561 } | |
4562 return false; | |
4563 } | |
4564 | |
4565 int get hashCode { | |
4566 int hash = 0; | |
4567 hash = _JenkinsSmiHash.combine(hash, element.hashCode); | |
4568 hash = _JenkinsSmiHash.combine(hash, className.hashCode); | |
4569 return _JenkinsSmiHash.finish(hash); | |
4570 } | |
4571 } | |
4572 | |
4573 /** | |
4574 * Position | |
4575 * | |
4576 * { | |
4577 * "file": FilePath | |
4578 * "offset": int | |
4579 * } | |
4580 */ | |
4581 class Position { | |
4582 /** | |
4583 * The file containing the position. | |
4584 */ | |
4585 final String file; | |
4586 | |
4587 /** | |
4588 * The offset of the position. | |
4589 */ | |
4590 final int offset; | |
4591 | |
4592 Position(this.file, this.offset); | |
4593 | |
4594 Map<String, dynamic> toJson() { | |
4595 Map<String, dynamic> result = {}; | |
4596 result["file"] = file; | |
4597 result["offset"] = offset; | |
4598 return result; | |
4599 } | |
4600 | |
4601 String toString() => JSON.encode(toJson()); | |
4602 | |
4603 bool operator==(other) { | |
4604 if (other is Position) { | |
4605 return file == other.file && | |
4606 offset == other.offset; | |
4607 } | |
4608 return false; | |
4609 } | |
4610 | |
4611 int get hashCode { | |
4612 int hash = 0; | |
4613 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
4614 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
4615 return _JenkinsSmiHash.finish(hash); | |
4616 } | |
4617 } | |
4618 | |
4619 /** | |
4620 * RefactoringKind | |
4621 * | |
4622 * enum { | |
4623 * CONVERT_GETTER_TO_METHOD | |
4624 * CONVERT_METHOD_TO_GETTER | |
4625 * EXTRACT_LOCAL_VARIABLE | |
4626 * EXTRACT_METHOD | |
4627 * INLINE_LOCAL_VARIABLE | |
4628 * INLINE_METHOD | |
4629 * RENAME | |
4630 * } | |
4631 */ | |
4632 class RefactoringKind { | |
4633 static const CONVERT_GETTER_TO_METHOD = const RefactoringKind._("CONVERT_GETTE R_TO_METHOD"); | |
4634 | |
4635 static const CONVERT_METHOD_TO_GETTER = const RefactoringKind._("CONVERT_METHO D_TO_GETTER"); | |
4636 | |
4637 static const EXTRACT_LOCAL_VARIABLE = const RefactoringKind._("EXTRACT_LOCAL_V ARIABLE"); | |
4638 | |
4639 static const EXTRACT_METHOD = const RefactoringKind._("EXTRACT_METHOD"); | |
4640 | |
4641 static const INLINE_LOCAL_VARIABLE = const RefactoringKind._("INLINE_LOCAL_VAR IABLE"); | |
4642 | |
4643 static const INLINE_METHOD = const RefactoringKind._("INLINE_METHOD"); | |
4644 | |
4645 static const RENAME = const RefactoringKind._("RENAME"); | |
4646 | |
4647 final String name; | |
4648 | |
4649 const RefactoringKind._(this.name); | |
4650 | |
4651 factory RefactoringKind(String name) { | |
4652 switch (name) { | |
4653 case "CONVERT_GETTER_TO_METHOD": | |
4654 return CONVERT_GETTER_TO_METHOD; | |
4655 case "CONVERT_METHOD_TO_GETTER": | |
4656 return CONVERT_METHOD_TO_GETTER; | |
4657 case "EXTRACT_LOCAL_VARIABLE": | |
4658 return EXTRACT_LOCAL_VARIABLE; | |
4659 case "EXTRACT_METHOD": | |
4660 return EXTRACT_METHOD; | |
4661 case "INLINE_LOCAL_VARIABLE": | |
4662 return INLINE_LOCAL_VARIABLE; | |
4663 case "INLINE_METHOD": | |
4664 return INLINE_METHOD; | |
4665 case "RENAME": | |
4666 return RENAME; | |
4667 } | |
4668 throw new Exception('Illegal enum value: $name'); | |
4669 } | |
4670 | |
4671 String toString() => "RefactoringKind.$name"; | |
4672 | |
4673 String toJson() => name; | |
4674 } | |
4675 | |
4676 /** | |
4677 * RefactoringMethodParameter | |
4678 * | |
4679 * { | |
4680 * "id": optional String | |
4681 * "kind": RefactoringMethodParameterKind | |
4682 * "type": String | |
4683 * "name": String | |
4684 * "parameters": optional String | |
4685 * } | |
4686 */ | |
4687 class RefactoringMethodParameter { | |
4688 /** | |
4689 * The unique identifier of the parameter. Clients may omit this field for | |
4690 * the parameters they want to add. | |
4691 */ | |
4692 final String id; | |
4693 | |
4694 /** | |
4695 * The kind of the parameter. | |
4696 */ | |
4697 final RefactoringMethodParameterKind kind; | |
4698 | |
4699 /** | |
4700 * The type that should be given to the parameter, or the return type of the | |
4701 * parameter's function type. | |
4702 */ | |
4703 final String type; | |
4704 | |
4705 /** | |
4706 * The name that should be given to the parameter. | |
4707 */ | |
4708 final String name; | |
4709 | |
4710 /** | |
4711 * The parameter list of the parameter's function type. If the parameter is | |
4712 * not of a function type, this field will not be defined. If the function | |
4713 * type has zero parameters, this field will have a value of "()". | |
4714 */ | |
4715 final String parameters; | |
4716 | |
4717 RefactoringMethodParameter(this.kind, this.type, this.name, {this.id, this.par ameters}); | |
4718 | |
4719 Map<String, dynamic> toJson() { | |
4720 Map<String, dynamic> result = {}; | |
4721 if (id != null) { | |
4722 result["id"] = id; | |
4723 } | |
4724 result["kind"] = kind.toJson(); | |
4725 result["type"] = type; | |
4726 result["name"] = name; | |
4727 if (parameters != null) { | |
4728 result["parameters"] = parameters; | |
4729 } | |
4730 return result; | |
4731 } | |
4732 | |
4733 String toString() => JSON.encode(toJson()); | |
4734 | |
4735 bool operator==(other) { | |
4736 if (other is RefactoringMethodParameter) { | |
4737 return id == other.id && | |
4738 kind == other.kind && | |
4739 type == other.type && | |
4740 name == other.name && | |
4741 parameters == other.parameters; | |
4742 } | |
4743 return false; | |
4744 } | |
4745 | |
4746 int get hashCode { | |
4747 int hash = 0; | |
4748 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
4749 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); | |
4750 hash = _JenkinsSmiHash.combine(hash, type.hashCode); | |
4751 hash = _JenkinsSmiHash.combine(hash, name.hashCode); | |
4752 hash = _JenkinsSmiHash.combine(hash, parameters.hashCode); | |
4753 return _JenkinsSmiHash.finish(hash); | |
4754 } | |
4755 } | |
4756 | |
4757 /** | |
4758 * RefactoringMethodParameterKind | |
4759 * | |
4760 * enum { | |
4761 * REQUIRED | |
4762 * POSITIONAL | |
4763 * NAMED | |
4764 * } | |
4765 */ | |
4766 class RefactoringMethodParameterKind { | |
4767 static const REQUIRED = const RefactoringMethodParameterKind._("REQUIRED"); | |
4768 | |
4769 static const POSITIONAL = const RefactoringMethodParameterKind._("POSITIONAL") ; | |
4770 | |
4771 static const NAMED = const RefactoringMethodParameterKind._("NAMED"); | |
4772 | |
4773 final String name; | |
4774 | |
4775 const RefactoringMethodParameterKind._(this.name); | |
4776 | |
4777 factory RefactoringMethodParameterKind(String name) { | |
4778 switch (name) { | |
4779 case "REQUIRED": | |
4780 return REQUIRED; | |
4781 case "POSITIONAL": | |
4782 return POSITIONAL; | |
4783 case "NAMED": | |
4784 return NAMED; | |
4785 } | |
4786 throw new Exception('Illegal enum value: $name'); | |
4787 } | |
4788 | |
4789 String toString() => "RefactoringMethodParameterKind.$name"; | |
4790 | |
4791 String toJson() => name; | |
4792 } | |
4793 | |
4794 /** | |
4795 * RefactoringProblem | |
4796 * | |
4797 * { | |
4798 * "severity": RefactoringProblemSeverity | |
4799 * "message": String | |
4800 * "location": Location | |
4801 * } | |
4802 */ | |
4803 class RefactoringProblem { | |
4804 /** | |
4805 * The severity of the problem being represented. | |
4806 */ | |
4807 final RefactoringProblemSeverity severity; | |
4808 | |
4809 /** | |
4810 * A human-readable description of the problem being represented. | |
4811 */ | |
4812 final String message; | |
4813 | |
4814 /** | |
4815 * The location of the problem being represented. | |
4816 */ | |
4817 final Location location; | |
4818 | |
4819 RefactoringProblem(this.severity, this.message, this.location); | |
4820 | |
4821 Map<String, dynamic> toJson() { | |
4822 Map<String, dynamic> result = {}; | |
4823 result["severity"] = severity.toJson(); | |
4824 result["message"] = message; | |
4825 result["location"] = location.toJson(); | |
4826 return result; | |
4827 } | |
4828 | |
4829 String toString() => JSON.encode(toJson()); | |
4830 | |
4831 bool operator==(other) { | |
4832 if (other is RefactoringProblem) { | |
4833 return severity == other.severity && | |
4834 message == other.message && | |
4835 location == other.location; | |
4836 } | |
4837 return false; | |
4838 } | |
4839 | |
4840 int get hashCode { | |
4841 int hash = 0; | |
4842 hash = _JenkinsSmiHash.combine(hash, severity.hashCode); | |
4843 hash = _JenkinsSmiHash.combine(hash, message.hashCode); | |
4844 hash = _JenkinsSmiHash.combine(hash, location.hashCode); | |
4845 return _JenkinsSmiHash.finish(hash); | |
4846 } | |
4847 } | |
4848 | |
4849 /** | |
4850 * RefactoringProblemSeverity | |
4851 * | |
4852 * enum { | |
4853 * INFO | |
4854 * WARNING | |
4855 * ERROR | |
4856 * FATAL | |
4857 * } | |
4858 */ | |
4859 class RefactoringProblemSeverity { | |
4860 static const INFO = const RefactoringProblemSeverity._("INFO"); | |
4861 | |
4862 static const WARNING = const RefactoringProblemSeverity._("WARNING"); | |
4863 | |
4864 static const ERROR = const RefactoringProblemSeverity._("ERROR"); | |
4865 | |
4866 static const FATAL = const RefactoringProblemSeverity._("FATAL"); | |
4867 | |
4868 final String name; | |
4869 | |
4870 const RefactoringProblemSeverity._(this.name); | |
4871 | |
4872 factory RefactoringProblemSeverity(String name) { | |
4873 switch (name) { | |
4874 case "INFO": | |
4875 return INFO; | |
4876 case "WARNING": | |
4877 return WARNING; | |
4878 case "ERROR": | |
4879 return ERROR; | |
4880 case "FATAL": | |
4881 return FATAL; | |
4882 } | |
4883 throw new Exception('Illegal enum value: $name'); | |
4884 } | |
4885 | |
4886 String toString() => "RefactoringProblemSeverity.$name"; | |
4887 | |
4888 String toJson() => name; | |
4889 } | |
4890 | |
4891 /** | |
4892 * RemoveContentOverlay | |
4893 * | |
4894 * { | |
4895 * "type": "remove" | |
4896 * } | |
4897 */ | |
4898 class RemoveContentOverlay { | |
4899 RemoveContentOverlay(); | |
4900 | |
4901 Map<String, dynamic> toJson() { | |
4902 Map<String, dynamic> result = {}; | |
4903 result["type"] = "remove"; | |
4904 return result; | |
4905 } | |
4906 | |
4907 String toString() => JSON.encode(toJson()); | |
4908 | |
4909 bool operator==(other) { | |
4910 if (other is RemoveContentOverlay) { | |
4911 return true; | |
4912 } | |
4913 return false; | |
4914 } | |
4915 | |
4916 int get hashCode { | |
4917 int hash = 0; | |
4918 hash = _JenkinsSmiHash.combine(hash, 114870849); | |
4919 return _JenkinsSmiHash.finish(hash); | |
4920 } | |
4921 } | |
4922 | |
4923 /** | |
4924 * SearchResult | |
4925 * | |
4926 * { | |
4927 * "location": Location | |
4928 * "kind": SearchResultKind | |
4929 * "isPotential": bool | |
4930 * "path": List<Element> | |
4931 * } | |
4932 */ | |
4933 class SearchResult { | |
4934 /** | |
4935 * The location of the code that matched the search criteria. | |
4936 */ | |
4937 final Location location; | |
4938 | |
4939 /** | |
4940 * The kind of element that was found or the kind of reference that was | |
4941 * found. | |
4942 */ | |
4943 final SearchResultKind kind; | |
4944 | |
4945 /** | |
4946 * True if the result is a potential match but cannot be confirmed to be a | |
4947 * match. For example, if all references to a method m defined in some class | |
4948 * were requested, and a reference to a method m from an unknown class were | |
4949 * found, it would be marked as being a potential match. | |
4950 */ | |
4951 final bool isPotential; | |
4952 | |
4953 /** | |
4954 * The elements that contain the result, starting with the most immediately | |
4955 * enclosing ancestor and ending with the library. | |
4956 */ | |
4957 final List<Element> path; | |
4958 | |
4959 SearchResult(this.location, this.kind, this.isPotential, this.path); | |
4960 | |
4961 Map<String, dynamic> toJson() { | |
4962 Map<String, dynamic> result = {}; | |
4963 result["location"] = location.toJson(); | |
4964 result["kind"] = kind.toJson(); | |
4965 result["isPotential"] = isPotential; | |
4966 result["path"] = path.map((Element value) => value.toJson()); | |
4967 return result; | |
4968 } | |
4969 | |
4970 String toString() => JSON.encode(toJson()); | |
4971 | |
4972 bool operator==(other) { | |
4973 if (other is SearchResult) { | |
4974 return location == other.location && | |
4975 kind == other.kind && | |
4976 isPotential == other.isPotential && | |
4977 path == other.path; | |
4978 } | |
4979 return false; | |
4980 } | |
4981 | |
4982 int get hashCode { | |
4983 int hash = 0; | |
4984 hash = _JenkinsSmiHash.combine(hash, location.hashCode); | |
4985 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); | |
4986 hash = _JenkinsSmiHash.combine(hash, isPotential.hashCode); | |
4987 hash = _JenkinsSmiHash.combine(hash, path.hashCode); | |
4988 return _JenkinsSmiHash.finish(hash); | |
4989 } | |
4990 } | |
4991 | |
4992 /** | |
4993 * SearchResultKind | |
4994 * | |
4995 * enum { | |
4996 * DECLARATION | |
4997 * INVOCATION | |
4998 * READ | |
4999 * READ_WRITE | |
5000 * REFERENCE | |
5001 * WRITE | |
5002 * } | |
5003 */ | |
5004 class SearchResultKind { | |
5005 /** | |
5006 * The declaration of an element. | |
5007 */ | |
5008 static const DECLARATION = const SearchResultKind._("DECLARATION"); | |
5009 | |
5010 /** | |
5011 * The invocation of a function or method. | |
5012 */ | |
5013 static const INVOCATION = const SearchResultKind._("INVOCATION"); | |
5014 | |
5015 /** | |
5016 * A reference to a field, parameter or variable where it is being read. | |
5017 */ | |
5018 static const READ = const SearchResultKind._("READ"); | |
5019 | |
5020 /** | |
5021 * A reference to a field, parameter or variable where it is being read and | |
5022 * written. | |
5023 */ | |
5024 static const READ_WRITE = const SearchResultKind._("READ_WRITE"); | |
5025 | |
5026 /** | |
5027 * A reference to an element. | |
5028 */ | |
5029 static const REFERENCE = const SearchResultKind._("REFERENCE"); | |
5030 | |
5031 /** | |
5032 * A reference to a field, parameter or variable where it is being written. | |
5033 */ | |
5034 static const WRITE = const SearchResultKind._("WRITE"); | |
5035 | |
5036 final String name; | |
5037 | |
5038 const SearchResultKind._(this.name); | |
5039 | |
5040 factory SearchResultKind(String name) { | |
5041 switch (name) { | |
5042 case "DECLARATION": | |
5043 return DECLARATION; | |
5044 case "INVOCATION": | |
5045 return INVOCATION; | |
5046 case "READ": | |
5047 return READ; | |
5048 case "READ_WRITE": | |
5049 return READ_WRITE; | |
5050 case "REFERENCE": | |
5051 return REFERENCE; | |
5052 case "WRITE": | |
5053 return WRITE; | |
5054 } | |
5055 throw new Exception('Illegal enum value: $name'); | |
5056 } | |
5057 | |
5058 String toString() => "SearchResultKind.$name"; | |
5059 | |
5060 String toJson() => name; | |
5061 } | |
5062 | |
5063 /** | |
5064 * ServerService | |
5065 * | |
5066 * enum { | |
5067 * STATUS | |
5068 * } | |
5069 */ | |
5070 class ServerService { | |
5071 static const STATUS = const ServerService._("STATUS"); | |
5072 | |
5073 final String name; | |
5074 | |
5075 const ServerService._(this.name); | |
5076 | |
5077 factory ServerService(String name) { | |
5078 switch (name) { | |
5079 case "STATUS": | |
5080 return STATUS; | |
5081 } | |
5082 throw new Exception('Illegal enum value: $name'); | |
5083 } | |
5084 | |
5085 String toString() => "ServerService.$name"; | |
5086 | |
5087 String toJson() => name; | |
5088 } | |
5089 | |
5090 /** | |
5091 * SourceChange | |
5092 * | |
5093 * { | |
5094 * "message": String | |
5095 * "edits": List<SourceFileEdit> | |
5096 * "linkedEditGroups": List<LinkedEditGroup> | |
5097 * "selection": optional Position | |
5098 * } | |
5099 */ | |
5100 class SourceChange { | |
5101 /** | |
5102 * A human-readable description of the change to be applied. | |
5103 */ | |
5104 final String message; | |
5105 | |
5106 /** | |
5107 * A list of the edits used to effect the change, grouped by file. | |
5108 */ | |
5109 final List<SourceFileEdit> edits; | |
5110 | |
5111 /** | |
5112 * A list of the linked editing groups used to customize the changes that | |
5113 * were made. | |
5114 */ | |
5115 final List<LinkedEditGroup> linkedEditGroups; | |
5116 | |
5117 /** | |
5118 * The position that should be selected after the edits have been applied. | |
5119 */ | |
5120 final Position selection; | |
5121 | |
5122 SourceChange(this.message, this.edits, this.linkedEditGroups, {this.selection} ); | |
5123 | |
5124 Map<String, dynamic> toJson() { | |
5125 Map<String, dynamic> result = {}; | |
5126 result["message"] = message; | |
5127 result["edits"] = edits.map((SourceFileEdit value) => value.toJson()); | |
5128 result["linkedEditGroups"] = linkedEditGroups.map((LinkedEditGroup value) => value.toJson()); | |
5129 if (selection != null) { | |
5130 result["selection"] = selection.toJson(); | |
5131 } | |
5132 return result; | |
5133 } | |
5134 | |
5135 String toString() => JSON.encode(toJson()); | |
5136 | |
5137 bool operator==(other) { | |
5138 if (other is SourceChange) { | |
5139 return message == other.message && | |
5140 edits == other.edits && | |
5141 linkedEditGroups == other.linkedEditGroups && | |
5142 selection == other.selection; | |
5143 } | |
5144 return false; | |
5145 } | |
5146 | |
5147 int get hashCode { | |
5148 int hash = 0; | |
5149 hash = _JenkinsSmiHash.combine(hash, message.hashCode); | |
5150 hash = _JenkinsSmiHash.combine(hash, edits.hashCode); | |
5151 hash = _JenkinsSmiHash.combine(hash, linkedEditGroups.hashCode); | |
5152 hash = _JenkinsSmiHash.combine(hash, selection.hashCode); | |
5153 return _JenkinsSmiHash.finish(hash); | |
5154 } | |
5155 } | |
5156 | |
5157 /** | |
5158 * SourceEdit | |
5159 * | |
5160 * { | |
5161 * "offset": int | |
5162 * "length": int | |
5163 * "replacement": String | |
5164 * "id": optional String | |
5165 * } | |
5166 */ | |
5167 class SourceEdit { | |
5168 /** | |
5169 * The offset of the region to be modified. | |
5170 */ | |
5171 final int offset; | |
5172 | |
5173 /** | |
5174 * The length of the region to be modified. | |
5175 */ | |
5176 final int length; | |
5177 | |
5178 /** | |
5179 * The code that is to replace the specified region in the original code. | |
5180 */ | |
5181 final String replacement; | |
5182 | |
5183 /** | |
5184 * An identifier that uniquely identifies this source edit from other edits | |
5185 * in the same response. This field is omitted unless a containing structure | |
5186 * needs to be able to identify the edit for some reason. | |
5187 * | |
5188 * For example, some refactoring operations can produce edits that might not | |
5189 * be appropriate (referred to as potential edits). Such edits will have an | |
5190 * id so that they can be referenced. Edits in the same response that do not | |
5191 * need to be referenced will not have an id. | |
5192 */ | |
5193 final String id; | |
5194 | |
5195 SourceEdit(this.offset, this.length, this.replacement, {this.id}); | |
5196 | |
5197 Map<String, dynamic> toJson() { | |
5198 Map<String, dynamic> result = {}; | |
5199 result["offset"] = offset; | |
5200 result["length"] = length; | |
5201 result["replacement"] = replacement; | |
5202 if (id != null) { | |
5203 result["id"] = id; | |
5204 } | |
5205 return result; | |
5206 } | |
5207 | |
5208 String toString() => JSON.encode(toJson()); | |
5209 | |
5210 bool operator==(other) { | |
5211 if (other is SourceEdit) { | |
5212 return offset == other.offset && | |
5213 length == other.length && | |
5214 replacement == other.replacement && | |
5215 id == other.id; | |
5216 } | |
5217 return false; | |
5218 } | |
5219 | |
5220 int get hashCode { | |
5221 int hash = 0; | |
5222 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
5223 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
5224 hash = _JenkinsSmiHash.combine(hash, replacement.hashCode); | |
5225 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
5226 return _JenkinsSmiHash.finish(hash); | |
5227 } | |
5228 } | |
5229 | |
5230 /** | |
5231 * SourceFileEdit | |
5232 * | |
5233 * { | |
5234 * "file": FilePath | |
5235 * "edits": List<SourceEdit> | |
5236 * } | |
5237 */ | |
5238 class SourceFileEdit { | |
5239 /** | |
5240 * The file containing the code to be modified. | |
5241 */ | |
5242 final String file; | |
5243 | |
5244 /** | |
5245 * A list of the edits used to effect the change. | |
5246 */ | |
5247 final List<SourceEdit> edits; | |
5248 | |
5249 SourceFileEdit(this.file, this.edits); | |
5250 | |
5251 Map<String, dynamic> toJson() { | |
5252 Map<String, dynamic> result = {}; | |
5253 result["file"] = file; | |
5254 result["edits"] = edits.map((SourceEdit value) => value.toJson()); | |
5255 return result; | |
5256 } | |
5257 | |
5258 String toString() => JSON.encode(toJson()); | |
5259 | |
5260 bool operator==(other) { | |
5261 if (other is SourceFileEdit) { | |
5262 return file == other.file && | |
5263 edits == other.edits; | |
5264 } | |
5265 return false; | |
5266 } | |
5267 | |
5268 int get hashCode { | |
5269 int hash = 0; | |
5270 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
5271 hash = _JenkinsSmiHash.combine(hash, edits.hashCode); | |
5272 return _JenkinsSmiHash.finish(hash); | |
5273 } | |
5274 } | |
5275 | |
5276 /** | |
5277 * TypeHierarchyItem | |
5278 * | |
5279 * { | |
5280 * "classElement": Element | |
5281 * "displayName": optional String | |
5282 * "memberElement": optional Element | |
5283 * "superclass": optional int | |
5284 * "interfaces": List<int> | |
5285 * "mixins": List<int> | |
5286 * "subclasses": List<int> | |
5287 * } | |
5288 */ | |
5289 class TypeHierarchyItem { | |
5290 /** | |
5291 * The class element represented by this item. | |
5292 */ | |
5293 final Element classElement; | |
5294 | |
5295 /** | |
5296 * The name to be displayed for the class. This field will be omitted if the | |
5297 * display name is the same as the name of the element. The display name is | |
5298 * different if there is additional type information to be displayed, such as | |
5299 * type arguments. | |
5300 */ | |
5301 final String displayName; | |
5302 | |
5303 /** | |
5304 * The member in the class corresponding to the member on which the hierarchy | |
5305 * was requested. This field will be omitted if the hierarchy was not | |
5306 * requested for a member or if the class does not have a corresponding | |
5307 * member. | |
5308 */ | |
5309 final Element memberElement; | |
5310 | |
5311 /** | |
5312 * The index of the item representing the superclass of this class. This | |
5313 * field will be omitted if this item represents the class Object. | |
5314 */ | |
5315 final int superclass; | |
5316 | |
5317 /** | |
5318 * The indexes of the items representing the interfaces implemented by this | |
5319 * class. The list will be empty if there are no implemented interfaces. | |
5320 */ | |
5321 final List<int> interfaces; | |
5322 | |
5323 /** | |
5324 * The indexes of the items representing the mixins referenced by this class. | |
5325 * The list will be empty if there are no classes mixed in to this class. | |
5326 */ | |
5327 final List<int> mixins; | |
5328 | |
5329 /** | |
5330 * The indexes of the items representing the subtypes of this class. The list | |
5331 * will be empty if there are no subtypes or if this item represents a | |
5332 * supertype of the pivot type. | |
5333 */ | |
5334 final List<int> subclasses; | |
5335 | |
5336 TypeHierarchyItem(this.classElement, this.interfaces, this.mixins, this.subcla sses, {this.displayName, this.memberElement, this.superclass}); | |
5337 | |
5338 Map<String, dynamic> toJson() { | |
5339 Map<String, dynamic> result = {}; | |
5340 result["classElement"] = classElement.toJson(); | |
5341 if (displayName != null) { | |
5342 result["displayName"] = displayName; | |
5343 } | |
5344 if (memberElement != null) { | |
5345 result["memberElement"] = memberElement.toJson(); | |
5346 } | |
5347 if (superclass != null) { | |
5348 result["superclass"] = superclass; | |
5349 } | |
5350 result["interfaces"] = interfaces; | |
5351 result["mixins"] = mixins; | |
5352 result["subclasses"] = subclasses; | |
5353 return result; | |
5354 } | |
5355 | |
5356 String toString() => JSON.encode(toJson()); | |
5357 | |
5358 bool operator==(other) { | |
5359 if (other is TypeHierarchyItem) { | |
5360 return classElement == other.classElement && | |
5361 displayName == other.displayName && | |
5362 memberElement == other.memberElement && | |
5363 superclass == other.superclass && | |
5364 interfaces == other.interfaces && | |
5365 mixins == other.mixins && | |
5366 subclasses == other.subclasses; | |
5367 } | |
5368 return false; | |
5369 } | |
5370 | |
5371 int get hashCode { | |
5372 int hash = 0; | |
5373 hash = _JenkinsSmiHash.combine(hash, classElement.hashCode); | |
5374 hash = _JenkinsSmiHash.combine(hash, displayName.hashCode); | |
5375 hash = _JenkinsSmiHash.combine(hash, memberElement.hashCode); | |
5376 hash = _JenkinsSmiHash.combine(hash, superclass.hashCode); | |
5377 hash = _JenkinsSmiHash.combine(hash, interfaces.hashCode); | |
5378 hash = _JenkinsSmiHash.combine(hash, mixins.hashCode); | |
5379 hash = _JenkinsSmiHash.combine(hash, subclasses.hashCode); | |
5380 return _JenkinsSmiHash.finish(hash); | |
5381 } | |
5382 } | |
5383 | |
5384 /** | |
5385 * extractLocalVariable feedback | |
5386 * | |
5387 * { | |
5388 * "names": List<String> | |
5389 * "offsets": List<int> | |
5390 * "lengths": List<int> | |
5391 * } | |
5392 */ | |
5393 class ExtractLocalVariableFeedback { | |
5394 /** | |
5395 * The proposed names for the local variable. | |
5396 */ | |
5397 final List<String> names; | |
5398 | |
5399 /** | |
5400 * The offsets of the expressions that would be replaced by a reference to | |
5401 * the variable. | |
5402 */ | |
5403 final List<int> offsets; | |
5404 | |
5405 /** | |
5406 * The lengths of the expressions that would be replaced by a reference to | |
5407 * the variable. The lengths correspond to the offsets. In other words, for a | |
5408 * given expression, if the offset of that expression is offsets[i], then the | |
5409 * length of that expression is lengths[i]. | |
5410 */ | |
5411 final List<int> lengths; | |
5412 | |
5413 ExtractLocalVariableFeedback(this.names, this.offsets, this.lengths); | |
5414 | |
5415 Map<String, dynamic> toJson() { | |
5416 Map<String, dynamic> result = {}; | |
5417 result["names"] = names; | |
5418 result["offsets"] = offsets; | |
5419 result["lengths"] = lengths; | |
5420 return result; | |
5421 } | |
5422 | |
5423 String toString() => JSON.encode(toJson()); | |
5424 | |
5425 bool operator==(other) { | |
5426 if (other is ExtractLocalVariableFeedback) { | |
5427 return names == other.names && | |
5428 offsets == other.offsets && | |
5429 lengths == other.lengths; | |
5430 } | |
5431 return false; | |
5432 } | |
5433 | |
5434 int get hashCode { | |
5435 int hash = 0; | |
5436 hash = _JenkinsSmiHash.combine(hash, names.hashCode); | |
5437 hash = _JenkinsSmiHash.combine(hash, offsets.hashCode); | |
5438 hash = _JenkinsSmiHash.combine(hash, lengths.hashCode); | |
5439 return _JenkinsSmiHash.finish(hash); | |
5440 } | |
5441 } | |
5442 | |
5443 /** | |
5444 * extractLocalVariable options | |
5445 * | |
5446 * { | |
5447 * "name": String | |
5448 * "extractAll": bool | |
5449 * } | |
5450 */ | |
5451 class ExtractLocalVariableOptions { | |
5452 /** | |
5453 * The name that the local variable should be given. | |
5454 */ | |
5455 final String name; | |
5456 | |
5457 /** | |
5458 * True if all occurrences of the expression within the scope in which the | |
5459 * variable will be defined should be replaced by a reference to the local | |
5460 * variable. The expression used to initiate the refactoring will always be | |
5461 * replaced. | |
5462 */ | |
5463 final bool extractAll; | |
5464 | |
5465 ExtractLocalVariableOptions(this.name, this.extractAll); | |
5466 | |
5467 Map<String, dynamic> toJson() { | |
5468 Map<String, dynamic> result = {}; | |
5469 result["name"] = name; | |
5470 result["extractAll"] = extractAll; | |
5471 return result; | |
5472 } | |
5473 | |
5474 String toString() => JSON.encode(toJson()); | |
5475 | |
5476 bool operator==(other) { | |
5477 if (other is ExtractLocalVariableOptions) { | |
5478 return name == other.name && | |
5479 extractAll == other.extractAll; | |
5480 } | |
5481 return false; | |
5482 } | |
5483 | |
5484 int get hashCode { | |
5485 int hash = 0; | |
5486 hash = _JenkinsSmiHash.combine(hash, name.hashCode); | |
5487 hash = _JenkinsSmiHash.combine(hash, extractAll.hashCode); | |
5488 return _JenkinsSmiHash.finish(hash); | |
5489 } | |
5490 } | |
5491 | |
5492 /** | |
5493 * extractMethod feedback | |
5494 * | |
5495 * { | |
5496 * "offset": int | |
5497 * "length": int | |
5498 * "returnType": String | |
5499 * "names": List<String> | |
5500 * "canCreateGetter": bool | |
5501 * "parameters": List<RefactoringMethodParameter> | |
5502 * "occurrences": int | |
5503 * "offsets": List<int> | |
5504 * "lengths": List<int> | |
5505 * } | |
5506 */ | |
5507 class ExtractMethodFeedback { | |
5508 /** | |
5509 * The offset to the beginning of the expression or statements that will be | |
5510 * extracted. | |
5511 */ | |
5512 final int offset; | |
5513 | |
5514 /** | |
5515 * The length of the expression or statements that will be extracted. | |
5516 */ | |
5517 final int length; | |
5518 | |
5519 /** | |
5520 * The proposed return type for the method. | |
5521 */ | |
5522 final String returnType; | |
5523 | |
5524 /** | |
5525 * The proposed names for the method. | |
5526 */ | |
5527 final List<String> names; | |
5528 | |
5529 /** | |
5530 * True if a getter could be created rather than a method. | |
5531 */ | |
5532 final bool canCreateGetter; | |
5533 | |
5534 /** | |
5535 * The proposed parameters for the method. | |
5536 */ | |
5537 final List<RefactoringMethodParameter> parameters; | |
5538 | |
5539 /** | |
5540 * The number of times the expression or statements occurs. | |
5541 */ | |
5542 final int occurrences; | |
5543 | |
5544 /** | |
5545 * The offsets of the expressions or statements that would be replaced by an | |
5546 * invocation of the method. | |
5547 */ | |
5548 final List<int> offsets; | |
5549 | |
5550 /** | |
5551 * The lengths of the expressions or statements that would be replaced by an | |
5552 * invocation of the method. The lengths correspond to the offsets. In other | |
5553 * words, for a given expression (or block of statements), if the offset of | |
5554 * that expression is offsets[i], then the length of that expression is | |
5555 * lengths[i]. | |
5556 */ | |
5557 final List<int> lengths; | |
5558 | |
5559 ExtractMethodFeedback(this.offset, this.length, this.returnType, this.names, t his.canCreateGetter, this.parameters, this.occurrences, this.offsets, this.lengt hs); | |
5560 | |
5561 Map<String, dynamic> toJson() { | |
5562 Map<String, dynamic> result = {}; | |
5563 result["offset"] = offset; | |
5564 result["length"] = length; | |
5565 result["returnType"] = returnType; | |
5566 result["names"] = names; | |
5567 result["canCreateGetter"] = canCreateGetter; | |
5568 result["parameters"] = parameters.map((RefactoringMethodParameter value) => value.toJson()); | |
5569 result["occurrences"] = occurrences; | |
5570 result["offsets"] = offsets; | |
5571 result["lengths"] = lengths; | |
5572 return result; | |
5573 } | |
5574 | |
5575 String toString() => JSON.encode(toJson()); | |
5576 | |
5577 bool operator==(other) { | |
5578 if (other is ExtractMethodFeedback) { | |
5579 return offset == other.offset && | |
5580 length == other.length && | |
5581 returnType == other.returnType && | |
5582 names == other.names && | |
5583 canCreateGetter == other.canCreateGetter && | |
5584 parameters == other.parameters && | |
5585 occurrences == other.occurrences && | |
5586 offsets == other.offsets && | |
5587 lengths == other.lengths; | |
5588 } | |
5589 return false; | |
5590 } | |
5591 | |
5592 int get hashCode { | |
5593 int hash = 0; | |
5594 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
5595 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
5596 hash = _JenkinsSmiHash.combine(hash, returnType.hashCode); | |
5597 hash = _JenkinsSmiHash.combine(hash, names.hashCode); | |
5598 hash = _JenkinsSmiHash.combine(hash, canCreateGetter.hashCode); | |
5599 hash = _JenkinsSmiHash.combine(hash, parameters.hashCode); | |
5600 hash = _JenkinsSmiHash.combine(hash, occurrences.hashCode); | |
5601 hash = _JenkinsSmiHash.combine(hash, offsets.hashCode); | |
5602 hash = _JenkinsSmiHash.combine(hash, lengths.hashCode); | |
5603 return _JenkinsSmiHash.finish(hash); | |
5604 } | |
5605 } | |
5606 | |
5607 /** | |
5608 * extractMethod options | |
5609 * | |
5610 * { | |
5611 * "returnType": String | |
5612 * "createGetter": bool | |
5613 * "name": String | |
5614 * "parameters": List<RefactoringMethodParameter> | |
5615 * "extractAll": bool | |
5616 * } | |
5617 */ | |
5618 class ExtractMethodOptions { | |
5619 /** | |
5620 * The return type that should be defined for the method. | |
5621 */ | |
5622 final String returnType; | |
5623 | |
5624 /** | |
5625 * True if a getter should be created rather than a method. It is an error if | |
5626 * this field is true and the list of parameters is non-empty. | |
5627 */ | |
5628 final bool createGetter; | |
5629 | |
5630 /** | |
5631 * The name that the method should be given. | |
5632 */ | |
5633 final String name; | |
5634 | |
5635 /** | |
5636 * The parameters that should be defined for the method. | |
5637 * | |
5638 * It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL | |
5639 * parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a | |
5640 * NAMED parameter. | |
5641 * | |
5642 * - To change the order and/or update proposed paramerers, add parameters | |
5643 * with the same identifiers as proposed. | |
5644 * - To add new parameters, omit their identifier. | |
5645 * - To remove some parameters, omit them in this list. | |
5646 */ | |
5647 final List<RefactoringMethodParameter> parameters; | |
5648 | |
5649 /** | |
5650 * True if all occurrences of the expression or statements should be replaced | |
5651 * by an invocation of the method. The expression or statements used to | |
5652 * initiate the refactoring will always be replaced. | |
5653 */ | |
5654 final bool extractAll; | |
5655 | |
5656 ExtractMethodOptions(this.returnType, this.createGetter, this.name, this.param eters, this.extractAll); | |
5657 | |
5658 Map<String, dynamic> toJson() { | |
5659 Map<String, dynamic> result = {}; | |
5660 result["returnType"] = returnType; | |
5661 result["createGetter"] = createGetter; | |
5662 result["name"] = name; | |
5663 result["parameters"] = parameters.map((RefactoringMethodParameter value) => value.toJson()); | |
5664 result["extractAll"] = extractAll; | |
5665 return result; | |
5666 } | |
5667 | |
5668 String toString() => JSON.encode(toJson()); | |
5669 | |
5670 bool operator==(other) { | |
5671 if (other is ExtractMethodOptions) { | |
5672 return returnType == other.returnType && | |
5673 createGetter == other.createGetter && | |
5674 name == other.name && | |
5675 parameters == other.parameters && | |
5676 extractAll == other.extractAll; | |
5677 } | |
5678 return false; | |
5679 } | |
5680 | |
5681 int get hashCode { | |
5682 int hash = 0; | |
5683 hash = _JenkinsSmiHash.combine(hash, returnType.hashCode); | |
5684 hash = _JenkinsSmiHash.combine(hash, createGetter.hashCode); | |
5685 hash = _JenkinsSmiHash.combine(hash, name.hashCode); | |
5686 hash = _JenkinsSmiHash.combine(hash, parameters.hashCode); | |
5687 hash = _JenkinsSmiHash.combine(hash, extractAll.hashCode); | |
5688 return _JenkinsSmiHash.finish(hash); | |
5689 } | |
5690 } | |
5691 | |
5692 /** | |
5693 * inlineMethod options | |
5694 * | |
5695 * { | |
5696 * "deleteSource": bool | |
5697 * "inlineAll": bool | |
5698 * } | |
5699 */ | |
5700 class InlineMethodOptions { | |
5701 /** | |
5702 * True if the method being inlined should be removed. It is an error if this | |
5703 * field is true and inlineAll is false. | |
5704 */ | |
5705 final bool deleteSource; | |
5706 | |
5707 /** | |
5708 * True if all invocations of the method should be inlined, or false if only | |
5709 * the invocation site used to create this refactoring should be inlined. | |
5710 */ | |
5711 final bool inlineAll; | |
5712 | |
5713 InlineMethodOptions(this.deleteSource, this.inlineAll); | |
5714 | |
5715 Map<String, dynamic> toJson() { | |
5716 Map<String, dynamic> result = {}; | |
5717 result["deleteSource"] = deleteSource; | |
5718 result["inlineAll"] = inlineAll; | |
5719 return result; | |
5720 } | |
5721 | |
5722 String toString() => JSON.encode(toJson()); | |
5723 | |
5724 bool operator==(other) { | |
5725 if (other is InlineMethodOptions) { | |
5726 return deleteSource == other.deleteSource && | |
5727 inlineAll == other.inlineAll; | |
5728 } | |
5729 return false; | |
5730 } | |
5731 | |
5732 int get hashCode { | |
5733 int hash = 0; | |
5734 hash = _JenkinsSmiHash.combine(hash, deleteSource.hashCode); | |
5735 hash = _JenkinsSmiHash.combine(hash, inlineAll.hashCode); | |
5736 return _JenkinsSmiHash.finish(hash); | |
5737 } | |
5738 } | |
5739 | |
5740 /** | |
5741 * rename feedback | |
5742 * | |
5743 * { | |
5744 * "offset": int | |
5745 * "length": int | |
5746 * } | |
5747 */ | |
5748 class RenameFeedback { | |
5749 /** | |
5750 * The offset to the beginning of the name selected to be renamed. | |
5751 */ | |
5752 final int offset; | |
5753 | |
5754 /** | |
5755 * The length of the name selected to be renamed. | |
5756 */ | |
5757 final int length; | |
5758 | |
5759 RenameFeedback(this.offset, this.length); | |
5760 | |
5761 Map<String, dynamic> toJson() { | |
5762 Map<String, dynamic> result = {}; | |
5763 result["offset"] = offset; | |
5764 result["length"] = length; | |
5765 return result; | |
5766 } | |
5767 | |
5768 String toString() => JSON.encode(toJson()); | |
5769 | |
5770 bool operator==(other) { | |
5771 if (other is RenameFeedback) { | |
5772 return offset == other.offset && | |
5773 length == other.length; | |
5774 } | |
5775 return false; | |
5776 } | |
5777 | |
5778 int get hashCode { | |
5779 int hash = 0; | |
5780 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
5781 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
5782 return _JenkinsSmiHash.finish(hash); | |
5783 } | |
5784 } | |
5785 | |
5786 /** | |
5787 * rename options | |
5788 * | |
5789 * { | |
5790 * "newName": String | |
5791 * } | |
5792 */ | |
5793 class RenameOptions { | |
5794 /** | |
5795 * The name that the element should have after the refactoring. | |
5796 */ | |
5797 final String newName; | |
5798 | |
5799 RenameOptions(this.newName); | |
5800 | |
5801 Map<String, dynamic> toJson() { | |
5802 Map<String, dynamic> result = {}; | |
5803 result["newName"] = newName; | |
5804 return result; | |
5805 } | |
5806 | |
5807 String toString() => JSON.encode(toJson()); | |
5808 | |
5809 bool operator==(other) { | |
5810 if (other is RenameOptions) { | |
5811 return newName == other.newName; | |
5812 } | |
5813 return false; | |
5814 } | |
5815 | |
5816 int get hashCode { | |
5817 int hash = 0; | |
5818 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); | |
5819 return _JenkinsSmiHash.finish(hash); | |
5820 } | |
5821 } | |
5822 | |
5823 abstract class JsonDecoder extends JsonDecoderBase { | |
5824 | |
5825 ServerGetVersionResult decodeServerGetVersionResult(String jsonPath, Object js on) { | |
Brian Wilkerson
2014/08/18 14:10:16
Consider converting these methods to named constru
Paul Berry
2014/08/18 21:58:03
Done.
| |
5826 if (json is Map) { | |
5827 String version; | |
5828 if (json.containsKey("version")) { | |
5829 version = _decodeString(jsonPath + ".version", json["version"]); | |
5830 } else { | |
5831 throw missingKey(jsonPath, "version"); | |
5832 } | |
5833 return new ServerGetVersionResult(version); | |
5834 } else { | |
5835 throw mismatch(jsonPath, "server.getVersion result"); | |
5836 } | |
5837 } | |
5838 | |
5839 ServerSetSubscriptionsParams decodeServerSetSubscriptionsParams(String jsonPat h, Object json) { | |
5840 if (json is Map) { | |
5841 List<ServerService> subscriptions; | |
5842 if (json.containsKey("subscriptions")) { | |
5843 subscriptions = _decodeList(jsonPath + ".subscriptions", json["subscript ions"], decodeServerService); | |
5844 } else { | |
5845 throw missingKey(jsonPath, "subscriptions"); | |
5846 } | |
5847 return new ServerSetSubscriptionsParams(subscriptions); | |
5848 } else { | |
5849 throw mismatch(jsonPath, "server.setSubscriptions params"); | |
5850 } | |
5851 } | |
5852 | |
5853 ServerErrorParams decodeServerErrorParams(String jsonPath, Object json) { | |
5854 if (json is Map) { | |
5855 bool fatal; | |
5856 if (json.containsKey("fatal")) { | |
5857 fatal = _decodeBool(jsonPath + ".fatal", json["fatal"]); | |
5858 } else { | |
5859 throw missingKey(jsonPath, "fatal"); | |
5860 } | |
5861 String message; | |
5862 if (json.containsKey("message")) { | |
5863 message = _decodeString(jsonPath + ".message", json["message"]); | |
5864 } else { | |
5865 throw missingKey(jsonPath, "message"); | |
5866 } | |
5867 String stackTrace; | |
5868 if (json.containsKey("stackTrace")) { | |
5869 stackTrace = _decodeString(jsonPath + ".stackTrace", json["stackTrace"]) ; | |
5870 } else { | |
5871 throw missingKey(jsonPath, "stackTrace"); | |
5872 } | |
5873 return new ServerErrorParams(fatal, message, stackTrace); | |
5874 } else { | |
5875 throw mismatch(jsonPath, "server.error params"); | |
5876 } | |
5877 } | |
5878 | |
5879 ServerStatusParams decodeServerStatusParams(String jsonPath, Object json) { | |
5880 if (json is Map) { | |
5881 AnalysisStatus analysis; | |
5882 if (json.containsKey("analysis")) { | |
5883 analysis = decodeAnalysisStatus(jsonPath + ".analysis", json["analysis"] ); | |
5884 } | |
5885 return new ServerStatusParams(analysis: analysis); | |
5886 } else { | |
5887 throw mismatch(jsonPath, "server.status params"); | |
5888 } | |
5889 } | |
5890 | |
5891 AnalysisGetErrorsParams decodeAnalysisGetErrorsParams(String jsonPath, Object json) { | |
5892 if (json is Map) { | |
5893 String file; | |
5894 if (json.containsKey("file")) { | |
5895 file = _decodeString(jsonPath + ".file", json["file"]); | |
5896 } else { | |
5897 throw missingKey(jsonPath, "file"); | |
5898 } | |
5899 return new AnalysisGetErrorsParams(file); | |
5900 } else { | |
5901 throw mismatch(jsonPath, "analysis.getErrors params"); | |
5902 } | |
5903 } | |
5904 | |
5905 AnalysisGetErrorsResult decodeAnalysisGetErrorsResult(String jsonPath, Object json) { | |
5906 if (json is Map) { | |
5907 List<AnalysisError> errors; | |
5908 if (json.containsKey("errors")) { | |
5909 errors = _decodeList(jsonPath + ".errors", json["errors"], decodeAnalysi sError); | |
5910 } else { | |
5911 throw missingKey(jsonPath, "errors"); | |
5912 } | |
5913 return new AnalysisGetErrorsResult(errors); | |
5914 } else { | |
5915 throw mismatch(jsonPath, "analysis.getErrors result"); | |
5916 } | |
5917 } | |
5918 | |
5919 AnalysisGetHoverParams decodeAnalysisGetHoverParams(String jsonPath, Object js on) { | |
5920 if (json is Map) { | |
5921 String file; | |
5922 if (json.containsKey("file")) { | |
5923 file = _decodeString(jsonPath + ".file", json["file"]); | |
5924 } else { | |
5925 throw missingKey(jsonPath, "file"); | |
5926 } | |
5927 int offset; | |
5928 if (json.containsKey("offset")) { | |
5929 offset = _decodeInt(jsonPath + ".offset", json["offset"]); | |
5930 } else { | |
5931 throw missingKey(jsonPath, "offset"); | |
5932 } | |
5933 return new AnalysisGetHoverParams(file, offset); | |
5934 } else { | |
5935 throw mismatch(jsonPath, "analysis.getHover params"); | |
5936 } | |
5937 } | |
5938 | |
5939 AnalysisGetHoverResult decodeAnalysisGetHoverResult(String jsonPath, Object js on) { | |
5940 if (json is Map) { | |
5941 List<HoverInformation> hovers; | |
5942 if (json.containsKey("hovers")) { | |
5943 hovers = _decodeList(jsonPath + ".hovers", json["hovers"], decodeHoverIn formation); | |
5944 } else { | |
5945 throw missingKey(jsonPath, "hovers"); | |
5946 } | |
5947 return new AnalysisGetHoverResult(hovers); | |
5948 } else { | |
5949 throw mismatch(jsonPath, "analysis.getHover result"); | |
5950 } | |
5951 } | |
5952 | |
5953 AnalysisSetAnalysisRootsParams decodeAnalysisSetAnalysisRootsParams(String jso nPath, Object json) { | |
5954 if (json is Map) { | |
5955 List<String> included; | |
5956 if (json.containsKey("included")) { | |
5957 included = _decodeList(jsonPath + ".included", json["included"], _decode String); | |
5958 } else { | |
5959 throw missingKey(jsonPath, "included"); | |
5960 } | |
5961 List<String> excluded; | |
5962 if (json.containsKey("excluded")) { | |
5963 excluded = _decodeList(jsonPath + ".excluded", json["excluded"], _decode String); | |
5964 } else { | |
5965 throw missingKey(jsonPath, "excluded"); | |
5966 } | |
5967 return new AnalysisSetAnalysisRootsParams(included, excluded); | |
5968 } else { | |
5969 throw mismatch(jsonPath, "analysis.setAnalysisRoots params"); | |
5970 } | |
5971 } | |
5972 | |
5973 AnalysisSetPriorityFilesParams decodeAnalysisSetPriorityFilesParams(String jso nPath, Object json) { | |
5974 if (json is Map) { | |
5975 List<String> files; | |
5976 if (json.containsKey("files")) { | |
5977 files = _decodeList(jsonPath + ".files", json["files"], _decodeString); | |
5978 } else { | |
5979 throw missingKey(jsonPath, "files"); | |
5980 } | |
5981 return new AnalysisSetPriorityFilesParams(files); | |
5982 } else { | |
5983 throw mismatch(jsonPath, "analysis.setPriorityFiles params"); | |
5984 } | |
5985 } | |
5986 | |
5987 AnalysisSetSubscriptionsParams decodeAnalysisSetSubscriptionsParams(String jso nPath, Object json) { | |
5988 if (json is Map) { | |
5989 Map<AnalysisService, List<String>> subscriptions; | |
5990 if (json.containsKey("subscriptions")) { | |
5991 subscriptions = _decodeMap(jsonPath + ".subscriptions", json["subscripti ons"], keyDecoder: decodeAnalysisService, valueDecoder: (String jsonPath, Object json) => _decodeList(jsonPath, json, _decodeString)); | |
5992 } else { | |
5993 throw missingKey(jsonPath, "subscriptions"); | |
5994 } | |
5995 return new AnalysisSetSubscriptionsParams(subscriptions); | |
5996 } else { | |
5997 throw mismatch(jsonPath, "analysis.setSubscriptions params"); | |
5998 } | |
5999 } | |
6000 | |
6001 AnalysisUpdateContentParams decodeAnalysisUpdateContentParams(String jsonPath, Object json) { | |
6002 if (json is Map) { | |
6003 Map<String, dynamic> files; | |
6004 if (json.containsKey("files")) { | |
6005 files = _decodeMap(jsonPath + ".files", json["files"], valueDecoder: (St ring jsonPath, Object json) => _decodeUnion(jsonPath, json, "type", {"add": deco deAddContentOverlay, "change": decodeChangeContentOverlay, "remove": decodeRemov eContentOverlay})); | |
6006 } else { | |
6007 throw missingKey(jsonPath, "files"); | |
6008 } | |
6009 return new AnalysisUpdateContentParams(files); | |
6010 } else { | |
6011 throw mismatch(jsonPath, "analysis.updateContent params"); | |
6012 } | |
6013 } | |
6014 | |
6015 AnalysisUpdateOptionsParams decodeAnalysisUpdateOptionsParams(String jsonPath, Object json) { | |
6016 if (json is Map) { | |
6017 AnalysisOptions options; | |
6018 if (json.containsKey("options")) { | |
6019 options = decodeAnalysisOptions(jsonPath + ".options", json["options"]); | |
6020 } else { | |
6021 throw missingKey(jsonPath, "options"); | |
6022 } | |
6023 return new AnalysisUpdateOptionsParams(options); | |
6024 } else { | |
6025 throw mismatch(jsonPath, "analysis.updateOptions params"); | |
6026 } | |
6027 } | |
6028 | |
6029 AnalysisErrorsParams decodeAnalysisErrorsParams(String jsonPath, Object json) { | |
6030 if (json is Map) { | |
6031 String file; | |
6032 if (json.containsKey("file")) { | |
6033 file = _decodeString(jsonPath + ".file", json["file"]); | |
6034 } else { | |
6035 throw missingKey(jsonPath, "file"); | |
6036 } | |
6037 List<AnalysisError> errors; | |
6038 if (json.containsKey("errors")) { | |
6039 errors = _decodeList(jsonPath + ".errors", json["errors"], decodeAnalysi sError); | |
6040 } else { | |
6041 throw missingKey(jsonPath, "errors"); | |
6042 } | |
6043 return new AnalysisErrorsParams(file, errors); | |
6044 } else { | |
6045 throw mismatch(jsonPath, "analysis.errors params"); | |
6046 } | |
6047 } | |
6048 | |
6049 AnalysisFlushResultsParams decodeAnalysisFlushResultsParams(String jsonPath, O bject json) { | |
6050 if (json is Map) { | |
6051 List<String> files; | |
6052 if (json.containsKey("files")) { | |
6053 files = _decodeList(jsonPath + ".files", json["files"], _decodeString); | |
6054 } else { | |
6055 throw missingKey(jsonPath, "files"); | |
6056 } | |
6057 return new AnalysisFlushResultsParams(files); | |
6058 } else { | |
6059 throw mismatch(jsonPath, "analysis.flushResults params"); | |
6060 } | |
6061 } | |
6062 | |
6063 AnalysisFoldingParams decodeAnalysisFoldingParams(String jsonPath, Object json ) { | |
6064 if (json is Map) { | |
6065 String file; | |
6066 if (json.containsKey("file")) { | |
6067 file = _decodeString(jsonPath + ".file", json["file"]); | |
6068 } else { | |
6069 throw missingKey(jsonPath, "file"); | |
6070 } | |
6071 List<FoldingRegion> regions; | |
6072 if (json.containsKey("regions")) { | |
6073 regions = _decodeList(jsonPath + ".regions", json["regions"], decodeFold ingRegion); | |
6074 } else { | |
6075 throw missingKey(jsonPath, "regions"); | |
6076 } | |
6077 return new AnalysisFoldingParams(file, regions); | |
6078 } else { | |
6079 throw mismatch(jsonPath, "analysis.folding params"); | |
6080 } | |
6081 } | |
6082 | |
6083 AnalysisHighlightsParams decodeAnalysisHighlightsParams(String jsonPath, Objec t json) { | |
6084 if (json is Map) { | |
6085 String file; | |
6086 if (json.containsKey("file")) { | |
6087 file = _decodeString(jsonPath + ".file", json["file"]); | |
6088 } else { | |
6089 throw missingKey(jsonPath, "file"); | |
6090 } | |
6091 List<HighlightRegion> regions; | |
6092 if (json.containsKey("regions")) { | |
6093 regions = _decodeList(jsonPath + ".regions", json["regions"], decodeHigh lightRegion); | |
6094 } else { | |
6095 throw missingKey(jsonPath, "regions"); | |
6096 } | |
6097 return new AnalysisHighlightsParams(file, regions); | |
6098 } else { | |
6099 throw mismatch(jsonPath, "analysis.highlights params"); | |
6100 } | |
6101 } | |
6102 | |
6103 AnalysisNavigationParams decodeAnalysisNavigationParams(String jsonPath, Objec t json) { | |
6104 if (json is Map) { | |
6105 String file; | |
6106 if (json.containsKey("file")) { | |
6107 file = _decodeString(jsonPath + ".file", json["file"]); | |
6108 } else { | |
6109 throw missingKey(jsonPath, "file"); | |
6110 } | |
6111 List<NavigationRegion> regions; | |
6112 if (json.containsKey("regions")) { | |
6113 regions = _decodeList(jsonPath + ".regions", json["regions"], decodeNavi gationRegion); | |
6114 } else { | |
6115 throw missingKey(jsonPath, "regions"); | |
6116 } | |
6117 return new AnalysisNavigationParams(file, regions); | |
6118 } else { | |
6119 throw mismatch(jsonPath, "analysis.navigation params"); | |
6120 } | |
6121 } | |
6122 | |
6123 AnalysisOccurrencesParams decodeAnalysisOccurrencesParams(String jsonPath, Obj ect json) { | |
6124 if (json is Map) { | |
6125 String file; | |
6126 if (json.containsKey("file")) { | |
6127 file = _decodeString(jsonPath + ".file", json["file"]); | |
6128 } else { | |
6129 throw missingKey(jsonPath, "file"); | |
6130 } | |
6131 List<Occurrences> occurrences; | |
6132 if (json.containsKey("occurrences")) { | |
6133 occurrences = _decodeList(jsonPath + ".occurrences", json["occurrences"] , decodeOccurrences); | |
6134 } else { | |
6135 throw missingKey(jsonPath, "occurrences"); | |
6136 } | |
6137 return new AnalysisOccurrencesParams(file, occurrences); | |
6138 } else { | |
6139 throw mismatch(jsonPath, "analysis.occurrences params"); | |
6140 } | |
6141 } | |
6142 | |
6143 AnalysisOutlineParams decodeAnalysisOutlineParams(String jsonPath, Object json ) { | |
6144 if (json is Map) { | |
6145 String file; | |
6146 if (json.containsKey("file")) { | |
6147 file = _decodeString(jsonPath + ".file", json["file"]); | |
6148 } else { | |
6149 throw missingKey(jsonPath, "file"); | |
6150 } | |
6151 Outline outline; | |
6152 if (json.containsKey("outline")) { | |
6153 outline = decodeOutline(jsonPath + ".outline", json["outline"]); | |
6154 } else { | |
6155 throw missingKey(jsonPath, "outline"); | |
6156 } | |
6157 return new AnalysisOutlineParams(file, outline); | |
6158 } else { | |
6159 throw mismatch(jsonPath, "analysis.outline params"); | |
6160 } | |
6161 } | |
6162 | |
6163 AnalysisOverridesParams decodeAnalysisOverridesParams(String jsonPath, Object json) { | |
6164 if (json is Map) { | |
6165 String file; | |
6166 if (json.containsKey("file")) { | |
6167 file = _decodeString(jsonPath + ".file", json["file"]); | |
6168 } else { | |
6169 throw missingKey(jsonPath, "file"); | |
6170 } | |
6171 List<Override> overrides; | |
6172 if (json.containsKey("overrides")) { | |
6173 overrides = _decodeList(jsonPath + ".overrides", json["overrides"], deco deOverride); | |
6174 } else { | |
6175 throw missingKey(jsonPath, "overrides"); | |
6176 } | |
6177 return new AnalysisOverridesParams(file, overrides); | |
6178 } else { | |
6179 throw mismatch(jsonPath, "analysis.overrides params"); | |
6180 } | |
6181 } | |
6182 | |
6183 CompletionGetSuggestionsParams decodeCompletionGetSuggestionsParams(String jso nPath, Object json) { | |
6184 if (json is Map) { | |
6185 String file; | |
6186 if (json.containsKey("file")) { | |
6187 file = _decodeString(jsonPath + ".file", json["file"]); | |
6188 } else { | |
6189 throw missingKey(jsonPath, "file"); | |
6190 } | |
6191 int offset; | |
6192 if (json.containsKey("offset")) { | |
6193 offset = _decodeInt(jsonPath + ".offset", json["offset"]); | |
6194 } else { | |
6195 throw missingKey(jsonPath, "offset"); | |
6196 } | |
6197 return new CompletionGetSuggestionsParams(file, offset); | |
6198 } else { | |
6199 throw mismatch(jsonPath, "completion.getSuggestions params"); | |
6200 } | |
6201 } | |
6202 | |
6203 CompletionGetSuggestionsResult decodeCompletionGetSuggestionsResult(String jso nPath, Object json) { | |
6204 if (json is Map) { | |
6205 String id; | |
6206 if (json.containsKey("id")) { | |
6207 id = _decodeString(jsonPath + ".id", json["id"]); | |
6208 } else { | |
6209 throw missingKey(jsonPath, "id"); | |
6210 } | |
6211 return new CompletionGetSuggestionsResult(id); | |
6212 } else { | |
6213 throw mismatch(jsonPath, "completion.getSuggestions result"); | |
6214 } | |
6215 } | |
6216 | |
6217 CompletionResultsParams decodeCompletionResultsParams(String jsonPath, Object json) { | |
6218 if (json is Map) { | |
6219 String id; | |
6220 if (json.containsKey("id")) { | |
6221 id = _decodeString(jsonPath + ".id", json["id"]); | |
6222 } else { | |
6223 throw missingKey(jsonPath, "id"); | |
6224 } | |
6225 int replacementOffset; | |
6226 if (json.containsKey("replacementOffset")) { | |
6227 replacementOffset = _decodeInt(jsonPath + ".replacementOffset", json["re placementOffset"]); | |
6228 } else { | |
6229 throw missingKey(jsonPath, "replacementOffset"); | |
6230 } | |
6231 int replacementLength; | |
6232 if (json.containsKey("replacementLength")) { | |
6233 replacementLength = _decodeInt(jsonPath + ".replacementLength", json["re placementLength"]); | |
6234 } else { | |
6235 throw missingKey(jsonPath, "replacementLength"); | |
6236 } | |
6237 List<CompletionSuggestion> results; | |
6238 if (json.containsKey("results")) { | |
6239 results = _decodeList(jsonPath + ".results", json["results"], decodeComp letionSuggestion); | |
6240 } else { | |
6241 throw missingKey(jsonPath, "results"); | |
6242 } | |
6243 bool last; | |
6244 if (json.containsKey("last")) { | |
6245 last = _decodeBool(jsonPath + ".last", json["last"]); | |
6246 } else { | |
6247 throw missingKey(jsonPath, "last"); | |
6248 } | |
6249 return new CompletionResultsParams(id, replacementOffset, replacementLengt h, results, last); | |
6250 } else { | |
6251 throw mismatch(jsonPath, "completion.results params"); | |
6252 } | |
6253 } | |
6254 | |
6255 SearchFindElementReferencesParams decodeSearchFindElementReferencesParams(Stri ng jsonPath, Object json) { | |
6256 if (json is Map) { | |
6257 String file; | |
6258 if (json.containsKey("file")) { | |
6259 file = _decodeString(jsonPath + ".file", json["file"]); | |
6260 } else { | |
6261 throw missingKey(jsonPath, "file"); | |
6262 } | |
6263 int offset; | |
6264 if (json.containsKey("offset")) { | |
6265 offset = _decodeInt(jsonPath + ".offset", json["offset"]); | |
6266 } else { | |
6267 throw missingKey(jsonPath, "offset"); | |
6268 } | |
6269 bool includePotential; | |
6270 if (json.containsKey("includePotential")) { | |
6271 includePotential = _decodeBool(jsonPath + ".includePotential", json["inc ludePotential"]); | |
6272 } else { | |
6273 throw missingKey(jsonPath, "includePotential"); | |
6274 } | |
6275 return new SearchFindElementReferencesParams(file, offset, includePotentia l); | |
6276 } else { | |
6277 throw mismatch(jsonPath, "search.findElementReferences params"); | |
6278 } | |
6279 } | |
6280 | |
6281 SearchFindElementReferencesResult decodeSearchFindElementReferencesResult(Stri ng jsonPath, Object json) { | |
6282 if (json is Map) { | |
6283 String id; | |
6284 if (json.containsKey("id")) { | |
6285 id = _decodeString(jsonPath + ".id", json["id"]); | |
6286 } else { | |
6287 throw missingKey(jsonPath, "id"); | |
6288 } | |
6289 Element element; | |
6290 if (json.containsKey("element")) { | |
6291 element = decodeElement(jsonPath + ".element", json["element"]); | |
6292 } else { | |
6293 throw missingKey(jsonPath, "element"); | |
6294 } | |
6295 return new SearchFindElementReferencesResult(id, element); | |
6296 } else { | |
6297 throw mismatch(jsonPath, "search.findElementReferences result"); | |
6298 } | |
6299 } | |
6300 | |
6301 SearchFindMemberDeclarationsParams decodeSearchFindMemberDeclarationsParams(St ring jsonPath, Object json) { | |
6302 if (json is Map) { | |
6303 String name; | |
6304 if (json.containsKey("name")) { | |
6305 name = _decodeString(jsonPath + ".name", json["name"]); | |
6306 } else { | |
6307 throw missingKey(jsonPath, "name"); | |
6308 } | |
6309 return new SearchFindMemberDeclarationsParams(name); | |
6310 } else { | |
6311 throw mismatch(jsonPath, "search.findMemberDeclarations params"); | |
6312 } | |
6313 } | |
6314 | |
6315 SearchFindMemberDeclarationsResult decodeSearchFindMemberDeclarationsResult(St ring jsonPath, Object json) { | |
6316 if (json is Map) { | |
6317 String id; | |
6318 if (json.containsKey("id")) { | |
6319 id = _decodeString(jsonPath + ".id", json["id"]); | |
6320 } else { | |
6321 throw missingKey(jsonPath, "id"); | |
6322 } | |
6323 return new SearchFindMemberDeclarationsResult(id); | |
6324 } else { | |
6325 throw mismatch(jsonPath, "search.findMemberDeclarations result"); | |
6326 } | |
6327 } | |
6328 | |
6329 SearchFindMemberReferencesParams decodeSearchFindMemberReferencesParams(String jsonPath, Object json) { | |
6330 if (json is Map) { | |
6331 String name; | |
6332 if (json.containsKey("name")) { | |
6333 name = _decodeString(jsonPath + ".name", json["name"]); | |
6334 } else { | |
6335 throw missingKey(jsonPath, "name"); | |
6336 } | |
6337 return new SearchFindMemberReferencesParams(name); | |
6338 } else { | |
6339 throw mismatch(jsonPath, "search.findMemberReferences params"); | |
6340 } | |
6341 } | |
6342 | |
6343 SearchFindMemberReferencesResult decodeSearchFindMemberReferencesResult(String jsonPath, Object json) { | |
6344 if (json is Map) { | |
6345 String id; | |
6346 if (json.containsKey("id")) { | |
6347 id = _decodeString(jsonPath + ".id", json["id"]); | |
6348 } else { | |
6349 throw missingKey(jsonPath, "id"); | |
6350 } | |
6351 return new SearchFindMemberReferencesResult(id); | |
6352 } else { | |
6353 throw mismatch(jsonPath, "search.findMemberReferences result"); | |
6354 } | |
6355 } | |
6356 | |
6357 SearchFindTopLevelDeclarationsParams decodeSearchFindTopLevelDeclarationsParam s(String jsonPath, Object json) { | |
6358 if (json is Map) { | |
6359 String pattern; | |
6360 if (json.containsKey("pattern")) { | |
6361 pattern = _decodeString(jsonPath + ".pattern", json["pattern"]); | |
6362 } else { | |
6363 throw missingKey(jsonPath, "pattern"); | |
6364 } | |
6365 return new SearchFindTopLevelDeclarationsParams(pattern); | |
6366 } else { | |
6367 throw mismatch(jsonPath, "search.findTopLevelDeclarations params"); | |
6368 } | |
6369 } | |
6370 | |
6371 SearchFindTopLevelDeclarationsResult decodeSearchFindTopLevelDeclarationsResul t(String jsonPath, Object json) { | |
6372 if (json is Map) { | |
6373 String id; | |
6374 if (json.containsKey("id")) { | |
6375 id = _decodeString(jsonPath + ".id", json["id"]); | |
6376 } else { | |
6377 throw missingKey(jsonPath, "id"); | |
6378 } | |
6379 return new SearchFindTopLevelDeclarationsResult(id); | |
6380 } else { | |
6381 throw mismatch(jsonPath, "search.findTopLevelDeclarations result"); | |
6382 } | |
6383 } | |
6384 | |
6385 SearchGetTypeHierarchyParams decodeSearchGetTypeHierarchyParams(String jsonPat h, Object json) { | |
6386 if (json is Map) { | |
6387 String file; | |
6388 if (json.containsKey("file")) { | |
6389 file = _decodeString(jsonPath + ".file", json["file"]); | |
6390 } else { | |
6391 throw missingKey(jsonPath, "file"); | |
6392 } | |
6393 int offset; | |
6394 if (json.containsKey("offset")) { | |
6395 offset = _decodeInt(jsonPath + ".offset", json["offset"]); | |
6396 } else { | |
6397 throw missingKey(jsonPath, "offset"); | |
6398 } | |
6399 return new SearchGetTypeHierarchyParams(file, offset); | |
6400 } else { | |
6401 throw mismatch(jsonPath, "search.getTypeHierarchy params"); | |
6402 } | |
6403 } | |
6404 | |
6405 SearchGetTypeHierarchyResult decodeSearchGetTypeHierarchyResult(String jsonPat h, Object json) { | |
6406 if (json is Map) { | |
6407 List<TypeHierarchyItem> hierarchyItems; | |
6408 if (json.containsKey("hierarchyItems")) { | |
6409 hierarchyItems = _decodeList(jsonPath + ".hierarchyItems", json["hierarc hyItems"], decodeTypeHierarchyItem); | |
6410 } | |
6411 return new SearchGetTypeHierarchyResult(hierarchyItems: hierarchyItems); | |
6412 } else { | |
6413 throw mismatch(jsonPath, "search.getTypeHierarchy result"); | |
6414 } | |
6415 } | |
6416 | |
6417 SearchResultsParams decodeSearchResultsParams(String jsonPath, Object json) { | |
6418 if (json is Map) { | |
6419 String id; | |
6420 if (json.containsKey("id")) { | |
6421 id = _decodeString(jsonPath + ".id", json["id"]); | |
6422 } else { | |
6423 throw missingKey(jsonPath, "id"); | |
6424 } | |
6425 List<SearchResult> results; | |
6426 if (json.containsKey("results")) { | |
6427 results = _decodeList(jsonPath + ".results", json["results"], decodeSear chResult); | |
6428 } else { | |
6429 throw missingKey(jsonPath, "results"); | |
6430 } | |
6431 bool last; | |
6432 if (json.containsKey("last")) { | |
6433 last = _decodeBool(jsonPath + ".last", json["last"]); | |
6434 } else { | |
6435 throw missingKey(jsonPath, "last"); | |
6436 } | |
6437 return new SearchResultsParams(id, results, last); | |
6438 } else { | |
6439 throw mismatch(jsonPath, "search.results params"); | |
6440 } | |
6441 } | |
6442 | |
6443 EditGetAssistsParams decodeEditGetAssistsParams(String jsonPath, Object json) { | |
6444 if (json is Map) { | |
6445 String file; | |
6446 if (json.containsKey("file")) { | |
6447 file = _decodeString(jsonPath + ".file", json["file"]); | |
6448 } else { | |
6449 throw missingKey(jsonPath, "file"); | |
6450 } | |
6451 int offset; | |
6452 if (json.containsKey("offset")) { | |
6453 offset = _decodeInt(jsonPath + ".offset", json["offset"]); | |
6454 } else { | |
6455 throw missingKey(jsonPath, "offset"); | |
6456 } | |
6457 int length; | |
6458 if (json.containsKey("length")) { | |
6459 length = _decodeInt(jsonPath + ".length", json["length"]); | |
6460 } else { | |
6461 throw missingKey(jsonPath, "length"); | |
6462 } | |
6463 return new EditGetAssistsParams(file, offset, length); | |
6464 } else { | |
6465 throw mismatch(jsonPath, "edit.getAssists params"); | |
6466 } | |
6467 } | |
6468 | |
6469 EditGetAssistsResult decodeEditGetAssistsResult(String jsonPath, Object json) { | |
6470 if (json is Map) { | |
6471 List<SourceChange> assists; | |
6472 if (json.containsKey("assists")) { | |
6473 assists = _decodeList(jsonPath + ".assists", json["assists"], decodeSour ceChange); | |
6474 } else { | |
6475 throw missingKey(jsonPath, "assists"); | |
6476 } | |
6477 return new EditGetAssistsResult(assists); | |
6478 } else { | |
6479 throw mismatch(jsonPath, "edit.getAssists result"); | |
6480 } | |
6481 } | |
6482 | |
6483 EditGetAvailableRefactoringsParams decodeEditGetAvailableRefactoringsParams(St ring jsonPath, Object json) { | |
6484 if (json is Map) { | |
6485 String file; | |
6486 if (json.containsKey("file")) { | |
6487 file = _decodeString(jsonPath + ".file", json["file"]); | |
6488 } else { | |
6489 throw missingKey(jsonPath, "file"); | |
6490 } | |
6491 int offset; | |
6492 if (json.containsKey("offset")) { | |
6493 offset = _decodeInt(jsonPath + ".offset", json["offset"]); | |
6494 } else { | |
6495 throw missingKey(jsonPath, "offset"); | |
6496 } | |
6497 int length; | |
6498 if (json.containsKey("length")) { | |
6499 length = _decodeInt(jsonPath + ".length", json["length"]); | |
6500 } else { | |
6501 throw missingKey(jsonPath, "length"); | |
6502 } | |
6503 return new EditGetAvailableRefactoringsParams(file, offset, length); | |
6504 } else { | |
6505 throw mismatch(jsonPath, "edit.getAvailableRefactorings params"); | |
6506 } | |
6507 } | |
6508 | |
6509 EditGetAvailableRefactoringsResult decodeEditGetAvailableRefactoringsResult(St ring jsonPath, Object json) { | |
6510 if (json is Map) { | |
6511 List<RefactoringKind> kinds; | |
6512 if (json.containsKey("kinds")) { | |
6513 kinds = _decodeList(jsonPath + ".kinds", json["kinds"], decodeRefactorin gKind); | |
6514 } else { | |
6515 throw missingKey(jsonPath, "kinds"); | |
6516 } | |
6517 return new EditGetAvailableRefactoringsResult(kinds); | |
6518 } else { | |
6519 throw mismatch(jsonPath, "edit.getAvailableRefactorings result"); | |
6520 } | |
6521 } | |
6522 | |
6523 EditGetFixesParams decodeEditGetFixesParams(String jsonPath, Object json) { | |
6524 if (json is Map) { | |
6525 String file; | |
6526 if (json.containsKey("file")) { | |
6527 file = _decodeString(jsonPath + ".file", json["file"]); | |
6528 } else { | |
6529 throw missingKey(jsonPath, "file"); | |
6530 } | |
6531 int offset; | |
6532 if (json.containsKey("offset")) { | |
6533 offset = _decodeInt(jsonPath + ".offset", json["offset"]); | |
6534 } else { | |
6535 throw missingKey(jsonPath, "offset"); | |
6536 } | |
6537 return new EditGetFixesParams(file, offset); | |
6538 } else { | |
6539 throw mismatch(jsonPath, "edit.getFixes params"); | |
6540 } | |
6541 } | |
6542 | |
6543 EditGetFixesResult decodeEditGetFixesResult(String jsonPath, Object json) { | |
6544 if (json is Map) { | |
6545 List<ErrorFixes> fixes; | |
6546 if (json.containsKey("fixes")) { | |
6547 fixes = _decodeList(jsonPath + ".fixes", json["fixes"], decodeErrorFixes ); | |
6548 } else { | |
6549 throw missingKey(jsonPath, "fixes"); | |
6550 } | |
6551 return new EditGetFixesResult(fixes); | |
6552 } else { | |
6553 throw mismatch(jsonPath, "edit.getFixes result"); | |
6554 } | |
6555 } | |
6556 | |
6557 EditGetRefactoringParams decodeEditGetRefactoringParams(String jsonPath, Objec t json) { | |
6558 if (json is Map) { | |
6559 RefactoringKind kindId; | |
6560 if (json.containsKey("kindId")) { | |
6561 kindId = decodeRefactoringKind(jsonPath + ".kindId", json["kindId"]); | |
6562 } else { | |
6563 throw missingKey(jsonPath, "kindId"); | |
6564 } | |
6565 String file; | |
6566 if (json.containsKey("file")) { | |
6567 file = _decodeString(jsonPath + ".file", json["file"]); | |
6568 } else { | |
6569 throw missingKey(jsonPath, "file"); | |
6570 } | |
6571 int offset; | |
6572 if (json.containsKey("offset")) { | |
6573 offset = _decodeInt(jsonPath + ".offset", json["offset"]); | |
6574 } else { | |
6575 throw missingKey(jsonPath, "offset"); | |
6576 } | |
6577 int length; | |
6578 if (json.containsKey("length")) { | |
6579 length = _decodeInt(jsonPath + ".length", json["length"]); | |
6580 } else { | |
6581 throw missingKey(jsonPath, "length"); | |
6582 } | |
6583 bool validateOnly; | |
6584 if (json.containsKey("validateOnly")) { | |
6585 validateOnly = _decodeBool(jsonPath + ".validateOnly", json["validateOnl y"]); | |
6586 } else { | |
6587 throw missingKey(jsonPath, "validateOnly"); | |
6588 } | |
6589 Object options; | |
6590 if (json.containsKey("options")) { | |
6591 options = json["options"]; | |
6592 } | |
6593 return new EditGetRefactoringParams(kindId, file, offset, length, validate Only, options: options); | |
6594 } else { | |
6595 throw mismatch(jsonPath, "edit.getRefactoring params"); | |
6596 } | |
6597 } | |
6598 | |
6599 EditGetRefactoringResult decodeEditGetRefactoringResult(String jsonPath, Objec t json) { | |
6600 if (json is Map) { | |
6601 List<RefactoringProblem> status; | |
6602 if (json.containsKey("status")) { | |
6603 status = _decodeList(jsonPath + ".status", json["status"], decodeRefacto ringProblem); | |
6604 } else { | |
6605 throw missingKey(jsonPath, "status"); | |
6606 } | |
6607 Object feedback; | |
6608 if (json.containsKey("feedback")) { | |
6609 feedback = json["feedback"]; | |
6610 } | |
6611 SourceChange change; | |
6612 if (json.containsKey("change")) { | |
6613 change = decodeSourceChange(jsonPath + ".change", json["change"]); | |
6614 } | |
6615 List<String> potentialEdits; | |
6616 if (json.containsKey("potentialEdits")) { | |
6617 potentialEdits = _decodeList(jsonPath + ".potentialEdits", json["potenti alEdits"], _decodeString); | |
6618 } | |
6619 return new EditGetRefactoringResult(status, feedback: feedback, change: ch ange, potentialEdits: potentialEdits); | |
6620 } else { | |
6621 throw mismatch(jsonPath, "edit.getRefactoring result"); | |
6622 } | |
6623 } | |
6624 | |
6625 DebugCreateContextParams decodeDebugCreateContextParams(String jsonPath, Objec t json) { | |
6626 if (json is Map) { | |
6627 String contextRoot; | |
6628 if (json.containsKey("contextRoot")) { | |
6629 contextRoot = _decodeString(jsonPath + ".contextRoot", json["contextRoot "]); | |
6630 } else { | |
6631 throw missingKey(jsonPath, "contextRoot"); | |
6632 } | |
6633 return new DebugCreateContextParams(contextRoot); | |
6634 } else { | |
6635 throw mismatch(jsonPath, "debug.createContext params"); | |
6636 } | |
6637 } | |
6638 | |
6639 DebugCreateContextResult decodeDebugCreateContextResult(String jsonPath, Objec t json) { | |
6640 if (json is Map) { | |
6641 String id; | |
6642 if (json.containsKey("id")) { | |
6643 id = _decodeString(jsonPath + ".id", json["id"]); | |
6644 } else { | |
6645 throw missingKey(jsonPath, "id"); | |
6646 } | |
6647 return new DebugCreateContextResult(id); | |
6648 } else { | |
6649 throw mismatch(jsonPath, "debug.createContext result"); | |
6650 } | |
6651 } | |
6652 | |
6653 DebugDeleteContextParams decodeDebugDeleteContextParams(String jsonPath, Objec t json) { | |
6654 if (json is Map) { | |
6655 String id; | |
6656 if (json.containsKey("id")) { | |
6657 id = _decodeString(jsonPath + ".id", json["id"]); | |
6658 } else { | |
6659 throw missingKey(jsonPath, "id"); | |
6660 } | |
6661 return new DebugDeleteContextParams(id); | |
6662 } else { | |
6663 throw mismatch(jsonPath, "debug.deleteContext params"); | |
6664 } | |
6665 } | |
6666 | |
6667 DebugMapUriParams decodeDebugMapUriParams(String jsonPath, Object json) { | |
6668 if (json is Map) { | |
6669 String id; | |
6670 if (json.containsKey("id")) { | |
6671 id = _decodeString(jsonPath + ".id", json["id"]); | |
6672 } else { | |
6673 throw missingKey(jsonPath, "id"); | |
6674 } | |
6675 String file; | |
6676 if (json.containsKey("file")) { | |
6677 file = _decodeString(jsonPath + ".file", json["file"]); | |
6678 } | |
6679 String uri; | |
6680 if (json.containsKey("uri")) { | |
6681 uri = _decodeString(jsonPath + ".uri", json["uri"]); | |
6682 } | |
6683 return new DebugMapUriParams(id, file: file, uri: uri); | |
6684 } else { | |
6685 throw mismatch(jsonPath, "debug.mapUri params"); | |
6686 } | |
6687 } | |
6688 | |
6689 DebugMapUriResult decodeDebugMapUriResult(String jsonPath, Object json) { | |
6690 if (json is Map) { | |
6691 String file; | |
6692 if (json.containsKey("file")) { | |
6693 file = _decodeString(jsonPath + ".file", json["file"]); | |
6694 } | |
6695 String uri; | |
6696 if (json.containsKey("uri")) { | |
6697 uri = _decodeString(jsonPath + ".uri", json["uri"]); | |
6698 } | |
6699 return new DebugMapUriResult(file: file, uri: uri); | |
6700 } else { | |
6701 throw mismatch(jsonPath, "debug.mapUri result"); | |
6702 } | |
6703 } | |
6704 | |
6705 DebugSetSubscriptionsParams decodeDebugSetSubscriptionsParams(String jsonPath, Object json) { | |
6706 if (json is Map) { | |
6707 List<DebugService> subscriptions; | |
6708 if (json.containsKey("subscriptions")) { | |
6709 subscriptions = _decodeList(jsonPath + ".subscriptions", json["subscript ions"], decodeDebugService); | |
6710 } else { | |
6711 throw missingKey(jsonPath, "subscriptions"); | |
6712 } | |
6713 return new DebugSetSubscriptionsParams(subscriptions); | |
6714 } else { | |
6715 throw mismatch(jsonPath, "debug.setSubscriptions params"); | |
6716 } | |
6717 } | |
6718 | |
6719 DebugLaunchDataParams decodeDebugLaunchDataParams(String jsonPath, Object json ) { | |
6720 if (json is Map) { | |
6721 List<ExecutableFile> executables; | |
6722 if (json.containsKey("executables")) { | |
6723 executables = _decodeList(jsonPath + ".executables", json["executables"] , decodeExecutableFile); | |
6724 } else { | |
6725 throw missingKey(jsonPath, "executables"); | |
6726 } | |
6727 Map<String, List<String>> dartToHtml; | |
6728 if (json.containsKey("dartToHtml")) { | |
6729 dartToHtml = _decodeMap(jsonPath + ".dartToHtml", json["dartToHtml"], va lueDecoder: (String jsonPath, Object json) => _decodeList(jsonPath, json, _decod eString)); | |
6730 } else { | |
6731 throw missingKey(jsonPath, "dartToHtml"); | |
6732 } | |
6733 Map<String, List<String>> htmlToDart; | |
6734 if (json.containsKey("htmlToDart")) { | |
6735 htmlToDart = _decodeMap(jsonPath + ".htmlToDart", json["htmlToDart"], va lueDecoder: (String jsonPath, Object json) => _decodeList(jsonPath, json, _decod eString)); | |
6736 } else { | |
6737 throw missingKey(jsonPath, "htmlToDart"); | |
6738 } | |
6739 return new DebugLaunchDataParams(executables, dartToHtml, htmlToDart); | |
6740 } else { | |
6741 throw mismatch(jsonPath, "debug.launchData params"); | |
6742 } | |
6743 } | |
6744 | |
6745 AddContentOverlay decodeAddContentOverlay(String jsonPath, Object json) { | |
6746 if (json is Map) { | |
6747 if (json["type"] != "add") { | |
6748 throw mismatch(jsonPath, "equal " + "add"); | |
6749 } | |
6750 String content; | |
6751 if (json.containsKey("content")) { | |
6752 content = _decodeString(jsonPath + ".content", json["content"]); | |
6753 } else { | |
6754 throw missingKey(jsonPath, "content"); | |
6755 } | |
6756 return new AddContentOverlay(content); | |
6757 } else { | |
6758 throw mismatch(jsonPath, "AddContentOverlay"); | |
6759 } | |
6760 } | |
6761 | |
6762 AnalysisError decodeAnalysisError(String jsonPath, Object json) { | |
6763 if (json is Map) { | |
6764 ErrorSeverity severity; | |
6765 if (json.containsKey("severity")) { | |
6766 severity = decodeErrorSeverity(jsonPath + ".severity", json["severity"]) ; | |
6767 } else { | |
6768 throw missingKey(jsonPath, "severity"); | |
6769 } | |
6770 ErrorType type; | |
6771 if (json.containsKey("type")) { | |
6772 type = decodeErrorType(jsonPath + ".type", json["type"]); | |
6773 } else { | |
6774 throw missingKey(jsonPath, "type"); | |
6775 } | |
6776 Location location; | |
6777 if (json.containsKey("location")) { | |
6778 location = decodeLocation(jsonPath + ".location", json["location"]); | |
6779 } else { | |
6780 throw missingKey(jsonPath, "location"); | |
6781 } | |
6782 String message; | |
6783 if (json.containsKey("message")) { | |
6784 message = _decodeString(jsonPath + ".message", json["message"]); | |
6785 } else { | |
6786 throw missingKey(jsonPath, "message"); | |
6787 } | |
6788 String correction; | |
6789 if (json.containsKey("correction")) { | |
6790 correction = _decodeString(jsonPath + ".correction", json["correction"]) ; | |
6791 } | |
6792 return new AnalysisError(severity, type, location, message, correction: co rrection); | |
6793 } else { | |
6794 throw mismatch(jsonPath, "AnalysisError"); | |
6795 } | |
6796 } | |
6797 | |
6798 AnalysisOptions decodeAnalysisOptions(String jsonPath, Object json) { | |
6799 if (json is Map) { | |
6800 bool enableAsync; | |
6801 if (json.containsKey("enableAsync")) { | |
danrubel
2014/08/17 17:10:20
Is the containsKey check needed here? Will the map
Paul Berry
2014/08/18 21:58:03
That suggestion would create a semantic difference
| |
6802 enableAsync = _decodeBool(jsonPath + ".enableAsync", json["enableAsync"] ); | |
6803 } | |
6804 bool enableDeferredLoading; | |
6805 if (json.containsKey("enableDeferredLoading")) { | |
6806 enableDeferredLoading = _decodeBool(jsonPath + ".enableDeferredLoading", json["enableDeferredLoading"]); | |
6807 } | |
6808 bool enableEnums; | |
6809 if (json.containsKey("enableEnums")) { | |
6810 enableEnums = _decodeBool(jsonPath + ".enableEnums", json["enableEnums"] ); | |
6811 } | |
6812 bool generateDart2jsHints; | |
6813 if (json.containsKey("generateDart2jsHints")) { | |
6814 generateDart2jsHints = _decodeBool(jsonPath + ".generateDart2jsHints", j son["generateDart2jsHints"]); | |
6815 } | |
6816 bool generateHints; | |
6817 if (json.containsKey("generateHints")) { | |
6818 generateHints = _decodeBool(jsonPath + ".generateHints", json["generateH ints"]); | |
6819 } | |
6820 return new AnalysisOptions(enableAsync: enableAsync, enableDeferredLoading : enableDeferredLoading, enableEnums: enableEnums, generateDart2jsHints: generat eDart2jsHints, generateHints: generateHints); | |
6821 } else { | |
6822 throw mismatch(jsonPath, "AnalysisOptions"); | |
6823 } | |
6824 } | |
6825 | |
6826 AnalysisService decodeAnalysisService(String jsonPath, Object json) { | |
6827 if (json is String) { | |
6828 try { | |
6829 return new AnalysisService(json); | |
6830 } catch(_) { | |
6831 // Fall through | |
6832 } | |
6833 } | |
6834 throw mismatch(jsonPath, "AnalysisService"); | |
6835 } | |
6836 | |
6837 AnalysisStatus decodeAnalysisStatus(String jsonPath, Object json) { | |
6838 if (json is Map) { | |
6839 bool analyzing; | |
6840 if (json.containsKey("analyzing")) { | |
6841 analyzing = _decodeBool(jsonPath + ".analyzing", json["analyzing"]); | |
6842 } else { | |
6843 throw missingKey(jsonPath, "analyzing"); | |
6844 } | |
6845 String analysisTarget; | |
6846 if (json.containsKey("analysisTarget")) { | |
6847 analysisTarget = _decodeString(jsonPath + ".analysisTarget", json["analy sisTarget"]); | |
6848 } | |
6849 return new AnalysisStatus(analyzing, analysisTarget: analysisTarget); | |
6850 } else { | |
6851 throw mismatch(jsonPath, "AnalysisStatus"); | |
6852 } | |
6853 } | |
6854 | |
6855 ChangeContentOverlay decodeChangeContentOverlay(String jsonPath, Object json) { | |
6856 if (json is Map) { | |
6857 if (json["type"] != "change") { | |
6858 throw mismatch(jsonPath, "equal " + "change"); | |
6859 } | |
6860 List<SourceEdit> edits; | |
6861 if (json.containsKey("edits")) { | |
6862 edits = _decodeList(jsonPath + ".edits", json["edits"], decodeSourceEdit ); | |
6863 } else { | |
6864 throw missingKey(jsonPath, "edits"); | |
6865 } | |
6866 return new ChangeContentOverlay(edits); | |
6867 } else { | |
6868 throw mismatch(jsonPath, "ChangeContentOverlay"); | |
6869 } | |
6870 } | |
6871 | |
6872 CompletionRelevance decodeCompletionRelevance(String jsonPath, Object json) { | |
6873 if (json is String) { | |
6874 try { | |
6875 return new CompletionRelevance(json); | |
6876 } catch(_) { | |
6877 // Fall through | |
6878 } | |
6879 } | |
6880 throw mismatch(jsonPath, "CompletionRelevance"); | |
6881 } | |
6882 | |
6883 CompletionSuggestion decodeCompletionSuggestion(String jsonPath, Object json) { | |
6884 if (json is Map) { | |
6885 CompletionSuggestionKind kind; | |
6886 if (json.containsKey("kind")) { | |
6887 kind = decodeCompletionSuggestionKind(jsonPath + ".kind", json["kind"]); | |
6888 } else { | |
6889 throw missingKey(jsonPath, "kind"); | |
6890 } | |
6891 CompletionRelevance relevance; | |
6892 if (json.containsKey("relevance")) { | |
6893 relevance = decodeCompletionRelevance(jsonPath + ".relevance", json["rel evance"]); | |
6894 } else { | |
6895 throw missingKey(jsonPath, "relevance"); | |
6896 } | |
6897 String completion; | |
6898 if (json.containsKey("completion")) { | |
6899 completion = _decodeString(jsonPath + ".completion", json["completion"]) ; | |
6900 } else { | |
6901 throw missingKey(jsonPath, "completion"); | |
6902 } | |
6903 int selectionOffset; | |
6904 if (json.containsKey("selectionOffset")) { | |
6905 selectionOffset = _decodeInt(jsonPath + ".selectionOffset", json["select ionOffset"]); | |
6906 } else { | |
6907 throw missingKey(jsonPath, "selectionOffset"); | |
6908 } | |
6909 int selectionLength; | |
6910 if (json.containsKey("selectionLength")) { | |
6911 selectionLength = _decodeInt(jsonPath + ".selectionLength", json["select ionLength"]); | |
6912 } else { | |
6913 throw missingKey(jsonPath, "selectionLength"); | |
6914 } | |
6915 bool isDeprecated; | |
6916 if (json.containsKey("isDeprecated")) { | |
6917 isDeprecated = _decodeBool(jsonPath + ".isDeprecated", json["isDeprecate d"]); | |
6918 } else { | |
6919 throw missingKey(jsonPath, "isDeprecated"); | |
6920 } | |
6921 bool isPotential; | |
6922 if (json.containsKey("isPotential")) { | |
6923 isPotential = _decodeBool(jsonPath + ".isPotential", json["isPotential"] ); | |
6924 } else { | |
6925 throw missingKey(jsonPath, "isPotential"); | |
6926 } | |
6927 String docSummary; | |
6928 if (json.containsKey("docSummary")) { | |
6929 docSummary = _decodeString(jsonPath + ".docSummary", json["docSummary"]) ; | |
6930 } | |
6931 String docComplete; | |
6932 if (json.containsKey("docComplete")) { | |
6933 docComplete = _decodeString(jsonPath + ".docComplete", json["docComplete "]); | |
6934 } | |
6935 String declaringType; | |
6936 if (json.containsKey("declaringType")) { | |
6937 declaringType = _decodeString(jsonPath + ".declaringType", json["declari ngType"]); | |
6938 } | |
6939 String returnType; | |
6940 if (json.containsKey("returnType")) { | |
6941 returnType = _decodeString(jsonPath + ".returnType", json["returnType"]) ; | |
6942 } | |
6943 List<String> parameterNames; | |
6944 if (json.containsKey("parameterNames")) { | |
6945 parameterNames = _decodeList(jsonPath + ".parameterNames", json["paramet erNames"], _decodeString); | |
6946 } | |
6947 List<String> parameterTypes; | |
6948 if (json.containsKey("parameterTypes")) { | |
6949 parameterTypes = _decodeList(jsonPath + ".parameterTypes", json["paramet erTypes"], _decodeString); | |
6950 } | |
6951 int requiredParameterCount; | |
6952 if (json.containsKey("requiredParameterCount")) { | |
6953 requiredParameterCount = _decodeInt(jsonPath + ".requiredParameterCount" , json["requiredParameterCount"]); | |
6954 } | |
6955 int positionalParameterCount; | |
6956 if (json.containsKey("positionalParameterCount")) { | |
6957 positionalParameterCount = _decodeInt(jsonPath + ".positionalParameterCo unt", json["positionalParameterCount"]); | |
6958 } | |
6959 String parameterName; | |
6960 if (json.containsKey("parameterName")) { | |
6961 parameterName = _decodeString(jsonPath + ".parameterName", json["paramet erName"]); | |
6962 } | |
6963 String parameterType; | |
6964 if (json.containsKey("parameterType")) { | |
6965 parameterType = _decodeString(jsonPath + ".parameterType", json["paramet erType"]); | |
6966 } | |
6967 return new CompletionSuggestion(kind, relevance, completion, selectionOffs et, selectionLength, isDeprecated, isPotential, docSummary: docSummary, docCompl ete: docComplete, declaringType: declaringType, returnType: returnType, paramete rNames: parameterNames, parameterTypes: parameterTypes, requiredParameterCount: requiredParameterCount, positionalParameterCount: positionalParameterCount, para meterName: parameterName, parameterType: parameterType); | |
6968 } else { | |
6969 throw mismatch(jsonPath, "CompletionSuggestion"); | |
6970 } | |
6971 } | |
6972 | |
6973 CompletionSuggestionKind decodeCompletionSuggestionKind(String jsonPath, Objec t json) { | |
6974 if (json is String) { | |
6975 try { | |
6976 return new CompletionSuggestionKind(json); | |
6977 } catch(_) { | |
6978 // Fall through | |
6979 } | |
6980 } | |
6981 throw mismatch(jsonPath, "CompletionSuggestionKind"); | |
6982 } | |
6983 | |
6984 DebugService decodeDebugService(String jsonPath, Object json) { | |
6985 if (json is String) { | |
6986 try { | |
6987 return new DebugService(json); | |
6988 } catch(_) { | |
6989 // Fall through | |
6990 } | |
6991 } | |
6992 throw mismatch(jsonPath, "DebugService"); | |
6993 } | |
6994 | |
6995 Element decodeElement(String jsonPath, Object json) { | |
6996 if (json is Map) { | |
6997 ElementKind kind; | |
6998 if (json.containsKey("kind")) { | |
6999 kind = decodeElementKind(jsonPath + ".kind", json["kind"]); | |
7000 } else { | |
7001 throw missingKey(jsonPath, "kind"); | |
7002 } | |
7003 String name; | |
7004 if (json.containsKey("name")) { | |
7005 name = _decodeString(jsonPath + ".name", json["name"]); | |
7006 } else { | |
7007 throw missingKey(jsonPath, "name"); | |
7008 } | |
7009 Location location; | |
7010 if (json.containsKey("location")) { | |
7011 location = decodeLocation(jsonPath + ".location", json["location"]); | |
7012 } | |
7013 int flags; | |
7014 if (json.containsKey("flags")) { | |
7015 flags = _decodeInt(jsonPath + ".flags", json["flags"]); | |
7016 } else { | |
7017 throw missingKey(jsonPath, "flags"); | |
7018 } | |
7019 String parameters; | |
7020 if (json.containsKey("parameters")) { | |
7021 parameters = _decodeString(jsonPath + ".parameters", json["parameters"]) ; | |
7022 } | |
7023 String returnType; | |
7024 if (json.containsKey("returnType")) { | |
7025 returnType = _decodeString(jsonPath + ".returnType", json["returnType"]) ; | |
7026 } | |
7027 return new Element(kind, name, flags, location: location, parameters: para meters, returnType: returnType); | |
7028 } else { | |
7029 throw mismatch(jsonPath, "Element"); | |
7030 } | |
7031 } | |
7032 | |
7033 ElementKind decodeElementKind(String jsonPath, Object json) { | |
7034 if (json is String) { | |
7035 try { | |
7036 return new ElementKind(json); | |
7037 } catch(_) { | |
7038 // Fall through | |
7039 } | |
7040 } | |
7041 throw mismatch(jsonPath, "ElementKind"); | |
7042 } | |
7043 | |
7044 Error decodeError(String jsonPath, Object json) { | |
7045 if (json is Map) { | |
7046 String code; | |
7047 if (json.containsKey("code")) { | |
7048 code = _decodeString(jsonPath + ".code", json["code"]); | |
7049 } else { | |
7050 throw missingKey(jsonPath, "code"); | |
7051 } | |
7052 String message; | |
7053 if (json.containsKey("message")) { | |
7054 message = _decodeString(jsonPath + ".message", json["message"]); | |
7055 } else { | |
7056 throw missingKey(jsonPath, "message"); | |
7057 } | |
7058 Object data; | |
7059 if (json.containsKey("data")) { | |
7060 data = json["data"]; | |
7061 } | |
7062 return new Error(code, message, data: data); | |
7063 } else { | |
7064 throw mismatch(jsonPath, "Error"); | |
7065 } | |
7066 } | |
7067 | |
7068 ErrorFixes decodeErrorFixes(String jsonPath, Object json) { | |
7069 if (json is Map) { | |
7070 AnalysisError error; | |
7071 if (json.containsKey("error")) { | |
7072 error = decodeAnalysisError(jsonPath + ".error", json["error"]); | |
7073 } else { | |
7074 throw missingKey(jsonPath, "error"); | |
7075 } | |
7076 List<SourceChange> fixes; | |
7077 if (json.containsKey("fixes")) { | |
7078 fixes = _decodeList(jsonPath + ".fixes", json["fixes"], decodeSourceChan ge); | |
7079 } else { | |
7080 throw missingKey(jsonPath, "fixes"); | |
7081 } | |
7082 return new ErrorFixes(error, fixes); | |
7083 } else { | |
7084 throw mismatch(jsonPath, "ErrorFixes"); | |
7085 } | |
7086 } | |
7087 | |
7088 ErrorSeverity decodeErrorSeverity(String jsonPath, Object json) { | |
7089 if (json is String) { | |
7090 try { | |
7091 return new ErrorSeverity(json); | |
7092 } catch(_) { | |
7093 // Fall through | |
7094 } | |
7095 } | |
7096 throw mismatch(jsonPath, "ErrorSeverity"); | |
7097 } | |
7098 | |
7099 ErrorType decodeErrorType(String jsonPath, Object json) { | |
7100 if (json is String) { | |
7101 try { | |
7102 return new ErrorType(json); | |
7103 } catch(_) { | |
7104 // Fall through | |
7105 } | |
7106 } | |
7107 throw mismatch(jsonPath, "ErrorType"); | |
7108 } | |
7109 | |
7110 ExecutableFile decodeExecutableFile(String jsonPath, Object json) { | |
7111 if (json is Map) { | |
7112 String file; | |
7113 if (json.containsKey("file")) { | |
7114 file = _decodeString(jsonPath + ".file", json["file"]); | |
7115 } else { | |
7116 throw missingKey(jsonPath, "file"); | |
7117 } | |
7118 ExecutableKind offset; | |
7119 if (json.containsKey("offset")) { | |
7120 offset = decodeExecutableKind(jsonPath + ".offset", json["offset"]); | |
7121 } else { | |
7122 throw missingKey(jsonPath, "offset"); | |
7123 } | |
7124 return new ExecutableFile(file, offset); | |
7125 } else { | |
7126 throw mismatch(jsonPath, "ExecutableFile"); | |
7127 } | |
7128 } | |
7129 | |
7130 ExecutableKind decodeExecutableKind(String jsonPath, Object json) { | |
7131 if (json is String) { | |
7132 try { | |
7133 return new ExecutableKind(json); | |
7134 } catch(_) { | |
7135 // Fall through | |
7136 } | |
7137 } | |
7138 throw mismatch(jsonPath, "ExecutableKind"); | |
7139 } | |
7140 | |
7141 FoldingKind decodeFoldingKind(String jsonPath, Object json) { | |
7142 if (json is String) { | |
7143 try { | |
7144 return new FoldingKind(json); | |
7145 } catch(_) { | |
7146 // Fall through | |
7147 } | |
7148 } | |
7149 throw mismatch(jsonPath, "FoldingKind"); | |
7150 } | |
7151 | |
7152 FoldingRegion decodeFoldingRegion(String jsonPath, Object json) { | |
7153 if (json is Map) { | |
7154 FoldingKind kind; | |
7155 if (json.containsKey("kind")) { | |
7156 kind = decodeFoldingKind(jsonPath + ".kind", json["kind"]); | |
7157 } else { | |
7158 throw missingKey(jsonPath, "kind"); | |
7159 } | |
7160 int offset; | |
7161 if (json.containsKey("offset")) { | |
7162 offset = _decodeInt(jsonPath + ".offset", json["offset"]); | |
7163 } else { | |
7164 throw missingKey(jsonPath, "offset"); | |
7165 } | |
7166 int length; | |
7167 if (json.containsKey("length")) { | |
7168 length = _decodeInt(jsonPath + ".length", json["length"]); | |
7169 } else { | |
7170 throw missingKey(jsonPath, "length"); | |
7171 } | |
7172 return new FoldingRegion(kind, offset, length); | |
7173 } else { | |
7174 throw mismatch(jsonPath, "FoldingRegion"); | |
7175 } | |
7176 } | |
7177 | |
7178 HighlightRegion decodeHighlightRegion(String jsonPath, Object json) { | |
7179 if (json is Map) { | |
7180 HighlightRegionType type; | |
7181 if (json.containsKey("type")) { | |
7182 type = decodeHighlightRegionType(jsonPath + ".type", json["type"]); | |
7183 } else { | |
7184 throw missingKey(jsonPath, "type"); | |
7185 } | |
7186 int offset; | |
7187 if (json.containsKey("offset")) { | |
7188 offset = _decodeInt(jsonPath + ".offset", json["offset"]); | |
7189 } else { | |
7190 throw missingKey(jsonPath, "offset"); | |
7191 } | |
7192 int length; | |
7193 if (json.containsKey("length")) { | |
7194 length = _decodeInt(jsonPath + ".length", json["length"]); | |
7195 } else { | |
7196 throw missingKey(jsonPath, "length"); | |
7197 } | |
7198 return new HighlightRegion(type, offset, length); | |
7199 } else { | |
7200 throw mismatch(jsonPath, "HighlightRegion"); | |
7201 } | |
7202 } | |
7203 | |
7204 HighlightRegionType decodeHighlightRegionType(String jsonPath, Object json) { | |
7205 if (json is String) { | |
7206 try { | |
7207 return new HighlightRegionType(json); | |
7208 } catch(_) { | |
7209 // Fall through | |
7210 } | |
7211 } | |
7212 throw mismatch(jsonPath, "HighlightRegionType"); | |
7213 } | |
7214 | |
7215 HoverInformation decodeHoverInformation(String jsonPath, Object json) { | |
7216 if (json is Map) { | |
7217 int offset; | |
7218 if (json.containsKey("offset")) { | |
7219 offset = _decodeInt(jsonPath + ".offset", json["offset"]); | |
7220 } else { | |
7221 throw missingKey(jsonPath, "offset"); | |
7222 } | |
7223 int length; | |
7224 if (json.containsKey("length")) { | |
7225 length = _decodeInt(jsonPath + ".length", json["length"]); | |
7226 } else { | |
7227 throw missingKey(jsonPath, "length"); | |
7228 } | |
7229 String containingLibraryPath; | |
7230 if (json.containsKey("containingLibraryPath")) { | |
7231 containingLibraryPath = _decodeString(jsonPath + ".containingLibraryPath ", json["containingLibraryPath"]); | |
7232 } | |
7233 String containingLibraryName; | |
7234 if (json.containsKey("containingLibraryName")) { | |
7235 containingLibraryName = _decodeString(jsonPath + ".containingLibraryName ", json["containingLibraryName"]); | |
7236 } | |
7237 String dartdoc; | |
7238 if (json.containsKey("dartdoc")) { | |
7239 dartdoc = _decodeString(jsonPath + ".dartdoc", json["dartdoc"]); | |
7240 } | |
7241 String elementDescription; | |
7242 if (json.containsKey("elementDescription")) { | |
7243 elementDescription = _decodeString(jsonPath + ".elementDescription", jso n["elementDescription"]); | |
7244 } | |
7245 String elementKind; | |
7246 if (json.containsKey("elementKind")) { | |
7247 elementKind = _decodeString(jsonPath + ".elementKind", json["elementKind "]); | |
7248 } | |
7249 String parameter; | |
7250 if (json.containsKey("parameter")) { | |
7251 parameter = _decodeString(jsonPath + ".parameter", json["parameter"]); | |
7252 } | |
7253 String propagatedType; | |
7254 if (json.containsKey("propagatedType")) { | |
7255 propagatedType = _decodeString(jsonPath + ".propagatedType", json["propa gatedType"]); | |
7256 } | |
7257 String staticType; | |
7258 if (json.containsKey("staticType")) { | |
7259 staticType = _decodeString(jsonPath + ".staticType", json["staticType"]) ; | |
7260 } | |
7261 return new HoverInformation(offset, length, containingLibraryPath: contain ingLibraryPath, containingLibraryName: containingLibraryName, dartdoc: dartdoc, elementDescription: elementDescription, elementKind: elementKind, parameter: par ameter, propagatedType: propagatedType, staticType: staticType); | |
7262 } else { | |
7263 throw mismatch(jsonPath, "HoverInformation"); | |
7264 } | |
7265 } | |
7266 | |
7267 LinkedEditGroup decodeLinkedEditGroup(String jsonPath, Object json) { | |
7268 if (json is Map) { | |
7269 List<Position> positions; | |
7270 if (json.containsKey("positions")) { | |
7271 positions = _decodeList(jsonPath + ".positions", json["positions"], deco dePosition); | |
7272 } else { | |
7273 throw missingKey(jsonPath, "positions"); | |
7274 } | |
7275 int length; | |
7276 if (json.containsKey("length")) { | |
7277 length = _decodeInt(jsonPath + ".length", json["length"]); | |
7278 } else { | |
7279 throw missingKey(jsonPath, "length"); | |
7280 } | |
7281 List<LinkedEditSuggestion> suggestions; | |
7282 if (json.containsKey("suggestions")) { | |
7283 suggestions = _decodeList(jsonPath + ".suggestions", json["suggestions"] , decodeLinkedEditSuggestion); | |
7284 } else { | |
7285 throw missingKey(jsonPath, "suggestions"); | |
7286 } | |
7287 return new LinkedEditGroup(positions, length, suggestions); | |
7288 } else { | |
7289 throw mismatch(jsonPath, "LinkedEditGroup"); | |
7290 } | |
7291 } | |
7292 | |
7293 LinkedEditSuggestion decodeLinkedEditSuggestion(String jsonPath, Object json) { | |
7294 if (json is Map) { | |
7295 String value; | |
7296 if (json.containsKey("value")) { | |
7297 value = _decodeString(jsonPath + ".value", json["value"]); | |
7298 } else { | |
7299 throw missingKey(jsonPath, "value"); | |
7300 } | |
7301 LinkedEditSuggestionKind kind; | |
7302 if (json.containsKey("kind")) { | |
7303 kind = decodeLinkedEditSuggestionKind(jsonPath + ".kind", json["kind"]); | |
7304 } else { | |
7305 throw missingKey(jsonPath, "kind"); | |
7306 } | |
7307 return new LinkedEditSuggestion(value, kind); | |
7308 } else { | |
7309 throw mismatch(jsonPath, "LinkedEditSuggestion"); | |
7310 } | |
7311 } | |
7312 | |
7313 LinkedEditSuggestionKind decodeLinkedEditSuggestionKind(String jsonPath, Objec t json) { | |
7314 if (json is String) { | |
7315 try { | |
7316 return new LinkedEditSuggestionKind(json); | |
7317 } catch(_) { | |
7318 // Fall through | |
7319 } | |
7320 } | |
7321 throw mismatch(jsonPath, "LinkedEditSuggestionKind"); | |
7322 } | |
7323 | |
7324 Location decodeLocation(String jsonPath, Object json) { | |
7325 if (json is Map) { | |
7326 String file; | |
7327 if (json.containsKey("file")) { | |
7328 file = _decodeString(jsonPath + ".file", json["file"]); | |
7329 } else { | |
7330 throw missingKey(jsonPath, "file"); | |
7331 } | |
7332 int offset; | |
7333 if (json.containsKey("offset")) { | |
7334 offset = _decodeInt(jsonPath + ".offset", json["offset"]); | |
7335 } else { | |
7336 throw missingKey(jsonPath, "offset"); | |
7337 } | |
7338 int length; | |
7339 if (json.containsKey("length")) { | |
7340 length = _decodeInt(jsonPath + ".length", json["length"]); | |
7341 } else { | |
7342 throw missingKey(jsonPath, "length"); | |
7343 } | |
7344 int startLine; | |
7345 if (json.containsKey("startLine")) { | |
7346 startLine = _decodeInt(jsonPath + ".startLine", json["startLine"]); | |
7347 } else { | |
7348 throw missingKey(jsonPath, "startLine"); | |
7349 } | |
7350 int startColumn; | |
7351 if (json.containsKey("startColumn")) { | |
7352 startColumn = _decodeInt(jsonPath + ".startColumn", json["startColumn"]) ; | |
7353 } else { | |
7354 throw missingKey(jsonPath, "startColumn"); | |
7355 } | |
7356 return new Location(file, offset, length, startLine, startColumn); | |
7357 } else { | |
7358 throw mismatch(jsonPath, "Location"); | |
7359 } | |
7360 } | |
7361 | |
7362 NavigationRegion decodeNavigationRegion(String jsonPath, Object json) { | |
7363 if (json is Map) { | |
7364 int offset; | |
7365 if (json.containsKey("offset")) { | |
7366 offset = _decodeInt(jsonPath + ".offset", json["offset"]); | |
7367 } else { | |
7368 throw missingKey(jsonPath, "offset"); | |
7369 } | |
7370 int length; | |
7371 if (json.containsKey("length")) { | |
7372 length = _decodeInt(jsonPath + ".length", json["length"]); | |
7373 } else { | |
7374 throw missingKey(jsonPath, "length"); | |
7375 } | |
7376 List<Element> targets; | |
7377 if (json.containsKey("targets")) { | |
7378 targets = _decodeList(jsonPath + ".targets", json["targets"], decodeElem ent); | |
7379 } else { | |
7380 throw missingKey(jsonPath, "targets"); | |
7381 } | |
7382 return new NavigationRegion(offset, length, targets); | |
7383 } else { | |
7384 throw mismatch(jsonPath, "NavigationRegion"); | |
7385 } | |
7386 } | |
7387 | |
7388 Occurrences decodeOccurrences(String jsonPath, Object json) { | |
7389 if (json is Map) { | |
7390 Element element; | |
7391 if (json.containsKey("element")) { | |
7392 element = decodeElement(jsonPath + ".element", json["element"]); | |
7393 } else { | |
7394 throw missingKey(jsonPath, "element"); | |
7395 } | |
7396 List<int> offsets; | |
7397 if (json.containsKey("offsets")) { | |
7398 offsets = _decodeList(jsonPath + ".offsets", json["offsets"], _decodeInt ); | |
7399 } else { | |
7400 throw missingKey(jsonPath, "offsets"); | |
7401 } | |
7402 int length; | |
7403 if (json.containsKey("length")) { | |
7404 length = _decodeInt(jsonPath + ".length", json["length"]); | |
7405 } else { | |
7406 throw missingKey(jsonPath, "length"); | |
7407 } | |
7408 return new Occurrences(element, offsets, length); | |
7409 } else { | |
7410 throw mismatch(jsonPath, "Occurrences"); | |
7411 } | |
7412 } | |
7413 | |
7414 Outline decodeOutline(String jsonPath, Object json) { | |
7415 if (json is Map) { | |
7416 Element element; | |
7417 if (json.containsKey("element")) { | |
7418 element = decodeElement(jsonPath + ".element", json["element"]); | |
7419 } else { | |
7420 throw missingKey(jsonPath, "element"); | |
7421 } | |
7422 int offset; | |
7423 if (json.containsKey("offset")) { | |
7424 offset = _decodeInt(jsonPath + ".offset", json["offset"]); | |
7425 } else { | |
7426 throw missingKey(jsonPath, "offset"); | |
7427 } | |
7428 int length; | |
7429 if (json.containsKey("length")) { | |
7430 length = _decodeInt(jsonPath + ".length", json["length"]); | |
7431 } else { | |
7432 throw missingKey(jsonPath, "length"); | |
7433 } | |
7434 List<Outline> children; | |
7435 if (json.containsKey("children")) { | |
7436 children = _decodeList(jsonPath + ".children", json["children"], decodeO utline); | |
7437 } | |
7438 return new Outline(element, offset, length, children: children); | |
7439 } else { | |
7440 throw mismatch(jsonPath, "Outline"); | |
7441 } | |
7442 } | |
7443 | |
7444 Override decodeOverride(String jsonPath, Object json) { | |
7445 if (json is Map) { | |
7446 int offset; | |
7447 if (json.containsKey("offset")) { | |
7448 offset = _decodeInt(jsonPath + ".offset", json["offset"]); | |
7449 } else { | |
7450 throw missingKey(jsonPath, "offset"); | |
7451 } | |
7452 int length; | |
7453 if (json.containsKey("length")) { | |
7454 length = _decodeInt(jsonPath + ".length", json["length"]); | |
7455 } else { | |
7456 throw missingKey(jsonPath, "length"); | |
7457 } | |
7458 OverriddenMember superclassMember; | |
7459 if (json.containsKey("superclassMember")) { | |
7460 superclassMember = decodeOverriddenMember(jsonPath + ".superclassMember" , json["superclassMember"]); | |
7461 } | |
7462 List<OverriddenMember> interfaceMembers; | |
7463 if (json.containsKey("interfaceMembers")) { | |
7464 interfaceMembers = _decodeList(jsonPath + ".interfaceMembers", json["int erfaceMembers"], decodeOverriddenMember); | |
7465 } | |
7466 return new Override(offset, length, superclassMember: superclassMember, in terfaceMembers: interfaceMembers); | |
7467 } else { | |
7468 throw mismatch(jsonPath, "Override"); | |
7469 } | |
7470 } | |
7471 | |
7472 OverriddenMember decodeOverriddenMember(String jsonPath, Object json) { | |
7473 if (json is Map) { | |
7474 Element element; | |
7475 if (json.containsKey("element")) { | |
7476 element = decodeElement(jsonPath + ".element", json["element"]); | |
7477 } else { | |
7478 throw missingKey(jsonPath, "element"); | |
7479 } | |
7480 String className; | |
7481 if (json.containsKey("className")) { | |
7482 className = _decodeString(jsonPath + ".className", json["className"]); | |
7483 } else { | |
7484 throw missingKey(jsonPath, "className"); | |
7485 } | |
7486 return new OverriddenMember(element, className); | |
7487 } else { | |
7488 throw mismatch(jsonPath, "OverriddenMember"); | |
7489 } | |
7490 } | |
7491 | |
7492 Position decodePosition(String jsonPath, Object json) { | |
7493 if (json is Map) { | |
7494 String file; | |
7495 if (json.containsKey("file")) { | |
7496 file = _decodeString(jsonPath + ".file", json["file"]); | |
7497 } else { | |
7498 throw missingKey(jsonPath, "file"); | |
7499 } | |
7500 int offset; | |
7501 if (json.containsKey("offset")) { | |
7502 offset = _decodeInt(jsonPath + ".offset", json["offset"]); | |
7503 } else { | |
7504 throw missingKey(jsonPath, "offset"); | |
7505 } | |
7506 return new Position(file, offset); | |
7507 } else { | |
7508 throw mismatch(jsonPath, "Position"); | |
7509 } | |
7510 } | |
7511 | |
7512 RefactoringKind decodeRefactoringKind(String jsonPath, Object json) { | |
7513 if (json is String) { | |
7514 try { | |
7515 return new RefactoringKind(json); | |
7516 } catch(_) { | |
7517 // Fall through | |
7518 } | |
7519 } | |
7520 throw mismatch(jsonPath, "RefactoringKind"); | |
7521 } | |
7522 | |
7523 RefactoringMethodParameter decodeRefactoringMethodParameter(String jsonPath, O bject json) { | |
7524 if (json is Map) { | |
7525 String id; | |
7526 if (json.containsKey("id")) { | |
7527 id = _decodeString(jsonPath + ".id", json["id"]); | |
7528 } | |
7529 RefactoringMethodParameterKind kind; | |
7530 if (json.containsKey("kind")) { | |
7531 kind = decodeRefactoringMethodParameterKind(jsonPath + ".kind", json["ki nd"]); | |
7532 } else { | |
7533 throw missingKey(jsonPath, "kind"); | |
7534 } | |
7535 String type; | |
7536 if (json.containsKey("type")) { | |
7537 type = _decodeString(jsonPath + ".type", json["type"]); | |
7538 } else { | |
7539 throw missingKey(jsonPath, "type"); | |
7540 } | |
7541 String name; | |
7542 if (json.containsKey("name")) { | |
7543 name = _decodeString(jsonPath + ".name", json["name"]); | |
7544 } else { | |
7545 throw missingKey(jsonPath, "name"); | |
7546 } | |
7547 String parameters; | |
7548 if (json.containsKey("parameters")) { | |
7549 parameters = _decodeString(jsonPath + ".parameters", json["parameters"]) ; | |
7550 } | |
7551 return new RefactoringMethodParameter(kind, type, name, id: id, parameters : parameters); | |
7552 } else { | |
7553 throw mismatch(jsonPath, "RefactoringMethodParameter"); | |
7554 } | |
7555 } | |
7556 | |
7557 RefactoringMethodParameterKind decodeRefactoringMethodParameterKind(String jso nPath, Object json) { | |
7558 if (json is String) { | |
7559 try { | |
7560 return new RefactoringMethodParameterKind(json); | |
7561 } catch(_) { | |
7562 // Fall through | |
7563 } | |
7564 } | |
7565 throw mismatch(jsonPath, "RefactoringMethodParameterKind"); | |
7566 } | |
7567 | |
7568 RefactoringProblem decodeRefactoringProblem(String jsonPath, Object json) { | |
7569 if (json is Map) { | |
7570 RefactoringProblemSeverity severity; | |
7571 if (json.containsKey("severity")) { | |
7572 severity = decodeRefactoringProblemSeverity(jsonPath + ".severity", json ["severity"]); | |
7573 } else { | |
7574 throw missingKey(jsonPath, "severity"); | |
7575 } | |
7576 String message; | |
7577 if (json.containsKey("message")) { | |
7578 message = _decodeString(jsonPath + ".message", json["message"]); | |
7579 } else { | |
7580 throw missingKey(jsonPath, "message"); | |
7581 } | |
7582 Location location; | |
7583 if (json.containsKey("location")) { | |
7584 location = decodeLocation(jsonPath + ".location", json["location"]); | |
7585 } else { | |
7586 throw missingKey(jsonPath, "location"); | |
7587 } | |
7588 return new RefactoringProblem(severity, message, location); | |
7589 } else { | |
7590 throw mismatch(jsonPath, "RefactoringProblem"); | |
7591 } | |
7592 } | |
7593 | |
7594 RefactoringProblemSeverity decodeRefactoringProblemSeverity(String jsonPath, O bject json) { | |
7595 if (json is String) { | |
7596 try { | |
7597 return new RefactoringProblemSeverity(json); | |
7598 } catch(_) { | |
7599 // Fall through | |
7600 } | |
7601 } | |
7602 throw mismatch(jsonPath, "RefactoringProblemSeverity"); | |
7603 } | |
7604 | |
7605 RemoveContentOverlay decodeRemoveContentOverlay(String jsonPath, Object json) { | |
7606 if (json is Map) { | |
7607 if (json["type"] != "remove") { | |
7608 throw mismatch(jsonPath, "equal " + "remove"); | |
7609 } | |
7610 return new RemoveContentOverlay(); | |
7611 } else { | |
7612 throw mismatch(jsonPath, "RemoveContentOverlay"); | |
7613 } | |
7614 } | |
7615 | |
7616 SearchResult decodeSearchResult(String jsonPath, Object json) { | |
7617 if (json is Map) { | |
7618 Location location; | |
7619 if (json.containsKey("location")) { | |
7620 location = decodeLocation(jsonPath + ".location", json["location"]); | |
7621 } else { | |
7622 throw missingKey(jsonPath, "location"); | |
7623 } | |
7624 SearchResultKind kind; | |
7625 if (json.containsKey("kind")) { | |
7626 kind = decodeSearchResultKind(jsonPath + ".kind", json["kind"]); | |
7627 } else { | |
7628 throw missingKey(jsonPath, "kind"); | |
7629 } | |
7630 bool isPotential; | |
7631 if (json.containsKey("isPotential")) { | |
7632 isPotential = _decodeBool(jsonPath + ".isPotential", json["isPotential"] ); | |
7633 } else { | |
7634 throw missingKey(jsonPath, "isPotential"); | |
7635 } | |
7636 List<Element> path; | |
7637 if (json.containsKey("path")) { | |
7638 path = _decodeList(jsonPath + ".path", json["path"], decodeElement); | |
7639 } else { | |
7640 throw missingKey(jsonPath, "path"); | |
7641 } | |
7642 return new SearchResult(location, kind, isPotential, path); | |
7643 } else { | |
7644 throw mismatch(jsonPath, "SearchResult"); | |
7645 } | |
7646 } | |
7647 | |
7648 SearchResultKind decodeSearchResultKind(String jsonPath, Object json) { | |
7649 if (json is String) { | |
7650 try { | |
7651 return new SearchResultKind(json); | |
7652 } catch(_) { | |
7653 // Fall through | |
7654 } | |
7655 } | |
7656 throw mismatch(jsonPath, "SearchResultKind"); | |
7657 } | |
7658 | |
7659 ServerService decodeServerService(String jsonPath, Object json) { | |
7660 if (json is String) { | |
7661 try { | |
7662 return new ServerService(json); | |
7663 } catch(_) { | |
7664 // Fall through | |
7665 } | |
7666 } | |
7667 throw mismatch(jsonPath, "ServerService"); | |
7668 } | |
7669 | |
7670 SourceChange decodeSourceChange(String jsonPath, Object json) { | |
7671 if (json is Map) { | |
7672 String message; | |
7673 if (json.containsKey("message")) { | |
7674 message = _decodeString(jsonPath + ".message", json["message"]); | |
7675 } else { | |
7676 throw missingKey(jsonPath, "message"); | |
7677 } | |
7678 List<SourceFileEdit> edits; | |
7679 if (json.containsKey("edits")) { | |
7680 edits = _decodeList(jsonPath + ".edits", json["edits"], decodeSourceFile Edit); | |
7681 } else { | |
7682 throw missingKey(jsonPath, "edits"); | |
7683 } | |
7684 List<LinkedEditGroup> linkedEditGroups; | |
7685 if (json.containsKey("linkedEditGroups")) { | |
7686 linkedEditGroups = _decodeList(jsonPath + ".linkedEditGroups", json["lin kedEditGroups"], decodeLinkedEditGroup); | |
7687 } else { | |
7688 throw missingKey(jsonPath, "linkedEditGroups"); | |
7689 } | |
7690 Position selection; | |
7691 if (json.containsKey("selection")) { | |
7692 selection = decodePosition(jsonPath + ".selection", json["selection"]); | |
7693 } | |
7694 return new SourceChange(message, edits, linkedEditGroups, selection: selec tion); | |
7695 } else { | |
7696 throw mismatch(jsonPath, "SourceChange"); | |
7697 } | |
7698 } | |
7699 | |
7700 SourceEdit decodeSourceEdit(String jsonPath, Object json) { | |
7701 if (json is Map) { | |
7702 int offset; | |
7703 if (json.containsKey("offset")) { | |
7704 offset = _decodeInt(jsonPath + ".offset", json["offset"]); | |
7705 } else { | |
7706 throw missingKey(jsonPath, "offset"); | |
7707 } | |
7708 int length; | |
7709 if (json.containsKey("length")) { | |
7710 length = _decodeInt(jsonPath + ".length", json["length"]); | |
7711 } else { | |
7712 throw missingKey(jsonPath, "length"); | |
7713 } | |
7714 String replacement; | |
7715 if (json.containsKey("replacement")) { | |
7716 replacement = _decodeString(jsonPath + ".replacement", json["replacement "]); | |
7717 } else { | |
7718 throw missingKey(jsonPath, "replacement"); | |
7719 } | |
7720 String id; | |
7721 if (json.containsKey("id")) { | |
7722 id = _decodeString(jsonPath + ".id", json["id"]); | |
7723 } | |
7724 return new SourceEdit(offset, length, replacement, id: id); | |
7725 } else { | |
7726 throw mismatch(jsonPath, "SourceEdit"); | |
7727 } | |
7728 } | |
7729 | |
7730 SourceFileEdit decodeSourceFileEdit(String jsonPath, Object json) { | |
7731 if (json is Map) { | |
7732 String file; | |
7733 if (json.containsKey("file")) { | |
7734 file = _decodeString(jsonPath + ".file", json["file"]); | |
7735 } else { | |
7736 throw missingKey(jsonPath, "file"); | |
7737 } | |
7738 List<SourceEdit> edits; | |
7739 if (json.containsKey("edits")) { | |
7740 edits = _decodeList(jsonPath + ".edits", json["edits"], decodeSourceEdit ); | |
7741 } else { | |
7742 throw missingKey(jsonPath, "edits"); | |
7743 } | |
7744 return new SourceFileEdit(file, edits); | |
7745 } else { | |
7746 throw mismatch(jsonPath, "SourceFileEdit"); | |
7747 } | |
7748 } | |
7749 | |
7750 TypeHierarchyItem decodeTypeHierarchyItem(String jsonPath, Object json) { | |
7751 if (json is Map) { | |
7752 Element classElement; | |
7753 if (json.containsKey("classElement")) { | |
7754 classElement = decodeElement(jsonPath + ".classElement", json["classElem ent"]); | |
7755 } else { | |
7756 throw missingKey(jsonPath, "classElement"); | |
7757 } | |
7758 String displayName; | |
7759 if (json.containsKey("displayName")) { | |
7760 displayName = _decodeString(jsonPath + ".displayName", json["displayName "]); | |
7761 } | |
7762 Element memberElement; | |
7763 if (json.containsKey("memberElement")) { | |
7764 memberElement = decodeElement(jsonPath + ".memberElement", json["memberE lement"]); | |
7765 } | |
7766 int superclass; | |
7767 if (json.containsKey("superclass")) { | |
7768 superclass = _decodeInt(jsonPath + ".superclass", json["superclass"]); | |
7769 } | |
7770 List<int> interfaces; | |
7771 if (json.containsKey("interfaces")) { | |
7772 interfaces = _decodeList(jsonPath + ".interfaces", json["interfaces"], _ decodeInt); | |
7773 } else { | |
7774 throw missingKey(jsonPath, "interfaces"); | |
7775 } | |
7776 List<int> mixins; | |
7777 if (json.containsKey("mixins")) { | |
7778 mixins = _decodeList(jsonPath + ".mixins", json["mixins"], _decodeInt); | |
7779 } else { | |
7780 throw missingKey(jsonPath, "mixins"); | |
7781 } | |
7782 List<int> subclasses; | |
7783 if (json.containsKey("subclasses")) { | |
7784 subclasses = _decodeList(jsonPath + ".subclasses", json["subclasses"], _ decodeInt); | |
7785 } else { | |
7786 throw missingKey(jsonPath, "subclasses"); | |
7787 } | |
7788 return new TypeHierarchyItem(classElement, interfaces, mixins, subclasses, displayName: displayName, memberElement: memberElement, superclass: superclass) ; | |
7789 } else { | |
7790 throw mismatch(jsonPath, "TypeHierarchyItem"); | |
7791 } | |
7792 } | |
7793 | |
7794 ExtractLocalVariableFeedback decodeExtractLocalVariableFeedback(String jsonPat h, Object json) { | |
7795 if (json is Map) { | |
7796 List<String> names; | |
7797 if (json.containsKey("names")) { | |
7798 names = _decodeList(jsonPath + ".names", json["names"], _decodeString); | |
7799 } else { | |
7800 throw missingKey(jsonPath, "names"); | |
7801 } | |
7802 List<int> offsets; | |
7803 if (json.containsKey("offsets")) { | |
7804 offsets = _decodeList(jsonPath + ".offsets", json["offsets"], _decodeInt ); | |
7805 } else { | |
7806 throw missingKey(jsonPath, "offsets"); | |
7807 } | |
7808 List<int> lengths; | |
7809 if (json.containsKey("lengths")) { | |
7810 lengths = _decodeList(jsonPath + ".lengths", json["lengths"], _decodeInt ); | |
7811 } else { | |
7812 throw missingKey(jsonPath, "lengths"); | |
7813 } | |
7814 return new ExtractLocalVariableFeedback(names, offsets, lengths); | |
7815 } else { | |
7816 throw mismatch(jsonPath, "extractLocalVariable feedback"); | |
7817 } | |
7818 } | |
7819 | |
7820 ExtractLocalVariableOptions decodeExtractLocalVariableOptions(String jsonPath, Object json) { | |
7821 if (json is Map) { | |
7822 String name; | |
7823 if (json.containsKey("name")) { | |
7824 name = _decodeString(jsonPath + ".name", json["name"]); | |
7825 } else { | |
7826 throw missingKey(jsonPath, "name"); | |
7827 } | |
7828 bool extractAll; | |
7829 if (json.containsKey("extractAll")) { | |
7830 extractAll = _decodeBool(jsonPath + ".extractAll", json["extractAll"]); | |
7831 } else { | |
7832 throw missingKey(jsonPath, "extractAll"); | |
7833 } | |
7834 return new ExtractLocalVariableOptions(name, extractAll); | |
7835 } else { | |
7836 throw mismatch(jsonPath, "extractLocalVariable options"); | |
7837 } | |
7838 } | |
7839 | |
7840 ExtractMethodFeedback decodeExtractMethodFeedback(String jsonPath, Object json ) { | |
7841 if (json is Map) { | |
7842 int offset; | |
7843 if (json.containsKey("offset")) { | |
7844 offset = _decodeInt(jsonPath + ".offset", json["offset"]); | |
7845 } else { | |
7846 throw missingKey(jsonPath, "offset"); | |
7847 } | |
7848 int length; | |
7849 if (json.containsKey("length")) { | |
7850 length = _decodeInt(jsonPath + ".length", json["length"]); | |
7851 } else { | |
7852 throw missingKey(jsonPath, "length"); | |
7853 } | |
7854 String returnType; | |
7855 if (json.containsKey("returnType")) { | |
7856 returnType = _decodeString(jsonPath + ".returnType", json["returnType"]) ; | |
7857 } else { | |
7858 throw missingKey(jsonPath, "returnType"); | |
7859 } | |
7860 List<String> names; | |
7861 if (json.containsKey("names")) { | |
7862 names = _decodeList(jsonPath + ".names", json["names"], _decodeString); | |
7863 } else { | |
7864 throw missingKey(jsonPath, "names"); | |
7865 } | |
7866 bool canCreateGetter; | |
7867 if (json.containsKey("canCreateGetter")) { | |
7868 canCreateGetter = _decodeBool(jsonPath + ".canCreateGetter", json["canCr eateGetter"]); | |
7869 } else { | |
7870 throw missingKey(jsonPath, "canCreateGetter"); | |
7871 } | |
7872 List<RefactoringMethodParameter> parameters; | |
7873 if (json.containsKey("parameters")) { | |
7874 parameters = _decodeList(jsonPath + ".parameters", json["parameters"], d ecodeRefactoringMethodParameter); | |
7875 } else { | |
7876 throw missingKey(jsonPath, "parameters"); | |
7877 } | |
7878 int occurrences; | |
7879 if (json.containsKey("occurrences")) { | |
7880 occurrences = _decodeInt(jsonPath + ".occurrences", json["occurrences"]) ; | |
7881 } else { | |
7882 throw missingKey(jsonPath, "occurrences"); | |
7883 } | |
7884 List<int> offsets; | |
7885 if (json.containsKey("offsets")) { | |
7886 offsets = _decodeList(jsonPath + ".offsets", json["offsets"], _decodeInt ); | |
7887 } else { | |
7888 throw missingKey(jsonPath, "offsets"); | |
7889 } | |
7890 List<int> lengths; | |
7891 if (json.containsKey("lengths")) { | |
7892 lengths = _decodeList(jsonPath + ".lengths", json["lengths"], _decodeInt ); | |
7893 } else { | |
7894 throw missingKey(jsonPath, "lengths"); | |
7895 } | |
7896 return new ExtractMethodFeedback(offset, length, returnType, names, canCre ateGetter, parameters, occurrences, offsets, lengths); | |
7897 } else { | |
7898 throw mismatch(jsonPath, "extractMethod feedback"); | |
7899 } | |
7900 } | |
7901 | |
7902 ExtractMethodOptions decodeExtractMethodOptions(String jsonPath, Object json) { | |
7903 if (json is Map) { | |
7904 String returnType; | |
7905 if (json.containsKey("returnType")) { | |
7906 returnType = _decodeString(jsonPath + ".returnType", json["returnType"]) ; | |
7907 } else { | |
7908 throw missingKey(jsonPath, "returnType"); | |
7909 } | |
7910 bool createGetter; | |
7911 if (json.containsKey("createGetter")) { | |
7912 createGetter = _decodeBool(jsonPath + ".createGetter", json["createGette r"]); | |
7913 } else { | |
7914 throw missingKey(jsonPath, "createGetter"); | |
7915 } | |
7916 String name; | |
7917 if (json.containsKey("name")) { | |
7918 name = _decodeString(jsonPath + ".name", json["name"]); | |
7919 } else { | |
7920 throw missingKey(jsonPath, "name"); | |
7921 } | |
7922 List<RefactoringMethodParameter> parameters; | |
7923 if (json.containsKey("parameters")) { | |
7924 parameters = _decodeList(jsonPath + ".parameters", json["parameters"], d ecodeRefactoringMethodParameter); | |
7925 } else { | |
7926 throw missingKey(jsonPath, "parameters"); | |
7927 } | |
7928 bool extractAll; | |
7929 if (json.containsKey("extractAll")) { | |
7930 extractAll = _decodeBool(jsonPath + ".extractAll", json["extractAll"]); | |
7931 } else { | |
7932 throw missingKey(jsonPath, "extractAll"); | |
7933 } | |
7934 return new ExtractMethodOptions(returnType, createGetter, name, parameters , extractAll); | |
7935 } else { | |
7936 throw mismatch(jsonPath, "extractMethod options"); | |
7937 } | |
7938 } | |
7939 | |
7940 InlineMethodOptions decodeInlineMethodOptions(String jsonPath, Object json) { | |
7941 if (json is Map) { | |
7942 bool deleteSource; | |
7943 if (json.containsKey("deleteSource")) { | |
7944 deleteSource = _decodeBool(jsonPath + ".deleteSource", json["deleteSourc e"]); | |
7945 } else { | |
7946 throw missingKey(jsonPath, "deleteSource"); | |
7947 } | |
7948 bool inlineAll; | |
7949 if (json.containsKey("inlineAll")) { | |
7950 inlineAll = _decodeBool(jsonPath + ".inlineAll", json["inlineAll"]); | |
7951 } else { | |
7952 throw missingKey(jsonPath, "inlineAll"); | |
7953 } | |
7954 return new InlineMethodOptions(deleteSource, inlineAll); | |
7955 } else { | |
7956 throw mismatch(jsonPath, "inlineMethod options"); | |
7957 } | |
7958 } | |
7959 | |
7960 RenameFeedback decodeRenameFeedback(String jsonPath, Object json) { | |
7961 if (json is Map) { | |
7962 int offset; | |
7963 if (json.containsKey("offset")) { | |
7964 offset = _decodeInt(jsonPath + ".offset", json["offset"]); | |
7965 } else { | |
7966 throw missingKey(jsonPath, "offset"); | |
7967 } | |
7968 int length; | |
7969 if (json.containsKey("length")) { | |
7970 length = _decodeInt(jsonPath + ".length", json["length"]); | |
7971 } else { | |
7972 throw missingKey(jsonPath, "length"); | |
7973 } | |
7974 return new RenameFeedback(offset, length); | |
7975 } else { | |
7976 throw mismatch(jsonPath, "rename feedback"); | |
7977 } | |
7978 } | |
7979 | |
7980 RenameOptions decodeRenameOptions(String jsonPath, Object json) { | |
7981 if (json is Map) { | |
7982 String newName; | |
7983 if (json.containsKey("newName")) { | |
7984 newName = _decodeString(jsonPath + ".newName", json["newName"]); | |
7985 } else { | |
7986 throw missingKey(jsonPath, "newName"); | |
7987 } | |
7988 return new RenameOptions(newName); | |
7989 } else { | |
7990 throw mismatch(jsonPath, "rename options"); | |
7991 } | |
7992 } | |
7993 } | |
7994 | |
7995 /** | |
7996 * Decode the response to a request of type server.getVersion | |
7997 * | |
7998 * Return the version number of the analysis server. | |
7999 */ | |
8000 ServerGetVersionResult decodeServerGetVersionResponse(Response response) { | |
Brian Wilkerson
2014/08/18 14:10:16
Consider converting these functions to constructor
Paul Berry
2014/08/18 21:58:03
Done.
| |
8001 var decoder = new ResponseDecoder(); | |
8002 return decoder.decodeServerGetVersionResult("result", response.result); | |
8003 } | |
8004 | |
8005 /** | |
8006 * Decode a request of type server.setSubscriptions | |
8007 * | |
8008 * Subscribe for services. All previous subscriptions are replaced by the given | |
8009 * set of services. | |
8010 * | |
8011 * It is an error if any of the elements in the list are not valid services. If | |
8012 * there is an error, then the current subscriptions will remain unchanged. | |
8013 */ | |
8014 ServerSetSubscriptionsParams decodeServerSetSubscriptionsRequest(Request request ) { | |
8015 var decoder = new RequestDecoder(request); | |
8016 return decoder.decodeServerSetSubscriptionsParams("params", request.params); | |
8017 } | |
8018 | |
8019 /** | |
8020 * Decode a notification of type server.error | |
8021 * | |
8022 * Reports that an unexpected error has occurred while executing the server. | |
8023 * This notification is not used for problems with specific requests (which are | |
8024 * returned as part of the response) but is used for exceptions that occur | |
8025 * while performing other tasks, such as analysis or preparing notifications. | |
8026 * | |
8027 * It is not possible to subscribe to or unsubscribe from this notification. | |
8028 */ | |
8029 ServerErrorParams decodeServerErrorNotification(Notification notification) { | |
8030 var decoder = new ResponseDecoder(); | |
8031 return decoder.decodeServerErrorParams("params", notification.params); | |
8032 } | |
8033 | |
8034 /** | |
8035 * Decode a notification of type server.status | |
8036 * | |
8037 * Reports the current status of the server. Parameters are omitted if there | |
8038 * has been no change in the status represented by that parameter. | |
8039 * | |
8040 * This notification is not subscribed to by default. Clients can subscribe by | |
8041 * including the value "STATUS" in the list of services passed in a | |
8042 * server.setSubscriptions request. | |
8043 */ | |
8044 ServerStatusParams decodeServerStatusNotification(Notification notification) { | |
8045 var decoder = new ResponseDecoder(); | |
8046 return decoder.decodeServerStatusParams("params", notification.params); | |
8047 } | |
8048 | |
8049 /** | |
8050 * Decode a request of type analysis.getErrors | |
8051 * | |
8052 * Return the errors associated with the given file. If the errors for the | |
8053 * given file have not yet been computed, or the most recently computed errors | |
8054 * for the given file are out of date, then the response for this request will | |
8055 * be delayed until they have been computed. If some or all of the errors for | |
8056 * the file cannot be computed, then the subset of the errors that can be | |
8057 * computed will be returned and the response will contain an error to indicate | |
8058 * why the errors could not be computed. | |
8059 * | |
8060 * This request is intended to be used by clients that cannot asynchronously | |
8061 * apply updated error information. Clients that can apply error information as | |
8062 * it becomes available should use the information provided by the | |
8063 * 'analysis.errors' notification. | |
8064 */ | |
8065 AnalysisGetErrorsParams decodeAnalysisGetErrorsRequest(Request request) { | |
8066 var decoder = new RequestDecoder(request); | |
8067 return decoder.decodeAnalysisGetErrorsParams("params", request.params); | |
8068 } | |
8069 | |
8070 /** | |
8071 * Decode the response to a request of type analysis.getErrors | |
8072 * | |
8073 * Return the errors associated with the given file. If the errors for the | |
8074 * given file have not yet been computed, or the most recently computed errors | |
8075 * for the given file are out of date, then the response for this request will | |
8076 * be delayed until they have been computed. If some or all of the errors for | |
8077 * the file cannot be computed, then the subset of the errors that can be | |
8078 * computed will be returned and the response will contain an error to indicate | |
8079 * why the errors could not be computed. | |
8080 * | |
8081 * This request is intended to be used by clients that cannot asynchronously | |
8082 * apply updated error information. Clients that can apply error information as | |
8083 * it becomes available should use the information provided by the | |
8084 * 'analysis.errors' notification. | |
8085 */ | |
8086 AnalysisGetErrorsResult decodeAnalysisGetErrorsResponse(Response response) { | |
8087 var decoder = new ResponseDecoder(); | |
8088 return decoder.decodeAnalysisGetErrorsResult("result", response.result); | |
8089 } | |
8090 | |
8091 /** | |
8092 * Decode a request of type analysis.getHover | |
8093 * | |
8094 * Return the hover information associate with the given location. If some or | |
8095 * all of the hover information is not available at the time this request is | |
8096 * processed the information will be omitted from the response. | |
8097 */ | |
8098 AnalysisGetHoverParams decodeAnalysisGetHoverRequest(Request request) { | |
8099 var decoder = new RequestDecoder(request); | |
8100 return decoder.decodeAnalysisGetHoverParams("params", request.params); | |
8101 } | |
8102 | |
8103 /** | |
8104 * Decode the response to a request of type analysis.getHover | |
8105 * | |
8106 * Return the hover information associate with the given location. If some or | |
8107 * all of the hover information is not available at the time this request is | |
8108 * processed the information will be omitted from the response. | |
8109 */ | |
8110 AnalysisGetHoverResult decodeAnalysisGetHoverResponse(Response response) { | |
8111 var decoder = new ResponseDecoder(); | |
8112 return decoder.decodeAnalysisGetHoverResult("result", response.result); | |
8113 } | |
8114 | |
8115 /** | |
8116 * Decode a request of type analysis.setAnalysisRoots | |
8117 * | |
8118 * Sets the root paths used to determine which files to analyze. The set of | |
8119 * files to be analyzed are all of the files in one of the root paths that are | |
8120 * not also in one of the excluded paths. | |
8121 * | |
8122 * Note that this request determines the set of requested analysis roots. The | |
8123 * actual set of analysis roots at any given time is the intersection of this | |
8124 * set with the set of files and directories actually present on the | |
8125 * filesystem. When the filesystem changes, the actual set of analysis roots is | |
8126 * automatically updated, but the set of requested analysis roots is unchanged. | |
8127 * This means that if the client sets an analysis root before the root becomes | |
8128 * visible to server in the filesystem, there is no error; once the server sees | |
8129 * the root in the filesystem it will start analyzing it. Similarly, server | |
8130 * will stop analyzing files that are removed from the file system but they | |
8131 * will remain in the set of requested roots. | |
8132 * | |
8133 * If an included path represents a file, then server will look in the | |
8134 * directory containing the file for a pubspec.yaml file. If none is found, | |
8135 * then the parents of the directory will be searched until such a file is | |
8136 * found or the root of the file system is reached. If such a file is found, it | |
8137 * will be used to resolve package: URI’s within the file. | |
8138 */ | |
8139 AnalysisSetAnalysisRootsParams decodeAnalysisSetAnalysisRootsRequest(Request req uest) { | |
8140 var decoder = new RequestDecoder(request); | |
8141 return decoder.decodeAnalysisSetAnalysisRootsParams("params", request.params); | |
8142 } | |
8143 | |
8144 /** | |
8145 * Decode a request of type analysis.setPriorityFiles | |
8146 * | |
8147 * Set the priority files to the files in the given list. A priority file is a | |
8148 * file that is given priority when scheduling which analysis work to do first. | |
8149 * The list typically contains those files that are visible to the user and | |
8150 * those for which analysis results will have the biggest impact on the user | |
8151 * experience. The order of the files within the list is significant: the first | |
8152 * file will be given higher priority than the second, the second higher | |
8153 * priority than the third, and so on. | |
8154 * | |
8155 * Note that this request determines the set of requested priority files. The | |
8156 * actual set of priority files is the intersection of the requested set of | |
8157 * priority files with the set of files currently subject to analysis. (See | |
8158 * analysis.setSubscriptions for a description of files that are subject to | |
8159 * analysis.) | |
8160 * | |
8161 * If a requested priority file is a directory it is ignored, but remains in | |
8162 * the set of requested priority files so that if it later becomes a file it | |
8163 * can be included in the set of actual priority files. | |
8164 */ | |
8165 AnalysisSetPriorityFilesParams decodeAnalysisSetPriorityFilesRequest(Request req uest) { | |
8166 var decoder = new RequestDecoder(request); | |
8167 return decoder.decodeAnalysisSetPriorityFilesParams("params", request.params); | |
8168 } | |
8169 | |
8170 /** | |
8171 * Decode a request of type analysis.setSubscriptions | |
8172 * | |
8173 * Subscribe for services. All previous subscriptions are replaced by the | |
8174 * current set of subscriptions. If a given service is not included as a key in | |
8175 * the map then no files will be subscribed to the service, exactly as if the | |
8176 * service had been included in the map with an explicit empty list of files. | |
8177 * | |
8178 * Note that this request determines the set of requested subscriptions. The | |
8179 * actual set of subscriptions at any given time is the intersection of this | |
8180 * set with the set of files currently subject to analysis. The files currently | |
8181 * subject to analysis are the set of files contained within an actual analysis | |
8182 * root but not excluded, plus all of the files transitively reachable from | |
8183 * those files via import, export and part directives. (See | |
8184 * analysis.setAnalysisRoots for an explanation of how the actual analysis | |
8185 * roots are determined.) When the actual analysis roots change, the actual set | |
8186 * of subscriptions is automatically updated, but the set of requested | |
8187 * subscriptions is unchanged. | |
8188 * | |
8189 * If a requested subscription is a directory it is ignored, but remains in the | |
8190 * set of requested subscriptions so that if it later becomes a file it can be | |
8191 * included in the set of actual subscriptions. | |
8192 * | |
8193 * It is an error if any of the keys in the map are not valid services. If | |
8194 * there is an error, then the existing subscriptions will remain unchanged. | |
8195 */ | |
8196 AnalysisSetSubscriptionsParams decodeAnalysisSetSubscriptionsRequest(Request req uest) { | |
8197 var decoder = new RequestDecoder(request); | |
8198 return decoder.decodeAnalysisSetSubscriptionsParams("params", request.params); | |
8199 } | |
8200 | |
8201 /** | |
8202 * Decode a request of type analysis.updateContent | |
8203 * | |
8204 * Update the content of one or more files. Files that were previously updated | |
8205 * but not included in this update remain unchanged. This effectively | |
8206 * represents an overlay of the filesystem. The files whose content is | |
8207 * overridden are therefore seen by server as being files with the given | |
8208 * content, even if the files do not exist on the filesystem or if the file | |
8209 * path represents the path to a directory on the filesystem. | |
8210 */ | |
8211 AnalysisUpdateContentParams decodeAnalysisUpdateContentRequest(Request request) { | |
8212 var decoder = new RequestDecoder(request); | |
8213 return decoder.decodeAnalysisUpdateContentParams("params", request.params); | |
8214 } | |
8215 | |
8216 /** | |
8217 * Decode a request of type analysis.updateOptions | |
8218 * | |
8219 * Update the options controlling analysis based on the given set of options. | |
8220 * Any options that are not included in the analysis options will not be | |
8221 * changed. If there are options in the analysis options that are not valid an | |
8222 * error will be reported but the values of the valid options will still be | |
8223 * updated. | |
8224 */ | |
8225 AnalysisUpdateOptionsParams decodeAnalysisUpdateOptionsRequest(Request request) { | |
8226 var decoder = new RequestDecoder(request); | |
8227 return decoder.decodeAnalysisUpdateOptionsParams("params", request.params); | |
8228 } | |
8229 | |
8230 /** | |
8231 * Decode a notification of type analysis.errors | |
8232 * | |
8233 * Reports the errors associated with a given file. The set of errors included | |
8234 * in the notification is always a complete list that supersedes any previously | |
8235 * reported errors. | |
8236 * | |
8237 * It is only possible to unsubscribe from this notification by using the | |
8238 * command-line flag --no-error-notification. | |
8239 */ | |
8240 AnalysisErrorsParams decodeAnalysisErrorsNotification(Notification notification) { | |
8241 var decoder = new ResponseDecoder(); | |
8242 return decoder.decodeAnalysisErrorsParams("params", notification.params); | |
8243 } | |
8244 | |
8245 /** | |
8246 * Decode a notification of type analysis.flushResults | |
8247 * | |
8248 * Reports that any analysis results that were previously associated with the | |
8249 * given files should be considered to be invalid because those files are no | |
8250 * longer being analyzed, either because the analysis root that contained it is | |
8251 * no longer being analyzed or because the file no longer exists. | |
8252 * | |
8253 * If a file is included in this notification and at some later time a | |
8254 * notification with results for the file is received, clients should assume | |
8255 * that the file is once again being analyzed and the information should be | |
8256 * processed. | |
8257 * | |
8258 * It is not possible to subscribe to or unsubscribe from this notification. | |
8259 */ | |
8260 AnalysisFlushResultsParams decodeAnalysisFlushResultsNotification(Notification n otification) { | |
8261 var decoder = new ResponseDecoder(); | |
8262 return decoder.decodeAnalysisFlushResultsParams("params", notification.params) ; | |
8263 } | |
8264 | |
8265 /** | |
8266 * Decode a notification of type analysis.folding | |
8267 * | |
8268 * Reports the folding regions associated with a given file. Folding regions | |
8269 * can be nested, but will not be overlapping. Nesting occurs when a foldable | |
8270 * element, such as a method, is nested inside another foldable element such as | |
8271 * a class. | |
8272 * | |
8273 * This notification is not subscribed to by default. Clients can subscribe by | |
8274 * including the value "FOLDING" in the list of services passed in an | |
8275 * analysis.setSubscriptions request. | |
8276 */ | |
8277 AnalysisFoldingParams decodeAnalysisFoldingNotification(Notification notificatio n) { | |
8278 var decoder = new ResponseDecoder(); | |
8279 return decoder.decodeAnalysisFoldingParams("params", notification.params); | |
8280 } | |
8281 | |
8282 /** | |
8283 * Decode a notification of type analysis.highlights | |
8284 * | |
8285 * Reports the highlight regions associated with a given file. | |
8286 * | |
8287 * This notification is not subscribed to by default. Clients can subscribe by | |
8288 * including the value "HIGHLIGHTS" in the list of services passed in an | |
8289 * analysis.setSubscriptions request. | |
8290 */ | |
8291 AnalysisHighlightsParams decodeAnalysisHighlightsNotification(Notification notif ication) { | |
8292 var decoder = new ResponseDecoder(); | |
8293 return decoder.decodeAnalysisHighlightsParams("params", notification.params); | |
8294 } | |
8295 | |
8296 /** | |
8297 * Decode a notification of type analysis.navigation | |
8298 * | |
8299 * Reports the navigation targets associated with a given file. | |
8300 * | |
8301 * This notification is not subscribed to by default. Clients can subscribe by | |
8302 * including the value "NAVIGATION" in the list of services passed in an | |
8303 * analysis.setSubscriptions request. | |
8304 */ | |
8305 AnalysisNavigationParams decodeAnalysisNavigationNotification(Notification notif ication) { | |
8306 var decoder = new ResponseDecoder(); | |
8307 return decoder.decodeAnalysisNavigationParams("params", notification.params); | |
8308 } | |
8309 | |
8310 /** | |
8311 * Decode a notification of type analysis.occurrences | |
8312 * | |
8313 * Reports the occurrences of references to elements within a single file. | |
8314 * | |
8315 * This notification is not subscribed to by default. Clients can subscribe by | |
8316 * including the value "OCCURRENCES" in the list of services passed in an | |
8317 * analysis.setSubscriptions request. | |
8318 */ | |
8319 AnalysisOccurrencesParams decodeAnalysisOccurrencesNotification(Notification not ification) { | |
8320 var decoder = new ResponseDecoder(); | |
8321 return decoder.decodeAnalysisOccurrencesParams("params", notification.params); | |
8322 } | |
8323 | |
8324 /** | |
8325 * Decode a notification of type analysis.outline | |
8326 * | |
8327 * Reports the outline associated with a single file. | |
8328 * | |
8329 * This notification is not subscribed to by default. Clients can subscribe by | |
8330 * including the value "OUTLINE" in the list of services passed in an | |
8331 * analysis.setSubscriptions request. | |
8332 */ | |
8333 AnalysisOutlineParams decodeAnalysisOutlineNotification(Notification notificatio n) { | |
8334 var decoder = new ResponseDecoder(); | |
8335 return decoder.decodeAnalysisOutlineParams("params", notification.params); | |
8336 } | |
8337 | |
8338 /** | |
8339 * Decode a notification of type analysis.overrides | |
8340 * | |
8341 * Reports the overridding members in a file. | |
8342 * | |
8343 * This notification is not subscribed to by default. Clients can subscribe by | |
8344 * including the value "OVERRIDES" in the list of services passed in an | |
8345 * analysis.setSubscriptions request. | |
8346 */ | |
8347 AnalysisOverridesParams decodeAnalysisOverridesNotification(Notification notific ation) { | |
8348 var decoder = new ResponseDecoder(); | |
8349 return decoder.decodeAnalysisOverridesParams("params", notification.params); | |
8350 } | |
8351 | |
8352 /** | |
8353 * Decode a request of type completion.getSuggestions | |
8354 * | |
8355 * Request that completion suggestions for the given offset in the given file | |
8356 * be returned. | |
8357 */ | |
8358 CompletionGetSuggestionsParams decodeCompletionGetSuggestionsRequest(Request req uest) { | |
8359 var decoder = new RequestDecoder(request); | |
8360 return decoder.decodeCompletionGetSuggestionsParams("params", request.params); | |
8361 } | |
8362 | |
8363 /** | |
8364 * Decode the response to a request of type completion.getSuggestions | |
8365 * | |
8366 * Request that completion suggestions for the given offset in the given file | |
8367 * be returned. | |
8368 */ | |
8369 CompletionGetSuggestionsResult decodeCompletionGetSuggestionsResponse(Response r esponse) { | |
8370 var decoder = new ResponseDecoder(); | |
8371 return decoder.decodeCompletionGetSuggestionsResult("result", response.result) ; | |
8372 } | |
8373 | |
8374 /** | |
8375 * Decode a notification of type completion.results | |
8376 * | |
8377 * Reports the completion suggestions that should be presented to the user. The | |
8378 * set of suggestions included in the notification is always a complete list | |
8379 * that supersedes any previously reported suggestions. | |
8380 */ | |
8381 CompletionResultsParams decodeCompletionResultsNotification(Notification notific ation) { | |
8382 var decoder = new ResponseDecoder(); | |
8383 return decoder.decodeCompletionResultsParams("params", notification.params); | |
8384 } | |
8385 | |
8386 /** | |
8387 * Decode a request of type search.findElementReferences | |
8388 * | |
8389 * Perform a search for references to the element defined or referenced at the | |
8390 * given offset in the given file. | |
8391 * | |
8392 * An identifier is returned immediately, and individual results will be | |
8393 * returned via the search.results notification as they become available. | |
8394 */ | |
8395 SearchFindElementReferencesParams decodeSearchFindElementReferencesRequest(Reque st request) { | |
8396 var decoder = new RequestDecoder(request); | |
8397 return decoder.decodeSearchFindElementReferencesParams("params", request.param s); | |
8398 } | |
8399 | |
8400 /** | |
8401 * Decode the response to a request of type search.findElementReferences | |
8402 * | |
8403 * Perform a search for references to the element defined or referenced at the | |
8404 * given offset in the given file. | |
8405 * | |
8406 * An identifier is returned immediately, and individual results will be | |
8407 * returned via the search.results notification as they become available. | |
8408 */ | |
8409 SearchFindElementReferencesResult decodeSearchFindElementReferencesResponse(Resp onse response) { | |
8410 var decoder = new ResponseDecoder(); | |
8411 return decoder.decodeSearchFindElementReferencesResult("result", response.resu lt); | |
8412 } | |
8413 | |
8414 /** | |
8415 * Decode a request of type search.findMemberDeclarations | |
8416 * | |
8417 * Perform a search for declarations of members whose name is equal to the | |
8418 * given name. | |
8419 * | |
8420 * An identifier is returned immediately, and individual results will be | |
8421 * returned via the search.results notification as they become available. | |
8422 */ | |
8423 SearchFindMemberDeclarationsParams decodeSearchFindMemberDeclarationsRequest(Req uest request) { | |
8424 var decoder = new RequestDecoder(request); | |
8425 return decoder.decodeSearchFindMemberDeclarationsParams("params", request.para ms); | |
8426 } | |
8427 | |
8428 /** | |
8429 * Decode the response to a request of type search.findMemberDeclarations | |
8430 * | |
8431 * Perform a search for declarations of members whose name is equal to the | |
8432 * given name. | |
8433 * | |
8434 * An identifier is returned immediately, and individual results will be | |
8435 * returned via the search.results notification as they become available. | |
8436 */ | |
8437 SearchFindMemberDeclarationsResult decodeSearchFindMemberDeclarationsResponse(Re sponse response) { | |
8438 var decoder = new ResponseDecoder(); | |
8439 return decoder.decodeSearchFindMemberDeclarationsResult("result", response.res ult); | |
8440 } | |
8441 | |
8442 /** | |
8443 * Decode a request of type search.findMemberReferences | |
8444 * | |
8445 * Perform a search for references to members whose name is equal to the given | |
8446 * name. This search does not check to see that there is a member defined with | |
8447 * the given name, so it is able to find references to undefined members as | |
8448 * well. | |
8449 * | |
8450 * An identifier is returned immediately, and individual results will be | |
8451 * returned via the search.results notification as they become available. | |
8452 */ | |
8453 SearchFindMemberReferencesParams decodeSearchFindMemberReferencesRequest(Request request) { | |
8454 var decoder = new RequestDecoder(request); | |
8455 return decoder.decodeSearchFindMemberReferencesParams("params", request.params ); | |
8456 } | |
8457 | |
8458 /** | |
8459 * Decode the response to a request of type search.findMemberReferences | |
8460 * | |
8461 * Perform a search for references to members whose name is equal to the given | |
8462 * name. This search does not check to see that there is a member defined with | |
8463 * the given name, so it is able to find references to undefined members as | |
8464 * well. | |
8465 * | |
8466 * An identifier is returned immediately, and individual results will be | |
8467 * returned via the search.results notification as they become available. | |
8468 */ | |
8469 SearchFindMemberReferencesResult decodeSearchFindMemberReferencesResponse(Respon se response) { | |
8470 var decoder = new ResponseDecoder(); | |
8471 return decoder.decodeSearchFindMemberReferencesResult("result", response.resul t); | |
8472 } | |
8473 | |
8474 /** | |
8475 * Decode a request of type search.findTopLevelDeclarations | |
8476 * | |
8477 * Perform a search for declarations of top-level elements (classes, typedefs, | |
8478 * getters, setters, functions and fields) whose name matches the given | |
8479 * pattern. | |
8480 * | |
8481 * An identifier is returned immediately, and individual results will be | |
8482 * returned via the search.results notification as they become available. | |
8483 */ | |
8484 SearchFindTopLevelDeclarationsParams decodeSearchFindTopLevelDeclarationsRequest (Request request) { | |
8485 var decoder = new RequestDecoder(request); | |
8486 return decoder.decodeSearchFindTopLevelDeclarationsParams("params", request.pa rams); | |
8487 } | |
8488 | |
8489 /** | |
8490 * Decode the response to a request of type search.findTopLevelDeclarations | |
8491 * | |
8492 * Perform a search for declarations of top-level elements (classes, typedefs, | |
8493 * getters, setters, functions and fields) whose name matches the given | |
8494 * pattern. | |
8495 * | |
8496 * An identifier is returned immediately, and individual results will be | |
8497 * returned via the search.results notification as they become available. | |
8498 */ | |
8499 SearchFindTopLevelDeclarationsResult decodeSearchFindTopLevelDeclarationsRespons e(Response response) { | |
8500 var decoder = new ResponseDecoder(); | |
8501 return decoder.decodeSearchFindTopLevelDeclarationsResult("result", response.r esult); | |
8502 } | |
8503 | |
8504 /** | |
8505 * Decode a request of type search.getTypeHierarchy | |
8506 * | |
8507 * Return the type hierarchy of the class declared or referenced at the given | |
8508 * location. | |
8509 */ | |
8510 SearchGetTypeHierarchyParams decodeSearchGetTypeHierarchyRequest(Request request ) { | |
8511 var decoder = new RequestDecoder(request); | |
8512 return decoder.decodeSearchGetTypeHierarchyParams("params", request.params); | |
8513 } | |
8514 | |
8515 /** | |
8516 * Decode the response to a request of type search.getTypeHierarchy | |
8517 * | |
8518 * Return the type hierarchy of the class declared or referenced at the given | |
8519 * location. | |
8520 */ | |
8521 SearchGetTypeHierarchyResult decodeSearchGetTypeHierarchyResponse(Response respo nse) { | |
8522 var decoder = new ResponseDecoder(); | |
8523 return decoder.decodeSearchGetTypeHierarchyResult("result", response.result); | |
8524 } | |
8525 | |
8526 /** | |
8527 * Decode a notification of type search.results | |
8528 * | |
8529 * Reports some or all of the results of performing a requested search. Unlike | |
8530 * other notifications, this notification contains search results that should | |
8531 * be added to any previously received search results associated with the same | |
8532 * search id. | |
8533 */ | |
8534 SearchResultsParams decodeSearchResultsNotification(Notification notification) { | |
8535 var decoder = new ResponseDecoder(); | |
8536 return decoder.decodeSearchResultsParams("params", notification.params); | |
8537 } | |
8538 | |
8539 /** | |
8540 * Decode a request of type edit.getAssists | |
8541 * | |
8542 * Return the set of assists that are available at the given location. An | |
8543 * assist is distinguished from a refactoring primarily by the fact that it | |
8544 * affects a single file and does not require user input in order to be | |
8545 * performed. | |
8546 */ | |
8547 EditGetAssistsParams decodeEditGetAssistsRequest(Request request) { | |
8548 var decoder = new RequestDecoder(request); | |
8549 return decoder.decodeEditGetAssistsParams("params", request.params); | |
8550 } | |
8551 | |
8552 /** | |
8553 * Decode the response to a request of type edit.getAssists | |
8554 * | |
8555 * Return the set of assists that are available at the given location. An | |
8556 * assist is distinguished from a refactoring primarily by the fact that it | |
8557 * affects a single file and does not require user input in order to be | |
8558 * performed. | |
8559 */ | |
8560 EditGetAssistsResult decodeEditGetAssistsResponse(Response response) { | |
8561 var decoder = new ResponseDecoder(); | |
8562 return decoder.decodeEditGetAssistsResult("result", response.result); | |
8563 } | |
8564 | |
8565 /** | |
8566 * Decode a request of type edit.getAvailableRefactorings | |
8567 * | |
8568 * Get a list of the kinds of refactorings that are valid for the given | |
8569 * selection in the given file. | |
8570 */ | |
8571 EditGetAvailableRefactoringsParams decodeEditGetAvailableRefactoringsRequest(Req uest request) { | |
8572 var decoder = new RequestDecoder(request); | |
8573 return decoder.decodeEditGetAvailableRefactoringsParams("params", request.para ms); | |
8574 } | |
8575 | |
8576 /** | |
8577 * Decode the response to a request of type edit.getAvailableRefactorings | |
8578 * | |
8579 * Get a list of the kinds of refactorings that are valid for the given | |
8580 * selection in the given file. | |
8581 */ | |
8582 EditGetAvailableRefactoringsResult decodeEditGetAvailableRefactoringsResponse(Re sponse response) { | |
8583 var decoder = new ResponseDecoder(); | |
8584 return decoder.decodeEditGetAvailableRefactoringsResult("result", response.res ult); | |
8585 } | |
8586 | |
8587 /** | |
8588 * Decode a request of type edit.getFixes | |
8589 * | |
8590 * Return the set of fixes that are available for the errors at a given offset | |
8591 * in a given file. | |
8592 */ | |
8593 EditGetFixesParams decodeEditGetFixesRequest(Request request) { | |
8594 var decoder = new RequestDecoder(request); | |
8595 return decoder.decodeEditGetFixesParams("params", request.params); | |
8596 } | |
8597 | |
8598 /** | |
8599 * Decode the response to a request of type edit.getFixes | |
8600 * | |
8601 * Return the set of fixes that are available for the errors at a given offset | |
8602 * in a given file. | |
8603 */ | |
8604 EditGetFixesResult decodeEditGetFixesResponse(Response response) { | |
8605 var decoder = new ResponseDecoder(); | |
8606 return decoder.decodeEditGetFixesResult("result", response.result); | |
8607 } | |
8608 | |
8609 /** | |
8610 * Decode a request of type edit.getRefactoring | |
8611 * | |
8612 * Get the changes required to perform a refactoring. | |
8613 */ | |
8614 EditGetRefactoringParams decodeEditGetRefactoringRequest(Request request) { | |
8615 var decoder = new RequestDecoder(request); | |
8616 return decoder.decodeEditGetRefactoringParams("params", request.params); | |
8617 } | |
8618 | |
8619 /** | |
8620 * Decode the response to a request of type edit.getRefactoring | |
8621 * | |
8622 * Get the changes required to perform a refactoring. | |
8623 */ | |
8624 EditGetRefactoringResult decodeEditGetRefactoringResponse(Response response) { | |
8625 var decoder = new ResponseDecoder(); | |
8626 return decoder.decodeEditGetRefactoringResult("result", response.result); | |
8627 } | |
8628 | |
8629 /** | |
8630 * Decode a request of type debug.createContext | |
8631 * | |
8632 * Create a debugging context for the executable file with the given path. The | |
8633 * context that is created will persist until debug.deleteContext is used to | |
8634 * delete it. Clients, therefore, are responsible for managing the lifetime of | |
8635 * debugging contexts. | |
8636 */ | |
8637 DebugCreateContextParams decodeDebugCreateContextRequest(Request request) { | |
8638 var decoder = new RequestDecoder(request); | |
8639 return decoder.decodeDebugCreateContextParams("params", request.params); | |
8640 } | |
8641 | |
8642 /** | |
8643 * Decode the response to a request of type debug.createContext | |
8644 * | |
8645 * Create a debugging context for the executable file with the given path. The | |
8646 * context that is created will persist until debug.deleteContext is used to | |
8647 * delete it. Clients, therefore, are responsible for managing the lifetime of | |
8648 * debugging contexts. | |
8649 */ | |
8650 DebugCreateContextResult decodeDebugCreateContextResponse(Response response) { | |
8651 var decoder = new ResponseDecoder(); | |
8652 return decoder.decodeDebugCreateContextResult("result", response.result); | |
8653 } | |
8654 | |
8655 /** | |
8656 * Decode a request of type debug.deleteContext | |
8657 * | |
8658 * Delete the debugging context with the given identifier. The context id is no | |
8659 * longer valid after this command. The server is allowed to re-use ids when | |
8660 * they are no longer valid. | |
8661 */ | |
8662 DebugDeleteContextParams decodeDebugDeleteContextRequest(Request request) { | |
8663 var decoder = new RequestDecoder(request); | |
8664 return decoder.decodeDebugDeleteContextParams("params", request.params); | |
8665 } | |
8666 | |
8667 /** | |
8668 * Decode a request of type debug.mapUri | |
8669 * | |
8670 * Map a URI from the debugging context to the file that it corresponds to, or | |
8671 * map a file to the URI that it corresponds to in the debugging context. | |
8672 * | |
8673 * Exactly one of the file and uri fields must be provided. | |
8674 */ | |
8675 DebugMapUriParams decodeDebugMapUriRequest(Request request) { | |
8676 var decoder = new RequestDecoder(request); | |
8677 return decoder.decodeDebugMapUriParams("params", request.params); | |
8678 } | |
8679 | |
8680 /** | |
8681 * Decode the response to a request of type debug.mapUri | |
8682 * | |
8683 * Map a URI from the debugging context to the file that it corresponds to, or | |
8684 * map a file to the URI that it corresponds to in the debugging context. | |
8685 * | |
8686 * Exactly one of the file and uri fields must be provided. | |
8687 */ | |
8688 DebugMapUriResult decodeDebugMapUriResponse(Response response) { | |
8689 var decoder = new ResponseDecoder(); | |
8690 return decoder.decodeDebugMapUriResult("result", response.result); | |
8691 } | |
8692 | |
8693 /** | |
8694 * Decode a request of type debug.setSubscriptions | |
8695 * | |
8696 * Subscribe for services. All previous subscriptions are replaced by the given | |
8697 * set of services. | |
8698 * | |
8699 * It is an error if any of the elements in the list are not valid services. If | |
8700 * there is an error, then the current subscriptions will remain unchanged. | |
8701 */ | |
8702 DebugSetSubscriptionsParams decodeDebugSetSubscriptionsRequest(Request request) { | |
8703 var decoder = new RequestDecoder(request); | |
8704 return decoder.decodeDebugSetSubscriptionsParams("params", request.params); | |
8705 } | |
8706 | |
8707 /** | |
8708 * Decode a notification of type debug.launchData | |
8709 * | |
8710 * Reports information needed to allow applications within the given context to | |
8711 * be launched. | |
8712 * | |
8713 * This notification is not subscribed to by default. Clients can subscribe by | |
8714 * including the value "LAUNCH_DATA" in the list of services passed in a | |
8715 * debug.setSubscriptions request. | |
8716 */ | |
8717 DebugLaunchDataParams decodeDebugLaunchDataNotification(Notification notificatio n) { | |
8718 var decoder = new ResponseDecoder(); | |
8719 return decoder.decodeDebugLaunchDataParams("params", notification.params); | |
8720 } | |
8721 | |
8722 /** | |
8723 * Decode refactoring feedback of type EXTRACT_LOCAL_VARIABLE | |
8724 * | |
8725 * Create a local variable initialized by a specified expression. | |
8726 * | |
8727 * It is an error if the range contains anything other than a complete | |
8728 * expression (no partial expressions are allowed). | |
8729 */ | |
8730 ExtractLocalVariableFeedback decodeExtractLocalVariableFeedback(EditGetRefactori ngResult refactoringResult) { | |
8731 var decoder = new ResponseDecoder(); | |
8732 return decoder.decodeExtractLocalVariableFeedback("feedback", refactoringResul t.feedback); | |
8733 } | |
8734 | |
8735 /** | |
8736 * Decode refactoring options of type EXTRACT_LOCAL_VARIABLE | |
8737 * | |
8738 * Create a local variable initialized by a specified expression. | |
8739 * | |
8740 * It is an error if the range contains anything other than a complete | |
8741 * expression (no partial expressions are allowed). | |
8742 */ | |
8743 ExtractLocalVariableOptions decodeExtractLocalVariableOptions(EditGetRefactoring Params refactoringParams, Request request) { | |
8744 var decoder = new RequestDecoder(request); | |
8745 return decoder.decodeExtractLocalVariableOptions("options", refactoringParams. options); | |
8746 } | |
8747 | |
8748 /** | |
8749 * Decode refactoring feedback of type EXTRACT_METHOD | |
8750 * | |
8751 * Create a method whose body is the specified expression or list of | |
8752 * statements, possibly augmented with a return statement. | |
8753 * | |
8754 * It is an error if the range contains anything other than a complete | |
8755 * expression (no partial expressions are allowed) or a complete sequence of | |
8756 * statements. | |
8757 */ | |
8758 ExtractMethodFeedback decodeExtractMethodFeedback(EditGetRefactoringResult refac toringResult) { | |
8759 var decoder = new ResponseDecoder(); | |
8760 return decoder.decodeExtractMethodFeedback("feedback", refactoringResult.feedb ack); | |
8761 } | |
8762 | |
8763 /** | |
8764 * Decode refactoring options of type EXTRACT_METHOD | |
8765 * | |
8766 * Create a method whose body is the specified expression or list of | |
8767 * statements, possibly augmented with a return statement. | |
8768 * | |
8769 * It is an error if the range contains anything other than a complete | |
8770 * expression (no partial expressions are allowed) or a complete sequence of | |
8771 * statements. | |
8772 */ | |
8773 ExtractMethodOptions decodeExtractMethodOptions(EditGetRefactoringParams refacto ringParams, Request request) { | |
8774 var decoder = new RequestDecoder(request); | |
8775 return decoder.decodeExtractMethodOptions("options", refactoringParams.options ); | |
8776 } | |
8777 | |
8778 /** | |
8779 * Decode refactoring options of type INLINE_METHOD | |
8780 * | |
8781 * Inline a method in place of one or all references to that method. | |
8782 * | |
8783 * It is an error if the range contains anything other than all or part of the | |
8784 * name of a single method. | |
8785 */ | |
8786 InlineMethodOptions decodeInlineMethodOptions(EditGetRefactoringParams refactori ngParams, Request request) { | |
8787 var decoder = new RequestDecoder(request); | |
8788 return decoder.decodeInlineMethodOptions("options", refactoringParams.options) ; | |
8789 } | |
8790 | |
8791 /** | |
8792 * Decode refactoring feedback of type RENAME | |
8793 * | |
8794 * Rename a given element and all of the references to that element. | |
8795 * | |
8796 * It is an error if the range contains anything other than all or part of the | |
8797 * name of a single function (including methods, getters and setters), variable | |
8798 * (including fields, parameters and local variables), class or function type. | |
8799 */ | |
8800 RenameFeedback decodeRenameFeedback(EditGetRefactoringResult refactoringResult) { | |
8801 var decoder = new ResponseDecoder(); | |
8802 return decoder.decodeRenameFeedback("feedback", refactoringResult.feedback); | |
8803 } | |
8804 | |
8805 /** | |
8806 * Decode refactoring options of type RENAME | |
8807 * | |
8808 * Rename a given element and all of the references to that element. | |
8809 * | |
8810 * It is an error if the range contains anything other than all or part of the | |
8811 * name of a single function (including methods, getters and setters), variable | |
8812 * (including fields, parameters and local variables), class or function type. | |
8813 */ | |
8814 RenameOptions decodeRenameOptions(EditGetRefactoringParams refactoringParams, Re quest request) { | |
8815 var decoder = new RequestDecoder(request); | |
8816 return decoder.decodeRenameOptions("options", refactoringParams.options); | |
8817 } | |
OLD | NEW |