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

Side by Side Diff: pkg/analyzer_plugin/lib/protocol/generated_protocol.dart

Issue 2664213003: Add the generator and the generated files (Closed)
Patch Set: add missed files Created 3 years, 10 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
« no previous file with comments | « pkg/analyzer_plugin/doc/api.html ('k') | pkg/analyzer_plugin/lib/protocol/protocol.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) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
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/tool/spec/generate_files".
8
9 import 'dart:convert' hide JsonDecoder;
10
11 import 'package:analyzer/src/generated/utilities_general.dart';
12 import 'package:analyzer_plugin/protocol/protocol.dart';
13 import 'package:analyzer_plugin/src/protocol/protocol_internal.dart';
14
15 /**
16 * AddContentOverlay
17 *
18 * {
19 * "type": "add"
20 * "content": String
21 * }
22 *
23 * Clients may not extend, implement or mix-in this class.
24 */
25 class AddContentOverlay implements HasToJson {
26 String _content;
27
28 /**
29 * The new content of the file.
30 */
31 String get content => _content;
32
33 /**
34 * The new content of the file.
35 */
36 void set content(String value) {
37 assert(value != null);
38 this._content = value;
39 }
40
41 AddContentOverlay(String content) {
42 this.content = content;
43 }
44
45 factory AddContentOverlay.fromJson(JsonDecoder jsonDecoder, String jsonPath, O bject json) {
46 if (json == null) {
47 json = {};
48 }
49 if (json is Map) {
50 if (json["type"] != "add") {
51 throw jsonDecoder.mismatch(jsonPath, "equal " + "add", json);
52 }
53 String content;
54 if (json.containsKey("content")) {
55 content = jsonDecoder.decodeString(jsonPath + ".content", json["content" ]);
56 } else {
57 throw jsonDecoder.mismatch(jsonPath, "content");
58 }
59 return new AddContentOverlay(content);
60 } else {
61 throw jsonDecoder.mismatch(jsonPath, "AddContentOverlay", json);
62 }
63 }
64
65 @override
66 Map<String, dynamic> toJson() {
67 Map<String, dynamic> result = {};
68 result["type"] = "add";
69 result["content"] = content;
70 return result;
71 }
72
73 @override
74 String toString() => JSON.encode(toJson());
75
76 @override
77 bool operator==(other) {
78 if (other is AddContentOverlay) {
79 return content == other.content;
80 }
81 return false;
82 }
83
84 @override
85 int get hashCode {
86 int hash = 0;
87 hash = JenkinsSmiHash.combine(hash, 704418402);
88 hash = JenkinsSmiHash.combine(hash, content.hashCode);
89 return JenkinsSmiHash.finish(hash);
90 }
91 }
92
93 /**
94 * AnalysisError
95 *
96 * {
97 * "severity": AnalysisErrorSeverity
98 * "type": AnalysisErrorType
99 * "location": Location
100 * "message": String
101 * "correction": optional String
102 * "code": String
103 * "hasFix": optional bool
104 * }
105 *
106 * Clients may not extend, implement or mix-in this class.
107 */
108 class AnalysisError implements HasToJson {
109 AnalysisErrorSeverity _severity;
110
111 AnalysisErrorType _type;
112
113 Location _location;
114
115 String _message;
116
117 String _correction;
118
119 String _code;
120
121 bool _hasFix;
122
123 /**
124 * The severity of the error.
125 */
126 AnalysisErrorSeverity get severity => _severity;
127
128 /**
129 * The severity of the error.
130 */
131 void set severity(AnalysisErrorSeverity value) {
132 assert(value != null);
133 this._severity = value;
134 }
135
136 /**
137 * The type of the error.
138 */
139 AnalysisErrorType get type => _type;
140
141 /**
142 * The type of the error.
143 */
144 void set type(AnalysisErrorType value) {
145 assert(value != null);
146 this._type = value;
147 }
148
149 /**
150 * The location associated with the error.
151 */
152 Location get location => _location;
153
154 /**
155 * The location associated with the error.
156 */
157 void set location(Location value) {
158 assert(value != null);
159 this._location = value;
160 }
161
162 /**
163 * The message to be displayed for this error. The message should indicate
164 * what is wrong with the code and why it is wrong.
165 */
166 String get message => _message;
167
168 /**
169 * The message to be displayed for this error. The message should indicate
170 * what is wrong with the code and why it is wrong.
171 */
172 void set message(String value) {
173 assert(value != null);
174 this._message = value;
175 }
176
177 /**
178 * The correction message to be displayed for this error. The correction
179 * message should indicate how the user can fix the error. The field is
180 * omitted if there is no correction message associated with the error code.
181 */
182 String get correction => _correction;
183
184 /**
185 * The correction message to be displayed for this error. The correction
186 * message should indicate how the user can fix the error. The field is
187 * omitted if there is no correction message associated with the error code.
188 */
189 void set correction(String value) {
190 this._correction = value;
191 }
192
193 /**
194 * The name, as a string, of the error code associated with this error.
195 */
196 String get code => _code;
197
198 /**
199 * The name, as a string, of the error code associated with this error.
200 */
201 void set code(String value) {
202 assert(value != null);
203 this._code = value;
204 }
205
206 /**
207 * A hint to indicate to interested clients that this error has an associated
208 * fix (or fixes). The absence of this field implies there are not known to
209 * be fixes. Note that since the operation to calculate whether fixes apply
210 * needs to be performant it is possible that complicated tests will be
211 * skipped and a false negative returned. For this reason, this attribute
212 * should be treated as a "hint". Despite the possibility of false negatives,
213 * no false positives should be returned. If a client sees this flag set they
214 * can proceed with the confidence that there are in fact associated fixes.
215 */
216 bool get hasFix => _hasFix;
217
218 /**
219 * A hint to indicate to interested clients that this error has an associated
220 * fix (or fixes). The absence of this field implies there are not known to
221 * be fixes. Note that since the operation to calculate whether fixes apply
222 * needs to be performant it is possible that complicated tests will be
223 * skipped and a false negative returned. For this reason, this attribute
224 * should be treated as a "hint". Despite the possibility of false negatives,
225 * no false positives should be returned. If a client sees this flag set they
226 * can proceed with the confidence that there are in fact associated fixes.
227 */
228 void set hasFix(bool value) {
229 this._hasFix = value;
230 }
231
232 AnalysisError(AnalysisErrorSeverity severity, AnalysisErrorType type, Location location, String message, String code, {String correction, bool hasFix}) {
233 this.severity = severity;
234 this.type = type;
235 this.location = location;
236 this.message = message;
237 this.correction = correction;
238 this.code = code;
239 this.hasFix = hasFix;
240 }
241
242 factory AnalysisError.fromJson(JsonDecoder jsonDecoder, String jsonPath, Objec t json) {
243 if (json == null) {
244 json = {};
245 }
246 if (json is Map) {
247 AnalysisErrorSeverity severity;
248 if (json.containsKey("severity")) {
249 severity = new AnalysisErrorSeverity.fromJson(jsonDecoder, jsonPath + ". severity", json["severity"]);
250 } else {
251 throw jsonDecoder.mismatch(jsonPath, "severity");
252 }
253 AnalysisErrorType type;
254 if (json.containsKey("type")) {
255 type = new AnalysisErrorType.fromJson(jsonDecoder, jsonPath + ".type", j son["type"]);
256 } else {
257 throw jsonDecoder.mismatch(jsonPath, "type");
258 }
259 Location location;
260 if (json.containsKey("location")) {
261 location = new Location.fromJson(jsonDecoder, jsonPath + ".location", js on["location"]);
262 } else {
263 throw jsonDecoder.mismatch(jsonPath, "location");
264 }
265 String message;
266 if (json.containsKey("message")) {
267 message = jsonDecoder.decodeString(jsonPath + ".message", json["message" ]);
268 } else {
269 throw jsonDecoder.mismatch(jsonPath, "message");
270 }
271 String correction;
272 if (json.containsKey("correction")) {
273 correction = jsonDecoder.decodeString(jsonPath + ".correction", json["co rrection"]);
274 }
275 String code;
276 if (json.containsKey("code")) {
277 code = jsonDecoder.decodeString(jsonPath + ".code", json["code"]);
278 } else {
279 throw jsonDecoder.mismatch(jsonPath, "code");
280 }
281 bool hasFix;
282 if (json.containsKey("hasFix")) {
283 hasFix = jsonDecoder.decodeBool(jsonPath + ".hasFix", json["hasFix"]);
284 }
285 return new AnalysisError(severity, type, location, message, code, correcti on: correction, hasFix: hasFix);
286 } else {
287 throw jsonDecoder.mismatch(jsonPath, "AnalysisError", json);
288 }
289 }
290
291 @override
292 Map<String, dynamic> toJson() {
293 Map<String, dynamic> result = {};
294 result["severity"] = severity.toJson();
295 result["type"] = type.toJson();
296 result["location"] = location.toJson();
297 result["message"] = message;
298 if (correction != null) {
299 result["correction"] = correction;
300 }
301 result["code"] = code;
302 if (hasFix != null) {
303 result["hasFix"] = hasFix;
304 }
305 return result;
306 }
307
308 @override
309 String toString() => JSON.encode(toJson());
310
311 @override
312 bool operator==(other) {
313 if (other is AnalysisError) {
314 return severity == other.severity &&
315 type == other.type &&
316 location == other.location &&
317 message == other.message &&
318 correction == other.correction &&
319 code == other.code &&
320 hasFix == other.hasFix;
321 }
322 return false;
323 }
324
325 @override
326 int get hashCode {
327 int hash = 0;
328 hash = JenkinsSmiHash.combine(hash, severity.hashCode);
329 hash = JenkinsSmiHash.combine(hash, type.hashCode);
330 hash = JenkinsSmiHash.combine(hash, location.hashCode);
331 hash = JenkinsSmiHash.combine(hash, message.hashCode);
332 hash = JenkinsSmiHash.combine(hash, correction.hashCode);
333 hash = JenkinsSmiHash.combine(hash, code.hashCode);
334 hash = JenkinsSmiHash.combine(hash, hasFix.hashCode);
335 return JenkinsSmiHash.finish(hash);
336 }
337 }
338
339 /**
340 * AnalysisErrorFixes
341 *
342 * {
343 * "error": AnalysisError
344 * "fixes": List<SourceChange>
345 * }
346 *
347 * Clients may not extend, implement or mix-in this class.
348 */
349 class AnalysisErrorFixes implements HasToJson {
350 AnalysisError _error;
351
352 List<SourceChange> _fixes;
353
354 /**
355 * The error with which the fixes are associated.
356 */
357 AnalysisError get error => _error;
358
359 /**
360 * The error with which the fixes are associated.
361 */
362 void set error(AnalysisError value) {
363 assert(value != null);
364 this._error = value;
365 }
366
367 /**
368 * The fixes associated with the error.
369 */
370 List<SourceChange> get fixes => _fixes;
371
372 /**
373 * The fixes associated with the error.
374 */
375 void set fixes(List<SourceChange> value) {
376 assert(value != null);
377 this._fixes = value;
378 }
379
380 AnalysisErrorFixes(AnalysisError error, {List<SourceChange> fixes}) {
381 this.error = error;
382 if (fixes == null) {
383 this.fixes = <SourceChange>[];
384 } else {
385 this.fixes = fixes;
386 }
387 }
388
389 factory AnalysisErrorFixes.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
390 if (json == null) {
391 json = {};
392 }
393 if (json is Map) {
394 AnalysisError error;
395 if (json.containsKey("error")) {
396 error = new AnalysisError.fromJson(jsonDecoder, jsonPath + ".error", jso n["error"]);
397 } else {
398 throw jsonDecoder.mismatch(jsonPath, "error");
399 }
400 List<SourceChange> fixes;
401 if (json.containsKey("fixes")) {
402 fixes = jsonDecoder.decodeList(jsonPath + ".fixes", json["fixes"], (Stri ng jsonPath, Object json) => new SourceChange.fromJson(jsonDecoder, jsonPath, js on));
403 } else {
404 throw jsonDecoder.mismatch(jsonPath, "fixes");
405 }
406 return new AnalysisErrorFixes(error, fixes: fixes);
407 } else {
408 throw jsonDecoder.mismatch(jsonPath, "AnalysisErrorFixes", json);
409 }
410 }
411
412 @override
413 Map<String, dynamic> toJson() {
414 Map<String, dynamic> result = {};
415 result["error"] = error.toJson();
416 result["fixes"] = fixes.map((SourceChange value) => value.toJson()).toList() ;
417 return result;
418 }
419
420 @override
421 String toString() => JSON.encode(toJson());
422
423 @override
424 bool operator==(other) {
425 if (other is AnalysisErrorFixes) {
426 return error == other.error &&
427 listEqual(fixes, other.fixes, (SourceChange a, SourceChange b) => a == b);
428 }
429 return false;
430 }
431
432 @override
433 int get hashCode {
434 int hash = 0;
435 hash = JenkinsSmiHash.combine(hash, error.hashCode);
436 hash = JenkinsSmiHash.combine(hash, fixes.hashCode);
437 return JenkinsSmiHash.finish(hash);
438 }
439 }
440
441 /**
442 * AnalysisErrorSeverity
443 *
444 * enum {
445 * INFO
446 * WARNING
447 * ERROR
448 * }
449 *
450 * Clients may not extend, implement or mix-in this class.
451 */
452 class AnalysisErrorSeverity implements Enum {
453 static const AnalysisErrorSeverity INFO = const AnalysisErrorSeverity._("INFO" );
454
455 static const AnalysisErrorSeverity WARNING = const AnalysisErrorSeverity._("WA RNING");
456
457 static const AnalysisErrorSeverity ERROR = const AnalysisErrorSeverity._("ERRO R");
458
459 /**
460 * A list containing all of the enum values that are defined.
461 */
462 static const List<AnalysisErrorSeverity> VALUES = const <AnalysisErrorSeverity >[INFO, WARNING, ERROR];
463
464 @override
465 final String name;
466
467 const AnalysisErrorSeverity._(this.name);
468
469 factory AnalysisErrorSeverity(String name) {
470 switch (name) {
471 case "INFO":
472 return INFO;
473 case "WARNING":
474 return WARNING;
475 case "ERROR":
476 return ERROR;
477 }
478 throw new Exception('Illegal enum value: $name');
479 }
480
481 factory AnalysisErrorSeverity.fromJson(JsonDecoder jsonDecoder, String jsonPat h, Object json) {
482 if (json is String) {
483 try {
484 return new AnalysisErrorSeverity(json);
485 } catch(_) {
486 // Fall through
487 }
488 }
489 throw jsonDecoder.mismatch(jsonPath, "AnalysisErrorSeverity", json);
490 }
491
492 @override
493 String toString() => "AnalysisErrorSeverity.$name";
494
495 String toJson() => name;
496 }
497
498 /**
499 * AnalysisErrorType
500 *
501 * enum {
502 * CHECKED_MODE_COMPILE_TIME_ERROR
503 * COMPILE_TIME_ERROR
504 * HINT
505 * LINT
506 * STATIC_TYPE_WARNING
507 * STATIC_WARNING
508 * SYNTACTIC_ERROR
509 * TODO
510 * }
511 *
512 * Clients may not extend, implement or mix-in this class.
513 */
514 class AnalysisErrorType implements Enum {
515 static const AnalysisErrorType CHECKED_MODE_COMPILE_TIME_ERROR = const Analysi sErrorType._("CHECKED_MODE_COMPILE_TIME_ERROR");
516
517 static const AnalysisErrorType COMPILE_TIME_ERROR = const AnalysisErrorType._( "COMPILE_TIME_ERROR");
518
519 static const AnalysisErrorType HINT = const AnalysisErrorType._("HINT");
520
521 static const AnalysisErrorType LINT = const AnalysisErrorType._("LINT");
522
523 static const AnalysisErrorType STATIC_TYPE_WARNING = const AnalysisErrorType._ ("STATIC_TYPE_WARNING");
524
525 static const AnalysisErrorType STATIC_WARNING = const AnalysisErrorType._("STA TIC_WARNING");
526
527 static const AnalysisErrorType SYNTACTIC_ERROR = const AnalysisErrorType._("SY NTACTIC_ERROR");
528
529 static const AnalysisErrorType TODO = const AnalysisErrorType._("TODO");
530
531 /**
532 * A list containing all of the enum values that are defined.
533 */
534 static const List<AnalysisErrorType> VALUES = const <AnalysisErrorType>[CHECKE D_MODE_COMPILE_TIME_ERROR, COMPILE_TIME_ERROR, HINT, LINT, STATIC_TYPE_WARNING, STATIC_WARNING, SYNTACTIC_ERROR, TODO];
535
536 @override
537 final String name;
538
539 const AnalysisErrorType._(this.name);
540
541 factory AnalysisErrorType(String name) {
542 switch (name) {
543 case "CHECKED_MODE_COMPILE_TIME_ERROR":
544 return CHECKED_MODE_COMPILE_TIME_ERROR;
545 case "COMPILE_TIME_ERROR":
546 return COMPILE_TIME_ERROR;
547 case "HINT":
548 return HINT;
549 case "LINT":
550 return LINT;
551 case "STATIC_TYPE_WARNING":
552 return STATIC_TYPE_WARNING;
553 case "STATIC_WARNING":
554 return STATIC_WARNING;
555 case "SYNTACTIC_ERROR":
556 return SYNTACTIC_ERROR;
557 case "TODO":
558 return TODO;
559 }
560 throw new Exception('Illegal enum value: $name');
561 }
562
563 factory AnalysisErrorType.fromJson(JsonDecoder jsonDecoder, String jsonPath, O bject json) {
564 if (json is String) {
565 try {
566 return new AnalysisErrorType(json);
567 } catch(_) {
568 // Fall through
569 }
570 }
571 throw jsonDecoder.mismatch(jsonPath, "AnalysisErrorType", json);
572 }
573
574 @override
575 String toString() => "AnalysisErrorType.$name";
576
577 String toJson() => name;
578 }
579
580 /**
581 * analysis.errors params
582 *
583 * {
584 * "file": FilePath
585 * "errors": List<AnalysisError>
586 * }
587 *
588 * Clients may not extend, implement or mix-in this class.
589 */
590 class AnalysisErrorsParams implements HasToJson {
591 String _file;
592
593 List<AnalysisError> _errors;
594
595 /**
596 * The file containing the errors.
597 */
598 String get file => _file;
599
600 /**
601 * The file containing the errors.
602 */
603 void set file(String value) {
604 assert(value != null);
605 this._file = value;
606 }
607
608 /**
609 * The errors contained in the file.
610 */
611 List<AnalysisError> get errors => _errors;
612
613 /**
614 * The errors contained in the file.
615 */
616 void set errors(List<AnalysisError> value) {
617 assert(value != null);
618 this._errors = value;
619 }
620
621 AnalysisErrorsParams(String file, List<AnalysisError> errors) {
622 this.file = file;
623 this.errors = errors;
624 }
625
626 factory AnalysisErrorsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath , Object json) {
627 if (json == null) {
628 json = {};
629 }
630 if (json is Map) {
631 String file;
632 if (json.containsKey("file")) {
633 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
634 } else {
635 throw jsonDecoder.mismatch(jsonPath, "file");
636 }
637 List<AnalysisError> errors;
638 if (json.containsKey("errors")) {
639 errors = jsonDecoder.decodeList(jsonPath + ".errors", json["errors"], (S tring jsonPath, Object json) => new AnalysisError.fromJson(jsonDecoder, jsonPath , json));
640 } else {
641 throw jsonDecoder.mismatch(jsonPath, "errors");
642 }
643 return new AnalysisErrorsParams(file, errors);
644 } else {
645 throw jsonDecoder.mismatch(jsonPath, "analysis.errors params", json);
646 }
647 }
648
649 factory AnalysisErrorsParams.fromNotification(Notification notification) {
650 return new AnalysisErrorsParams.fromJson(
651 new ResponseDecoder(null), "params", notification.params);
652 }
653
654 @override
655 Map<String, dynamic> toJson() {
656 Map<String, dynamic> result = {};
657 result["file"] = file;
658 result["errors"] = errors.map((AnalysisError value) => value.toJson()).toLis t();
659 return result;
660 }
661
662 Notification toNotification() {
663 return new Notification("analysis.errors", toJson());
664 }
665
666 @override
667 String toString() => JSON.encode(toJson());
668
669 @override
670 bool operator==(other) {
671 if (other is AnalysisErrorsParams) {
672 return file == other.file &&
673 listEqual(errors, other.errors, (AnalysisError a, AnalysisError b) => a == b);
674 }
675 return false;
676 }
677
678 @override
679 int get hashCode {
680 int hash = 0;
681 hash = JenkinsSmiHash.combine(hash, file.hashCode);
682 hash = JenkinsSmiHash.combine(hash, errors.hashCode);
683 return JenkinsSmiHash.finish(hash);
684 }
685 }
686
687 /**
688 * analysis.folding params
689 *
690 * {
691 * "file": FilePath
692 * "regions": List<FoldingRegion>
693 * }
694 *
695 * Clients may not extend, implement or mix-in this class.
696 */
697 class AnalysisFoldingParams implements HasToJson {
698 String _file;
699
700 List<FoldingRegion> _regions;
701
702 /**
703 * The file containing the folding regions.
704 */
705 String get file => _file;
706
707 /**
708 * The file containing the folding regions.
709 */
710 void set file(String value) {
711 assert(value != null);
712 this._file = value;
713 }
714
715 /**
716 * The folding regions contained in the file.
717 */
718 List<FoldingRegion> get regions => _regions;
719
720 /**
721 * The folding regions contained in the file.
722 */
723 void set regions(List<FoldingRegion> value) {
724 assert(value != null);
725 this._regions = value;
726 }
727
728 AnalysisFoldingParams(String file, List<FoldingRegion> regions) {
729 this.file = file;
730 this.regions = regions;
731 }
732
733 factory AnalysisFoldingParams.fromJson(JsonDecoder jsonDecoder, String jsonPat h, Object json) {
734 if (json == null) {
735 json = {};
736 }
737 if (json is Map) {
738 String file;
739 if (json.containsKey("file")) {
740 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
741 } else {
742 throw jsonDecoder.mismatch(jsonPath, "file");
743 }
744 List<FoldingRegion> regions;
745 if (json.containsKey("regions")) {
746 regions = jsonDecoder.decodeList(jsonPath + ".regions", json["regions"], (String jsonPath, Object json) => new FoldingRegion.fromJson(jsonDecoder, jsonP ath, json));
747 } else {
748 throw jsonDecoder.mismatch(jsonPath, "regions");
749 }
750 return new AnalysisFoldingParams(file, regions);
751 } else {
752 throw jsonDecoder.mismatch(jsonPath, "analysis.folding params", json);
753 }
754 }
755
756 factory AnalysisFoldingParams.fromNotification(Notification notification) {
757 return new AnalysisFoldingParams.fromJson(
758 new ResponseDecoder(null), "params", notification.params);
759 }
760
761 @override
762 Map<String, dynamic> toJson() {
763 Map<String, dynamic> result = {};
764 result["file"] = file;
765 result["regions"] = regions.map((FoldingRegion value) => value.toJson()).toL ist();
766 return result;
767 }
768
769 Notification toNotification() {
770 return new Notification("analysis.folding", toJson());
771 }
772
773 @override
774 String toString() => JSON.encode(toJson());
775
776 @override
777 bool operator==(other) {
778 if (other is AnalysisFoldingParams) {
779 return file == other.file &&
780 listEqual(regions, other.regions, (FoldingRegion a, FoldingRegion b) = > a == b);
781 }
782 return false;
783 }
784
785 @override
786 int get hashCode {
787 int hash = 0;
788 hash = JenkinsSmiHash.combine(hash, file.hashCode);
789 hash = JenkinsSmiHash.combine(hash, regions.hashCode);
790 return JenkinsSmiHash.finish(hash);
791 }
792 }
793
794 /**
795 * analysis.handleWatchEvents params
796 *
797 * {
798 * "events": List<WatchEvent>
799 * }
800 *
801 * Clients may not extend, implement or mix-in this class.
802 */
803 class AnalysisHandleWatchEventsParams implements HasToJson {
804 List<WatchEvent> _events;
805
806 /**
807 * The watch events that the plugin should handle.
808 */
809 List<WatchEvent> get events => _events;
810
811 /**
812 * The watch events that the plugin should handle.
813 */
814 void set events(List<WatchEvent> value) {
815 assert(value != null);
816 this._events = value;
817 }
818
819 AnalysisHandleWatchEventsParams(List<WatchEvent> events) {
820 this.events = events;
821 }
822
823 factory AnalysisHandleWatchEventsParams.fromJson(JsonDecoder jsonDecoder, Stri ng jsonPath, Object json) {
824 if (json == null) {
825 json = {};
826 }
827 if (json is Map) {
828 List<WatchEvent> events;
829 if (json.containsKey("events")) {
830 events = jsonDecoder.decodeList(jsonPath + ".events", json["events"], (S tring jsonPath, Object json) => new WatchEvent.fromJson(jsonDecoder, jsonPath, j son));
831 } else {
832 throw jsonDecoder.mismatch(jsonPath, "events");
833 }
834 return new AnalysisHandleWatchEventsParams(events);
835 } else {
836 throw jsonDecoder.mismatch(jsonPath, "analysis.handleWatchEvents params", json);
837 }
838 }
839
840 factory AnalysisHandleWatchEventsParams.fromRequest(Request request) {
841 return new AnalysisHandleWatchEventsParams.fromJson(
842 new RequestDecoder(request), "params", request.params);
843 }
844
845 @override
846 Map<String, dynamic> toJson() {
847 Map<String, dynamic> result = {};
848 result["events"] = events.map((WatchEvent value) => value.toJson()).toList() ;
849 return result;
850 }
851
852 Request toRequest(String id) {
853 return new Request(id, "analysis.handleWatchEvents", toJson());
854 }
855
856 @override
857 String toString() => JSON.encode(toJson());
858
859 @override
860 bool operator==(other) {
861 if (other is AnalysisHandleWatchEventsParams) {
862 return listEqual(events, other.events, (WatchEvent a, WatchEvent b) => a = = b);
863 }
864 return false;
865 }
866
867 @override
868 int get hashCode {
869 int hash = 0;
870 hash = JenkinsSmiHash.combine(hash, events.hashCode);
871 return JenkinsSmiHash.finish(hash);
872 }
873 }
874
875 /**
876 * analysis.handleWatchEvents result
877 *
878 * Clients may not extend, implement or mix-in this class.
879 */
880 class AnalysisHandleWatchEventsResult implements ResponseResult {
881 @override
882 Map<String, dynamic> toJson() => <String, dynamic>{};
883
884 @override
885 Response toResponse(String id) {
886 return new Response(id, result: null);
887 }
888
889 @override
890 bool operator==(other) {
891 if (other is AnalysisHandleWatchEventsResult) {
892 return true;
893 }
894 return false;
895 }
896
897 @override
898 int get hashCode {
899 return 779767607;
900 }
901 }
902
903 /**
904 * analysis.highlights params
905 *
906 * {
907 * "file": FilePath
908 * "regions": List<HighlightRegion>
909 * }
910 *
911 * Clients may not extend, implement or mix-in this class.
912 */
913 class AnalysisHighlightsParams implements HasToJson {
914 String _file;
915
916 List<HighlightRegion> _regions;
917
918 /**
919 * The file containing the highlight regions.
920 */
921 String get file => _file;
922
923 /**
924 * The file containing the highlight regions.
925 */
926 void set file(String value) {
927 assert(value != null);
928 this._file = value;
929 }
930
931 /**
932 * The highlight regions contained in the file.
933 */
934 List<HighlightRegion> get regions => _regions;
935
936 /**
937 * The highlight regions contained in the file.
938 */
939 void set regions(List<HighlightRegion> value) {
940 assert(value != null);
941 this._regions = value;
942 }
943
944 AnalysisHighlightsParams(String file, List<HighlightRegion> regions) {
945 this.file = file;
946 this.regions = regions;
947 }
948
949 factory AnalysisHighlightsParams.fromJson(JsonDecoder jsonDecoder, String json Path, Object json) {
950 if (json == null) {
951 json = {};
952 }
953 if (json is Map) {
954 String file;
955 if (json.containsKey("file")) {
956 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
957 } else {
958 throw jsonDecoder.mismatch(jsonPath, "file");
959 }
960 List<HighlightRegion> regions;
961 if (json.containsKey("regions")) {
962 regions = jsonDecoder.decodeList(jsonPath + ".regions", json["regions"], (String jsonPath, Object json) => new HighlightRegion.fromJson(jsonDecoder, jso nPath, json));
963 } else {
964 throw jsonDecoder.mismatch(jsonPath, "regions");
965 }
966 return new AnalysisHighlightsParams(file, regions);
967 } else {
968 throw jsonDecoder.mismatch(jsonPath, "analysis.highlights params", json);
969 }
970 }
971
972 factory AnalysisHighlightsParams.fromNotification(Notification notification) {
973 return new AnalysisHighlightsParams.fromJson(
974 new ResponseDecoder(null), "params", notification.params);
975 }
976
977 @override
978 Map<String, dynamic> toJson() {
979 Map<String, dynamic> result = {};
980 result["file"] = file;
981 result["regions"] = regions.map((HighlightRegion value) => value.toJson()).t oList();
982 return result;
983 }
984
985 Notification toNotification() {
986 return new Notification("analysis.highlights", toJson());
987 }
988
989 @override
990 String toString() => JSON.encode(toJson());
991
992 @override
993 bool operator==(other) {
994 if (other is AnalysisHighlightsParams) {
995 return file == other.file &&
996 listEqual(regions, other.regions, (HighlightRegion a, HighlightRegion b) => a == b);
997 }
998 return false;
999 }
1000
1001 @override
1002 int get hashCode {
1003 int hash = 0;
1004 hash = JenkinsSmiHash.combine(hash, file.hashCode);
1005 hash = JenkinsSmiHash.combine(hash, regions.hashCode);
1006 return JenkinsSmiHash.finish(hash);
1007 }
1008 }
1009
1010 /**
1011 * analysis.navigation params
1012 *
1013 * {
1014 * "file": FilePath
1015 * "regions": List<NavigationRegion>
1016 * "targets": List<NavigationTarget>
1017 * "files": List<FilePath>
1018 * }
1019 *
1020 * Clients may not extend, implement or mix-in this class.
1021 */
1022 class AnalysisNavigationParams implements HasToJson {
1023 String _file;
1024
1025 List<NavigationRegion> _regions;
1026
1027 List<NavigationTarget> _targets;
1028
1029 List<String> _files;
1030
1031 /**
1032 * The file containing the navigation regions.
1033 */
1034 String get file => _file;
1035
1036 /**
1037 * The file containing the navigation regions.
1038 */
1039 void set file(String value) {
1040 assert(value != null);
1041 this._file = value;
1042 }
1043
1044 /**
1045 * The navigation regions contained in the file.
1046 */
1047 List<NavigationRegion> get regions => _regions;
1048
1049 /**
1050 * The navigation regions contained in the file.
1051 */
1052 void set regions(List<NavigationRegion> value) {
1053 assert(value != null);
1054 this._regions = value;
1055 }
1056
1057 /**
1058 * The navigation targets referenced in the file. They are referenced by
1059 * NavigationRegions by their index in this array.
1060 */
1061 List<NavigationTarget> get targets => _targets;
1062
1063 /**
1064 * The navigation targets referenced in the file. They are referenced by
1065 * NavigationRegions by their index in this array.
1066 */
1067 void set targets(List<NavigationTarget> value) {
1068 assert(value != null);
1069 this._targets = value;
1070 }
1071
1072 /**
1073 * The files containing navigation targets referenced in the file. They are
1074 * referenced by NavigationTargets by their index in this array.
1075 */
1076 List<String> get files => _files;
1077
1078 /**
1079 * The files containing navigation targets referenced in the file. They are
1080 * referenced by NavigationTargets by their index in this array.
1081 */
1082 void set files(List<String> value) {
1083 assert(value != null);
1084 this._files = value;
1085 }
1086
1087 AnalysisNavigationParams(String file, List<NavigationRegion> regions, List<Nav igationTarget> targets, List<String> files) {
1088 this.file = file;
1089 this.regions = regions;
1090 this.targets = targets;
1091 this.files = files;
1092 }
1093
1094 factory AnalysisNavigationParams.fromJson(JsonDecoder jsonDecoder, String json Path, Object json) {
1095 if (json == null) {
1096 json = {};
1097 }
1098 if (json is Map) {
1099 String file;
1100 if (json.containsKey("file")) {
1101 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
1102 } else {
1103 throw jsonDecoder.mismatch(jsonPath, "file");
1104 }
1105 List<NavigationRegion> regions;
1106 if (json.containsKey("regions")) {
1107 regions = jsonDecoder.decodeList(jsonPath + ".regions", json["regions"], (String jsonPath, Object json) => new NavigationRegion.fromJson(jsonDecoder, js onPath, json));
1108 } else {
1109 throw jsonDecoder.mismatch(jsonPath, "regions");
1110 }
1111 List<NavigationTarget> targets;
1112 if (json.containsKey("targets")) {
1113 targets = jsonDecoder.decodeList(jsonPath + ".targets", json["targets"], (String jsonPath, Object json) => new NavigationTarget.fromJson(jsonDecoder, js onPath, json));
1114 } else {
1115 throw jsonDecoder.mismatch(jsonPath, "targets");
1116 }
1117 List<String> files;
1118 if (json.containsKey("files")) {
1119 files = jsonDecoder.decodeList(jsonPath + ".files", json["files"], jsonD ecoder.decodeString);
1120 } else {
1121 throw jsonDecoder.mismatch(jsonPath, "files");
1122 }
1123 return new AnalysisNavigationParams(file, regions, targets, files);
1124 } else {
1125 throw jsonDecoder.mismatch(jsonPath, "analysis.navigation params", json);
1126 }
1127 }
1128
1129 factory AnalysisNavigationParams.fromNotification(Notification notification) {
1130 return new AnalysisNavigationParams.fromJson(
1131 new ResponseDecoder(null), "params", notification.params);
1132 }
1133
1134 @override
1135 Map<String, dynamic> toJson() {
1136 Map<String, dynamic> result = {};
1137 result["file"] = file;
1138 result["regions"] = regions.map((NavigationRegion value) => value.toJson()). toList();
1139 result["targets"] = targets.map((NavigationTarget value) => value.toJson()). toList();
1140 result["files"] = files;
1141 return result;
1142 }
1143
1144 Notification toNotification() {
1145 return new Notification("analysis.navigation", toJson());
1146 }
1147
1148 @override
1149 String toString() => JSON.encode(toJson());
1150
1151 @override
1152 bool operator==(other) {
1153 if (other is AnalysisNavigationParams) {
1154 return file == other.file &&
1155 listEqual(regions, other.regions, (NavigationRegion a, NavigationRegio n b) => a == b) &&
1156 listEqual(targets, other.targets, (NavigationTarget a, NavigationTarge t b) => a == b) &&
1157 listEqual(files, other.files, (String a, String b) => a == b);
1158 }
1159 return false;
1160 }
1161
1162 @override
1163 int get hashCode {
1164 int hash = 0;
1165 hash = JenkinsSmiHash.combine(hash, file.hashCode);
1166 hash = JenkinsSmiHash.combine(hash, regions.hashCode);
1167 hash = JenkinsSmiHash.combine(hash, targets.hashCode);
1168 hash = JenkinsSmiHash.combine(hash, files.hashCode);
1169 return JenkinsSmiHash.finish(hash);
1170 }
1171 }
1172
1173 /**
1174 * analysis.occurrences params
1175 *
1176 * {
1177 * "file": FilePath
1178 * "occurrences": List<Occurrences>
1179 * }
1180 *
1181 * Clients may not extend, implement or mix-in this class.
1182 */
1183 class AnalysisOccurrencesParams implements HasToJson {
1184 String _file;
1185
1186 List<Occurrences> _occurrences;
1187
1188 /**
1189 * The file in which the references occur.
1190 */
1191 String get file => _file;
1192
1193 /**
1194 * The file in which the references occur.
1195 */
1196 void set file(String value) {
1197 assert(value != null);
1198 this._file = value;
1199 }
1200
1201 /**
1202 * The occurrences of references to elements within the file.
1203 */
1204 List<Occurrences> get occurrences => _occurrences;
1205
1206 /**
1207 * The occurrences of references to elements within the file.
1208 */
1209 void set occurrences(List<Occurrences> value) {
1210 assert(value != null);
1211 this._occurrences = value;
1212 }
1213
1214 AnalysisOccurrencesParams(String file, List<Occurrences> occurrences) {
1215 this.file = file;
1216 this.occurrences = occurrences;
1217 }
1218
1219 factory AnalysisOccurrencesParams.fromJson(JsonDecoder jsonDecoder, String jso nPath, Object json) {
1220 if (json == null) {
1221 json = {};
1222 }
1223 if (json is Map) {
1224 String file;
1225 if (json.containsKey("file")) {
1226 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
1227 } else {
1228 throw jsonDecoder.mismatch(jsonPath, "file");
1229 }
1230 List<Occurrences> occurrences;
1231 if (json.containsKey("occurrences")) {
1232 occurrences = jsonDecoder.decodeList(jsonPath + ".occurrences", json["oc currences"], (String jsonPath, Object json) => new Occurrences.fromJson(jsonDeco der, jsonPath, json));
1233 } else {
1234 throw jsonDecoder.mismatch(jsonPath, "occurrences");
1235 }
1236 return new AnalysisOccurrencesParams(file, occurrences);
1237 } else {
1238 throw jsonDecoder.mismatch(jsonPath, "analysis.occurrences params", json);
1239 }
1240 }
1241
1242 factory AnalysisOccurrencesParams.fromNotification(Notification notification) {
1243 return new AnalysisOccurrencesParams.fromJson(
1244 new ResponseDecoder(null), "params", notification.params);
1245 }
1246
1247 @override
1248 Map<String, dynamic> toJson() {
1249 Map<String, dynamic> result = {};
1250 result["file"] = file;
1251 result["occurrences"] = occurrences.map((Occurrences value) => value.toJson( )).toList();
1252 return result;
1253 }
1254
1255 Notification toNotification() {
1256 return new Notification("analysis.occurrences", toJson());
1257 }
1258
1259 @override
1260 String toString() => JSON.encode(toJson());
1261
1262 @override
1263 bool operator==(other) {
1264 if (other is AnalysisOccurrencesParams) {
1265 return file == other.file &&
1266 listEqual(occurrences, other.occurrences, (Occurrences a, Occurrences b) => a == b);
1267 }
1268 return false;
1269 }
1270
1271 @override
1272 int get hashCode {
1273 int hash = 0;
1274 hash = JenkinsSmiHash.combine(hash, file.hashCode);
1275 hash = JenkinsSmiHash.combine(hash, occurrences.hashCode);
1276 return JenkinsSmiHash.finish(hash);
1277 }
1278 }
1279
1280 /**
1281 * analysis.outline params
1282 *
1283 * {
1284 * "file": FilePath
1285 * "outline": List<Outline>
1286 * }
1287 *
1288 * Clients may not extend, implement or mix-in this class.
1289 */
1290 class AnalysisOutlineParams implements HasToJson {
1291 String _file;
1292
1293 List<Outline> _outline;
1294
1295 /**
1296 * The file with which the outline is associated.
1297 */
1298 String get file => _file;
1299
1300 /**
1301 * The file with which the outline is associated.
1302 */
1303 void set file(String value) {
1304 assert(value != null);
1305 this._file = value;
1306 }
1307
1308 /**
1309 * The outline fragments associated with the file.
1310 */
1311 List<Outline> get outline => _outline;
1312
1313 /**
1314 * The outline fragments associated with the file.
1315 */
1316 void set outline(List<Outline> value) {
1317 assert(value != null);
1318 this._outline = value;
1319 }
1320
1321 AnalysisOutlineParams(String file, List<Outline> outline) {
1322 this.file = file;
1323 this.outline = outline;
1324 }
1325
1326 factory AnalysisOutlineParams.fromJson(JsonDecoder jsonDecoder, String jsonPat h, Object json) {
1327 if (json == null) {
1328 json = {};
1329 }
1330 if (json is Map) {
1331 String file;
1332 if (json.containsKey("file")) {
1333 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
1334 } else {
1335 throw jsonDecoder.mismatch(jsonPath, "file");
1336 }
1337 List<Outline> outline;
1338 if (json.containsKey("outline")) {
1339 outline = jsonDecoder.decodeList(jsonPath + ".outline", json["outline"], (String jsonPath, Object json) => new Outline.fromJson(jsonDecoder, jsonPath, j son));
1340 } else {
1341 throw jsonDecoder.mismatch(jsonPath, "outline");
1342 }
1343 return new AnalysisOutlineParams(file, outline);
1344 } else {
1345 throw jsonDecoder.mismatch(jsonPath, "analysis.outline params", json);
1346 }
1347 }
1348
1349 factory AnalysisOutlineParams.fromNotification(Notification notification) {
1350 return new AnalysisOutlineParams.fromJson(
1351 new ResponseDecoder(null), "params", notification.params);
1352 }
1353
1354 @override
1355 Map<String, dynamic> toJson() {
1356 Map<String, dynamic> result = {};
1357 result["file"] = file;
1358 result["outline"] = outline.map((Outline value) => value.toJson()).toList();
1359 return result;
1360 }
1361
1362 Notification toNotification() {
1363 return new Notification("analysis.outline", toJson());
1364 }
1365
1366 @override
1367 String toString() => JSON.encode(toJson());
1368
1369 @override
1370 bool operator==(other) {
1371 if (other is AnalysisOutlineParams) {
1372 return file == other.file &&
1373 listEqual(outline, other.outline, (Outline a, Outline b) => a == b);
1374 }
1375 return false;
1376 }
1377
1378 @override
1379 int get hashCode {
1380 int hash = 0;
1381 hash = JenkinsSmiHash.combine(hash, file.hashCode);
1382 hash = JenkinsSmiHash.combine(hash, outline.hashCode);
1383 return JenkinsSmiHash.finish(hash);
1384 }
1385 }
1386
1387 /**
1388 * analysis.reanalyze params
1389 *
1390 * {
1391 * "roots": optional List<FilePath>
1392 * }
1393 *
1394 * Clients may not extend, implement or mix-in this class.
1395 */
1396 class AnalysisReanalyzeParams implements HasToJson {
1397 List<String> _roots;
1398
1399 /**
1400 * A list of the context roots that are to be re-analyzed.
1401 *
1402 * If no context roots are provided, then all current context roots should be
1403 * re-analyzed.
1404 */
1405 List<String> get roots => _roots;
1406
1407 /**
1408 * A list of the context roots that are to be re-analyzed.
1409 *
1410 * If no context roots are provided, then all current context roots should be
1411 * re-analyzed.
1412 */
1413 void set roots(List<String> value) {
1414 this._roots = value;
1415 }
1416
1417 AnalysisReanalyzeParams({List<String> roots}) {
1418 this.roots = roots;
1419 }
1420
1421 factory AnalysisReanalyzeParams.fromJson(JsonDecoder jsonDecoder, String jsonP ath, Object json) {
1422 if (json == null) {
1423 json = {};
1424 }
1425 if (json is Map) {
1426 List<String> roots;
1427 if (json.containsKey("roots")) {
1428 roots = jsonDecoder.decodeList(jsonPath + ".roots", json["roots"], jsonD ecoder.decodeString);
1429 }
1430 return new AnalysisReanalyzeParams(roots: roots);
1431 } else {
1432 throw jsonDecoder.mismatch(jsonPath, "analysis.reanalyze params", json);
1433 }
1434 }
1435
1436 factory AnalysisReanalyzeParams.fromRequest(Request request) {
1437 return new AnalysisReanalyzeParams.fromJson(
1438 new RequestDecoder(request), "params", request.params);
1439 }
1440
1441 @override
1442 Map<String, dynamic> toJson() {
1443 Map<String, dynamic> result = {};
1444 if (roots != null) {
1445 result["roots"] = roots;
1446 }
1447 return result;
1448 }
1449
1450 Request toRequest(String id) {
1451 return new Request(id, "analysis.reanalyze", toJson());
1452 }
1453
1454 @override
1455 String toString() => JSON.encode(toJson());
1456
1457 @override
1458 bool operator==(other) {
1459 if (other is AnalysisReanalyzeParams) {
1460 return listEqual(roots, other.roots, (String a, String b) => a == b);
1461 }
1462 return false;
1463 }
1464
1465 @override
1466 int get hashCode {
1467 int hash = 0;
1468 hash = JenkinsSmiHash.combine(hash, roots.hashCode);
1469 return JenkinsSmiHash.finish(hash);
1470 }
1471 }
1472
1473 /**
1474 * analysis.reanalyze result
1475 *
1476 * Clients may not extend, implement or mix-in this class.
1477 */
1478 class AnalysisReanalyzeResult implements ResponseResult {
1479 @override
1480 Map<String, dynamic> toJson() => <String, dynamic>{};
1481
1482 @override
1483 Response toResponse(String id) {
1484 return new Response(id, result: null);
1485 }
1486
1487 @override
1488 bool operator==(other) {
1489 if (other is AnalysisReanalyzeResult) {
1490 return true;
1491 }
1492 return false;
1493 }
1494
1495 @override
1496 int get hashCode {
1497 return 846803925;
1498 }
1499 }
1500
1501 /**
1502 * AnalysisService
1503 *
1504 * enum {
1505 * FOLDING
1506 * HIGHLIGHTS
1507 * NAVIGATION
1508 * OCCURRENCES
1509 * OUTLINE
1510 * }
1511 *
1512 * Clients may not extend, implement or mix-in this class.
1513 */
1514 class AnalysisService implements Enum {
1515 static const AnalysisService FOLDING = const AnalysisService._("FOLDING");
1516
1517 static const AnalysisService HIGHLIGHTS = const AnalysisService._("HIGHLIGHTS" );
1518
1519 static const AnalysisService NAVIGATION = const AnalysisService._("NAVIGATION" );
1520
1521 static const AnalysisService OCCURRENCES = const AnalysisService._("OCCURRENCE S");
1522
1523 static const AnalysisService OUTLINE = const AnalysisService._("OUTLINE");
1524
1525 /**
1526 * A list containing all of the enum values that are defined.
1527 */
1528 static const List<AnalysisService> VALUES = const <AnalysisService>[FOLDING, H IGHLIGHTS, NAVIGATION, OCCURRENCES, OUTLINE];
1529
1530 @override
1531 final String name;
1532
1533 const AnalysisService._(this.name);
1534
1535 factory AnalysisService(String name) {
1536 switch (name) {
1537 case "FOLDING":
1538 return FOLDING;
1539 case "HIGHLIGHTS":
1540 return HIGHLIGHTS;
1541 case "NAVIGATION":
1542 return NAVIGATION;
1543 case "OCCURRENCES":
1544 return OCCURRENCES;
1545 case "OUTLINE":
1546 return OUTLINE;
1547 }
1548 throw new Exception('Illegal enum value: $name');
1549 }
1550
1551 factory AnalysisService.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obj ect json) {
1552 if (json is String) {
1553 try {
1554 return new AnalysisService(json);
1555 } catch(_) {
1556 // Fall through
1557 }
1558 }
1559 throw jsonDecoder.mismatch(jsonPath, "AnalysisService", json);
1560 }
1561
1562 @override
1563 String toString() => "AnalysisService.$name";
1564
1565 String toJson() => name;
1566 }
1567
1568 /**
1569 * analysis.setContextBuilderOptions params
1570 *
1571 * {
1572 * "options": ContextBuilderOptions
1573 * }
1574 *
1575 * Clients may not extend, implement or mix-in this class.
1576 */
1577 class AnalysisSetContextBuilderOptionsParams implements HasToJson {
1578 ContextBuilderOptions _options;
1579
1580 /**
1581 * The options used to build the analysis contexts.
1582 */
1583 ContextBuilderOptions get options => _options;
1584
1585 /**
1586 * The options used to build the analysis contexts.
1587 */
1588 void set options(ContextBuilderOptions value) {
1589 assert(value != null);
1590 this._options = value;
1591 }
1592
1593 AnalysisSetContextBuilderOptionsParams(ContextBuilderOptions options) {
1594 this.options = options;
1595 }
1596
1597 factory AnalysisSetContextBuilderOptionsParams.fromJson(JsonDecoder jsonDecode r, String jsonPath, Object json) {
1598 if (json == null) {
1599 json = {};
1600 }
1601 if (json is Map) {
1602 ContextBuilderOptions options;
1603 if (json.containsKey("options")) {
1604 options = new ContextBuilderOptions.fromJson(jsonDecoder, jsonPath + ".o ptions", json["options"]);
1605 } else {
1606 throw jsonDecoder.mismatch(jsonPath, "options");
1607 }
1608 return new AnalysisSetContextBuilderOptionsParams(options);
1609 } else {
1610 throw jsonDecoder.mismatch(jsonPath, "analysis.setContextBuilderOptions pa rams", json);
1611 }
1612 }
1613
1614 factory AnalysisSetContextBuilderOptionsParams.fromRequest(Request request) {
1615 return new AnalysisSetContextBuilderOptionsParams.fromJson(
1616 new RequestDecoder(request), "params", request.params);
1617 }
1618
1619 @override
1620 Map<String, dynamic> toJson() {
1621 Map<String, dynamic> result = {};
1622 result["options"] = options.toJson();
1623 return result;
1624 }
1625
1626 Request toRequest(String id) {
1627 return new Request(id, "analysis.setContextBuilderOptions", toJson());
1628 }
1629
1630 @override
1631 String toString() => JSON.encode(toJson());
1632
1633 @override
1634 bool operator==(other) {
1635 if (other is AnalysisSetContextBuilderOptionsParams) {
1636 return options == other.options;
1637 }
1638 return false;
1639 }
1640
1641 @override
1642 int get hashCode {
1643 int hash = 0;
1644 hash = JenkinsSmiHash.combine(hash, options.hashCode);
1645 return JenkinsSmiHash.finish(hash);
1646 }
1647 }
1648
1649 /**
1650 * analysis.setContextBuilderOptions result
1651 *
1652 * Clients may not extend, implement or mix-in this class.
1653 */
1654 class AnalysisSetContextBuilderOptionsResult implements ResponseResult {
1655 @override
1656 Map<String, dynamic> toJson() => <String, dynamic>{};
1657
1658 @override
1659 Response toResponse(String id) {
1660 return new Response(id, result: null);
1661 }
1662
1663 @override
1664 bool operator==(other) {
1665 if (other is AnalysisSetContextBuilderOptionsResult) {
1666 return true;
1667 }
1668 return false;
1669 }
1670
1671 @override
1672 int get hashCode {
1673 return 645412314;
1674 }
1675 }
1676
1677 /**
1678 * analysis.setContextRoots params
1679 *
1680 * {
1681 * "roots": List<ContextRoot>
1682 * }
1683 *
1684 * Clients may not extend, implement or mix-in this class.
1685 */
1686 class AnalysisSetContextRootsParams implements HasToJson {
1687 List<ContextRoot> _roots;
1688
1689 /**
1690 * A list of the context roots that should be analyzed.
1691 */
1692 List<ContextRoot> get roots => _roots;
1693
1694 /**
1695 * A list of the context roots that should be analyzed.
1696 */
1697 void set roots(List<ContextRoot> value) {
1698 assert(value != null);
1699 this._roots = value;
1700 }
1701
1702 AnalysisSetContextRootsParams(List<ContextRoot> roots) {
1703 this.roots = roots;
1704 }
1705
1706 factory AnalysisSetContextRootsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
1707 if (json == null) {
1708 json = {};
1709 }
1710 if (json is Map) {
1711 List<ContextRoot> roots;
1712 if (json.containsKey("roots")) {
1713 roots = jsonDecoder.decodeList(jsonPath + ".roots", json["roots"], (Stri ng jsonPath, Object json) => new ContextRoot.fromJson(jsonDecoder, jsonPath, jso n));
1714 } else {
1715 throw jsonDecoder.mismatch(jsonPath, "roots");
1716 }
1717 return new AnalysisSetContextRootsParams(roots);
1718 } else {
1719 throw jsonDecoder.mismatch(jsonPath, "analysis.setContextRoots params", js on);
1720 }
1721 }
1722
1723 factory AnalysisSetContextRootsParams.fromRequest(Request request) {
1724 return new AnalysisSetContextRootsParams.fromJson(
1725 new RequestDecoder(request), "params", request.params);
1726 }
1727
1728 @override
1729 Map<String, dynamic> toJson() {
1730 Map<String, dynamic> result = {};
1731 result["roots"] = roots.map((ContextRoot value) => value.toJson()).toList();
1732 return result;
1733 }
1734
1735 Request toRequest(String id) {
1736 return new Request(id, "analysis.setContextRoots", toJson());
1737 }
1738
1739 @override
1740 String toString() => JSON.encode(toJson());
1741
1742 @override
1743 bool operator==(other) {
1744 if (other is AnalysisSetContextRootsParams) {
1745 return listEqual(roots, other.roots, (ContextRoot a, ContextRoot b) => a = = b);
1746 }
1747 return false;
1748 }
1749
1750 @override
1751 int get hashCode {
1752 int hash = 0;
1753 hash = JenkinsSmiHash.combine(hash, roots.hashCode);
1754 return JenkinsSmiHash.finish(hash);
1755 }
1756 }
1757
1758 /**
1759 * analysis.setContextRoots result
1760 *
1761 * Clients may not extend, implement or mix-in this class.
1762 */
1763 class AnalysisSetContextRootsResult implements ResponseResult {
1764 @override
1765 Map<String, dynamic> toJson() => <String, dynamic>{};
1766
1767 @override
1768 Response toResponse(String id) {
1769 return new Response(id, result: null);
1770 }
1771
1772 @override
1773 bool operator==(other) {
1774 if (other is AnalysisSetContextRootsResult) {
1775 return true;
1776 }
1777 return false;
1778 }
1779
1780 @override
1781 int get hashCode {
1782 return 969645618;
1783 }
1784 }
1785
1786 /**
1787 * analysis.setPriorityFiles params
1788 *
1789 * {
1790 * "files": List<FilePath>
1791 * }
1792 *
1793 * Clients may not extend, implement or mix-in this class.
1794 */
1795 class AnalysisSetPriorityFilesParams implements HasToJson {
1796 List<String> _files;
1797
1798 /**
1799 * The files that are to be a priority for analysis.
1800 */
1801 List<String> get files => _files;
1802
1803 /**
1804 * The files that are to be a priority for analysis.
1805 */
1806 void set files(List<String> value) {
1807 assert(value != null);
1808 this._files = value;
1809 }
1810
1811 AnalysisSetPriorityFilesParams(List<String> files) {
1812 this.files = files;
1813 }
1814
1815 factory AnalysisSetPriorityFilesParams.fromJson(JsonDecoder jsonDecoder, Strin g jsonPath, Object json) {
1816 if (json == null) {
1817 json = {};
1818 }
1819 if (json is Map) {
1820 List<String> files;
1821 if (json.containsKey("files")) {
1822 files = jsonDecoder.decodeList(jsonPath + ".files", json["files"], jsonD ecoder.decodeString);
1823 } else {
1824 throw jsonDecoder.mismatch(jsonPath, "files");
1825 }
1826 return new AnalysisSetPriorityFilesParams(files);
1827 } else {
1828 throw jsonDecoder.mismatch(jsonPath, "analysis.setPriorityFiles params", j son);
1829 }
1830 }
1831
1832 factory AnalysisSetPriorityFilesParams.fromRequest(Request request) {
1833 return new AnalysisSetPriorityFilesParams.fromJson(
1834 new RequestDecoder(request), "params", request.params);
1835 }
1836
1837 @override
1838 Map<String, dynamic> toJson() {
1839 Map<String, dynamic> result = {};
1840 result["files"] = files;
1841 return result;
1842 }
1843
1844 Request toRequest(String id) {
1845 return new Request(id, "analysis.setPriorityFiles", toJson());
1846 }
1847
1848 @override
1849 String toString() => JSON.encode(toJson());
1850
1851 @override
1852 bool operator==(other) {
1853 if (other is AnalysisSetPriorityFilesParams) {
1854 return listEqual(files, other.files, (String a, String b) => a == b);
1855 }
1856 return false;
1857 }
1858
1859 @override
1860 int get hashCode {
1861 int hash = 0;
1862 hash = JenkinsSmiHash.combine(hash, files.hashCode);
1863 return JenkinsSmiHash.finish(hash);
1864 }
1865 }
1866
1867 /**
1868 * analysis.setPriorityFiles result
1869 *
1870 * Clients may not extend, implement or mix-in this class.
1871 */
1872 class AnalysisSetPriorityFilesResult implements ResponseResult {
1873 @override
1874 Map<String, dynamic> toJson() => <String, dynamic>{};
1875
1876 @override
1877 Response toResponse(String id) {
1878 return new Response(id, result: null);
1879 }
1880
1881 @override
1882 bool operator==(other) {
1883 if (other is AnalysisSetPriorityFilesResult) {
1884 return true;
1885 }
1886 return false;
1887 }
1888
1889 @override
1890 int get hashCode {
1891 return 330050055;
1892 }
1893 }
1894
1895 /**
1896 * analysis.setSubscriptions params
1897 *
1898 * {
1899 * "subscriptions": Map<AnalysisService, List<FilePath>>
1900 * }
1901 *
1902 * Clients may not extend, implement or mix-in this class.
1903 */
1904 class AnalysisSetSubscriptionsParams implements HasToJson {
1905 Map<AnalysisService, List<String>> _subscriptions;
1906
1907 /**
1908 * A table mapping services to a list of the files being subscribed to the
1909 * service.
1910 */
1911 Map<AnalysisService, List<String>> get subscriptions => _subscriptions;
1912
1913 /**
1914 * A table mapping services to a list of the files being subscribed to the
1915 * service.
1916 */
1917 void set subscriptions(Map<AnalysisService, List<String>> value) {
1918 assert(value != null);
1919 this._subscriptions = value;
1920 }
1921
1922 AnalysisSetSubscriptionsParams(Map<AnalysisService, List<String>> subscription s) {
1923 this.subscriptions = subscriptions;
1924 }
1925
1926 factory AnalysisSetSubscriptionsParams.fromJson(JsonDecoder jsonDecoder, Strin g jsonPath, Object json) {
1927 if (json == null) {
1928 json = {};
1929 }
1930 if (json is Map) {
1931 Map<AnalysisService, List<String>> subscriptions;
1932 if (json.containsKey("subscriptions")) {
1933 subscriptions = jsonDecoder.decodeMap(jsonPath + ".subscriptions", json[ "subscriptions"], keyDecoder: (String jsonPath, Object json) => new AnalysisServ ice.fromJson(jsonDecoder, jsonPath, json), valueDecoder: (String jsonPath, Objec t json) => jsonDecoder.decodeList(jsonPath, json, jsonDecoder.decodeString));
1934 } else {
1935 throw jsonDecoder.mismatch(jsonPath, "subscriptions");
1936 }
1937 return new AnalysisSetSubscriptionsParams(subscriptions);
1938 } else {
1939 throw jsonDecoder.mismatch(jsonPath, "analysis.setSubscriptions params", j son);
1940 }
1941 }
1942
1943 factory AnalysisSetSubscriptionsParams.fromRequest(Request request) {
1944 return new AnalysisSetSubscriptionsParams.fromJson(
1945 new RequestDecoder(request), "params", request.params);
1946 }
1947
1948 @override
1949 Map<String, dynamic> toJson() {
1950 Map<String, dynamic> result = {};
1951 result["subscriptions"] = mapMap(subscriptions, keyCallback: (AnalysisServic e value) => value.toJson());
1952 return result;
1953 }
1954
1955 Request toRequest(String id) {
1956 return new Request(id, "analysis.setSubscriptions", toJson());
1957 }
1958
1959 @override
1960 String toString() => JSON.encode(toJson());
1961
1962 @override
1963 bool operator==(other) {
1964 if (other is AnalysisSetSubscriptionsParams) {
1965 return mapEqual(subscriptions, other.subscriptions, (List<String> a, List< String> b) => listEqual(a, b, (String a, String b) => a == b));
1966 }
1967 return false;
1968 }
1969
1970 @override
1971 int get hashCode {
1972 int hash = 0;
1973 hash = JenkinsSmiHash.combine(hash, subscriptions.hashCode);
1974 return JenkinsSmiHash.finish(hash);
1975 }
1976 }
1977
1978 /**
1979 * analysis.setSubscriptions result
1980 *
1981 * Clients may not extend, implement or mix-in this class.
1982 */
1983 class AnalysisSetSubscriptionsResult implements ResponseResult {
1984 @override
1985 Map<String, dynamic> toJson() => <String, dynamic>{};
1986
1987 @override
1988 Response toResponse(String id) {
1989 return new Response(id, result: null);
1990 }
1991
1992 @override
1993 bool operator==(other) {
1994 if (other is AnalysisSetSubscriptionsResult) {
1995 return true;
1996 }
1997 return false;
1998 }
1999
2000 @override
2001 int get hashCode {
2002 return 218088493;
2003 }
2004 }
2005
2006 /**
2007 * analysis.updateContent params
2008 *
2009 * {
2010 * "files": Map<FilePath, AddContentOverlay | ChangeContentOverlay | RemoveCon tentOverlay>
2011 * }
2012 *
2013 * Clients may not extend, implement or mix-in this class.
2014 */
2015 class AnalysisUpdateContentParams implements HasToJson {
2016 Map<String, dynamic> _files;
2017
2018 /**
2019 * A table mapping the files whose content has changed to a description of
2020 * the content change.
2021 */
2022 Map<String, dynamic> get files => _files;
2023
2024 /**
2025 * A table mapping the files whose content has changed to a description of
2026 * the content change.
2027 */
2028 void set files(Map<String, dynamic> value) {
2029 assert(value != null);
2030 this._files = value;
2031 }
2032
2033 AnalysisUpdateContentParams(Map<String, dynamic> files) {
2034 this.files = files;
2035 }
2036
2037 factory AnalysisUpdateContentParams.fromJson(JsonDecoder jsonDecoder, String j sonPath, Object json) {
2038 if (json == null) {
2039 json = {};
2040 }
2041 if (json is Map) {
2042 Map<String, dynamic> files;
2043 if (json.containsKey("files")) {
2044 files = jsonDecoder.decodeMap(jsonPath + ".files", json["files"], valueD ecoder: (String jsonPath, Object json) => jsonDecoder.decodeUnion(jsonPath, json , "type", {"add": (String jsonPath, Object json) => new AddContentOverlay.fromJs on(jsonDecoder, jsonPath, json), "change": (String jsonPath, Object json) => new ChangeContentOverlay.fromJson(jsonDecoder, jsonPath, json), "remove": (String j sonPath, Object json) => new RemoveContentOverlay.fromJson(jsonDecoder, jsonPath , json)}));
2045 } else {
2046 throw jsonDecoder.mismatch(jsonPath, "files");
2047 }
2048 return new AnalysisUpdateContentParams(files);
2049 } else {
2050 throw jsonDecoder.mismatch(jsonPath, "analysis.updateContent params", json );
2051 }
2052 }
2053
2054 factory AnalysisUpdateContentParams.fromRequest(Request request) {
2055 return new AnalysisUpdateContentParams.fromJson(
2056 new RequestDecoder(request), "params", request.params);
2057 }
2058
2059 @override
2060 Map<String, dynamic> toJson() {
2061 Map<String, dynamic> result = {};
2062 result["files"] = mapMap(files, valueCallback: (dynamic value) => value.toJs on());
2063 return result;
2064 }
2065
2066 Request toRequest(String id) {
2067 return new Request(id, "analysis.updateContent", toJson());
2068 }
2069
2070 @override
2071 String toString() => JSON.encode(toJson());
2072
2073 @override
2074 bool operator==(other) {
2075 if (other is AnalysisUpdateContentParams) {
2076 return mapEqual(files, other.files, (dynamic a, dynamic b) => a == b);
2077 }
2078 return false;
2079 }
2080
2081 @override
2082 int get hashCode {
2083 int hash = 0;
2084 hash = JenkinsSmiHash.combine(hash, files.hashCode);
2085 return JenkinsSmiHash.finish(hash);
2086 }
2087 }
2088
2089 /**
2090 * analysis.updateContent result
2091 *
2092 * Clients may not extend, implement or mix-in this class.
2093 */
2094 class AnalysisUpdateContentResult implements ResponseResult {
2095 @override
2096 Map<String, dynamic> toJson() => <String, dynamic>{};
2097
2098 @override
2099 Response toResponse(String id) {
2100 return new Response(id, result: null);
2101 }
2102
2103 @override
2104 bool operator==(other) {
2105 if (other is AnalysisUpdateContentResult) {
2106 return true;
2107 }
2108 return false;
2109 }
2110
2111 @override
2112 int get hashCode {
2113 return 468798730;
2114 }
2115 }
2116
2117 /**
2118 * ChangeContentOverlay
2119 *
2120 * {
2121 * "type": "change"
2122 * "edits": List<SourceEdit>
2123 * }
2124 *
2125 * Clients may not extend, implement or mix-in this class.
2126 */
2127 class ChangeContentOverlay implements HasToJson {
2128 List<SourceEdit> _edits;
2129
2130 /**
2131 * The edits to be applied to the file.
2132 */
2133 List<SourceEdit> get edits => _edits;
2134
2135 /**
2136 * The edits to be applied to the file.
2137 */
2138 void set edits(List<SourceEdit> value) {
2139 assert(value != null);
2140 this._edits = value;
2141 }
2142
2143 ChangeContentOverlay(List<SourceEdit> edits) {
2144 this.edits = edits;
2145 }
2146
2147 factory ChangeContentOverlay.fromJson(JsonDecoder jsonDecoder, String jsonPath , Object json) {
2148 if (json == null) {
2149 json = {};
2150 }
2151 if (json is Map) {
2152 if (json["type"] != "change") {
2153 throw jsonDecoder.mismatch(jsonPath, "equal " + "change", json);
2154 }
2155 List<SourceEdit> edits;
2156 if (json.containsKey("edits")) {
2157 edits = jsonDecoder.decodeList(jsonPath + ".edits", json["edits"], (Stri ng jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, json ));
2158 } else {
2159 throw jsonDecoder.mismatch(jsonPath, "edits");
2160 }
2161 return new ChangeContentOverlay(edits);
2162 } else {
2163 throw jsonDecoder.mismatch(jsonPath, "ChangeContentOverlay", json);
2164 }
2165 }
2166
2167 @override
2168 Map<String, dynamic> toJson() {
2169 Map<String, dynamic> result = {};
2170 result["type"] = "change";
2171 result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList();
2172 return result;
2173 }
2174
2175 @override
2176 String toString() => JSON.encode(toJson());
2177
2178 @override
2179 bool operator==(other) {
2180 if (other is ChangeContentOverlay) {
2181 return listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a == b);
2182 }
2183 return false;
2184 }
2185
2186 @override
2187 int get hashCode {
2188 int hash = 0;
2189 hash = JenkinsSmiHash.combine(hash, 873118866);
2190 hash = JenkinsSmiHash.combine(hash, edits.hashCode);
2191 return JenkinsSmiHash.finish(hash);
2192 }
2193 }
2194
2195 /**
2196 * completion.getSuggestions params
2197 *
2198 * {
2199 * "file": FilePath
2200 * "offset": int
2201 * }
2202 *
2203 * Clients may not extend, implement or mix-in this class.
2204 */
2205 class CompletionGetSuggestionsParams implements HasToJson {
2206 String _file;
2207
2208 int _offset;
2209
2210 /**
2211 * The file containing the point at which suggestions are to be made.
2212 */
2213 String get file => _file;
2214
2215 /**
2216 * The file containing the point at which suggestions are to be made.
2217 */
2218 void set file(String value) {
2219 assert(value != null);
2220 this._file = value;
2221 }
2222
2223 /**
2224 * The offset within the file at which suggestions are to be made.
2225 */
2226 int get offset => _offset;
2227
2228 /**
2229 * The offset within the file at which suggestions are to be made.
2230 */
2231 void set offset(int value) {
2232 assert(value != null);
2233 this._offset = value;
2234 }
2235
2236 CompletionGetSuggestionsParams(String file, int offset) {
2237 this.file = file;
2238 this.offset = offset;
2239 }
2240
2241 factory CompletionGetSuggestionsParams.fromJson(JsonDecoder jsonDecoder, Strin g jsonPath, Object json) {
2242 if (json == null) {
2243 json = {};
2244 }
2245 if (json is Map) {
2246 String file;
2247 if (json.containsKey("file")) {
2248 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
2249 } else {
2250 throw jsonDecoder.mismatch(jsonPath, "file");
2251 }
2252 int offset;
2253 if (json.containsKey("offset")) {
2254 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
2255 } else {
2256 throw jsonDecoder.mismatch(jsonPath, "offset");
2257 }
2258 return new CompletionGetSuggestionsParams(file, offset);
2259 } else {
2260 throw jsonDecoder.mismatch(jsonPath, "completion.getSuggestions params", j son);
2261 }
2262 }
2263
2264 factory CompletionGetSuggestionsParams.fromRequest(Request request) {
2265 return new CompletionGetSuggestionsParams.fromJson(
2266 new RequestDecoder(request), "params", request.params);
2267 }
2268
2269 @override
2270 Map<String, dynamic> toJson() {
2271 Map<String, dynamic> result = {};
2272 result["file"] = file;
2273 result["offset"] = offset;
2274 return result;
2275 }
2276
2277 Request toRequest(String id) {
2278 return new Request(id, "completion.getSuggestions", toJson());
2279 }
2280
2281 @override
2282 String toString() => JSON.encode(toJson());
2283
2284 @override
2285 bool operator==(other) {
2286 if (other is CompletionGetSuggestionsParams) {
2287 return file == other.file &&
2288 offset == other.offset;
2289 }
2290 return false;
2291 }
2292
2293 @override
2294 int get hashCode {
2295 int hash = 0;
2296 hash = JenkinsSmiHash.combine(hash, file.hashCode);
2297 hash = JenkinsSmiHash.combine(hash, offset.hashCode);
2298 return JenkinsSmiHash.finish(hash);
2299 }
2300 }
2301
2302 /**
2303 * completion.getSuggestions result
2304 *
2305 * {
2306 * "replacementOffset": int
2307 * "replacementLength": int
2308 * "results": List<CompletionSuggestion>
2309 * }
2310 *
2311 * Clients may not extend, implement or mix-in this class.
2312 */
2313 class CompletionGetSuggestionsResult implements ResponseResult {
2314 int _replacementOffset;
2315
2316 int _replacementLength;
2317
2318 List<CompletionSuggestion> _results;
2319
2320 /**
2321 * The offset of the start of the text to be replaced. This will be different
2322 * than the offset used to request the completion suggestions if there was a
2323 * portion of an identifier before the original offset. In particular, the
2324 * replacementOffset will be the offset of the beginning of said identifier.
2325 */
2326 int get replacementOffset => _replacementOffset;
2327
2328 /**
2329 * The offset of the start of the text to be replaced. This will be different
2330 * than the offset used to request the completion suggestions if there was a
2331 * portion of an identifier before the original offset. In particular, the
2332 * replacementOffset will be the offset of the beginning of said identifier.
2333 */
2334 void set replacementOffset(int value) {
2335 assert(value != null);
2336 this._replacementOffset = value;
2337 }
2338
2339 /**
2340 * The length of the text to be replaced if the remainder of the identifier
2341 * containing the cursor is to be replaced when the suggestion is applied
2342 * (that is, the number of characters in the existing identifier).
2343 */
2344 int get replacementLength => _replacementLength;
2345
2346 /**
2347 * The length of the text to be replaced if the remainder of the identifier
2348 * containing the cursor is to be replaced when the suggestion is applied
2349 * (that is, the number of characters in the existing identifier).
2350 */
2351 void set replacementLength(int value) {
2352 assert(value != null);
2353 this._replacementLength = value;
2354 }
2355
2356 /**
2357 * The completion suggestions being reported. The notification contains all
2358 * possible completions at the requested cursor position, even those that do
2359 * not match the characters the user has already typed. This allows the
2360 * client to respond to further keystrokes from the user without having to
2361 * make additional requests.
2362 */
2363 List<CompletionSuggestion> get results => _results;
2364
2365 /**
2366 * The completion suggestions being reported. The notification contains all
2367 * possible completions at the requested cursor position, even those that do
2368 * not match the characters the user has already typed. This allows the
2369 * client to respond to further keystrokes from the user without having to
2370 * make additional requests.
2371 */
2372 void set results(List<CompletionSuggestion> value) {
2373 assert(value != null);
2374 this._results = value;
2375 }
2376
2377 CompletionGetSuggestionsResult(int replacementOffset, int replacementLength, L ist<CompletionSuggestion> results) {
2378 this.replacementOffset = replacementOffset;
2379 this.replacementLength = replacementLength;
2380 this.results = results;
2381 }
2382
2383 factory CompletionGetSuggestionsResult.fromJson(JsonDecoder jsonDecoder, Strin g jsonPath, Object json) {
2384 if (json == null) {
2385 json = {};
2386 }
2387 if (json is Map) {
2388 int replacementOffset;
2389 if (json.containsKey("replacementOffset")) {
2390 replacementOffset = jsonDecoder.decodeInt(jsonPath + ".replacementOffset ", json["replacementOffset"]);
2391 } else {
2392 throw jsonDecoder.mismatch(jsonPath, "replacementOffset");
2393 }
2394 int replacementLength;
2395 if (json.containsKey("replacementLength")) {
2396 replacementLength = jsonDecoder.decodeInt(jsonPath + ".replacementLength ", json["replacementLength"]);
2397 } else {
2398 throw jsonDecoder.mismatch(jsonPath, "replacementLength");
2399 }
2400 List<CompletionSuggestion> results;
2401 if (json.containsKey("results")) {
2402 results = jsonDecoder.decodeList(jsonPath + ".results", json["results"], (String jsonPath, Object json) => new CompletionSuggestion.fromJson(jsonDecoder , jsonPath, json));
2403 } else {
2404 throw jsonDecoder.mismatch(jsonPath, "results");
2405 }
2406 return new CompletionGetSuggestionsResult(replacementOffset, replacementLe ngth, results);
2407 } else {
2408 throw jsonDecoder.mismatch(jsonPath, "completion.getSuggestions result", j son);
2409 }
2410 }
2411
2412 factory CompletionGetSuggestionsResult.fromResponse(Response response) {
2413 return new CompletionGetSuggestionsResult.fromJson(
2414 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), " result", response.result);
2415 }
2416
2417 @override
2418 Map<String, dynamic> toJson() {
2419 Map<String, dynamic> result = {};
2420 result["replacementOffset"] = replacementOffset;
2421 result["replacementLength"] = replacementLength;
2422 result["results"] = results.map((CompletionSuggestion value) => value.toJson ()).toList();
2423 return result;
2424 }
2425
2426 @override
2427 Response toResponse(String id) {
2428 return new Response(id, result: toJson());
2429 }
2430
2431 @override
2432 String toString() => JSON.encode(toJson());
2433
2434 @override
2435 bool operator==(other) {
2436 if (other is CompletionGetSuggestionsResult) {
2437 return replacementOffset == other.replacementOffset &&
2438 replacementLength == other.replacementLength &&
2439 listEqual(results, other.results, (CompletionSuggestion a, CompletionS uggestion b) => a == b);
2440 }
2441 return false;
2442 }
2443
2444 @override
2445 int get hashCode {
2446 int hash = 0;
2447 hash = JenkinsSmiHash.combine(hash, replacementOffset.hashCode);
2448 hash = JenkinsSmiHash.combine(hash, replacementLength.hashCode);
2449 hash = JenkinsSmiHash.combine(hash, results.hashCode);
2450 return JenkinsSmiHash.finish(hash);
2451 }
2452 }
2453
2454 /**
2455 * CompletionSuggestion
2456 *
2457 * {
2458 * "kind": CompletionSuggestionKind
2459 * "relevance": int
2460 * "completion": String
2461 * "selectionOffset": int
2462 * "selectionLength": int
2463 * "isDeprecated": bool
2464 * "isPotential": bool
2465 * "docSummary": optional String
2466 * "docComplete": optional String
2467 * "declaringType": optional String
2468 * "element": optional Element
2469 * "returnType": optional String
2470 * "parameterNames": optional List<String>
2471 * "parameterTypes": optional List<String>
2472 * "requiredParameterCount": optional int
2473 * "hasNamedParameters": optional bool
2474 * "parameterName": optional String
2475 * "parameterType": optional String
2476 * "importUri": optional String
2477 * }
2478 *
2479 * Clients may not extend, implement or mix-in this class.
2480 */
2481 class CompletionSuggestion implements HasToJson {
2482 CompletionSuggestionKind _kind;
2483
2484 int _relevance;
2485
2486 String _completion;
2487
2488 int _selectionOffset;
2489
2490 int _selectionLength;
2491
2492 bool _isDeprecated;
2493
2494 bool _isPotential;
2495
2496 String _docSummary;
2497
2498 String _docComplete;
2499
2500 String _declaringType;
2501
2502 Element _element;
2503
2504 String _returnType;
2505
2506 List<String> _parameterNames;
2507
2508 List<String> _parameterTypes;
2509
2510 int _requiredParameterCount;
2511
2512 bool _hasNamedParameters;
2513
2514 String _parameterName;
2515
2516 String _parameterType;
2517
2518 String _importUri;
2519
2520 /**
2521 * The kind of element being suggested.
2522 */
2523 CompletionSuggestionKind get kind => _kind;
2524
2525 /**
2526 * The kind of element being suggested.
2527 */
2528 void set kind(CompletionSuggestionKind value) {
2529 assert(value != null);
2530 this._kind = value;
2531 }
2532
2533 /**
2534 * The relevance of this completion suggestion where a higher number
2535 * indicates a higher relevance.
2536 */
2537 int get relevance => _relevance;
2538
2539 /**
2540 * The relevance of this completion suggestion where a higher number
2541 * indicates a higher relevance.
2542 */
2543 void set relevance(int value) {
2544 assert(value != null);
2545 this._relevance = value;
2546 }
2547
2548 /**
2549 * The identifier to be inserted if the suggestion is selected. If the
2550 * suggestion is for a method or function, the client might want to
2551 * additionally insert a template for the parameters. The information
2552 * required in order to do so is contained in other fields.
2553 */
2554 String get completion => _completion;
2555
2556 /**
2557 * The identifier to be inserted if the suggestion is selected. If the
2558 * suggestion is for a method or function, the client might want to
2559 * additionally insert a template for the parameters. The information
2560 * required in order to do so is contained in other fields.
2561 */
2562 void set completion(String value) {
2563 assert(value != null);
2564 this._completion = value;
2565 }
2566
2567 /**
2568 * The offset, relative to the beginning of the completion, of where the
2569 * selection should be placed after insertion.
2570 */
2571 int get selectionOffset => _selectionOffset;
2572
2573 /**
2574 * The offset, relative to the beginning of the completion, of where the
2575 * selection should be placed after insertion.
2576 */
2577 void set selectionOffset(int value) {
2578 assert(value != null);
2579 this._selectionOffset = value;
2580 }
2581
2582 /**
2583 * The number of characters that should be selected after insertion.
2584 */
2585 int get selectionLength => _selectionLength;
2586
2587 /**
2588 * The number of characters that should be selected after insertion.
2589 */
2590 void set selectionLength(int value) {
2591 assert(value != null);
2592 this._selectionLength = value;
2593 }
2594
2595 /**
2596 * True if the suggested element is deprecated.
2597 */
2598 bool get isDeprecated => _isDeprecated;
2599
2600 /**
2601 * True if the suggested element is deprecated.
2602 */
2603 void set isDeprecated(bool value) {
2604 assert(value != null);
2605 this._isDeprecated = value;
2606 }
2607
2608 /**
2609 * True if the element is not known to be valid for the target. This happens
2610 * if the type of the target is dynamic.
2611 */
2612 bool get isPotential => _isPotential;
2613
2614 /**
2615 * True if the element is not known to be valid for the target. This happens
2616 * if the type of the target is dynamic.
2617 */
2618 void set isPotential(bool value) {
2619 assert(value != null);
2620 this._isPotential = value;
2621 }
2622
2623 /**
2624 * An abbreviated version of the Dartdoc associated with the element being
2625 * suggested, This field is omitted if there is no Dartdoc associated with
2626 * the element.
2627 */
2628 String get docSummary => _docSummary;
2629
2630 /**
2631 * An abbreviated version of the Dartdoc associated with the element being
2632 * suggested, This field is omitted if there is no Dartdoc associated with
2633 * the element.
2634 */
2635 void set docSummary(String value) {
2636 this._docSummary = value;
2637 }
2638
2639 /**
2640 * The Dartdoc associated with the element being suggested. This field is
2641 * omitted if there is no Dartdoc associated with the element.
2642 */
2643 String get docComplete => _docComplete;
2644
2645 /**
2646 * The Dartdoc associated with the element being suggested. This field is
2647 * omitted if there is no Dartdoc associated with the element.
2648 */
2649 void set docComplete(String value) {
2650 this._docComplete = value;
2651 }
2652
2653 /**
2654 * The class that declares the element being suggested. This field is omitted
2655 * if the suggested element is not a member of a class.
2656 */
2657 String get declaringType => _declaringType;
2658
2659 /**
2660 * The class that declares the element being suggested. This field is omitted
2661 * if the suggested element is not a member of a class.
2662 */
2663 void set declaringType(String value) {
2664 this._declaringType = value;
2665 }
2666
2667 /**
2668 * Information about the element reference being suggested.
2669 */
2670 Element get element => _element;
2671
2672 /**
2673 * Information about the element reference being suggested.
2674 */
2675 void set element(Element value) {
2676 this._element = value;
2677 }
2678
2679 /**
2680 * The return type of the getter, function or method or the type of the field
2681 * being suggested. This field is omitted if the suggested element is not a
2682 * getter, function or method.
2683 */
2684 String get returnType => _returnType;
2685
2686 /**
2687 * The return type of the getter, function or method or the type of the field
2688 * being suggested. This field is omitted if the suggested element is not a
2689 * getter, function or method.
2690 */
2691 void set returnType(String value) {
2692 this._returnType = value;
2693 }
2694
2695 /**
2696 * The names of the parameters of the function or method being suggested.
2697 * This field is omitted if the suggested element is not a setter, function
2698 * or method.
2699 */
2700 List<String> get parameterNames => _parameterNames;
2701
2702 /**
2703 * The names of the parameters of the function or method being suggested.
2704 * This field is omitted if the suggested element is not a setter, function
2705 * or method.
2706 */
2707 void set parameterNames(List<String> value) {
2708 this._parameterNames = value;
2709 }
2710
2711 /**
2712 * The types of the parameters of the function or method being suggested.
2713 * This field is omitted if the parameterNames field is omitted.
2714 */
2715 List<String> get parameterTypes => _parameterTypes;
2716
2717 /**
2718 * The types of the parameters of the function or method being suggested.
2719 * This field is omitted if the parameterNames field is omitted.
2720 */
2721 void set parameterTypes(List<String> value) {
2722 this._parameterTypes = value;
2723 }
2724
2725 /**
2726 * The number of required parameters for the function or method being
2727 * suggested. This field is omitted if the parameterNames field is omitted.
2728 */
2729 int get requiredParameterCount => _requiredParameterCount;
2730
2731 /**
2732 * The number of required parameters for the function or method being
2733 * suggested. This field is omitted if the parameterNames field is omitted.
2734 */
2735 void set requiredParameterCount(int value) {
2736 this._requiredParameterCount = value;
2737 }
2738
2739 /**
2740 * True if the function or method being suggested has at least one named
2741 * parameter. This field is omitted if the parameterNames field is omitted.
2742 */
2743 bool get hasNamedParameters => _hasNamedParameters;
2744
2745 /**
2746 * True if the function or method being suggested has at least one named
2747 * parameter. This field is omitted if the parameterNames field is omitted.
2748 */
2749 void set hasNamedParameters(bool value) {
2750 this._hasNamedParameters = value;
2751 }
2752
2753 /**
2754 * The name of the optional parameter being suggested. This field is omitted
2755 * if the suggestion is not the addition of an optional argument within an
2756 * argument list.
2757 */
2758 String get parameterName => _parameterName;
2759
2760 /**
2761 * The name of the optional parameter being suggested. This field is omitted
2762 * if the suggestion is not the addition of an optional argument within an
2763 * argument list.
2764 */
2765 void set parameterName(String value) {
2766 this._parameterName = value;
2767 }
2768
2769 /**
2770 * The type of the options parameter being suggested. This field is omitted
2771 * if the parameterName field is omitted.
2772 */
2773 String get parameterType => _parameterType;
2774
2775 /**
2776 * The type of the options parameter being suggested. This field is omitted
2777 * if the parameterName field is omitted.
2778 */
2779 void set parameterType(String value) {
2780 this._parameterType = value;
2781 }
2782
2783 /**
2784 * The import to be added if the suggestion is out of scope and needs an
2785 * import to be added to be in scope.
2786 */
2787 String get importUri => _importUri;
2788
2789 /**
2790 * The import to be added if the suggestion is out of scope and needs an
2791 * import to be added to be in scope.
2792 */
2793 void set importUri(String value) {
2794 this._importUri = value;
2795 }
2796
2797 CompletionSuggestion(CompletionSuggestionKind kind, int relevance, String comp letion, int selectionOffset, int selectionLength, bool isDeprecated, bool isPote ntial, {String docSummary, String docComplete, String declaringType, Element ele ment, String returnType, List<String> parameterNames, List<String> parameterType s, int requiredParameterCount, bool hasNamedParameters, String parameterName, St ring parameterType, String importUri}) {
2798 this.kind = kind;
2799 this.relevance = relevance;
2800 this.completion = completion;
2801 this.selectionOffset = selectionOffset;
2802 this.selectionLength = selectionLength;
2803 this.isDeprecated = isDeprecated;
2804 this.isPotential = isPotential;
2805 this.docSummary = docSummary;
2806 this.docComplete = docComplete;
2807 this.declaringType = declaringType;
2808 this.element = element;
2809 this.returnType = returnType;
2810 this.parameterNames = parameterNames;
2811 this.parameterTypes = parameterTypes;
2812 this.requiredParameterCount = requiredParameterCount;
2813 this.hasNamedParameters = hasNamedParameters;
2814 this.parameterName = parameterName;
2815 this.parameterType = parameterType;
2816 this.importUri = importUri;
2817 }
2818
2819 factory CompletionSuggestion.fromJson(JsonDecoder jsonDecoder, String jsonPath , Object json) {
2820 if (json == null) {
2821 json = {};
2822 }
2823 if (json is Map) {
2824 CompletionSuggestionKind kind;
2825 if (json.containsKey("kind")) {
2826 kind = new CompletionSuggestionKind.fromJson(jsonDecoder, jsonPath + ".k ind", json["kind"]);
2827 } else {
2828 throw jsonDecoder.mismatch(jsonPath, "kind");
2829 }
2830 int relevance;
2831 if (json.containsKey("relevance")) {
2832 relevance = jsonDecoder.decodeInt(jsonPath + ".relevance", json["relevan ce"]);
2833 } else {
2834 throw jsonDecoder.mismatch(jsonPath, "relevance");
2835 }
2836 String completion;
2837 if (json.containsKey("completion")) {
2838 completion = jsonDecoder.decodeString(jsonPath + ".completion", json["co mpletion"]);
2839 } else {
2840 throw jsonDecoder.mismatch(jsonPath, "completion");
2841 }
2842 int selectionOffset;
2843 if (json.containsKey("selectionOffset")) {
2844 selectionOffset = jsonDecoder.decodeInt(jsonPath + ".selectionOffset", j son["selectionOffset"]);
2845 } else {
2846 throw jsonDecoder.mismatch(jsonPath, "selectionOffset");
2847 }
2848 int selectionLength;
2849 if (json.containsKey("selectionLength")) {
2850 selectionLength = jsonDecoder.decodeInt(jsonPath + ".selectionLength", j son["selectionLength"]);
2851 } else {
2852 throw jsonDecoder.mismatch(jsonPath, "selectionLength");
2853 }
2854 bool isDeprecated;
2855 if (json.containsKey("isDeprecated")) {
2856 isDeprecated = jsonDecoder.decodeBool(jsonPath + ".isDeprecated", json[" isDeprecated"]);
2857 } else {
2858 throw jsonDecoder.mismatch(jsonPath, "isDeprecated");
2859 }
2860 bool isPotential;
2861 if (json.containsKey("isPotential")) {
2862 isPotential = jsonDecoder.decodeBool(jsonPath + ".isPotential", json["is Potential"]);
2863 } else {
2864 throw jsonDecoder.mismatch(jsonPath, "isPotential");
2865 }
2866 String docSummary;
2867 if (json.containsKey("docSummary")) {
2868 docSummary = jsonDecoder.decodeString(jsonPath + ".docSummary", json["do cSummary"]);
2869 }
2870 String docComplete;
2871 if (json.containsKey("docComplete")) {
2872 docComplete = jsonDecoder.decodeString(jsonPath + ".docComplete", json[" docComplete"]);
2873 }
2874 String declaringType;
2875 if (json.containsKey("declaringType")) {
2876 declaringType = jsonDecoder.decodeString(jsonPath + ".declaringType", js on["declaringType"]);
2877 }
2878 Element element;
2879 if (json.containsKey("element")) {
2880 element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json[ "element"]);
2881 }
2882 String returnType;
2883 if (json.containsKey("returnType")) {
2884 returnType = jsonDecoder.decodeString(jsonPath + ".returnType", json["re turnType"]);
2885 }
2886 List<String> parameterNames;
2887 if (json.containsKey("parameterNames")) {
2888 parameterNames = jsonDecoder.decodeList(jsonPath + ".parameterNames", js on["parameterNames"], jsonDecoder.decodeString);
2889 }
2890 List<String> parameterTypes;
2891 if (json.containsKey("parameterTypes")) {
2892 parameterTypes = jsonDecoder.decodeList(jsonPath + ".parameterTypes", js on["parameterTypes"], jsonDecoder.decodeString);
2893 }
2894 int requiredParameterCount;
2895 if (json.containsKey("requiredParameterCount")) {
2896 requiredParameterCount = jsonDecoder.decodeInt(jsonPath + ".requiredPara meterCount", json["requiredParameterCount"]);
2897 }
2898 bool hasNamedParameters;
2899 if (json.containsKey("hasNamedParameters")) {
2900 hasNamedParameters = jsonDecoder.decodeBool(jsonPath + ".hasNamedParamet ers", json["hasNamedParameters"]);
2901 }
2902 String parameterName;
2903 if (json.containsKey("parameterName")) {
2904 parameterName = jsonDecoder.decodeString(jsonPath + ".parameterName", js on["parameterName"]);
2905 }
2906 String parameterType;
2907 if (json.containsKey("parameterType")) {
2908 parameterType = jsonDecoder.decodeString(jsonPath + ".parameterType", js on["parameterType"]);
2909 }
2910 String importUri;
2911 if (json.containsKey("importUri")) {
2912 importUri = jsonDecoder.decodeString(jsonPath + ".importUri", json["impo rtUri"]);
2913 }
2914 return new CompletionSuggestion(kind, relevance, completion, selectionOffs et, selectionLength, isDeprecated, isPotential, docSummary: docSummary, docCompl ete: docComplete, declaringType: declaringType, element: element, returnType: re turnType, parameterNames: parameterNames, parameterTypes: parameterTypes, requir edParameterCount: requiredParameterCount, hasNamedParameters: hasNamedParameters , parameterName: parameterName, parameterType: parameterType, importUri: importU ri);
2915 } else {
2916 throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestion", json);
2917 }
2918 }
2919
2920 @override
2921 Map<String, dynamic> toJson() {
2922 Map<String, dynamic> result = {};
2923 result["kind"] = kind.toJson();
2924 result["relevance"] = relevance;
2925 result["completion"] = completion;
2926 result["selectionOffset"] = selectionOffset;
2927 result["selectionLength"] = selectionLength;
2928 result["isDeprecated"] = isDeprecated;
2929 result["isPotential"] = isPotential;
2930 if (docSummary != null) {
2931 result["docSummary"] = docSummary;
2932 }
2933 if (docComplete != null) {
2934 result["docComplete"] = docComplete;
2935 }
2936 if (declaringType != null) {
2937 result["declaringType"] = declaringType;
2938 }
2939 if (element != null) {
2940 result["element"] = element.toJson();
2941 }
2942 if (returnType != null) {
2943 result["returnType"] = returnType;
2944 }
2945 if (parameterNames != null) {
2946 result["parameterNames"] = parameterNames;
2947 }
2948 if (parameterTypes != null) {
2949 result["parameterTypes"] = parameterTypes;
2950 }
2951 if (requiredParameterCount != null) {
2952 result["requiredParameterCount"] = requiredParameterCount;
2953 }
2954 if (hasNamedParameters != null) {
2955 result["hasNamedParameters"] = hasNamedParameters;
2956 }
2957 if (parameterName != null) {
2958 result["parameterName"] = parameterName;
2959 }
2960 if (parameterType != null) {
2961 result["parameterType"] = parameterType;
2962 }
2963 if (importUri != null) {
2964 result["importUri"] = importUri;
2965 }
2966 return result;
2967 }
2968
2969 @override
2970 String toString() => JSON.encode(toJson());
2971
2972 @override
2973 bool operator==(other) {
2974 if (other is CompletionSuggestion) {
2975 return kind == other.kind &&
2976 relevance == other.relevance &&
2977 completion == other.completion &&
2978 selectionOffset == other.selectionOffset &&
2979 selectionLength == other.selectionLength &&
2980 isDeprecated == other.isDeprecated &&
2981 isPotential == other.isPotential &&
2982 docSummary == other.docSummary &&
2983 docComplete == other.docComplete &&
2984 declaringType == other.declaringType &&
2985 element == other.element &&
2986 returnType == other.returnType &&
2987 listEqual(parameterNames, other.parameterNames, (String a, String b) = > a == b) &&
2988 listEqual(parameterTypes, other.parameterTypes, (String a, String b) = > a == b) &&
2989 requiredParameterCount == other.requiredParameterCount &&
2990 hasNamedParameters == other.hasNamedParameters &&
2991 parameterName == other.parameterName &&
2992 parameterType == other.parameterType &&
2993 importUri == other.importUri;
2994 }
2995 return false;
2996 }
2997
2998 @override
2999 int get hashCode {
3000 int hash = 0;
3001 hash = JenkinsSmiHash.combine(hash, kind.hashCode);
3002 hash = JenkinsSmiHash.combine(hash, relevance.hashCode);
3003 hash = JenkinsSmiHash.combine(hash, completion.hashCode);
3004 hash = JenkinsSmiHash.combine(hash, selectionOffset.hashCode);
3005 hash = JenkinsSmiHash.combine(hash, selectionLength.hashCode);
3006 hash = JenkinsSmiHash.combine(hash, isDeprecated.hashCode);
3007 hash = JenkinsSmiHash.combine(hash, isPotential.hashCode);
3008 hash = JenkinsSmiHash.combine(hash, docSummary.hashCode);
3009 hash = JenkinsSmiHash.combine(hash, docComplete.hashCode);
3010 hash = JenkinsSmiHash.combine(hash, declaringType.hashCode);
3011 hash = JenkinsSmiHash.combine(hash, element.hashCode);
3012 hash = JenkinsSmiHash.combine(hash, returnType.hashCode);
3013 hash = JenkinsSmiHash.combine(hash, parameterNames.hashCode);
3014 hash = JenkinsSmiHash.combine(hash, parameterTypes.hashCode);
3015 hash = JenkinsSmiHash.combine(hash, requiredParameterCount.hashCode);
3016 hash = JenkinsSmiHash.combine(hash, hasNamedParameters.hashCode);
3017 hash = JenkinsSmiHash.combine(hash, parameterName.hashCode);
3018 hash = JenkinsSmiHash.combine(hash, parameterType.hashCode);
3019 hash = JenkinsSmiHash.combine(hash, importUri.hashCode);
3020 return JenkinsSmiHash.finish(hash);
3021 }
3022 }
3023
3024 /**
3025 * CompletionSuggestionKind
3026 *
3027 * enum {
3028 * ARGUMENT_LIST
3029 * IMPORT
3030 * IDENTIFIER
3031 * INVOCATION
3032 * KEYWORD
3033 * NAMED_ARGUMENT
3034 * OPTIONAL_ARGUMENT
3035 * PARAMETER
3036 * }
3037 *
3038 * Clients may not extend, implement or mix-in this class.
3039 */
3040 class CompletionSuggestionKind implements Enum {
3041 /**
3042 * A list of arguments for the method or function that is being invoked. For
3043 * this suggestion kind, the completion field is a textual representation of
3044 * the invocation and the parameterNames, parameterTypes, and
3045 * requiredParameterCount attributes are defined.
3046 */
3047 static const CompletionSuggestionKind ARGUMENT_LIST = const CompletionSuggesti onKind._("ARGUMENT_LIST");
3048
3049 static const CompletionSuggestionKind IMPORT = const CompletionSuggestionKind. _("IMPORT");
3050
3051 /**
3052 * The element identifier should be inserted at the completion location. For
3053 * example "someMethod" in import 'myLib.dart' show someMethod;. For
3054 * suggestions of this kind, the element attribute is defined and the
3055 * completion field is the element's identifier.
3056 */
3057 static const CompletionSuggestionKind IDENTIFIER = const CompletionSuggestionK ind._("IDENTIFIER");
3058
3059 /**
3060 * The element is being invoked at the completion location. For example,
3061 * 'someMethod' in x.someMethod();. For suggestions of this kind, the element
3062 * attribute is defined and the completion field is the element's identifier.
3063 */
3064 static const CompletionSuggestionKind INVOCATION = const CompletionSuggestionK ind._("INVOCATION");
3065
3066 /**
3067 * A keyword is being suggested. For suggestions of this kind, the completion
3068 * is the keyword.
3069 */
3070 static const CompletionSuggestionKind KEYWORD = const CompletionSuggestionKind ._("KEYWORD");
3071
3072 /**
3073 * A named argument for the current call site is being suggested. For
3074 * suggestions of this kind, the completion is the named argument identifier
3075 * including a trailing ':' and a space.
3076 */
3077 static const CompletionSuggestionKind NAMED_ARGUMENT = const CompletionSuggest ionKind._("NAMED_ARGUMENT");
3078
3079 static const CompletionSuggestionKind OPTIONAL_ARGUMENT = const CompletionSugg estionKind._("OPTIONAL_ARGUMENT");
3080
3081 static const CompletionSuggestionKind PARAMETER = const CompletionSuggestionKi nd._("PARAMETER");
3082
3083 /**
3084 * A list containing all of the enum values that are defined.
3085 */
3086 static const List<CompletionSuggestionKind> VALUES = const <CompletionSuggesti onKind>[ARGUMENT_LIST, IMPORT, IDENTIFIER, INVOCATION, KEYWORD, NAMED_ARGUMENT, OPTIONAL_ARGUMENT, PARAMETER];
3087
3088 @override
3089 final String name;
3090
3091 const CompletionSuggestionKind._(this.name);
3092
3093 factory CompletionSuggestionKind(String name) {
3094 switch (name) {
3095 case "ARGUMENT_LIST":
3096 return ARGUMENT_LIST;
3097 case "IMPORT":
3098 return IMPORT;
3099 case "IDENTIFIER":
3100 return IDENTIFIER;
3101 case "INVOCATION":
3102 return INVOCATION;
3103 case "KEYWORD":
3104 return KEYWORD;
3105 case "NAMED_ARGUMENT":
3106 return NAMED_ARGUMENT;
3107 case "OPTIONAL_ARGUMENT":
3108 return OPTIONAL_ARGUMENT;
3109 case "PARAMETER":
3110 return PARAMETER;
3111 }
3112 throw new Exception('Illegal enum value: $name');
3113 }
3114
3115 factory CompletionSuggestionKind.fromJson(JsonDecoder jsonDecoder, String json Path, Object json) {
3116 if (json is String) {
3117 try {
3118 return new CompletionSuggestionKind(json);
3119 } catch(_) {
3120 // Fall through
3121 }
3122 }
3123 throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestionKind", json);
3124 }
3125
3126 @override
3127 String toString() => "CompletionSuggestionKind.$name";
3128
3129 String toJson() => name;
3130 }
3131
3132 /**
3133 * ContextBuilderOptions
3134 *
3135 * {
3136 * "dartSdkSummaryPath": optional String
3137 * "defaultAnalysisOptionsFilePath": optional List<String>
3138 * "declaredVariables": optional Map<String, String>
3139 * "defaultPackageFilePath": optional List<String>
3140 * "defaultPackagesDirectoryPath": optional List<String>
3141 * }
3142 *
3143 * Clients may not extend, implement or mix-in this class.
3144 */
3145 class ContextBuilderOptions implements HasToJson {
3146 String _dartSdkSummaryPath;
3147
3148 List<String> _defaultAnalysisOptionsFilePath;
3149
3150 Map<String, String> _declaredVariables;
3151
3152 List<String> _defaultPackageFilePath;
3153
3154 List<String> _defaultPackagesDirectoryPath;
3155
3156 /**
3157 * The file path of the file containing the summary of the SDK that should be
3158 * used to "analyze" the SDK. The field will be omitted if the summary should
3159 * be found in the SDK.
3160 */
3161 String get dartSdkSummaryPath => _dartSdkSummaryPath;
3162
3163 /**
3164 * The file path of the file containing the summary of the SDK that should be
3165 * used to "analyze" the SDK. The field will be omitted if the summary should
3166 * be found in the SDK.
3167 */
3168 void set dartSdkSummaryPath(String value) {
3169 this._dartSdkSummaryPath = value;
3170 }
3171
3172 /**
3173 * The file path of the analysis options file that should be used in place of
3174 * any file in the root directory or a parent of the root directory. The
3175 * field will be omitted if the normal lookup mechanism should be used.
3176 */
3177 List<String> get defaultAnalysisOptionsFilePath => _defaultAnalysisOptionsFile Path;
3178
3179 /**
3180 * The file path of the analysis options file that should be used in place of
3181 * any file in the root directory or a parent of the root directory. The
3182 * field will be omitted if the normal lookup mechanism should be used.
3183 */
3184 void set defaultAnalysisOptionsFilePath(List<String> value) {
3185 this._defaultAnalysisOptionsFilePath = value;
3186 }
3187
3188 /**
3189 * A table mapping variable names to values for the declared variables. The
3190 * field will be omitted if no additional variables need to be declared.
3191 */
3192 Map<String, String> get declaredVariables => _declaredVariables;
3193
3194 /**
3195 * A table mapping variable names to values for the declared variables. The
3196 * field will be omitted if no additional variables need to be declared.
3197 */
3198 void set declaredVariables(Map<String, String> value) {
3199 this._declaredVariables = value;
3200 }
3201
3202 /**
3203 * The file path of the .packages file that should be used in place of any
3204 * file found using the normal (Package Specification DEP) lookup mechanism.
3205 * The field will be omitted if the normal lookup mechanism should be used.
3206 */
3207 List<String> get defaultPackageFilePath => _defaultPackageFilePath;
3208
3209 /**
3210 * The file path of the .packages file that should be used in place of any
3211 * file found using the normal (Package Specification DEP) lookup mechanism.
3212 * The field will be omitted if the normal lookup mechanism should be used.
3213 */
3214 void set defaultPackageFilePath(List<String> value) {
3215 this._defaultPackageFilePath = value;
3216 }
3217
3218 /**
3219 * The file path of the packages directory that should be used in place of
3220 * any file found using the normal (Package Specification DEP) lookup
3221 * mechanism. The field will be omitted if the normal lookup mechanism should
3222 * be used.
3223 */
3224 List<String> get defaultPackagesDirectoryPath => _defaultPackagesDirectoryPath ;
3225
3226 /**
3227 * The file path of the packages directory that should be used in place of
3228 * any file found using the normal (Package Specification DEP) lookup
3229 * mechanism. The field will be omitted if the normal lookup mechanism should
3230 * be used.
3231 */
3232 void set defaultPackagesDirectoryPath(List<String> value) {
3233 this._defaultPackagesDirectoryPath = value;
3234 }
3235
3236 ContextBuilderOptions({String dartSdkSummaryPath, List<String> defaultAnalysis OptionsFilePath, Map<String, String> declaredVariables, List<String> defaultPack ageFilePath, List<String> defaultPackagesDirectoryPath}) {
3237 this.dartSdkSummaryPath = dartSdkSummaryPath;
3238 this.defaultAnalysisOptionsFilePath = defaultAnalysisOptionsFilePath;
3239 this.declaredVariables = declaredVariables;
3240 this.defaultPackageFilePath = defaultPackageFilePath;
3241 this.defaultPackagesDirectoryPath = defaultPackagesDirectoryPath;
3242 }
3243
3244 factory ContextBuilderOptions.fromJson(JsonDecoder jsonDecoder, String jsonPat h, Object json) {
3245 if (json == null) {
3246 json = {};
3247 }
3248 if (json is Map) {
3249 String dartSdkSummaryPath;
3250 if (json.containsKey("dartSdkSummaryPath")) {
3251 dartSdkSummaryPath = jsonDecoder.decodeString(jsonPath + ".dartSdkSummar yPath", json["dartSdkSummaryPath"]);
3252 }
3253 List<String> defaultAnalysisOptionsFilePath;
3254 if (json.containsKey("defaultAnalysisOptionsFilePath")) {
3255 defaultAnalysisOptionsFilePath = jsonDecoder.decodeList(jsonPath + ".def aultAnalysisOptionsFilePath", json["defaultAnalysisOptionsFilePath"], jsonDecode r.decodeString);
3256 }
3257 Map<String, String> declaredVariables;
3258 if (json.containsKey("declaredVariables")) {
3259 declaredVariables = jsonDecoder.decodeMap(jsonPath + ".declaredVariables ", json["declaredVariables"], valueDecoder: jsonDecoder.decodeString);
3260 }
3261 List<String> defaultPackageFilePath;
3262 if (json.containsKey("defaultPackageFilePath")) {
3263 defaultPackageFilePath = jsonDecoder.decodeList(jsonPath + ".defaultPack ageFilePath", json["defaultPackageFilePath"], jsonDecoder.decodeString);
3264 }
3265 List<String> defaultPackagesDirectoryPath;
3266 if (json.containsKey("defaultPackagesDirectoryPath")) {
3267 defaultPackagesDirectoryPath = jsonDecoder.decodeList(jsonPath + ".defau ltPackagesDirectoryPath", json["defaultPackagesDirectoryPath"], jsonDecoder.deco deString);
3268 }
3269 return new ContextBuilderOptions(dartSdkSummaryPath: dartSdkSummaryPath, d efaultAnalysisOptionsFilePath: defaultAnalysisOptionsFilePath, declaredVariables : declaredVariables, defaultPackageFilePath: defaultPackageFilePath, defaultPack agesDirectoryPath: defaultPackagesDirectoryPath);
3270 } else {
3271 throw jsonDecoder.mismatch(jsonPath, "ContextBuilderOptions", json);
3272 }
3273 }
3274
3275 @override
3276 Map<String, dynamic> toJson() {
3277 Map<String, dynamic> result = {};
3278 if (dartSdkSummaryPath != null) {
3279 result["dartSdkSummaryPath"] = dartSdkSummaryPath;
3280 }
3281 if (defaultAnalysisOptionsFilePath != null) {
3282 result["defaultAnalysisOptionsFilePath"] = defaultAnalysisOptionsFilePath;
3283 }
3284 if (declaredVariables != null) {
3285 result["declaredVariables"] = declaredVariables;
3286 }
3287 if (defaultPackageFilePath != null) {
3288 result["defaultPackageFilePath"] = defaultPackageFilePath;
3289 }
3290 if (defaultPackagesDirectoryPath != null) {
3291 result["defaultPackagesDirectoryPath"] = defaultPackagesDirectoryPath;
3292 }
3293 return result;
3294 }
3295
3296 @override
3297 String toString() => JSON.encode(toJson());
3298
3299 @override
3300 bool operator==(other) {
3301 if (other is ContextBuilderOptions) {
3302 return dartSdkSummaryPath == other.dartSdkSummaryPath &&
3303 listEqual(defaultAnalysisOptionsFilePath, other.defaultAnalysisOptions FilePath, (String a, String b) => a == b) &&
3304 mapEqual(declaredVariables, other.declaredVariables, (String a, String b) => a == b) &&
3305 listEqual(defaultPackageFilePath, other.defaultPackageFilePath, (Strin g a, String b) => a == b) &&
3306 listEqual(defaultPackagesDirectoryPath, other.defaultPackagesDirectory Path, (String a, String b) => a == b);
3307 }
3308 return false;
3309 }
3310
3311 @override
3312 int get hashCode {
3313 int hash = 0;
3314 hash = JenkinsSmiHash.combine(hash, dartSdkSummaryPath.hashCode);
3315 hash = JenkinsSmiHash.combine(hash, defaultAnalysisOptionsFilePath.hashCode) ;
3316 hash = JenkinsSmiHash.combine(hash, declaredVariables.hashCode);
3317 hash = JenkinsSmiHash.combine(hash, defaultPackageFilePath.hashCode);
3318 hash = JenkinsSmiHash.combine(hash, defaultPackagesDirectoryPath.hashCode);
3319 return JenkinsSmiHash.finish(hash);
3320 }
3321 }
3322
3323 /**
3324 * ContextRoot
3325 *
3326 * {
3327 * "root": String
3328 * "exclude": List<String>
3329 * }
3330 *
3331 * Clients may not extend, implement or mix-in this class.
3332 */
3333 class ContextRoot implements HasToJson {
3334 String _root;
3335
3336 List<String> _exclude;
3337
3338 /**
3339 * The absolute path of the root directory containing the files to be
3340 * analyzed.
3341 */
3342 String get root => _root;
3343
3344 /**
3345 * The absolute path of the root directory containing the files to be
3346 * analyzed.
3347 */
3348 void set root(String value) {
3349 assert(value != null);
3350 this._root = value;
3351 }
3352
3353 /**
3354 * A list of the absolute paths of files and directories within the root
3355 * directory that should not be analyzed.
3356 */
3357 List<String> get exclude => _exclude;
3358
3359 /**
3360 * A list of the absolute paths of files and directories within the root
3361 * directory that should not be analyzed.
3362 */
3363 void set exclude(List<String> value) {
3364 assert(value != null);
3365 this._exclude = value;
3366 }
3367
3368 ContextRoot(String root, List<String> exclude) {
3369 this.root = root;
3370 this.exclude = exclude;
3371 }
3372
3373 factory ContextRoot.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
3374 if (json == null) {
3375 json = {};
3376 }
3377 if (json is Map) {
3378 String root;
3379 if (json.containsKey("root")) {
3380 root = jsonDecoder.decodeString(jsonPath + ".root", json["root"]);
3381 } else {
3382 throw jsonDecoder.mismatch(jsonPath, "root");
3383 }
3384 List<String> exclude;
3385 if (json.containsKey("exclude")) {
3386 exclude = jsonDecoder.decodeList(jsonPath + ".exclude", json["exclude"], jsonDecoder.decodeString);
3387 } else {
3388 throw jsonDecoder.mismatch(jsonPath, "exclude");
3389 }
3390 return new ContextRoot(root, exclude);
3391 } else {
3392 throw jsonDecoder.mismatch(jsonPath, "ContextRoot", json);
3393 }
3394 }
3395
3396 @override
3397 Map<String, dynamic> toJson() {
3398 Map<String, dynamic> result = {};
3399 result["root"] = root;
3400 result["exclude"] = exclude;
3401 return result;
3402 }
3403
3404 @override
3405 String toString() => JSON.encode(toJson());
3406
3407 @override
3408 bool operator==(other) {
3409 if (other is ContextRoot) {
3410 return root == other.root &&
3411 listEqual(exclude, other.exclude, (String a, String b) => a == b);
3412 }
3413 return false;
3414 }
3415
3416 @override
3417 int get hashCode {
3418 int hash = 0;
3419 hash = JenkinsSmiHash.combine(hash, root.hashCode);
3420 hash = JenkinsSmiHash.combine(hash, exclude.hashCode);
3421 return JenkinsSmiHash.finish(hash);
3422 }
3423 }
3424
3425 /**
3426 * convertGetterToMethod feedback
3427 *
3428 * Clients may not extend, implement or mix-in this class.
3429 */
3430 class ConvertGetterToMethodFeedback extends RefactoringFeedback implements HasTo Json {
3431 @override
3432 bool operator==(other) {
3433 if (other is ConvertGetterToMethodFeedback) {
3434 return true;
3435 }
3436 return false;
3437 }
3438
3439 @override
3440 int get hashCode {
3441 return 616032599;
3442 }
3443 }
3444
3445 /**
3446 * convertGetterToMethod options
3447 *
3448 * Clients may not extend, implement or mix-in this class.
3449 */
3450 class ConvertGetterToMethodOptions extends RefactoringOptions implements HasToJs on {
3451 @override
3452 bool operator==(other) {
3453 if (other is ConvertGetterToMethodOptions) {
3454 return true;
3455 }
3456 return false;
3457 }
3458
3459 @override
3460 int get hashCode {
3461 return 488848400;
3462 }
3463 }
3464
3465 /**
3466 * convertMethodToGetter feedback
3467 *
3468 * Clients may not extend, implement or mix-in this class.
3469 */
3470 class ConvertMethodToGetterFeedback extends RefactoringFeedback implements HasTo Json {
3471 @override
3472 bool operator==(other) {
3473 if (other is ConvertMethodToGetterFeedback) {
3474 return true;
3475 }
3476 return false;
3477 }
3478
3479 @override
3480 int get hashCode {
3481 return 165291526;
3482 }
3483 }
3484
3485 /**
3486 * convertMethodToGetter options
3487 *
3488 * Clients may not extend, implement or mix-in this class.
3489 */
3490 class ConvertMethodToGetterOptions extends RefactoringOptions implements HasToJs on {
3491 @override
3492 bool operator==(other) {
3493 if (other is ConvertMethodToGetterOptions) {
3494 return true;
3495 }
3496 return false;
3497 }
3498
3499 @override
3500 int get hashCode {
3501 return 27952290;
3502 }
3503 }
3504
3505 /**
3506 * edit.getAssists params
3507 *
3508 * {
3509 * "file": FilePath
3510 * "offset": int
3511 * "length": int
3512 * }
3513 *
3514 * Clients may not extend, implement or mix-in this class.
3515 */
3516 class EditGetAssistsParams implements HasToJson {
3517 String _file;
3518
3519 int _offset;
3520
3521 int _length;
3522
3523 /**
3524 * The file containing the code for which assists are being requested.
3525 */
3526 String get file => _file;
3527
3528 /**
3529 * The file containing the code for which assists are being requested.
3530 */
3531 void set file(String value) {
3532 assert(value != null);
3533 this._file = value;
3534 }
3535
3536 /**
3537 * The offset of the code for which assists are being requested.
3538 */
3539 int get offset => _offset;
3540
3541 /**
3542 * The offset of the code for which assists are being requested.
3543 */
3544 void set offset(int value) {
3545 assert(value != null);
3546 this._offset = value;
3547 }
3548
3549 /**
3550 * The length of the code for which assists are being requested.
3551 */
3552 int get length => _length;
3553
3554 /**
3555 * The length of the code for which assists are being requested.
3556 */
3557 void set length(int value) {
3558 assert(value != null);
3559 this._length = value;
3560 }
3561
3562 EditGetAssistsParams(String file, int offset, int length) {
3563 this.file = file;
3564 this.offset = offset;
3565 this.length = length;
3566 }
3567
3568 factory EditGetAssistsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath , Object json) {
3569 if (json == null) {
3570 json = {};
3571 }
3572 if (json is Map) {
3573 String file;
3574 if (json.containsKey("file")) {
3575 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
3576 } else {
3577 throw jsonDecoder.mismatch(jsonPath, "file");
3578 }
3579 int offset;
3580 if (json.containsKey("offset")) {
3581 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
3582 } else {
3583 throw jsonDecoder.mismatch(jsonPath, "offset");
3584 }
3585 int length;
3586 if (json.containsKey("length")) {
3587 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
3588 } else {
3589 throw jsonDecoder.mismatch(jsonPath, "length");
3590 }
3591 return new EditGetAssistsParams(file, offset, length);
3592 } else {
3593 throw jsonDecoder.mismatch(jsonPath, "edit.getAssists params", json);
3594 }
3595 }
3596
3597 factory EditGetAssistsParams.fromRequest(Request request) {
3598 return new EditGetAssistsParams.fromJson(
3599 new RequestDecoder(request), "params", request.params);
3600 }
3601
3602 @override
3603 Map<String, dynamic> toJson() {
3604 Map<String, dynamic> result = {};
3605 result["file"] = file;
3606 result["offset"] = offset;
3607 result["length"] = length;
3608 return result;
3609 }
3610
3611 Request toRequest(String id) {
3612 return new Request(id, "edit.getAssists", toJson());
3613 }
3614
3615 @override
3616 String toString() => JSON.encode(toJson());
3617
3618 @override
3619 bool operator==(other) {
3620 if (other is EditGetAssistsParams) {
3621 return file == other.file &&
3622 offset == other.offset &&
3623 length == other.length;
3624 }
3625 return false;
3626 }
3627
3628 @override
3629 int get hashCode {
3630 int hash = 0;
3631 hash = JenkinsSmiHash.combine(hash, file.hashCode);
3632 hash = JenkinsSmiHash.combine(hash, offset.hashCode);
3633 hash = JenkinsSmiHash.combine(hash, length.hashCode);
3634 return JenkinsSmiHash.finish(hash);
3635 }
3636 }
3637
3638 /**
3639 * edit.getAssists result
3640 *
3641 * {
3642 * "assists": List<SourceChange>
3643 * }
3644 *
3645 * Clients may not extend, implement or mix-in this class.
3646 */
3647 class EditGetAssistsResult implements ResponseResult {
3648 List<SourceChange> _assists;
3649
3650 /**
3651 * The assists that are available at the given location.
3652 */
3653 List<SourceChange> get assists => _assists;
3654
3655 /**
3656 * The assists that are available at the given location.
3657 */
3658 void set assists(List<SourceChange> value) {
3659 assert(value != null);
3660 this._assists = value;
3661 }
3662
3663 EditGetAssistsResult(List<SourceChange> assists) {
3664 this.assists = assists;
3665 }
3666
3667 factory EditGetAssistsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath , Object json) {
3668 if (json == null) {
3669 json = {};
3670 }
3671 if (json is Map) {
3672 List<SourceChange> assists;
3673 if (json.containsKey("assists")) {
3674 assists = jsonDecoder.decodeList(jsonPath + ".assists", json["assists"], (String jsonPath, Object json) => new SourceChange.fromJson(jsonDecoder, jsonPa th, json));
3675 } else {
3676 throw jsonDecoder.mismatch(jsonPath, "assists");
3677 }
3678 return new EditGetAssistsResult(assists);
3679 } else {
3680 throw jsonDecoder.mismatch(jsonPath, "edit.getAssists result", json);
3681 }
3682 }
3683
3684 factory EditGetAssistsResult.fromResponse(Response response) {
3685 return new EditGetAssistsResult.fromJson(
3686 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), " result", response.result);
3687 }
3688
3689 @override
3690 Map<String, dynamic> toJson() {
3691 Map<String, dynamic> result = {};
3692 result["assists"] = assists.map((SourceChange value) => value.toJson()).toLi st();
3693 return result;
3694 }
3695
3696 @override
3697 Response toResponse(String id) {
3698 return new Response(id, result: toJson());
3699 }
3700
3701 @override
3702 String toString() => JSON.encode(toJson());
3703
3704 @override
3705 bool operator==(other) {
3706 if (other is EditGetAssistsResult) {
3707 return listEqual(assists, other.assists, (SourceChange a, SourceChange b) => a == b);
3708 }
3709 return false;
3710 }
3711
3712 @override
3713 int get hashCode {
3714 int hash = 0;
3715 hash = JenkinsSmiHash.combine(hash, assists.hashCode);
3716 return JenkinsSmiHash.finish(hash);
3717 }
3718 }
3719
3720 /**
3721 * edit.getAvailableRefactorings params
3722 *
3723 * {
3724 * "file": FilePath
3725 * "offset": int
3726 * "length": int
3727 * }
3728 *
3729 * Clients may not extend, implement or mix-in this class.
3730 */
3731 class EditGetAvailableRefactoringsParams implements HasToJson {
3732 String _file;
3733
3734 int _offset;
3735
3736 int _length;
3737
3738 /**
3739 * The file containing the code on which the refactoring would be based.
3740 */
3741 String get file => _file;
3742
3743 /**
3744 * The file containing the code on which the refactoring would be based.
3745 */
3746 void set file(String value) {
3747 assert(value != null);
3748 this._file = value;
3749 }
3750
3751 /**
3752 * The offset of the code on which the refactoring would be based.
3753 */
3754 int get offset => _offset;
3755
3756 /**
3757 * The offset of the code on which the refactoring would be based.
3758 */
3759 void set offset(int value) {
3760 assert(value != null);
3761 this._offset = value;
3762 }
3763
3764 /**
3765 * The length of the code on which the refactoring would be based.
3766 */
3767 int get length => _length;
3768
3769 /**
3770 * The length of the code on which the refactoring would be based.
3771 */
3772 void set length(int value) {
3773 assert(value != null);
3774 this._length = value;
3775 }
3776
3777 EditGetAvailableRefactoringsParams(String file, int offset, int length) {
3778 this.file = file;
3779 this.offset = offset;
3780 this.length = length;
3781 }
3782
3783 factory EditGetAvailableRefactoringsParams.fromJson(JsonDecoder jsonDecoder, S tring jsonPath, Object json) {
3784 if (json == null) {
3785 json = {};
3786 }
3787 if (json is Map) {
3788 String file;
3789 if (json.containsKey("file")) {
3790 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
3791 } else {
3792 throw jsonDecoder.mismatch(jsonPath, "file");
3793 }
3794 int offset;
3795 if (json.containsKey("offset")) {
3796 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
3797 } else {
3798 throw jsonDecoder.mismatch(jsonPath, "offset");
3799 }
3800 int length;
3801 if (json.containsKey("length")) {
3802 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
3803 } else {
3804 throw jsonDecoder.mismatch(jsonPath, "length");
3805 }
3806 return new EditGetAvailableRefactoringsParams(file, offset, length);
3807 } else {
3808 throw jsonDecoder.mismatch(jsonPath, "edit.getAvailableRefactorings params ", json);
3809 }
3810 }
3811
3812 factory EditGetAvailableRefactoringsParams.fromRequest(Request request) {
3813 return new EditGetAvailableRefactoringsParams.fromJson(
3814 new RequestDecoder(request), "params", request.params);
3815 }
3816
3817 @override
3818 Map<String, dynamic> toJson() {
3819 Map<String, dynamic> result = {};
3820 result["file"] = file;
3821 result["offset"] = offset;
3822 result["length"] = length;
3823 return result;
3824 }
3825
3826 Request toRequest(String id) {
3827 return new Request(id, "edit.getAvailableRefactorings", toJson());
3828 }
3829
3830 @override
3831 String toString() => JSON.encode(toJson());
3832
3833 @override
3834 bool operator==(other) {
3835 if (other is EditGetAvailableRefactoringsParams) {
3836 return file == other.file &&
3837 offset == other.offset &&
3838 length == other.length;
3839 }
3840 return false;
3841 }
3842
3843 @override
3844 int get hashCode {
3845 int hash = 0;
3846 hash = JenkinsSmiHash.combine(hash, file.hashCode);
3847 hash = JenkinsSmiHash.combine(hash, offset.hashCode);
3848 hash = JenkinsSmiHash.combine(hash, length.hashCode);
3849 return JenkinsSmiHash.finish(hash);
3850 }
3851 }
3852
3853 /**
3854 * edit.getAvailableRefactorings result
3855 *
3856 * {
3857 * "kinds": List<RefactoringKind>
3858 * }
3859 *
3860 * Clients may not extend, implement or mix-in this class.
3861 */
3862 class EditGetAvailableRefactoringsResult implements ResponseResult {
3863 List<RefactoringKind> _kinds;
3864
3865 /**
3866 * The kinds of refactorings that are valid for the given selection.
3867 *
3868 * The list of refactoring kinds is currently limited to those defined by the
3869 * server API, preventing plugins from adding their own refactorings.
3870 * However, plugins can support pre-defined refactorings, such as a rename
3871 * refactoring, at locations not supported by server.
3872 */
3873 List<RefactoringKind> get kinds => _kinds;
3874
3875 /**
3876 * The kinds of refactorings that are valid for the given selection.
3877 *
3878 * The list of refactoring kinds is currently limited to those defined by the
3879 * server API, preventing plugins from adding their own refactorings.
3880 * However, plugins can support pre-defined refactorings, such as a rename
3881 * refactoring, at locations not supported by server.
3882 */
3883 void set kinds(List<RefactoringKind> value) {
3884 assert(value != null);
3885 this._kinds = value;
3886 }
3887
3888 EditGetAvailableRefactoringsResult(List<RefactoringKind> kinds) {
3889 this.kinds = kinds;
3890 }
3891
3892 factory EditGetAvailableRefactoringsResult.fromJson(JsonDecoder jsonDecoder, S tring jsonPath, Object json) {
3893 if (json == null) {
3894 json = {};
3895 }
3896 if (json is Map) {
3897 List<RefactoringKind> kinds;
3898 if (json.containsKey("kinds")) {
3899 kinds = jsonDecoder.decodeList(jsonPath + ".kinds", json["kinds"], (Stri ng jsonPath, Object json) => new RefactoringKind.fromJson(jsonDecoder, jsonPath, json));
3900 } else {
3901 throw jsonDecoder.mismatch(jsonPath, "kinds");
3902 }
3903 return new EditGetAvailableRefactoringsResult(kinds);
3904 } else {
3905 throw jsonDecoder.mismatch(jsonPath, "edit.getAvailableRefactorings result ", json);
3906 }
3907 }
3908
3909 factory EditGetAvailableRefactoringsResult.fromResponse(Response response) {
3910 return new EditGetAvailableRefactoringsResult.fromJson(
3911 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), " result", response.result);
3912 }
3913
3914 @override
3915 Map<String, dynamic> toJson() {
3916 Map<String, dynamic> result = {};
3917 result["kinds"] = kinds.map((RefactoringKind value) => value.toJson()).toLis t();
3918 return result;
3919 }
3920
3921 @override
3922 Response toResponse(String id) {
3923 return new Response(id, result: toJson());
3924 }
3925
3926 @override
3927 String toString() => JSON.encode(toJson());
3928
3929 @override
3930 bool operator==(other) {
3931 if (other is EditGetAvailableRefactoringsResult) {
3932 return listEqual(kinds, other.kinds, (RefactoringKind a, RefactoringKind b ) => a == b);
3933 }
3934 return false;
3935 }
3936
3937 @override
3938 int get hashCode {
3939 int hash = 0;
3940 hash = JenkinsSmiHash.combine(hash, kinds.hashCode);
3941 return JenkinsSmiHash.finish(hash);
3942 }
3943 }
3944
3945 /**
3946 * edit.getFixes params
3947 *
3948 * {
3949 * "file": FilePath
3950 * "offset": int
3951 * }
3952 *
3953 * Clients may not extend, implement or mix-in this class.
3954 */
3955 class EditGetFixesParams implements HasToJson {
3956 String _file;
3957
3958 int _offset;
3959
3960 /**
3961 * The file containing the errors for which fixes are being requested.
3962 */
3963 String get file => _file;
3964
3965 /**
3966 * The file containing the errors for which fixes are being requested.
3967 */
3968 void set file(String value) {
3969 assert(value != null);
3970 this._file = value;
3971 }
3972
3973 /**
3974 * The offset used to select the errors for which fixes will be returned.
3975 */
3976 int get offset => _offset;
3977
3978 /**
3979 * The offset used to select the errors for which fixes will be returned.
3980 */
3981 void set offset(int value) {
3982 assert(value != null);
3983 this._offset = value;
3984 }
3985
3986 EditGetFixesParams(String file, int offset) {
3987 this.file = file;
3988 this.offset = offset;
3989 }
3990
3991 factory EditGetFixesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
3992 if (json == null) {
3993 json = {};
3994 }
3995 if (json is Map) {
3996 String file;
3997 if (json.containsKey("file")) {
3998 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
3999 } else {
4000 throw jsonDecoder.mismatch(jsonPath, "file");
4001 }
4002 int offset;
4003 if (json.containsKey("offset")) {
4004 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
4005 } else {
4006 throw jsonDecoder.mismatch(jsonPath, "offset");
4007 }
4008 return new EditGetFixesParams(file, offset);
4009 } else {
4010 throw jsonDecoder.mismatch(jsonPath, "edit.getFixes params", json);
4011 }
4012 }
4013
4014 factory EditGetFixesParams.fromRequest(Request request) {
4015 return new EditGetFixesParams.fromJson(
4016 new RequestDecoder(request), "params", request.params);
4017 }
4018
4019 @override
4020 Map<String, dynamic> toJson() {
4021 Map<String, dynamic> result = {};
4022 result["file"] = file;
4023 result["offset"] = offset;
4024 return result;
4025 }
4026
4027 Request toRequest(String id) {
4028 return new Request(id, "edit.getFixes", toJson());
4029 }
4030
4031 @override
4032 String toString() => JSON.encode(toJson());
4033
4034 @override
4035 bool operator==(other) {
4036 if (other is EditGetFixesParams) {
4037 return file == other.file &&
4038 offset == other.offset;
4039 }
4040 return false;
4041 }
4042
4043 @override
4044 int get hashCode {
4045 int hash = 0;
4046 hash = JenkinsSmiHash.combine(hash, file.hashCode);
4047 hash = JenkinsSmiHash.combine(hash, offset.hashCode);
4048 return JenkinsSmiHash.finish(hash);
4049 }
4050 }
4051
4052 /**
4053 * edit.getFixes result
4054 *
4055 * {
4056 * "fixes": List<AnalysisErrorFixes>
4057 * }
4058 *
4059 * Clients may not extend, implement or mix-in this class.
4060 */
4061 class EditGetFixesResult implements ResponseResult {
4062 List<AnalysisErrorFixes> _fixes;
4063
4064 /**
4065 * The fixes that are available for the errors at the given offset.
4066 */
4067 List<AnalysisErrorFixes> get fixes => _fixes;
4068
4069 /**
4070 * The fixes that are available for the errors at the given offset.
4071 */
4072 void set fixes(List<AnalysisErrorFixes> value) {
4073 assert(value != null);
4074 this._fixes = value;
4075 }
4076
4077 EditGetFixesResult(List<AnalysisErrorFixes> fixes) {
4078 this.fixes = fixes;
4079 }
4080
4081 factory EditGetFixesResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
4082 if (json == null) {
4083 json = {};
4084 }
4085 if (json is Map) {
4086 List<AnalysisErrorFixes> fixes;
4087 if (json.containsKey("fixes")) {
4088 fixes = jsonDecoder.decodeList(jsonPath + ".fixes", json["fixes"], (Stri ng jsonPath, Object json) => new AnalysisErrorFixes.fromJson(jsonDecoder, jsonPa th, json));
4089 } else {
4090 throw jsonDecoder.mismatch(jsonPath, "fixes");
4091 }
4092 return new EditGetFixesResult(fixes);
4093 } else {
4094 throw jsonDecoder.mismatch(jsonPath, "edit.getFixes result", json);
4095 }
4096 }
4097
4098 factory EditGetFixesResult.fromResponse(Response response) {
4099 return new EditGetFixesResult.fromJson(
4100 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), " result", response.result);
4101 }
4102
4103 @override
4104 Map<String, dynamic> toJson() {
4105 Map<String, dynamic> result = {};
4106 result["fixes"] = fixes.map((AnalysisErrorFixes value) => value.toJson()).to List();
4107 return result;
4108 }
4109
4110 @override
4111 Response toResponse(String id) {
4112 return new Response(id, result: toJson());
4113 }
4114
4115 @override
4116 String toString() => JSON.encode(toJson());
4117
4118 @override
4119 bool operator==(other) {
4120 if (other is EditGetFixesResult) {
4121 return listEqual(fixes, other.fixes, (AnalysisErrorFixes a, AnalysisErrorF ixes b) => a == b);
4122 }
4123 return false;
4124 }
4125
4126 @override
4127 int get hashCode {
4128 int hash = 0;
4129 hash = JenkinsSmiHash.combine(hash, fixes.hashCode);
4130 return JenkinsSmiHash.finish(hash);
4131 }
4132 }
4133
4134 /**
4135 * edit.getRefactoring params
4136 *
4137 * {
4138 * "kind": RefactoringKind
4139 * "file": FilePath
4140 * "offset": int
4141 * "length": int
4142 * "validateOnly": bool
4143 * "options": optional RefactoringOptions
4144 * }
4145 *
4146 * Clients may not extend, implement or mix-in this class.
4147 */
4148 class EditGetRefactoringParams implements HasToJson {
4149 RefactoringKind _kind;
4150
4151 String _file;
4152
4153 int _offset;
4154
4155 int _length;
4156
4157 bool _validateOnly;
4158
4159 RefactoringOptions _options;
4160
4161 /**
4162 * The kind of refactoring to be performed.
4163 */
4164 RefactoringKind get kind => _kind;
4165
4166 /**
4167 * The kind of refactoring to be performed.
4168 */
4169 void set kind(RefactoringKind value) {
4170 assert(value != null);
4171 this._kind = value;
4172 }
4173
4174 /**
4175 * The file containing the code involved in the refactoring.
4176 */
4177 String get file => _file;
4178
4179 /**
4180 * The file containing the code involved in the refactoring.
4181 */
4182 void set file(String value) {
4183 assert(value != null);
4184 this._file = value;
4185 }
4186
4187 /**
4188 * The offset of the region involved in the refactoring.
4189 */
4190 int get offset => _offset;
4191
4192 /**
4193 * The offset of the region involved in the refactoring.
4194 */
4195 void set offset(int value) {
4196 assert(value != null);
4197 this._offset = value;
4198 }
4199
4200 /**
4201 * The length of the region involved in the refactoring.
4202 */
4203 int get length => _length;
4204
4205 /**
4206 * The length of the region involved in the refactoring.
4207 */
4208 void set length(int value) {
4209 assert(value != null);
4210 this._length = value;
4211 }
4212
4213 /**
4214 * True if the client is only requesting that the values of the options be
4215 * validated and no change be generated.
4216 */
4217 bool get validateOnly => _validateOnly;
4218
4219 /**
4220 * True if the client is only requesting that the values of the options be
4221 * validated and no change be generated.
4222 */
4223 void set validateOnly(bool value) {
4224 assert(value != null);
4225 this._validateOnly = value;
4226 }
4227
4228 /**
4229 * Data used to provide values provided by the user. The structure of the
4230 * data is dependent on the kind of refactoring being performed. The data
4231 * that is expected is documented in the section titled Refactorings, labeled
4232 * as "Options". This field can be omitted if the refactoring does not
4233 * require any options or if the values of those options are not known.
4234 */
4235 RefactoringOptions get options => _options;
4236
4237 /**
4238 * Data used to provide values provided by the user. The structure of the
4239 * data is dependent on the kind of refactoring being performed. The data
4240 * that is expected is documented in the section titled Refactorings, labeled
4241 * as "Options". This field can be omitted if the refactoring does not
4242 * require any options or if the values of those options are not known.
4243 */
4244 void set options(RefactoringOptions value) {
4245 this._options = value;
4246 }
4247
4248 EditGetRefactoringParams(RefactoringKind kind, String file, int offset, int le ngth, bool validateOnly, {RefactoringOptions options}) {
4249 this.kind = kind;
4250 this.file = file;
4251 this.offset = offset;
4252 this.length = length;
4253 this.validateOnly = validateOnly;
4254 this.options = options;
4255 }
4256
4257 factory EditGetRefactoringParams.fromJson(JsonDecoder jsonDecoder, String json Path, Object json) {
4258 if (json == null) {
4259 json = {};
4260 }
4261 if (json is Map) {
4262 RefactoringKind kind;
4263 if (json.containsKey("kind")) {
4264 kind = new RefactoringKind.fromJson(jsonDecoder, jsonPath + ".kind", jso n["kind"]);
4265 } else {
4266 throw jsonDecoder.mismatch(jsonPath, "kind");
4267 }
4268 String file;
4269 if (json.containsKey("file")) {
4270 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
4271 } else {
4272 throw jsonDecoder.mismatch(jsonPath, "file");
4273 }
4274 int offset;
4275 if (json.containsKey("offset")) {
4276 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
4277 } else {
4278 throw jsonDecoder.mismatch(jsonPath, "offset");
4279 }
4280 int length;
4281 if (json.containsKey("length")) {
4282 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
4283 } else {
4284 throw jsonDecoder.mismatch(jsonPath, "length");
4285 }
4286 bool validateOnly;
4287 if (json.containsKey("validateOnly")) {
4288 validateOnly = jsonDecoder.decodeBool(jsonPath + ".validateOnly", json[" validateOnly"]);
4289 } else {
4290 throw jsonDecoder.mismatch(jsonPath, "validateOnly");
4291 }
4292 RefactoringOptions options;
4293 if (json.containsKey("options")) {
4294 options = new RefactoringOptions.fromJson(jsonDecoder, jsonPath + ".opti ons", json["options"], kind);
4295 }
4296 return new EditGetRefactoringParams(kind, file, offset, length, validateOn ly, options: options);
4297 } else {
4298 throw jsonDecoder.mismatch(jsonPath, "edit.getRefactoring params", json);
4299 }
4300 }
4301
4302 factory EditGetRefactoringParams.fromRequest(Request request) {
4303 var params = new EditGetRefactoringParams.fromJson(
4304 new RequestDecoder(request), "params", request.params);
4305 REQUEST_ID_REFACTORING_KINDS[request.id] = params.kind;
4306 return params;
4307 }
4308
4309 @override
4310 Map<String, dynamic> toJson() {
4311 Map<String, dynamic> result = {};
4312 result["kind"] = kind.toJson();
4313 result["file"] = file;
4314 result["offset"] = offset;
4315 result["length"] = length;
4316 result["validateOnly"] = validateOnly;
4317 if (options != null) {
4318 result["options"] = options.toJson();
4319 }
4320 return result;
4321 }
4322
4323 Request toRequest(String id) {
4324 return new Request(id, "edit.getRefactoring", toJson());
4325 }
4326
4327 @override
4328 String toString() => JSON.encode(toJson());
4329
4330 @override
4331 bool operator==(other) {
4332 if (other is EditGetRefactoringParams) {
4333 return kind == other.kind &&
4334 file == other.file &&
4335 offset == other.offset &&
4336 length == other.length &&
4337 validateOnly == other.validateOnly &&
4338 options == other.options;
4339 }
4340 return false;
4341 }
4342
4343 @override
4344 int get hashCode {
4345 int hash = 0;
4346 hash = JenkinsSmiHash.combine(hash, kind.hashCode);
4347 hash = JenkinsSmiHash.combine(hash, file.hashCode);
4348 hash = JenkinsSmiHash.combine(hash, offset.hashCode);
4349 hash = JenkinsSmiHash.combine(hash, length.hashCode);
4350 hash = JenkinsSmiHash.combine(hash, validateOnly.hashCode);
4351 hash = JenkinsSmiHash.combine(hash, options.hashCode);
4352 return JenkinsSmiHash.finish(hash);
4353 }
4354 }
4355
4356 /**
4357 * edit.getRefactoring result
4358 *
4359 * {
4360 * "initialProblems": List<RefactoringProblem>
4361 * "optionsProblems": List<RefactoringProblem>
4362 * "finalProblems": List<RefactoringProblem>
4363 * "feedback": optional RefactoringFeedback
4364 * "change": optional SourceChange
4365 * "potentialEdits": optional List<String>
4366 * }
4367 *
4368 * Clients may not extend, implement or mix-in this class.
4369 */
4370 class EditGetRefactoringResult implements ResponseResult {
4371 List<RefactoringProblem> _initialProblems;
4372
4373 List<RefactoringProblem> _optionsProblems;
4374
4375 List<RefactoringProblem> _finalProblems;
4376
4377 RefactoringFeedback _feedback;
4378
4379 SourceChange _change;
4380
4381 List<String> _potentialEdits;
4382
4383 /**
4384 * The initial status of the refactoring, that is, problems related to the
4385 * context in which the refactoring is requested. The list should be empty if
4386 * there are no known problems.
4387 */
4388 List<RefactoringProblem> get initialProblems => _initialProblems;
4389
4390 /**
4391 * The initial status of the refactoring, that is, problems related to the
4392 * context in which the refactoring is requested. The list should be empty if
4393 * there are no known problems.
4394 */
4395 void set initialProblems(List<RefactoringProblem> value) {
4396 assert(value != null);
4397 this._initialProblems = value;
4398 }
4399
4400 /**
4401 * The options validation status, that is, problems in the given options,
4402 * such as light-weight validation of a new name, flags compatibility, etc.
4403 * The list should be empty if there are no known problems.
4404 */
4405 List<RefactoringProblem> get optionsProblems => _optionsProblems;
4406
4407 /**
4408 * The options validation status, that is, problems in the given options,
4409 * such as light-weight validation of a new name, flags compatibility, etc.
4410 * The list should be empty if there are no known problems.
4411 */
4412 void set optionsProblems(List<RefactoringProblem> value) {
4413 assert(value != null);
4414 this._optionsProblems = value;
4415 }
4416
4417 /**
4418 * The final status of the refactoring, that is, problems identified in the
4419 * result of a full, potentially expensive validation and / or change
4420 * creation. The list should be empty if there are no known problems.
4421 */
4422 List<RefactoringProblem> get finalProblems => _finalProblems;
4423
4424 /**
4425 * The final status of the refactoring, that is, problems identified in the
4426 * result of a full, potentially expensive validation and / or change
4427 * creation. The list should be empty if there are no known problems.
4428 */
4429 void set finalProblems(List<RefactoringProblem> value) {
4430 assert(value != null);
4431 this._finalProblems = value;
4432 }
4433
4434 /**
4435 * Data used to provide feedback to the user. The structure of the data is
4436 * dependent on the kind of refactoring being created. The data that is
4437 * returned is documented in the section titled Refactorings, labeled as
4438 * "Feedback".
4439 */
4440 RefactoringFeedback get feedback => _feedback;
4441
4442 /**
4443 * Data used to provide feedback to the user. The structure of the data is
4444 * dependent on the kind of refactoring being created. The data that is
4445 * returned is documented in the section titled Refactorings, labeled as
4446 * "Feedback".
4447 */
4448 void set feedback(RefactoringFeedback value) {
4449 this._feedback = value;
4450 }
4451
4452 /**
4453 * The changes that are to be applied to affect the refactoring. This field
4454 * can be omitted if there are problems that prevent a set of changes from
4455 * being computed, such as having no options specified for a refactoring that
4456 * requires them, or if only validation was requested.
4457 */
4458 SourceChange get change => _change;
4459
4460 /**
4461 * The changes that are to be applied to affect the refactoring. This field
4462 * can be omitted if there are problems that prevent a set of changes from
4463 * being computed, such as having no options specified for a refactoring that
4464 * requires them, or if only validation was requested.
4465 */
4466 void set change(SourceChange value) {
4467 this._change = value;
4468 }
4469
4470 /**
4471 * The ids of source edits that are not known to be valid. An edit is not
4472 * known to be valid if there was insufficient type information for the
4473 * plugin to be able to determine whether or not the code needs to be
4474 * modified, such as when a member is being renamed and there is a reference
4475 * to a member from an unknown type. This field can be omitted if the change
4476 * field is omitted or if there are no potential edits for the refactoring.
4477 */
4478 List<String> get potentialEdits => _potentialEdits;
4479
4480 /**
4481 * The ids of source edits that are not known to be valid. An edit is not
4482 * known to be valid if there was insufficient type information for the
4483 * plugin to be able to determine whether or not the code needs to be
4484 * modified, such as when a member is being renamed and there is a reference
4485 * to a member from an unknown type. This field can be omitted if the change
4486 * field is omitted or if there are no potential edits for the refactoring.
4487 */
4488 void set potentialEdits(List<String> value) {
4489 this._potentialEdits = value;
4490 }
4491
4492 EditGetRefactoringResult(List<RefactoringProblem> initialProblems, List<Refact oringProblem> optionsProblems, List<RefactoringProblem> finalProblems, {Refactor ingFeedback feedback, SourceChange change, List<String> potentialEdits}) {
4493 this.initialProblems = initialProblems;
4494 this.optionsProblems = optionsProblems;
4495 this.finalProblems = finalProblems;
4496 this.feedback = feedback;
4497 this.change = change;
4498 this.potentialEdits = potentialEdits;
4499 }
4500
4501 factory EditGetRefactoringResult.fromJson(JsonDecoder jsonDecoder, String json Path, Object json) {
4502 if (json == null) {
4503 json = {};
4504 }
4505 if (json is Map) {
4506 List<RefactoringProblem> initialProblems;
4507 if (json.containsKey("initialProblems")) {
4508 initialProblems = jsonDecoder.decodeList(jsonPath + ".initialProblems", json["initialProblems"], (String jsonPath, Object json) => new RefactoringProble m.fromJson(jsonDecoder, jsonPath, json));
4509 } else {
4510 throw jsonDecoder.mismatch(jsonPath, "initialProblems");
4511 }
4512 List<RefactoringProblem> optionsProblems;
4513 if (json.containsKey("optionsProblems")) {
4514 optionsProblems = jsonDecoder.decodeList(jsonPath + ".optionsProblems", json["optionsProblems"], (String jsonPath, Object json) => new RefactoringProble m.fromJson(jsonDecoder, jsonPath, json));
4515 } else {
4516 throw jsonDecoder.mismatch(jsonPath, "optionsProblems");
4517 }
4518 List<RefactoringProblem> finalProblems;
4519 if (json.containsKey("finalProblems")) {
4520 finalProblems = jsonDecoder.decodeList(jsonPath + ".finalProblems", json ["finalProblems"], (String jsonPath, Object json) => new RefactoringProblem.from Json(jsonDecoder, jsonPath, json));
4521 } else {
4522 throw jsonDecoder.mismatch(jsonPath, "finalProblems");
4523 }
4524 RefactoringFeedback feedback;
4525 if (json.containsKey("feedback")) {
4526 feedback = new RefactoringFeedback.fromJson(jsonDecoder, jsonPath + ".fe edback", json["feedback"], json);
4527 }
4528 SourceChange change;
4529 if (json.containsKey("change")) {
4530 change = new SourceChange.fromJson(jsonDecoder, jsonPath + ".change", js on["change"]);
4531 }
4532 List<String> potentialEdits;
4533 if (json.containsKey("potentialEdits")) {
4534 potentialEdits = jsonDecoder.decodeList(jsonPath + ".potentialEdits", js on["potentialEdits"], jsonDecoder.decodeString);
4535 }
4536 return new EditGetRefactoringResult(initialProblems, optionsProblems, fina lProblems, feedback: feedback, change: change, potentialEdits: potentialEdits);
4537 } else {
4538 throw jsonDecoder.mismatch(jsonPath, "edit.getRefactoring result", json);
4539 }
4540 }
4541
4542 factory EditGetRefactoringResult.fromResponse(Response response) {
4543 return new EditGetRefactoringResult.fromJson(
4544 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), " result", response.result);
4545 }
4546
4547 @override
4548 Map<String, dynamic> toJson() {
4549 Map<String, dynamic> result = {};
4550 result["initialProblems"] = initialProblems.map((RefactoringProblem value) = > value.toJson()).toList();
4551 result["optionsProblems"] = optionsProblems.map((RefactoringProblem value) = > value.toJson()).toList();
4552 result["finalProblems"] = finalProblems.map((RefactoringProblem value) => va lue.toJson()).toList();
4553 if (feedback != null) {
4554 result["feedback"] = feedback.toJson();
4555 }
4556 if (change != null) {
4557 result["change"] = change.toJson();
4558 }
4559 if (potentialEdits != null) {
4560 result["potentialEdits"] = potentialEdits;
4561 }
4562 return result;
4563 }
4564
4565 @override
4566 Response toResponse(String id) {
4567 return new Response(id, result: toJson());
4568 }
4569
4570 @override
4571 String toString() => JSON.encode(toJson());
4572
4573 @override
4574 bool operator==(other) {
4575 if (other is EditGetRefactoringResult) {
4576 return listEqual(initialProblems, other.initialProblems, (RefactoringProbl em a, RefactoringProblem b) => a == b) &&
4577 listEqual(optionsProblems, other.optionsProblems, (RefactoringProblem a, RefactoringProblem b) => a == b) &&
4578 listEqual(finalProblems, other.finalProblems, (RefactoringProblem a, R efactoringProblem b) => a == b) &&
4579 feedback == other.feedback &&
4580 change == other.change &&
4581 listEqual(potentialEdits, other.potentialEdits, (String a, String b) = > a == b);
4582 }
4583 return false;
4584 }
4585
4586 @override
4587 int get hashCode {
4588 int hash = 0;
4589 hash = JenkinsSmiHash.combine(hash, initialProblems.hashCode);
4590 hash = JenkinsSmiHash.combine(hash, optionsProblems.hashCode);
4591 hash = JenkinsSmiHash.combine(hash, finalProblems.hashCode);
4592 hash = JenkinsSmiHash.combine(hash, feedback.hashCode);
4593 hash = JenkinsSmiHash.combine(hash, change.hashCode);
4594 hash = JenkinsSmiHash.combine(hash, potentialEdits.hashCode);
4595 return JenkinsSmiHash.finish(hash);
4596 }
4597 }
4598
4599 /**
4600 * Element
4601 *
4602 * {
4603 * "kind": ElementKind
4604 * "name": String
4605 * "location": optional Location
4606 * "flags": int
4607 * "parameters": optional String
4608 * "returnType": optional String
4609 * "typeParameters": optional String
4610 * }
4611 *
4612 * Clients may not extend, implement or mix-in this class.
4613 */
4614 class Element implements HasToJson {
4615 static const int FLAG_ABSTRACT = 0x01;
4616 static const int FLAG_CONST = 0x02;
4617 static const int FLAG_FINAL = 0x04;
4618 static const int FLAG_STATIC = 0x08;
4619 static const int FLAG_PRIVATE = 0x10;
4620 static const int FLAG_DEPRECATED = 0x20;
4621
4622 static int makeFlags({isAbstract: false, isConst: false, isFinal: false, isSta tic: false, isPrivate: false, isDeprecated: false}) {
4623 int flags = 0;
4624 if (isAbstract) flags |= FLAG_ABSTRACT;
4625 if (isConst) flags |= FLAG_CONST;
4626 if (isFinal) flags |= FLAG_FINAL;
4627 if (isStatic) flags |= FLAG_STATIC;
4628 if (isPrivate) flags |= FLAG_PRIVATE;
4629 if (isDeprecated) flags |= FLAG_DEPRECATED;
4630 return flags;
4631 }
4632
4633 ElementKind _kind;
4634
4635 String _name;
4636
4637 Location _location;
4638
4639 int _flags;
4640
4641 String _parameters;
4642
4643 String _returnType;
4644
4645 String _typeParameters;
4646
4647 /**
4648 * The kind of the element.
4649 */
4650 ElementKind get kind => _kind;
4651
4652 /**
4653 * The kind of the element.
4654 */
4655 void set kind(ElementKind value) {
4656 assert(value != null);
4657 this._kind = value;
4658 }
4659
4660 /**
4661 * The name of the element. This is typically used as the label in the
4662 * outline.
4663 */
4664 String get name => _name;
4665
4666 /**
4667 * The name of the element. This is typically used as the label in the
4668 * outline.
4669 */
4670 void set name(String value) {
4671 assert(value != null);
4672 this._name = value;
4673 }
4674
4675 /**
4676 * The location of the name in the declaration of the element.
4677 */
4678 Location get location => _location;
4679
4680 /**
4681 * The location of the name in the declaration of the element.
4682 */
4683 void set location(Location value) {
4684 this._location = value;
4685 }
4686
4687 /**
4688 * A bit-map containing the following flags:
4689 *
4690 * - 0x01 - set if the element is explicitly or implicitly abstract
4691 * - 0x02 - set if the element was declared to be ‘const’
4692 * - 0x04 - set if the element was declared to be ‘final’
4693 * - 0x08 - set if the element is a static member of a class or is a
4694 * top-level function or field
4695 * - 0x10 - set if the element is private
4696 * - 0x20 - set if the element is deprecated
4697 */
4698 int get flags => _flags;
4699
4700 /**
4701 * A bit-map containing the following flags:
4702 *
4703 * - 0x01 - set if the element is explicitly or implicitly abstract
4704 * - 0x02 - set if the element was declared to be ‘const’
4705 * - 0x04 - set if the element was declared to be ‘final’
4706 * - 0x08 - set if the element is a static member of a class or is a
4707 * top-level function or field
4708 * - 0x10 - set if the element is private
4709 * - 0x20 - set if the element is deprecated
4710 */
4711 void set flags(int value) {
4712 assert(value != null);
4713 this._flags = value;
4714 }
4715
4716 /**
4717 * The parameter list for the element. If the element is not a method or
4718 * function this field will not be defined. If the element doesn't have
4719 * parameters (e.g. getter), this field will not be defined. If the element
4720 * has zero parameters, this field will have a value of "()".
4721 */
4722 String get parameters => _parameters;
4723
4724 /**
4725 * The parameter list for the element. If the element is not a method or
4726 * function this field will not be defined. If the element doesn't have
4727 * parameters (e.g. getter), this field will not be defined. If the element
4728 * has zero parameters, this field will have a value of "()".
4729 */
4730 void set parameters(String value) {
4731 this._parameters = value;
4732 }
4733
4734 /**
4735 * The return type of the element. If the element is not a method or function
4736 * this field will not be defined. If the element does not have a declared
4737 * return type, this field will contain an empty string.
4738 */
4739 String get returnType => _returnType;
4740
4741 /**
4742 * The return type of the element. If the element is not a method or function
4743 * this field will not be defined. If the element does not have a declared
4744 * return type, this field will contain an empty string.
4745 */
4746 void set returnType(String value) {
4747 this._returnType = value;
4748 }
4749
4750 /**
4751 * The type parameter list for the element. If the element doesn't have type
4752 * parameters, this field will not be defined.
4753 */
4754 String get typeParameters => _typeParameters;
4755
4756 /**
4757 * The type parameter list for the element. If the element doesn't have type
4758 * parameters, this field will not be defined.
4759 */
4760 void set typeParameters(String value) {
4761 this._typeParameters = value;
4762 }
4763
4764 Element(ElementKind kind, String name, int flags, {Location location, String p arameters, String returnType, String typeParameters}) {
4765 this.kind = kind;
4766 this.name = name;
4767 this.location = location;
4768 this.flags = flags;
4769 this.parameters = parameters;
4770 this.returnType = returnType;
4771 this.typeParameters = typeParameters;
4772 }
4773
4774 factory Element.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json ) {
4775 if (json == null) {
4776 json = {};
4777 }
4778 if (json is Map) {
4779 ElementKind kind;
4780 if (json.containsKey("kind")) {
4781 kind = new ElementKind.fromJson(jsonDecoder, jsonPath + ".kind", json["k ind"]);
4782 } else {
4783 throw jsonDecoder.mismatch(jsonPath, "kind");
4784 }
4785 String name;
4786 if (json.containsKey("name")) {
4787 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
4788 } else {
4789 throw jsonDecoder.mismatch(jsonPath, "name");
4790 }
4791 Location location;
4792 if (json.containsKey("location")) {
4793 location = new Location.fromJson(jsonDecoder, jsonPath + ".location", js on["location"]);
4794 }
4795 int flags;
4796 if (json.containsKey("flags")) {
4797 flags = jsonDecoder.decodeInt(jsonPath + ".flags", json["flags"]);
4798 } else {
4799 throw jsonDecoder.mismatch(jsonPath, "flags");
4800 }
4801 String parameters;
4802 if (json.containsKey("parameters")) {
4803 parameters = jsonDecoder.decodeString(jsonPath + ".parameters", json["pa rameters"]);
4804 }
4805 String returnType;
4806 if (json.containsKey("returnType")) {
4807 returnType = jsonDecoder.decodeString(jsonPath + ".returnType", json["re turnType"]);
4808 }
4809 String typeParameters;
4810 if (json.containsKey("typeParameters")) {
4811 typeParameters = jsonDecoder.decodeString(jsonPath + ".typeParameters", json["typeParameters"]);
4812 }
4813 return new Element(kind, name, flags, location: location, parameters: para meters, returnType: returnType, typeParameters: typeParameters);
4814 } else {
4815 throw jsonDecoder.mismatch(jsonPath, "Element", json);
4816 }
4817 }
4818
4819 bool get isAbstract => (flags & FLAG_ABSTRACT) != 0;
4820 bool get isConst => (flags & FLAG_CONST) != 0;
4821 bool get isFinal => (flags & FLAG_FINAL) != 0;
4822 bool get isStatic => (flags & FLAG_STATIC) != 0;
4823 bool get isPrivate => (flags & FLAG_PRIVATE) != 0;
4824 bool get isDeprecated => (flags & FLAG_DEPRECATED) != 0;
4825
4826 @override
4827 Map<String, dynamic> toJson() {
4828 Map<String, dynamic> result = {};
4829 result["kind"] = kind.toJson();
4830 result["name"] = name;
4831 if (location != null) {
4832 result["location"] = location.toJson();
4833 }
4834 result["flags"] = flags;
4835 if (parameters != null) {
4836 result["parameters"] = parameters;
4837 }
4838 if (returnType != null) {
4839 result["returnType"] = returnType;
4840 }
4841 if (typeParameters != null) {
4842 result["typeParameters"] = typeParameters;
4843 }
4844 return result;
4845 }
4846
4847 @override
4848 String toString() => JSON.encode(toJson());
4849
4850 @override
4851 bool operator==(other) {
4852 if (other is Element) {
4853 return kind == other.kind &&
4854 name == other.name &&
4855 location == other.location &&
4856 flags == other.flags &&
4857 parameters == other.parameters &&
4858 returnType == other.returnType &&
4859 typeParameters == other.typeParameters;
4860 }
4861 return false;
4862 }
4863
4864 @override
4865 int get hashCode {
4866 int hash = 0;
4867 hash = JenkinsSmiHash.combine(hash, kind.hashCode);
4868 hash = JenkinsSmiHash.combine(hash, name.hashCode);
4869 hash = JenkinsSmiHash.combine(hash, location.hashCode);
4870 hash = JenkinsSmiHash.combine(hash, flags.hashCode);
4871 hash = JenkinsSmiHash.combine(hash, parameters.hashCode);
4872 hash = JenkinsSmiHash.combine(hash, returnType.hashCode);
4873 hash = JenkinsSmiHash.combine(hash, typeParameters.hashCode);
4874 return JenkinsSmiHash.finish(hash);
4875 }
4876 }
4877
4878 /**
4879 * ElementKind
4880 *
4881 * enum {
4882 * CLASS
4883 * CLASS_TYPE_ALIAS
4884 * COMPILATION_UNIT
4885 * CONSTRUCTOR
4886 * ENUM
4887 * ENUM_CONSTANT
4888 * FIELD
4889 * FILE
4890 * FUNCTION
4891 * FUNCTION_TYPE_ALIAS
4892 * GETTER
4893 * LABEL
4894 * LIBRARY
4895 * LOCAL_VARIABLE
4896 * METHOD
4897 * PARAMETER
4898 * PREFIX
4899 * SETTER
4900 * TOP_LEVEL_VARIABLE
4901 * TYPE_PARAMETER
4902 * UNKNOWN
4903 * }
4904 *
4905 * Clients may not extend, implement or mix-in this class.
4906 */
4907 class ElementKind implements Enum {
4908 static const ElementKind CLASS = const ElementKind._("CLASS");
4909
4910 static const ElementKind CLASS_TYPE_ALIAS = const ElementKind._("CLASS_TYPE_AL IAS");
4911
4912 static const ElementKind COMPILATION_UNIT = const ElementKind._("COMPILATION_U NIT");
4913
4914 static const ElementKind CONSTRUCTOR = const ElementKind._("CONSTRUCTOR");
4915
4916 static const ElementKind ENUM = const ElementKind._("ENUM");
4917
4918 static const ElementKind ENUM_CONSTANT = const ElementKind._("ENUM_CONSTANT");
4919
4920 static const ElementKind FIELD = const ElementKind._("FIELD");
4921
4922 static const ElementKind FILE = const ElementKind._("FILE");
4923
4924 static const ElementKind FUNCTION = const ElementKind._("FUNCTION");
4925
4926 static const ElementKind FUNCTION_TYPE_ALIAS = const ElementKind._("FUNCTION_T YPE_ALIAS");
4927
4928 static const ElementKind GETTER = const ElementKind._("GETTER");
4929
4930 static const ElementKind LABEL = const ElementKind._("LABEL");
4931
4932 static const ElementKind LIBRARY = const ElementKind._("LIBRARY");
4933
4934 static const ElementKind LOCAL_VARIABLE = const ElementKind._("LOCAL_VARIABLE" );
4935
4936 static const ElementKind METHOD = const ElementKind._("METHOD");
4937
4938 static const ElementKind PARAMETER = const ElementKind._("PARAMETER");
4939
4940 static const ElementKind PREFIX = const ElementKind._("PREFIX");
4941
4942 static const ElementKind SETTER = const ElementKind._("SETTER");
4943
4944 static const ElementKind TOP_LEVEL_VARIABLE = const ElementKind._("TOP_LEVEL_V ARIABLE");
4945
4946 static const ElementKind TYPE_PARAMETER = const ElementKind._("TYPE_PARAMETER" );
4947
4948 static const ElementKind UNKNOWN = const ElementKind._("UNKNOWN");
4949
4950 /**
4951 * A list containing all of the enum values that are defined.
4952 */
4953 static const List<ElementKind> VALUES = const <ElementKind>[CLASS, CLASS_TYPE_ ALIAS, COMPILATION_UNIT, CONSTRUCTOR, ENUM, ENUM_CONSTANT, FIELD, FILE, FUNCTION , FUNCTION_TYPE_ALIAS, GETTER, LABEL, LIBRARY, LOCAL_VARIABLE, METHOD, PARAMETER , PREFIX, SETTER, TOP_LEVEL_VARIABLE, TYPE_PARAMETER, UNKNOWN];
4954
4955 @override
4956 final String name;
4957
4958 const ElementKind._(this.name);
4959
4960 factory ElementKind(String name) {
4961 switch (name) {
4962 case "CLASS":
4963 return CLASS;
4964 case "CLASS_TYPE_ALIAS":
4965 return CLASS_TYPE_ALIAS;
4966 case "COMPILATION_UNIT":
4967 return COMPILATION_UNIT;
4968 case "CONSTRUCTOR":
4969 return CONSTRUCTOR;
4970 case "ENUM":
4971 return ENUM;
4972 case "ENUM_CONSTANT":
4973 return ENUM_CONSTANT;
4974 case "FIELD":
4975 return FIELD;
4976 case "FILE":
4977 return FILE;
4978 case "FUNCTION":
4979 return FUNCTION;
4980 case "FUNCTION_TYPE_ALIAS":
4981 return FUNCTION_TYPE_ALIAS;
4982 case "GETTER":
4983 return GETTER;
4984 case "LABEL":
4985 return LABEL;
4986 case "LIBRARY":
4987 return LIBRARY;
4988 case "LOCAL_VARIABLE":
4989 return LOCAL_VARIABLE;
4990 case "METHOD":
4991 return METHOD;
4992 case "PARAMETER":
4993 return PARAMETER;
4994 case "PREFIX":
4995 return PREFIX;
4996 case "SETTER":
4997 return SETTER;
4998 case "TOP_LEVEL_VARIABLE":
4999 return TOP_LEVEL_VARIABLE;
5000 case "TYPE_PARAMETER":
5001 return TYPE_PARAMETER;
5002 case "UNKNOWN":
5003 return UNKNOWN;
5004 }
5005 throw new Exception('Illegal enum value: $name');
5006 }
5007
5008 factory ElementKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
5009 if (json is String) {
5010 try {
5011 return new ElementKind(json);
5012 } catch(_) {
5013 // Fall through
5014 }
5015 }
5016 throw jsonDecoder.mismatch(jsonPath, "ElementKind", json);
5017 }
5018
5019 @override
5020 String toString() => "ElementKind.$name";
5021
5022 String toJson() => name;
5023 }
5024
5025 /**
5026 * extractLocalVariable feedback
5027 *
5028 * {
5029 * "coveringExpressionOffsets": optional List<int>
5030 * "coveringExpressionLengths": optional List<int>
5031 * "names": List<String>
5032 * "offsets": List<int>
5033 * "lengths": List<int>
5034 * }
5035 *
5036 * Clients may not extend, implement or mix-in this class.
5037 */
5038 class ExtractLocalVariableFeedback extends RefactoringFeedback {
5039 List<int> _coveringExpressionOffsets;
5040
5041 List<int> _coveringExpressionLengths;
5042
5043 List<String> _names;
5044
5045 List<int> _offsets;
5046
5047 List<int> _lengths;
5048
5049 /**
5050 * The offsets of the expressions that cover the specified selection, from
5051 * the down most to the up most.
5052 */
5053 List<int> get coveringExpressionOffsets => _coveringExpressionOffsets;
5054
5055 /**
5056 * The offsets of the expressions that cover the specified selection, from
5057 * the down most to the up most.
5058 */
5059 void set coveringExpressionOffsets(List<int> value) {
5060 this._coveringExpressionOffsets = value;
5061 }
5062
5063 /**
5064 * The lengths of the expressions that cover the specified selection, from
5065 * the down most to the up most.
5066 */
5067 List<int> get coveringExpressionLengths => _coveringExpressionLengths;
5068
5069 /**
5070 * The lengths of the expressions that cover the specified selection, from
5071 * the down most to the up most.
5072 */
5073 void set coveringExpressionLengths(List<int> value) {
5074 this._coveringExpressionLengths = value;
5075 }
5076
5077 /**
5078 * The proposed names for the local variable.
5079 */
5080 List<String> get names => _names;
5081
5082 /**
5083 * The proposed names for the local variable.
5084 */
5085 void set names(List<String> value) {
5086 assert(value != null);
5087 this._names = value;
5088 }
5089
5090 /**
5091 * The offsets of the expressions that would be replaced by a reference to
5092 * the variable.
5093 */
5094 List<int> get offsets => _offsets;
5095
5096 /**
5097 * The offsets of the expressions that would be replaced by a reference to
5098 * the variable.
5099 */
5100 void set offsets(List<int> value) {
5101 assert(value != null);
5102 this._offsets = value;
5103 }
5104
5105 /**
5106 * The lengths of the expressions that would be replaced by a reference to
5107 * the variable. The lengths correspond to the offsets. In other words, for a
5108 * given expression, if the offset of that expression is offsets[i], then the
5109 * length of that expression is lengths[i].
5110 */
5111 List<int> get lengths => _lengths;
5112
5113 /**
5114 * The lengths of the expressions that would be replaced by a reference to
5115 * the variable. The lengths correspond to the offsets. In other words, for a
5116 * given expression, if the offset of that expression is offsets[i], then the
5117 * length of that expression is lengths[i].
5118 */
5119 void set lengths(List<int> value) {
5120 assert(value != null);
5121 this._lengths = value;
5122 }
5123
5124 ExtractLocalVariableFeedback(List<String> names, List<int> offsets, List<int> lengths, {List<int> coveringExpressionOffsets, List<int> coveringExpressionLengt hs}) {
5125 this.coveringExpressionOffsets = coveringExpressionOffsets;
5126 this.coveringExpressionLengths = coveringExpressionLengths;
5127 this.names = names;
5128 this.offsets = offsets;
5129 this.lengths = lengths;
5130 }
5131
5132 factory ExtractLocalVariableFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
5133 if (json == null) {
5134 json = {};
5135 }
5136 if (json is Map) {
5137 List<int> coveringExpressionOffsets;
5138 if (json.containsKey("coveringExpressionOffsets")) {
5139 coveringExpressionOffsets = jsonDecoder.decodeList(jsonPath + ".covering ExpressionOffsets", json["coveringExpressionOffsets"], jsonDecoder.decodeInt);
5140 }
5141 List<int> coveringExpressionLengths;
5142 if (json.containsKey("coveringExpressionLengths")) {
5143 coveringExpressionLengths = jsonDecoder.decodeList(jsonPath + ".covering ExpressionLengths", json["coveringExpressionLengths"], jsonDecoder.decodeInt);
5144 }
5145 List<String> names;
5146 if (json.containsKey("names")) {
5147 names = jsonDecoder.decodeList(jsonPath + ".names", json["names"], jsonD ecoder.decodeString);
5148 } else {
5149 throw jsonDecoder.mismatch(jsonPath, "names");
5150 }
5151 List<int> offsets;
5152 if (json.containsKey("offsets")) {
5153 offsets = jsonDecoder.decodeList(jsonPath + ".offsets", json["offsets"], jsonDecoder.decodeInt);
5154 } else {
5155 throw jsonDecoder.mismatch(jsonPath, "offsets");
5156 }
5157 List<int> lengths;
5158 if (json.containsKey("lengths")) {
5159 lengths = jsonDecoder.decodeList(jsonPath + ".lengths", json["lengths"], jsonDecoder.decodeInt);
5160 } else {
5161 throw jsonDecoder.mismatch(jsonPath, "lengths");
5162 }
5163 return new ExtractLocalVariableFeedback(names, offsets, lengths, coveringE xpressionOffsets: coveringExpressionOffsets, coveringExpressionLengths: covering ExpressionLengths);
5164 } else {
5165 throw jsonDecoder.mismatch(jsonPath, "extractLocalVariable feedback", json );
5166 }
5167 }
5168
5169 @override
5170 Map<String, dynamic> toJson() {
5171 Map<String, dynamic> result = {};
5172 if (coveringExpressionOffsets != null) {
5173 result["coveringExpressionOffsets"] = coveringExpressionOffsets;
5174 }
5175 if (coveringExpressionLengths != null) {
5176 result["coveringExpressionLengths"] = coveringExpressionLengths;
5177 }
5178 result["names"] = names;
5179 result["offsets"] = offsets;
5180 result["lengths"] = lengths;
5181 return result;
5182 }
5183
5184 @override
5185 String toString() => JSON.encode(toJson());
5186
5187 @override
5188 bool operator==(other) {
5189 if (other is ExtractLocalVariableFeedback) {
5190 return listEqual(coveringExpressionOffsets, other.coveringExpressionOffset s, (int a, int b) => a == b) &&
5191 listEqual(coveringExpressionLengths, other.coveringExpressionLengths, (int a, int b) => a == b) &&
5192 listEqual(names, other.names, (String a, String b) => a == b) &&
5193 listEqual(offsets, other.offsets, (int a, int b) => a == b) &&
5194 listEqual(lengths, other.lengths, (int a, int b) => a == b);
5195 }
5196 return false;
5197 }
5198
5199 @override
5200 int get hashCode {
5201 int hash = 0;
5202 hash = JenkinsSmiHash.combine(hash, coveringExpressionOffsets.hashCode);
5203 hash = JenkinsSmiHash.combine(hash, coveringExpressionLengths.hashCode);
5204 hash = JenkinsSmiHash.combine(hash, names.hashCode);
5205 hash = JenkinsSmiHash.combine(hash, offsets.hashCode);
5206 hash = JenkinsSmiHash.combine(hash, lengths.hashCode);
5207 return JenkinsSmiHash.finish(hash);
5208 }
5209 }
5210
5211 /**
5212 * extractLocalVariable options
5213 *
5214 * {
5215 * "name": String
5216 * "extractAll": bool
5217 * }
5218 *
5219 * Clients may not extend, implement or mix-in this class.
5220 */
5221 class ExtractLocalVariableOptions extends RefactoringOptions {
5222 String _name;
5223
5224 bool _extractAll;
5225
5226 /**
5227 * The name that the local variable should be given.
5228 */
5229 String get name => _name;
5230
5231 /**
5232 * The name that the local variable should be given.
5233 */
5234 void set name(String value) {
5235 assert(value != null);
5236 this._name = value;
5237 }
5238
5239 /**
5240 * True if all occurrences of the expression within the scope in which the
5241 * variable will be defined should be replaced by a reference to the local
5242 * variable. The expression used to initiate the refactoring will always be
5243 * replaced.
5244 */
5245 bool get extractAll => _extractAll;
5246
5247 /**
5248 * True if all occurrences of the expression within the scope in which the
5249 * variable will be defined should be replaced by a reference to the local
5250 * variable. The expression used to initiate the refactoring will always be
5251 * replaced.
5252 */
5253 void set extractAll(bool value) {
5254 assert(value != null);
5255 this._extractAll = value;
5256 }
5257
5258 ExtractLocalVariableOptions(String name, bool extractAll) {
5259 this.name = name;
5260 this.extractAll = extractAll;
5261 }
5262
5263 factory ExtractLocalVariableOptions.fromJson(JsonDecoder jsonDecoder, String j sonPath, Object json) {
5264 if (json == null) {
5265 json = {};
5266 }
5267 if (json is Map) {
5268 String name;
5269 if (json.containsKey("name")) {
5270 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
5271 } else {
5272 throw jsonDecoder.mismatch(jsonPath, "name");
5273 }
5274 bool extractAll;
5275 if (json.containsKey("extractAll")) {
5276 extractAll = jsonDecoder.decodeBool(jsonPath + ".extractAll", json["extr actAll"]);
5277 } else {
5278 throw jsonDecoder.mismatch(jsonPath, "extractAll");
5279 }
5280 return new ExtractLocalVariableOptions(name, extractAll);
5281 } else {
5282 throw jsonDecoder.mismatch(jsonPath, "extractLocalVariable options", json) ;
5283 }
5284 }
5285
5286 factory ExtractLocalVariableOptions.fromRefactoringParams(EditGetRefactoringPa rams refactoringParams, Request request) {
5287 return new ExtractLocalVariableOptions.fromJson(
5288 new RequestDecoder(request), "options", refactoringParams.options);
5289 }
5290
5291 @override
5292 Map<String, dynamic> toJson() {
5293 Map<String, dynamic> result = {};
5294 result["name"] = name;
5295 result["extractAll"] = extractAll;
5296 return result;
5297 }
5298
5299 @override
5300 String toString() => JSON.encode(toJson());
5301
5302 @override
5303 bool operator==(other) {
5304 if (other is ExtractLocalVariableOptions) {
5305 return name == other.name &&
5306 extractAll == other.extractAll;
5307 }
5308 return false;
5309 }
5310
5311 @override
5312 int get hashCode {
5313 int hash = 0;
5314 hash = JenkinsSmiHash.combine(hash, name.hashCode);
5315 hash = JenkinsSmiHash.combine(hash, extractAll.hashCode);
5316 return JenkinsSmiHash.finish(hash);
5317 }
5318 }
5319
5320 /**
5321 * extractMethod feedback
5322 *
5323 * {
5324 * "offset": int
5325 * "length": int
5326 * "returnType": String
5327 * "names": List<String>
5328 * "canCreateGetter": bool
5329 * "parameters": List<RefactoringMethodParameter>
5330 * "offsets": List<int>
5331 * "lengths": List<int>
5332 * }
5333 *
5334 * Clients may not extend, implement or mix-in this class.
5335 */
5336 class ExtractMethodFeedback extends RefactoringFeedback {
5337 int _offset;
5338
5339 int _length;
5340
5341 String _returnType;
5342
5343 List<String> _names;
5344
5345 bool _canCreateGetter;
5346
5347 List<RefactoringMethodParameter> _parameters;
5348
5349 List<int> _offsets;
5350
5351 List<int> _lengths;
5352
5353 /**
5354 * The offset to the beginning of the expression or statements that will be
5355 * extracted.
5356 */
5357 int get offset => _offset;
5358
5359 /**
5360 * The offset to the beginning of the expression or statements that will be
5361 * extracted.
5362 */
5363 void set offset(int value) {
5364 assert(value != null);
5365 this._offset = value;
5366 }
5367
5368 /**
5369 * The length of the expression or statements that will be extracted.
5370 */
5371 int get length => _length;
5372
5373 /**
5374 * The length of the expression or statements that will be extracted.
5375 */
5376 void set length(int value) {
5377 assert(value != null);
5378 this._length = value;
5379 }
5380
5381 /**
5382 * The proposed return type for the method. If the returned element does not
5383 * have a declared return type, this field will contain an empty string.
5384 */
5385 String get returnType => _returnType;
5386
5387 /**
5388 * The proposed return type for the method. If the returned element does not
5389 * have a declared return type, this field will contain an empty string.
5390 */
5391 void set returnType(String value) {
5392 assert(value != null);
5393 this._returnType = value;
5394 }
5395
5396 /**
5397 * The proposed names for the method.
5398 */
5399 List<String> get names => _names;
5400
5401 /**
5402 * The proposed names for the method.
5403 */
5404 void set names(List<String> value) {
5405 assert(value != null);
5406 this._names = value;
5407 }
5408
5409 /**
5410 * True if a getter could be created rather than a method.
5411 */
5412 bool get canCreateGetter => _canCreateGetter;
5413
5414 /**
5415 * True if a getter could be created rather than a method.
5416 */
5417 void set canCreateGetter(bool value) {
5418 assert(value != null);
5419 this._canCreateGetter = value;
5420 }
5421
5422 /**
5423 * The proposed parameters for the method.
5424 */
5425 List<RefactoringMethodParameter> get parameters => _parameters;
5426
5427 /**
5428 * The proposed parameters for the method.
5429 */
5430 void set parameters(List<RefactoringMethodParameter> value) {
5431 assert(value != null);
5432 this._parameters = value;
5433 }
5434
5435 /**
5436 * The offsets of the expressions or statements that would be replaced by an
5437 * invocation of the method.
5438 */
5439 List<int> get offsets => _offsets;
5440
5441 /**
5442 * The offsets of the expressions or statements that would be replaced by an
5443 * invocation of the method.
5444 */
5445 void set offsets(List<int> value) {
5446 assert(value != null);
5447 this._offsets = value;
5448 }
5449
5450 /**
5451 * The lengths of the expressions or statements that would be replaced by an
5452 * invocation of the method. The lengths correspond to the offsets. In other
5453 * words, for a given expression (or block of statements), if the offset of
5454 * that expression is offsets[i], then the length of that expression is
5455 * lengths[i].
5456 */
5457 List<int> get lengths => _lengths;
5458
5459 /**
5460 * The lengths of the expressions or statements that would be replaced by an
5461 * invocation of the method. The lengths correspond to the offsets. In other
5462 * words, for a given expression (or block of statements), if the offset of
5463 * that expression is offsets[i], then the length of that expression is
5464 * lengths[i].
5465 */
5466 void set lengths(List<int> value) {
5467 assert(value != null);
5468 this._lengths = value;
5469 }
5470
5471 ExtractMethodFeedback(int offset, int length, String returnType, List<String> names, bool canCreateGetter, List<RefactoringMethodParameter> parameters, List<i nt> offsets, List<int> lengths) {
5472 this.offset = offset;
5473 this.length = length;
5474 this.returnType = returnType;
5475 this.names = names;
5476 this.canCreateGetter = canCreateGetter;
5477 this.parameters = parameters;
5478 this.offsets = offsets;
5479 this.lengths = lengths;
5480 }
5481
5482 factory ExtractMethodFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPat h, Object json) {
5483 if (json == null) {
5484 json = {};
5485 }
5486 if (json is Map) {
5487 int offset;
5488 if (json.containsKey("offset")) {
5489 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
5490 } else {
5491 throw jsonDecoder.mismatch(jsonPath, "offset");
5492 }
5493 int length;
5494 if (json.containsKey("length")) {
5495 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
5496 } else {
5497 throw jsonDecoder.mismatch(jsonPath, "length");
5498 }
5499 String returnType;
5500 if (json.containsKey("returnType")) {
5501 returnType = jsonDecoder.decodeString(jsonPath + ".returnType", json["re turnType"]);
5502 } else {
5503 throw jsonDecoder.mismatch(jsonPath, "returnType");
5504 }
5505 List<String> names;
5506 if (json.containsKey("names")) {
5507 names = jsonDecoder.decodeList(jsonPath + ".names", json["names"], jsonD ecoder.decodeString);
5508 } else {
5509 throw jsonDecoder.mismatch(jsonPath, "names");
5510 }
5511 bool canCreateGetter;
5512 if (json.containsKey("canCreateGetter")) {
5513 canCreateGetter = jsonDecoder.decodeBool(jsonPath + ".canCreateGetter", json["canCreateGetter"]);
5514 } else {
5515 throw jsonDecoder.mismatch(jsonPath, "canCreateGetter");
5516 }
5517 List<RefactoringMethodParameter> parameters;
5518 if (json.containsKey("parameters")) {
5519 parameters = jsonDecoder.decodeList(jsonPath + ".parameters", json["para meters"], (String jsonPath, Object json) => new RefactoringMethodParameter.fromJ son(jsonDecoder, jsonPath, json));
5520 } else {
5521 throw jsonDecoder.mismatch(jsonPath, "parameters");
5522 }
5523 List<int> offsets;
5524 if (json.containsKey("offsets")) {
5525 offsets = jsonDecoder.decodeList(jsonPath + ".offsets", json["offsets"], jsonDecoder.decodeInt);
5526 } else {
5527 throw jsonDecoder.mismatch(jsonPath, "offsets");
5528 }
5529 List<int> lengths;
5530 if (json.containsKey("lengths")) {
5531 lengths = jsonDecoder.decodeList(jsonPath + ".lengths", json["lengths"], jsonDecoder.decodeInt);
5532 } else {
5533 throw jsonDecoder.mismatch(jsonPath, "lengths");
5534 }
5535 return new ExtractMethodFeedback(offset, length, returnType, names, canCre ateGetter, parameters, offsets, lengths);
5536 } else {
5537 throw jsonDecoder.mismatch(jsonPath, "extractMethod feedback", json);
5538 }
5539 }
5540
5541 @override
5542 Map<String, dynamic> toJson() {
5543 Map<String, dynamic> result = {};
5544 result["offset"] = offset;
5545 result["length"] = length;
5546 result["returnType"] = returnType;
5547 result["names"] = names;
5548 result["canCreateGetter"] = canCreateGetter;
5549 result["parameters"] = parameters.map((RefactoringMethodParameter value) => value.toJson()).toList();
5550 result["offsets"] = offsets;
5551 result["lengths"] = lengths;
5552 return result;
5553 }
5554
5555 @override
5556 String toString() => JSON.encode(toJson());
5557
5558 @override
5559 bool operator==(other) {
5560 if (other is ExtractMethodFeedback) {
5561 return offset == other.offset &&
5562 length == other.length &&
5563 returnType == other.returnType &&
5564 listEqual(names, other.names, (String a, String b) => a == b) &&
5565 canCreateGetter == other.canCreateGetter &&
5566 listEqual(parameters, other.parameters, (RefactoringMethodParameter a, RefactoringMethodParameter b) => a == b) &&
5567 listEqual(offsets, other.offsets, (int a, int b) => a == b) &&
5568 listEqual(lengths, other.lengths, (int a, int b) => a == b);
5569 }
5570 return false;
5571 }
5572
5573 @override
5574 int get hashCode {
5575 int hash = 0;
5576 hash = JenkinsSmiHash.combine(hash, offset.hashCode);
5577 hash = JenkinsSmiHash.combine(hash, length.hashCode);
5578 hash = JenkinsSmiHash.combine(hash, returnType.hashCode);
5579 hash = JenkinsSmiHash.combine(hash, names.hashCode);
5580 hash = JenkinsSmiHash.combine(hash, canCreateGetter.hashCode);
5581 hash = JenkinsSmiHash.combine(hash, parameters.hashCode);
5582 hash = JenkinsSmiHash.combine(hash, offsets.hashCode);
5583 hash = JenkinsSmiHash.combine(hash, lengths.hashCode);
5584 return JenkinsSmiHash.finish(hash);
5585 }
5586 }
5587
5588 /**
5589 * extractMethod options
5590 *
5591 * {
5592 * "returnType": String
5593 * "createGetter": bool
5594 * "name": String
5595 * "parameters": List<RefactoringMethodParameter>
5596 * "extractAll": bool
5597 * }
5598 *
5599 * Clients may not extend, implement or mix-in this class.
5600 */
5601 class ExtractMethodOptions extends RefactoringOptions {
5602 String _returnType;
5603
5604 bool _createGetter;
5605
5606 String _name;
5607
5608 List<RefactoringMethodParameter> _parameters;
5609
5610 bool _extractAll;
5611
5612 /**
5613 * The return type that should be defined for the method.
5614 */
5615 String get returnType => _returnType;
5616
5617 /**
5618 * The return type that should be defined for the method.
5619 */
5620 void set returnType(String value) {
5621 assert(value != null);
5622 this._returnType = value;
5623 }
5624
5625 /**
5626 * True if a getter should be created rather than a method. It is an error if
5627 * this field is true and the list of parameters is non-empty.
5628 */
5629 bool get createGetter => _createGetter;
5630
5631 /**
5632 * True if a getter should be created rather than a method. It is an error if
5633 * this field is true and the list of parameters is non-empty.
5634 */
5635 void set createGetter(bool value) {
5636 assert(value != null);
5637 this._createGetter = value;
5638 }
5639
5640 /**
5641 * The name that the method should be given.
5642 */
5643 String get name => _name;
5644
5645 /**
5646 * The name that the method should be given.
5647 */
5648 void set name(String value) {
5649 assert(value != null);
5650 this._name = value;
5651 }
5652
5653 /**
5654 * The parameters that should be defined for the method.
5655 *
5656 * It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL
5657 * parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a
5658 * NAMED parameter.
5659 *
5660 * - To change the order and/or update proposed parameters, add parameters
5661 * with the same identifiers as proposed.
5662 * - To add new parameters, omit their identifier.
5663 * - To remove some parameters, omit them in this list.
5664 */
5665 List<RefactoringMethodParameter> get parameters => _parameters;
5666
5667 /**
5668 * The parameters that should be defined for the method.
5669 *
5670 * It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL
5671 * parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a
5672 * NAMED parameter.
5673 *
5674 * - To change the order and/or update proposed parameters, add parameters
5675 * with the same identifiers as proposed.
5676 * - To add new parameters, omit their identifier.
5677 * - To remove some parameters, omit them in this list.
5678 */
5679 void set parameters(List<RefactoringMethodParameter> value) {
5680 assert(value != null);
5681 this._parameters = value;
5682 }
5683
5684 /**
5685 * True if all occurrences of the expression or statements should be replaced
5686 * by an invocation of the method. The expression or statements used to
5687 * initiate the refactoring will always be replaced.
5688 */
5689 bool get extractAll => _extractAll;
5690
5691 /**
5692 * True if all occurrences of the expression or statements should be replaced
5693 * by an invocation of the method. The expression or statements used to
5694 * initiate the refactoring will always be replaced.
5695 */
5696 void set extractAll(bool value) {
5697 assert(value != null);
5698 this._extractAll = value;
5699 }
5700
5701 ExtractMethodOptions(String returnType, bool createGetter, String name, List<R efactoringMethodParameter> parameters, bool extractAll) {
5702 this.returnType = returnType;
5703 this.createGetter = createGetter;
5704 this.name = name;
5705 this.parameters = parameters;
5706 this.extractAll = extractAll;
5707 }
5708
5709 factory ExtractMethodOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath , Object json) {
5710 if (json == null) {
5711 json = {};
5712 }
5713 if (json is Map) {
5714 String returnType;
5715 if (json.containsKey("returnType")) {
5716 returnType = jsonDecoder.decodeString(jsonPath + ".returnType", json["re turnType"]);
5717 } else {
5718 throw jsonDecoder.mismatch(jsonPath, "returnType");
5719 }
5720 bool createGetter;
5721 if (json.containsKey("createGetter")) {
5722 createGetter = jsonDecoder.decodeBool(jsonPath + ".createGetter", json[" createGetter"]);
5723 } else {
5724 throw jsonDecoder.mismatch(jsonPath, "createGetter");
5725 }
5726 String name;
5727 if (json.containsKey("name")) {
5728 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
5729 } else {
5730 throw jsonDecoder.mismatch(jsonPath, "name");
5731 }
5732 List<RefactoringMethodParameter> parameters;
5733 if (json.containsKey("parameters")) {
5734 parameters = jsonDecoder.decodeList(jsonPath + ".parameters", json["para meters"], (String jsonPath, Object json) => new RefactoringMethodParameter.fromJ son(jsonDecoder, jsonPath, json));
5735 } else {
5736 throw jsonDecoder.mismatch(jsonPath, "parameters");
5737 }
5738 bool extractAll;
5739 if (json.containsKey("extractAll")) {
5740 extractAll = jsonDecoder.decodeBool(jsonPath + ".extractAll", json["extr actAll"]);
5741 } else {
5742 throw jsonDecoder.mismatch(jsonPath, "extractAll");
5743 }
5744 return new ExtractMethodOptions(returnType, createGetter, name, parameters , extractAll);
5745 } else {
5746 throw jsonDecoder.mismatch(jsonPath, "extractMethod options", json);
5747 }
5748 }
5749
5750 factory ExtractMethodOptions.fromRefactoringParams(EditGetRefactoringParams re factoringParams, Request request) {
5751 return new ExtractMethodOptions.fromJson(
5752 new RequestDecoder(request), "options", refactoringParams.options);
5753 }
5754
5755 @override
5756 Map<String, dynamic> toJson() {
5757 Map<String, dynamic> result = {};
5758 result["returnType"] = returnType;
5759 result["createGetter"] = createGetter;
5760 result["name"] = name;
5761 result["parameters"] = parameters.map((RefactoringMethodParameter value) => value.toJson()).toList();
5762 result["extractAll"] = extractAll;
5763 return result;
5764 }
5765
5766 @override
5767 String toString() => JSON.encode(toJson());
5768
5769 @override
5770 bool operator==(other) {
5771 if (other is ExtractMethodOptions) {
5772 return returnType == other.returnType &&
5773 createGetter == other.createGetter &&
5774 name == other.name &&
5775 listEqual(parameters, other.parameters, (RefactoringMethodParameter a, RefactoringMethodParameter b) => a == b) &&
5776 extractAll == other.extractAll;
5777 }
5778 return false;
5779 }
5780
5781 @override
5782 int get hashCode {
5783 int hash = 0;
5784 hash = JenkinsSmiHash.combine(hash, returnType.hashCode);
5785 hash = JenkinsSmiHash.combine(hash, createGetter.hashCode);
5786 hash = JenkinsSmiHash.combine(hash, name.hashCode);
5787 hash = JenkinsSmiHash.combine(hash, parameters.hashCode);
5788 hash = JenkinsSmiHash.combine(hash, extractAll.hashCode);
5789 return JenkinsSmiHash.finish(hash);
5790 }
5791 }
5792
5793 /**
5794 * FoldingKind
5795 *
5796 * enum {
5797 * COMMENT
5798 * CLASS_MEMBER
5799 * DIRECTIVES
5800 * DOCUMENTATION_COMMENT
5801 * TOP_LEVEL_DECLARATION
5802 * }
5803 *
5804 * Clients may not extend, implement or mix-in this class.
5805 */
5806 class FoldingKind implements Enum {
5807 static const FoldingKind COMMENT = const FoldingKind._("COMMENT");
5808
5809 static const FoldingKind CLASS_MEMBER = const FoldingKind._("CLASS_MEMBER");
5810
5811 static const FoldingKind DIRECTIVES = const FoldingKind._("DIRECTIVES");
5812
5813 static const FoldingKind DOCUMENTATION_COMMENT = const FoldingKind._("DOCUMENT ATION_COMMENT");
5814
5815 static const FoldingKind TOP_LEVEL_DECLARATION = const FoldingKind._("TOP_LEVE L_DECLARATION");
5816
5817 /**
5818 * A list containing all of the enum values that are defined.
5819 */
5820 static const List<FoldingKind> VALUES = const <FoldingKind>[COMMENT, CLASS_MEM BER, DIRECTIVES, DOCUMENTATION_COMMENT, TOP_LEVEL_DECLARATION];
5821
5822 @override
5823 final String name;
5824
5825 const FoldingKind._(this.name);
5826
5827 factory FoldingKind(String name) {
5828 switch (name) {
5829 case "COMMENT":
5830 return COMMENT;
5831 case "CLASS_MEMBER":
5832 return CLASS_MEMBER;
5833 case "DIRECTIVES":
5834 return DIRECTIVES;
5835 case "DOCUMENTATION_COMMENT":
5836 return DOCUMENTATION_COMMENT;
5837 case "TOP_LEVEL_DECLARATION":
5838 return TOP_LEVEL_DECLARATION;
5839 }
5840 throw new Exception('Illegal enum value: $name');
5841 }
5842
5843 factory FoldingKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
5844 if (json is String) {
5845 try {
5846 return new FoldingKind(json);
5847 } catch(_) {
5848 // Fall through
5849 }
5850 }
5851 throw jsonDecoder.mismatch(jsonPath, "FoldingKind", json);
5852 }
5853
5854 @override
5855 String toString() => "FoldingKind.$name";
5856
5857 String toJson() => name;
5858 }
5859
5860 /**
5861 * FoldingRegion
5862 *
5863 * {
5864 * "kind": FoldingKind
5865 * "offset": int
5866 * "length": int
5867 * }
5868 *
5869 * Clients may not extend, implement or mix-in this class.
5870 */
5871 class FoldingRegion implements HasToJson {
5872 FoldingKind _kind;
5873
5874 int _offset;
5875
5876 int _length;
5877
5878 /**
5879 * The kind of the region.
5880 */
5881 FoldingKind get kind => _kind;
5882
5883 /**
5884 * The kind of the region.
5885 */
5886 void set kind(FoldingKind value) {
5887 assert(value != null);
5888 this._kind = value;
5889 }
5890
5891 /**
5892 * The offset of the region to be folded.
5893 */
5894 int get offset => _offset;
5895
5896 /**
5897 * The offset of the region to be folded.
5898 */
5899 void set offset(int value) {
5900 assert(value != null);
5901 this._offset = value;
5902 }
5903
5904 /**
5905 * The length of the region to be folded.
5906 */
5907 int get length => _length;
5908
5909 /**
5910 * The length of the region to be folded.
5911 */
5912 void set length(int value) {
5913 assert(value != null);
5914 this._length = value;
5915 }
5916
5917 FoldingRegion(FoldingKind kind, int offset, int length) {
5918 this.kind = kind;
5919 this.offset = offset;
5920 this.length = length;
5921 }
5922
5923 factory FoldingRegion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Objec t json) {
5924 if (json == null) {
5925 json = {};
5926 }
5927 if (json is Map) {
5928 FoldingKind kind;
5929 if (json.containsKey("kind")) {
5930 kind = new FoldingKind.fromJson(jsonDecoder, jsonPath + ".kind", json["k ind"]);
5931 } else {
5932 throw jsonDecoder.mismatch(jsonPath, "kind");
5933 }
5934 int offset;
5935 if (json.containsKey("offset")) {
5936 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
5937 } else {
5938 throw jsonDecoder.mismatch(jsonPath, "offset");
5939 }
5940 int length;
5941 if (json.containsKey("length")) {
5942 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
5943 } else {
5944 throw jsonDecoder.mismatch(jsonPath, "length");
5945 }
5946 return new FoldingRegion(kind, offset, length);
5947 } else {
5948 throw jsonDecoder.mismatch(jsonPath, "FoldingRegion", json);
5949 }
5950 }
5951
5952 @override
5953 Map<String, dynamic> toJson() {
5954 Map<String, dynamic> result = {};
5955 result["kind"] = kind.toJson();
5956 result["offset"] = offset;
5957 result["length"] = length;
5958 return result;
5959 }
5960
5961 @override
5962 String toString() => JSON.encode(toJson());
5963
5964 @override
5965 bool operator==(other) {
5966 if (other is FoldingRegion) {
5967 return kind == other.kind &&
5968 offset == other.offset &&
5969 length == other.length;
5970 }
5971 return false;
5972 }
5973
5974 @override
5975 int get hashCode {
5976 int hash = 0;
5977 hash = JenkinsSmiHash.combine(hash, kind.hashCode);
5978 hash = JenkinsSmiHash.combine(hash, offset.hashCode);
5979 hash = JenkinsSmiHash.combine(hash, length.hashCode);
5980 return JenkinsSmiHash.finish(hash);
5981 }
5982 }
5983
5984 /**
5985 * HighlightRegion
5986 *
5987 * {
5988 * "type": HighlightRegionType
5989 * "offset": int
5990 * "length": int
5991 * }
5992 *
5993 * Clients may not extend, implement or mix-in this class.
5994 */
5995 class HighlightRegion implements HasToJson {
5996 HighlightRegionType _type;
5997
5998 int _offset;
5999
6000 int _length;
6001
6002 /**
6003 * The type of highlight associated with the region.
6004 */
6005 HighlightRegionType get type => _type;
6006
6007 /**
6008 * The type of highlight associated with the region.
6009 */
6010 void set type(HighlightRegionType value) {
6011 assert(value != null);
6012 this._type = value;
6013 }
6014
6015 /**
6016 * The offset of the region to be highlighted.
6017 */
6018 int get offset => _offset;
6019
6020 /**
6021 * The offset of the region to be highlighted.
6022 */
6023 void set offset(int value) {
6024 assert(value != null);
6025 this._offset = value;
6026 }
6027
6028 /**
6029 * The length of the region to be highlighted.
6030 */
6031 int get length => _length;
6032
6033 /**
6034 * The length of the region to be highlighted.
6035 */
6036 void set length(int value) {
6037 assert(value != null);
6038 this._length = value;
6039 }
6040
6041 HighlightRegion(HighlightRegionType type, int offset, int length) {
6042 this.type = type;
6043 this.offset = offset;
6044 this.length = length;
6045 }
6046
6047 factory HighlightRegion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obj ect json) {
6048 if (json == null) {
6049 json = {};
6050 }
6051 if (json is Map) {
6052 HighlightRegionType type;
6053 if (json.containsKey("type")) {
6054 type = new HighlightRegionType.fromJson(jsonDecoder, jsonPath + ".type", json["type"]);
6055 } else {
6056 throw jsonDecoder.mismatch(jsonPath, "type");
6057 }
6058 int offset;
6059 if (json.containsKey("offset")) {
6060 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
6061 } else {
6062 throw jsonDecoder.mismatch(jsonPath, "offset");
6063 }
6064 int length;
6065 if (json.containsKey("length")) {
6066 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
6067 } else {
6068 throw jsonDecoder.mismatch(jsonPath, "length");
6069 }
6070 return new HighlightRegion(type, offset, length);
6071 } else {
6072 throw jsonDecoder.mismatch(jsonPath, "HighlightRegion", json);
6073 }
6074 }
6075
6076 @override
6077 Map<String, dynamic> toJson() {
6078 Map<String, dynamic> result = {};
6079 result["type"] = type.toJson();
6080 result["offset"] = offset;
6081 result["length"] = length;
6082 return result;
6083 }
6084
6085 @override
6086 String toString() => JSON.encode(toJson());
6087
6088 @override
6089 bool operator==(other) {
6090 if (other is HighlightRegion) {
6091 return type == other.type &&
6092 offset == other.offset &&
6093 length == other.length;
6094 }
6095 return false;
6096 }
6097
6098 @override
6099 int get hashCode {
6100 int hash = 0;
6101 hash = JenkinsSmiHash.combine(hash, type.hashCode);
6102 hash = JenkinsSmiHash.combine(hash, offset.hashCode);
6103 hash = JenkinsSmiHash.combine(hash, length.hashCode);
6104 return JenkinsSmiHash.finish(hash);
6105 }
6106 }
6107
6108 /**
6109 * HighlightRegionType
6110 *
6111 * enum {
6112 * ANNOTATION
6113 * BUILT_IN
6114 * CLASS
6115 * COMMENT_BLOCK
6116 * COMMENT_DOCUMENTATION
6117 * COMMENT_END_OF_LINE
6118 * CONSTRUCTOR
6119 * DIRECTIVE
6120 * DYNAMIC_TYPE
6121 * DYNAMIC_LOCAL_VARIABLE_DECLARATION
6122 * DYNAMIC_LOCAL_VARIABLE_REFERENCE
6123 * DYNAMIC_PARAMETER_DECLARATION
6124 * DYNAMIC_PARAMETER_REFERENCE
6125 * ENUM
6126 * ENUM_CONSTANT
6127 * FIELD
6128 * FIELD_STATIC
6129 * FUNCTION
6130 * FUNCTION_DECLARATION
6131 * FUNCTION_TYPE_ALIAS
6132 * GETTER_DECLARATION
6133 * IDENTIFIER_DEFAULT
6134 * IMPORT_PREFIX
6135 * INSTANCE_FIELD_DECLARATION
6136 * INSTANCE_FIELD_REFERENCE
6137 * INSTANCE_GETTER_DECLARATION
6138 * INSTANCE_GETTER_REFERENCE
6139 * INSTANCE_METHOD_DECLARATION
6140 * INSTANCE_METHOD_REFERENCE
6141 * INSTANCE_SETTER_DECLARATION
6142 * INSTANCE_SETTER_REFERENCE
6143 * INVALID_STRING_ESCAPE
6144 * KEYWORD
6145 * LABEL
6146 * LIBRARY_NAME
6147 * LITERAL_BOOLEAN
6148 * LITERAL_DOUBLE
6149 * LITERAL_INTEGER
6150 * LITERAL_LIST
6151 * LITERAL_MAP
6152 * LITERAL_STRING
6153 * LOCAL_FUNCTION_DECLARATION
6154 * LOCAL_FUNCTION_REFERENCE
6155 * LOCAL_VARIABLE
6156 * LOCAL_VARIABLE_DECLARATION
6157 * LOCAL_VARIABLE_REFERENCE
6158 * METHOD
6159 * METHOD_DECLARATION
6160 * METHOD_DECLARATION_STATIC
6161 * METHOD_STATIC
6162 * PARAMETER
6163 * SETTER_DECLARATION
6164 * TOP_LEVEL_VARIABLE
6165 * PARAMETER_DECLARATION
6166 * PARAMETER_REFERENCE
6167 * STATIC_FIELD_DECLARATION
6168 * STATIC_GETTER_DECLARATION
6169 * STATIC_GETTER_REFERENCE
6170 * STATIC_METHOD_DECLARATION
6171 * STATIC_METHOD_REFERENCE
6172 * STATIC_SETTER_DECLARATION
6173 * STATIC_SETTER_REFERENCE
6174 * TOP_LEVEL_FUNCTION_DECLARATION
6175 * TOP_LEVEL_FUNCTION_REFERENCE
6176 * TOP_LEVEL_GETTER_DECLARATION
6177 * TOP_LEVEL_GETTER_REFERENCE
6178 * TOP_LEVEL_SETTER_DECLARATION
6179 * TOP_LEVEL_SETTER_REFERENCE
6180 * TOP_LEVEL_VARIABLE_DECLARATION
6181 * TYPE_NAME_DYNAMIC
6182 * TYPE_PARAMETER
6183 * UNRESOLVED_INSTANCE_MEMBER_REFERENCE
6184 * VALID_STRING_ESCAPE
6185 * }
6186 *
6187 * Clients may not extend, implement or mix-in this class.
6188 */
6189 class HighlightRegionType implements Enum {
6190 static const HighlightRegionType ANNOTATION = const HighlightRegionType._("ANN OTATION");
6191
6192 static const HighlightRegionType BUILT_IN = const HighlightRegionType._("BUILT _IN");
6193
6194 static const HighlightRegionType CLASS = const HighlightRegionType._("CLASS");
6195
6196 static const HighlightRegionType COMMENT_BLOCK = const HighlightRegionType._(" COMMENT_BLOCK");
6197
6198 static const HighlightRegionType COMMENT_DOCUMENTATION = const HighlightRegion Type._("COMMENT_DOCUMENTATION");
6199
6200 static const HighlightRegionType COMMENT_END_OF_LINE = const HighlightRegionTy pe._("COMMENT_END_OF_LINE");
6201
6202 static const HighlightRegionType CONSTRUCTOR = const HighlightRegionType._("CO NSTRUCTOR");
6203
6204 static const HighlightRegionType DIRECTIVE = const HighlightRegionType._("DIRE CTIVE");
6205
6206 /**
6207 * Only for version 1 of highlight.
6208 */
6209 static const HighlightRegionType DYNAMIC_TYPE = const HighlightRegionType._("D YNAMIC_TYPE");
6210
6211 /**
6212 * Only for version 2 of highlight.
6213 */
6214 static const HighlightRegionType DYNAMIC_LOCAL_VARIABLE_DECLARATION = const Hi ghlightRegionType._("DYNAMIC_LOCAL_VARIABLE_DECLARATION");
6215
6216 /**
6217 * Only for version 2 of highlight.
6218 */
6219 static const HighlightRegionType DYNAMIC_LOCAL_VARIABLE_REFERENCE = const High lightRegionType._("DYNAMIC_LOCAL_VARIABLE_REFERENCE");
6220
6221 /**
6222 * Only for version 2 of highlight.
6223 */
6224 static const HighlightRegionType DYNAMIC_PARAMETER_DECLARATION = const Highlig htRegionType._("DYNAMIC_PARAMETER_DECLARATION");
6225
6226 /**
6227 * Only for version 2 of highlight.
6228 */
6229 static const HighlightRegionType DYNAMIC_PARAMETER_REFERENCE = const Highlight RegionType._("DYNAMIC_PARAMETER_REFERENCE");
6230
6231 static const HighlightRegionType ENUM = const HighlightRegionType._("ENUM");
6232
6233 static const HighlightRegionType ENUM_CONSTANT = const HighlightRegionType._(" ENUM_CONSTANT");
6234
6235 /**
6236 * Only for version 1 of highlight.
6237 */
6238 static const HighlightRegionType FIELD = const HighlightRegionType._("FIELD");
6239
6240 /**
6241 * Only for version 1 of highlight.
6242 */
6243 static const HighlightRegionType FIELD_STATIC = const HighlightRegionType._("F IELD_STATIC");
6244
6245 /**
6246 * Only for version 1 of highlight.
6247 */
6248 static const HighlightRegionType FUNCTION = const HighlightRegionType._("FUNCT ION");
6249
6250 /**
6251 * Only for version 1 of highlight.
6252 */
6253 static const HighlightRegionType FUNCTION_DECLARATION = const HighlightRegionT ype._("FUNCTION_DECLARATION");
6254
6255 static const HighlightRegionType FUNCTION_TYPE_ALIAS = const HighlightRegionTy pe._("FUNCTION_TYPE_ALIAS");
6256
6257 /**
6258 * Only for version 1 of highlight.
6259 */
6260 static const HighlightRegionType GETTER_DECLARATION = const HighlightRegionTyp e._("GETTER_DECLARATION");
6261
6262 static const HighlightRegionType IDENTIFIER_DEFAULT = const HighlightRegionTyp e._("IDENTIFIER_DEFAULT");
6263
6264 static const HighlightRegionType IMPORT_PREFIX = const HighlightRegionType._(" IMPORT_PREFIX");
6265
6266 /**
6267 * Only for version 2 of highlight.
6268 */
6269 static const HighlightRegionType INSTANCE_FIELD_DECLARATION = const HighlightR egionType._("INSTANCE_FIELD_DECLARATION");
6270
6271 /**
6272 * Only for version 2 of highlight.
6273 */
6274 static const HighlightRegionType INSTANCE_FIELD_REFERENCE = const HighlightReg ionType._("INSTANCE_FIELD_REFERENCE");
6275
6276 /**
6277 * Only for version 2 of highlight.
6278 */
6279 static const HighlightRegionType INSTANCE_GETTER_DECLARATION = const Highlight RegionType._("INSTANCE_GETTER_DECLARATION");
6280
6281 /**
6282 * Only for version 2 of highlight.
6283 */
6284 static const HighlightRegionType INSTANCE_GETTER_REFERENCE = const HighlightRe gionType._("INSTANCE_GETTER_REFERENCE");
6285
6286 /**
6287 * Only for version 2 of highlight.
6288 */
6289 static const HighlightRegionType INSTANCE_METHOD_DECLARATION = const Highlight RegionType._("INSTANCE_METHOD_DECLARATION");
6290
6291 /**
6292 * Only for version 2 of highlight.
6293 */
6294 static const HighlightRegionType INSTANCE_METHOD_REFERENCE = const HighlightRe gionType._("INSTANCE_METHOD_REFERENCE");
6295
6296 /**
6297 * Only for version 2 of highlight.
6298 */
6299 static const HighlightRegionType INSTANCE_SETTER_DECLARATION = const Highlight RegionType._("INSTANCE_SETTER_DECLARATION");
6300
6301 /**
6302 * Only for version 2 of highlight.
6303 */
6304 static const HighlightRegionType INSTANCE_SETTER_REFERENCE = const HighlightRe gionType._("INSTANCE_SETTER_REFERENCE");
6305
6306 /**
6307 * Only for version 2 of highlight.
6308 */
6309 static const HighlightRegionType INVALID_STRING_ESCAPE = const HighlightRegion Type._("INVALID_STRING_ESCAPE");
6310
6311 static const HighlightRegionType KEYWORD = const HighlightRegionType._("KEYWOR D");
6312
6313 static const HighlightRegionType LABEL = const HighlightRegionType._("LABEL");
6314
6315 /**
6316 * Only for version 2 of highlight.
6317 */
6318 static const HighlightRegionType LIBRARY_NAME = const HighlightRegionType._("L IBRARY_NAME");
6319
6320 static const HighlightRegionType LITERAL_BOOLEAN = const HighlightRegionType._ ("LITERAL_BOOLEAN");
6321
6322 static const HighlightRegionType LITERAL_DOUBLE = const HighlightRegionType._( "LITERAL_DOUBLE");
6323
6324 static const HighlightRegionType LITERAL_INTEGER = const HighlightRegionType._ ("LITERAL_INTEGER");
6325
6326 static const HighlightRegionType LITERAL_LIST = const HighlightRegionType._("L ITERAL_LIST");
6327
6328 static const HighlightRegionType LITERAL_MAP = const HighlightRegionType._("LI TERAL_MAP");
6329
6330 static const HighlightRegionType LITERAL_STRING = const HighlightRegionType._( "LITERAL_STRING");
6331
6332 /**
6333 * Only for version 2 of highlight.
6334 */
6335 static const HighlightRegionType LOCAL_FUNCTION_DECLARATION = const HighlightR egionType._("LOCAL_FUNCTION_DECLARATION");
6336
6337 /**
6338 * Only for version 2 of highlight.
6339 */
6340 static const HighlightRegionType LOCAL_FUNCTION_REFERENCE = const HighlightReg ionType._("LOCAL_FUNCTION_REFERENCE");
6341
6342 /**
6343 * Only for version 1 of highlight.
6344 */
6345 static const HighlightRegionType LOCAL_VARIABLE = const HighlightRegionType._( "LOCAL_VARIABLE");
6346
6347 static const HighlightRegionType LOCAL_VARIABLE_DECLARATION = const HighlightR egionType._("LOCAL_VARIABLE_DECLARATION");
6348
6349 /**
6350 * Only for version 2 of highlight.
6351 */
6352 static const HighlightRegionType LOCAL_VARIABLE_REFERENCE = const HighlightReg ionType._("LOCAL_VARIABLE_REFERENCE");
6353
6354 /**
6355 * Only for version 1 of highlight.
6356 */
6357 static const HighlightRegionType METHOD = const HighlightRegionType._("METHOD" );
6358
6359 /**
6360 * Only for version 1 of highlight.
6361 */
6362 static const HighlightRegionType METHOD_DECLARATION = const HighlightRegionTyp e._("METHOD_DECLARATION");
6363
6364 /**
6365 * Only for version 1 of highlight.
6366 */
6367 static const HighlightRegionType METHOD_DECLARATION_STATIC = const HighlightRe gionType._("METHOD_DECLARATION_STATIC");
6368
6369 /**
6370 * Only for version 1 of highlight.
6371 */
6372 static const HighlightRegionType METHOD_STATIC = const HighlightRegionType._(" METHOD_STATIC");
6373
6374 /**
6375 * Only for version 1 of highlight.
6376 */
6377 static const HighlightRegionType PARAMETER = const HighlightRegionType._("PARA METER");
6378
6379 /**
6380 * Only for version 1 of highlight.
6381 */
6382 static const HighlightRegionType SETTER_DECLARATION = const HighlightRegionTyp e._("SETTER_DECLARATION");
6383
6384 /**
6385 * Only for version 1 of highlight.
6386 */
6387 static const HighlightRegionType TOP_LEVEL_VARIABLE = const HighlightRegionTyp e._("TOP_LEVEL_VARIABLE");
6388
6389 /**
6390 * Only for version 2 of highlight.
6391 */
6392 static const HighlightRegionType PARAMETER_DECLARATION = const HighlightRegion Type._("PARAMETER_DECLARATION");
6393
6394 /**
6395 * Only for version 2 of highlight.
6396 */
6397 static const HighlightRegionType PARAMETER_REFERENCE = const HighlightRegionTy pe._("PARAMETER_REFERENCE");
6398
6399 /**
6400 * Only for version 2 of highlight.
6401 */
6402 static const HighlightRegionType STATIC_FIELD_DECLARATION = const HighlightReg ionType._("STATIC_FIELD_DECLARATION");
6403
6404 /**
6405 * Only for version 2 of highlight.
6406 */
6407 static const HighlightRegionType STATIC_GETTER_DECLARATION = const HighlightRe gionType._("STATIC_GETTER_DECLARATION");
6408
6409 /**
6410 * Only for version 2 of highlight.
6411 */
6412 static const HighlightRegionType STATIC_GETTER_REFERENCE = const HighlightRegi onType._("STATIC_GETTER_REFERENCE");
6413
6414 /**
6415 * Only for version 2 of highlight.
6416 */
6417 static const HighlightRegionType STATIC_METHOD_DECLARATION = const HighlightRe gionType._("STATIC_METHOD_DECLARATION");
6418
6419 /**
6420 * Only for version 2 of highlight.
6421 */
6422 static const HighlightRegionType STATIC_METHOD_REFERENCE = const HighlightRegi onType._("STATIC_METHOD_REFERENCE");
6423
6424 /**
6425 * Only for version 2 of highlight.
6426 */
6427 static const HighlightRegionType STATIC_SETTER_DECLARATION = const HighlightRe gionType._("STATIC_SETTER_DECLARATION");
6428
6429 /**
6430 * Only for version 2 of highlight.
6431 */
6432 static const HighlightRegionType STATIC_SETTER_REFERENCE = const HighlightRegi onType._("STATIC_SETTER_REFERENCE");
6433
6434 /**
6435 * Only for version 2 of highlight.
6436 */
6437 static const HighlightRegionType TOP_LEVEL_FUNCTION_DECLARATION = const Highli ghtRegionType._("TOP_LEVEL_FUNCTION_DECLARATION");
6438
6439 /**
6440 * Only for version 2 of highlight.
6441 */
6442 static const HighlightRegionType TOP_LEVEL_FUNCTION_REFERENCE = const Highligh tRegionType._("TOP_LEVEL_FUNCTION_REFERENCE");
6443
6444 /**
6445 * Only for version 2 of highlight.
6446 */
6447 static const HighlightRegionType TOP_LEVEL_GETTER_DECLARATION = const Highligh tRegionType._("TOP_LEVEL_GETTER_DECLARATION");
6448
6449 /**
6450 * Only for version 2 of highlight.
6451 */
6452 static const HighlightRegionType TOP_LEVEL_GETTER_REFERENCE = const HighlightR egionType._("TOP_LEVEL_GETTER_REFERENCE");
6453
6454 /**
6455 * Only for version 2 of highlight.
6456 */
6457 static const HighlightRegionType TOP_LEVEL_SETTER_DECLARATION = const Highligh tRegionType._("TOP_LEVEL_SETTER_DECLARATION");
6458
6459 /**
6460 * Only for version 2 of highlight.
6461 */
6462 static const HighlightRegionType TOP_LEVEL_SETTER_REFERENCE = const HighlightR egionType._("TOP_LEVEL_SETTER_REFERENCE");
6463
6464 /**
6465 * Only for version 2 of highlight.
6466 */
6467 static const HighlightRegionType TOP_LEVEL_VARIABLE_DECLARATION = const Highli ghtRegionType._("TOP_LEVEL_VARIABLE_DECLARATION");
6468
6469 static const HighlightRegionType TYPE_NAME_DYNAMIC = const HighlightRegionType ._("TYPE_NAME_DYNAMIC");
6470
6471 static const HighlightRegionType TYPE_PARAMETER = const HighlightRegionType._( "TYPE_PARAMETER");
6472
6473 /**
6474 * Only for version 2 of highlight.
6475 */
6476 static const HighlightRegionType UNRESOLVED_INSTANCE_MEMBER_REFERENCE = const HighlightRegionType._("UNRESOLVED_INSTANCE_MEMBER_REFERENCE");
6477
6478 /**
6479 * Only for version 2 of highlight.
6480 */
6481 static const HighlightRegionType VALID_STRING_ESCAPE = const HighlightRegionTy pe._("VALID_STRING_ESCAPE");
6482
6483 /**
6484 * A list containing all of the enum values that are defined.
6485 */
6486 static const List<HighlightRegionType> VALUES = const <HighlightRegionType>[AN NOTATION, BUILT_IN, CLASS, COMMENT_BLOCK, COMMENT_DOCUMENTATION, COMMENT_END_OF_ LINE, CONSTRUCTOR, DIRECTIVE, DYNAMIC_TYPE, DYNAMIC_LOCAL_VARIABLE_DECLARATION, DYNAMIC_LOCAL_VARIABLE_REFERENCE, DYNAMIC_PARAMETER_DECLARATION, DYNAMIC_PARAMET ER_REFERENCE, ENUM, ENUM_CONSTANT, FIELD, FIELD_STATIC, FUNCTION, FUNCTION_DECLA RATION, FUNCTION_TYPE_ALIAS, GETTER_DECLARATION, IDENTIFIER_DEFAULT, IMPORT_PREF IX, INSTANCE_FIELD_DECLARATION, INSTANCE_FIELD_REFERENCE, INSTANCE_GETTER_DECLAR ATION, INSTANCE_GETTER_REFERENCE, INSTANCE_METHOD_DECLARATION, INSTANCE_METHOD_R EFERENCE, INSTANCE_SETTER_DECLARATION, INSTANCE_SETTER_REFERENCE, INVALID_STRING _ESCAPE, KEYWORD, LABEL, LIBRARY_NAME, LITERAL_BOOLEAN, LITERAL_DOUBLE, LITERAL_ INTEGER, LITERAL_LIST, LITERAL_MAP, LITERAL_STRING, LOCAL_FUNCTION_DECLARATION, LOCAL_FUNCTION_REFERENCE, LOCAL_VARIABLE, LOCAL_VARIABLE_DECLARATION, LOCAL_VARI ABLE_REFERENCE, METHOD, METHOD_DECLARATION, METHOD_DECLARATION_STATIC, METHOD_ST ATIC, PARAMETER, SETTER_DECLARATION, TOP_LEVEL_VARIABLE, PARAMETER_DECLARATION, PARAMETER_REFERENCE, STATIC_FIELD_DECLARATION, STATIC_GETTER_DECLARATION, STATIC _GETTER_REFERENCE, STATIC_METHOD_DECLARATION, STATIC_METHOD_REFERENCE, STATIC_SE TTER_DECLARATION, STATIC_SETTER_REFERENCE, TOP_LEVEL_FUNCTION_DECLARATION, TOP_L EVEL_FUNCTION_REFERENCE, TOP_LEVEL_GETTER_DECLARATION, TOP_LEVEL_GETTER_REFERENC E, TOP_LEVEL_SETTER_DECLARATION, TOP_LEVEL_SETTER_REFERENCE, TOP_LEVEL_VARIABLE_ DECLARATION, TYPE_NAME_DYNAMIC, TYPE_PARAMETER, UNRESOLVED_INSTANCE_MEMBER_REFER ENCE, VALID_STRING_ESCAPE];
6487
6488 @override
6489 final String name;
6490
6491 const HighlightRegionType._(this.name);
6492
6493 factory HighlightRegionType(String name) {
6494 switch (name) {
6495 case "ANNOTATION":
6496 return ANNOTATION;
6497 case "BUILT_IN":
6498 return BUILT_IN;
6499 case "CLASS":
6500 return CLASS;
6501 case "COMMENT_BLOCK":
6502 return COMMENT_BLOCK;
6503 case "COMMENT_DOCUMENTATION":
6504 return COMMENT_DOCUMENTATION;
6505 case "COMMENT_END_OF_LINE":
6506 return COMMENT_END_OF_LINE;
6507 case "CONSTRUCTOR":
6508 return CONSTRUCTOR;
6509 case "DIRECTIVE":
6510 return DIRECTIVE;
6511 case "DYNAMIC_TYPE":
6512 return DYNAMIC_TYPE;
6513 case "DYNAMIC_LOCAL_VARIABLE_DECLARATION":
6514 return DYNAMIC_LOCAL_VARIABLE_DECLARATION;
6515 case "DYNAMIC_LOCAL_VARIABLE_REFERENCE":
6516 return DYNAMIC_LOCAL_VARIABLE_REFERENCE;
6517 case "DYNAMIC_PARAMETER_DECLARATION":
6518 return DYNAMIC_PARAMETER_DECLARATION;
6519 case "DYNAMIC_PARAMETER_REFERENCE":
6520 return DYNAMIC_PARAMETER_REFERENCE;
6521 case "ENUM":
6522 return ENUM;
6523 case "ENUM_CONSTANT":
6524 return ENUM_CONSTANT;
6525 case "FIELD":
6526 return FIELD;
6527 case "FIELD_STATIC":
6528 return FIELD_STATIC;
6529 case "FUNCTION":
6530 return FUNCTION;
6531 case "FUNCTION_DECLARATION":
6532 return FUNCTION_DECLARATION;
6533 case "FUNCTION_TYPE_ALIAS":
6534 return FUNCTION_TYPE_ALIAS;
6535 case "GETTER_DECLARATION":
6536 return GETTER_DECLARATION;
6537 case "IDENTIFIER_DEFAULT":
6538 return IDENTIFIER_DEFAULT;
6539 case "IMPORT_PREFIX":
6540 return IMPORT_PREFIX;
6541 case "INSTANCE_FIELD_DECLARATION":
6542 return INSTANCE_FIELD_DECLARATION;
6543 case "INSTANCE_FIELD_REFERENCE":
6544 return INSTANCE_FIELD_REFERENCE;
6545 case "INSTANCE_GETTER_DECLARATION":
6546 return INSTANCE_GETTER_DECLARATION;
6547 case "INSTANCE_GETTER_REFERENCE":
6548 return INSTANCE_GETTER_REFERENCE;
6549 case "INSTANCE_METHOD_DECLARATION":
6550 return INSTANCE_METHOD_DECLARATION;
6551 case "INSTANCE_METHOD_REFERENCE":
6552 return INSTANCE_METHOD_REFERENCE;
6553 case "INSTANCE_SETTER_DECLARATION":
6554 return INSTANCE_SETTER_DECLARATION;
6555 case "INSTANCE_SETTER_REFERENCE":
6556 return INSTANCE_SETTER_REFERENCE;
6557 case "INVALID_STRING_ESCAPE":
6558 return INVALID_STRING_ESCAPE;
6559 case "KEYWORD":
6560 return KEYWORD;
6561 case "LABEL":
6562 return LABEL;
6563 case "LIBRARY_NAME":
6564 return LIBRARY_NAME;
6565 case "LITERAL_BOOLEAN":
6566 return LITERAL_BOOLEAN;
6567 case "LITERAL_DOUBLE":
6568 return LITERAL_DOUBLE;
6569 case "LITERAL_INTEGER":
6570 return LITERAL_INTEGER;
6571 case "LITERAL_LIST":
6572 return LITERAL_LIST;
6573 case "LITERAL_MAP":
6574 return LITERAL_MAP;
6575 case "LITERAL_STRING":
6576 return LITERAL_STRING;
6577 case "LOCAL_FUNCTION_DECLARATION":
6578 return LOCAL_FUNCTION_DECLARATION;
6579 case "LOCAL_FUNCTION_REFERENCE":
6580 return LOCAL_FUNCTION_REFERENCE;
6581 case "LOCAL_VARIABLE":
6582 return LOCAL_VARIABLE;
6583 case "LOCAL_VARIABLE_DECLARATION":
6584 return LOCAL_VARIABLE_DECLARATION;
6585 case "LOCAL_VARIABLE_REFERENCE":
6586 return LOCAL_VARIABLE_REFERENCE;
6587 case "METHOD":
6588 return METHOD;
6589 case "METHOD_DECLARATION":
6590 return METHOD_DECLARATION;
6591 case "METHOD_DECLARATION_STATIC":
6592 return METHOD_DECLARATION_STATIC;
6593 case "METHOD_STATIC":
6594 return METHOD_STATIC;
6595 case "PARAMETER":
6596 return PARAMETER;
6597 case "SETTER_DECLARATION":
6598 return SETTER_DECLARATION;
6599 case "TOP_LEVEL_VARIABLE":
6600 return TOP_LEVEL_VARIABLE;
6601 case "PARAMETER_DECLARATION":
6602 return PARAMETER_DECLARATION;
6603 case "PARAMETER_REFERENCE":
6604 return PARAMETER_REFERENCE;
6605 case "STATIC_FIELD_DECLARATION":
6606 return STATIC_FIELD_DECLARATION;
6607 case "STATIC_GETTER_DECLARATION":
6608 return STATIC_GETTER_DECLARATION;
6609 case "STATIC_GETTER_REFERENCE":
6610 return STATIC_GETTER_REFERENCE;
6611 case "STATIC_METHOD_DECLARATION":
6612 return STATIC_METHOD_DECLARATION;
6613 case "STATIC_METHOD_REFERENCE":
6614 return STATIC_METHOD_REFERENCE;
6615 case "STATIC_SETTER_DECLARATION":
6616 return STATIC_SETTER_DECLARATION;
6617 case "STATIC_SETTER_REFERENCE":
6618 return STATIC_SETTER_REFERENCE;
6619 case "TOP_LEVEL_FUNCTION_DECLARATION":
6620 return TOP_LEVEL_FUNCTION_DECLARATION;
6621 case "TOP_LEVEL_FUNCTION_REFERENCE":
6622 return TOP_LEVEL_FUNCTION_REFERENCE;
6623 case "TOP_LEVEL_GETTER_DECLARATION":
6624 return TOP_LEVEL_GETTER_DECLARATION;
6625 case "TOP_LEVEL_GETTER_REFERENCE":
6626 return TOP_LEVEL_GETTER_REFERENCE;
6627 case "TOP_LEVEL_SETTER_DECLARATION":
6628 return TOP_LEVEL_SETTER_DECLARATION;
6629 case "TOP_LEVEL_SETTER_REFERENCE":
6630 return TOP_LEVEL_SETTER_REFERENCE;
6631 case "TOP_LEVEL_VARIABLE_DECLARATION":
6632 return TOP_LEVEL_VARIABLE_DECLARATION;
6633 case "TYPE_NAME_DYNAMIC":
6634 return TYPE_NAME_DYNAMIC;
6635 case "TYPE_PARAMETER":
6636 return TYPE_PARAMETER;
6637 case "UNRESOLVED_INSTANCE_MEMBER_REFERENCE":
6638 return UNRESOLVED_INSTANCE_MEMBER_REFERENCE;
6639 case "VALID_STRING_ESCAPE":
6640 return VALID_STRING_ESCAPE;
6641 }
6642 throw new Exception('Illegal enum value: $name');
6643 }
6644
6645 factory HighlightRegionType.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
6646 if (json is String) {
6647 try {
6648 return new HighlightRegionType(json);
6649 } catch(_) {
6650 // Fall through
6651 }
6652 }
6653 throw jsonDecoder.mismatch(jsonPath, "HighlightRegionType", json);
6654 }
6655
6656 @override
6657 String toString() => "HighlightRegionType.$name";
6658
6659 String toJson() => name;
6660 }
6661
6662 /**
6663 * inlineLocalVariable feedback
6664 *
6665 * {
6666 * "name": String
6667 * "occurrences": int
6668 * }
6669 *
6670 * Clients may not extend, implement or mix-in this class.
6671 */
6672 class InlineLocalVariableFeedback extends RefactoringFeedback {
6673 String _name;
6674
6675 int _occurrences;
6676
6677 /**
6678 * The name of the variable being inlined.
6679 */
6680 String get name => _name;
6681
6682 /**
6683 * The name of the variable being inlined.
6684 */
6685 void set name(String value) {
6686 assert(value != null);
6687 this._name = value;
6688 }
6689
6690 /**
6691 * The number of times the variable occurs.
6692 */
6693 int get occurrences => _occurrences;
6694
6695 /**
6696 * The number of times the variable occurs.
6697 */
6698 void set occurrences(int value) {
6699 assert(value != null);
6700 this._occurrences = value;
6701 }
6702
6703 InlineLocalVariableFeedback(String name, int occurrences) {
6704 this.name = name;
6705 this.occurrences = occurrences;
6706 }
6707
6708 factory InlineLocalVariableFeedback.fromJson(JsonDecoder jsonDecoder, String j sonPath, Object json) {
6709 if (json == null) {
6710 json = {};
6711 }
6712 if (json is Map) {
6713 String name;
6714 if (json.containsKey("name")) {
6715 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
6716 } else {
6717 throw jsonDecoder.mismatch(jsonPath, "name");
6718 }
6719 int occurrences;
6720 if (json.containsKey("occurrences")) {
6721 occurrences = jsonDecoder.decodeInt(jsonPath + ".occurrences", json["occ urrences"]);
6722 } else {
6723 throw jsonDecoder.mismatch(jsonPath, "occurrences");
6724 }
6725 return new InlineLocalVariableFeedback(name, occurrences);
6726 } else {
6727 throw jsonDecoder.mismatch(jsonPath, "inlineLocalVariable feedback", json) ;
6728 }
6729 }
6730
6731 @override
6732 Map<String, dynamic> toJson() {
6733 Map<String, dynamic> result = {};
6734 result["name"] = name;
6735 result["occurrences"] = occurrences;
6736 return result;
6737 }
6738
6739 @override
6740 String toString() => JSON.encode(toJson());
6741
6742 @override
6743 bool operator==(other) {
6744 if (other is InlineLocalVariableFeedback) {
6745 return name == other.name &&
6746 occurrences == other.occurrences;
6747 }
6748 return false;
6749 }
6750
6751 @override
6752 int get hashCode {
6753 int hash = 0;
6754 hash = JenkinsSmiHash.combine(hash, name.hashCode);
6755 hash = JenkinsSmiHash.combine(hash, occurrences.hashCode);
6756 return JenkinsSmiHash.finish(hash);
6757 }
6758 }
6759
6760 /**
6761 * inlineLocalVariable options
6762 *
6763 * Clients may not extend, implement or mix-in this class.
6764 */
6765 class InlineLocalVariableOptions extends RefactoringOptions implements HasToJson {
6766 @override
6767 bool operator==(other) {
6768 if (other is InlineLocalVariableOptions) {
6769 return true;
6770 }
6771 return false;
6772 }
6773
6774 @override
6775 int get hashCode {
6776 return 540364977;
6777 }
6778 }
6779
6780 /**
6781 * inlineMethod feedback
6782 *
6783 * {
6784 * "className": optional String
6785 * "methodName": String
6786 * "isDeclaration": bool
6787 * }
6788 *
6789 * Clients may not extend, implement or mix-in this class.
6790 */
6791 class InlineMethodFeedback extends RefactoringFeedback {
6792 String _className;
6793
6794 String _methodName;
6795
6796 bool _isDeclaration;
6797
6798 /**
6799 * The name of the class enclosing the method being inlined. If not a class
6800 * member is being inlined, this field will be absent.
6801 */
6802 String get className => _className;
6803
6804 /**
6805 * The name of the class enclosing the method being inlined. If not a class
6806 * member is being inlined, this field will be absent.
6807 */
6808 void set className(String value) {
6809 this._className = value;
6810 }
6811
6812 /**
6813 * The name of the method (or function) being inlined.
6814 */
6815 String get methodName => _methodName;
6816
6817 /**
6818 * The name of the method (or function) being inlined.
6819 */
6820 void set methodName(String value) {
6821 assert(value != null);
6822 this._methodName = value;
6823 }
6824
6825 /**
6826 * True if the declaration of the method is selected and all references
6827 * should be inlined.
6828 */
6829 bool get isDeclaration => _isDeclaration;
6830
6831 /**
6832 * True if the declaration of the method is selected and all references
6833 * should be inlined.
6834 */
6835 void set isDeclaration(bool value) {
6836 assert(value != null);
6837 this._isDeclaration = value;
6838 }
6839
6840 InlineMethodFeedback(String methodName, bool isDeclaration, {String className} ) {
6841 this.className = className;
6842 this.methodName = methodName;
6843 this.isDeclaration = isDeclaration;
6844 }
6845
6846 factory InlineMethodFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath , Object json) {
6847 if (json == null) {
6848 json = {};
6849 }
6850 if (json is Map) {
6851 String className;
6852 if (json.containsKey("className")) {
6853 className = jsonDecoder.decodeString(jsonPath + ".className", json["clas sName"]);
6854 }
6855 String methodName;
6856 if (json.containsKey("methodName")) {
6857 methodName = jsonDecoder.decodeString(jsonPath + ".methodName", json["me thodName"]);
6858 } else {
6859 throw jsonDecoder.mismatch(jsonPath, "methodName");
6860 }
6861 bool isDeclaration;
6862 if (json.containsKey("isDeclaration")) {
6863 isDeclaration = jsonDecoder.decodeBool(jsonPath + ".isDeclaration", json ["isDeclaration"]);
6864 } else {
6865 throw jsonDecoder.mismatch(jsonPath, "isDeclaration");
6866 }
6867 return new InlineMethodFeedback(methodName, isDeclaration, className: clas sName);
6868 } else {
6869 throw jsonDecoder.mismatch(jsonPath, "inlineMethod feedback", json);
6870 }
6871 }
6872
6873 @override
6874 Map<String, dynamic> toJson() {
6875 Map<String, dynamic> result = {};
6876 if (className != null) {
6877 result["className"] = className;
6878 }
6879 result["methodName"] = methodName;
6880 result["isDeclaration"] = isDeclaration;
6881 return result;
6882 }
6883
6884 @override
6885 String toString() => JSON.encode(toJson());
6886
6887 @override
6888 bool operator==(other) {
6889 if (other is InlineMethodFeedback) {
6890 return className == other.className &&
6891 methodName == other.methodName &&
6892 isDeclaration == other.isDeclaration;
6893 }
6894 return false;
6895 }
6896
6897 @override
6898 int get hashCode {
6899 int hash = 0;
6900 hash = JenkinsSmiHash.combine(hash, className.hashCode);
6901 hash = JenkinsSmiHash.combine(hash, methodName.hashCode);
6902 hash = JenkinsSmiHash.combine(hash, isDeclaration.hashCode);
6903 return JenkinsSmiHash.finish(hash);
6904 }
6905 }
6906
6907 /**
6908 * inlineMethod options
6909 *
6910 * {
6911 * "deleteSource": bool
6912 * "inlineAll": bool
6913 * }
6914 *
6915 * Clients may not extend, implement or mix-in this class.
6916 */
6917 class InlineMethodOptions extends RefactoringOptions {
6918 bool _deleteSource;
6919
6920 bool _inlineAll;
6921
6922 /**
6923 * True if the method being inlined should be removed. It is an error if this
6924 * field is true and inlineAll is false.
6925 */
6926 bool get deleteSource => _deleteSource;
6927
6928 /**
6929 * True if the method being inlined should be removed. It is an error if this
6930 * field is true and inlineAll is false.
6931 */
6932 void set deleteSource(bool value) {
6933 assert(value != null);
6934 this._deleteSource = value;
6935 }
6936
6937 /**
6938 * True if all invocations of the method should be inlined, or false if only
6939 * the invocation site used to create this refactoring should be inlined.
6940 */
6941 bool get inlineAll => _inlineAll;
6942
6943 /**
6944 * True if all invocations of the method should be inlined, or false if only
6945 * the invocation site used to create this refactoring should be inlined.
6946 */
6947 void set inlineAll(bool value) {
6948 assert(value != null);
6949 this._inlineAll = value;
6950 }
6951
6952 InlineMethodOptions(bool deleteSource, bool inlineAll) {
6953 this.deleteSource = deleteSource;
6954 this.inlineAll = inlineAll;
6955 }
6956
6957 factory InlineMethodOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
6958 if (json == null) {
6959 json = {};
6960 }
6961 if (json is Map) {
6962 bool deleteSource;
6963 if (json.containsKey("deleteSource")) {
6964 deleteSource = jsonDecoder.decodeBool(jsonPath + ".deleteSource", json[" deleteSource"]);
6965 } else {
6966 throw jsonDecoder.mismatch(jsonPath, "deleteSource");
6967 }
6968 bool inlineAll;
6969 if (json.containsKey("inlineAll")) {
6970 inlineAll = jsonDecoder.decodeBool(jsonPath + ".inlineAll", json["inline All"]);
6971 } else {
6972 throw jsonDecoder.mismatch(jsonPath, "inlineAll");
6973 }
6974 return new InlineMethodOptions(deleteSource, inlineAll);
6975 } else {
6976 throw jsonDecoder.mismatch(jsonPath, "inlineMethod options", json);
6977 }
6978 }
6979
6980 factory InlineMethodOptions.fromRefactoringParams(EditGetRefactoringParams ref actoringParams, Request request) {
6981 return new InlineMethodOptions.fromJson(
6982 new RequestDecoder(request), "options", refactoringParams.options);
6983 }
6984
6985 @override
6986 Map<String, dynamic> toJson() {
6987 Map<String, dynamic> result = {};
6988 result["deleteSource"] = deleteSource;
6989 result["inlineAll"] = inlineAll;
6990 return result;
6991 }
6992
6993 @override
6994 String toString() => JSON.encode(toJson());
6995
6996 @override
6997 bool operator==(other) {
6998 if (other is InlineMethodOptions) {
6999 return deleteSource == other.deleteSource &&
7000 inlineAll == other.inlineAll;
7001 }
7002 return false;
7003 }
7004
7005 @override
7006 int get hashCode {
7007 int hash = 0;
7008 hash = JenkinsSmiHash.combine(hash, deleteSource.hashCode);
7009 hash = JenkinsSmiHash.combine(hash, inlineAll.hashCode);
7010 return JenkinsSmiHash.finish(hash);
7011 }
7012 }
7013
7014 /**
7015 * LinkedEditGroup
7016 *
7017 * {
7018 * "positions": List<Position>
7019 * "length": int
7020 * "suggestions": List<LinkedEditSuggestion>
7021 * }
7022 *
7023 * Clients may not extend, implement or mix-in this class.
7024 */
7025 class LinkedEditGroup implements HasToJson {
7026 List<Position> _positions;
7027
7028 int _length;
7029
7030 List<LinkedEditSuggestion> _suggestions;
7031
7032 /**
7033 * The positions of the regions that should be edited simultaneously.
7034 */
7035 List<Position> get positions => _positions;
7036
7037 /**
7038 * The positions of the regions that should be edited simultaneously.
7039 */
7040 void set positions(List<Position> value) {
7041 assert(value != null);
7042 this._positions = value;
7043 }
7044
7045 /**
7046 * The length of the regions that should be edited simultaneously.
7047 */
7048 int get length => _length;
7049
7050 /**
7051 * The length of the regions that should be edited simultaneously.
7052 */
7053 void set length(int value) {
7054 assert(value != null);
7055 this._length = value;
7056 }
7057
7058 /**
7059 * Pre-computed suggestions for what every region might want to be changed
7060 * to.
7061 */
7062 List<LinkedEditSuggestion> get suggestions => _suggestions;
7063
7064 /**
7065 * Pre-computed suggestions for what every region might want to be changed
7066 * to.
7067 */
7068 void set suggestions(List<LinkedEditSuggestion> value) {
7069 assert(value != null);
7070 this._suggestions = value;
7071 }
7072
7073 LinkedEditGroup(List<Position> positions, int length, List<LinkedEditSuggestio n> suggestions) {
7074 this.positions = positions;
7075 this.length = length;
7076 this.suggestions = suggestions;
7077 }
7078
7079 factory LinkedEditGroup.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obj ect json) {
7080 if (json == null) {
7081 json = {};
7082 }
7083 if (json is Map) {
7084 List<Position> positions;
7085 if (json.containsKey("positions")) {
7086 positions = jsonDecoder.decodeList(jsonPath + ".positions", json["positi ons"], (String jsonPath, Object json) => new Position.fromJson(jsonDecoder, json Path, json));
7087 } else {
7088 throw jsonDecoder.mismatch(jsonPath, "positions");
7089 }
7090 int length;
7091 if (json.containsKey("length")) {
7092 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
7093 } else {
7094 throw jsonDecoder.mismatch(jsonPath, "length");
7095 }
7096 List<LinkedEditSuggestion> suggestions;
7097 if (json.containsKey("suggestions")) {
7098 suggestions = jsonDecoder.decodeList(jsonPath + ".suggestions", json["su ggestions"], (String jsonPath, Object json) => new LinkedEditSuggestion.fromJson (jsonDecoder, jsonPath, json));
7099 } else {
7100 throw jsonDecoder.mismatch(jsonPath, "suggestions");
7101 }
7102 return new LinkedEditGroup(positions, length, suggestions);
7103 } else {
7104 throw jsonDecoder.mismatch(jsonPath, "LinkedEditGroup", json);
7105 }
7106 }
7107
7108 /**
7109 * Construct an empty LinkedEditGroup.
7110 */
7111 LinkedEditGroup.empty() : this(<Position>[], 0, <LinkedEditSuggestion>[]);
7112
7113 @override
7114 Map<String, dynamic> toJson() {
7115 Map<String, dynamic> result = {};
7116 result["positions"] = positions.map((Position value) => value.toJson()).toLi st();
7117 result["length"] = length;
7118 result["suggestions"] = suggestions.map((LinkedEditSuggestion value) => valu e.toJson()).toList();
7119 return result;
7120 }
7121
7122 /**
7123 * Add a new position and change the length.
7124 */
7125 void addPosition(Position position, int length) {
7126 positions.add(position);
7127 this.length = length;
7128 }
7129
7130 /**
7131 * Add a new suggestion.
7132 */
7133 void addSuggestion(LinkedEditSuggestion suggestion) {
7134 suggestions.add(suggestion);
7135 }
7136
7137 @override
7138 String toString() => JSON.encode(toJson());
7139
7140 @override
7141 bool operator==(other) {
7142 if (other is LinkedEditGroup) {
7143 return listEqual(positions, other.positions, (Position a, Position b) => a == b) &&
7144 length == other.length &&
7145 listEqual(suggestions, other.suggestions, (LinkedEditSuggestion a, Lin kedEditSuggestion b) => a == b);
7146 }
7147 return false;
7148 }
7149
7150 @override
7151 int get hashCode {
7152 int hash = 0;
7153 hash = JenkinsSmiHash.combine(hash, positions.hashCode);
7154 hash = JenkinsSmiHash.combine(hash, length.hashCode);
7155 hash = JenkinsSmiHash.combine(hash, suggestions.hashCode);
7156 return JenkinsSmiHash.finish(hash);
7157 }
7158 }
7159
7160 /**
7161 * LinkedEditSuggestion
7162 *
7163 * {
7164 * "value": String
7165 * "kind": LinkedEditSuggestionKind
7166 * }
7167 *
7168 * Clients may not extend, implement or mix-in this class.
7169 */
7170 class LinkedEditSuggestion implements HasToJson {
7171 String _value;
7172
7173 LinkedEditSuggestionKind _kind;
7174
7175 /**
7176 * The value that could be used to replace all of the linked edit regions.
7177 */
7178 String get value => _value;
7179
7180 /**
7181 * The value that could be used to replace all of the linked edit regions.
7182 */
7183 void set value(String value) {
7184 assert(value != null);
7185 this._value = value;
7186 }
7187
7188 /**
7189 * The kind of value being proposed.
7190 */
7191 LinkedEditSuggestionKind get kind => _kind;
7192
7193 /**
7194 * The kind of value being proposed.
7195 */
7196 void set kind(LinkedEditSuggestionKind value) {
7197 assert(value != null);
7198 this._kind = value;
7199 }
7200
7201 LinkedEditSuggestion(String value, LinkedEditSuggestionKind kind) {
7202 this.value = value;
7203 this.kind = kind;
7204 }
7205
7206 factory LinkedEditSuggestion.fromJson(JsonDecoder jsonDecoder, String jsonPath , Object json) {
7207 if (json == null) {
7208 json = {};
7209 }
7210 if (json is Map) {
7211 String value;
7212 if (json.containsKey("value")) {
7213 value = jsonDecoder.decodeString(jsonPath + ".value", json["value"]);
7214 } else {
7215 throw jsonDecoder.mismatch(jsonPath, "value");
7216 }
7217 LinkedEditSuggestionKind kind;
7218 if (json.containsKey("kind")) {
7219 kind = new LinkedEditSuggestionKind.fromJson(jsonDecoder, jsonPath + ".k ind", json["kind"]);
7220 } else {
7221 throw jsonDecoder.mismatch(jsonPath, "kind");
7222 }
7223 return new LinkedEditSuggestion(value, kind);
7224 } else {
7225 throw jsonDecoder.mismatch(jsonPath, "LinkedEditSuggestion", json);
7226 }
7227 }
7228
7229 @override
7230 Map<String, dynamic> toJson() {
7231 Map<String, dynamic> result = {};
7232 result["value"] = value;
7233 result["kind"] = kind.toJson();
7234 return result;
7235 }
7236
7237 @override
7238 String toString() => JSON.encode(toJson());
7239
7240 @override
7241 bool operator==(other) {
7242 if (other is LinkedEditSuggestion) {
7243 return value == other.value &&
7244 kind == other.kind;
7245 }
7246 return false;
7247 }
7248
7249 @override
7250 int get hashCode {
7251 int hash = 0;
7252 hash = JenkinsSmiHash.combine(hash, value.hashCode);
7253 hash = JenkinsSmiHash.combine(hash, kind.hashCode);
7254 return JenkinsSmiHash.finish(hash);
7255 }
7256 }
7257
7258 /**
7259 * LinkedEditSuggestionKind
7260 *
7261 * enum {
7262 * METHOD
7263 * PARAMETER
7264 * TYPE
7265 * VARIABLE
7266 * }
7267 *
7268 * Clients may not extend, implement or mix-in this class.
7269 */
7270 class LinkedEditSuggestionKind implements Enum {
7271 static const LinkedEditSuggestionKind METHOD = const LinkedEditSuggestionKind. _("METHOD");
7272
7273 static const LinkedEditSuggestionKind PARAMETER = const LinkedEditSuggestionKi nd._("PARAMETER");
7274
7275 static const LinkedEditSuggestionKind TYPE = const LinkedEditSuggestionKind._( "TYPE");
7276
7277 static const LinkedEditSuggestionKind VARIABLE = const LinkedEditSuggestionKin d._("VARIABLE");
7278
7279 /**
7280 * A list containing all of the enum values that are defined.
7281 */
7282 static const List<LinkedEditSuggestionKind> VALUES = const <LinkedEditSuggesti onKind>[METHOD, PARAMETER, TYPE, VARIABLE];
7283
7284 @override
7285 final String name;
7286
7287 const LinkedEditSuggestionKind._(this.name);
7288
7289 factory LinkedEditSuggestionKind(String name) {
7290 switch (name) {
7291 case "METHOD":
7292 return METHOD;
7293 case "PARAMETER":
7294 return PARAMETER;
7295 case "TYPE":
7296 return TYPE;
7297 case "VARIABLE":
7298 return VARIABLE;
7299 }
7300 throw new Exception('Illegal enum value: $name');
7301 }
7302
7303 factory LinkedEditSuggestionKind.fromJson(JsonDecoder jsonDecoder, String json Path, Object json) {
7304 if (json is String) {
7305 try {
7306 return new LinkedEditSuggestionKind(json);
7307 } catch(_) {
7308 // Fall through
7309 }
7310 }
7311 throw jsonDecoder.mismatch(jsonPath, "LinkedEditSuggestionKind", json);
7312 }
7313
7314 @override
7315 String toString() => "LinkedEditSuggestionKind.$name";
7316
7317 String toJson() => name;
7318 }
7319
7320 /**
7321 * Location
7322 *
7323 * {
7324 * "file": FilePath
7325 * "offset": int
7326 * "length": int
7327 * "startLine": int
7328 * "startColumn": int
7329 * }
7330 *
7331 * Clients may not extend, implement or mix-in this class.
7332 */
7333 class Location implements HasToJson {
7334 String _file;
7335
7336 int _offset;
7337
7338 int _length;
7339
7340 int _startLine;
7341
7342 int _startColumn;
7343
7344 /**
7345 * The file containing the range.
7346 */
7347 String get file => _file;
7348
7349 /**
7350 * The file containing the range.
7351 */
7352 void set file(String value) {
7353 assert(value != null);
7354 this._file = value;
7355 }
7356
7357 /**
7358 * The offset of the range.
7359 */
7360 int get offset => _offset;
7361
7362 /**
7363 * The offset of the range.
7364 */
7365 void set offset(int value) {
7366 assert(value != null);
7367 this._offset = value;
7368 }
7369
7370 /**
7371 * The length of the range.
7372 */
7373 int get length => _length;
7374
7375 /**
7376 * The length of the range.
7377 */
7378 void set length(int value) {
7379 assert(value != null);
7380 this._length = value;
7381 }
7382
7383 /**
7384 * The one-based index of the line containing the first character of the
7385 * range.
7386 */
7387 int get startLine => _startLine;
7388
7389 /**
7390 * The one-based index of the line containing the first character of the
7391 * range.
7392 */
7393 void set startLine(int value) {
7394 assert(value != null);
7395 this._startLine = value;
7396 }
7397
7398 /**
7399 * The one-based index of the column containing the first character of the
7400 * range.
7401 */
7402 int get startColumn => _startColumn;
7403
7404 /**
7405 * The one-based index of the column containing the first character of the
7406 * range.
7407 */
7408 void set startColumn(int value) {
7409 assert(value != null);
7410 this._startColumn = value;
7411 }
7412
7413 Location(String file, int offset, int length, int startLine, int startColumn) {
7414 this.file = file;
7415 this.offset = offset;
7416 this.length = length;
7417 this.startLine = startLine;
7418 this.startColumn = startColumn;
7419 }
7420
7421 factory Location.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object jso n) {
7422 if (json == null) {
7423 json = {};
7424 }
7425 if (json is Map) {
7426 String file;
7427 if (json.containsKey("file")) {
7428 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
7429 } else {
7430 throw jsonDecoder.mismatch(jsonPath, "file");
7431 }
7432 int offset;
7433 if (json.containsKey("offset")) {
7434 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
7435 } else {
7436 throw jsonDecoder.mismatch(jsonPath, "offset");
7437 }
7438 int length;
7439 if (json.containsKey("length")) {
7440 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
7441 } else {
7442 throw jsonDecoder.mismatch(jsonPath, "length");
7443 }
7444 int startLine;
7445 if (json.containsKey("startLine")) {
7446 startLine = jsonDecoder.decodeInt(jsonPath + ".startLine", json["startLi ne"]);
7447 } else {
7448 throw jsonDecoder.mismatch(jsonPath, "startLine");
7449 }
7450 int startColumn;
7451 if (json.containsKey("startColumn")) {
7452 startColumn = jsonDecoder.decodeInt(jsonPath + ".startColumn", json["sta rtColumn"]);
7453 } else {
7454 throw jsonDecoder.mismatch(jsonPath, "startColumn");
7455 }
7456 return new Location(file, offset, length, startLine, startColumn);
7457 } else {
7458 throw jsonDecoder.mismatch(jsonPath, "Location", json);
7459 }
7460 }
7461
7462 @override
7463 Map<String, dynamic> toJson() {
7464 Map<String, dynamic> result = {};
7465 result["file"] = file;
7466 result["offset"] = offset;
7467 result["length"] = length;
7468 result["startLine"] = startLine;
7469 result["startColumn"] = startColumn;
7470 return result;
7471 }
7472
7473 @override
7474 String toString() => JSON.encode(toJson());
7475
7476 @override
7477 bool operator==(other) {
7478 if (other is Location) {
7479 return file == other.file &&
7480 offset == other.offset &&
7481 length == other.length &&
7482 startLine == other.startLine &&
7483 startColumn == other.startColumn;
7484 }
7485 return false;
7486 }
7487
7488 @override
7489 int get hashCode {
7490 int hash = 0;
7491 hash = JenkinsSmiHash.combine(hash, file.hashCode);
7492 hash = JenkinsSmiHash.combine(hash, offset.hashCode);
7493 hash = JenkinsSmiHash.combine(hash, length.hashCode);
7494 hash = JenkinsSmiHash.combine(hash, startLine.hashCode);
7495 hash = JenkinsSmiHash.combine(hash, startColumn.hashCode);
7496 return JenkinsSmiHash.finish(hash);
7497 }
7498 }
7499
7500 /**
7501 * moveFile feedback
7502 *
7503 * Clients may not extend, implement or mix-in this class.
7504 */
7505 class MoveFileFeedback extends RefactoringFeedback implements HasToJson {
7506 @override
7507 bool operator==(other) {
7508 if (other is MoveFileFeedback) {
7509 return true;
7510 }
7511 return false;
7512 }
7513
7514 @override
7515 int get hashCode {
7516 return 438975893;
7517 }
7518 }
7519
7520 /**
7521 * moveFile options
7522 *
7523 * {
7524 * "newFile": FilePath
7525 * }
7526 *
7527 * Clients may not extend, implement or mix-in this class.
7528 */
7529 class MoveFileOptions extends RefactoringOptions {
7530 String _newFile;
7531
7532 /**
7533 * The new file path to which the given file is being moved.
7534 */
7535 String get newFile => _newFile;
7536
7537 /**
7538 * The new file path to which the given file is being moved.
7539 */
7540 void set newFile(String value) {
7541 assert(value != null);
7542 this._newFile = value;
7543 }
7544
7545 MoveFileOptions(String newFile) {
7546 this.newFile = newFile;
7547 }
7548
7549 factory MoveFileOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obj ect json) {
7550 if (json == null) {
7551 json = {};
7552 }
7553 if (json is Map) {
7554 String newFile;
7555 if (json.containsKey("newFile")) {
7556 newFile = jsonDecoder.decodeString(jsonPath + ".newFile", json["newFile" ]);
7557 } else {
7558 throw jsonDecoder.mismatch(jsonPath, "newFile");
7559 }
7560 return new MoveFileOptions(newFile);
7561 } else {
7562 throw jsonDecoder.mismatch(jsonPath, "moveFile options", json);
7563 }
7564 }
7565
7566 factory MoveFileOptions.fromRefactoringParams(EditGetRefactoringParams refacto ringParams, Request request) {
7567 return new MoveFileOptions.fromJson(
7568 new RequestDecoder(request), "options", refactoringParams.options);
7569 }
7570
7571 @override
7572 Map<String, dynamic> toJson() {
7573 Map<String, dynamic> result = {};
7574 result["newFile"] = newFile;
7575 return result;
7576 }
7577
7578 @override
7579 String toString() => JSON.encode(toJson());
7580
7581 @override
7582 bool operator==(other) {
7583 if (other is MoveFileOptions) {
7584 return newFile == other.newFile;
7585 }
7586 return false;
7587 }
7588
7589 @override
7590 int get hashCode {
7591 int hash = 0;
7592 hash = JenkinsSmiHash.combine(hash, newFile.hashCode);
7593 return JenkinsSmiHash.finish(hash);
7594 }
7595 }
7596
7597 /**
7598 * NavigationRegion
7599 *
7600 * {
7601 * "offset": int
7602 * "length": int
7603 * "targets": List<int>
7604 * }
7605 *
7606 * Clients may not extend, implement or mix-in this class.
7607 */
7608 class NavigationRegion implements HasToJson {
7609 int _offset;
7610
7611 int _length;
7612
7613 List<int> _targets;
7614
7615 /**
7616 * The offset of the region from which the user can navigate.
7617 */
7618 int get offset => _offset;
7619
7620 /**
7621 * The offset of the region from which the user can navigate.
7622 */
7623 void set offset(int value) {
7624 assert(value != null);
7625 this._offset = value;
7626 }
7627
7628 /**
7629 * The length of the region from which the user can navigate.
7630 */
7631 int get length => _length;
7632
7633 /**
7634 * The length of the region from which the user can navigate.
7635 */
7636 void set length(int value) {
7637 assert(value != null);
7638 this._length = value;
7639 }
7640
7641 /**
7642 * The indexes of the targets (in the enclosing navigation response) to which
7643 * the given region is bound. By opening the target, clients can implement
7644 * one form of navigation. This list cannot be empty.
7645 */
7646 List<int> get targets => _targets;
7647
7648 /**
7649 * The indexes of the targets (in the enclosing navigation response) to which
7650 * the given region is bound. By opening the target, clients can implement
7651 * one form of navigation. This list cannot be empty.
7652 */
7653 void set targets(List<int> value) {
7654 assert(value != null);
7655 this._targets = value;
7656 }
7657
7658 NavigationRegion(int offset, int length, List<int> targets) {
7659 this.offset = offset;
7660 this.length = length;
7661 this.targets = targets;
7662 }
7663
7664 factory NavigationRegion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Ob ject json) {
7665 if (json == null) {
7666 json = {};
7667 }
7668 if (json is Map) {
7669 int offset;
7670 if (json.containsKey("offset")) {
7671 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
7672 } else {
7673 throw jsonDecoder.mismatch(jsonPath, "offset");
7674 }
7675 int length;
7676 if (json.containsKey("length")) {
7677 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
7678 } else {
7679 throw jsonDecoder.mismatch(jsonPath, "length");
7680 }
7681 List<int> targets;
7682 if (json.containsKey("targets")) {
7683 targets = jsonDecoder.decodeList(jsonPath + ".targets", json["targets"], jsonDecoder.decodeInt);
7684 } else {
7685 throw jsonDecoder.mismatch(jsonPath, "targets");
7686 }
7687 return new NavigationRegion(offset, length, targets);
7688 } else {
7689 throw jsonDecoder.mismatch(jsonPath, "NavigationRegion", json);
7690 }
7691 }
7692
7693 @override
7694 Map<String, dynamic> toJson() {
7695 Map<String, dynamic> result = {};
7696 result["offset"] = offset;
7697 result["length"] = length;
7698 result["targets"] = targets;
7699 return result;
7700 }
7701
7702 @override
7703 String toString() => JSON.encode(toJson());
7704
7705 @override
7706 bool operator==(other) {
7707 if (other is NavigationRegion) {
7708 return offset == other.offset &&
7709 length == other.length &&
7710 listEqual(targets, other.targets, (int a, int b) => a == b);
7711 }
7712 return false;
7713 }
7714
7715 @override
7716 int get hashCode {
7717 int hash = 0;
7718 hash = JenkinsSmiHash.combine(hash, offset.hashCode);
7719 hash = JenkinsSmiHash.combine(hash, length.hashCode);
7720 hash = JenkinsSmiHash.combine(hash, targets.hashCode);
7721 return JenkinsSmiHash.finish(hash);
7722 }
7723 }
7724
7725 /**
7726 * NavigationTarget
7727 *
7728 * {
7729 * "kind": ElementKind
7730 * "fileIndex": int
7731 * "offset": int
7732 * "length": int
7733 * "startLine": int
7734 * "startColumn": int
7735 * }
7736 *
7737 * Clients may not extend, implement or mix-in this class.
7738 */
7739 class NavigationTarget implements HasToJson {
7740 ElementKind _kind;
7741
7742 int _fileIndex;
7743
7744 int _offset;
7745
7746 int _length;
7747
7748 int _startLine;
7749
7750 int _startColumn;
7751
7752 /**
7753 * The kind of the element.
7754 */
7755 ElementKind get kind => _kind;
7756
7757 /**
7758 * The kind of the element.
7759 */
7760 void set kind(ElementKind value) {
7761 assert(value != null);
7762 this._kind = value;
7763 }
7764
7765 /**
7766 * The index of the file (in the enclosing navigation response) to navigate
7767 * to.
7768 */
7769 int get fileIndex => _fileIndex;
7770
7771 /**
7772 * The index of the file (in the enclosing navigation response) to navigate
7773 * to.
7774 */
7775 void set fileIndex(int value) {
7776 assert(value != null);
7777 this._fileIndex = value;
7778 }
7779
7780 /**
7781 * The offset of the region to which the user can navigate.
7782 */
7783 int get offset => _offset;
7784
7785 /**
7786 * The offset of the region to which the user can navigate.
7787 */
7788 void set offset(int value) {
7789 assert(value != null);
7790 this._offset = value;
7791 }
7792
7793 /**
7794 * The length of the region to which the user can navigate.
7795 */
7796 int get length => _length;
7797
7798 /**
7799 * The length of the region to which the user can navigate.
7800 */
7801 void set length(int value) {
7802 assert(value != null);
7803 this._length = value;
7804 }
7805
7806 /**
7807 * The one-based index of the line containing the first character of the
7808 * region.
7809 */
7810 int get startLine => _startLine;
7811
7812 /**
7813 * The one-based index of the line containing the first character of the
7814 * region.
7815 */
7816 void set startLine(int value) {
7817 assert(value != null);
7818 this._startLine = value;
7819 }
7820
7821 /**
7822 * The one-based index of the column containing the first character of the
7823 * region.
7824 */
7825 int get startColumn => _startColumn;
7826
7827 /**
7828 * The one-based index of the column containing the first character of the
7829 * region.
7830 */
7831 void set startColumn(int value) {
7832 assert(value != null);
7833 this._startColumn = value;
7834 }
7835
7836 NavigationTarget(ElementKind kind, int fileIndex, int offset, int length, int startLine, int startColumn) {
7837 this.kind = kind;
7838 this.fileIndex = fileIndex;
7839 this.offset = offset;
7840 this.length = length;
7841 this.startLine = startLine;
7842 this.startColumn = startColumn;
7843 }
7844
7845 factory NavigationTarget.fromJson(JsonDecoder jsonDecoder, String jsonPath, Ob ject json) {
7846 if (json == null) {
7847 json = {};
7848 }
7849 if (json is Map) {
7850 ElementKind kind;
7851 if (json.containsKey("kind")) {
7852 kind = new ElementKind.fromJson(jsonDecoder, jsonPath + ".kind", json["k ind"]);
7853 } else {
7854 throw jsonDecoder.mismatch(jsonPath, "kind");
7855 }
7856 int fileIndex;
7857 if (json.containsKey("fileIndex")) {
7858 fileIndex = jsonDecoder.decodeInt(jsonPath + ".fileIndex", json["fileInd ex"]);
7859 } else {
7860 throw jsonDecoder.mismatch(jsonPath, "fileIndex");
7861 }
7862 int offset;
7863 if (json.containsKey("offset")) {
7864 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
7865 } else {
7866 throw jsonDecoder.mismatch(jsonPath, "offset");
7867 }
7868 int length;
7869 if (json.containsKey("length")) {
7870 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
7871 } else {
7872 throw jsonDecoder.mismatch(jsonPath, "length");
7873 }
7874 int startLine;
7875 if (json.containsKey("startLine")) {
7876 startLine = jsonDecoder.decodeInt(jsonPath + ".startLine", json["startLi ne"]);
7877 } else {
7878 throw jsonDecoder.mismatch(jsonPath, "startLine");
7879 }
7880 int startColumn;
7881 if (json.containsKey("startColumn")) {
7882 startColumn = jsonDecoder.decodeInt(jsonPath + ".startColumn", json["sta rtColumn"]);
7883 } else {
7884 throw jsonDecoder.mismatch(jsonPath, "startColumn");
7885 }
7886 return new NavigationTarget(kind, fileIndex, offset, length, startLine, st artColumn);
7887 } else {
7888 throw jsonDecoder.mismatch(jsonPath, "NavigationTarget", json);
7889 }
7890 }
7891
7892 @override
7893 Map<String, dynamic> toJson() {
7894 Map<String, dynamic> result = {};
7895 result["kind"] = kind.toJson();
7896 result["fileIndex"] = fileIndex;
7897 result["offset"] = offset;
7898 result["length"] = length;
7899 result["startLine"] = startLine;
7900 result["startColumn"] = startColumn;
7901 return result;
7902 }
7903
7904 @override
7905 String toString() => JSON.encode(toJson());
7906
7907 @override
7908 bool operator==(other) {
7909 if (other is NavigationTarget) {
7910 return kind == other.kind &&
7911 fileIndex == other.fileIndex &&
7912 offset == other.offset &&
7913 length == other.length &&
7914 startLine == other.startLine &&
7915 startColumn == other.startColumn;
7916 }
7917 return false;
7918 }
7919
7920 @override
7921 int get hashCode {
7922 int hash = 0;
7923 hash = JenkinsSmiHash.combine(hash, kind.hashCode);
7924 hash = JenkinsSmiHash.combine(hash, fileIndex.hashCode);
7925 hash = JenkinsSmiHash.combine(hash, offset.hashCode);
7926 hash = JenkinsSmiHash.combine(hash, length.hashCode);
7927 hash = JenkinsSmiHash.combine(hash, startLine.hashCode);
7928 hash = JenkinsSmiHash.combine(hash, startColumn.hashCode);
7929 return JenkinsSmiHash.finish(hash);
7930 }
7931 }
7932
7933 /**
7934 * Occurrences
7935 *
7936 * {
7937 * "element": Element
7938 * "offsets": List<int>
7939 * "length": int
7940 * }
7941 *
7942 * Clients may not extend, implement or mix-in this class.
7943 */
7944 class Occurrences implements HasToJson {
7945 Element _element;
7946
7947 List<int> _offsets;
7948
7949 int _length;
7950
7951 /**
7952 * The element that was referenced.
7953 */
7954 Element get element => _element;
7955
7956 /**
7957 * The element that was referenced.
7958 */
7959 void set element(Element value) {
7960 assert(value != null);
7961 this._element = value;
7962 }
7963
7964 /**
7965 * The offsets of the name of the referenced element within the file.
7966 */
7967 List<int> get offsets => _offsets;
7968
7969 /**
7970 * The offsets of the name of the referenced element within the file.
7971 */
7972 void set offsets(List<int> value) {
7973 assert(value != null);
7974 this._offsets = value;
7975 }
7976
7977 /**
7978 * The length of the name of the referenced element.
7979 */
7980 int get length => _length;
7981
7982 /**
7983 * The length of the name of the referenced element.
7984 */
7985 void set length(int value) {
7986 assert(value != null);
7987 this._length = value;
7988 }
7989
7990 Occurrences(Element element, List<int> offsets, int length) {
7991 this.element = element;
7992 this.offsets = offsets;
7993 this.length = length;
7994 }
7995
7996 factory Occurrences.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
7997 if (json == null) {
7998 json = {};
7999 }
8000 if (json is Map) {
8001 Element element;
8002 if (json.containsKey("element")) {
8003 element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json[ "element"]);
8004 } else {
8005 throw jsonDecoder.mismatch(jsonPath, "element");
8006 }
8007 List<int> offsets;
8008 if (json.containsKey("offsets")) {
8009 offsets = jsonDecoder.decodeList(jsonPath + ".offsets", json["offsets"], jsonDecoder.decodeInt);
8010 } else {
8011 throw jsonDecoder.mismatch(jsonPath, "offsets");
8012 }
8013 int length;
8014 if (json.containsKey("length")) {
8015 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
8016 } else {
8017 throw jsonDecoder.mismatch(jsonPath, "length");
8018 }
8019 return new Occurrences(element, offsets, length);
8020 } else {
8021 throw jsonDecoder.mismatch(jsonPath, "Occurrences", json);
8022 }
8023 }
8024
8025 @override
8026 Map<String, dynamic> toJson() {
8027 Map<String, dynamic> result = {};
8028 result["element"] = element.toJson();
8029 result["offsets"] = offsets;
8030 result["length"] = length;
8031 return result;
8032 }
8033
8034 @override
8035 String toString() => JSON.encode(toJson());
8036
8037 @override
8038 bool operator==(other) {
8039 if (other is Occurrences) {
8040 return element == other.element &&
8041 listEqual(offsets, other.offsets, (int a, int b) => a == b) &&
8042 length == other.length;
8043 }
8044 return false;
8045 }
8046
8047 @override
8048 int get hashCode {
8049 int hash = 0;
8050 hash = JenkinsSmiHash.combine(hash, element.hashCode);
8051 hash = JenkinsSmiHash.combine(hash, offsets.hashCode);
8052 hash = JenkinsSmiHash.combine(hash, length.hashCode);
8053 return JenkinsSmiHash.finish(hash);
8054 }
8055 }
8056
8057 /**
8058 * Outline
8059 *
8060 * {
8061 * "element": Element
8062 * "offset": int
8063 * "length": int
8064 * "children": optional List<Outline>
8065 * }
8066 *
8067 * Clients may not extend, implement or mix-in this class.
8068 */
8069 class Outline implements HasToJson {
8070 Element _element;
8071
8072 int _offset;
8073
8074 int _length;
8075
8076 List<Outline> _children;
8077
8078 /**
8079 * A description of the element represented by this node.
8080 */
8081 Element get element => _element;
8082
8083 /**
8084 * A description of the element represented by this node.
8085 */
8086 void set element(Element value) {
8087 assert(value != null);
8088 this._element = value;
8089 }
8090
8091 /**
8092 * The offset of the first character of the element. This is different than
8093 * the offset in the Element, which is the offset of the name of the element.
8094 * It can be used, for example, to map locations in the file back to an
8095 * outline.
8096 */
8097 int get offset => _offset;
8098
8099 /**
8100 * The offset of the first character of the element. This is different than
8101 * the offset in the Element, which is the offset of the name of the element.
8102 * It can be used, for example, to map locations in the file back to an
8103 * outline.
8104 */
8105 void set offset(int value) {
8106 assert(value != null);
8107 this._offset = value;
8108 }
8109
8110 /**
8111 * The length of the element.
8112 */
8113 int get length => _length;
8114
8115 /**
8116 * The length of the element.
8117 */
8118 void set length(int value) {
8119 assert(value != null);
8120 this._length = value;
8121 }
8122
8123 /**
8124 * The children of the node. The field will be omitted if the node has no
8125 * children.
8126 */
8127 List<Outline> get children => _children;
8128
8129 /**
8130 * The children of the node. The field will be omitted if the node has no
8131 * children.
8132 */
8133 void set children(List<Outline> value) {
8134 this._children = value;
8135 }
8136
8137 Outline(Element element, int offset, int length, {List<Outline> children}) {
8138 this.element = element;
8139 this.offset = offset;
8140 this.length = length;
8141 this.children = children;
8142 }
8143
8144 factory Outline.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json ) {
8145 if (json == null) {
8146 json = {};
8147 }
8148 if (json is Map) {
8149 Element element;
8150 if (json.containsKey("element")) {
8151 element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json[ "element"]);
8152 } else {
8153 throw jsonDecoder.mismatch(jsonPath, "element");
8154 }
8155 int offset;
8156 if (json.containsKey("offset")) {
8157 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
8158 } else {
8159 throw jsonDecoder.mismatch(jsonPath, "offset");
8160 }
8161 int length;
8162 if (json.containsKey("length")) {
8163 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
8164 } else {
8165 throw jsonDecoder.mismatch(jsonPath, "length");
8166 }
8167 List<Outline> children;
8168 if (json.containsKey("children")) {
8169 children = jsonDecoder.decodeList(jsonPath + ".children", json["children "], (String jsonPath, Object json) => new Outline.fromJson(jsonDecoder, jsonPath , json));
8170 }
8171 return new Outline(element, offset, length, children: children);
8172 } else {
8173 throw jsonDecoder.mismatch(jsonPath, "Outline", json);
8174 }
8175 }
8176
8177 @override
8178 Map<String, dynamic> toJson() {
8179 Map<String, dynamic> result = {};
8180 result["element"] = element.toJson();
8181 result["offset"] = offset;
8182 result["length"] = length;
8183 if (children != null) {
8184 result["children"] = children.map((Outline value) => value.toJson()).toLis t();
8185 }
8186 return result;
8187 }
8188
8189 @override
8190 String toString() => JSON.encode(toJson());
8191
8192 @override
8193 bool operator==(other) {
8194 if (other is Outline) {
8195 return element == other.element &&
8196 offset == other.offset &&
8197 length == other.length &&
8198 listEqual(children, other.children, (Outline a, Outline b) => a == b);
8199 }
8200 return false;
8201 }
8202
8203 @override
8204 int get hashCode {
8205 int hash = 0;
8206 hash = JenkinsSmiHash.combine(hash, element.hashCode);
8207 hash = JenkinsSmiHash.combine(hash, offset.hashCode);
8208 hash = JenkinsSmiHash.combine(hash, length.hashCode);
8209 hash = JenkinsSmiHash.combine(hash, children.hashCode);
8210 return JenkinsSmiHash.finish(hash);
8211 }
8212 }
8213
8214 /**
8215 * plugin.error params
8216 *
8217 * {
8218 * "isFatal": bool
8219 * "message": String
8220 * "stackTrace": String
8221 * }
8222 *
8223 * Clients may not extend, implement or mix-in this class.
8224 */
8225 class PluginErrorParams implements HasToJson {
8226 bool _isFatal;
8227
8228 String _message;
8229
8230 String _stackTrace;
8231
8232 /**
8233 * A flag indicating whether the error is a fatal error, meaning that the
8234 * plugin will shutdown automatically after sending this notification. If
8235 * true, the server will not expect any other responses or notifications from
8236 * the plugin.
8237 */
8238 bool get isFatal => _isFatal;
8239
8240 /**
8241 * A flag indicating whether the error is a fatal error, meaning that the
8242 * plugin will shutdown automatically after sending this notification. If
8243 * true, the server will not expect any other responses or notifications from
8244 * the plugin.
8245 */
8246 void set isFatal(bool value) {
8247 assert(value != null);
8248 this._isFatal = value;
8249 }
8250
8251 /**
8252 * The error message indicating what kind of error was encountered.
8253 */
8254 String get message => _message;
8255
8256 /**
8257 * The error message indicating what kind of error was encountered.
8258 */
8259 void set message(String value) {
8260 assert(value != null);
8261 this._message = value;
8262 }
8263
8264 /**
8265 * The stack trace associated with the generation of the error, used for
8266 * debugging the plugin.
8267 */
8268 String get stackTrace => _stackTrace;
8269
8270 /**
8271 * The stack trace associated with the generation of the error, used for
8272 * debugging the plugin.
8273 */
8274 void set stackTrace(String value) {
8275 assert(value != null);
8276 this._stackTrace = value;
8277 }
8278
8279 PluginErrorParams(bool isFatal, String message, String stackTrace) {
8280 this.isFatal = isFatal;
8281 this.message = message;
8282 this.stackTrace = stackTrace;
8283 }
8284
8285 factory PluginErrorParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, O bject json) {
8286 if (json == null) {
8287 json = {};
8288 }
8289 if (json is Map) {
8290 bool isFatal;
8291 if (json.containsKey("isFatal")) {
8292 isFatal = jsonDecoder.decodeBool(jsonPath + ".isFatal", json["isFatal"]) ;
8293 } else {
8294 throw jsonDecoder.mismatch(jsonPath, "isFatal");
8295 }
8296 String message;
8297 if (json.containsKey("message")) {
8298 message = jsonDecoder.decodeString(jsonPath + ".message", json["message" ]);
8299 } else {
8300 throw jsonDecoder.mismatch(jsonPath, "message");
8301 }
8302 String stackTrace;
8303 if (json.containsKey("stackTrace")) {
8304 stackTrace = jsonDecoder.decodeString(jsonPath + ".stackTrace", json["st ackTrace"]);
8305 } else {
8306 throw jsonDecoder.mismatch(jsonPath, "stackTrace");
8307 }
8308 return new PluginErrorParams(isFatal, message, stackTrace);
8309 } else {
8310 throw jsonDecoder.mismatch(jsonPath, "plugin.error params", json);
8311 }
8312 }
8313
8314 factory PluginErrorParams.fromNotification(Notification notification) {
8315 return new PluginErrorParams.fromJson(
8316 new ResponseDecoder(null), "params", notification.params);
8317 }
8318
8319 @override
8320 Map<String, dynamic> toJson() {
8321 Map<String, dynamic> result = {};
8322 result["isFatal"] = isFatal;
8323 result["message"] = message;
8324 result["stackTrace"] = stackTrace;
8325 return result;
8326 }
8327
8328 Notification toNotification() {
8329 return new Notification("plugin.error", toJson());
8330 }
8331
8332 @override
8333 String toString() => JSON.encode(toJson());
8334
8335 @override
8336 bool operator==(other) {
8337 if (other is PluginErrorParams) {
8338 return isFatal == other.isFatal &&
8339 message == other.message &&
8340 stackTrace == other.stackTrace;
8341 }
8342 return false;
8343 }
8344
8345 @override
8346 int get hashCode {
8347 int hash = 0;
8348 hash = JenkinsSmiHash.combine(hash, isFatal.hashCode);
8349 hash = JenkinsSmiHash.combine(hash, message.hashCode);
8350 hash = JenkinsSmiHash.combine(hash, stackTrace.hashCode);
8351 return JenkinsSmiHash.finish(hash);
8352 }
8353 }
8354
8355 /**
8356 * plugin.shutdown params
8357 *
8358 * Clients may not extend, implement or mix-in this class.
8359 */
8360 class PluginShutdownParams {
8361 Request toRequest(String id) {
8362 return new Request(id, "plugin.shutdown", null);
8363 }
8364
8365 @override
8366 bool operator==(other) {
8367 if (other is PluginShutdownParams) {
8368 return true;
8369 }
8370 return false;
8371 }
8372
8373 @override
8374 int get hashCode {
8375 return 478064585;
8376 }
8377 }
8378
8379 /**
8380 * plugin.shutdown result
8381 *
8382 * Clients may not extend, implement or mix-in this class.
8383 */
8384 class PluginShutdownResult implements ResponseResult {
8385 @override
8386 Map<String, dynamic> toJson() => <String, dynamic>{};
8387
8388 @override
8389 Response toResponse(String id) {
8390 return new Response(id, result: null);
8391 }
8392
8393 @override
8394 bool operator==(other) {
8395 if (other is PluginShutdownResult) {
8396 return true;
8397 }
8398 return false;
8399 }
8400
8401 @override
8402 int get hashCode {
8403 return 9389109;
8404 }
8405 }
8406
8407 /**
8408 * plugin.versionCheck params
8409 *
8410 * {
8411 * "version": String
8412 * }
8413 *
8414 * Clients may not extend, implement or mix-in this class.
8415 */
8416 class PluginVersionCheckParams implements HasToJson {
8417 String _version;
8418
8419 /**
8420 * The version number of the plugin spec supported by the analysis server
8421 * that is executing the plugin.
8422 */
8423 String get version => _version;
8424
8425 /**
8426 * The version number of the plugin spec supported by the analysis server
8427 * that is executing the plugin.
8428 */
8429 void set version(String value) {
8430 assert(value != null);
8431 this._version = value;
8432 }
8433
8434 PluginVersionCheckParams(String version) {
8435 this.version = version;
8436 }
8437
8438 factory PluginVersionCheckParams.fromJson(JsonDecoder jsonDecoder, String json Path, Object json) {
8439 if (json == null) {
8440 json = {};
8441 }
8442 if (json is Map) {
8443 String version;
8444 if (json.containsKey("version")) {
8445 version = jsonDecoder.decodeString(jsonPath + ".version", json["version" ]);
8446 } else {
8447 throw jsonDecoder.mismatch(jsonPath, "version");
8448 }
8449 return new PluginVersionCheckParams(version);
8450 } else {
8451 throw jsonDecoder.mismatch(jsonPath, "plugin.versionCheck params", json);
8452 }
8453 }
8454
8455 factory PluginVersionCheckParams.fromRequest(Request request) {
8456 return new PluginVersionCheckParams.fromJson(
8457 new RequestDecoder(request), "params", request.params);
8458 }
8459
8460 @override
8461 Map<String, dynamic> toJson() {
8462 Map<String, dynamic> result = {};
8463 result["version"] = version;
8464 return result;
8465 }
8466
8467 Request toRequest(String id) {
8468 return new Request(id, "plugin.versionCheck", toJson());
8469 }
8470
8471 @override
8472 String toString() => JSON.encode(toJson());
8473
8474 @override
8475 bool operator==(other) {
8476 if (other is PluginVersionCheckParams) {
8477 return version == other.version;
8478 }
8479 return false;
8480 }
8481
8482 @override
8483 int get hashCode {
8484 int hash = 0;
8485 hash = JenkinsSmiHash.combine(hash, version.hashCode);
8486 return JenkinsSmiHash.finish(hash);
8487 }
8488 }
8489
8490 /**
8491 * plugin.versionCheck result
8492 *
8493 * {
8494 * "isCompatible": bool
8495 * "name": String
8496 * "version": String
8497 * "email": optional String
8498 * "interestingFiles": List<String>
8499 * }
8500 *
8501 * Clients may not extend, implement or mix-in this class.
8502 */
8503 class PluginVersionCheckResult implements ResponseResult {
8504 bool _isCompatible;
8505
8506 String _name;
8507
8508 String _version;
8509
8510 String _email;
8511
8512 List<String> _interestingFiles;
8513
8514 /**
8515 * A flag indicating whether the plugin supports the same version of the
8516 * plugin spec as the analysis server. If the value is false, then the plugin
8517 * is expected to shutdown after returning the response.
8518 */
8519 bool get isCompatible => _isCompatible;
8520
8521 /**
8522 * A flag indicating whether the plugin supports the same version of the
8523 * plugin spec as the analysis server. If the value is false, then the plugin
8524 * is expected to shutdown after returning the response.
8525 */
8526 void set isCompatible(bool value) {
8527 assert(value != null);
8528 this._isCompatible = value;
8529 }
8530
8531 /**
8532 * The name of the plugin. This value is only used when the server needs to
8533 * identify the plugin, either to the user or for debugging purposes.
8534 */
8535 String get name => _name;
8536
8537 /**
8538 * The name of the plugin. This value is only used when the server needs to
8539 * identify the plugin, either to the user or for debugging purposes.
8540 */
8541 void set name(String value) {
8542 assert(value != null);
8543 this._name = value;
8544 }
8545
8546 /**
8547 * The version of the plugin. This value is only used when the server needs
8548 * to identify the plugin, either to the user or for debugging purposes.
8549 */
8550 String get version => _version;
8551
8552 /**
8553 * The version of the plugin. This value is only used when the server needs
8554 * to identify the plugin, either to the user or for debugging purposes.
8555 */
8556 void set version(String value) {
8557 assert(value != null);
8558 this._version = value;
8559 }
8560
8561 /**
8562 * An e-mail address that either the client or the user can use to contact
8563 * the maintainers of the plugin when there is a problem.
8564 */
8565 String get email => _email;
8566
8567 /**
8568 * An e-mail address that either the client or the user can use to contact
8569 * the maintainers of the plugin when there is a problem.
8570 */
8571 void set email(String value) {
8572 this._email = value;
8573 }
8574
8575 /**
8576 * The glob patterns of the files for which the plugin will provide
8577 * information. This value is ignored if the isCompatible field is false.
8578 * Otherwise, it will be used to identify the files for which the plugin
8579 * should be notified of changes.
8580 */
8581 List<String> get interestingFiles => _interestingFiles;
8582
8583 /**
8584 * The glob patterns of the files for which the plugin will provide
8585 * information. This value is ignored if the isCompatible field is false.
8586 * Otherwise, it will be used to identify the files for which the plugin
8587 * should be notified of changes.
8588 */
8589 void set interestingFiles(List<String> value) {
8590 assert(value != null);
8591 this._interestingFiles = value;
8592 }
8593
8594 PluginVersionCheckResult(bool isCompatible, String name, String version, List< String> interestingFiles, {String email}) {
8595 this.isCompatible = isCompatible;
8596 this.name = name;
8597 this.version = version;
8598 this.email = email;
8599 this.interestingFiles = interestingFiles;
8600 }
8601
8602 factory PluginVersionCheckResult.fromJson(JsonDecoder jsonDecoder, String json Path, Object json) {
8603 if (json == null) {
8604 json = {};
8605 }
8606 if (json is Map) {
8607 bool isCompatible;
8608 if (json.containsKey("isCompatible")) {
8609 isCompatible = jsonDecoder.decodeBool(jsonPath + ".isCompatible", json[" isCompatible"]);
8610 } else {
8611 throw jsonDecoder.mismatch(jsonPath, "isCompatible");
8612 }
8613 String name;
8614 if (json.containsKey("name")) {
8615 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
8616 } else {
8617 throw jsonDecoder.mismatch(jsonPath, "name");
8618 }
8619 String version;
8620 if (json.containsKey("version")) {
8621 version = jsonDecoder.decodeString(jsonPath + ".version", json["version" ]);
8622 } else {
8623 throw jsonDecoder.mismatch(jsonPath, "version");
8624 }
8625 String email;
8626 if (json.containsKey("email")) {
8627 email = jsonDecoder.decodeString(jsonPath + ".email", json["email"]);
8628 }
8629 List<String> interestingFiles;
8630 if (json.containsKey("interestingFiles")) {
8631 interestingFiles = jsonDecoder.decodeList(jsonPath + ".interestingFiles" , json["interestingFiles"], jsonDecoder.decodeString);
8632 } else {
8633 throw jsonDecoder.mismatch(jsonPath, "interestingFiles");
8634 }
8635 return new PluginVersionCheckResult(isCompatible, name, version, interesti ngFiles, email: email);
8636 } else {
8637 throw jsonDecoder.mismatch(jsonPath, "plugin.versionCheck result", json);
8638 }
8639 }
8640
8641 factory PluginVersionCheckResult.fromResponse(Response response) {
8642 return new PluginVersionCheckResult.fromJson(
8643 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), " result", response.result);
8644 }
8645
8646 @override
8647 Map<String, dynamic> toJson() {
8648 Map<String, dynamic> result = {};
8649 result["isCompatible"] = isCompatible;
8650 result["name"] = name;
8651 result["version"] = version;
8652 if (email != null) {
8653 result["email"] = email;
8654 }
8655 result["interestingFiles"] = interestingFiles;
8656 return result;
8657 }
8658
8659 @override
8660 Response toResponse(String id) {
8661 return new Response(id, result: toJson());
8662 }
8663
8664 @override
8665 String toString() => JSON.encode(toJson());
8666
8667 @override
8668 bool operator==(other) {
8669 if (other is PluginVersionCheckResult) {
8670 return isCompatible == other.isCompatible &&
8671 name == other.name &&
8672 version == other.version &&
8673 email == other.email &&
8674 listEqual(interestingFiles, other.interestingFiles, (String a, String b) => a == b);
8675 }
8676 return false;
8677 }
8678
8679 @override
8680 int get hashCode {
8681 int hash = 0;
8682 hash = JenkinsSmiHash.combine(hash, isCompatible.hashCode);
8683 hash = JenkinsSmiHash.combine(hash, name.hashCode);
8684 hash = JenkinsSmiHash.combine(hash, version.hashCode);
8685 hash = JenkinsSmiHash.combine(hash, email.hashCode);
8686 hash = JenkinsSmiHash.combine(hash, interestingFiles.hashCode);
8687 return JenkinsSmiHash.finish(hash);
8688 }
8689 }
8690
8691 /**
8692 * Position
8693 *
8694 * {
8695 * "file": FilePath
8696 * "offset": int
8697 * }
8698 *
8699 * Clients may not extend, implement or mix-in this class.
8700 */
8701 class Position implements HasToJson {
8702 String _file;
8703
8704 int _offset;
8705
8706 /**
8707 * The file containing the position.
8708 */
8709 String get file => _file;
8710
8711 /**
8712 * The file containing the position.
8713 */
8714 void set file(String value) {
8715 assert(value != null);
8716 this._file = value;
8717 }
8718
8719 /**
8720 * The offset of the position.
8721 */
8722 int get offset => _offset;
8723
8724 /**
8725 * The offset of the position.
8726 */
8727 void set offset(int value) {
8728 assert(value != null);
8729 this._offset = value;
8730 }
8731
8732 Position(String file, int offset) {
8733 this.file = file;
8734 this.offset = offset;
8735 }
8736
8737 factory Position.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object jso n) {
8738 if (json == null) {
8739 json = {};
8740 }
8741 if (json is Map) {
8742 String file;
8743 if (json.containsKey("file")) {
8744 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
8745 } else {
8746 throw jsonDecoder.mismatch(jsonPath, "file");
8747 }
8748 int offset;
8749 if (json.containsKey("offset")) {
8750 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
8751 } else {
8752 throw jsonDecoder.mismatch(jsonPath, "offset");
8753 }
8754 return new Position(file, offset);
8755 } else {
8756 throw jsonDecoder.mismatch(jsonPath, "Position", json);
8757 }
8758 }
8759
8760 @override
8761 Map<String, dynamic> toJson() {
8762 Map<String, dynamic> result = {};
8763 result["file"] = file;
8764 result["offset"] = offset;
8765 return result;
8766 }
8767
8768 @override
8769 String toString() => JSON.encode(toJson());
8770
8771 @override
8772 bool operator==(other) {
8773 if (other is Position) {
8774 return file == other.file &&
8775 offset == other.offset;
8776 }
8777 return false;
8778 }
8779
8780 @override
8781 int get hashCode {
8782 int hash = 0;
8783 hash = JenkinsSmiHash.combine(hash, file.hashCode);
8784 hash = JenkinsSmiHash.combine(hash, offset.hashCode);
8785 return JenkinsSmiHash.finish(hash);
8786 }
8787 }
8788
8789 /**
8790 * RefactoringFeedback
8791 *
8792 * {
8793 * }
8794 *
8795 * Clients may not extend, implement or mix-in this class.
8796 */
8797 class RefactoringFeedback implements HasToJson {
8798 RefactoringFeedback();
8799
8800 factory RefactoringFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json, Map responseJson) {
8801 return refactoringFeedbackFromJson(jsonDecoder, jsonPath, json, responseJson );
8802 }
8803
8804 @override
8805 Map<String, dynamic> toJson() {
8806 Map<String, dynamic> result = {};
8807 return result;
8808 }
8809
8810 @override
8811 String toString() => JSON.encode(toJson());
8812
8813 @override
8814 bool operator==(other) {
8815 if (other is RefactoringFeedback) {
8816 return true;
8817 }
8818 return false;
8819 }
8820
8821 @override
8822 int get hashCode {
8823 int hash = 0;
8824 return JenkinsSmiHash.finish(hash);
8825 }
8826 }
8827
8828 /**
8829 * RefactoringKind
8830 *
8831 * enum {
8832 * CONVERT_GETTER_TO_METHOD
8833 * CONVERT_METHOD_TO_GETTER
8834 * EXTRACT_LOCAL_VARIABLE
8835 * EXTRACT_METHOD
8836 * INLINE_LOCAL_VARIABLE
8837 * INLINE_METHOD
8838 * MOVE_FILE
8839 * RENAME
8840 * SORT_MEMBERS
8841 * }
8842 *
8843 * Clients may not extend, implement or mix-in this class.
8844 */
8845 class RefactoringKind implements Enum {
8846 static const RefactoringKind CONVERT_GETTER_TO_METHOD = const RefactoringKind. _("CONVERT_GETTER_TO_METHOD");
8847
8848 static const RefactoringKind CONVERT_METHOD_TO_GETTER = const RefactoringKind. _("CONVERT_METHOD_TO_GETTER");
8849
8850 static const RefactoringKind EXTRACT_LOCAL_VARIABLE = const RefactoringKind._( "EXTRACT_LOCAL_VARIABLE");
8851
8852 static const RefactoringKind EXTRACT_METHOD = const RefactoringKind._("EXTRACT _METHOD");
8853
8854 static const RefactoringKind INLINE_LOCAL_VARIABLE = const RefactoringKind._(" INLINE_LOCAL_VARIABLE");
8855
8856 static const RefactoringKind INLINE_METHOD = const RefactoringKind._("INLINE_M ETHOD");
8857
8858 static const RefactoringKind MOVE_FILE = const RefactoringKind._("MOVE_FILE");
8859
8860 static const RefactoringKind RENAME = const RefactoringKind._("RENAME");
8861
8862 static const RefactoringKind SORT_MEMBERS = const RefactoringKind._("SORT_MEMB ERS");
8863
8864 /**
8865 * A list containing all of the enum values that are defined.
8866 */
8867 static const List<RefactoringKind> VALUES = const <RefactoringKind>[CONVERT_GE TTER_TO_METHOD, CONVERT_METHOD_TO_GETTER, EXTRACT_LOCAL_VARIABLE, EXTRACT_METHOD , INLINE_LOCAL_VARIABLE, INLINE_METHOD, MOVE_FILE, RENAME, SORT_MEMBERS];
8868
8869 @override
8870 final String name;
8871
8872 const RefactoringKind._(this.name);
8873
8874 factory RefactoringKind(String name) {
8875 switch (name) {
8876 case "CONVERT_GETTER_TO_METHOD":
8877 return CONVERT_GETTER_TO_METHOD;
8878 case "CONVERT_METHOD_TO_GETTER":
8879 return CONVERT_METHOD_TO_GETTER;
8880 case "EXTRACT_LOCAL_VARIABLE":
8881 return EXTRACT_LOCAL_VARIABLE;
8882 case "EXTRACT_METHOD":
8883 return EXTRACT_METHOD;
8884 case "INLINE_LOCAL_VARIABLE":
8885 return INLINE_LOCAL_VARIABLE;
8886 case "INLINE_METHOD":
8887 return INLINE_METHOD;
8888 case "MOVE_FILE":
8889 return MOVE_FILE;
8890 case "RENAME":
8891 return RENAME;
8892 case "SORT_MEMBERS":
8893 return SORT_MEMBERS;
8894 }
8895 throw new Exception('Illegal enum value: $name');
8896 }
8897
8898 factory RefactoringKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obj ect json) {
8899 if (json is String) {
8900 try {
8901 return new RefactoringKind(json);
8902 } catch(_) {
8903 // Fall through
8904 }
8905 }
8906 throw jsonDecoder.mismatch(jsonPath, "RefactoringKind", json);
8907 }
8908
8909 @override
8910 String toString() => "RefactoringKind.$name";
8911
8912 String toJson() => name;
8913 }
8914
8915 /**
8916 * RefactoringMethodParameter
8917 *
8918 * {
8919 * "id": optional String
8920 * "kind": RefactoringMethodParameterKind
8921 * "type": String
8922 * "name": String
8923 * "parameters": optional String
8924 * }
8925 *
8926 * Clients may not extend, implement or mix-in this class.
8927 */
8928 class RefactoringMethodParameter implements HasToJson {
8929 String _id;
8930
8931 RefactoringMethodParameterKind _kind;
8932
8933 String _type;
8934
8935 String _name;
8936
8937 String _parameters;
8938
8939 /**
8940 * The unique identifier of the parameter. Clients may omit this field for
8941 * the parameters they want to add.
8942 */
8943 String get id => _id;
8944
8945 /**
8946 * The unique identifier of the parameter. Clients may omit this field for
8947 * the parameters they want to add.
8948 */
8949 void set id(String value) {
8950 this._id = value;
8951 }
8952
8953 /**
8954 * The kind of the parameter.
8955 */
8956 RefactoringMethodParameterKind get kind => _kind;
8957
8958 /**
8959 * The kind of the parameter.
8960 */
8961 void set kind(RefactoringMethodParameterKind value) {
8962 assert(value != null);
8963 this._kind = value;
8964 }
8965
8966 /**
8967 * The type that should be given to the parameter, or the return type of the
8968 * parameter's function type.
8969 */
8970 String get type => _type;
8971
8972 /**
8973 * The type that should be given to the parameter, or the return type of the
8974 * parameter's function type.
8975 */
8976 void set type(String value) {
8977 assert(value != null);
8978 this._type = value;
8979 }
8980
8981 /**
8982 * The name that should be given to the parameter.
8983 */
8984 String get name => _name;
8985
8986 /**
8987 * The name that should be given to the parameter.
8988 */
8989 void set name(String value) {
8990 assert(value != null);
8991 this._name = value;
8992 }
8993
8994 /**
8995 * The parameter list of the parameter's function type. If the parameter is
8996 * not of a function type, this field will not be defined. If the function
8997 * type has zero parameters, this field will have a value of '()'.
8998 */
8999 String get parameters => _parameters;
9000
9001 /**
9002 * The parameter list of the parameter's function type. If the parameter is
9003 * not of a function type, this field will not be defined. If the function
9004 * type has zero parameters, this field will have a value of '()'.
9005 */
9006 void set parameters(String value) {
9007 this._parameters = value;
9008 }
9009
9010 RefactoringMethodParameter(RefactoringMethodParameterKind kind, String type, S tring name, {String id, String parameters}) {
9011 this.id = id;
9012 this.kind = kind;
9013 this.type = type;
9014 this.name = name;
9015 this.parameters = parameters;
9016 }
9017
9018 factory RefactoringMethodParameter.fromJson(JsonDecoder jsonDecoder, String js onPath, Object json) {
9019 if (json == null) {
9020 json = {};
9021 }
9022 if (json is Map) {
9023 String id;
9024 if (json.containsKey("id")) {
9025 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
9026 }
9027 RefactoringMethodParameterKind kind;
9028 if (json.containsKey("kind")) {
9029 kind = new RefactoringMethodParameterKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
9030 } else {
9031 throw jsonDecoder.mismatch(jsonPath, "kind");
9032 }
9033 String type;
9034 if (json.containsKey("type")) {
9035 type = jsonDecoder.decodeString(jsonPath + ".type", json["type"]);
9036 } else {
9037 throw jsonDecoder.mismatch(jsonPath, "type");
9038 }
9039 String name;
9040 if (json.containsKey("name")) {
9041 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
9042 } else {
9043 throw jsonDecoder.mismatch(jsonPath, "name");
9044 }
9045 String parameters;
9046 if (json.containsKey("parameters")) {
9047 parameters = jsonDecoder.decodeString(jsonPath + ".parameters", json["pa rameters"]);
9048 }
9049 return new RefactoringMethodParameter(kind, type, name, id: id, parameters : parameters);
9050 } else {
9051 throw jsonDecoder.mismatch(jsonPath, "RefactoringMethodParameter", json);
9052 }
9053 }
9054
9055 @override
9056 Map<String, dynamic> toJson() {
9057 Map<String, dynamic> result = {};
9058 if (id != null) {
9059 result["id"] = id;
9060 }
9061 result["kind"] = kind.toJson();
9062 result["type"] = type;
9063 result["name"] = name;
9064 if (parameters != null) {
9065 result["parameters"] = parameters;
9066 }
9067 return result;
9068 }
9069
9070 @override
9071 String toString() => JSON.encode(toJson());
9072
9073 @override
9074 bool operator==(other) {
9075 if (other is RefactoringMethodParameter) {
9076 return id == other.id &&
9077 kind == other.kind &&
9078 type == other.type &&
9079 name == other.name &&
9080 parameters == other.parameters;
9081 }
9082 return false;
9083 }
9084
9085 @override
9086 int get hashCode {
9087 int hash = 0;
9088 hash = JenkinsSmiHash.combine(hash, id.hashCode);
9089 hash = JenkinsSmiHash.combine(hash, kind.hashCode);
9090 hash = JenkinsSmiHash.combine(hash, type.hashCode);
9091 hash = JenkinsSmiHash.combine(hash, name.hashCode);
9092 hash = JenkinsSmiHash.combine(hash, parameters.hashCode);
9093 return JenkinsSmiHash.finish(hash);
9094 }
9095 }
9096
9097 /**
9098 * RefactoringMethodParameterKind
9099 *
9100 * enum {
9101 * REQUIRED
9102 * POSITIONAL
9103 * NAMED
9104 * }
9105 *
9106 * Clients may not extend, implement or mix-in this class.
9107 */
9108 class RefactoringMethodParameterKind implements Enum {
9109 static const RefactoringMethodParameterKind REQUIRED = const RefactoringMethod ParameterKind._("REQUIRED");
9110
9111 static const RefactoringMethodParameterKind POSITIONAL = const RefactoringMeth odParameterKind._("POSITIONAL");
9112
9113 static const RefactoringMethodParameterKind NAMED = const RefactoringMethodPar ameterKind._("NAMED");
9114
9115 /**
9116 * A list containing all of the enum values that are defined.
9117 */
9118 static const List<RefactoringMethodParameterKind> VALUES = const <RefactoringM ethodParameterKind>[REQUIRED, POSITIONAL, NAMED];
9119
9120 @override
9121 final String name;
9122
9123 const RefactoringMethodParameterKind._(this.name);
9124
9125 factory RefactoringMethodParameterKind(String name) {
9126 switch (name) {
9127 case "REQUIRED":
9128 return REQUIRED;
9129 case "POSITIONAL":
9130 return POSITIONAL;
9131 case "NAMED":
9132 return NAMED;
9133 }
9134 throw new Exception('Illegal enum value: $name');
9135 }
9136
9137 factory RefactoringMethodParameterKind.fromJson(JsonDecoder jsonDecoder, Strin g jsonPath, Object json) {
9138 if (json is String) {
9139 try {
9140 return new RefactoringMethodParameterKind(json);
9141 } catch(_) {
9142 // Fall through
9143 }
9144 }
9145 throw jsonDecoder.mismatch(jsonPath, "RefactoringMethodParameterKind", json) ;
9146 }
9147
9148 @override
9149 String toString() => "RefactoringMethodParameterKind.$name";
9150
9151 String toJson() => name;
9152 }
9153
9154 /**
9155 * RefactoringOptions
9156 *
9157 * {
9158 * }
9159 *
9160 * Clients may not extend, implement or mix-in this class.
9161 */
9162 class RefactoringOptions implements HasToJson {
9163 RefactoringOptions();
9164
9165 factory RefactoringOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json, RefactoringKind kind) {
9166 return refactoringOptionsFromJson(jsonDecoder, jsonPath, json, kind);
9167 }
9168
9169 @override
9170 Map<String, dynamic> toJson() {
9171 Map<String, dynamic> result = {};
9172 return result;
9173 }
9174
9175 @override
9176 String toString() => JSON.encode(toJson());
9177
9178 @override
9179 bool operator==(other) {
9180 if (other is RefactoringOptions) {
9181 return true;
9182 }
9183 return false;
9184 }
9185
9186 @override
9187 int get hashCode {
9188 int hash = 0;
9189 return JenkinsSmiHash.finish(hash);
9190 }
9191 }
9192
9193 /**
9194 * RefactoringProblem
9195 *
9196 * {
9197 * "severity": RefactoringProblemSeverity
9198 * "message": String
9199 * "location": optional Location
9200 * }
9201 *
9202 * Clients may not extend, implement or mix-in this class.
9203 */
9204 class RefactoringProblem implements HasToJson {
9205 RefactoringProblemSeverity _severity;
9206
9207 String _message;
9208
9209 Location _location;
9210
9211 /**
9212 * The severity of the problem being represented.
9213 */
9214 RefactoringProblemSeverity get severity => _severity;
9215
9216 /**
9217 * The severity of the problem being represented.
9218 */
9219 void set severity(RefactoringProblemSeverity value) {
9220 assert(value != null);
9221 this._severity = value;
9222 }
9223
9224 /**
9225 * A human-readable description of the problem being represented.
9226 */
9227 String get message => _message;
9228
9229 /**
9230 * A human-readable description of the problem being represented.
9231 */
9232 void set message(String value) {
9233 assert(value != null);
9234 this._message = value;
9235 }
9236
9237 /**
9238 * The location of the problem being represented. This field is omitted
9239 * unless there is a specific location associated with the problem (such as a
9240 * location where an element being renamed will be shadowed).
9241 */
9242 Location get location => _location;
9243
9244 /**
9245 * The location of the problem being represented. This field is omitted
9246 * unless there is a specific location associated with the problem (such as a
9247 * location where an element being renamed will be shadowed).
9248 */
9249 void set location(Location value) {
9250 this._location = value;
9251 }
9252
9253 RefactoringProblem(RefactoringProblemSeverity severity, String message, {Locat ion location}) {
9254 this.severity = severity;
9255 this.message = message;
9256 this.location = location;
9257 }
9258
9259 factory RefactoringProblem.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
9260 if (json == null) {
9261 json = {};
9262 }
9263 if (json is Map) {
9264 RefactoringProblemSeverity severity;
9265 if (json.containsKey("severity")) {
9266 severity = new RefactoringProblemSeverity.fromJson(jsonDecoder, jsonPath + ".severity", json["severity"]);
9267 } else {
9268 throw jsonDecoder.mismatch(jsonPath, "severity");
9269 }
9270 String message;
9271 if (json.containsKey("message")) {
9272 message = jsonDecoder.decodeString(jsonPath + ".message", json["message" ]);
9273 } else {
9274 throw jsonDecoder.mismatch(jsonPath, "message");
9275 }
9276 Location location;
9277 if (json.containsKey("location")) {
9278 location = new Location.fromJson(jsonDecoder, jsonPath + ".location", js on["location"]);
9279 }
9280 return new RefactoringProblem(severity, message, location: location);
9281 } else {
9282 throw jsonDecoder.mismatch(jsonPath, "RefactoringProblem", json);
9283 }
9284 }
9285
9286 @override
9287 Map<String, dynamic> toJson() {
9288 Map<String, dynamic> result = {};
9289 result["severity"] = severity.toJson();
9290 result["message"] = message;
9291 if (location != null) {
9292 result["location"] = location.toJson();
9293 }
9294 return result;
9295 }
9296
9297 @override
9298 String toString() => JSON.encode(toJson());
9299
9300 @override
9301 bool operator==(other) {
9302 if (other is RefactoringProblem) {
9303 return severity == other.severity &&
9304 message == other.message &&
9305 location == other.location;
9306 }
9307 return false;
9308 }
9309
9310 @override
9311 int get hashCode {
9312 int hash = 0;
9313 hash = JenkinsSmiHash.combine(hash, severity.hashCode);
9314 hash = JenkinsSmiHash.combine(hash, message.hashCode);
9315 hash = JenkinsSmiHash.combine(hash, location.hashCode);
9316 return JenkinsSmiHash.finish(hash);
9317 }
9318 }
9319
9320 /**
9321 * RefactoringProblemSeverity
9322 *
9323 * enum {
9324 * INFO
9325 * WARNING
9326 * ERROR
9327 * FATAL
9328 * }
9329 *
9330 * Clients may not extend, implement or mix-in this class.
9331 */
9332 class RefactoringProblemSeverity implements Enum {
9333 /**
9334 * A minor code problem. No example, because it is not used yet.
9335 */
9336 static const RefactoringProblemSeverity INFO = const RefactoringProblemSeverit y._("INFO");
9337
9338 /**
9339 * A minor code problem. For example names of local variables should be camel
9340 * case and start with a lower case letter. Staring the name of a variable
9341 * with an upper case is OK from the language point of view, but it is nice
9342 * to warn the user.
9343 */
9344 static const RefactoringProblemSeverity WARNING = const RefactoringProblemSeve rity._("WARNING");
9345
9346 /**
9347 * The refactoring technically can be performed, but there is a logical
9348 * problem. For example the name of a local variable being extracted
9349 * conflicts with another name in the scope, or duplicate parameter names in
9350 * the method being extracted, or a conflict between a parameter name and a
9351 * local variable, etc. In some cases the location of the problem is also
9352 * provided, so the IDE can show user the location and the problem, and let
9353 * the user decide whether they want to perform the refactoring. For example
9354 * the name conflict might be expected, and the user wants to fix it
9355 * afterwards.
9356 */
9357 static const RefactoringProblemSeverity ERROR = const RefactoringProblemSeveri ty._("ERROR");
9358
9359 /**
9360 * A fatal error, which prevents performing the refactoring. For example the
9361 * name of a local variable being extracted is not a valid identifier, or
9362 * selection is not a valid expression.
9363 */
9364 static const RefactoringProblemSeverity FATAL = const RefactoringProblemSeveri ty._("FATAL");
9365
9366 /**
9367 * A list containing all of the enum values that are defined.
9368 */
9369 static const List<RefactoringProblemSeverity> VALUES = const <RefactoringProbl emSeverity>[INFO, WARNING, ERROR, FATAL];
9370
9371 @override
9372 final String name;
9373
9374 const RefactoringProblemSeverity._(this.name);
9375
9376 factory RefactoringProblemSeverity(String name) {
9377 switch (name) {
9378 case "INFO":
9379 return INFO;
9380 case "WARNING":
9381 return WARNING;
9382 case "ERROR":
9383 return ERROR;
9384 case "FATAL":
9385 return FATAL;
9386 }
9387 throw new Exception('Illegal enum value: $name');
9388 }
9389
9390 factory RefactoringProblemSeverity.fromJson(JsonDecoder jsonDecoder, String js onPath, Object json) {
9391 if (json is String) {
9392 try {
9393 return new RefactoringProblemSeverity(json);
9394 } catch(_) {
9395 // Fall through
9396 }
9397 }
9398 throw jsonDecoder.mismatch(jsonPath, "RefactoringProblemSeverity", json);
9399 }
9400
9401 /**
9402 * Returns the [RefactoringProblemSeverity] with the maximal severity.
9403 */
9404 static RefactoringProblemSeverity max(RefactoringProblemSeverity a, Refactorin gProblemSeverity b) =>
9405 maxRefactoringProblemSeverity(a, b);
9406
9407 @override
9408 String toString() => "RefactoringProblemSeverity.$name";
9409
9410 String toJson() => name;
9411 }
9412
9413 /**
9414 * RemoveContentOverlay
9415 *
9416 * {
9417 * "type": "remove"
9418 * }
9419 *
9420 * Clients may not extend, implement or mix-in this class.
9421 */
9422 class RemoveContentOverlay implements HasToJson {
9423 RemoveContentOverlay();
9424
9425 factory RemoveContentOverlay.fromJson(JsonDecoder jsonDecoder, String jsonPath , Object json) {
9426 if (json == null) {
9427 json = {};
9428 }
9429 if (json is Map) {
9430 if (json["type"] != "remove") {
9431 throw jsonDecoder.mismatch(jsonPath, "equal " + "remove", json);
9432 }
9433 return new RemoveContentOverlay();
9434 } else {
9435 throw jsonDecoder.mismatch(jsonPath, "RemoveContentOverlay", json);
9436 }
9437 }
9438
9439 @override
9440 Map<String, dynamic> toJson() {
9441 Map<String, dynamic> result = {};
9442 result["type"] = "remove";
9443 return result;
9444 }
9445
9446 @override
9447 String toString() => JSON.encode(toJson());
9448
9449 @override
9450 bool operator==(other) {
9451 if (other is RemoveContentOverlay) {
9452 return true;
9453 }
9454 return false;
9455 }
9456
9457 @override
9458 int get hashCode {
9459 int hash = 0;
9460 hash = JenkinsSmiHash.combine(hash, 114870849);
9461 return JenkinsSmiHash.finish(hash);
9462 }
9463 }
9464
9465 /**
9466 * rename feedback
9467 *
9468 * {
9469 * "offset": int
9470 * "length": int
9471 * "elementKindName": String
9472 * "oldName": String
9473 * }
9474 *
9475 * Clients may not extend, implement or mix-in this class.
9476 */
9477 class RenameFeedback extends RefactoringFeedback {
9478 int _offset;
9479
9480 int _length;
9481
9482 String _elementKindName;
9483
9484 String _oldName;
9485
9486 /**
9487 * The offset to the beginning of the name selected to be renamed.
9488 */
9489 int get offset => _offset;
9490
9491 /**
9492 * The offset to the beginning of the name selected to be renamed.
9493 */
9494 void set offset(int value) {
9495 assert(value != null);
9496 this._offset = value;
9497 }
9498
9499 /**
9500 * The length of the name selected to be renamed.
9501 */
9502 int get length => _length;
9503
9504 /**
9505 * The length of the name selected to be renamed.
9506 */
9507 void set length(int value) {
9508 assert(value != null);
9509 this._length = value;
9510 }
9511
9512 /**
9513 * The human-readable description of the kind of element being renamed (such
9514 * as “class” or “function type alias”).
9515 */
9516 String get elementKindName => _elementKindName;
9517
9518 /**
9519 * The human-readable description of the kind of element being renamed (such
9520 * as “class” or “function type alias”).
9521 */
9522 void set elementKindName(String value) {
9523 assert(value != null);
9524 this._elementKindName = value;
9525 }
9526
9527 /**
9528 * The old name of the element before the refactoring.
9529 */
9530 String get oldName => _oldName;
9531
9532 /**
9533 * The old name of the element before the refactoring.
9534 */
9535 void set oldName(String value) {
9536 assert(value != null);
9537 this._oldName = value;
9538 }
9539
9540 RenameFeedback(int offset, int length, String elementKindName, String oldName) {
9541 this.offset = offset;
9542 this.length = length;
9543 this.elementKindName = elementKindName;
9544 this.oldName = oldName;
9545 }
9546
9547 factory RenameFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obje ct json) {
9548 if (json == null) {
9549 json = {};
9550 }
9551 if (json is Map) {
9552 int offset;
9553 if (json.containsKey("offset")) {
9554 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
9555 } else {
9556 throw jsonDecoder.mismatch(jsonPath, "offset");
9557 }
9558 int length;
9559 if (json.containsKey("length")) {
9560 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
9561 } else {
9562 throw jsonDecoder.mismatch(jsonPath, "length");
9563 }
9564 String elementKindName;
9565 if (json.containsKey("elementKindName")) {
9566 elementKindName = jsonDecoder.decodeString(jsonPath + ".elementKindName" , json["elementKindName"]);
9567 } else {
9568 throw jsonDecoder.mismatch(jsonPath, "elementKindName");
9569 }
9570 String oldName;
9571 if (json.containsKey("oldName")) {
9572 oldName = jsonDecoder.decodeString(jsonPath + ".oldName", json["oldName" ]);
9573 } else {
9574 throw jsonDecoder.mismatch(jsonPath, "oldName");
9575 }
9576 return new RenameFeedback(offset, length, elementKindName, oldName);
9577 } else {
9578 throw jsonDecoder.mismatch(jsonPath, "rename feedback", json);
9579 }
9580 }
9581
9582 @override
9583 Map<String, dynamic> toJson() {
9584 Map<String, dynamic> result = {};
9585 result["offset"] = offset;
9586 result["length"] = length;
9587 result["elementKindName"] = elementKindName;
9588 result["oldName"] = oldName;
9589 return result;
9590 }
9591
9592 @override
9593 String toString() => JSON.encode(toJson());
9594
9595 @override
9596 bool operator==(other) {
9597 if (other is RenameFeedback) {
9598 return offset == other.offset &&
9599 length == other.length &&
9600 elementKindName == other.elementKindName &&
9601 oldName == other.oldName;
9602 }
9603 return false;
9604 }
9605
9606 @override
9607 int get hashCode {
9608 int hash = 0;
9609 hash = JenkinsSmiHash.combine(hash, offset.hashCode);
9610 hash = JenkinsSmiHash.combine(hash, length.hashCode);
9611 hash = JenkinsSmiHash.combine(hash, elementKindName.hashCode);
9612 hash = JenkinsSmiHash.combine(hash, oldName.hashCode);
9613 return JenkinsSmiHash.finish(hash);
9614 }
9615 }
9616
9617 /**
9618 * rename options
9619 *
9620 * {
9621 * "newName": String
9622 * }
9623 *
9624 * Clients may not extend, implement or mix-in this class.
9625 */
9626 class RenameOptions extends RefactoringOptions {
9627 String _newName;
9628
9629 /**
9630 * The name that the element should have after the refactoring.
9631 */
9632 String get newName => _newName;
9633
9634 /**
9635 * The name that the element should have after the refactoring.
9636 */
9637 void set newName(String value) {
9638 assert(value != null);
9639 this._newName = value;
9640 }
9641
9642 RenameOptions(String newName) {
9643 this.newName = newName;
9644 }
9645
9646 factory RenameOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Objec t json) {
9647 if (json == null) {
9648 json = {};
9649 }
9650 if (json is Map) {
9651 String newName;
9652 if (json.containsKey("newName")) {
9653 newName = jsonDecoder.decodeString(jsonPath + ".newName", json["newName" ]);
9654 } else {
9655 throw jsonDecoder.mismatch(jsonPath, "newName");
9656 }
9657 return new RenameOptions(newName);
9658 } else {
9659 throw jsonDecoder.mismatch(jsonPath, "rename options", json);
9660 }
9661 }
9662
9663 factory RenameOptions.fromRefactoringParams(EditGetRefactoringParams refactori ngParams, Request request) {
9664 return new RenameOptions.fromJson(
9665 new RequestDecoder(request), "options", refactoringParams.options);
9666 }
9667
9668 @override
9669 Map<String, dynamic> toJson() {
9670 Map<String, dynamic> result = {};
9671 result["newName"] = newName;
9672 return result;
9673 }
9674
9675 @override
9676 String toString() => JSON.encode(toJson());
9677
9678 @override
9679 bool operator==(other) {
9680 if (other is RenameOptions) {
9681 return newName == other.newName;
9682 }
9683 return false;
9684 }
9685
9686 @override
9687 int get hashCode {
9688 int hash = 0;
9689 hash = JenkinsSmiHash.combine(hash, newName.hashCode);
9690 return JenkinsSmiHash.finish(hash);
9691 }
9692 }
9693
9694 /**
9695 * RequestError
9696 *
9697 * {
9698 * "code": RequestErrorCode
9699 * "message": String
9700 * "stackTrace": optional String
9701 * }
9702 *
9703 * Clients may not extend, implement or mix-in this class.
9704 */
9705 class RequestError implements HasToJson {
9706 RequestErrorCode _code;
9707
9708 String _message;
9709
9710 String _stackTrace;
9711
9712 /**
9713 * A code that uniquely identifies the error that occurred.
9714 */
9715 RequestErrorCode get code => _code;
9716
9717 /**
9718 * A code that uniquely identifies the error that occurred.
9719 */
9720 void set code(RequestErrorCode value) {
9721 assert(value != null);
9722 this._code = value;
9723 }
9724
9725 /**
9726 * A short description of the error.
9727 */
9728 String get message => _message;
9729
9730 /**
9731 * A short description of the error.
9732 */
9733 void set message(String value) {
9734 assert(value != null);
9735 this._message = value;
9736 }
9737
9738 /**
9739 * The stack trace associated with processing the request, used for debugging
9740 * the plugin.
9741 */
9742 String get stackTrace => _stackTrace;
9743
9744 /**
9745 * The stack trace associated with processing the request, used for debugging
9746 * the plugin.
9747 */
9748 void set stackTrace(String value) {
9749 this._stackTrace = value;
9750 }
9751
9752 RequestError(RequestErrorCode code, String message, {String stackTrace}) {
9753 this.code = code;
9754 this.message = message;
9755 this.stackTrace = stackTrace;
9756 }
9757
9758 factory RequestError.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
9759 if (json == null) {
9760 json = {};
9761 }
9762 if (json is Map) {
9763 RequestErrorCode code;
9764 if (json.containsKey("code")) {
9765 code = new RequestErrorCode.fromJson(jsonDecoder, jsonPath + ".code", js on["code"]);
9766 } else {
9767 throw jsonDecoder.mismatch(jsonPath, "code");
9768 }
9769 String message;
9770 if (json.containsKey("message")) {
9771 message = jsonDecoder.decodeString(jsonPath + ".message", json["message" ]);
9772 } else {
9773 throw jsonDecoder.mismatch(jsonPath, "message");
9774 }
9775 String stackTrace;
9776 if (json.containsKey("stackTrace")) {
9777 stackTrace = jsonDecoder.decodeString(jsonPath + ".stackTrace", json["st ackTrace"]);
9778 }
9779 return new RequestError(code, message, stackTrace: stackTrace);
9780 } else {
9781 throw jsonDecoder.mismatch(jsonPath, "RequestError", json);
9782 }
9783 }
9784
9785 @override
9786 Map<String, dynamic> toJson() {
9787 Map<String, dynamic> result = {};
9788 result["code"] = code.toJson();
9789 result["message"] = message;
9790 if (stackTrace != null) {
9791 result["stackTrace"] = stackTrace;
9792 }
9793 return result;
9794 }
9795
9796 @override
9797 String toString() => JSON.encode(toJson());
9798
9799 @override
9800 bool operator==(other) {
9801 if (other is RequestError) {
9802 return code == other.code &&
9803 message == other.message &&
9804 stackTrace == other.stackTrace;
9805 }
9806 return false;
9807 }
9808
9809 @override
9810 int get hashCode {
9811 int hash = 0;
9812 hash = JenkinsSmiHash.combine(hash, code.hashCode);
9813 hash = JenkinsSmiHash.combine(hash, message.hashCode);
9814 hash = JenkinsSmiHash.combine(hash, stackTrace.hashCode);
9815 return JenkinsSmiHash.finish(hash);
9816 }
9817 }
9818
9819 /**
9820 * RequestErrorCode
9821 *
9822 * enum {
9823 * INVALID_OVERLAY_CHANGE
9824 * INVALID_PARAMETER
9825 * PLUGIN_ERROR
9826 * UNKNOWN_REQUEST
9827 * }
9828 *
9829 * Clients may not extend, implement or mix-in this class.
9830 */
9831 class RequestErrorCode implements Enum {
9832 /**
9833 * An "analysis.updateContent" request contained a ChangeContentOverlay
9834 * object that can't be applied. This can happen for two reasons:
9835 *
9836 * - there was no preceding AddContentOverlay and hence no content to which
9837 * the edits could be applied, or
9838 * - one or more of the specified edits have an offset or length that is out
9839 * of range.
9840 */
9841 static const RequestErrorCode INVALID_OVERLAY_CHANGE = const RequestErrorCode. _("INVALID_OVERLAY_CHANGE");
9842
9843 /**
9844 * One of the method parameters was invalid.
9845 */
9846 static const RequestErrorCode INVALID_PARAMETER = const RequestErrorCode._("IN VALID_PARAMETER");
9847
9848 /**
9849 * An internal error occurred in the plugin while attempting to respond to a
9850 * request. Also see the plugin.error notification for errors that occur
9851 * outside of handling a request.
9852 */
9853 static const RequestErrorCode PLUGIN_ERROR = const RequestErrorCode._("PLUGIN_ ERROR");
9854
9855 /**
9856 * A request was received that the plugin does not recognize, or cannot
9857 * handle in its current configuration.
9858 */
9859 static const RequestErrorCode UNKNOWN_REQUEST = const RequestErrorCode._("UNKN OWN_REQUEST");
9860
9861 /**
9862 * A list containing all of the enum values that are defined.
9863 */
9864 static const List<RequestErrorCode> VALUES = const <RequestErrorCode>[INVALID_ OVERLAY_CHANGE, INVALID_PARAMETER, PLUGIN_ERROR, UNKNOWN_REQUEST];
9865
9866 @override
9867 final String name;
9868
9869 const RequestErrorCode._(this.name);
9870
9871 factory RequestErrorCode(String name) {
9872 switch (name) {
9873 case "INVALID_OVERLAY_CHANGE":
9874 return INVALID_OVERLAY_CHANGE;
9875 case "INVALID_PARAMETER":
9876 return INVALID_PARAMETER;
9877 case "PLUGIN_ERROR":
9878 return PLUGIN_ERROR;
9879 case "UNKNOWN_REQUEST":
9880 return UNKNOWN_REQUEST;
9881 }
9882 throw new Exception('Illegal enum value: $name');
9883 }
9884
9885 factory RequestErrorCode.fromJson(JsonDecoder jsonDecoder, String jsonPath, Ob ject json) {
9886 if (json is String) {
9887 try {
9888 return new RequestErrorCode(json);
9889 } catch(_) {
9890 // Fall through
9891 }
9892 }
9893 throw jsonDecoder.mismatch(jsonPath, "RequestErrorCode", json);
9894 }
9895
9896 @override
9897 String toString() => "RequestErrorCode.$name";
9898
9899 String toJson() => name;
9900 }
9901
9902 /**
9903 * SourceChange
9904 *
9905 * {
9906 * "message": String
9907 * "edits": List<SourceFileEdit>
9908 * "linkedEditGroups": List<LinkedEditGroup>
9909 * "selection": optional Position
9910 * }
9911 *
9912 * Clients may not extend, implement or mix-in this class.
9913 */
9914 class SourceChange implements HasToJson {
9915 String _message;
9916
9917 List<SourceFileEdit> _edits;
9918
9919 List<LinkedEditGroup> _linkedEditGroups;
9920
9921 Position _selection;
9922
9923 /**
9924 * A human-readable description of the change to be applied.
9925 */
9926 String get message => _message;
9927
9928 /**
9929 * A human-readable description of the change to be applied.
9930 */
9931 void set message(String value) {
9932 assert(value != null);
9933 this._message = value;
9934 }
9935
9936 /**
9937 * A list of the edits used to effect the change, grouped by file.
9938 */
9939 List<SourceFileEdit> get edits => _edits;
9940
9941 /**
9942 * A list of the edits used to effect the change, grouped by file.
9943 */
9944 void set edits(List<SourceFileEdit> value) {
9945 assert(value != null);
9946 this._edits = value;
9947 }
9948
9949 /**
9950 * A list of the linked editing groups used to customize the changes that
9951 * were made.
9952 */
9953 List<LinkedEditGroup> get linkedEditGroups => _linkedEditGroups;
9954
9955 /**
9956 * A list of the linked editing groups used to customize the changes that
9957 * were made.
9958 */
9959 void set linkedEditGroups(List<LinkedEditGroup> value) {
9960 assert(value != null);
9961 this._linkedEditGroups = value;
9962 }
9963
9964 /**
9965 * The position that should be selected after the edits have been applied.
9966 */
9967 Position get selection => _selection;
9968
9969 /**
9970 * The position that should be selected after the edits have been applied.
9971 */
9972 void set selection(Position value) {
9973 this._selection = value;
9974 }
9975
9976 SourceChange(String message, {List<SourceFileEdit> edits, List<LinkedEditGroup > linkedEditGroups, Position selection}) {
9977 this.message = message;
9978 if (edits == null) {
9979 this.edits = <SourceFileEdit>[];
9980 } else {
9981 this.edits = edits;
9982 }
9983 if (linkedEditGroups == null) {
9984 this.linkedEditGroups = <LinkedEditGroup>[];
9985 } else {
9986 this.linkedEditGroups = linkedEditGroups;
9987 }
9988 this.selection = selection;
9989 }
9990
9991 factory SourceChange.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
9992 if (json == null) {
9993 json = {};
9994 }
9995 if (json is Map) {
9996 String message;
9997 if (json.containsKey("message")) {
9998 message = jsonDecoder.decodeString(jsonPath + ".message", json["message" ]);
9999 } else {
10000 throw jsonDecoder.mismatch(jsonPath, "message");
10001 }
10002 List<SourceFileEdit> edits;
10003 if (json.containsKey("edits")) {
10004 edits = jsonDecoder.decodeList(jsonPath + ".edits", json["edits"], (Stri ng jsonPath, Object json) => new SourceFileEdit.fromJson(jsonDecoder, jsonPath, json));
10005 } else {
10006 throw jsonDecoder.mismatch(jsonPath, "edits");
10007 }
10008 List<LinkedEditGroup> linkedEditGroups;
10009 if (json.containsKey("linkedEditGroups")) {
10010 linkedEditGroups = jsonDecoder.decodeList(jsonPath + ".linkedEditGroups" , json["linkedEditGroups"], (String jsonPath, Object json) => new LinkedEditGrou p.fromJson(jsonDecoder, jsonPath, json));
10011 } else {
10012 throw jsonDecoder.mismatch(jsonPath, "linkedEditGroups");
10013 }
10014 Position selection;
10015 if (json.containsKey("selection")) {
10016 selection = new Position.fromJson(jsonDecoder, jsonPath + ".selection", json["selection"]);
10017 }
10018 return new SourceChange(message, edits: edits, linkedEditGroups: linkedEdi tGroups, selection: selection);
10019 } else {
10020 throw jsonDecoder.mismatch(jsonPath, "SourceChange", json);
10021 }
10022 }
10023
10024 @override
10025 Map<String, dynamic> toJson() {
10026 Map<String, dynamic> result = {};
10027 result["message"] = message;
10028 result["edits"] = edits.map((SourceFileEdit value) => value.toJson()).toList ();
10029 result["linkedEditGroups"] = linkedEditGroups.map((LinkedEditGroup value) => value.toJson()).toList();
10030 if (selection != null) {
10031 result["selection"] = selection.toJson();
10032 }
10033 return result;
10034 }
10035
10036 /**
10037 * Adds [edit] to the [FileEdit] for the given [file].
10038 */
10039 void addEdit(String file, int fileStamp, SourceEdit edit) =>
10040 addEditToSourceChange(this, file, fileStamp, edit);
10041
10042 /**
10043 * Adds the given [FileEdit].
10044 */
10045 void addFileEdit(SourceFileEdit edit) {
10046 edits.add(edit);
10047 }
10048
10049 /**
10050 * Adds the given [LinkedEditGroup].
10051 */
10052 void addLinkedEditGroup(LinkedEditGroup linkedEditGroup) {
10053 linkedEditGroups.add(linkedEditGroup);
10054 }
10055
10056 /**
10057 * Returns the [FileEdit] for the given [file], maybe `null`.
10058 */
10059 SourceFileEdit getFileEdit(String file) =>
10060 getChangeFileEdit(this, file);
10061
10062 @override
10063 String toString() => JSON.encode(toJson());
10064
10065 @override
10066 bool operator==(other) {
10067 if (other is SourceChange) {
10068 return message == other.message &&
10069 listEqual(edits, other.edits, (SourceFileEdit a, SourceFileEdit b) => a == b) &&
10070 listEqual(linkedEditGroups, other.linkedEditGroups, (LinkedEditGroup a , LinkedEditGroup b) => a == b) &&
10071 selection == other.selection;
10072 }
10073 return false;
10074 }
10075
10076 @override
10077 int get hashCode {
10078 int hash = 0;
10079 hash = JenkinsSmiHash.combine(hash, message.hashCode);
10080 hash = JenkinsSmiHash.combine(hash, edits.hashCode);
10081 hash = JenkinsSmiHash.combine(hash, linkedEditGroups.hashCode);
10082 hash = JenkinsSmiHash.combine(hash, selection.hashCode);
10083 return JenkinsSmiHash.finish(hash);
10084 }
10085 }
10086
10087 /**
10088 * SourceEdit
10089 *
10090 * {
10091 * "offset": int
10092 * "length": int
10093 * "replacement": String
10094 * "id": optional String
10095 * }
10096 *
10097 * Clients may not extend, implement or mix-in this class.
10098 */
10099 class SourceEdit implements HasToJson {
10100 /**
10101 * Get the result of applying a set of [edits] to the given [code]. Edits are
10102 * applied in the order they appear in [edits].
10103 */
10104 static String applySequence(String code, Iterable<SourceEdit> edits) =>
10105 applySequenceOfEdits(code, edits);
10106
10107 int _offset;
10108
10109 int _length;
10110
10111 String _replacement;
10112
10113 String _id;
10114
10115 /**
10116 * The offset of the region to be modified.
10117 */
10118 int get offset => _offset;
10119
10120 /**
10121 * The offset of the region to be modified.
10122 */
10123 void set offset(int value) {
10124 assert(value != null);
10125 this._offset = value;
10126 }
10127
10128 /**
10129 * The length of the region to be modified.
10130 */
10131 int get length => _length;
10132
10133 /**
10134 * The length of the region to be modified.
10135 */
10136 void set length(int value) {
10137 assert(value != null);
10138 this._length = value;
10139 }
10140
10141 /**
10142 * The code that is to replace the specified region in the original code.
10143 */
10144 String get replacement => _replacement;
10145
10146 /**
10147 * The code that is to replace the specified region in the original code.
10148 */
10149 void set replacement(String value) {
10150 assert(value != null);
10151 this._replacement = value;
10152 }
10153
10154 /**
10155 * An identifier that uniquely identifies this source edit from other edits
10156 * in the same response. This field is omitted unless a containing structure
10157 * needs to be able to identify the edit for some reason.
10158 *
10159 * For example, some refactoring operations can produce edits that might not
10160 * be appropriate (referred to as potential edits). Such edits will have an
10161 * id so that they can be referenced. Edits in the same response that do not
10162 * need to be referenced will not have an id.
10163 */
10164 String get id => _id;
10165
10166 /**
10167 * An identifier that uniquely identifies this source edit from other edits
10168 * in the same response. This field is omitted unless a containing structure
10169 * needs to be able to identify the edit for some reason.
10170 *
10171 * For example, some refactoring operations can produce edits that might not
10172 * be appropriate (referred to as potential edits). Such edits will have an
10173 * id so that they can be referenced. Edits in the same response that do not
10174 * need to be referenced will not have an id.
10175 */
10176 void set id(String value) {
10177 this._id = value;
10178 }
10179
10180 SourceEdit(int offset, int length, String replacement, {String id}) {
10181 this.offset = offset;
10182 this.length = length;
10183 this.replacement = replacement;
10184 this.id = id;
10185 }
10186
10187 factory SourceEdit.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object j son) {
10188 if (json == null) {
10189 json = {};
10190 }
10191 if (json is Map) {
10192 int offset;
10193 if (json.containsKey("offset")) {
10194 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
10195 } else {
10196 throw jsonDecoder.mismatch(jsonPath, "offset");
10197 }
10198 int length;
10199 if (json.containsKey("length")) {
10200 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
10201 } else {
10202 throw jsonDecoder.mismatch(jsonPath, "length");
10203 }
10204 String replacement;
10205 if (json.containsKey("replacement")) {
10206 replacement = jsonDecoder.decodeString(jsonPath + ".replacement", json[" replacement"]);
10207 } else {
10208 throw jsonDecoder.mismatch(jsonPath, "replacement");
10209 }
10210 String id;
10211 if (json.containsKey("id")) {
10212 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
10213 }
10214 return new SourceEdit(offset, length, replacement, id: id);
10215 } else {
10216 throw jsonDecoder.mismatch(jsonPath, "SourceEdit", json);
10217 }
10218 }
10219
10220 /**
10221 * The end of the region to be modified.
10222 */
10223 int get end => offset + length;
10224
10225 @override
10226 Map<String, dynamic> toJson() {
10227 Map<String, dynamic> result = {};
10228 result["offset"] = offset;
10229 result["length"] = length;
10230 result["replacement"] = replacement;
10231 if (id != null) {
10232 result["id"] = id;
10233 }
10234 return result;
10235 }
10236
10237 /**
10238 * Get the result of applying the edit to the given [code].
10239 */
10240 String apply(String code) => applyEdit(code, this);
10241
10242 @override
10243 String toString() => JSON.encode(toJson());
10244
10245 @override
10246 bool operator==(other) {
10247 if (other is SourceEdit) {
10248 return offset == other.offset &&
10249 length == other.length &&
10250 replacement == other.replacement &&
10251 id == other.id;
10252 }
10253 return false;
10254 }
10255
10256 @override
10257 int get hashCode {
10258 int hash = 0;
10259 hash = JenkinsSmiHash.combine(hash, offset.hashCode);
10260 hash = JenkinsSmiHash.combine(hash, length.hashCode);
10261 hash = JenkinsSmiHash.combine(hash, replacement.hashCode);
10262 hash = JenkinsSmiHash.combine(hash, id.hashCode);
10263 return JenkinsSmiHash.finish(hash);
10264 }
10265 }
10266
10267 /**
10268 * SourceFileEdit
10269 *
10270 * {
10271 * "file": FilePath
10272 * "fileStamp": long
10273 * "edits": List<SourceEdit>
10274 * }
10275 *
10276 * Clients may not extend, implement or mix-in this class.
10277 */
10278 class SourceFileEdit implements HasToJson {
10279 String _file;
10280
10281 int _fileStamp;
10282
10283 List<SourceEdit> _edits;
10284
10285 /**
10286 * The file containing the code to be modified.
10287 */
10288 String get file => _file;
10289
10290 /**
10291 * The file containing the code to be modified.
10292 */
10293 void set file(String value) {
10294 assert(value != null);
10295 this._file = value;
10296 }
10297
10298 /**
10299 * The modification stamp of the file at the moment when the change was
10300 * created, in milliseconds since the "Unix epoch". Will be -1 if the file
10301 * did not exist and should be created. The client may use this field to make
10302 * sure that the file was not changed since then, so it is safe to apply the
10303 * change.
10304 */
10305 int get fileStamp => _fileStamp;
10306
10307 /**
10308 * The modification stamp of the file at the moment when the change was
10309 * created, in milliseconds since the "Unix epoch". Will be -1 if the file
10310 * did not exist and should be created. The client may use this field to make
10311 * sure that the file was not changed since then, so it is safe to apply the
10312 * change.
10313 */
10314 void set fileStamp(int value) {
10315 assert(value != null);
10316 this._fileStamp = value;
10317 }
10318
10319 /**
10320 * A list of the edits used to effect the change.
10321 */
10322 List<SourceEdit> get edits => _edits;
10323
10324 /**
10325 * A list of the edits used to effect the change.
10326 */
10327 void set edits(List<SourceEdit> value) {
10328 assert(value != null);
10329 this._edits = value;
10330 }
10331
10332 SourceFileEdit(String file, int fileStamp, {List<SourceEdit> edits}) {
10333 this.file = file;
10334 this.fileStamp = fileStamp;
10335 if (edits == null) {
10336 this.edits = <SourceEdit>[];
10337 } else {
10338 this.edits = edits;
10339 }
10340 }
10341
10342 factory SourceFileEdit.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obje ct json) {
10343 if (json == null) {
10344 json = {};
10345 }
10346 if (json is Map) {
10347 String file;
10348 if (json.containsKey("file")) {
10349 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
10350 } else {
10351 throw jsonDecoder.mismatch(jsonPath, "file");
10352 }
10353 int fileStamp;
10354 if (json.containsKey("fileStamp")) {
10355 fileStamp = jsonDecoder.decodeInt(jsonPath + ".fileStamp", json["fileSta mp"]);
10356 } else {
10357 throw jsonDecoder.mismatch(jsonPath, "fileStamp");
10358 }
10359 List<SourceEdit> edits;
10360 if (json.containsKey("edits")) {
10361 edits = jsonDecoder.decodeList(jsonPath + ".edits", json["edits"], (Stri ng jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, json ));
10362 } else {
10363 throw jsonDecoder.mismatch(jsonPath, "edits");
10364 }
10365 return new SourceFileEdit(file, fileStamp, edits: edits);
10366 } else {
10367 throw jsonDecoder.mismatch(jsonPath, "SourceFileEdit", json);
10368 }
10369 }
10370
10371 @override
10372 Map<String, dynamic> toJson() {
10373 Map<String, dynamic> result = {};
10374 result["file"] = file;
10375 result["fileStamp"] = fileStamp;
10376 result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList();
10377 return result;
10378 }
10379
10380 /**
10381 * Adds the given [Edit] to the list.
10382 */
10383 void add(SourceEdit edit) => addEditForSource(this, edit);
10384
10385 /**
10386 * Adds the given [Edit]s.
10387 */
10388 void addAll(Iterable<SourceEdit> edits) =>
10389 addAllEditsForSource(this, edits);
10390
10391 @override
10392 String toString() => JSON.encode(toJson());
10393
10394 @override
10395 bool operator==(other) {
10396 if (other is SourceFileEdit) {
10397 return file == other.file &&
10398 fileStamp == other.fileStamp &&
10399 listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a == b);
10400 }
10401 return false;
10402 }
10403
10404 @override
10405 int get hashCode {
10406 int hash = 0;
10407 hash = JenkinsSmiHash.combine(hash, file.hashCode);
10408 hash = JenkinsSmiHash.combine(hash, fileStamp.hashCode);
10409 hash = JenkinsSmiHash.combine(hash, edits.hashCode);
10410 return JenkinsSmiHash.finish(hash);
10411 }
10412 }
10413
10414 /**
10415 * WatchEvent
10416 *
10417 * {
10418 * "type": WatchEventType
10419 * "path": String
10420 * }
10421 *
10422 * Clients may not extend, implement or mix-in this class.
10423 */
10424 class WatchEvent implements HasToJson {
10425 WatchEventType _type;
10426
10427 String _path;
10428
10429 /**
10430 * The type of change represented by this event.
10431 */
10432 WatchEventType get type => _type;
10433
10434 /**
10435 * The type of change represented by this event.
10436 */
10437 void set type(WatchEventType value) {
10438 assert(value != null);
10439 this._type = value;
10440 }
10441
10442 /**
10443 * The absolute path of the file or directory that changed.
10444 */
10445 String get path => _path;
10446
10447 /**
10448 * The absolute path of the file or directory that changed.
10449 */
10450 void set path(String value) {
10451 assert(value != null);
10452 this._path = value;
10453 }
10454
10455 WatchEvent(WatchEventType type, String path) {
10456 this.type = type;
10457 this.path = path;
10458 }
10459
10460 factory WatchEvent.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object j son) {
10461 if (json == null) {
10462 json = {};
10463 }
10464 if (json is Map) {
10465 WatchEventType type;
10466 if (json.containsKey("type")) {
10467 type = new WatchEventType.fromJson(jsonDecoder, jsonPath + ".type", json ["type"]);
10468 } else {
10469 throw jsonDecoder.mismatch(jsonPath, "type");
10470 }
10471 String path;
10472 if (json.containsKey("path")) {
10473 path = jsonDecoder.decodeString(jsonPath + ".path", json["path"]);
10474 } else {
10475 throw jsonDecoder.mismatch(jsonPath, "path");
10476 }
10477 return new WatchEvent(type, path);
10478 } else {
10479 throw jsonDecoder.mismatch(jsonPath, "WatchEvent", json);
10480 }
10481 }
10482
10483 @override
10484 Map<String, dynamic> toJson() {
10485 Map<String, dynamic> result = {};
10486 result["type"] = type.toJson();
10487 result["path"] = path;
10488 return result;
10489 }
10490
10491 @override
10492 String toString() => JSON.encode(toJson());
10493
10494 @override
10495 bool operator==(other) {
10496 if (other is WatchEvent) {
10497 return type == other.type &&
10498 path == other.path;
10499 }
10500 return false;
10501 }
10502
10503 @override
10504 int get hashCode {
10505 int hash = 0;
10506 hash = JenkinsSmiHash.combine(hash, type.hashCode);
10507 hash = JenkinsSmiHash.combine(hash, path.hashCode);
10508 return JenkinsSmiHash.finish(hash);
10509 }
10510 }
10511
10512 /**
10513 * WatchEventType
10514 *
10515 * enum {
10516 * ADD
10517 * MODIFY
10518 * REMOVE
10519 * }
10520 *
10521 * Clients may not extend, implement or mix-in this class.
10522 */
10523 class WatchEventType implements Enum {
10524 /**
10525 * An indication that the file or directory was added.
10526 */
10527 static const WatchEventType ADD = const WatchEventType._("ADD");
10528
10529 /**
10530 * An indication that the file was modified.
10531 */
10532 static const WatchEventType MODIFY = const WatchEventType._("MODIFY");
10533
10534 /**
10535 * An indication that the file or directory was removed.
10536 */
10537 static const WatchEventType REMOVE = const WatchEventType._("REMOVE");
10538
10539 /**
10540 * A list containing all of the enum values that are defined.
10541 */
10542 static const List<WatchEventType> VALUES = const <WatchEventType>[ADD, MODIFY, REMOVE];
10543
10544 @override
10545 final String name;
10546
10547 const WatchEventType._(this.name);
10548
10549 factory WatchEventType(String name) {
10550 switch (name) {
10551 case "ADD":
10552 return ADD;
10553 case "MODIFY":
10554 return MODIFY;
10555 case "REMOVE":
10556 return REMOVE;
10557 }
10558 throw new Exception('Illegal enum value: $name');
10559 }
10560
10561 factory WatchEventType.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obje ct json) {
10562 if (json is String) {
10563 try {
10564 return new WatchEventType(json);
10565 } catch(_) {
10566 // Fall through
10567 }
10568 }
10569 throw jsonDecoder.mismatch(jsonPath, "WatchEventType", json);
10570 }
10571
10572 @override
10573 String toString() => "WatchEventType.$name";
10574
10575 String toJson() => name;
10576 }
OLDNEW
« no previous file with comments | « pkg/analyzer_plugin/doc/api.html ('k') | pkg/analyzer_plugin/lib/protocol/protocol.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698