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

Side by Side Diff: pkg/analysis_server/lib/src/generated_protocol.dart

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

Powered by Google App Engine
This is Rietveld 408576698