OLD | NEW |
| (Empty) |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | |
2 // for details. All rights reserved. Use of this source code is governed by a | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 // | |
5 // This file has been automatically generated. Please do not edit it manually. | |
6 // To regenerate the file, use the script | |
7 // "pkg/analysis_server/tool/spec/generate_files". | |
8 | |
9 part of analysis_server.plugin.protocol.protocol; | |
10 | |
11 /** | |
12 * server.getVersion params | |
13 * | |
14 * Clients may not extend, implement or mix-in this class. | |
15 */ | |
16 class ServerGetVersionParams { | |
17 Request toRequest(String id) { | |
18 return new Request(id, "server.getVersion", null); | |
19 } | |
20 | |
21 @override | |
22 bool operator ==(other) { | |
23 if (other is ServerGetVersionParams) { | |
24 return true; | |
25 } | |
26 return false; | |
27 } | |
28 | |
29 @override | |
30 int get hashCode { | |
31 return 55877452; | |
32 } | |
33 } | |
34 | |
35 /** | |
36 * server.getVersion result | |
37 * | |
38 * { | |
39 * "version": String | |
40 * } | |
41 * | |
42 * Clients may not extend, implement or mix-in this class. | |
43 */ | |
44 class ServerGetVersionResult implements HasToJson { | |
45 String _version; | |
46 | |
47 /** | |
48 * The version number of the analysis server. | |
49 */ | |
50 String get version => _version; | |
51 | |
52 /** | |
53 * The version number of the analysis server. | |
54 */ | |
55 void set version(String value) { | |
56 assert(value != null); | |
57 this._version = value; | |
58 } | |
59 | |
60 ServerGetVersionResult(String version) { | |
61 this.version = version; | |
62 } | |
63 | |
64 factory ServerGetVersionResult.fromJson( | |
65 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
66 if (json == null) { | |
67 json = {}; | |
68 } | |
69 if (json is Map) { | |
70 String version; | |
71 if (json.containsKey("version")) { | |
72 version = | |
73 jsonDecoder.decodeString(jsonPath + ".version", json["version"]); | |
74 } else { | |
75 throw jsonDecoder.missingKey(jsonPath, "version"); | |
76 } | |
77 return new ServerGetVersionResult(version); | |
78 } else { | |
79 throw jsonDecoder.mismatch(jsonPath, "server.getVersion result", json); | |
80 } | |
81 } | |
82 | |
83 factory ServerGetVersionResult.fromResponse(Response response) { | |
84 return new ServerGetVersionResult.fromJson( | |
85 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
86 "result", | |
87 response._result); | |
88 } | |
89 | |
90 Map<String, dynamic> toJson() { | |
91 Map<String, dynamic> result = {}; | |
92 result["version"] = version; | |
93 return result; | |
94 } | |
95 | |
96 Response toResponse(String id) { | |
97 return new Response(id, result: toJson()); | |
98 } | |
99 | |
100 @override | |
101 String toString() => JSON.encode(toJson()); | |
102 | |
103 @override | |
104 bool operator ==(other) { | |
105 if (other is ServerGetVersionResult) { | |
106 return version == other.version; | |
107 } | |
108 return false; | |
109 } | |
110 | |
111 @override | |
112 int get hashCode { | |
113 int hash = 0; | |
114 hash = JenkinsSmiHash.combine(hash, version.hashCode); | |
115 return JenkinsSmiHash.finish(hash); | |
116 } | |
117 } | |
118 | |
119 /** | |
120 * server.shutdown params | |
121 * | |
122 * Clients may not extend, implement or mix-in this class. | |
123 */ | |
124 class ServerShutdownParams { | |
125 Request toRequest(String id) { | |
126 return new Request(id, "server.shutdown", null); | |
127 } | |
128 | |
129 @override | |
130 bool operator ==(other) { | |
131 if (other is ServerShutdownParams) { | |
132 return true; | |
133 } | |
134 return false; | |
135 } | |
136 | |
137 @override | |
138 int get hashCode { | |
139 return 366630911; | |
140 } | |
141 } | |
142 | |
143 /** | |
144 * server.shutdown result | |
145 * | |
146 * Clients may not extend, implement or mix-in this class. | |
147 */ | |
148 class ServerShutdownResult { | |
149 Response toResponse(String id) { | |
150 return new Response(id, result: null); | |
151 } | |
152 | |
153 @override | |
154 bool operator ==(other) { | |
155 if (other is ServerShutdownResult) { | |
156 return true; | |
157 } | |
158 return false; | |
159 } | |
160 | |
161 @override | |
162 int get hashCode { | |
163 return 193626532; | |
164 } | |
165 } | |
166 | |
167 /** | |
168 * server.setSubscriptions params | |
169 * | |
170 * { | |
171 * "subscriptions": List<ServerService> | |
172 * } | |
173 * | |
174 * Clients may not extend, implement or mix-in this class. | |
175 */ | |
176 class ServerSetSubscriptionsParams implements HasToJson { | |
177 List<ServerService> _subscriptions; | |
178 | |
179 /** | |
180 * A list of the services being subscribed to. | |
181 */ | |
182 List<ServerService> get subscriptions => _subscriptions; | |
183 | |
184 /** | |
185 * A list of the services being subscribed to. | |
186 */ | |
187 void set subscriptions(List<ServerService> value) { | |
188 assert(value != null); | |
189 this._subscriptions = value; | |
190 } | |
191 | |
192 ServerSetSubscriptionsParams(List<ServerService> subscriptions) { | |
193 this.subscriptions = subscriptions; | |
194 } | |
195 | |
196 factory ServerSetSubscriptionsParams.fromJson( | |
197 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
198 if (json == null) { | |
199 json = {}; | |
200 } | |
201 if (json is Map) { | |
202 List<ServerService> subscriptions; | |
203 if (json.containsKey("subscriptions")) { | |
204 subscriptions = jsonDecoder.decodeList( | |
205 jsonPath + ".subscriptions", | |
206 json["subscriptions"], | |
207 (String jsonPath, Object json) => | |
208 new ServerService.fromJson(jsonDecoder, jsonPath, json)); | |
209 } else { | |
210 throw jsonDecoder.missingKey(jsonPath, "subscriptions"); | |
211 } | |
212 return new ServerSetSubscriptionsParams(subscriptions); | |
213 } else { | |
214 throw jsonDecoder.mismatch( | |
215 jsonPath, "server.setSubscriptions params", json); | |
216 } | |
217 } | |
218 | |
219 factory ServerSetSubscriptionsParams.fromRequest(Request request) { | |
220 return new ServerSetSubscriptionsParams.fromJson( | |
221 new RequestDecoder(request), "params", request._params); | |
222 } | |
223 | |
224 Map<String, dynamic> toJson() { | |
225 Map<String, dynamic> result = {}; | |
226 result["subscriptions"] = | |
227 subscriptions.map((ServerService value) => value.toJson()).toList(); | |
228 return result; | |
229 } | |
230 | |
231 Request toRequest(String id) { | |
232 return new Request(id, "server.setSubscriptions", toJson()); | |
233 } | |
234 | |
235 @override | |
236 String toString() => JSON.encode(toJson()); | |
237 | |
238 @override | |
239 bool operator ==(other) { | |
240 if (other is ServerSetSubscriptionsParams) { | |
241 return listEqual(subscriptions, other.subscriptions, | |
242 (ServerService a, ServerService b) => a == b); | |
243 } | |
244 return false; | |
245 } | |
246 | |
247 @override | |
248 int get hashCode { | |
249 int hash = 0; | |
250 hash = JenkinsSmiHash.combine(hash, subscriptions.hashCode); | |
251 return JenkinsSmiHash.finish(hash); | |
252 } | |
253 } | |
254 | |
255 /** | |
256 * server.setSubscriptions result | |
257 * | |
258 * Clients may not extend, implement or mix-in this class. | |
259 */ | |
260 class ServerSetSubscriptionsResult { | |
261 Response toResponse(String id) { | |
262 return new Response(id, result: null); | |
263 } | |
264 | |
265 @override | |
266 bool operator ==(other) { | |
267 if (other is ServerSetSubscriptionsResult) { | |
268 return true; | |
269 } | |
270 return false; | |
271 } | |
272 | |
273 @override | |
274 int get hashCode { | |
275 return 748820900; | |
276 } | |
277 } | |
278 | |
279 /** | |
280 * server.connected params | |
281 * | |
282 * { | |
283 * "version": String | |
284 * "pid": int | |
285 * "sessionId": optional String | |
286 * } | |
287 * | |
288 * Clients may not extend, implement or mix-in this class. | |
289 */ | |
290 class ServerConnectedParams implements HasToJson { | |
291 String _version; | |
292 | |
293 int _pid; | |
294 | |
295 String _sessionId; | |
296 | |
297 /** | |
298 * The version number of the analysis server. | |
299 */ | |
300 String get version => _version; | |
301 | |
302 /** | |
303 * The version number of the analysis server. | |
304 */ | |
305 void set version(String value) { | |
306 assert(value != null); | |
307 this._version = value; | |
308 } | |
309 | |
310 /** | |
311 * The process id of the analysis server process. | |
312 */ | |
313 int get pid => _pid; | |
314 | |
315 /** | |
316 * The process id of the analysis server process. | |
317 */ | |
318 void set pid(int value) { | |
319 assert(value != null); | |
320 this._pid = value; | |
321 } | |
322 | |
323 /** | |
324 * The session id for this session. | |
325 */ | |
326 String get sessionId => _sessionId; | |
327 | |
328 /** | |
329 * The session id for this session. | |
330 */ | |
331 void set sessionId(String value) { | |
332 this._sessionId = value; | |
333 } | |
334 | |
335 ServerConnectedParams(String version, int pid, {String sessionId}) { | |
336 this.version = version; | |
337 this.pid = pid; | |
338 this.sessionId = sessionId; | |
339 } | |
340 | |
341 factory ServerConnectedParams.fromJson( | |
342 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
343 if (json == null) { | |
344 json = {}; | |
345 } | |
346 if (json is Map) { | |
347 String version; | |
348 if (json.containsKey("version")) { | |
349 version = | |
350 jsonDecoder.decodeString(jsonPath + ".version", json["version"]); | |
351 } else { | |
352 throw jsonDecoder.missingKey(jsonPath, "version"); | |
353 } | |
354 int pid; | |
355 if (json.containsKey("pid")) { | |
356 pid = jsonDecoder.decodeInt(jsonPath + ".pid", json["pid"]); | |
357 } else { | |
358 throw jsonDecoder.missingKey(jsonPath, "pid"); | |
359 } | |
360 String sessionId; | |
361 if (json.containsKey("sessionId")) { | |
362 sessionId = jsonDecoder.decodeString( | |
363 jsonPath + ".sessionId", json["sessionId"]); | |
364 } | |
365 return new ServerConnectedParams(version, pid, sessionId: sessionId); | |
366 } else { | |
367 throw jsonDecoder.mismatch(jsonPath, "server.connected params", json); | |
368 } | |
369 } | |
370 | |
371 factory ServerConnectedParams.fromNotification(Notification notification) { | |
372 return new ServerConnectedParams.fromJson( | |
373 new ResponseDecoder(null), "params", notification._params); | |
374 } | |
375 | |
376 Map<String, dynamic> toJson() { | |
377 Map<String, dynamic> result = {}; | |
378 result["version"] = version; | |
379 result["pid"] = pid; | |
380 if (sessionId != null) { | |
381 result["sessionId"] = sessionId; | |
382 } | |
383 return result; | |
384 } | |
385 | |
386 Notification toNotification() { | |
387 return new Notification("server.connected", toJson()); | |
388 } | |
389 | |
390 @override | |
391 String toString() => JSON.encode(toJson()); | |
392 | |
393 @override | |
394 bool operator ==(other) { | |
395 if (other is ServerConnectedParams) { | |
396 return version == other.version && | |
397 pid == other.pid && | |
398 sessionId == other.sessionId; | |
399 } | |
400 return false; | |
401 } | |
402 | |
403 @override | |
404 int get hashCode { | |
405 int hash = 0; | |
406 hash = JenkinsSmiHash.combine(hash, version.hashCode); | |
407 hash = JenkinsSmiHash.combine(hash, pid.hashCode); | |
408 hash = JenkinsSmiHash.combine(hash, sessionId.hashCode); | |
409 return JenkinsSmiHash.finish(hash); | |
410 } | |
411 } | |
412 | |
413 /** | |
414 * server.error params | |
415 * | |
416 * { | |
417 * "isFatal": bool | |
418 * "message": String | |
419 * "stackTrace": String | |
420 * } | |
421 * | |
422 * Clients may not extend, implement or mix-in this class. | |
423 */ | |
424 class ServerErrorParams implements HasToJson { | |
425 bool _isFatal; | |
426 | |
427 String _message; | |
428 | |
429 String _stackTrace; | |
430 | |
431 /** | |
432 * True if the error is a fatal error, meaning that the server will shutdown | |
433 * automatically after sending this notification. | |
434 */ | |
435 bool get isFatal => _isFatal; | |
436 | |
437 /** | |
438 * True if the error is a fatal error, meaning that the server will shutdown | |
439 * automatically after sending this notification. | |
440 */ | |
441 void set isFatal(bool value) { | |
442 assert(value != null); | |
443 this._isFatal = value; | |
444 } | |
445 | |
446 /** | |
447 * The error message indicating what kind of error was encountered. | |
448 */ | |
449 String get message => _message; | |
450 | |
451 /** | |
452 * The error message indicating what kind of error was encountered. | |
453 */ | |
454 void set message(String value) { | |
455 assert(value != null); | |
456 this._message = value; | |
457 } | |
458 | |
459 /** | |
460 * The stack trace associated with the generation of the error, used for | |
461 * debugging the server. | |
462 */ | |
463 String get stackTrace => _stackTrace; | |
464 | |
465 /** | |
466 * The stack trace associated with the generation of the error, used for | |
467 * debugging the server. | |
468 */ | |
469 void set stackTrace(String value) { | |
470 assert(value != null); | |
471 this._stackTrace = value; | |
472 } | |
473 | |
474 ServerErrorParams(bool isFatal, String message, String stackTrace) { | |
475 this.isFatal = isFatal; | |
476 this.message = message; | |
477 this.stackTrace = stackTrace; | |
478 } | |
479 | |
480 factory ServerErrorParams.fromJson( | |
481 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
482 if (json == null) { | |
483 json = {}; | |
484 } | |
485 if (json is Map) { | |
486 bool isFatal; | |
487 if (json.containsKey("isFatal")) { | |
488 isFatal = | |
489 jsonDecoder.decodeBool(jsonPath + ".isFatal", json["isFatal"]); | |
490 } else { | |
491 throw jsonDecoder.missingKey(jsonPath, "isFatal"); | |
492 } | |
493 String message; | |
494 if (json.containsKey("message")) { | |
495 message = | |
496 jsonDecoder.decodeString(jsonPath + ".message", json["message"]); | |
497 } else { | |
498 throw jsonDecoder.missingKey(jsonPath, "message"); | |
499 } | |
500 String stackTrace; | |
501 if (json.containsKey("stackTrace")) { | |
502 stackTrace = jsonDecoder.decodeString( | |
503 jsonPath + ".stackTrace", json["stackTrace"]); | |
504 } else { | |
505 throw jsonDecoder.missingKey(jsonPath, "stackTrace"); | |
506 } | |
507 return new ServerErrorParams(isFatal, message, stackTrace); | |
508 } else { | |
509 throw jsonDecoder.mismatch(jsonPath, "server.error params", json); | |
510 } | |
511 } | |
512 | |
513 factory ServerErrorParams.fromNotification(Notification notification) { | |
514 return new ServerErrorParams.fromJson( | |
515 new ResponseDecoder(null), "params", notification._params); | |
516 } | |
517 | |
518 Map<String, dynamic> toJson() { | |
519 Map<String, dynamic> result = {}; | |
520 result["isFatal"] = isFatal; | |
521 result["message"] = message; | |
522 result["stackTrace"] = stackTrace; | |
523 return result; | |
524 } | |
525 | |
526 Notification toNotification() { | |
527 return new Notification("server.error", toJson()); | |
528 } | |
529 | |
530 @override | |
531 String toString() => JSON.encode(toJson()); | |
532 | |
533 @override | |
534 bool operator ==(other) { | |
535 if (other is ServerErrorParams) { | |
536 return isFatal == other.isFatal && | |
537 message == other.message && | |
538 stackTrace == other.stackTrace; | |
539 } | |
540 return false; | |
541 } | |
542 | |
543 @override | |
544 int get hashCode { | |
545 int hash = 0; | |
546 hash = JenkinsSmiHash.combine(hash, isFatal.hashCode); | |
547 hash = JenkinsSmiHash.combine(hash, message.hashCode); | |
548 hash = JenkinsSmiHash.combine(hash, stackTrace.hashCode); | |
549 return JenkinsSmiHash.finish(hash); | |
550 } | |
551 } | |
552 | |
553 /** | |
554 * server.status params | |
555 * | |
556 * { | |
557 * "analysis": optional AnalysisStatus | |
558 * "pub": optional PubStatus | |
559 * } | |
560 * | |
561 * Clients may not extend, implement or mix-in this class. | |
562 */ | |
563 class ServerStatusParams implements HasToJson { | |
564 AnalysisStatus _analysis; | |
565 | |
566 PubStatus _pub; | |
567 | |
568 /** | |
569 * The current status of analysis, including whether analysis is being | |
570 * performed and if so what is being analyzed. | |
571 */ | |
572 AnalysisStatus get analysis => _analysis; | |
573 | |
574 /** | |
575 * The current status of analysis, including whether analysis is being | |
576 * performed and if so what is being analyzed. | |
577 */ | |
578 void set analysis(AnalysisStatus value) { | |
579 this._analysis = value; | |
580 } | |
581 | |
582 /** | |
583 * The current status of pub execution, indicating whether we are currently | |
584 * running pub. | |
585 */ | |
586 PubStatus get pub => _pub; | |
587 | |
588 /** | |
589 * The current status of pub execution, indicating whether we are currently | |
590 * running pub. | |
591 */ | |
592 void set pub(PubStatus value) { | |
593 this._pub = value; | |
594 } | |
595 | |
596 ServerStatusParams({AnalysisStatus analysis, PubStatus pub}) { | |
597 this.analysis = analysis; | |
598 this.pub = pub; | |
599 } | |
600 | |
601 factory ServerStatusParams.fromJson( | |
602 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
603 if (json == null) { | |
604 json = {}; | |
605 } | |
606 if (json is Map) { | |
607 AnalysisStatus analysis; | |
608 if (json.containsKey("analysis")) { | |
609 analysis = new AnalysisStatus.fromJson( | |
610 jsonDecoder, jsonPath + ".analysis", json["analysis"]); | |
611 } | |
612 PubStatus pub; | |
613 if (json.containsKey("pub")) { | |
614 pub = | |
615 new PubStatus.fromJson(jsonDecoder, jsonPath + ".pub", json["pub"]); | |
616 } | |
617 return new ServerStatusParams(analysis: analysis, pub: pub); | |
618 } else { | |
619 throw jsonDecoder.mismatch(jsonPath, "server.status params", json); | |
620 } | |
621 } | |
622 | |
623 factory ServerStatusParams.fromNotification(Notification notification) { | |
624 return new ServerStatusParams.fromJson( | |
625 new ResponseDecoder(null), "params", notification._params); | |
626 } | |
627 | |
628 Map<String, dynamic> toJson() { | |
629 Map<String, dynamic> result = {}; | |
630 if (analysis != null) { | |
631 result["analysis"] = analysis.toJson(); | |
632 } | |
633 if (pub != null) { | |
634 result["pub"] = pub.toJson(); | |
635 } | |
636 return result; | |
637 } | |
638 | |
639 Notification toNotification() { | |
640 return new Notification("server.status", toJson()); | |
641 } | |
642 | |
643 @override | |
644 String toString() => JSON.encode(toJson()); | |
645 | |
646 @override | |
647 bool operator ==(other) { | |
648 if (other is ServerStatusParams) { | |
649 return analysis == other.analysis && pub == other.pub; | |
650 } | |
651 return false; | |
652 } | |
653 | |
654 @override | |
655 int get hashCode { | |
656 int hash = 0; | |
657 hash = JenkinsSmiHash.combine(hash, analysis.hashCode); | |
658 hash = JenkinsSmiHash.combine(hash, pub.hashCode); | |
659 return JenkinsSmiHash.finish(hash); | |
660 } | |
661 } | |
662 | |
663 /** | |
664 * analysis.getErrors params | |
665 * | |
666 * { | |
667 * "file": FilePath | |
668 * } | |
669 * | |
670 * Clients may not extend, implement or mix-in this class. | |
671 */ | |
672 class AnalysisGetErrorsParams implements HasToJson { | |
673 String _file; | |
674 | |
675 /** | |
676 * The file for which errors are being requested. | |
677 */ | |
678 String get file => _file; | |
679 | |
680 /** | |
681 * The file for which errors are being requested. | |
682 */ | |
683 void set file(String value) { | |
684 assert(value != null); | |
685 this._file = value; | |
686 } | |
687 | |
688 AnalysisGetErrorsParams(String file) { | |
689 this.file = file; | |
690 } | |
691 | |
692 factory AnalysisGetErrorsParams.fromJson( | |
693 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
694 if (json == null) { | |
695 json = {}; | |
696 } | |
697 if (json is Map) { | |
698 String file; | |
699 if (json.containsKey("file")) { | |
700 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
701 } else { | |
702 throw jsonDecoder.missingKey(jsonPath, "file"); | |
703 } | |
704 return new AnalysisGetErrorsParams(file); | |
705 } else { | |
706 throw jsonDecoder.mismatch(jsonPath, "analysis.getErrors params", json); | |
707 } | |
708 } | |
709 | |
710 factory AnalysisGetErrorsParams.fromRequest(Request request) { | |
711 return new AnalysisGetErrorsParams.fromJson( | |
712 new RequestDecoder(request), "params", request._params); | |
713 } | |
714 | |
715 Map<String, dynamic> toJson() { | |
716 Map<String, dynamic> result = {}; | |
717 result["file"] = file; | |
718 return result; | |
719 } | |
720 | |
721 Request toRequest(String id) { | |
722 return new Request(id, "analysis.getErrors", toJson()); | |
723 } | |
724 | |
725 @override | |
726 String toString() => JSON.encode(toJson()); | |
727 | |
728 @override | |
729 bool operator ==(other) { | |
730 if (other is AnalysisGetErrorsParams) { | |
731 return file == other.file; | |
732 } | |
733 return false; | |
734 } | |
735 | |
736 @override | |
737 int get hashCode { | |
738 int hash = 0; | |
739 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
740 return JenkinsSmiHash.finish(hash); | |
741 } | |
742 } | |
743 | |
744 /** | |
745 * analysis.getErrors result | |
746 * | |
747 * { | |
748 * "errors": List<AnalysisError> | |
749 * } | |
750 * | |
751 * Clients may not extend, implement or mix-in this class. | |
752 */ | |
753 class AnalysisGetErrorsResult implements HasToJson { | |
754 List<AnalysisError> _errors; | |
755 | |
756 /** | |
757 * The errors associated with the file. | |
758 */ | |
759 List<AnalysisError> get errors => _errors; | |
760 | |
761 /** | |
762 * The errors associated with the file. | |
763 */ | |
764 void set errors(List<AnalysisError> value) { | |
765 assert(value != null); | |
766 this._errors = value; | |
767 } | |
768 | |
769 AnalysisGetErrorsResult(List<AnalysisError> errors) { | |
770 this.errors = errors; | |
771 } | |
772 | |
773 factory AnalysisGetErrorsResult.fromJson( | |
774 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
775 if (json == null) { | |
776 json = {}; | |
777 } | |
778 if (json is Map) { | |
779 List<AnalysisError> errors; | |
780 if (json.containsKey("errors")) { | |
781 errors = jsonDecoder.decodeList( | |
782 jsonPath + ".errors", | |
783 json["errors"], | |
784 (String jsonPath, Object json) => | |
785 new AnalysisError.fromJson(jsonDecoder, jsonPath, json)); | |
786 } else { | |
787 throw jsonDecoder.missingKey(jsonPath, "errors"); | |
788 } | |
789 return new AnalysisGetErrorsResult(errors); | |
790 } else { | |
791 throw jsonDecoder.mismatch(jsonPath, "analysis.getErrors result", json); | |
792 } | |
793 } | |
794 | |
795 factory AnalysisGetErrorsResult.fromResponse(Response response) { | |
796 return new AnalysisGetErrorsResult.fromJson( | |
797 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
798 "result", | |
799 response._result); | |
800 } | |
801 | |
802 Map<String, dynamic> toJson() { | |
803 Map<String, dynamic> result = {}; | |
804 result["errors"] = | |
805 errors.map((AnalysisError value) => value.toJson()).toList(); | |
806 return result; | |
807 } | |
808 | |
809 Response toResponse(String id) { | |
810 return new Response(id, result: toJson()); | |
811 } | |
812 | |
813 @override | |
814 String toString() => JSON.encode(toJson()); | |
815 | |
816 @override | |
817 bool operator ==(other) { | |
818 if (other is AnalysisGetErrorsResult) { | |
819 return listEqual( | |
820 errors, other.errors, (AnalysisError a, AnalysisError b) => a == b); | |
821 } | |
822 return false; | |
823 } | |
824 | |
825 @override | |
826 int get hashCode { | |
827 int hash = 0; | |
828 hash = JenkinsSmiHash.combine(hash, errors.hashCode); | |
829 return JenkinsSmiHash.finish(hash); | |
830 } | |
831 } | |
832 | |
833 /** | |
834 * analysis.getHover params | |
835 * | |
836 * { | |
837 * "file": FilePath | |
838 * "offset": int | |
839 * } | |
840 * | |
841 * Clients may not extend, implement or mix-in this class. | |
842 */ | |
843 class AnalysisGetHoverParams implements HasToJson { | |
844 String _file; | |
845 | |
846 int _offset; | |
847 | |
848 /** | |
849 * The file in which hover information is being requested. | |
850 */ | |
851 String get file => _file; | |
852 | |
853 /** | |
854 * The file in which hover information is being requested. | |
855 */ | |
856 void set file(String value) { | |
857 assert(value != null); | |
858 this._file = value; | |
859 } | |
860 | |
861 /** | |
862 * The offset for which hover information is being requested. | |
863 */ | |
864 int get offset => _offset; | |
865 | |
866 /** | |
867 * The offset for which hover information is being requested. | |
868 */ | |
869 void set offset(int value) { | |
870 assert(value != null); | |
871 this._offset = value; | |
872 } | |
873 | |
874 AnalysisGetHoverParams(String file, int offset) { | |
875 this.file = file; | |
876 this.offset = offset; | |
877 } | |
878 | |
879 factory AnalysisGetHoverParams.fromJson( | |
880 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
881 if (json == null) { | |
882 json = {}; | |
883 } | |
884 if (json is Map) { | |
885 String file; | |
886 if (json.containsKey("file")) { | |
887 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
888 } else { | |
889 throw jsonDecoder.missingKey(jsonPath, "file"); | |
890 } | |
891 int offset; | |
892 if (json.containsKey("offset")) { | |
893 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
894 } else { | |
895 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
896 } | |
897 return new AnalysisGetHoverParams(file, offset); | |
898 } else { | |
899 throw jsonDecoder.mismatch(jsonPath, "analysis.getHover params", json); | |
900 } | |
901 } | |
902 | |
903 factory AnalysisGetHoverParams.fromRequest(Request request) { | |
904 return new AnalysisGetHoverParams.fromJson( | |
905 new RequestDecoder(request), "params", request._params); | |
906 } | |
907 | |
908 Map<String, dynamic> toJson() { | |
909 Map<String, dynamic> result = {}; | |
910 result["file"] = file; | |
911 result["offset"] = offset; | |
912 return result; | |
913 } | |
914 | |
915 Request toRequest(String id) { | |
916 return new Request(id, "analysis.getHover", toJson()); | |
917 } | |
918 | |
919 @override | |
920 String toString() => JSON.encode(toJson()); | |
921 | |
922 @override | |
923 bool operator ==(other) { | |
924 if (other is AnalysisGetHoverParams) { | |
925 return file == other.file && offset == other.offset; | |
926 } | |
927 return false; | |
928 } | |
929 | |
930 @override | |
931 int get hashCode { | |
932 int hash = 0; | |
933 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
934 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
935 return JenkinsSmiHash.finish(hash); | |
936 } | |
937 } | |
938 | |
939 /** | |
940 * analysis.getHover result | |
941 * | |
942 * { | |
943 * "hovers": List<HoverInformation> | |
944 * } | |
945 * | |
946 * Clients may not extend, implement or mix-in this class. | |
947 */ | |
948 class AnalysisGetHoverResult implements HasToJson { | |
949 List<HoverInformation> _hovers; | |
950 | |
951 /** | |
952 * The hover information associated with the location. The list will be empty | |
953 * if no information could be determined for the location. The list can | |
954 * contain multiple items if the file is being analyzed in multiple contexts | |
955 * in conflicting ways (such as a part that is included in multiple | |
956 * libraries). | |
957 */ | |
958 List<HoverInformation> get hovers => _hovers; | |
959 | |
960 /** | |
961 * The hover information associated with the location. The list will be empty | |
962 * if no information could be determined for the location. The list can | |
963 * contain multiple items if the file is being analyzed in multiple contexts | |
964 * in conflicting ways (such as a part that is included in multiple | |
965 * libraries). | |
966 */ | |
967 void set hovers(List<HoverInformation> value) { | |
968 assert(value != null); | |
969 this._hovers = value; | |
970 } | |
971 | |
972 AnalysisGetHoverResult(List<HoverInformation> hovers) { | |
973 this.hovers = hovers; | |
974 } | |
975 | |
976 factory AnalysisGetHoverResult.fromJson( | |
977 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
978 if (json == null) { | |
979 json = {}; | |
980 } | |
981 if (json is Map) { | |
982 List<HoverInformation> hovers; | |
983 if (json.containsKey("hovers")) { | |
984 hovers = jsonDecoder.decodeList( | |
985 jsonPath + ".hovers", | |
986 json["hovers"], | |
987 (String jsonPath, Object json) => | |
988 new HoverInformation.fromJson(jsonDecoder, jsonPath, json)); | |
989 } else { | |
990 throw jsonDecoder.missingKey(jsonPath, "hovers"); | |
991 } | |
992 return new AnalysisGetHoverResult(hovers); | |
993 } else { | |
994 throw jsonDecoder.mismatch(jsonPath, "analysis.getHover result", json); | |
995 } | |
996 } | |
997 | |
998 factory AnalysisGetHoverResult.fromResponse(Response response) { | |
999 return new AnalysisGetHoverResult.fromJson( | |
1000 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
1001 "result", | |
1002 response._result); | |
1003 } | |
1004 | |
1005 Map<String, dynamic> toJson() { | |
1006 Map<String, dynamic> result = {}; | |
1007 result["hovers"] = | |
1008 hovers.map((HoverInformation value) => value.toJson()).toList(); | |
1009 return result; | |
1010 } | |
1011 | |
1012 Response toResponse(String id) { | |
1013 return new Response(id, result: toJson()); | |
1014 } | |
1015 | |
1016 @override | |
1017 String toString() => JSON.encode(toJson()); | |
1018 | |
1019 @override | |
1020 bool operator ==(other) { | |
1021 if (other is AnalysisGetHoverResult) { | |
1022 return listEqual(hovers, other.hovers, | |
1023 (HoverInformation a, HoverInformation b) => a == b); | |
1024 } | |
1025 return false; | |
1026 } | |
1027 | |
1028 @override | |
1029 int get hashCode { | |
1030 int hash = 0; | |
1031 hash = JenkinsSmiHash.combine(hash, hovers.hashCode); | |
1032 return JenkinsSmiHash.finish(hash); | |
1033 } | |
1034 } | |
1035 | |
1036 /** | |
1037 * analysis.getReachableSources params | |
1038 * | |
1039 * { | |
1040 * "file": FilePath | |
1041 * } | |
1042 * | |
1043 * Clients may not extend, implement or mix-in this class. | |
1044 */ | |
1045 class AnalysisGetReachableSourcesParams implements HasToJson { | |
1046 String _file; | |
1047 | |
1048 /** | |
1049 * The file for which reachable source information is being requested. | |
1050 */ | |
1051 String get file => _file; | |
1052 | |
1053 /** | |
1054 * The file for which reachable source information is being requested. | |
1055 */ | |
1056 void set file(String value) { | |
1057 assert(value != null); | |
1058 this._file = value; | |
1059 } | |
1060 | |
1061 AnalysisGetReachableSourcesParams(String file) { | |
1062 this.file = file; | |
1063 } | |
1064 | |
1065 factory AnalysisGetReachableSourcesParams.fromJson( | |
1066 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
1067 if (json == null) { | |
1068 json = {}; | |
1069 } | |
1070 if (json is Map) { | |
1071 String file; | |
1072 if (json.containsKey("file")) { | |
1073 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
1074 } else { | |
1075 throw jsonDecoder.missingKey(jsonPath, "file"); | |
1076 } | |
1077 return new AnalysisGetReachableSourcesParams(file); | |
1078 } else { | |
1079 throw jsonDecoder.mismatch( | |
1080 jsonPath, "analysis.getReachableSources params", json); | |
1081 } | |
1082 } | |
1083 | |
1084 factory AnalysisGetReachableSourcesParams.fromRequest(Request request) { | |
1085 return new AnalysisGetReachableSourcesParams.fromJson( | |
1086 new RequestDecoder(request), "params", request._params); | |
1087 } | |
1088 | |
1089 Map<String, dynamic> toJson() { | |
1090 Map<String, dynamic> result = {}; | |
1091 result["file"] = file; | |
1092 return result; | |
1093 } | |
1094 | |
1095 Request toRequest(String id) { | |
1096 return new Request(id, "analysis.getReachableSources", toJson()); | |
1097 } | |
1098 | |
1099 @override | |
1100 String toString() => JSON.encode(toJson()); | |
1101 | |
1102 @override | |
1103 bool operator ==(other) { | |
1104 if (other is AnalysisGetReachableSourcesParams) { | |
1105 return file == other.file; | |
1106 } | |
1107 return false; | |
1108 } | |
1109 | |
1110 @override | |
1111 int get hashCode { | |
1112 int hash = 0; | |
1113 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
1114 return JenkinsSmiHash.finish(hash); | |
1115 } | |
1116 } | |
1117 | |
1118 /** | |
1119 * analysis.getReachableSources result | |
1120 * | |
1121 * { | |
1122 * "sources": Map<String, List<String>> | |
1123 * } | |
1124 * | |
1125 * Clients may not extend, implement or mix-in this class. | |
1126 */ | |
1127 class AnalysisGetReachableSourcesResult implements HasToJson { | |
1128 Map<String, List<String>> _sources; | |
1129 | |
1130 /** | |
1131 * A mapping from source URIs to directly reachable source URIs. For example, | |
1132 * a file "foo.dart" that imports "bar.dart" would have the corresponding | |
1133 * mapping { "file:///foo.dart" : ["file:///bar.dart"] }. If "bar.dart" has | |
1134 * further imports (or exports) there will be a mapping from the URI | |
1135 * "file:///bar.dart" to them. To check if a specific URI is reachable from a | |
1136 * given file, clients can check for its presence in the resulting key set. | |
1137 */ | |
1138 Map<String, List<String>> get sources => _sources; | |
1139 | |
1140 /** | |
1141 * A mapping from source URIs to directly reachable source URIs. For example, | |
1142 * a file "foo.dart" that imports "bar.dart" would have the corresponding | |
1143 * mapping { "file:///foo.dart" : ["file:///bar.dart"] }. If "bar.dart" has | |
1144 * further imports (or exports) there will be a mapping from the URI | |
1145 * "file:///bar.dart" to them. To check if a specific URI is reachable from a | |
1146 * given file, clients can check for its presence in the resulting key set. | |
1147 */ | |
1148 void set sources(Map<String, List<String>> value) { | |
1149 assert(value != null); | |
1150 this._sources = value; | |
1151 } | |
1152 | |
1153 AnalysisGetReachableSourcesResult(Map<String, List<String>> sources) { | |
1154 this.sources = sources; | |
1155 } | |
1156 | |
1157 factory AnalysisGetReachableSourcesResult.fromJson( | |
1158 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
1159 if (json == null) { | |
1160 json = {}; | |
1161 } | |
1162 if (json is Map) { | |
1163 Map<String, List<String>> sources; | |
1164 if (json.containsKey("sources")) { | |
1165 sources = jsonDecoder.decodeMap(jsonPath + ".sources", json["sources"], | |
1166 valueDecoder: (String jsonPath, Object json) => jsonDecoder | |
1167 .decodeList(jsonPath, json, jsonDecoder.decodeString)); | |
1168 } else { | |
1169 throw jsonDecoder.missingKey(jsonPath, "sources"); | |
1170 } | |
1171 return new AnalysisGetReachableSourcesResult(sources); | |
1172 } else { | |
1173 throw jsonDecoder.mismatch( | |
1174 jsonPath, "analysis.getReachableSources result", json); | |
1175 } | |
1176 } | |
1177 | |
1178 factory AnalysisGetReachableSourcesResult.fromResponse(Response response) { | |
1179 return new AnalysisGetReachableSourcesResult.fromJson( | |
1180 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
1181 "result", | |
1182 response._result); | |
1183 } | |
1184 | |
1185 Map<String, dynamic> toJson() { | |
1186 Map<String, dynamic> result = {}; | |
1187 result["sources"] = sources; | |
1188 return result; | |
1189 } | |
1190 | |
1191 Response toResponse(String id) { | |
1192 return new Response(id, result: toJson()); | |
1193 } | |
1194 | |
1195 @override | |
1196 String toString() => JSON.encode(toJson()); | |
1197 | |
1198 @override | |
1199 bool operator ==(other) { | |
1200 if (other is AnalysisGetReachableSourcesResult) { | |
1201 return mapEqual( | |
1202 sources, | |
1203 other.sources, | |
1204 (List<String> a, List<String> b) => | |
1205 listEqual(a, b, (String a, String b) => a == b)); | |
1206 } | |
1207 return false; | |
1208 } | |
1209 | |
1210 @override | |
1211 int get hashCode { | |
1212 int hash = 0; | |
1213 hash = JenkinsSmiHash.combine(hash, sources.hashCode); | |
1214 return JenkinsSmiHash.finish(hash); | |
1215 } | |
1216 } | |
1217 | |
1218 /** | |
1219 * analysis.getLibraryDependencies params | |
1220 * | |
1221 * Clients may not extend, implement or mix-in this class. | |
1222 */ | |
1223 class AnalysisGetLibraryDependenciesParams { | |
1224 Request toRequest(String id) { | |
1225 return new Request(id, "analysis.getLibraryDependencies", null); | |
1226 } | |
1227 | |
1228 @override | |
1229 bool operator ==(other) { | |
1230 if (other is AnalysisGetLibraryDependenciesParams) { | |
1231 return true; | |
1232 } | |
1233 return false; | |
1234 } | |
1235 | |
1236 @override | |
1237 int get hashCode { | |
1238 return 246577680; | |
1239 } | |
1240 } | |
1241 | |
1242 /** | |
1243 * analysis.getLibraryDependencies result | |
1244 * | |
1245 * { | |
1246 * "libraries": List<FilePath> | |
1247 * "packageMap": Map<String, Map<String, List<FilePath>>> | |
1248 * } | |
1249 * | |
1250 * Clients may not extend, implement or mix-in this class. | |
1251 */ | |
1252 class AnalysisGetLibraryDependenciesResult implements HasToJson { | |
1253 List<String> _libraries; | |
1254 | |
1255 Map<String, Map<String, List<String>>> _packageMap; | |
1256 | |
1257 /** | |
1258 * A list of the paths of library elements referenced by files in existing | |
1259 * analysis roots. | |
1260 */ | |
1261 List<String> get libraries => _libraries; | |
1262 | |
1263 /** | |
1264 * A list of the paths of library elements referenced by files in existing | |
1265 * analysis roots. | |
1266 */ | |
1267 void set libraries(List<String> value) { | |
1268 assert(value != null); | |
1269 this._libraries = value; | |
1270 } | |
1271 | |
1272 /** | |
1273 * A mapping from context source roots to package maps which map package | |
1274 * names to source directories for use in client-side package URI resolution. | |
1275 */ | |
1276 Map<String, Map<String, List<String>>> get packageMap => _packageMap; | |
1277 | |
1278 /** | |
1279 * A mapping from context source roots to package maps which map package | |
1280 * names to source directories for use in client-side package URI resolution. | |
1281 */ | |
1282 void set packageMap(Map<String, Map<String, List<String>>> value) { | |
1283 assert(value != null); | |
1284 this._packageMap = value; | |
1285 } | |
1286 | |
1287 AnalysisGetLibraryDependenciesResult(List<String> libraries, | |
1288 Map<String, Map<String, List<String>>> packageMap) { | |
1289 this.libraries = libraries; | |
1290 this.packageMap = packageMap; | |
1291 } | |
1292 | |
1293 factory AnalysisGetLibraryDependenciesResult.fromJson( | |
1294 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
1295 if (json == null) { | |
1296 json = {}; | |
1297 } | |
1298 if (json is Map) { | |
1299 List<String> libraries; | |
1300 if (json.containsKey("libraries")) { | |
1301 libraries = jsonDecoder.decodeList(jsonPath + ".libraries", | |
1302 json["libraries"], jsonDecoder.decodeString); | |
1303 } else { | |
1304 throw jsonDecoder.missingKey(jsonPath, "libraries"); | |
1305 } | |
1306 Map<String, Map<String, List<String>>> packageMap; | |
1307 if (json.containsKey("packageMap")) { | |
1308 packageMap = jsonDecoder.decodeMap( | |
1309 jsonPath + ".packageMap", json["packageMap"], | |
1310 valueDecoder: (String jsonPath, Object json) => | |
1311 jsonDecoder.decodeMap(jsonPath, json, | |
1312 valueDecoder: (String jsonPath, Object json) => jsonDecoder | |
1313 .decodeList(jsonPath, json, jsonDecoder.decodeString))); | |
1314 } else { | |
1315 throw jsonDecoder.missingKey(jsonPath, "packageMap"); | |
1316 } | |
1317 return new AnalysisGetLibraryDependenciesResult(libraries, packageMap); | |
1318 } else { | |
1319 throw jsonDecoder.mismatch( | |
1320 jsonPath, "analysis.getLibraryDependencies result", json); | |
1321 } | |
1322 } | |
1323 | |
1324 factory AnalysisGetLibraryDependenciesResult.fromResponse(Response response) { | |
1325 return new AnalysisGetLibraryDependenciesResult.fromJson( | |
1326 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
1327 "result", | |
1328 response._result); | |
1329 } | |
1330 | |
1331 Map<String, dynamic> toJson() { | |
1332 Map<String, dynamic> result = {}; | |
1333 result["libraries"] = libraries; | |
1334 result["packageMap"] = packageMap; | |
1335 return result; | |
1336 } | |
1337 | |
1338 Response toResponse(String id) { | |
1339 return new Response(id, result: toJson()); | |
1340 } | |
1341 | |
1342 @override | |
1343 String toString() => JSON.encode(toJson()); | |
1344 | |
1345 @override | |
1346 bool operator ==(other) { | |
1347 if (other is AnalysisGetLibraryDependenciesResult) { | |
1348 return listEqual( | |
1349 libraries, other.libraries, (String a, String b) => a == b) && | |
1350 mapEqual( | |
1351 packageMap, | |
1352 other.packageMap, | |
1353 (Map<String, List<String>> a, Map<String, List<String>> b) => | |
1354 mapEqual( | |
1355 a, | |
1356 b, | |
1357 (List<String> a, List<String> b) => | |
1358 listEqual(a, b, (String a, String b) => a == b))); | |
1359 } | |
1360 return false; | |
1361 } | |
1362 | |
1363 @override | |
1364 int get hashCode { | |
1365 int hash = 0; | |
1366 hash = JenkinsSmiHash.combine(hash, libraries.hashCode); | |
1367 hash = JenkinsSmiHash.combine(hash, packageMap.hashCode); | |
1368 return JenkinsSmiHash.finish(hash); | |
1369 } | |
1370 } | |
1371 | |
1372 /** | |
1373 * analysis.getNavigation params | |
1374 * | |
1375 * { | |
1376 * "file": FilePath | |
1377 * "offset": int | |
1378 * "length": int | |
1379 * } | |
1380 * | |
1381 * Clients may not extend, implement or mix-in this class. | |
1382 */ | |
1383 class AnalysisGetNavigationParams implements HasToJson { | |
1384 String _file; | |
1385 | |
1386 int _offset; | |
1387 | |
1388 int _length; | |
1389 | |
1390 /** | |
1391 * The file in which navigation information is being requested. | |
1392 */ | |
1393 String get file => _file; | |
1394 | |
1395 /** | |
1396 * The file in which navigation information is being requested. | |
1397 */ | |
1398 void set file(String value) { | |
1399 assert(value != null); | |
1400 this._file = value; | |
1401 } | |
1402 | |
1403 /** | |
1404 * The offset of the region for which navigation information is being | |
1405 * requested. | |
1406 */ | |
1407 int get offset => _offset; | |
1408 | |
1409 /** | |
1410 * The offset of the region for which navigation information is being | |
1411 * requested. | |
1412 */ | |
1413 void set offset(int value) { | |
1414 assert(value != null); | |
1415 this._offset = value; | |
1416 } | |
1417 | |
1418 /** | |
1419 * The length of the region for which navigation information is being | |
1420 * requested. | |
1421 */ | |
1422 int get length => _length; | |
1423 | |
1424 /** | |
1425 * The length of the region for which navigation information is being | |
1426 * requested. | |
1427 */ | |
1428 void set length(int value) { | |
1429 assert(value != null); | |
1430 this._length = value; | |
1431 } | |
1432 | |
1433 AnalysisGetNavigationParams(String file, int offset, int length) { | |
1434 this.file = file; | |
1435 this.offset = offset; | |
1436 this.length = length; | |
1437 } | |
1438 | |
1439 factory AnalysisGetNavigationParams.fromJson( | |
1440 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
1441 if (json == null) { | |
1442 json = {}; | |
1443 } | |
1444 if (json is Map) { | |
1445 String file; | |
1446 if (json.containsKey("file")) { | |
1447 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
1448 } else { | |
1449 throw jsonDecoder.missingKey(jsonPath, "file"); | |
1450 } | |
1451 int offset; | |
1452 if (json.containsKey("offset")) { | |
1453 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
1454 } else { | |
1455 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
1456 } | |
1457 int length; | |
1458 if (json.containsKey("length")) { | |
1459 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
1460 } else { | |
1461 throw jsonDecoder.missingKey(jsonPath, "length"); | |
1462 } | |
1463 return new AnalysisGetNavigationParams(file, offset, length); | |
1464 } else { | |
1465 throw jsonDecoder.mismatch( | |
1466 jsonPath, "analysis.getNavigation params", json); | |
1467 } | |
1468 } | |
1469 | |
1470 factory AnalysisGetNavigationParams.fromRequest(Request request) { | |
1471 return new AnalysisGetNavigationParams.fromJson( | |
1472 new RequestDecoder(request), "params", request._params); | |
1473 } | |
1474 | |
1475 Map<String, dynamic> toJson() { | |
1476 Map<String, dynamic> result = {}; | |
1477 result["file"] = file; | |
1478 result["offset"] = offset; | |
1479 result["length"] = length; | |
1480 return result; | |
1481 } | |
1482 | |
1483 Request toRequest(String id) { | |
1484 return new Request(id, "analysis.getNavigation", toJson()); | |
1485 } | |
1486 | |
1487 @override | |
1488 String toString() => JSON.encode(toJson()); | |
1489 | |
1490 @override | |
1491 bool operator ==(other) { | |
1492 if (other is AnalysisGetNavigationParams) { | |
1493 return file == other.file && | |
1494 offset == other.offset && | |
1495 length == other.length; | |
1496 } | |
1497 return false; | |
1498 } | |
1499 | |
1500 @override | |
1501 int get hashCode { | |
1502 int hash = 0; | |
1503 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
1504 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
1505 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
1506 return JenkinsSmiHash.finish(hash); | |
1507 } | |
1508 } | |
1509 | |
1510 /** | |
1511 * analysis.getNavigation result | |
1512 * | |
1513 * { | |
1514 * "files": List<FilePath> | |
1515 * "targets": List<NavigationTarget> | |
1516 * "regions": List<NavigationRegion> | |
1517 * } | |
1518 * | |
1519 * Clients may not extend, implement or mix-in this class. | |
1520 */ | |
1521 class AnalysisGetNavigationResult implements HasToJson { | |
1522 List<String> _files; | |
1523 | |
1524 List<NavigationTarget> _targets; | |
1525 | |
1526 List<NavigationRegion> _regions; | |
1527 | |
1528 /** | |
1529 * A list of the paths of files that are referenced by the navigation | |
1530 * targets. | |
1531 */ | |
1532 List<String> get files => _files; | |
1533 | |
1534 /** | |
1535 * A list of the paths of files that are referenced by the navigation | |
1536 * targets. | |
1537 */ | |
1538 void set files(List<String> value) { | |
1539 assert(value != null); | |
1540 this._files = value; | |
1541 } | |
1542 | |
1543 /** | |
1544 * A list of the navigation targets that are referenced by the navigation | |
1545 * regions. | |
1546 */ | |
1547 List<NavigationTarget> get targets => _targets; | |
1548 | |
1549 /** | |
1550 * A list of the navigation targets that are referenced by the navigation | |
1551 * regions. | |
1552 */ | |
1553 void set targets(List<NavigationTarget> value) { | |
1554 assert(value != null); | |
1555 this._targets = value; | |
1556 } | |
1557 | |
1558 /** | |
1559 * A list of the navigation regions within the requested region of the file. | |
1560 */ | |
1561 List<NavigationRegion> get regions => _regions; | |
1562 | |
1563 /** | |
1564 * A list of the navigation regions within the requested region of the file. | |
1565 */ | |
1566 void set regions(List<NavigationRegion> value) { | |
1567 assert(value != null); | |
1568 this._regions = value; | |
1569 } | |
1570 | |
1571 AnalysisGetNavigationResult(List<String> files, | |
1572 List<NavigationTarget> targets, List<NavigationRegion> regions) { | |
1573 this.files = files; | |
1574 this.targets = targets; | |
1575 this.regions = regions; | |
1576 } | |
1577 | |
1578 factory AnalysisGetNavigationResult.fromJson( | |
1579 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
1580 if (json == null) { | |
1581 json = {}; | |
1582 } | |
1583 if (json is Map) { | |
1584 List<String> files; | |
1585 if (json.containsKey("files")) { | |
1586 files = jsonDecoder.decodeList( | |
1587 jsonPath + ".files", json["files"], jsonDecoder.decodeString); | |
1588 } else { | |
1589 throw jsonDecoder.missingKey(jsonPath, "files"); | |
1590 } | |
1591 List<NavigationTarget> targets; | |
1592 if (json.containsKey("targets")) { | |
1593 targets = jsonDecoder.decodeList( | |
1594 jsonPath + ".targets", | |
1595 json["targets"], | |
1596 (String jsonPath, Object json) => | |
1597 new NavigationTarget.fromJson(jsonDecoder, jsonPath, json)); | |
1598 } else { | |
1599 throw jsonDecoder.missingKey(jsonPath, "targets"); | |
1600 } | |
1601 List<NavigationRegion> regions; | |
1602 if (json.containsKey("regions")) { | |
1603 regions = jsonDecoder.decodeList( | |
1604 jsonPath + ".regions", | |
1605 json["regions"], | |
1606 (String jsonPath, Object json) => | |
1607 new NavigationRegion.fromJson(jsonDecoder, jsonPath, json)); | |
1608 } else { | |
1609 throw jsonDecoder.missingKey(jsonPath, "regions"); | |
1610 } | |
1611 return new AnalysisGetNavigationResult(files, targets, regions); | |
1612 } else { | |
1613 throw jsonDecoder.mismatch( | |
1614 jsonPath, "analysis.getNavigation result", json); | |
1615 } | |
1616 } | |
1617 | |
1618 factory AnalysisGetNavigationResult.fromResponse(Response response) { | |
1619 return new AnalysisGetNavigationResult.fromJson( | |
1620 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
1621 "result", | |
1622 response._result); | |
1623 } | |
1624 | |
1625 Map<String, dynamic> toJson() { | |
1626 Map<String, dynamic> result = {}; | |
1627 result["files"] = files; | |
1628 result["targets"] = | |
1629 targets.map((NavigationTarget value) => value.toJson()).toList(); | |
1630 result["regions"] = | |
1631 regions.map((NavigationRegion value) => value.toJson()).toList(); | |
1632 return result; | |
1633 } | |
1634 | |
1635 Response toResponse(String id) { | |
1636 return new Response(id, result: toJson()); | |
1637 } | |
1638 | |
1639 @override | |
1640 String toString() => JSON.encode(toJson()); | |
1641 | |
1642 @override | |
1643 bool operator ==(other) { | |
1644 if (other is AnalysisGetNavigationResult) { | |
1645 return listEqual(files, other.files, (String a, String b) => a == b) && | |
1646 listEqual(targets, other.targets, | |
1647 (NavigationTarget a, NavigationTarget b) => a == b) && | |
1648 listEqual(regions, other.regions, | |
1649 (NavigationRegion a, NavigationRegion b) => a == b); | |
1650 } | |
1651 return false; | |
1652 } | |
1653 | |
1654 @override | |
1655 int get hashCode { | |
1656 int hash = 0; | |
1657 hash = JenkinsSmiHash.combine(hash, files.hashCode); | |
1658 hash = JenkinsSmiHash.combine(hash, targets.hashCode); | |
1659 hash = JenkinsSmiHash.combine(hash, regions.hashCode); | |
1660 return JenkinsSmiHash.finish(hash); | |
1661 } | |
1662 } | |
1663 | |
1664 /** | |
1665 * analysis.reanalyze params | |
1666 * | |
1667 * { | |
1668 * "roots": optional List<FilePath> | |
1669 * } | |
1670 * | |
1671 * Clients may not extend, implement or mix-in this class. | |
1672 */ | |
1673 class AnalysisReanalyzeParams implements HasToJson { | |
1674 List<String> _roots; | |
1675 | |
1676 /** | |
1677 * A list of the analysis roots that are to be re-analyzed. | |
1678 */ | |
1679 List<String> get roots => _roots; | |
1680 | |
1681 /** | |
1682 * A list of the analysis roots that are to be re-analyzed. | |
1683 */ | |
1684 void set roots(List<String> value) { | |
1685 this._roots = value; | |
1686 } | |
1687 | |
1688 AnalysisReanalyzeParams({List<String> roots}) { | |
1689 this.roots = roots; | |
1690 } | |
1691 | |
1692 factory AnalysisReanalyzeParams.fromJson( | |
1693 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
1694 if (json == null) { | |
1695 json = {}; | |
1696 } | |
1697 if (json is Map) { | |
1698 List<String> roots; | |
1699 if (json.containsKey("roots")) { | |
1700 roots = jsonDecoder.decodeList( | |
1701 jsonPath + ".roots", json["roots"], jsonDecoder.decodeString); | |
1702 } | |
1703 return new AnalysisReanalyzeParams(roots: roots); | |
1704 } else { | |
1705 throw jsonDecoder.mismatch(jsonPath, "analysis.reanalyze params", json); | |
1706 } | |
1707 } | |
1708 | |
1709 factory AnalysisReanalyzeParams.fromRequest(Request request) { | |
1710 return new AnalysisReanalyzeParams.fromJson( | |
1711 new RequestDecoder(request), "params", request._params); | |
1712 } | |
1713 | |
1714 Map<String, dynamic> toJson() { | |
1715 Map<String, dynamic> result = {}; | |
1716 if (roots != null) { | |
1717 result["roots"] = roots; | |
1718 } | |
1719 return result; | |
1720 } | |
1721 | |
1722 Request toRequest(String id) { | |
1723 return new Request(id, "analysis.reanalyze", toJson()); | |
1724 } | |
1725 | |
1726 @override | |
1727 String toString() => JSON.encode(toJson()); | |
1728 | |
1729 @override | |
1730 bool operator ==(other) { | |
1731 if (other is AnalysisReanalyzeParams) { | |
1732 return listEqual(roots, other.roots, (String a, String b) => a == b); | |
1733 } | |
1734 return false; | |
1735 } | |
1736 | |
1737 @override | |
1738 int get hashCode { | |
1739 int hash = 0; | |
1740 hash = JenkinsSmiHash.combine(hash, roots.hashCode); | |
1741 return JenkinsSmiHash.finish(hash); | |
1742 } | |
1743 } | |
1744 | |
1745 /** | |
1746 * analysis.reanalyze result | |
1747 * | |
1748 * Clients may not extend, implement or mix-in this class. | |
1749 */ | |
1750 class AnalysisReanalyzeResult { | |
1751 Response toResponse(String id) { | |
1752 return new Response(id, result: null); | |
1753 } | |
1754 | |
1755 @override | |
1756 bool operator ==(other) { | |
1757 if (other is AnalysisReanalyzeResult) { | |
1758 return true; | |
1759 } | |
1760 return false; | |
1761 } | |
1762 | |
1763 @override | |
1764 int get hashCode { | |
1765 return 846803925; | |
1766 } | |
1767 } | |
1768 | |
1769 /** | |
1770 * analysis.setAnalysisRoots params | |
1771 * | |
1772 * { | |
1773 * "included": List<FilePath> | |
1774 * "excluded": List<FilePath> | |
1775 * "packageRoots": optional Map<FilePath, FilePath> | |
1776 * } | |
1777 * | |
1778 * Clients may not extend, implement or mix-in this class. | |
1779 */ | |
1780 class AnalysisSetAnalysisRootsParams implements HasToJson { | |
1781 List<String> _included; | |
1782 | |
1783 List<String> _excluded; | |
1784 | |
1785 Map<String, String> _packageRoots; | |
1786 | |
1787 /** | |
1788 * A list of the files and directories that should be analyzed. | |
1789 */ | |
1790 List<String> get included => _included; | |
1791 | |
1792 /** | |
1793 * A list of the files and directories that should be analyzed. | |
1794 */ | |
1795 void set included(List<String> value) { | |
1796 assert(value != null); | |
1797 this._included = value; | |
1798 } | |
1799 | |
1800 /** | |
1801 * A list of the files and directories within the included directories that | |
1802 * should not be analyzed. | |
1803 */ | |
1804 List<String> get excluded => _excluded; | |
1805 | |
1806 /** | |
1807 * A list of the files and directories within the included directories that | |
1808 * should not be analyzed. | |
1809 */ | |
1810 void set excluded(List<String> value) { | |
1811 assert(value != null); | |
1812 this._excluded = value; | |
1813 } | |
1814 | |
1815 /** | |
1816 * A mapping from source directories to package roots that should override | |
1817 * the normal package: URI resolution mechanism. | |
1818 * | |
1819 * If a package root is a directory, then the analyzer will behave as though | |
1820 * the associated source directory in the map contains a special pubspec.yaml | |
1821 * file which resolves any package: URI to the corresponding path within that | |
1822 * package root directory. The effect is the same as specifying the package | |
1823 * root directory as a "--package_root" parameter to the Dart VM when | |
1824 * executing any Dart file inside the source directory. | |
1825 * | |
1826 * If a package root is a file, then the analyzer will behave as though that | |
1827 * file is a ".packages" file in the source directory. The effect is the same | |
1828 * as specifying the file as a "--packages" parameter to the Dart VM when | |
1829 * executing any Dart file inside the source directory. | |
1830 * | |
1831 * Files in any directories that are not overridden by this mapping have | |
1832 * their package: URI's resolved using the normal pubspec.yaml mechanism. If | |
1833 * this field is absent, or the empty map is specified, that indicates that | |
1834 * the normal pubspec.yaml mechanism should always be used. | |
1835 */ | |
1836 Map<String, String> get packageRoots => _packageRoots; | |
1837 | |
1838 /** | |
1839 * A mapping from source directories to package roots that should override | |
1840 * the normal package: URI resolution mechanism. | |
1841 * | |
1842 * If a package root is a directory, then the analyzer will behave as though | |
1843 * the associated source directory in the map contains a special pubspec.yaml | |
1844 * file which resolves any package: URI to the corresponding path within that | |
1845 * package root directory. The effect is the same as specifying the package | |
1846 * root directory as a "--package_root" parameter to the Dart VM when | |
1847 * executing any Dart file inside the source directory. | |
1848 * | |
1849 * If a package root is a file, then the analyzer will behave as though that | |
1850 * file is a ".packages" file in the source directory. The effect is the same | |
1851 * as specifying the file as a "--packages" parameter to the Dart VM when | |
1852 * executing any Dart file inside the source directory. | |
1853 * | |
1854 * Files in any directories that are not overridden by this mapping have | |
1855 * their package: URI's resolved using the normal pubspec.yaml mechanism. If | |
1856 * this field is absent, or the empty map is specified, that indicates that | |
1857 * the normal pubspec.yaml mechanism should always be used. | |
1858 */ | |
1859 void set packageRoots(Map<String, String> value) { | |
1860 this._packageRoots = value; | |
1861 } | |
1862 | |
1863 AnalysisSetAnalysisRootsParams(List<String> included, List<String> excluded, | |
1864 {Map<String, String> packageRoots}) { | |
1865 this.included = included; | |
1866 this.excluded = excluded; | |
1867 this.packageRoots = packageRoots; | |
1868 } | |
1869 | |
1870 factory AnalysisSetAnalysisRootsParams.fromJson( | |
1871 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
1872 if (json == null) { | |
1873 json = {}; | |
1874 } | |
1875 if (json is Map) { | |
1876 List<String> included; | |
1877 if (json.containsKey("included")) { | |
1878 included = jsonDecoder.decodeList( | |
1879 jsonPath + ".included", json["included"], jsonDecoder.decodeString); | |
1880 } else { | |
1881 throw jsonDecoder.missingKey(jsonPath, "included"); | |
1882 } | |
1883 List<String> excluded; | |
1884 if (json.containsKey("excluded")) { | |
1885 excluded = jsonDecoder.decodeList( | |
1886 jsonPath + ".excluded", json["excluded"], jsonDecoder.decodeString); | |
1887 } else { | |
1888 throw jsonDecoder.missingKey(jsonPath, "excluded"); | |
1889 } | |
1890 Map<String, String> packageRoots; | |
1891 if (json.containsKey("packageRoots")) { | |
1892 packageRoots = jsonDecoder.decodeMap( | |
1893 jsonPath + ".packageRoots", json["packageRoots"], | |
1894 valueDecoder: jsonDecoder.decodeString); | |
1895 } | |
1896 return new AnalysisSetAnalysisRootsParams(included, excluded, | |
1897 packageRoots: packageRoots); | |
1898 } else { | |
1899 throw jsonDecoder.mismatch( | |
1900 jsonPath, "analysis.setAnalysisRoots params", json); | |
1901 } | |
1902 } | |
1903 | |
1904 factory AnalysisSetAnalysisRootsParams.fromRequest(Request request) { | |
1905 return new AnalysisSetAnalysisRootsParams.fromJson( | |
1906 new RequestDecoder(request), "params", request._params); | |
1907 } | |
1908 | |
1909 Map<String, dynamic> toJson() { | |
1910 Map<String, dynamic> result = {}; | |
1911 result["included"] = included; | |
1912 result["excluded"] = excluded; | |
1913 if (packageRoots != null) { | |
1914 result["packageRoots"] = packageRoots; | |
1915 } | |
1916 return result; | |
1917 } | |
1918 | |
1919 Request toRequest(String id) { | |
1920 return new Request(id, "analysis.setAnalysisRoots", toJson()); | |
1921 } | |
1922 | |
1923 @override | |
1924 String toString() => JSON.encode(toJson()); | |
1925 | |
1926 @override | |
1927 bool operator ==(other) { | |
1928 if (other is AnalysisSetAnalysisRootsParams) { | |
1929 return listEqual( | |
1930 included, other.included, (String a, String b) => a == b) && | |
1931 listEqual(excluded, other.excluded, (String a, String b) => a == b) && | |
1932 mapEqual( | |
1933 packageRoots, other.packageRoots, (String a, String b) => a == b); | |
1934 } | |
1935 return false; | |
1936 } | |
1937 | |
1938 @override | |
1939 int get hashCode { | |
1940 int hash = 0; | |
1941 hash = JenkinsSmiHash.combine(hash, included.hashCode); | |
1942 hash = JenkinsSmiHash.combine(hash, excluded.hashCode); | |
1943 hash = JenkinsSmiHash.combine(hash, packageRoots.hashCode); | |
1944 return JenkinsSmiHash.finish(hash); | |
1945 } | |
1946 } | |
1947 | |
1948 /** | |
1949 * analysis.setAnalysisRoots result | |
1950 * | |
1951 * Clients may not extend, implement or mix-in this class. | |
1952 */ | |
1953 class AnalysisSetAnalysisRootsResult { | |
1954 Response toResponse(String id) { | |
1955 return new Response(id, result: null); | |
1956 } | |
1957 | |
1958 @override | |
1959 bool operator ==(other) { | |
1960 if (other is AnalysisSetAnalysisRootsResult) { | |
1961 return true; | |
1962 } | |
1963 return false; | |
1964 } | |
1965 | |
1966 @override | |
1967 int get hashCode { | |
1968 return 866004753; | |
1969 } | |
1970 } | |
1971 | |
1972 /** | |
1973 * analysis.setGeneralSubscriptions params | |
1974 * | |
1975 * { | |
1976 * "subscriptions": List<GeneralAnalysisService> | |
1977 * } | |
1978 * | |
1979 * Clients may not extend, implement or mix-in this class. | |
1980 */ | |
1981 class AnalysisSetGeneralSubscriptionsParams implements HasToJson { | |
1982 List<GeneralAnalysisService> _subscriptions; | |
1983 | |
1984 /** | |
1985 * A list of the services being subscribed to. | |
1986 */ | |
1987 List<GeneralAnalysisService> get subscriptions => _subscriptions; | |
1988 | |
1989 /** | |
1990 * A list of the services being subscribed to. | |
1991 */ | |
1992 void set subscriptions(List<GeneralAnalysisService> value) { | |
1993 assert(value != null); | |
1994 this._subscriptions = value; | |
1995 } | |
1996 | |
1997 AnalysisSetGeneralSubscriptionsParams( | |
1998 List<GeneralAnalysisService> subscriptions) { | |
1999 this.subscriptions = subscriptions; | |
2000 } | |
2001 | |
2002 factory AnalysisSetGeneralSubscriptionsParams.fromJson( | |
2003 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
2004 if (json == null) { | |
2005 json = {}; | |
2006 } | |
2007 if (json is Map) { | |
2008 List<GeneralAnalysisService> subscriptions; | |
2009 if (json.containsKey("subscriptions")) { | |
2010 subscriptions = jsonDecoder.decodeList( | |
2011 jsonPath + ".subscriptions", | |
2012 json["subscriptions"], | |
2013 (String jsonPath, Object json) => | |
2014 new GeneralAnalysisService.fromJson( | |
2015 jsonDecoder, jsonPath, json)); | |
2016 } else { | |
2017 throw jsonDecoder.missingKey(jsonPath, "subscriptions"); | |
2018 } | |
2019 return new AnalysisSetGeneralSubscriptionsParams(subscriptions); | |
2020 } else { | |
2021 throw jsonDecoder.mismatch( | |
2022 jsonPath, "analysis.setGeneralSubscriptions params", json); | |
2023 } | |
2024 } | |
2025 | |
2026 factory AnalysisSetGeneralSubscriptionsParams.fromRequest(Request request) { | |
2027 return new AnalysisSetGeneralSubscriptionsParams.fromJson( | |
2028 new RequestDecoder(request), "params", request._params); | |
2029 } | |
2030 | |
2031 Map<String, dynamic> toJson() { | |
2032 Map<String, dynamic> result = {}; | |
2033 result["subscriptions"] = subscriptions | |
2034 .map((GeneralAnalysisService value) => value.toJson()) | |
2035 .toList(); | |
2036 return result; | |
2037 } | |
2038 | |
2039 Request toRequest(String id) { | |
2040 return new Request(id, "analysis.setGeneralSubscriptions", toJson()); | |
2041 } | |
2042 | |
2043 @override | |
2044 String toString() => JSON.encode(toJson()); | |
2045 | |
2046 @override | |
2047 bool operator ==(other) { | |
2048 if (other is AnalysisSetGeneralSubscriptionsParams) { | |
2049 return listEqual(subscriptions, other.subscriptions, | |
2050 (GeneralAnalysisService a, GeneralAnalysisService b) => a == b); | |
2051 } | |
2052 return false; | |
2053 } | |
2054 | |
2055 @override | |
2056 int get hashCode { | |
2057 int hash = 0; | |
2058 hash = JenkinsSmiHash.combine(hash, subscriptions.hashCode); | |
2059 return JenkinsSmiHash.finish(hash); | |
2060 } | |
2061 } | |
2062 | |
2063 /** | |
2064 * analysis.setGeneralSubscriptions result | |
2065 * | |
2066 * Clients may not extend, implement or mix-in this class. | |
2067 */ | |
2068 class AnalysisSetGeneralSubscriptionsResult { | |
2069 Response toResponse(String id) { | |
2070 return new Response(id, result: null); | |
2071 } | |
2072 | |
2073 @override | |
2074 bool operator ==(other) { | |
2075 if (other is AnalysisSetGeneralSubscriptionsResult) { | |
2076 return true; | |
2077 } | |
2078 return false; | |
2079 } | |
2080 | |
2081 @override | |
2082 int get hashCode { | |
2083 return 386759562; | |
2084 } | |
2085 } | |
2086 | |
2087 /** | |
2088 * analysis.setPriorityFiles params | |
2089 * | |
2090 * { | |
2091 * "files": List<FilePath> | |
2092 * } | |
2093 * | |
2094 * Clients may not extend, implement or mix-in this class. | |
2095 */ | |
2096 class AnalysisSetPriorityFilesParams implements HasToJson { | |
2097 List<String> _files; | |
2098 | |
2099 /** | |
2100 * The files that are to be a priority for analysis. | |
2101 */ | |
2102 List<String> get files => _files; | |
2103 | |
2104 /** | |
2105 * The files that are to be a priority for analysis. | |
2106 */ | |
2107 void set files(List<String> value) { | |
2108 assert(value != null); | |
2109 this._files = value; | |
2110 } | |
2111 | |
2112 AnalysisSetPriorityFilesParams(List<String> files) { | |
2113 this.files = files; | |
2114 } | |
2115 | |
2116 factory AnalysisSetPriorityFilesParams.fromJson( | |
2117 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
2118 if (json == null) { | |
2119 json = {}; | |
2120 } | |
2121 if (json is Map) { | |
2122 List<String> files; | |
2123 if (json.containsKey("files")) { | |
2124 files = jsonDecoder.decodeList( | |
2125 jsonPath + ".files", json["files"], jsonDecoder.decodeString); | |
2126 } else { | |
2127 throw jsonDecoder.missingKey(jsonPath, "files"); | |
2128 } | |
2129 return new AnalysisSetPriorityFilesParams(files); | |
2130 } else { | |
2131 throw jsonDecoder.mismatch( | |
2132 jsonPath, "analysis.setPriorityFiles params", json); | |
2133 } | |
2134 } | |
2135 | |
2136 factory AnalysisSetPriorityFilesParams.fromRequest(Request request) { | |
2137 return new AnalysisSetPriorityFilesParams.fromJson( | |
2138 new RequestDecoder(request), "params", request._params); | |
2139 } | |
2140 | |
2141 Map<String, dynamic> toJson() { | |
2142 Map<String, dynamic> result = {}; | |
2143 result["files"] = files; | |
2144 return result; | |
2145 } | |
2146 | |
2147 Request toRequest(String id) { | |
2148 return new Request(id, "analysis.setPriorityFiles", toJson()); | |
2149 } | |
2150 | |
2151 @override | |
2152 String toString() => JSON.encode(toJson()); | |
2153 | |
2154 @override | |
2155 bool operator ==(other) { | |
2156 if (other is AnalysisSetPriorityFilesParams) { | |
2157 return listEqual(files, other.files, (String a, String b) => a == b); | |
2158 } | |
2159 return false; | |
2160 } | |
2161 | |
2162 @override | |
2163 int get hashCode { | |
2164 int hash = 0; | |
2165 hash = JenkinsSmiHash.combine(hash, files.hashCode); | |
2166 return JenkinsSmiHash.finish(hash); | |
2167 } | |
2168 } | |
2169 | |
2170 /** | |
2171 * analysis.setPriorityFiles result | |
2172 * | |
2173 * Clients may not extend, implement or mix-in this class. | |
2174 */ | |
2175 class AnalysisSetPriorityFilesResult { | |
2176 Response toResponse(String id) { | |
2177 return new Response(id, result: null); | |
2178 } | |
2179 | |
2180 @override | |
2181 bool operator ==(other) { | |
2182 if (other is AnalysisSetPriorityFilesResult) { | |
2183 return true; | |
2184 } | |
2185 return false; | |
2186 } | |
2187 | |
2188 @override | |
2189 int get hashCode { | |
2190 return 330050055; | |
2191 } | |
2192 } | |
2193 | |
2194 /** | |
2195 * analysis.setSubscriptions params | |
2196 * | |
2197 * { | |
2198 * "subscriptions": Map<AnalysisService, List<FilePath>> | |
2199 * } | |
2200 * | |
2201 * Clients may not extend, implement or mix-in this class. | |
2202 */ | |
2203 class AnalysisSetSubscriptionsParams implements HasToJson { | |
2204 Map<AnalysisService, List<String>> _subscriptions; | |
2205 | |
2206 /** | |
2207 * A table mapping services to a list of the files being subscribed to the | |
2208 * service. | |
2209 */ | |
2210 Map<AnalysisService, List<String>> get subscriptions => _subscriptions; | |
2211 | |
2212 /** | |
2213 * A table mapping services to a list of the files being subscribed to the | |
2214 * service. | |
2215 */ | |
2216 void set subscriptions(Map<AnalysisService, List<String>> value) { | |
2217 assert(value != null); | |
2218 this._subscriptions = value; | |
2219 } | |
2220 | |
2221 AnalysisSetSubscriptionsParams( | |
2222 Map<AnalysisService, List<String>> subscriptions) { | |
2223 this.subscriptions = subscriptions; | |
2224 } | |
2225 | |
2226 factory AnalysisSetSubscriptionsParams.fromJson( | |
2227 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
2228 if (json == null) { | |
2229 json = {}; | |
2230 } | |
2231 if (json is Map) { | |
2232 Map<AnalysisService, List<String>> subscriptions; | |
2233 if (json.containsKey("subscriptions")) { | |
2234 subscriptions = jsonDecoder.decodeMap( | |
2235 jsonPath + ".subscriptions", json["subscriptions"], | |
2236 keyDecoder: (String jsonPath, Object json) => | |
2237 new AnalysisService.fromJson(jsonDecoder, jsonPath, json), | |
2238 valueDecoder: (String jsonPath, Object json) => jsonDecoder | |
2239 .decodeList(jsonPath, json, jsonDecoder.decodeString)); | |
2240 } else { | |
2241 throw jsonDecoder.missingKey(jsonPath, "subscriptions"); | |
2242 } | |
2243 return new AnalysisSetSubscriptionsParams(subscriptions); | |
2244 } else { | |
2245 throw jsonDecoder.mismatch( | |
2246 jsonPath, "analysis.setSubscriptions params", json); | |
2247 } | |
2248 } | |
2249 | |
2250 factory AnalysisSetSubscriptionsParams.fromRequest(Request request) { | |
2251 return new AnalysisSetSubscriptionsParams.fromJson( | |
2252 new RequestDecoder(request), "params", request._params); | |
2253 } | |
2254 | |
2255 Map<String, dynamic> toJson() { | |
2256 Map<String, dynamic> result = {}; | |
2257 result["subscriptions"] = mapMap(subscriptions, | |
2258 keyCallback: (AnalysisService value) => value.toJson()); | |
2259 return result; | |
2260 } | |
2261 | |
2262 Request toRequest(String id) { | |
2263 return new Request(id, "analysis.setSubscriptions", toJson()); | |
2264 } | |
2265 | |
2266 @override | |
2267 String toString() => JSON.encode(toJson()); | |
2268 | |
2269 @override | |
2270 bool operator ==(other) { | |
2271 if (other is AnalysisSetSubscriptionsParams) { | |
2272 return mapEqual( | |
2273 subscriptions, | |
2274 other.subscriptions, | |
2275 (List<String> a, List<String> b) => | |
2276 listEqual(a, b, (String a, String b) => a == b)); | |
2277 } | |
2278 return false; | |
2279 } | |
2280 | |
2281 @override | |
2282 int get hashCode { | |
2283 int hash = 0; | |
2284 hash = JenkinsSmiHash.combine(hash, subscriptions.hashCode); | |
2285 return JenkinsSmiHash.finish(hash); | |
2286 } | |
2287 } | |
2288 | |
2289 /** | |
2290 * analysis.setSubscriptions result | |
2291 * | |
2292 * Clients may not extend, implement or mix-in this class. | |
2293 */ | |
2294 class AnalysisSetSubscriptionsResult { | |
2295 Response toResponse(String id) { | |
2296 return new Response(id, result: null); | |
2297 } | |
2298 | |
2299 @override | |
2300 bool operator ==(other) { | |
2301 if (other is AnalysisSetSubscriptionsResult) { | |
2302 return true; | |
2303 } | |
2304 return false; | |
2305 } | |
2306 | |
2307 @override | |
2308 int get hashCode { | |
2309 return 218088493; | |
2310 } | |
2311 } | |
2312 | |
2313 /** | |
2314 * analysis.updateContent params | |
2315 * | |
2316 * { | |
2317 * "files": Map<FilePath, AddContentOverlay | ChangeContentOverlay | RemoveCon
tentOverlay> | |
2318 * } | |
2319 * | |
2320 * Clients may not extend, implement or mix-in this class. | |
2321 */ | |
2322 class AnalysisUpdateContentParams implements HasToJson { | |
2323 Map<String, dynamic> _files; | |
2324 | |
2325 /** | |
2326 * A table mapping the files whose content has changed to a description of | |
2327 * the content change. | |
2328 */ | |
2329 Map<String, dynamic> get files => _files; | |
2330 | |
2331 /** | |
2332 * A table mapping the files whose content has changed to a description of | |
2333 * the content change. | |
2334 */ | |
2335 void set files(Map<String, dynamic> value) { | |
2336 assert(value != null); | |
2337 this._files = value; | |
2338 } | |
2339 | |
2340 AnalysisUpdateContentParams(Map<String, dynamic> files) { | |
2341 this.files = files; | |
2342 } | |
2343 | |
2344 factory AnalysisUpdateContentParams.fromJson( | |
2345 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
2346 if (json == null) { | |
2347 json = {}; | |
2348 } | |
2349 if (json is Map) { | |
2350 Map<String, dynamic> files; | |
2351 if (json.containsKey("files")) { | |
2352 files = jsonDecoder.decodeMap(jsonPath + ".files", json["files"], | |
2353 valueDecoder: (String jsonPath, Object json) => | |
2354 jsonDecoder.decodeUnion(jsonPath, json, "type", { | |
2355 "add": (String jsonPath, Object json) => | |
2356 new AddContentOverlay.fromJson( | |
2357 jsonDecoder, jsonPath, json), | |
2358 "change": (String jsonPath, Object json) => | |
2359 new ChangeContentOverlay.fromJson( | |
2360 jsonDecoder, jsonPath, json), | |
2361 "remove": (String jsonPath, Object json) => | |
2362 new RemoveContentOverlay.fromJson( | |
2363 jsonDecoder, jsonPath, json) | |
2364 })); | |
2365 } else { | |
2366 throw jsonDecoder.missingKey(jsonPath, "files"); | |
2367 } | |
2368 return new AnalysisUpdateContentParams(files); | |
2369 } else { | |
2370 throw jsonDecoder.mismatch( | |
2371 jsonPath, "analysis.updateContent params", json); | |
2372 } | |
2373 } | |
2374 | |
2375 factory AnalysisUpdateContentParams.fromRequest(Request request) { | |
2376 return new AnalysisUpdateContentParams.fromJson( | |
2377 new RequestDecoder(request), "params", request._params); | |
2378 } | |
2379 | |
2380 Map<String, dynamic> toJson() { | |
2381 Map<String, dynamic> result = {}; | |
2382 result["files"] = | |
2383 mapMap(files, valueCallback: (dynamic value) => value.toJson()); | |
2384 return result; | |
2385 } | |
2386 | |
2387 Request toRequest(String id) { | |
2388 return new Request(id, "analysis.updateContent", toJson()); | |
2389 } | |
2390 | |
2391 @override | |
2392 String toString() => JSON.encode(toJson()); | |
2393 | |
2394 @override | |
2395 bool operator ==(other) { | |
2396 if (other is AnalysisUpdateContentParams) { | |
2397 return mapEqual(files, other.files, (dynamic a, dynamic b) => a == b); | |
2398 } | |
2399 return false; | |
2400 } | |
2401 | |
2402 @override | |
2403 int get hashCode { | |
2404 int hash = 0; | |
2405 hash = JenkinsSmiHash.combine(hash, files.hashCode); | |
2406 return JenkinsSmiHash.finish(hash); | |
2407 } | |
2408 } | |
2409 | |
2410 /** | |
2411 * analysis.updateContent result | |
2412 * | |
2413 * { | |
2414 * } | |
2415 * | |
2416 * Clients may not extend, implement or mix-in this class. | |
2417 */ | |
2418 class AnalysisUpdateContentResult implements HasToJson { | |
2419 AnalysisUpdateContentResult(); | |
2420 | |
2421 factory AnalysisUpdateContentResult.fromJson( | |
2422 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
2423 if (json == null) { | |
2424 json = {}; | |
2425 } | |
2426 if (json is Map) { | |
2427 return new AnalysisUpdateContentResult(); | |
2428 } else { | |
2429 throw jsonDecoder.mismatch( | |
2430 jsonPath, "analysis.updateContent result", json); | |
2431 } | |
2432 } | |
2433 | |
2434 factory AnalysisUpdateContentResult.fromResponse(Response response) { | |
2435 return new AnalysisUpdateContentResult.fromJson( | |
2436 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
2437 "result", | |
2438 response._result); | |
2439 } | |
2440 | |
2441 Map<String, dynamic> toJson() { | |
2442 Map<String, dynamic> result = {}; | |
2443 return result; | |
2444 } | |
2445 | |
2446 Response toResponse(String id) { | |
2447 return new Response(id, result: toJson()); | |
2448 } | |
2449 | |
2450 @override | |
2451 String toString() => JSON.encode(toJson()); | |
2452 | |
2453 @override | |
2454 bool operator ==(other) { | |
2455 if (other is AnalysisUpdateContentResult) { | |
2456 return true; | |
2457 } | |
2458 return false; | |
2459 } | |
2460 | |
2461 @override | |
2462 int get hashCode { | |
2463 int hash = 0; | |
2464 return JenkinsSmiHash.finish(hash); | |
2465 } | |
2466 } | |
2467 | |
2468 /** | |
2469 * analysis.updateOptions params | |
2470 * | |
2471 * { | |
2472 * "options": AnalysisOptions | |
2473 * } | |
2474 * | |
2475 * Clients may not extend, implement or mix-in this class. | |
2476 */ | |
2477 class AnalysisUpdateOptionsParams implements HasToJson { | |
2478 AnalysisOptions _options; | |
2479 | |
2480 /** | |
2481 * The options that are to be used to control analysis. | |
2482 */ | |
2483 AnalysisOptions get options => _options; | |
2484 | |
2485 /** | |
2486 * The options that are to be used to control analysis. | |
2487 */ | |
2488 void set options(AnalysisOptions value) { | |
2489 assert(value != null); | |
2490 this._options = value; | |
2491 } | |
2492 | |
2493 AnalysisUpdateOptionsParams(AnalysisOptions options) { | |
2494 this.options = options; | |
2495 } | |
2496 | |
2497 factory AnalysisUpdateOptionsParams.fromJson( | |
2498 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
2499 if (json == null) { | |
2500 json = {}; | |
2501 } | |
2502 if (json is Map) { | |
2503 AnalysisOptions options; | |
2504 if (json.containsKey("options")) { | |
2505 options = new AnalysisOptions.fromJson( | |
2506 jsonDecoder, jsonPath + ".options", json["options"]); | |
2507 } else { | |
2508 throw jsonDecoder.missingKey(jsonPath, "options"); | |
2509 } | |
2510 return new AnalysisUpdateOptionsParams(options); | |
2511 } else { | |
2512 throw jsonDecoder.mismatch( | |
2513 jsonPath, "analysis.updateOptions params", json); | |
2514 } | |
2515 } | |
2516 | |
2517 factory AnalysisUpdateOptionsParams.fromRequest(Request request) { | |
2518 return new AnalysisUpdateOptionsParams.fromJson( | |
2519 new RequestDecoder(request), "params", request._params); | |
2520 } | |
2521 | |
2522 Map<String, dynamic> toJson() { | |
2523 Map<String, dynamic> result = {}; | |
2524 result["options"] = options.toJson(); | |
2525 return result; | |
2526 } | |
2527 | |
2528 Request toRequest(String id) { | |
2529 return new Request(id, "analysis.updateOptions", toJson()); | |
2530 } | |
2531 | |
2532 @override | |
2533 String toString() => JSON.encode(toJson()); | |
2534 | |
2535 @override | |
2536 bool operator ==(other) { | |
2537 if (other is AnalysisUpdateOptionsParams) { | |
2538 return options == other.options; | |
2539 } | |
2540 return false; | |
2541 } | |
2542 | |
2543 @override | |
2544 int get hashCode { | |
2545 int hash = 0; | |
2546 hash = JenkinsSmiHash.combine(hash, options.hashCode); | |
2547 return JenkinsSmiHash.finish(hash); | |
2548 } | |
2549 } | |
2550 | |
2551 /** | |
2552 * analysis.updateOptions result | |
2553 * | |
2554 * Clients may not extend, implement or mix-in this class. | |
2555 */ | |
2556 class AnalysisUpdateOptionsResult { | |
2557 Response toResponse(String id) { | |
2558 return new Response(id, result: null); | |
2559 } | |
2560 | |
2561 @override | |
2562 bool operator ==(other) { | |
2563 if (other is AnalysisUpdateOptionsResult) { | |
2564 return true; | |
2565 } | |
2566 return false; | |
2567 } | |
2568 | |
2569 @override | |
2570 int get hashCode { | |
2571 return 179689467; | |
2572 } | |
2573 } | |
2574 | |
2575 /** | |
2576 * analysis.analyzedFiles params | |
2577 * | |
2578 * { | |
2579 * "directories": List<FilePath> | |
2580 * } | |
2581 * | |
2582 * Clients may not extend, implement or mix-in this class. | |
2583 */ | |
2584 class AnalysisAnalyzedFilesParams implements HasToJson { | |
2585 List<String> _directories; | |
2586 | |
2587 /** | |
2588 * A list of the paths of the files that are being analyzed. | |
2589 */ | |
2590 List<String> get directories => _directories; | |
2591 | |
2592 /** | |
2593 * A list of the paths of the files that are being analyzed. | |
2594 */ | |
2595 void set directories(List<String> value) { | |
2596 assert(value != null); | |
2597 this._directories = value; | |
2598 } | |
2599 | |
2600 AnalysisAnalyzedFilesParams(List<String> directories) { | |
2601 this.directories = directories; | |
2602 } | |
2603 | |
2604 factory AnalysisAnalyzedFilesParams.fromJson( | |
2605 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
2606 if (json == null) { | |
2607 json = {}; | |
2608 } | |
2609 if (json is Map) { | |
2610 List<String> directories; | |
2611 if (json.containsKey("directories")) { | |
2612 directories = jsonDecoder.decodeList(jsonPath + ".directories", | |
2613 json["directories"], jsonDecoder.decodeString); | |
2614 } else { | |
2615 throw jsonDecoder.missingKey(jsonPath, "directories"); | |
2616 } | |
2617 return new AnalysisAnalyzedFilesParams(directories); | |
2618 } else { | |
2619 throw jsonDecoder.mismatch( | |
2620 jsonPath, "analysis.analyzedFiles params", json); | |
2621 } | |
2622 } | |
2623 | |
2624 factory AnalysisAnalyzedFilesParams.fromNotification( | |
2625 Notification notification) { | |
2626 return new AnalysisAnalyzedFilesParams.fromJson( | |
2627 new ResponseDecoder(null), "params", notification._params); | |
2628 } | |
2629 | |
2630 Map<String, dynamic> toJson() { | |
2631 Map<String, dynamic> result = {}; | |
2632 result["directories"] = directories; | |
2633 return result; | |
2634 } | |
2635 | |
2636 Notification toNotification() { | |
2637 return new Notification("analysis.analyzedFiles", toJson()); | |
2638 } | |
2639 | |
2640 @override | |
2641 String toString() => JSON.encode(toJson()); | |
2642 | |
2643 @override | |
2644 bool operator ==(other) { | |
2645 if (other is AnalysisAnalyzedFilesParams) { | |
2646 return listEqual( | |
2647 directories, other.directories, (String a, String b) => a == b); | |
2648 } | |
2649 return false; | |
2650 } | |
2651 | |
2652 @override | |
2653 int get hashCode { | |
2654 int hash = 0; | |
2655 hash = JenkinsSmiHash.combine(hash, directories.hashCode); | |
2656 return JenkinsSmiHash.finish(hash); | |
2657 } | |
2658 } | |
2659 | |
2660 /** | |
2661 * analysis.errors params | |
2662 * | |
2663 * { | |
2664 * "file": FilePath | |
2665 * "errors": List<AnalysisError> | |
2666 * } | |
2667 * | |
2668 * Clients may not extend, implement or mix-in this class. | |
2669 */ | |
2670 class AnalysisErrorsParams implements HasToJson { | |
2671 String _file; | |
2672 | |
2673 List<AnalysisError> _errors; | |
2674 | |
2675 /** | |
2676 * The file containing the errors. | |
2677 */ | |
2678 String get file => _file; | |
2679 | |
2680 /** | |
2681 * The file containing the errors. | |
2682 */ | |
2683 void set file(String value) { | |
2684 assert(value != null); | |
2685 this._file = value; | |
2686 } | |
2687 | |
2688 /** | |
2689 * The errors contained in the file. | |
2690 */ | |
2691 List<AnalysisError> get errors => _errors; | |
2692 | |
2693 /** | |
2694 * The errors contained in the file. | |
2695 */ | |
2696 void set errors(List<AnalysisError> value) { | |
2697 assert(value != null); | |
2698 this._errors = value; | |
2699 } | |
2700 | |
2701 AnalysisErrorsParams(String file, List<AnalysisError> errors) { | |
2702 this.file = file; | |
2703 this.errors = errors; | |
2704 } | |
2705 | |
2706 factory AnalysisErrorsParams.fromJson( | |
2707 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
2708 if (json == null) { | |
2709 json = {}; | |
2710 } | |
2711 if (json is Map) { | |
2712 String file; | |
2713 if (json.containsKey("file")) { | |
2714 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
2715 } else { | |
2716 throw jsonDecoder.missingKey(jsonPath, "file"); | |
2717 } | |
2718 List<AnalysisError> errors; | |
2719 if (json.containsKey("errors")) { | |
2720 errors = jsonDecoder.decodeList( | |
2721 jsonPath + ".errors", | |
2722 json["errors"], | |
2723 (String jsonPath, Object json) => | |
2724 new AnalysisError.fromJson(jsonDecoder, jsonPath, json)); | |
2725 } else { | |
2726 throw jsonDecoder.missingKey(jsonPath, "errors"); | |
2727 } | |
2728 return new AnalysisErrorsParams(file, errors); | |
2729 } else { | |
2730 throw jsonDecoder.mismatch(jsonPath, "analysis.errors params", json); | |
2731 } | |
2732 } | |
2733 | |
2734 factory AnalysisErrorsParams.fromNotification(Notification notification) { | |
2735 return new AnalysisErrorsParams.fromJson( | |
2736 new ResponseDecoder(null), "params", notification._params); | |
2737 } | |
2738 | |
2739 Map<String, dynamic> toJson() { | |
2740 Map<String, dynamic> result = {}; | |
2741 result["file"] = file; | |
2742 result["errors"] = | |
2743 errors.map((AnalysisError value) => value.toJson()).toList(); | |
2744 return result; | |
2745 } | |
2746 | |
2747 Notification toNotification() { | |
2748 return new Notification("analysis.errors", toJson()); | |
2749 } | |
2750 | |
2751 @override | |
2752 String toString() => JSON.encode(toJson()); | |
2753 | |
2754 @override | |
2755 bool operator ==(other) { | |
2756 if (other is AnalysisErrorsParams) { | |
2757 return file == other.file && | |
2758 listEqual(errors, other.errors, | |
2759 (AnalysisError a, AnalysisError b) => a == b); | |
2760 } | |
2761 return false; | |
2762 } | |
2763 | |
2764 @override | |
2765 int get hashCode { | |
2766 int hash = 0; | |
2767 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
2768 hash = JenkinsSmiHash.combine(hash, errors.hashCode); | |
2769 return JenkinsSmiHash.finish(hash); | |
2770 } | |
2771 } | |
2772 | |
2773 /** | |
2774 * analysis.flushResults params | |
2775 * | |
2776 * { | |
2777 * "files": List<FilePath> | |
2778 * } | |
2779 * | |
2780 * Clients may not extend, implement or mix-in this class. | |
2781 */ | |
2782 class AnalysisFlushResultsParams implements HasToJson { | |
2783 List<String> _files; | |
2784 | |
2785 /** | |
2786 * The files that are no longer being analyzed. | |
2787 */ | |
2788 List<String> get files => _files; | |
2789 | |
2790 /** | |
2791 * The files that are no longer being analyzed. | |
2792 */ | |
2793 void set files(List<String> value) { | |
2794 assert(value != null); | |
2795 this._files = value; | |
2796 } | |
2797 | |
2798 AnalysisFlushResultsParams(List<String> files) { | |
2799 this.files = files; | |
2800 } | |
2801 | |
2802 factory AnalysisFlushResultsParams.fromJson( | |
2803 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
2804 if (json == null) { | |
2805 json = {}; | |
2806 } | |
2807 if (json is Map) { | |
2808 List<String> files; | |
2809 if (json.containsKey("files")) { | |
2810 files = jsonDecoder.decodeList( | |
2811 jsonPath + ".files", json["files"], jsonDecoder.decodeString); | |
2812 } else { | |
2813 throw jsonDecoder.missingKey(jsonPath, "files"); | |
2814 } | |
2815 return new AnalysisFlushResultsParams(files); | |
2816 } else { | |
2817 throw jsonDecoder.mismatch( | |
2818 jsonPath, "analysis.flushResults params", json); | |
2819 } | |
2820 } | |
2821 | |
2822 factory AnalysisFlushResultsParams.fromNotification( | |
2823 Notification notification) { | |
2824 return new AnalysisFlushResultsParams.fromJson( | |
2825 new ResponseDecoder(null), "params", notification._params); | |
2826 } | |
2827 | |
2828 Map<String, dynamic> toJson() { | |
2829 Map<String, dynamic> result = {}; | |
2830 result["files"] = files; | |
2831 return result; | |
2832 } | |
2833 | |
2834 Notification toNotification() { | |
2835 return new Notification("analysis.flushResults", toJson()); | |
2836 } | |
2837 | |
2838 @override | |
2839 String toString() => JSON.encode(toJson()); | |
2840 | |
2841 @override | |
2842 bool operator ==(other) { | |
2843 if (other is AnalysisFlushResultsParams) { | |
2844 return listEqual(files, other.files, (String a, String b) => a == b); | |
2845 } | |
2846 return false; | |
2847 } | |
2848 | |
2849 @override | |
2850 int get hashCode { | |
2851 int hash = 0; | |
2852 hash = JenkinsSmiHash.combine(hash, files.hashCode); | |
2853 return JenkinsSmiHash.finish(hash); | |
2854 } | |
2855 } | |
2856 | |
2857 /** | |
2858 * analysis.folding params | |
2859 * | |
2860 * { | |
2861 * "file": FilePath | |
2862 * "regions": List<FoldingRegion> | |
2863 * } | |
2864 * | |
2865 * Clients may not extend, implement or mix-in this class. | |
2866 */ | |
2867 class AnalysisFoldingParams implements HasToJson { | |
2868 String _file; | |
2869 | |
2870 List<FoldingRegion> _regions; | |
2871 | |
2872 /** | |
2873 * The file containing the folding regions. | |
2874 */ | |
2875 String get file => _file; | |
2876 | |
2877 /** | |
2878 * The file containing the folding regions. | |
2879 */ | |
2880 void set file(String value) { | |
2881 assert(value != null); | |
2882 this._file = value; | |
2883 } | |
2884 | |
2885 /** | |
2886 * The folding regions contained in the file. | |
2887 */ | |
2888 List<FoldingRegion> get regions => _regions; | |
2889 | |
2890 /** | |
2891 * The folding regions contained in the file. | |
2892 */ | |
2893 void set regions(List<FoldingRegion> value) { | |
2894 assert(value != null); | |
2895 this._regions = value; | |
2896 } | |
2897 | |
2898 AnalysisFoldingParams(String file, List<FoldingRegion> regions) { | |
2899 this.file = file; | |
2900 this.regions = regions; | |
2901 } | |
2902 | |
2903 factory AnalysisFoldingParams.fromJson( | |
2904 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
2905 if (json == null) { | |
2906 json = {}; | |
2907 } | |
2908 if (json is Map) { | |
2909 String file; | |
2910 if (json.containsKey("file")) { | |
2911 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
2912 } else { | |
2913 throw jsonDecoder.missingKey(jsonPath, "file"); | |
2914 } | |
2915 List<FoldingRegion> regions; | |
2916 if (json.containsKey("regions")) { | |
2917 regions = jsonDecoder.decodeList( | |
2918 jsonPath + ".regions", | |
2919 json["regions"], | |
2920 (String jsonPath, Object json) => | |
2921 new FoldingRegion.fromJson(jsonDecoder, jsonPath, json)); | |
2922 } else { | |
2923 throw jsonDecoder.missingKey(jsonPath, "regions"); | |
2924 } | |
2925 return new AnalysisFoldingParams(file, regions); | |
2926 } else { | |
2927 throw jsonDecoder.mismatch(jsonPath, "analysis.folding params", json); | |
2928 } | |
2929 } | |
2930 | |
2931 factory AnalysisFoldingParams.fromNotification(Notification notification) { | |
2932 return new AnalysisFoldingParams.fromJson( | |
2933 new ResponseDecoder(null), "params", notification._params); | |
2934 } | |
2935 | |
2936 Map<String, dynamic> toJson() { | |
2937 Map<String, dynamic> result = {}; | |
2938 result["file"] = file; | |
2939 result["regions"] = | |
2940 regions.map((FoldingRegion value) => value.toJson()).toList(); | |
2941 return result; | |
2942 } | |
2943 | |
2944 Notification toNotification() { | |
2945 return new Notification("analysis.folding", toJson()); | |
2946 } | |
2947 | |
2948 @override | |
2949 String toString() => JSON.encode(toJson()); | |
2950 | |
2951 @override | |
2952 bool operator ==(other) { | |
2953 if (other is AnalysisFoldingParams) { | |
2954 return file == other.file && | |
2955 listEqual(regions, other.regions, | |
2956 (FoldingRegion a, FoldingRegion b) => a == b); | |
2957 } | |
2958 return false; | |
2959 } | |
2960 | |
2961 @override | |
2962 int get hashCode { | |
2963 int hash = 0; | |
2964 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
2965 hash = JenkinsSmiHash.combine(hash, regions.hashCode); | |
2966 return JenkinsSmiHash.finish(hash); | |
2967 } | |
2968 } | |
2969 | |
2970 /** | |
2971 * analysis.highlights params | |
2972 * | |
2973 * { | |
2974 * "file": FilePath | |
2975 * "regions": List<HighlightRegion> | |
2976 * } | |
2977 * | |
2978 * Clients may not extend, implement or mix-in this class. | |
2979 */ | |
2980 class AnalysisHighlightsParams implements HasToJson { | |
2981 String _file; | |
2982 | |
2983 List<HighlightRegion> _regions; | |
2984 | |
2985 /** | |
2986 * The file containing the highlight regions. | |
2987 */ | |
2988 String get file => _file; | |
2989 | |
2990 /** | |
2991 * The file containing the highlight regions. | |
2992 */ | |
2993 void set file(String value) { | |
2994 assert(value != null); | |
2995 this._file = value; | |
2996 } | |
2997 | |
2998 /** | |
2999 * The highlight regions contained in the file. Each highlight region | |
3000 * represents a particular syntactic or semantic meaning associated with some | |
3001 * range. Note that the highlight regions that are returned can overlap other | |
3002 * highlight regions if there is more than one meaning associated with a | |
3003 * particular region. | |
3004 */ | |
3005 List<HighlightRegion> get regions => _regions; | |
3006 | |
3007 /** | |
3008 * The highlight regions contained in the file. Each highlight region | |
3009 * represents a particular syntactic or semantic meaning associated with some | |
3010 * range. Note that the highlight regions that are returned can overlap other | |
3011 * highlight regions if there is more than one meaning associated with a | |
3012 * particular region. | |
3013 */ | |
3014 void set regions(List<HighlightRegion> value) { | |
3015 assert(value != null); | |
3016 this._regions = value; | |
3017 } | |
3018 | |
3019 AnalysisHighlightsParams(String file, List<HighlightRegion> regions) { | |
3020 this.file = file; | |
3021 this.regions = regions; | |
3022 } | |
3023 | |
3024 factory AnalysisHighlightsParams.fromJson( | |
3025 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
3026 if (json == null) { | |
3027 json = {}; | |
3028 } | |
3029 if (json is Map) { | |
3030 String file; | |
3031 if (json.containsKey("file")) { | |
3032 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
3033 } else { | |
3034 throw jsonDecoder.missingKey(jsonPath, "file"); | |
3035 } | |
3036 List<HighlightRegion> regions; | |
3037 if (json.containsKey("regions")) { | |
3038 regions = jsonDecoder.decodeList( | |
3039 jsonPath + ".regions", | |
3040 json["regions"], | |
3041 (String jsonPath, Object json) => | |
3042 new HighlightRegion.fromJson(jsonDecoder, jsonPath, json)); | |
3043 } else { | |
3044 throw jsonDecoder.missingKey(jsonPath, "regions"); | |
3045 } | |
3046 return new AnalysisHighlightsParams(file, regions); | |
3047 } else { | |
3048 throw jsonDecoder.mismatch(jsonPath, "analysis.highlights params", json); | |
3049 } | |
3050 } | |
3051 | |
3052 factory AnalysisHighlightsParams.fromNotification(Notification notification) { | |
3053 return new AnalysisHighlightsParams.fromJson( | |
3054 new ResponseDecoder(null), "params", notification._params); | |
3055 } | |
3056 | |
3057 Map<String, dynamic> toJson() { | |
3058 Map<String, dynamic> result = {}; | |
3059 result["file"] = file; | |
3060 result["regions"] = | |
3061 regions.map((HighlightRegion value) => value.toJson()).toList(); | |
3062 return result; | |
3063 } | |
3064 | |
3065 Notification toNotification() { | |
3066 return new Notification("analysis.highlights", toJson()); | |
3067 } | |
3068 | |
3069 @override | |
3070 String toString() => JSON.encode(toJson()); | |
3071 | |
3072 @override | |
3073 bool operator ==(other) { | |
3074 if (other is AnalysisHighlightsParams) { | |
3075 return file == other.file && | |
3076 listEqual(regions, other.regions, | |
3077 (HighlightRegion a, HighlightRegion b) => a == b); | |
3078 } | |
3079 return false; | |
3080 } | |
3081 | |
3082 @override | |
3083 int get hashCode { | |
3084 int hash = 0; | |
3085 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
3086 hash = JenkinsSmiHash.combine(hash, regions.hashCode); | |
3087 return JenkinsSmiHash.finish(hash); | |
3088 } | |
3089 } | |
3090 | |
3091 /** | |
3092 * analysis.implemented params | |
3093 * | |
3094 * { | |
3095 * "file": FilePath | |
3096 * "classes": List<ImplementedClass> | |
3097 * "members": List<ImplementedMember> | |
3098 * } | |
3099 * | |
3100 * Clients may not extend, implement or mix-in this class. | |
3101 */ | |
3102 class AnalysisImplementedParams implements HasToJson { | |
3103 String _file; | |
3104 | |
3105 List<ImplementedClass> _classes; | |
3106 | |
3107 List<ImplementedMember> _members; | |
3108 | |
3109 /** | |
3110 * The file with which the implementations are associated. | |
3111 */ | |
3112 String get file => _file; | |
3113 | |
3114 /** | |
3115 * The file with which the implementations are associated. | |
3116 */ | |
3117 void set file(String value) { | |
3118 assert(value != null); | |
3119 this._file = value; | |
3120 } | |
3121 | |
3122 /** | |
3123 * The classes defined in the file that are implemented or extended. | |
3124 */ | |
3125 List<ImplementedClass> get classes => _classes; | |
3126 | |
3127 /** | |
3128 * The classes defined in the file that are implemented or extended. | |
3129 */ | |
3130 void set classes(List<ImplementedClass> value) { | |
3131 assert(value != null); | |
3132 this._classes = value; | |
3133 } | |
3134 | |
3135 /** | |
3136 * The member defined in the file that are implemented or overridden. | |
3137 */ | |
3138 List<ImplementedMember> get members => _members; | |
3139 | |
3140 /** | |
3141 * The member defined in the file that are implemented or overridden. | |
3142 */ | |
3143 void set members(List<ImplementedMember> value) { | |
3144 assert(value != null); | |
3145 this._members = value; | |
3146 } | |
3147 | |
3148 AnalysisImplementedParams(String file, List<ImplementedClass> classes, | |
3149 List<ImplementedMember> members) { | |
3150 this.file = file; | |
3151 this.classes = classes; | |
3152 this.members = members; | |
3153 } | |
3154 | |
3155 factory AnalysisImplementedParams.fromJson( | |
3156 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
3157 if (json == null) { | |
3158 json = {}; | |
3159 } | |
3160 if (json is Map) { | |
3161 String file; | |
3162 if (json.containsKey("file")) { | |
3163 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
3164 } else { | |
3165 throw jsonDecoder.missingKey(jsonPath, "file"); | |
3166 } | |
3167 List<ImplementedClass> classes; | |
3168 if (json.containsKey("classes")) { | |
3169 classes = jsonDecoder.decodeList( | |
3170 jsonPath + ".classes", | |
3171 json["classes"], | |
3172 (String jsonPath, Object json) => | |
3173 new ImplementedClass.fromJson(jsonDecoder, jsonPath, json)); | |
3174 } else { | |
3175 throw jsonDecoder.missingKey(jsonPath, "classes"); | |
3176 } | |
3177 List<ImplementedMember> members; | |
3178 if (json.containsKey("members")) { | |
3179 members = jsonDecoder.decodeList( | |
3180 jsonPath + ".members", | |
3181 json["members"], | |
3182 (String jsonPath, Object json) => | |
3183 new ImplementedMember.fromJson(jsonDecoder, jsonPath, json)); | |
3184 } else { | |
3185 throw jsonDecoder.missingKey(jsonPath, "members"); | |
3186 } | |
3187 return new AnalysisImplementedParams(file, classes, members); | |
3188 } else { | |
3189 throw jsonDecoder.mismatch(jsonPath, "analysis.implemented params", json); | |
3190 } | |
3191 } | |
3192 | |
3193 factory AnalysisImplementedParams.fromNotification( | |
3194 Notification notification) { | |
3195 return new AnalysisImplementedParams.fromJson( | |
3196 new ResponseDecoder(null), "params", notification._params); | |
3197 } | |
3198 | |
3199 Map<String, dynamic> toJson() { | |
3200 Map<String, dynamic> result = {}; | |
3201 result["file"] = file; | |
3202 result["classes"] = | |
3203 classes.map((ImplementedClass value) => value.toJson()).toList(); | |
3204 result["members"] = | |
3205 members.map((ImplementedMember value) => value.toJson()).toList(); | |
3206 return result; | |
3207 } | |
3208 | |
3209 Notification toNotification() { | |
3210 return new Notification("analysis.implemented", toJson()); | |
3211 } | |
3212 | |
3213 @override | |
3214 String toString() => JSON.encode(toJson()); | |
3215 | |
3216 @override | |
3217 bool operator ==(other) { | |
3218 if (other is AnalysisImplementedParams) { | |
3219 return file == other.file && | |
3220 listEqual(classes, other.classes, | |
3221 (ImplementedClass a, ImplementedClass b) => a == b) && | |
3222 listEqual(members, other.members, | |
3223 (ImplementedMember a, ImplementedMember b) => a == b); | |
3224 } | |
3225 return false; | |
3226 } | |
3227 | |
3228 @override | |
3229 int get hashCode { | |
3230 int hash = 0; | |
3231 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
3232 hash = JenkinsSmiHash.combine(hash, classes.hashCode); | |
3233 hash = JenkinsSmiHash.combine(hash, members.hashCode); | |
3234 return JenkinsSmiHash.finish(hash); | |
3235 } | |
3236 } | |
3237 | |
3238 /** | |
3239 * analysis.invalidate params | |
3240 * | |
3241 * { | |
3242 * "file": FilePath | |
3243 * "offset": int | |
3244 * "length": int | |
3245 * "delta": int | |
3246 * } | |
3247 * | |
3248 * Clients may not extend, implement or mix-in this class. | |
3249 */ | |
3250 class AnalysisInvalidateParams implements HasToJson { | |
3251 String _file; | |
3252 | |
3253 int _offset; | |
3254 | |
3255 int _length; | |
3256 | |
3257 int _delta; | |
3258 | |
3259 /** | |
3260 * The file whose information has been invalidated. | |
3261 */ | |
3262 String get file => _file; | |
3263 | |
3264 /** | |
3265 * The file whose information has been invalidated. | |
3266 */ | |
3267 void set file(String value) { | |
3268 assert(value != null); | |
3269 this._file = value; | |
3270 } | |
3271 | |
3272 /** | |
3273 * The offset of the invalidated region. | |
3274 */ | |
3275 int get offset => _offset; | |
3276 | |
3277 /** | |
3278 * The offset of the invalidated region. | |
3279 */ | |
3280 void set offset(int value) { | |
3281 assert(value != null); | |
3282 this._offset = value; | |
3283 } | |
3284 | |
3285 /** | |
3286 * The length of the invalidated region. | |
3287 */ | |
3288 int get length => _length; | |
3289 | |
3290 /** | |
3291 * The length of the invalidated region. | |
3292 */ | |
3293 void set length(int value) { | |
3294 assert(value != null); | |
3295 this._length = value; | |
3296 } | |
3297 | |
3298 /** | |
3299 * The delta to be applied to the offsets in information that follows the | |
3300 * invalidated region in order to update it so that it doesn't need to be | |
3301 * re-requested. | |
3302 */ | |
3303 int get delta => _delta; | |
3304 | |
3305 /** | |
3306 * The delta to be applied to the offsets in information that follows the | |
3307 * invalidated region in order to update it so that it doesn't need to be | |
3308 * re-requested. | |
3309 */ | |
3310 void set delta(int value) { | |
3311 assert(value != null); | |
3312 this._delta = value; | |
3313 } | |
3314 | |
3315 AnalysisInvalidateParams(String file, int offset, int length, int delta) { | |
3316 this.file = file; | |
3317 this.offset = offset; | |
3318 this.length = length; | |
3319 this.delta = delta; | |
3320 } | |
3321 | |
3322 factory AnalysisInvalidateParams.fromJson( | |
3323 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
3324 if (json == null) { | |
3325 json = {}; | |
3326 } | |
3327 if (json is Map) { | |
3328 String file; | |
3329 if (json.containsKey("file")) { | |
3330 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
3331 } else { | |
3332 throw jsonDecoder.missingKey(jsonPath, "file"); | |
3333 } | |
3334 int offset; | |
3335 if (json.containsKey("offset")) { | |
3336 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
3337 } else { | |
3338 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
3339 } | |
3340 int length; | |
3341 if (json.containsKey("length")) { | |
3342 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
3343 } else { | |
3344 throw jsonDecoder.missingKey(jsonPath, "length"); | |
3345 } | |
3346 int delta; | |
3347 if (json.containsKey("delta")) { | |
3348 delta = jsonDecoder.decodeInt(jsonPath + ".delta", json["delta"]); | |
3349 } else { | |
3350 throw jsonDecoder.missingKey(jsonPath, "delta"); | |
3351 } | |
3352 return new AnalysisInvalidateParams(file, offset, length, delta); | |
3353 } else { | |
3354 throw jsonDecoder.mismatch(jsonPath, "analysis.invalidate params", json); | |
3355 } | |
3356 } | |
3357 | |
3358 factory AnalysisInvalidateParams.fromNotification(Notification notification) { | |
3359 return new AnalysisInvalidateParams.fromJson( | |
3360 new ResponseDecoder(null), "params", notification._params); | |
3361 } | |
3362 | |
3363 Map<String, dynamic> toJson() { | |
3364 Map<String, dynamic> result = {}; | |
3365 result["file"] = file; | |
3366 result["offset"] = offset; | |
3367 result["length"] = length; | |
3368 result["delta"] = delta; | |
3369 return result; | |
3370 } | |
3371 | |
3372 Notification toNotification() { | |
3373 return new Notification("analysis.invalidate", toJson()); | |
3374 } | |
3375 | |
3376 @override | |
3377 String toString() => JSON.encode(toJson()); | |
3378 | |
3379 @override | |
3380 bool operator ==(other) { | |
3381 if (other is AnalysisInvalidateParams) { | |
3382 return file == other.file && | |
3383 offset == other.offset && | |
3384 length == other.length && | |
3385 delta == other.delta; | |
3386 } | |
3387 return false; | |
3388 } | |
3389 | |
3390 @override | |
3391 int get hashCode { | |
3392 int hash = 0; | |
3393 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
3394 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
3395 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
3396 hash = JenkinsSmiHash.combine(hash, delta.hashCode); | |
3397 return JenkinsSmiHash.finish(hash); | |
3398 } | |
3399 } | |
3400 | |
3401 /** | |
3402 * analysis.navigation params | |
3403 * | |
3404 * { | |
3405 * "file": FilePath | |
3406 * "regions": List<NavigationRegion> | |
3407 * "targets": List<NavigationTarget> | |
3408 * "files": List<FilePath> | |
3409 * } | |
3410 * | |
3411 * Clients may not extend, implement or mix-in this class. | |
3412 */ | |
3413 class AnalysisNavigationParams implements HasToJson { | |
3414 String _file; | |
3415 | |
3416 List<NavigationRegion> _regions; | |
3417 | |
3418 List<NavigationTarget> _targets; | |
3419 | |
3420 List<String> _files; | |
3421 | |
3422 /** | |
3423 * The file containing the navigation regions. | |
3424 */ | |
3425 String get file => _file; | |
3426 | |
3427 /** | |
3428 * The file containing the navigation regions. | |
3429 */ | |
3430 void set file(String value) { | |
3431 assert(value != null); | |
3432 this._file = value; | |
3433 } | |
3434 | |
3435 /** | |
3436 * The navigation regions contained in the file. The regions are sorted by | |
3437 * their offsets. Each navigation region represents a list of targets | |
3438 * associated with some range. The lists will usually contain a single | |
3439 * target, but can contain more in the case of a part that is included in | |
3440 * multiple libraries or in Dart code that is compiled against multiple | |
3441 * versions of a package. Note that the navigation regions that are returned | |
3442 * do not overlap other navigation regions. | |
3443 */ | |
3444 List<NavigationRegion> get regions => _regions; | |
3445 | |
3446 /** | |
3447 * The navigation regions contained in the file. The regions are sorted by | |
3448 * their offsets. Each navigation region represents a list of targets | |
3449 * associated with some range. The lists will usually contain a single | |
3450 * target, but can contain more in the case of a part that is included in | |
3451 * multiple libraries or in Dart code that is compiled against multiple | |
3452 * versions of a package. Note that the navigation regions that are returned | |
3453 * do not overlap other navigation regions. | |
3454 */ | |
3455 void set regions(List<NavigationRegion> value) { | |
3456 assert(value != null); | |
3457 this._regions = value; | |
3458 } | |
3459 | |
3460 /** | |
3461 * The navigation targets referenced in the file. They are referenced by | |
3462 * NavigationRegions by their index in this array. | |
3463 */ | |
3464 List<NavigationTarget> get targets => _targets; | |
3465 | |
3466 /** | |
3467 * The navigation targets referenced in the file. They are referenced by | |
3468 * NavigationRegions by their index in this array. | |
3469 */ | |
3470 void set targets(List<NavigationTarget> value) { | |
3471 assert(value != null); | |
3472 this._targets = value; | |
3473 } | |
3474 | |
3475 /** | |
3476 * The files containing navigation targets referenced in the file. They are | |
3477 * referenced by NavigationTargets by their index in this array. | |
3478 */ | |
3479 List<String> get files => _files; | |
3480 | |
3481 /** | |
3482 * The files containing navigation targets referenced in the file. They are | |
3483 * referenced by NavigationTargets by their index in this array. | |
3484 */ | |
3485 void set files(List<String> value) { | |
3486 assert(value != null); | |
3487 this._files = value; | |
3488 } | |
3489 | |
3490 AnalysisNavigationParams(String file, List<NavigationRegion> regions, | |
3491 List<NavigationTarget> targets, List<String> files) { | |
3492 this.file = file; | |
3493 this.regions = regions; | |
3494 this.targets = targets; | |
3495 this.files = files; | |
3496 } | |
3497 | |
3498 factory AnalysisNavigationParams.fromJson( | |
3499 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
3500 if (json == null) { | |
3501 json = {}; | |
3502 } | |
3503 if (json is Map) { | |
3504 String file; | |
3505 if (json.containsKey("file")) { | |
3506 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
3507 } else { | |
3508 throw jsonDecoder.missingKey(jsonPath, "file"); | |
3509 } | |
3510 List<NavigationRegion> regions; | |
3511 if (json.containsKey("regions")) { | |
3512 regions = jsonDecoder.decodeList( | |
3513 jsonPath + ".regions", | |
3514 json["regions"], | |
3515 (String jsonPath, Object json) => | |
3516 new NavigationRegion.fromJson(jsonDecoder, jsonPath, json)); | |
3517 } else { | |
3518 throw jsonDecoder.missingKey(jsonPath, "regions"); | |
3519 } | |
3520 List<NavigationTarget> targets; | |
3521 if (json.containsKey("targets")) { | |
3522 targets = jsonDecoder.decodeList( | |
3523 jsonPath + ".targets", | |
3524 json["targets"], | |
3525 (String jsonPath, Object json) => | |
3526 new NavigationTarget.fromJson(jsonDecoder, jsonPath, json)); | |
3527 } else { | |
3528 throw jsonDecoder.missingKey(jsonPath, "targets"); | |
3529 } | |
3530 List<String> files; | |
3531 if (json.containsKey("files")) { | |
3532 files = jsonDecoder.decodeList( | |
3533 jsonPath + ".files", json["files"], jsonDecoder.decodeString); | |
3534 } else { | |
3535 throw jsonDecoder.missingKey(jsonPath, "files"); | |
3536 } | |
3537 return new AnalysisNavigationParams(file, regions, targets, files); | |
3538 } else { | |
3539 throw jsonDecoder.mismatch(jsonPath, "analysis.navigation params", json); | |
3540 } | |
3541 } | |
3542 | |
3543 factory AnalysisNavigationParams.fromNotification(Notification notification) { | |
3544 return new AnalysisNavigationParams.fromJson( | |
3545 new ResponseDecoder(null), "params", notification._params); | |
3546 } | |
3547 | |
3548 Map<String, dynamic> toJson() { | |
3549 Map<String, dynamic> result = {}; | |
3550 result["file"] = file; | |
3551 result["regions"] = | |
3552 regions.map((NavigationRegion value) => value.toJson()).toList(); | |
3553 result["targets"] = | |
3554 targets.map((NavigationTarget value) => value.toJson()).toList(); | |
3555 result["files"] = files; | |
3556 return result; | |
3557 } | |
3558 | |
3559 Notification toNotification() { | |
3560 return new Notification("analysis.navigation", toJson()); | |
3561 } | |
3562 | |
3563 @override | |
3564 String toString() => JSON.encode(toJson()); | |
3565 | |
3566 @override | |
3567 bool operator ==(other) { | |
3568 if (other is AnalysisNavigationParams) { | |
3569 return file == other.file && | |
3570 listEqual(regions, other.regions, | |
3571 (NavigationRegion a, NavigationRegion b) => a == b) && | |
3572 listEqual(targets, other.targets, | |
3573 (NavigationTarget a, NavigationTarget b) => a == b) && | |
3574 listEqual(files, other.files, (String a, String b) => a == b); | |
3575 } | |
3576 return false; | |
3577 } | |
3578 | |
3579 @override | |
3580 int get hashCode { | |
3581 int hash = 0; | |
3582 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
3583 hash = JenkinsSmiHash.combine(hash, regions.hashCode); | |
3584 hash = JenkinsSmiHash.combine(hash, targets.hashCode); | |
3585 hash = JenkinsSmiHash.combine(hash, files.hashCode); | |
3586 return JenkinsSmiHash.finish(hash); | |
3587 } | |
3588 } | |
3589 | |
3590 /** | |
3591 * analysis.occurrences params | |
3592 * | |
3593 * { | |
3594 * "file": FilePath | |
3595 * "occurrences": List<Occurrences> | |
3596 * } | |
3597 * | |
3598 * Clients may not extend, implement or mix-in this class. | |
3599 */ | |
3600 class AnalysisOccurrencesParams implements HasToJson { | |
3601 String _file; | |
3602 | |
3603 List<Occurrences> _occurrences; | |
3604 | |
3605 /** | |
3606 * The file in which the references occur. | |
3607 */ | |
3608 String get file => _file; | |
3609 | |
3610 /** | |
3611 * The file in which the references occur. | |
3612 */ | |
3613 void set file(String value) { | |
3614 assert(value != null); | |
3615 this._file = value; | |
3616 } | |
3617 | |
3618 /** | |
3619 * The occurrences of references to elements within the file. | |
3620 */ | |
3621 List<Occurrences> get occurrences => _occurrences; | |
3622 | |
3623 /** | |
3624 * The occurrences of references to elements within the file. | |
3625 */ | |
3626 void set occurrences(List<Occurrences> value) { | |
3627 assert(value != null); | |
3628 this._occurrences = value; | |
3629 } | |
3630 | |
3631 AnalysisOccurrencesParams(String file, List<Occurrences> occurrences) { | |
3632 this.file = file; | |
3633 this.occurrences = occurrences; | |
3634 } | |
3635 | |
3636 factory AnalysisOccurrencesParams.fromJson( | |
3637 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
3638 if (json == null) { | |
3639 json = {}; | |
3640 } | |
3641 if (json is Map) { | |
3642 String file; | |
3643 if (json.containsKey("file")) { | |
3644 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
3645 } else { | |
3646 throw jsonDecoder.missingKey(jsonPath, "file"); | |
3647 } | |
3648 List<Occurrences> occurrences; | |
3649 if (json.containsKey("occurrences")) { | |
3650 occurrences = jsonDecoder.decodeList( | |
3651 jsonPath + ".occurrences", | |
3652 json["occurrences"], | |
3653 (String jsonPath, Object json) => | |
3654 new Occurrences.fromJson(jsonDecoder, jsonPath, json)); | |
3655 } else { | |
3656 throw jsonDecoder.missingKey(jsonPath, "occurrences"); | |
3657 } | |
3658 return new AnalysisOccurrencesParams(file, occurrences); | |
3659 } else { | |
3660 throw jsonDecoder.mismatch(jsonPath, "analysis.occurrences params", json); | |
3661 } | |
3662 } | |
3663 | |
3664 factory AnalysisOccurrencesParams.fromNotification( | |
3665 Notification notification) { | |
3666 return new AnalysisOccurrencesParams.fromJson( | |
3667 new ResponseDecoder(null), "params", notification._params); | |
3668 } | |
3669 | |
3670 Map<String, dynamic> toJson() { | |
3671 Map<String, dynamic> result = {}; | |
3672 result["file"] = file; | |
3673 result["occurrences"] = | |
3674 occurrences.map((Occurrences value) => value.toJson()).toList(); | |
3675 return result; | |
3676 } | |
3677 | |
3678 Notification toNotification() { | |
3679 return new Notification("analysis.occurrences", toJson()); | |
3680 } | |
3681 | |
3682 @override | |
3683 String toString() => JSON.encode(toJson()); | |
3684 | |
3685 @override | |
3686 bool operator ==(other) { | |
3687 if (other is AnalysisOccurrencesParams) { | |
3688 return file == other.file && | |
3689 listEqual(occurrences, other.occurrences, | |
3690 (Occurrences a, Occurrences b) => a == b); | |
3691 } | |
3692 return false; | |
3693 } | |
3694 | |
3695 @override | |
3696 int get hashCode { | |
3697 int hash = 0; | |
3698 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
3699 hash = JenkinsSmiHash.combine(hash, occurrences.hashCode); | |
3700 return JenkinsSmiHash.finish(hash); | |
3701 } | |
3702 } | |
3703 | |
3704 /** | |
3705 * analysis.outline params | |
3706 * | |
3707 * { | |
3708 * "file": FilePath | |
3709 * "kind": FileKind | |
3710 * "libraryName": optional String | |
3711 * "outline": Outline | |
3712 * } | |
3713 * | |
3714 * Clients may not extend, implement or mix-in this class. | |
3715 */ | |
3716 class AnalysisOutlineParams implements HasToJson { | |
3717 String _file; | |
3718 | |
3719 FileKind _kind; | |
3720 | |
3721 String _libraryName; | |
3722 | |
3723 Outline _outline; | |
3724 | |
3725 /** | |
3726 * The file with which the outline is associated. | |
3727 */ | |
3728 String get file => _file; | |
3729 | |
3730 /** | |
3731 * The file with which the outline is associated. | |
3732 */ | |
3733 void set file(String value) { | |
3734 assert(value != null); | |
3735 this._file = value; | |
3736 } | |
3737 | |
3738 /** | |
3739 * The kind of the file. | |
3740 */ | |
3741 FileKind get kind => _kind; | |
3742 | |
3743 /** | |
3744 * The kind of the file. | |
3745 */ | |
3746 void set kind(FileKind value) { | |
3747 assert(value != null); | |
3748 this._kind = value; | |
3749 } | |
3750 | |
3751 /** | |
3752 * The name of the library defined by the file using a "library" directive, | |
3753 * or referenced by a "part of" directive. If both "library" and "part of" | |
3754 * directives are present, then the "library" directive takes precedence. | |
3755 * This field will be omitted if the file has neither "library" nor "part of" | |
3756 * directives. | |
3757 */ | |
3758 String get libraryName => _libraryName; | |
3759 | |
3760 /** | |
3761 * The name of the library defined by the file using a "library" directive, | |
3762 * or referenced by a "part of" directive. If both "library" and "part of" | |
3763 * directives are present, then the "library" directive takes precedence. | |
3764 * This field will be omitted if the file has neither "library" nor "part of" | |
3765 * directives. | |
3766 */ | |
3767 void set libraryName(String value) { | |
3768 this._libraryName = value; | |
3769 } | |
3770 | |
3771 /** | |
3772 * The outline associated with the file. | |
3773 */ | |
3774 Outline get outline => _outline; | |
3775 | |
3776 /** | |
3777 * The outline associated with the file. | |
3778 */ | |
3779 void set outline(Outline value) { | |
3780 assert(value != null); | |
3781 this._outline = value; | |
3782 } | |
3783 | |
3784 AnalysisOutlineParams(String file, FileKind kind, Outline outline, | |
3785 {String libraryName}) { | |
3786 this.file = file; | |
3787 this.kind = kind; | |
3788 this.libraryName = libraryName; | |
3789 this.outline = outline; | |
3790 } | |
3791 | |
3792 factory AnalysisOutlineParams.fromJson( | |
3793 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
3794 if (json == null) { | |
3795 json = {}; | |
3796 } | |
3797 if (json is Map) { | |
3798 String file; | |
3799 if (json.containsKey("file")) { | |
3800 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
3801 } else { | |
3802 throw jsonDecoder.missingKey(jsonPath, "file"); | |
3803 } | |
3804 FileKind kind; | |
3805 if (json.containsKey("kind")) { | |
3806 kind = new FileKind.fromJson( | |
3807 jsonDecoder, jsonPath + ".kind", json["kind"]); | |
3808 } else { | |
3809 throw jsonDecoder.missingKey(jsonPath, "kind"); | |
3810 } | |
3811 String libraryName; | |
3812 if (json.containsKey("libraryName")) { | |
3813 libraryName = jsonDecoder.decodeString( | |
3814 jsonPath + ".libraryName", json["libraryName"]); | |
3815 } | |
3816 Outline outline; | |
3817 if (json.containsKey("outline")) { | |
3818 outline = new Outline.fromJson( | |
3819 jsonDecoder, jsonPath + ".outline", json["outline"]); | |
3820 } else { | |
3821 throw jsonDecoder.missingKey(jsonPath, "outline"); | |
3822 } | |
3823 return new AnalysisOutlineParams(file, kind, outline, | |
3824 libraryName: libraryName); | |
3825 } else { | |
3826 throw jsonDecoder.mismatch(jsonPath, "analysis.outline params", json); | |
3827 } | |
3828 } | |
3829 | |
3830 factory AnalysisOutlineParams.fromNotification(Notification notification) { | |
3831 return new AnalysisOutlineParams.fromJson( | |
3832 new ResponseDecoder(null), "params", notification._params); | |
3833 } | |
3834 | |
3835 Map<String, dynamic> toJson() { | |
3836 Map<String, dynamic> result = {}; | |
3837 result["file"] = file; | |
3838 result["kind"] = kind.toJson(); | |
3839 if (libraryName != null) { | |
3840 result["libraryName"] = libraryName; | |
3841 } | |
3842 result["outline"] = outline.toJson(); | |
3843 return result; | |
3844 } | |
3845 | |
3846 Notification toNotification() { | |
3847 return new Notification("analysis.outline", toJson()); | |
3848 } | |
3849 | |
3850 @override | |
3851 String toString() => JSON.encode(toJson()); | |
3852 | |
3853 @override | |
3854 bool operator ==(other) { | |
3855 if (other is AnalysisOutlineParams) { | |
3856 return file == other.file && | |
3857 kind == other.kind && | |
3858 libraryName == other.libraryName && | |
3859 outline == other.outline; | |
3860 } | |
3861 return false; | |
3862 } | |
3863 | |
3864 @override | |
3865 int get hashCode { | |
3866 int hash = 0; | |
3867 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
3868 hash = JenkinsSmiHash.combine(hash, kind.hashCode); | |
3869 hash = JenkinsSmiHash.combine(hash, libraryName.hashCode); | |
3870 hash = JenkinsSmiHash.combine(hash, outline.hashCode); | |
3871 return JenkinsSmiHash.finish(hash); | |
3872 } | |
3873 } | |
3874 | |
3875 /** | |
3876 * analysis.overrides params | |
3877 * | |
3878 * { | |
3879 * "file": FilePath | |
3880 * "overrides": List<Override> | |
3881 * } | |
3882 * | |
3883 * Clients may not extend, implement or mix-in this class. | |
3884 */ | |
3885 class AnalysisOverridesParams implements HasToJson { | |
3886 String _file; | |
3887 | |
3888 List<Override> _overrides; | |
3889 | |
3890 /** | |
3891 * The file with which the overrides are associated. | |
3892 */ | |
3893 String get file => _file; | |
3894 | |
3895 /** | |
3896 * The file with which the overrides are associated. | |
3897 */ | |
3898 void set file(String value) { | |
3899 assert(value != null); | |
3900 this._file = value; | |
3901 } | |
3902 | |
3903 /** | |
3904 * The overrides associated with the file. | |
3905 */ | |
3906 List<Override> get overrides => _overrides; | |
3907 | |
3908 /** | |
3909 * The overrides associated with the file. | |
3910 */ | |
3911 void set overrides(List<Override> value) { | |
3912 assert(value != null); | |
3913 this._overrides = value; | |
3914 } | |
3915 | |
3916 AnalysisOverridesParams(String file, List<Override> overrides) { | |
3917 this.file = file; | |
3918 this.overrides = overrides; | |
3919 } | |
3920 | |
3921 factory AnalysisOverridesParams.fromJson( | |
3922 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
3923 if (json == null) { | |
3924 json = {}; | |
3925 } | |
3926 if (json is Map) { | |
3927 String file; | |
3928 if (json.containsKey("file")) { | |
3929 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
3930 } else { | |
3931 throw jsonDecoder.missingKey(jsonPath, "file"); | |
3932 } | |
3933 List<Override> overrides; | |
3934 if (json.containsKey("overrides")) { | |
3935 overrides = jsonDecoder.decodeList( | |
3936 jsonPath + ".overrides", | |
3937 json["overrides"], | |
3938 (String jsonPath, Object json) => | |
3939 new Override.fromJson(jsonDecoder, jsonPath, json)); | |
3940 } else { | |
3941 throw jsonDecoder.missingKey(jsonPath, "overrides"); | |
3942 } | |
3943 return new AnalysisOverridesParams(file, overrides); | |
3944 } else { | |
3945 throw jsonDecoder.mismatch(jsonPath, "analysis.overrides params", json); | |
3946 } | |
3947 } | |
3948 | |
3949 factory AnalysisOverridesParams.fromNotification(Notification notification) { | |
3950 return new AnalysisOverridesParams.fromJson( | |
3951 new ResponseDecoder(null), "params", notification._params); | |
3952 } | |
3953 | |
3954 Map<String, dynamic> toJson() { | |
3955 Map<String, dynamic> result = {}; | |
3956 result["file"] = file; | |
3957 result["overrides"] = | |
3958 overrides.map((Override value) => value.toJson()).toList(); | |
3959 return result; | |
3960 } | |
3961 | |
3962 Notification toNotification() { | |
3963 return new Notification("analysis.overrides", toJson()); | |
3964 } | |
3965 | |
3966 @override | |
3967 String toString() => JSON.encode(toJson()); | |
3968 | |
3969 @override | |
3970 bool operator ==(other) { | |
3971 if (other is AnalysisOverridesParams) { | |
3972 return file == other.file && | |
3973 listEqual( | |
3974 overrides, other.overrides, (Override a, Override b) => a == b); | |
3975 } | |
3976 return false; | |
3977 } | |
3978 | |
3979 @override | |
3980 int get hashCode { | |
3981 int hash = 0; | |
3982 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
3983 hash = JenkinsSmiHash.combine(hash, overrides.hashCode); | |
3984 return JenkinsSmiHash.finish(hash); | |
3985 } | |
3986 } | |
3987 | |
3988 /** | |
3989 * completion.getSuggestions params | |
3990 * | |
3991 * { | |
3992 * "file": FilePath | |
3993 * "offset": int | |
3994 * } | |
3995 * | |
3996 * Clients may not extend, implement or mix-in this class. | |
3997 */ | |
3998 class CompletionGetSuggestionsParams implements HasToJson { | |
3999 String _file; | |
4000 | |
4001 int _offset; | |
4002 | |
4003 /** | |
4004 * The file containing the point at which suggestions are to be made. | |
4005 */ | |
4006 String get file => _file; | |
4007 | |
4008 /** | |
4009 * The file containing the point at which suggestions are to be made. | |
4010 */ | |
4011 void set file(String value) { | |
4012 assert(value != null); | |
4013 this._file = value; | |
4014 } | |
4015 | |
4016 /** | |
4017 * The offset within the file at which suggestions are to be made. | |
4018 */ | |
4019 int get offset => _offset; | |
4020 | |
4021 /** | |
4022 * The offset within the file at which suggestions are to be made. | |
4023 */ | |
4024 void set offset(int value) { | |
4025 assert(value != null); | |
4026 this._offset = value; | |
4027 } | |
4028 | |
4029 CompletionGetSuggestionsParams(String file, int offset) { | |
4030 this.file = file; | |
4031 this.offset = offset; | |
4032 } | |
4033 | |
4034 factory CompletionGetSuggestionsParams.fromJson( | |
4035 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
4036 if (json == null) { | |
4037 json = {}; | |
4038 } | |
4039 if (json is Map) { | |
4040 String file; | |
4041 if (json.containsKey("file")) { | |
4042 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
4043 } else { | |
4044 throw jsonDecoder.missingKey(jsonPath, "file"); | |
4045 } | |
4046 int offset; | |
4047 if (json.containsKey("offset")) { | |
4048 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
4049 } else { | |
4050 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
4051 } | |
4052 return new CompletionGetSuggestionsParams(file, offset); | |
4053 } else { | |
4054 throw jsonDecoder.mismatch( | |
4055 jsonPath, "completion.getSuggestions params", json); | |
4056 } | |
4057 } | |
4058 | |
4059 factory CompletionGetSuggestionsParams.fromRequest(Request request) { | |
4060 return new CompletionGetSuggestionsParams.fromJson( | |
4061 new RequestDecoder(request), "params", request._params); | |
4062 } | |
4063 | |
4064 Map<String, dynamic> toJson() { | |
4065 Map<String, dynamic> result = {}; | |
4066 result["file"] = file; | |
4067 result["offset"] = offset; | |
4068 return result; | |
4069 } | |
4070 | |
4071 Request toRequest(String id) { | |
4072 return new Request(id, "completion.getSuggestions", toJson()); | |
4073 } | |
4074 | |
4075 @override | |
4076 String toString() => JSON.encode(toJson()); | |
4077 | |
4078 @override | |
4079 bool operator ==(other) { | |
4080 if (other is CompletionGetSuggestionsParams) { | |
4081 return file == other.file && offset == other.offset; | |
4082 } | |
4083 return false; | |
4084 } | |
4085 | |
4086 @override | |
4087 int get hashCode { | |
4088 int hash = 0; | |
4089 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
4090 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
4091 return JenkinsSmiHash.finish(hash); | |
4092 } | |
4093 } | |
4094 | |
4095 /** | |
4096 * completion.getSuggestions result | |
4097 * | |
4098 * { | |
4099 * "id": CompletionId | |
4100 * } | |
4101 * | |
4102 * Clients may not extend, implement or mix-in this class. | |
4103 */ | |
4104 class CompletionGetSuggestionsResult implements HasToJson { | |
4105 String _id; | |
4106 | |
4107 /** | |
4108 * The identifier used to associate results with this completion request. | |
4109 */ | |
4110 String get id => _id; | |
4111 | |
4112 /** | |
4113 * The identifier used to associate results with this completion request. | |
4114 */ | |
4115 void set id(String value) { | |
4116 assert(value != null); | |
4117 this._id = value; | |
4118 } | |
4119 | |
4120 CompletionGetSuggestionsResult(String id) { | |
4121 this.id = id; | |
4122 } | |
4123 | |
4124 factory CompletionGetSuggestionsResult.fromJson( | |
4125 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
4126 if (json == null) { | |
4127 json = {}; | |
4128 } | |
4129 if (json is Map) { | |
4130 String id; | |
4131 if (json.containsKey("id")) { | |
4132 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); | |
4133 } else { | |
4134 throw jsonDecoder.missingKey(jsonPath, "id"); | |
4135 } | |
4136 return new CompletionGetSuggestionsResult(id); | |
4137 } else { | |
4138 throw jsonDecoder.mismatch( | |
4139 jsonPath, "completion.getSuggestions result", json); | |
4140 } | |
4141 } | |
4142 | |
4143 factory CompletionGetSuggestionsResult.fromResponse(Response response) { | |
4144 return new CompletionGetSuggestionsResult.fromJson( | |
4145 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
4146 "result", | |
4147 response._result); | |
4148 } | |
4149 | |
4150 Map<String, dynamic> toJson() { | |
4151 Map<String, dynamic> result = {}; | |
4152 result["id"] = id; | |
4153 return result; | |
4154 } | |
4155 | |
4156 Response toResponse(String id) { | |
4157 return new Response(id, result: toJson()); | |
4158 } | |
4159 | |
4160 @override | |
4161 String toString() => JSON.encode(toJson()); | |
4162 | |
4163 @override | |
4164 bool operator ==(other) { | |
4165 if (other is CompletionGetSuggestionsResult) { | |
4166 return id == other.id; | |
4167 } | |
4168 return false; | |
4169 } | |
4170 | |
4171 @override | |
4172 int get hashCode { | |
4173 int hash = 0; | |
4174 hash = JenkinsSmiHash.combine(hash, id.hashCode); | |
4175 return JenkinsSmiHash.finish(hash); | |
4176 } | |
4177 } | |
4178 | |
4179 /** | |
4180 * completion.results params | |
4181 * | |
4182 * { | |
4183 * "id": CompletionId | |
4184 * "replacementOffset": int | |
4185 * "replacementLength": int | |
4186 * "results": List<CompletionSuggestion> | |
4187 * "isLast": bool | |
4188 * } | |
4189 * | |
4190 * Clients may not extend, implement or mix-in this class. | |
4191 */ | |
4192 class CompletionResultsParams implements HasToJson { | |
4193 String _id; | |
4194 | |
4195 int _replacementOffset; | |
4196 | |
4197 int _replacementLength; | |
4198 | |
4199 List<CompletionSuggestion> _results; | |
4200 | |
4201 bool _isLast; | |
4202 | |
4203 /** | |
4204 * The id associated with the completion. | |
4205 */ | |
4206 String get id => _id; | |
4207 | |
4208 /** | |
4209 * The id associated with the completion. | |
4210 */ | |
4211 void set id(String value) { | |
4212 assert(value != null); | |
4213 this._id = value; | |
4214 } | |
4215 | |
4216 /** | |
4217 * The offset of the start of the text to be replaced. This will be different | |
4218 * than the offset used to request the completion suggestions if there was a | |
4219 * portion of an identifier before the original offset. In particular, the | |
4220 * replacementOffset will be the offset of the beginning of said identifier. | |
4221 */ | |
4222 int get replacementOffset => _replacementOffset; | |
4223 | |
4224 /** | |
4225 * The offset of the start of the text to be replaced. This will be different | |
4226 * than the offset used to request the completion suggestions if there was a | |
4227 * portion of an identifier before the original offset. In particular, the | |
4228 * replacementOffset will be the offset of the beginning of said identifier. | |
4229 */ | |
4230 void set replacementOffset(int value) { | |
4231 assert(value != null); | |
4232 this._replacementOffset = value; | |
4233 } | |
4234 | |
4235 /** | |
4236 * The length of the text to be replaced if the remainder of the identifier | |
4237 * containing the cursor is to be replaced when the suggestion is applied | |
4238 * (that is, the number of characters in the existing identifier). | |
4239 */ | |
4240 int get replacementLength => _replacementLength; | |
4241 | |
4242 /** | |
4243 * The length of the text to be replaced if the remainder of the identifier | |
4244 * containing the cursor is to be replaced when the suggestion is applied | |
4245 * (that is, the number of characters in the existing identifier). | |
4246 */ | |
4247 void set replacementLength(int value) { | |
4248 assert(value != null); | |
4249 this._replacementLength = value; | |
4250 } | |
4251 | |
4252 /** | |
4253 * The completion suggestions being reported. The notification contains all | |
4254 * possible completions at the requested cursor position, even those that do | |
4255 * not match the characters the user has already typed. This allows the | |
4256 * client to respond to further keystrokes from the user without having to | |
4257 * make additional requests. | |
4258 */ | |
4259 List<CompletionSuggestion> get results => _results; | |
4260 | |
4261 /** | |
4262 * The completion suggestions being reported. The notification contains all | |
4263 * possible completions at the requested cursor position, even those that do | |
4264 * not match the characters the user has already typed. This allows the | |
4265 * client to respond to further keystrokes from the user without having to | |
4266 * make additional requests. | |
4267 */ | |
4268 void set results(List<CompletionSuggestion> value) { | |
4269 assert(value != null); | |
4270 this._results = value; | |
4271 } | |
4272 | |
4273 /** | |
4274 * True if this is that last set of results that will be returned for the | |
4275 * indicated completion. | |
4276 */ | |
4277 bool get isLast => _isLast; | |
4278 | |
4279 /** | |
4280 * True if this is that last set of results that will be returned for the | |
4281 * indicated completion. | |
4282 */ | |
4283 void set isLast(bool value) { | |
4284 assert(value != null); | |
4285 this._isLast = value; | |
4286 } | |
4287 | |
4288 CompletionResultsParams(String id, int replacementOffset, | |
4289 int replacementLength, List<CompletionSuggestion> results, bool isLast) { | |
4290 this.id = id; | |
4291 this.replacementOffset = replacementOffset; | |
4292 this.replacementLength = replacementLength; | |
4293 this.results = results; | |
4294 this.isLast = isLast; | |
4295 } | |
4296 | |
4297 factory CompletionResultsParams.fromJson( | |
4298 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
4299 if (json == null) { | |
4300 json = {}; | |
4301 } | |
4302 if (json is Map) { | |
4303 String id; | |
4304 if (json.containsKey("id")) { | |
4305 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); | |
4306 } else { | |
4307 throw jsonDecoder.missingKey(jsonPath, "id"); | |
4308 } | |
4309 int replacementOffset; | |
4310 if (json.containsKey("replacementOffset")) { | |
4311 replacementOffset = jsonDecoder.decodeInt( | |
4312 jsonPath + ".replacementOffset", json["replacementOffset"]); | |
4313 } else { | |
4314 throw jsonDecoder.missingKey(jsonPath, "replacementOffset"); | |
4315 } | |
4316 int replacementLength; | |
4317 if (json.containsKey("replacementLength")) { | |
4318 replacementLength = jsonDecoder.decodeInt( | |
4319 jsonPath + ".replacementLength", json["replacementLength"]); | |
4320 } else { | |
4321 throw jsonDecoder.missingKey(jsonPath, "replacementLength"); | |
4322 } | |
4323 List<CompletionSuggestion> results; | |
4324 if (json.containsKey("results")) { | |
4325 results = jsonDecoder.decodeList( | |
4326 jsonPath + ".results", | |
4327 json["results"], | |
4328 (String jsonPath, Object json) => | |
4329 new CompletionSuggestion.fromJson(jsonDecoder, jsonPath, json)); | |
4330 } else { | |
4331 throw jsonDecoder.missingKey(jsonPath, "results"); | |
4332 } | |
4333 bool isLast; | |
4334 if (json.containsKey("isLast")) { | |
4335 isLast = jsonDecoder.decodeBool(jsonPath + ".isLast", json["isLast"]); | |
4336 } else { | |
4337 throw jsonDecoder.missingKey(jsonPath, "isLast"); | |
4338 } | |
4339 return new CompletionResultsParams( | |
4340 id, replacementOffset, replacementLength, results, isLast); | |
4341 } else { | |
4342 throw jsonDecoder.mismatch(jsonPath, "completion.results params", json); | |
4343 } | |
4344 } | |
4345 | |
4346 factory CompletionResultsParams.fromNotification(Notification notification) { | |
4347 return new CompletionResultsParams.fromJson( | |
4348 new ResponseDecoder(null), "params", notification._params); | |
4349 } | |
4350 | |
4351 Map<String, dynamic> toJson() { | |
4352 Map<String, dynamic> result = {}; | |
4353 result["id"] = id; | |
4354 result["replacementOffset"] = replacementOffset; | |
4355 result["replacementLength"] = replacementLength; | |
4356 result["results"] = | |
4357 results.map((CompletionSuggestion value) => value.toJson()).toList(); | |
4358 result["isLast"] = isLast; | |
4359 return result; | |
4360 } | |
4361 | |
4362 Notification toNotification() { | |
4363 return new Notification("completion.results", toJson()); | |
4364 } | |
4365 | |
4366 @override | |
4367 String toString() => JSON.encode(toJson()); | |
4368 | |
4369 @override | |
4370 bool operator ==(other) { | |
4371 if (other is CompletionResultsParams) { | |
4372 return id == other.id && | |
4373 replacementOffset == other.replacementOffset && | |
4374 replacementLength == other.replacementLength && | |
4375 listEqual(results, other.results, | |
4376 (CompletionSuggestion a, CompletionSuggestion b) => a == b) && | |
4377 isLast == other.isLast; | |
4378 } | |
4379 return false; | |
4380 } | |
4381 | |
4382 @override | |
4383 int get hashCode { | |
4384 int hash = 0; | |
4385 hash = JenkinsSmiHash.combine(hash, id.hashCode); | |
4386 hash = JenkinsSmiHash.combine(hash, replacementOffset.hashCode); | |
4387 hash = JenkinsSmiHash.combine(hash, replacementLength.hashCode); | |
4388 hash = JenkinsSmiHash.combine(hash, results.hashCode); | |
4389 hash = JenkinsSmiHash.combine(hash, isLast.hashCode); | |
4390 return JenkinsSmiHash.finish(hash); | |
4391 } | |
4392 } | |
4393 | |
4394 /** | |
4395 * search.findElementReferences params | |
4396 * | |
4397 * { | |
4398 * "file": FilePath | |
4399 * "offset": int | |
4400 * "includePotential": bool | |
4401 * } | |
4402 * | |
4403 * Clients may not extend, implement or mix-in this class. | |
4404 */ | |
4405 class SearchFindElementReferencesParams implements HasToJson { | |
4406 String _file; | |
4407 | |
4408 int _offset; | |
4409 | |
4410 bool _includePotential; | |
4411 | |
4412 /** | |
4413 * The file containing the declaration of or reference to the element used to | |
4414 * define the search. | |
4415 */ | |
4416 String get file => _file; | |
4417 | |
4418 /** | |
4419 * The file containing the declaration of or reference to the element used to | |
4420 * define the search. | |
4421 */ | |
4422 void set file(String value) { | |
4423 assert(value != null); | |
4424 this._file = value; | |
4425 } | |
4426 | |
4427 /** | |
4428 * The offset within the file of the declaration of or reference to the | |
4429 * element. | |
4430 */ | |
4431 int get offset => _offset; | |
4432 | |
4433 /** | |
4434 * The offset within the file of the declaration of or reference to the | |
4435 * element. | |
4436 */ | |
4437 void set offset(int value) { | |
4438 assert(value != null); | |
4439 this._offset = value; | |
4440 } | |
4441 | |
4442 /** | |
4443 * True if potential matches are to be included in the results. | |
4444 */ | |
4445 bool get includePotential => _includePotential; | |
4446 | |
4447 /** | |
4448 * True if potential matches are to be included in the results. | |
4449 */ | |
4450 void set includePotential(bool value) { | |
4451 assert(value != null); | |
4452 this._includePotential = value; | |
4453 } | |
4454 | |
4455 SearchFindElementReferencesParams( | |
4456 String file, int offset, bool includePotential) { | |
4457 this.file = file; | |
4458 this.offset = offset; | |
4459 this.includePotential = includePotential; | |
4460 } | |
4461 | |
4462 factory SearchFindElementReferencesParams.fromJson( | |
4463 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
4464 if (json == null) { | |
4465 json = {}; | |
4466 } | |
4467 if (json is Map) { | |
4468 String file; | |
4469 if (json.containsKey("file")) { | |
4470 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
4471 } else { | |
4472 throw jsonDecoder.missingKey(jsonPath, "file"); | |
4473 } | |
4474 int offset; | |
4475 if (json.containsKey("offset")) { | |
4476 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
4477 } else { | |
4478 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
4479 } | |
4480 bool includePotential; | |
4481 if (json.containsKey("includePotential")) { | |
4482 includePotential = jsonDecoder.decodeBool( | |
4483 jsonPath + ".includePotential", json["includePotential"]); | |
4484 } else { | |
4485 throw jsonDecoder.missingKey(jsonPath, "includePotential"); | |
4486 } | |
4487 return new SearchFindElementReferencesParams( | |
4488 file, offset, includePotential); | |
4489 } else { | |
4490 throw jsonDecoder.mismatch( | |
4491 jsonPath, "search.findElementReferences params", json); | |
4492 } | |
4493 } | |
4494 | |
4495 factory SearchFindElementReferencesParams.fromRequest(Request request) { | |
4496 return new SearchFindElementReferencesParams.fromJson( | |
4497 new RequestDecoder(request), "params", request._params); | |
4498 } | |
4499 | |
4500 Map<String, dynamic> toJson() { | |
4501 Map<String, dynamic> result = {}; | |
4502 result["file"] = file; | |
4503 result["offset"] = offset; | |
4504 result["includePotential"] = includePotential; | |
4505 return result; | |
4506 } | |
4507 | |
4508 Request toRequest(String id) { | |
4509 return new Request(id, "search.findElementReferences", toJson()); | |
4510 } | |
4511 | |
4512 @override | |
4513 String toString() => JSON.encode(toJson()); | |
4514 | |
4515 @override | |
4516 bool operator ==(other) { | |
4517 if (other is SearchFindElementReferencesParams) { | |
4518 return file == other.file && | |
4519 offset == other.offset && | |
4520 includePotential == other.includePotential; | |
4521 } | |
4522 return false; | |
4523 } | |
4524 | |
4525 @override | |
4526 int get hashCode { | |
4527 int hash = 0; | |
4528 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
4529 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
4530 hash = JenkinsSmiHash.combine(hash, includePotential.hashCode); | |
4531 return JenkinsSmiHash.finish(hash); | |
4532 } | |
4533 } | |
4534 | |
4535 /** | |
4536 * search.findElementReferences result | |
4537 * | |
4538 * { | |
4539 * "id": optional SearchId | |
4540 * "element": optional Element | |
4541 * } | |
4542 * | |
4543 * Clients may not extend, implement or mix-in this class. | |
4544 */ | |
4545 class SearchFindElementReferencesResult implements HasToJson { | |
4546 String _id; | |
4547 | |
4548 Element _element; | |
4549 | |
4550 /** | |
4551 * The identifier used to associate results with this search request. | |
4552 * | |
4553 * If no element was found at the given location, this field will be absent, | |
4554 * and no results will be reported via the search.results notification. | |
4555 */ | |
4556 String get id => _id; | |
4557 | |
4558 /** | |
4559 * The identifier used to associate results with this search request. | |
4560 * | |
4561 * If no element was found at the given location, this field will be absent, | |
4562 * and no results will be reported via the search.results notification. | |
4563 */ | |
4564 void set id(String value) { | |
4565 this._id = value; | |
4566 } | |
4567 | |
4568 /** | |
4569 * The element referenced or defined at the given offset and whose references | |
4570 * will be returned in the search results. | |
4571 * | |
4572 * If no element was found at the given location, this field will be absent. | |
4573 */ | |
4574 Element get element => _element; | |
4575 | |
4576 /** | |
4577 * The element referenced or defined at the given offset and whose references | |
4578 * will be returned in the search results. | |
4579 * | |
4580 * If no element was found at the given location, this field will be absent. | |
4581 */ | |
4582 void set element(Element value) { | |
4583 this._element = value; | |
4584 } | |
4585 | |
4586 SearchFindElementReferencesResult({String id, Element element}) { | |
4587 this.id = id; | |
4588 this.element = element; | |
4589 } | |
4590 | |
4591 factory SearchFindElementReferencesResult.fromJson( | |
4592 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
4593 if (json == null) { | |
4594 json = {}; | |
4595 } | |
4596 if (json is Map) { | |
4597 String id; | |
4598 if (json.containsKey("id")) { | |
4599 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); | |
4600 } | |
4601 Element element; | |
4602 if (json.containsKey("element")) { | |
4603 element = new Element.fromJson( | |
4604 jsonDecoder, jsonPath + ".element", json["element"]); | |
4605 } | |
4606 return new SearchFindElementReferencesResult(id: id, element: element); | |
4607 } else { | |
4608 throw jsonDecoder.mismatch( | |
4609 jsonPath, "search.findElementReferences result", json); | |
4610 } | |
4611 } | |
4612 | |
4613 factory SearchFindElementReferencesResult.fromResponse(Response response) { | |
4614 return new SearchFindElementReferencesResult.fromJson( | |
4615 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
4616 "result", | |
4617 response._result); | |
4618 } | |
4619 | |
4620 Map<String, dynamic> toJson() { | |
4621 Map<String, dynamic> result = {}; | |
4622 if (id != null) { | |
4623 result["id"] = id; | |
4624 } | |
4625 if (element != null) { | |
4626 result["element"] = element.toJson(); | |
4627 } | |
4628 return result; | |
4629 } | |
4630 | |
4631 Response toResponse(String id) { | |
4632 return new Response(id, result: toJson()); | |
4633 } | |
4634 | |
4635 @override | |
4636 String toString() => JSON.encode(toJson()); | |
4637 | |
4638 @override | |
4639 bool operator ==(other) { | |
4640 if (other is SearchFindElementReferencesResult) { | |
4641 return id == other.id && element == other.element; | |
4642 } | |
4643 return false; | |
4644 } | |
4645 | |
4646 @override | |
4647 int get hashCode { | |
4648 int hash = 0; | |
4649 hash = JenkinsSmiHash.combine(hash, id.hashCode); | |
4650 hash = JenkinsSmiHash.combine(hash, element.hashCode); | |
4651 return JenkinsSmiHash.finish(hash); | |
4652 } | |
4653 } | |
4654 | |
4655 /** | |
4656 * search.findMemberDeclarations params | |
4657 * | |
4658 * { | |
4659 * "name": String | |
4660 * } | |
4661 * | |
4662 * Clients may not extend, implement or mix-in this class. | |
4663 */ | |
4664 class SearchFindMemberDeclarationsParams implements HasToJson { | |
4665 String _name; | |
4666 | |
4667 /** | |
4668 * The name of the declarations to be found. | |
4669 */ | |
4670 String get name => _name; | |
4671 | |
4672 /** | |
4673 * The name of the declarations to be found. | |
4674 */ | |
4675 void set name(String value) { | |
4676 assert(value != null); | |
4677 this._name = value; | |
4678 } | |
4679 | |
4680 SearchFindMemberDeclarationsParams(String name) { | |
4681 this.name = name; | |
4682 } | |
4683 | |
4684 factory SearchFindMemberDeclarationsParams.fromJson( | |
4685 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
4686 if (json == null) { | |
4687 json = {}; | |
4688 } | |
4689 if (json is Map) { | |
4690 String name; | |
4691 if (json.containsKey("name")) { | |
4692 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]); | |
4693 } else { | |
4694 throw jsonDecoder.missingKey(jsonPath, "name"); | |
4695 } | |
4696 return new SearchFindMemberDeclarationsParams(name); | |
4697 } else { | |
4698 throw jsonDecoder.mismatch( | |
4699 jsonPath, "search.findMemberDeclarations params", json); | |
4700 } | |
4701 } | |
4702 | |
4703 factory SearchFindMemberDeclarationsParams.fromRequest(Request request) { | |
4704 return new SearchFindMemberDeclarationsParams.fromJson( | |
4705 new RequestDecoder(request), "params", request._params); | |
4706 } | |
4707 | |
4708 Map<String, dynamic> toJson() { | |
4709 Map<String, dynamic> result = {}; | |
4710 result["name"] = name; | |
4711 return result; | |
4712 } | |
4713 | |
4714 Request toRequest(String id) { | |
4715 return new Request(id, "search.findMemberDeclarations", toJson()); | |
4716 } | |
4717 | |
4718 @override | |
4719 String toString() => JSON.encode(toJson()); | |
4720 | |
4721 @override | |
4722 bool operator ==(other) { | |
4723 if (other is SearchFindMemberDeclarationsParams) { | |
4724 return name == other.name; | |
4725 } | |
4726 return false; | |
4727 } | |
4728 | |
4729 @override | |
4730 int get hashCode { | |
4731 int hash = 0; | |
4732 hash = JenkinsSmiHash.combine(hash, name.hashCode); | |
4733 return JenkinsSmiHash.finish(hash); | |
4734 } | |
4735 } | |
4736 | |
4737 /** | |
4738 * search.findMemberDeclarations result | |
4739 * | |
4740 * { | |
4741 * "id": SearchId | |
4742 * } | |
4743 * | |
4744 * Clients may not extend, implement or mix-in this class. | |
4745 */ | |
4746 class SearchFindMemberDeclarationsResult implements HasToJson { | |
4747 String _id; | |
4748 | |
4749 /** | |
4750 * The identifier used to associate results with this search request. | |
4751 */ | |
4752 String get id => _id; | |
4753 | |
4754 /** | |
4755 * The identifier used to associate results with this search request. | |
4756 */ | |
4757 void set id(String value) { | |
4758 assert(value != null); | |
4759 this._id = value; | |
4760 } | |
4761 | |
4762 SearchFindMemberDeclarationsResult(String id) { | |
4763 this.id = id; | |
4764 } | |
4765 | |
4766 factory SearchFindMemberDeclarationsResult.fromJson( | |
4767 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
4768 if (json == null) { | |
4769 json = {}; | |
4770 } | |
4771 if (json is Map) { | |
4772 String id; | |
4773 if (json.containsKey("id")) { | |
4774 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); | |
4775 } else { | |
4776 throw jsonDecoder.missingKey(jsonPath, "id"); | |
4777 } | |
4778 return new SearchFindMemberDeclarationsResult(id); | |
4779 } else { | |
4780 throw jsonDecoder.mismatch( | |
4781 jsonPath, "search.findMemberDeclarations result", json); | |
4782 } | |
4783 } | |
4784 | |
4785 factory SearchFindMemberDeclarationsResult.fromResponse(Response response) { | |
4786 return new SearchFindMemberDeclarationsResult.fromJson( | |
4787 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
4788 "result", | |
4789 response._result); | |
4790 } | |
4791 | |
4792 Map<String, dynamic> toJson() { | |
4793 Map<String, dynamic> result = {}; | |
4794 result["id"] = id; | |
4795 return result; | |
4796 } | |
4797 | |
4798 Response toResponse(String id) { | |
4799 return new Response(id, result: toJson()); | |
4800 } | |
4801 | |
4802 @override | |
4803 String toString() => JSON.encode(toJson()); | |
4804 | |
4805 @override | |
4806 bool operator ==(other) { | |
4807 if (other is SearchFindMemberDeclarationsResult) { | |
4808 return id == other.id; | |
4809 } | |
4810 return false; | |
4811 } | |
4812 | |
4813 @override | |
4814 int get hashCode { | |
4815 int hash = 0; | |
4816 hash = JenkinsSmiHash.combine(hash, id.hashCode); | |
4817 return JenkinsSmiHash.finish(hash); | |
4818 } | |
4819 } | |
4820 | |
4821 /** | |
4822 * search.findMemberReferences params | |
4823 * | |
4824 * { | |
4825 * "name": String | |
4826 * } | |
4827 * | |
4828 * Clients may not extend, implement or mix-in this class. | |
4829 */ | |
4830 class SearchFindMemberReferencesParams implements HasToJson { | |
4831 String _name; | |
4832 | |
4833 /** | |
4834 * The name of the references to be found. | |
4835 */ | |
4836 String get name => _name; | |
4837 | |
4838 /** | |
4839 * The name of the references to be found. | |
4840 */ | |
4841 void set name(String value) { | |
4842 assert(value != null); | |
4843 this._name = value; | |
4844 } | |
4845 | |
4846 SearchFindMemberReferencesParams(String name) { | |
4847 this.name = name; | |
4848 } | |
4849 | |
4850 factory SearchFindMemberReferencesParams.fromJson( | |
4851 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
4852 if (json == null) { | |
4853 json = {}; | |
4854 } | |
4855 if (json is Map) { | |
4856 String name; | |
4857 if (json.containsKey("name")) { | |
4858 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]); | |
4859 } else { | |
4860 throw jsonDecoder.missingKey(jsonPath, "name"); | |
4861 } | |
4862 return new SearchFindMemberReferencesParams(name); | |
4863 } else { | |
4864 throw jsonDecoder.mismatch( | |
4865 jsonPath, "search.findMemberReferences params", json); | |
4866 } | |
4867 } | |
4868 | |
4869 factory SearchFindMemberReferencesParams.fromRequest(Request request) { | |
4870 return new SearchFindMemberReferencesParams.fromJson( | |
4871 new RequestDecoder(request), "params", request._params); | |
4872 } | |
4873 | |
4874 Map<String, dynamic> toJson() { | |
4875 Map<String, dynamic> result = {}; | |
4876 result["name"] = name; | |
4877 return result; | |
4878 } | |
4879 | |
4880 Request toRequest(String id) { | |
4881 return new Request(id, "search.findMemberReferences", toJson()); | |
4882 } | |
4883 | |
4884 @override | |
4885 String toString() => JSON.encode(toJson()); | |
4886 | |
4887 @override | |
4888 bool operator ==(other) { | |
4889 if (other is SearchFindMemberReferencesParams) { | |
4890 return name == other.name; | |
4891 } | |
4892 return false; | |
4893 } | |
4894 | |
4895 @override | |
4896 int get hashCode { | |
4897 int hash = 0; | |
4898 hash = JenkinsSmiHash.combine(hash, name.hashCode); | |
4899 return JenkinsSmiHash.finish(hash); | |
4900 } | |
4901 } | |
4902 | |
4903 /** | |
4904 * search.findMemberReferences result | |
4905 * | |
4906 * { | |
4907 * "id": SearchId | |
4908 * } | |
4909 * | |
4910 * Clients may not extend, implement or mix-in this class. | |
4911 */ | |
4912 class SearchFindMemberReferencesResult implements HasToJson { | |
4913 String _id; | |
4914 | |
4915 /** | |
4916 * The identifier used to associate results with this search request. | |
4917 */ | |
4918 String get id => _id; | |
4919 | |
4920 /** | |
4921 * The identifier used to associate results with this search request. | |
4922 */ | |
4923 void set id(String value) { | |
4924 assert(value != null); | |
4925 this._id = value; | |
4926 } | |
4927 | |
4928 SearchFindMemberReferencesResult(String id) { | |
4929 this.id = id; | |
4930 } | |
4931 | |
4932 factory SearchFindMemberReferencesResult.fromJson( | |
4933 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
4934 if (json == null) { | |
4935 json = {}; | |
4936 } | |
4937 if (json is Map) { | |
4938 String id; | |
4939 if (json.containsKey("id")) { | |
4940 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); | |
4941 } else { | |
4942 throw jsonDecoder.missingKey(jsonPath, "id"); | |
4943 } | |
4944 return new SearchFindMemberReferencesResult(id); | |
4945 } else { | |
4946 throw jsonDecoder.mismatch( | |
4947 jsonPath, "search.findMemberReferences result", json); | |
4948 } | |
4949 } | |
4950 | |
4951 factory SearchFindMemberReferencesResult.fromResponse(Response response) { | |
4952 return new SearchFindMemberReferencesResult.fromJson( | |
4953 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
4954 "result", | |
4955 response._result); | |
4956 } | |
4957 | |
4958 Map<String, dynamic> toJson() { | |
4959 Map<String, dynamic> result = {}; | |
4960 result["id"] = id; | |
4961 return result; | |
4962 } | |
4963 | |
4964 Response toResponse(String id) { | |
4965 return new Response(id, result: toJson()); | |
4966 } | |
4967 | |
4968 @override | |
4969 String toString() => JSON.encode(toJson()); | |
4970 | |
4971 @override | |
4972 bool operator ==(other) { | |
4973 if (other is SearchFindMemberReferencesResult) { | |
4974 return id == other.id; | |
4975 } | |
4976 return false; | |
4977 } | |
4978 | |
4979 @override | |
4980 int get hashCode { | |
4981 int hash = 0; | |
4982 hash = JenkinsSmiHash.combine(hash, id.hashCode); | |
4983 return JenkinsSmiHash.finish(hash); | |
4984 } | |
4985 } | |
4986 | |
4987 /** | |
4988 * search.findTopLevelDeclarations params | |
4989 * | |
4990 * { | |
4991 * "pattern": String | |
4992 * } | |
4993 * | |
4994 * Clients may not extend, implement or mix-in this class. | |
4995 */ | |
4996 class SearchFindTopLevelDeclarationsParams implements HasToJson { | |
4997 String _pattern; | |
4998 | |
4999 /** | |
5000 * The regular expression used to match the names of the declarations to be | |
5001 * found. | |
5002 */ | |
5003 String get pattern => _pattern; | |
5004 | |
5005 /** | |
5006 * The regular expression used to match the names of the declarations to be | |
5007 * found. | |
5008 */ | |
5009 void set pattern(String value) { | |
5010 assert(value != null); | |
5011 this._pattern = value; | |
5012 } | |
5013 | |
5014 SearchFindTopLevelDeclarationsParams(String pattern) { | |
5015 this.pattern = pattern; | |
5016 } | |
5017 | |
5018 factory SearchFindTopLevelDeclarationsParams.fromJson( | |
5019 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
5020 if (json == null) { | |
5021 json = {}; | |
5022 } | |
5023 if (json is Map) { | |
5024 String pattern; | |
5025 if (json.containsKey("pattern")) { | |
5026 pattern = | |
5027 jsonDecoder.decodeString(jsonPath + ".pattern", json["pattern"]); | |
5028 } else { | |
5029 throw jsonDecoder.missingKey(jsonPath, "pattern"); | |
5030 } | |
5031 return new SearchFindTopLevelDeclarationsParams(pattern); | |
5032 } else { | |
5033 throw jsonDecoder.mismatch( | |
5034 jsonPath, "search.findTopLevelDeclarations params", json); | |
5035 } | |
5036 } | |
5037 | |
5038 factory SearchFindTopLevelDeclarationsParams.fromRequest(Request request) { | |
5039 return new SearchFindTopLevelDeclarationsParams.fromJson( | |
5040 new RequestDecoder(request), "params", request._params); | |
5041 } | |
5042 | |
5043 Map<String, dynamic> toJson() { | |
5044 Map<String, dynamic> result = {}; | |
5045 result["pattern"] = pattern; | |
5046 return result; | |
5047 } | |
5048 | |
5049 Request toRequest(String id) { | |
5050 return new Request(id, "search.findTopLevelDeclarations", toJson()); | |
5051 } | |
5052 | |
5053 @override | |
5054 String toString() => JSON.encode(toJson()); | |
5055 | |
5056 @override | |
5057 bool operator ==(other) { | |
5058 if (other is SearchFindTopLevelDeclarationsParams) { | |
5059 return pattern == other.pattern; | |
5060 } | |
5061 return false; | |
5062 } | |
5063 | |
5064 @override | |
5065 int get hashCode { | |
5066 int hash = 0; | |
5067 hash = JenkinsSmiHash.combine(hash, pattern.hashCode); | |
5068 return JenkinsSmiHash.finish(hash); | |
5069 } | |
5070 } | |
5071 | |
5072 /** | |
5073 * search.findTopLevelDeclarations result | |
5074 * | |
5075 * { | |
5076 * "id": SearchId | |
5077 * } | |
5078 * | |
5079 * Clients may not extend, implement or mix-in this class. | |
5080 */ | |
5081 class SearchFindTopLevelDeclarationsResult implements HasToJson { | |
5082 String _id; | |
5083 | |
5084 /** | |
5085 * The identifier used to associate results with this search request. | |
5086 */ | |
5087 String get id => _id; | |
5088 | |
5089 /** | |
5090 * The identifier used to associate results with this search request. | |
5091 */ | |
5092 void set id(String value) { | |
5093 assert(value != null); | |
5094 this._id = value; | |
5095 } | |
5096 | |
5097 SearchFindTopLevelDeclarationsResult(String id) { | |
5098 this.id = id; | |
5099 } | |
5100 | |
5101 factory SearchFindTopLevelDeclarationsResult.fromJson( | |
5102 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
5103 if (json == null) { | |
5104 json = {}; | |
5105 } | |
5106 if (json is Map) { | |
5107 String id; | |
5108 if (json.containsKey("id")) { | |
5109 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); | |
5110 } else { | |
5111 throw jsonDecoder.missingKey(jsonPath, "id"); | |
5112 } | |
5113 return new SearchFindTopLevelDeclarationsResult(id); | |
5114 } else { | |
5115 throw jsonDecoder.mismatch( | |
5116 jsonPath, "search.findTopLevelDeclarations result", json); | |
5117 } | |
5118 } | |
5119 | |
5120 factory SearchFindTopLevelDeclarationsResult.fromResponse(Response response) { | |
5121 return new SearchFindTopLevelDeclarationsResult.fromJson( | |
5122 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
5123 "result", | |
5124 response._result); | |
5125 } | |
5126 | |
5127 Map<String, dynamic> toJson() { | |
5128 Map<String, dynamic> result = {}; | |
5129 result["id"] = id; | |
5130 return result; | |
5131 } | |
5132 | |
5133 Response toResponse(String id) { | |
5134 return new Response(id, result: toJson()); | |
5135 } | |
5136 | |
5137 @override | |
5138 String toString() => JSON.encode(toJson()); | |
5139 | |
5140 @override | |
5141 bool operator ==(other) { | |
5142 if (other is SearchFindTopLevelDeclarationsResult) { | |
5143 return id == other.id; | |
5144 } | |
5145 return false; | |
5146 } | |
5147 | |
5148 @override | |
5149 int get hashCode { | |
5150 int hash = 0; | |
5151 hash = JenkinsSmiHash.combine(hash, id.hashCode); | |
5152 return JenkinsSmiHash.finish(hash); | |
5153 } | |
5154 } | |
5155 | |
5156 /** | |
5157 * search.getTypeHierarchy params | |
5158 * | |
5159 * { | |
5160 * "file": FilePath | |
5161 * "offset": int | |
5162 * "superOnly": optional bool | |
5163 * } | |
5164 * | |
5165 * Clients may not extend, implement or mix-in this class. | |
5166 */ | |
5167 class SearchGetTypeHierarchyParams implements HasToJson { | |
5168 String _file; | |
5169 | |
5170 int _offset; | |
5171 | |
5172 bool _superOnly; | |
5173 | |
5174 /** | |
5175 * The file containing the declaration or reference to the type for which a | |
5176 * hierarchy is being requested. | |
5177 */ | |
5178 String get file => _file; | |
5179 | |
5180 /** | |
5181 * The file containing the declaration or reference to the type for which a | |
5182 * hierarchy is being requested. | |
5183 */ | |
5184 void set file(String value) { | |
5185 assert(value != null); | |
5186 this._file = value; | |
5187 } | |
5188 | |
5189 /** | |
5190 * The offset of the name of the type within the file. | |
5191 */ | |
5192 int get offset => _offset; | |
5193 | |
5194 /** | |
5195 * The offset of the name of the type within the file. | |
5196 */ | |
5197 void set offset(int value) { | |
5198 assert(value != null); | |
5199 this._offset = value; | |
5200 } | |
5201 | |
5202 /** | |
5203 * True if the client is only requesting superclasses and interfaces | |
5204 * hierarchy. | |
5205 */ | |
5206 bool get superOnly => _superOnly; | |
5207 | |
5208 /** | |
5209 * True if the client is only requesting superclasses and interfaces | |
5210 * hierarchy. | |
5211 */ | |
5212 void set superOnly(bool value) { | |
5213 this._superOnly = value; | |
5214 } | |
5215 | |
5216 SearchGetTypeHierarchyParams(String file, int offset, {bool superOnly}) { | |
5217 this.file = file; | |
5218 this.offset = offset; | |
5219 this.superOnly = superOnly; | |
5220 } | |
5221 | |
5222 factory SearchGetTypeHierarchyParams.fromJson( | |
5223 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
5224 if (json == null) { | |
5225 json = {}; | |
5226 } | |
5227 if (json is Map) { | |
5228 String file; | |
5229 if (json.containsKey("file")) { | |
5230 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
5231 } else { | |
5232 throw jsonDecoder.missingKey(jsonPath, "file"); | |
5233 } | |
5234 int offset; | |
5235 if (json.containsKey("offset")) { | |
5236 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
5237 } else { | |
5238 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
5239 } | |
5240 bool superOnly; | |
5241 if (json.containsKey("superOnly")) { | |
5242 superOnly = | |
5243 jsonDecoder.decodeBool(jsonPath + ".superOnly", json["superOnly"]); | |
5244 } | |
5245 return new SearchGetTypeHierarchyParams(file, offset, | |
5246 superOnly: superOnly); | |
5247 } else { | |
5248 throw jsonDecoder.mismatch( | |
5249 jsonPath, "search.getTypeHierarchy params", json); | |
5250 } | |
5251 } | |
5252 | |
5253 factory SearchGetTypeHierarchyParams.fromRequest(Request request) { | |
5254 return new SearchGetTypeHierarchyParams.fromJson( | |
5255 new RequestDecoder(request), "params", request._params); | |
5256 } | |
5257 | |
5258 Map<String, dynamic> toJson() { | |
5259 Map<String, dynamic> result = {}; | |
5260 result["file"] = file; | |
5261 result["offset"] = offset; | |
5262 if (superOnly != null) { | |
5263 result["superOnly"] = superOnly; | |
5264 } | |
5265 return result; | |
5266 } | |
5267 | |
5268 Request toRequest(String id) { | |
5269 return new Request(id, "search.getTypeHierarchy", toJson()); | |
5270 } | |
5271 | |
5272 @override | |
5273 String toString() => JSON.encode(toJson()); | |
5274 | |
5275 @override | |
5276 bool operator ==(other) { | |
5277 if (other is SearchGetTypeHierarchyParams) { | |
5278 return file == other.file && | |
5279 offset == other.offset && | |
5280 superOnly == other.superOnly; | |
5281 } | |
5282 return false; | |
5283 } | |
5284 | |
5285 @override | |
5286 int get hashCode { | |
5287 int hash = 0; | |
5288 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
5289 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
5290 hash = JenkinsSmiHash.combine(hash, superOnly.hashCode); | |
5291 return JenkinsSmiHash.finish(hash); | |
5292 } | |
5293 } | |
5294 | |
5295 /** | |
5296 * search.getTypeHierarchy result | |
5297 * | |
5298 * { | |
5299 * "hierarchyItems": optional List<TypeHierarchyItem> | |
5300 * } | |
5301 * | |
5302 * Clients may not extend, implement or mix-in this class. | |
5303 */ | |
5304 class SearchGetTypeHierarchyResult implements HasToJson { | |
5305 List<TypeHierarchyItem> _hierarchyItems; | |
5306 | |
5307 /** | |
5308 * A list of the types in the requested hierarchy. The first element of the | |
5309 * list is the item representing the type for which the hierarchy was | |
5310 * requested. The index of other elements of the list is unspecified, but | |
5311 * correspond to the integers used to reference supertype and subtype items | |
5312 * within the items. | |
5313 * | |
5314 * This field will be absent if the code at the given file and offset does | |
5315 * not represent a type, or if the file has not been sufficiently analyzed to | |
5316 * allow a type hierarchy to be produced. | |
5317 */ | |
5318 List<TypeHierarchyItem> get hierarchyItems => _hierarchyItems; | |
5319 | |
5320 /** | |
5321 * A list of the types in the requested hierarchy. The first element of the | |
5322 * list is the item representing the type for which the hierarchy was | |
5323 * requested. The index of other elements of the list is unspecified, but | |
5324 * correspond to the integers used to reference supertype and subtype items | |
5325 * within the items. | |
5326 * | |
5327 * This field will be absent if the code at the given file and offset does | |
5328 * not represent a type, or if the file has not been sufficiently analyzed to | |
5329 * allow a type hierarchy to be produced. | |
5330 */ | |
5331 void set hierarchyItems(List<TypeHierarchyItem> value) { | |
5332 this._hierarchyItems = value; | |
5333 } | |
5334 | |
5335 SearchGetTypeHierarchyResult({List<TypeHierarchyItem> hierarchyItems}) { | |
5336 this.hierarchyItems = hierarchyItems; | |
5337 } | |
5338 | |
5339 factory SearchGetTypeHierarchyResult.fromJson( | |
5340 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
5341 if (json == null) { | |
5342 json = {}; | |
5343 } | |
5344 if (json is Map) { | |
5345 List<TypeHierarchyItem> hierarchyItems; | |
5346 if (json.containsKey("hierarchyItems")) { | |
5347 hierarchyItems = jsonDecoder.decodeList( | |
5348 jsonPath + ".hierarchyItems", | |
5349 json["hierarchyItems"], | |
5350 (String jsonPath, Object json) => | |
5351 new TypeHierarchyItem.fromJson(jsonDecoder, jsonPath, json)); | |
5352 } | |
5353 return new SearchGetTypeHierarchyResult(hierarchyItems: hierarchyItems); | |
5354 } else { | |
5355 throw jsonDecoder.mismatch( | |
5356 jsonPath, "search.getTypeHierarchy result", json); | |
5357 } | |
5358 } | |
5359 | |
5360 factory SearchGetTypeHierarchyResult.fromResponse(Response response) { | |
5361 return new SearchGetTypeHierarchyResult.fromJson( | |
5362 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
5363 "result", | |
5364 response._result); | |
5365 } | |
5366 | |
5367 Map<String, dynamic> toJson() { | |
5368 Map<String, dynamic> result = {}; | |
5369 if (hierarchyItems != null) { | |
5370 result["hierarchyItems"] = hierarchyItems | |
5371 .map((TypeHierarchyItem value) => value.toJson()) | |
5372 .toList(); | |
5373 } | |
5374 return result; | |
5375 } | |
5376 | |
5377 Response toResponse(String id) { | |
5378 return new Response(id, result: toJson()); | |
5379 } | |
5380 | |
5381 @override | |
5382 String toString() => JSON.encode(toJson()); | |
5383 | |
5384 @override | |
5385 bool operator ==(other) { | |
5386 if (other is SearchGetTypeHierarchyResult) { | |
5387 return listEqual(hierarchyItems, other.hierarchyItems, | |
5388 (TypeHierarchyItem a, TypeHierarchyItem b) => a == b); | |
5389 } | |
5390 return false; | |
5391 } | |
5392 | |
5393 @override | |
5394 int get hashCode { | |
5395 int hash = 0; | |
5396 hash = JenkinsSmiHash.combine(hash, hierarchyItems.hashCode); | |
5397 return JenkinsSmiHash.finish(hash); | |
5398 } | |
5399 } | |
5400 | |
5401 /** | |
5402 * search.results params | |
5403 * | |
5404 * { | |
5405 * "id": SearchId | |
5406 * "results": List<SearchResult> | |
5407 * "isLast": bool | |
5408 * } | |
5409 * | |
5410 * Clients may not extend, implement or mix-in this class. | |
5411 */ | |
5412 class SearchResultsParams implements HasToJson { | |
5413 String _id; | |
5414 | |
5415 List<SearchResult> _results; | |
5416 | |
5417 bool _isLast; | |
5418 | |
5419 /** | |
5420 * The id associated with the search. | |
5421 */ | |
5422 String get id => _id; | |
5423 | |
5424 /** | |
5425 * The id associated with the search. | |
5426 */ | |
5427 void set id(String value) { | |
5428 assert(value != null); | |
5429 this._id = value; | |
5430 } | |
5431 | |
5432 /** | |
5433 * The search results being reported. | |
5434 */ | |
5435 List<SearchResult> get results => _results; | |
5436 | |
5437 /** | |
5438 * The search results being reported. | |
5439 */ | |
5440 void set results(List<SearchResult> value) { | |
5441 assert(value != null); | |
5442 this._results = value; | |
5443 } | |
5444 | |
5445 /** | |
5446 * True if this is that last set of results that will be returned for the | |
5447 * indicated search. | |
5448 */ | |
5449 bool get isLast => _isLast; | |
5450 | |
5451 /** | |
5452 * True if this is that last set of results that will be returned for the | |
5453 * indicated search. | |
5454 */ | |
5455 void set isLast(bool value) { | |
5456 assert(value != null); | |
5457 this._isLast = value; | |
5458 } | |
5459 | |
5460 SearchResultsParams(String id, List<SearchResult> results, bool isLast) { | |
5461 this.id = id; | |
5462 this.results = results; | |
5463 this.isLast = isLast; | |
5464 } | |
5465 | |
5466 factory SearchResultsParams.fromJson( | |
5467 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
5468 if (json == null) { | |
5469 json = {}; | |
5470 } | |
5471 if (json is Map) { | |
5472 String id; | |
5473 if (json.containsKey("id")) { | |
5474 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); | |
5475 } else { | |
5476 throw jsonDecoder.missingKey(jsonPath, "id"); | |
5477 } | |
5478 List<SearchResult> results; | |
5479 if (json.containsKey("results")) { | |
5480 results = jsonDecoder.decodeList( | |
5481 jsonPath + ".results", | |
5482 json["results"], | |
5483 (String jsonPath, Object json) => | |
5484 new SearchResult.fromJson(jsonDecoder, jsonPath, json)); | |
5485 } else { | |
5486 throw jsonDecoder.missingKey(jsonPath, "results"); | |
5487 } | |
5488 bool isLast; | |
5489 if (json.containsKey("isLast")) { | |
5490 isLast = jsonDecoder.decodeBool(jsonPath + ".isLast", json["isLast"]); | |
5491 } else { | |
5492 throw jsonDecoder.missingKey(jsonPath, "isLast"); | |
5493 } | |
5494 return new SearchResultsParams(id, results, isLast); | |
5495 } else { | |
5496 throw jsonDecoder.mismatch(jsonPath, "search.results params", json); | |
5497 } | |
5498 } | |
5499 | |
5500 factory SearchResultsParams.fromNotification(Notification notification) { | |
5501 return new SearchResultsParams.fromJson( | |
5502 new ResponseDecoder(null), "params", notification._params); | |
5503 } | |
5504 | |
5505 Map<String, dynamic> toJson() { | |
5506 Map<String, dynamic> result = {}; | |
5507 result["id"] = id; | |
5508 result["results"] = | |
5509 results.map((SearchResult value) => value.toJson()).toList(); | |
5510 result["isLast"] = isLast; | |
5511 return result; | |
5512 } | |
5513 | |
5514 Notification toNotification() { | |
5515 return new Notification("search.results", toJson()); | |
5516 } | |
5517 | |
5518 @override | |
5519 String toString() => JSON.encode(toJson()); | |
5520 | |
5521 @override | |
5522 bool operator ==(other) { | |
5523 if (other is SearchResultsParams) { | |
5524 return id == other.id && | |
5525 listEqual(results, other.results, | |
5526 (SearchResult a, SearchResult b) => a == b) && | |
5527 isLast == other.isLast; | |
5528 } | |
5529 return false; | |
5530 } | |
5531 | |
5532 @override | |
5533 int get hashCode { | |
5534 int hash = 0; | |
5535 hash = JenkinsSmiHash.combine(hash, id.hashCode); | |
5536 hash = JenkinsSmiHash.combine(hash, results.hashCode); | |
5537 hash = JenkinsSmiHash.combine(hash, isLast.hashCode); | |
5538 return JenkinsSmiHash.finish(hash); | |
5539 } | |
5540 } | |
5541 | |
5542 /** | |
5543 * edit.format params | |
5544 * | |
5545 * { | |
5546 * "file": FilePath | |
5547 * "selectionOffset": int | |
5548 * "selectionLength": int | |
5549 * "lineLength": optional int | |
5550 * } | |
5551 * | |
5552 * Clients may not extend, implement or mix-in this class. | |
5553 */ | |
5554 class EditFormatParams implements HasToJson { | |
5555 String _file; | |
5556 | |
5557 int _selectionOffset; | |
5558 | |
5559 int _selectionLength; | |
5560 | |
5561 int _lineLength; | |
5562 | |
5563 /** | |
5564 * The file containing the code to be formatted. | |
5565 */ | |
5566 String get file => _file; | |
5567 | |
5568 /** | |
5569 * The file containing the code to be formatted. | |
5570 */ | |
5571 void set file(String value) { | |
5572 assert(value != null); | |
5573 this._file = value; | |
5574 } | |
5575 | |
5576 /** | |
5577 * The offset of the current selection in the file. | |
5578 */ | |
5579 int get selectionOffset => _selectionOffset; | |
5580 | |
5581 /** | |
5582 * The offset of the current selection in the file. | |
5583 */ | |
5584 void set selectionOffset(int value) { | |
5585 assert(value != null); | |
5586 this._selectionOffset = value; | |
5587 } | |
5588 | |
5589 /** | |
5590 * The length of the current selection in the file. | |
5591 */ | |
5592 int get selectionLength => _selectionLength; | |
5593 | |
5594 /** | |
5595 * The length of the current selection in the file. | |
5596 */ | |
5597 void set selectionLength(int value) { | |
5598 assert(value != null); | |
5599 this._selectionLength = value; | |
5600 } | |
5601 | |
5602 /** | |
5603 * The line length to be used by the formatter. | |
5604 */ | |
5605 int get lineLength => _lineLength; | |
5606 | |
5607 /** | |
5608 * The line length to be used by the formatter. | |
5609 */ | |
5610 void set lineLength(int value) { | |
5611 this._lineLength = value; | |
5612 } | |
5613 | |
5614 EditFormatParams(String file, int selectionOffset, int selectionLength, | |
5615 {int lineLength}) { | |
5616 this.file = file; | |
5617 this.selectionOffset = selectionOffset; | |
5618 this.selectionLength = selectionLength; | |
5619 this.lineLength = lineLength; | |
5620 } | |
5621 | |
5622 factory EditFormatParams.fromJson( | |
5623 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
5624 if (json == null) { | |
5625 json = {}; | |
5626 } | |
5627 if (json is Map) { | |
5628 String file; | |
5629 if (json.containsKey("file")) { | |
5630 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
5631 } else { | |
5632 throw jsonDecoder.missingKey(jsonPath, "file"); | |
5633 } | |
5634 int selectionOffset; | |
5635 if (json.containsKey("selectionOffset")) { | |
5636 selectionOffset = jsonDecoder.decodeInt( | |
5637 jsonPath + ".selectionOffset", json["selectionOffset"]); | |
5638 } else { | |
5639 throw jsonDecoder.missingKey(jsonPath, "selectionOffset"); | |
5640 } | |
5641 int selectionLength; | |
5642 if (json.containsKey("selectionLength")) { | |
5643 selectionLength = jsonDecoder.decodeInt( | |
5644 jsonPath + ".selectionLength", json["selectionLength"]); | |
5645 } else { | |
5646 throw jsonDecoder.missingKey(jsonPath, "selectionLength"); | |
5647 } | |
5648 int lineLength; | |
5649 if (json.containsKey("lineLength")) { | |
5650 lineLength = | |
5651 jsonDecoder.decodeInt(jsonPath + ".lineLength", json["lineLength"]); | |
5652 } | |
5653 return new EditFormatParams(file, selectionOffset, selectionLength, | |
5654 lineLength: lineLength); | |
5655 } else { | |
5656 throw jsonDecoder.mismatch(jsonPath, "edit.format params", json); | |
5657 } | |
5658 } | |
5659 | |
5660 factory EditFormatParams.fromRequest(Request request) { | |
5661 return new EditFormatParams.fromJson( | |
5662 new RequestDecoder(request), "params", request._params); | |
5663 } | |
5664 | |
5665 Map<String, dynamic> toJson() { | |
5666 Map<String, dynamic> result = {}; | |
5667 result["file"] = file; | |
5668 result["selectionOffset"] = selectionOffset; | |
5669 result["selectionLength"] = selectionLength; | |
5670 if (lineLength != null) { | |
5671 result["lineLength"] = lineLength; | |
5672 } | |
5673 return result; | |
5674 } | |
5675 | |
5676 Request toRequest(String id) { | |
5677 return new Request(id, "edit.format", toJson()); | |
5678 } | |
5679 | |
5680 @override | |
5681 String toString() => JSON.encode(toJson()); | |
5682 | |
5683 @override | |
5684 bool operator ==(other) { | |
5685 if (other is EditFormatParams) { | |
5686 return file == other.file && | |
5687 selectionOffset == other.selectionOffset && | |
5688 selectionLength == other.selectionLength && | |
5689 lineLength == other.lineLength; | |
5690 } | |
5691 return false; | |
5692 } | |
5693 | |
5694 @override | |
5695 int get hashCode { | |
5696 int hash = 0; | |
5697 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
5698 hash = JenkinsSmiHash.combine(hash, selectionOffset.hashCode); | |
5699 hash = JenkinsSmiHash.combine(hash, selectionLength.hashCode); | |
5700 hash = JenkinsSmiHash.combine(hash, lineLength.hashCode); | |
5701 return JenkinsSmiHash.finish(hash); | |
5702 } | |
5703 } | |
5704 | |
5705 /** | |
5706 * edit.format result | |
5707 * | |
5708 * { | |
5709 * "edits": List<SourceEdit> | |
5710 * "selectionOffset": int | |
5711 * "selectionLength": int | |
5712 * } | |
5713 * | |
5714 * Clients may not extend, implement or mix-in this class. | |
5715 */ | |
5716 class EditFormatResult implements HasToJson { | |
5717 List<SourceEdit> _edits; | |
5718 | |
5719 int _selectionOffset; | |
5720 | |
5721 int _selectionLength; | |
5722 | |
5723 /** | |
5724 * The edit(s) to be applied in order to format the code. The list will be | |
5725 * empty if the code was already formatted (there are no changes). | |
5726 */ | |
5727 List<SourceEdit> get edits => _edits; | |
5728 | |
5729 /** | |
5730 * The edit(s) to be applied in order to format the code. The list will be | |
5731 * empty if the code was already formatted (there are no changes). | |
5732 */ | |
5733 void set edits(List<SourceEdit> value) { | |
5734 assert(value != null); | |
5735 this._edits = value; | |
5736 } | |
5737 | |
5738 /** | |
5739 * The offset of the selection after formatting the code. | |
5740 */ | |
5741 int get selectionOffset => _selectionOffset; | |
5742 | |
5743 /** | |
5744 * The offset of the selection after formatting the code. | |
5745 */ | |
5746 void set selectionOffset(int value) { | |
5747 assert(value != null); | |
5748 this._selectionOffset = value; | |
5749 } | |
5750 | |
5751 /** | |
5752 * The length of the selection after formatting the code. | |
5753 */ | |
5754 int get selectionLength => _selectionLength; | |
5755 | |
5756 /** | |
5757 * The length of the selection after formatting the code. | |
5758 */ | |
5759 void set selectionLength(int value) { | |
5760 assert(value != null); | |
5761 this._selectionLength = value; | |
5762 } | |
5763 | |
5764 EditFormatResult( | |
5765 List<SourceEdit> edits, int selectionOffset, int selectionLength) { | |
5766 this.edits = edits; | |
5767 this.selectionOffset = selectionOffset; | |
5768 this.selectionLength = selectionLength; | |
5769 } | |
5770 | |
5771 factory EditFormatResult.fromJson( | |
5772 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
5773 if (json == null) { | |
5774 json = {}; | |
5775 } | |
5776 if (json is Map) { | |
5777 List<SourceEdit> edits; | |
5778 if (json.containsKey("edits")) { | |
5779 edits = jsonDecoder.decodeList( | |
5780 jsonPath + ".edits", | |
5781 json["edits"], | |
5782 (String jsonPath, Object json) => | |
5783 new SourceEdit.fromJson(jsonDecoder, jsonPath, json)); | |
5784 } else { | |
5785 throw jsonDecoder.missingKey(jsonPath, "edits"); | |
5786 } | |
5787 int selectionOffset; | |
5788 if (json.containsKey("selectionOffset")) { | |
5789 selectionOffset = jsonDecoder.decodeInt( | |
5790 jsonPath + ".selectionOffset", json["selectionOffset"]); | |
5791 } else { | |
5792 throw jsonDecoder.missingKey(jsonPath, "selectionOffset"); | |
5793 } | |
5794 int selectionLength; | |
5795 if (json.containsKey("selectionLength")) { | |
5796 selectionLength = jsonDecoder.decodeInt( | |
5797 jsonPath + ".selectionLength", json["selectionLength"]); | |
5798 } else { | |
5799 throw jsonDecoder.missingKey(jsonPath, "selectionLength"); | |
5800 } | |
5801 return new EditFormatResult(edits, selectionOffset, selectionLength); | |
5802 } else { | |
5803 throw jsonDecoder.mismatch(jsonPath, "edit.format result", json); | |
5804 } | |
5805 } | |
5806 | |
5807 factory EditFormatResult.fromResponse(Response response) { | |
5808 return new EditFormatResult.fromJson( | |
5809 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
5810 "result", | |
5811 response._result); | |
5812 } | |
5813 | |
5814 Map<String, dynamic> toJson() { | |
5815 Map<String, dynamic> result = {}; | |
5816 result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList(); | |
5817 result["selectionOffset"] = selectionOffset; | |
5818 result["selectionLength"] = selectionLength; | |
5819 return result; | |
5820 } | |
5821 | |
5822 Response toResponse(String id) { | |
5823 return new Response(id, result: toJson()); | |
5824 } | |
5825 | |
5826 @override | |
5827 String toString() => JSON.encode(toJson()); | |
5828 | |
5829 @override | |
5830 bool operator ==(other) { | |
5831 if (other is EditFormatResult) { | |
5832 return listEqual( | |
5833 edits, other.edits, (SourceEdit a, SourceEdit b) => a == b) && | |
5834 selectionOffset == other.selectionOffset && | |
5835 selectionLength == other.selectionLength; | |
5836 } | |
5837 return false; | |
5838 } | |
5839 | |
5840 @override | |
5841 int get hashCode { | |
5842 int hash = 0; | |
5843 hash = JenkinsSmiHash.combine(hash, edits.hashCode); | |
5844 hash = JenkinsSmiHash.combine(hash, selectionOffset.hashCode); | |
5845 hash = JenkinsSmiHash.combine(hash, selectionLength.hashCode); | |
5846 return JenkinsSmiHash.finish(hash); | |
5847 } | |
5848 } | |
5849 | |
5850 /** | |
5851 * edit.getAssists params | |
5852 * | |
5853 * { | |
5854 * "file": FilePath | |
5855 * "offset": int | |
5856 * "length": int | |
5857 * } | |
5858 * | |
5859 * Clients may not extend, implement or mix-in this class. | |
5860 */ | |
5861 class EditGetAssistsParams implements HasToJson { | |
5862 String _file; | |
5863 | |
5864 int _offset; | |
5865 | |
5866 int _length; | |
5867 | |
5868 /** | |
5869 * The file containing the code for which assists are being requested. | |
5870 */ | |
5871 String get file => _file; | |
5872 | |
5873 /** | |
5874 * The file containing the code for which assists are being requested. | |
5875 */ | |
5876 void set file(String value) { | |
5877 assert(value != null); | |
5878 this._file = value; | |
5879 } | |
5880 | |
5881 /** | |
5882 * The offset of the code for which assists are being requested. | |
5883 */ | |
5884 int get offset => _offset; | |
5885 | |
5886 /** | |
5887 * The offset of the code for which assists are being requested. | |
5888 */ | |
5889 void set offset(int value) { | |
5890 assert(value != null); | |
5891 this._offset = value; | |
5892 } | |
5893 | |
5894 /** | |
5895 * The length of the code for which assists are being requested. | |
5896 */ | |
5897 int get length => _length; | |
5898 | |
5899 /** | |
5900 * The length of the code for which assists are being requested. | |
5901 */ | |
5902 void set length(int value) { | |
5903 assert(value != null); | |
5904 this._length = value; | |
5905 } | |
5906 | |
5907 EditGetAssistsParams(String file, int offset, int length) { | |
5908 this.file = file; | |
5909 this.offset = offset; | |
5910 this.length = length; | |
5911 } | |
5912 | |
5913 factory EditGetAssistsParams.fromJson( | |
5914 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
5915 if (json == null) { | |
5916 json = {}; | |
5917 } | |
5918 if (json is Map) { | |
5919 String file; | |
5920 if (json.containsKey("file")) { | |
5921 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
5922 } else { | |
5923 throw jsonDecoder.missingKey(jsonPath, "file"); | |
5924 } | |
5925 int offset; | |
5926 if (json.containsKey("offset")) { | |
5927 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
5928 } else { | |
5929 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
5930 } | |
5931 int length; | |
5932 if (json.containsKey("length")) { | |
5933 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
5934 } else { | |
5935 throw jsonDecoder.missingKey(jsonPath, "length"); | |
5936 } | |
5937 return new EditGetAssistsParams(file, offset, length); | |
5938 } else { | |
5939 throw jsonDecoder.mismatch(jsonPath, "edit.getAssists params", json); | |
5940 } | |
5941 } | |
5942 | |
5943 factory EditGetAssistsParams.fromRequest(Request request) { | |
5944 return new EditGetAssistsParams.fromJson( | |
5945 new RequestDecoder(request), "params", request._params); | |
5946 } | |
5947 | |
5948 Map<String, dynamic> toJson() { | |
5949 Map<String, dynamic> result = {}; | |
5950 result["file"] = file; | |
5951 result["offset"] = offset; | |
5952 result["length"] = length; | |
5953 return result; | |
5954 } | |
5955 | |
5956 Request toRequest(String id) { | |
5957 return new Request(id, "edit.getAssists", toJson()); | |
5958 } | |
5959 | |
5960 @override | |
5961 String toString() => JSON.encode(toJson()); | |
5962 | |
5963 @override | |
5964 bool operator ==(other) { | |
5965 if (other is EditGetAssistsParams) { | |
5966 return file == other.file && | |
5967 offset == other.offset && | |
5968 length == other.length; | |
5969 } | |
5970 return false; | |
5971 } | |
5972 | |
5973 @override | |
5974 int get hashCode { | |
5975 int hash = 0; | |
5976 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
5977 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
5978 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
5979 return JenkinsSmiHash.finish(hash); | |
5980 } | |
5981 } | |
5982 | |
5983 /** | |
5984 * edit.getAssists result | |
5985 * | |
5986 * { | |
5987 * "assists": List<SourceChange> | |
5988 * } | |
5989 * | |
5990 * Clients may not extend, implement or mix-in this class. | |
5991 */ | |
5992 class EditGetAssistsResult implements HasToJson { | |
5993 List<SourceChange> _assists; | |
5994 | |
5995 /** | |
5996 * The assists that are available at the given location. | |
5997 */ | |
5998 List<SourceChange> get assists => _assists; | |
5999 | |
6000 /** | |
6001 * The assists that are available at the given location. | |
6002 */ | |
6003 void set assists(List<SourceChange> value) { | |
6004 assert(value != null); | |
6005 this._assists = value; | |
6006 } | |
6007 | |
6008 EditGetAssistsResult(List<SourceChange> assists) { | |
6009 this.assists = assists; | |
6010 } | |
6011 | |
6012 factory EditGetAssistsResult.fromJson( | |
6013 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
6014 if (json == null) { | |
6015 json = {}; | |
6016 } | |
6017 if (json is Map) { | |
6018 List<SourceChange> assists; | |
6019 if (json.containsKey("assists")) { | |
6020 assists = jsonDecoder.decodeList( | |
6021 jsonPath + ".assists", | |
6022 json["assists"], | |
6023 (String jsonPath, Object json) => | |
6024 new SourceChange.fromJson(jsonDecoder, jsonPath, json)); | |
6025 } else { | |
6026 throw jsonDecoder.missingKey(jsonPath, "assists"); | |
6027 } | |
6028 return new EditGetAssistsResult(assists); | |
6029 } else { | |
6030 throw jsonDecoder.mismatch(jsonPath, "edit.getAssists result", json); | |
6031 } | |
6032 } | |
6033 | |
6034 factory EditGetAssistsResult.fromResponse(Response response) { | |
6035 return new EditGetAssistsResult.fromJson( | |
6036 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
6037 "result", | |
6038 response._result); | |
6039 } | |
6040 | |
6041 Map<String, dynamic> toJson() { | |
6042 Map<String, dynamic> result = {}; | |
6043 result["assists"] = | |
6044 assists.map((SourceChange value) => value.toJson()).toList(); | |
6045 return result; | |
6046 } | |
6047 | |
6048 Response toResponse(String id) { | |
6049 return new Response(id, result: toJson()); | |
6050 } | |
6051 | |
6052 @override | |
6053 String toString() => JSON.encode(toJson()); | |
6054 | |
6055 @override | |
6056 bool operator ==(other) { | |
6057 if (other is EditGetAssistsResult) { | |
6058 return listEqual( | |
6059 assists, other.assists, (SourceChange a, SourceChange b) => a == b); | |
6060 } | |
6061 return false; | |
6062 } | |
6063 | |
6064 @override | |
6065 int get hashCode { | |
6066 int hash = 0; | |
6067 hash = JenkinsSmiHash.combine(hash, assists.hashCode); | |
6068 return JenkinsSmiHash.finish(hash); | |
6069 } | |
6070 } | |
6071 | |
6072 /** | |
6073 * edit.getAvailableRefactorings params | |
6074 * | |
6075 * { | |
6076 * "file": FilePath | |
6077 * "offset": int | |
6078 * "length": int | |
6079 * } | |
6080 * | |
6081 * Clients may not extend, implement or mix-in this class. | |
6082 */ | |
6083 class EditGetAvailableRefactoringsParams implements HasToJson { | |
6084 String _file; | |
6085 | |
6086 int _offset; | |
6087 | |
6088 int _length; | |
6089 | |
6090 /** | |
6091 * The file containing the code on which the refactoring would be based. | |
6092 */ | |
6093 String get file => _file; | |
6094 | |
6095 /** | |
6096 * The file containing the code on which the refactoring would be based. | |
6097 */ | |
6098 void set file(String value) { | |
6099 assert(value != null); | |
6100 this._file = value; | |
6101 } | |
6102 | |
6103 /** | |
6104 * The offset of the code on which the refactoring would be based. | |
6105 */ | |
6106 int get offset => _offset; | |
6107 | |
6108 /** | |
6109 * The offset of the code on which the refactoring would be based. | |
6110 */ | |
6111 void set offset(int value) { | |
6112 assert(value != null); | |
6113 this._offset = value; | |
6114 } | |
6115 | |
6116 /** | |
6117 * The length of the code on which the refactoring would be based. | |
6118 */ | |
6119 int get length => _length; | |
6120 | |
6121 /** | |
6122 * The length of the code on which the refactoring would be based. | |
6123 */ | |
6124 void set length(int value) { | |
6125 assert(value != null); | |
6126 this._length = value; | |
6127 } | |
6128 | |
6129 EditGetAvailableRefactoringsParams(String file, int offset, int length) { | |
6130 this.file = file; | |
6131 this.offset = offset; | |
6132 this.length = length; | |
6133 } | |
6134 | |
6135 factory EditGetAvailableRefactoringsParams.fromJson( | |
6136 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
6137 if (json == null) { | |
6138 json = {}; | |
6139 } | |
6140 if (json is Map) { | |
6141 String file; | |
6142 if (json.containsKey("file")) { | |
6143 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
6144 } else { | |
6145 throw jsonDecoder.missingKey(jsonPath, "file"); | |
6146 } | |
6147 int offset; | |
6148 if (json.containsKey("offset")) { | |
6149 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
6150 } else { | |
6151 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
6152 } | |
6153 int length; | |
6154 if (json.containsKey("length")) { | |
6155 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
6156 } else { | |
6157 throw jsonDecoder.missingKey(jsonPath, "length"); | |
6158 } | |
6159 return new EditGetAvailableRefactoringsParams(file, offset, length); | |
6160 } else { | |
6161 throw jsonDecoder.mismatch( | |
6162 jsonPath, "edit.getAvailableRefactorings params", json); | |
6163 } | |
6164 } | |
6165 | |
6166 factory EditGetAvailableRefactoringsParams.fromRequest(Request request) { | |
6167 return new EditGetAvailableRefactoringsParams.fromJson( | |
6168 new RequestDecoder(request), "params", request._params); | |
6169 } | |
6170 | |
6171 Map<String, dynamic> toJson() { | |
6172 Map<String, dynamic> result = {}; | |
6173 result["file"] = file; | |
6174 result["offset"] = offset; | |
6175 result["length"] = length; | |
6176 return result; | |
6177 } | |
6178 | |
6179 Request toRequest(String id) { | |
6180 return new Request(id, "edit.getAvailableRefactorings", toJson()); | |
6181 } | |
6182 | |
6183 @override | |
6184 String toString() => JSON.encode(toJson()); | |
6185 | |
6186 @override | |
6187 bool operator ==(other) { | |
6188 if (other is EditGetAvailableRefactoringsParams) { | |
6189 return file == other.file && | |
6190 offset == other.offset && | |
6191 length == other.length; | |
6192 } | |
6193 return false; | |
6194 } | |
6195 | |
6196 @override | |
6197 int get hashCode { | |
6198 int hash = 0; | |
6199 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
6200 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
6201 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
6202 return JenkinsSmiHash.finish(hash); | |
6203 } | |
6204 } | |
6205 | |
6206 /** | |
6207 * edit.getAvailableRefactorings result | |
6208 * | |
6209 * { | |
6210 * "kinds": List<RefactoringKind> | |
6211 * } | |
6212 * | |
6213 * Clients may not extend, implement or mix-in this class. | |
6214 */ | |
6215 class EditGetAvailableRefactoringsResult implements HasToJson { | |
6216 List<RefactoringKind> _kinds; | |
6217 | |
6218 /** | |
6219 * The kinds of refactorings that are valid for the given selection. | |
6220 */ | |
6221 List<RefactoringKind> get kinds => _kinds; | |
6222 | |
6223 /** | |
6224 * The kinds of refactorings that are valid for the given selection. | |
6225 */ | |
6226 void set kinds(List<RefactoringKind> value) { | |
6227 assert(value != null); | |
6228 this._kinds = value; | |
6229 } | |
6230 | |
6231 EditGetAvailableRefactoringsResult(List<RefactoringKind> kinds) { | |
6232 this.kinds = kinds; | |
6233 } | |
6234 | |
6235 factory EditGetAvailableRefactoringsResult.fromJson( | |
6236 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
6237 if (json == null) { | |
6238 json = {}; | |
6239 } | |
6240 if (json is Map) { | |
6241 List<RefactoringKind> kinds; | |
6242 if (json.containsKey("kinds")) { | |
6243 kinds = jsonDecoder.decodeList( | |
6244 jsonPath + ".kinds", | |
6245 json["kinds"], | |
6246 (String jsonPath, Object json) => | |
6247 new RefactoringKind.fromJson(jsonDecoder, jsonPath, json)); | |
6248 } else { | |
6249 throw jsonDecoder.missingKey(jsonPath, "kinds"); | |
6250 } | |
6251 return new EditGetAvailableRefactoringsResult(kinds); | |
6252 } else { | |
6253 throw jsonDecoder.mismatch( | |
6254 jsonPath, "edit.getAvailableRefactorings result", json); | |
6255 } | |
6256 } | |
6257 | |
6258 factory EditGetAvailableRefactoringsResult.fromResponse(Response response) { | |
6259 return new EditGetAvailableRefactoringsResult.fromJson( | |
6260 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
6261 "result", | |
6262 response._result); | |
6263 } | |
6264 | |
6265 Map<String, dynamic> toJson() { | |
6266 Map<String, dynamic> result = {}; | |
6267 result["kinds"] = | |
6268 kinds.map((RefactoringKind value) => value.toJson()).toList(); | |
6269 return result; | |
6270 } | |
6271 | |
6272 Response toResponse(String id) { | |
6273 return new Response(id, result: toJson()); | |
6274 } | |
6275 | |
6276 @override | |
6277 String toString() => JSON.encode(toJson()); | |
6278 | |
6279 @override | |
6280 bool operator ==(other) { | |
6281 if (other is EditGetAvailableRefactoringsResult) { | |
6282 return listEqual( | |
6283 kinds, other.kinds, (RefactoringKind a, RefactoringKind b) => a == b); | |
6284 } | |
6285 return false; | |
6286 } | |
6287 | |
6288 @override | |
6289 int get hashCode { | |
6290 int hash = 0; | |
6291 hash = JenkinsSmiHash.combine(hash, kinds.hashCode); | |
6292 return JenkinsSmiHash.finish(hash); | |
6293 } | |
6294 } | |
6295 | |
6296 /** | |
6297 * edit.getFixes params | |
6298 * | |
6299 * { | |
6300 * "file": FilePath | |
6301 * "offset": int | |
6302 * } | |
6303 * | |
6304 * Clients may not extend, implement or mix-in this class. | |
6305 */ | |
6306 class EditGetFixesParams implements HasToJson { | |
6307 String _file; | |
6308 | |
6309 int _offset; | |
6310 | |
6311 /** | |
6312 * The file containing the errors for which fixes are being requested. | |
6313 */ | |
6314 String get file => _file; | |
6315 | |
6316 /** | |
6317 * The file containing the errors for which fixes are being requested. | |
6318 */ | |
6319 void set file(String value) { | |
6320 assert(value != null); | |
6321 this._file = value; | |
6322 } | |
6323 | |
6324 /** | |
6325 * The offset used to select the errors for which fixes will be returned. | |
6326 */ | |
6327 int get offset => _offset; | |
6328 | |
6329 /** | |
6330 * The offset used to select the errors for which fixes will be returned. | |
6331 */ | |
6332 void set offset(int value) { | |
6333 assert(value != null); | |
6334 this._offset = value; | |
6335 } | |
6336 | |
6337 EditGetFixesParams(String file, int offset) { | |
6338 this.file = file; | |
6339 this.offset = offset; | |
6340 } | |
6341 | |
6342 factory EditGetFixesParams.fromJson( | |
6343 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
6344 if (json == null) { | |
6345 json = {}; | |
6346 } | |
6347 if (json is Map) { | |
6348 String file; | |
6349 if (json.containsKey("file")) { | |
6350 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
6351 } else { | |
6352 throw jsonDecoder.missingKey(jsonPath, "file"); | |
6353 } | |
6354 int offset; | |
6355 if (json.containsKey("offset")) { | |
6356 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
6357 } else { | |
6358 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
6359 } | |
6360 return new EditGetFixesParams(file, offset); | |
6361 } else { | |
6362 throw jsonDecoder.mismatch(jsonPath, "edit.getFixes params", json); | |
6363 } | |
6364 } | |
6365 | |
6366 factory EditGetFixesParams.fromRequest(Request request) { | |
6367 return new EditGetFixesParams.fromJson( | |
6368 new RequestDecoder(request), "params", request._params); | |
6369 } | |
6370 | |
6371 Map<String, dynamic> toJson() { | |
6372 Map<String, dynamic> result = {}; | |
6373 result["file"] = file; | |
6374 result["offset"] = offset; | |
6375 return result; | |
6376 } | |
6377 | |
6378 Request toRequest(String id) { | |
6379 return new Request(id, "edit.getFixes", toJson()); | |
6380 } | |
6381 | |
6382 @override | |
6383 String toString() => JSON.encode(toJson()); | |
6384 | |
6385 @override | |
6386 bool operator ==(other) { | |
6387 if (other is EditGetFixesParams) { | |
6388 return file == other.file && offset == other.offset; | |
6389 } | |
6390 return false; | |
6391 } | |
6392 | |
6393 @override | |
6394 int get hashCode { | |
6395 int hash = 0; | |
6396 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
6397 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
6398 return JenkinsSmiHash.finish(hash); | |
6399 } | |
6400 } | |
6401 | |
6402 /** | |
6403 * edit.getFixes result | |
6404 * | |
6405 * { | |
6406 * "fixes": List<AnalysisErrorFixes> | |
6407 * } | |
6408 * | |
6409 * Clients may not extend, implement or mix-in this class. | |
6410 */ | |
6411 class EditGetFixesResult implements HasToJson { | |
6412 List<AnalysisErrorFixes> _fixes; | |
6413 | |
6414 /** | |
6415 * The fixes that are available for the errors at the given offset. | |
6416 */ | |
6417 List<AnalysisErrorFixes> get fixes => _fixes; | |
6418 | |
6419 /** | |
6420 * The fixes that are available for the errors at the given offset. | |
6421 */ | |
6422 void set fixes(List<AnalysisErrorFixes> value) { | |
6423 assert(value != null); | |
6424 this._fixes = value; | |
6425 } | |
6426 | |
6427 EditGetFixesResult(List<AnalysisErrorFixes> fixes) { | |
6428 this.fixes = fixes; | |
6429 } | |
6430 | |
6431 factory EditGetFixesResult.fromJson( | |
6432 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
6433 if (json == null) { | |
6434 json = {}; | |
6435 } | |
6436 if (json is Map) { | |
6437 List<AnalysisErrorFixes> fixes; | |
6438 if (json.containsKey("fixes")) { | |
6439 fixes = jsonDecoder.decodeList( | |
6440 jsonPath + ".fixes", | |
6441 json["fixes"], | |
6442 (String jsonPath, Object json) => | |
6443 new AnalysisErrorFixes.fromJson(jsonDecoder, jsonPath, json)); | |
6444 } else { | |
6445 throw jsonDecoder.missingKey(jsonPath, "fixes"); | |
6446 } | |
6447 return new EditGetFixesResult(fixes); | |
6448 } else { | |
6449 throw jsonDecoder.mismatch(jsonPath, "edit.getFixes result", json); | |
6450 } | |
6451 } | |
6452 | |
6453 factory EditGetFixesResult.fromResponse(Response response) { | |
6454 return new EditGetFixesResult.fromJson( | |
6455 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
6456 "result", | |
6457 response._result); | |
6458 } | |
6459 | |
6460 Map<String, dynamic> toJson() { | |
6461 Map<String, dynamic> result = {}; | |
6462 result["fixes"] = | |
6463 fixes.map((AnalysisErrorFixes value) => value.toJson()).toList(); | |
6464 return result; | |
6465 } | |
6466 | |
6467 Response toResponse(String id) { | |
6468 return new Response(id, result: toJson()); | |
6469 } | |
6470 | |
6471 @override | |
6472 String toString() => JSON.encode(toJson()); | |
6473 | |
6474 @override | |
6475 bool operator ==(other) { | |
6476 if (other is EditGetFixesResult) { | |
6477 return listEqual(fixes, other.fixes, | |
6478 (AnalysisErrorFixes a, AnalysisErrorFixes b) => a == b); | |
6479 } | |
6480 return false; | |
6481 } | |
6482 | |
6483 @override | |
6484 int get hashCode { | |
6485 int hash = 0; | |
6486 hash = JenkinsSmiHash.combine(hash, fixes.hashCode); | |
6487 return JenkinsSmiHash.finish(hash); | |
6488 } | |
6489 } | |
6490 | |
6491 /** | |
6492 * edit.getRefactoring params | |
6493 * | |
6494 * { | |
6495 * "kind": RefactoringKind | |
6496 * "file": FilePath | |
6497 * "offset": int | |
6498 * "length": int | |
6499 * "validateOnly": bool | |
6500 * "options": optional RefactoringOptions | |
6501 * } | |
6502 * | |
6503 * Clients may not extend, implement or mix-in this class. | |
6504 */ | |
6505 class EditGetRefactoringParams implements HasToJson { | |
6506 RefactoringKind _kind; | |
6507 | |
6508 String _file; | |
6509 | |
6510 int _offset; | |
6511 | |
6512 int _length; | |
6513 | |
6514 bool _validateOnly; | |
6515 | |
6516 RefactoringOptions _options; | |
6517 | |
6518 /** | |
6519 * The kind of refactoring to be performed. | |
6520 */ | |
6521 RefactoringKind get kind => _kind; | |
6522 | |
6523 /** | |
6524 * The kind of refactoring to be performed. | |
6525 */ | |
6526 void set kind(RefactoringKind value) { | |
6527 assert(value != null); | |
6528 this._kind = value; | |
6529 } | |
6530 | |
6531 /** | |
6532 * The file containing the code involved in the refactoring. | |
6533 */ | |
6534 String get file => _file; | |
6535 | |
6536 /** | |
6537 * The file containing the code involved in the refactoring. | |
6538 */ | |
6539 void set file(String value) { | |
6540 assert(value != null); | |
6541 this._file = value; | |
6542 } | |
6543 | |
6544 /** | |
6545 * The offset of the region involved in the refactoring. | |
6546 */ | |
6547 int get offset => _offset; | |
6548 | |
6549 /** | |
6550 * The offset of the region involved in the refactoring. | |
6551 */ | |
6552 void set offset(int value) { | |
6553 assert(value != null); | |
6554 this._offset = value; | |
6555 } | |
6556 | |
6557 /** | |
6558 * The length of the region involved in the refactoring. | |
6559 */ | |
6560 int get length => _length; | |
6561 | |
6562 /** | |
6563 * The length of the region involved in the refactoring. | |
6564 */ | |
6565 void set length(int value) { | |
6566 assert(value != null); | |
6567 this._length = value; | |
6568 } | |
6569 | |
6570 /** | |
6571 * True if the client is only requesting that the values of the options be | |
6572 * validated and no change be generated. | |
6573 */ | |
6574 bool get validateOnly => _validateOnly; | |
6575 | |
6576 /** | |
6577 * True if the client is only requesting that the values of the options be | |
6578 * validated and no change be generated. | |
6579 */ | |
6580 void set validateOnly(bool value) { | |
6581 assert(value != null); | |
6582 this._validateOnly = value; | |
6583 } | |
6584 | |
6585 /** | |
6586 * Data used to provide values provided by the user. The structure of the | |
6587 * data is dependent on the kind of refactoring being performed. The data | |
6588 * that is expected is documented in the section titled Refactorings, labeled | |
6589 * as "Options". This field can be omitted if the refactoring does not | |
6590 * require any options or if the values of those options are not known. | |
6591 */ | |
6592 RefactoringOptions get options => _options; | |
6593 | |
6594 /** | |
6595 * Data used to provide values provided by the user. The structure of the | |
6596 * data is dependent on the kind of refactoring being performed. The data | |
6597 * that is expected is documented in the section titled Refactorings, labeled | |
6598 * as "Options". This field can be omitted if the refactoring does not | |
6599 * require any options or if the values of those options are not known. | |
6600 */ | |
6601 void set options(RefactoringOptions value) { | |
6602 this._options = value; | |
6603 } | |
6604 | |
6605 EditGetRefactoringParams(RefactoringKind kind, String file, int offset, | |
6606 int length, bool validateOnly, | |
6607 {RefactoringOptions options}) { | |
6608 this.kind = kind; | |
6609 this.file = file; | |
6610 this.offset = offset; | |
6611 this.length = length; | |
6612 this.validateOnly = validateOnly; | |
6613 this.options = options; | |
6614 } | |
6615 | |
6616 factory EditGetRefactoringParams.fromJson( | |
6617 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
6618 if (json == null) { | |
6619 json = {}; | |
6620 } | |
6621 if (json is Map) { | |
6622 RefactoringKind kind; | |
6623 if (json.containsKey("kind")) { | |
6624 kind = new RefactoringKind.fromJson( | |
6625 jsonDecoder, jsonPath + ".kind", json["kind"]); | |
6626 } else { | |
6627 throw jsonDecoder.missingKey(jsonPath, "kind"); | |
6628 } | |
6629 String file; | |
6630 if (json.containsKey("file")) { | |
6631 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
6632 } else { | |
6633 throw jsonDecoder.missingKey(jsonPath, "file"); | |
6634 } | |
6635 int offset; | |
6636 if (json.containsKey("offset")) { | |
6637 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
6638 } else { | |
6639 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
6640 } | |
6641 int length; | |
6642 if (json.containsKey("length")) { | |
6643 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
6644 } else { | |
6645 throw jsonDecoder.missingKey(jsonPath, "length"); | |
6646 } | |
6647 bool validateOnly; | |
6648 if (json.containsKey("validateOnly")) { | |
6649 validateOnly = jsonDecoder.decodeBool( | |
6650 jsonPath + ".validateOnly", json["validateOnly"]); | |
6651 } else { | |
6652 throw jsonDecoder.missingKey(jsonPath, "validateOnly"); | |
6653 } | |
6654 RefactoringOptions options; | |
6655 if (json.containsKey("options")) { | |
6656 options = new RefactoringOptions.fromJson( | |
6657 jsonDecoder, jsonPath + ".options", json["options"], kind); | |
6658 } | |
6659 return new EditGetRefactoringParams( | |
6660 kind, file, offset, length, validateOnly, | |
6661 options: options); | |
6662 } else { | |
6663 throw jsonDecoder.mismatch(jsonPath, "edit.getRefactoring params", json); | |
6664 } | |
6665 } | |
6666 | |
6667 factory EditGetRefactoringParams.fromRequest(Request request) { | |
6668 var params = new EditGetRefactoringParams.fromJson( | |
6669 new RequestDecoder(request), "params", request._params); | |
6670 REQUEST_ID_REFACTORING_KINDS[request.id] = params.kind; | |
6671 return params; | |
6672 } | |
6673 | |
6674 Map<String, dynamic> toJson() { | |
6675 Map<String, dynamic> result = {}; | |
6676 result["kind"] = kind.toJson(); | |
6677 result["file"] = file; | |
6678 result["offset"] = offset; | |
6679 result["length"] = length; | |
6680 result["validateOnly"] = validateOnly; | |
6681 if (options != null) { | |
6682 result["options"] = options.toJson(); | |
6683 } | |
6684 return result; | |
6685 } | |
6686 | |
6687 Request toRequest(String id) { | |
6688 return new Request(id, "edit.getRefactoring", toJson()); | |
6689 } | |
6690 | |
6691 @override | |
6692 String toString() => JSON.encode(toJson()); | |
6693 | |
6694 @override | |
6695 bool operator ==(other) { | |
6696 if (other is EditGetRefactoringParams) { | |
6697 return kind == other.kind && | |
6698 file == other.file && | |
6699 offset == other.offset && | |
6700 length == other.length && | |
6701 validateOnly == other.validateOnly && | |
6702 options == other.options; | |
6703 } | |
6704 return false; | |
6705 } | |
6706 | |
6707 @override | |
6708 int get hashCode { | |
6709 int hash = 0; | |
6710 hash = JenkinsSmiHash.combine(hash, kind.hashCode); | |
6711 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
6712 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
6713 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
6714 hash = JenkinsSmiHash.combine(hash, validateOnly.hashCode); | |
6715 hash = JenkinsSmiHash.combine(hash, options.hashCode); | |
6716 return JenkinsSmiHash.finish(hash); | |
6717 } | |
6718 } | |
6719 | |
6720 /** | |
6721 * edit.getRefactoring result | |
6722 * | |
6723 * { | |
6724 * "initialProblems": List<RefactoringProblem> | |
6725 * "optionsProblems": List<RefactoringProblem> | |
6726 * "finalProblems": List<RefactoringProblem> | |
6727 * "feedback": optional RefactoringFeedback | |
6728 * "change": optional SourceChange | |
6729 * "potentialEdits": optional List<String> | |
6730 * } | |
6731 * | |
6732 * Clients may not extend, implement or mix-in this class. | |
6733 */ | |
6734 class EditGetRefactoringResult implements HasToJson { | |
6735 List<RefactoringProblem> _initialProblems; | |
6736 | |
6737 List<RefactoringProblem> _optionsProblems; | |
6738 | |
6739 List<RefactoringProblem> _finalProblems; | |
6740 | |
6741 RefactoringFeedback _feedback; | |
6742 | |
6743 SourceChange _change; | |
6744 | |
6745 List<String> _potentialEdits; | |
6746 | |
6747 /** | |
6748 * The initial status of the refactoring, i.e. problems related to the | |
6749 * context in which the refactoring is requested. The array will be empty if | |
6750 * there are no known problems. | |
6751 */ | |
6752 List<RefactoringProblem> get initialProblems => _initialProblems; | |
6753 | |
6754 /** | |
6755 * The initial status of the refactoring, i.e. problems related to the | |
6756 * context in which the refactoring is requested. The array will be empty if | |
6757 * there are no known problems. | |
6758 */ | |
6759 void set initialProblems(List<RefactoringProblem> value) { | |
6760 assert(value != null); | |
6761 this._initialProblems = value; | |
6762 } | |
6763 | |
6764 /** | |
6765 * The options validation status, i.e. problems in the given options, such as | |
6766 * light-weight validation of a new name, flags compatibility, etc. The array | |
6767 * will be empty if there are no known problems. | |
6768 */ | |
6769 List<RefactoringProblem> get optionsProblems => _optionsProblems; | |
6770 | |
6771 /** | |
6772 * The options validation status, i.e. problems in the given options, such as | |
6773 * light-weight validation of a new name, flags compatibility, etc. The array | |
6774 * will be empty if there are no known problems. | |
6775 */ | |
6776 void set optionsProblems(List<RefactoringProblem> value) { | |
6777 assert(value != null); | |
6778 this._optionsProblems = value; | |
6779 } | |
6780 | |
6781 /** | |
6782 * The final status of the refactoring, i.e. problems identified in the | |
6783 * result of a full, potentially expensive validation and / or change | |
6784 * creation. The array will be empty if there are no known problems. | |
6785 */ | |
6786 List<RefactoringProblem> get finalProblems => _finalProblems; | |
6787 | |
6788 /** | |
6789 * The final status of the refactoring, i.e. problems identified in the | |
6790 * result of a full, potentially expensive validation and / or change | |
6791 * creation. The array will be empty if there are no known problems. | |
6792 */ | |
6793 void set finalProblems(List<RefactoringProblem> value) { | |
6794 assert(value != null); | |
6795 this._finalProblems = value; | |
6796 } | |
6797 | |
6798 /** | |
6799 * Data used to provide feedback to the user. The structure of the data is | |
6800 * dependent on the kind of refactoring being created. The data that is | |
6801 * returned is documented in the section titled Refactorings, labeled as | |
6802 * "Feedback". | |
6803 */ | |
6804 RefactoringFeedback get feedback => _feedback; | |
6805 | |
6806 /** | |
6807 * Data used to provide feedback to the user. The structure of the data is | |
6808 * dependent on the kind of refactoring being created. The data that is | |
6809 * returned is documented in the section titled Refactorings, labeled as | |
6810 * "Feedback". | |
6811 */ | |
6812 void set feedback(RefactoringFeedback value) { | |
6813 this._feedback = value; | |
6814 } | |
6815 | |
6816 /** | |
6817 * The changes that are to be applied to affect the refactoring. This field | |
6818 * will be omitted if there are problems that prevent a set of changes from | |
6819 * being computed, such as having no options specified for a refactoring that | |
6820 * requires them, or if only validation was requested. | |
6821 */ | |
6822 SourceChange get change => _change; | |
6823 | |
6824 /** | |
6825 * The changes that are to be applied to affect the refactoring. This field | |
6826 * will be omitted if there are problems that prevent a set of changes from | |
6827 * being computed, such as having no options specified for a refactoring that | |
6828 * requires them, or if only validation was requested. | |
6829 */ | |
6830 void set change(SourceChange value) { | |
6831 this._change = value; | |
6832 } | |
6833 | |
6834 /** | |
6835 * The ids of source edits that are not known to be valid. An edit is not | |
6836 * known to be valid if there was insufficient type information for the | |
6837 * server to be able to determine whether or not the code needs to be | |
6838 * modified, such as when a member is being renamed and there is a reference | |
6839 * to a member from an unknown type. This field will be omitted if the change | |
6840 * field is omitted or if there are no potential edits for the refactoring. | |
6841 */ | |
6842 List<String> get potentialEdits => _potentialEdits; | |
6843 | |
6844 /** | |
6845 * The ids of source edits that are not known to be valid. An edit is not | |
6846 * known to be valid if there was insufficient type information for the | |
6847 * server to be able to determine whether or not the code needs to be | |
6848 * modified, such as when a member is being renamed and there is a reference | |
6849 * to a member from an unknown type. This field will be omitted if the change | |
6850 * field is omitted or if there are no potential edits for the refactoring. | |
6851 */ | |
6852 void set potentialEdits(List<String> value) { | |
6853 this._potentialEdits = value; | |
6854 } | |
6855 | |
6856 EditGetRefactoringResult( | |
6857 List<RefactoringProblem> initialProblems, | |
6858 List<RefactoringProblem> optionsProblems, | |
6859 List<RefactoringProblem> finalProblems, | |
6860 {RefactoringFeedback feedback, | |
6861 SourceChange change, | |
6862 List<String> potentialEdits}) { | |
6863 this.initialProblems = initialProblems; | |
6864 this.optionsProblems = optionsProblems; | |
6865 this.finalProblems = finalProblems; | |
6866 this.feedback = feedback; | |
6867 this.change = change; | |
6868 this.potentialEdits = potentialEdits; | |
6869 } | |
6870 | |
6871 factory EditGetRefactoringResult.fromJson( | |
6872 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
6873 if (json == null) { | |
6874 json = {}; | |
6875 } | |
6876 if (json is Map) { | |
6877 List<RefactoringProblem> initialProblems; | |
6878 if (json.containsKey("initialProblems")) { | |
6879 initialProblems = jsonDecoder.decodeList( | |
6880 jsonPath + ".initialProblems", | |
6881 json["initialProblems"], | |
6882 (String jsonPath, Object json) => | |
6883 new RefactoringProblem.fromJson(jsonDecoder, jsonPath, json)); | |
6884 } else { | |
6885 throw jsonDecoder.missingKey(jsonPath, "initialProblems"); | |
6886 } | |
6887 List<RefactoringProblem> optionsProblems; | |
6888 if (json.containsKey("optionsProblems")) { | |
6889 optionsProblems = jsonDecoder.decodeList( | |
6890 jsonPath + ".optionsProblems", | |
6891 json["optionsProblems"], | |
6892 (String jsonPath, Object json) => | |
6893 new RefactoringProblem.fromJson(jsonDecoder, jsonPath, json)); | |
6894 } else { | |
6895 throw jsonDecoder.missingKey(jsonPath, "optionsProblems"); | |
6896 } | |
6897 List<RefactoringProblem> finalProblems; | |
6898 if (json.containsKey("finalProblems")) { | |
6899 finalProblems = jsonDecoder.decodeList( | |
6900 jsonPath + ".finalProblems", | |
6901 json["finalProblems"], | |
6902 (String jsonPath, Object json) => | |
6903 new RefactoringProblem.fromJson(jsonDecoder, jsonPath, json)); | |
6904 } else { | |
6905 throw jsonDecoder.missingKey(jsonPath, "finalProblems"); | |
6906 } | |
6907 RefactoringFeedback feedback; | |
6908 if (json.containsKey("feedback")) { | |
6909 feedback = new RefactoringFeedback.fromJson( | |
6910 jsonDecoder, jsonPath + ".feedback", json["feedback"], json); | |
6911 } | |
6912 SourceChange change; | |
6913 if (json.containsKey("change")) { | |
6914 change = new SourceChange.fromJson( | |
6915 jsonDecoder, jsonPath + ".change", json["change"]); | |
6916 } | |
6917 List<String> potentialEdits; | |
6918 if (json.containsKey("potentialEdits")) { | |
6919 potentialEdits = jsonDecoder.decodeList(jsonPath + ".potentialEdits", | |
6920 json["potentialEdits"], jsonDecoder.decodeString); | |
6921 } | |
6922 return new EditGetRefactoringResult( | |
6923 initialProblems, optionsProblems, finalProblems, | |
6924 feedback: feedback, change: change, potentialEdits: potentialEdits); | |
6925 } else { | |
6926 throw jsonDecoder.mismatch(jsonPath, "edit.getRefactoring result", json); | |
6927 } | |
6928 } | |
6929 | |
6930 factory EditGetRefactoringResult.fromResponse(Response response) { | |
6931 return new EditGetRefactoringResult.fromJson( | |
6932 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
6933 "result", | |
6934 response._result); | |
6935 } | |
6936 | |
6937 Map<String, dynamic> toJson() { | |
6938 Map<String, dynamic> result = {}; | |
6939 result["initialProblems"] = initialProblems | |
6940 .map((RefactoringProblem value) => value.toJson()) | |
6941 .toList(); | |
6942 result["optionsProblems"] = optionsProblems | |
6943 .map((RefactoringProblem value) => value.toJson()) | |
6944 .toList(); | |
6945 result["finalProblems"] = finalProblems | |
6946 .map((RefactoringProblem value) => value.toJson()) | |
6947 .toList(); | |
6948 if (feedback != null) { | |
6949 result["feedback"] = feedback.toJson(); | |
6950 } | |
6951 if (change != null) { | |
6952 result["change"] = change.toJson(); | |
6953 } | |
6954 if (potentialEdits != null) { | |
6955 result["potentialEdits"] = potentialEdits; | |
6956 } | |
6957 return result; | |
6958 } | |
6959 | |
6960 Response toResponse(String id) { | |
6961 return new Response(id, result: toJson()); | |
6962 } | |
6963 | |
6964 @override | |
6965 String toString() => JSON.encode(toJson()); | |
6966 | |
6967 @override | |
6968 bool operator ==(other) { | |
6969 if (other is EditGetRefactoringResult) { | |
6970 return listEqual(initialProblems, other.initialProblems, | |
6971 (RefactoringProblem a, RefactoringProblem b) => a == b) && | |
6972 listEqual(optionsProblems, other.optionsProblems, | |
6973 (RefactoringProblem a, RefactoringProblem b) => a == b) && | |
6974 listEqual(finalProblems, other.finalProblems, | |
6975 (RefactoringProblem a, RefactoringProblem b) => a == b) && | |
6976 feedback == other.feedback && | |
6977 change == other.change && | |
6978 listEqual(potentialEdits, other.potentialEdits, | |
6979 (String a, String b) => a == b); | |
6980 } | |
6981 return false; | |
6982 } | |
6983 | |
6984 @override | |
6985 int get hashCode { | |
6986 int hash = 0; | |
6987 hash = JenkinsSmiHash.combine(hash, initialProblems.hashCode); | |
6988 hash = JenkinsSmiHash.combine(hash, optionsProblems.hashCode); | |
6989 hash = JenkinsSmiHash.combine(hash, finalProblems.hashCode); | |
6990 hash = JenkinsSmiHash.combine(hash, feedback.hashCode); | |
6991 hash = JenkinsSmiHash.combine(hash, change.hashCode); | |
6992 hash = JenkinsSmiHash.combine(hash, potentialEdits.hashCode); | |
6993 return JenkinsSmiHash.finish(hash); | |
6994 } | |
6995 } | |
6996 | |
6997 /** | |
6998 * edit.getStatementCompletion params | |
6999 * | |
7000 * { | |
7001 * "file": FilePath | |
7002 * "offset": int | |
7003 * } | |
7004 * | |
7005 * Clients may not extend, implement or mix-in this class. | |
7006 */ | |
7007 class EditGetStatementCompletionParams implements HasToJson { | |
7008 String _file; | |
7009 | |
7010 int _offset; | |
7011 | |
7012 /** | |
7013 * The file containing the statement to be completed. | |
7014 */ | |
7015 String get file => _file; | |
7016 | |
7017 /** | |
7018 * The file containing the statement to be completed. | |
7019 */ | |
7020 void set file(String value) { | |
7021 assert(value != null); | |
7022 this._file = value; | |
7023 } | |
7024 | |
7025 /** | |
7026 * The offset used to identify the statement to be completed. | |
7027 */ | |
7028 int get offset => _offset; | |
7029 | |
7030 /** | |
7031 * The offset used to identify the statement to be completed. | |
7032 */ | |
7033 void set offset(int value) { | |
7034 assert(value != null); | |
7035 this._offset = value; | |
7036 } | |
7037 | |
7038 EditGetStatementCompletionParams(String file, int offset) { | |
7039 this.file = file; | |
7040 this.offset = offset; | |
7041 } | |
7042 | |
7043 factory EditGetStatementCompletionParams.fromJson( | |
7044 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
7045 if (json == null) { | |
7046 json = {}; | |
7047 } | |
7048 if (json is Map) { | |
7049 String file; | |
7050 if (json.containsKey("file")) { | |
7051 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
7052 } else { | |
7053 throw jsonDecoder.missingKey(jsonPath, "file"); | |
7054 } | |
7055 int offset; | |
7056 if (json.containsKey("offset")) { | |
7057 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
7058 } else { | |
7059 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
7060 } | |
7061 return new EditGetStatementCompletionParams(file, offset); | |
7062 } else { | |
7063 throw jsonDecoder.mismatch( | |
7064 jsonPath, "edit.getStatementCompletion params", json); | |
7065 } | |
7066 } | |
7067 | |
7068 factory EditGetStatementCompletionParams.fromRequest(Request request) { | |
7069 return new EditGetStatementCompletionParams.fromJson( | |
7070 new RequestDecoder(request), "params", request._params); | |
7071 } | |
7072 | |
7073 Map<String, dynamic> toJson() { | |
7074 Map<String, dynamic> result = {}; | |
7075 result["file"] = file; | |
7076 result["offset"] = offset; | |
7077 return result; | |
7078 } | |
7079 | |
7080 Request toRequest(String id) { | |
7081 return new Request(id, "edit.getStatementCompletion", toJson()); | |
7082 } | |
7083 | |
7084 @override | |
7085 String toString() => JSON.encode(toJson()); | |
7086 | |
7087 @override | |
7088 bool operator ==(other) { | |
7089 if (other is EditGetStatementCompletionParams) { | |
7090 return file == other.file && offset == other.offset; | |
7091 } | |
7092 return false; | |
7093 } | |
7094 | |
7095 @override | |
7096 int get hashCode { | |
7097 int hash = 0; | |
7098 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
7099 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
7100 return JenkinsSmiHash.finish(hash); | |
7101 } | |
7102 } | |
7103 | |
7104 /** | |
7105 * edit.getStatementCompletion result | |
7106 * | |
7107 * { | |
7108 * "change": SourceChange | |
7109 * "whitespaceOnly": bool | |
7110 * } | |
7111 * | |
7112 * Clients may not extend, implement or mix-in this class. | |
7113 */ | |
7114 class EditGetStatementCompletionResult implements HasToJson { | |
7115 SourceChange _change; | |
7116 | |
7117 bool _whitespaceOnly; | |
7118 | |
7119 /** | |
7120 * The change to be applied in order to complete the statement. | |
7121 */ | |
7122 SourceChange get change => _change; | |
7123 | |
7124 /** | |
7125 * The change to be applied in order to complete the statement. | |
7126 */ | |
7127 void set change(SourceChange value) { | |
7128 assert(value != null); | |
7129 this._change = value; | |
7130 } | |
7131 | |
7132 /** | |
7133 * Will be true if the change contains nothing but whitespace characters, or | |
7134 * is empty. | |
7135 */ | |
7136 bool get whitespaceOnly => _whitespaceOnly; | |
7137 | |
7138 /** | |
7139 * Will be true if the change contains nothing but whitespace characters, or | |
7140 * is empty. | |
7141 */ | |
7142 void set whitespaceOnly(bool value) { | |
7143 assert(value != null); | |
7144 this._whitespaceOnly = value; | |
7145 } | |
7146 | |
7147 EditGetStatementCompletionResult(SourceChange change, bool whitespaceOnly) { | |
7148 this.change = change; | |
7149 this.whitespaceOnly = whitespaceOnly; | |
7150 } | |
7151 | |
7152 factory EditGetStatementCompletionResult.fromJson( | |
7153 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
7154 if (json == null) { | |
7155 json = {}; | |
7156 } | |
7157 if (json is Map) { | |
7158 SourceChange change; | |
7159 if (json.containsKey("change")) { | |
7160 change = new SourceChange.fromJson( | |
7161 jsonDecoder, jsonPath + ".change", json["change"]); | |
7162 } else { | |
7163 throw jsonDecoder.missingKey(jsonPath, "change"); | |
7164 } | |
7165 bool whitespaceOnly; | |
7166 if (json.containsKey("whitespaceOnly")) { | |
7167 whitespaceOnly = jsonDecoder.decodeBool( | |
7168 jsonPath + ".whitespaceOnly", json["whitespaceOnly"]); | |
7169 } else { | |
7170 throw jsonDecoder.missingKey(jsonPath, "whitespaceOnly"); | |
7171 } | |
7172 return new EditGetStatementCompletionResult(change, whitespaceOnly); | |
7173 } else { | |
7174 throw jsonDecoder.mismatch( | |
7175 jsonPath, "edit.getStatementCompletion result", json); | |
7176 } | |
7177 } | |
7178 | |
7179 factory EditGetStatementCompletionResult.fromResponse(Response response) { | |
7180 return new EditGetStatementCompletionResult.fromJson( | |
7181 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
7182 "result", | |
7183 response._result); | |
7184 } | |
7185 | |
7186 Map<String, dynamic> toJson() { | |
7187 Map<String, dynamic> result = {}; | |
7188 result["change"] = change.toJson(); | |
7189 result["whitespaceOnly"] = whitespaceOnly; | |
7190 return result; | |
7191 } | |
7192 | |
7193 Response toResponse(String id) { | |
7194 return new Response(id, result: toJson()); | |
7195 } | |
7196 | |
7197 @override | |
7198 String toString() => JSON.encode(toJson()); | |
7199 | |
7200 @override | |
7201 bool operator ==(other) { | |
7202 if (other is EditGetStatementCompletionResult) { | |
7203 return change == other.change && whitespaceOnly == other.whitespaceOnly; | |
7204 } | |
7205 return false; | |
7206 } | |
7207 | |
7208 @override | |
7209 int get hashCode { | |
7210 int hash = 0; | |
7211 hash = JenkinsSmiHash.combine(hash, change.hashCode); | |
7212 hash = JenkinsSmiHash.combine(hash, whitespaceOnly.hashCode); | |
7213 return JenkinsSmiHash.finish(hash); | |
7214 } | |
7215 } | |
7216 | |
7217 /** | |
7218 * edit.sortMembers params | |
7219 * | |
7220 * { | |
7221 * "file": FilePath | |
7222 * } | |
7223 * | |
7224 * Clients may not extend, implement or mix-in this class. | |
7225 */ | |
7226 class EditSortMembersParams implements HasToJson { | |
7227 String _file; | |
7228 | |
7229 /** | |
7230 * The Dart file to sort. | |
7231 */ | |
7232 String get file => _file; | |
7233 | |
7234 /** | |
7235 * The Dart file to sort. | |
7236 */ | |
7237 void set file(String value) { | |
7238 assert(value != null); | |
7239 this._file = value; | |
7240 } | |
7241 | |
7242 EditSortMembersParams(String file) { | |
7243 this.file = file; | |
7244 } | |
7245 | |
7246 factory EditSortMembersParams.fromJson( | |
7247 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
7248 if (json == null) { | |
7249 json = {}; | |
7250 } | |
7251 if (json is Map) { | |
7252 String file; | |
7253 if (json.containsKey("file")) { | |
7254 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
7255 } else { | |
7256 throw jsonDecoder.missingKey(jsonPath, "file"); | |
7257 } | |
7258 return new EditSortMembersParams(file); | |
7259 } else { | |
7260 throw jsonDecoder.mismatch(jsonPath, "edit.sortMembers params", json); | |
7261 } | |
7262 } | |
7263 | |
7264 factory EditSortMembersParams.fromRequest(Request request) { | |
7265 return new EditSortMembersParams.fromJson( | |
7266 new RequestDecoder(request), "params", request._params); | |
7267 } | |
7268 | |
7269 Map<String, dynamic> toJson() { | |
7270 Map<String, dynamic> result = {}; | |
7271 result["file"] = file; | |
7272 return result; | |
7273 } | |
7274 | |
7275 Request toRequest(String id) { | |
7276 return new Request(id, "edit.sortMembers", toJson()); | |
7277 } | |
7278 | |
7279 @override | |
7280 String toString() => JSON.encode(toJson()); | |
7281 | |
7282 @override | |
7283 bool operator ==(other) { | |
7284 if (other is EditSortMembersParams) { | |
7285 return file == other.file; | |
7286 } | |
7287 return false; | |
7288 } | |
7289 | |
7290 @override | |
7291 int get hashCode { | |
7292 int hash = 0; | |
7293 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
7294 return JenkinsSmiHash.finish(hash); | |
7295 } | |
7296 } | |
7297 | |
7298 /** | |
7299 * edit.sortMembers result | |
7300 * | |
7301 * { | |
7302 * "edit": SourceFileEdit | |
7303 * } | |
7304 * | |
7305 * Clients may not extend, implement or mix-in this class. | |
7306 */ | |
7307 class EditSortMembersResult implements HasToJson { | |
7308 SourceFileEdit _edit; | |
7309 | |
7310 /** | |
7311 * The file edit that is to be applied to the given file to effect the | |
7312 * sorting. | |
7313 */ | |
7314 SourceFileEdit get edit => _edit; | |
7315 | |
7316 /** | |
7317 * The file edit that is to be applied to the given file to effect the | |
7318 * sorting. | |
7319 */ | |
7320 void set edit(SourceFileEdit value) { | |
7321 assert(value != null); | |
7322 this._edit = value; | |
7323 } | |
7324 | |
7325 EditSortMembersResult(SourceFileEdit edit) { | |
7326 this.edit = edit; | |
7327 } | |
7328 | |
7329 factory EditSortMembersResult.fromJson( | |
7330 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
7331 if (json == null) { | |
7332 json = {}; | |
7333 } | |
7334 if (json is Map) { | |
7335 SourceFileEdit edit; | |
7336 if (json.containsKey("edit")) { | |
7337 edit = new SourceFileEdit.fromJson( | |
7338 jsonDecoder, jsonPath + ".edit", json["edit"]); | |
7339 } else { | |
7340 throw jsonDecoder.missingKey(jsonPath, "edit"); | |
7341 } | |
7342 return new EditSortMembersResult(edit); | |
7343 } else { | |
7344 throw jsonDecoder.mismatch(jsonPath, "edit.sortMembers result", json); | |
7345 } | |
7346 } | |
7347 | |
7348 factory EditSortMembersResult.fromResponse(Response response) { | |
7349 return new EditSortMembersResult.fromJson( | |
7350 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
7351 "result", | |
7352 response._result); | |
7353 } | |
7354 | |
7355 Map<String, dynamic> toJson() { | |
7356 Map<String, dynamic> result = {}; | |
7357 result["edit"] = edit.toJson(); | |
7358 return result; | |
7359 } | |
7360 | |
7361 Response toResponse(String id) { | |
7362 return new Response(id, result: toJson()); | |
7363 } | |
7364 | |
7365 @override | |
7366 String toString() => JSON.encode(toJson()); | |
7367 | |
7368 @override | |
7369 bool operator ==(other) { | |
7370 if (other is EditSortMembersResult) { | |
7371 return edit == other.edit; | |
7372 } | |
7373 return false; | |
7374 } | |
7375 | |
7376 @override | |
7377 int get hashCode { | |
7378 int hash = 0; | |
7379 hash = JenkinsSmiHash.combine(hash, edit.hashCode); | |
7380 return JenkinsSmiHash.finish(hash); | |
7381 } | |
7382 } | |
7383 | |
7384 /** | |
7385 * edit.organizeDirectives params | |
7386 * | |
7387 * { | |
7388 * "file": FilePath | |
7389 * } | |
7390 * | |
7391 * Clients may not extend, implement or mix-in this class. | |
7392 */ | |
7393 class EditOrganizeDirectivesParams implements HasToJson { | |
7394 String _file; | |
7395 | |
7396 /** | |
7397 * The Dart file to organize directives in. | |
7398 */ | |
7399 String get file => _file; | |
7400 | |
7401 /** | |
7402 * The Dart file to organize directives in. | |
7403 */ | |
7404 void set file(String value) { | |
7405 assert(value != null); | |
7406 this._file = value; | |
7407 } | |
7408 | |
7409 EditOrganizeDirectivesParams(String file) { | |
7410 this.file = file; | |
7411 } | |
7412 | |
7413 factory EditOrganizeDirectivesParams.fromJson( | |
7414 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
7415 if (json == null) { | |
7416 json = {}; | |
7417 } | |
7418 if (json is Map) { | |
7419 String file; | |
7420 if (json.containsKey("file")) { | |
7421 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
7422 } else { | |
7423 throw jsonDecoder.missingKey(jsonPath, "file"); | |
7424 } | |
7425 return new EditOrganizeDirectivesParams(file); | |
7426 } else { | |
7427 throw jsonDecoder.mismatch( | |
7428 jsonPath, "edit.organizeDirectives params", json); | |
7429 } | |
7430 } | |
7431 | |
7432 factory EditOrganizeDirectivesParams.fromRequest(Request request) { | |
7433 return new EditOrganizeDirectivesParams.fromJson( | |
7434 new RequestDecoder(request), "params", request._params); | |
7435 } | |
7436 | |
7437 Map<String, dynamic> toJson() { | |
7438 Map<String, dynamic> result = {}; | |
7439 result["file"] = file; | |
7440 return result; | |
7441 } | |
7442 | |
7443 Request toRequest(String id) { | |
7444 return new Request(id, "edit.organizeDirectives", toJson()); | |
7445 } | |
7446 | |
7447 @override | |
7448 String toString() => JSON.encode(toJson()); | |
7449 | |
7450 @override | |
7451 bool operator ==(other) { | |
7452 if (other is EditOrganizeDirectivesParams) { | |
7453 return file == other.file; | |
7454 } | |
7455 return false; | |
7456 } | |
7457 | |
7458 @override | |
7459 int get hashCode { | |
7460 int hash = 0; | |
7461 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
7462 return JenkinsSmiHash.finish(hash); | |
7463 } | |
7464 } | |
7465 | |
7466 /** | |
7467 * edit.organizeDirectives result | |
7468 * | |
7469 * { | |
7470 * "edit": SourceFileEdit | |
7471 * } | |
7472 * | |
7473 * Clients may not extend, implement or mix-in this class. | |
7474 */ | |
7475 class EditOrganizeDirectivesResult implements HasToJson { | |
7476 SourceFileEdit _edit; | |
7477 | |
7478 /** | |
7479 * The file edit that is to be applied to the given file to effect the | |
7480 * organizing. | |
7481 */ | |
7482 SourceFileEdit get edit => _edit; | |
7483 | |
7484 /** | |
7485 * The file edit that is to be applied to the given file to effect the | |
7486 * organizing. | |
7487 */ | |
7488 void set edit(SourceFileEdit value) { | |
7489 assert(value != null); | |
7490 this._edit = value; | |
7491 } | |
7492 | |
7493 EditOrganizeDirectivesResult(SourceFileEdit edit) { | |
7494 this.edit = edit; | |
7495 } | |
7496 | |
7497 factory EditOrganizeDirectivesResult.fromJson( | |
7498 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
7499 if (json == null) { | |
7500 json = {}; | |
7501 } | |
7502 if (json is Map) { | |
7503 SourceFileEdit edit; | |
7504 if (json.containsKey("edit")) { | |
7505 edit = new SourceFileEdit.fromJson( | |
7506 jsonDecoder, jsonPath + ".edit", json["edit"]); | |
7507 } else { | |
7508 throw jsonDecoder.missingKey(jsonPath, "edit"); | |
7509 } | |
7510 return new EditOrganizeDirectivesResult(edit); | |
7511 } else { | |
7512 throw jsonDecoder.mismatch( | |
7513 jsonPath, "edit.organizeDirectives result", json); | |
7514 } | |
7515 } | |
7516 | |
7517 factory EditOrganizeDirectivesResult.fromResponse(Response response) { | |
7518 return new EditOrganizeDirectivesResult.fromJson( | |
7519 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
7520 "result", | |
7521 response._result); | |
7522 } | |
7523 | |
7524 Map<String, dynamic> toJson() { | |
7525 Map<String, dynamic> result = {}; | |
7526 result["edit"] = edit.toJson(); | |
7527 return result; | |
7528 } | |
7529 | |
7530 Response toResponse(String id) { | |
7531 return new Response(id, result: toJson()); | |
7532 } | |
7533 | |
7534 @override | |
7535 String toString() => JSON.encode(toJson()); | |
7536 | |
7537 @override | |
7538 bool operator ==(other) { | |
7539 if (other is EditOrganizeDirectivesResult) { | |
7540 return edit == other.edit; | |
7541 } | |
7542 return false; | |
7543 } | |
7544 | |
7545 @override | |
7546 int get hashCode { | |
7547 int hash = 0; | |
7548 hash = JenkinsSmiHash.combine(hash, edit.hashCode); | |
7549 return JenkinsSmiHash.finish(hash); | |
7550 } | |
7551 } | |
7552 | |
7553 /** | |
7554 * execution.createContext params | |
7555 * | |
7556 * { | |
7557 * "contextRoot": FilePath | |
7558 * } | |
7559 * | |
7560 * Clients may not extend, implement or mix-in this class. | |
7561 */ | |
7562 class ExecutionCreateContextParams implements HasToJson { | |
7563 String _contextRoot; | |
7564 | |
7565 /** | |
7566 * The path of the Dart or HTML file that will be launched, or the path of | |
7567 * the directory containing the file. | |
7568 */ | |
7569 String get contextRoot => _contextRoot; | |
7570 | |
7571 /** | |
7572 * The path of the Dart or HTML file that will be launched, or the path of | |
7573 * the directory containing the file. | |
7574 */ | |
7575 void set contextRoot(String value) { | |
7576 assert(value != null); | |
7577 this._contextRoot = value; | |
7578 } | |
7579 | |
7580 ExecutionCreateContextParams(String contextRoot) { | |
7581 this.contextRoot = contextRoot; | |
7582 } | |
7583 | |
7584 factory ExecutionCreateContextParams.fromJson( | |
7585 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
7586 if (json == null) { | |
7587 json = {}; | |
7588 } | |
7589 if (json is Map) { | |
7590 String contextRoot; | |
7591 if (json.containsKey("contextRoot")) { | |
7592 contextRoot = jsonDecoder.decodeString( | |
7593 jsonPath + ".contextRoot", json["contextRoot"]); | |
7594 } else { | |
7595 throw jsonDecoder.missingKey(jsonPath, "contextRoot"); | |
7596 } | |
7597 return new ExecutionCreateContextParams(contextRoot); | |
7598 } else { | |
7599 throw jsonDecoder.mismatch( | |
7600 jsonPath, "execution.createContext params", json); | |
7601 } | |
7602 } | |
7603 | |
7604 factory ExecutionCreateContextParams.fromRequest(Request request) { | |
7605 return new ExecutionCreateContextParams.fromJson( | |
7606 new RequestDecoder(request), "params", request._params); | |
7607 } | |
7608 | |
7609 Map<String, dynamic> toJson() { | |
7610 Map<String, dynamic> result = {}; | |
7611 result["contextRoot"] = contextRoot; | |
7612 return result; | |
7613 } | |
7614 | |
7615 Request toRequest(String id) { | |
7616 return new Request(id, "execution.createContext", toJson()); | |
7617 } | |
7618 | |
7619 @override | |
7620 String toString() => JSON.encode(toJson()); | |
7621 | |
7622 @override | |
7623 bool operator ==(other) { | |
7624 if (other is ExecutionCreateContextParams) { | |
7625 return contextRoot == other.contextRoot; | |
7626 } | |
7627 return false; | |
7628 } | |
7629 | |
7630 @override | |
7631 int get hashCode { | |
7632 int hash = 0; | |
7633 hash = JenkinsSmiHash.combine(hash, contextRoot.hashCode); | |
7634 return JenkinsSmiHash.finish(hash); | |
7635 } | |
7636 } | |
7637 | |
7638 /** | |
7639 * execution.createContext result | |
7640 * | |
7641 * { | |
7642 * "id": ExecutionContextId | |
7643 * } | |
7644 * | |
7645 * Clients may not extend, implement or mix-in this class. | |
7646 */ | |
7647 class ExecutionCreateContextResult implements HasToJson { | |
7648 String _id; | |
7649 | |
7650 /** | |
7651 * The identifier used to refer to the execution context that was created. | |
7652 */ | |
7653 String get id => _id; | |
7654 | |
7655 /** | |
7656 * The identifier used to refer to the execution context that was created. | |
7657 */ | |
7658 void set id(String value) { | |
7659 assert(value != null); | |
7660 this._id = value; | |
7661 } | |
7662 | |
7663 ExecutionCreateContextResult(String id) { | |
7664 this.id = id; | |
7665 } | |
7666 | |
7667 factory ExecutionCreateContextResult.fromJson( | |
7668 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
7669 if (json == null) { | |
7670 json = {}; | |
7671 } | |
7672 if (json is Map) { | |
7673 String id; | |
7674 if (json.containsKey("id")) { | |
7675 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); | |
7676 } else { | |
7677 throw jsonDecoder.missingKey(jsonPath, "id"); | |
7678 } | |
7679 return new ExecutionCreateContextResult(id); | |
7680 } else { | |
7681 throw jsonDecoder.mismatch( | |
7682 jsonPath, "execution.createContext result", json); | |
7683 } | |
7684 } | |
7685 | |
7686 factory ExecutionCreateContextResult.fromResponse(Response response) { | |
7687 return new ExecutionCreateContextResult.fromJson( | |
7688 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
7689 "result", | |
7690 response._result); | |
7691 } | |
7692 | |
7693 Map<String, dynamic> toJson() { | |
7694 Map<String, dynamic> result = {}; | |
7695 result["id"] = id; | |
7696 return result; | |
7697 } | |
7698 | |
7699 Response toResponse(String id) { | |
7700 return new Response(id, result: toJson()); | |
7701 } | |
7702 | |
7703 @override | |
7704 String toString() => JSON.encode(toJson()); | |
7705 | |
7706 @override | |
7707 bool operator ==(other) { | |
7708 if (other is ExecutionCreateContextResult) { | |
7709 return id == other.id; | |
7710 } | |
7711 return false; | |
7712 } | |
7713 | |
7714 @override | |
7715 int get hashCode { | |
7716 int hash = 0; | |
7717 hash = JenkinsSmiHash.combine(hash, id.hashCode); | |
7718 return JenkinsSmiHash.finish(hash); | |
7719 } | |
7720 } | |
7721 | |
7722 /** | |
7723 * execution.deleteContext params | |
7724 * | |
7725 * { | |
7726 * "id": ExecutionContextId | |
7727 * } | |
7728 * | |
7729 * Clients may not extend, implement or mix-in this class. | |
7730 */ | |
7731 class ExecutionDeleteContextParams implements HasToJson { | |
7732 String _id; | |
7733 | |
7734 /** | |
7735 * The identifier of the execution context that is to be deleted. | |
7736 */ | |
7737 String get id => _id; | |
7738 | |
7739 /** | |
7740 * The identifier of the execution context that is to be deleted. | |
7741 */ | |
7742 void set id(String value) { | |
7743 assert(value != null); | |
7744 this._id = value; | |
7745 } | |
7746 | |
7747 ExecutionDeleteContextParams(String id) { | |
7748 this.id = id; | |
7749 } | |
7750 | |
7751 factory ExecutionDeleteContextParams.fromJson( | |
7752 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
7753 if (json == null) { | |
7754 json = {}; | |
7755 } | |
7756 if (json is Map) { | |
7757 String id; | |
7758 if (json.containsKey("id")) { | |
7759 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); | |
7760 } else { | |
7761 throw jsonDecoder.missingKey(jsonPath, "id"); | |
7762 } | |
7763 return new ExecutionDeleteContextParams(id); | |
7764 } else { | |
7765 throw jsonDecoder.mismatch( | |
7766 jsonPath, "execution.deleteContext params", json); | |
7767 } | |
7768 } | |
7769 | |
7770 factory ExecutionDeleteContextParams.fromRequest(Request request) { | |
7771 return new ExecutionDeleteContextParams.fromJson( | |
7772 new RequestDecoder(request), "params", request._params); | |
7773 } | |
7774 | |
7775 Map<String, dynamic> toJson() { | |
7776 Map<String, dynamic> result = {}; | |
7777 result["id"] = id; | |
7778 return result; | |
7779 } | |
7780 | |
7781 Request toRequest(String id) { | |
7782 return new Request(id, "execution.deleteContext", toJson()); | |
7783 } | |
7784 | |
7785 @override | |
7786 String toString() => JSON.encode(toJson()); | |
7787 | |
7788 @override | |
7789 bool operator ==(other) { | |
7790 if (other is ExecutionDeleteContextParams) { | |
7791 return id == other.id; | |
7792 } | |
7793 return false; | |
7794 } | |
7795 | |
7796 @override | |
7797 int get hashCode { | |
7798 int hash = 0; | |
7799 hash = JenkinsSmiHash.combine(hash, id.hashCode); | |
7800 return JenkinsSmiHash.finish(hash); | |
7801 } | |
7802 } | |
7803 | |
7804 /** | |
7805 * execution.deleteContext result | |
7806 * | |
7807 * Clients may not extend, implement or mix-in this class. | |
7808 */ | |
7809 class ExecutionDeleteContextResult { | |
7810 Response toResponse(String id) { | |
7811 return new Response(id, result: null); | |
7812 } | |
7813 | |
7814 @override | |
7815 bool operator ==(other) { | |
7816 if (other is ExecutionDeleteContextResult) { | |
7817 return true; | |
7818 } | |
7819 return false; | |
7820 } | |
7821 | |
7822 @override | |
7823 int get hashCode { | |
7824 return 479954425; | |
7825 } | |
7826 } | |
7827 | |
7828 /** | |
7829 * execution.mapUri params | |
7830 * | |
7831 * { | |
7832 * "id": ExecutionContextId | |
7833 * "file": optional FilePath | |
7834 * "uri": optional String | |
7835 * } | |
7836 * | |
7837 * Clients may not extend, implement or mix-in this class. | |
7838 */ | |
7839 class ExecutionMapUriParams implements HasToJson { | |
7840 String _id; | |
7841 | |
7842 String _file; | |
7843 | |
7844 String _uri; | |
7845 | |
7846 /** | |
7847 * The identifier of the execution context in which the URI is to be mapped. | |
7848 */ | |
7849 String get id => _id; | |
7850 | |
7851 /** | |
7852 * The identifier of the execution context in which the URI is to be mapped. | |
7853 */ | |
7854 void set id(String value) { | |
7855 assert(value != null); | |
7856 this._id = value; | |
7857 } | |
7858 | |
7859 /** | |
7860 * The path of the file to be mapped into a URI. | |
7861 */ | |
7862 String get file => _file; | |
7863 | |
7864 /** | |
7865 * The path of the file to be mapped into a URI. | |
7866 */ | |
7867 void set file(String value) { | |
7868 this._file = value; | |
7869 } | |
7870 | |
7871 /** | |
7872 * The URI to be mapped into a file path. | |
7873 */ | |
7874 String get uri => _uri; | |
7875 | |
7876 /** | |
7877 * The URI to be mapped into a file path. | |
7878 */ | |
7879 void set uri(String value) { | |
7880 this._uri = value; | |
7881 } | |
7882 | |
7883 ExecutionMapUriParams(String id, {String file, String uri}) { | |
7884 this.id = id; | |
7885 this.file = file; | |
7886 this.uri = uri; | |
7887 } | |
7888 | |
7889 factory ExecutionMapUriParams.fromJson( | |
7890 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
7891 if (json == null) { | |
7892 json = {}; | |
7893 } | |
7894 if (json is Map) { | |
7895 String id; | |
7896 if (json.containsKey("id")) { | |
7897 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); | |
7898 } else { | |
7899 throw jsonDecoder.missingKey(jsonPath, "id"); | |
7900 } | |
7901 String file; | |
7902 if (json.containsKey("file")) { | |
7903 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
7904 } | |
7905 String uri; | |
7906 if (json.containsKey("uri")) { | |
7907 uri = jsonDecoder.decodeString(jsonPath + ".uri", json["uri"]); | |
7908 } | |
7909 return new ExecutionMapUriParams(id, file: file, uri: uri); | |
7910 } else { | |
7911 throw jsonDecoder.mismatch(jsonPath, "execution.mapUri params", json); | |
7912 } | |
7913 } | |
7914 | |
7915 factory ExecutionMapUriParams.fromRequest(Request request) { | |
7916 return new ExecutionMapUriParams.fromJson( | |
7917 new RequestDecoder(request), "params", request._params); | |
7918 } | |
7919 | |
7920 Map<String, dynamic> toJson() { | |
7921 Map<String, dynamic> result = {}; | |
7922 result["id"] = id; | |
7923 if (file != null) { | |
7924 result["file"] = file; | |
7925 } | |
7926 if (uri != null) { | |
7927 result["uri"] = uri; | |
7928 } | |
7929 return result; | |
7930 } | |
7931 | |
7932 Request toRequest(String id) { | |
7933 return new Request(id, "execution.mapUri", toJson()); | |
7934 } | |
7935 | |
7936 @override | |
7937 String toString() => JSON.encode(toJson()); | |
7938 | |
7939 @override | |
7940 bool operator ==(other) { | |
7941 if (other is ExecutionMapUriParams) { | |
7942 return id == other.id && file == other.file && uri == other.uri; | |
7943 } | |
7944 return false; | |
7945 } | |
7946 | |
7947 @override | |
7948 int get hashCode { | |
7949 int hash = 0; | |
7950 hash = JenkinsSmiHash.combine(hash, id.hashCode); | |
7951 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
7952 hash = JenkinsSmiHash.combine(hash, uri.hashCode); | |
7953 return JenkinsSmiHash.finish(hash); | |
7954 } | |
7955 } | |
7956 | |
7957 /** | |
7958 * execution.mapUri result | |
7959 * | |
7960 * { | |
7961 * "file": optional FilePath | |
7962 * "uri": optional String | |
7963 * } | |
7964 * | |
7965 * Clients may not extend, implement or mix-in this class. | |
7966 */ | |
7967 class ExecutionMapUriResult implements HasToJson { | |
7968 String _file; | |
7969 | |
7970 String _uri; | |
7971 | |
7972 /** | |
7973 * The file to which the URI was mapped. This field is omitted if the uri | |
7974 * field was not given in the request. | |
7975 */ | |
7976 String get file => _file; | |
7977 | |
7978 /** | |
7979 * The file to which the URI was mapped. This field is omitted if the uri | |
7980 * field was not given in the request. | |
7981 */ | |
7982 void set file(String value) { | |
7983 this._file = value; | |
7984 } | |
7985 | |
7986 /** | |
7987 * The URI to which the file path was mapped. This field is omitted if the | |
7988 * file field was not given in the request. | |
7989 */ | |
7990 String get uri => _uri; | |
7991 | |
7992 /** | |
7993 * The URI to which the file path was mapped. This field is omitted if the | |
7994 * file field was not given in the request. | |
7995 */ | |
7996 void set uri(String value) { | |
7997 this._uri = value; | |
7998 } | |
7999 | |
8000 ExecutionMapUriResult({String file, String uri}) { | |
8001 this.file = file; | |
8002 this.uri = uri; | |
8003 } | |
8004 | |
8005 factory ExecutionMapUriResult.fromJson( | |
8006 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
8007 if (json == null) { | |
8008 json = {}; | |
8009 } | |
8010 if (json is Map) { | |
8011 String file; | |
8012 if (json.containsKey("file")) { | |
8013 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
8014 } | |
8015 String uri; | |
8016 if (json.containsKey("uri")) { | |
8017 uri = jsonDecoder.decodeString(jsonPath + ".uri", json["uri"]); | |
8018 } | |
8019 return new ExecutionMapUriResult(file: file, uri: uri); | |
8020 } else { | |
8021 throw jsonDecoder.mismatch(jsonPath, "execution.mapUri result", json); | |
8022 } | |
8023 } | |
8024 | |
8025 factory ExecutionMapUriResult.fromResponse(Response response) { | |
8026 return new ExecutionMapUriResult.fromJson( | |
8027 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
8028 "result", | |
8029 response._result); | |
8030 } | |
8031 | |
8032 Map<String, dynamic> toJson() { | |
8033 Map<String, dynamic> result = {}; | |
8034 if (file != null) { | |
8035 result["file"] = file; | |
8036 } | |
8037 if (uri != null) { | |
8038 result["uri"] = uri; | |
8039 } | |
8040 return result; | |
8041 } | |
8042 | |
8043 Response toResponse(String id) { | |
8044 return new Response(id, result: toJson()); | |
8045 } | |
8046 | |
8047 @override | |
8048 String toString() => JSON.encode(toJson()); | |
8049 | |
8050 @override | |
8051 bool operator ==(other) { | |
8052 if (other is ExecutionMapUriResult) { | |
8053 return file == other.file && uri == other.uri; | |
8054 } | |
8055 return false; | |
8056 } | |
8057 | |
8058 @override | |
8059 int get hashCode { | |
8060 int hash = 0; | |
8061 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
8062 hash = JenkinsSmiHash.combine(hash, uri.hashCode); | |
8063 return JenkinsSmiHash.finish(hash); | |
8064 } | |
8065 } | |
8066 | |
8067 /** | |
8068 * execution.setSubscriptions params | |
8069 * | |
8070 * { | |
8071 * "subscriptions": List<ExecutionService> | |
8072 * } | |
8073 * | |
8074 * Clients may not extend, implement or mix-in this class. | |
8075 */ | |
8076 class ExecutionSetSubscriptionsParams implements HasToJson { | |
8077 List<ExecutionService> _subscriptions; | |
8078 | |
8079 /** | |
8080 * A list of the services being subscribed to. | |
8081 */ | |
8082 List<ExecutionService> get subscriptions => _subscriptions; | |
8083 | |
8084 /** | |
8085 * A list of the services being subscribed to. | |
8086 */ | |
8087 void set subscriptions(List<ExecutionService> value) { | |
8088 assert(value != null); | |
8089 this._subscriptions = value; | |
8090 } | |
8091 | |
8092 ExecutionSetSubscriptionsParams(List<ExecutionService> subscriptions) { | |
8093 this.subscriptions = subscriptions; | |
8094 } | |
8095 | |
8096 factory ExecutionSetSubscriptionsParams.fromJson( | |
8097 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
8098 if (json == null) { | |
8099 json = {}; | |
8100 } | |
8101 if (json is Map) { | |
8102 List<ExecutionService> subscriptions; | |
8103 if (json.containsKey("subscriptions")) { | |
8104 subscriptions = jsonDecoder.decodeList( | |
8105 jsonPath + ".subscriptions", | |
8106 json["subscriptions"], | |
8107 (String jsonPath, Object json) => | |
8108 new ExecutionService.fromJson(jsonDecoder, jsonPath, json)); | |
8109 } else { | |
8110 throw jsonDecoder.missingKey(jsonPath, "subscriptions"); | |
8111 } | |
8112 return new ExecutionSetSubscriptionsParams(subscriptions); | |
8113 } else { | |
8114 throw jsonDecoder.mismatch( | |
8115 jsonPath, "execution.setSubscriptions params", json); | |
8116 } | |
8117 } | |
8118 | |
8119 factory ExecutionSetSubscriptionsParams.fromRequest(Request request) { | |
8120 return new ExecutionSetSubscriptionsParams.fromJson( | |
8121 new RequestDecoder(request), "params", request._params); | |
8122 } | |
8123 | |
8124 Map<String, dynamic> toJson() { | |
8125 Map<String, dynamic> result = {}; | |
8126 result["subscriptions"] = | |
8127 subscriptions.map((ExecutionService value) => value.toJson()).toList(); | |
8128 return result; | |
8129 } | |
8130 | |
8131 Request toRequest(String id) { | |
8132 return new Request(id, "execution.setSubscriptions", toJson()); | |
8133 } | |
8134 | |
8135 @override | |
8136 String toString() => JSON.encode(toJson()); | |
8137 | |
8138 @override | |
8139 bool operator ==(other) { | |
8140 if (other is ExecutionSetSubscriptionsParams) { | |
8141 return listEqual(subscriptions, other.subscriptions, | |
8142 (ExecutionService a, ExecutionService b) => a == b); | |
8143 } | |
8144 return false; | |
8145 } | |
8146 | |
8147 @override | |
8148 int get hashCode { | |
8149 int hash = 0; | |
8150 hash = JenkinsSmiHash.combine(hash, subscriptions.hashCode); | |
8151 return JenkinsSmiHash.finish(hash); | |
8152 } | |
8153 } | |
8154 | |
8155 /** | |
8156 * execution.setSubscriptions result | |
8157 * | |
8158 * Clients may not extend, implement or mix-in this class. | |
8159 */ | |
8160 class ExecutionSetSubscriptionsResult { | |
8161 Response toResponse(String id) { | |
8162 return new Response(id, result: null); | |
8163 } | |
8164 | |
8165 @override | |
8166 bool operator ==(other) { | |
8167 if (other is ExecutionSetSubscriptionsResult) { | |
8168 return true; | |
8169 } | |
8170 return false; | |
8171 } | |
8172 | |
8173 @override | |
8174 int get hashCode { | |
8175 return 287678780; | |
8176 } | |
8177 } | |
8178 | |
8179 /** | |
8180 * execution.launchData params | |
8181 * | |
8182 * { | |
8183 * "file": FilePath | |
8184 * "kind": optional ExecutableKind | |
8185 * "referencedFiles": optional List<FilePath> | |
8186 * } | |
8187 * | |
8188 * Clients may not extend, implement or mix-in this class. | |
8189 */ | |
8190 class ExecutionLaunchDataParams implements HasToJson { | |
8191 String _file; | |
8192 | |
8193 ExecutableKind _kind; | |
8194 | |
8195 List<String> _referencedFiles; | |
8196 | |
8197 /** | |
8198 * The file for which launch data is being provided. This will either be a | |
8199 * Dart library or an HTML file. | |
8200 */ | |
8201 String get file => _file; | |
8202 | |
8203 /** | |
8204 * The file for which launch data is being provided. This will either be a | |
8205 * Dart library or an HTML file. | |
8206 */ | |
8207 void set file(String value) { | |
8208 assert(value != null); | |
8209 this._file = value; | |
8210 } | |
8211 | |
8212 /** | |
8213 * The kind of the executable file. This field is omitted if the file is not | |
8214 * a Dart file. | |
8215 */ | |
8216 ExecutableKind get kind => _kind; | |
8217 | |
8218 /** | |
8219 * The kind of the executable file. This field is omitted if the file is not | |
8220 * a Dart file. | |
8221 */ | |
8222 void set kind(ExecutableKind value) { | |
8223 this._kind = value; | |
8224 } | |
8225 | |
8226 /** | |
8227 * A list of the Dart files that are referenced by the file. This field is | |
8228 * omitted if the file is not an HTML file. | |
8229 */ | |
8230 List<String> get referencedFiles => _referencedFiles; | |
8231 | |
8232 /** | |
8233 * A list of the Dart files that are referenced by the file. This field is | |
8234 * omitted if the file is not an HTML file. | |
8235 */ | |
8236 void set referencedFiles(List<String> value) { | |
8237 this._referencedFiles = value; | |
8238 } | |
8239 | |
8240 ExecutionLaunchDataParams(String file, | |
8241 {ExecutableKind kind, List<String> referencedFiles}) { | |
8242 this.file = file; | |
8243 this.kind = kind; | |
8244 this.referencedFiles = referencedFiles; | |
8245 } | |
8246 | |
8247 factory ExecutionLaunchDataParams.fromJson( | |
8248 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
8249 if (json == null) { | |
8250 json = {}; | |
8251 } | |
8252 if (json is Map) { | |
8253 String file; | |
8254 if (json.containsKey("file")) { | |
8255 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
8256 } else { | |
8257 throw jsonDecoder.missingKey(jsonPath, "file"); | |
8258 } | |
8259 ExecutableKind kind; | |
8260 if (json.containsKey("kind")) { | |
8261 kind = new ExecutableKind.fromJson( | |
8262 jsonDecoder, jsonPath + ".kind", json["kind"]); | |
8263 } | |
8264 List<String> referencedFiles; | |
8265 if (json.containsKey("referencedFiles")) { | |
8266 referencedFiles = jsonDecoder.decodeList(jsonPath + ".referencedFiles", | |
8267 json["referencedFiles"], jsonDecoder.decodeString); | |
8268 } | |
8269 return new ExecutionLaunchDataParams(file, | |
8270 kind: kind, referencedFiles: referencedFiles); | |
8271 } else { | |
8272 throw jsonDecoder.mismatch(jsonPath, "execution.launchData params", json); | |
8273 } | |
8274 } | |
8275 | |
8276 factory ExecutionLaunchDataParams.fromNotification( | |
8277 Notification notification) { | |
8278 return new ExecutionLaunchDataParams.fromJson( | |
8279 new ResponseDecoder(null), "params", notification._params); | |
8280 } | |
8281 | |
8282 Map<String, dynamic> toJson() { | |
8283 Map<String, dynamic> result = {}; | |
8284 result["file"] = file; | |
8285 if (kind != null) { | |
8286 result["kind"] = kind.toJson(); | |
8287 } | |
8288 if (referencedFiles != null) { | |
8289 result["referencedFiles"] = referencedFiles; | |
8290 } | |
8291 return result; | |
8292 } | |
8293 | |
8294 Notification toNotification() { | |
8295 return new Notification("execution.launchData", toJson()); | |
8296 } | |
8297 | |
8298 @override | |
8299 String toString() => JSON.encode(toJson()); | |
8300 | |
8301 @override | |
8302 bool operator ==(other) { | |
8303 if (other is ExecutionLaunchDataParams) { | |
8304 return file == other.file && | |
8305 kind == other.kind && | |
8306 listEqual(referencedFiles, other.referencedFiles, | |
8307 (String a, String b) => a == b); | |
8308 } | |
8309 return false; | |
8310 } | |
8311 | |
8312 @override | |
8313 int get hashCode { | |
8314 int hash = 0; | |
8315 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
8316 hash = JenkinsSmiHash.combine(hash, kind.hashCode); | |
8317 hash = JenkinsSmiHash.combine(hash, referencedFiles.hashCode); | |
8318 return JenkinsSmiHash.finish(hash); | |
8319 } | |
8320 } | |
8321 | |
8322 /** | |
8323 * diagnostic.getDiagnostics params | |
8324 * | |
8325 * Clients may not extend, implement or mix-in this class. | |
8326 */ | |
8327 class DiagnosticGetDiagnosticsParams { | |
8328 Request toRequest(String id) { | |
8329 return new Request(id, "diagnostic.getDiagnostics", null); | |
8330 } | |
8331 | |
8332 @override | |
8333 bool operator ==(other) { | |
8334 if (other is DiagnosticGetDiagnosticsParams) { | |
8335 return true; | |
8336 } | |
8337 return false; | |
8338 } | |
8339 | |
8340 @override | |
8341 int get hashCode { | |
8342 return 587526202; | |
8343 } | |
8344 } | |
8345 | |
8346 /** | |
8347 * diagnostic.getDiagnostics result | |
8348 * | |
8349 * { | |
8350 * "contexts": List<ContextData> | |
8351 * } | |
8352 * | |
8353 * Clients may not extend, implement or mix-in this class. | |
8354 */ | |
8355 class DiagnosticGetDiagnosticsResult implements HasToJson { | |
8356 List<ContextData> _contexts; | |
8357 | |
8358 /** | |
8359 * The list of analysis contexts. | |
8360 */ | |
8361 List<ContextData> get contexts => _contexts; | |
8362 | |
8363 /** | |
8364 * The list of analysis contexts. | |
8365 */ | |
8366 void set contexts(List<ContextData> value) { | |
8367 assert(value != null); | |
8368 this._contexts = value; | |
8369 } | |
8370 | |
8371 DiagnosticGetDiagnosticsResult(List<ContextData> contexts) { | |
8372 this.contexts = contexts; | |
8373 } | |
8374 | |
8375 factory DiagnosticGetDiagnosticsResult.fromJson( | |
8376 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
8377 if (json == null) { | |
8378 json = {}; | |
8379 } | |
8380 if (json is Map) { | |
8381 List<ContextData> contexts; | |
8382 if (json.containsKey("contexts")) { | |
8383 contexts = jsonDecoder.decodeList( | |
8384 jsonPath + ".contexts", | |
8385 json["contexts"], | |
8386 (String jsonPath, Object json) => | |
8387 new ContextData.fromJson(jsonDecoder, jsonPath, json)); | |
8388 } else { | |
8389 throw jsonDecoder.missingKey(jsonPath, "contexts"); | |
8390 } | |
8391 return new DiagnosticGetDiagnosticsResult(contexts); | |
8392 } else { | |
8393 throw jsonDecoder.mismatch( | |
8394 jsonPath, "diagnostic.getDiagnostics result", json); | |
8395 } | |
8396 } | |
8397 | |
8398 factory DiagnosticGetDiagnosticsResult.fromResponse(Response response) { | |
8399 return new DiagnosticGetDiagnosticsResult.fromJson( | |
8400 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
8401 "result", | |
8402 response._result); | |
8403 } | |
8404 | |
8405 Map<String, dynamic> toJson() { | |
8406 Map<String, dynamic> result = {}; | |
8407 result["contexts"] = | |
8408 contexts.map((ContextData value) => value.toJson()).toList(); | |
8409 return result; | |
8410 } | |
8411 | |
8412 Response toResponse(String id) { | |
8413 return new Response(id, result: toJson()); | |
8414 } | |
8415 | |
8416 @override | |
8417 String toString() => JSON.encode(toJson()); | |
8418 | |
8419 @override | |
8420 bool operator ==(other) { | |
8421 if (other is DiagnosticGetDiagnosticsResult) { | |
8422 return listEqual( | |
8423 contexts, other.contexts, (ContextData a, ContextData b) => a == b); | |
8424 } | |
8425 return false; | |
8426 } | |
8427 | |
8428 @override | |
8429 int get hashCode { | |
8430 int hash = 0; | |
8431 hash = JenkinsSmiHash.combine(hash, contexts.hashCode); | |
8432 return JenkinsSmiHash.finish(hash); | |
8433 } | |
8434 } | |
8435 | |
8436 /** | |
8437 * diagnostic.getServerPort params | |
8438 * | |
8439 * Clients may not extend, implement or mix-in this class. | |
8440 */ | |
8441 class DiagnosticGetServerPortParams { | |
8442 Request toRequest(String id) { | |
8443 return new Request(id, "diagnostic.getServerPort", null); | |
8444 } | |
8445 | |
8446 @override | |
8447 bool operator ==(other) { | |
8448 if (other is DiagnosticGetServerPortParams) { | |
8449 return true; | |
8450 } | |
8451 return false; | |
8452 } | |
8453 | |
8454 @override | |
8455 int get hashCode { | |
8456 return 367508704; | |
8457 } | |
8458 } | |
8459 | |
8460 /** | |
8461 * diagnostic.getServerPort result | |
8462 * | |
8463 * { | |
8464 * "port": int | |
8465 * } | |
8466 * | |
8467 * Clients may not extend, implement or mix-in this class. | |
8468 */ | |
8469 class DiagnosticGetServerPortResult implements HasToJson { | |
8470 int _port; | |
8471 | |
8472 /** | |
8473 * The diagnostic server port. | |
8474 */ | |
8475 int get port => _port; | |
8476 | |
8477 /** | |
8478 * The diagnostic server port. | |
8479 */ | |
8480 void set port(int value) { | |
8481 assert(value != null); | |
8482 this._port = value; | |
8483 } | |
8484 | |
8485 DiagnosticGetServerPortResult(int port) { | |
8486 this.port = port; | |
8487 } | |
8488 | |
8489 factory DiagnosticGetServerPortResult.fromJson( | |
8490 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
8491 if (json == null) { | |
8492 json = {}; | |
8493 } | |
8494 if (json is Map) { | |
8495 int port; | |
8496 if (json.containsKey("port")) { | |
8497 port = jsonDecoder.decodeInt(jsonPath + ".port", json["port"]); | |
8498 } else { | |
8499 throw jsonDecoder.missingKey(jsonPath, "port"); | |
8500 } | |
8501 return new DiagnosticGetServerPortResult(port); | |
8502 } else { | |
8503 throw jsonDecoder.mismatch( | |
8504 jsonPath, "diagnostic.getServerPort result", json); | |
8505 } | |
8506 } | |
8507 | |
8508 factory DiagnosticGetServerPortResult.fromResponse(Response response) { | |
8509 return new DiagnosticGetServerPortResult.fromJson( | |
8510 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
8511 "result", | |
8512 response._result); | |
8513 } | |
8514 | |
8515 Map<String, dynamic> toJson() { | |
8516 Map<String, dynamic> result = {}; | |
8517 result["port"] = port; | |
8518 return result; | |
8519 } | |
8520 | |
8521 Response toResponse(String id) { | |
8522 return new Response(id, result: toJson()); | |
8523 } | |
8524 | |
8525 @override | |
8526 String toString() => JSON.encode(toJson()); | |
8527 | |
8528 @override | |
8529 bool operator ==(other) { | |
8530 if (other is DiagnosticGetServerPortResult) { | |
8531 return port == other.port; | |
8532 } | |
8533 return false; | |
8534 } | |
8535 | |
8536 @override | |
8537 int get hashCode { | |
8538 int hash = 0; | |
8539 hash = JenkinsSmiHash.combine(hash, port.hashCode); | |
8540 return JenkinsSmiHash.finish(hash); | |
8541 } | |
8542 } | |
8543 | |
8544 /** | |
8545 * AddContentOverlay | |
8546 * | |
8547 * { | |
8548 * "type": "add" | |
8549 * "content": String | |
8550 * } | |
8551 * | |
8552 * Clients may not extend, implement or mix-in this class. | |
8553 */ | |
8554 class AddContentOverlay implements HasToJson { | |
8555 String _content; | |
8556 | |
8557 /** | |
8558 * The new content of the file. | |
8559 */ | |
8560 String get content => _content; | |
8561 | |
8562 /** | |
8563 * The new content of the file. | |
8564 */ | |
8565 void set content(String value) { | |
8566 assert(value != null); | |
8567 this._content = value; | |
8568 } | |
8569 | |
8570 AddContentOverlay(String content) { | |
8571 this.content = content; | |
8572 } | |
8573 | |
8574 factory AddContentOverlay.fromJson( | |
8575 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
8576 if (json == null) { | |
8577 json = {}; | |
8578 } | |
8579 if (json is Map) { | |
8580 if (json["type"] != "add") { | |
8581 throw jsonDecoder.mismatch(jsonPath, "equal " + "add", json); | |
8582 } | |
8583 String content; | |
8584 if (json.containsKey("content")) { | |
8585 content = | |
8586 jsonDecoder.decodeString(jsonPath + ".content", json["content"]); | |
8587 } else { | |
8588 throw jsonDecoder.missingKey(jsonPath, "content"); | |
8589 } | |
8590 return new AddContentOverlay(content); | |
8591 } else { | |
8592 throw jsonDecoder.mismatch(jsonPath, "AddContentOverlay", json); | |
8593 } | |
8594 } | |
8595 | |
8596 Map<String, dynamic> toJson() { | |
8597 Map<String, dynamic> result = {}; | |
8598 result["type"] = "add"; | |
8599 result["content"] = content; | |
8600 return result; | |
8601 } | |
8602 | |
8603 @override | |
8604 String toString() => JSON.encode(toJson()); | |
8605 | |
8606 @override | |
8607 bool operator ==(other) { | |
8608 if (other is AddContentOverlay) { | |
8609 return content == other.content; | |
8610 } | |
8611 return false; | |
8612 } | |
8613 | |
8614 @override | |
8615 int get hashCode { | |
8616 int hash = 0; | |
8617 hash = JenkinsSmiHash.combine(hash, 704418402); | |
8618 hash = JenkinsSmiHash.combine(hash, content.hashCode); | |
8619 return JenkinsSmiHash.finish(hash); | |
8620 } | |
8621 } | |
8622 | |
8623 /** | |
8624 * AnalysisError | |
8625 * | |
8626 * { | |
8627 * "severity": AnalysisErrorSeverity | |
8628 * "type": AnalysisErrorType | |
8629 * "location": Location | |
8630 * "message": String | |
8631 * "correction": optional String | |
8632 * "code": String | |
8633 * "hasFix": optional bool | |
8634 * } | |
8635 * | |
8636 * Clients may not extend, implement or mix-in this class. | |
8637 */ | |
8638 class AnalysisError implements HasToJson { | |
8639 AnalysisErrorSeverity _severity; | |
8640 | |
8641 AnalysisErrorType _type; | |
8642 | |
8643 Location _location; | |
8644 | |
8645 String _message; | |
8646 | |
8647 String _correction; | |
8648 | |
8649 String _code; | |
8650 | |
8651 bool _hasFix; | |
8652 | |
8653 /** | |
8654 * The severity of the error. | |
8655 */ | |
8656 AnalysisErrorSeverity get severity => _severity; | |
8657 | |
8658 /** | |
8659 * The severity of the error. | |
8660 */ | |
8661 void set severity(AnalysisErrorSeverity value) { | |
8662 assert(value != null); | |
8663 this._severity = value; | |
8664 } | |
8665 | |
8666 /** | |
8667 * The type of the error. | |
8668 */ | |
8669 AnalysisErrorType get type => _type; | |
8670 | |
8671 /** | |
8672 * The type of the error. | |
8673 */ | |
8674 void set type(AnalysisErrorType value) { | |
8675 assert(value != null); | |
8676 this._type = value; | |
8677 } | |
8678 | |
8679 /** | |
8680 * The location associated with the error. | |
8681 */ | |
8682 Location get location => _location; | |
8683 | |
8684 /** | |
8685 * The location associated with the error. | |
8686 */ | |
8687 void set location(Location value) { | |
8688 assert(value != null); | |
8689 this._location = value; | |
8690 } | |
8691 | |
8692 /** | |
8693 * The message to be displayed for this error. The message should indicate | |
8694 * what is wrong with the code and why it is wrong. | |
8695 */ | |
8696 String get message => _message; | |
8697 | |
8698 /** | |
8699 * The message to be displayed for this error. The message should indicate | |
8700 * what is wrong with the code and why it is wrong. | |
8701 */ | |
8702 void set message(String value) { | |
8703 assert(value != null); | |
8704 this._message = value; | |
8705 } | |
8706 | |
8707 /** | |
8708 * The correction message to be displayed for this error. The correction | |
8709 * message should indicate how the user can fix the error. The field is | |
8710 * omitted if there is no correction message associated with the error code. | |
8711 */ | |
8712 String get correction => _correction; | |
8713 | |
8714 /** | |
8715 * The correction message to be displayed for this error. The correction | |
8716 * message should indicate how the user can fix the error. The field is | |
8717 * omitted if there is no correction message associated with the error code. | |
8718 */ | |
8719 void set correction(String value) { | |
8720 this._correction = value; | |
8721 } | |
8722 | |
8723 /** | |
8724 * The name, as a string, of the error code associated with this error. | |
8725 */ | |
8726 String get code => _code; | |
8727 | |
8728 /** | |
8729 * The name, as a string, of the error code associated with this error. | |
8730 */ | |
8731 void set code(String value) { | |
8732 assert(value != null); | |
8733 this._code = value; | |
8734 } | |
8735 | |
8736 /** | |
8737 * A hint to indicate to interested clients that this error has an associated | |
8738 * fix (or fixes). The absence of this field implies there are not known to | |
8739 * be fixes. Note that since the operation to calculate whether fixes apply | |
8740 * needs to be performant it is possible that complicated tests will be | |
8741 * skipped and a false negative returned. For this reason, this attribute | |
8742 * should be treated as a "hint". Despite the possibility of false negatives, | |
8743 * no false positives should be returned. If a client sees this flag set they | |
8744 * can proceed with the confidence that there are in fact associated fixes. | |
8745 */ | |
8746 bool get hasFix => _hasFix; | |
8747 | |
8748 /** | |
8749 * A hint to indicate to interested clients that this error has an associated | |
8750 * fix (or fixes). The absence of this field implies there are not known to | |
8751 * be fixes. Note that since the operation to calculate whether fixes apply | |
8752 * needs to be performant it is possible that complicated tests will be | |
8753 * skipped and a false negative returned. For this reason, this attribute | |
8754 * should be treated as a "hint". Despite the possibility of false negatives, | |
8755 * no false positives should be returned. If a client sees this flag set they | |
8756 * can proceed with the confidence that there are in fact associated fixes. | |
8757 */ | |
8758 void set hasFix(bool value) { | |
8759 this._hasFix = value; | |
8760 } | |
8761 | |
8762 AnalysisError(AnalysisErrorSeverity severity, AnalysisErrorType type, | |
8763 Location location, String message, String code, | |
8764 {String correction, bool hasFix}) { | |
8765 this.severity = severity; | |
8766 this.type = type; | |
8767 this.location = location; | |
8768 this.message = message; | |
8769 this.correction = correction; | |
8770 this.code = code; | |
8771 this.hasFix = hasFix; | |
8772 } | |
8773 | |
8774 factory AnalysisError.fromJson( | |
8775 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
8776 if (json == null) { | |
8777 json = {}; | |
8778 } | |
8779 if (json is Map) { | |
8780 AnalysisErrorSeverity severity; | |
8781 if (json.containsKey("severity")) { | |
8782 severity = new AnalysisErrorSeverity.fromJson( | |
8783 jsonDecoder, jsonPath + ".severity", json["severity"]); | |
8784 } else { | |
8785 throw jsonDecoder.missingKey(jsonPath, "severity"); | |
8786 } | |
8787 AnalysisErrorType type; | |
8788 if (json.containsKey("type")) { | |
8789 type = new AnalysisErrorType.fromJson( | |
8790 jsonDecoder, jsonPath + ".type", json["type"]); | |
8791 } else { | |
8792 throw jsonDecoder.missingKey(jsonPath, "type"); | |
8793 } | |
8794 Location location; | |
8795 if (json.containsKey("location")) { | |
8796 location = new Location.fromJson( | |
8797 jsonDecoder, jsonPath + ".location", json["location"]); | |
8798 } else { | |
8799 throw jsonDecoder.missingKey(jsonPath, "location"); | |
8800 } | |
8801 String message; | |
8802 if (json.containsKey("message")) { | |
8803 message = | |
8804 jsonDecoder.decodeString(jsonPath + ".message", json["message"]); | |
8805 } else { | |
8806 throw jsonDecoder.missingKey(jsonPath, "message"); | |
8807 } | |
8808 String correction; | |
8809 if (json.containsKey("correction")) { | |
8810 correction = jsonDecoder.decodeString( | |
8811 jsonPath + ".correction", json["correction"]); | |
8812 } | |
8813 String code; | |
8814 if (json.containsKey("code")) { | |
8815 code = jsonDecoder.decodeString(jsonPath + ".code", json["code"]); | |
8816 } else { | |
8817 throw jsonDecoder.missingKey(jsonPath, "code"); | |
8818 } | |
8819 bool hasFix; | |
8820 if (json.containsKey("hasFix")) { | |
8821 hasFix = jsonDecoder.decodeBool(jsonPath + ".hasFix", json["hasFix"]); | |
8822 } | |
8823 return new AnalysisError(severity, type, location, message, code, | |
8824 correction: correction, hasFix: hasFix); | |
8825 } else { | |
8826 throw jsonDecoder.mismatch(jsonPath, "AnalysisError", json); | |
8827 } | |
8828 } | |
8829 | |
8830 Map<String, dynamic> toJson() { | |
8831 Map<String, dynamic> result = {}; | |
8832 result["severity"] = severity.toJson(); | |
8833 result["type"] = type.toJson(); | |
8834 result["location"] = location.toJson(); | |
8835 result["message"] = message; | |
8836 if (correction != null) { | |
8837 result["correction"] = correction; | |
8838 } | |
8839 result["code"] = code; | |
8840 if (hasFix != null) { | |
8841 result["hasFix"] = hasFix; | |
8842 } | |
8843 return result; | |
8844 } | |
8845 | |
8846 @override | |
8847 String toString() => JSON.encode(toJson()); | |
8848 | |
8849 @override | |
8850 bool operator ==(other) { | |
8851 if (other is AnalysisError) { | |
8852 return severity == other.severity && | |
8853 type == other.type && | |
8854 location == other.location && | |
8855 message == other.message && | |
8856 correction == other.correction && | |
8857 code == other.code && | |
8858 hasFix == other.hasFix; | |
8859 } | |
8860 return false; | |
8861 } | |
8862 | |
8863 @override | |
8864 int get hashCode { | |
8865 int hash = 0; | |
8866 hash = JenkinsSmiHash.combine(hash, severity.hashCode); | |
8867 hash = JenkinsSmiHash.combine(hash, type.hashCode); | |
8868 hash = JenkinsSmiHash.combine(hash, location.hashCode); | |
8869 hash = JenkinsSmiHash.combine(hash, message.hashCode); | |
8870 hash = JenkinsSmiHash.combine(hash, correction.hashCode); | |
8871 hash = JenkinsSmiHash.combine(hash, code.hashCode); | |
8872 hash = JenkinsSmiHash.combine(hash, hasFix.hashCode); | |
8873 return JenkinsSmiHash.finish(hash); | |
8874 } | |
8875 } | |
8876 | |
8877 /** | |
8878 * AnalysisErrorFixes | |
8879 * | |
8880 * { | |
8881 * "error": AnalysisError | |
8882 * "fixes": List<SourceChange> | |
8883 * } | |
8884 * | |
8885 * Clients may not extend, implement or mix-in this class. | |
8886 */ | |
8887 class AnalysisErrorFixes implements HasToJson { | |
8888 AnalysisError _error; | |
8889 | |
8890 List<SourceChange> _fixes; | |
8891 | |
8892 /** | |
8893 * The error with which the fixes are associated. | |
8894 */ | |
8895 AnalysisError get error => _error; | |
8896 | |
8897 /** | |
8898 * The error with which the fixes are associated. | |
8899 */ | |
8900 void set error(AnalysisError value) { | |
8901 assert(value != null); | |
8902 this._error = value; | |
8903 } | |
8904 | |
8905 /** | |
8906 * The fixes associated with the error. | |
8907 */ | |
8908 List<SourceChange> get fixes => _fixes; | |
8909 | |
8910 /** | |
8911 * The fixes associated with the error. | |
8912 */ | |
8913 void set fixes(List<SourceChange> value) { | |
8914 assert(value != null); | |
8915 this._fixes = value; | |
8916 } | |
8917 | |
8918 AnalysisErrorFixes(AnalysisError error, {List<SourceChange> fixes}) { | |
8919 this.error = error; | |
8920 if (fixes == null) { | |
8921 this.fixes = <SourceChange>[]; | |
8922 } else { | |
8923 this.fixes = fixes; | |
8924 } | |
8925 } | |
8926 | |
8927 factory AnalysisErrorFixes.fromJson( | |
8928 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
8929 if (json == null) { | |
8930 json = {}; | |
8931 } | |
8932 if (json is Map) { | |
8933 AnalysisError error; | |
8934 if (json.containsKey("error")) { | |
8935 error = new AnalysisError.fromJson( | |
8936 jsonDecoder, jsonPath + ".error", json["error"]); | |
8937 } else { | |
8938 throw jsonDecoder.missingKey(jsonPath, "error"); | |
8939 } | |
8940 List<SourceChange> fixes; | |
8941 if (json.containsKey("fixes")) { | |
8942 fixes = jsonDecoder.decodeList( | |
8943 jsonPath + ".fixes", | |
8944 json["fixes"], | |
8945 (String jsonPath, Object json) => | |
8946 new SourceChange.fromJson(jsonDecoder, jsonPath, json)); | |
8947 } else { | |
8948 throw jsonDecoder.missingKey(jsonPath, "fixes"); | |
8949 } | |
8950 return new AnalysisErrorFixes(error, fixes: fixes); | |
8951 } else { | |
8952 throw jsonDecoder.mismatch(jsonPath, "AnalysisErrorFixes", json); | |
8953 } | |
8954 } | |
8955 | |
8956 Map<String, dynamic> toJson() { | |
8957 Map<String, dynamic> result = {}; | |
8958 result["error"] = error.toJson(); | |
8959 result["fixes"] = | |
8960 fixes.map((SourceChange value) => value.toJson()).toList(); | |
8961 return result; | |
8962 } | |
8963 | |
8964 @override | |
8965 String toString() => JSON.encode(toJson()); | |
8966 | |
8967 @override | |
8968 bool operator ==(other) { | |
8969 if (other is AnalysisErrorFixes) { | |
8970 return error == other.error && | |
8971 listEqual( | |
8972 fixes, other.fixes, (SourceChange a, SourceChange b) => a == b); | |
8973 } | |
8974 return false; | |
8975 } | |
8976 | |
8977 @override | |
8978 int get hashCode { | |
8979 int hash = 0; | |
8980 hash = JenkinsSmiHash.combine(hash, error.hashCode); | |
8981 hash = JenkinsSmiHash.combine(hash, fixes.hashCode); | |
8982 return JenkinsSmiHash.finish(hash); | |
8983 } | |
8984 } | |
8985 | |
8986 /** | |
8987 * AnalysisErrorSeverity | |
8988 * | |
8989 * enum { | |
8990 * INFO | |
8991 * WARNING | |
8992 * ERROR | |
8993 * } | |
8994 * | |
8995 * Clients may not extend, implement or mix-in this class. | |
8996 */ | |
8997 class AnalysisErrorSeverity implements Enum { | |
8998 static const AnalysisErrorSeverity INFO = | |
8999 const AnalysisErrorSeverity._("INFO"); | |
9000 | |
9001 static const AnalysisErrorSeverity WARNING = | |
9002 const AnalysisErrorSeverity._("WARNING"); | |
9003 | |
9004 static const AnalysisErrorSeverity ERROR = | |
9005 const AnalysisErrorSeverity._("ERROR"); | |
9006 | |
9007 /** | |
9008 * A list containing all of the enum values that are defined. | |
9009 */ | |
9010 static const List<AnalysisErrorSeverity> VALUES = | |
9011 const <AnalysisErrorSeverity>[INFO, WARNING, ERROR]; | |
9012 | |
9013 final String name; | |
9014 | |
9015 const AnalysisErrorSeverity._(this.name); | |
9016 | |
9017 factory AnalysisErrorSeverity(String name) { | |
9018 switch (name) { | |
9019 case "INFO": | |
9020 return INFO; | |
9021 case "WARNING": | |
9022 return WARNING; | |
9023 case "ERROR": | |
9024 return ERROR; | |
9025 } | |
9026 throw new Exception('Illegal enum value: $name'); | |
9027 } | |
9028 | |
9029 factory AnalysisErrorSeverity.fromJson( | |
9030 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
9031 if (json is String) { | |
9032 try { | |
9033 return new AnalysisErrorSeverity(json); | |
9034 } catch (_) { | |
9035 // Fall through | |
9036 } | |
9037 } | |
9038 throw jsonDecoder.mismatch(jsonPath, "AnalysisErrorSeverity", json); | |
9039 } | |
9040 | |
9041 @override | |
9042 String toString() => "AnalysisErrorSeverity.$name"; | |
9043 | |
9044 String toJson() => name; | |
9045 } | |
9046 | |
9047 /** | |
9048 * AnalysisErrorType | |
9049 * | |
9050 * enum { | |
9051 * CHECKED_MODE_COMPILE_TIME_ERROR | |
9052 * COMPILE_TIME_ERROR | |
9053 * HINT | |
9054 * LINT | |
9055 * STATIC_TYPE_WARNING | |
9056 * STATIC_WARNING | |
9057 * SYNTACTIC_ERROR | |
9058 * TODO | |
9059 * } | |
9060 * | |
9061 * Clients may not extend, implement or mix-in this class. | |
9062 */ | |
9063 class AnalysisErrorType implements Enum { | |
9064 static const AnalysisErrorType CHECKED_MODE_COMPILE_TIME_ERROR = | |
9065 const AnalysisErrorType._("CHECKED_MODE_COMPILE_TIME_ERROR"); | |
9066 | |
9067 static const AnalysisErrorType COMPILE_TIME_ERROR = | |
9068 const AnalysisErrorType._("COMPILE_TIME_ERROR"); | |
9069 | |
9070 static const AnalysisErrorType HINT = const AnalysisErrorType._("HINT"); | |
9071 | |
9072 static const AnalysisErrorType LINT = const AnalysisErrorType._("LINT"); | |
9073 | |
9074 static const AnalysisErrorType STATIC_TYPE_WARNING = | |
9075 const AnalysisErrorType._("STATIC_TYPE_WARNING"); | |
9076 | |
9077 static const AnalysisErrorType STATIC_WARNING = | |
9078 const AnalysisErrorType._("STATIC_WARNING"); | |
9079 | |
9080 static const AnalysisErrorType SYNTACTIC_ERROR = | |
9081 const AnalysisErrorType._("SYNTACTIC_ERROR"); | |
9082 | |
9083 static const AnalysisErrorType TODO = const AnalysisErrorType._("TODO"); | |
9084 | |
9085 /** | |
9086 * A list containing all of the enum values that are defined. | |
9087 */ | |
9088 static const List<AnalysisErrorType> VALUES = const <AnalysisErrorType>[ | |
9089 CHECKED_MODE_COMPILE_TIME_ERROR, | |
9090 COMPILE_TIME_ERROR, | |
9091 HINT, | |
9092 LINT, | |
9093 STATIC_TYPE_WARNING, | |
9094 STATIC_WARNING, | |
9095 SYNTACTIC_ERROR, | |
9096 TODO | |
9097 ]; | |
9098 | |
9099 final String name; | |
9100 | |
9101 const AnalysisErrorType._(this.name); | |
9102 | |
9103 factory AnalysisErrorType(String name) { | |
9104 switch (name) { | |
9105 case "CHECKED_MODE_COMPILE_TIME_ERROR": | |
9106 return CHECKED_MODE_COMPILE_TIME_ERROR; | |
9107 case "COMPILE_TIME_ERROR": | |
9108 return COMPILE_TIME_ERROR; | |
9109 case "HINT": | |
9110 return HINT; | |
9111 case "LINT": | |
9112 return LINT; | |
9113 case "STATIC_TYPE_WARNING": | |
9114 return STATIC_TYPE_WARNING; | |
9115 case "STATIC_WARNING": | |
9116 return STATIC_WARNING; | |
9117 case "SYNTACTIC_ERROR": | |
9118 return SYNTACTIC_ERROR; | |
9119 case "TODO": | |
9120 return TODO; | |
9121 } | |
9122 throw new Exception('Illegal enum value: $name'); | |
9123 } | |
9124 | |
9125 factory AnalysisErrorType.fromJson( | |
9126 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
9127 if (json is String) { | |
9128 try { | |
9129 return new AnalysisErrorType(json); | |
9130 } catch (_) { | |
9131 // Fall through | |
9132 } | |
9133 } | |
9134 throw jsonDecoder.mismatch(jsonPath, "AnalysisErrorType", json); | |
9135 } | |
9136 | |
9137 @override | |
9138 String toString() => "AnalysisErrorType.$name"; | |
9139 | |
9140 String toJson() => name; | |
9141 } | |
9142 | |
9143 /** | |
9144 * AnalysisOptions | |
9145 * | |
9146 * { | |
9147 * "enableAsync": optional bool | |
9148 * "enableDeferredLoading": optional bool | |
9149 * "enableEnums": optional bool | |
9150 * "enableNullAwareOperators": optional bool | |
9151 * "enableSuperMixins": optional bool | |
9152 * "generateDart2jsHints": optional bool | |
9153 * "generateHints": optional bool | |
9154 * "generateLints": optional bool | |
9155 * } | |
9156 * | |
9157 * Clients may not extend, implement or mix-in this class. | |
9158 */ | |
9159 class AnalysisOptions implements HasToJson { | |
9160 bool _enableAsync; | |
9161 | |
9162 bool _enableDeferredLoading; | |
9163 | |
9164 bool _enableEnums; | |
9165 | |
9166 bool _enableNullAwareOperators; | |
9167 | |
9168 bool _enableSuperMixins; | |
9169 | |
9170 bool _generateDart2jsHints; | |
9171 | |
9172 bool _generateHints; | |
9173 | |
9174 bool _generateLints; | |
9175 | |
9176 /** | |
9177 * Deprecated: this feature is always enabled. | |
9178 * | |
9179 * True if the client wants to enable support for the proposed async feature. | |
9180 */ | |
9181 bool get enableAsync => _enableAsync; | |
9182 | |
9183 /** | |
9184 * Deprecated: this feature is always enabled. | |
9185 * | |
9186 * True if the client wants to enable support for the proposed async feature. | |
9187 */ | |
9188 void set enableAsync(bool value) { | |
9189 this._enableAsync = value; | |
9190 } | |
9191 | |
9192 /** | |
9193 * Deprecated: this feature is always enabled. | |
9194 * | |
9195 * True if the client wants to enable support for the proposed deferred | |
9196 * loading feature. | |
9197 */ | |
9198 bool get enableDeferredLoading => _enableDeferredLoading; | |
9199 | |
9200 /** | |
9201 * Deprecated: this feature is always enabled. | |
9202 * | |
9203 * True if the client wants to enable support for the proposed deferred | |
9204 * loading feature. | |
9205 */ | |
9206 void set enableDeferredLoading(bool value) { | |
9207 this._enableDeferredLoading = value; | |
9208 } | |
9209 | |
9210 /** | |
9211 * Deprecated: this feature is always enabled. | |
9212 * | |
9213 * True if the client wants to enable support for the proposed enum feature. | |
9214 */ | |
9215 bool get enableEnums => _enableEnums; | |
9216 | |
9217 /** | |
9218 * Deprecated: this feature is always enabled. | |
9219 * | |
9220 * True if the client wants to enable support for the proposed enum feature. | |
9221 */ | |
9222 void set enableEnums(bool value) { | |
9223 this._enableEnums = value; | |
9224 } | |
9225 | |
9226 /** | |
9227 * Deprecated: this feature is always enabled. | |
9228 * | |
9229 * True if the client wants to enable support for the proposed "null aware | |
9230 * operators" feature. | |
9231 */ | |
9232 bool get enableNullAwareOperators => _enableNullAwareOperators; | |
9233 | |
9234 /** | |
9235 * Deprecated: this feature is always enabled. | |
9236 * | |
9237 * True if the client wants to enable support for the proposed "null aware | |
9238 * operators" feature. | |
9239 */ | |
9240 void set enableNullAwareOperators(bool value) { | |
9241 this._enableNullAwareOperators = value; | |
9242 } | |
9243 | |
9244 /** | |
9245 * True if the client wants to enable support for the proposed "less | |
9246 * restricted mixins" proposal (DEP 34). | |
9247 */ | |
9248 bool get enableSuperMixins => _enableSuperMixins; | |
9249 | |
9250 /** | |
9251 * True if the client wants to enable support for the proposed "less | |
9252 * restricted mixins" proposal (DEP 34). | |
9253 */ | |
9254 void set enableSuperMixins(bool value) { | |
9255 this._enableSuperMixins = value; | |
9256 } | |
9257 | |
9258 /** | |
9259 * True if hints that are specific to dart2js should be generated. This | |
9260 * option is ignored if generateHints is false. | |
9261 */ | |
9262 bool get generateDart2jsHints => _generateDart2jsHints; | |
9263 | |
9264 /** | |
9265 * True if hints that are specific to dart2js should be generated. This | |
9266 * option is ignored if generateHints is false. | |
9267 */ | |
9268 void set generateDart2jsHints(bool value) { | |
9269 this._generateDart2jsHints = value; | |
9270 } | |
9271 | |
9272 /** | |
9273 * True if hints should be generated as part of generating errors and | |
9274 * warnings. | |
9275 */ | |
9276 bool get generateHints => _generateHints; | |
9277 | |
9278 /** | |
9279 * True if hints should be generated as part of generating errors and | |
9280 * warnings. | |
9281 */ | |
9282 void set generateHints(bool value) { | |
9283 this._generateHints = value; | |
9284 } | |
9285 | |
9286 /** | |
9287 * True if lints should be generated as part of generating errors and | |
9288 * warnings. | |
9289 */ | |
9290 bool get generateLints => _generateLints; | |
9291 | |
9292 /** | |
9293 * True if lints should be generated as part of generating errors and | |
9294 * warnings. | |
9295 */ | |
9296 void set generateLints(bool value) { | |
9297 this._generateLints = value; | |
9298 } | |
9299 | |
9300 AnalysisOptions( | |
9301 {bool enableAsync, | |
9302 bool enableDeferredLoading, | |
9303 bool enableEnums, | |
9304 bool enableNullAwareOperators, | |
9305 bool enableSuperMixins, | |
9306 bool generateDart2jsHints, | |
9307 bool generateHints, | |
9308 bool generateLints}) { | |
9309 this.enableAsync = enableAsync; | |
9310 this.enableDeferredLoading = enableDeferredLoading; | |
9311 this.enableEnums = enableEnums; | |
9312 this.enableNullAwareOperators = enableNullAwareOperators; | |
9313 this.enableSuperMixins = enableSuperMixins; | |
9314 this.generateDart2jsHints = generateDart2jsHints; | |
9315 this.generateHints = generateHints; | |
9316 this.generateLints = generateLints; | |
9317 } | |
9318 | |
9319 factory AnalysisOptions.fromJson( | |
9320 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
9321 if (json == null) { | |
9322 json = {}; | |
9323 } | |
9324 if (json is Map) { | |
9325 bool enableAsync; | |
9326 if (json.containsKey("enableAsync")) { | |
9327 enableAsync = jsonDecoder.decodeBool( | |
9328 jsonPath + ".enableAsync", json["enableAsync"]); | |
9329 } | |
9330 bool enableDeferredLoading; | |
9331 if (json.containsKey("enableDeferredLoading")) { | |
9332 enableDeferredLoading = jsonDecoder.decodeBool( | |
9333 jsonPath + ".enableDeferredLoading", json["enableDeferredLoading"]); | |
9334 } | |
9335 bool enableEnums; | |
9336 if (json.containsKey("enableEnums")) { | |
9337 enableEnums = jsonDecoder.decodeBool( | |
9338 jsonPath + ".enableEnums", json["enableEnums"]); | |
9339 } | |
9340 bool enableNullAwareOperators; | |
9341 if (json.containsKey("enableNullAwareOperators")) { | |
9342 enableNullAwareOperators = jsonDecoder.decodeBool( | |
9343 jsonPath + ".enableNullAwareOperators", | |
9344 json["enableNullAwareOperators"]); | |
9345 } | |
9346 bool enableSuperMixins; | |
9347 if (json.containsKey("enableSuperMixins")) { | |
9348 enableSuperMixins = jsonDecoder.decodeBool( | |
9349 jsonPath + ".enableSuperMixins", json["enableSuperMixins"]); | |
9350 } | |
9351 bool generateDart2jsHints; | |
9352 if (json.containsKey("generateDart2jsHints")) { | |
9353 generateDart2jsHints = jsonDecoder.decodeBool( | |
9354 jsonPath + ".generateDart2jsHints", json["generateDart2jsHints"]); | |
9355 } | |
9356 bool generateHints; | |
9357 if (json.containsKey("generateHints")) { | |
9358 generateHints = jsonDecoder.decodeBool( | |
9359 jsonPath + ".generateHints", json["generateHints"]); | |
9360 } | |
9361 bool generateLints; | |
9362 if (json.containsKey("generateLints")) { | |
9363 generateLints = jsonDecoder.decodeBool( | |
9364 jsonPath + ".generateLints", json["generateLints"]); | |
9365 } | |
9366 return new AnalysisOptions( | |
9367 enableAsync: enableAsync, | |
9368 enableDeferredLoading: enableDeferredLoading, | |
9369 enableEnums: enableEnums, | |
9370 enableNullAwareOperators: enableNullAwareOperators, | |
9371 enableSuperMixins: enableSuperMixins, | |
9372 generateDart2jsHints: generateDart2jsHints, | |
9373 generateHints: generateHints, | |
9374 generateLints: generateLints); | |
9375 } else { | |
9376 throw jsonDecoder.mismatch(jsonPath, "AnalysisOptions", json); | |
9377 } | |
9378 } | |
9379 | |
9380 Map<String, dynamic> toJson() { | |
9381 Map<String, dynamic> result = {}; | |
9382 if (enableAsync != null) { | |
9383 result["enableAsync"] = enableAsync; | |
9384 } | |
9385 if (enableDeferredLoading != null) { | |
9386 result["enableDeferredLoading"] = enableDeferredLoading; | |
9387 } | |
9388 if (enableEnums != null) { | |
9389 result["enableEnums"] = enableEnums; | |
9390 } | |
9391 if (enableNullAwareOperators != null) { | |
9392 result["enableNullAwareOperators"] = enableNullAwareOperators; | |
9393 } | |
9394 if (enableSuperMixins != null) { | |
9395 result["enableSuperMixins"] = enableSuperMixins; | |
9396 } | |
9397 if (generateDart2jsHints != null) { | |
9398 result["generateDart2jsHints"] = generateDart2jsHints; | |
9399 } | |
9400 if (generateHints != null) { | |
9401 result["generateHints"] = generateHints; | |
9402 } | |
9403 if (generateLints != null) { | |
9404 result["generateLints"] = generateLints; | |
9405 } | |
9406 return result; | |
9407 } | |
9408 | |
9409 @override | |
9410 String toString() => JSON.encode(toJson()); | |
9411 | |
9412 @override | |
9413 bool operator ==(other) { | |
9414 if (other is AnalysisOptions) { | |
9415 return enableAsync == other.enableAsync && | |
9416 enableDeferredLoading == other.enableDeferredLoading && | |
9417 enableEnums == other.enableEnums && | |
9418 enableNullAwareOperators == other.enableNullAwareOperators && | |
9419 enableSuperMixins == other.enableSuperMixins && | |
9420 generateDart2jsHints == other.generateDart2jsHints && | |
9421 generateHints == other.generateHints && | |
9422 generateLints == other.generateLints; | |
9423 } | |
9424 return false; | |
9425 } | |
9426 | |
9427 @override | |
9428 int get hashCode { | |
9429 int hash = 0; | |
9430 hash = JenkinsSmiHash.combine(hash, enableAsync.hashCode); | |
9431 hash = JenkinsSmiHash.combine(hash, enableDeferredLoading.hashCode); | |
9432 hash = JenkinsSmiHash.combine(hash, enableEnums.hashCode); | |
9433 hash = JenkinsSmiHash.combine(hash, enableNullAwareOperators.hashCode); | |
9434 hash = JenkinsSmiHash.combine(hash, enableSuperMixins.hashCode); | |
9435 hash = JenkinsSmiHash.combine(hash, generateDart2jsHints.hashCode); | |
9436 hash = JenkinsSmiHash.combine(hash, generateHints.hashCode); | |
9437 hash = JenkinsSmiHash.combine(hash, generateLints.hashCode); | |
9438 return JenkinsSmiHash.finish(hash); | |
9439 } | |
9440 } | |
9441 | |
9442 /** | |
9443 * AnalysisService | |
9444 * | |
9445 * enum { | |
9446 * FOLDING | |
9447 * HIGHLIGHTS | |
9448 * IMPLEMENTED | |
9449 * INVALIDATE | |
9450 * NAVIGATION | |
9451 * OCCURRENCES | |
9452 * OUTLINE | |
9453 * OVERRIDES | |
9454 * } | |
9455 * | |
9456 * Clients may not extend, implement or mix-in this class. | |
9457 */ | |
9458 class AnalysisService implements Enum { | |
9459 static const AnalysisService FOLDING = const AnalysisService._("FOLDING"); | |
9460 | |
9461 static const AnalysisService HIGHLIGHTS = | |
9462 const AnalysisService._("HIGHLIGHTS"); | |
9463 | |
9464 static const AnalysisService IMPLEMENTED = | |
9465 const AnalysisService._("IMPLEMENTED"); | |
9466 | |
9467 /** | |
9468 * This service is not currently implemented and will become a | |
9469 * GeneralAnalysisService in a future release. | |
9470 */ | |
9471 static const AnalysisService INVALIDATE = | |
9472 const AnalysisService._("INVALIDATE"); | |
9473 | |
9474 static const AnalysisService NAVIGATION = | |
9475 const AnalysisService._("NAVIGATION"); | |
9476 | |
9477 static const AnalysisService OCCURRENCES = | |
9478 const AnalysisService._("OCCURRENCES"); | |
9479 | |
9480 static const AnalysisService OUTLINE = const AnalysisService._("OUTLINE"); | |
9481 | |
9482 static const AnalysisService OVERRIDES = const AnalysisService._("OVERRIDES"); | |
9483 | |
9484 /** | |
9485 * A list containing all of the enum values that are defined. | |
9486 */ | |
9487 static const List<AnalysisService> VALUES = const <AnalysisService>[ | |
9488 FOLDING, | |
9489 HIGHLIGHTS, | |
9490 IMPLEMENTED, | |
9491 INVALIDATE, | |
9492 NAVIGATION, | |
9493 OCCURRENCES, | |
9494 OUTLINE, | |
9495 OVERRIDES | |
9496 ]; | |
9497 | |
9498 final String name; | |
9499 | |
9500 const AnalysisService._(this.name); | |
9501 | |
9502 factory AnalysisService(String name) { | |
9503 switch (name) { | |
9504 case "FOLDING": | |
9505 return FOLDING; | |
9506 case "HIGHLIGHTS": | |
9507 return HIGHLIGHTS; | |
9508 case "IMPLEMENTED": | |
9509 return IMPLEMENTED; | |
9510 case "INVALIDATE": | |
9511 return INVALIDATE; | |
9512 case "NAVIGATION": | |
9513 return NAVIGATION; | |
9514 case "OCCURRENCES": | |
9515 return OCCURRENCES; | |
9516 case "OUTLINE": | |
9517 return OUTLINE; | |
9518 case "OVERRIDES": | |
9519 return OVERRIDES; | |
9520 } | |
9521 throw new Exception('Illegal enum value: $name'); | |
9522 } | |
9523 | |
9524 factory AnalysisService.fromJson( | |
9525 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
9526 if (json is String) { | |
9527 try { | |
9528 return new AnalysisService(json); | |
9529 } catch (_) { | |
9530 // Fall through | |
9531 } | |
9532 } | |
9533 throw jsonDecoder.mismatch(jsonPath, "AnalysisService", json); | |
9534 } | |
9535 | |
9536 @override | |
9537 String toString() => "AnalysisService.$name"; | |
9538 | |
9539 String toJson() => name; | |
9540 } | |
9541 | |
9542 /** | |
9543 * AnalysisStatus | |
9544 * | |
9545 * { | |
9546 * "isAnalyzing": bool | |
9547 * "analysisTarget": optional String | |
9548 * } | |
9549 * | |
9550 * Clients may not extend, implement or mix-in this class. | |
9551 */ | |
9552 class AnalysisStatus implements HasToJson { | |
9553 bool _isAnalyzing; | |
9554 | |
9555 String _analysisTarget; | |
9556 | |
9557 /** | |
9558 * True if analysis is currently being performed. | |
9559 */ | |
9560 bool get isAnalyzing => _isAnalyzing; | |
9561 | |
9562 /** | |
9563 * True if analysis is currently being performed. | |
9564 */ | |
9565 void set isAnalyzing(bool value) { | |
9566 assert(value != null); | |
9567 this._isAnalyzing = value; | |
9568 } | |
9569 | |
9570 /** | |
9571 * The name of the current target of analysis. This field is omitted if | |
9572 * analyzing is false. | |
9573 */ | |
9574 String get analysisTarget => _analysisTarget; | |
9575 | |
9576 /** | |
9577 * The name of the current target of analysis. This field is omitted if | |
9578 * analyzing is false. | |
9579 */ | |
9580 void set analysisTarget(String value) { | |
9581 this._analysisTarget = value; | |
9582 } | |
9583 | |
9584 AnalysisStatus(bool isAnalyzing, {String analysisTarget}) { | |
9585 this.isAnalyzing = isAnalyzing; | |
9586 this.analysisTarget = analysisTarget; | |
9587 } | |
9588 | |
9589 factory AnalysisStatus.fromJson( | |
9590 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
9591 if (json == null) { | |
9592 json = {}; | |
9593 } | |
9594 if (json is Map) { | |
9595 bool isAnalyzing; | |
9596 if (json.containsKey("isAnalyzing")) { | |
9597 isAnalyzing = jsonDecoder.decodeBool( | |
9598 jsonPath + ".isAnalyzing", json["isAnalyzing"]); | |
9599 } else { | |
9600 throw jsonDecoder.missingKey(jsonPath, "isAnalyzing"); | |
9601 } | |
9602 String analysisTarget; | |
9603 if (json.containsKey("analysisTarget")) { | |
9604 analysisTarget = jsonDecoder.decodeString( | |
9605 jsonPath + ".analysisTarget", json["analysisTarget"]); | |
9606 } | |
9607 return new AnalysisStatus(isAnalyzing, analysisTarget: analysisTarget); | |
9608 } else { | |
9609 throw jsonDecoder.mismatch(jsonPath, "AnalysisStatus", json); | |
9610 } | |
9611 } | |
9612 | |
9613 Map<String, dynamic> toJson() { | |
9614 Map<String, dynamic> result = {}; | |
9615 result["isAnalyzing"] = isAnalyzing; | |
9616 if (analysisTarget != null) { | |
9617 result["analysisTarget"] = analysisTarget; | |
9618 } | |
9619 return result; | |
9620 } | |
9621 | |
9622 @override | |
9623 String toString() => JSON.encode(toJson()); | |
9624 | |
9625 @override | |
9626 bool operator ==(other) { | |
9627 if (other is AnalysisStatus) { | |
9628 return isAnalyzing == other.isAnalyzing && | |
9629 analysisTarget == other.analysisTarget; | |
9630 } | |
9631 return false; | |
9632 } | |
9633 | |
9634 @override | |
9635 int get hashCode { | |
9636 int hash = 0; | |
9637 hash = JenkinsSmiHash.combine(hash, isAnalyzing.hashCode); | |
9638 hash = JenkinsSmiHash.combine(hash, analysisTarget.hashCode); | |
9639 return JenkinsSmiHash.finish(hash); | |
9640 } | |
9641 } | |
9642 | |
9643 /** | |
9644 * ChangeContentOverlay | |
9645 * | |
9646 * { | |
9647 * "type": "change" | |
9648 * "edits": List<SourceEdit> | |
9649 * } | |
9650 * | |
9651 * Clients may not extend, implement or mix-in this class. | |
9652 */ | |
9653 class ChangeContentOverlay implements HasToJson { | |
9654 List<SourceEdit> _edits; | |
9655 | |
9656 /** | |
9657 * The edits to be applied to the file. | |
9658 */ | |
9659 List<SourceEdit> get edits => _edits; | |
9660 | |
9661 /** | |
9662 * The edits to be applied to the file. | |
9663 */ | |
9664 void set edits(List<SourceEdit> value) { | |
9665 assert(value != null); | |
9666 this._edits = value; | |
9667 } | |
9668 | |
9669 ChangeContentOverlay(List<SourceEdit> edits) { | |
9670 this.edits = edits; | |
9671 } | |
9672 | |
9673 factory ChangeContentOverlay.fromJson( | |
9674 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
9675 if (json == null) { | |
9676 json = {}; | |
9677 } | |
9678 if (json is Map) { | |
9679 if (json["type"] != "change") { | |
9680 throw jsonDecoder.mismatch(jsonPath, "equal " + "change", json); | |
9681 } | |
9682 List<SourceEdit> edits; | |
9683 if (json.containsKey("edits")) { | |
9684 edits = jsonDecoder.decodeList( | |
9685 jsonPath + ".edits", | |
9686 json["edits"], | |
9687 (String jsonPath, Object json) => | |
9688 new SourceEdit.fromJson(jsonDecoder, jsonPath, json)); | |
9689 } else { | |
9690 throw jsonDecoder.missingKey(jsonPath, "edits"); | |
9691 } | |
9692 return new ChangeContentOverlay(edits); | |
9693 } else { | |
9694 throw jsonDecoder.mismatch(jsonPath, "ChangeContentOverlay", json); | |
9695 } | |
9696 } | |
9697 | |
9698 Map<String, dynamic> toJson() { | |
9699 Map<String, dynamic> result = {}; | |
9700 result["type"] = "change"; | |
9701 result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList(); | |
9702 return result; | |
9703 } | |
9704 | |
9705 @override | |
9706 String toString() => JSON.encode(toJson()); | |
9707 | |
9708 @override | |
9709 bool operator ==(other) { | |
9710 if (other is ChangeContentOverlay) { | |
9711 return listEqual( | |
9712 edits, other.edits, (SourceEdit a, SourceEdit b) => a == b); | |
9713 } | |
9714 return false; | |
9715 } | |
9716 | |
9717 @override | |
9718 int get hashCode { | |
9719 int hash = 0; | |
9720 hash = JenkinsSmiHash.combine(hash, 873118866); | |
9721 hash = JenkinsSmiHash.combine(hash, edits.hashCode); | |
9722 return JenkinsSmiHash.finish(hash); | |
9723 } | |
9724 } | |
9725 | |
9726 /** | |
9727 * CompletionSuggestion | |
9728 * | |
9729 * { | |
9730 * "kind": CompletionSuggestionKind | |
9731 * "relevance": int | |
9732 * "completion": String | |
9733 * "selectionOffset": int | |
9734 * "selectionLength": int | |
9735 * "isDeprecated": bool | |
9736 * "isPotential": bool | |
9737 * "docSummary": optional String | |
9738 * "docComplete": optional String | |
9739 * "declaringType": optional String | |
9740 * "defaultArgumentListString": optional String | |
9741 * "defaultArgumentListTextRanges": optional List<int> | |
9742 * "element": optional Element | |
9743 * "returnType": optional String | |
9744 * "parameterNames": optional List<String> | |
9745 * "parameterTypes": optional List<String> | |
9746 * "requiredParameterCount": optional int | |
9747 * "hasNamedParameters": optional bool | |
9748 * "parameterName": optional String | |
9749 * "parameterType": optional String | |
9750 * "importUri": optional String | |
9751 * } | |
9752 * | |
9753 * Clients may not extend, implement or mix-in this class. | |
9754 */ | |
9755 class CompletionSuggestion implements HasToJson { | |
9756 CompletionSuggestionKind _kind; | |
9757 | |
9758 int _relevance; | |
9759 | |
9760 String _completion; | |
9761 | |
9762 int _selectionOffset; | |
9763 | |
9764 int _selectionLength; | |
9765 | |
9766 bool _isDeprecated; | |
9767 | |
9768 bool _isPotential; | |
9769 | |
9770 String _docSummary; | |
9771 | |
9772 String _docComplete; | |
9773 | |
9774 String _declaringType; | |
9775 | |
9776 String _defaultArgumentListString; | |
9777 | |
9778 List<int> _defaultArgumentListTextRanges; | |
9779 | |
9780 Element _element; | |
9781 | |
9782 String _returnType; | |
9783 | |
9784 List<String> _parameterNames; | |
9785 | |
9786 List<String> _parameterTypes; | |
9787 | |
9788 int _requiredParameterCount; | |
9789 | |
9790 bool _hasNamedParameters; | |
9791 | |
9792 String _parameterName; | |
9793 | |
9794 String _parameterType; | |
9795 | |
9796 String _importUri; | |
9797 | |
9798 /** | |
9799 * The kind of element being suggested. | |
9800 */ | |
9801 CompletionSuggestionKind get kind => _kind; | |
9802 | |
9803 /** | |
9804 * The kind of element being suggested. | |
9805 */ | |
9806 void set kind(CompletionSuggestionKind value) { | |
9807 assert(value != null); | |
9808 this._kind = value; | |
9809 } | |
9810 | |
9811 /** | |
9812 * The relevance of this completion suggestion where a higher number | |
9813 * indicates a higher relevance. | |
9814 */ | |
9815 int get relevance => _relevance; | |
9816 | |
9817 /** | |
9818 * The relevance of this completion suggestion where a higher number | |
9819 * indicates a higher relevance. | |
9820 */ | |
9821 void set relevance(int value) { | |
9822 assert(value != null); | |
9823 this._relevance = value; | |
9824 } | |
9825 | |
9826 /** | |
9827 * The identifier to be inserted if the suggestion is selected. If the | |
9828 * suggestion is for a method or function, the client might want to | |
9829 * additionally insert a template for the parameters. The information | |
9830 * required in order to do so is contained in other fields. | |
9831 */ | |
9832 String get completion => _completion; | |
9833 | |
9834 /** | |
9835 * The identifier to be inserted if the suggestion is selected. If the | |
9836 * suggestion is for a method or function, the client might want to | |
9837 * additionally insert a template for the parameters. The information | |
9838 * required in order to do so is contained in other fields. | |
9839 */ | |
9840 void set completion(String value) { | |
9841 assert(value != null); | |
9842 this._completion = value; | |
9843 } | |
9844 | |
9845 /** | |
9846 * The offset, relative to the beginning of the completion, of where the | |
9847 * selection should be placed after insertion. | |
9848 */ | |
9849 int get selectionOffset => _selectionOffset; | |
9850 | |
9851 /** | |
9852 * The offset, relative to the beginning of the completion, of where the | |
9853 * selection should be placed after insertion. | |
9854 */ | |
9855 void set selectionOffset(int value) { | |
9856 assert(value != null); | |
9857 this._selectionOffset = value; | |
9858 } | |
9859 | |
9860 /** | |
9861 * The number of characters that should be selected after insertion. | |
9862 */ | |
9863 int get selectionLength => _selectionLength; | |
9864 | |
9865 /** | |
9866 * The number of characters that should be selected after insertion. | |
9867 */ | |
9868 void set selectionLength(int value) { | |
9869 assert(value != null); | |
9870 this._selectionLength = value; | |
9871 } | |
9872 | |
9873 /** | |
9874 * True if the suggested element is deprecated. | |
9875 */ | |
9876 bool get isDeprecated => _isDeprecated; | |
9877 | |
9878 /** | |
9879 * True if the suggested element is deprecated. | |
9880 */ | |
9881 void set isDeprecated(bool value) { | |
9882 assert(value != null); | |
9883 this._isDeprecated = value; | |
9884 } | |
9885 | |
9886 /** | |
9887 * True if the element is not known to be valid for the target. This happens | |
9888 * if the type of the target is dynamic. | |
9889 */ | |
9890 bool get isPotential => _isPotential; | |
9891 | |
9892 /** | |
9893 * True if the element is not known to be valid for the target. This happens | |
9894 * if the type of the target is dynamic. | |
9895 */ | |
9896 void set isPotential(bool value) { | |
9897 assert(value != null); | |
9898 this._isPotential = value; | |
9899 } | |
9900 | |
9901 /** | |
9902 * An abbreviated version of the Dartdoc associated with the element being | |
9903 * suggested, This field is omitted if there is no Dartdoc associated with | |
9904 * the element. | |
9905 */ | |
9906 String get docSummary => _docSummary; | |
9907 | |
9908 /** | |
9909 * An abbreviated version of the Dartdoc associated with the element being | |
9910 * suggested, This field is omitted if there is no Dartdoc associated with | |
9911 * the element. | |
9912 */ | |
9913 void set docSummary(String value) { | |
9914 this._docSummary = value; | |
9915 } | |
9916 | |
9917 /** | |
9918 * The Dartdoc associated with the element being suggested, This field is | |
9919 * omitted if there is no Dartdoc associated with the element. | |
9920 */ | |
9921 String get docComplete => _docComplete; | |
9922 | |
9923 /** | |
9924 * The Dartdoc associated with the element being suggested, This field is | |
9925 * omitted if there is no Dartdoc associated with the element. | |
9926 */ | |
9927 void set docComplete(String value) { | |
9928 this._docComplete = value; | |
9929 } | |
9930 | |
9931 /** | |
9932 * The class that declares the element being suggested. This field is omitted | |
9933 * if the suggested element is not a member of a class. | |
9934 */ | |
9935 String get declaringType => _declaringType; | |
9936 | |
9937 /** | |
9938 * The class that declares the element being suggested. This field is omitted | |
9939 * if the suggested element is not a member of a class. | |
9940 */ | |
9941 void set declaringType(String value) { | |
9942 this._declaringType = value; | |
9943 } | |
9944 | |
9945 /** | |
9946 * A default String for use in generating argument list source contents on | |
9947 * the client side. | |
9948 */ | |
9949 String get defaultArgumentListString => _defaultArgumentListString; | |
9950 | |
9951 /** | |
9952 * A default String for use in generating argument list source contents on | |
9953 * the client side. | |
9954 */ | |
9955 void set defaultArgumentListString(String value) { | |
9956 this._defaultArgumentListString = value; | |
9957 } | |
9958 | |
9959 /** | |
9960 * Pairs of offsets and lengths describing 'defaultArgumentListString' text | |
9961 * ranges suitable for use by clients to set up linked edits of default | |
9962 * argument source contents. For example, given an argument list string 'x, | |
9963 * y', the corresponding text range [0, 1, 3, 1], indicates two text ranges | |
9964 * of length 1, starting at offsets 0 and 3. Clients can use these ranges to | |
9965 * treat the 'x' and 'y' values specially for linked edits. | |
9966 */ | |
9967 List<int> get defaultArgumentListTextRanges => _defaultArgumentListTextRanges; | |
9968 | |
9969 /** | |
9970 * Pairs of offsets and lengths describing 'defaultArgumentListString' text | |
9971 * ranges suitable for use by clients to set up linked edits of default | |
9972 * argument source contents. For example, given an argument list string 'x, | |
9973 * y', the corresponding text range [0, 1, 3, 1], indicates two text ranges | |
9974 * of length 1, starting at offsets 0 and 3. Clients can use these ranges to | |
9975 * treat the 'x' and 'y' values specially for linked edits. | |
9976 */ | |
9977 void set defaultArgumentListTextRanges(List<int> value) { | |
9978 this._defaultArgumentListTextRanges = value; | |
9979 } | |
9980 | |
9981 /** | |
9982 * Information about the element reference being suggested. | |
9983 */ | |
9984 Element get element => _element; | |
9985 | |
9986 /** | |
9987 * Information about the element reference being suggested. | |
9988 */ | |
9989 void set element(Element value) { | |
9990 this._element = value; | |
9991 } | |
9992 | |
9993 /** | |
9994 * The return type of the getter, function or method or the type of the field | |
9995 * being suggested. This field is omitted if the suggested element is not a | |
9996 * getter, function or method. | |
9997 */ | |
9998 String get returnType => _returnType; | |
9999 | |
10000 /** | |
10001 * The return type of the getter, function or method or the type of the field | |
10002 * being suggested. This field is omitted if the suggested element is not a | |
10003 * getter, function or method. | |
10004 */ | |
10005 void set returnType(String value) { | |
10006 this._returnType = value; | |
10007 } | |
10008 | |
10009 /** | |
10010 * The names of the parameters of the function or method being suggested. | |
10011 * This field is omitted if the suggested element is not a setter, function | |
10012 * or method. | |
10013 */ | |
10014 List<String> get parameterNames => _parameterNames; | |
10015 | |
10016 /** | |
10017 * The names of the parameters of the function or method being suggested. | |
10018 * This field is omitted if the suggested element is not a setter, function | |
10019 * or method. | |
10020 */ | |
10021 void set parameterNames(List<String> value) { | |
10022 this._parameterNames = value; | |
10023 } | |
10024 | |
10025 /** | |
10026 * The types of the parameters of the function or method being suggested. | |
10027 * This field is omitted if the parameterNames field is omitted. | |
10028 */ | |
10029 List<String> get parameterTypes => _parameterTypes; | |
10030 | |
10031 /** | |
10032 * The types of the parameters of the function or method being suggested. | |
10033 * This field is omitted if the parameterNames field is omitted. | |
10034 */ | |
10035 void set parameterTypes(List<String> value) { | |
10036 this._parameterTypes = value; | |
10037 } | |
10038 | |
10039 /** | |
10040 * The number of required parameters for the function or method being | |
10041 * suggested. This field is omitted if the parameterNames field is omitted. | |
10042 */ | |
10043 int get requiredParameterCount => _requiredParameterCount; | |
10044 | |
10045 /** | |
10046 * The number of required parameters for the function or method being | |
10047 * suggested. This field is omitted if the parameterNames field is omitted. | |
10048 */ | |
10049 void set requiredParameterCount(int value) { | |
10050 this._requiredParameterCount = value; | |
10051 } | |
10052 | |
10053 /** | |
10054 * True if the function or method being suggested has at least one named | |
10055 * parameter. This field is omitted if the parameterNames field is omitted. | |
10056 */ | |
10057 bool get hasNamedParameters => _hasNamedParameters; | |
10058 | |
10059 /** | |
10060 * True if the function or method being suggested has at least one named | |
10061 * parameter. This field is omitted if the parameterNames field is omitted. | |
10062 */ | |
10063 void set hasNamedParameters(bool value) { | |
10064 this._hasNamedParameters = value; | |
10065 } | |
10066 | |
10067 /** | |
10068 * The name of the optional parameter being suggested. This field is omitted | |
10069 * if the suggestion is not the addition of an optional argument within an | |
10070 * argument list. | |
10071 */ | |
10072 String get parameterName => _parameterName; | |
10073 | |
10074 /** | |
10075 * The name of the optional parameter being suggested. This field is omitted | |
10076 * if the suggestion is not the addition of an optional argument within an | |
10077 * argument list. | |
10078 */ | |
10079 void set parameterName(String value) { | |
10080 this._parameterName = value; | |
10081 } | |
10082 | |
10083 /** | |
10084 * The type of the options parameter being suggested. This field is omitted | |
10085 * if the parameterName field is omitted. | |
10086 */ | |
10087 String get parameterType => _parameterType; | |
10088 | |
10089 /** | |
10090 * The type of the options parameter being suggested. This field is omitted | |
10091 * if the parameterName field is omitted. | |
10092 */ | |
10093 void set parameterType(String value) { | |
10094 this._parameterType = value; | |
10095 } | |
10096 | |
10097 /** | |
10098 * The import to be added if the suggestion is out of scope and needs an | |
10099 * import to be added to be in scope. | |
10100 */ | |
10101 String get importUri => _importUri; | |
10102 | |
10103 /** | |
10104 * The import to be added if the suggestion is out of scope and needs an | |
10105 * import to be added to be in scope. | |
10106 */ | |
10107 void set importUri(String value) { | |
10108 this._importUri = value; | |
10109 } | |
10110 | |
10111 CompletionSuggestion( | |
10112 CompletionSuggestionKind kind, | |
10113 int relevance, | |
10114 String completion, | |
10115 int selectionOffset, | |
10116 int selectionLength, | |
10117 bool isDeprecated, | |
10118 bool isPotential, | |
10119 {String docSummary, | |
10120 String docComplete, | |
10121 String declaringType, | |
10122 String defaultArgumentListString, | |
10123 List<int> defaultArgumentListTextRanges, | |
10124 Element element, | |
10125 String returnType, | |
10126 List<String> parameterNames, | |
10127 List<String> parameterTypes, | |
10128 int requiredParameterCount, | |
10129 bool hasNamedParameters, | |
10130 String parameterName, | |
10131 String parameterType, | |
10132 String importUri}) { | |
10133 this.kind = kind; | |
10134 this.relevance = relevance; | |
10135 this.completion = completion; | |
10136 this.selectionOffset = selectionOffset; | |
10137 this.selectionLength = selectionLength; | |
10138 this.isDeprecated = isDeprecated; | |
10139 this.isPotential = isPotential; | |
10140 this.docSummary = docSummary; | |
10141 this.docComplete = docComplete; | |
10142 this.declaringType = declaringType; | |
10143 this.defaultArgumentListString = defaultArgumentListString; | |
10144 this.defaultArgumentListTextRanges = defaultArgumentListTextRanges; | |
10145 this.element = element; | |
10146 this.returnType = returnType; | |
10147 this.parameterNames = parameterNames; | |
10148 this.parameterTypes = parameterTypes; | |
10149 this.requiredParameterCount = requiredParameterCount; | |
10150 this.hasNamedParameters = hasNamedParameters; | |
10151 this.parameterName = parameterName; | |
10152 this.parameterType = parameterType; | |
10153 this.importUri = importUri; | |
10154 } | |
10155 | |
10156 factory CompletionSuggestion.fromJson( | |
10157 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
10158 if (json == null) { | |
10159 json = {}; | |
10160 } | |
10161 if (json is Map) { | |
10162 CompletionSuggestionKind kind; | |
10163 if (json.containsKey("kind")) { | |
10164 kind = new CompletionSuggestionKind.fromJson( | |
10165 jsonDecoder, jsonPath + ".kind", json["kind"]); | |
10166 } else { | |
10167 throw jsonDecoder.missingKey(jsonPath, "kind"); | |
10168 } | |
10169 int relevance; | |
10170 if (json.containsKey("relevance")) { | |
10171 relevance = | |
10172 jsonDecoder.decodeInt(jsonPath + ".relevance", json["relevance"]); | |
10173 } else { | |
10174 throw jsonDecoder.missingKey(jsonPath, "relevance"); | |
10175 } | |
10176 String completion; | |
10177 if (json.containsKey("completion")) { | |
10178 completion = jsonDecoder.decodeString( | |
10179 jsonPath + ".completion", json["completion"]); | |
10180 } else { | |
10181 throw jsonDecoder.missingKey(jsonPath, "completion"); | |
10182 } | |
10183 int selectionOffset; | |
10184 if (json.containsKey("selectionOffset")) { | |
10185 selectionOffset = jsonDecoder.decodeInt( | |
10186 jsonPath + ".selectionOffset", json["selectionOffset"]); | |
10187 } else { | |
10188 throw jsonDecoder.missingKey(jsonPath, "selectionOffset"); | |
10189 } | |
10190 int selectionLength; | |
10191 if (json.containsKey("selectionLength")) { | |
10192 selectionLength = jsonDecoder.decodeInt( | |
10193 jsonPath + ".selectionLength", json["selectionLength"]); | |
10194 } else { | |
10195 throw jsonDecoder.missingKey(jsonPath, "selectionLength"); | |
10196 } | |
10197 bool isDeprecated; | |
10198 if (json.containsKey("isDeprecated")) { | |
10199 isDeprecated = jsonDecoder.decodeBool( | |
10200 jsonPath + ".isDeprecated", json["isDeprecated"]); | |
10201 } else { | |
10202 throw jsonDecoder.missingKey(jsonPath, "isDeprecated"); | |
10203 } | |
10204 bool isPotential; | |
10205 if (json.containsKey("isPotential")) { | |
10206 isPotential = jsonDecoder.decodeBool( | |
10207 jsonPath + ".isPotential", json["isPotential"]); | |
10208 } else { | |
10209 throw jsonDecoder.missingKey(jsonPath, "isPotential"); | |
10210 } | |
10211 String docSummary; | |
10212 if (json.containsKey("docSummary")) { | |
10213 docSummary = jsonDecoder.decodeString( | |
10214 jsonPath + ".docSummary", json["docSummary"]); | |
10215 } | |
10216 String docComplete; | |
10217 if (json.containsKey("docComplete")) { | |
10218 docComplete = jsonDecoder.decodeString( | |
10219 jsonPath + ".docComplete", json["docComplete"]); | |
10220 } | |
10221 String declaringType; | |
10222 if (json.containsKey("declaringType")) { | |
10223 declaringType = jsonDecoder.decodeString( | |
10224 jsonPath + ".declaringType", json["declaringType"]); | |
10225 } | |
10226 String defaultArgumentListString; | |
10227 if (json.containsKey("defaultArgumentListString")) { | |
10228 defaultArgumentListString = jsonDecoder.decodeString( | |
10229 jsonPath + ".defaultArgumentListString", | |
10230 json["defaultArgumentListString"]); | |
10231 } | |
10232 List<int> defaultArgumentListTextRanges; | |
10233 if (json.containsKey("defaultArgumentListTextRanges")) { | |
10234 defaultArgumentListTextRanges = jsonDecoder.decodeList( | |
10235 jsonPath + ".defaultArgumentListTextRanges", | |
10236 json["defaultArgumentListTextRanges"], | |
10237 jsonDecoder.decodeInt); | |
10238 } | |
10239 Element element; | |
10240 if (json.containsKey("element")) { | |
10241 element = new Element.fromJson( | |
10242 jsonDecoder, jsonPath + ".element", json["element"]); | |
10243 } | |
10244 String returnType; | |
10245 if (json.containsKey("returnType")) { | |
10246 returnType = jsonDecoder.decodeString( | |
10247 jsonPath + ".returnType", json["returnType"]); | |
10248 } | |
10249 List<String> parameterNames; | |
10250 if (json.containsKey("parameterNames")) { | |
10251 parameterNames = jsonDecoder.decodeList(jsonPath + ".parameterNames", | |
10252 json["parameterNames"], jsonDecoder.decodeString); | |
10253 } | |
10254 List<String> parameterTypes; | |
10255 if (json.containsKey("parameterTypes")) { | |
10256 parameterTypes = jsonDecoder.decodeList(jsonPath + ".parameterTypes", | |
10257 json["parameterTypes"], jsonDecoder.decodeString); | |
10258 } | |
10259 int requiredParameterCount; | |
10260 if (json.containsKey("requiredParameterCount")) { | |
10261 requiredParameterCount = jsonDecoder.decodeInt( | |
10262 jsonPath + ".requiredParameterCount", | |
10263 json["requiredParameterCount"]); | |
10264 } | |
10265 bool hasNamedParameters; | |
10266 if (json.containsKey("hasNamedParameters")) { | |
10267 hasNamedParameters = jsonDecoder.decodeBool( | |
10268 jsonPath + ".hasNamedParameters", json["hasNamedParameters"]); | |
10269 } | |
10270 String parameterName; | |
10271 if (json.containsKey("parameterName")) { | |
10272 parameterName = jsonDecoder.decodeString( | |
10273 jsonPath + ".parameterName", json["parameterName"]); | |
10274 } | |
10275 String parameterType; | |
10276 if (json.containsKey("parameterType")) { | |
10277 parameterType = jsonDecoder.decodeString( | |
10278 jsonPath + ".parameterType", json["parameterType"]); | |
10279 } | |
10280 String importUri; | |
10281 if (json.containsKey("importUri")) { | |
10282 importUri = jsonDecoder.decodeString( | |
10283 jsonPath + ".importUri", json["importUri"]); | |
10284 } | |
10285 return new CompletionSuggestion(kind, relevance, completion, | |
10286 selectionOffset, selectionLength, isDeprecated, isPotential, | |
10287 docSummary: docSummary, | |
10288 docComplete: docComplete, | |
10289 declaringType: declaringType, | |
10290 defaultArgumentListString: defaultArgumentListString, | |
10291 defaultArgumentListTextRanges: defaultArgumentListTextRanges, | |
10292 element: element, | |
10293 returnType: returnType, | |
10294 parameterNames: parameterNames, | |
10295 parameterTypes: parameterTypes, | |
10296 requiredParameterCount: requiredParameterCount, | |
10297 hasNamedParameters: hasNamedParameters, | |
10298 parameterName: parameterName, | |
10299 parameterType: parameterType, | |
10300 importUri: importUri); | |
10301 } else { | |
10302 throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestion", json); | |
10303 } | |
10304 } | |
10305 | |
10306 Map<String, dynamic> toJson() { | |
10307 Map<String, dynamic> result = {}; | |
10308 result["kind"] = kind.toJson(); | |
10309 result["relevance"] = relevance; | |
10310 result["completion"] = completion; | |
10311 result["selectionOffset"] = selectionOffset; | |
10312 result["selectionLength"] = selectionLength; | |
10313 result["isDeprecated"] = isDeprecated; | |
10314 result["isPotential"] = isPotential; | |
10315 if (docSummary != null) { | |
10316 result["docSummary"] = docSummary; | |
10317 } | |
10318 if (docComplete != null) { | |
10319 result["docComplete"] = docComplete; | |
10320 } | |
10321 if (declaringType != null) { | |
10322 result["declaringType"] = declaringType; | |
10323 } | |
10324 if (defaultArgumentListString != null) { | |
10325 result["defaultArgumentListString"] = defaultArgumentListString; | |
10326 } | |
10327 if (defaultArgumentListTextRanges != null) { | |
10328 result["defaultArgumentListTextRanges"] = defaultArgumentListTextRanges; | |
10329 } | |
10330 if (element != null) { | |
10331 result["element"] = element.toJson(); | |
10332 } | |
10333 if (returnType != null) { | |
10334 result["returnType"] = returnType; | |
10335 } | |
10336 if (parameterNames != null) { | |
10337 result["parameterNames"] = parameterNames; | |
10338 } | |
10339 if (parameterTypes != null) { | |
10340 result["parameterTypes"] = parameterTypes; | |
10341 } | |
10342 if (requiredParameterCount != null) { | |
10343 result["requiredParameterCount"] = requiredParameterCount; | |
10344 } | |
10345 if (hasNamedParameters != null) { | |
10346 result["hasNamedParameters"] = hasNamedParameters; | |
10347 } | |
10348 if (parameterName != null) { | |
10349 result["parameterName"] = parameterName; | |
10350 } | |
10351 if (parameterType != null) { | |
10352 result["parameterType"] = parameterType; | |
10353 } | |
10354 if (importUri != null) { | |
10355 result["importUri"] = importUri; | |
10356 } | |
10357 return result; | |
10358 } | |
10359 | |
10360 @override | |
10361 String toString() => JSON.encode(toJson()); | |
10362 | |
10363 @override | |
10364 bool operator ==(other) { | |
10365 if (other is CompletionSuggestion) { | |
10366 return kind == other.kind && | |
10367 relevance == other.relevance && | |
10368 completion == other.completion && | |
10369 selectionOffset == other.selectionOffset && | |
10370 selectionLength == other.selectionLength && | |
10371 isDeprecated == other.isDeprecated && | |
10372 isPotential == other.isPotential && | |
10373 docSummary == other.docSummary && | |
10374 docComplete == other.docComplete && | |
10375 declaringType == other.declaringType && | |
10376 defaultArgumentListString == other.defaultArgumentListString && | |
10377 listEqual(defaultArgumentListTextRanges, | |
10378 other.defaultArgumentListTextRanges, (int a, int b) => a == b) && | |
10379 element == other.element && | |
10380 returnType == other.returnType && | |
10381 listEqual(parameterNames, other.parameterNames, | |
10382 (String a, String b) => a == b) && | |
10383 listEqual(parameterTypes, other.parameterTypes, | |
10384 (String a, String b) => a == b) && | |
10385 requiredParameterCount == other.requiredParameterCount && | |
10386 hasNamedParameters == other.hasNamedParameters && | |
10387 parameterName == other.parameterName && | |
10388 parameterType == other.parameterType && | |
10389 importUri == other.importUri; | |
10390 } | |
10391 return false; | |
10392 } | |
10393 | |
10394 @override | |
10395 int get hashCode { | |
10396 int hash = 0; | |
10397 hash = JenkinsSmiHash.combine(hash, kind.hashCode); | |
10398 hash = JenkinsSmiHash.combine(hash, relevance.hashCode); | |
10399 hash = JenkinsSmiHash.combine(hash, completion.hashCode); | |
10400 hash = JenkinsSmiHash.combine(hash, selectionOffset.hashCode); | |
10401 hash = JenkinsSmiHash.combine(hash, selectionLength.hashCode); | |
10402 hash = JenkinsSmiHash.combine(hash, isDeprecated.hashCode); | |
10403 hash = JenkinsSmiHash.combine(hash, isPotential.hashCode); | |
10404 hash = JenkinsSmiHash.combine(hash, docSummary.hashCode); | |
10405 hash = JenkinsSmiHash.combine(hash, docComplete.hashCode); | |
10406 hash = JenkinsSmiHash.combine(hash, declaringType.hashCode); | |
10407 hash = JenkinsSmiHash.combine(hash, defaultArgumentListString.hashCode); | |
10408 hash = JenkinsSmiHash.combine(hash, defaultArgumentListTextRanges.hashCode); | |
10409 hash = JenkinsSmiHash.combine(hash, element.hashCode); | |
10410 hash = JenkinsSmiHash.combine(hash, returnType.hashCode); | |
10411 hash = JenkinsSmiHash.combine(hash, parameterNames.hashCode); | |
10412 hash = JenkinsSmiHash.combine(hash, parameterTypes.hashCode); | |
10413 hash = JenkinsSmiHash.combine(hash, requiredParameterCount.hashCode); | |
10414 hash = JenkinsSmiHash.combine(hash, hasNamedParameters.hashCode); | |
10415 hash = JenkinsSmiHash.combine(hash, parameterName.hashCode); | |
10416 hash = JenkinsSmiHash.combine(hash, parameterType.hashCode); | |
10417 hash = JenkinsSmiHash.combine(hash, importUri.hashCode); | |
10418 return JenkinsSmiHash.finish(hash); | |
10419 } | |
10420 } | |
10421 | |
10422 /** | |
10423 * CompletionSuggestionKind | |
10424 * | |
10425 * enum { | |
10426 * ARGUMENT_LIST | |
10427 * IMPORT | |
10428 * IDENTIFIER | |
10429 * INVOCATION | |
10430 * KEYWORD | |
10431 * NAMED_ARGUMENT | |
10432 * OPTIONAL_ARGUMENT | |
10433 * PARAMETER | |
10434 * } | |
10435 * | |
10436 * Clients may not extend, implement or mix-in this class. | |
10437 */ | |
10438 class CompletionSuggestionKind implements Enum { | |
10439 /** | |
10440 * A list of arguments for the method or function that is being invoked. For | |
10441 * this suggestion kind, the completion field is a textual representation of | |
10442 * the invocation and the parameterNames, parameterTypes, and | |
10443 * requiredParameterCount attributes are defined. | |
10444 */ | |
10445 static const CompletionSuggestionKind ARGUMENT_LIST = | |
10446 const CompletionSuggestionKind._("ARGUMENT_LIST"); | |
10447 | |
10448 static const CompletionSuggestionKind IMPORT = | |
10449 const CompletionSuggestionKind._("IMPORT"); | |
10450 | |
10451 /** | |
10452 * The element identifier should be inserted at the completion location. For | |
10453 * example "someMethod" in import 'myLib.dart' show someMethod; . For | |
10454 * suggestions of this kind, the element attribute is defined and the | |
10455 * completion field is the element's identifier. | |
10456 */ | |
10457 static const CompletionSuggestionKind IDENTIFIER = | |
10458 const CompletionSuggestionKind._("IDENTIFIER"); | |
10459 | |
10460 /** | |
10461 * The element is being invoked at the completion location. For example, | |
10462 * "someMethod" in x.someMethod(); . For suggestions of this kind, the | |
10463 * element attribute is defined and the completion field is the element's | |
10464 * identifier. | |
10465 */ | |
10466 static const CompletionSuggestionKind INVOCATION = | |
10467 const CompletionSuggestionKind._("INVOCATION"); | |
10468 | |
10469 /** | |
10470 * A keyword is being suggested. For suggestions of this kind, the completion | |
10471 * is the keyword. | |
10472 */ | |
10473 static const CompletionSuggestionKind KEYWORD = | |
10474 const CompletionSuggestionKind._("KEYWORD"); | |
10475 | |
10476 /** | |
10477 * A named argument for the current callsite is being suggested. For | |
10478 * suggestions of this kind, the completion is the named argument identifier | |
10479 * including a trailing ':' and space. | |
10480 */ | |
10481 static const CompletionSuggestionKind NAMED_ARGUMENT = | |
10482 const CompletionSuggestionKind._("NAMED_ARGUMENT"); | |
10483 | |
10484 static const CompletionSuggestionKind OPTIONAL_ARGUMENT = | |
10485 const CompletionSuggestionKind._("OPTIONAL_ARGUMENT"); | |
10486 | |
10487 static const CompletionSuggestionKind PARAMETER = | |
10488 const CompletionSuggestionKind._("PARAMETER"); | |
10489 | |
10490 /** | |
10491 * A list containing all of the enum values that are defined. | |
10492 */ | |
10493 static const List<CompletionSuggestionKind> VALUES = | |
10494 const <CompletionSuggestionKind>[ | |
10495 ARGUMENT_LIST, | |
10496 IMPORT, | |
10497 IDENTIFIER, | |
10498 INVOCATION, | |
10499 KEYWORD, | |
10500 NAMED_ARGUMENT, | |
10501 OPTIONAL_ARGUMENT, | |
10502 PARAMETER | |
10503 ]; | |
10504 | |
10505 final String name; | |
10506 | |
10507 const CompletionSuggestionKind._(this.name); | |
10508 | |
10509 factory CompletionSuggestionKind(String name) { | |
10510 switch (name) { | |
10511 case "ARGUMENT_LIST": | |
10512 return ARGUMENT_LIST; | |
10513 case "IMPORT": | |
10514 return IMPORT; | |
10515 case "IDENTIFIER": | |
10516 return IDENTIFIER; | |
10517 case "INVOCATION": | |
10518 return INVOCATION; | |
10519 case "KEYWORD": | |
10520 return KEYWORD; | |
10521 case "NAMED_ARGUMENT": | |
10522 return NAMED_ARGUMENT; | |
10523 case "OPTIONAL_ARGUMENT": | |
10524 return OPTIONAL_ARGUMENT; | |
10525 case "PARAMETER": | |
10526 return PARAMETER; | |
10527 } | |
10528 throw new Exception('Illegal enum value: $name'); | |
10529 } | |
10530 | |
10531 factory CompletionSuggestionKind.fromJson( | |
10532 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
10533 if (json is String) { | |
10534 try { | |
10535 return new CompletionSuggestionKind(json); | |
10536 } catch (_) { | |
10537 // Fall through | |
10538 } | |
10539 } | |
10540 throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestionKind", json); | |
10541 } | |
10542 | |
10543 @override | |
10544 String toString() => "CompletionSuggestionKind.$name"; | |
10545 | |
10546 String toJson() => name; | |
10547 } | |
10548 | |
10549 /** | |
10550 * ContextData | |
10551 * | |
10552 * { | |
10553 * "name": String | |
10554 * "explicitFileCount": int | |
10555 * "implicitFileCount": int | |
10556 * "workItemQueueLength": int | |
10557 * "cacheEntryExceptions": List<String> | |
10558 * } | |
10559 * | |
10560 * Clients may not extend, implement or mix-in this class. | |
10561 */ | |
10562 class ContextData implements HasToJson { | |
10563 String _name; | |
10564 | |
10565 int _explicitFileCount; | |
10566 | |
10567 int _implicitFileCount; | |
10568 | |
10569 int _workItemQueueLength; | |
10570 | |
10571 List<String> _cacheEntryExceptions; | |
10572 | |
10573 /** | |
10574 * The name of the context. | |
10575 */ | |
10576 String get name => _name; | |
10577 | |
10578 /** | |
10579 * The name of the context. | |
10580 */ | |
10581 void set name(String value) { | |
10582 assert(value != null); | |
10583 this._name = value; | |
10584 } | |
10585 | |
10586 /** | |
10587 * Explicitly analyzed files. | |
10588 */ | |
10589 int get explicitFileCount => _explicitFileCount; | |
10590 | |
10591 /** | |
10592 * Explicitly analyzed files. | |
10593 */ | |
10594 void set explicitFileCount(int value) { | |
10595 assert(value != null); | |
10596 this._explicitFileCount = value; | |
10597 } | |
10598 | |
10599 /** | |
10600 * Implicitly analyzed files. | |
10601 */ | |
10602 int get implicitFileCount => _implicitFileCount; | |
10603 | |
10604 /** | |
10605 * Implicitly analyzed files. | |
10606 */ | |
10607 void set implicitFileCount(int value) { | |
10608 assert(value != null); | |
10609 this._implicitFileCount = value; | |
10610 } | |
10611 | |
10612 /** | |
10613 * The number of work items in the queue. | |
10614 */ | |
10615 int get workItemQueueLength => _workItemQueueLength; | |
10616 | |
10617 /** | |
10618 * The number of work items in the queue. | |
10619 */ | |
10620 void set workItemQueueLength(int value) { | |
10621 assert(value != null); | |
10622 this._workItemQueueLength = value; | |
10623 } | |
10624 | |
10625 /** | |
10626 * Exceptions associated with cache entries. | |
10627 */ | |
10628 List<String> get cacheEntryExceptions => _cacheEntryExceptions; | |
10629 | |
10630 /** | |
10631 * Exceptions associated with cache entries. | |
10632 */ | |
10633 void set cacheEntryExceptions(List<String> value) { | |
10634 assert(value != null); | |
10635 this._cacheEntryExceptions = value; | |
10636 } | |
10637 | |
10638 ContextData(String name, int explicitFileCount, int implicitFileCount, | |
10639 int workItemQueueLength, List<String> cacheEntryExceptions) { | |
10640 this.name = name; | |
10641 this.explicitFileCount = explicitFileCount; | |
10642 this.implicitFileCount = implicitFileCount; | |
10643 this.workItemQueueLength = workItemQueueLength; | |
10644 this.cacheEntryExceptions = cacheEntryExceptions; | |
10645 } | |
10646 | |
10647 factory ContextData.fromJson( | |
10648 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
10649 if (json == null) { | |
10650 json = {}; | |
10651 } | |
10652 if (json is Map) { | |
10653 String name; | |
10654 if (json.containsKey("name")) { | |
10655 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]); | |
10656 } else { | |
10657 throw jsonDecoder.missingKey(jsonPath, "name"); | |
10658 } | |
10659 int explicitFileCount; | |
10660 if (json.containsKey("explicitFileCount")) { | |
10661 explicitFileCount = jsonDecoder.decodeInt( | |
10662 jsonPath + ".explicitFileCount", json["explicitFileCount"]); | |
10663 } else { | |
10664 throw jsonDecoder.missingKey(jsonPath, "explicitFileCount"); | |
10665 } | |
10666 int implicitFileCount; | |
10667 if (json.containsKey("implicitFileCount")) { | |
10668 implicitFileCount = jsonDecoder.decodeInt( | |
10669 jsonPath + ".implicitFileCount", json["implicitFileCount"]); | |
10670 } else { | |
10671 throw jsonDecoder.missingKey(jsonPath, "implicitFileCount"); | |
10672 } | |
10673 int workItemQueueLength; | |
10674 if (json.containsKey("workItemQueueLength")) { | |
10675 workItemQueueLength = jsonDecoder.decodeInt( | |
10676 jsonPath + ".workItemQueueLength", json["workItemQueueLength"]); | |
10677 } else { | |
10678 throw jsonDecoder.missingKey(jsonPath, "workItemQueueLength"); | |
10679 } | |
10680 List<String> cacheEntryExceptions; | |
10681 if (json.containsKey("cacheEntryExceptions")) { | |
10682 cacheEntryExceptions = jsonDecoder.decodeList( | |
10683 jsonPath + ".cacheEntryExceptions", | |
10684 json["cacheEntryExceptions"], | |
10685 jsonDecoder.decodeString); | |
10686 } else { | |
10687 throw jsonDecoder.missingKey(jsonPath, "cacheEntryExceptions"); | |
10688 } | |
10689 return new ContextData(name, explicitFileCount, implicitFileCount, | |
10690 workItemQueueLength, cacheEntryExceptions); | |
10691 } else { | |
10692 throw jsonDecoder.mismatch(jsonPath, "ContextData", json); | |
10693 } | |
10694 } | |
10695 | |
10696 Map<String, dynamic> toJson() { | |
10697 Map<String, dynamic> result = {}; | |
10698 result["name"] = name; | |
10699 result["explicitFileCount"] = explicitFileCount; | |
10700 result["implicitFileCount"] = implicitFileCount; | |
10701 result["workItemQueueLength"] = workItemQueueLength; | |
10702 result["cacheEntryExceptions"] = cacheEntryExceptions; | |
10703 return result; | |
10704 } | |
10705 | |
10706 @override | |
10707 String toString() => JSON.encode(toJson()); | |
10708 | |
10709 @override | |
10710 bool operator ==(other) { | |
10711 if (other is ContextData) { | |
10712 return name == other.name && | |
10713 explicitFileCount == other.explicitFileCount && | |
10714 implicitFileCount == other.implicitFileCount && | |
10715 workItemQueueLength == other.workItemQueueLength && | |
10716 listEqual(cacheEntryExceptions, other.cacheEntryExceptions, | |
10717 (String a, String b) => a == b); | |
10718 } | |
10719 return false; | |
10720 } | |
10721 | |
10722 @override | |
10723 int get hashCode { | |
10724 int hash = 0; | |
10725 hash = JenkinsSmiHash.combine(hash, name.hashCode); | |
10726 hash = JenkinsSmiHash.combine(hash, explicitFileCount.hashCode); | |
10727 hash = JenkinsSmiHash.combine(hash, implicitFileCount.hashCode); | |
10728 hash = JenkinsSmiHash.combine(hash, workItemQueueLength.hashCode); | |
10729 hash = JenkinsSmiHash.combine(hash, cacheEntryExceptions.hashCode); | |
10730 return JenkinsSmiHash.finish(hash); | |
10731 } | |
10732 } | |
10733 | |
10734 /** | |
10735 * Element | |
10736 * | |
10737 * { | |
10738 * "kind": ElementKind | |
10739 * "name": String | |
10740 * "location": optional Location | |
10741 * "flags": int | |
10742 * "parameters": optional String | |
10743 * "returnType": optional String | |
10744 * "typeParameters": optional String | |
10745 * } | |
10746 * | |
10747 * Clients may not extend, implement or mix-in this class. | |
10748 */ | |
10749 class Element implements HasToJson { | |
10750 static const int FLAG_ABSTRACT = 0x01; | |
10751 static const int FLAG_CONST = 0x02; | |
10752 static const int FLAG_FINAL = 0x04; | |
10753 static const int FLAG_STATIC = 0x08; | |
10754 static const int FLAG_PRIVATE = 0x10; | |
10755 static const int FLAG_DEPRECATED = 0x20; | |
10756 | |
10757 static int makeFlags( | |
10758 {isAbstract: false, | |
10759 isConst: false, | |
10760 isFinal: false, | |
10761 isStatic: false, | |
10762 isPrivate: false, | |
10763 isDeprecated: false}) { | |
10764 int flags = 0; | |
10765 if (isAbstract) flags |= FLAG_ABSTRACT; | |
10766 if (isConst) flags |= FLAG_CONST; | |
10767 if (isFinal) flags |= FLAG_FINAL; | |
10768 if (isStatic) flags |= FLAG_STATIC; | |
10769 if (isPrivate) flags |= FLAG_PRIVATE; | |
10770 if (isDeprecated) flags |= FLAG_DEPRECATED; | |
10771 return flags; | |
10772 } | |
10773 | |
10774 ElementKind _kind; | |
10775 | |
10776 String _name; | |
10777 | |
10778 Location _location; | |
10779 | |
10780 int _flags; | |
10781 | |
10782 String _parameters; | |
10783 | |
10784 String _returnType; | |
10785 | |
10786 String _typeParameters; | |
10787 | |
10788 /** | |
10789 * The kind of the element. | |
10790 */ | |
10791 ElementKind get kind => _kind; | |
10792 | |
10793 /** | |
10794 * The kind of the element. | |
10795 */ | |
10796 void set kind(ElementKind value) { | |
10797 assert(value != null); | |
10798 this._kind = value; | |
10799 } | |
10800 | |
10801 /** | |
10802 * The name of the element. This is typically used as the label in the | |
10803 * outline. | |
10804 */ | |
10805 String get name => _name; | |
10806 | |
10807 /** | |
10808 * The name of the element. This is typically used as the label in the | |
10809 * outline. | |
10810 */ | |
10811 void set name(String value) { | |
10812 assert(value != null); | |
10813 this._name = value; | |
10814 } | |
10815 | |
10816 /** | |
10817 * The location of the name in the declaration of the element. | |
10818 */ | |
10819 Location get location => _location; | |
10820 | |
10821 /** | |
10822 * The location of the name in the declaration of the element. | |
10823 */ | |
10824 void set location(Location value) { | |
10825 this._location = value; | |
10826 } | |
10827 | |
10828 /** | |
10829 * A bit-map containing the following flags: | |
10830 * | |
10831 * - 0x01 - set if the element is explicitly or implicitly abstract | |
10832 * - 0x02 - set if the element was declared to be ‘const’ | |
10833 * - 0x04 - set if the element was declared to be ‘final’ | |
10834 * - 0x08 - set if the element is a static member of a class or is a | |
10835 * top-level function or field | |
10836 * - 0x10 - set if the element is private | |
10837 * - 0x20 - set if the element is deprecated | |
10838 */ | |
10839 int get flags => _flags; | |
10840 | |
10841 /** | |
10842 * A bit-map containing the following flags: | |
10843 * | |
10844 * - 0x01 - set if the element is explicitly or implicitly abstract | |
10845 * - 0x02 - set if the element was declared to be ‘const’ | |
10846 * - 0x04 - set if the element was declared to be ‘final’ | |
10847 * - 0x08 - set if the element is a static member of a class or is a | |
10848 * top-level function or field | |
10849 * - 0x10 - set if the element is private | |
10850 * - 0x20 - set if the element is deprecated | |
10851 */ | |
10852 void set flags(int value) { | |
10853 assert(value != null); | |
10854 this._flags = value; | |
10855 } | |
10856 | |
10857 /** | |
10858 * The parameter list for the element. If the element is not a method or | |
10859 * function this field will not be defined. If the element doesn't have | |
10860 * parameters (e.g. getter), this field will not be defined. If the element | |
10861 * has zero parameters, this field will have a value of "()". | |
10862 */ | |
10863 String get parameters => _parameters; | |
10864 | |
10865 /** | |
10866 * The parameter list for the element. If the element is not a method or | |
10867 * function this field will not be defined. If the element doesn't have | |
10868 * parameters (e.g. getter), this field will not be defined. If the element | |
10869 * has zero parameters, this field will have a value of "()". | |
10870 */ | |
10871 void set parameters(String value) { | |
10872 this._parameters = value; | |
10873 } | |
10874 | |
10875 /** | |
10876 * The return type of the element. If the element is not a method or function | |
10877 * this field will not be defined. If the element does not have a declared | |
10878 * return type, this field will contain an empty string. | |
10879 */ | |
10880 String get returnType => _returnType; | |
10881 | |
10882 /** | |
10883 * The return type of the element. If the element is not a method or function | |
10884 * this field will not be defined. If the element does not have a declared | |
10885 * return type, this field will contain an empty string. | |
10886 */ | |
10887 void set returnType(String value) { | |
10888 this._returnType = value; | |
10889 } | |
10890 | |
10891 /** | |
10892 * The type parameter list for the element. If the element doesn't have type | |
10893 * parameters, this field will not be defined. | |
10894 */ | |
10895 String get typeParameters => _typeParameters; | |
10896 | |
10897 /** | |
10898 * The type parameter list for the element. If the element doesn't have type | |
10899 * parameters, this field will not be defined. | |
10900 */ | |
10901 void set typeParameters(String value) { | |
10902 this._typeParameters = value; | |
10903 } | |
10904 | |
10905 Element(ElementKind kind, String name, int flags, | |
10906 {Location location, | |
10907 String parameters, | |
10908 String returnType, | |
10909 String typeParameters}) { | |
10910 this.kind = kind; | |
10911 this.name = name; | |
10912 this.location = location; | |
10913 this.flags = flags; | |
10914 this.parameters = parameters; | |
10915 this.returnType = returnType; | |
10916 this.typeParameters = typeParameters; | |
10917 } | |
10918 | |
10919 factory Element.fromJson( | |
10920 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
10921 if (json == null) { | |
10922 json = {}; | |
10923 } | |
10924 if (json is Map) { | |
10925 ElementKind kind; | |
10926 if (json.containsKey("kind")) { | |
10927 kind = new ElementKind.fromJson( | |
10928 jsonDecoder, jsonPath + ".kind", json["kind"]); | |
10929 } else { | |
10930 throw jsonDecoder.missingKey(jsonPath, "kind"); | |
10931 } | |
10932 String name; | |
10933 if (json.containsKey("name")) { | |
10934 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]); | |
10935 } else { | |
10936 throw jsonDecoder.missingKey(jsonPath, "name"); | |
10937 } | |
10938 Location location; | |
10939 if (json.containsKey("location")) { | |
10940 location = new Location.fromJson( | |
10941 jsonDecoder, jsonPath + ".location", json["location"]); | |
10942 } | |
10943 int flags; | |
10944 if (json.containsKey("flags")) { | |
10945 flags = jsonDecoder.decodeInt(jsonPath + ".flags", json["flags"]); | |
10946 } else { | |
10947 throw jsonDecoder.missingKey(jsonPath, "flags"); | |
10948 } | |
10949 String parameters; | |
10950 if (json.containsKey("parameters")) { | |
10951 parameters = jsonDecoder.decodeString( | |
10952 jsonPath + ".parameters", json["parameters"]); | |
10953 } | |
10954 String returnType; | |
10955 if (json.containsKey("returnType")) { | |
10956 returnType = jsonDecoder.decodeString( | |
10957 jsonPath + ".returnType", json["returnType"]); | |
10958 } | |
10959 String typeParameters; | |
10960 if (json.containsKey("typeParameters")) { | |
10961 typeParameters = jsonDecoder.decodeString( | |
10962 jsonPath + ".typeParameters", json["typeParameters"]); | |
10963 } | |
10964 return new Element(kind, name, flags, | |
10965 location: location, | |
10966 parameters: parameters, | |
10967 returnType: returnType, | |
10968 typeParameters: typeParameters); | |
10969 } else { | |
10970 throw jsonDecoder.mismatch(jsonPath, "Element", json); | |
10971 } | |
10972 } | |
10973 | |
10974 bool get isAbstract => (flags & FLAG_ABSTRACT) != 0; | |
10975 bool get isConst => (flags & FLAG_CONST) != 0; | |
10976 bool get isFinal => (flags & FLAG_FINAL) != 0; | |
10977 bool get isStatic => (flags & FLAG_STATIC) != 0; | |
10978 bool get isPrivate => (flags & FLAG_PRIVATE) != 0; | |
10979 bool get isDeprecated => (flags & FLAG_DEPRECATED) != 0; | |
10980 | |
10981 Map<String, dynamic> toJson() { | |
10982 Map<String, dynamic> result = {}; | |
10983 result["kind"] = kind.toJson(); | |
10984 result["name"] = name; | |
10985 if (location != null) { | |
10986 result["location"] = location.toJson(); | |
10987 } | |
10988 result["flags"] = flags; | |
10989 if (parameters != null) { | |
10990 result["parameters"] = parameters; | |
10991 } | |
10992 if (returnType != null) { | |
10993 result["returnType"] = returnType; | |
10994 } | |
10995 if (typeParameters != null) { | |
10996 result["typeParameters"] = typeParameters; | |
10997 } | |
10998 return result; | |
10999 } | |
11000 | |
11001 @override | |
11002 String toString() => JSON.encode(toJson()); | |
11003 | |
11004 @override | |
11005 bool operator ==(other) { | |
11006 if (other is Element) { | |
11007 return kind == other.kind && | |
11008 name == other.name && | |
11009 location == other.location && | |
11010 flags == other.flags && | |
11011 parameters == other.parameters && | |
11012 returnType == other.returnType && | |
11013 typeParameters == other.typeParameters; | |
11014 } | |
11015 return false; | |
11016 } | |
11017 | |
11018 @override | |
11019 int get hashCode { | |
11020 int hash = 0; | |
11021 hash = JenkinsSmiHash.combine(hash, kind.hashCode); | |
11022 hash = JenkinsSmiHash.combine(hash, name.hashCode); | |
11023 hash = JenkinsSmiHash.combine(hash, location.hashCode); | |
11024 hash = JenkinsSmiHash.combine(hash, flags.hashCode); | |
11025 hash = JenkinsSmiHash.combine(hash, parameters.hashCode); | |
11026 hash = JenkinsSmiHash.combine(hash, returnType.hashCode); | |
11027 hash = JenkinsSmiHash.combine(hash, typeParameters.hashCode); | |
11028 return JenkinsSmiHash.finish(hash); | |
11029 } | |
11030 } | |
11031 | |
11032 /** | |
11033 * ElementKind | |
11034 * | |
11035 * enum { | |
11036 * CLASS | |
11037 * CLASS_TYPE_ALIAS | |
11038 * COMPILATION_UNIT | |
11039 * CONSTRUCTOR | |
11040 * ENUM | |
11041 * ENUM_CONSTANT | |
11042 * FIELD | |
11043 * FILE | |
11044 * FUNCTION | |
11045 * FUNCTION_TYPE_ALIAS | |
11046 * GETTER | |
11047 * LABEL | |
11048 * LIBRARY | |
11049 * LOCAL_VARIABLE | |
11050 * METHOD | |
11051 * PARAMETER | |
11052 * PREFIX | |
11053 * SETTER | |
11054 * TOP_LEVEL_VARIABLE | |
11055 * TYPE_PARAMETER | |
11056 * UNIT_TEST_GROUP | |
11057 * UNIT_TEST_TEST | |
11058 * UNKNOWN | |
11059 * } | |
11060 * | |
11061 * Clients may not extend, implement or mix-in this class. | |
11062 */ | |
11063 class ElementKind implements Enum { | |
11064 static const ElementKind CLASS = const ElementKind._("CLASS"); | |
11065 | |
11066 static const ElementKind CLASS_TYPE_ALIAS = | |
11067 const ElementKind._("CLASS_TYPE_ALIAS"); | |
11068 | |
11069 static const ElementKind COMPILATION_UNIT = | |
11070 const ElementKind._("COMPILATION_UNIT"); | |
11071 | |
11072 static const ElementKind CONSTRUCTOR = const ElementKind._("CONSTRUCTOR"); | |
11073 | |
11074 static const ElementKind ENUM = const ElementKind._("ENUM"); | |
11075 | |
11076 static const ElementKind ENUM_CONSTANT = const ElementKind._("ENUM_CONSTANT"); | |
11077 | |
11078 static const ElementKind FIELD = const ElementKind._("FIELD"); | |
11079 | |
11080 static const ElementKind FILE = const ElementKind._("FILE"); | |
11081 | |
11082 static const ElementKind FUNCTION = const ElementKind._("FUNCTION"); | |
11083 | |
11084 static const ElementKind FUNCTION_TYPE_ALIAS = | |
11085 const ElementKind._("FUNCTION_TYPE_ALIAS"); | |
11086 | |
11087 static const ElementKind GETTER = const ElementKind._("GETTER"); | |
11088 | |
11089 static const ElementKind LABEL = const ElementKind._("LABEL"); | |
11090 | |
11091 static const ElementKind LIBRARY = const ElementKind._("LIBRARY"); | |
11092 | |
11093 static const ElementKind LOCAL_VARIABLE = | |
11094 const ElementKind._("LOCAL_VARIABLE"); | |
11095 | |
11096 static const ElementKind METHOD = const ElementKind._("METHOD"); | |
11097 | |
11098 static const ElementKind PARAMETER = const ElementKind._("PARAMETER"); | |
11099 | |
11100 static const ElementKind PREFIX = const ElementKind._("PREFIX"); | |
11101 | |
11102 static const ElementKind SETTER = const ElementKind._("SETTER"); | |
11103 | |
11104 static const ElementKind TOP_LEVEL_VARIABLE = | |
11105 const ElementKind._("TOP_LEVEL_VARIABLE"); | |
11106 | |
11107 static const ElementKind TYPE_PARAMETER = | |
11108 const ElementKind._("TYPE_PARAMETER"); | |
11109 | |
11110 /** | |
11111 * Deprecated: support for tests was removed. | |
11112 */ | |
11113 static const ElementKind UNIT_TEST_GROUP = | |
11114 const ElementKind._("UNIT_TEST_GROUP"); | |
11115 | |
11116 /** | |
11117 * Deprecated: support for tests was removed. | |
11118 */ | |
11119 static const ElementKind UNIT_TEST_TEST = | |
11120 const ElementKind._("UNIT_TEST_TEST"); | |
11121 | |
11122 static const ElementKind UNKNOWN = const ElementKind._("UNKNOWN"); | |
11123 | |
11124 /** | |
11125 * A list containing all of the enum values that are defined. | |
11126 */ | |
11127 static const List<ElementKind> VALUES = const <ElementKind>[ | |
11128 CLASS, | |
11129 CLASS_TYPE_ALIAS, | |
11130 COMPILATION_UNIT, | |
11131 CONSTRUCTOR, | |
11132 ENUM, | |
11133 ENUM_CONSTANT, | |
11134 FIELD, | |
11135 FILE, | |
11136 FUNCTION, | |
11137 FUNCTION_TYPE_ALIAS, | |
11138 GETTER, | |
11139 LABEL, | |
11140 LIBRARY, | |
11141 LOCAL_VARIABLE, | |
11142 METHOD, | |
11143 PARAMETER, | |
11144 PREFIX, | |
11145 SETTER, | |
11146 TOP_LEVEL_VARIABLE, | |
11147 TYPE_PARAMETER, | |
11148 UNIT_TEST_GROUP, | |
11149 UNIT_TEST_TEST, | |
11150 UNKNOWN | |
11151 ]; | |
11152 | |
11153 final String name; | |
11154 | |
11155 const ElementKind._(this.name); | |
11156 | |
11157 factory ElementKind(String name) { | |
11158 switch (name) { | |
11159 case "CLASS": | |
11160 return CLASS; | |
11161 case "CLASS_TYPE_ALIAS": | |
11162 return CLASS_TYPE_ALIAS; | |
11163 case "COMPILATION_UNIT": | |
11164 return COMPILATION_UNIT; | |
11165 case "CONSTRUCTOR": | |
11166 return CONSTRUCTOR; | |
11167 case "ENUM": | |
11168 return ENUM; | |
11169 case "ENUM_CONSTANT": | |
11170 return ENUM_CONSTANT; | |
11171 case "FIELD": | |
11172 return FIELD; | |
11173 case "FILE": | |
11174 return FILE; | |
11175 case "FUNCTION": | |
11176 return FUNCTION; | |
11177 case "FUNCTION_TYPE_ALIAS": | |
11178 return FUNCTION_TYPE_ALIAS; | |
11179 case "GETTER": | |
11180 return GETTER; | |
11181 case "LABEL": | |
11182 return LABEL; | |
11183 case "LIBRARY": | |
11184 return LIBRARY; | |
11185 case "LOCAL_VARIABLE": | |
11186 return LOCAL_VARIABLE; | |
11187 case "METHOD": | |
11188 return METHOD; | |
11189 case "PARAMETER": | |
11190 return PARAMETER; | |
11191 case "PREFIX": | |
11192 return PREFIX; | |
11193 case "SETTER": | |
11194 return SETTER; | |
11195 case "TOP_LEVEL_VARIABLE": | |
11196 return TOP_LEVEL_VARIABLE; | |
11197 case "TYPE_PARAMETER": | |
11198 return TYPE_PARAMETER; | |
11199 case "UNIT_TEST_GROUP": | |
11200 return UNIT_TEST_GROUP; | |
11201 case "UNIT_TEST_TEST": | |
11202 return UNIT_TEST_TEST; | |
11203 case "UNKNOWN": | |
11204 return UNKNOWN; | |
11205 } | |
11206 throw new Exception('Illegal enum value: $name'); | |
11207 } | |
11208 | |
11209 factory ElementKind.fromJson( | |
11210 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
11211 if (json is String) { | |
11212 try { | |
11213 return new ElementKind(json); | |
11214 } catch (_) { | |
11215 // Fall through | |
11216 } | |
11217 } | |
11218 throw jsonDecoder.mismatch(jsonPath, "ElementKind", json); | |
11219 } | |
11220 | |
11221 @override | |
11222 String toString() => "ElementKind.$name"; | |
11223 | |
11224 String toJson() => name; | |
11225 } | |
11226 | |
11227 /** | |
11228 * ExecutableFile | |
11229 * | |
11230 * { | |
11231 * "file": FilePath | |
11232 * "kind": ExecutableKind | |
11233 * } | |
11234 * | |
11235 * Clients may not extend, implement or mix-in this class. | |
11236 */ | |
11237 class ExecutableFile implements HasToJson { | |
11238 String _file; | |
11239 | |
11240 ExecutableKind _kind; | |
11241 | |
11242 /** | |
11243 * The path of the executable file. | |
11244 */ | |
11245 String get file => _file; | |
11246 | |
11247 /** | |
11248 * The path of the executable file. | |
11249 */ | |
11250 void set file(String value) { | |
11251 assert(value != null); | |
11252 this._file = value; | |
11253 } | |
11254 | |
11255 /** | |
11256 * The kind of the executable file. | |
11257 */ | |
11258 ExecutableKind get kind => _kind; | |
11259 | |
11260 /** | |
11261 * The kind of the executable file. | |
11262 */ | |
11263 void set kind(ExecutableKind value) { | |
11264 assert(value != null); | |
11265 this._kind = value; | |
11266 } | |
11267 | |
11268 ExecutableFile(String file, ExecutableKind kind) { | |
11269 this.file = file; | |
11270 this.kind = kind; | |
11271 } | |
11272 | |
11273 factory ExecutableFile.fromJson( | |
11274 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
11275 if (json == null) { | |
11276 json = {}; | |
11277 } | |
11278 if (json is Map) { | |
11279 String file; | |
11280 if (json.containsKey("file")) { | |
11281 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
11282 } else { | |
11283 throw jsonDecoder.missingKey(jsonPath, "file"); | |
11284 } | |
11285 ExecutableKind kind; | |
11286 if (json.containsKey("kind")) { | |
11287 kind = new ExecutableKind.fromJson( | |
11288 jsonDecoder, jsonPath + ".kind", json["kind"]); | |
11289 } else { | |
11290 throw jsonDecoder.missingKey(jsonPath, "kind"); | |
11291 } | |
11292 return new ExecutableFile(file, kind); | |
11293 } else { | |
11294 throw jsonDecoder.mismatch(jsonPath, "ExecutableFile", json); | |
11295 } | |
11296 } | |
11297 | |
11298 Map<String, dynamic> toJson() { | |
11299 Map<String, dynamic> result = {}; | |
11300 result["file"] = file; | |
11301 result["kind"] = kind.toJson(); | |
11302 return result; | |
11303 } | |
11304 | |
11305 @override | |
11306 String toString() => JSON.encode(toJson()); | |
11307 | |
11308 @override | |
11309 bool operator ==(other) { | |
11310 if (other is ExecutableFile) { | |
11311 return file == other.file && kind == other.kind; | |
11312 } | |
11313 return false; | |
11314 } | |
11315 | |
11316 @override | |
11317 int get hashCode { | |
11318 int hash = 0; | |
11319 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
11320 hash = JenkinsSmiHash.combine(hash, kind.hashCode); | |
11321 return JenkinsSmiHash.finish(hash); | |
11322 } | |
11323 } | |
11324 | |
11325 /** | |
11326 * ExecutableKind | |
11327 * | |
11328 * enum { | |
11329 * CLIENT | |
11330 * EITHER | |
11331 * NOT_EXECUTABLE | |
11332 * SERVER | |
11333 * } | |
11334 * | |
11335 * Clients may not extend, implement or mix-in this class. | |
11336 */ | |
11337 class ExecutableKind implements Enum { | |
11338 static const ExecutableKind CLIENT = const ExecutableKind._("CLIENT"); | |
11339 | |
11340 static const ExecutableKind EITHER = const ExecutableKind._("EITHER"); | |
11341 | |
11342 static const ExecutableKind NOT_EXECUTABLE = | |
11343 const ExecutableKind._("NOT_EXECUTABLE"); | |
11344 | |
11345 static const ExecutableKind SERVER = const ExecutableKind._("SERVER"); | |
11346 | |
11347 /** | |
11348 * A list containing all of the enum values that are defined. | |
11349 */ | |
11350 static const List<ExecutableKind> VALUES = const <ExecutableKind>[ | |
11351 CLIENT, | |
11352 EITHER, | |
11353 NOT_EXECUTABLE, | |
11354 SERVER | |
11355 ]; | |
11356 | |
11357 final String name; | |
11358 | |
11359 const ExecutableKind._(this.name); | |
11360 | |
11361 factory ExecutableKind(String name) { | |
11362 switch (name) { | |
11363 case "CLIENT": | |
11364 return CLIENT; | |
11365 case "EITHER": | |
11366 return EITHER; | |
11367 case "NOT_EXECUTABLE": | |
11368 return NOT_EXECUTABLE; | |
11369 case "SERVER": | |
11370 return SERVER; | |
11371 } | |
11372 throw new Exception('Illegal enum value: $name'); | |
11373 } | |
11374 | |
11375 factory ExecutableKind.fromJson( | |
11376 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
11377 if (json is String) { | |
11378 try { | |
11379 return new ExecutableKind(json); | |
11380 } catch (_) { | |
11381 // Fall through | |
11382 } | |
11383 } | |
11384 throw jsonDecoder.mismatch(jsonPath, "ExecutableKind", json); | |
11385 } | |
11386 | |
11387 @override | |
11388 String toString() => "ExecutableKind.$name"; | |
11389 | |
11390 String toJson() => name; | |
11391 } | |
11392 | |
11393 /** | |
11394 * ExecutionService | |
11395 * | |
11396 * enum { | |
11397 * LAUNCH_DATA | |
11398 * } | |
11399 * | |
11400 * Clients may not extend, implement or mix-in this class. | |
11401 */ | |
11402 class ExecutionService implements Enum { | |
11403 static const ExecutionService LAUNCH_DATA = | |
11404 const ExecutionService._("LAUNCH_DATA"); | |
11405 | |
11406 /** | |
11407 * A list containing all of the enum values that are defined. | |
11408 */ | |
11409 static const List<ExecutionService> VALUES = const <ExecutionService>[ | |
11410 LAUNCH_DATA | |
11411 ]; | |
11412 | |
11413 final String name; | |
11414 | |
11415 const ExecutionService._(this.name); | |
11416 | |
11417 factory ExecutionService(String name) { | |
11418 switch (name) { | |
11419 case "LAUNCH_DATA": | |
11420 return LAUNCH_DATA; | |
11421 } | |
11422 throw new Exception('Illegal enum value: $name'); | |
11423 } | |
11424 | |
11425 factory ExecutionService.fromJson( | |
11426 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
11427 if (json is String) { | |
11428 try { | |
11429 return new ExecutionService(json); | |
11430 } catch (_) { | |
11431 // Fall through | |
11432 } | |
11433 } | |
11434 throw jsonDecoder.mismatch(jsonPath, "ExecutionService", json); | |
11435 } | |
11436 | |
11437 @override | |
11438 String toString() => "ExecutionService.$name"; | |
11439 | |
11440 String toJson() => name; | |
11441 } | |
11442 | |
11443 /** | |
11444 * FileKind | |
11445 * | |
11446 * enum { | |
11447 * LIBRARY | |
11448 * PART | |
11449 * } | |
11450 * | |
11451 * Clients may not extend, implement or mix-in this class. | |
11452 */ | |
11453 class FileKind implements Enum { | |
11454 static const FileKind LIBRARY = const FileKind._("LIBRARY"); | |
11455 | |
11456 static const FileKind PART = const FileKind._("PART"); | |
11457 | |
11458 /** | |
11459 * A list containing all of the enum values that are defined. | |
11460 */ | |
11461 static const List<FileKind> VALUES = const <FileKind>[LIBRARY, PART]; | |
11462 | |
11463 final String name; | |
11464 | |
11465 const FileKind._(this.name); | |
11466 | |
11467 factory FileKind(String name) { | |
11468 switch (name) { | |
11469 case "LIBRARY": | |
11470 return LIBRARY; | |
11471 case "PART": | |
11472 return PART; | |
11473 } | |
11474 throw new Exception('Illegal enum value: $name'); | |
11475 } | |
11476 | |
11477 factory FileKind.fromJson( | |
11478 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
11479 if (json is String) { | |
11480 try { | |
11481 return new FileKind(json); | |
11482 } catch (_) { | |
11483 // Fall through | |
11484 } | |
11485 } | |
11486 throw jsonDecoder.mismatch(jsonPath, "FileKind", json); | |
11487 } | |
11488 | |
11489 @override | |
11490 String toString() => "FileKind.$name"; | |
11491 | |
11492 String toJson() => name; | |
11493 } | |
11494 | |
11495 /** | |
11496 * FoldingKind | |
11497 * | |
11498 * enum { | |
11499 * COMMENT | |
11500 * CLASS_MEMBER | |
11501 * DIRECTIVES | |
11502 * DOCUMENTATION_COMMENT | |
11503 * TOP_LEVEL_DECLARATION | |
11504 * } | |
11505 * | |
11506 * Clients may not extend, implement or mix-in this class. | |
11507 */ | |
11508 class FoldingKind implements Enum { | |
11509 static const FoldingKind COMMENT = const FoldingKind._("COMMENT"); | |
11510 | |
11511 static const FoldingKind CLASS_MEMBER = const FoldingKind._("CLASS_MEMBER"); | |
11512 | |
11513 static const FoldingKind DIRECTIVES = const FoldingKind._("DIRECTIVES"); | |
11514 | |
11515 static const FoldingKind DOCUMENTATION_COMMENT = | |
11516 const FoldingKind._("DOCUMENTATION_COMMENT"); | |
11517 | |
11518 static const FoldingKind TOP_LEVEL_DECLARATION = | |
11519 const FoldingKind._("TOP_LEVEL_DECLARATION"); | |
11520 | |
11521 /** | |
11522 * A list containing all of the enum values that are defined. | |
11523 */ | |
11524 static const List<FoldingKind> VALUES = const <FoldingKind>[ | |
11525 COMMENT, | |
11526 CLASS_MEMBER, | |
11527 DIRECTIVES, | |
11528 DOCUMENTATION_COMMENT, | |
11529 TOP_LEVEL_DECLARATION | |
11530 ]; | |
11531 | |
11532 final String name; | |
11533 | |
11534 const FoldingKind._(this.name); | |
11535 | |
11536 factory FoldingKind(String name) { | |
11537 switch (name) { | |
11538 case "COMMENT": | |
11539 return COMMENT; | |
11540 case "CLASS_MEMBER": | |
11541 return CLASS_MEMBER; | |
11542 case "DIRECTIVES": | |
11543 return DIRECTIVES; | |
11544 case "DOCUMENTATION_COMMENT": | |
11545 return DOCUMENTATION_COMMENT; | |
11546 case "TOP_LEVEL_DECLARATION": | |
11547 return TOP_LEVEL_DECLARATION; | |
11548 } | |
11549 throw new Exception('Illegal enum value: $name'); | |
11550 } | |
11551 | |
11552 factory FoldingKind.fromJson( | |
11553 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
11554 if (json is String) { | |
11555 try { | |
11556 return new FoldingKind(json); | |
11557 } catch (_) { | |
11558 // Fall through | |
11559 } | |
11560 } | |
11561 throw jsonDecoder.mismatch(jsonPath, "FoldingKind", json); | |
11562 } | |
11563 | |
11564 @override | |
11565 String toString() => "FoldingKind.$name"; | |
11566 | |
11567 String toJson() => name; | |
11568 } | |
11569 | |
11570 /** | |
11571 * FoldingRegion | |
11572 * | |
11573 * { | |
11574 * "kind": FoldingKind | |
11575 * "offset": int | |
11576 * "length": int | |
11577 * } | |
11578 * | |
11579 * Clients may not extend, implement or mix-in this class. | |
11580 */ | |
11581 class FoldingRegion implements HasToJson { | |
11582 FoldingKind _kind; | |
11583 | |
11584 int _offset; | |
11585 | |
11586 int _length; | |
11587 | |
11588 /** | |
11589 * The kind of the region. | |
11590 */ | |
11591 FoldingKind get kind => _kind; | |
11592 | |
11593 /** | |
11594 * The kind of the region. | |
11595 */ | |
11596 void set kind(FoldingKind value) { | |
11597 assert(value != null); | |
11598 this._kind = value; | |
11599 } | |
11600 | |
11601 /** | |
11602 * The offset of the region to be folded. | |
11603 */ | |
11604 int get offset => _offset; | |
11605 | |
11606 /** | |
11607 * The offset of the region to be folded. | |
11608 */ | |
11609 void set offset(int value) { | |
11610 assert(value != null); | |
11611 this._offset = value; | |
11612 } | |
11613 | |
11614 /** | |
11615 * The length of the region to be folded. | |
11616 */ | |
11617 int get length => _length; | |
11618 | |
11619 /** | |
11620 * The length of the region to be folded. | |
11621 */ | |
11622 void set length(int value) { | |
11623 assert(value != null); | |
11624 this._length = value; | |
11625 } | |
11626 | |
11627 FoldingRegion(FoldingKind kind, int offset, int length) { | |
11628 this.kind = kind; | |
11629 this.offset = offset; | |
11630 this.length = length; | |
11631 } | |
11632 | |
11633 factory FoldingRegion.fromJson( | |
11634 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
11635 if (json == null) { | |
11636 json = {}; | |
11637 } | |
11638 if (json is Map) { | |
11639 FoldingKind kind; | |
11640 if (json.containsKey("kind")) { | |
11641 kind = new FoldingKind.fromJson( | |
11642 jsonDecoder, jsonPath + ".kind", json["kind"]); | |
11643 } else { | |
11644 throw jsonDecoder.missingKey(jsonPath, "kind"); | |
11645 } | |
11646 int offset; | |
11647 if (json.containsKey("offset")) { | |
11648 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
11649 } else { | |
11650 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
11651 } | |
11652 int length; | |
11653 if (json.containsKey("length")) { | |
11654 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
11655 } else { | |
11656 throw jsonDecoder.missingKey(jsonPath, "length"); | |
11657 } | |
11658 return new FoldingRegion(kind, offset, length); | |
11659 } else { | |
11660 throw jsonDecoder.mismatch(jsonPath, "FoldingRegion", json); | |
11661 } | |
11662 } | |
11663 | |
11664 Map<String, dynamic> toJson() { | |
11665 Map<String, dynamic> result = {}; | |
11666 result["kind"] = kind.toJson(); | |
11667 result["offset"] = offset; | |
11668 result["length"] = length; | |
11669 return result; | |
11670 } | |
11671 | |
11672 @override | |
11673 String toString() => JSON.encode(toJson()); | |
11674 | |
11675 @override | |
11676 bool operator ==(other) { | |
11677 if (other is FoldingRegion) { | |
11678 return kind == other.kind && | |
11679 offset == other.offset && | |
11680 length == other.length; | |
11681 } | |
11682 return false; | |
11683 } | |
11684 | |
11685 @override | |
11686 int get hashCode { | |
11687 int hash = 0; | |
11688 hash = JenkinsSmiHash.combine(hash, kind.hashCode); | |
11689 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
11690 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
11691 return JenkinsSmiHash.finish(hash); | |
11692 } | |
11693 } | |
11694 | |
11695 /** | |
11696 * GeneralAnalysisService | |
11697 * | |
11698 * enum { | |
11699 * ANALYZED_FILES | |
11700 * } | |
11701 * | |
11702 * Clients may not extend, implement or mix-in this class. | |
11703 */ | |
11704 class GeneralAnalysisService implements Enum { | |
11705 static const GeneralAnalysisService ANALYZED_FILES = | |
11706 const GeneralAnalysisService._("ANALYZED_FILES"); | |
11707 | |
11708 /** | |
11709 * A list containing all of the enum values that are defined. | |
11710 */ | |
11711 static const List<GeneralAnalysisService> VALUES = | |
11712 const <GeneralAnalysisService>[ANALYZED_FILES]; | |
11713 | |
11714 final String name; | |
11715 | |
11716 const GeneralAnalysisService._(this.name); | |
11717 | |
11718 factory GeneralAnalysisService(String name) { | |
11719 switch (name) { | |
11720 case "ANALYZED_FILES": | |
11721 return ANALYZED_FILES; | |
11722 } | |
11723 throw new Exception('Illegal enum value: $name'); | |
11724 } | |
11725 | |
11726 factory GeneralAnalysisService.fromJson( | |
11727 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
11728 if (json is String) { | |
11729 try { | |
11730 return new GeneralAnalysisService(json); | |
11731 } catch (_) { | |
11732 // Fall through | |
11733 } | |
11734 } | |
11735 throw jsonDecoder.mismatch(jsonPath, "GeneralAnalysisService", json); | |
11736 } | |
11737 | |
11738 @override | |
11739 String toString() => "GeneralAnalysisService.$name"; | |
11740 | |
11741 String toJson() => name; | |
11742 } | |
11743 | |
11744 /** | |
11745 * HighlightRegion | |
11746 * | |
11747 * { | |
11748 * "type": HighlightRegionType | |
11749 * "offset": int | |
11750 * "length": int | |
11751 * } | |
11752 * | |
11753 * Clients may not extend, implement or mix-in this class. | |
11754 */ | |
11755 class HighlightRegion implements HasToJson { | |
11756 HighlightRegionType _type; | |
11757 | |
11758 int _offset; | |
11759 | |
11760 int _length; | |
11761 | |
11762 /** | |
11763 * The type of highlight associated with the region. | |
11764 */ | |
11765 HighlightRegionType get type => _type; | |
11766 | |
11767 /** | |
11768 * The type of highlight associated with the region. | |
11769 */ | |
11770 void set type(HighlightRegionType value) { | |
11771 assert(value != null); | |
11772 this._type = value; | |
11773 } | |
11774 | |
11775 /** | |
11776 * The offset of the region to be highlighted. | |
11777 */ | |
11778 int get offset => _offset; | |
11779 | |
11780 /** | |
11781 * The offset of the region to be highlighted. | |
11782 */ | |
11783 void set offset(int value) { | |
11784 assert(value != null); | |
11785 this._offset = value; | |
11786 } | |
11787 | |
11788 /** | |
11789 * The length of the region to be highlighted. | |
11790 */ | |
11791 int get length => _length; | |
11792 | |
11793 /** | |
11794 * The length of the region to be highlighted. | |
11795 */ | |
11796 void set length(int value) { | |
11797 assert(value != null); | |
11798 this._length = value; | |
11799 } | |
11800 | |
11801 HighlightRegion(HighlightRegionType type, int offset, int length) { | |
11802 this.type = type; | |
11803 this.offset = offset; | |
11804 this.length = length; | |
11805 } | |
11806 | |
11807 factory HighlightRegion.fromJson( | |
11808 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
11809 if (json == null) { | |
11810 json = {}; | |
11811 } | |
11812 if (json is Map) { | |
11813 HighlightRegionType type; | |
11814 if (json.containsKey("type")) { | |
11815 type = new HighlightRegionType.fromJson( | |
11816 jsonDecoder, jsonPath + ".type", json["type"]); | |
11817 } else { | |
11818 throw jsonDecoder.missingKey(jsonPath, "type"); | |
11819 } | |
11820 int offset; | |
11821 if (json.containsKey("offset")) { | |
11822 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
11823 } else { | |
11824 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
11825 } | |
11826 int length; | |
11827 if (json.containsKey("length")) { | |
11828 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
11829 } else { | |
11830 throw jsonDecoder.missingKey(jsonPath, "length"); | |
11831 } | |
11832 return new HighlightRegion(type, offset, length); | |
11833 } else { | |
11834 throw jsonDecoder.mismatch(jsonPath, "HighlightRegion", json); | |
11835 } | |
11836 } | |
11837 | |
11838 Map<String, dynamic> toJson() { | |
11839 Map<String, dynamic> result = {}; | |
11840 result["type"] = type.toJson(); | |
11841 result["offset"] = offset; | |
11842 result["length"] = length; | |
11843 return result; | |
11844 } | |
11845 | |
11846 @override | |
11847 String toString() => JSON.encode(toJson()); | |
11848 | |
11849 @override | |
11850 bool operator ==(other) { | |
11851 if (other is HighlightRegion) { | |
11852 return type == other.type && | |
11853 offset == other.offset && | |
11854 length == other.length; | |
11855 } | |
11856 return false; | |
11857 } | |
11858 | |
11859 @override | |
11860 int get hashCode { | |
11861 int hash = 0; | |
11862 hash = JenkinsSmiHash.combine(hash, type.hashCode); | |
11863 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
11864 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
11865 return JenkinsSmiHash.finish(hash); | |
11866 } | |
11867 } | |
11868 | |
11869 /** | |
11870 * HighlightRegionType | |
11871 * | |
11872 * enum { | |
11873 * ANNOTATION | |
11874 * BUILT_IN | |
11875 * CLASS | |
11876 * COMMENT_BLOCK | |
11877 * COMMENT_DOCUMENTATION | |
11878 * COMMENT_END_OF_LINE | |
11879 * CONSTRUCTOR | |
11880 * DIRECTIVE | |
11881 * DYNAMIC_TYPE | |
11882 * DYNAMIC_LOCAL_VARIABLE_DECLARATION | |
11883 * DYNAMIC_LOCAL_VARIABLE_REFERENCE | |
11884 * DYNAMIC_PARAMETER_DECLARATION | |
11885 * DYNAMIC_PARAMETER_REFERENCE | |
11886 * ENUM | |
11887 * ENUM_CONSTANT | |
11888 * FIELD | |
11889 * FIELD_STATIC | |
11890 * FUNCTION | |
11891 * FUNCTION_DECLARATION | |
11892 * FUNCTION_TYPE_ALIAS | |
11893 * GETTER_DECLARATION | |
11894 * IDENTIFIER_DEFAULT | |
11895 * IMPORT_PREFIX | |
11896 * INSTANCE_FIELD_DECLARATION | |
11897 * INSTANCE_FIELD_REFERENCE | |
11898 * INSTANCE_GETTER_DECLARATION | |
11899 * INSTANCE_GETTER_REFERENCE | |
11900 * INSTANCE_METHOD_DECLARATION | |
11901 * INSTANCE_METHOD_REFERENCE | |
11902 * INSTANCE_SETTER_DECLARATION | |
11903 * INSTANCE_SETTER_REFERENCE | |
11904 * INVALID_STRING_ESCAPE | |
11905 * KEYWORD | |
11906 * LABEL | |
11907 * LIBRARY_NAME | |
11908 * LITERAL_BOOLEAN | |
11909 * LITERAL_DOUBLE | |
11910 * LITERAL_INTEGER | |
11911 * LITERAL_LIST | |
11912 * LITERAL_MAP | |
11913 * LITERAL_STRING | |
11914 * LOCAL_FUNCTION_DECLARATION | |
11915 * LOCAL_FUNCTION_REFERENCE | |
11916 * LOCAL_VARIABLE | |
11917 * LOCAL_VARIABLE_DECLARATION | |
11918 * LOCAL_VARIABLE_REFERENCE | |
11919 * METHOD | |
11920 * METHOD_DECLARATION | |
11921 * METHOD_DECLARATION_STATIC | |
11922 * METHOD_STATIC | |
11923 * PARAMETER | |
11924 * SETTER_DECLARATION | |
11925 * TOP_LEVEL_VARIABLE | |
11926 * PARAMETER_DECLARATION | |
11927 * PARAMETER_REFERENCE | |
11928 * STATIC_FIELD_DECLARATION | |
11929 * STATIC_GETTER_DECLARATION | |
11930 * STATIC_GETTER_REFERENCE | |
11931 * STATIC_METHOD_DECLARATION | |
11932 * STATIC_METHOD_REFERENCE | |
11933 * STATIC_SETTER_DECLARATION | |
11934 * STATIC_SETTER_REFERENCE | |
11935 * TOP_LEVEL_FUNCTION_DECLARATION | |
11936 * TOP_LEVEL_FUNCTION_REFERENCE | |
11937 * TOP_LEVEL_GETTER_DECLARATION | |
11938 * TOP_LEVEL_GETTER_REFERENCE | |
11939 * TOP_LEVEL_SETTER_DECLARATION | |
11940 * TOP_LEVEL_SETTER_REFERENCE | |
11941 * TOP_LEVEL_VARIABLE_DECLARATION | |
11942 * TYPE_NAME_DYNAMIC | |
11943 * TYPE_PARAMETER | |
11944 * UNRESOLVED_INSTANCE_MEMBER_REFERENCE | |
11945 * VALID_STRING_ESCAPE | |
11946 * } | |
11947 * | |
11948 * Clients may not extend, implement or mix-in this class. | |
11949 */ | |
11950 class HighlightRegionType implements Enum { | |
11951 static const HighlightRegionType ANNOTATION = | |
11952 const HighlightRegionType._("ANNOTATION"); | |
11953 | |
11954 static const HighlightRegionType BUILT_IN = | |
11955 const HighlightRegionType._("BUILT_IN"); | |
11956 | |
11957 static const HighlightRegionType CLASS = const HighlightRegionType._("CLASS"); | |
11958 | |
11959 static const HighlightRegionType COMMENT_BLOCK = | |
11960 const HighlightRegionType._("COMMENT_BLOCK"); | |
11961 | |
11962 static const HighlightRegionType COMMENT_DOCUMENTATION = | |
11963 const HighlightRegionType._("COMMENT_DOCUMENTATION"); | |
11964 | |
11965 static const HighlightRegionType COMMENT_END_OF_LINE = | |
11966 const HighlightRegionType._("COMMENT_END_OF_LINE"); | |
11967 | |
11968 static const HighlightRegionType CONSTRUCTOR = | |
11969 const HighlightRegionType._("CONSTRUCTOR"); | |
11970 | |
11971 static const HighlightRegionType DIRECTIVE = | |
11972 const HighlightRegionType._("DIRECTIVE"); | |
11973 | |
11974 /** | |
11975 * Only for version 1 of highlight. | |
11976 */ | |
11977 static const HighlightRegionType DYNAMIC_TYPE = | |
11978 const HighlightRegionType._("DYNAMIC_TYPE"); | |
11979 | |
11980 /** | |
11981 * Only for version 2 of highlight. | |
11982 */ | |
11983 static const HighlightRegionType DYNAMIC_LOCAL_VARIABLE_DECLARATION = | |
11984 const HighlightRegionType._("DYNAMIC_LOCAL_VARIABLE_DECLARATION"); | |
11985 | |
11986 /** | |
11987 * Only for version 2 of highlight. | |
11988 */ | |
11989 static const HighlightRegionType DYNAMIC_LOCAL_VARIABLE_REFERENCE = | |
11990 const HighlightRegionType._("DYNAMIC_LOCAL_VARIABLE_REFERENCE"); | |
11991 | |
11992 /** | |
11993 * Only for version 2 of highlight. | |
11994 */ | |
11995 static const HighlightRegionType DYNAMIC_PARAMETER_DECLARATION = | |
11996 const HighlightRegionType._("DYNAMIC_PARAMETER_DECLARATION"); | |
11997 | |
11998 /** | |
11999 * Only for version 2 of highlight. | |
12000 */ | |
12001 static const HighlightRegionType DYNAMIC_PARAMETER_REFERENCE = | |
12002 const HighlightRegionType._("DYNAMIC_PARAMETER_REFERENCE"); | |
12003 | |
12004 static const HighlightRegionType ENUM = const HighlightRegionType._("ENUM"); | |
12005 | |
12006 static const HighlightRegionType ENUM_CONSTANT = | |
12007 const HighlightRegionType._("ENUM_CONSTANT"); | |
12008 | |
12009 /** | |
12010 * Only for version 1 of highlight. | |
12011 */ | |
12012 static const HighlightRegionType FIELD = const HighlightRegionType._("FIELD"); | |
12013 | |
12014 /** | |
12015 * Only for version 1 of highlight. | |
12016 */ | |
12017 static const HighlightRegionType FIELD_STATIC = | |
12018 const HighlightRegionType._("FIELD_STATIC"); | |
12019 | |
12020 /** | |
12021 * Only for version 1 of highlight. | |
12022 */ | |
12023 static const HighlightRegionType FUNCTION = | |
12024 const HighlightRegionType._("FUNCTION"); | |
12025 | |
12026 /** | |
12027 * Only for version 1 of highlight. | |
12028 */ | |
12029 static const HighlightRegionType FUNCTION_DECLARATION = | |
12030 const HighlightRegionType._("FUNCTION_DECLARATION"); | |
12031 | |
12032 static const HighlightRegionType FUNCTION_TYPE_ALIAS = | |
12033 const HighlightRegionType._("FUNCTION_TYPE_ALIAS"); | |
12034 | |
12035 /** | |
12036 * Only for version 1 of highlight. | |
12037 */ | |
12038 static const HighlightRegionType GETTER_DECLARATION = | |
12039 const HighlightRegionType._("GETTER_DECLARATION"); | |
12040 | |
12041 static const HighlightRegionType IDENTIFIER_DEFAULT = | |
12042 const HighlightRegionType._("IDENTIFIER_DEFAULT"); | |
12043 | |
12044 static const HighlightRegionType IMPORT_PREFIX = | |
12045 const HighlightRegionType._("IMPORT_PREFIX"); | |
12046 | |
12047 /** | |
12048 * Only for version 2 of highlight. | |
12049 */ | |
12050 static const HighlightRegionType INSTANCE_FIELD_DECLARATION = | |
12051 const HighlightRegionType._("INSTANCE_FIELD_DECLARATION"); | |
12052 | |
12053 /** | |
12054 * Only for version 2 of highlight. | |
12055 */ | |
12056 static const HighlightRegionType INSTANCE_FIELD_REFERENCE = | |
12057 const HighlightRegionType._("INSTANCE_FIELD_REFERENCE"); | |
12058 | |
12059 /** | |
12060 * Only for version 2 of highlight. | |
12061 */ | |
12062 static const HighlightRegionType INSTANCE_GETTER_DECLARATION = | |
12063 const HighlightRegionType._("INSTANCE_GETTER_DECLARATION"); | |
12064 | |
12065 /** | |
12066 * Only for version 2 of highlight. | |
12067 */ | |
12068 static const HighlightRegionType INSTANCE_GETTER_REFERENCE = | |
12069 const HighlightRegionType._("INSTANCE_GETTER_REFERENCE"); | |
12070 | |
12071 /** | |
12072 * Only for version 2 of highlight. | |
12073 */ | |
12074 static const HighlightRegionType INSTANCE_METHOD_DECLARATION = | |
12075 const HighlightRegionType._("INSTANCE_METHOD_DECLARATION"); | |
12076 | |
12077 /** | |
12078 * Only for version 2 of highlight. | |
12079 */ | |
12080 static const HighlightRegionType INSTANCE_METHOD_REFERENCE = | |
12081 const HighlightRegionType._("INSTANCE_METHOD_REFERENCE"); | |
12082 | |
12083 /** | |
12084 * Only for version 2 of highlight. | |
12085 */ | |
12086 static const HighlightRegionType INSTANCE_SETTER_DECLARATION = | |
12087 const HighlightRegionType._("INSTANCE_SETTER_DECLARATION"); | |
12088 | |
12089 /** | |
12090 * Only for version 2 of highlight. | |
12091 */ | |
12092 static const HighlightRegionType INSTANCE_SETTER_REFERENCE = | |
12093 const HighlightRegionType._("INSTANCE_SETTER_REFERENCE"); | |
12094 | |
12095 /** | |
12096 * Only for version 2 of highlight. | |
12097 */ | |
12098 static const HighlightRegionType INVALID_STRING_ESCAPE = | |
12099 const HighlightRegionType._("INVALID_STRING_ESCAPE"); | |
12100 | |
12101 static const HighlightRegionType KEYWORD = | |
12102 const HighlightRegionType._("KEYWORD"); | |
12103 | |
12104 static const HighlightRegionType LABEL = const HighlightRegionType._("LABEL"); | |
12105 | |
12106 /** | |
12107 * Only for version 2 of highlight. | |
12108 */ | |
12109 static const HighlightRegionType LIBRARY_NAME = | |
12110 const HighlightRegionType._("LIBRARY_NAME"); | |
12111 | |
12112 static const HighlightRegionType LITERAL_BOOLEAN = | |
12113 const HighlightRegionType._("LITERAL_BOOLEAN"); | |
12114 | |
12115 static const HighlightRegionType LITERAL_DOUBLE = | |
12116 const HighlightRegionType._("LITERAL_DOUBLE"); | |
12117 | |
12118 static const HighlightRegionType LITERAL_INTEGER = | |
12119 const HighlightRegionType._("LITERAL_INTEGER"); | |
12120 | |
12121 static const HighlightRegionType LITERAL_LIST = | |
12122 const HighlightRegionType._("LITERAL_LIST"); | |
12123 | |
12124 static const HighlightRegionType LITERAL_MAP = | |
12125 const HighlightRegionType._("LITERAL_MAP"); | |
12126 | |
12127 static const HighlightRegionType LITERAL_STRING = | |
12128 const HighlightRegionType._("LITERAL_STRING"); | |
12129 | |
12130 /** | |
12131 * Only for version 2 of highlight. | |
12132 */ | |
12133 static const HighlightRegionType LOCAL_FUNCTION_DECLARATION = | |
12134 const HighlightRegionType._("LOCAL_FUNCTION_DECLARATION"); | |
12135 | |
12136 /** | |
12137 * Only for version 2 of highlight. | |
12138 */ | |
12139 static const HighlightRegionType LOCAL_FUNCTION_REFERENCE = | |
12140 const HighlightRegionType._("LOCAL_FUNCTION_REFERENCE"); | |
12141 | |
12142 /** | |
12143 * Only for version 1 of highlight. | |
12144 */ | |
12145 static const HighlightRegionType LOCAL_VARIABLE = | |
12146 const HighlightRegionType._("LOCAL_VARIABLE"); | |
12147 | |
12148 static const HighlightRegionType LOCAL_VARIABLE_DECLARATION = | |
12149 const HighlightRegionType._("LOCAL_VARIABLE_DECLARATION"); | |
12150 | |
12151 /** | |
12152 * Only for version 2 of highlight. | |
12153 */ | |
12154 static const HighlightRegionType LOCAL_VARIABLE_REFERENCE = | |
12155 const HighlightRegionType._("LOCAL_VARIABLE_REFERENCE"); | |
12156 | |
12157 /** | |
12158 * Only for version 1 of highlight. | |
12159 */ | |
12160 static const HighlightRegionType METHOD = | |
12161 const HighlightRegionType._("METHOD"); | |
12162 | |
12163 /** | |
12164 * Only for version 1 of highlight. | |
12165 */ | |
12166 static const HighlightRegionType METHOD_DECLARATION = | |
12167 const HighlightRegionType._("METHOD_DECLARATION"); | |
12168 | |
12169 /** | |
12170 * Only for version 1 of highlight. | |
12171 */ | |
12172 static const HighlightRegionType METHOD_DECLARATION_STATIC = | |
12173 const HighlightRegionType._("METHOD_DECLARATION_STATIC"); | |
12174 | |
12175 /** | |
12176 * Only for version 1 of highlight. | |
12177 */ | |
12178 static const HighlightRegionType METHOD_STATIC = | |
12179 const HighlightRegionType._("METHOD_STATIC"); | |
12180 | |
12181 /** | |
12182 * Only for version 1 of highlight. | |
12183 */ | |
12184 static const HighlightRegionType PARAMETER = | |
12185 const HighlightRegionType._("PARAMETER"); | |
12186 | |
12187 /** | |
12188 * Only for version 1 of highlight. | |
12189 */ | |
12190 static const HighlightRegionType SETTER_DECLARATION = | |
12191 const HighlightRegionType._("SETTER_DECLARATION"); | |
12192 | |
12193 /** | |
12194 * Only for version 1 of highlight. | |
12195 */ | |
12196 static const HighlightRegionType TOP_LEVEL_VARIABLE = | |
12197 const HighlightRegionType._("TOP_LEVEL_VARIABLE"); | |
12198 | |
12199 /** | |
12200 * Only for version 2 of highlight. | |
12201 */ | |
12202 static const HighlightRegionType PARAMETER_DECLARATION = | |
12203 const HighlightRegionType._("PARAMETER_DECLARATION"); | |
12204 | |
12205 /** | |
12206 * Only for version 2 of highlight. | |
12207 */ | |
12208 static const HighlightRegionType PARAMETER_REFERENCE = | |
12209 const HighlightRegionType._("PARAMETER_REFERENCE"); | |
12210 | |
12211 /** | |
12212 * Only for version 2 of highlight. | |
12213 */ | |
12214 static const HighlightRegionType STATIC_FIELD_DECLARATION = | |
12215 const HighlightRegionType._("STATIC_FIELD_DECLARATION"); | |
12216 | |
12217 /** | |
12218 * Only for version 2 of highlight. | |
12219 */ | |
12220 static const HighlightRegionType STATIC_GETTER_DECLARATION = | |
12221 const HighlightRegionType._("STATIC_GETTER_DECLARATION"); | |
12222 | |
12223 /** | |
12224 * Only for version 2 of highlight. | |
12225 */ | |
12226 static const HighlightRegionType STATIC_GETTER_REFERENCE = | |
12227 const HighlightRegionType._("STATIC_GETTER_REFERENCE"); | |
12228 | |
12229 /** | |
12230 * Only for version 2 of highlight. | |
12231 */ | |
12232 static const HighlightRegionType STATIC_METHOD_DECLARATION = | |
12233 const HighlightRegionType._("STATIC_METHOD_DECLARATION"); | |
12234 | |
12235 /** | |
12236 * Only for version 2 of highlight. | |
12237 */ | |
12238 static const HighlightRegionType STATIC_METHOD_REFERENCE = | |
12239 const HighlightRegionType._("STATIC_METHOD_REFERENCE"); | |
12240 | |
12241 /** | |
12242 * Only for version 2 of highlight. | |
12243 */ | |
12244 static const HighlightRegionType STATIC_SETTER_DECLARATION = | |
12245 const HighlightRegionType._("STATIC_SETTER_DECLARATION"); | |
12246 | |
12247 /** | |
12248 * Only for version 2 of highlight. | |
12249 */ | |
12250 static const HighlightRegionType STATIC_SETTER_REFERENCE = | |
12251 const HighlightRegionType._("STATIC_SETTER_REFERENCE"); | |
12252 | |
12253 /** | |
12254 * Only for version 2 of highlight. | |
12255 */ | |
12256 static const HighlightRegionType TOP_LEVEL_FUNCTION_DECLARATION = | |
12257 const HighlightRegionType._("TOP_LEVEL_FUNCTION_DECLARATION"); | |
12258 | |
12259 /** | |
12260 * Only for version 2 of highlight. | |
12261 */ | |
12262 static const HighlightRegionType TOP_LEVEL_FUNCTION_REFERENCE = | |
12263 const HighlightRegionType._("TOP_LEVEL_FUNCTION_REFERENCE"); | |
12264 | |
12265 /** | |
12266 * Only for version 2 of highlight. | |
12267 */ | |
12268 static const HighlightRegionType TOP_LEVEL_GETTER_DECLARATION = | |
12269 const HighlightRegionType._("TOP_LEVEL_GETTER_DECLARATION"); | |
12270 | |
12271 /** | |
12272 * Only for version 2 of highlight. | |
12273 */ | |
12274 static const HighlightRegionType TOP_LEVEL_GETTER_REFERENCE = | |
12275 const HighlightRegionType._("TOP_LEVEL_GETTER_REFERENCE"); | |
12276 | |
12277 /** | |
12278 * Only for version 2 of highlight. | |
12279 */ | |
12280 static const HighlightRegionType TOP_LEVEL_SETTER_DECLARATION = | |
12281 const HighlightRegionType._("TOP_LEVEL_SETTER_DECLARATION"); | |
12282 | |
12283 /** | |
12284 * Only for version 2 of highlight. | |
12285 */ | |
12286 static const HighlightRegionType TOP_LEVEL_SETTER_REFERENCE = | |
12287 const HighlightRegionType._("TOP_LEVEL_SETTER_REFERENCE"); | |
12288 | |
12289 /** | |
12290 * Only for version 2 of highlight. | |
12291 */ | |
12292 static const HighlightRegionType TOP_LEVEL_VARIABLE_DECLARATION = | |
12293 const HighlightRegionType._("TOP_LEVEL_VARIABLE_DECLARATION"); | |
12294 | |
12295 static const HighlightRegionType TYPE_NAME_DYNAMIC = | |
12296 const HighlightRegionType._("TYPE_NAME_DYNAMIC"); | |
12297 | |
12298 static const HighlightRegionType TYPE_PARAMETER = | |
12299 const HighlightRegionType._("TYPE_PARAMETER"); | |
12300 | |
12301 /** | |
12302 * Only for version 2 of highlight. | |
12303 */ | |
12304 static const HighlightRegionType UNRESOLVED_INSTANCE_MEMBER_REFERENCE = | |
12305 const HighlightRegionType._("UNRESOLVED_INSTANCE_MEMBER_REFERENCE"); | |
12306 | |
12307 /** | |
12308 * Only for version 2 of highlight. | |
12309 */ | |
12310 static const HighlightRegionType VALID_STRING_ESCAPE = | |
12311 const HighlightRegionType._("VALID_STRING_ESCAPE"); | |
12312 | |
12313 /** | |
12314 * A list containing all of the enum values that are defined. | |
12315 */ | |
12316 static const List<HighlightRegionType> VALUES = const <HighlightRegionType>[ | |
12317 ANNOTATION, | |
12318 BUILT_IN, | |
12319 CLASS, | |
12320 COMMENT_BLOCK, | |
12321 COMMENT_DOCUMENTATION, | |
12322 COMMENT_END_OF_LINE, | |
12323 CONSTRUCTOR, | |
12324 DIRECTIVE, | |
12325 DYNAMIC_TYPE, | |
12326 DYNAMIC_LOCAL_VARIABLE_DECLARATION, | |
12327 DYNAMIC_LOCAL_VARIABLE_REFERENCE, | |
12328 DYNAMIC_PARAMETER_DECLARATION, | |
12329 DYNAMIC_PARAMETER_REFERENCE, | |
12330 ENUM, | |
12331 ENUM_CONSTANT, | |
12332 FIELD, | |
12333 FIELD_STATIC, | |
12334 FUNCTION, | |
12335 FUNCTION_DECLARATION, | |
12336 FUNCTION_TYPE_ALIAS, | |
12337 GETTER_DECLARATION, | |
12338 IDENTIFIER_DEFAULT, | |
12339 IMPORT_PREFIX, | |
12340 INSTANCE_FIELD_DECLARATION, | |
12341 INSTANCE_FIELD_REFERENCE, | |
12342 INSTANCE_GETTER_DECLARATION, | |
12343 INSTANCE_GETTER_REFERENCE, | |
12344 INSTANCE_METHOD_DECLARATION, | |
12345 INSTANCE_METHOD_REFERENCE, | |
12346 INSTANCE_SETTER_DECLARATION, | |
12347 INSTANCE_SETTER_REFERENCE, | |
12348 INVALID_STRING_ESCAPE, | |
12349 KEYWORD, | |
12350 LABEL, | |
12351 LIBRARY_NAME, | |
12352 LITERAL_BOOLEAN, | |
12353 LITERAL_DOUBLE, | |
12354 LITERAL_INTEGER, | |
12355 LITERAL_LIST, | |
12356 LITERAL_MAP, | |
12357 LITERAL_STRING, | |
12358 LOCAL_FUNCTION_DECLARATION, | |
12359 LOCAL_FUNCTION_REFERENCE, | |
12360 LOCAL_VARIABLE, | |
12361 LOCAL_VARIABLE_DECLARATION, | |
12362 LOCAL_VARIABLE_REFERENCE, | |
12363 METHOD, | |
12364 METHOD_DECLARATION, | |
12365 METHOD_DECLARATION_STATIC, | |
12366 METHOD_STATIC, | |
12367 PARAMETER, | |
12368 SETTER_DECLARATION, | |
12369 TOP_LEVEL_VARIABLE, | |
12370 PARAMETER_DECLARATION, | |
12371 PARAMETER_REFERENCE, | |
12372 STATIC_FIELD_DECLARATION, | |
12373 STATIC_GETTER_DECLARATION, | |
12374 STATIC_GETTER_REFERENCE, | |
12375 STATIC_METHOD_DECLARATION, | |
12376 STATIC_METHOD_REFERENCE, | |
12377 STATIC_SETTER_DECLARATION, | |
12378 STATIC_SETTER_REFERENCE, | |
12379 TOP_LEVEL_FUNCTION_DECLARATION, | |
12380 TOP_LEVEL_FUNCTION_REFERENCE, | |
12381 TOP_LEVEL_GETTER_DECLARATION, | |
12382 TOP_LEVEL_GETTER_REFERENCE, | |
12383 TOP_LEVEL_SETTER_DECLARATION, | |
12384 TOP_LEVEL_SETTER_REFERENCE, | |
12385 TOP_LEVEL_VARIABLE_DECLARATION, | |
12386 TYPE_NAME_DYNAMIC, | |
12387 TYPE_PARAMETER, | |
12388 UNRESOLVED_INSTANCE_MEMBER_REFERENCE, | |
12389 VALID_STRING_ESCAPE | |
12390 ]; | |
12391 | |
12392 final String name; | |
12393 | |
12394 const HighlightRegionType._(this.name); | |
12395 | |
12396 factory HighlightRegionType(String name) { | |
12397 switch (name) { | |
12398 case "ANNOTATION": | |
12399 return ANNOTATION; | |
12400 case "BUILT_IN": | |
12401 return BUILT_IN; | |
12402 case "CLASS": | |
12403 return CLASS; | |
12404 case "COMMENT_BLOCK": | |
12405 return COMMENT_BLOCK; | |
12406 case "COMMENT_DOCUMENTATION": | |
12407 return COMMENT_DOCUMENTATION; | |
12408 case "COMMENT_END_OF_LINE": | |
12409 return COMMENT_END_OF_LINE; | |
12410 case "CONSTRUCTOR": | |
12411 return CONSTRUCTOR; | |
12412 case "DIRECTIVE": | |
12413 return DIRECTIVE; | |
12414 case "DYNAMIC_TYPE": | |
12415 return DYNAMIC_TYPE; | |
12416 case "DYNAMIC_LOCAL_VARIABLE_DECLARATION": | |
12417 return DYNAMIC_LOCAL_VARIABLE_DECLARATION; | |
12418 case "DYNAMIC_LOCAL_VARIABLE_REFERENCE": | |
12419 return DYNAMIC_LOCAL_VARIABLE_REFERENCE; | |
12420 case "DYNAMIC_PARAMETER_DECLARATION": | |
12421 return DYNAMIC_PARAMETER_DECLARATION; | |
12422 case "DYNAMIC_PARAMETER_REFERENCE": | |
12423 return DYNAMIC_PARAMETER_REFERENCE; | |
12424 case "ENUM": | |
12425 return ENUM; | |
12426 case "ENUM_CONSTANT": | |
12427 return ENUM_CONSTANT; | |
12428 case "FIELD": | |
12429 return FIELD; | |
12430 case "FIELD_STATIC": | |
12431 return FIELD_STATIC; | |
12432 case "FUNCTION": | |
12433 return FUNCTION; | |
12434 case "FUNCTION_DECLARATION": | |
12435 return FUNCTION_DECLARATION; | |
12436 case "FUNCTION_TYPE_ALIAS": | |
12437 return FUNCTION_TYPE_ALIAS; | |
12438 case "GETTER_DECLARATION": | |
12439 return GETTER_DECLARATION; | |
12440 case "IDENTIFIER_DEFAULT": | |
12441 return IDENTIFIER_DEFAULT; | |
12442 case "IMPORT_PREFIX": | |
12443 return IMPORT_PREFIX; | |
12444 case "INSTANCE_FIELD_DECLARATION": | |
12445 return INSTANCE_FIELD_DECLARATION; | |
12446 case "INSTANCE_FIELD_REFERENCE": | |
12447 return INSTANCE_FIELD_REFERENCE; | |
12448 case "INSTANCE_GETTER_DECLARATION": | |
12449 return INSTANCE_GETTER_DECLARATION; | |
12450 case "INSTANCE_GETTER_REFERENCE": | |
12451 return INSTANCE_GETTER_REFERENCE; | |
12452 case "INSTANCE_METHOD_DECLARATION": | |
12453 return INSTANCE_METHOD_DECLARATION; | |
12454 case "INSTANCE_METHOD_REFERENCE": | |
12455 return INSTANCE_METHOD_REFERENCE; | |
12456 case "INSTANCE_SETTER_DECLARATION": | |
12457 return INSTANCE_SETTER_DECLARATION; | |
12458 case "INSTANCE_SETTER_REFERENCE": | |
12459 return INSTANCE_SETTER_REFERENCE; | |
12460 case "INVALID_STRING_ESCAPE": | |
12461 return INVALID_STRING_ESCAPE; | |
12462 case "KEYWORD": | |
12463 return KEYWORD; | |
12464 case "LABEL": | |
12465 return LABEL; | |
12466 case "LIBRARY_NAME": | |
12467 return LIBRARY_NAME; | |
12468 case "LITERAL_BOOLEAN": | |
12469 return LITERAL_BOOLEAN; | |
12470 case "LITERAL_DOUBLE": | |
12471 return LITERAL_DOUBLE; | |
12472 case "LITERAL_INTEGER": | |
12473 return LITERAL_INTEGER; | |
12474 case "LITERAL_LIST": | |
12475 return LITERAL_LIST; | |
12476 case "LITERAL_MAP": | |
12477 return LITERAL_MAP; | |
12478 case "LITERAL_STRING": | |
12479 return LITERAL_STRING; | |
12480 case "LOCAL_FUNCTION_DECLARATION": | |
12481 return LOCAL_FUNCTION_DECLARATION; | |
12482 case "LOCAL_FUNCTION_REFERENCE": | |
12483 return LOCAL_FUNCTION_REFERENCE; | |
12484 case "LOCAL_VARIABLE": | |
12485 return LOCAL_VARIABLE; | |
12486 case "LOCAL_VARIABLE_DECLARATION": | |
12487 return LOCAL_VARIABLE_DECLARATION; | |
12488 case "LOCAL_VARIABLE_REFERENCE": | |
12489 return LOCAL_VARIABLE_REFERENCE; | |
12490 case "METHOD": | |
12491 return METHOD; | |
12492 case "METHOD_DECLARATION": | |
12493 return METHOD_DECLARATION; | |
12494 case "METHOD_DECLARATION_STATIC": | |
12495 return METHOD_DECLARATION_STATIC; | |
12496 case "METHOD_STATIC": | |
12497 return METHOD_STATIC; | |
12498 case "PARAMETER": | |
12499 return PARAMETER; | |
12500 case "SETTER_DECLARATION": | |
12501 return SETTER_DECLARATION; | |
12502 case "TOP_LEVEL_VARIABLE": | |
12503 return TOP_LEVEL_VARIABLE; | |
12504 case "PARAMETER_DECLARATION": | |
12505 return PARAMETER_DECLARATION; | |
12506 case "PARAMETER_REFERENCE": | |
12507 return PARAMETER_REFERENCE; | |
12508 case "STATIC_FIELD_DECLARATION": | |
12509 return STATIC_FIELD_DECLARATION; | |
12510 case "STATIC_GETTER_DECLARATION": | |
12511 return STATIC_GETTER_DECLARATION; | |
12512 case "STATIC_GETTER_REFERENCE": | |
12513 return STATIC_GETTER_REFERENCE; | |
12514 case "STATIC_METHOD_DECLARATION": | |
12515 return STATIC_METHOD_DECLARATION; | |
12516 case "STATIC_METHOD_REFERENCE": | |
12517 return STATIC_METHOD_REFERENCE; | |
12518 case "STATIC_SETTER_DECLARATION": | |
12519 return STATIC_SETTER_DECLARATION; | |
12520 case "STATIC_SETTER_REFERENCE": | |
12521 return STATIC_SETTER_REFERENCE; | |
12522 case "TOP_LEVEL_FUNCTION_DECLARATION": | |
12523 return TOP_LEVEL_FUNCTION_DECLARATION; | |
12524 case "TOP_LEVEL_FUNCTION_REFERENCE": | |
12525 return TOP_LEVEL_FUNCTION_REFERENCE; | |
12526 case "TOP_LEVEL_GETTER_DECLARATION": | |
12527 return TOP_LEVEL_GETTER_DECLARATION; | |
12528 case "TOP_LEVEL_GETTER_REFERENCE": | |
12529 return TOP_LEVEL_GETTER_REFERENCE; | |
12530 case "TOP_LEVEL_SETTER_DECLARATION": | |
12531 return TOP_LEVEL_SETTER_DECLARATION; | |
12532 case "TOP_LEVEL_SETTER_REFERENCE": | |
12533 return TOP_LEVEL_SETTER_REFERENCE; | |
12534 case "TOP_LEVEL_VARIABLE_DECLARATION": | |
12535 return TOP_LEVEL_VARIABLE_DECLARATION; | |
12536 case "TYPE_NAME_DYNAMIC": | |
12537 return TYPE_NAME_DYNAMIC; | |
12538 case "TYPE_PARAMETER": | |
12539 return TYPE_PARAMETER; | |
12540 case "UNRESOLVED_INSTANCE_MEMBER_REFERENCE": | |
12541 return UNRESOLVED_INSTANCE_MEMBER_REFERENCE; | |
12542 case "VALID_STRING_ESCAPE": | |
12543 return VALID_STRING_ESCAPE; | |
12544 } | |
12545 throw new Exception('Illegal enum value: $name'); | |
12546 } | |
12547 | |
12548 factory HighlightRegionType.fromJson( | |
12549 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
12550 if (json is String) { | |
12551 try { | |
12552 return new HighlightRegionType(json); | |
12553 } catch (_) { | |
12554 // Fall through | |
12555 } | |
12556 } | |
12557 throw jsonDecoder.mismatch(jsonPath, "HighlightRegionType", json); | |
12558 } | |
12559 | |
12560 @override | |
12561 String toString() => "HighlightRegionType.$name"; | |
12562 | |
12563 String toJson() => name; | |
12564 } | |
12565 | |
12566 /** | |
12567 * HoverInformation | |
12568 * | |
12569 * { | |
12570 * "offset": int | |
12571 * "length": int | |
12572 * "containingLibraryPath": optional String | |
12573 * "containingLibraryName": optional String | |
12574 * "containingClassDescription": optional String | |
12575 * "dartdoc": optional String | |
12576 * "elementDescription": optional String | |
12577 * "elementKind": optional String | |
12578 * "isDeprecated": optional bool | |
12579 * "parameter": optional String | |
12580 * "propagatedType": optional String | |
12581 * "staticType": optional String | |
12582 * } | |
12583 * | |
12584 * Clients may not extend, implement or mix-in this class. | |
12585 */ | |
12586 class HoverInformation implements HasToJson { | |
12587 int _offset; | |
12588 | |
12589 int _length; | |
12590 | |
12591 String _containingLibraryPath; | |
12592 | |
12593 String _containingLibraryName; | |
12594 | |
12595 String _containingClassDescription; | |
12596 | |
12597 String _dartdoc; | |
12598 | |
12599 String _elementDescription; | |
12600 | |
12601 String _elementKind; | |
12602 | |
12603 bool _isDeprecated; | |
12604 | |
12605 String _parameter; | |
12606 | |
12607 String _propagatedType; | |
12608 | |
12609 String _staticType; | |
12610 | |
12611 /** | |
12612 * The offset of the range of characters that encompasses the cursor position | |
12613 * and has the same hover information as the cursor position. | |
12614 */ | |
12615 int get offset => _offset; | |
12616 | |
12617 /** | |
12618 * The offset of the range of characters that encompasses the cursor position | |
12619 * and has the same hover information as the cursor position. | |
12620 */ | |
12621 void set offset(int value) { | |
12622 assert(value != null); | |
12623 this._offset = value; | |
12624 } | |
12625 | |
12626 /** | |
12627 * The length of the range of characters that encompasses the cursor position | |
12628 * and has the same hover information as the cursor position. | |
12629 */ | |
12630 int get length => _length; | |
12631 | |
12632 /** | |
12633 * The length of the range of characters that encompasses the cursor position | |
12634 * and has the same hover information as the cursor position. | |
12635 */ | |
12636 void set length(int value) { | |
12637 assert(value != null); | |
12638 this._length = value; | |
12639 } | |
12640 | |
12641 /** | |
12642 * The path to the defining compilation unit of the library in which the | |
12643 * referenced element is declared. This data is omitted if there is no | |
12644 * referenced element, or if the element is declared inside an HTML file. | |
12645 */ | |
12646 String get containingLibraryPath => _containingLibraryPath; | |
12647 | |
12648 /** | |
12649 * The path to the defining compilation unit of the library in which the | |
12650 * referenced element is declared. This data is omitted if there is no | |
12651 * referenced element, or if the element is declared inside an HTML file. | |
12652 */ | |
12653 void set containingLibraryPath(String value) { | |
12654 this._containingLibraryPath = value; | |
12655 } | |
12656 | |
12657 /** | |
12658 * The name of the library in which the referenced element is declared. This | |
12659 * data is omitted if there is no referenced element, or if the element is | |
12660 * declared inside an HTML file. | |
12661 */ | |
12662 String get containingLibraryName => _containingLibraryName; | |
12663 | |
12664 /** | |
12665 * The name of the library in which the referenced element is declared. This | |
12666 * data is omitted if there is no referenced element, or if the element is | |
12667 * declared inside an HTML file. | |
12668 */ | |
12669 void set containingLibraryName(String value) { | |
12670 this._containingLibraryName = value; | |
12671 } | |
12672 | |
12673 /** | |
12674 * A human-readable description of the class declaring the element being | |
12675 * referenced. This data is omitted if there is no referenced element, or if | |
12676 * the element is not a class member. | |
12677 */ | |
12678 String get containingClassDescription => _containingClassDescription; | |
12679 | |
12680 /** | |
12681 * A human-readable description of the class declaring the element being | |
12682 * referenced. This data is omitted if there is no referenced element, or if | |
12683 * the element is not a class member. | |
12684 */ | |
12685 void set containingClassDescription(String value) { | |
12686 this._containingClassDescription = value; | |
12687 } | |
12688 | |
12689 /** | |
12690 * The dartdoc associated with the referenced element. Other than the removal | |
12691 * of the comment delimiters, including leading asterisks in the case of a | |
12692 * block comment, the dartdoc is unprocessed markdown. This data is omitted | |
12693 * if there is no referenced element, or if the element has no dartdoc. | |
12694 */ | |
12695 String get dartdoc => _dartdoc; | |
12696 | |
12697 /** | |
12698 * The dartdoc associated with the referenced element. Other than the removal | |
12699 * of the comment delimiters, including leading asterisks in the case of a | |
12700 * block comment, the dartdoc is unprocessed markdown. This data is omitted | |
12701 * if there is no referenced element, or if the element has no dartdoc. | |
12702 */ | |
12703 void set dartdoc(String value) { | |
12704 this._dartdoc = value; | |
12705 } | |
12706 | |
12707 /** | |
12708 * A human-readable description of the element being referenced. This data is | |
12709 * omitted if there is no referenced element. | |
12710 */ | |
12711 String get elementDescription => _elementDescription; | |
12712 | |
12713 /** | |
12714 * A human-readable description of the element being referenced. This data is | |
12715 * omitted if there is no referenced element. | |
12716 */ | |
12717 void set elementDescription(String value) { | |
12718 this._elementDescription = value; | |
12719 } | |
12720 | |
12721 /** | |
12722 * A human-readable description of the kind of element being referenced (such | |
12723 * as "class" or "function type alias"). This data is omitted if there is no | |
12724 * referenced element. | |
12725 */ | |
12726 String get elementKind => _elementKind; | |
12727 | |
12728 /** | |
12729 * A human-readable description of the kind of element being referenced (such | |
12730 * as "class" or "function type alias"). This data is omitted if there is no | |
12731 * referenced element. | |
12732 */ | |
12733 void set elementKind(String value) { | |
12734 this._elementKind = value; | |
12735 } | |
12736 | |
12737 /** | |
12738 * True if the referenced element is deprecated. | |
12739 */ | |
12740 bool get isDeprecated => _isDeprecated; | |
12741 | |
12742 /** | |
12743 * True if the referenced element is deprecated. | |
12744 */ | |
12745 void set isDeprecated(bool value) { | |
12746 this._isDeprecated = value; | |
12747 } | |
12748 | |
12749 /** | |
12750 * A human-readable description of the parameter corresponding to the | |
12751 * expression being hovered over. This data is omitted if the location is not | |
12752 * in an argument to a function. | |
12753 */ | |
12754 String get parameter => _parameter; | |
12755 | |
12756 /** | |
12757 * A human-readable description of the parameter corresponding to the | |
12758 * expression being hovered over. This data is omitted if the location is not | |
12759 * in an argument to a function. | |
12760 */ | |
12761 void set parameter(String value) { | |
12762 this._parameter = value; | |
12763 } | |
12764 | |
12765 /** | |
12766 * The name of the propagated type of the expression. This data is omitted if | |
12767 * the location does not correspond to an expression or if there is no | |
12768 * propagated type information. | |
12769 */ | |
12770 String get propagatedType => _propagatedType; | |
12771 | |
12772 /** | |
12773 * The name of the propagated type of the expression. This data is omitted if | |
12774 * the location does not correspond to an expression or if there is no | |
12775 * propagated type information. | |
12776 */ | |
12777 void set propagatedType(String value) { | |
12778 this._propagatedType = value; | |
12779 } | |
12780 | |
12781 /** | |
12782 * The name of the static type of the expression. This data is omitted if the | |
12783 * location does not correspond to an expression. | |
12784 */ | |
12785 String get staticType => _staticType; | |
12786 | |
12787 /** | |
12788 * The name of the static type of the expression. This data is omitted if the | |
12789 * location does not correspond to an expression. | |
12790 */ | |
12791 void set staticType(String value) { | |
12792 this._staticType = value; | |
12793 } | |
12794 | |
12795 HoverInformation(int offset, int length, | |
12796 {String containingLibraryPath, | |
12797 String containingLibraryName, | |
12798 String containingClassDescription, | |
12799 String dartdoc, | |
12800 String elementDescription, | |
12801 String elementKind, | |
12802 bool isDeprecated, | |
12803 String parameter, | |
12804 String propagatedType, | |
12805 String staticType}) { | |
12806 this.offset = offset; | |
12807 this.length = length; | |
12808 this.containingLibraryPath = containingLibraryPath; | |
12809 this.containingLibraryName = containingLibraryName; | |
12810 this.containingClassDescription = containingClassDescription; | |
12811 this.dartdoc = dartdoc; | |
12812 this.elementDescription = elementDescription; | |
12813 this.elementKind = elementKind; | |
12814 this.isDeprecated = isDeprecated; | |
12815 this.parameter = parameter; | |
12816 this.propagatedType = propagatedType; | |
12817 this.staticType = staticType; | |
12818 } | |
12819 | |
12820 factory HoverInformation.fromJson( | |
12821 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
12822 if (json == null) { | |
12823 json = {}; | |
12824 } | |
12825 if (json is Map) { | |
12826 int offset; | |
12827 if (json.containsKey("offset")) { | |
12828 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
12829 } else { | |
12830 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
12831 } | |
12832 int length; | |
12833 if (json.containsKey("length")) { | |
12834 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
12835 } else { | |
12836 throw jsonDecoder.missingKey(jsonPath, "length"); | |
12837 } | |
12838 String containingLibraryPath; | |
12839 if (json.containsKey("containingLibraryPath")) { | |
12840 containingLibraryPath = jsonDecoder.decodeString( | |
12841 jsonPath + ".containingLibraryPath", json["containingLibraryPath"]); | |
12842 } | |
12843 String containingLibraryName; | |
12844 if (json.containsKey("containingLibraryName")) { | |
12845 containingLibraryName = jsonDecoder.decodeString( | |
12846 jsonPath + ".containingLibraryName", json["containingLibraryName"]); | |
12847 } | |
12848 String containingClassDescription; | |
12849 if (json.containsKey("containingClassDescription")) { | |
12850 containingClassDescription = jsonDecoder.decodeString( | |
12851 jsonPath + ".containingClassDescription", | |
12852 json["containingClassDescription"]); | |
12853 } | |
12854 String dartdoc; | |
12855 if (json.containsKey("dartdoc")) { | |
12856 dartdoc = | |
12857 jsonDecoder.decodeString(jsonPath + ".dartdoc", json["dartdoc"]); | |
12858 } | |
12859 String elementDescription; | |
12860 if (json.containsKey("elementDescription")) { | |
12861 elementDescription = jsonDecoder.decodeString( | |
12862 jsonPath + ".elementDescription", json["elementDescription"]); | |
12863 } | |
12864 String elementKind; | |
12865 if (json.containsKey("elementKind")) { | |
12866 elementKind = jsonDecoder.decodeString( | |
12867 jsonPath + ".elementKind", json["elementKind"]); | |
12868 } | |
12869 bool isDeprecated; | |
12870 if (json.containsKey("isDeprecated")) { | |
12871 isDeprecated = jsonDecoder.decodeBool( | |
12872 jsonPath + ".isDeprecated", json["isDeprecated"]); | |
12873 } | |
12874 String parameter; | |
12875 if (json.containsKey("parameter")) { | |
12876 parameter = jsonDecoder.decodeString( | |
12877 jsonPath + ".parameter", json["parameter"]); | |
12878 } | |
12879 String propagatedType; | |
12880 if (json.containsKey("propagatedType")) { | |
12881 propagatedType = jsonDecoder.decodeString( | |
12882 jsonPath + ".propagatedType", json["propagatedType"]); | |
12883 } | |
12884 String staticType; | |
12885 if (json.containsKey("staticType")) { | |
12886 staticType = jsonDecoder.decodeString( | |
12887 jsonPath + ".staticType", json["staticType"]); | |
12888 } | |
12889 return new HoverInformation(offset, length, | |
12890 containingLibraryPath: containingLibraryPath, | |
12891 containingLibraryName: containingLibraryName, | |
12892 containingClassDescription: containingClassDescription, | |
12893 dartdoc: dartdoc, | |
12894 elementDescription: elementDescription, | |
12895 elementKind: elementKind, | |
12896 isDeprecated: isDeprecated, | |
12897 parameter: parameter, | |
12898 propagatedType: propagatedType, | |
12899 staticType: staticType); | |
12900 } else { | |
12901 throw jsonDecoder.mismatch(jsonPath, "HoverInformation", json); | |
12902 } | |
12903 } | |
12904 | |
12905 Map<String, dynamic> toJson() { | |
12906 Map<String, dynamic> result = {}; | |
12907 result["offset"] = offset; | |
12908 result["length"] = length; | |
12909 if (containingLibraryPath != null) { | |
12910 result["containingLibraryPath"] = containingLibraryPath; | |
12911 } | |
12912 if (containingLibraryName != null) { | |
12913 result["containingLibraryName"] = containingLibraryName; | |
12914 } | |
12915 if (containingClassDescription != null) { | |
12916 result["containingClassDescription"] = containingClassDescription; | |
12917 } | |
12918 if (dartdoc != null) { | |
12919 result["dartdoc"] = dartdoc; | |
12920 } | |
12921 if (elementDescription != null) { | |
12922 result["elementDescription"] = elementDescription; | |
12923 } | |
12924 if (elementKind != null) { | |
12925 result["elementKind"] = elementKind; | |
12926 } | |
12927 if (isDeprecated != null) { | |
12928 result["isDeprecated"] = isDeprecated; | |
12929 } | |
12930 if (parameter != null) { | |
12931 result["parameter"] = parameter; | |
12932 } | |
12933 if (propagatedType != null) { | |
12934 result["propagatedType"] = propagatedType; | |
12935 } | |
12936 if (staticType != null) { | |
12937 result["staticType"] = staticType; | |
12938 } | |
12939 return result; | |
12940 } | |
12941 | |
12942 @override | |
12943 String toString() => JSON.encode(toJson()); | |
12944 | |
12945 @override | |
12946 bool operator ==(other) { | |
12947 if (other is HoverInformation) { | |
12948 return offset == other.offset && | |
12949 length == other.length && | |
12950 containingLibraryPath == other.containingLibraryPath && | |
12951 containingLibraryName == other.containingLibraryName && | |
12952 containingClassDescription == other.containingClassDescription && | |
12953 dartdoc == other.dartdoc && | |
12954 elementDescription == other.elementDescription && | |
12955 elementKind == other.elementKind && | |
12956 isDeprecated == other.isDeprecated && | |
12957 parameter == other.parameter && | |
12958 propagatedType == other.propagatedType && | |
12959 staticType == other.staticType; | |
12960 } | |
12961 return false; | |
12962 } | |
12963 | |
12964 @override | |
12965 int get hashCode { | |
12966 int hash = 0; | |
12967 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
12968 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
12969 hash = JenkinsSmiHash.combine(hash, containingLibraryPath.hashCode); | |
12970 hash = JenkinsSmiHash.combine(hash, containingLibraryName.hashCode); | |
12971 hash = JenkinsSmiHash.combine(hash, containingClassDescription.hashCode); | |
12972 hash = JenkinsSmiHash.combine(hash, dartdoc.hashCode); | |
12973 hash = JenkinsSmiHash.combine(hash, elementDescription.hashCode); | |
12974 hash = JenkinsSmiHash.combine(hash, elementKind.hashCode); | |
12975 hash = JenkinsSmiHash.combine(hash, isDeprecated.hashCode); | |
12976 hash = JenkinsSmiHash.combine(hash, parameter.hashCode); | |
12977 hash = JenkinsSmiHash.combine(hash, propagatedType.hashCode); | |
12978 hash = JenkinsSmiHash.combine(hash, staticType.hashCode); | |
12979 return JenkinsSmiHash.finish(hash); | |
12980 } | |
12981 } | |
12982 | |
12983 /** | |
12984 * ImplementedClass | |
12985 * | |
12986 * { | |
12987 * "offset": int | |
12988 * "length": int | |
12989 * } | |
12990 * | |
12991 * Clients may not extend, implement or mix-in this class. | |
12992 */ | |
12993 class ImplementedClass implements HasToJson { | |
12994 int _offset; | |
12995 | |
12996 int _length; | |
12997 | |
12998 /** | |
12999 * The offset of the name of the implemented class. | |
13000 */ | |
13001 int get offset => _offset; | |
13002 | |
13003 /** | |
13004 * The offset of the name of the implemented class. | |
13005 */ | |
13006 void set offset(int value) { | |
13007 assert(value != null); | |
13008 this._offset = value; | |
13009 } | |
13010 | |
13011 /** | |
13012 * The length of the name of the implemented class. | |
13013 */ | |
13014 int get length => _length; | |
13015 | |
13016 /** | |
13017 * The length of the name of the implemented class. | |
13018 */ | |
13019 void set length(int value) { | |
13020 assert(value != null); | |
13021 this._length = value; | |
13022 } | |
13023 | |
13024 ImplementedClass(int offset, int length) { | |
13025 this.offset = offset; | |
13026 this.length = length; | |
13027 } | |
13028 | |
13029 factory ImplementedClass.fromJson( | |
13030 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
13031 if (json == null) { | |
13032 json = {}; | |
13033 } | |
13034 if (json is Map) { | |
13035 int offset; | |
13036 if (json.containsKey("offset")) { | |
13037 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
13038 } else { | |
13039 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
13040 } | |
13041 int length; | |
13042 if (json.containsKey("length")) { | |
13043 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
13044 } else { | |
13045 throw jsonDecoder.missingKey(jsonPath, "length"); | |
13046 } | |
13047 return new ImplementedClass(offset, length); | |
13048 } else { | |
13049 throw jsonDecoder.mismatch(jsonPath, "ImplementedClass", json); | |
13050 } | |
13051 } | |
13052 | |
13053 Map<String, dynamic> toJson() { | |
13054 Map<String, dynamic> result = {}; | |
13055 result["offset"] = offset; | |
13056 result["length"] = length; | |
13057 return result; | |
13058 } | |
13059 | |
13060 @override | |
13061 String toString() => JSON.encode(toJson()); | |
13062 | |
13063 @override | |
13064 bool operator ==(other) { | |
13065 if (other is ImplementedClass) { | |
13066 return offset == other.offset && length == other.length; | |
13067 } | |
13068 return false; | |
13069 } | |
13070 | |
13071 @override | |
13072 int get hashCode { | |
13073 int hash = 0; | |
13074 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
13075 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
13076 return JenkinsSmiHash.finish(hash); | |
13077 } | |
13078 } | |
13079 | |
13080 /** | |
13081 * ImplementedMember | |
13082 * | |
13083 * { | |
13084 * "offset": int | |
13085 * "length": int | |
13086 * } | |
13087 * | |
13088 * Clients may not extend, implement or mix-in this class. | |
13089 */ | |
13090 class ImplementedMember implements HasToJson { | |
13091 int _offset; | |
13092 | |
13093 int _length; | |
13094 | |
13095 /** | |
13096 * The offset of the name of the implemented member. | |
13097 */ | |
13098 int get offset => _offset; | |
13099 | |
13100 /** | |
13101 * The offset of the name of the implemented member. | |
13102 */ | |
13103 void set offset(int value) { | |
13104 assert(value != null); | |
13105 this._offset = value; | |
13106 } | |
13107 | |
13108 /** | |
13109 * The length of the name of the implemented member. | |
13110 */ | |
13111 int get length => _length; | |
13112 | |
13113 /** | |
13114 * The length of the name of the implemented member. | |
13115 */ | |
13116 void set length(int value) { | |
13117 assert(value != null); | |
13118 this._length = value; | |
13119 } | |
13120 | |
13121 ImplementedMember(int offset, int length) { | |
13122 this.offset = offset; | |
13123 this.length = length; | |
13124 } | |
13125 | |
13126 factory ImplementedMember.fromJson( | |
13127 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
13128 if (json == null) { | |
13129 json = {}; | |
13130 } | |
13131 if (json is Map) { | |
13132 int offset; | |
13133 if (json.containsKey("offset")) { | |
13134 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
13135 } else { | |
13136 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
13137 } | |
13138 int length; | |
13139 if (json.containsKey("length")) { | |
13140 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
13141 } else { | |
13142 throw jsonDecoder.missingKey(jsonPath, "length"); | |
13143 } | |
13144 return new ImplementedMember(offset, length); | |
13145 } else { | |
13146 throw jsonDecoder.mismatch(jsonPath, "ImplementedMember", json); | |
13147 } | |
13148 } | |
13149 | |
13150 Map<String, dynamic> toJson() { | |
13151 Map<String, dynamic> result = {}; | |
13152 result["offset"] = offset; | |
13153 result["length"] = length; | |
13154 return result; | |
13155 } | |
13156 | |
13157 @override | |
13158 String toString() => JSON.encode(toJson()); | |
13159 | |
13160 @override | |
13161 bool operator ==(other) { | |
13162 if (other is ImplementedMember) { | |
13163 return offset == other.offset && length == other.length; | |
13164 } | |
13165 return false; | |
13166 } | |
13167 | |
13168 @override | |
13169 int get hashCode { | |
13170 int hash = 0; | |
13171 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
13172 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
13173 return JenkinsSmiHash.finish(hash); | |
13174 } | |
13175 } | |
13176 | |
13177 /** | |
13178 * LinkedEditGroup | |
13179 * | |
13180 * { | |
13181 * "positions": List<Position> | |
13182 * "length": int | |
13183 * "suggestions": List<LinkedEditSuggestion> | |
13184 * } | |
13185 * | |
13186 * Clients may not extend, implement or mix-in this class. | |
13187 */ | |
13188 class LinkedEditGroup implements HasToJson { | |
13189 List<Position> _positions; | |
13190 | |
13191 int _length; | |
13192 | |
13193 List<LinkedEditSuggestion> _suggestions; | |
13194 | |
13195 /** | |
13196 * The positions of the regions that should be edited simultaneously. | |
13197 */ | |
13198 List<Position> get positions => _positions; | |
13199 | |
13200 /** | |
13201 * The positions of the regions that should be edited simultaneously. | |
13202 */ | |
13203 void set positions(List<Position> value) { | |
13204 assert(value != null); | |
13205 this._positions = value; | |
13206 } | |
13207 | |
13208 /** | |
13209 * The length of the regions that should be edited simultaneously. | |
13210 */ | |
13211 int get length => _length; | |
13212 | |
13213 /** | |
13214 * The length of the regions that should be edited simultaneously. | |
13215 */ | |
13216 void set length(int value) { | |
13217 assert(value != null); | |
13218 this._length = value; | |
13219 } | |
13220 | |
13221 /** | |
13222 * Pre-computed suggestions for what every region might want to be changed | |
13223 * to. | |
13224 */ | |
13225 List<LinkedEditSuggestion> get suggestions => _suggestions; | |
13226 | |
13227 /** | |
13228 * Pre-computed suggestions for what every region might want to be changed | |
13229 * to. | |
13230 */ | |
13231 void set suggestions(List<LinkedEditSuggestion> value) { | |
13232 assert(value != null); | |
13233 this._suggestions = value; | |
13234 } | |
13235 | |
13236 LinkedEditGroup(List<Position> positions, int length, | |
13237 List<LinkedEditSuggestion> suggestions) { | |
13238 this.positions = positions; | |
13239 this.length = length; | |
13240 this.suggestions = suggestions; | |
13241 } | |
13242 | |
13243 factory LinkedEditGroup.fromJson( | |
13244 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
13245 if (json == null) { | |
13246 json = {}; | |
13247 } | |
13248 if (json is Map) { | |
13249 List<Position> positions; | |
13250 if (json.containsKey("positions")) { | |
13251 positions = jsonDecoder.decodeList( | |
13252 jsonPath + ".positions", | |
13253 json["positions"], | |
13254 (String jsonPath, Object json) => | |
13255 new Position.fromJson(jsonDecoder, jsonPath, json)); | |
13256 } else { | |
13257 throw jsonDecoder.missingKey(jsonPath, "positions"); | |
13258 } | |
13259 int length; | |
13260 if (json.containsKey("length")) { | |
13261 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
13262 } else { | |
13263 throw jsonDecoder.missingKey(jsonPath, "length"); | |
13264 } | |
13265 List<LinkedEditSuggestion> suggestions; | |
13266 if (json.containsKey("suggestions")) { | |
13267 suggestions = jsonDecoder.decodeList( | |
13268 jsonPath + ".suggestions", | |
13269 json["suggestions"], | |
13270 (String jsonPath, Object json) => | |
13271 new LinkedEditSuggestion.fromJson(jsonDecoder, jsonPath, json)); | |
13272 } else { | |
13273 throw jsonDecoder.missingKey(jsonPath, "suggestions"); | |
13274 } | |
13275 return new LinkedEditGroup(positions, length, suggestions); | |
13276 } else { | |
13277 throw jsonDecoder.mismatch(jsonPath, "LinkedEditGroup", json); | |
13278 } | |
13279 } | |
13280 | |
13281 /** | |
13282 * Construct an empty LinkedEditGroup. | |
13283 */ | |
13284 LinkedEditGroup.empty() : this(<Position>[], 0, <LinkedEditSuggestion>[]); | |
13285 | |
13286 Map<String, dynamic> toJson() { | |
13287 Map<String, dynamic> result = {}; | |
13288 result["positions"] = | |
13289 positions.map((Position value) => value.toJson()).toList(); | |
13290 result["length"] = length; | |
13291 result["suggestions"] = suggestions | |
13292 .map((LinkedEditSuggestion value) => value.toJson()) | |
13293 .toList(); | |
13294 return result; | |
13295 } | |
13296 | |
13297 /** | |
13298 * Add a new position and change the length. | |
13299 */ | |
13300 void addPosition(Position position, int length) { | |
13301 positions.add(position); | |
13302 this.length = length; | |
13303 } | |
13304 | |
13305 /** | |
13306 * Add a new suggestion. | |
13307 */ | |
13308 void addSuggestion(LinkedEditSuggestion suggestion) { | |
13309 suggestions.add(suggestion); | |
13310 } | |
13311 | |
13312 @override | |
13313 String toString() => JSON.encode(toJson()); | |
13314 | |
13315 @override | |
13316 bool operator ==(other) { | |
13317 if (other is LinkedEditGroup) { | |
13318 return listEqual( | |
13319 positions, other.positions, (Position a, Position b) => a == b) && | |
13320 length == other.length && | |
13321 listEqual(suggestions, other.suggestions, | |
13322 (LinkedEditSuggestion a, LinkedEditSuggestion b) => a == b); | |
13323 } | |
13324 return false; | |
13325 } | |
13326 | |
13327 @override | |
13328 int get hashCode { | |
13329 int hash = 0; | |
13330 hash = JenkinsSmiHash.combine(hash, positions.hashCode); | |
13331 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
13332 hash = JenkinsSmiHash.combine(hash, suggestions.hashCode); | |
13333 return JenkinsSmiHash.finish(hash); | |
13334 } | |
13335 } | |
13336 | |
13337 /** | |
13338 * LinkedEditSuggestion | |
13339 * | |
13340 * { | |
13341 * "value": String | |
13342 * "kind": LinkedEditSuggestionKind | |
13343 * } | |
13344 * | |
13345 * Clients may not extend, implement or mix-in this class. | |
13346 */ | |
13347 class LinkedEditSuggestion implements HasToJson { | |
13348 String _value; | |
13349 | |
13350 LinkedEditSuggestionKind _kind; | |
13351 | |
13352 /** | |
13353 * The value that could be used to replace all of the linked edit regions. | |
13354 */ | |
13355 String get value => _value; | |
13356 | |
13357 /** | |
13358 * The value that could be used to replace all of the linked edit regions. | |
13359 */ | |
13360 void set value(String value) { | |
13361 assert(value != null); | |
13362 this._value = value; | |
13363 } | |
13364 | |
13365 /** | |
13366 * The kind of value being proposed. | |
13367 */ | |
13368 LinkedEditSuggestionKind get kind => _kind; | |
13369 | |
13370 /** | |
13371 * The kind of value being proposed. | |
13372 */ | |
13373 void set kind(LinkedEditSuggestionKind value) { | |
13374 assert(value != null); | |
13375 this._kind = value; | |
13376 } | |
13377 | |
13378 LinkedEditSuggestion(String value, LinkedEditSuggestionKind kind) { | |
13379 this.value = value; | |
13380 this.kind = kind; | |
13381 } | |
13382 | |
13383 factory LinkedEditSuggestion.fromJson( | |
13384 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
13385 if (json == null) { | |
13386 json = {}; | |
13387 } | |
13388 if (json is Map) { | |
13389 String value; | |
13390 if (json.containsKey("value")) { | |
13391 value = jsonDecoder.decodeString(jsonPath + ".value", json["value"]); | |
13392 } else { | |
13393 throw jsonDecoder.missingKey(jsonPath, "value"); | |
13394 } | |
13395 LinkedEditSuggestionKind kind; | |
13396 if (json.containsKey("kind")) { | |
13397 kind = new LinkedEditSuggestionKind.fromJson( | |
13398 jsonDecoder, jsonPath + ".kind", json["kind"]); | |
13399 } else { | |
13400 throw jsonDecoder.missingKey(jsonPath, "kind"); | |
13401 } | |
13402 return new LinkedEditSuggestion(value, kind); | |
13403 } else { | |
13404 throw jsonDecoder.mismatch(jsonPath, "LinkedEditSuggestion", json); | |
13405 } | |
13406 } | |
13407 | |
13408 Map<String, dynamic> toJson() { | |
13409 Map<String, dynamic> result = {}; | |
13410 result["value"] = value; | |
13411 result["kind"] = kind.toJson(); | |
13412 return result; | |
13413 } | |
13414 | |
13415 @override | |
13416 String toString() => JSON.encode(toJson()); | |
13417 | |
13418 @override | |
13419 bool operator ==(other) { | |
13420 if (other is LinkedEditSuggestion) { | |
13421 return value == other.value && kind == other.kind; | |
13422 } | |
13423 return false; | |
13424 } | |
13425 | |
13426 @override | |
13427 int get hashCode { | |
13428 int hash = 0; | |
13429 hash = JenkinsSmiHash.combine(hash, value.hashCode); | |
13430 hash = JenkinsSmiHash.combine(hash, kind.hashCode); | |
13431 return JenkinsSmiHash.finish(hash); | |
13432 } | |
13433 } | |
13434 | |
13435 /** | |
13436 * LinkedEditSuggestionKind | |
13437 * | |
13438 * enum { | |
13439 * METHOD | |
13440 * PARAMETER | |
13441 * TYPE | |
13442 * VARIABLE | |
13443 * } | |
13444 * | |
13445 * Clients may not extend, implement or mix-in this class. | |
13446 */ | |
13447 class LinkedEditSuggestionKind implements Enum { | |
13448 static const LinkedEditSuggestionKind METHOD = | |
13449 const LinkedEditSuggestionKind._("METHOD"); | |
13450 | |
13451 static const LinkedEditSuggestionKind PARAMETER = | |
13452 const LinkedEditSuggestionKind._("PARAMETER"); | |
13453 | |
13454 static const LinkedEditSuggestionKind TYPE = | |
13455 const LinkedEditSuggestionKind._("TYPE"); | |
13456 | |
13457 static const LinkedEditSuggestionKind VARIABLE = | |
13458 const LinkedEditSuggestionKind._("VARIABLE"); | |
13459 | |
13460 /** | |
13461 * A list containing all of the enum values that are defined. | |
13462 */ | |
13463 static const List<LinkedEditSuggestionKind> VALUES = | |
13464 const <LinkedEditSuggestionKind>[METHOD, PARAMETER, TYPE, VARIABLE]; | |
13465 | |
13466 final String name; | |
13467 | |
13468 const LinkedEditSuggestionKind._(this.name); | |
13469 | |
13470 factory LinkedEditSuggestionKind(String name) { | |
13471 switch (name) { | |
13472 case "METHOD": | |
13473 return METHOD; | |
13474 case "PARAMETER": | |
13475 return PARAMETER; | |
13476 case "TYPE": | |
13477 return TYPE; | |
13478 case "VARIABLE": | |
13479 return VARIABLE; | |
13480 } | |
13481 throw new Exception('Illegal enum value: $name'); | |
13482 } | |
13483 | |
13484 factory LinkedEditSuggestionKind.fromJson( | |
13485 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
13486 if (json is String) { | |
13487 try { | |
13488 return new LinkedEditSuggestionKind(json); | |
13489 } catch (_) { | |
13490 // Fall through | |
13491 } | |
13492 } | |
13493 throw jsonDecoder.mismatch(jsonPath, "LinkedEditSuggestionKind", json); | |
13494 } | |
13495 | |
13496 @override | |
13497 String toString() => "LinkedEditSuggestionKind.$name"; | |
13498 | |
13499 String toJson() => name; | |
13500 } | |
13501 | |
13502 /** | |
13503 * Location | |
13504 * | |
13505 * { | |
13506 * "file": FilePath | |
13507 * "offset": int | |
13508 * "length": int | |
13509 * "startLine": int | |
13510 * "startColumn": int | |
13511 * } | |
13512 * | |
13513 * Clients may not extend, implement or mix-in this class. | |
13514 */ | |
13515 class Location implements HasToJson { | |
13516 String _file; | |
13517 | |
13518 int _offset; | |
13519 | |
13520 int _length; | |
13521 | |
13522 int _startLine; | |
13523 | |
13524 int _startColumn; | |
13525 | |
13526 /** | |
13527 * The file containing the range. | |
13528 */ | |
13529 String get file => _file; | |
13530 | |
13531 /** | |
13532 * The file containing the range. | |
13533 */ | |
13534 void set file(String value) { | |
13535 assert(value != null); | |
13536 this._file = value; | |
13537 } | |
13538 | |
13539 /** | |
13540 * The offset of the range. | |
13541 */ | |
13542 int get offset => _offset; | |
13543 | |
13544 /** | |
13545 * The offset of the range. | |
13546 */ | |
13547 void set offset(int value) { | |
13548 assert(value != null); | |
13549 this._offset = value; | |
13550 } | |
13551 | |
13552 /** | |
13553 * The length of the range. | |
13554 */ | |
13555 int get length => _length; | |
13556 | |
13557 /** | |
13558 * The length of the range. | |
13559 */ | |
13560 void set length(int value) { | |
13561 assert(value != null); | |
13562 this._length = value; | |
13563 } | |
13564 | |
13565 /** | |
13566 * The one-based index of the line containing the first character of the | |
13567 * range. | |
13568 */ | |
13569 int get startLine => _startLine; | |
13570 | |
13571 /** | |
13572 * The one-based index of the line containing the first character of the | |
13573 * range. | |
13574 */ | |
13575 void set startLine(int value) { | |
13576 assert(value != null); | |
13577 this._startLine = value; | |
13578 } | |
13579 | |
13580 /** | |
13581 * The one-based index of the column containing the first character of the | |
13582 * range. | |
13583 */ | |
13584 int get startColumn => _startColumn; | |
13585 | |
13586 /** | |
13587 * The one-based index of the column containing the first character of the | |
13588 * range. | |
13589 */ | |
13590 void set startColumn(int value) { | |
13591 assert(value != null); | |
13592 this._startColumn = value; | |
13593 } | |
13594 | |
13595 Location( | |
13596 String file, int offset, int length, int startLine, int startColumn) { | |
13597 this.file = file; | |
13598 this.offset = offset; | |
13599 this.length = length; | |
13600 this.startLine = startLine; | |
13601 this.startColumn = startColumn; | |
13602 } | |
13603 | |
13604 factory Location.fromJson( | |
13605 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
13606 if (json == null) { | |
13607 json = {}; | |
13608 } | |
13609 if (json is Map) { | |
13610 String file; | |
13611 if (json.containsKey("file")) { | |
13612 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
13613 } else { | |
13614 throw jsonDecoder.missingKey(jsonPath, "file"); | |
13615 } | |
13616 int offset; | |
13617 if (json.containsKey("offset")) { | |
13618 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
13619 } else { | |
13620 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
13621 } | |
13622 int length; | |
13623 if (json.containsKey("length")) { | |
13624 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
13625 } else { | |
13626 throw jsonDecoder.missingKey(jsonPath, "length"); | |
13627 } | |
13628 int startLine; | |
13629 if (json.containsKey("startLine")) { | |
13630 startLine = | |
13631 jsonDecoder.decodeInt(jsonPath + ".startLine", json["startLine"]); | |
13632 } else { | |
13633 throw jsonDecoder.missingKey(jsonPath, "startLine"); | |
13634 } | |
13635 int startColumn; | |
13636 if (json.containsKey("startColumn")) { | |
13637 startColumn = jsonDecoder.decodeInt( | |
13638 jsonPath + ".startColumn", json["startColumn"]); | |
13639 } else { | |
13640 throw jsonDecoder.missingKey(jsonPath, "startColumn"); | |
13641 } | |
13642 return new Location(file, offset, length, startLine, startColumn); | |
13643 } else { | |
13644 throw jsonDecoder.mismatch(jsonPath, "Location", json); | |
13645 } | |
13646 } | |
13647 | |
13648 Map<String, dynamic> toJson() { | |
13649 Map<String, dynamic> result = {}; | |
13650 result["file"] = file; | |
13651 result["offset"] = offset; | |
13652 result["length"] = length; | |
13653 result["startLine"] = startLine; | |
13654 result["startColumn"] = startColumn; | |
13655 return result; | |
13656 } | |
13657 | |
13658 @override | |
13659 String toString() => JSON.encode(toJson()); | |
13660 | |
13661 @override | |
13662 bool operator ==(other) { | |
13663 if (other is Location) { | |
13664 return file == other.file && | |
13665 offset == other.offset && | |
13666 length == other.length && | |
13667 startLine == other.startLine && | |
13668 startColumn == other.startColumn; | |
13669 } | |
13670 return false; | |
13671 } | |
13672 | |
13673 @override | |
13674 int get hashCode { | |
13675 int hash = 0; | |
13676 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
13677 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
13678 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
13679 hash = JenkinsSmiHash.combine(hash, startLine.hashCode); | |
13680 hash = JenkinsSmiHash.combine(hash, startColumn.hashCode); | |
13681 return JenkinsSmiHash.finish(hash); | |
13682 } | |
13683 } | |
13684 | |
13685 /** | |
13686 * NavigationRegion | |
13687 * | |
13688 * { | |
13689 * "offset": int | |
13690 * "length": int | |
13691 * "targets": List<int> | |
13692 * } | |
13693 * | |
13694 * Clients may not extend, implement or mix-in this class. | |
13695 */ | |
13696 class NavigationRegion implements HasToJson { | |
13697 int _offset; | |
13698 | |
13699 int _length; | |
13700 | |
13701 List<int> _targets; | |
13702 | |
13703 /** | |
13704 * The offset of the region from which the user can navigate. | |
13705 */ | |
13706 int get offset => _offset; | |
13707 | |
13708 /** | |
13709 * The offset of the region from which the user can navigate. | |
13710 */ | |
13711 void set offset(int value) { | |
13712 assert(value != null); | |
13713 this._offset = value; | |
13714 } | |
13715 | |
13716 /** | |
13717 * The length of the region from which the user can navigate. | |
13718 */ | |
13719 int get length => _length; | |
13720 | |
13721 /** | |
13722 * The length of the region from which the user can navigate. | |
13723 */ | |
13724 void set length(int value) { | |
13725 assert(value != null); | |
13726 this._length = value; | |
13727 } | |
13728 | |
13729 /** | |
13730 * The indexes of the targets (in the enclosing navigation response) to which | |
13731 * the given region is bound. By opening the target, clients can implement | |
13732 * one form of navigation. This list cannot be empty. | |
13733 */ | |
13734 List<int> get targets => _targets; | |
13735 | |
13736 /** | |
13737 * The indexes of the targets (in the enclosing navigation response) to which | |
13738 * the given region is bound. By opening the target, clients can implement | |
13739 * one form of navigation. This list cannot be empty. | |
13740 */ | |
13741 void set targets(List<int> value) { | |
13742 assert(value != null); | |
13743 this._targets = value; | |
13744 } | |
13745 | |
13746 NavigationRegion(int offset, int length, List<int> targets) { | |
13747 this.offset = offset; | |
13748 this.length = length; | |
13749 this.targets = targets; | |
13750 } | |
13751 | |
13752 factory NavigationRegion.fromJson( | |
13753 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
13754 if (json == null) { | |
13755 json = {}; | |
13756 } | |
13757 if (json is Map) { | |
13758 int offset; | |
13759 if (json.containsKey("offset")) { | |
13760 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
13761 } else { | |
13762 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
13763 } | |
13764 int length; | |
13765 if (json.containsKey("length")) { | |
13766 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
13767 } else { | |
13768 throw jsonDecoder.missingKey(jsonPath, "length"); | |
13769 } | |
13770 List<int> targets; | |
13771 if (json.containsKey("targets")) { | |
13772 targets = jsonDecoder.decodeList( | |
13773 jsonPath + ".targets", json["targets"], jsonDecoder.decodeInt); | |
13774 } else { | |
13775 throw jsonDecoder.missingKey(jsonPath, "targets"); | |
13776 } | |
13777 return new NavigationRegion(offset, length, targets); | |
13778 } else { | |
13779 throw jsonDecoder.mismatch(jsonPath, "NavigationRegion", json); | |
13780 } | |
13781 } | |
13782 | |
13783 Map<String, dynamic> toJson() { | |
13784 Map<String, dynamic> result = {}; | |
13785 result["offset"] = offset; | |
13786 result["length"] = length; | |
13787 result["targets"] = targets; | |
13788 return result; | |
13789 } | |
13790 | |
13791 @override | |
13792 String toString() => JSON.encode(toJson()); | |
13793 | |
13794 @override | |
13795 bool operator ==(other) { | |
13796 if (other is NavigationRegion) { | |
13797 return offset == other.offset && | |
13798 length == other.length && | |
13799 listEqual(targets, other.targets, (int a, int b) => a == b); | |
13800 } | |
13801 return false; | |
13802 } | |
13803 | |
13804 @override | |
13805 int get hashCode { | |
13806 int hash = 0; | |
13807 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
13808 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
13809 hash = JenkinsSmiHash.combine(hash, targets.hashCode); | |
13810 return JenkinsSmiHash.finish(hash); | |
13811 } | |
13812 } | |
13813 | |
13814 /** | |
13815 * NavigationTarget | |
13816 * | |
13817 * { | |
13818 * "kind": ElementKind | |
13819 * "fileIndex": int | |
13820 * "offset": int | |
13821 * "length": int | |
13822 * "startLine": int | |
13823 * "startColumn": int | |
13824 * } | |
13825 * | |
13826 * Clients may not extend, implement or mix-in this class. | |
13827 */ | |
13828 class NavigationTarget implements HasToJson { | |
13829 ElementKind _kind; | |
13830 | |
13831 int _fileIndex; | |
13832 | |
13833 int _offset; | |
13834 | |
13835 int _length; | |
13836 | |
13837 int _startLine; | |
13838 | |
13839 int _startColumn; | |
13840 | |
13841 /** | |
13842 * The kind of the element. | |
13843 */ | |
13844 ElementKind get kind => _kind; | |
13845 | |
13846 /** | |
13847 * The kind of the element. | |
13848 */ | |
13849 void set kind(ElementKind value) { | |
13850 assert(value != null); | |
13851 this._kind = value; | |
13852 } | |
13853 | |
13854 /** | |
13855 * The index of the file (in the enclosing navigation response) to navigate | |
13856 * to. | |
13857 */ | |
13858 int get fileIndex => _fileIndex; | |
13859 | |
13860 /** | |
13861 * The index of the file (in the enclosing navigation response) to navigate | |
13862 * to. | |
13863 */ | |
13864 void set fileIndex(int value) { | |
13865 assert(value != null); | |
13866 this._fileIndex = value; | |
13867 } | |
13868 | |
13869 /** | |
13870 * The offset of the region to which the user can navigate. | |
13871 */ | |
13872 int get offset => _offset; | |
13873 | |
13874 /** | |
13875 * The offset of the region to which the user can navigate. | |
13876 */ | |
13877 void set offset(int value) { | |
13878 assert(value != null); | |
13879 this._offset = value; | |
13880 } | |
13881 | |
13882 /** | |
13883 * The length of the region to which the user can navigate. | |
13884 */ | |
13885 int get length => _length; | |
13886 | |
13887 /** | |
13888 * The length of the region to which the user can navigate. | |
13889 */ | |
13890 void set length(int value) { | |
13891 assert(value != null); | |
13892 this._length = value; | |
13893 } | |
13894 | |
13895 /** | |
13896 * The one-based index of the line containing the first character of the | |
13897 * region. | |
13898 */ | |
13899 int get startLine => _startLine; | |
13900 | |
13901 /** | |
13902 * The one-based index of the line containing the first character of the | |
13903 * region. | |
13904 */ | |
13905 void set startLine(int value) { | |
13906 assert(value != null); | |
13907 this._startLine = value; | |
13908 } | |
13909 | |
13910 /** | |
13911 * The one-based index of the column containing the first character of the | |
13912 * region. | |
13913 */ | |
13914 int get startColumn => _startColumn; | |
13915 | |
13916 /** | |
13917 * The one-based index of the column containing the first character of the | |
13918 * region. | |
13919 */ | |
13920 void set startColumn(int value) { | |
13921 assert(value != null); | |
13922 this._startColumn = value; | |
13923 } | |
13924 | |
13925 NavigationTarget(ElementKind kind, int fileIndex, int offset, int length, | |
13926 int startLine, int startColumn) { | |
13927 this.kind = kind; | |
13928 this.fileIndex = fileIndex; | |
13929 this.offset = offset; | |
13930 this.length = length; | |
13931 this.startLine = startLine; | |
13932 this.startColumn = startColumn; | |
13933 } | |
13934 | |
13935 factory NavigationTarget.fromJson( | |
13936 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
13937 if (json == null) { | |
13938 json = {}; | |
13939 } | |
13940 if (json is Map) { | |
13941 ElementKind kind; | |
13942 if (json.containsKey("kind")) { | |
13943 kind = new ElementKind.fromJson( | |
13944 jsonDecoder, jsonPath + ".kind", json["kind"]); | |
13945 } else { | |
13946 throw jsonDecoder.missingKey(jsonPath, "kind"); | |
13947 } | |
13948 int fileIndex; | |
13949 if (json.containsKey("fileIndex")) { | |
13950 fileIndex = | |
13951 jsonDecoder.decodeInt(jsonPath + ".fileIndex", json["fileIndex"]); | |
13952 } else { | |
13953 throw jsonDecoder.missingKey(jsonPath, "fileIndex"); | |
13954 } | |
13955 int offset; | |
13956 if (json.containsKey("offset")) { | |
13957 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
13958 } else { | |
13959 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
13960 } | |
13961 int length; | |
13962 if (json.containsKey("length")) { | |
13963 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
13964 } else { | |
13965 throw jsonDecoder.missingKey(jsonPath, "length"); | |
13966 } | |
13967 int startLine; | |
13968 if (json.containsKey("startLine")) { | |
13969 startLine = | |
13970 jsonDecoder.decodeInt(jsonPath + ".startLine", json["startLine"]); | |
13971 } else { | |
13972 throw jsonDecoder.missingKey(jsonPath, "startLine"); | |
13973 } | |
13974 int startColumn; | |
13975 if (json.containsKey("startColumn")) { | |
13976 startColumn = jsonDecoder.decodeInt( | |
13977 jsonPath + ".startColumn", json["startColumn"]); | |
13978 } else { | |
13979 throw jsonDecoder.missingKey(jsonPath, "startColumn"); | |
13980 } | |
13981 return new NavigationTarget( | |
13982 kind, fileIndex, offset, length, startLine, startColumn); | |
13983 } else { | |
13984 throw jsonDecoder.mismatch(jsonPath, "NavigationTarget", json); | |
13985 } | |
13986 } | |
13987 | |
13988 Map<String, dynamic> toJson() { | |
13989 Map<String, dynamic> result = {}; | |
13990 result["kind"] = kind.toJson(); | |
13991 result["fileIndex"] = fileIndex; | |
13992 result["offset"] = offset; | |
13993 result["length"] = length; | |
13994 result["startLine"] = startLine; | |
13995 result["startColumn"] = startColumn; | |
13996 return result; | |
13997 } | |
13998 | |
13999 @override | |
14000 String toString() => JSON.encode(toJson()); | |
14001 | |
14002 @override | |
14003 bool operator ==(other) { | |
14004 if (other is NavigationTarget) { | |
14005 return kind == other.kind && | |
14006 fileIndex == other.fileIndex && | |
14007 offset == other.offset && | |
14008 length == other.length && | |
14009 startLine == other.startLine && | |
14010 startColumn == other.startColumn; | |
14011 } | |
14012 return false; | |
14013 } | |
14014 | |
14015 @override | |
14016 int get hashCode { | |
14017 int hash = 0; | |
14018 hash = JenkinsSmiHash.combine(hash, kind.hashCode); | |
14019 hash = JenkinsSmiHash.combine(hash, fileIndex.hashCode); | |
14020 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
14021 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
14022 hash = JenkinsSmiHash.combine(hash, startLine.hashCode); | |
14023 hash = JenkinsSmiHash.combine(hash, startColumn.hashCode); | |
14024 return JenkinsSmiHash.finish(hash); | |
14025 } | |
14026 } | |
14027 | |
14028 /** | |
14029 * Occurrences | |
14030 * | |
14031 * { | |
14032 * "element": Element | |
14033 * "offsets": List<int> | |
14034 * "length": int | |
14035 * } | |
14036 * | |
14037 * Clients may not extend, implement or mix-in this class. | |
14038 */ | |
14039 class Occurrences implements HasToJson { | |
14040 Element _element; | |
14041 | |
14042 List<int> _offsets; | |
14043 | |
14044 int _length; | |
14045 | |
14046 /** | |
14047 * The element that was referenced. | |
14048 */ | |
14049 Element get element => _element; | |
14050 | |
14051 /** | |
14052 * The element that was referenced. | |
14053 */ | |
14054 void set element(Element value) { | |
14055 assert(value != null); | |
14056 this._element = value; | |
14057 } | |
14058 | |
14059 /** | |
14060 * The offsets of the name of the referenced element within the file. | |
14061 */ | |
14062 List<int> get offsets => _offsets; | |
14063 | |
14064 /** | |
14065 * The offsets of the name of the referenced element within the file. | |
14066 */ | |
14067 void set offsets(List<int> value) { | |
14068 assert(value != null); | |
14069 this._offsets = value; | |
14070 } | |
14071 | |
14072 /** | |
14073 * The length of the name of the referenced element. | |
14074 */ | |
14075 int get length => _length; | |
14076 | |
14077 /** | |
14078 * The length of the name of the referenced element. | |
14079 */ | |
14080 void set length(int value) { | |
14081 assert(value != null); | |
14082 this._length = value; | |
14083 } | |
14084 | |
14085 Occurrences(Element element, List<int> offsets, int length) { | |
14086 this.element = element; | |
14087 this.offsets = offsets; | |
14088 this.length = length; | |
14089 } | |
14090 | |
14091 factory Occurrences.fromJson( | |
14092 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
14093 if (json == null) { | |
14094 json = {}; | |
14095 } | |
14096 if (json is Map) { | |
14097 Element element; | |
14098 if (json.containsKey("element")) { | |
14099 element = new Element.fromJson( | |
14100 jsonDecoder, jsonPath + ".element", json["element"]); | |
14101 } else { | |
14102 throw jsonDecoder.missingKey(jsonPath, "element"); | |
14103 } | |
14104 List<int> offsets; | |
14105 if (json.containsKey("offsets")) { | |
14106 offsets = jsonDecoder.decodeList( | |
14107 jsonPath + ".offsets", json["offsets"], jsonDecoder.decodeInt); | |
14108 } else { | |
14109 throw jsonDecoder.missingKey(jsonPath, "offsets"); | |
14110 } | |
14111 int length; | |
14112 if (json.containsKey("length")) { | |
14113 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
14114 } else { | |
14115 throw jsonDecoder.missingKey(jsonPath, "length"); | |
14116 } | |
14117 return new Occurrences(element, offsets, length); | |
14118 } else { | |
14119 throw jsonDecoder.mismatch(jsonPath, "Occurrences", json); | |
14120 } | |
14121 } | |
14122 | |
14123 Map<String, dynamic> toJson() { | |
14124 Map<String, dynamic> result = {}; | |
14125 result["element"] = element.toJson(); | |
14126 result["offsets"] = offsets; | |
14127 result["length"] = length; | |
14128 return result; | |
14129 } | |
14130 | |
14131 @override | |
14132 String toString() => JSON.encode(toJson()); | |
14133 | |
14134 @override | |
14135 bool operator ==(other) { | |
14136 if (other is Occurrences) { | |
14137 return element == other.element && | |
14138 listEqual(offsets, other.offsets, (int a, int b) => a == b) && | |
14139 length == other.length; | |
14140 } | |
14141 return false; | |
14142 } | |
14143 | |
14144 @override | |
14145 int get hashCode { | |
14146 int hash = 0; | |
14147 hash = JenkinsSmiHash.combine(hash, element.hashCode); | |
14148 hash = JenkinsSmiHash.combine(hash, offsets.hashCode); | |
14149 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
14150 return JenkinsSmiHash.finish(hash); | |
14151 } | |
14152 } | |
14153 | |
14154 /** | |
14155 * Outline | |
14156 * | |
14157 * { | |
14158 * "element": Element | |
14159 * "offset": int | |
14160 * "length": int | |
14161 * "children": optional List<Outline> | |
14162 * } | |
14163 * | |
14164 * Clients may not extend, implement or mix-in this class. | |
14165 */ | |
14166 class Outline implements HasToJson { | |
14167 Element _element; | |
14168 | |
14169 int _offset; | |
14170 | |
14171 int _length; | |
14172 | |
14173 List<Outline> _children; | |
14174 | |
14175 /** | |
14176 * A description of the element represented by this node. | |
14177 */ | |
14178 Element get element => _element; | |
14179 | |
14180 /** | |
14181 * A description of the element represented by this node. | |
14182 */ | |
14183 void set element(Element value) { | |
14184 assert(value != null); | |
14185 this._element = value; | |
14186 } | |
14187 | |
14188 /** | |
14189 * The offset of the first character of the element. This is different than | |
14190 * the offset in the Element, which if the offset of the name of the element. | |
14191 * It can be used, for example, to map locations in the file back to an | |
14192 * outline. | |
14193 */ | |
14194 int get offset => _offset; | |
14195 | |
14196 /** | |
14197 * The offset of the first character of the element. This is different than | |
14198 * the offset in the Element, which if the offset of the name of the element. | |
14199 * It can be used, for example, to map locations in the file back to an | |
14200 * outline. | |
14201 */ | |
14202 void set offset(int value) { | |
14203 assert(value != null); | |
14204 this._offset = value; | |
14205 } | |
14206 | |
14207 /** | |
14208 * The length of the element. | |
14209 */ | |
14210 int get length => _length; | |
14211 | |
14212 /** | |
14213 * The length of the element. | |
14214 */ | |
14215 void set length(int value) { | |
14216 assert(value != null); | |
14217 this._length = value; | |
14218 } | |
14219 | |
14220 /** | |
14221 * The children of the node. The field will be omitted if the node has no | |
14222 * children. | |
14223 */ | |
14224 List<Outline> get children => _children; | |
14225 | |
14226 /** | |
14227 * The children of the node. The field will be omitted if the node has no | |
14228 * children. | |
14229 */ | |
14230 void set children(List<Outline> value) { | |
14231 this._children = value; | |
14232 } | |
14233 | |
14234 Outline(Element element, int offset, int length, {List<Outline> children}) { | |
14235 this.element = element; | |
14236 this.offset = offset; | |
14237 this.length = length; | |
14238 this.children = children; | |
14239 } | |
14240 | |
14241 factory Outline.fromJson( | |
14242 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
14243 if (json == null) { | |
14244 json = {}; | |
14245 } | |
14246 if (json is Map) { | |
14247 Element element; | |
14248 if (json.containsKey("element")) { | |
14249 element = new Element.fromJson( | |
14250 jsonDecoder, jsonPath + ".element", json["element"]); | |
14251 } else { | |
14252 throw jsonDecoder.missingKey(jsonPath, "element"); | |
14253 } | |
14254 int offset; | |
14255 if (json.containsKey("offset")) { | |
14256 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
14257 } else { | |
14258 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
14259 } | |
14260 int length; | |
14261 if (json.containsKey("length")) { | |
14262 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
14263 } else { | |
14264 throw jsonDecoder.missingKey(jsonPath, "length"); | |
14265 } | |
14266 List<Outline> children; | |
14267 if (json.containsKey("children")) { | |
14268 children = jsonDecoder.decodeList( | |
14269 jsonPath + ".children", | |
14270 json["children"], | |
14271 (String jsonPath, Object json) => | |
14272 new Outline.fromJson(jsonDecoder, jsonPath, json)); | |
14273 } | |
14274 return new Outline(element, offset, length, children: children); | |
14275 } else { | |
14276 throw jsonDecoder.mismatch(jsonPath, "Outline", json); | |
14277 } | |
14278 } | |
14279 | |
14280 Map<String, dynamic> toJson() { | |
14281 Map<String, dynamic> result = {}; | |
14282 result["element"] = element.toJson(); | |
14283 result["offset"] = offset; | |
14284 result["length"] = length; | |
14285 if (children != null) { | |
14286 result["children"] = | |
14287 children.map((Outline value) => value.toJson()).toList(); | |
14288 } | |
14289 return result; | |
14290 } | |
14291 | |
14292 @override | |
14293 String toString() => JSON.encode(toJson()); | |
14294 | |
14295 @override | |
14296 bool operator ==(other) { | |
14297 if (other is Outline) { | |
14298 return element == other.element && | |
14299 offset == other.offset && | |
14300 length == other.length && | |
14301 listEqual(children, other.children, (Outline a, Outline b) => a == b); | |
14302 } | |
14303 return false; | |
14304 } | |
14305 | |
14306 @override | |
14307 int get hashCode { | |
14308 int hash = 0; | |
14309 hash = JenkinsSmiHash.combine(hash, element.hashCode); | |
14310 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
14311 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
14312 hash = JenkinsSmiHash.combine(hash, children.hashCode); | |
14313 return JenkinsSmiHash.finish(hash); | |
14314 } | |
14315 } | |
14316 | |
14317 /** | |
14318 * Override | |
14319 * | |
14320 * { | |
14321 * "offset": int | |
14322 * "length": int | |
14323 * "superclassMember": optional OverriddenMember | |
14324 * "interfaceMembers": optional List<OverriddenMember> | |
14325 * } | |
14326 * | |
14327 * Clients may not extend, implement or mix-in this class. | |
14328 */ | |
14329 class Override implements HasToJson { | |
14330 int _offset; | |
14331 | |
14332 int _length; | |
14333 | |
14334 OverriddenMember _superclassMember; | |
14335 | |
14336 List<OverriddenMember> _interfaceMembers; | |
14337 | |
14338 /** | |
14339 * The offset of the name of the overriding member. | |
14340 */ | |
14341 int get offset => _offset; | |
14342 | |
14343 /** | |
14344 * The offset of the name of the overriding member. | |
14345 */ | |
14346 void set offset(int value) { | |
14347 assert(value != null); | |
14348 this._offset = value; | |
14349 } | |
14350 | |
14351 /** | |
14352 * The length of the name of the overriding member. | |
14353 */ | |
14354 int get length => _length; | |
14355 | |
14356 /** | |
14357 * The length of the name of the overriding member. | |
14358 */ | |
14359 void set length(int value) { | |
14360 assert(value != null); | |
14361 this._length = value; | |
14362 } | |
14363 | |
14364 /** | |
14365 * The member inherited from a superclass that is overridden by the | |
14366 * overriding member. The field is omitted if there is no superclass member, | |
14367 * in which case there must be at least one interface member. | |
14368 */ | |
14369 OverriddenMember get superclassMember => _superclassMember; | |
14370 | |
14371 /** | |
14372 * The member inherited from a superclass that is overridden by the | |
14373 * overriding member. The field is omitted if there is no superclass member, | |
14374 * in which case there must be at least one interface member. | |
14375 */ | |
14376 void set superclassMember(OverriddenMember value) { | |
14377 this._superclassMember = value; | |
14378 } | |
14379 | |
14380 /** | |
14381 * The members inherited from interfaces that are overridden by the | |
14382 * overriding member. The field is omitted if there are no interface members, | |
14383 * in which case there must be a superclass member. | |
14384 */ | |
14385 List<OverriddenMember> get interfaceMembers => _interfaceMembers; | |
14386 | |
14387 /** | |
14388 * The members inherited from interfaces that are overridden by the | |
14389 * overriding member. The field is omitted if there are no interface members, | |
14390 * in which case there must be a superclass member. | |
14391 */ | |
14392 void set interfaceMembers(List<OverriddenMember> value) { | |
14393 this._interfaceMembers = value; | |
14394 } | |
14395 | |
14396 Override(int offset, int length, | |
14397 {OverriddenMember superclassMember, | |
14398 List<OverriddenMember> interfaceMembers}) { | |
14399 this.offset = offset; | |
14400 this.length = length; | |
14401 this.superclassMember = superclassMember; | |
14402 this.interfaceMembers = interfaceMembers; | |
14403 } | |
14404 | |
14405 factory Override.fromJson( | |
14406 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
14407 if (json == null) { | |
14408 json = {}; | |
14409 } | |
14410 if (json is Map) { | |
14411 int offset; | |
14412 if (json.containsKey("offset")) { | |
14413 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
14414 } else { | |
14415 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
14416 } | |
14417 int length; | |
14418 if (json.containsKey("length")) { | |
14419 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
14420 } else { | |
14421 throw jsonDecoder.missingKey(jsonPath, "length"); | |
14422 } | |
14423 OverriddenMember superclassMember; | |
14424 if (json.containsKey("superclassMember")) { | |
14425 superclassMember = new OverriddenMember.fromJson(jsonDecoder, | |
14426 jsonPath + ".superclassMember", json["superclassMember"]); | |
14427 } | |
14428 List<OverriddenMember> interfaceMembers; | |
14429 if (json.containsKey("interfaceMembers")) { | |
14430 interfaceMembers = jsonDecoder.decodeList( | |
14431 jsonPath + ".interfaceMembers", | |
14432 json["interfaceMembers"], | |
14433 (String jsonPath, Object json) => | |
14434 new OverriddenMember.fromJson(jsonDecoder, jsonPath, json)); | |
14435 } | |
14436 return new Override(offset, length, | |
14437 superclassMember: superclassMember, | |
14438 interfaceMembers: interfaceMembers); | |
14439 } else { | |
14440 throw jsonDecoder.mismatch(jsonPath, "Override", json); | |
14441 } | |
14442 } | |
14443 | |
14444 Map<String, dynamic> toJson() { | |
14445 Map<String, dynamic> result = {}; | |
14446 result["offset"] = offset; | |
14447 result["length"] = length; | |
14448 if (superclassMember != null) { | |
14449 result["superclassMember"] = superclassMember.toJson(); | |
14450 } | |
14451 if (interfaceMembers != null) { | |
14452 result["interfaceMembers"] = interfaceMembers | |
14453 .map((OverriddenMember value) => value.toJson()) | |
14454 .toList(); | |
14455 } | |
14456 return result; | |
14457 } | |
14458 | |
14459 @override | |
14460 String toString() => JSON.encode(toJson()); | |
14461 | |
14462 @override | |
14463 bool operator ==(other) { | |
14464 if (other is Override) { | |
14465 return offset == other.offset && | |
14466 length == other.length && | |
14467 superclassMember == other.superclassMember && | |
14468 listEqual(interfaceMembers, other.interfaceMembers, | |
14469 (OverriddenMember a, OverriddenMember b) => a == b); | |
14470 } | |
14471 return false; | |
14472 } | |
14473 | |
14474 @override | |
14475 int get hashCode { | |
14476 int hash = 0; | |
14477 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
14478 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
14479 hash = JenkinsSmiHash.combine(hash, superclassMember.hashCode); | |
14480 hash = JenkinsSmiHash.combine(hash, interfaceMembers.hashCode); | |
14481 return JenkinsSmiHash.finish(hash); | |
14482 } | |
14483 } | |
14484 | |
14485 /** | |
14486 * OverriddenMember | |
14487 * | |
14488 * { | |
14489 * "element": Element | |
14490 * "className": String | |
14491 * } | |
14492 * | |
14493 * Clients may not extend, implement or mix-in this class. | |
14494 */ | |
14495 class OverriddenMember implements HasToJson { | |
14496 Element _element; | |
14497 | |
14498 String _className; | |
14499 | |
14500 /** | |
14501 * The element that is being overridden. | |
14502 */ | |
14503 Element get element => _element; | |
14504 | |
14505 /** | |
14506 * The element that is being overridden. | |
14507 */ | |
14508 void set element(Element value) { | |
14509 assert(value != null); | |
14510 this._element = value; | |
14511 } | |
14512 | |
14513 /** | |
14514 * The name of the class in which the member is defined. | |
14515 */ | |
14516 String get className => _className; | |
14517 | |
14518 /** | |
14519 * The name of the class in which the member is defined. | |
14520 */ | |
14521 void set className(String value) { | |
14522 assert(value != null); | |
14523 this._className = value; | |
14524 } | |
14525 | |
14526 OverriddenMember(Element element, String className) { | |
14527 this.element = element; | |
14528 this.className = className; | |
14529 } | |
14530 | |
14531 factory OverriddenMember.fromJson( | |
14532 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
14533 if (json == null) { | |
14534 json = {}; | |
14535 } | |
14536 if (json is Map) { | |
14537 Element element; | |
14538 if (json.containsKey("element")) { | |
14539 element = new Element.fromJson( | |
14540 jsonDecoder, jsonPath + ".element", json["element"]); | |
14541 } else { | |
14542 throw jsonDecoder.missingKey(jsonPath, "element"); | |
14543 } | |
14544 String className; | |
14545 if (json.containsKey("className")) { | |
14546 className = jsonDecoder.decodeString( | |
14547 jsonPath + ".className", json["className"]); | |
14548 } else { | |
14549 throw jsonDecoder.missingKey(jsonPath, "className"); | |
14550 } | |
14551 return new OverriddenMember(element, className); | |
14552 } else { | |
14553 throw jsonDecoder.mismatch(jsonPath, "OverriddenMember", json); | |
14554 } | |
14555 } | |
14556 | |
14557 Map<String, dynamic> toJson() { | |
14558 Map<String, dynamic> result = {}; | |
14559 result["element"] = element.toJson(); | |
14560 result["className"] = className; | |
14561 return result; | |
14562 } | |
14563 | |
14564 @override | |
14565 String toString() => JSON.encode(toJson()); | |
14566 | |
14567 @override | |
14568 bool operator ==(other) { | |
14569 if (other is OverriddenMember) { | |
14570 return element == other.element && className == other.className; | |
14571 } | |
14572 return false; | |
14573 } | |
14574 | |
14575 @override | |
14576 int get hashCode { | |
14577 int hash = 0; | |
14578 hash = JenkinsSmiHash.combine(hash, element.hashCode); | |
14579 hash = JenkinsSmiHash.combine(hash, className.hashCode); | |
14580 return JenkinsSmiHash.finish(hash); | |
14581 } | |
14582 } | |
14583 | |
14584 /** | |
14585 * Position | |
14586 * | |
14587 * { | |
14588 * "file": FilePath | |
14589 * "offset": int | |
14590 * } | |
14591 * | |
14592 * Clients may not extend, implement or mix-in this class. | |
14593 */ | |
14594 class Position implements HasToJson { | |
14595 String _file; | |
14596 | |
14597 int _offset; | |
14598 | |
14599 /** | |
14600 * The file containing the position. | |
14601 */ | |
14602 String get file => _file; | |
14603 | |
14604 /** | |
14605 * The file containing the position. | |
14606 */ | |
14607 void set file(String value) { | |
14608 assert(value != null); | |
14609 this._file = value; | |
14610 } | |
14611 | |
14612 /** | |
14613 * The offset of the position. | |
14614 */ | |
14615 int get offset => _offset; | |
14616 | |
14617 /** | |
14618 * The offset of the position. | |
14619 */ | |
14620 void set offset(int value) { | |
14621 assert(value != null); | |
14622 this._offset = value; | |
14623 } | |
14624 | |
14625 Position(String file, int offset) { | |
14626 this.file = file; | |
14627 this.offset = offset; | |
14628 } | |
14629 | |
14630 factory Position.fromJson( | |
14631 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
14632 if (json == null) { | |
14633 json = {}; | |
14634 } | |
14635 if (json is Map) { | |
14636 String file; | |
14637 if (json.containsKey("file")) { | |
14638 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
14639 } else { | |
14640 throw jsonDecoder.missingKey(jsonPath, "file"); | |
14641 } | |
14642 int offset; | |
14643 if (json.containsKey("offset")) { | |
14644 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
14645 } else { | |
14646 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
14647 } | |
14648 return new Position(file, offset); | |
14649 } else { | |
14650 throw jsonDecoder.mismatch(jsonPath, "Position", json); | |
14651 } | |
14652 } | |
14653 | |
14654 Map<String, dynamic> toJson() { | |
14655 Map<String, dynamic> result = {}; | |
14656 result["file"] = file; | |
14657 result["offset"] = offset; | |
14658 return result; | |
14659 } | |
14660 | |
14661 @override | |
14662 String toString() => JSON.encode(toJson()); | |
14663 | |
14664 @override | |
14665 bool operator ==(other) { | |
14666 if (other is Position) { | |
14667 return file == other.file && offset == other.offset; | |
14668 } | |
14669 return false; | |
14670 } | |
14671 | |
14672 @override | |
14673 int get hashCode { | |
14674 int hash = 0; | |
14675 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
14676 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
14677 return JenkinsSmiHash.finish(hash); | |
14678 } | |
14679 } | |
14680 | |
14681 /** | |
14682 * PubStatus | |
14683 * | |
14684 * { | |
14685 * "isListingPackageDirs": bool | |
14686 * } | |
14687 * | |
14688 * Clients may not extend, implement or mix-in this class. | |
14689 */ | |
14690 class PubStatus implements HasToJson { | |
14691 bool _isListingPackageDirs; | |
14692 | |
14693 /** | |
14694 * True if the server is currently running pub to produce a list of package | |
14695 * directories. | |
14696 */ | |
14697 bool get isListingPackageDirs => _isListingPackageDirs; | |
14698 | |
14699 /** | |
14700 * True if the server is currently running pub to produce a list of package | |
14701 * directories. | |
14702 */ | |
14703 void set isListingPackageDirs(bool value) { | |
14704 assert(value != null); | |
14705 this._isListingPackageDirs = value; | |
14706 } | |
14707 | |
14708 PubStatus(bool isListingPackageDirs) { | |
14709 this.isListingPackageDirs = isListingPackageDirs; | |
14710 } | |
14711 | |
14712 factory PubStatus.fromJson( | |
14713 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
14714 if (json == null) { | |
14715 json = {}; | |
14716 } | |
14717 if (json is Map) { | |
14718 bool isListingPackageDirs; | |
14719 if (json.containsKey("isListingPackageDirs")) { | |
14720 isListingPackageDirs = jsonDecoder.decodeBool( | |
14721 jsonPath + ".isListingPackageDirs", json["isListingPackageDirs"]); | |
14722 } else { | |
14723 throw jsonDecoder.missingKey(jsonPath, "isListingPackageDirs"); | |
14724 } | |
14725 return new PubStatus(isListingPackageDirs); | |
14726 } else { | |
14727 throw jsonDecoder.mismatch(jsonPath, "PubStatus", json); | |
14728 } | |
14729 } | |
14730 | |
14731 Map<String, dynamic> toJson() { | |
14732 Map<String, dynamic> result = {}; | |
14733 result["isListingPackageDirs"] = isListingPackageDirs; | |
14734 return result; | |
14735 } | |
14736 | |
14737 @override | |
14738 String toString() => JSON.encode(toJson()); | |
14739 | |
14740 @override | |
14741 bool operator ==(other) { | |
14742 if (other is PubStatus) { | |
14743 return isListingPackageDirs == other.isListingPackageDirs; | |
14744 } | |
14745 return false; | |
14746 } | |
14747 | |
14748 @override | |
14749 int get hashCode { | |
14750 int hash = 0; | |
14751 hash = JenkinsSmiHash.combine(hash, isListingPackageDirs.hashCode); | |
14752 return JenkinsSmiHash.finish(hash); | |
14753 } | |
14754 } | |
14755 | |
14756 /** | |
14757 * RefactoringKind | |
14758 * | |
14759 * enum { | |
14760 * CONVERT_GETTER_TO_METHOD | |
14761 * CONVERT_METHOD_TO_GETTER | |
14762 * EXTRACT_LOCAL_VARIABLE | |
14763 * EXTRACT_METHOD | |
14764 * INLINE_LOCAL_VARIABLE | |
14765 * INLINE_METHOD | |
14766 * MOVE_FILE | |
14767 * RENAME | |
14768 * SORT_MEMBERS | |
14769 * } | |
14770 * | |
14771 * Clients may not extend, implement or mix-in this class. | |
14772 */ | |
14773 class RefactoringKind implements Enum { | |
14774 static const RefactoringKind CONVERT_GETTER_TO_METHOD = | |
14775 const RefactoringKind._("CONVERT_GETTER_TO_METHOD"); | |
14776 | |
14777 static const RefactoringKind CONVERT_METHOD_TO_GETTER = | |
14778 const RefactoringKind._("CONVERT_METHOD_TO_GETTER"); | |
14779 | |
14780 static const RefactoringKind EXTRACT_LOCAL_VARIABLE = | |
14781 const RefactoringKind._("EXTRACT_LOCAL_VARIABLE"); | |
14782 | |
14783 static const RefactoringKind EXTRACT_METHOD = | |
14784 const RefactoringKind._("EXTRACT_METHOD"); | |
14785 | |
14786 static const RefactoringKind INLINE_LOCAL_VARIABLE = | |
14787 const RefactoringKind._("INLINE_LOCAL_VARIABLE"); | |
14788 | |
14789 static const RefactoringKind INLINE_METHOD = | |
14790 const RefactoringKind._("INLINE_METHOD"); | |
14791 | |
14792 static const RefactoringKind MOVE_FILE = const RefactoringKind._("MOVE_FILE"); | |
14793 | |
14794 static const RefactoringKind RENAME = const RefactoringKind._("RENAME"); | |
14795 | |
14796 static const RefactoringKind SORT_MEMBERS = | |
14797 const RefactoringKind._("SORT_MEMBERS"); | |
14798 | |
14799 /** | |
14800 * A list containing all of the enum values that are defined. | |
14801 */ | |
14802 static const List<RefactoringKind> VALUES = const <RefactoringKind>[ | |
14803 CONVERT_GETTER_TO_METHOD, | |
14804 CONVERT_METHOD_TO_GETTER, | |
14805 EXTRACT_LOCAL_VARIABLE, | |
14806 EXTRACT_METHOD, | |
14807 INLINE_LOCAL_VARIABLE, | |
14808 INLINE_METHOD, | |
14809 MOVE_FILE, | |
14810 RENAME, | |
14811 SORT_MEMBERS | |
14812 ]; | |
14813 | |
14814 final String name; | |
14815 | |
14816 const RefactoringKind._(this.name); | |
14817 | |
14818 factory RefactoringKind(String name) { | |
14819 switch (name) { | |
14820 case "CONVERT_GETTER_TO_METHOD": | |
14821 return CONVERT_GETTER_TO_METHOD; | |
14822 case "CONVERT_METHOD_TO_GETTER": | |
14823 return CONVERT_METHOD_TO_GETTER; | |
14824 case "EXTRACT_LOCAL_VARIABLE": | |
14825 return EXTRACT_LOCAL_VARIABLE; | |
14826 case "EXTRACT_METHOD": | |
14827 return EXTRACT_METHOD; | |
14828 case "INLINE_LOCAL_VARIABLE": | |
14829 return INLINE_LOCAL_VARIABLE; | |
14830 case "INLINE_METHOD": | |
14831 return INLINE_METHOD; | |
14832 case "MOVE_FILE": | |
14833 return MOVE_FILE; | |
14834 case "RENAME": | |
14835 return RENAME; | |
14836 case "SORT_MEMBERS": | |
14837 return SORT_MEMBERS; | |
14838 } | |
14839 throw new Exception('Illegal enum value: $name'); | |
14840 } | |
14841 | |
14842 factory RefactoringKind.fromJson( | |
14843 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
14844 if (json is String) { | |
14845 try { | |
14846 return new RefactoringKind(json); | |
14847 } catch (_) { | |
14848 // Fall through | |
14849 } | |
14850 } | |
14851 throw jsonDecoder.mismatch(jsonPath, "RefactoringKind", json); | |
14852 } | |
14853 | |
14854 @override | |
14855 String toString() => "RefactoringKind.$name"; | |
14856 | |
14857 String toJson() => name; | |
14858 } | |
14859 | |
14860 /** | |
14861 * RefactoringMethodParameter | |
14862 * | |
14863 * { | |
14864 * "id": optional String | |
14865 * "kind": RefactoringMethodParameterKind | |
14866 * "type": String | |
14867 * "name": String | |
14868 * "parameters": optional String | |
14869 * } | |
14870 * | |
14871 * Clients may not extend, implement or mix-in this class. | |
14872 */ | |
14873 class RefactoringMethodParameter implements HasToJson { | |
14874 String _id; | |
14875 | |
14876 RefactoringMethodParameterKind _kind; | |
14877 | |
14878 String _type; | |
14879 | |
14880 String _name; | |
14881 | |
14882 String _parameters; | |
14883 | |
14884 /** | |
14885 * The unique identifier of the parameter. Clients may omit this field for | |
14886 * the parameters they want to add. | |
14887 */ | |
14888 String get id => _id; | |
14889 | |
14890 /** | |
14891 * The unique identifier of the parameter. Clients may omit this field for | |
14892 * the parameters they want to add. | |
14893 */ | |
14894 void set id(String value) { | |
14895 this._id = value; | |
14896 } | |
14897 | |
14898 /** | |
14899 * The kind of the parameter. | |
14900 */ | |
14901 RefactoringMethodParameterKind get kind => _kind; | |
14902 | |
14903 /** | |
14904 * The kind of the parameter. | |
14905 */ | |
14906 void set kind(RefactoringMethodParameterKind value) { | |
14907 assert(value != null); | |
14908 this._kind = value; | |
14909 } | |
14910 | |
14911 /** | |
14912 * The type that should be given to the parameter, or the return type of the | |
14913 * parameter's function type. | |
14914 */ | |
14915 String get type => _type; | |
14916 | |
14917 /** | |
14918 * The type that should be given to the parameter, or the return type of the | |
14919 * parameter's function type. | |
14920 */ | |
14921 void set type(String value) { | |
14922 assert(value != null); | |
14923 this._type = value; | |
14924 } | |
14925 | |
14926 /** | |
14927 * The name that should be given to the parameter. | |
14928 */ | |
14929 String get name => _name; | |
14930 | |
14931 /** | |
14932 * The name that should be given to the parameter. | |
14933 */ | |
14934 void set name(String value) { | |
14935 assert(value != null); | |
14936 this._name = value; | |
14937 } | |
14938 | |
14939 /** | |
14940 * The parameter list of the parameter's function type. If the parameter is | |
14941 * not of a function type, this field will not be defined. If the function | |
14942 * type has zero parameters, this field will have a value of "()". | |
14943 */ | |
14944 String get parameters => _parameters; | |
14945 | |
14946 /** | |
14947 * The parameter list of the parameter's function type. If the parameter is | |
14948 * not of a function type, this field will not be defined. If the function | |
14949 * type has zero parameters, this field will have a value of "()". | |
14950 */ | |
14951 void set parameters(String value) { | |
14952 this._parameters = value; | |
14953 } | |
14954 | |
14955 RefactoringMethodParameter( | |
14956 RefactoringMethodParameterKind kind, String type, String name, | |
14957 {String id, String parameters}) { | |
14958 this.id = id; | |
14959 this.kind = kind; | |
14960 this.type = type; | |
14961 this.name = name; | |
14962 this.parameters = parameters; | |
14963 } | |
14964 | |
14965 factory RefactoringMethodParameter.fromJson( | |
14966 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
14967 if (json == null) { | |
14968 json = {}; | |
14969 } | |
14970 if (json is Map) { | |
14971 String id; | |
14972 if (json.containsKey("id")) { | |
14973 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); | |
14974 } | |
14975 RefactoringMethodParameterKind kind; | |
14976 if (json.containsKey("kind")) { | |
14977 kind = new RefactoringMethodParameterKind.fromJson( | |
14978 jsonDecoder, jsonPath + ".kind", json["kind"]); | |
14979 } else { | |
14980 throw jsonDecoder.missingKey(jsonPath, "kind"); | |
14981 } | |
14982 String type; | |
14983 if (json.containsKey("type")) { | |
14984 type = jsonDecoder.decodeString(jsonPath + ".type", json["type"]); | |
14985 } else { | |
14986 throw jsonDecoder.missingKey(jsonPath, "type"); | |
14987 } | |
14988 String name; | |
14989 if (json.containsKey("name")) { | |
14990 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]); | |
14991 } else { | |
14992 throw jsonDecoder.missingKey(jsonPath, "name"); | |
14993 } | |
14994 String parameters; | |
14995 if (json.containsKey("parameters")) { | |
14996 parameters = jsonDecoder.decodeString( | |
14997 jsonPath + ".parameters", json["parameters"]); | |
14998 } | |
14999 return new RefactoringMethodParameter(kind, type, name, | |
15000 id: id, parameters: parameters); | |
15001 } else { | |
15002 throw jsonDecoder.mismatch(jsonPath, "RefactoringMethodParameter", json); | |
15003 } | |
15004 } | |
15005 | |
15006 Map<String, dynamic> toJson() { | |
15007 Map<String, dynamic> result = {}; | |
15008 if (id != null) { | |
15009 result["id"] = id; | |
15010 } | |
15011 result["kind"] = kind.toJson(); | |
15012 result["type"] = type; | |
15013 result["name"] = name; | |
15014 if (parameters != null) { | |
15015 result["parameters"] = parameters; | |
15016 } | |
15017 return result; | |
15018 } | |
15019 | |
15020 @override | |
15021 String toString() => JSON.encode(toJson()); | |
15022 | |
15023 @override | |
15024 bool operator ==(other) { | |
15025 if (other is RefactoringMethodParameter) { | |
15026 return id == other.id && | |
15027 kind == other.kind && | |
15028 type == other.type && | |
15029 name == other.name && | |
15030 parameters == other.parameters; | |
15031 } | |
15032 return false; | |
15033 } | |
15034 | |
15035 @override | |
15036 int get hashCode { | |
15037 int hash = 0; | |
15038 hash = JenkinsSmiHash.combine(hash, id.hashCode); | |
15039 hash = JenkinsSmiHash.combine(hash, kind.hashCode); | |
15040 hash = JenkinsSmiHash.combine(hash, type.hashCode); | |
15041 hash = JenkinsSmiHash.combine(hash, name.hashCode); | |
15042 hash = JenkinsSmiHash.combine(hash, parameters.hashCode); | |
15043 return JenkinsSmiHash.finish(hash); | |
15044 } | |
15045 } | |
15046 | |
15047 /** | |
15048 * RefactoringFeedback | |
15049 * | |
15050 * { | |
15051 * } | |
15052 * | |
15053 * Clients may not extend, implement or mix-in this class. | |
15054 */ | |
15055 class RefactoringFeedback implements HasToJson { | |
15056 RefactoringFeedback(); | |
15057 | |
15058 factory RefactoringFeedback.fromJson( | |
15059 JsonDecoder jsonDecoder, String jsonPath, Object json, Map responseJson) { | |
15060 return refactoringFeedbackFromJson( | |
15061 jsonDecoder, jsonPath, json, responseJson); | |
15062 } | |
15063 | |
15064 Map<String, dynamic> toJson() { | |
15065 Map<String, dynamic> result = {}; | |
15066 return result; | |
15067 } | |
15068 | |
15069 @override | |
15070 String toString() => JSON.encode(toJson()); | |
15071 | |
15072 @override | |
15073 bool operator ==(other) { | |
15074 if (other is RefactoringFeedback) { | |
15075 return true; | |
15076 } | |
15077 return false; | |
15078 } | |
15079 | |
15080 @override | |
15081 int get hashCode { | |
15082 int hash = 0; | |
15083 return JenkinsSmiHash.finish(hash); | |
15084 } | |
15085 } | |
15086 | |
15087 /** | |
15088 * RefactoringOptions | |
15089 * | |
15090 * { | |
15091 * } | |
15092 * | |
15093 * Clients may not extend, implement or mix-in this class. | |
15094 */ | |
15095 class RefactoringOptions implements HasToJson { | |
15096 RefactoringOptions(); | |
15097 | |
15098 factory RefactoringOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, | |
15099 Object json, RefactoringKind kind) { | |
15100 return refactoringOptionsFromJson(jsonDecoder, jsonPath, json, kind); | |
15101 } | |
15102 | |
15103 Map<String, dynamic> toJson() { | |
15104 Map<String, dynamic> result = {}; | |
15105 return result; | |
15106 } | |
15107 | |
15108 @override | |
15109 String toString() => JSON.encode(toJson()); | |
15110 | |
15111 @override | |
15112 bool operator ==(other) { | |
15113 if (other is RefactoringOptions) { | |
15114 return true; | |
15115 } | |
15116 return false; | |
15117 } | |
15118 | |
15119 @override | |
15120 int get hashCode { | |
15121 int hash = 0; | |
15122 return JenkinsSmiHash.finish(hash); | |
15123 } | |
15124 } | |
15125 | |
15126 /** | |
15127 * RefactoringMethodParameterKind | |
15128 * | |
15129 * enum { | |
15130 * REQUIRED | |
15131 * POSITIONAL | |
15132 * NAMED | |
15133 * } | |
15134 * | |
15135 * Clients may not extend, implement or mix-in this class. | |
15136 */ | |
15137 class RefactoringMethodParameterKind implements Enum { | |
15138 static const RefactoringMethodParameterKind REQUIRED = | |
15139 const RefactoringMethodParameterKind._("REQUIRED"); | |
15140 | |
15141 static const RefactoringMethodParameterKind POSITIONAL = | |
15142 const RefactoringMethodParameterKind._("POSITIONAL"); | |
15143 | |
15144 static const RefactoringMethodParameterKind NAMED = | |
15145 const RefactoringMethodParameterKind._("NAMED"); | |
15146 | |
15147 /** | |
15148 * A list containing all of the enum values that are defined. | |
15149 */ | |
15150 static const List<RefactoringMethodParameterKind> VALUES = | |
15151 const <RefactoringMethodParameterKind>[REQUIRED, POSITIONAL, NAMED]; | |
15152 | |
15153 final String name; | |
15154 | |
15155 const RefactoringMethodParameterKind._(this.name); | |
15156 | |
15157 factory RefactoringMethodParameterKind(String name) { | |
15158 switch (name) { | |
15159 case "REQUIRED": | |
15160 return REQUIRED; | |
15161 case "POSITIONAL": | |
15162 return POSITIONAL; | |
15163 case "NAMED": | |
15164 return NAMED; | |
15165 } | |
15166 throw new Exception('Illegal enum value: $name'); | |
15167 } | |
15168 | |
15169 factory RefactoringMethodParameterKind.fromJson( | |
15170 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
15171 if (json is String) { | |
15172 try { | |
15173 return new RefactoringMethodParameterKind(json); | |
15174 } catch (_) { | |
15175 // Fall through | |
15176 } | |
15177 } | |
15178 throw jsonDecoder.mismatch( | |
15179 jsonPath, "RefactoringMethodParameterKind", json); | |
15180 } | |
15181 | |
15182 @override | |
15183 String toString() => "RefactoringMethodParameterKind.$name"; | |
15184 | |
15185 String toJson() => name; | |
15186 } | |
15187 | |
15188 /** | |
15189 * RefactoringProblem | |
15190 * | |
15191 * { | |
15192 * "severity": RefactoringProblemSeverity | |
15193 * "message": String | |
15194 * "location": optional Location | |
15195 * } | |
15196 * | |
15197 * Clients may not extend, implement or mix-in this class. | |
15198 */ | |
15199 class RefactoringProblem implements HasToJson { | |
15200 RefactoringProblemSeverity _severity; | |
15201 | |
15202 String _message; | |
15203 | |
15204 Location _location; | |
15205 | |
15206 /** | |
15207 * The severity of the problem being represented. | |
15208 */ | |
15209 RefactoringProblemSeverity get severity => _severity; | |
15210 | |
15211 /** | |
15212 * The severity of the problem being represented. | |
15213 */ | |
15214 void set severity(RefactoringProblemSeverity value) { | |
15215 assert(value != null); | |
15216 this._severity = value; | |
15217 } | |
15218 | |
15219 /** | |
15220 * A human-readable description of the problem being represented. | |
15221 */ | |
15222 String get message => _message; | |
15223 | |
15224 /** | |
15225 * A human-readable description of the problem being represented. | |
15226 */ | |
15227 void set message(String value) { | |
15228 assert(value != null); | |
15229 this._message = value; | |
15230 } | |
15231 | |
15232 /** | |
15233 * The location of the problem being represented. This field is omitted | |
15234 * unless there is a specific location associated with the problem (such as a | |
15235 * location where an element being renamed will be shadowed). | |
15236 */ | |
15237 Location get location => _location; | |
15238 | |
15239 /** | |
15240 * The location of the problem being represented. This field is omitted | |
15241 * unless there is a specific location associated with the problem (such as a | |
15242 * location where an element being renamed will be shadowed). | |
15243 */ | |
15244 void set location(Location value) { | |
15245 this._location = value; | |
15246 } | |
15247 | |
15248 RefactoringProblem(RefactoringProblemSeverity severity, String message, | |
15249 {Location location}) { | |
15250 this.severity = severity; | |
15251 this.message = message; | |
15252 this.location = location; | |
15253 } | |
15254 | |
15255 factory RefactoringProblem.fromJson( | |
15256 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
15257 if (json == null) { | |
15258 json = {}; | |
15259 } | |
15260 if (json is Map) { | |
15261 RefactoringProblemSeverity severity; | |
15262 if (json.containsKey("severity")) { | |
15263 severity = new RefactoringProblemSeverity.fromJson( | |
15264 jsonDecoder, jsonPath + ".severity", json["severity"]); | |
15265 } else { | |
15266 throw jsonDecoder.missingKey(jsonPath, "severity"); | |
15267 } | |
15268 String message; | |
15269 if (json.containsKey("message")) { | |
15270 message = | |
15271 jsonDecoder.decodeString(jsonPath + ".message", json["message"]); | |
15272 } else { | |
15273 throw jsonDecoder.missingKey(jsonPath, "message"); | |
15274 } | |
15275 Location location; | |
15276 if (json.containsKey("location")) { | |
15277 location = new Location.fromJson( | |
15278 jsonDecoder, jsonPath + ".location", json["location"]); | |
15279 } | |
15280 return new RefactoringProblem(severity, message, location: location); | |
15281 } else { | |
15282 throw jsonDecoder.mismatch(jsonPath, "RefactoringProblem", json); | |
15283 } | |
15284 } | |
15285 | |
15286 Map<String, dynamic> toJson() { | |
15287 Map<String, dynamic> result = {}; | |
15288 result["severity"] = severity.toJson(); | |
15289 result["message"] = message; | |
15290 if (location != null) { | |
15291 result["location"] = location.toJson(); | |
15292 } | |
15293 return result; | |
15294 } | |
15295 | |
15296 @override | |
15297 String toString() => JSON.encode(toJson()); | |
15298 | |
15299 @override | |
15300 bool operator ==(other) { | |
15301 if (other is RefactoringProblem) { | |
15302 return severity == other.severity && | |
15303 message == other.message && | |
15304 location == other.location; | |
15305 } | |
15306 return false; | |
15307 } | |
15308 | |
15309 @override | |
15310 int get hashCode { | |
15311 int hash = 0; | |
15312 hash = JenkinsSmiHash.combine(hash, severity.hashCode); | |
15313 hash = JenkinsSmiHash.combine(hash, message.hashCode); | |
15314 hash = JenkinsSmiHash.combine(hash, location.hashCode); | |
15315 return JenkinsSmiHash.finish(hash); | |
15316 } | |
15317 } | |
15318 | |
15319 /** | |
15320 * RefactoringProblemSeverity | |
15321 * | |
15322 * enum { | |
15323 * INFO | |
15324 * WARNING | |
15325 * ERROR | |
15326 * FATAL | |
15327 * } | |
15328 * | |
15329 * Clients may not extend, implement or mix-in this class. | |
15330 */ | |
15331 class RefactoringProblemSeverity implements Enum { | |
15332 /** | |
15333 * A minor code problem. No example, because it is not used yet. | |
15334 */ | |
15335 static const RefactoringProblemSeverity INFO = | |
15336 const RefactoringProblemSeverity._("INFO"); | |
15337 | |
15338 /** | |
15339 * A minor code problem. For example names of local variables should be camel | |
15340 * case and start with a lower case letter. Staring the name of a variable | |
15341 * with an upper case is OK from the language point of view, but it is nice | |
15342 * to warn the user. | |
15343 */ | |
15344 static const RefactoringProblemSeverity WARNING = | |
15345 const RefactoringProblemSeverity._("WARNING"); | |
15346 | |
15347 /** | |
15348 * The refactoring technically can be performed, but there is a logical | |
15349 * problem. For example the name of a local variable being extracted | |
15350 * conflicts with another name in the scope, or duplicate parameter names in | |
15351 * the method being extracted, or a conflict between a parameter name and a | |
15352 * local variable, etc. In some cases the location of the problem is also | |
15353 * provided, so the IDE can show user the location and the problem, and let | |
15354 * the user decide whether she wants to perform the refactoring. For example | |
15355 * the name conflict might be expected, and the user wants to fix it | |
15356 * afterwards. | |
15357 */ | |
15358 static const RefactoringProblemSeverity ERROR = | |
15359 const RefactoringProblemSeverity._("ERROR"); | |
15360 | |
15361 /** | |
15362 * A fatal error, which prevents performing the refactoring. For example the | |
15363 * name of a local variable being extracted is not a valid identifier, or | |
15364 * selection is not a valid expression. | |
15365 */ | |
15366 static const RefactoringProblemSeverity FATAL = | |
15367 const RefactoringProblemSeverity._("FATAL"); | |
15368 | |
15369 /** | |
15370 * A list containing all of the enum values that are defined. | |
15371 */ | |
15372 static const List<RefactoringProblemSeverity> VALUES = | |
15373 const <RefactoringProblemSeverity>[INFO, WARNING, ERROR, FATAL]; | |
15374 | |
15375 final String name; | |
15376 | |
15377 const RefactoringProblemSeverity._(this.name); | |
15378 | |
15379 factory RefactoringProblemSeverity(String name) { | |
15380 switch (name) { | |
15381 case "INFO": | |
15382 return INFO; | |
15383 case "WARNING": | |
15384 return WARNING; | |
15385 case "ERROR": | |
15386 return ERROR; | |
15387 case "FATAL": | |
15388 return FATAL; | |
15389 } | |
15390 throw new Exception('Illegal enum value: $name'); | |
15391 } | |
15392 | |
15393 factory RefactoringProblemSeverity.fromJson( | |
15394 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
15395 if (json is String) { | |
15396 try { | |
15397 return new RefactoringProblemSeverity(json); | |
15398 } catch (_) { | |
15399 // Fall through | |
15400 } | |
15401 } | |
15402 throw jsonDecoder.mismatch(jsonPath, "RefactoringProblemSeverity", json); | |
15403 } | |
15404 | |
15405 /** | |
15406 * Returns the [RefactoringProblemSeverity] with the maximal severity. | |
15407 */ | |
15408 static RefactoringProblemSeverity max( | |
15409 RefactoringProblemSeverity a, RefactoringProblemSeverity b) => | |
15410 maxRefactoringProblemSeverity(a, b); | |
15411 | |
15412 @override | |
15413 String toString() => "RefactoringProblemSeverity.$name"; | |
15414 | |
15415 String toJson() => name; | |
15416 } | |
15417 | |
15418 /** | |
15419 * RemoveContentOverlay | |
15420 * | |
15421 * { | |
15422 * "type": "remove" | |
15423 * } | |
15424 * | |
15425 * Clients may not extend, implement or mix-in this class. | |
15426 */ | |
15427 class RemoveContentOverlay implements HasToJson { | |
15428 RemoveContentOverlay(); | |
15429 | |
15430 factory RemoveContentOverlay.fromJson( | |
15431 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
15432 if (json == null) { | |
15433 json = {}; | |
15434 } | |
15435 if (json is Map) { | |
15436 if (json["type"] != "remove") { | |
15437 throw jsonDecoder.mismatch(jsonPath, "equal " + "remove", json); | |
15438 } | |
15439 return new RemoveContentOverlay(); | |
15440 } else { | |
15441 throw jsonDecoder.mismatch(jsonPath, "RemoveContentOverlay", json); | |
15442 } | |
15443 } | |
15444 | |
15445 Map<String, dynamic> toJson() { | |
15446 Map<String, dynamic> result = {}; | |
15447 result["type"] = "remove"; | |
15448 return result; | |
15449 } | |
15450 | |
15451 @override | |
15452 String toString() => JSON.encode(toJson()); | |
15453 | |
15454 @override | |
15455 bool operator ==(other) { | |
15456 if (other is RemoveContentOverlay) { | |
15457 return true; | |
15458 } | |
15459 return false; | |
15460 } | |
15461 | |
15462 @override | |
15463 int get hashCode { | |
15464 int hash = 0; | |
15465 hash = JenkinsSmiHash.combine(hash, 114870849); | |
15466 return JenkinsSmiHash.finish(hash); | |
15467 } | |
15468 } | |
15469 | |
15470 /** | |
15471 * RequestError | |
15472 * | |
15473 * { | |
15474 * "code": RequestErrorCode | |
15475 * "message": String | |
15476 * "stackTrace": optional String | |
15477 * } | |
15478 * | |
15479 * Clients may not extend, implement or mix-in this class. | |
15480 */ | |
15481 class RequestError implements HasToJson { | |
15482 RequestErrorCode _code; | |
15483 | |
15484 String _message; | |
15485 | |
15486 String _stackTrace; | |
15487 | |
15488 /** | |
15489 * A code that uniquely identifies the error that occurred. | |
15490 */ | |
15491 RequestErrorCode get code => _code; | |
15492 | |
15493 /** | |
15494 * A code that uniquely identifies the error that occurred. | |
15495 */ | |
15496 void set code(RequestErrorCode value) { | |
15497 assert(value != null); | |
15498 this._code = value; | |
15499 } | |
15500 | |
15501 /** | |
15502 * A short description of the error. | |
15503 */ | |
15504 String get message => _message; | |
15505 | |
15506 /** | |
15507 * A short description of the error. | |
15508 */ | |
15509 void set message(String value) { | |
15510 assert(value != null); | |
15511 this._message = value; | |
15512 } | |
15513 | |
15514 /** | |
15515 * The stack trace associated with processing the request, used for debugging | |
15516 * the server. | |
15517 */ | |
15518 String get stackTrace => _stackTrace; | |
15519 | |
15520 /** | |
15521 * The stack trace associated with processing the request, used for debugging | |
15522 * the server. | |
15523 */ | |
15524 void set stackTrace(String value) { | |
15525 this._stackTrace = value; | |
15526 } | |
15527 | |
15528 RequestError(RequestErrorCode code, String message, {String stackTrace}) { | |
15529 this.code = code; | |
15530 this.message = message; | |
15531 this.stackTrace = stackTrace; | |
15532 } | |
15533 | |
15534 factory RequestError.fromJson( | |
15535 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
15536 if (json == null) { | |
15537 json = {}; | |
15538 } | |
15539 if (json is Map) { | |
15540 RequestErrorCode code; | |
15541 if (json.containsKey("code")) { | |
15542 code = new RequestErrorCode.fromJson( | |
15543 jsonDecoder, jsonPath + ".code", json["code"]); | |
15544 } else { | |
15545 throw jsonDecoder.missingKey(jsonPath, "code"); | |
15546 } | |
15547 String message; | |
15548 if (json.containsKey("message")) { | |
15549 message = | |
15550 jsonDecoder.decodeString(jsonPath + ".message", json["message"]); | |
15551 } else { | |
15552 throw jsonDecoder.missingKey(jsonPath, "message"); | |
15553 } | |
15554 String stackTrace; | |
15555 if (json.containsKey("stackTrace")) { | |
15556 stackTrace = jsonDecoder.decodeString( | |
15557 jsonPath + ".stackTrace", json["stackTrace"]); | |
15558 } | |
15559 return new RequestError(code, message, stackTrace: stackTrace); | |
15560 } else { | |
15561 throw jsonDecoder.mismatch(jsonPath, "RequestError", json); | |
15562 } | |
15563 } | |
15564 | |
15565 Map<String, dynamic> toJson() { | |
15566 Map<String, dynamic> result = {}; | |
15567 result["code"] = code.toJson(); | |
15568 result["message"] = message; | |
15569 if (stackTrace != null) { | |
15570 result["stackTrace"] = stackTrace; | |
15571 } | |
15572 return result; | |
15573 } | |
15574 | |
15575 @override | |
15576 String toString() => JSON.encode(toJson()); | |
15577 | |
15578 @override | |
15579 bool operator ==(other) { | |
15580 if (other is RequestError) { | |
15581 return code == other.code && | |
15582 message == other.message && | |
15583 stackTrace == other.stackTrace; | |
15584 } | |
15585 return false; | |
15586 } | |
15587 | |
15588 @override | |
15589 int get hashCode { | |
15590 int hash = 0; | |
15591 hash = JenkinsSmiHash.combine(hash, code.hashCode); | |
15592 hash = JenkinsSmiHash.combine(hash, message.hashCode); | |
15593 hash = JenkinsSmiHash.combine(hash, stackTrace.hashCode); | |
15594 return JenkinsSmiHash.finish(hash); | |
15595 } | |
15596 } | |
15597 | |
15598 /** | |
15599 * RequestErrorCode | |
15600 * | |
15601 * enum { | |
15602 * CONTENT_MODIFIED | |
15603 * DEBUG_PORT_COULD_NOT_BE_OPENED | |
15604 * FILE_NOT_ANALYZED | |
15605 * FORMAT_INVALID_FILE | |
15606 * FORMAT_WITH_ERRORS | |
15607 * GET_ERRORS_INVALID_FILE | |
15608 * GET_NAVIGATION_INVALID_FILE | |
15609 * GET_REACHABLE_SOURCES_INVALID_FILE | |
15610 * INVALID_ANALYSIS_ROOT | |
15611 * INVALID_EXECUTION_CONTEXT | |
15612 * INVALID_FILE_PATH_FORMAT | |
15613 * INVALID_OVERLAY_CHANGE | |
15614 * INVALID_PARAMETER | |
15615 * INVALID_REQUEST | |
15616 * NO_INDEX_GENERATED | |
15617 * ORGANIZE_DIRECTIVES_ERROR | |
15618 * REFACTORING_REQUEST_CANCELLED | |
15619 * SERVER_ALREADY_STARTED | |
15620 * SERVER_ERROR | |
15621 * SORT_MEMBERS_INVALID_FILE | |
15622 * SORT_MEMBERS_PARSE_ERRORS | |
15623 * UNANALYZED_PRIORITY_FILES | |
15624 * UNKNOWN_REQUEST | |
15625 * UNKNOWN_SOURCE | |
15626 * UNSUPPORTED_FEATURE | |
15627 * } | |
15628 * | |
15629 * Clients may not extend, implement or mix-in this class. | |
15630 */ | |
15631 class RequestErrorCode implements Enum { | |
15632 /** | |
15633 * An "analysis.getErrors" or "analysis.getNavigation" request could not be | |
15634 * satisfied because the content of the file changed before the requested | |
15635 * results could be computed. | |
15636 */ | |
15637 static const RequestErrorCode CONTENT_MODIFIED = | |
15638 const RequestErrorCode._("CONTENT_MODIFIED"); | |
15639 | |
15640 /** | |
15641 * The server was unable to open a port for the diagnostic server. | |
15642 */ | |
15643 static const RequestErrorCode DEBUG_PORT_COULD_NOT_BE_OPENED = | |
15644 const RequestErrorCode._("DEBUG_PORT_COULD_NOT_BE_OPENED"); | |
15645 | |
15646 /** | |
15647 * A request specified a FilePath which does not match a file in an analysis | |
15648 * root, or the requested operation is not available for the file. | |
15649 */ | |
15650 static const RequestErrorCode FILE_NOT_ANALYZED = | |
15651 const RequestErrorCode._("FILE_NOT_ANALYZED"); | |
15652 | |
15653 /** | |
15654 * An "edit.format" request specified a FilePath which does not match a Dart | |
15655 * file in an analysis root. | |
15656 */ | |
15657 static const RequestErrorCode FORMAT_INVALID_FILE = | |
15658 const RequestErrorCode._("FORMAT_INVALID_FILE"); | |
15659 | |
15660 /** | |
15661 * An "edit.format" request specified a file that contains syntax errors. | |
15662 */ | |
15663 static const RequestErrorCode FORMAT_WITH_ERRORS = | |
15664 const RequestErrorCode._("FORMAT_WITH_ERRORS"); | |
15665 | |
15666 /** | |
15667 * An "analysis.getErrors" request specified a FilePath which does not match | |
15668 * a file currently subject to analysis. | |
15669 */ | |
15670 static const RequestErrorCode GET_ERRORS_INVALID_FILE = | |
15671 const RequestErrorCode._("GET_ERRORS_INVALID_FILE"); | |
15672 | |
15673 /** | |
15674 * An "analysis.getNavigation" request specified a FilePath which does not | |
15675 * match a file currently subject to analysis. | |
15676 */ | |
15677 static const RequestErrorCode GET_NAVIGATION_INVALID_FILE = | |
15678 const RequestErrorCode._("GET_NAVIGATION_INVALID_FILE"); | |
15679 | |
15680 /** | |
15681 * An "analysis.getReachableSources" request specified a FilePath which does | |
15682 * not match a file currently subject to analysis. | |
15683 */ | |
15684 static const RequestErrorCode GET_REACHABLE_SOURCES_INVALID_FILE = | |
15685 const RequestErrorCode._("GET_REACHABLE_SOURCES_INVALID_FILE"); | |
15686 | |
15687 /** | |
15688 * A path passed as an argument to a request (such as analysis.reanalyze) is | |
15689 * required to be an analysis root, but isn't. | |
15690 */ | |
15691 static const RequestErrorCode INVALID_ANALYSIS_ROOT = | |
15692 const RequestErrorCode._("INVALID_ANALYSIS_ROOT"); | |
15693 | |
15694 /** | |
15695 * The context root used to create an execution context does not exist. | |
15696 */ | |
15697 static const RequestErrorCode INVALID_EXECUTION_CONTEXT = | |
15698 const RequestErrorCode._("INVALID_EXECUTION_CONTEXT"); | |
15699 | |
15700 /** | |
15701 * The format of the given file path is invalid, e.g. is not absolute and | |
15702 * normalized. | |
15703 */ | |
15704 static const RequestErrorCode INVALID_FILE_PATH_FORMAT = | |
15705 const RequestErrorCode._("INVALID_FILE_PATH_FORMAT"); | |
15706 | |
15707 /** | |
15708 * An "analysis.updateContent" request contained a ChangeContentOverlay | |
15709 * object which can't be applied, due to an edit having an offset or length | |
15710 * that is out of range. | |
15711 */ | |
15712 static const RequestErrorCode INVALID_OVERLAY_CHANGE = | |
15713 const RequestErrorCode._("INVALID_OVERLAY_CHANGE"); | |
15714 | |
15715 /** | |
15716 * One of the method parameters was invalid. | |
15717 */ | |
15718 static const RequestErrorCode INVALID_PARAMETER = | |
15719 const RequestErrorCode._("INVALID_PARAMETER"); | |
15720 | |
15721 /** | |
15722 * A malformed request was received. | |
15723 */ | |
15724 static const RequestErrorCode INVALID_REQUEST = | |
15725 const RequestErrorCode._("INVALID_REQUEST"); | |
15726 | |
15727 /** | |
15728 * The "--no-index" flag was passed when the analysis server created, but | |
15729 * this API call requires an index to have been generated. | |
15730 */ | |
15731 static const RequestErrorCode NO_INDEX_GENERATED = | |
15732 const RequestErrorCode._("NO_INDEX_GENERATED"); | |
15733 | |
15734 /** | |
15735 * An "edit.organizeDirectives" request specified a Dart file that cannot be | |
15736 * analyzed. The reason is described in the message. | |
15737 */ | |
15738 static const RequestErrorCode ORGANIZE_DIRECTIVES_ERROR = | |
15739 const RequestErrorCode._("ORGANIZE_DIRECTIVES_ERROR"); | |
15740 | |
15741 /** | |
15742 * Another refactoring request was received during processing of this one. | |
15743 */ | |
15744 static const RequestErrorCode REFACTORING_REQUEST_CANCELLED = | |
15745 const RequestErrorCode._("REFACTORING_REQUEST_CANCELLED"); | |
15746 | |
15747 /** | |
15748 * The analysis server has already been started (and hence won't accept new | |
15749 * connections). | |
15750 * | |
15751 * This error is included for future expansion; at present the analysis | |
15752 * server can only speak to one client at a time so this error will never | |
15753 * occur. | |
15754 */ | |
15755 static const RequestErrorCode SERVER_ALREADY_STARTED = | |
15756 const RequestErrorCode._("SERVER_ALREADY_STARTED"); | |
15757 | |
15758 /** | |
15759 * An internal error occurred in the analysis server. Also see the | |
15760 * server.error notification. | |
15761 */ | |
15762 static const RequestErrorCode SERVER_ERROR = | |
15763 const RequestErrorCode._("SERVER_ERROR"); | |
15764 | |
15765 /** | |
15766 * An "edit.sortMembers" request specified a FilePath which does not match a | |
15767 * Dart file in an analysis root. | |
15768 */ | |
15769 static const RequestErrorCode SORT_MEMBERS_INVALID_FILE = | |
15770 const RequestErrorCode._("SORT_MEMBERS_INVALID_FILE"); | |
15771 | |
15772 /** | |
15773 * An "edit.sortMembers" request specified a Dart file that has scan or parse | |
15774 * errors. | |
15775 */ | |
15776 static const RequestErrorCode SORT_MEMBERS_PARSE_ERRORS = | |
15777 const RequestErrorCode._("SORT_MEMBERS_PARSE_ERRORS"); | |
15778 | |
15779 /** | |
15780 * An "analysis.setPriorityFiles" request includes one or more files that are | |
15781 * not being analyzed. | |
15782 * | |
15783 * This is a legacy error; it will be removed before the API reaches version | |
15784 * 1.0. | |
15785 */ | |
15786 static const RequestErrorCode UNANALYZED_PRIORITY_FILES = | |
15787 const RequestErrorCode._("UNANALYZED_PRIORITY_FILES"); | |
15788 | |
15789 /** | |
15790 * A request was received which the analysis server does not recognize, or | |
15791 * cannot handle in its current configuration. | |
15792 */ | |
15793 static const RequestErrorCode UNKNOWN_REQUEST = | |
15794 const RequestErrorCode._("UNKNOWN_REQUEST"); | |
15795 | |
15796 /** | |
15797 * The analysis server was requested to perform an action on a source that | |
15798 * does not exist. | |
15799 */ | |
15800 static const RequestErrorCode UNKNOWN_SOURCE = | |
15801 const RequestErrorCode._("UNKNOWN_SOURCE"); | |
15802 | |
15803 /** | |
15804 * The analysis server was requested to perform an action which is not | |
15805 * supported. | |
15806 * | |
15807 * This is a legacy error; it will be removed before the API reaches version | |
15808 * 1.0. | |
15809 */ | |
15810 static const RequestErrorCode UNSUPPORTED_FEATURE = | |
15811 const RequestErrorCode._("UNSUPPORTED_FEATURE"); | |
15812 | |
15813 /** | |
15814 * A list containing all of the enum values that are defined. | |
15815 */ | |
15816 static const List<RequestErrorCode> VALUES = const <RequestErrorCode>[ | |
15817 CONTENT_MODIFIED, | |
15818 DEBUG_PORT_COULD_NOT_BE_OPENED, | |
15819 FILE_NOT_ANALYZED, | |
15820 FORMAT_INVALID_FILE, | |
15821 FORMAT_WITH_ERRORS, | |
15822 GET_ERRORS_INVALID_FILE, | |
15823 GET_NAVIGATION_INVALID_FILE, | |
15824 GET_REACHABLE_SOURCES_INVALID_FILE, | |
15825 INVALID_ANALYSIS_ROOT, | |
15826 INVALID_EXECUTION_CONTEXT, | |
15827 INVALID_FILE_PATH_FORMAT, | |
15828 INVALID_OVERLAY_CHANGE, | |
15829 INVALID_PARAMETER, | |
15830 INVALID_REQUEST, | |
15831 NO_INDEX_GENERATED, | |
15832 ORGANIZE_DIRECTIVES_ERROR, | |
15833 REFACTORING_REQUEST_CANCELLED, | |
15834 SERVER_ALREADY_STARTED, | |
15835 SERVER_ERROR, | |
15836 SORT_MEMBERS_INVALID_FILE, | |
15837 SORT_MEMBERS_PARSE_ERRORS, | |
15838 UNANALYZED_PRIORITY_FILES, | |
15839 UNKNOWN_REQUEST, | |
15840 UNKNOWN_SOURCE, | |
15841 UNSUPPORTED_FEATURE | |
15842 ]; | |
15843 | |
15844 final String name; | |
15845 | |
15846 const RequestErrorCode._(this.name); | |
15847 | |
15848 factory RequestErrorCode(String name) { | |
15849 switch (name) { | |
15850 case "CONTENT_MODIFIED": | |
15851 return CONTENT_MODIFIED; | |
15852 case "DEBUG_PORT_COULD_NOT_BE_OPENED": | |
15853 return DEBUG_PORT_COULD_NOT_BE_OPENED; | |
15854 case "FILE_NOT_ANALYZED": | |
15855 return FILE_NOT_ANALYZED; | |
15856 case "FORMAT_INVALID_FILE": | |
15857 return FORMAT_INVALID_FILE; | |
15858 case "FORMAT_WITH_ERRORS": | |
15859 return FORMAT_WITH_ERRORS; | |
15860 case "GET_ERRORS_INVALID_FILE": | |
15861 return GET_ERRORS_INVALID_FILE; | |
15862 case "GET_NAVIGATION_INVALID_FILE": | |
15863 return GET_NAVIGATION_INVALID_FILE; | |
15864 case "GET_REACHABLE_SOURCES_INVALID_FILE": | |
15865 return GET_REACHABLE_SOURCES_INVALID_FILE; | |
15866 case "INVALID_ANALYSIS_ROOT": | |
15867 return INVALID_ANALYSIS_ROOT; | |
15868 case "INVALID_EXECUTION_CONTEXT": | |
15869 return INVALID_EXECUTION_CONTEXT; | |
15870 case "INVALID_FILE_PATH_FORMAT": | |
15871 return INVALID_FILE_PATH_FORMAT; | |
15872 case "INVALID_OVERLAY_CHANGE": | |
15873 return INVALID_OVERLAY_CHANGE; | |
15874 case "INVALID_PARAMETER": | |
15875 return INVALID_PARAMETER; | |
15876 case "INVALID_REQUEST": | |
15877 return INVALID_REQUEST; | |
15878 case "NO_INDEX_GENERATED": | |
15879 return NO_INDEX_GENERATED; | |
15880 case "ORGANIZE_DIRECTIVES_ERROR": | |
15881 return ORGANIZE_DIRECTIVES_ERROR; | |
15882 case "REFACTORING_REQUEST_CANCELLED": | |
15883 return REFACTORING_REQUEST_CANCELLED; | |
15884 case "SERVER_ALREADY_STARTED": | |
15885 return SERVER_ALREADY_STARTED; | |
15886 case "SERVER_ERROR": | |
15887 return SERVER_ERROR; | |
15888 case "SORT_MEMBERS_INVALID_FILE": | |
15889 return SORT_MEMBERS_INVALID_FILE; | |
15890 case "SORT_MEMBERS_PARSE_ERRORS": | |
15891 return SORT_MEMBERS_PARSE_ERRORS; | |
15892 case "UNANALYZED_PRIORITY_FILES": | |
15893 return UNANALYZED_PRIORITY_FILES; | |
15894 case "UNKNOWN_REQUEST": | |
15895 return UNKNOWN_REQUEST; | |
15896 case "UNKNOWN_SOURCE": | |
15897 return UNKNOWN_SOURCE; | |
15898 case "UNSUPPORTED_FEATURE": | |
15899 return UNSUPPORTED_FEATURE; | |
15900 } | |
15901 throw new Exception('Illegal enum value: $name'); | |
15902 } | |
15903 | |
15904 factory RequestErrorCode.fromJson( | |
15905 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
15906 if (json is String) { | |
15907 try { | |
15908 return new RequestErrorCode(json); | |
15909 } catch (_) { | |
15910 // Fall through | |
15911 } | |
15912 } | |
15913 throw jsonDecoder.mismatch(jsonPath, "RequestErrorCode", json); | |
15914 } | |
15915 | |
15916 @override | |
15917 String toString() => "RequestErrorCode.$name"; | |
15918 | |
15919 String toJson() => name; | |
15920 } | |
15921 | |
15922 /** | |
15923 * SearchResult | |
15924 * | |
15925 * { | |
15926 * "location": Location | |
15927 * "kind": SearchResultKind | |
15928 * "isPotential": bool | |
15929 * "path": List<Element> | |
15930 * } | |
15931 * | |
15932 * Clients may not extend, implement or mix-in this class. | |
15933 */ | |
15934 class SearchResult implements HasToJson { | |
15935 Location _location; | |
15936 | |
15937 SearchResultKind _kind; | |
15938 | |
15939 bool _isPotential; | |
15940 | |
15941 List<Element> _path; | |
15942 | |
15943 /** | |
15944 * The location of the code that matched the search criteria. | |
15945 */ | |
15946 Location get location => _location; | |
15947 | |
15948 /** | |
15949 * The location of the code that matched the search criteria. | |
15950 */ | |
15951 void set location(Location value) { | |
15952 assert(value != null); | |
15953 this._location = value; | |
15954 } | |
15955 | |
15956 /** | |
15957 * The kind of element that was found or the kind of reference that was | |
15958 * found. | |
15959 */ | |
15960 SearchResultKind get kind => _kind; | |
15961 | |
15962 /** | |
15963 * The kind of element that was found or the kind of reference that was | |
15964 * found. | |
15965 */ | |
15966 void set kind(SearchResultKind value) { | |
15967 assert(value != null); | |
15968 this._kind = value; | |
15969 } | |
15970 | |
15971 /** | |
15972 * True if the result is a potential match but cannot be confirmed to be a | |
15973 * match. For example, if all references to a method m defined in some class | |
15974 * were requested, and a reference to a method m from an unknown class were | |
15975 * found, it would be marked as being a potential match. | |
15976 */ | |
15977 bool get isPotential => _isPotential; | |
15978 | |
15979 /** | |
15980 * True if the result is a potential match but cannot be confirmed to be a | |
15981 * match. For example, if all references to a method m defined in some class | |
15982 * were requested, and a reference to a method m from an unknown class were | |
15983 * found, it would be marked as being a potential match. | |
15984 */ | |
15985 void set isPotential(bool value) { | |
15986 assert(value != null); | |
15987 this._isPotential = value; | |
15988 } | |
15989 | |
15990 /** | |
15991 * The elements that contain the result, starting with the most immediately | |
15992 * enclosing ancestor and ending with the library. | |
15993 */ | |
15994 List<Element> get path => _path; | |
15995 | |
15996 /** | |
15997 * The elements that contain the result, starting with the most immediately | |
15998 * enclosing ancestor and ending with the library. | |
15999 */ | |
16000 void set path(List<Element> value) { | |
16001 assert(value != null); | |
16002 this._path = value; | |
16003 } | |
16004 | |
16005 SearchResult(Location location, SearchResultKind kind, bool isPotential, | |
16006 List<Element> path) { | |
16007 this.location = location; | |
16008 this.kind = kind; | |
16009 this.isPotential = isPotential; | |
16010 this.path = path; | |
16011 } | |
16012 | |
16013 factory SearchResult.fromJson( | |
16014 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
16015 if (json == null) { | |
16016 json = {}; | |
16017 } | |
16018 if (json is Map) { | |
16019 Location location; | |
16020 if (json.containsKey("location")) { | |
16021 location = new Location.fromJson( | |
16022 jsonDecoder, jsonPath + ".location", json["location"]); | |
16023 } else { | |
16024 throw jsonDecoder.missingKey(jsonPath, "location"); | |
16025 } | |
16026 SearchResultKind kind; | |
16027 if (json.containsKey("kind")) { | |
16028 kind = new SearchResultKind.fromJson( | |
16029 jsonDecoder, jsonPath + ".kind", json["kind"]); | |
16030 } else { | |
16031 throw jsonDecoder.missingKey(jsonPath, "kind"); | |
16032 } | |
16033 bool isPotential; | |
16034 if (json.containsKey("isPotential")) { | |
16035 isPotential = jsonDecoder.decodeBool( | |
16036 jsonPath + ".isPotential", json["isPotential"]); | |
16037 } else { | |
16038 throw jsonDecoder.missingKey(jsonPath, "isPotential"); | |
16039 } | |
16040 List<Element> path; | |
16041 if (json.containsKey("path")) { | |
16042 path = jsonDecoder.decodeList( | |
16043 jsonPath + ".path", | |
16044 json["path"], | |
16045 (String jsonPath, Object json) => | |
16046 new Element.fromJson(jsonDecoder, jsonPath, json)); | |
16047 } else { | |
16048 throw jsonDecoder.missingKey(jsonPath, "path"); | |
16049 } | |
16050 return new SearchResult(location, kind, isPotential, path); | |
16051 } else { | |
16052 throw jsonDecoder.mismatch(jsonPath, "SearchResult", json); | |
16053 } | |
16054 } | |
16055 | |
16056 Map<String, dynamic> toJson() { | |
16057 Map<String, dynamic> result = {}; | |
16058 result["location"] = location.toJson(); | |
16059 result["kind"] = kind.toJson(); | |
16060 result["isPotential"] = isPotential; | |
16061 result["path"] = path.map((Element value) => value.toJson()).toList(); | |
16062 return result; | |
16063 } | |
16064 | |
16065 @override | |
16066 String toString() => JSON.encode(toJson()); | |
16067 | |
16068 @override | |
16069 bool operator ==(other) { | |
16070 if (other is SearchResult) { | |
16071 return location == other.location && | |
16072 kind == other.kind && | |
16073 isPotential == other.isPotential && | |
16074 listEqual(path, other.path, (Element a, Element b) => a == b); | |
16075 } | |
16076 return false; | |
16077 } | |
16078 | |
16079 @override | |
16080 int get hashCode { | |
16081 int hash = 0; | |
16082 hash = JenkinsSmiHash.combine(hash, location.hashCode); | |
16083 hash = JenkinsSmiHash.combine(hash, kind.hashCode); | |
16084 hash = JenkinsSmiHash.combine(hash, isPotential.hashCode); | |
16085 hash = JenkinsSmiHash.combine(hash, path.hashCode); | |
16086 return JenkinsSmiHash.finish(hash); | |
16087 } | |
16088 } | |
16089 | |
16090 /** | |
16091 * SearchResultKind | |
16092 * | |
16093 * enum { | |
16094 * DECLARATION | |
16095 * INVOCATION | |
16096 * READ | |
16097 * READ_WRITE | |
16098 * REFERENCE | |
16099 * UNKNOWN | |
16100 * WRITE | |
16101 * } | |
16102 * | |
16103 * Clients may not extend, implement or mix-in this class. | |
16104 */ | |
16105 class SearchResultKind implements Enum { | |
16106 /** | |
16107 * The declaration of an element. | |
16108 */ | |
16109 static const SearchResultKind DECLARATION = | |
16110 const SearchResultKind._("DECLARATION"); | |
16111 | |
16112 /** | |
16113 * The invocation of a function or method. | |
16114 */ | |
16115 static const SearchResultKind INVOCATION = | |
16116 const SearchResultKind._("INVOCATION"); | |
16117 | |
16118 /** | |
16119 * A reference to a field, parameter or variable where it is being read. | |
16120 */ | |
16121 static const SearchResultKind READ = const SearchResultKind._("READ"); | |
16122 | |
16123 /** | |
16124 * A reference to a field, parameter or variable where it is being read and | |
16125 * written. | |
16126 */ | |
16127 static const SearchResultKind READ_WRITE = | |
16128 const SearchResultKind._("READ_WRITE"); | |
16129 | |
16130 /** | |
16131 * A reference to an element. | |
16132 */ | |
16133 static const SearchResultKind REFERENCE = | |
16134 const SearchResultKind._("REFERENCE"); | |
16135 | |
16136 /** | |
16137 * Some other kind of search result. | |
16138 */ | |
16139 static const SearchResultKind UNKNOWN = const SearchResultKind._("UNKNOWN"); | |
16140 | |
16141 /** | |
16142 * A reference to a field, parameter or variable where it is being written. | |
16143 */ | |
16144 static const SearchResultKind WRITE = const SearchResultKind._("WRITE"); | |
16145 | |
16146 /** | |
16147 * A list containing all of the enum values that are defined. | |
16148 */ | |
16149 static const List<SearchResultKind> VALUES = const <SearchResultKind>[ | |
16150 DECLARATION, | |
16151 INVOCATION, | |
16152 READ, | |
16153 READ_WRITE, | |
16154 REFERENCE, | |
16155 UNKNOWN, | |
16156 WRITE | |
16157 ]; | |
16158 | |
16159 final String name; | |
16160 | |
16161 const SearchResultKind._(this.name); | |
16162 | |
16163 factory SearchResultKind(String name) { | |
16164 switch (name) { | |
16165 case "DECLARATION": | |
16166 return DECLARATION; | |
16167 case "INVOCATION": | |
16168 return INVOCATION; | |
16169 case "READ": | |
16170 return READ; | |
16171 case "READ_WRITE": | |
16172 return READ_WRITE; | |
16173 case "REFERENCE": | |
16174 return REFERENCE; | |
16175 case "UNKNOWN": | |
16176 return UNKNOWN; | |
16177 case "WRITE": | |
16178 return WRITE; | |
16179 } | |
16180 throw new Exception('Illegal enum value: $name'); | |
16181 } | |
16182 | |
16183 factory SearchResultKind.fromJson( | |
16184 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
16185 if (json is String) { | |
16186 try { | |
16187 return new SearchResultKind(json); | |
16188 } catch (_) { | |
16189 // Fall through | |
16190 } | |
16191 } | |
16192 throw jsonDecoder.mismatch(jsonPath, "SearchResultKind", json); | |
16193 } | |
16194 | |
16195 @override | |
16196 String toString() => "SearchResultKind.$name"; | |
16197 | |
16198 String toJson() => name; | |
16199 } | |
16200 | |
16201 /** | |
16202 * ServerService | |
16203 * | |
16204 * enum { | |
16205 * STATUS | |
16206 * } | |
16207 * | |
16208 * Clients may not extend, implement or mix-in this class. | |
16209 */ | |
16210 class ServerService implements Enum { | |
16211 static const ServerService STATUS = const ServerService._("STATUS"); | |
16212 | |
16213 /** | |
16214 * A list containing all of the enum values that are defined. | |
16215 */ | |
16216 static const List<ServerService> VALUES = const <ServerService>[STATUS]; | |
16217 | |
16218 final String name; | |
16219 | |
16220 const ServerService._(this.name); | |
16221 | |
16222 factory ServerService(String name) { | |
16223 switch (name) { | |
16224 case "STATUS": | |
16225 return STATUS; | |
16226 } | |
16227 throw new Exception('Illegal enum value: $name'); | |
16228 } | |
16229 | |
16230 factory ServerService.fromJson( | |
16231 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
16232 if (json is String) { | |
16233 try { | |
16234 return new ServerService(json); | |
16235 } catch (_) { | |
16236 // Fall through | |
16237 } | |
16238 } | |
16239 throw jsonDecoder.mismatch(jsonPath, "ServerService", json); | |
16240 } | |
16241 | |
16242 @override | |
16243 String toString() => "ServerService.$name"; | |
16244 | |
16245 String toJson() => name; | |
16246 } | |
16247 | |
16248 /** | |
16249 * SourceChange | |
16250 * | |
16251 * { | |
16252 * "message": String | |
16253 * "edits": List<SourceFileEdit> | |
16254 * "linkedEditGroups": List<LinkedEditGroup> | |
16255 * "selection": optional Position | |
16256 * } | |
16257 * | |
16258 * Clients may not extend, implement or mix-in this class. | |
16259 */ | |
16260 class SourceChange implements HasToJson { | |
16261 String _message; | |
16262 | |
16263 List<SourceFileEdit> _edits; | |
16264 | |
16265 List<LinkedEditGroup> _linkedEditGroups; | |
16266 | |
16267 Position _selection; | |
16268 | |
16269 /** | |
16270 * A human-readable description of the change to be applied. | |
16271 */ | |
16272 String get message => _message; | |
16273 | |
16274 /** | |
16275 * A human-readable description of the change to be applied. | |
16276 */ | |
16277 void set message(String value) { | |
16278 assert(value != null); | |
16279 this._message = value; | |
16280 } | |
16281 | |
16282 /** | |
16283 * A list of the edits used to effect the change, grouped by file. | |
16284 */ | |
16285 List<SourceFileEdit> get edits => _edits; | |
16286 | |
16287 /** | |
16288 * A list of the edits used to effect the change, grouped by file. | |
16289 */ | |
16290 void set edits(List<SourceFileEdit> value) { | |
16291 assert(value != null); | |
16292 this._edits = value; | |
16293 } | |
16294 | |
16295 /** | |
16296 * A list of the linked editing groups used to customize the changes that | |
16297 * were made. | |
16298 */ | |
16299 List<LinkedEditGroup> get linkedEditGroups => _linkedEditGroups; | |
16300 | |
16301 /** | |
16302 * A list of the linked editing groups used to customize the changes that | |
16303 * were made. | |
16304 */ | |
16305 void set linkedEditGroups(List<LinkedEditGroup> value) { | |
16306 assert(value != null); | |
16307 this._linkedEditGroups = value; | |
16308 } | |
16309 | |
16310 /** | |
16311 * The position that should be selected after the edits have been applied. | |
16312 */ | |
16313 Position get selection => _selection; | |
16314 | |
16315 /** | |
16316 * The position that should be selected after the edits have been applied. | |
16317 */ | |
16318 void set selection(Position value) { | |
16319 this._selection = value; | |
16320 } | |
16321 | |
16322 SourceChange(String message, | |
16323 {List<SourceFileEdit> edits, | |
16324 List<LinkedEditGroup> linkedEditGroups, | |
16325 Position selection}) { | |
16326 this.message = message; | |
16327 if (edits == null) { | |
16328 this.edits = <SourceFileEdit>[]; | |
16329 } else { | |
16330 this.edits = edits; | |
16331 } | |
16332 if (linkedEditGroups == null) { | |
16333 this.linkedEditGroups = <LinkedEditGroup>[]; | |
16334 } else { | |
16335 this.linkedEditGroups = linkedEditGroups; | |
16336 } | |
16337 this.selection = selection; | |
16338 } | |
16339 | |
16340 factory SourceChange.fromJson( | |
16341 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
16342 if (json == null) { | |
16343 json = {}; | |
16344 } | |
16345 if (json is Map) { | |
16346 String message; | |
16347 if (json.containsKey("message")) { | |
16348 message = | |
16349 jsonDecoder.decodeString(jsonPath + ".message", json["message"]); | |
16350 } else { | |
16351 throw jsonDecoder.missingKey(jsonPath, "message"); | |
16352 } | |
16353 List<SourceFileEdit> edits; | |
16354 if (json.containsKey("edits")) { | |
16355 edits = jsonDecoder.decodeList( | |
16356 jsonPath + ".edits", | |
16357 json["edits"], | |
16358 (String jsonPath, Object json) => | |
16359 new SourceFileEdit.fromJson(jsonDecoder, jsonPath, json)); | |
16360 } else { | |
16361 throw jsonDecoder.missingKey(jsonPath, "edits"); | |
16362 } | |
16363 List<LinkedEditGroup> linkedEditGroups; | |
16364 if (json.containsKey("linkedEditGroups")) { | |
16365 linkedEditGroups = jsonDecoder.decodeList( | |
16366 jsonPath + ".linkedEditGroups", | |
16367 json["linkedEditGroups"], | |
16368 (String jsonPath, Object json) => | |
16369 new LinkedEditGroup.fromJson(jsonDecoder, jsonPath, json)); | |
16370 } else { | |
16371 throw jsonDecoder.missingKey(jsonPath, "linkedEditGroups"); | |
16372 } | |
16373 Position selection; | |
16374 if (json.containsKey("selection")) { | |
16375 selection = new Position.fromJson( | |
16376 jsonDecoder, jsonPath + ".selection", json["selection"]); | |
16377 } | |
16378 return new SourceChange(message, | |
16379 edits: edits, | |
16380 linkedEditGroups: linkedEditGroups, | |
16381 selection: selection); | |
16382 } else { | |
16383 throw jsonDecoder.mismatch(jsonPath, "SourceChange", json); | |
16384 } | |
16385 } | |
16386 | |
16387 Map<String, dynamic> toJson() { | |
16388 Map<String, dynamic> result = {}; | |
16389 result["message"] = message; | |
16390 result["edits"] = | |
16391 edits.map((SourceFileEdit value) => value.toJson()).toList(); | |
16392 result["linkedEditGroups"] = linkedEditGroups | |
16393 .map((LinkedEditGroup value) => value.toJson()) | |
16394 .toList(); | |
16395 if (selection != null) { | |
16396 result["selection"] = selection.toJson(); | |
16397 } | |
16398 return result; | |
16399 } | |
16400 | |
16401 /** | |
16402 * Adds [edit] to the [FileEdit] for the given [file]. | |
16403 */ | |
16404 void addEdit(String file, int fileStamp, SourceEdit edit) => | |
16405 addEditToSourceChange(this, file, fileStamp, edit); | |
16406 | |
16407 /** | |
16408 * Adds the given [FileEdit]. | |
16409 */ | |
16410 void addFileEdit(SourceFileEdit edit) { | |
16411 edits.add(edit); | |
16412 } | |
16413 | |
16414 /** | |
16415 * Adds the given [LinkedEditGroup]. | |
16416 */ | |
16417 void addLinkedEditGroup(LinkedEditGroup linkedEditGroup) { | |
16418 linkedEditGroups.add(linkedEditGroup); | |
16419 } | |
16420 | |
16421 /** | |
16422 * Returns the [FileEdit] for the given [file], maybe `null`. | |
16423 */ | |
16424 SourceFileEdit getFileEdit(String file) => getChangeFileEdit(this, file); | |
16425 | |
16426 @override | |
16427 String toString() => JSON.encode(toJson()); | |
16428 | |
16429 @override | |
16430 bool operator ==(other) { | |
16431 if (other is SourceChange) { | |
16432 return message == other.message && | |
16433 listEqual(edits, other.edits, | |
16434 (SourceFileEdit a, SourceFileEdit b) => a == b) && | |
16435 listEqual(linkedEditGroups, other.linkedEditGroups, | |
16436 (LinkedEditGroup a, LinkedEditGroup b) => a == b) && | |
16437 selection == other.selection; | |
16438 } | |
16439 return false; | |
16440 } | |
16441 | |
16442 @override | |
16443 int get hashCode { | |
16444 int hash = 0; | |
16445 hash = JenkinsSmiHash.combine(hash, message.hashCode); | |
16446 hash = JenkinsSmiHash.combine(hash, edits.hashCode); | |
16447 hash = JenkinsSmiHash.combine(hash, linkedEditGroups.hashCode); | |
16448 hash = JenkinsSmiHash.combine(hash, selection.hashCode); | |
16449 return JenkinsSmiHash.finish(hash); | |
16450 } | |
16451 } | |
16452 | |
16453 /** | |
16454 * SourceEdit | |
16455 * | |
16456 * { | |
16457 * "offset": int | |
16458 * "length": int | |
16459 * "replacement": String | |
16460 * "id": optional String | |
16461 * } | |
16462 * | |
16463 * Clients may not extend, implement or mix-in this class. | |
16464 */ | |
16465 class SourceEdit implements HasToJson { | |
16466 /** | |
16467 * Get the result of applying a set of [edits] to the given [code]. Edits are | |
16468 * applied in the order they appear in [edits]. | |
16469 */ | |
16470 static String applySequence(String code, Iterable<SourceEdit> edits) => | |
16471 applySequenceOfEdits(code, edits); | |
16472 | |
16473 int _offset; | |
16474 | |
16475 int _length; | |
16476 | |
16477 String _replacement; | |
16478 | |
16479 String _id; | |
16480 | |
16481 /** | |
16482 * The offset of the region to be modified. | |
16483 */ | |
16484 int get offset => _offset; | |
16485 | |
16486 /** | |
16487 * The offset of the region to be modified. | |
16488 */ | |
16489 void set offset(int value) { | |
16490 assert(value != null); | |
16491 this._offset = value; | |
16492 } | |
16493 | |
16494 /** | |
16495 * The length of the region to be modified. | |
16496 */ | |
16497 int get length => _length; | |
16498 | |
16499 /** | |
16500 * The length of the region to be modified. | |
16501 */ | |
16502 void set length(int value) { | |
16503 assert(value != null); | |
16504 this._length = value; | |
16505 } | |
16506 | |
16507 /** | |
16508 * The code that is to replace the specified region in the original code. | |
16509 */ | |
16510 String get replacement => _replacement; | |
16511 | |
16512 /** | |
16513 * The code that is to replace the specified region in the original code. | |
16514 */ | |
16515 void set replacement(String value) { | |
16516 assert(value != null); | |
16517 this._replacement = value; | |
16518 } | |
16519 | |
16520 /** | |
16521 * An identifier that uniquely identifies this source edit from other edits | |
16522 * in the same response. This field is omitted unless a containing structure | |
16523 * needs to be able to identify the edit for some reason. | |
16524 * | |
16525 * For example, some refactoring operations can produce edits that might not | |
16526 * be appropriate (referred to as potential edits). Such edits will have an | |
16527 * id so that they can be referenced. Edits in the same response that do not | |
16528 * need to be referenced will not have an id. | |
16529 */ | |
16530 String get id => _id; | |
16531 | |
16532 /** | |
16533 * An identifier that uniquely identifies this source edit from other edits | |
16534 * in the same response. This field is omitted unless a containing structure | |
16535 * needs to be able to identify the edit for some reason. | |
16536 * | |
16537 * For example, some refactoring operations can produce edits that might not | |
16538 * be appropriate (referred to as potential edits). Such edits will have an | |
16539 * id so that they can be referenced. Edits in the same response that do not | |
16540 * need to be referenced will not have an id. | |
16541 */ | |
16542 void set id(String value) { | |
16543 this._id = value; | |
16544 } | |
16545 | |
16546 SourceEdit(int offset, int length, String replacement, {String id}) { | |
16547 this.offset = offset; | |
16548 this.length = length; | |
16549 this.replacement = replacement; | |
16550 this.id = id; | |
16551 } | |
16552 | |
16553 factory SourceEdit.fromJson( | |
16554 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
16555 if (json == null) { | |
16556 json = {}; | |
16557 } | |
16558 if (json is Map) { | |
16559 int offset; | |
16560 if (json.containsKey("offset")) { | |
16561 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
16562 } else { | |
16563 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
16564 } | |
16565 int length; | |
16566 if (json.containsKey("length")) { | |
16567 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
16568 } else { | |
16569 throw jsonDecoder.missingKey(jsonPath, "length"); | |
16570 } | |
16571 String replacement; | |
16572 if (json.containsKey("replacement")) { | |
16573 replacement = jsonDecoder.decodeString( | |
16574 jsonPath + ".replacement", json["replacement"]); | |
16575 } else { | |
16576 throw jsonDecoder.missingKey(jsonPath, "replacement"); | |
16577 } | |
16578 String id; | |
16579 if (json.containsKey("id")) { | |
16580 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); | |
16581 } | |
16582 return new SourceEdit(offset, length, replacement, id: id); | |
16583 } else { | |
16584 throw jsonDecoder.mismatch(jsonPath, "SourceEdit", json); | |
16585 } | |
16586 } | |
16587 | |
16588 /** | |
16589 * The end of the region to be modified. | |
16590 */ | |
16591 int get end => offset + length; | |
16592 | |
16593 Map<String, dynamic> toJson() { | |
16594 Map<String, dynamic> result = {}; | |
16595 result["offset"] = offset; | |
16596 result["length"] = length; | |
16597 result["replacement"] = replacement; | |
16598 if (id != null) { | |
16599 result["id"] = id; | |
16600 } | |
16601 return result; | |
16602 } | |
16603 | |
16604 /** | |
16605 * Get the result of applying the edit to the given [code]. | |
16606 */ | |
16607 String apply(String code) => applyEdit(code, this); | |
16608 | |
16609 @override | |
16610 String toString() => JSON.encode(toJson()); | |
16611 | |
16612 @override | |
16613 bool operator ==(other) { | |
16614 if (other is SourceEdit) { | |
16615 return offset == other.offset && | |
16616 length == other.length && | |
16617 replacement == other.replacement && | |
16618 id == other.id; | |
16619 } | |
16620 return false; | |
16621 } | |
16622 | |
16623 @override | |
16624 int get hashCode { | |
16625 int hash = 0; | |
16626 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
16627 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
16628 hash = JenkinsSmiHash.combine(hash, replacement.hashCode); | |
16629 hash = JenkinsSmiHash.combine(hash, id.hashCode); | |
16630 return JenkinsSmiHash.finish(hash); | |
16631 } | |
16632 } | |
16633 | |
16634 /** | |
16635 * SourceFileEdit | |
16636 * | |
16637 * { | |
16638 * "file": FilePath | |
16639 * "fileStamp": long | |
16640 * "edits": List<SourceEdit> | |
16641 * } | |
16642 * | |
16643 * Clients may not extend, implement or mix-in this class. | |
16644 */ | |
16645 class SourceFileEdit implements HasToJson { | |
16646 String _file; | |
16647 | |
16648 int _fileStamp; | |
16649 | |
16650 List<SourceEdit> _edits; | |
16651 | |
16652 /** | |
16653 * The file containing the code to be modified. | |
16654 */ | |
16655 String get file => _file; | |
16656 | |
16657 /** | |
16658 * The file containing the code to be modified. | |
16659 */ | |
16660 void set file(String value) { | |
16661 assert(value != null); | |
16662 this._file = value; | |
16663 } | |
16664 | |
16665 /** | |
16666 * The modification stamp of the file at the moment when the change was | |
16667 * created, in milliseconds since the "Unix epoch". Will be -1 if the file | |
16668 * did not exist and should be created. The client may use this field to make | |
16669 * sure that the file was not changed since then, so it is safe to apply the | |
16670 * change. | |
16671 */ | |
16672 int get fileStamp => _fileStamp; | |
16673 | |
16674 /** | |
16675 * The modification stamp of the file at the moment when the change was | |
16676 * created, in milliseconds since the "Unix epoch". Will be -1 if the file | |
16677 * did not exist and should be created. The client may use this field to make | |
16678 * sure that the file was not changed since then, so it is safe to apply the | |
16679 * change. | |
16680 */ | |
16681 void set fileStamp(int value) { | |
16682 assert(value != null); | |
16683 this._fileStamp = value; | |
16684 } | |
16685 | |
16686 /** | |
16687 * A list of the edits used to effect the change. | |
16688 */ | |
16689 List<SourceEdit> get edits => _edits; | |
16690 | |
16691 /** | |
16692 * A list of the edits used to effect the change. | |
16693 */ | |
16694 void set edits(List<SourceEdit> value) { | |
16695 assert(value != null); | |
16696 this._edits = value; | |
16697 } | |
16698 | |
16699 SourceFileEdit(String file, int fileStamp, {List<SourceEdit> edits}) { | |
16700 this.file = file; | |
16701 this.fileStamp = fileStamp; | |
16702 if (edits == null) { | |
16703 this.edits = <SourceEdit>[]; | |
16704 } else { | |
16705 this.edits = edits; | |
16706 } | |
16707 } | |
16708 | |
16709 factory SourceFileEdit.fromJson( | |
16710 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
16711 if (json == null) { | |
16712 json = {}; | |
16713 } | |
16714 if (json is Map) { | |
16715 String file; | |
16716 if (json.containsKey("file")) { | |
16717 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
16718 } else { | |
16719 throw jsonDecoder.missingKey(jsonPath, "file"); | |
16720 } | |
16721 int fileStamp; | |
16722 if (json.containsKey("fileStamp")) { | |
16723 fileStamp = | |
16724 jsonDecoder.decodeInt(jsonPath + ".fileStamp", json["fileStamp"]); | |
16725 } else { | |
16726 throw jsonDecoder.missingKey(jsonPath, "fileStamp"); | |
16727 } | |
16728 List<SourceEdit> edits; | |
16729 if (json.containsKey("edits")) { | |
16730 edits = jsonDecoder.decodeList( | |
16731 jsonPath + ".edits", | |
16732 json["edits"], | |
16733 (String jsonPath, Object json) => | |
16734 new SourceEdit.fromJson(jsonDecoder, jsonPath, json)); | |
16735 } else { | |
16736 throw jsonDecoder.missingKey(jsonPath, "edits"); | |
16737 } | |
16738 return new SourceFileEdit(file, fileStamp, edits: edits); | |
16739 } else { | |
16740 throw jsonDecoder.mismatch(jsonPath, "SourceFileEdit", json); | |
16741 } | |
16742 } | |
16743 | |
16744 Map<String, dynamic> toJson() { | |
16745 Map<String, dynamic> result = {}; | |
16746 result["file"] = file; | |
16747 result["fileStamp"] = fileStamp; | |
16748 result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList(); | |
16749 return result; | |
16750 } | |
16751 | |
16752 /** | |
16753 * Adds the given [Edit] to the list. | |
16754 */ | |
16755 void add(SourceEdit edit) => addEditForSource(this, edit); | |
16756 | |
16757 /** | |
16758 * Adds the given [Edit]s. | |
16759 */ | |
16760 void addAll(Iterable<SourceEdit> edits) => addAllEditsForSource(this, edits); | |
16761 | |
16762 @override | |
16763 String toString() => JSON.encode(toJson()); | |
16764 | |
16765 @override | |
16766 bool operator ==(other) { | |
16767 if (other is SourceFileEdit) { | |
16768 return file == other.file && | |
16769 fileStamp == other.fileStamp && | |
16770 listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a == b); | |
16771 } | |
16772 return false; | |
16773 } | |
16774 | |
16775 @override | |
16776 int get hashCode { | |
16777 int hash = 0; | |
16778 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
16779 hash = JenkinsSmiHash.combine(hash, fileStamp.hashCode); | |
16780 hash = JenkinsSmiHash.combine(hash, edits.hashCode); | |
16781 return JenkinsSmiHash.finish(hash); | |
16782 } | |
16783 } | |
16784 | |
16785 /** | |
16786 * TypeHierarchyItem | |
16787 * | |
16788 * { | |
16789 * "classElement": Element | |
16790 * "displayName": optional String | |
16791 * "memberElement": optional Element | |
16792 * "superclass": optional int | |
16793 * "interfaces": List<int> | |
16794 * "mixins": List<int> | |
16795 * "subclasses": List<int> | |
16796 * } | |
16797 * | |
16798 * Clients may not extend, implement or mix-in this class. | |
16799 */ | |
16800 class TypeHierarchyItem implements HasToJson { | |
16801 Element _classElement; | |
16802 | |
16803 String _displayName; | |
16804 | |
16805 Element _memberElement; | |
16806 | |
16807 int _superclass; | |
16808 | |
16809 List<int> _interfaces; | |
16810 | |
16811 List<int> _mixins; | |
16812 | |
16813 List<int> _subclasses; | |
16814 | |
16815 /** | |
16816 * The class element represented by this item. | |
16817 */ | |
16818 Element get classElement => _classElement; | |
16819 | |
16820 /** | |
16821 * The class element represented by this item. | |
16822 */ | |
16823 void set classElement(Element value) { | |
16824 assert(value != null); | |
16825 this._classElement = value; | |
16826 } | |
16827 | |
16828 /** | |
16829 * The name to be displayed for the class. This field will be omitted if the | |
16830 * display name is the same as the name of the element. The display name is | |
16831 * different if there is additional type information to be displayed, such as | |
16832 * type arguments. | |
16833 */ | |
16834 String get displayName => _displayName; | |
16835 | |
16836 /** | |
16837 * The name to be displayed for the class. This field will be omitted if the | |
16838 * display name is the same as the name of the element. The display name is | |
16839 * different if there is additional type information to be displayed, such as | |
16840 * type arguments. | |
16841 */ | |
16842 void set displayName(String value) { | |
16843 this._displayName = value; | |
16844 } | |
16845 | |
16846 /** | |
16847 * The member in the class corresponding to the member on which the hierarchy | |
16848 * was requested. This field will be omitted if the hierarchy was not | |
16849 * requested for a member or if the class does not have a corresponding | |
16850 * member. | |
16851 */ | |
16852 Element get memberElement => _memberElement; | |
16853 | |
16854 /** | |
16855 * The member in the class corresponding to the member on which the hierarchy | |
16856 * was requested. This field will be omitted if the hierarchy was not | |
16857 * requested for a member or if the class does not have a corresponding | |
16858 * member. | |
16859 */ | |
16860 void set memberElement(Element value) { | |
16861 this._memberElement = value; | |
16862 } | |
16863 | |
16864 /** | |
16865 * The index of the item representing the superclass of this class. This | |
16866 * field will be omitted if this item represents the class Object. | |
16867 */ | |
16868 int get superclass => _superclass; | |
16869 | |
16870 /** | |
16871 * The index of the item representing the superclass of this class. This | |
16872 * field will be omitted if this item represents the class Object. | |
16873 */ | |
16874 void set superclass(int value) { | |
16875 this._superclass = value; | |
16876 } | |
16877 | |
16878 /** | |
16879 * The indexes of the items representing the interfaces implemented by this | |
16880 * class. The list will be empty if there are no implemented interfaces. | |
16881 */ | |
16882 List<int> get interfaces => _interfaces; | |
16883 | |
16884 /** | |
16885 * The indexes of the items representing the interfaces implemented by this | |
16886 * class. The list will be empty if there are no implemented interfaces. | |
16887 */ | |
16888 void set interfaces(List<int> value) { | |
16889 assert(value != null); | |
16890 this._interfaces = value; | |
16891 } | |
16892 | |
16893 /** | |
16894 * The indexes of the items representing the mixins referenced by this class. | |
16895 * The list will be empty if there are no classes mixed in to this class. | |
16896 */ | |
16897 List<int> get mixins => _mixins; | |
16898 | |
16899 /** | |
16900 * The indexes of the items representing the mixins referenced by this class. | |
16901 * The list will be empty if there are no classes mixed in to this class. | |
16902 */ | |
16903 void set mixins(List<int> value) { | |
16904 assert(value != null); | |
16905 this._mixins = value; | |
16906 } | |
16907 | |
16908 /** | |
16909 * The indexes of the items representing the subtypes of this class. The list | |
16910 * will be empty if there are no subtypes or if this item represents a | |
16911 * supertype of the pivot type. | |
16912 */ | |
16913 List<int> get subclasses => _subclasses; | |
16914 | |
16915 /** | |
16916 * The indexes of the items representing the subtypes of this class. The list | |
16917 * will be empty if there are no subtypes or if this item represents a | |
16918 * supertype of the pivot type. | |
16919 */ | |
16920 void set subclasses(List<int> value) { | |
16921 assert(value != null); | |
16922 this._subclasses = value; | |
16923 } | |
16924 | |
16925 TypeHierarchyItem(Element classElement, | |
16926 {String displayName, | |
16927 Element memberElement, | |
16928 int superclass, | |
16929 List<int> interfaces, | |
16930 List<int> mixins, | |
16931 List<int> subclasses}) { | |
16932 this.classElement = classElement; | |
16933 this.displayName = displayName; | |
16934 this.memberElement = memberElement; | |
16935 this.superclass = superclass; | |
16936 if (interfaces == null) { | |
16937 this.interfaces = <int>[]; | |
16938 } else { | |
16939 this.interfaces = interfaces; | |
16940 } | |
16941 if (mixins == null) { | |
16942 this.mixins = <int>[]; | |
16943 } else { | |
16944 this.mixins = mixins; | |
16945 } | |
16946 if (subclasses == null) { | |
16947 this.subclasses = <int>[]; | |
16948 } else { | |
16949 this.subclasses = subclasses; | |
16950 } | |
16951 } | |
16952 | |
16953 factory TypeHierarchyItem.fromJson( | |
16954 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
16955 if (json == null) { | |
16956 json = {}; | |
16957 } | |
16958 if (json is Map) { | |
16959 Element classElement; | |
16960 if (json.containsKey("classElement")) { | |
16961 classElement = new Element.fromJson( | |
16962 jsonDecoder, jsonPath + ".classElement", json["classElement"]); | |
16963 } else { | |
16964 throw jsonDecoder.missingKey(jsonPath, "classElement"); | |
16965 } | |
16966 String displayName; | |
16967 if (json.containsKey("displayName")) { | |
16968 displayName = jsonDecoder.decodeString( | |
16969 jsonPath + ".displayName", json["displayName"]); | |
16970 } | |
16971 Element memberElement; | |
16972 if (json.containsKey("memberElement")) { | |
16973 memberElement = new Element.fromJson( | |
16974 jsonDecoder, jsonPath + ".memberElement", json["memberElement"]); | |
16975 } | |
16976 int superclass; | |
16977 if (json.containsKey("superclass")) { | |
16978 superclass = | |
16979 jsonDecoder.decodeInt(jsonPath + ".superclass", json["superclass"]); | |
16980 } | |
16981 List<int> interfaces; | |
16982 if (json.containsKey("interfaces")) { | |
16983 interfaces = jsonDecoder.decodeList(jsonPath + ".interfaces", | |
16984 json["interfaces"], jsonDecoder.decodeInt); | |
16985 } else { | |
16986 throw jsonDecoder.missingKey(jsonPath, "interfaces"); | |
16987 } | |
16988 List<int> mixins; | |
16989 if (json.containsKey("mixins")) { | |
16990 mixins = jsonDecoder.decodeList( | |
16991 jsonPath + ".mixins", json["mixins"], jsonDecoder.decodeInt); | |
16992 } else { | |
16993 throw jsonDecoder.missingKey(jsonPath, "mixins"); | |
16994 } | |
16995 List<int> subclasses; | |
16996 if (json.containsKey("subclasses")) { | |
16997 subclasses = jsonDecoder.decodeList(jsonPath + ".subclasses", | |
16998 json["subclasses"], jsonDecoder.decodeInt); | |
16999 } else { | |
17000 throw jsonDecoder.missingKey(jsonPath, "subclasses"); | |
17001 } | |
17002 return new TypeHierarchyItem(classElement, | |
17003 displayName: displayName, | |
17004 memberElement: memberElement, | |
17005 superclass: superclass, | |
17006 interfaces: interfaces, | |
17007 mixins: mixins, | |
17008 subclasses: subclasses); | |
17009 } else { | |
17010 throw jsonDecoder.mismatch(jsonPath, "TypeHierarchyItem", json); | |
17011 } | |
17012 } | |
17013 | |
17014 Map<String, dynamic> toJson() { | |
17015 Map<String, dynamic> result = {}; | |
17016 result["classElement"] = classElement.toJson(); | |
17017 if (displayName != null) { | |
17018 result["displayName"] = displayName; | |
17019 } | |
17020 if (memberElement != null) { | |
17021 result["memberElement"] = memberElement.toJson(); | |
17022 } | |
17023 if (superclass != null) { | |
17024 result["superclass"] = superclass; | |
17025 } | |
17026 result["interfaces"] = interfaces; | |
17027 result["mixins"] = mixins; | |
17028 result["subclasses"] = subclasses; | |
17029 return result; | |
17030 } | |
17031 | |
17032 @override | |
17033 String toString() => JSON.encode(toJson()); | |
17034 | |
17035 @override | |
17036 bool operator ==(other) { | |
17037 if (other is TypeHierarchyItem) { | |
17038 return classElement == other.classElement && | |
17039 displayName == other.displayName && | |
17040 memberElement == other.memberElement && | |
17041 superclass == other.superclass && | |
17042 listEqual(interfaces, other.interfaces, (int a, int b) => a == b) && | |
17043 listEqual(mixins, other.mixins, (int a, int b) => a == b) && | |
17044 listEqual(subclasses, other.subclasses, (int a, int b) => a == b); | |
17045 } | |
17046 return false; | |
17047 } | |
17048 | |
17049 @override | |
17050 int get hashCode { | |
17051 int hash = 0; | |
17052 hash = JenkinsSmiHash.combine(hash, classElement.hashCode); | |
17053 hash = JenkinsSmiHash.combine(hash, displayName.hashCode); | |
17054 hash = JenkinsSmiHash.combine(hash, memberElement.hashCode); | |
17055 hash = JenkinsSmiHash.combine(hash, superclass.hashCode); | |
17056 hash = JenkinsSmiHash.combine(hash, interfaces.hashCode); | |
17057 hash = JenkinsSmiHash.combine(hash, mixins.hashCode); | |
17058 hash = JenkinsSmiHash.combine(hash, subclasses.hashCode); | |
17059 return JenkinsSmiHash.finish(hash); | |
17060 } | |
17061 } | |
17062 | |
17063 /** | |
17064 * convertGetterToMethod feedback | |
17065 * | |
17066 * Clients may not extend, implement or mix-in this class. | |
17067 */ | |
17068 class ConvertGetterToMethodFeedback extends RefactoringFeedback { | |
17069 @override | |
17070 bool operator ==(other) { | |
17071 if (other is ConvertGetterToMethodFeedback) { | |
17072 return true; | |
17073 } | |
17074 return false; | |
17075 } | |
17076 | |
17077 @override | |
17078 int get hashCode { | |
17079 return 616032599; | |
17080 } | |
17081 } | |
17082 | |
17083 /** | |
17084 * convertGetterToMethod options | |
17085 * | |
17086 * Clients may not extend, implement or mix-in this class. | |
17087 */ | |
17088 class ConvertGetterToMethodOptions extends RefactoringOptions { | |
17089 @override | |
17090 bool operator ==(other) { | |
17091 if (other is ConvertGetterToMethodOptions) { | |
17092 return true; | |
17093 } | |
17094 return false; | |
17095 } | |
17096 | |
17097 @override | |
17098 int get hashCode { | |
17099 return 488848400; | |
17100 } | |
17101 } | |
17102 | |
17103 /** | |
17104 * convertMethodToGetter feedback | |
17105 * | |
17106 * Clients may not extend, implement or mix-in this class. | |
17107 */ | |
17108 class ConvertMethodToGetterFeedback extends RefactoringFeedback { | |
17109 @override | |
17110 bool operator ==(other) { | |
17111 if (other is ConvertMethodToGetterFeedback) { | |
17112 return true; | |
17113 } | |
17114 return false; | |
17115 } | |
17116 | |
17117 @override | |
17118 int get hashCode { | |
17119 return 165291526; | |
17120 } | |
17121 } | |
17122 | |
17123 /** | |
17124 * convertMethodToGetter options | |
17125 * | |
17126 * Clients may not extend, implement or mix-in this class. | |
17127 */ | |
17128 class ConvertMethodToGetterOptions extends RefactoringOptions { | |
17129 @override | |
17130 bool operator ==(other) { | |
17131 if (other is ConvertMethodToGetterOptions) { | |
17132 return true; | |
17133 } | |
17134 return false; | |
17135 } | |
17136 | |
17137 @override | |
17138 int get hashCode { | |
17139 return 27952290; | |
17140 } | |
17141 } | |
17142 | |
17143 /** | |
17144 * extractLocalVariable feedback | |
17145 * | |
17146 * { | |
17147 * "coveringExpressionOffsets": optional List<int> | |
17148 * "coveringExpressionLengths": optional List<int> | |
17149 * "names": List<String> | |
17150 * "offsets": List<int> | |
17151 * "lengths": List<int> | |
17152 * } | |
17153 * | |
17154 * Clients may not extend, implement or mix-in this class. | |
17155 */ | |
17156 class ExtractLocalVariableFeedback extends RefactoringFeedback { | |
17157 List<int> _coveringExpressionOffsets; | |
17158 | |
17159 List<int> _coveringExpressionLengths; | |
17160 | |
17161 List<String> _names; | |
17162 | |
17163 List<int> _offsets; | |
17164 | |
17165 List<int> _lengths; | |
17166 | |
17167 /** | |
17168 * The offsets of the expressions that cover the specified selection, from | |
17169 * the down most to the up most. | |
17170 */ | |
17171 List<int> get coveringExpressionOffsets => _coveringExpressionOffsets; | |
17172 | |
17173 /** | |
17174 * The offsets of the expressions that cover the specified selection, from | |
17175 * the down most to the up most. | |
17176 */ | |
17177 void set coveringExpressionOffsets(List<int> value) { | |
17178 this._coveringExpressionOffsets = value; | |
17179 } | |
17180 | |
17181 /** | |
17182 * The lengths of the expressions that cover the specified selection, from | |
17183 * the down most to the up most. | |
17184 */ | |
17185 List<int> get coveringExpressionLengths => _coveringExpressionLengths; | |
17186 | |
17187 /** | |
17188 * The lengths of the expressions that cover the specified selection, from | |
17189 * the down most to the up most. | |
17190 */ | |
17191 void set coveringExpressionLengths(List<int> value) { | |
17192 this._coveringExpressionLengths = value; | |
17193 } | |
17194 | |
17195 /** | |
17196 * The proposed names for the local variable. | |
17197 */ | |
17198 List<String> get names => _names; | |
17199 | |
17200 /** | |
17201 * The proposed names for the local variable. | |
17202 */ | |
17203 void set names(List<String> value) { | |
17204 assert(value != null); | |
17205 this._names = value; | |
17206 } | |
17207 | |
17208 /** | |
17209 * The offsets of the expressions that would be replaced by a reference to | |
17210 * the variable. | |
17211 */ | |
17212 List<int> get offsets => _offsets; | |
17213 | |
17214 /** | |
17215 * The offsets of the expressions that would be replaced by a reference to | |
17216 * the variable. | |
17217 */ | |
17218 void set offsets(List<int> value) { | |
17219 assert(value != null); | |
17220 this._offsets = value; | |
17221 } | |
17222 | |
17223 /** | |
17224 * The lengths of the expressions that would be replaced by a reference to | |
17225 * the variable. The lengths correspond to the offsets. In other words, for a | |
17226 * given expression, if the offset of that expression is offsets[i], then the | |
17227 * length of that expression is lengths[i]. | |
17228 */ | |
17229 List<int> get lengths => _lengths; | |
17230 | |
17231 /** | |
17232 * The lengths of the expressions that would be replaced by a reference to | |
17233 * the variable. The lengths correspond to the offsets. In other words, for a | |
17234 * given expression, if the offset of that expression is offsets[i], then the | |
17235 * length of that expression is lengths[i]. | |
17236 */ | |
17237 void set lengths(List<int> value) { | |
17238 assert(value != null); | |
17239 this._lengths = value; | |
17240 } | |
17241 | |
17242 ExtractLocalVariableFeedback( | |
17243 List<String> names, List<int> offsets, List<int> lengths, | |
17244 {List<int> coveringExpressionOffsets, | |
17245 List<int> coveringExpressionLengths}) { | |
17246 this.coveringExpressionOffsets = coveringExpressionOffsets; | |
17247 this.coveringExpressionLengths = coveringExpressionLengths; | |
17248 this.names = names; | |
17249 this.offsets = offsets; | |
17250 this.lengths = lengths; | |
17251 } | |
17252 | |
17253 factory ExtractLocalVariableFeedback.fromJson( | |
17254 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
17255 if (json == null) { | |
17256 json = {}; | |
17257 } | |
17258 if (json is Map) { | |
17259 List<int> coveringExpressionOffsets; | |
17260 if (json.containsKey("coveringExpressionOffsets")) { | |
17261 coveringExpressionOffsets = jsonDecoder.decodeList( | |
17262 jsonPath + ".coveringExpressionOffsets", | |
17263 json["coveringExpressionOffsets"], | |
17264 jsonDecoder.decodeInt); | |
17265 } | |
17266 List<int> coveringExpressionLengths; | |
17267 if (json.containsKey("coveringExpressionLengths")) { | |
17268 coveringExpressionLengths = jsonDecoder.decodeList( | |
17269 jsonPath + ".coveringExpressionLengths", | |
17270 json["coveringExpressionLengths"], | |
17271 jsonDecoder.decodeInt); | |
17272 } | |
17273 List<String> names; | |
17274 if (json.containsKey("names")) { | |
17275 names = jsonDecoder.decodeList( | |
17276 jsonPath + ".names", json["names"], jsonDecoder.decodeString); | |
17277 } else { | |
17278 throw jsonDecoder.missingKey(jsonPath, "names"); | |
17279 } | |
17280 List<int> offsets; | |
17281 if (json.containsKey("offsets")) { | |
17282 offsets = jsonDecoder.decodeList( | |
17283 jsonPath + ".offsets", json["offsets"], jsonDecoder.decodeInt); | |
17284 } else { | |
17285 throw jsonDecoder.missingKey(jsonPath, "offsets"); | |
17286 } | |
17287 List<int> lengths; | |
17288 if (json.containsKey("lengths")) { | |
17289 lengths = jsonDecoder.decodeList( | |
17290 jsonPath + ".lengths", json["lengths"], jsonDecoder.decodeInt); | |
17291 } else { | |
17292 throw jsonDecoder.missingKey(jsonPath, "lengths"); | |
17293 } | |
17294 return new ExtractLocalVariableFeedback(names, offsets, lengths, | |
17295 coveringExpressionOffsets: coveringExpressionOffsets, | |
17296 coveringExpressionLengths: coveringExpressionLengths); | |
17297 } else { | |
17298 throw jsonDecoder.mismatch( | |
17299 jsonPath, "extractLocalVariable feedback", json); | |
17300 } | |
17301 } | |
17302 | |
17303 Map<String, dynamic> toJson() { | |
17304 Map<String, dynamic> result = {}; | |
17305 if (coveringExpressionOffsets != null) { | |
17306 result["coveringExpressionOffsets"] = coveringExpressionOffsets; | |
17307 } | |
17308 if (coveringExpressionLengths != null) { | |
17309 result["coveringExpressionLengths"] = coveringExpressionLengths; | |
17310 } | |
17311 result["names"] = names; | |
17312 result["offsets"] = offsets; | |
17313 result["lengths"] = lengths; | |
17314 return result; | |
17315 } | |
17316 | |
17317 @override | |
17318 String toString() => JSON.encode(toJson()); | |
17319 | |
17320 @override | |
17321 bool operator ==(other) { | |
17322 if (other is ExtractLocalVariableFeedback) { | |
17323 return listEqual(coveringExpressionOffsets, | |
17324 other.coveringExpressionOffsets, (int a, int b) => a == b) && | |
17325 listEqual(coveringExpressionLengths, other.coveringExpressionLengths, | |
17326 (int a, int b) => a == b) && | |
17327 listEqual(names, other.names, (String a, String b) => a == b) && | |
17328 listEqual(offsets, other.offsets, (int a, int b) => a == b) && | |
17329 listEqual(lengths, other.lengths, (int a, int b) => a == b); | |
17330 } | |
17331 return false; | |
17332 } | |
17333 | |
17334 @override | |
17335 int get hashCode { | |
17336 int hash = 0; | |
17337 hash = JenkinsSmiHash.combine(hash, coveringExpressionOffsets.hashCode); | |
17338 hash = JenkinsSmiHash.combine(hash, coveringExpressionLengths.hashCode); | |
17339 hash = JenkinsSmiHash.combine(hash, names.hashCode); | |
17340 hash = JenkinsSmiHash.combine(hash, offsets.hashCode); | |
17341 hash = JenkinsSmiHash.combine(hash, lengths.hashCode); | |
17342 return JenkinsSmiHash.finish(hash); | |
17343 } | |
17344 } | |
17345 | |
17346 /** | |
17347 * extractLocalVariable options | |
17348 * | |
17349 * { | |
17350 * "name": String | |
17351 * "extractAll": bool | |
17352 * } | |
17353 * | |
17354 * Clients may not extend, implement or mix-in this class. | |
17355 */ | |
17356 class ExtractLocalVariableOptions extends RefactoringOptions { | |
17357 String _name; | |
17358 | |
17359 bool _extractAll; | |
17360 | |
17361 /** | |
17362 * The name that the local variable should be given. | |
17363 */ | |
17364 String get name => _name; | |
17365 | |
17366 /** | |
17367 * The name that the local variable should be given. | |
17368 */ | |
17369 void set name(String value) { | |
17370 assert(value != null); | |
17371 this._name = value; | |
17372 } | |
17373 | |
17374 /** | |
17375 * True if all occurrences of the expression within the scope in which the | |
17376 * variable will be defined should be replaced by a reference to the local | |
17377 * variable. The expression used to initiate the refactoring will always be | |
17378 * replaced. | |
17379 */ | |
17380 bool get extractAll => _extractAll; | |
17381 | |
17382 /** | |
17383 * True if all occurrences of the expression within the scope in which the | |
17384 * variable will be defined should be replaced by a reference to the local | |
17385 * variable. The expression used to initiate the refactoring will always be | |
17386 * replaced. | |
17387 */ | |
17388 void set extractAll(bool value) { | |
17389 assert(value != null); | |
17390 this._extractAll = value; | |
17391 } | |
17392 | |
17393 ExtractLocalVariableOptions(String name, bool extractAll) { | |
17394 this.name = name; | |
17395 this.extractAll = extractAll; | |
17396 } | |
17397 | |
17398 factory ExtractLocalVariableOptions.fromJson( | |
17399 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
17400 if (json == null) { | |
17401 json = {}; | |
17402 } | |
17403 if (json is Map) { | |
17404 String name; | |
17405 if (json.containsKey("name")) { | |
17406 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]); | |
17407 } else { | |
17408 throw jsonDecoder.missingKey(jsonPath, "name"); | |
17409 } | |
17410 bool extractAll; | |
17411 if (json.containsKey("extractAll")) { | |
17412 extractAll = jsonDecoder.decodeBool( | |
17413 jsonPath + ".extractAll", json["extractAll"]); | |
17414 } else { | |
17415 throw jsonDecoder.missingKey(jsonPath, "extractAll"); | |
17416 } | |
17417 return new ExtractLocalVariableOptions(name, extractAll); | |
17418 } else { | |
17419 throw jsonDecoder.mismatch( | |
17420 jsonPath, "extractLocalVariable options", json); | |
17421 } | |
17422 } | |
17423 | |
17424 factory ExtractLocalVariableOptions.fromRefactoringParams( | |
17425 EditGetRefactoringParams refactoringParams, Request request) { | |
17426 return new ExtractLocalVariableOptions.fromJson( | |
17427 new RequestDecoder(request), "options", refactoringParams.options); | |
17428 } | |
17429 | |
17430 Map<String, dynamic> toJson() { | |
17431 Map<String, dynamic> result = {}; | |
17432 result["name"] = name; | |
17433 result["extractAll"] = extractAll; | |
17434 return result; | |
17435 } | |
17436 | |
17437 @override | |
17438 String toString() => JSON.encode(toJson()); | |
17439 | |
17440 @override | |
17441 bool operator ==(other) { | |
17442 if (other is ExtractLocalVariableOptions) { | |
17443 return name == other.name && extractAll == other.extractAll; | |
17444 } | |
17445 return false; | |
17446 } | |
17447 | |
17448 @override | |
17449 int get hashCode { | |
17450 int hash = 0; | |
17451 hash = JenkinsSmiHash.combine(hash, name.hashCode); | |
17452 hash = JenkinsSmiHash.combine(hash, extractAll.hashCode); | |
17453 return JenkinsSmiHash.finish(hash); | |
17454 } | |
17455 } | |
17456 | |
17457 /** | |
17458 * extractMethod feedback | |
17459 * | |
17460 * { | |
17461 * "offset": int | |
17462 * "length": int | |
17463 * "returnType": String | |
17464 * "names": List<String> | |
17465 * "canCreateGetter": bool | |
17466 * "parameters": List<RefactoringMethodParameter> | |
17467 * "offsets": List<int> | |
17468 * "lengths": List<int> | |
17469 * } | |
17470 * | |
17471 * Clients may not extend, implement or mix-in this class. | |
17472 */ | |
17473 class ExtractMethodFeedback extends RefactoringFeedback { | |
17474 int _offset; | |
17475 | |
17476 int _length; | |
17477 | |
17478 String _returnType; | |
17479 | |
17480 List<String> _names; | |
17481 | |
17482 bool _canCreateGetter; | |
17483 | |
17484 List<RefactoringMethodParameter> _parameters; | |
17485 | |
17486 List<int> _offsets; | |
17487 | |
17488 List<int> _lengths; | |
17489 | |
17490 /** | |
17491 * The offset to the beginning of the expression or statements that will be | |
17492 * extracted. | |
17493 */ | |
17494 int get offset => _offset; | |
17495 | |
17496 /** | |
17497 * The offset to the beginning of the expression or statements that will be | |
17498 * extracted. | |
17499 */ | |
17500 void set offset(int value) { | |
17501 assert(value != null); | |
17502 this._offset = value; | |
17503 } | |
17504 | |
17505 /** | |
17506 * The length of the expression or statements that will be extracted. | |
17507 */ | |
17508 int get length => _length; | |
17509 | |
17510 /** | |
17511 * The length of the expression or statements that will be extracted. | |
17512 */ | |
17513 void set length(int value) { | |
17514 assert(value != null); | |
17515 this._length = value; | |
17516 } | |
17517 | |
17518 /** | |
17519 * The proposed return type for the method. If the returned element does not | |
17520 * have a declared return type, this field will contain an empty string. | |
17521 */ | |
17522 String get returnType => _returnType; | |
17523 | |
17524 /** | |
17525 * The proposed return type for the method. If the returned element does not | |
17526 * have a declared return type, this field will contain an empty string. | |
17527 */ | |
17528 void set returnType(String value) { | |
17529 assert(value != null); | |
17530 this._returnType = value; | |
17531 } | |
17532 | |
17533 /** | |
17534 * The proposed names for the method. | |
17535 */ | |
17536 List<String> get names => _names; | |
17537 | |
17538 /** | |
17539 * The proposed names for the method. | |
17540 */ | |
17541 void set names(List<String> value) { | |
17542 assert(value != null); | |
17543 this._names = value; | |
17544 } | |
17545 | |
17546 /** | |
17547 * True if a getter could be created rather than a method. | |
17548 */ | |
17549 bool get canCreateGetter => _canCreateGetter; | |
17550 | |
17551 /** | |
17552 * True if a getter could be created rather than a method. | |
17553 */ | |
17554 void set canCreateGetter(bool value) { | |
17555 assert(value != null); | |
17556 this._canCreateGetter = value; | |
17557 } | |
17558 | |
17559 /** | |
17560 * The proposed parameters for the method. | |
17561 */ | |
17562 List<RefactoringMethodParameter> get parameters => _parameters; | |
17563 | |
17564 /** | |
17565 * The proposed parameters for the method. | |
17566 */ | |
17567 void set parameters(List<RefactoringMethodParameter> value) { | |
17568 assert(value != null); | |
17569 this._parameters = value; | |
17570 } | |
17571 | |
17572 /** | |
17573 * The offsets of the expressions or statements that would be replaced by an | |
17574 * invocation of the method. | |
17575 */ | |
17576 List<int> get offsets => _offsets; | |
17577 | |
17578 /** | |
17579 * The offsets of the expressions or statements that would be replaced by an | |
17580 * invocation of the method. | |
17581 */ | |
17582 void set offsets(List<int> value) { | |
17583 assert(value != null); | |
17584 this._offsets = value; | |
17585 } | |
17586 | |
17587 /** | |
17588 * The lengths of the expressions or statements that would be replaced by an | |
17589 * invocation of the method. The lengths correspond to the offsets. In other | |
17590 * words, for a given expression (or block of statements), if the offset of | |
17591 * that expression is offsets[i], then the length of that expression is | |
17592 * lengths[i]. | |
17593 */ | |
17594 List<int> get lengths => _lengths; | |
17595 | |
17596 /** | |
17597 * The lengths of the expressions or statements that would be replaced by an | |
17598 * invocation of the method. The lengths correspond to the offsets. In other | |
17599 * words, for a given expression (or block of statements), if the offset of | |
17600 * that expression is offsets[i], then the length of that expression is | |
17601 * lengths[i]. | |
17602 */ | |
17603 void set lengths(List<int> value) { | |
17604 assert(value != null); | |
17605 this._lengths = value; | |
17606 } | |
17607 | |
17608 ExtractMethodFeedback( | |
17609 int offset, | |
17610 int length, | |
17611 String returnType, | |
17612 List<String> names, | |
17613 bool canCreateGetter, | |
17614 List<RefactoringMethodParameter> parameters, | |
17615 List<int> offsets, | |
17616 List<int> lengths) { | |
17617 this.offset = offset; | |
17618 this.length = length; | |
17619 this.returnType = returnType; | |
17620 this.names = names; | |
17621 this.canCreateGetter = canCreateGetter; | |
17622 this.parameters = parameters; | |
17623 this.offsets = offsets; | |
17624 this.lengths = lengths; | |
17625 } | |
17626 | |
17627 factory ExtractMethodFeedback.fromJson( | |
17628 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
17629 if (json == null) { | |
17630 json = {}; | |
17631 } | |
17632 if (json is Map) { | |
17633 int offset; | |
17634 if (json.containsKey("offset")) { | |
17635 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
17636 } else { | |
17637 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
17638 } | |
17639 int length; | |
17640 if (json.containsKey("length")) { | |
17641 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
17642 } else { | |
17643 throw jsonDecoder.missingKey(jsonPath, "length"); | |
17644 } | |
17645 String returnType; | |
17646 if (json.containsKey("returnType")) { | |
17647 returnType = jsonDecoder.decodeString( | |
17648 jsonPath + ".returnType", json["returnType"]); | |
17649 } else { | |
17650 throw jsonDecoder.missingKey(jsonPath, "returnType"); | |
17651 } | |
17652 List<String> names; | |
17653 if (json.containsKey("names")) { | |
17654 names = jsonDecoder.decodeList( | |
17655 jsonPath + ".names", json["names"], jsonDecoder.decodeString); | |
17656 } else { | |
17657 throw jsonDecoder.missingKey(jsonPath, "names"); | |
17658 } | |
17659 bool canCreateGetter; | |
17660 if (json.containsKey("canCreateGetter")) { | |
17661 canCreateGetter = jsonDecoder.decodeBool( | |
17662 jsonPath + ".canCreateGetter", json["canCreateGetter"]); | |
17663 } else { | |
17664 throw jsonDecoder.missingKey(jsonPath, "canCreateGetter"); | |
17665 } | |
17666 List<RefactoringMethodParameter> parameters; | |
17667 if (json.containsKey("parameters")) { | |
17668 parameters = jsonDecoder.decodeList( | |
17669 jsonPath + ".parameters", | |
17670 json["parameters"], | |
17671 (String jsonPath, Object json) => | |
17672 new RefactoringMethodParameter.fromJson( | |
17673 jsonDecoder, jsonPath, json)); | |
17674 } else { | |
17675 throw jsonDecoder.missingKey(jsonPath, "parameters"); | |
17676 } | |
17677 List<int> offsets; | |
17678 if (json.containsKey("offsets")) { | |
17679 offsets = jsonDecoder.decodeList( | |
17680 jsonPath + ".offsets", json["offsets"], jsonDecoder.decodeInt); | |
17681 } else { | |
17682 throw jsonDecoder.missingKey(jsonPath, "offsets"); | |
17683 } | |
17684 List<int> lengths; | |
17685 if (json.containsKey("lengths")) { | |
17686 lengths = jsonDecoder.decodeList( | |
17687 jsonPath + ".lengths", json["lengths"], jsonDecoder.decodeInt); | |
17688 } else { | |
17689 throw jsonDecoder.missingKey(jsonPath, "lengths"); | |
17690 } | |
17691 return new ExtractMethodFeedback(offset, length, returnType, names, | |
17692 canCreateGetter, parameters, offsets, lengths); | |
17693 } else { | |
17694 throw jsonDecoder.mismatch(jsonPath, "extractMethod feedback", json); | |
17695 } | |
17696 } | |
17697 | |
17698 Map<String, dynamic> toJson() { | |
17699 Map<String, dynamic> result = {}; | |
17700 result["offset"] = offset; | |
17701 result["length"] = length; | |
17702 result["returnType"] = returnType; | |
17703 result["names"] = names; | |
17704 result["canCreateGetter"] = canCreateGetter; | |
17705 result["parameters"] = parameters | |
17706 .map((RefactoringMethodParameter value) => value.toJson()) | |
17707 .toList(); | |
17708 result["offsets"] = offsets; | |
17709 result["lengths"] = lengths; | |
17710 return result; | |
17711 } | |
17712 | |
17713 @override | |
17714 String toString() => JSON.encode(toJson()); | |
17715 | |
17716 @override | |
17717 bool operator ==(other) { | |
17718 if (other is ExtractMethodFeedback) { | |
17719 return offset == other.offset && | |
17720 length == other.length && | |
17721 returnType == other.returnType && | |
17722 listEqual(names, other.names, (String a, String b) => a == b) && | |
17723 canCreateGetter == other.canCreateGetter && | |
17724 listEqual( | |
17725 parameters, | |
17726 other.parameters, | |
17727 (RefactoringMethodParameter a, RefactoringMethodParameter b) => | |
17728 a == b) && | |
17729 listEqual(offsets, other.offsets, (int a, int b) => a == b) && | |
17730 listEqual(lengths, other.lengths, (int a, int b) => a == b); | |
17731 } | |
17732 return false; | |
17733 } | |
17734 | |
17735 @override | |
17736 int get hashCode { | |
17737 int hash = 0; | |
17738 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
17739 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
17740 hash = JenkinsSmiHash.combine(hash, returnType.hashCode); | |
17741 hash = JenkinsSmiHash.combine(hash, names.hashCode); | |
17742 hash = JenkinsSmiHash.combine(hash, canCreateGetter.hashCode); | |
17743 hash = JenkinsSmiHash.combine(hash, parameters.hashCode); | |
17744 hash = JenkinsSmiHash.combine(hash, offsets.hashCode); | |
17745 hash = JenkinsSmiHash.combine(hash, lengths.hashCode); | |
17746 return JenkinsSmiHash.finish(hash); | |
17747 } | |
17748 } | |
17749 | |
17750 /** | |
17751 * extractMethod options | |
17752 * | |
17753 * { | |
17754 * "returnType": String | |
17755 * "createGetter": bool | |
17756 * "name": String | |
17757 * "parameters": List<RefactoringMethodParameter> | |
17758 * "extractAll": bool | |
17759 * } | |
17760 * | |
17761 * Clients may not extend, implement or mix-in this class. | |
17762 */ | |
17763 class ExtractMethodOptions extends RefactoringOptions { | |
17764 String _returnType; | |
17765 | |
17766 bool _createGetter; | |
17767 | |
17768 String _name; | |
17769 | |
17770 List<RefactoringMethodParameter> _parameters; | |
17771 | |
17772 bool _extractAll; | |
17773 | |
17774 /** | |
17775 * The return type that should be defined for the method. | |
17776 */ | |
17777 String get returnType => _returnType; | |
17778 | |
17779 /** | |
17780 * The return type that should be defined for the method. | |
17781 */ | |
17782 void set returnType(String value) { | |
17783 assert(value != null); | |
17784 this._returnType = value; | |
17785 } | |
17786 | |
17787 /** | |
17788 * True if a getter should be created rather than a method. It is an error if | |
17789 * this field is true and the list of parameters is non-empty. | |
17790 */ | |
17791 bool get createGetter => _createGetter; | |
17792 | |
17793 /** | |
17794 * True if a getter should be created rather than a method. It is an error if | |
17795 * this field is true and the list of parameters is non-empty. | |
17796 */ | |
17797 void set createGetter(bool value) { | |
17798 assert(value != null); | |
17799 this._createGetter = value; | |
17800 } | |
17801 | |
17802 /** | |
17803 * The name that the method should be given. | |
17804 */ | |
17805 String get name => _name; | |
17806 | |
17807 /** | |
17808 * The name that the method should be given. | |
17809 */ | |
17810 void set name(String value) { | |
17811 assert(value != null); | |
17812 this._name = value; | |
17813 } | |
17814 | |
17815 /** | |
17816 * The parameters that should be defined for the method. | |
17817 * | |
17818 * It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL | |
17819 * parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a | |
17820 * NAMED parameter. | |
17821 * | |
17822 * - To change the order and/or update proposed parameters, add parameters | |
17823 * with the same identifiers as proposed. | |
17824 * - To add new parameters, omit their identifier. | |
17825 * - To remove some parameters, omit them in this list. | |
17826 */ | |
17827 List<RefactoringMethodParameter> get parameters => _parameters; | |
17828 | |
17829 /** | |
17830 * The parameters that should be defined for the method. | |
17831 * | |
17832 * It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL | |
17833 * parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a | |
17834 * NAMED parameter. | |
17835 * | |
17836 * - To change the order and/or update proposed parameters, add parameters | |
17837 * with the same identifiers as proposed. | |
17838 * - To add new parameters, omit their identifier. | |
17839 * - To remove some parameters, omit them in this list. | |
17840 */ | |
17841 void set parameters(List<RefactoringMethodParameter> value) { | |
17842 assert(value != null); | |
17843 this._parameters = value; | |
17844 } | |
17845 | |
17846 /** | |
17847 * True if all occurrences of the expression or statements should be replaced | |
17848 * by an invocation of the method. The expression or statements used to | |
17849 * initiate the refactoring will always be replaced. | |
17850 */ | |
17851 bool get extractAll => _extractAll; | |
17852 | |
17853 /** | |
17854 * True if all occurrences of the expression or statements should be replaced | |
17855 * by an invocation of the method. The expression or statements used to | |
17856 * initiate the refactoring will always be replaced. | |
17857 */ | |
17858 void set extractAll(bool value) { | |
17859 assert(value != null); | |
17860 this._extractAll = value; | |
17861 } | |
17862 | |
17863 ExtractMethodOptions(String returnType, bool createGetter, String name, | |
17864 List<RefactoringMethodParameter> parameters, bool extractAll) { | |
17865 this.returnType = returnType; | |
17866 this.createGetter = createGetter; | |
17867 this.name = name; | |
17868 this.parameters = parameters; | |
17869 this.extractAll = extractAll; | |
17870 } | |
17871 | |
17872 factory ExtractMethodOptions.fromJson( | |
17873 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
17874 if (json == null) { | |
17875 json = {}; | |
17876 } | |
17877 if (json is Map) { | |
17878 String returnType; | |
17879 if (json.containsKey("returnType")) { | |
17880 returnType = jsonDecoder.decodeString( | |
17881 jsonPath + ".returnType", json["returnType"]); | |
17882 } else { | |
17883 throw jsonDecoder.missingKey(jsonPath, "returnType"); | |
17884 } | |
17885 bool createGetter; | |
17886 if (json.containsKey("createGetter")) { | |
17887 createGetter = jsonDecoder.decodeBool( | |
17888 jsonPath + ".createGetter", json["createGetter"]); | |
17889 } else { | |
17890 throw jsonDecoder.missingKey(jsonPath, "createGetter"); | |
17891 } | |
17892 String name; | |
17893 if (json.containsKey("name")) { | |
17894 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]); | |
17895 } else { | |
17896 throw jsonDecoder.missingKey(jsonPath, "name"); | |
17897 } | |
17898 List<RefactoringMethodParameter> parameters; | |
17899 if (json.containsKey("parameters")) { | |
17900 parameters = jsonDecoder.decodeList( | |
17901 jsonPath + ".parameters", | |
17902 json["parameters"], | |
17903 (String jsonPath, Object json) => | |
17904 new RefactoringMethodParameter.fromJson( | |
17905 jsonDecoder, jsonPath, json)); | |
17906 } else { | |
17907 throw jsonDecoder.missingKey(jsonPath, "parameters"); | |
17908 } | |
17909 bool extractAll; | |
17910 if (json.containsKey("extractAll")) { | |
17911 extractAll = jsonDecoder.decodeBool( | |
17912 jsonPath + ".extractAll", json["extractAll"]); | |
17913 } else { | |
17914 throw jsonDecoder.missingKey(jsonPath, "extractAll"); | |
17915 } | |
17916 return new ExtractMethodOptions( | |
17917 returnType, createGetter, name, parameters, extractAll); | |
17918 } else { | |
17919 throw jsonDecoder.mismatch(jsonPath, "extractMethod options", json); | |
17920 } | |
17921 } | |
17922 | |
17923 factory ExtractMethodOptions.fromRefactoringParams( | |
17924 EditGetRefactoringParams refactoringParams, Request request) { | |
17925 return new ExtractMethodOptions.fromJson( | |
17926 new RequestDecoder(request), "options", refactoringParams.options); | |
17927 } | |
17928 | |
17929 Map<String, dynamic> toJson() { | |
17930 Map<String, dynamic> result = {}; | |
17931 result["returnType"] = returnType; | |
17932 result["createGetter"] = createGetter; | |
17933 result["name"] = name; | |
17934 result["parameters"] = parameters | |
17935 .map((RefactoringMethodParameter value) => value.toJson()) | |
17936 .toList(); | |
17937 result["extractAll"] = extractAll; | |
17938 return result; | |
17939 } | |
17940 | |
17941 @override | |
17942 String toString() => JSON.encode(toJson()); | |
17943 | |
17944 @override | |
17945 bool operator ==(other) { | |
17946 if (other is ExtractMethodOptions) { | |
17947 return returnType == other.returnType && | |
17948 createGetter == other.createGetter && | |
17949 name == other.name && | |
17950 listEqual( | |
17951 parameters, | |
17952 other.parameters, | |
17953 (RefactoringMethodParameter a, RefactoringMethodParameter b) => | |
17954 a == b) && | |
17955 extractAll == other.extractAll; | |
17956 } | |
17957 return false; | |
17958 } | |
17959 | |
17960 @override | |
17961 int get hashCode { | |
17962 int hash = 0; | |
17963 hash = JenkinsSmiHash.combine(hash, returnType.hashCode); | |
17964 hash = JenkinsSmiHash.combine(hash, createGetter.hashCode); | |
17965 hash = JenkinsSmiHash.combine(hash, name.hashCode); | |
17966 hash = JenkinsSmiHash.combine(hash, parameters.hashCode); | |
17967 hash = JenkinsSmiHash.combine(hash, extractAll.hashCode); | |
17968 return JenkinsSmiHash.finish(hash); | |
17969 } | |
17970 } | |
17971 | |
17972 /** | |
17973 * inlineLocalVariable feedback | |
17974 * | |
17975 * { | |
17976 * "name": String | |
17977 * "occurrences": int | |
17978 * } | |
17979 * | |
17980 * Clients may not extend, implement or mix-in this class. | |
17981 */ | |
17982 class InlineLocalVariableFeedback extends RefactoringFeedback { | |
17983 String _name; | |
17984 | |
17985 int _occurrences; | |
17986 | |
17987 /** | |
17988 * The name of the variable being inlined. | |
17989 */ | |
17990 String get name => _name; | |
17991 | |
17992 /** | |
17993 * The name of the variable being inlined. | |
17994 */ | |
17995 void set name(String value) { | |
17996 assert(value != null); | |
17997 this._name = value; | |
17998 } | |
17999 | |
18000 /** | |
18001 * The number of times the variable occurs. | |
18002 */ | |
18003 int get occurrences => _occurrences; | |
18004 | |
18005 /** | |
18006 * The number of times the variable occurs. | |
18007 */ | |
18008 void set occurrences(int value) { | |
18009 assert(value != null); | |
18010 this._occurrences = value; | |
18011 } | |
18012 | |
18013 InlineLocalVariableFeedback(String name, int occurrences) { | |
18014 this.name = name; | |
18015 this.occurrences = occurrences; | |
18016 } | |
18017 | |
18018 factory InlineLocalVariableFeedback.fromJson( | |
18019 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
18020 if (json == null) { | |
18021 json = {}; | |
18022 } | |
18023 if (json is Map) { | |
18024 String name; | |
18025 if (json.containsKey("name")) { | |
18026 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]); | |
18027 } else { | |
18028 throw jsonDecoder.missingKey(jsonPath, "name"); | |
18029 } | |
18030 int occurrences; | |
18031 if (json.containsKey("occurrences")) { | |
18032 occurrences = jsonDecoder.decodeInt( | |
18033 jsonPath + ".occurrences", json["occurrences"]); | |
18034 } else { | |
18035 throw jsonDecoder.missingKey(jsonPath, "occurrences"); | |
18036 } | |
18037 return new InlineLocalVariableFeedback(name, occurrences); | |
18038 } else { | |
18039 throw jsonDecoder.mismatch( | |
18040 jsonPath, "inlineLocalVariable feedback", json); | |
18041 } | |
18042 } | |
18043 | |
18044 Map<String, dynamic> toJson() { | |
18045 Map<String, dynamic> result = {}; | |
18046 result["name"] = name; | |
18047 result["occurrences"] = occurrences; | |
18048 return result; | |
18049 } | |
18050 | |
18051 @override | |
18052 String toString() => JSON.encode(toJson()); | |
18053 | |
18054 @override | |
18055 bool operator ==(other) { | |
18056 if (other is InlineLocalVariableFeedback) { | |
18057 return name == other.name && occurrences == other.occurrences; | |
18058 } | |
18059 return false; | |
18060 } | |
18061 | |
18062 @override | |
18063 int get hashCode { | |
18064 int hash = 0; | |
18065 hash = JenkinsSmiHash.combine(hash, name.hashCode); | |
18066 hash = JenkinsSmiHash.combine(hash, occurrences.hashCode); | |
18067 return JenkinsSmiHash.finish(hash); | |
18068 } | |
18069 } | |
18070 | |
18071 /** | |
18072 * inlineLocalVariable options | |
18073 * | |
18074 * Clients may not extend, implement or mix-in this class. | |
18075 */ | |
18076 class InlineLocalVariableOptions extends RefactoringOptions { | |
18077 @override | |
18078 bool operator ==(other) { | |
18079 if (other is InlineLocalVariableOptions) { | |
18080 return true; | |
18081 } | |
18082 return false; | |
18083 } | |
18084 | |
18085 @override | |
18086 int get hashCode { | |
18087 return 540364977; | |
18088 } | |
18089 } | |
18090 | |
18091 /** | |
18092 * inlineMethod feedback | |
18093 * | |
18094 * { | |
18095 * "className": optional String | |
18096 * "methodName": String | |
18097 * "isDeclaration": bool | |
18098 * } | |
18099 * | |
18100 * Clients may not extend, implement or mix-in this class. | |
18101 */ | |
18102 class InlineMethodFeedback extends RefactoringFeedback { | |
18103 String _className; | |
18104 | |
18105 String _methodName; | |
18106 | |
18107 bool _isDeclaration; | |
18108 | |
18109 /** | |
18110 * The name of the class enclosing the method being inlined. If not a class | |
18111 * member is being inlined, this field will be absent. | |
18112 */ | |
18113 String get className => _className; | |
18114 | |
18115 /** | |
18116 * The name of the class enclosing the method being inlined. If not a class | |
18117 * member is being inlined, this field will be absent. | |
18118 */ | |
18119 void set className(String value) { | |
18120 this._className = value; | |
18121 } | |
18122 | |
18123 /** | |
18124 * The name of the method (or function) being inlined. | |
18125 */ | |
18126 String get methodName => _methodName; | |
18127 | |
18128 /** | |
18129 * The name of the method (or function) being inlined. | |
18130 */ | |
18131 void set methodName(String value) { | |
18132 assert(value != null); | |
18133 this._methodName = value; | |
18134 } | |
18135 | |
18136 /** | |
18137 * True if the declaration of the method is selected. So all references | |
18138 * should be inlined. | |
18139 */ | |
18140 bool get isDeclaration => _isDeclaration; | |
18141 | |
18142 /** | |
18143 * True if the declaration of the method is selected. So all references | |
18144 * should be inlined. | |
18145 */ | |
18146 void set isDeclaration(bool value) { | |
18147 assert(value != null); | |
18148 this._isDeclaration = value; | |
18149 } | |
18150 | |
18151 InlineMethodFeedback(String methodName, bool isDeclaration, | |
18152 {String className}) { | |
18153 this.className = className; | |
18154 this.methodName = methodName; | |
18155 this.isDeclaration = isDeclaration; | |
18156 } | |
18157 | |
18158 factory InlineMethodFeedback.fromJson( | |
18159 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
18160 if (json == null) { | |
18161 json = {}; | |
18162 } | |
18163 if (json is Map) { | |
18164 String className; | |
18165 if (json.containsKey("className")) { | |
18166 className = jsonDecoder.decodeString( | |
18167 jsonPath + ".className", json["className"]); | |
18168 } | |
18169 String methodName; | |
18170 if (json.containsKey("methodName")) { | |
18171 methodName = jsonDecoder.decodeString( | |
18172 jsonPath + ".methodName", json["methodName"]); | |
18173 } else { | |
18174 throw jsonDecoder.missingKey(jsonPath, "methodName"); | |
18175 } | |
18176 bool isDeclaration; | |
18177 if (json.containsKey("isDeclaration")) { | |
18178 isDeclaration = jsonDecoder.decodeBool( | |
18179 jsonPath + ".isDeclaration", json["isDeclaration"]); | |
18180 } else { | |
18181 throw jsonDecoder.missingKey(jsonPath, "isDeclaration"); | |
18182 } | |
18183 return new InlineMethodFeedback(methodName, isDeclaration, | |
18184 className: className); | |
18185 } else { | |
18186 throw jsonDecoder.mismatch(jsonPath, "inlineMethod feedback", json); | |
18187 } | |
18188 } | |
18189 | |
18190 Map<String, dynamic> toJson() { | |
18191 Map<String, dynamic> result = {}; | |
18192 if (className != null) { | |
18193 result["className"] = className; | |
18194 } | |
18195 result["methodName"] = methodName; | |
18196 result["isDeclaration"] = isDeclaration; | |
18197 return result; | |
18198 } | |
18199 | |
18200 @override | |
18201 String toString() => JSON.encode(toJson()); | |
18202 | |
18203 @override | |
18204 bool operator ==(other) { | |
18205 if (other is InlineMethodFeedback) { | |
18206 return className == other.className && | |
18207 methodName == other.methodName && | |
18208 isDeclaration == other.isDeclaration; | |
18209 } | |
18210 return false; | |
18211 } | |
18212 | |
18213 @override | |
18214 int get hashCode { | |
18215 int hash = 0; | |
18216 hash = JenkinsSmiHash.combine(hash, className.hashCode); | |
18217 hash = JenkinsSmiHash.combine(hash, methodName.hashCode); | |
18218 hash = JenkinsSmiHash.combine(hash, isDeclaration.hashCode); | |
18219 return JenkinsSmiHash.finish(hash); | |
18220 } | |
18221 } | |
18222 | |
18223 /** | |
18224 * inlineMethod options | |
18225 * | |
18226 * { | |
18227 * "deleteSource": bool | |
18228 * "inlineAll": bool | |
18229 * } | |
18230 * | |
18231 * Clients may not extend, implement or mix-in this class. | |
18232 */ | |
18233 class InlineMethodOptions extends RefactoringOptions { | |
18234 bool _deleteSource; | |
18235 | |
18236 bool _inlineAll; | |
18237 | |
18238 /** | |
18239 * True if the method being inlined should be removed. It is an error if this | |
18240 * field is true and inlineAll is false. | |
18241 */ | |
18242 bool get deleteSource => _deleteSource; | |
18243 | |
18244 /** | |
18245 * True if the method being inlined should be removed. It is an error if this | |
18246 * field is true and inlineAll is false. | |
18247 */ | |
18248 void set deleteSource(bool value) { | |
18249 assert(value != null); | |
18250 this._deleteSource = value; | |
18251 } | |
18252 | |
18253 /** | |
18254 * True if all invocations of the method should be inlined, or false if only | |
18255 * the invocation site used to create this refactoring should be inlined. | |
18256 */ | |
18257 bool get inlineAll => _inlineAll; | |
18258 | |
18259 /** | |
18260 * True if all invocations of the method should be inlined, or false if only | |
18261 * the invocation site used to create this refactoring should be inlined. | |
18262 */ | |
18263 void set inlineAll(bool value) { | |
18264 assert(value != null); | |
18265 this._inlineAll = value; | |
18266 } | |
18267 | |
18268 InlineMethodOptions(bool deleteSource, bool inlineAll) { | |
18269 this.deleteSource = deleteSource; | |
18270 this.inlineAll = inlineAll; | |
18271 } | |
18272 | |
18273 factory InlineMethodOptions.fromJson( | |
18274 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
18275 if (json == null) { | |
18276 json = {}; | |
18277 } | |
18278 if (json is Map) { | |
18279 bool deleteSource; | |
18280 if (json.containsKey("deleteSource")) { | |
18281 deleteSource = jsonDecoder.decodeBool( | |
18282 jsonPath + ".deleteSource", json["deleteSource"]); | |
18283 } else { | |
18284 throw jsonDecoder.missingKey(jsonPath, "deleteSource"); | |
18285 } | |
18286 bool inlineAll; | |
18287 if (json.containsKey("inlineAll")) { | |
18288 inlineAll = | |
18289 jsonDecoder.decodeBool(jsonPath + ".inlineAll", json["inlineAll"]); | |
18290 } else { | |
18291 throw jsonDecoder.missingKey(jsonPath, "inlineAll"); | |
18292 } | |
18293 return new InlineMethodOptions(deleteSource, inlineAll); | |
18294 } else { | |
18295 throw jsonDecoder.mismatch(jsonPath, "inlineMethod options", json); | |
18296 } | |
18297 } | |
18298 | |
18299 factory InlineMethodOptions.fromRefactoringParams( | |
18300 EditGetRefactoringParams refactoringParams, Request request) { | |
18301 return new InlineMethodOptions.fromJson( | |
18302 new RequestDecoder(request), "options", refactoringParams.options); | |
18303 } | |
18304 | |
18305 Map<String, dynamic> toJson() { | |
18306 Map<String, dynamic> result = {}; | |
18307 result["deleteSource"] = deleteSource; | |
18308 result["inlineAll"] = inlineAll; | |
18309 return result; | |
18310 } | |
18311 | |
18312 @override | |
18313 String toString() => JSON.encode(toJson()); | |
18314 | |
18315 @override | |
18316 bool operator ==(other) { | |
18317 if (other is InlineMethodOptions) { | |
18318 return deleteSource == other.deleteSource && inlineAll == other.inlineAll; | |
18319 } | |
18320 return false; | |
18321 } | |
18322 | |
18323 @override | |
18324 int get hashCode { | |
18325 int hash = 0; | |
18326 hash = JenkinsSmiHash.combine(hash, deleteSource.hashCode); | |
18327 hash = JenkinsSmiHash.combine(hash, inlineAll.hashCode); | |
18328 return JenkinsSmiHash.finish(hash); | |
18329 } | |
18330 } | |
18331 | |
18332 /** | |
18333 * moveFile feedback | |
18334 * | |
18335 * Clients may not extend, implement or mix-in this class. | |
18336 */ | |
18337 class MoveFileFeedback extends RefactoringFeedback { | |
18338 @override | |
18339 bool operator ==(other) { | |
18340 if (other is MoveFileFeedback) { | |
18341 return true; | |
18342 } | |
18343 return false; | |
18344 } | |
18345 | |
18346 @override | |
18347 int get hashCode { | |
18348 return 438975893; | |
18349 } | |
18350 } | |
18351 | |
18352 /** | |
18353 * moveFile options | |
18354 * | |
18355 * { | |
18356 * "newFile": FilePath | |
18357 * } | |
18358 * | |
18359 * Clients may not extend, implement or mix-in this class. | |
18360 */ | |
18361 class MoveFileOptions extends RefactoringOptions { | |
18362 String _newFile; | |
18363 | |
18364 /** | |
18365 * The new file path to which the given file is being moved. | |
18366 */ | |
18367 String get newFile => _newFile; | |
18368 | |
18369 /** | |
18370 * The new file path to which the given file is being moved. | |
18371 */ | |
18372 void set newFile(String value) { | |
18373 assert(value != null); | |
18374 this._newFile = value; | |
18375 } | |
18376 | |
18377 MoveFileOptions(String newFile) { | |
18378 this.newFile = newFile; | |
18379 } | |
18380 | |
18381 factory MoveFileOptions.fromJson( | |
18382 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
18383 if (json == null) { | |
18384 json = {}; | |
18385 } | |
18386 if (json is Map) { | |
18387 String newFile; | |
18388 if (json.containsKey("newFile")) { | |
18389 newFile = | |
18390 jsonDecoder.decodeString(jsonPath + ".newFile", json["newFile"]); | |
18391 } else { | |
18392 throw jsonDecoder.missingKey(jsonPath, "newFile"); | |
18393 } | |
18394 return new MoveFileOptions(newFile); | |
18395 } else { | |
18396 throw jsonDecoder.mismatch(jsonPath, "moveFile options", json); | |
18397 } | |
18398 } | |
18399 | |
18400 factory MoveFileOptions.fromRefactoringParams( | |
18401 EditGetRefactoringParams refactoringParams, Request request) { | |
18402 return new MoveFileOptions.fromJson( | |
18403 new RequestDecoder(request), "options", refactoringParams.options); | |
18404 } | |
18405 | |
18406 Map<String, dynamic> toJson() { | |
18407 Map<String, dynamic> result = {}; | |
18408 result["newFile"] = newFile; | |
18409 return result; | |
18410 } | |
18411 | |
18412 @override | |
18413 String toString() => JSON.encode(toJson()); | |
18414 | |
18415 @override | |
18416 bool operator ==(other) { | |
18417 if (other is MoveFileOptions) { | |
18418 return newFile == other.newFile; | |
18419 } | |
18420 return false; | |
18421 } | |
18422 | |
18423 @override | |
18424 int get hashCode { | |
18425 int hash = 0; | |
18426 hash = JenkinsSmiHash.combine(hash, newFile.hashCode); | |
18427 return JenkinsSmiHash.finish(hash); | |
18428 } | |
18429 } | |
18430 | |
18431 /** | |
18432 * rename feedback | |
18433 * | |
18434 * { | |
18435 * "offset": int | |
18436 * "length": int | |
18437 * "elementKindName": String | |
18438 * "oldName": String | |
18439 * } | |
18440 * | |
18441 * Clients may not extend, implement or mix-in this class. | |
18442 */ | |
18443 class RenameFeedback extends RefactoringFeedback { | |
18444 int _offset; | |
18445 | |
18446 int _length; | |
18447 | |
18448 String _elementKindName; | |
18449 | |
18450 String _oldName; | |
18451 | |
18452 /** | |
18453 * The offset to the beginning of the name selected to be renamed. | |
18454 */ | |
18455 int get offset => _offset; | |
18456 | |
18457 /** | |
18458 * The offset to the beginning of the name selected to be renamed. | |
18459 */ | |
18460 void set offset(int value) { | |
18461 assert(value != null); | |
18462 this._offset = value; | |
18463 } | |
18464 | |
18465 /** | |
18466 * The length of the name selected to be renamed. | |
18467 */ | |
18468 int get length => _length; | |
18469 | |
18470 /** | |
18471 * The length of the name selected to be renamed. | |
18472 */ | |
18473 void set length(int value) { | |
18474 assert(value != null); | |
18475 this._length = value; | |
18476 } | |
18477 | |
18478 /** | |
18479 * The human-readable description of the kind of element being renamed (such | |
18480 * as "class" or "function type alias"). | |
18481 */ | |
18482 String get elementKindName => _elementKindName; | |
18483 | |
18484 /** | |
18485 * The human-readable description of the kind of element being renamed (such | |
18486 * as "class" or "function type alias"). | |
18487 */ | |
18488 void set elementKindName(String value) { | |
18489 assert(value != null); | |
18490 this._elementKindName = value; | |
18491 } | |
18492 | |
18493 /** | |
18494 * The old name of the element before the refactoring. | |
18495 */ | |
18496 String get oldName => _oldName; | |
18497 | |
18498 /** | |
18499 * The old name of the element before the refactoring. | |
18500 */ | |
18501 void set oldName(String value) { | |
18502 assert(value != null); | |
18503 this._oldName = value; | |
18504 } | |
18505 | |
18506 RenameFeedback( | |
18507 int offset, int length, String elementKindName, String oldName) { | |
18508 this.offset = offset; | |
18509 this.length = length; | |
18510 this.elementKindName = elementKindName; | |
18511 this.oldName = oldName; | |
18512 } | |
18513 | |
18514 factory RenameFeedback.fromJson( | |
18515 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
18516 if (json == null) { | |
18517 json = {}; | |
18518 } | |
18519 if (json is Map) { | |
18520 int offset; | |
18521 if (json.containsKey("offset")) { | |
18522 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
18523 } else { | |
18524 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
18525 } | |
18526 int length; | |
18527 if (json.containsKey("length")) { | |
18528 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
18529 } else { | |
18530 throw jsonDecoder.missingKey(jsonPath, "length"); | |
18531 } | |
18532 String elementKindName; | |
18533 if (json.containsKey("elementKindName")) { | |
18534 elementKindName = jsonDecoder.decodeString( | |
18535 jsonPath + ".elementKindName", json["elementKindName"]); | |
18536 } else { | |
18537 throw jsonDecoder.missingKey(jsonPath, "elementKindName"); | |
18538 } | |
18539 String oldName; | |
18540 if (json.containsKey("oldName")) { | |
18541 oldName = | |
18542 jsonDecoder.decodeString(jsonPath + ".oldName", json["oldName"]); | |
18543 } else { | |
18544 throw jsonDecoder.missingKey(jsonPath, "oldName"); | |
18545 } | |
18546 return new RenameFeedback(offset, length, elementKindName, oldName); | |
18547 } else { | |
18548 throw jsonDecoder.mismatch(jsonPath, "rename feedback", json); | |
18549 } | |
18550 } | |
18551 | |
18552 Map<String, dynamic> toJson() { | |
18553 Map<String, dynamic> result = {}; | |
18554 result["offset"] = offset; | |
18555 result["length"] = length; | |
18556 result["elementKindName"] = elementKindName; | |
18557 result["oldName"] = oldName; | |
18558 return result; | |
18559 } | |
18560 | |
18561 @override | |
18562 String toString() => JSON.encode(toJson()); | |
18563 | |
18564 @override | |
18565 bool operator ==(other) { | |
18566 if (other is RenameFeedback) { | |
18567 return offset == other.offset && | |
18568 length == other.length && | |
18569 elementKindName == other.elementKindName && | |
18570 oldName == other.oldName; | |
18571 } | |
18572 return false; | |
18573 } | |
18574 | |
18575 @override | |
18576 int get hashCode { | |
18577 int hash = 0; | |
18578 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
18579 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
18580 hash = JenkinsSmiHash.combine(hash, elementKindName.hashCode); | |
18581 hash = JenkinsSmiHash.combine(hash, oldName.hashCode); | |
18582 return JenkinsSmiHash.finish(hash); | |
18583 } | |
18584 } | |
18585 | |
18586 /** | |
18587 * rename options | |
18588 * | |
18589 * { | |
18590 * "newName": String | |
18591 * } | |
18592 * | |
18593 * Clients may not extend, implement or mix-in this class. | |
18594 */ | |
18595 class RenameOptions extends RefactoringOptions { | |
18596 String _newName; | |
18597 | |
18598 /** | |
18599 * The name that the element should have after the refactoring. | |
18600 */ | |
18601 String get newName => _newName; | |
18602 | |
18603 /** | |
18604 * The name that the element should have after the refactoring. | |
18605 */ | |
18606 void set newName(String value) { | |
18607 assert(value != null); | |
18608 this._newName = value; | |
18609 } | |
18610 | |
18611 RenameOptions(String newName) { | |
18612 this.newName = newName; | |
18613 } | |
18614 | |
18615 factory RenameOptions.fromJson( | |
18616 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
18617 if (json == null) { | |
18618 json = {}; | |
18619 } | |
18620 if (json is Map) { | |
18621 String newName; | |
18622 if (json.containsKey("newName")) { | |
18623 newName = | |
18624 jsonDecoder.decodeString(jsonPath + ".newName", json["newName"]); | |
18625 } else { | |
18626 throw jsonDecoder.missingKey(jsonPath, "newName"); | |
18627 } | |
18628 return new RenameOptions(newName); | |
18629 } else { | |
18630 throw jsonDecoder.mismatch(jsonPath, "rename options", json); | |
18631 } | |
18632 } | |
18633 | |
18634 factory RenameOptions.fromRefactoringParams( | |
18635 EditGetRefactoringParams refactoringParams, Request request) { | |
18636 return new RenameOptions.fromJson( | |
18637 new RequestDecoder(request), "options", refactoringParams.options); | |
18638 } | |
18639 | |
18640 Map<String, dynamic> toJson() { | |
18641 Map<String, dynamic> result = {}; | |
18642 result["newName"] = newName; | |
18643 return result; | |
18644 } | |
18645 | |
18646 @override | |
18647 String toString() => JSON.encode(toJson()); | |
18648 | |
18649 @override | |
18650 bool operator ==(other) { | |
18651 if (other is RenameOptions) { | |
18652 return newName == other.newName; | |
18653 } | |
18654 return false; | |
18655 } | |
18656 | |
18657 @override | |
18658 int get hashCode { | |
18659 int hash = 0; | |
18660 hash = JenkinsSmiHash.combine(hash, newName.hashCode); | |
18661 return JenkinsSmiHash.finish(hash); | |
18662 } | |
18663 } | |
OLD | NEW |