OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 // | 4 // |
5 // This file has been automatically generated. Please do not edit it manually. | 5 // This file has been automatically generated. Please do not edit it manually. |
6 // To regenerate the file, use the script | 6 // To regenerate the file, use the script |
7 // "pkg/analysis_server/tool/spec/generate_files". | 7 // "pkg/analysis_server/tool/spec/generate_files". |
8 | 8 |
9 import 'dart:convert' hide JsonDecoder; | 9 import 'dart:convert' hide JsonDecoder; |
10 | 10 |
11 import 'package:analyzer/src/generated/utilities_general.dart'; | 11 import 'package:analyzer/src/generated/utilities_general.dart'; |
12 import 'package:analysis_server/protocol/protocol.dart'; | 12 import 'package:analysis_server/protocol/protocol.dart'; |
13 import 'package:analysis_server/src/protocol/protocol_internal.dart'; | 13 import 'package:analysis_server/src/protocol/protocol_internal.dart'; |
14 | 14 import 'package:analyzer_plugin/protocol/protocol_common.dart'; |
15 /** | |
16 * AddContentOverlay | |
17 * | |
18 * { | |
19 * "type": "add" | |
20 * "content": String | |
21 * } | |
22 * | |
23 * Clients may not extend, implement or mix-in this class. | |
24 */ | |
25 class AddContentOverlay implements HasToJson { | |
26 String _content; | |
27 | |
28 /** | |
29 * The new content of the file. | |
30 */ | |
31 String get content => _content; | |
32 | |
33 /** | |
34 * The new content of the file. | |
35 */ | |
36 void set content(String value) { | |
37 assert(value != null); | |
38 this._content = value; | |
39 } | |
40 | |
41 AddContentOverlay(String content) { | |
42 this.content = content; | |
43 } | |
44 | |
45 factory AddContentOverlay.fromJson( | |
46 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
47 if (json == null) { | |
48 json = {}; | |
49 } | |
50 if (json is Map) { | |
51 if (json["type"] != "add") { | |
52 throw jsonDecoder.mismatch(jsonPath, "equal " + "add", json); | |
53 } | |
54 String content; | |
55 if (json.containsKey("content")) { | |
56 content = | |
57 jsonDecoder.decodeString(jsonPath + ".content", json["content"]); | |
58 } else { | |
59 throw jsonDecoder.mismatch(jsonPath, "content"); | |
60 } | |
61 return new AddContentOverlay(content); | |
62 } else { | |
63 throw jsonDecoder.mismatch(jsonPath, "AddContentOverlay", json); | |
64 } | |
65 } | |
66 | |
67 @override | |
68 Map<String, dynamic> toJson() { | |
69 Map<String, dynamic> result = {}; | |
70 result["type"] = "add"; | |
71 result["content"] = content; | |
72 return result; | |
73 } | |
74 | |
75 @override | |
76 String toString() => JSON.encode(toJson()); | |
77 | |
78 @override | |
79 bool operator ==(other) { | |
80 if (other is AddContentOverlay) { | |
81 return content == other.content; | |
82 } | |
83 return false; | |
84 } | |
85 | |
86 @override | |
87 int get hashCode { | |
88 int hash = 0; | |
89 hash = JenkinsSmiHash.combine(hash, 704418402); | |
90 hash = JenkinsSmiHash.combine(hash, content.hashCode); | |
91 return JenkinsSmiHash.finish(hash); | |
92 } | |
93 } | |
94 | 15 |
95 /** | 16 /** |
96 * analysis.analyzedFiles params | 17 * analysis.analyzedFiles params |
97 * | 18 * |
98 * { | 19 * { |
99 * "directories": List<FilePath> | 20 * "directories": List<FilePath> |
100 * } | 21 * } |
101 * | 22 * |
102 * Clients may not extend, implement or mix-in this class. | 23 * Clients may not extend, implement or mix-in this class. |
103 */ | 24 */ |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 93 |
173 @override | 94 @override |
174 int get hashCode { | 95 int get hashCode { |
175 int hash = 0; | 96 int hash = 0; |
176 hash = JenkinsSmiHash.combine(hash, directories.hashCode); | 97 hash = JenkinsSmiHash.combine(hash, directories.hashCode); |
177 return JenkinsSmiHash.finish(hash); | 98 return JenkinsSmiHash.finish(hash); |
178 } | 99 } |
179 } | 100 } |
180 | 101 |
181 /** | 102 /** |
182 * AnalysisError | |
183 * | |
184 * { | |
185 * "severity": AnalysisErrorSeverity | |
186 * "type": AnalysisErrorType | |
187 * "location": Location | |
188 * "message": String | |
189 * "correction": optional String | |
190 * "code": String | |
191 * "hasFix": optional bool | |
192 * } | |
193 * | |
194 * Clients may not extend, implement or mix-in this class. | |
195 */ | |
196 class AnalysisError implements HasToJson { | |
197 AnalysisErrorSeverity _severity; | |
198 | |
199 AnalysisErrorType _type; | |
200 | |
201 Location _location; | |
202 | |
203 String _message; | |
204 | |
205 String _correction; | |
206 | |
207 String _code; | |
208 | |
209 bool _hasFix; | |
210 | |
211 /** | |
212 * The severity of the error. | |
213 */ | |
214 AnalysisErrorSeverity get severity => _severity; | |
215 | |
216 /** | |
217 * The severity of the error. | |
218 */ | |
219 void set severity(AnalysisErrorSeverity value) { | |
220 assert(value != null); | |
221 this._severity = value; | |
222 } | |
223 | |
224 /** | |
225 * The type of the error. | |
226 */ | |
227 AnalysisErrorType get type => _type; | |
228 | |
229 /** | |
230 * The type of the error. | |
231 */ | |
232 void set type(AnalysisErrorType value) { | |
233 assert(value != null); | |
234 this._type = value; | |
235 } | |
236 | |
237 /** | |
238 * The location associated with the error. | |
239 */ | |
240 Location get location => _location; | |
241 | |
242 /** | |
243 * The location associated with the error. | |
244 */ | |
245 void set location(Location value) { | |
246 assert(value != null); | |
247 this._location = value; | |
248 } | |
249 | |
250 /** | |
251 * The message to be displayed for this error. The message should indicate | |
252 * what is wrong with the code and why it is wrong. | |
253 */ | |
254 String get message => _message; | |
255 | |
256 /** | |
257 * The message to be displayed for this error. The message should indicate | |
258 * what is wrong with the code and why it is wrong. | |
259 */ | |
260 void set message(String value) { | |
261 assert(value != null); | |
262 this._message = value; | |
263 } | |
264 | |
265 /** | |
266 * The correction message to be displayed for this error. The correction | |
267 * message should indicate how the user can fix the error. The field is | |
268 * omitted if there is no correction message associated with the error code. | |
269 */ | |
270 String get correction => _correction; | |
271 | |
272 /** | |
273 * The correction message to be displayed for this error. The correction | |
274 * message should indicate how the user can fix the error. The field is | |
275 * omitted if there is no correction message associated with the error code. | |
276 */ | |
277 void set correction(String value) { | |
278 this._correction = value; | |
279 } | |
280 | |
281 /** | |
282 * The name, as a string, of the error code associated with this error. | |
283 */ | |
284 String get code => _code; | |
285 | |
286 /** | |
287 * The name, as a string, of the error code associated with this error. | |
288 */ | |
289 void set code(String value) { | |
290 assert(value != null); | |
291 this._code = value; | |
292 } | |
293 | |
294 /** | |
295 * A hint to indicate to interested clients that this error has an associated | |
296 * fix (or fixes). The absence of this field implies there are not known to | |
297 * be fixes. Note that since the operation to calculate whether fixes apply | |
298 * needs to be performant it is possible that complicated tests will be | |
299 * skipped and a false negative returned. For this reason, this attribute | |
300 * should be treated as a "hint". Despite the possibility of false negatives, | |
301 * no false positives should be returned. If a client sees this flag set they | |
302 * can proceed with the confidence that there are in fact associated fixes. | |
303 */ | |
304 bool get hasFix => _hasFix; | |
305 | |
306 /** | |
307 * A hint to indicate to interested clients that this error has an associated | |
308 * fix (or fixes). The absence of this field implies there are not known to | |
309 * be fixes. Note that since the operation to calculate whether fixes apply | |
310 * needs to be performant it is possible that complicated tests will be | |
311 * skipped and a false negative returned. For this reason, this attribute | |
312 * should be treated as a "hint". Despite the possibility of false negatives, | |
313 * no false positives should be returned. If a client sees this flag set they | |
314 * can proceed with the confidence that there are in fact associated fixes. | |
315 */ | |
316 void set hasFix(bool value) { | |
317 this._hasFix = value; | |
318 } | |
319 | |
320 AnalysisError(AnalysisErrorSeverity severity, AnalysisErrorType type, | |
321 Location location, String message, String code, | |
322 {String correction, bool hasFix}) { | |
323 this.severity = severity; | |
324 this.type = type; | |
325 this.location = location; | |
326 this.message = message; | |
327 this.correction = correction; | |
328 this.code = code; | |
329 this.hasFix = hasFix; | |
330 } | |
331 | |
332 factory AnalysisError.fromJson( | |
333 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
334 if (json == null) { | |
335 json = {}; | |
336 } | |
337 if (json is Map) { | |
338 AnalysisErrorSeverity severity; | |
339 if (json.containsKey("severity")) { | |
340 severity = new AnalysisErrorSeverity.fromJson( | |
341 jsonDecoder, jsonPath + ".severity", json["severity"]); | |
342 } else { | |
343 throw jsonDecoder.mismatch(jsonPath, "severity"); | |
344 } | |
345 AnalysisErrorType type; | |
346 if (json.containsKey("type")) { | |
347 type = new AnalysisErrorType.fromJson( | |
348 jsonDecoder, jsonPath + ".type", json["type"]); | |
349 } else { | |
350 throw jsonDecoder.mismatch(jsonPath, "type"); | |
351 } | |
352 Location location; | |
353 if (json.containsKey("location")) { | |
354 location = new Location.fromJson( | |
355 jsonDecoder, jsonPath + ".location", json["location"]); | |
356 } else { | |
357 throw jsonDecoder.mismatch(jsonPath, "location"); | |
358 } | |
359 String message; | |
360 if (json.containsKey("message")) { | |
361 message = | |
362 jsonDecoder.decodeString(jsonPath + ".message", json["message"]); | |
363 } else { | |
364 throw jsonDecoder.mismatch(jsonPath, "message"); | |
365 } | |
366 String correction; | |
367 if (json.containsKey("correction")) { | |
368 correction = jsonDecoder.decodeString( | |
369 jsonPath + ".correction", json["correction"]); | |
370 } | |
371 String code; | |
372 if (json.containsKey("code")) { | |
373 code = jsonDecoder.decodeString(jsonPath + ".code", json["code"]); | |
374 } else { | |
375 throw jsonDecoder.mismatch(jsonPath, "code"); | |
376 } | |
377 bool hasFix; | |
378 if (json.containsKey("hasFix")) { | |
379 hasFix = jsonDecoder.decodeBool(jsonPath + ".hasFix", json["hasFix"]); | |
380 } | |
381 return new AnalysisError(severity, type, location, message, code, | |
382 correction: correction, hasFix: hasFix); | |
383 } else { | |
384 throw jsonDecoder.mismatch(jsonPath, "AnalysisError", json); | |
385 } | |
386 } | |
387 | |
388 @override | |
389 Map<String, dynamic> toJson() { | |
390 Map<String, dynamic> result = {}; | |
391 result["severity"] = severity.toJson(); | |
392 result["type"] = type.toJson(); | |
393 result["location"] = location.toJson(); | |
394 result["message"] = message; | |
395 if (correction != null) { | |
396 result["correction"] = correction; | |
397 } | |
398 result["code"] = code; | |
399 if (hasFix != null) { | |
400 result["hasFix"] = hasFix; | |
401 } | |
402 return result; | |
403 } | |
404 | |
405 @override | |
406 String toString() => JSON.encode(toJson()); | |
407 | |
408 @override | |
409 bool operator ==(other) { | |
410 if (other is AnalysisError) { | |
411 return severity == other.severity && | |
412 type == other.type && | |
413 location == other.location && | |
414 message == other.message && | |
415 correction == other.correction && | |
416 code == other.code && | |
417 hasFix == other.hasFix; | |
418 } | |
419 return false; | |
420 } | |
421 | |
422 @override | |
423 int get hashCode { | |
424 int hash = 0; | |
425 hash = JenkinsSmiHash.combine(hash, severity.hashCode); | |
426 hash = JenkinsSmiHash.combine(hash, type.hashCode); | |
427 hash = JenkinsSmiHash.combine(hash, location.hashCode); | |
428 hash = JenkinsSmiHash.combine(hash, message.hashCode); | |
429 hash = JenkinsSmiHash.combine(hash, correction.hashCode); | |
430 hash = JenkinsSmiHash.combine(hash, code.hashCode); | |
431 hash = JenkinsSmiHash.combine(hash, hasFix.hashCode); | |
432 return JenkinsSmiHash.finish(hash); | |
433 } | |
434 } | |
435 | |
436 /** | |
437 * AnalysisErrorFixes | 103 * AnalysisErrorFixes |
438 * | 104 * |
439 * { | 105 * { |
440 * "error": AnalysisError | 106 * "error": AnalysisError |
441 * "fixes": List<SourceChange> | 107 * "fixes": List<SourceChange> |
442 * } | 108 * } |
443 * | 109 * |
444 * Clients may not extend, implement or mix-in this class. | 110 * Clients may not extend, implement or mix-in this class. |
445 */ | 111 */ |
446 class AnalysisErrorFixes implements HasToJson { | 112 class AnalysisErrorFixes implements HasToJson { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 @override | 203 @override |
538 int get hashCode { | 204 int get hashCode { |
539 int hash = 0; | 205 int hash = 0; |
540 hash = JenkinsSmiHash.combine(hash, error.hashCode); | 206 hash = JenkinsSmiHash.combine(hash, error.hashCode); |
541 hash = JenkinsSmiHash.combine(hash, fixes.hashCode); | 207 hash = JenkinsSmiHash.combine(hash, fixes.hashCode); |
542 return JenkinsSmiHash.finish(hash); | 208 return JenkinsSmiHash.finish(hash); |
543 } | 209 } |
544 } | 210 } |
545 | 211 |
546 /** | 212 /** |
547 * AnalysisErrorSeverity | |
548 * | |
549 * enum { | |
550 * INFO | |
551 * WARNING | |
552 * ERROR | |
553 * } | |
554 * | |
555 * Clients may not extend, implement or mix-in this class. | |
556 */ | |
557 class AnalysisErrorSeverity implements Enum { | |
558 static const AnalysisErrorSeverity INFO = | |
559 const AnalysisErrorSeverity._("INFO"); | |
560 | |
561 static const AnalysisErrorSeverity WARNING = | |
562 const AnalysisErrorSeverity._("WARNING"); | |
563 | |
564 static const AnalysisErrorSeverity ERROR = | |
565 const AnalysisErrorSeverity._("ERROR"); | |
566 | |
567 /** | |
568 * A list containing all of the enum values that are defined. | |
569 */ | |
570 static const List<AnalysisErrorSeverity> VALUES = | |
571 const <AnalysisErrorSeverity>[INFO, WARNING, ERROR]; | |
572 | |
573 @override | |
574 final String name; | |
575 | |
576 const AnalysisErrorSeverity._(this.name); | |
577 | |
578 factory AnalysisErrorSeverity(String name) { | |
579 switch (name) { | |
580 case "INFO": | |
581 return INFO; | |
582 case "WARNING": | |
583 return WARNING; | |
584 case "ERROR": | |
585 return ERROR; | |
586 } | |
587 throw new Exception('Illegal enum value: $name'); | |
588 } | |
589 | |
590 factory AnalysisErrorSeverity.fromJson( | |
591 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
592 if (json is String) { | |
593 try { | |
594 return new AnalysisErrorSeverity(json); | |
595 } catch (_) { | |
596 // Fall through | |
597 } | |
598 } | |
599 throw jsonDecoder.mismatch(jsonPath, "AnalysisErrorSeverity", json); | |
600 } | |
601 | |
602 @override | |
603 String toString() => "AnalysisErrorSeverity.$name"; | |
604 | |
605 String toJson() => name; | |
606 } | |
607 | |
608 /** | |
609 * AnalysisErrorType | |
610 * | |
611 * enum { | |
612 * CHECKED_MODE_COMPILE_TIME_ERROR | |
613 * COMPILE_TIME_ERROR | |
614 * HINT | |
615 * LINT | |
616 * STATIC_TYPE_WARNING | |
617 * STATIC_WARNING | |
618 * SYNTACTIC_ERROR | |
619 * TODO | |
620 * } | |
621 * | |
622 * Clients may not extend, implement or mix-in this class. | |
623 */ | |
624 class AnalysisErrorType implements Enum { | |
625 static const AnalysisErrorType CHECKED_MODE_COMPILE_TIME_ERROR = | |
626 const AnalysisErrorType._("CHECKED_MODE_COMPILE_TIME_ERROR"); | |
627 | |
628 static const AnalysisErrorType COMPILE_TIME_ERROR = | |
629 const AnalysisErrorType._("COMPILE_TIME_ERROR"); | |
630 | |
631 static const AnalysisErrorType HINT = const AnalysisErrorType._("HINT"); | |
632 | |
633 static const AnalysisErrorType LINT = const AnalysisErrorType._("LINT"); | |
634 | |
635 static const AnalysisErrorType STATIC_TYPE_WARNING = | |
636 const AnalysisErrorType._("STATIC_TYPE_WARNING"); | |
637 | |
638 static const AnalysisErrorType STATIC_WARNING = | |
639 const AnalysisErrorType._("STATIC_WARNING"); | |
640 | |
641 static const AnalysisErrorType SYNTACTIC_ERROR = | |
642 const AnalysisErrorType._("SYNTACTIC_ERROR"); | |
643 | |
644 static const AnalysisErrorType TODO = const AnalysisErrorType._("TODO"); | |
645 | |
646 /** | |
647 * A list containing all of the enum values that are defined. | |
648 */ | |
649 static const List<AnalysisErrorType> VALUES = const <AnalysisErrorType>[ | |
650 CHECKED_MODE_COMPILE_TIME_ERROR, | |
651 COMPILE_TIME_ERROR, | |
652 HINT, | |
653 LINT, | |
654 STATIC_TYPE_WARNING, | |
655 STATIC_WARNING, | |
656 SYNTACTIC_ERROR, | |
657 TODO | |
658 ]; | |
659 | |
660 @override | |
661 final String name; | |
662 | |
663 const AnalysisErrorType._(this.name); | |
664 | |
665 factory AnalysisErrorType(String name) { | |
666 switch (name) { | |
667 case "CHECKED_MODE_COMPILE_TIME_ERROR": | |
668 return CHECKED_MODE_COMPILE_TIME_ERROR; | |
669 case "COMPILE_TIME_ERROR": | |
670 return COMPILE_TIME_ERROR; | |
671 case "HINT": | |
672 return HINT; | |
673 case "LINT": | |
674 return LINT; | |
675 case "STATIC_TYPE_WARNING": | |
676 return STATIC_TYPE_WARNING; | |
677 case "STATIC_WARNING": | |
678 return STATIC_WARNING; | |
679 case "SYNTACTIC_ERROR": | |
680 return SYNTACTIC_ERROR; | |
681 case "TODO": | |
682 return TODO; | |
683 } | |
684 throw new Exception('Illegal enum value: $name'); | |
685 } | |
686 | |
687 factory AnalysisErrorType.fromJson( | |
688 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
689 if (json is String) { | |
690 try { | |
691 return new AnalysisErrorType(json); | |
692 } catch (_) { | |
693 // Fall through | |
694 } | |
695 } | |
696 throw jsonDecoder.mismatch(jsonPath, "AnalysisErrorType", json); | |
697 } | |
698 | |
699 @override | |
700 String toString() => "AnalysisErrorType.$name"; | |
701 | |
702 String toJson() => name; | |
703 } | |
704 | |
705 /** | |
706 * analysis.errors params | 213 * analysis.errors params |
707 * | 214 * |
708 * { | 215 * { |
709 * "file": FilePath | 216 * "file": FilePath |
710 * "errors": List<AnalysisError> | 217 * "errors": List<AnalysisError> |
711 * } | 218 * } |
712 * | 219 * |
713 * Clients may not extend, implement or mix-in this class. | 220 * Clients may not extend, implement or mix-in this class. |
714 */ | 221 */ |
715 class AnalysisErrorsParams implements HasToJson { | 222 class AnalysisErrorsParams implements HasToJson { |
(...skipping 3795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4511 return false; | 4018 return false; |
4512 } | 4019 } |
4513 | 4020 |
4514 @override | 4021 @override |
4515 int get hashCode { | 4022 int get hashCode { |
4516 return 179689467; | 4023 return 179689467; |
4517 } | 4024 } |
4518 } | 4025 } |
4519 | 4026 |
4520 /** | 4027 /** |
4521 * ChangeContentOverlay | |
4522 * | |
4523 * { | |
4524 * "type": "change" | |
4525 * "edits": List<SourceEdit> | |
4526 * } | |
4527 * | |
4528 * Clients may not extend, implement or mix-in this class. | |
4529 */ | |
4530 class ChangeContentOverlay implements HasToJson { | |
4531 List<SourceEdit> _edits; | |
4532 | |
4533 /** | |
4534 * The edits to be applied to the file. | |
4535 */ | |
4536 List<SourceEdit> get edits => _edits; | |
4537 | |
4538 /** | |
4539 * The edits to be applied to the file. | |
4540 */ | |
4541 void set edits(List<SourceEdit> value) { | |
4542 assert(value != null); | |
4543 this._edits = value; | |
4544 } | |
4545 | |
4546 ChangeContentOverlay(List<SourceEdit> edits) { | |
4547 this.edits = edits; | |
4548 } | |
4549 | |
4550 factory ChangeContentOverlay.fromJson( | |
4551 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
4552 if (json == null) { | |
4553 json = {}; | |
4554 } | |
4555 if (json is Map) { | |
4556 if (json["type"] != "change") { | |
4557 throw jsonDecoder.mismatch(jsonPath, "equal " + "change", json); | |
4558 } | |
4559 List<SourceEdit> edits; | |
4560 if (json.containsKey("edits")) { | |
4561 edits = jsonDecoder.decodeList( | |
4562 jsonPath + ".edits", | |
4563 json["edits"], | |
4564 (String jsonPath, Object json) => | |
4565 new SourceEdit.fromJson(jsonDecoder, jsonPath, json)); | |
4566 } else { | |
4567 throw jsonDecoder.mismatch(jsonPath, "edits"); | |
4568 } | |
4569 return new ChangeContentOverlay(edits); | |
4570 } else { | |
4571 throw jsonDecoder.mismatch(jsonPath, "ChangeContentOverlay", json); | |
4572 } | |
4573 } | |
4574 | |
4575 @override | |
4576 Map<String, dynamic> toJson() { | |
4577 Map<String, dynamic> result = {}; | |
4578 result["type"] = "change"; | |
4579 result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList(); | |
4580 return result; | |
4581 } | |
4582 | |
4583 @override | |
4584 String toString() => JSON.encode(toJson()); | |
4585 | |
4586 @override | |
4587 bool operator ==(other) { | |
4588 if (other is ChangeContentOverlay) { | |
4589 return listEqual( | |
4590 edits, other.edits, (SourceEdit a, SourceEdit b) => a == b); | |
4591 } | |
4592 return false; | |
4593 } | |
4594 | |
4595 @override | |
4596 int get hashCode { | |
4597 int hash = 0; | |
4598 hash = JenkinsSmiHash.combine(hash, 873118866); | |
4599 hash = JenkinsSmiHash.combine(hash, edits.hashCode); | |
4600 return JenkinsSmiHash.finish(hash); | |
4601 } | |
4602 } | |
4603 | |
4604 /** | |
4605 * completion.getSuggestions params | 4028 * completion.getSuggestions params |
4606 * | 4029 * |
4607 * { | 4030 * { |
4608 * "file": FilePath | 4031 * "file": FilePath |
4609 * "offset": int | 4032 * "offset": int |
4610 * } | 4033 * } |
4611 * | 4034 * |
4612 * Clients may not extend, implement or mix-in this class. | 4035 * Clients may not extend, implement or mix-in this class. |
4613 */ | 4036 */ |
4614 class CompletionGetSuggestionsParams implements RequestParams { | 4037 class CompletionGetSuggestionsParams implements RequestParams { |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5006 hash = JenkinsSmiHash.combine(hash, id.hashCode); | 4429 hash = JenkinsSmiHash.combine(hash, id.hashCode); |
5007 hash = JenkinsSmiHash.combine(hash, replacementOffset.hashCode); | 4430 hash = JenkinsSmiHash.combine(hash, replacementOffset.hashCode); |
5008 hash = JenkinsSmiHash.combine(hash, replacementLength.hashCode); | 4431 hash = JenkinsSmiHash.combine(hash, replacementLength.hashCode); |
5009 hash = JenkinsSmiHash.combine(hash, results.hashCode); | 4432 hash = JenkinsSmiHash.combine(hash, results.hashCode); |
5010 hash = JenkinsSmiHash.combine(hash, isLast.hashCode); | 4433 hash = JenkinsSmiHash.combine(hash, isLast.hashCode); |
5011 return JenkinsSmiHash.finish(hash); | 4434 return JenkinsSmiHash.finish(hash); |
5012 } | 4435 } |
5013 } | 4436 } |
5014 | 4437 |
5015 /** | 4438 /** |
5016 * CompletionSuggestion | 4439 * ContextData |
5017 * | 4440 * |
5018 * { | 4441 * { |
5019 * "kind": CompletionSuggestionKind | 4442 * "name": String |
5020 * "relevance": int | 4443 * "explicitFileCount": int |
5021 * "completion": String | 4444 * "implicitFileCount": int |
5022 * "selectionOffset": int | 4445 * "workItemQueueLength": int |
5023 * "selectionLength": int | 4446 * "cacheEntryExceptions": List<String> |
5024 * "isDeprecated": bool | |
5025 * "isPotential": bool | |
5026 * "docSummary": optional String | |
5027 * "docComplete": optional String | |
5028 * "declaringType": optional String | |
5029 * "defaultArgumentListString": optional String | |
5030 * "defaultArgumentListTextRanges": optional List<int> | |
5031 * "element": optional Element | |
5032 * "returnType": optional String | |
5033 * "parameterNames": optional List<String> | |
5034 * "parameterTypes": optional List<String> | |
5035 * "requiredParameterCount": optional int | |
5036 * "hasNamedParameters": optional bool | |
5037 * "parameterName": optional String | |
5038 * "parameterType": optional String | |
5039 * "importUri": optional String | |
5040 * } | 4447 * } |
5041 * | 4448 * |
5042 * Clients may not extend, implement or mix-in this class. | 4449 * Clients may not extend, implement or mix-in this class. |
5043 */ | 4450 */ |
5044 class CompletionSuggestion implements HasToJson { | 4451 class ContextData implements HasToJson { |
5045 CompletionSuggestionKind _kind; | 4452 String _name; |
5046 | 4453 |
5047 int _relevance; | 4454 int _explicitFileCount; |
5048 | 4455 |
5049 String _completion; | 4456 int _implicitFileCount; |
5050 | 4457 |
5051 int _selectionOffset; | 4458 int _workItemQueueLength; |
5052 | 4459 |
5053 int _selectionLength; | 4460 List<String> _cacheEntryExceptions; |
5054 | |
5055 bool _isDeprecated; | |
5056 | |
5057 bool _isPotential; | |
5058 | |
5059 String _docSummary; | |
5060 | |
5061 String _docComplete; | |
5062 | |
5063 String _declaringType; | |
5064 | |
5065 String _defaultArgumentListString; | |
5066 | |
5067 List<int> _defaultArgumentListTextRanges; | |
5068 | |
5069 Element _element; | |
5070 | |
5071 String _returnType; | |
5072 | |
5073 List<String> _parameterNames; | |
5074 | |
5075 List<String> _parameterTypes; | |
5076 | |
5077 int _requiredParameterCount; | |
5078 | |
5079 bool _hasNamedParameters; | |
5080 | |
5081 String _parameterName; | |
5082 | |
5083 String _parameterType; | |
5084 | |
5085 String _importUri; | |
5086 | 4461 |
5087 /** | 4462 /** |
5088 * The kind of element being suggested. | 4463 * The name of the context. |
5089 */ | 4464 */ |
5090 CompletionSuggestionKind get kind => _kind; | 4465 String get name => _name; |
5091 | 4466 |
5092 /** | 4467 /** |
5093 * The kind of element being suggested. | 4468 * The name of the context. |
5094 */ | 4469 */ |
5095 void set kind(CompletionSuggestionKind value) { | 4470 void set name(String value) { |
5096 assert(value != null); | 4471 assert(value != null); |
5097 this._kind = value; | 4472 this._name = value; |
5098 } | 4473 } |
5099 | 4474 |
5100 /** | 4475 /** |
5101 * The relevance of this completion suggestion where a higher number | 4476 * Explicitly analyzed files. |
5102 * indicates a higher relevance. | |
5103 */ | 4477 */ |
5104 int get relevance => _relevance; | 4478 int get explicitFileCount => _explicitFileCount; |
5105 | 4479 |
5106 /** | 4480 /** |
5107 * The relevance of this completion suggestion where a higher number | 4481 * Explicitly analyzed files. |
5108 * indicates a higher relevance. | |
5109 */ | 4482 */ |
5110 void set relevance(int value) { | 4483 void set explicitFileCount(int value) { |
5111 assert(value != null); | 4484 assert(value != null); |
5112 this._relevance = value; | 4485 this._explicitFileCount = value; |
5113 } | 4486 } |
5114 | 4487 |
5115 /** | 4488 /** |
5116 * The identifier to be inserted if the suggestion is selected. If the | 4489 * Implicitly analyzed files. |
5117 * suggestion is for a method or function, the client might want to | |
5118 * additionally insert a template for the parameters. The information | |
5119 * required in order to do so is contained in other fields. | |
5120 */ | 4490 */ |
5121 String get completion => _completion; | 4491 int get implicitFileCount => _implicitFileCount; |
5122 | 4492 |
5123 /** | 4493 /** |
5124 * The identifier to be inserted if the suggestion is selected. If the | 4494 * Implicitly analyzed files. |
5125 * suggestion is for a method or function, the client might want to | |
5126 * additionally insert a template for the parameters. The information | |
5127 * required in order to do so is contained in other fields. | |
5128 */ | 4495 */ |
5129 void set completion(String value) { | 4496 void set implicitFileCount(int value) { |
5130 assert(value != null); | 4497 assert(value != null); |
5131 this._completion = value; | 4498 this._implicitFileCount = value; |
5132 } | 4499 } |
5133 | 4500 |
5134 /** | 4501 /** |
5135 * The offset, relative to the beginning of the completion, of where the | 4502 * The number of work items in the queue. |
5136 * selection should be placed after insertion. | |
5137 */ | 4503 */ |
5138 int get selectionOffset => _selectionOffset; | 4504 int get workItemQueueLength => _workItemQueueLength; |
5139 | 4505 |
5140 /** | 4506 /** |
5141 * The offset, relative to the beginning of the completion, of where the | 4507 * The number of work items in the queue. |
5142 * selection should be placed after insertion. | |
5143 */ | 4508 */ |
5144 void set selectionOffset(int value) { | 4509 void set workItemQueueLength(int value) { |
5145 assert(value != null); | 4510 assert(value != null); |
5146 this._selectionOffset = value; | 4511 this._workItemQueueLength = value; |
5147 } | 4512 } |
5148 | 4513 |
5149 /** | 4514 /** |
5150 * The number of characters that should be selected after insertion. | 4515 * Exceptions associated with cache entries. |
5151 */ | 4516 */ |
5152 int get selectionLength => _selectionLength; | 4517 List<String> get cacheEntryExceptions => _cacheEntryExceptions; |
5153 | 4518 |
5154 /** | 4519 /** |
5155 * The number of characters that should be selected after insertion. | 4520 * Exceptions associated with cache entries. |
5156 */ | 4521 */ |
5157 void set selectionLength(int value) { | 4522 void set cacheEntryExceptions(List<String> value) { |
5158 assert(value != null); | 4523 assert(value != null); |
5159 this._selectionLength = value; | 4524 this._cacheEntryExceptions = value; |
5160 } | 4525 } |
5161 | 4526 |
5162 /** | 4527 ContextData(String name, int explicitFileCount, int implicitFileCount, |
5163 * True if the suggested element is deprecated. | 4528 int workItemQueueLength, List<String> cacheEntryExceptions) { |
5164 */ | 4529 this.name = name; |
5165 bool get isDeprecated => _isDeprecated; | 4530 this.explicitFileCount = explicitFileCount; |
5166 | 4531 this.implicitFileCount = implicitFileCount; |
5167 /** | 4532 this.workItemQueueLength = workItemQueueLength; |
5168 * True if the suggested element is deprecated. | 4533 this.cacheEntryExceptions = cacheEntryExceptions; |
5169 */ | |
5170 void set isDeprecated(bool value) { | |
5171 assert(value != null); | |
5172 this._isDeprecated = value; | |
5173 } | 4534 } |
5174 | 4535 |
5175 /** | 4536 factory ContextData.fromJson( |
5176 * True if the element is not known to be valid for the target. This happens | |
5177 * if the type of the target is dynamic. | |
5178 */ | |
5179 bool get isPotential => _isPotential; | |
5180 | |
5181 /** | |
5182 * True if the element is not known to be valid for the target. This happens | |
5183 * if the type of the target is dynamic. | |
5184 */ | |
5185 void set isPotential(bool value) { | |
5186 assert(value != null); | |
5187 this._isPotential = value; | |
5188 } | |
5189 | |
5190 /** | |
5191 * An abbreviated version of the Dartdoc associated with the element being | |
5192 * suggested, This field is omitted if there is no Dartdoc associated with | |
5193 * the element. | |
5194 */ | |
5195 String get docSummary => _docSummary; | |
5196 | |
5197 /** | |
5198 * An abbreviated version of the Dartdoc associated with the element being | |
5199 * suggested, This field is omitted if there is no Dartdoc associated with | |
5200 * the element. | |
5201 */ | |
5202 void set docSummary(String value) { | |
5203 this._docSummary = value; | |
5204 } | |
5205 | |
5206 /** | |
5207 * The Dartdoc associated with the element being suggested, This field is | |
5208 * omitted if there is no Dartdoc associated with the element. | |
5209 */ | |
5210 String get docComplete => _docComplete; | |
5211 | |
5212 /** | |
5213 * The Dartdoc associated with the element being suggested, This field is | |
5214 * omitted if there is no Dartdoc associated with the element. | |
5215 */ | |
5216 void set docComplete(String value) { | |
5217 this._docComplete = value; | |
5218 } | |
5219 | |
5220 /** | |
5221 * The class that declares the element being suggested. This field is omitted | |
5222 * if the suggested element is not a member of a class. | |
5223 */ | |
5224 String get declaringType => _declaringType; | |
5225 | |
5226 /** | |
5227 * The class that declares the element being suggested. This field is omitted | |
5228 * if the suggested element is not a member of a class. | |
5229 */ | |
5230 void set declaringType(String value) { | |
5231 this._declaringType = value; | |
5232 } | |
5233 | |
5234 /** | |
5235 * A default String for use in generating argument list source contents on | |
5236 * the client side. | |
5237 */ | |
5238 String get defaultArgumentListString => _defaultArgumentListString; | |
5239 | |
5240 /** | |
5241 * A default String for use in generating argument list source contents on | |
5242 * the client side. | |
5243 */ | |
5244 void set defaultArgumentListString(String value) { | |
5245 this._defaultArgumentListString = value; | |
5246 } | |
5247 | |
5248 /** | |
5249 * Pairs of offsets and lengths describing 'defaultArgumentListString' text | |
5250 * ranges suitable for use by clients to set up linked edits of default | |
5251 * argument source contents. For example, given an argument list string 'x, | |
5252 * y', the corresponding text range [0, 1, 3, 1], indicates two text ranges | |
5253 * of length 1, starting at offsets 0 and 3. Clients can use these ranges to | |
5254 * treat the 'x' and 'y' values specially for linked edits. | |
5255 */ | |
5256 List<int> get defaultArgumentListTextRanges => _defaultArgumentListTextRanges; | |
5257 | |
5258 /** | |
5259 * Pairs of offsets and lengths describing 'defaultArgumentListString' text | |
5260 * ranges suitable for use by clients to set up linked edits of default | |
5261 * argument source contents. For example, given an argument list string 'x, | |
5262 * y', the corresponding text range [0, 1, 3, 1], indicates two text ranges | |
5263 * of length 1, starting at offsets 0 and 3. Clients can use these ranges to | |
5264 * treat the 'x' and 'y' values specially for linked edits. | |
5265 */ | |
5266 void set defaultArgumentListTextRanges(List<int> value) { | |
5267 this._defaultArgumentListTextRanges = value; | |
5268 } | |
5269 | |
5270 /** | |
5271 * Information about the element reference being suggested. | |
5272 */ | |
5273 Element get element => _element; | |
5274 | |
5275 /** | |
5276 * Information about the element reference being suggested. | |
5277 */ | |
5278 void set element(Element value) { | |
5279 this._element = value; | |
5280 } | |
5281 | |
5282 /** | |
5283 * The return type of the getter, function or method or the type of the field | |
5284 * being suggested. This field is omitted if the suggested element is not a | |
5285 * getter, function or method. | |
5286 */ | |
5287 String get returnType => _returnType; | |
5288 | |
5289 /** | |
5290 * The return type of the getter, function or method or the type of the field | |
5291 * being suggested. This field is omitted if the suggested element is not a | |
5292 * getter, function or method. | |
5293 */ | |
5294 void set returnType(String value) { | |
5295 this._returnType = value; | |
5296 } | |
5297 | |
5298 /** | |
5299 * The names of the parameters of the function or method being suggested. | |
5300 * This field is omitted if the suggested element is not a setter, function | |
5301 * or method. | |
5302 */ | |
5303 List<String> get parameterNames => _parameterNames; | |
5304 | |
5305 /** | |
5306 * The names of the parameters of the function or method being suggested. | |
5307 * This field is omitted if the suggested element is not a setter, function | |
5308 * or method. | |
5309 */ | |
5310 void set parameterNames(List<String> value) { | |
5311 this._parameterNames = value; | |
5312 } | |
5313 | |
5314 /** | |
5315 * The types of the parameters of the function or method being suggested. | |
5316 * This field is omitted if the parameterNames field is omitted. | |
5317 */ | |
5318 List<String> get parameterTypes => _parameterTypes; | |
5319 | |
5320 /** | |
5321 * The types of the parameters of the function or method being suggested. | |
5322 * This field is omitted if the parameterNames field is omitted. | |
5323 */ | |
5324 void set parameterTypes(List<String> value) { | |
5325 this._parameterTypes = value; | |
5326 } | |
5327 | |
5328 /** | |
5329 * The number of required parameters for the function or method being | |
5330 * suggested. This field is omitted if the parameterNames field is omitted. | |
5331 */ | |
5332 int get requiredParameterCount => _requiredParameterCount; | |
5333 | |
5334 /** | |
5335 * The number of required parameters for the function or method being | |
5336 * suggested. This field is omitted if the parameterNames field is omitted. | |
5337 */ | |
5338 void set requiredParameterCount(int value) { | |
5339 this._requiredParameterCount = value; | |
5340 } | |
5341 | |
5342 /** | |
5343 * True if the function or method being suggested has at least one named | |
5344 * parameter. This field is omitted if the parameterNames field is omitted. | |
5345 */ | |
5346 bool get hasNamedParameters => _hasNamedParameters; | |
5347 | |
5348 /** | |
5349 * True if the function or method being suggested has at least one named | |
5350 * parameter. This field is omitted if the parameterNames field is omitted. | |
5351 */ | |
5352 void set hasNamedParameters(bool value) { | |
5353 this._hasNamedParameters = value; | |
5354 } | |
5355 | |
5356 /** | |
5357 * The name of the optional parameter being suggested. This field is omitted | |
5358 * if the suggestion is not the addition of an optional argument within an | |
5359 * argument list. | |
5360 */ | |
5361 String get parameterName => _parameterName; | |
5362 | |
5363 /** | |
5364 * The name of the optional parameter being suggested. This field is omitted | |
5365 * if the suggestion is not the addition of an optional argument within an | |
5366 * argument list. | |
5367 */ | |
5368 void set parameterName(String value) { | |
5369 this._parameterName = value; | |
5370 } | |
5371 | |
5372 /** | |
5373 * The type of the options parameter being suggested. This field is omitted | |
5374 * if the parameterName field is omitted. | |
5375 */ | |
5376 String get parameterType => _parameterType; | |
5377 | |
5378 /** | |
5379 * The type of the options parameter being suggested. This field is omitted | |
5380 * if the parameterName field is omitted. | |
5381 */ | |
5382 void set parameterType(String value) { | |
5383 this._parameterType = value; | |
5384 } | |
5385 | |
5386 /** | |
5387 * The import to be added if the suggestion is out of scope and needs an | |
5388 * import to be added to be in scope. | |
5389 */ | |
5390 String get importUri => _importUri; | |
5391 | |
5392 /** | |
5393 * The import to be added if the suggestion is out of scope and needs an | |
5394 * import to be added to be in scope. | |
5395 */ | |
5396 void set importUri(String value) { | |
5397 this._importUri = value; | |
5398 } | |
5399 | |
5400 CompletionSuggestion( | |
5401 CompletionSuggestionKind kind, | |
5402 int relevance, | |
5403 String completion, | |
5404 int selectionOffset, | |
5405 int selectionLength, | |
5406 bool isDeprecated, | |
5407 bool isPotential, | |
5408 {String docSummary, | |
5409 String docComplete, | |
5410 String declaringType, | |
5411 String defaultArgumentListString, | |
5412 List<int> defaultArgumentListTextRanges, | |
5413 Element element, | |
5414 String returnType, | |
5415 List<String> parameterNames, | |
5416 List<String> parameterTypes, | |
5417 int requiredParameterCount, | |
5418 bool hasNamedParameters, | |
5419 String parameterName, | |
5420 String parameterType, | |
5421 String importUri}) { | |
5422 this.kind = kind; | |
5423 this.relevance = relevance; | |
5424 this.completion = completion; | |
5425 this.selectionOffset = selectionOffset; | |
5426 this.selectionLength = selectionLength; | |
5427 this.isDeprecated = isDeprecated; | |
5428 this.isPotential = isPotential; | |
5429 this.docSummary = docSummary; | |
5430 this.docComplete = docComplete; | |
5431 this.declaringType = declaringType; | |
5432 this.defaultArgumentListString = defaultArgumentListString; | |
5433 this.defaultArgumentListTextRanges = defaultArgumentListTextRanges; | |
5434 this.element = element; | |
5435 this.returnType = returnType; | |
5436 this.parameterNames = parameterNames; | |
5437 this.parameterTypes = parameterTypes; | |
5438 this.requiredParameterCount = requiredParameterCount; | |
5439 this.hasNamedParameters = hasNamedParameters; | |
5440 this.parameterName = parameterName; | |
5441 this.parameterType = parameterType; | |
5442 this.importUri = importUri; | |
5443 } | |
5444 | |
5445 factory CompletionSuggestion.fromJson( | |
5446 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 4537 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
5447 if (json == null) { | 4538 if (json == null) { |
5448 json = {}; | 4539 json = {}; |
5449 } | 4540 } |
5450 if (json is Map) { | 4541 if (json is Map) { |
5451 CompletionSuggestionKind kind; | 4542 String name; |
5452 if (json.containsKey("kind")) { | 4543 if (json.containsKey("name")) { |
5453 kind = new CompletionSuggestionKind.fromJson( | 4544 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]); |
5454 jsonDecoder, jsonPath + ".kind", json["kind"]); | |
5455 } else { | 4545 } else { |
5456 throw jsonDecoder.mismatch(jsonPath, "kind"); | 4546 throw jsonDecoder.mismatch(jsonPath, "name"); |
5457 } | 4547 } |
5458 int relevance; | 4548 int explicitFileCount; |
5459 if (json.containsKey("relevance")) { | 4549 if (json.containsKey("explicitFileCount")) { |
5460 relevance = | 4550 explicitFileCount = jsonDecoder.decodeInt( |
5461 jsonDecoder.decodeInt(jsonPath + ".relevance", json["relevance"]); | 4551 jsonPath + ".explicitFileCount", json["explicitFileCount"]); |
5462 } else { | 4552 } else { |
5463 throw jsonDecoder.mismatch(jsonPath, "relevance"); | 4553 throw jsonDecoder.mismatch(jsonPath, "explicitFileCount"); |
5464 } | 4554 } |
5465 String completion; | 4555 int implicitFileCount; |
5466 if (json.containsKey("completion")) { | 4556 if (json.containsKey("implicitFileCount")) { |
5467 completion = jsonDecoder.decodeString( | 4557 implicitFileCount = jsonDecoder.decodeInt( |
5468 jsonPath + ".completion", json["completion"]); | 4558 jsonPath + ".implicitFileCount", json["implicitFileCount"]); |
5469 } else { | 4559 } else { |
5470 throw jsonDecoder.mismatch(jsonPath, "completion"); | 4560 throw jsonDecoder.mismatch(jsonPath, "implicitFileCount"); |
5471 } | 4561 } |
5472 int selectionOffset; | 4562 int workItemQueueLength; |
5473 if (json.containsKey("selectionOffset")) { | 4563 if (json.containsKey("workItemQueueLength")) { |
5474 selectionOffset = jsonDecoder.decodeInt( | 4564 workItemQueueLength = jsonDecoder.decodeInt( |
5475 jsonPath + ".selectionOffset", json["selectionOffset"]); | 4565 jsonPath + ".workItemQueueLength", json["workItemQueueLength"]); |
5476 } else { | 4566 } else { |
5477 throw jsonDecoder.mismatch(jsonPath, "selectionOffset"); | 4567 throw jsonDecoder.mismatch(jsonPath, "workItemQueueLength"); |
5478 } | 4568 } |
5479 int selectionLength; | 4569 List<String> cacheEntryExceptions; |
5480 if (json.containsKey("selectionLength")) { | 4570 if (json.containsKey("cacheEntryExceptions")) { |
5481 selectionLength = jsonDecoder.decodeInt( | 4571 cacheEntryExceptions = jsonDecoder.decodeList( |
5482 jsonPath + ".selectionLength", json["selectionLength"]); | 4572 jsonPath + ".cacheEntryExceptions", |
| 4573 json["cacheEntryExceptions"], |
| 4574 jsonDecoder.decodeString); |
5483 } else { | 4575 } else { |
5484 throw jsonDecoder.mismatch(jsonPath, "selectionLength"); | 4576 throw jsonDecoder.mismatch(jsonPath, "cacheEntryExceptions"); |
5485 } | 4577 } |
5486 bool isDeprecated; | 4578 return new ContextData(name, explicitFileCount, implicitFileCount, |
5487 if (json.containsKey("isDeprecated")) { | 4579 workItemQueueLength, cacheEntryExceptions); |
5488 isDeprecated = jsonDecoder.decodeBool( | |
5489 jsonPath + ".isDeprecated", json["isDeprecated"]); | |
5490 } else { | |
5491 throw jsonDecoder.mismatch(jsonPath, "isDeprecated"); | |
5492 } | |
5493 bool isPotential; | |
5494 if (json.containsKey("isPotential")) { | |
5495 isPotential = jsonDecoder.decodeBool( | |
5496 jsonPath + ".isPotential", json["isPotential"]); | |
5497 } else { | |
5498 throw jsonDecoder.mismatch(jsonPath, "isPotential"); | |
5499 } | |
5500 String docSummary; | |
5501 if (json.containsKey("docSummary")) { | |
5502 docSummary = jsonDecoder.decodeString( | |
5503 jsonPath + ".docSummary", json["docSummary"]); | |
5504 } | |
5505 String docComplete; | |
5506 if (json.containsKey("docComplete")) { | |
5507 docComplete = jsonDecoder.decodeString( | |
5508 jsonPath + ".docComplete", json["docComplete"]); | |
5509 } | |
5510 String declaringType; | |
5511 if (json.containsKey("declaringType")) { | |
5512 declaringType = jsonDecoder.decodeString( | |
5513 jsonPath + ".declaringType", json["declaringType"]); | |
5514 } | |
5515 String defaultArgumentListString; | |
5516 if (json.containsKey("defaultArgumentListString")) { | |
5517 defaultArgumentListString = jsonDecoder.decodeString( | |
5518 jsonPath + ".defaultArgumentListString", | |
5519 json["defaultArgumentListString"]); | |
5520 } | |
5521 List<int> defaultArgumentListTextRanges; | |
5522 if (json.containsKey("defaultArgumentListTextRanges")) { | |
5523 defaultArgumentListTextRanges = jsonDecoder.decodeList( | |
5524 jsonPath + ".defaultArgumentListTextRanges", | |
5525 json["defaultArgumentListTextRanges"], | |
5526 jsonDecoder.decodeInt); | |
5527 } | |
5528 Element element; | |
5529 if (json.containsKey("element")) { | |
5530 element = new Element.fromJson( | |
5531 jsonDecoder, jsonPath + ".element", json["element"]); | |
5532 } | |
5533 String returnType; | |
5534 if (json.containsKey("returnType")) { | |
5535 returnType = jsonDecoder.decodeString( | |
5536 jsonPath + ".returnType", json["returnType"]); | |
5537 } | |
5538 List<String> parameterNames; | |
5539 if (json.containsKey("parameterNames")) { | |
5540 parameterNames = jsonDecoder.decodeList(jsonPath + ".parameterNames", | |
5541 json["parameterNames"], jsonDecoder.decodeString); | |
5542 } | |
5543 List<String> parameterTypes; | |
5544 if (json.containsKey("parameterTypes")) { | |
5545 parameterTypes = jsonDecoder.decodeList(jsonPath + ".parameterTypes", | |
5546 json["parameterTypes"], jsonDecoder.decodeString); | |
5547 } | |
5548 int requiredParameterCount; | |
5549 if (json.containsKey("requiredParameterCount")) { | |
5550 requiredParameterCount = jsonDecoder.decodeInt( | |
5551 jsonPath + ".requiredParameterCount", | |
5552 json["requiredParameterCount"]); | |
5553 } | |
5554 bool hasNamedParameters; | |
5555 if (json.containsKey("hasNamedParameters")) { | |
5556 hasNamedParameters = jsonDecoder.decodeBool( | |
5557 jsonPath + ".hasNamedParameters", json["hasNamedParameters"]); | |
5558 } | |
5559 String parameterName; | |
5560 if (json.containsKey("parameterName")) { | |
5561 parameterName = jsonDecoder.decodeString( | |
5562 jsonPath + ".parameterName", json["parameterName"]); | |
5563 } | |
5564 String parameterType; | |
5565 if (json.containsKey("parameterType")) { | |
5566 parameterType = jsonDecoder.decodeString( | |
5567 jsonPath + ".parameterType", json["parameterType"]); | |
5568 } | |
5569 String importUri; | |
5570 if (json.containsKey("importUri")) { | |
5571 importUri = jsonDecoder.decodeString( | |
5572 jsonPath + ".importUri", json["importUri"]); | |
5573 } | |
5574 return new CompletionSuggestion(kind, relevance, completion, | |
5575 selectionOffset, selectionLength, isDeprecated, isPotential, | |
5576 docSummary: docSummary, | |
5577 docComplete: docComplete, | |
5578 declaringType: declaringType, | |
5579 defaultArgumentListString: defaultArgumentListString, | |
5580 defaultArgumentListTextRanges: defaultArgumentListTextRanges, | |
5581 element: element, | |
5582 returnType: returnType, | |
5583 parameterNames: parameterNames, | |
5584 parameterTypes: parameterTypes, | |
5585 requiredParameterCount: requiredParameterCount, | |
5586 hasNamedParameters: hasNamedParameters, | |
5587 parameterName: parameterName, | |
5588 parameterType: parameterType, | |
5589 importUri: importUri); | |
5590 } else { | 4580 } else { |
5591 throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestion", json); | 4581 throw jsonDecoder.mismatch(jsonPath, "ContextData", json); |
5592 } | 4582 } |
5593 } | 4583 } |
5594 | 4584 |
5595 @override | 4585 @override |
5596 Map<String, dynamic> toJson() { | 4586 Map<String, dynamic> toJson() { |
5597 Map<String, dynamic> result = {}; | 4587 Map<String, dynamic> result = {}; |
5598 result["kind"] = kind.toJson(); | 4588 result["name"] = name; |
5599 result["relevance"] = relevance; | 4589 result["explicitFileCount"] = explicitFileCount; |
5600 result["completion"] = completion; | 4590 result["implicitFileCount"] = implicitFileCount; |
5601 result["selectionOffset"] = selectionOffset; | 4591 result["workItemQueueLength"] = workItemQueueLength; |
5602 result["selectionLength"] = selectionLength; | 4592 result["cacheEntryExceptions"] = cacheEntryExceptions; |
5603 result["isDeprecated"] = isDeprecated; | |
5604 result["isPotential"] = isPotential; | |
5605 if (docSummary != null) { | |
5606 result["docSummary"] = docSummary; | |
5607 } | |
5608 if (docComplete != null) { | |
5609 result["docComplete"] = docComplete; | |
5610 } | |
5611 if (declaringType != null) { | |
5612 result["declaringType"] = declaringType; | |
5613 } | |
5614 if (defaultArgumentListString != null) { | |
5615 result["defaultArgumentListString"] = defaultArgumentListString; | |
5616 } | |
5617 if (defaultArgumentListTextRanges != null) { | |
5618 result["defaultArgumentListTextRanges"] = defaultArgumentListTextRanges; | |
5619 } | |
5620 if (element != null) { | |
5621 result["element"] = element.toJson(); | |
5622 } | |
5623 if (returnType != null) { | |
5624 result["returnType"] = returnType; | |
5625 } | |
5626 if (parameterNames != null) { | |
5627 result["parameterNames"] = parameterNames; | |
5628 } | |
5629 if (parameterTypes != null) { | |
5630 result["parameterTypes"] = parameterTypes; | |
5631 } | |
5632 if (requiredParameterCount != null) { | |
5633 result["requiredParameterCount"] = requiredParameterCount; | |
5634 } | |
5635 if (hasNamedParameters != null) { | |
5636 result["hasNamedParameters"] = hasNamedParameters; | |
5637 } | |
5638 if (parameterName != null) { | |
5639 result["parameterName"] = parameterName; | |
5640 } | |
5641 if (parameterType != null) { | |
5642 result["parameterType"] = parameterType; | |
5643 } | |
5644 if (importUri != null) { | |
5645 result["importUri"] = importUri; | |
5646 } | |
5647 return result; | 4593 return result; |
5648 } | 4594 } |
5649 | 4595 |
5650 @override | 4596 @override |
5651 String toString() => JSON.encode(toJson()); | 4597 String toString() => JSON.encode(toJson()); |
5652 | 4598 |
5653 @override | 4599 @override |
5654 bool operator ==(other) { | 4600 bool operator ==(other) { |
5655 if (other is CompletionSuggestion) { | 4601 if (other is ContextData) { |
5656 return kind == other.kind && | 4602 return name == other.name && |
5657 relevance == other.relevance && | 4603 explicitFileCount == other.explicitFileCount && |
5658 completion == other.completion && | 4604 implicitFileCount == other.implicitFileCount && |
5659 selectionOffset == other.selectionOffset && | 4605 workItemQueueLength == other.workItemQueueLength && |
5660 selectionLength == other.selectionLength && | 4606 listEqual(cacheEntryExceptions, other.cacheEntryExceptions, |
5661 isDeprecated == other.isDeprecated && | 4607 (String a, String b) => a == b); |
5662 isPotential == other.isPotential && | |
5663 docSummary == other.docSummary && | |
5664 docComplete == other.docComplete && | |
5665 declaringType == other.declaringType && | |
5666 defaultArgumentListString == other.defaultArgumentListString && | |
5667 listEqual(defaultArgumentListTextRanges, | |
5668 other.defaultArgumentListTextRanges, (int a, int b) => a == b) && | |
5669 element == other.element && | |
5670 returnType == other.returnType && | |
5671 listEqual(parameterNames, other.parameterNames, | |
5672 (String a, String b) => a == b) && | |
5673 listEqual(parameterTypes, other.parameterTypes, | |
5674 (String a, String b) => a == b) && | |
5675 requiredParameterCount == other.requiredParameterCount && | |
5676 hasNamedParameters == other.hasNamedParameters && | |
5677 parameterName == other.parameterName && | |
5678 parameterType == other.parameterType && | |
5679 importUri == other.importUri; | |
5680 } | 4608 } |
5681 return false; | 4609 return false; |
5682 } | 4610 } |
5683 | 4611 |
5684 @override | 4612 @override |
5685 int get hashCode { | 4613 int get hashCode { |
5686 int hash = 0; | 4614 int hash = 0; |
5687 hash = JenkinsSmiHash.combine(hash, kind.hashCode); | |
5688 hash = JenkinsSmiHash.combine(hash, relevance.hashCode); | |
5689 hash = JenkinsSmiHash.combine(hash, completion.hashCode); | |
5690 hash = JenkinsSmiHash.combine(hash, selectionOffset.hashCode); | |
5691 hash = JenkinsSmiHash.combine(hash, selectionLength.hashCode); | |
5692 hash = JenkinsSmiHash.combine(hash, isDeprecated.hashCode); | |
5693 hash = JenkinsSmiHash.combine(hash, isPotential.hashCode); | |
5694 hash = JenkinsSmiHash.combine(hash, docSummary.hashCode); | |
5695 hash = JenkinsSmiHash.combine(hash, docComplete.hashCode); | |
5696 hash = JenkinsSmiHash.combine(hash, declaringType.hashCode); | |
5697 hash = JenkinsSmiHash.combine(hash, defaultArgumentListString.hashCode); | |
5698 hash = JenkinsSmiHash.combine(hash, defaultArgumentListTextRanges.hashCode); | |
5699 hash = JenkinsSmiHash.combine(hash, element.hashCode); | |
5700 hash = JenkinsSmiHash.combine(hash, returnType.hashCode); | |
5701 hash = JenkinsSmiHash.combine(hash, parameterNames.hashCode); | |
5702 hash = JenkinsSmiHash.combine(hash, parameterTypes.hashCode); | |
5703 hash = JenkinsSmiHash.combine(hash, requiredParameterCount.hashCode); | |
5704 hash = JenkinsSmiHash.combine(hash, hasNamedParameters.hashCode); | |
5705 hash = JenkinsSmiHash.combine(hash, parameterName.hashCode); | |
5706 hash = JenkinsSmiHash.combine(hash, parameterType.hashCode); | |
5707 hash = JenkinsSmiHash.combine(hash, importUri.hashCode); | |
5708 return JenkinsSmiHash.finish(hash); | |
5709 } | |
5710 } | |
5711 | |
5712 /** | |
5713 * CompletionSuggestionKind | |
5714 * | |
5715 * enum { | |
5716 * ARGUMENT_LIST | |
5717 * IMPORT | |
5718 * IDENTIFIER | |
5719 * INVOCATION | |
5720 * KEYWORD | |
5721 * NAMED_ARGUMENT | |
5722 * OPTIONAL_ARGUMENT | |
5723 * PARAMETER | |
5724 * } | |
5725 * | |
5726 * Clients may not extend, implement or mix-in this class. | |
5727 */ | |
5728 class CompletionSuggestionKind implements Enum { | |
5729 /** | |
5730 * A list of arguments for the method or function that is being invoked. For | |
5731 * this suggestion kind, the completion field is a textual representation of | |
5732 * the invocation and the parameterNames, parameterTypes, and | |
5733 * requiredParameterCount attributes are defined. | |
5734 */ | |
5735 static const CompletionSuggestionKind ARGUMENT_LIST = | |
5736 const CompletionSuggestionKind._("ARGUMENT_LIST"); | |
5737 | |
5738 static const CompletionSuggestionKind IMPORT = | |
5739 const CompletionSuggestionKind._("IMPORT"); | |
5740 | |
5741 /** | |
5742 * The element identifier should be inserted at the completion location. For | |
5743 * example "someMethod" in import 'myLib.dart' show someMethod; . For | |
5744 * suggestions of this kind, the element attribute is defined and the | |
5745 * completion field is the element's identifier. | |
5746 */ | |
5747 static const CompletionSuggestionKind IDENTIFIER = | |
5748 const CompletionSuggestionKind._("IDENTIFIER"); | |
5749 | |
5750 /** | |
5751 * The element is being invoked at the completion location. For example, | |
5752 * "someMethod" in x.someMethod(); . For suggestions of this kind, the | |
5753 * element attribute is defined and the completion field is the element's | |
5754 * identifier. | |
5755 */ | |
5756 static const CompletionSuggestionKind INVOCATION = | |
5757 const CompletionSuggestionKind._("INVOCATION"); | |
5758 | |
5759 /** | |
5760 * A keyword is being suggested. For suggestions of this kind, the completion | |
5761 * is the keyword. | |
5762 */ | |
5763 static const CompletionSuggestionKind KEYWORD = | |
5764 const CompletionSuggestionKind._("KEYWORD"); | |
5765 | |
5766 /** | |
5767 * A named argument for the current callsite is being suggested. For | |
5768 * suggestions of this kind, the completion is the named argument identifier | |
5769 * including a trailing ':' and space. | |
5770 */ | |
5771 static const CompletionSuggestionKind NAMED_ARGUMENT = | |
5772 const CompletionSuggestionKind._("NAMED_ARGUMENT"); | |
5773 | |
5774 static const CompletionSuggestionKind OPTIONAL_ARGUMENT = | |
5775 const CompletionSuggestionKind._("OPTIONAL_ARGUMENT"); | |
5776 | |
5777 static const CompletionSuggestionKind PARAMETER = | |
5778 const CompletionSuggestionKind._("PARAMETER"); | |
5779 | |
5780 /** | |
5781 * A list containing all of the enum values that are defined. | |
5782 */ | |
5783 static const List<CompletionSuggestionKind> VALUES = | |
5784 const <CompletionSuggestionKind>[ | |
5785 ARGUMENT_LIST, | |
5786 IMPORT, | |
5787 IDENTIFIER, | |
5788 INVOCATION, | |
5789 KEYWORD, | |
5790 NAMED_ARGUMENT, | |
5791 OPTIONAL_ARGUMENT, | |
5792 PARAMETER | |
5793 ]; | |
5794 | |
5795 @override | |
5796 final String name; | |
5797 | |
5798 const CompletionSuggestionKind._(this.name); | |
5799 | |
5800 factory CompletionSuggestionKind(String name) { | |
5801 switch (name) { | |
5802 case "ARGUMENT_LIST": | |
5803 return ARGUMENT_LIST; | |
5804 case "IMPORT": | |
5805 return IMPORT; | |
5806 case "IDENTIFIER": | |
5807 return IDENTIFIER; | |
5808 case "INVOCATION": | |
5809 return INVOCATION; | |
5810 case "KEYWORD": | |
5811 return KEYWORD; | |
5812 case "NAMED_ARGUMENT": | |
5813 return NAMED_ARGUMENT; | |
5814 case "OPTIONAL_ARGUMENT": | |
5815 return OPTIONAL_ARGUMENT; | |
5816 case "PARAMETER": | |
5817 return PARAMETER; | |
5818 } | |
5819 throw new Exception('Illegal enum value: $name'); | |
5820 } | |
5821 | |
5822 factory CompletionSuggestionKind.fromJson( | |
5823 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
5824 if (json is String) { | |
5825 try { | |
5826 return new CompletionSuggestionKind(json); | |
5827 } catch (_) { | |
5828 // Fall through | |
5829 } | |
5830 } | |
5831 throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestionKind", json); | |
5832 } | |
5833 | |
5834 @override | |
5835 String toString() => "CompletionSuggestionKind.$name"; | |
5836 | |
5837 String toJson() => name; | |
5838 } | |
5839 | |
5840 /** | |
5841 * ContextData | |
5842 * | |
5843 * { | |
5844 * "name": String | |
5845 * "explicitFileCount": int | |
5846 * "implicitFileCount": int | |
5847 * "workItemQueueLength": int | |
5848 * "cacheEntryExceptions": List<String> | |
5849 * } | |
5850 * | |
5851 * Clients may not extend, implement or mix-in this class. | |
5852 */ | |
5853 class ContextData implements HasToJson { | |
5854 String _name; | |
5855 | |
5856 int _explicitFileCount; | |
5857 | |
5858 int _implicitFileCount; | |
5859 | |
5860 int _workItemQueueLength; | |
5861 | |
5862 List<String> _cacheEntryExceptions; | |
5863 | |
5864 /** | |
5865 * The name of the context. | |
5866 */ | |
5867 String get name => _name; | |
5868 | |
5869 /** | |
5870 * The name of the context. | |
5871 */ | |
5872 void set name(String value) { | |
5873 assert(value != null); | |
5874 this._name = value; | |
5875 } | |
5876 | |
5877 /** | |
5878 * Explicitly analyzed files. | |
5879 */ | |
5880 int get explicitFileCount => _explicitFileCount; | |
5881 | |
5882 /** | |
5883 * Explicitly analyzed files. | |
5884 */ | |
5885 void set explicitFileCount(int value) { | |
5886 assert(value != null); | |
5887 this._explicitFileCount = value; | |
5888 } | |
5889 | |
5890 /** | |
5891 * Implicitly analyzed files. | |
5892 */ | |
5893 int get implicitFileCount => _implicitFileCount; | |
5894 | |
5895 /** | |
5896 * Implicitly analyzed files. | |
5897 */ | |
5898 void set implicitFileCount(int value) { | |
5899 assert(value != null); | |
5900 this._implicitFileCount = value; | |
5901 } | |
5902 | |
5903 /** | |
5904 * The number of work items in the queue. | |
5905 */ | |
5906 int get workItemQueueLength => _workItemQueueLength; | |
5907 | |
5908 /** | |
5909 * The number of work items in the queue. | |
5910 */ | |
5911 void set workItemQueueLength(int value) { | |
5912 assert(value != null); | |
5913 this._workItemQueueLength = value; | |
5914 } | |
5915 | |
5916 /** | |
5917 * Exceptions associated with cache entries. | |
5918 */ | |
5919 List<String> get cacheEntryExceptions => _cacheEntryExceptions; | |
5920 | |
5921 /** | |
5922 * Exceptions associated with cache entries. | |
5923 */ | |
5924 void set cacheEntryExceptions(List<String> value) { | |
5925 assert(value != null); | |
5926 this._cacheEntryExceptions = value; | |
5927 } | |
5928 | |
5929 ContextData(String name, int explicitFileCount, int implicitFileCount, | |
5930 int workItemQueueLength, List<String> cacheEntryExceptions) { | |
5931 this.name = name; | |
5932 this.explicitFileCount = explicitFileCount; | |
5933 this.implicitFileCount = implicitFileCount; | |
5934 this.workItemQueueLength = workItemQueueLength; | |
5935 this.cacheEntryExceptions = cacheEntryExceptions; | |
5936 } | |
5937 | |
5938 factory ContextData.fromJson( | |
5939 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
5940 if (json == null) { | |
5941 json = {}; | |
5942 } | |
5943 if (json is Map) { | |
5944 String name; | |
5945 if (json.containsKey("name")) { | |
5946 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]); | |
5947 } else { | |
5948 throw jsonDecoder.mismatch(jsonPath, "name"); | |
5949 } | |
5950 int explicitFileCount; | |
5951 if (json.containsKey("explicitFileCount")) { | |
5952 explicitFileCount = jsonDecoder.decodeInt( | |
5953 jsonPath + ".explicitFileCount", json["explicitFileCount"]); | |
5954 } else { | |
5955 throw jsonDecoder.mismatch(jsonPath, "explicitFileCount"); | |
5956 } | |
5957 int implicitFileCount; | |
5958 if (json.containsKey("implicitFileCount")) { | |
5959 implicitFileCount = jsonDecoder.decodeInt( | |
5960 jsonPath + ".implicitFileCount", json["implicitFileCount"]); | |
5961 } else { | |
5962 throw jsonDecoder.mismatch(jsonPath, "implicitFileCount"); | |
5963 } | |
5964 int workItemQueueLength; | |
5965 if (json.containsKey("workItemQueueLength")) { | |
5966 workItemQueueLength = jsonDecoder.decodeInt( | |
5967 jsonPath + ".workItemQueueLength", json["workItemQueueLength"]); | |
5968 } else { | |
5969 throw jsonDecoder.mismatch(jsonPath, "workItemQueueLength"); | |
5970 } | |
5971 List<String> cacheEntryExceptions; | |
5972 if (json.containsKey("cacheEntryExceptions")) { | |
5973 cacheEntryExceptions = jsonDecoder.decodeList( | |
5974 jsonPath + ".cacheEntryExceptions", | |
5975 json["cacheEntryExceptions"], | |
5976 jsonDecoder.decodeString); | |
5977 } else { | |
5978 throw jsonDecoder.mismatch(jsonPath, "cacheEntryExceptions"); | |
5979 } | |
5980 return new ContextData(name, explicitFileCount, implicitFileCount, | |
5981 workItemQueueLength, cacheEntryExceptions); | |
5982 } else { | |
5983 throw jsonDecoder.mismatch(jsonPath, "ContextData", json); | |
5984 } | |
5985 } | |
5986 | |
5987 @override | |
5988 Map<String, dynamic> toJson() { | |
5989 Map<String, dynamic> result = {}; | |
5990 result["name"] = name; | |
5991 result["explicitFileCount"] = explicitFileCount; | |
5992 result["implicitFileCount"] = implicitFileCount; | |
5993 result["workItemQueueLength"] = workItemQueueLength; | |
5994 result["cacheEntryExceptions"] = cacheEntryExceptions; | |
5995 return result; | |
5996 } | |
5997 | |
5998 @override | |
5999 String toString() => JSON.encode(toJson()); | |
6000 | |
6001 @override | |
6002 bool operator ==(other) { | |
6003 if (other is ContextData) { | |
6004 return name == other.name && | |
6005 explicitFileCount == other.explicitFileCount && | |
6006 implicitFileCount == other.implicitFileCount && | |
6007 workItemQueueLength == other.workItemQueueLength && | |
6008 listEqual(cacheEntryExceptions, other.cacheEntryExceptions, | |
6009 (String a, String b) => a == b); | |
6010 } | |
6011 return false; | |
6012 } | |
6013 | |
6014 @override | |
6015 int get hashCode { | |
6016 int hash = 0; | |
6017 hash = JenkinsSmiHash.combine(hash, name.hashCode); | 4615 hash = JenkinsSmiHash.combine(hash, name.hashCode); |
6018 hash = JenkinsSmiHash.combine(hash, explicitFileCount.hashCode); | 4616 hash = JenkinsSmiHash.combine(hash, explicitFileCount.hashCode); |
6019 hash = JenkinsSmiHash.combine(hash, implicitFileCount.hashCode); | 4617 hash = JenkinsSmiHash.combine(hash, implicitFileCount.hashCode); |
6020 hash = JenkinsSmiHash.combine(hash, workItemQueueLength.hashCode); | 4618 hash = JenkinsSmiHash.combine(hash, workItemQueueLength.hashCode); |
6021 hash = JenkinsSmiHash.combine(hash, cacheEntryExceptions.hashCode); | 4619 hash = JenkinsSmiHash.combine(hash, cacheEntryExceptions.hashCode); |
6022 return JenkinsSmiHash.finish(hash); | 4620 return JenkinsSmiHash.finish(hash); |
6023 } | 4621 } |
6024 } | 4622 } |
6025 | 4623 |
6026 /** | 4624 /** |
(...skipping 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7908 @override | 6506 @override |
7909 String toString() => JSON.encode(toJson()); | 6507 String toString() => JSON.encode(toJson()); |
7910 | 6508 |
7911 @override | 6509 @override |
7912 bool operator ==(other) { | 6510 bool operator ==(other) { |
7913 if (other is EditGetStatementCompletionParams) { | 6511 if (other is EditGetStatementCompletionParams) { |
7914 return file == other.file && offset == other.offset; | 6512 return file == other.file && offset == other.offset; |
7915 } | 6513 } |
7916 return false; | 6514 return false; |
7917 } | 6515 } |
7918 | |
7919 @override | |
7920 int get hashCode { | |
7921 int hash = 0; | |
7922 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
7923 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
7924 return JenkinsSmiHash.finish(hash); | |
7925 } | |
7926 } | |
7927 | |
7928 /** | |
7929 * edit.getStatementCompletion result | |
7930 * | |
7931 * { | |
7932 * "change": SourceChange | |
7933 * "whitespaceOnly": bool | |
7934 * } | |
7935 * | |
7936 * Clients may not extend, implement or mix-in this class. | |
7937 */ | |
7938 class EditGetStatementCompletionResult implements ResponseResult { | |
7939 SourceChange _change; | |
7940 | |
7941 bool _whitespaceOnly; | |
7942 | |
7943 /** | |
7944 * The change to be applied in order to complete the statement. | |
7945 */ | |
7946 SourceChange get change => _change; | |
7947 | |
7948 /** | |
7949 * The change to be applied in order to complete the statement. | |
7950 */ | |
7951 void set change(SourceChange value) { | |
7952 assert(value != null); | |
7953 this._change = value; | |
7954 } | |
7955 | |
7956 /** | |
7957 * Will be true if the change contains nothing but whitespace characters, or | |
7958 * is empty. | |
7959 */ | |
7960 bool get whitespaceOnly => _whitespaceOnly; | |
7961 | |
7962 /** | |
7963 * Will be true if the change contains nothing but whitespace characters, or | |
7964 * is empty. | |
7965 */ | |
7966 void set whitespaceOnly(bool value) { | |
7967 assert(value != null); | |
7968 this._whitespaceOnly = value; | |
7969 } | |
7970 | |
7971 EditGetStatementCompletionResult(SourceChange change, bool whitespaceOnly) { | |
7972 this.change = change; | |
7973 this.whitespaceOnly = whitespaceOnly; | |
7974 } | |
7975 | |
7976 factory EditGetStatementCompletionResult.fromJson( | |
7977 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
7978 if (json == null) { | |
7979 json = {}; | |
7980 } | |
7981 if (json is Map) { | |
7982 SourceChange change; | |
7983 if (json.containsKey("change")) { | |
7984 change = new SourceChange.fromJson( | |
7985 jsonDecoder, jsonPath + ".change", json["change"]); | |
7986 } else { | |
7987 throw jsonDecoder.mismatch(jsonPath, "change"); | |
7988 } | |
7989 bool whitespaceOnly; | |
7990 if (json.containsKey("whitespaceOnly")) { | |
7991 whitespaceOnly = jsonDecoder.decodeBool( | |
7992 jsonPath + ".whitespaceOnly", json["whitespaceOnly"]); | |
7993 } else { | |
7994 throw jsonDecoder.mismatch(jsonPath, "whitespaceOnly"); | |
7995 } | |
7996 return new EditGetStatementCompletionResult(change, whitespaceOnly); | |
7997 } else { | |
7998 throw jsonDecoder.mismatch( | |
7999 jsonPath, "edit.getStatementCompletion result", json); | |
8000 } | |
8001 } | |
8002 | |
8003 factory EditGetStatementCompletionResult.fromResponse(Response response) { | |
8004 return new EditGetStatementCompletionResult.fromJson( | |
8005 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
8006 "result", | |
8007 response.result); | |
8008 } | |
8009 | |
8010 @override | |
8011 Map<String, dynamic> toJson() { | |
8012 Map<String, dynamic> result = {}; | |
8013 result["change"] = change.toJson(); | |
8014 result["whitespaceOnly"] = whitespaceOnly; | |
8015 return result; | |
8016 } | |
8017 | |
8018 @override | |
8019 Response toResponse(String id) { | |
8020 return new Response(id, result: toJson()); | |
8021 } | |
8022 | |
8023 @override | |
8024 String toString() => JSON.encode(toJson()); | |
8025 | |
8026 @override | |
8027 bool operator ==(other) { | |
8028 if (other is EditGetStatementCompletionResult) { | |
8029 return change == other.change && whitespaceOnly == other.whitespaceOnly; | |
8030 } | |
8031 return false; | |
8032 } | |
8033 | |
8034 @override | |
8035 int get hashCode { | |
8036 int hash = 0; | |
8037 hash = JenkinsSmiHash.combine(hash, change.hashCode); | |
8038 hash = JenkinsSmiHash.combine(hash, whitespaceOnly.hashCode); | |
8039 return JenkinsSmiHash.finish(hash); | |
8040 } | |
8041 } | |
8042 | |
8043 /** | |
8044 * edit.organizeDirectives params | |
8045 * | |
8046 * { | |
8047 * "file": FilePath | |
8048 * } | |
8049 * | |
8050 * Clients may not extend, implement or mix-in this class. | |
8051 */ | |
8052 class EditOrganizeDirectivesParams implements RequestParams { | |
8053 String _file; | |
8054 | |
8055 /** | |
8056 * The Dart file to organize directives in. | |
8057 */ | |
8058 String get file => _file; | |
8059 | |
8060 /** | |
8061 * The Dart file to organize directives in. | |
8062 */ | |
8063 void set file(String value) { | |
8064 assert(value != null); | |
8065 this._file = value; | |
8066 } | |
8067 | |
8068 EditOrganizeDirectivesParams(String file) { | |
8069 this.file = file; | |
8070 } | |
8071 | |
8072 factory EditOrganizeDirectivesParams.fromJson( | |
8073 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
8074 if (json == null) { | |
8075 json = {}; | |
8076 } | |
8077 if (json is Map) { | |
8078 String file; | |
8079 if (json.containsKey("file")) { | |
8080 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
8081 } else { | |
8082 throw jsonDecoder.mismatch(jsonPath, "file"); | |
8083 } | |
8084 return new EditOrganizeDirectivesParams(file); | |
8085 } else { | |
8086 throw jsonDecoder.mismatch( | |
8087 jsonPath, "edit.organizeDirectives params", json); | |
8088 } | |
8089 } | |
8090 | |
8091 factory EditOrganizeDirectivesParams.fromRequest(Request request) { | |
8092 return new EditOrganizeDirectivesParams.fromJson( | |
8093 new RequestDecoder(request), "params", request.params); | |
8094 } | |
8095 | |
8096 @override | |
8097 Map<String, dynamic> toJson() { | |
8098 Map<String, dynamic> result = {}; | |
8099 result["file"] = file; | |
8100 return result; | |
8101 } | |
8102 | |
8103 @override | |
8104 Request toRequest(String id) { | |
8105 return new Request(id, "edit.organizeDirectives", toJson()); | |
8106 } | |
8107 | |
8108 @override | |
8109 String toString() => JSON.encode(toJson()); | |
8110 | |
8111 @override | |
8112 bool operator ==(other) { | |
8113 if (other is EditOrganizeDirectivesParams) { | |
8114 return file == other.file; | |
8115 } | |
8116 return false; | |
8117 } | |
8118 | |
8119 @override | |
8120 int get hashCode { | |
8121 int hash = 0; | |
8122 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
8123 return JenkinsSmiHash.finish(hash); | |
8124 } | |
8125 } | |
8126 | |
8127 /** | |
8128 * edit.organizeDirectives result | |
8129 * | |
8130 * { | |
8131 * "edit": SourceFileEdit | |
8132 * } | |
8133 * | |
8134 * Clients may not extend, implement or mix-in this class. | |
8135 */ | |
8136 class EditOrganizeDirectivesResult implements ResponseResult { | |
8137 SourceFileEdit _edit; | |
8138 | |
8139 /** | |
8140 * The file edit that is to be applied to the given file to effect the | |
8141 * organizing. | |
8142 */ | |
8143 SourceFileEdit get edit => _edit; | |
8144 | |
8145 /** | |
8146 * The file edit that is to be applied to the given file to effect the | |
8147 * organizing. | |
8148 */ | |
8149 void set edit(SourceFileEdit value) { | |
8150 assert(value != null); | |
8151 this._edit = value; | |
8152 } | |
8153 | |
8154 EditOrganizeDirectivesResult(SourceFileEdit edit) { | |
8155 this.edit = edit; | |
8156 } | |
8157 | |
8158 factory EditOrganizeDirectivesResult.fromJson( | |
8159 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
8160 if (json == null) { | |
8161 json = {}; | |
8162 } | |
8163 if (json is Map) { | |
8164 SourceFileEdit edit; | |
8165 if (json.containsKey("edit")) { | |
8166 edit = new SourceFileEdit.fromJson( | |
8167 jsonDecoder, jsonPath + ".edit", json["edit"]); | |
8168 } else { | |
8169 throw jsonDecoder.mismatch(jsonPath, "edit"); | |
8170 } | |
8171 return new EditOrganizeDirectivesResult(edit); | |
8172 } else { | |
8173 throw jsonDecoder.mismatch( | |
8174 jsonPath, "edit.organizeDirectives result", json); | |
8175 } | |
8176 } | |
8177 | |
8178 factory EditOrganizeDirectivesResult.fromResponse(Response response) { | |
8179 return new EditOrganizeDirectivesResult.fromJson( | |
8180 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
8181 "result", | |
8182 response.result); | |
8183 } | |
8184 | |
8185 @override | |
8186 Map<String, dynamic> toJson() { | |
8187 Map<String, dynamic> result = {}; | |
8188 result["edit"] = edit.toJson(); | |
8189 return result; | |
8190 } | |
8191 | |
8192 @override | |
8193 Response toResponse(String id) { | |
8194 return new Response(id, result: toJson()); | |
8195 } | |
8196 | |
8197 @override | |
8198 String toString() => JSON.encode(toJson()); | |
8199 | |
8200 @override | |
8201 bool operator ==(other) { | |
8202 if (other is EditOrganizeDirectivesResult) { | |
8203 return edit == other.edit; | |
8204 } | |
8205 return false; | |
8206 } | |
8207 | |
8208 @override | |
8209 int get hashCode { | |
8210 int hash = 0; | |
8211 hash = JenkinsSmiHash.combine(hash, edit.hashCode); | |
8212 return JenkinsSmiHash.finish(hash); | |
8213 } | |
8214 } | |
8215 | |
8216 /** | |
8217 * edit.sortMembers params | |
8218 * | |
8219 * { | |
8220 * "file": FilePath | |
8221 * } | |
8222 * | |
8223 * Clients may not extend, implement or mix-in this class. | |
8224 */ | |
8225 class EditSortMembersParams implements RequestParams { | |
8226 String _file; | |
8227 | |
8228 /** | |
8229 * The Dart file to sort. | |
8230 */ | |
8231 String get file => _file; | |
8232 | |
8233 /** | |
8234 * The Dart file to sort. | |
8235 */ | |
8236 void set file(String value) { | |
8237 assert(value != null); | |
8238 this._file = value; | |
8239 } | |
8240 | |
8241 EditSortMembersParams(String file) { | |
8242 this.file = file; | |
8243 } | |
8244 | |
8245 factory EditSortMembersParams.fromJson( | |
8246 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
8247 if (json == null) { | |
8248 json = {}; | |
8249 } | |
8250 if (json is Map) { | |
8251 String file; | |
8252 if (json.containsKey("file")) { | |
8253 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
8254 } else { | |
8255 throw jsonDecoder.mismatch(jsonPath, "file"); | |
8256 } | |
8257 return new EditSortMembersParams(file); | |
8258 } else { | |
8259 throw jsonDecoder.mismatch(jsonPath, "edit.sortMembers params", json); | |
8260 } | |
8261 } | |
8262 | |
8263 factory EditSortMembersParams.fromRequest(Request request) { | |
8264 return new EditSortMembersParams.fromJson( | |
8265 new RequestDecoder(request), "params", request.params); | |
8266 } | |
8267 | |
8268 @override | |
8269 Map<String, dynamic> toJson() { | |
8270 Map<String, dynamic> result = {}; | |
8271 result["file"] = file; | |
8272 return result; | |
8273 } | |
8274 | |
8275 @override | |
8276 Request toRequest(String id) { | |
8277 return new Request(id, "edit.sortMembers", toJson()); | |
8278 } | |
8279 | |
8280 @override | |
8281 String toString() => JSON.encode(toJson()); | |
8282 | |
8283 @override | |
8284 bool operator ==(other) { | |
8285 if (other is EditSortMembersParams) { | |
8286 return file == other.file; | |
8287 } | |
8288 return false; | |
8289 } | |
8290 | |
8291 @override | |
8292 int get hashCode { | |
8293 int hash = 0; | |
8294 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
8295 return JenkinsSmiHash.finish(hash); | |
8296 } | |
8297 } | |
8298 | |
8299 /** | |
8300 * edit.sortMembers result | |
8301 * | |
8302 * { | |
8303 * "edit": SourceFileEdit | |
8304 * } | |
8305 * | |
8306 * Clients may not extend, implement or mix-in this class. | |
8307 */ | |
8308 class EditSortMembersResult implements ResponseResult { | |
8309 SourceFileEdit _edit; | |
8310 | |
8311 /** | |
8312 * The file edit that is to be applied to the given file to effect the | |
8313 * sorting. | |
8314 */ | |
8315 SourceFileEdit get edit => _edit; | |
8316 | |
8317 /** | |
8318 * The file edit that is to be applied to the given file to effect the | |
8319 * sorting. | |
8320 */ | |
8321 void set edit(SourceFileEdit value) { | |
8322 assert(value != null); | |
8323 this._edit = value; | |
8324 } | |
8325 | |
8326 EditSortMembersResult(SourceFileEdit edit) { | |
8327 this.edit = edit; | |
8328 } | |
8329 | |
8330 factory EditSortMembersResult.fromJson( | |
8331 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
8332 if (json == null) { | |
8333 json = {}; | |
8334 } | |
8335 if (json is Map) { | |
8336 SourceFileEdit edit; | |
8337 if (json.containsKey("edit")) { | |
8338 edit = new SourceFileEdit.fromJson( | |
8339 jsonDecoder, jsonPath + ".edit", json["edit"]); | |
8340 } else { | |
8341 throw jsonDecoder.mismatch(jsonPath, "edit"); | |
8342 } | |
8343 return new EditSortMembersResult(edit); | |
8344 } else { | |
8345 throw jsonDecoder.mismatch(jsonPath, "edit.sortMembers result", json); | |
8346 } | |
8347 } | |
8348 | |
8349 factory EditSortMembersResult.fromResponse(Response response) { | |
8350 return new EditSortMembersResult.fromJson( | |
8351 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
8352 "result", | |
8353 response.result); | |
8354 } | |
8355 | |
8356 @override | |
8357 Map<String, dynamic> toJson() { | |
8358 Map<String, dynamic> result = {}; | |
8359 result["edit"] = edit.toJson(); | |
8360 return result; | |
8361 } | |
8362 | |
8363 @override | |
8364 Response toResponse(String id) { | |
8365 return new Response(id, result: toJson()); | |
8366 } | |
8367 | |
8368 @override | |
8369 String toString() => JSON.encode(toJson()); | |
8370 | |
8371 @override | |
8372 bool operator ==(other) { | |
8373 if (other is EditSortMembersResult) { | |
8374 return edit == other.edit; | |
8375 } | |
8376 return false; | |
8377 } | |
8378 | |
8379 @override | |
8380 int get hashCode { | |
8381 int hash = 0; | |
8382 hash = JenkinsSmiHash.combine(hash, edit.hashCode); | |
8383 return JenkinsSmiHash.finish(hash); | |
8384 } | |
8385 } | |
8386 | |
8387 /** | |
8388 * Element | |
8389 * | |
8390 * { | |
8391 * "kind": ElementKind | |
8392 * "name": String | |
8393 * "location": optional Location | |
8394 * "flags": int | |
8395 * "parameters": optional String | |
8396 * "returnType": optional String | |
8397 * "typeParameters": optional String | |
8398 * } | |
8399 * | |
8400 * Clients may not extend, implement or mix-in this class. | |
8401 */ | |
8402 class Element implements HasToJson { | |
8403 static const int FLAG_ABSTRACT = 0x01; | |
8404 static const int FLAG_CONST = 0x02; | |
8405 static const int FLAG_FINAL = 0x04; | |
8406 static const int FLAG_STATIC = 0x08; | |
8407 static const int FLAG_PRIVATE = 0x10; | |
8408 static const int FLAG_DEPRECATED = 0x20; | |
8409 | |
8410 static int makeFlags( | |
8411 {isAbstract: false, | |
8412 isConst: false, | |
8413 isFinal: false, | |
8414 isStatic: false, | |
8415 isPrivate: false, | |
8416 isDeprecated: false}) { | |
8417 int flags = 0; | |
8418 if (isAbstract) flags |= FLAG_ABSTRACT; | |
8419 if (isConst) flags |= FLAG_CONST; | |
8420 if (isFinal) flags |= FLAG_FINAL; | |
8421 if (isStatic) flags |= FLAG_STATIC; | |
8422 if (isPrivate) flags |= FLAG_PRIVATE; | |
8423 if (isDeprecated) flags |= FLAG_DEPRECATED; | |
8424 return flags; | |
8425 } | |
8426 | |
8427 ElementKind _kind; | |
8428 | |
8429 String _name; | |
8430 | |
8431 Location _location; | |
8432 | |
8433 int _flags; | |
8434 | |
8435 String _parameters; | |
8436 | |
8437 String _returnType; | |
8438 | |
8439 String _typeParameters; | |
8440 | |
8441 /** | |
8442 * The kind of the element. | |
8443 */ | |
8444 ElementKind get kind => _kind; | |
8445 | |
8446 /** | |
8447 * The kind of the element. | |
8448 */ | |
8449 void set kind(ElementKind value) { | |
8450 assert(value != null); | |
8451 this._kind = value; | |
8452 } | |
8453 | |
8454 /** | |
8455 * The name of the element. This is typically used as the label in the | |
8456 * outline. | |
8457 */ | |
8458 String get name => _name; | |
8459 | |
8460 /** | |
8461 * The name of the element. This is typically used as the label in the | |
8462 * outline. | |
8463 */ | |
8464 void set name(String value) { | |
8465 assert(value != null); | |
8466 this._name = value; | |
8467 } | |
8468 | |
8469 /** | |
8470 * The location of the name in the declaration of the element. | |
8471 */ | |
8472 Location get location => _location; | |
8473 | |
8474 /** | |
8475 * The location of the name in the declaration of the element. | |
8476 */ | |
8477 void set location(Location value) { | |
8478 this._location = value; | |
8479 } | |
8480 | |
8481 /** | |
8482 * A bit-map containing the following flags: | |
8483 * | |
8484 * - 0x01 - set if the element is explicitly or implicitly abstract | |
8485 * - 0x02 - set if the element was declared to be ‘const’ | |
8486 * - 0x04 - set if the element was declared to be ‘final’ | |
8487 * - 0x08 - set if the element is a static member of a class or is a | |
8488 * top-level function or field | |
8489 * - 0x10 - set if the element is private | |
8490 * - 0x20 - set if the element is deprecated | |
8491 */ | |
8492 int get flags => _flags; | |
8493 | |
8494 /** | |
8495 * A bit-map containing the following flags: | |
8496 * | |
8497 * - 0x01 - set if the element is explicitly or implicitly abstract | |
8498 * - 0x02 - set if the element was declared to be ‘const’ | |
8499 * - 0x04 - set if the element was declared to be ‘final’ | |
8500 * - 0x08 - set if the element is a static member of a class or is a | |
8501 * top-level function or field | |
8502 * - 0x10 - set if the element is private | |
8503 * - 0x20 - set if the element is deprecated | |
8504 */ | |
8505 void set flags(int value) { | |
8506 assert(value != null); | |
8507 this._flags = value; | |
8508 } | |
8509 | |
8510 /** | |
8511 * The parameter list for the element. If the element is not a method or | |
8512 * function this field will not be defined. If the element doesn't have | |
8513 * parameters (e.g. getter), this field will not be defined. If the element | |
8514 * has zero parameters, this field will have a value of "()". | |
8515 */ | |
8516 String get parameters => _parameters; | |
8517 | |
8518 /** | |
8519 * The parameter list for the element. If the element is not a method or | |
8520 * function this field will not be defined. If the element doesn't have | |
8521 * parameters (e.g. getter), this field will not be defined. If the element | |
8522 * has zero parameters, this field will have a value of "()". | |
8523 */ | |
8524 void set parameters(String value) { | |
8525 this._parameters = value; | |
8526 } | |
8527 | |
8528 /** | |
8529 * The return type of the element. If the element is not a method or function | |
8530 * this field will not be defined. If the element does not have a declared | |
8531 * return type, this field will contain an empty string. | |
8532 */ | |
8533 String get returnType => _returnType; | |
8534 | |
8535 /** | |
8536 * The return type of the element. If the element is not a method or function | |
8537 * this field will not be defined. If the element does not have a declared | |
8538 * return type, this field will contain an empty string. | |
8539 */ | |
8540 void set returnType(String value) { | |
8541 this._returnType = value; | |
8542 } | |
8543 | |
8544 /** | |
8545 * The type parameter list for the element. If the element doesn't have type | |
8546 * parameters, this field will not be defined. | |
8547 */ | |
8548 String get typeParameters => _typeParameters; | |
8549 | |
8550 /** | |
8551 * The type parameter list for the element. If the element doesn't have type | |
8552 * parameters, this field will not be defined. | |
8553 */ | |
8554 void set typeParameters(String value) { | |
8555 this._typeParameters = value; | |
8556 } | |
8557 | |
8558 Element(ElementKind kind, String name, int flags, | |
8559 {Location location, | |
8560 String parameters, | |
8561 String returnType, | |
8562 String typeParameters}) { | |
8563 this.kind = kind; | |
8564 this.name = name; | |
8565 this.location = location; | |
8566 this.flags = flags; | |
8567 this.parameters = parameters; | |
8568 this.returnType = returnType; | |
8569 this.typeParameters = typeParameters; | |
8570 } | |
8571 | |
8572 factory Element.fromJson( | |
8573 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
8574 if (json == null) { | |
8575 json = {}; | |
8576 } | |
8577 if (json is Map) { | |
8578 ElementKind kind; | |
8579 if (json.containsKey("kind")) { | |
8580 kind = new ElementKind.fromJson( | |
8581 jsonDecoder, jsonPath + ".kind", json["kind"]); | |
8582 } else { | |
8583 throw jsonDecoder.mismatch(jsonPath, "kind"); | |
8584 } | |
8585 String name; | |
8586 if (json.containsKey("name")) { | |
8587 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]); | |
8588 } else { | |
8589 throw jsonDecoder.mismatch(jsonPath, "name"); | |
8590 } | |
8591 Location location; | |
8592 if (json.containsKey("location")) { | |
8593 location = new Location.fromJson( | |
8594 jsonDecoder, jsonPath + ".location", json["location"]); | |
8595 } | |
8596 int flags; | |
8597 if (json.containsKey("flags")) { | |
8598 flags = jsonDecoder.decodeInt(jsonPath + ".flags", json["flags"]); | |
8599 } else { | |
8600 throw jsonDecoder.mismatch(jsonPath, "flags"); | |
8601 } | |
8602 String parameters; | |
8603 if (json.containsKey("parameters")) { | |
8604 parameters = jsonDecoder.decodeString( | |
8605 jsonPath + ".parameters", json["parameters"]); | |
8606 } | |
8607 String returnType; | |
8608 if (json.containsKey("returnType")) { | |
8609 returnType = jsonDecoder.decodeString( | |
8610 jsonPath + ".returnType", json["returnType"]); | |
8611 } | |
8612 String typeParameters; | |
8613 if (json.containsKey("typeParameters")) { | |
8614 typeParameters = jsonDecoder.decodeString( | |
8615 jsonPath + ".typeParameters", json["typeParameters"]); | |
8616 } | |
8617 return new Element(kind, name, flags, | |
8618 location: location, | |
8619 parameters: parameters, | |
8620 returnType: returnType, | |
8621 typeParameters: typeParameters); | |
8622 } else { | |
8623 throw jsonDecoder.mismatch(jsonPath, "Element", json); | |
8624 } | |
8625 } | |
8626 | |
8627 bool get isAbstract => (flags & FLAG_ABSTRACT) != 0; | |
8628 bool get isConst => (flags & FLAG_CONST) != 0; | |
8629 bool get isFinal => (flags & FLAG_FINAL) != 0; | |
8630 bool get isStatic => (flags & FLAG_STATIC) != 0; | |
8631 bool get isPrivate => (flags & FLAG_PRIVATE) != 0; | |
8632 bool get isDeprecated => (flags & FLAG_DEPRECATED) != 0; | |
8633 | |
8634 @override | |
8635 Map<String, dynamic> toJson() { | |
8636 Map<String, dynamic> result = {}; | |
8637 result["kind"] = kind.toJson(); | |
8638 result["name"] = name; | |
8639 if (location != null) { | |
8640 result["location"] = location.toJson(); | |
8641 } | |
8642 result["flags"] = flags; | |
8643 if (parameters != null) { | |
8644 result["parameters"] = parameters; | |
8645 } | |
8646 if (returnType != null) { | |
8647 result["returnType"] = returnType; | |
8648 } | |
8649 if (typeParameters != null) { | |
8650 result["typeParameters"] = typeParameters; | |
8651 } | |
8652 return result; | |
8653 } | |
8654 | |
8655 @override | |
8656 String toString() => JSON.encode(toJson()); | |
8657 | |
8658 @override | |
8659 bool operator ==(other) { | |
8660 if (other is Element) { | |
8661 return kind == other.kind && | |
8662 name == other.name && | |
8663 location == other.location && | |
8664 flags == other.flags && | |
8665 parameters == other.parameters && | |
8666 returnType == other.returnType && | |
8667 typeParameters == other.typeParameters; | |
8668 } | |
8669 return false; | |
8670 } | |
8671 | |
8672 @override | |
8673 int get hashCode { | |
8674 int hash = 0; | |
8675 hash = JenkinsSmiHash.combine(hash, kind.hashCode); | |
8676 hash = JenkinsSmiHash.combine(hash, name.hashCode); | |
8677 hash = JenkinsSmiHash.combine(hash, location.hashCode); | |
8678 hash = JenkinsSmiHash.combine(hash, flags.hashCode); | |
8679 hash = JenkinsSmiHash.combine(hash, parameters.hashCode); | |
8680 hash = JenkinsSmiHash.combine(hash, returnType.hashCode); | |
8681 hash = JenkinsSmiHash.combine(hash, typeParameters.hashCode); | |
8682 return JenkinsSmiHash.finish(hash); | |
8683 } | |
8684 } | |
8685 | |
8686 /** | |
8687 * ElementKind | |
8688 * | |
8689 * enum { | |
8690 * CLASS | |
8691 * CLASS_TYPE_ALIAS | |
8692 * COMPILATION_UNIT | |
8693 * CONSTRUCTOR | |
8694 * ENUM | |
8695 * ENUM_CONSTANT | |
8696 * FIELD | |
8697 * FILE | |
8698 * FUNCTION | |
8699 * FUNCTION_TYPE_ALIAS | |
8700 * GETTER | |
8701 * LABEL | |
8702 * LIBRARY | |
8703 * LOCAL_VARIABLE | |
8704 * METHOD | |
8705 * PARAMETER | |
8706 * PREFIX | |
8707 * SETTER | |
8708 * TOP_LEVEL_VARIABLE | |
8709 * TYPE_PARAMETER | |
8710 * UNIT_TEST_GROUP | |
8711 * UNIT_TEST_TEST | |
8712 * UNKNOWN | |
8713 * } | |
8714 * | |
8715 * Clients may not extend, implement or mix-in this class. | |
8716 */ | |
8717 class ElementKind implements Enum { | |
8718 static const ElementKind CLASS = const ElementKind._("CLASS"); | |
8719 | |
8720 static const ElementKind CLASS_TYPE_ALIAS = | |
8721 const ElementKind._("CLASS_TYPE_ALIAS"); | |
8722 | |
8723 static const ElementKind COMPILATION_UNIT = | |
8724 const ElementKind._("COMPILATION_UNIT"); | |
8725 | |
8726 static const ElementKind CONSTRUCTOR = const ElementKind._("CONSTRUCTOR"); | |
8727 | |
8728 static const ElementKind ENUM = const ElementKind._("ENUM"); | |
8729 | |
8730 static const ElementKind ENUM_CONSTANT = const ElementKind._("ENUM_CONSTANT"); | |
8731 | |
8732 static const ElementKind FIELD = const ElementKind._("FIELD"); | |
8733 | |
8734 static const ElementKind FILE = const ElementKind._("FILE"); | |
8735 | |
8736 static const ElementKind FUNCTION = const ElementKind._("FUNCTION"); | |
8737 | |
8738 static const ElementKind FUNCTION_TYPE_ALIAS = | |
8739 const ElementKind._("FUNCTION_TYPE_ALIAS"); | |
8740 | |
8741 static const ElementKind GETTER = const ElementKind._("GETTER"); | |
8742 | |
8743 static const ElementKind LABEL = const ElementKind._("LABEL"); | |
8744 | |
8745 static const ElementKind LIBRARY = const ElementKind._("LIBRARY"); | |
8746 | |
8747 static const ElementKind LOCAL_VARIABLE = | |
8748 const ElementKind._("LOCAL_VARIABLE"); | |
8749 | |
8750 static const ElementKind METHOD = const ElementKind._("METHOD"); | |
8751 | |
8752 static const ElementKind PARAMETER = const ElementKind._("PARAMETER"); | |
8753 | |
8754 static const ElementKind PREFIX = const ElementKind._("PREFIX"); | |
8755 | |
8756 static const ElementKind SETTER = const ElementKind._("SETTER"); | |
8757 | |
8758 static const ElementKind TOP_LEVEL_VARIABLE = | |
8759 const ElementKind._("TOP_LEVEL_VARIABLE"); | |
8760 | |
8761 static const ElementKind TYPE_PARAMETER = | |
8762 const ElementKind._("TYPE_PARAMETER"); | |
8763 | |
8764 /** | |
8765 * Deprecated: support for tests was removed. | |
8766 */ | |
8767 static const ElementKind UNIT_TEST_GROUP = | |
8768 const ElementKind._("UNIT_TEST_GROUP"); | |
8769 | |
8770 /** | |
8771 * Deprecated: support for tests was removed. | |
8772 */ | |
8773 static const ElementKind UNIT_TEST_TEST = | |
8774 const ElementKind._("UNIT_TEST_TEST"); | |
8775 | |
8776 static const ElementKind UNKNOWN = const ElementKind._("UNKNOWN"); | |
8777 | |
8778 /** | |
8779 * A list containing all of the enum values that are defined. | |
8780 */ | |
8781 static const List<ElementKind> VALUES = const <ElementKind>[ | |
8782 CLASS, | |
8783 CLASS_TYPE_ALIAS, | |
8784 COMPILATION_UNIT, | |
8785 CONSTRUCTOR, | |
8786 ENUM, | |
8787 ENUM_CONSTANT, | |
8788 FIELD, | |
8789 FILE, | |
8790 FUNCTION, | |
8791 FUNCTION_TYPE_ALIAS, | |
8792 GETTER, | |
8793 LABEL, | |
8794 LIBRARY, | |
8795 LOCAL_VARIABLE, | |
8796 METHOD, | |
8797 PARAMETER, | |
8798 PREFIX, | |
8799 SETTER, | |
8800 TOP_LEVEL_VARIABLE, | |
8801 TYPE_PARAMETER, | |
8802 UNIT_TEST_GROUP, | |
8803 UNIT_TEST_TEST, | |
8804 UNKNOWN | |
8805 ]; | |
8806 | |
8807 @override | |
8808 final String name; | |
8809 | |
8810 const ElementKind._(this.name); | |
8811 | |
8812 factory ElementKind(String name) { | |
8813 switch (name) { | |
8814 case "CLASS": | |
8815 return CLASS; | |
8816 case "CLASS_TYPE_ALIAS": | |
8817 return CLASS_TYPE_ALIAS; | |
8818 case "COMPILATION_UNIT": | |
8819 return COMPILATION_UNIT; | |
8820 case "CONSTRUCTOR": | |
8821 return CONSTRUCTOR; | |
8822 case "ENUM": | |
8823 return ENUM; | |
8824 case "ENUM_CONSTANT": | |
8825 return ENUM_CONSTANT; | |
8826 case "FIELD": | |
8827 return FIELD; | |
8828 case "FILE": | |
8829 return FILE; | |
8830 case "FUNCTION": | |
8831 return FUNCTION; | |
8832 case "FUNCTION_TYPE_ALIAS": | |
8833 return FUNCTION_TYPE_ALIAS; | |
8834 case "GETTER": | |
8835 return GETTER; | |
8836 case "LABEL": | |
8837 return LABEL; | |
8838 case "LIBRARY": | |
8839 return LIBRARY; | |
8840 case "LOCAL_VARIABLE": | |
8841 return LOCAL_VARIABLE; | |
8842 case "METHOD": | |
8843 return METHOD; | |
8844 case "PARAMETER": | |
8845 return PARAMETER; | |
8846 case "PREFIX": | |
8847 return PREFIX; | |
8848 case "SETTER": | |
8849 return SETTER; | |
8850 case "TOP_LEVEL_VARIABLE": | |
8851 return TOP_LEVEL_VARIABLE; | |
8852 case "TYPE_PARAMETER": | |
8853 return TYPE_PARAMETER; | |
8854 case "UNIT_TEST_GROUP": | |
8855 return UNIT_TEST_GROUP; | |
8856 case "UNIT_TEST_TEST": | |
8857 return UNIT_TEST_TEST; | |
8858 case "UNKNOWN": | |
8859 return UNKNOWN; | |
8860 } | |
8861 throw new Exception('Illegal enum value: $name'); | |
8862 } | |
8863 | |
8864 factory ElementKind.fromJson( | |
8865 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
8866 if (json is String) { | |
8867 try { | |
8868 return new ElementKind(json); | |
8869 } catch (_) { | |
8870 // Fall through | |
8871 } | |
8872 } | |
8873 throw jsonDecoder.mismatch(jsonPath, "ElementKind", json); | |
8874 } | |
8875 | |
8876 @override | |
8877 String toString() => "ElementKind.$name"; | |
8878 | |
8879 String toJson() => name; | |
8880 } | |
8881 | |
8882 /** | |
8883 * ExecutableFile | |
8884 * | |
8885 * { | |
8886 * "file": FilePath | |
8887 * "kind": ExecutableKind | |
8888 * } | |
8889 * | |
8890 * Clients may not extend, implement or mix-in this class. | |
8891 */ | |
8892 class ExecutableFile implements HasToJson { | |
8893 String _file; | |
8894 | |
8895 ExecutableKind _kind; | |
8896 | |
8897 /** | |
8898 * The path of the executable file. | |
8899 */ | |
8900 String get file => _file; | |
8901 | |
8902 /** | |
8903 * The path of the executable file. | |
8904 */ | |
8905 void set file(String value) { | |
8906 assert(value != null); | |
8907 this._file = value; | |
8908 } | |
8909 | |
8910 /** | |
8911 * The kind of the executable file. | |
8912 */ | |
8913 ExecutableKind get kind => _kind; | |
8914 | |
8915 /** | |
8916 * The kind of the executable file. | |
8917 */ | |
8918 void set kind(ExecutableKind value) { | |
8919 assert(value != null); | |
8920 this._kind = value; | |
8921 } | |
8922 | |
8923 ExecutableFile(String file, ExecutableKind kind) { | |
8924 this.file = file; | |
8925 this.kind = kind; | |
8926 } | |
8927 | |
8928 factory ExecutableFile.fromJson( | |
8929 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
8930 if (json == null) { | |
8931 json = {}; | |
8932 } | |
8933 if (json is Map) { | |
8934 String file; | |
8935 if (json.containsKey("file")) { | |
8936 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
8937 } else { | |
8938 throw jsonDecoder.mismatch(jsonPath, "file"); | |
8939 } | |
8940 ExecutableKind kind; | |
8941 if (json.containsKey("kind")) { | |
8942 kind = new ExecutableKind.fromJson( | |
8943 jsonDecoder, jsonPath + ".kind", json["kind"]); | |
8944 } else { | |
8945 throw jsonDecoder.mismatch(jsonPath, "kind"); | |
8946 } | |
8947 return new ExecutableFile(file, kind); | |
8948 } else { | |
8949 throw jsonDecoder.mismatch(jsonPath, "ExecutableFile", json); | |
8950 } | |
8951 } | |
8952 | |
8953 @override | |
8954 Map<String, dynamic> toJson() { | |
8955 Map<String, dynamic> result = {}; | |
8956 result["file"] = file; | |
8957 result["kind"] = kind.toJson(); | |
8958 return result; | |
8959 } | |
8960 | |
8961 @override | |
8962 String toString() => JSON.encode(toJson()); | |
8963 | |
8964 @override | |
8965 bool operator ==(other) { | |
8966 if (other is ExecutableFile) { | |
8967 return file == other.file && kind == other.kind; | |
8968 } | |
8969 return false; | |
8970 } | |
8971 | |
8972 @override | |
8973 int get hashCode { | |
8974 int hash = 0; | |
8975 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
8976 hash = JenkinsSmiHash.combine(hash, kind.hashCode); | |
8977 return JenkinsSmiHash.finish(hash); | |
8978 } | |
8979 } | |
8980 | |
8981 /** | |
8982 * ExecutableKind | |
8983 * | |
8984 * enum { | |
8985 * CLIENT | |
8986 * EITHER | |
8987 * NOT_EXECUTABLE | |
8988 * SERVER | |
8989 * } | |
8990 * | |
8991 * Clients may not extend, implement or mix-in this class. | |
8992 */ | |
8993 class ExecutableKind implements Enum { | |
8994 static const ExecutableKind CLIENT = const ExecutableKind._("CLIENT"); | |
8995 | |
8996 static const ExecutableKind EITHER = const ExecutableKind._("EITHER"); | |
8997 | |
8998 static const ExecutableKind NOT_EXECUTABLE = | |
8999 const ExecutableKind._("NOT_EXECUTABLE"); | |
9000 | |
9001 static const ExecutableKind SERVER = const ExecutableKind._("SERVER"); | |
9002 | |
9003 /** | |
9004 * A list containing all of the enum values that are defined. | |
9005 */ | |
9006 static const List<ExecutableKind> VALUES = const <ExecutableKind>[ | |
9007 CLIENT, | |
9008 EITHER, | |
9009 NOT_EXECUTABLE, | |
9010 SERVER | |
9011 ]; | |
9012 | |
9013 @override | |
9014 final String name; | |
9015 | |
9016 const ExecutableKind._(this.name); | |
9017 | |
9018 factory ExecutableKind(String name) { | |
9019 switch (name) { | |
9020 case "CLIENT": | |
9021 return CLIENT; | |
9022 case "EITHER": | |
9023 return EITHER; | |
9024 case "NOT_EXECUTABLE": | |
9025 return NOT_EXECUTABLE; | |
9026 case "SERVER": | |
9027 return SERVER; | |
9028 } | |
9029 throw new Exception('Illegal enum value: $name'); | |
9030 } | |
9031 | |
9032 factory ExecutableKind.fromJson( | |
9033 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
9034 if (json is String) { | |
9035 try { | |
9036 return new ExecutableKind(json); | |
9037 } catch (_) { | |
9038 // Fall through | |
9039 } | |
9040 } | |
9041 throw jsonDecoder.mismatch(jsonPath, "ExecutableKind", json); | |
9042 } | |
9043 | |
9044 @override | |
9045 String toString() => "ExecutableKind.$name"; | |
9046 | |
9047 String toJson() => name; | |
9048 } | |
9049 | |
9050 /** | |
9051 * execution.createContext params | |
9052 * | |
9053 * { | |
9054 * "contextRoot": FilePath | |
9055 * } | |
9056 * | |
9057 * Clients may not extend, implement or mix-in this class. | |
9058 */ | |
9059 class ExecutionCreateContextParams implements RequestParams { | |
9060 String _contextRoot; | |
9061 | |
9062 /** | |
9063 * The path of the Dart or HTML file that will be launched, or the path of | |
9064 * the directory containing the file. | |
9065 */ | |
9066 String get contextRoot => _contextRoot; | |
9067 | |
9068 /** | |
9069 * The path of the Dart or HTML file that will be launched, or the path of | |
9070 * the directory containing the file. | |
9071 */ | |
9072 void set contextRoot(String value) { | |
9073 assert(value != null); | |
9074 this._contextRoot = value; | |
9075 } | |
9076 | |
9077 ExecutionCreateContextParams(String contextRoot) { | |
9078 this.contextRoot = contextRoot; | |
9079 } | |
9080 | |
9081 factory ExecutionCreateContextParams.fromJson( | |
9082 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
9083 if (json == null) { | |
9084 json = {}; | |
9085 } | |
9086 if (json is Map) { | |
9087 String contextRoot; | |
9088 if (json.containsKey("contextRoot")) { | |
9089 contextRoot = jsonDecoder.decodeString( | |
9090 jsonPath + ".contextRoot", json["contextRoot"]); | |
9091 } else { | |
9092 throw jsonDecoder.mismatch(jsonPath, "contextRoot"); | |
9093 } | |
9094 return new ExecutionCreateContextParams(contextRoot); | |
9095 } else { | |
9096 throw jsonDecoder.mismatch( | |
9097 jsonPath, "execution.createContext params", json); | |
9098 } | |
9099 } | |
9100 | |
9101 factory ExecutionCreateContextParams.fromRequest(Request request) { | |
9102 return new ExecutionCreateContextParams.fromJson( | |
9103 new RequestDecoder(request), "params", request.params); | |
9104 } | |
9105 | |
9106 @override | |
9107 Map<String, dynamic> toJson() { | |
9108 Map<String, dynamic> result = {}; | |
9109 result["contextRoot"] = contextRoot; | |
9110 return result; | |
9111 } | |
9112 | |
9113 @override | |
9114 Request toRequest(String id) { | |
9115 return new Request(id, "execution.createContext", toJson()); | |
9116 } | |
9117 | |
9118 @override | |
9119 String toString() => JSON.encode(toJson()); | |
9120 | |
9121 @override | |
9122 bool operator ==(other) { | |
9123 if (other is ExecutionCreateContextParams) { | |
9124 return contextRoot == other.contextRoot; | |
9125 } | |
9126 return false; | |
9127 } | |
9128 | |
9129 @override | |
9130 int get hashCode { | |
9131 int hash = 0; | |
9132 hash = JenkinsSmiHash.combine(hash, contextRoot.hashCode); | |
9133 return JenkinsSmiHash.finish(hash); | |
9134 } | |
9135 } | |
9136 | |
9137 /** | |
9138 * execution.createContext result | |
9139 * | |
9140 * { | |
9141 * "id": ExecutionContextId | |
9142 * } | |
9143 * | |
9144 * Clients may not extend, implement or mix-in this class. | |
9145 */ | |
9146 class ExecutionCreateContextResult implements ResponseResult { | |
9147 String _id; | |
9148 | |
9149 /** | |
9150 * The identifier used to refer to the execution context that was created. | |
9151 */ | |
9152 String get id => _id; | |
9153 | |
9154 /** | |
9155 * The identifier used to refer to the execution context that was created. | |
9156 */ | |
9157 void set id(String value) { | |
9158 assert(value != null); | |
9159 this._id = value; | |
9160 } | |
9161 | |
9162 ExecutionCreateContextResult(String id) { | |
9163 this.id = id; | |
9164 } | |
9165 | |
9166 factory ExecutionCreateContextResult.fromJson( | |
9167 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
9168 if (json == null) { | |
9169 json = {}; | |
9170 } | |
9171 if (json is Map) { | |
9172 String id; | |
9173 if (json.containsKey("id")) { | |
9174 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); | |
9175 } else { | |
9176 throw jsonDecoder.mismatch(jsonPath, "id"); | |
9177 } | |
9178 return new ExecutionCreateContextResult(id); | |
9179 } else { | |
9180 throw jsonDecoder.mismatch( | |
9181 jsonPath, "execution.createContext result", json); | |
9182 } | |
9183 } | |
9184 | |
9185 factory ExecutionCreateContextResult.fromResponse(Response response) { | |
9186 return new ExecutionCreateContextResult.fromJson( | |
9187 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
9188 "result", | |
9189 response.result); | |
9190 } | |
9191 | |
9192 @override | |
9193 Map<String, dynamic> toJson() { | |
9194 Map<String, dynamic> result = {}; | |
9195 result["id"] = id; | |
9196 return result; | |
9197 } | |
9198 | |
9199 @override | |
9200 Response toResponse(String id) { | |
9201 return new Response(id, result: toJson()); | |
9202 } | |
9203 | |
9204 @override | |
9205 String toString() => JSON.encode(toJson()); | |
9206 | |
9207 @override | |
9208 bool operator ==(other) { | |
9209 if (other is ExecutionCreateContextResult) { | |
9210 return id == other.id; | |
9211 } | |
9212 return false; | |
9213 } | |
9214 | |
9215 @override | |
9216 int get hashCode { | |
9217 int hash = 0; | |
9218 hash = JenkinsSmiHash.combine(hash, id.hashCode); | |
9219 return JenkinsSmiHash.finish(hash); | |
9220 } | |
9221 } | |
9222 | |
9223 /** | |
9224 * execution.deleteContext params | |
9225 * | |
9226 * { | |
9227 * "id": ExecutionContextId | |
9228 * } | |
9229 * | |
9230 * Clients may not extend, implement or mix-in this class. | |
9231 */ | |
9232 class ExecutionDeleteContextParams implements RequestParams { | |
9233 String _id; | |
9234 | |
9235 /** | |
9236 * The identifier of the execution context that is to be deleted. | |
9237 */ | |
9238 String get id => _id; | |
9239 | |
9240 /** | |
9241 * The identifier of the execution context that is to be deleted. | |
9242 */ | |
9243 void set id(String value) { | |
9244 assert(value != null); | |
9245 this._id = value; | |
9246 } | |
9247 | |
9248 ExecutionDeleteContextParams(String id) { | |
9249 this.id = id; | |
9250 } | |
9251 | |
9252 factory ExecutionDeleteContextParams.fromJson( | |
9253 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
9254 if (json == null) { | |
9255 json = {}; | |
9256 } | |
9257 if (json is Map) { | |
9258 String id; | |
9259 if (json.containsKey("id")) { | |
9260 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); | |
9261 } else { | |
9262 throw jsonDecoder.mismatch(jsonPath, "id"); | |
9263 } | |
9264 return new ExecutionDeleteContextParams(id); | |
9265 } else { | |
9266 throw jsonDecoder.mismatch( | |
9267 jsonPath, "execution.deleteContext params", json); | |
9268 } | |
9269 } | |
9270 | |
9271 factory ExecutionDeleteContextParams.fromRequest(Request request) { | |
9272 return new ExecutionDeleteContextParams.fromJson( | |
9273 new RequestDecoder(request), "params", request.params); | |
9274 } | |
9275 | |
9276 @override | |
9277 Map<String, dynamic> toJson() { | |
9278 Map<String, dynamic> result = {}; | |
9279 result["id"] = id; | |
9280 return result; | |
9281 } | |
9282 | |
9283 @override | |
9284 Request toRequest(String id) { | |
9285 return new Request(id, "execution.deleteContext", toJson()); | |
9286 } | |
9287 | |
9288 @override | |
9289 String toString() => JSON.encode(toJson()); | |
9290 | |
9291 @override | |
9292 bool operator ==(other) { | |
9293 if (other is ExecutionDeleteContextParams) { | |
9294 return id == other.id; | |
9295 } | |
9296 return false; | |
9297 } | |
9298 | |
9299 @override | |
9300 int get hashCode { | |
9301 int hash = 0; | |
9302 hash = JenkinsSmiHash.combine(hash, id.hashCode); | |
9303 return JenkinsSmiHash.finish(hash); | |
9304 } | |
9305 } | |
9306 | |
9307 /** | |
9308 * execution.deleteContext result | |
9309 * | |
9310 * Clients may not extend, implement or mix-in this class. | |
9311 */ | |
9312 class ExecutionDeleteContextResult implements ResponseResult { | |
9313 @override | |
9314 Map<String, dynamic> toJson() => <String, dynamic>{}; | |
9315 | |
9316 @override | |
9317 Response toResponse(String id) { | |
9318 return new Response(id, result: null); | |
9319 } | |
9320 | |
9321 @override | |
9322 bool operator ==(other) { | |
9323 if (other is ExecutionDeleteContextResult) { | |
9324 return true; | |
9325 } | |
9326 return false; | |
9327 } | |
9328 | |
9329 @override | |
9330 int get hashCode { | |
9331 return 479954425; | |
9332 } | |
9333 } | |
9334 | |
9335 /** | |
9336 * execution.launchData params | |
9337 * | |
9338 * { | |
9339 * "file": FilePath | |
9340 * "kind": optional ExecutableKind | |
9341 * "referencedFiles": optional List<FilePath> | |
9342 * } | |
9343 * | |
9344 * Clients may not extend, implement or mix-in this class. | |
9345 */ | |
9346 class ExecutionLaunchDataParams implements HasToJson { | |
9347 String _file; | |
9348 | |
9349 ExecutableKind _kind; | |
9350 | |
9351 List<String> _referencedFiles; | |
9352 | |
9353 /** | |
9354 * The file for which launch data is being provided. This will either be a | |
9355 * Dart library or an HTML file. | |
9356 */ | |
9357 String get file => _file; | |
9358 | |
9359 /** | |
9360 * The file for which launch data is being provided. This will either be a | |
9361 * Dart library or an HTML file. | |
9362 */ | |
9363 void set file(String value) { | |
9364 assert(value != null); | |
9365 this._file = value; | |
9366 } | |
9367 | |
9368 /** | |
9369 * The kind of the executable file. This field is omitted if the file is not | |
9370 * a Dart file. | |
9371 */ | |
9372 ExecutableKind get kind => _kind; | |
9373 | |
9374 /** | |
9375 * The kind of the executable file. This field is omitted if the file is not | |
9376 * a Dart file. | |
9377 */ | |
9378 void set kind(ExecutableKind value) { | |
9379 this._kind = value; | |
9380 } | |
9381 | |
9382 /** | |
9383 * A list of the Dart files that are referenced by the file. This field is | |
9384 * omitted if the file is not an HTML file. | |
9385 */ | |
9386 List<String> get referencedFiles => _referencedFiles; | |
9387 | |
9388 /** | |
9389 * A list of the Dart files that are referenced by the file. This field is | |
9390 * omitted if the file is not an HTML file. | |
9391 */ | |
9392 void set referencedFiles(List<String> value) { | |
9393 this._referencedFiles = value; | |
9394 } | |
9395 | |
9396 ExecutionLaunchDataParams(String file, | |
9397 {ExecutableKind kind, List<String> referencedFiles}) { | |
9398 this.file = file; | |
9399 this.kind = kind; | |
9400 this.referencedFiles = referencedFiles; | |
9401 } | |
9402 | |
9403 factory ExecutionLaunchDataParams.fromJson( | |
9404 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
9405 if (json == null) { | |
9406 json = {}; | |
9407 } | |
9408 if (json is Map) { | |
9409 String file; | |
9410 if (json.containsKey("file")) { | |
9411 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
9412 } else { | |
9413 throw jsonDecoder.mismatch(jsonPath, "file"); | |
9414 } | |
9415 ExecutableKind kind; | |
9416 if (json.containsKey("kind")) { | |
9417 kind = new ExecutableKind.fromJson( | |
9418 jsonDecoder, jsonPath + ".kind", json["kind"]); | |
9419 } | |
9420 List<String> referencedFiles; | |
9421 if (json.containsKey("referencedFiles")) { | |
9422 referencedFiles = jsonDecoder.decodeList(jsonPath + ".referencedFiles", | |
9423 json["referencedFiles"], jsonDecoder.decodeString); | |
9424 } | |
9425 return new ExecutionLaunchDataParams(file, | |
9426 kind: kind, referencedFiles: referencedFiles); | |
9427 } else { | |
9428 throw jsonDecoder.mismatch(jsonPath, "execution.launchData params", json); | |
9429 } | |
9430 } | |
9431 | |
9432 factory ExecutionLaunchDataParams.fromNotification( | |
9433 Notification notification) { | |
9434 return new ExecutionLaunchDataParams.fromJson( | |
9435 new ResponseDecoder(null), "params", notification.params); | |
9436 } | |
9437 | |
9438 @override | |
9439 Map<String, dynamic> toJson() { | |
9440 Map<String, dynamic> result = {}; | |
9441 result["file"] = file; | |
9442 if (kind != null) { | |
9443 result["kind"] = kind.toJson(); | |
9444 } | |
9445 if (referencedFiles != null) { | |
9446 result["referencedFiles"] = referencedFiles; | |
9447 } | |
9448 return result; | |
9449 } | |
9450 | |
9451 Notification toNotification() { | |
9452 return new Notification("execution.launchData", toJson()); | |
9453 } | |
9454 | |
9455 @override | |
9456 String toString() => JSON.encode(toJson()); | |
9457 | |
9458 @override | |
9459 bool operator ==(other) { | |
9460 if (other is ExecutionLaunchDataParams) { | |
9461 return file == other.file && | |
9462 kind == other.kind && | |
9463 listEqual(referencedFiles, other.referencedFiles, | |
9464 (String a, String b) => a == b); | |
9465 } | |
9466 return false; | |
9467 } | |
9468 | |
9469 @override | |
9470 int get hashCode { | |
9471 int hash = 0; | |
9472 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
9473 hash = JenkinsSmiHash.combine(hash, kind.hashCode); | |
9474 hash = JenkinsSmiHash.combine(hash, referencedFiles.hashCode); | |
9475 return JenkinsSmiHash.finish(hash); | |
9476 } | |
9477 } | |
9478 | |
9479 /** | |
9480 * execution.mapUri params | |
9481 * | |
9482 * { | |
9483 * "id": ExecutionContextId | |
9484 * "file": optional FilePath | |
9485 * "uri": optional String | |
9486 * } | |
9487 * | |
9488 * Clients may not extend, implement or mix-in this class. | |
9489 */ | |
9490 class ExecutionMapUriParams implements RequestParams { | |
9491 String _id; | |
9492 | |
9493 String _file; | |
9494 | |
9495 String _uri; | |
9496 | |
9497 /** | |
9498 * The identifier of the execution context in which the URI is to be mapped. | |
9499 */ | |
9500 String get id => _id; | |
9501 | |
9502 /** | |
9503 * The identifier of the execution context in which the URI is to be mapped. | |
9504 */ | |
9505 void set id(String value) { | |
9506 assert(value != null); | |
9507 this._id = value; | |
9508 } | |
9509 | |
9510 /** | |
9511 * The path of the file to be mapped into a URI. | |
9512 */ | |
9513 String get file => _file; | |
9514 | |
9515 /** | |
9516 * The path of the file to be mapped into a URI. | |
9517 */ | |
9518 void set file(String value) { | |
9519 this._file = value; | |
9520 } | |
9521 | |
9522 /** | |
9523 * The URI to be mapped into a file path. | |
9524 */ | |
9525 String get uri => _uri; | |
9526 | |
9527 /** | |
9528 * The URI to be mapped into a file path. | |
9529 */ | |
9530 void set uri(String value) { | |
9531 this._uri = value; | |
9532 } | |
9533 | |
9534 ExecutionMapUriParams(String id, {String file, String uri}) { | |
9535 this.id = id; | |
9536 this.file = file; | |
9537 this.uri = uri; | |
9538 } | |
9539 | |
9540 factory ExecutionMapUriParams.fromJson( | |
9541 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
9542 if (json == null) { | |
9543 json = {}; | |
9544 } | |
9545 if (json is Map) { | |
9546 String id; | |
9547 if (json.containsKey("id")) { | |
9548 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); | |
9549 } else { | |
9550 throw jsonDecoder.mismatch(jsonPath, "id"); | |
9551 } | |
9552 String file; | |
9553 if (json.containsKey("file")) { | |
9554 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
9555 } | |
9556 String uri; | |
9557 if (json.containsKey("uri")) { | |
9558 uri = jsonDecoder.decodeString(jsonPath + ".uri", json["uri"]); | |
9559 } | |
9560 return new ExecutionMapUriParams(id, file: file, uri: uri); | |
9561 } else { | |
9562 throw jsonDecoder.mismatch(jsonPath, "execution.mapUri params", json); | |
9563 } | |
9564 } | |
9565 | |
9566 factory ExecutionMapUriParams.fromRequest(Request request) { | |
9567 return new ExecutionMapUriParams.fromJson( | |
9568 new RequestDecoder(request), "params", request.params); | |
9569 } | |
9570 | |
9571 @override | |
9572 Map<String, dynamic> toJson() { | |
9573 Map<String, dynamic> result = {}; | |
9574 result["id"] = id; | |
9575 if (file != null) { | |
9576 result["file"] = file; | |
9577 } | |
9578 if (uri != null) { | |
9579 result["uri"] = uri; | |
9580 } | |
9581 return result; | |
9582 } | |
9583 | |
9584 @override | |
9585 Request toRequest(String id) { | |
9586 return new Request(id, "execution.mapUri", toJson()); | |
9587 } | |
9588 | |
9589 @override | |
9590 String toString() => JSON.encode(toJson()); | |
9591 | |
9592 @override | |
9593 bool operator ==(other) { | |
9594 if (other is ExecutionMapUriParams) { | |
9595 return id == other.id && file == other.file && uri == other.uri; | |
9596 } | |
9597 return false; | |
9598 } | |
9599 | |
9600 @override | |
9601 int get hashCode { | |
9602 int hash = 0; | |
9603 hash = JenkinsSmiHash.combine(hash, id.hashCode); | |
9604 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
9605 hash = JenkinsSmiHash.combine(hash, uri.hashCode); | |
9606 return JenkinsSmiHash.finish(hash); | |
9607 } | |
9608 } | |
9609 | |
9610 /** | |
9611 * execution.mapUri result | |
9612 * | |
9613 * { | |
9614 * "file": optional FilePath | |
9615 * "uri": optional String | |
9616 * } | |
9617 * | |
9618 * Clients may not extend, implement or mix-in this class. | |
9619 */ | |
9620 class ExecutionMapUriResult implements ResponseResult { | |
9621 String _file; | |
9622 | |
9623 String _uri; | |
9624 | |
9625 /** | |
9626 * The file to which the URI was mapped. This field is omitted if the uri | |
9627 * field was not given in the request. | |
9628 */ | |
9629 String get file => _file; | |
9630 | |
9631 /** | |
9632 * The file to which the URI was mapped. This field is omitted if the uri | |
9633 * field was not given in the request. | |
9634 */ | |
9635 void set file(String value) { | |
9636 this._file = value; | |
9637 } | |
9638 | |
9639 /** | |
9640 * The URI to which the file path was mapped. This field is omitted if the | |
9641 * file field was not given in the request. | |
9642 */ | |
9643 String get uri => _uri; | |
9644 | |
9645 /** | |
9646 * The URI to which the file path was mapped. This field is omitted if the | |
9647 * file field was not given in the request. | |
9648 */ | |
9649 void set uri(String value) { | |
9650 this._uri = value; | |
9651 } | |
9652 | |
9653 ExecutionMapUriResult({String file, String uri}) { | |
9654 this.file = file; | |
9655 this.uri = uri; | |
9656 } | |
9657 | |
9658 factory ExecutionMapUriResult.fromJson( | |
9659 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
9660 if (json == null) { | |
9661 json = {}; | |
9662 } | |
9663 if (json is Map) { | |
9664 String file; | |
9665 if (json.containsKey("file")) { | |
9666 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
9667 } | |
9668 String uri; | |
9669 if (json.containsKey("uri")) { | |
9670 uri = jsonDecoder.decodeString(jsonPath + ".uri", json["uri"]); | |
9671 } | |
9672 return new ExecutionMapUriResult(file: file, uri: uri); | |
9673 } else { | |
9674 throw jsonDecoder.mismatch(jsonPath, "execution.mapUri result", json); | |
9675 } | |
9676 } | |
9677 | |
9678 factory ExecutionMapUriResult.fromResponse(Response response) { | |
9679 return new ExecutionMapUriResult.fromJson( | |
9680 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
9681 "result", | |
9682 response.result); | |
9683 } | |
9684 | |
9685 @override | |
9686 Map<String, dynamic> toJson() { | |
9687 Map<String, dynamic> result = {}; | |
9688 if (file != null) { | |
9689 result["file"] = file; | |
9690 } | |
9691 if (uri != null) { | |
9692 result["uri"] = uri; | |
9693 } | |
9694 return result; | |
9695 } | |
9696 | |
9697 @override | |
9698 Response toResponse(String id) { | |
9699 return new Response(id, result: toJson()); | |
9700 } | |
9701 | |
9702 @override | |
9703 String toString() => JSON.encode(toJson()); | |
9704 | |
9705 @override | |
9706 bool operator ==(other) { | |
9707 if (other is ExecutionMapUriResult) { | |
9708 return file == other.file && uri == other.uri; | |
9709 } | |
9710 return false; | |
9711 } | |
9712 | |
9713 @override | |
9714 int get hashCode { | |
9715 int hash = 0; | |
9716 hash = JenkinsSmiHash.combine(hash, file.hashCode); | |
9717 hash = JenkinsSmiHash.combine(hash, uri.hashCode); | |
9718 return JenkinsSmiHash.finish(hash); | |
9719 } | |
9720 } | |
9721 | |
9722 /** | |
9723 * ExecutionService | |
9724 * | |
9725 * enum { | |
9726 * LAUNCH_DATA | |
9727 * } | |
9728 * | |
9729 * Clients may not extend, implement or mix-in this class. | |
9730 */ | |
9731 class ExecutionService implements Enum { | |
9732 static const ExecutionService LAUNCH_DATA = | |
9733 const ExecutionService._("LAUNCH_DATA"); | |
9734 | |
9735 /** | |
9736 * A list containing all of the enum values that are defined. | |
9737 */ | |
9738 static const List<ExecutionService> VALUES = const <ExecutionService>[ | |
9739 LAUNCH_DATA | |
9740 ]; | |
9741 | |
9742 @override | |
9743 final String name; | |
9744 | |
9745 const ExecutionService._(this.name); | |
9746 | |
9747 factory ExecutionService(String name) { | |
9748 switch (name) { | |
9749 case "LAUNCH_DATA": | |
9750 return LAUNCH_DATA; | |
9751 } | |
9752 throw new Exception('Illegal enum value: $name'); | |
9753 } | |
9754 | |
9755 factory ExecutionService.fromJson( | |
9756 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
9757 if (json is String) { | |
9758 try { | |
9759 return new ExecutionService(json); | |
9760 } catch (_) { | |
9761 // Fall through | |
9762 } | |
9763 } | |
9764 throw jsonDecoder.mismatch(jsonPath, "ExecutionService", json); | |
9765 } | |
9766 | |
9767 @override | |
9768 String toString() => "ExecutionService.$name"; | |
9769 | |
9770 String toJson() => name; | |
9771 } | |
9772 | |
9773 /** | |
9774 * execution.setSubscriptions params | |
9775 * | |
9776 * { | |
9777 * "subscriptions": List<ExecutionService> | |
9778 * } | |
9779 * | |
9780 * Clients may not extend, implement or mix-in this class. | |
9781 */ | |
9782 class ExecutionSetSubscriptionsParams implements RequestParams { | |
9783 List<ExecutionService> _subscriptions; | |
9784 | |
9785 /** | |
9786 * A list of the services being subscribed to. | |
9787 */ | |
9788 List<ExecutionService> get subscriptions => _subscriptions; | |
9789 | |
9790 /** | |
9791 * A list of the services being subscribed to. | |
9792 */ | |
9793 void set subscriptions(List<ExecutionService> value) { | |
9794 assert(value != null); | |
9795 this._subscriptions = value; | |
9796 } | |
9797 | |
9798 ExecutionSetSubscriptionsParams(List<ExecutionService> subscriptions) { | |
9799 this.subscriptions = subscriptions; | |
9800 } | |
9801 | |
9802 factory ExecutionSetSubscriptionsParams.fromJson( | |
9803 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
9804 if (json == null) { | |
9805 json = {}; | |
9806 } | |
9807 if (json is Map) { | |
9808 List<ExecutionService> subscriptions; | |
9809 if (json.containsKey("subscriptions")) { | |
9810 subscriptions = jsonDecoder.decodeList( | |
9811 jsonPath + ".subscriptions", | |
9812 json["subscriptions"], | |
9813 (String jsonPath, Object json) => | |
9814 new ExecutionService.fromJson(jsonDecoder, jsonPath, json)); | |
9815 } else { | |
9816 throw jsonDecoder.mismatch(jsonPath, "subscriptions"); | |
9817 } | |
9818 return new ExecutionSetSubscriptionsParams(subscriptions); | |
9819 } else { | |
9820 throw jsonDecoder.mismatch( | |
9821 jsonPath, "execution.setSubscriptions params", json); | |
9822 } | |
9823 } | |
9824 | |
9825 factory ExecutionSetSubscriptionsParams.fromRequest(Request request) { | |
9826 return new ExecutionSetSubscriptionsParams.fromJson( | |
9827 new RequestDecoder(request), "params", request.params); | |
9828 } | |
9829 | |
9830 @override | |
9831 Map<String, dynamic> toJson() { | |
9832 Map<String, dynamic> result = {}; | |
9833 result["subscriptions"] = | |
9834 subscriptions.map((ExecutionService value) => value.toJson()).toList(); | |
9835 return result; | |
9836 } | |
9837 | |
9838 @override | |
9839 Request toRequest(String id) { | |
9840 return new Request(id, "execution.setSubscriptions", toJson()); | |
9841 } | |
9842 | |
9843 @override | |
9844 String toString() => JSON.encode(toJson()); | |
9845 | |
9846 @override | |
9847 bool operator ==(other) { | |
9848 if (other is ExecutionSetSubscriptionsParams) { | |
9849 return listEqual(subscriptions, other.subscriptions, | |
9850 (ExecutionService a, ExecutionService b) => a == b); | |
9851 } | |
9852 return false; | |
9853 } | |
9854 | |
9855 @override | |
9856 int get hashCode { | |
9857 int hash = 0; | |
9858 hash = JenkinsSmiHash.combine(hash, subscriptions.hashCode); | |
9859 return JenkinsSmiHash.finish(hash); | |
9860 } | |
9861 } | |
9862 | |
9863 /** | |
9864 * execution.setSubscriptions result | |
9865 * | |
9866 * Clients may not extend, implement or mix-in this class. | |
9867 */ | |
9868 class ExecutionSetSubscriptionsResult implements ResponseResult { | |
9869 @override | |
9870 Map<String, dynamic> toJson() => <String, dynamic>{}; | |
9871 | |
9872 @override | |
9873 Response toResponse(String id) { | |
9874 return new Response(id, result: null); | |
9875 } | |
9876 | |
9877 @override | |
9878 bool operator ==(other) { | |
9879 if (other is ExecutionSetSubscriptionsResult) { | |
9880 return true; | |
9881 } | |
9882 return false; | |
9883 } | |
9884 | |
9885 @override | |
9886 int get hashCode { | |
9887 return 287678780; | |
9888 } | |
9889 } | |
9890 | |
9891 /** | |
9892 * extractLocalVariable feedback | |
9893 * | |
9894 * { | |
9895 * "coveringExpressionOffsets": optional List<int> | |
9896 * "coveringExpressionLengths": optional List<int> | |
9897 * "names": List<String> | |
9898 * "offsets": List<int> | |
9899 * "lengths": List<int> | |
9900 * } | |
9901 * | |
9902 * Clients may not extend, implement or mix-in this class. | |
9903 */ | |
9904 class ExtractLocalVariableFeedback extends RefactoringFeedback { | |
9905 List<int> _coveringExpressionOffsets; | |
9906 | |
9907 List<int> _coveringExpressionLengths; | |
9908 | |
9909 List<String> _names; | |
9910 | |
9911 List<int> _offsets; | |
9912 | |
9913 List<int> _lengths; | |
9914 | |
9915 /** | |
9916 * The offsets of the expressions that cover the specified selection, from | |
9917 * the down most to the up most. | |
9918 */ | |
9919 List<int> get coveringExpressionOffsets => _coveringExpressionOffsets; | |
9920 | |
9921 /** | |
9922 * The offsets of the expressions that cover the specified selection, from | |
9923 * the down most to the up most. | |
9924 */ | |
9925 void set coveringExpressionOffsets(List<int> value) { | |
9926 this._coveringExpressionOffsets = value; | |
9927 } | |
9928 | |
9929 /** | |
9930 * The lengths of the expressions that cover the specified selection, from | |
9931 * the down most to the up most. | |
9932 */ | |
9933 List<int> get coveringExpressionLengths => _coveringExpressionLengths; | |
9934 | |
9935 /** | |
9936 * The lengths of the expressions that cover the specified selection, from | |
9937 * the down most to the up most. | |
9938 */ | |
9939 void set coveringExpressionLengths(List<int> value) { | |
9940 this._coveringExpressionLengths = value; | |
9941 } | |
9942 | |
9943 /** | |
9944 * The proposed names for the local variable. | |
9945 */ | |
9946 List<String> get names => _names; | |
9947 | |
9948 /** | |
9949 * The proposed names for the local variable. | |
9950 */ | |
9951 void set names(List<String> value) { | |
9952 assert(value != null); | |
9953 this._names = value; | |
9954 } | |
9955 | |
9956 /** | |
9957 * The offsets of the expressions that would be replaced by a reference to | |
9958 * the variable. | |
9959 */ | |
9960 List<int> get offsets => _offsets; | |
9961 | |
9962 /** | |
9963 * The offsets of the expressions that would be replaced by a reference to | |
9964 * the variable. | |
9965 */ | |
9966 void set offsets(List<int> value) { | |
9967 assert(value != null); | |
9968 this._offsets = value; | |
9969 } | |
9970 | |
9971 /** | |
9972 * The lengths of the expressions that would be replaced by a reference to | |
9973 * the variable. The lengths correspond to the offsets. In other words, for a | |
9974 * given expression, if the offset of that expression is offsets[i], then the | |
9975 * length of that expression is lengths[i]. | |
9976 */ | |
9977 List<int> get lengths => _lengths; | |
9978 | |
9979 /** | |
9980 * The lengths of the expressions that would be replaced by a reference to | |
9981 * the variable. The lengths correspond to the offsets. In other words, for a | |
9982 * given expression, if the offset of that expression is offsets[i], then the | |
9983 * length of that expression is lengths[i]. | |
9984 */ | |
9985 void set lengths(List<int> value) { | |
9986 assert(value != null); | |
9987 this._lengths = value; | |
9988 } | |
9989 | |
9990 ExtractLocalVariableFeedback( | |
9991 List<String> names, List<int> offsets, List<int> lengths, | |
9992 {List<int> coveringExpressionOffsets, | |
9993 List<int> coveringExpressionLengths}) { | |
9994 this.coveringExpressionOffsets = coveringExpressionOffsets; | |
9995 this.coveringExpressionLengths = coveringExpressionLengths; | |
9996 this.names = names; | |
9997 this.offsets = offsets; | |
9998 this.lengths = lengths; | |
9999 } | |
10000 | |
10001 factory ExtractLocalVariableFeedback.fromJson( | |
10002 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
10003 if (json == null) { | |
10004 json = {}; | |
10005 } | |
10006 if (json is Map) { | |
10007 List<int> coveringExpressionOffsets; | |
10008 if (json.containsKey("coveringExpressionOffsets")) { | |
10009 coveringExpressionOffsets = jsonDecoder.decodeList( | |
10010 jsonPath + ".coveringExpressionOffsets", | |
10011 json["coveringExpressionOffsets"], | |
10012 jsonDecoder.decodeInt); | |
10013 } | |
10014 List<int> coveringExpressionLengths; | |
10015 if (json.containsKey("coveringExpressionLengths")) { | |
10016 coveringExpressionLengths = jsonDecoder.decodeList( | |
10017 jsonPath + ".coveringExpressionLengths", | |
10018 json["coveringExpressionLengths"], | |
10019 jsonDecoder.decodeInt); | |
10020 } | |
10021 List<String> names; | |
10022 if (json.containsKey("names")) { | |
10023 names = jsonDecoder.decodeList( | |
10024 jsonPath + ".names", json["names"], jsonDecoder.decodeString); | |
10025 } else { | |
10026 throw jsonDecoder.mismatch(jsonPath, "names"); | |
10027 } | |
10028 List<int> offsets; | |
10029 if (json.containsKey("offsets")) { | |
10030 offsets = jsonDecoder.decodeList( | |
10031 jsonPath + ".offsets", json["offsets"], jsonDecoder.decodeInt); | |
10032 } else { | |
10033 throw jsonDecoder.mismatch(jsonPath, "offsets"); | |
10034 } | |
10035 List<int> lengths; | |
10036 if (json.containsKey("lengths")) { | |
10037 lengths = jsonDecoder.decodeList( | |
10038 jsonPath + ".lengths", json["lengths"], jsonDecoder.decodeInt); | |
10039 } else { | |
10040 throw jsonDecoder.mismatch(jsonPath, "lengths"); | |
10041 } | |
10042 return new ExtractLocalVariableFeedback(names, offsets, lengths, | |
10043 coveringExpressionOffsets: coveringExpressionOffsets, | |
10044 coveringExpressionLengths: coveringExpressionLengths); | |
10045 } else { | |
10046 throw jsonDecoder.mismatch( | |
10047 jsonPath, "extractLocalVariable feedback", json); | |
10048 } | |
10049 } | |
10050 | |
10051 @override | |
10052 Map<String, dynamic> toJson() { | |
10053 Map<String, dynamic> result = {}; | |
10054 if (coveringExpressionOffsets != null) { | |
10055 result["coveringExpressionOffsets"] = coveringExpressionOffsets; | |
10056 } | |
10057 if (coveringExpressionLengths != null) { | |
10058 result["coveringExpressionLengths"] = coveringExpressionLengths; | |
10059 } | |
10060 result["names"] = names; | |
10061 result["offsets"] = offsets; | |
10062 result["lengths"] = lengths; | |
10063 return result; | |
10064 } | |
10065 | |
10066 @override | |
10067 String toString() => JSON.encode(toJson()); | |
10068 | |
10069 @override | |
10070 bool operator ==(other) { | |
10071 if (other is ExtractLocalVariableFeedback) { | |
10072 return listEqual(coveringExpressionOffsets, | |
10073 other.coveringExpressionOffsets, (int a, int b) => a == b) && | |
10074 listEqual(coveringExpressionLengths, other.coveringExpressionLengths, | |
10075 (int a, int b) => a == b) && | |
10076 listEqual(names, other.names, (String a, String b) => a == b) && | |
10077 listEqual(offsets, other.offsets, (int a, int b) => a == b) && | |
10078 listEqual(lengths, other.lengths, (int a, int b) => a == b); | |
10079 } | |
10080 return false; | |
10081 } | |
10082 | |
10083 @override | |
10084 int get hashCode { | |
10085 int hash = 0; | |
10086 hash = JenkinsSmiHash.combine(hash, coveringExpressionOffsets.hashCode); | |
10087 hash = JenkinsSmiHash.combine(hash, coveringExpressionLengths.hashCode); | |
10088 hash = JenkinsSmiHash.combine(hash, names.hashCode); | |
10089 hash = JenkinsSmiHash.combine(hash, offsets.hashCode); | |
10090 hash = JenkinsSmiHash.combine(hash, lengths.hashCode); | |
10091 return JenkinsSmiHash.finish(hash); | |
10092 } | |
10093 } | |
10094 | |
10095 /** | |
10096 * extractLocalVariable options | |
10097 * | |
10098 * { | |
10099 * "name": String | |
10100 * "extractAll": bool | |
10101 * } | |
10102 * | |
10103 * Clients may not extend, implement or mix-in this class. | |
10104 */ | |
10105 class ExtractLocalVariableOptions extends RefactoringOptions { | |
10106 String _name; | |
10107 | |
10108 bool _extractAll; | |
10109 | |
10110 /** | |
10111 * The name that the local variable should be given. | |
10112 */ | |
10113 String get name => _name; | |
10114 | |
10115 /** | |
10116 * The name that the local variable should be given. | |
10117 */ | |
10118 void set name(String value) { | |
10119 assert(value != null); | |
10120 this._name = value; | |
10121 } | |
10122 | |
10123 /** | |
10124 * True if all occurrences of the expression within the scope in which the | |
10125 * variable will be defined should be replaced by a reference to the local | |
10126 * variable. The expression used to initiate the refactoring will always be | |
10127 * replaced. | |
10128 */ | |
10129 bool get extractAll => _extractAll; | |
10130 | |
10131 /** | |
10132 * True if all occurrences of the expression within the scope in which the | |
10133 * variable will be defined should be replaced by a reference to the local | |
10134 * variable. The expression used to initiate the refactoring will always be | |
10135 * replaced. | |
10136 */ | |
10137 void set extractAll(bool value) { | |
10138 assert(value != null); | |
10139 this._extractAll = value; | |
10140 } | |
10141 | |
10142 ExtractLocalVariableOptions(String name, bool extractAll) { | |
10143 this.name = name; | |
10144 this.extractAll = extractAll; | |
10145 } | |
10146 | |
10147 factory ExtractLocalVariableOptions.fromJson( | |
10148 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
10149 if (json == null) { | |
10150 json = {}; | |
10151 } | |
10152 if (json is Map) { | |
10153 String name; | |
10154 if (json.containsKey("name")) { | |
10155 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]); | |
10156 } else { | |
10157 throw jsonDecoder.mismatch(jsonPath, "name"); | |
10158 } | |
10159 bool extractAll; | |
10160 if (json.containsKey("extractAll")) { | |
10161 extractAll = jsonDecoder.decodeBool( | |
10162 jsonPath + ".extractAll", json["extractAll"]); | |
10163 } else { | |
10164 throw jsonDecoder.mismatch(jsonPath, "extractAll"); | |
10165 } | |
10166 return new ExtractLocalVariableOptions(name, extractAll); | |
10167 } else { | |
10168 throw jsonDecoder.mismatch( | |
10169 jsonPath, "extractLocalVariable options", json); | |
10170 } | |
10171 } | |
10172 | |
10173 factory ExtractLocalVariableOptions.fromRefactoringParams( | |
10174 EditGetRefactoringParams refactoringParams, Request request) { | |
10175 return new ExtractLocalVariableOptions.fromJson( | |
10176 new RequestDecoder(request), "options", refactoringParams.options); | |
10177 } | |
10178 | |
10179 @override | |
10180 Map<String, dynamic> toJson() { | |
10181 Map<String, dynamic> result = {}; | |
10182 result["name"] = name; | |
10183 result["extractAll"] = extractAll; | |
10184 return result; | |
10185 } | |
10186 | |
10187 @override | |
10188 String toString() => JSON.encode(toJson()); | |
10189 | |
10190 @override | |
10191 bool operator ==(other) { | |
10192 if (other is ExtractLocalVariableOptions) { | |
10193 return name == other.name && extractAll == other.extractAll; | |
10194 } | |
10195 return false; | |
10196 } | |
10197 | |
10198 @override | |
10199 int get hashCode { | |
10200 int hash = 0; | |
10201 hash = JenkinsSmiHash.combine(hash, name.hashCode); | |
10202 hash = JenkinsSmiHash.combine(hash, extractAll.hashCode); | |
10203 return JenkinsSmiHash.finish(hash); | |
10204 } | |
10205 } | |
10206 | |
10207 /** | |
10208 * extractMethod feedback | |
10209 * | |
10210 * { | |
10211 * "offset": int | |
10212 * "length": int | |
10213 * "returnType": String | |
10214 * "names": List<String> | |
10215 * "canCreateGetter": bool | |
10216 * "parameters": List<RefactoringMethodParameter> | |
10217 * "offsets": List<int> | |
10218 * "lengths": List<int> | |
10219 * } | |
10220 * | |
10221 * Clients may not extend, implement or mix-in this class. | |
10222 */ | |
10223 class ExtractMethodFeedback extends RefactoringFeedback { | |
10224 int _offset; | |
10225 | |
10226 int _length; | |
10227 | |
10228 String _returnType; | |
10229 | |
10230 List<String> _names; | |
10231 | |
10232 bool _canCreateGetter; | |
10233 | |
10234 List<RefactoringMethodParameter> _parameters; | |
10235 | |
10236 List<int> _offsets; | |
10237 | |
10238 List<int> _lengths; | |
10239 | |
10240 /** | |
10241 * The offset to the beginning of the expression or statements that will be | |
10242 * extracted. | |
10243 */ | |
10244 int get offset => _offset; | |
10245 | |
10246 /** | |
10247 * The offset to the beginning of the expression or statements that will be | |
10248 * extracted. | |
10249 */ | |
10250 void set offset(int value) { | |
10251 assert(value != null); | |
10252 this._offset = value; | |
10253 } | |
10254 | |
10255 /** | |
10256 * The length of the expression or statements that will be extracted. | |
10257 */ | |
10258 int get length => _length; | |
10259 | |
10260 /** | |
10261 * The length of the expression or statements that will be extracted. | |
10262 */ | |
10263 void set length(int value) { | |
10264 assert(value != null); | |
10265 this._length = value; | |
10266 } | |
10267 | |
10268 /** | |
10269 * The proposed return type for the method. If the returned element does not | |
10270 * have a declared return type, this field will contain an empty string. | |
10271 */ | |
10272 String get returnType => _returnType; | |
10273 | |
10274 /** | |
10275 * The proposed return type for the method. If the returned element does not | |
10276 * have a declared return type, this field will contain an empty string. | |
10277 */ | |
10278 void set returnType(String value) { | |
10279 assert(value != null); | |
10280 this._returnType = value; | |
10281 } | |
10282 | |
10283 /** | |
10284 * The proposed names for the method. | |
10285 */ | |
10286 List<String> get names => _names; | |
10287 | |
10288 /** | |
10289 * The proposed names for the method. | |
10290 */ | |
10291 void set names(List<String> value) { | |
10292 assert(value != null); | |
10293 this._names = value; | |
10294 } | |
10295 | |
10296 /** | |
10297 * True if a getter could be created rather than a method. | |
10298 */ | |
10299 bool get canCreateGetter => _canCreateGetter; | |
10300 | |
10301 /** | |
10302 * True if a getter could be created rather than a method. | |
10303 */ | |
10304 void set canCreateGetter(bool value) { | |
10305 assert(value != null); | |
10306 this._canCreateGetter = value; | |
10307 } | |
10308 | |
10309 /** | |
10310 * The proposed parameters for the method. | |
10311 */ | |
10312 List<RefactoringMethodParameter> get parameters => _parameters; | |
10313 | |
10314 /** | |
10315 * The proposed parameters for the method. | |
10316 */ | |
10317 void set parameters(List<RefactoringMethodParameter> value) { | |
10318 assert(value != null); | |
10319 this._parameters = value; | |
10320 } | |
10321 | |
10322 /** | |
10323 * The offsets of the expressions or statements that would be replaced by an | |
10324 * invocation of the method. | |
10325 */ | |
10326 List<int> get offsets => _offsets; | |
10327 | |
10328 /** | |
10329 * The offsets of the expressions or statements that would be replaced by an | |
10330 * invocation of the method. | |
10331 */ | |
10332 void set offsets(List<int> value) { | |
10333 assert(value != null); | |
10334 this._offsets = value; | |
10335 } | |
10336 | |
10337 /** | |
10338 * The lengths of the expressions or statements that would be replaced by an | |
10339 * invocation of the method. The lengths correspond to the offsets. In other | |
10340 * words, for a given expression (or block of statements), if the offset of | |
10341 * that expression is offsets[i], then the length of that expression is | |
10342 * lengths[i]. | |
10343 */ | |
10344 List<int> get lengths => _lengths; | |
10345 | |
10346 /** | |
10347 * The lengths of the expressions or statements that would be replaced by an | |
10348 * invocation of the method. The lengths correspond to the offsets. In other | |
10349 * words, for a given expression (or block of statements), if the offset of | |
10350 * that expression is offsets[i], then the length of that expression is | |
10351 * lengths[i]. | |
10352 */ | |
10353 void set lengths(List<int> value) { | |
10354 assert(value != null); | |
10355 this._lengths = value; | |
10356 } | |
10357 | |
10358 ExtractMethodFeedback( | |
10359 int offset, | |
10360 int length, | |
10361 String returnType, | |
10362 List<String> names, | |
10363 bool canCreateGetter, | |
10364 List<RefactoringMethodParameter> parameters, | |
10365 List<int> offsets, | |
10366 List<int> lengths) { | |
10367 this.offset = offset; | |
10368 this.length = length; | |
10369 this.returnType = returnType; | |
10370 this.names = names; | |
10371 this.canCreateGetter = canCreateGetter; | |
10372 this.parameters = parameters; | |
10373 this.offsets = offsets; | |
10374 this.lengths = lengths; | |
10375 } | |
10376 | |
10377 factory ExtractMethodFeedback.fromJson( | |
10378 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
10379 if (json == null) { | |
10380 json = {}; | |
10381 } | |
10382 if (json is Map) { | |
10383 int offset; | |
10384 if (json.containsKey("offset")) { | |
10385 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
10386 } else { | |
10387 throw jsonDecoder.mismatch(jsonPath, "offset"); | |
10388 } | |
10389 int length; | |
10390 if (json.containsKey("length")) { | |
10391 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
10392 } else { | |
10393 throw jsonDecoder.mismatch(jsonPath, "length"); | |
10394 } | |
10395 String returnType; | |
10396 if (json.containsKey("returnType")) { | |
10397 returnType = jsonDecoder.decodeString( | |
10398 jsonPath + ".returnType", json["returnType"]); | |
10399 } else { | |
10400 throw jsonDecoder.mismatch(jsonPath, "returnType"); | |
10401 } | |
10402 List<String> names; | |
10403 if (json.containsKey("names")) { | |
10404 names = jsonDecoder.decodeList( | |
10405 jsonPath + ".names", json["names"], jsonDecoder.decodeString); | |
10406 } else { | |
10407 throw jsonDecoder.mismatch(jsonPath, "names"); | |
10408 } | |
10409 bool canCreateGetter; | |
10410 if (json.containsKey("canCreateGetter")) { | |
10411 canCreateGetter = jsonDecoder.decodeBool( | |
10412 jsonPath + ".canCreateGetter", json["canCreateGetter"]); | |
10413 } else { | |
10414 throw jsonDecoder.mismatch(jsonPath, "canCreateGetter"); | |
10415 } | |
10416 List<RefactoringMethodParameter> parameters; | |
10417 if (json.containsKey("parameters")) { | |
10418 parameters = jsonDecoder.decodeList( | |
10419 jsonPath + ".parameters", | |
10420 json["parameters"], | |
10421 (String jsonPath, Object json) => | |
10422 new RefactoringMethodParameter.fromJson( | |
10423 jsonDecoder, jsonPath, json)); | |
10424 } else { | |
10425 throw jsonDecoder.mismatch(jsonPath, "parameters"); | |
10426 } | |
10427 List<int> offsets; | |
10428 if (json.containsKey("offsets")) { | |
10429 offsets = jsonDecoder.decodeList( | |
10430 jsonPath + ".offsets", json["offsets"], jsonDecoder.decodeInt); | |
10431 } else { | |
10432 throw jsonDecoder.mismatch(jsonPath, "offsets"); | |
10433 } | |
10434 List<int> lengths; | |
10435 if (json.containsKey("lengths")) { | |
10436 lengths = jsonDecoder.decodeList( | |
10437 jsonPath + ".lengths", json["lengths"], jsonDecoder.decodeInt); | |
10438 } else { | |
10439 throw jsonDecoder.mismatch(jsonPath, "lengths"); | |
10440 } | |
10441 return new ExtractMethodFeedback(offset, length, returnType, names, | |
10442 canCreateGetter, parameters, offsets, lengths); | |
10443 } else { | |
10444 throw jsonDecoder.mismatch(jsonPath, "extractMethod feedback", json); | |
10445 } | |
10446 } | |
10447 | |
10448 @override | |
10449 Map<String, dynamic> toJson() { | |
10450 Map<String, dynamic> result = {}; | |
10451 result["offset"] = offset; | |
10452 result["length"] = length; | |
10453 result["returnType"] = returnType; | |
10454 result["names"] = names; | |
10455 result["canCreateGetter"] = canCreateGetter; | |
10456 result["parameters"] = parameters | |
10457 .map((RefactoringMethodParameter value) => value.toJson()) | |
10458 .toList(); | |
10459 result["offsets"] = offsets; | |
10460 result["lengths"] = lengths; | |
10461 return result; | |
10462 } | |
10463 | |
10464 @override | |
10465 String toString() => JSON.encode(toJson()); | |
10466 | |
10467 @override | |
10468 bool operator ==(other) { | |
10469 if (other is ExtractMethodFeedback) { | |
10470 return offset == other.offset && | |
10471 length == other.length && | |
10472 returnType == other.returnType && | |
10473 listEqual(names, other.names, (String a, String b) => a == b) && | |
10474 canCreateGetter == other.canCreateGetter && | |
10475 listEqual( | |
10476 parameters, | |
10477 other.parameters, | |
10478 (RefactoringMethodParameter a, RefactoringMethodParameter b) => | |
10479 a == b) && | |
10480 listEqual(offsets, other.offsets, (int a, int b) => a == b) && | |
10481 listEqual(lengths, other.lengths, (int a, int b) => a == b); | |
10482 } | |
10483 return false; | |
10484 } | |
10485 | 6516 |
10486 @override | 6517 @override |
10487 int get hashCode { | 6518 int get hashCode { |
10488 int hash = 0; | 6519 int hash = 0; |
| 6520 hash = JenkinsSmiHash.combine(hash, file.hashCode); |
10489 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | 6521 hash = JenkinsSmiHash.combine(hash, offset.hashCode); |
10490 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
10491 hash = JenkinsSmiHash.combine(hash, returnType.hashCode); | |
10492 hash = JenkinsSmiHash.combine(hash, names.hashCode); | |
10493 hash = JenkinsSmiHash.combine(hash, canCreateGetter.hashCode); | |
10494 hash = JenkinsSmiHash.combine(hash, parameters.hashCode); | |
10495 hash = JenkinsSmiHash.combine(hash, offsets.hashCode); | |
10496 hash = JenkinsSmiHash.combine(hash, lengths.hashCode); | |
10497 return JenkinsSmiHash.finish(hash); | 6522 return JenkinsSmiHash.finish(hash); |
10498 } | 6523 } |
10499 } | 6524 } |
10500 | 6525 |
10501 /** | 6526 /** |
10502 * extractMethod options | 6527 * edit.getStatementCompletion result |
10503 * | 6528 * |
10504 * { | 6529 * { |
10505 * "returnType": String | 6530 * "change": SourceChange |
10506 * "createGetter": bool | 6531 * "whitespaceOnly": bool |
10507 * "name": String | |
10508 * "parameters": List<RefactoringMethodParameter> | |
10509 * "extractAll": bool | |
10510 * } | 6532 * } |
10511 * | 6533 * |
10512 * Clients may not extend, implement or mix-in this class. | 6534 * Clients may not extend, implement or mix-in this class. |
10513 */ | 6535 */ |
10514 class ExtractMethodOptions extends RefactoringOptions { | 6536 class EditGetStatementCompletionResult implements ResponseResult { |
10515 String _returnType; | 6537 SourceChange _change; |
10516 | 6538 |
10517 bool _createGetter; | 6539 bool _whitespaceOnly; |
10518 | |
10519 String _name; | |
10520 | |
10521 List<RefactoringMethodParameter> _parameters; | |
10522 | |
10523 bool _extractAll; | |
10524 | 6540 |
10525 /** | 6541 /** |
10526 * The return type that should be defined for the method. | 6542 * The change to be applied in order to complete the statement. |
10527 */ | 6543 */ |
10528 String get returnType => _returnType; | 6544 SourceChange get change => _change; |
10529 | 6545 |
10530 /** | 6546 /** |
10531 * The return type that should be defined for the method. | 6547 * The change to be applied in order to complete the statement. |
10532 */ | 6548 */ |
10533 void set returnType(String value) { | 6549 void set change(SourceChange value) { |
10534 assert(value != null); | 6550 assert(value != null); |
10535 this._returnType = value; | 6551 this._change = value; |
10536 } | 6552 } |
10537 | 6553 |
10538 /** | 6554 /** |
10539 * True if a getter should be created rather than a method. It is an error if | 6555 * Will be true if the change contains nothing but whitespace characters, or |
10540 * this field is true and the list of parameters is non-empty. | 6556 * is empty. |
10541 */ | 6557 */ |
10542 bool get createGetter => _createGetter; | 6558 bool get whitespaceOnly => _whitespaceOnly; |
10543 | 6559 |
10544 /** | 6560 /** |
10545 * True if a getter should be created rather than a method. It is an error if | 6561 * Will be true if the change contains nothing but whitespace characters, or |
10546 * this field is true and the list of parameters is non-empty. | 6562 * is empty. |
10547 */ | 6563 */ |
10548 void set createGetter(bool value) { | 6564 void set whitespaceOnly(bool value) { |
10549 assert(value != null); | 6565 assert(value != null); |
10550 this._createGetter = value; | 6566 this._whitespaceOnly = value; |
10551 } | 6567 } |
10552 | 6568 |
10553 /** | 6569 EditGetStatementCompletionResult(SourceChange change, bool whitespaceOnly) { |
10554 * The name that the method should be given. | 6570 this.change = change; |
10555 */ | 6571 this.whitespaceOnly = whitespaceOnly; |
10556 String get name => _name; | |
10557 | |
10558 /** | |
10559 * The name that the method should be given. | |
10560 */ | |
10561 void set name(String value) { | |
10562 assert(value != null); | |
10563 this._name = value; | |
10564 } | 6572 } |
10565 | 6573 |
10566 /** | 6574 factory EditGetStatementCompletionResult.fromJson( |
10567 * The parameters that should be defined for the method. | |
10568 * | |
10569 * It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL | |
10570 * parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a | |
10571 * NAMED parameter. | |
10572 * | |
10573 * - To change the order and/or update proposed parameters, add parameters | |
10574 * with the same identifiers as proposed. | |
10575 * - To add new parameters, omit their identifier. | |
10576 * - To remove some parameters, omit them in this list. | |
10577 */ | |
10578 List<RefactoringMethodParameter> get parameters => _parameters; | |
10579 | |
10580 /** | |
10581 * The parameters that should be defined for the method. | |
10582 * | |
10583 * It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL | |
10584 * parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a | |
10585 * NAMED parameter. | |
10586 * | |
10587 * - To change the order and/or update proposed parameters, add parameters | |
10588 * with the same identifiers as proposed. | |
10589 * - To add new parameters, omit their identifier. | |
10590 * - To remove some parameters, omit them in this list. | |
10591 */ | |
10592 void set parameters(List<RefactoringMethodParameter> value) { | |
10593 assert(value != null); | |
10594 this._parameters = value; | |
10595 } | |
10596 | |
10597 /** | |
10598 * True if all occurrences of the expression or statements should be replaced | |
10599 * by an invocation of the method. The expression or statements used to | |
10600 * initiate the refactoring will always be replaced. | |
10601 */ | |
10602 bool get extractAll => _extractAll; | |
10603 | |
10604 /** | |
10605 * True if all occurrences of the expression or statements should be replaced | |
10606 * by an invocation of the method. The expression or statements used to | |
10607 * initiate the refactoring will always be replaced. | |
10608 */ | |
10609 void set extractAll(bool value) { | |
10610 assert(value != null); | |
10611 this._extractAll = value; | |
10612 } | |
10613 | |
10614 ExtractMethodOptions(String returnType, bool createGetter, String name, | |
10615 List<RefactoringMethodParameter> parameters, bool extractAll) { | |
10616 this.returnType = returnType; | |
10617 this.createGetter = createGetter; | |
10618 this.name = name; | |
10619 this.parameters = parameters; | |
10620 this.extractAll = extractAll; | |
10621 } | |
10622 | |
10623 factory ExtractMethodOptions.fromJson( | |
10624 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 6575 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
10625 if (json == null) { | 6576 if (json == null) { |
10626 json = {}; | 6577 json = {}; |
10627 } | 6578 } |
10628 if (json is Map) { | 6579 if (json is Map) { |
10629 String returnType; | 6580 SourceChange change; |
10630 if (json.containsKey("returnType")) { | 6581 if (json.containsKey("change")) { |
10631 returnType = jsonDecoder.decodeString( | 6582 change = new SourceChange.fromJson( |
10632 jsonPath + ".returnType", json["returnType"]); | 6583 jsonDecoder, jsonPath + ".change", json["change"]); |
10633 } else { | 6584 } else { |
10634 throw jsonDecoder.mismatch(jsonPath, "returnType"); | 6585 throw jsonDecoder.mismatch(jsonPath, "change"); |
10635 } | 6586 } |
10636 bool createGetter; | 6587 bool whitespaceOnly; |
10637 if (json.containsKey("createGetter")) { | 6588 if (json.containsKey("whitespaceOnly")) { |
10638 createGetter = jsonDecoder.decodeBool( | 6589 whitespaceOnly = jsonDecoder.decodeBool( |
10639 jsonPath + ".createGetter", json["createGetter"]); | 6590 jsonPath + ".whitespaceOnly", json["whitespaceOnly"]); |
10640 } else { | 6591 } else { |
10641 throw jsonDecoder.mismatch(jsonPath, "createGetter"); | 6592 throw jsonDecoder.mismatch(jsonPath, "whitespaceOnly"); |
10642 } | 6593 } |
10643 String name; | 6594 return new EditGetStatementCompletionResult(change, whitespaceOnly); |
10644 if (json.containsKey("name")) { | |
10645 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]); | |
10646 } else { | |
10647 throw jsonDecoder.mismatch(jsonPath, "name"); | |
10648 } | |
10649 List<RefactoringMethodParameter> parameters; | |
10650 if (json.containsKey("parameters")) { | |
10651 parameters = jsonDecoder.decodeList( | |
10652 jsonPath + ".parameters", | |
10653 json["parameters"], | |
10654 (String jsonPath, Object json) => | |
10655 new RefactoringMethodParameter.fromJson( | |
10656 jsonDecoder, jsonPath, json)); | |
10657 } else { | |
10658 throw jsonDecoder.mismatch(jsonPath, "parameters"); | |
10659 } | |
10660 bool extractAll; | |
10661 if (json.containsKey("extractAll")) { | |
10662 extractAll = jsonDecoder.decodeBool( | |
10663 jsonPath + ".extractAll", json["extractAll"]); | |
10664 } else { | |
10665 throw jsonDecoder.mismatch(jsonPath, "extractAll"); | |
10666 } | |
10667 return new ExtractMethodOptions( | |
10668 returnType, createGetter, name, parameters, extractAll); | |
10669 } else { | 6595 } else { |
10670 throw jsonDecoder.mismatch(jsonPath, "extractMethod options", json); | 6596 throw jsonDecoder.mismatch( |
| 6597 jsonPath, "edit.getStatementCompletion result", json); |
10671 } | 6598 } |
10672 } | 6599 } |
10673 | 6600 |
10674 factory ExtractMethodOptions.fromRefactoringParams( | 6601 factory EditGetStatementCompletionResult.fromResponse(Response response) { |
10675 EditGetRefactoringParams refactoringParams, Request request) { | 6602 return new EditGetStatementCompletionResult.fromJson( |
10676 return new ExtractMethodOptions.fromJson( | 6603 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), |
10677 new RequestDecoder(request), "options", refactoringParams.options); | 6604 "result", |
| 6605 response.result); |
10678 } | 6606 } |
10679 | 6607 |
10680 @override | 6608 @override |
10681 Map<String, dynamic> toJson() { | 6609 Map<String, dynamic> toJson() { |
10682 Map<String, dynamic> result = {}; | 6610 Map<String, dynamic> result = {}; |
10683 result["returnType"] = returnType; | 6611 result["change"] = change.toJson(); |
10684 result["createGetter"] = createGetter; | 6612 result["whitespaceOnly"] = whitespaceOnly; |
10685 result["name"] = name; | |
10686 result["parameters"] = parameters | |
10687 .map((RefactoringMethodParameter value) => value.toJson()) | |
10688 .toList(); | |
10689 result["extractAll"] = extractAll; | |
10690 return result; | 6613 return result; |
10691 } | 6614 } |
10692 | 6615 |
10693 @override | 6616 @override |
| 6617 Response toResponse(String id) { |
| 6618 return new Response(id, result: toJson()); |
| 6619 } |
| 6620 |
| 6621 @override |
10694 String toString() => JSON.encode(toJson()); | 6622 String toString() => JSON.encode(toJson()); |
10695 | 6623 |
10696 @override | 6624 @override |
10697 bool operator ==(other) { | 6625 bool operator ==(other) { |
10698 if (other is ExtractMethodOptions) { | 6626 if (other is EditGetStatementCompletionResult) { |
10699 return returnType == other.returnType && | 6627 return change == other.change && whitespaceOnly == other.whitespaceOnly; |
10700 createGetter == other.createGetter && | |
10701 name == other.name && | |
10702 listEqual( | |
10703 parameters, | |
10704 other.parameters, | |
10705 (RefactoringMethodParameter a, RefactoringMethodParameter b) => | |
10706 a == b) && | |
10707 extractAll == other.extractAll; | |
10708 } | 6628 } |
10709 return false; | 6629 return false; |
10710 } | 6630 } |
10711 | 6631 |
10712 @override | 6632 @override |
10713 int get hashCode { | 6633 int get hashCode { |
10714 int hash = 0; | 6634 int hash = 0; |
10715 hash = JenkinsSmiHash.combine(hash, returnType.hashCode); | 6635 hash = JenkinsSmiHash.combine(hash, change.hashCode); |
10716 hash = JenkinsSmiHash.combine(hash, createGetter.hashCode); | 6636 hash = JenkinsSmiHash.combine(hash, whitespaceOnly.hashCode); |
10717 hash = JenkinsSmiHash.combine(hash, name.hashCode); | |
10718 hash = JenkinsSmiHash.combine(hash, parameters.hashCode); | |
10719 hash = JenkinsSmiHash.combine(hash, extractAll.hashCode); | |
10720 return JenkinsSmiHash.finish(hash); | 6637 return JenkinsSmiHash.finish(hash); |
10721 } | 6638 } |
10722 } | 6639 } |
10723 | 6640 |
10724 /** | 6641 /** |
10725 * FileKind | 6642 * edit.organizeDirectives params |
10726 * | 6643 * |
10727 * enum { | 6644 * { |
10728 * LIBRARY | 6645 * "file": FilePath |
10729 * PART | |
10730 * } | 6646 * } |
10731 * | 6647 * |
10732 * Clients may not extend, implement or mix-in this class. | 6648 * Clients may not extend, implement or mix-in this class. |
10733 */ | 6649 */ |
10734 class FileKind implements Enum { | 6650 class EditOrganizeDirectivesParams implements RequestParams { |
10735 static const FileKind LIBRARY = const FileKind._("LIBRARY"); | 6651 String _file; |
10736 | 6652 |
10737 static const FileKind PART = const FileKind._("PART"); | 6653 /** |
10738 | 6654 * The Dart file to organize directives in. |
10739 /** | 6655 */ |
10740 * A list containing all of the enum values that are defined. | 6656 String get file => _file; |
10741 */ | 6657 |
10742 static const List<FileKind> VALUES = const <FileKind>[LIBRARY, PART]; | 6658 /** |
10743 | 6659 * The Dart file to organize directives in. |
10744 @override | 6660 */ |
10745 final String name; | 6661 void set file(String value) { |
10746 | |
10747 const FileKind._(this.name); | |
10748 | |
10749 factory FileKind(String name) { | |
10750 switch (name) { | |
10751 case "LIBRARY": | |
10752 return LIBRARY; | |
10753 case "PART": | |
10754 return PART; | |
10755 } | |
10756 throw new Exception('Illegal enum value: $name'); | |
10757 } | |
10758 | |
10759 factory FileKind.fromJson( | |
10760 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
10761 if (json is String) { | |
10762 try { | |
10763 return new FileKind(json); | |
10764 } catch (_) { | |
10765 // Fall through | |
10766 } | |
10767 } | |
10768 throw jsonDecoder.mismatch(jsonPath, "FileKind", json); | |
10769 } | |
10770 | |
10771 @override | |
10772 String toString() => "FileKind.$name"; | |
10773 | |
10774 String toJson() => name; | |
10775 } | |
10776 | |
10777 /** | |
10778 * FoldingKind | |
10779 * | |
10780 * enum { | |
10781 * COMMENT | |
10782 * CLASS_MEMBER | |
10783 * DIRECTIVES | |
10784 * DOCUMENTATION_COMMENT | |
10785 * TOP_LEVEL_DECLARATION | |
10786 * } | |
10787 * | |
10788 * Clients may not extend, implement or mix-in this class. | |
10789 */ | |
10790 class FoldingKind implements Enum { | |
10791 static const FoldingKind COMMENT = const FoldingKind._("COMMENT"); | |
10792 | |
10793 static const FoldingKind CLASS_MEMBER = const FoldingKind._("CLASS_MEMBER"); | |
10794 | |
10795 static const FoldingKind DIRECTIVES = const FoldingKind._("DIRECTIVES"); | |
10796 | |
10797 static const FoldingKind DOCUMENTATION_COMMENT = | |
10798 const FoldingKind._("DOCUMENTATION_COMMENT"); | |
10799 | |
10800 static const FoldingKind TOP_LEVEL_DECLARATION = | |
10801 const FoldingKind._("TOP_LEVEL_DECLARATION"); | |
10802 | |
10803 /** | |
10804 * A list containing all of the enum values that are defined. | |
10805 */ | |
10806 static const List<FoldingKind> VALUES = const <FoldingKind>[ | |
10807 COMMENT, | |
10808 CLASS_MEMBER, | |
10809 DIRECTIVES, | |
10810 DOCUMENTATION_COMMENT, | |
10811 TOP_LEVEL_DECLARATION | |
10812 ]; | |
10813 | |
10814 @override | |
10815 final String name; | |
10816 | |
10817 const FoldingKind._(this.name); | |
10818 | |
10819 factory FoldingKind(String name) { | |
10820 switch (name) { | |
10821 case "COMMENT": | |
10822 return COMMENT; | |
10823 case "CLASS_MEMBER": | |
10824 return CLASS_MEMBER; | |
10825 case "DIRECTIVES": | |
10826 return DIRECTIVES; | |
10827 case "DOCUMENTATION_COMMENT": | |
10828 return DOCUMENTATION_COMMENT; | |
10829 case "TOP_LEVEL_DECLARATION": | |
10830 return TOP_LEVEL_DECLARATION; | |
10831 } | |
10832 throw new Exception('Illegal enum value: $name'); | |
10833 } | |
10834 | |
10835 factory FoldingKind.fromJson( | |
10836 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
10837 if (json is String) { | |
10838 try { | |
10839 return new FoldingKind(json); | |
10840 } catch (_) { | |
10841 // Fall through | |
10842 } | |
10843 } | |
10844 throw jsonDecoder.mismatch(jsonPath, "FoldingKind", json); | |
10845 } | |
10846 | |
10847 @override | |
10848 String toString() => "FoldingKind.$name"; | |
10849 | |
10850 String toJson() => name; | |
10851 } | |
10852 | |
10853 /** | |
10854 * FoldingRegion | |
10855 * | |
10856 * { | |
10857 * "kind": FoldingKind | |
10858 * "offset": int | |
10859 * "length": int | |
10860 * } | |
10861 * | |
10862 * Clients may not extend, implement or mix-in this class. | |
10863 */ | |
10864 class FoldingRegion implements HasToJson { | |
10865 FoldingKind _kind; | |
10866 | |
10867 int _offset; | |
10868 | |
10869 int _length; | |
10870 | |
10871 /** | |
10872 * The kind of the region. | |
10873 */ | |
10874 FoldingKind get kind => _kind; | |
10875 | |
10876 /** | |
10877 * The kind of the region. | |
10878 */ | |
10879 void set kind(FoldingKind value) { | |
10880 assert(value != null); | 6662 assert(value != null); |
10881 this._kind = value; | 6663 this._file = value; |
10882 } | 6664 } |
10883 | 6665 |
10884 /** | 6666 EditOrganizeDirectivesParams(String file) { |
10885 * The offset of the region to be folded. | 6667 this.file = file; |
10886 */ | 6668 } |
10887 int get offset => _offset; | 6669 |
10888 | 6670 factory EditOrganizeDirectivesParams.fromJson( |
10889 /** | |
10890 * The offset of the region to be folded. | |
10891 */ | |
10892 void set offset(int value) { | |
10893 assert(value != null); | |
10894 this._offset = value; | |
10895 } | |
10896 | |
10897 /** | |
10898 * The length of the region to be folded. | |
10899 */ | |
10900 int get length => _length; | |
10901 | |
10902 /** | |
10903 * The length of the region to be folded. | |
10904 */ | |
10905 void set length(int value) { | |
10906 assert(value != null); | |
10907 this._length = value; | |
10908 } | |
10909 | |
10910 FoldingRegion(FoldingKind kind, int offset, int length) { | |
10911 this.kind = kind; | |
10912 this.offset = offset; | |
10913 this.length = length; | |
10914 } | |
10915 | |
10916 factory FoldingRegion.fromJson( | |
10917 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 6671 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
10918 if (json == null) { | 6672 if (json == null) { |
10919 json = {}; | 6673 json = {}; |
10920 } | 6674 } |
10921 if (json is Map) { | 6675 if (json is Map) { |
10922 FoldingKind kind; | 6676 String file; |
10923 if (json.containsKey("kind")) { | 6677 if (json.containsKey("file")) { |
10924 kind = new FoldingKind.fromJson( | 6678 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); |
10925 jsonDecoder, jsonPath + ".kind", json["kind"]); | |
10926 } else { | 6679 } else { |
10927 throw jsonDecoder.mismatch(jsonPath, "kind"); | 6680 throw jsonDecoder.mismatch(jsonPath, "file"); |
10928 } | 6681 } |
10929 int offset; | 6682 return new EditOrganizeDirectivesParams(file); |
10930 if (json.containsKey("offset")) { | |
10931 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
10932 } else { | |
10933 throw jsonDecoder.mismatch(jsonPath, "offset"); | |
10934 } | |
10935 int length; | |
10936 if (json.containsKey("length")) { | |
10937 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
10938 } else { | |
10939 throw jsonDecoder.mismatch(jsonPath, "length"); | |
10940 } | |
10941 return new FoldingRegion(kind, offset, length); | |
10942 } else { | 6683 } else { |
10943 throw jsonDecoder.mismatch(jsonPath, "FoldingRegion", json); | 6684 throw jsonDecoder.mismatch( |
10944 } | 6685 jsonPath, "edit.organizeDirectives params", json); |
| 6686 } |
| 6687 } |
| 6688 |
| 6689 factory EditOrganizeDirectivesParams.fromRequest(Request request) { |
| 6690 return new EditOrganizeDirectivesParams.fromJson( |
| 6691 new RequestDecoder(request), "params", request.params); |
10945 } | 6692 } |
10946 | 6693 |
10947 @override | 6694 @override |
10948 Map<String, dynamic> toJson() { | 6695 Map<String, dynamic> toJson() { |
10949 Map<String, dynamic> result = {}; | 6696 Map<String, dynamic> result = {}; |
10950 result["kind"] = kind.toJson(); | 6697 result["file"] = file; |
10951 result["offset"] = offset; | |
10952 result["length"] = length; | |
10953 return result; | 6698 return result; |
10954 } | 6699 } |
10955 | 6700 |
10956 @override | 6701 @override |
| 6702 Request toRequest(String id) { |
| 6703 return new Request(id, "edit.organizeDirectives", toJson()); |
| 6704 } |
| 6705 |
| 6706 @override |
10957 String toString() => JSON.encode(toJson()); | 6707 String toString() => JSON.encode(toJson()); |
10958 | 6708 |
10959 @override | 6709 @override |
10960 bool operator ==(other) { | 6710 bool operator ==(other) { |
10961 if (other is FoldingRegion) { | 6711 if (other is EditOrganizeDirectivesParams) { |
10962 return kind == other.kind && | 6712 return file == other.file; |
10963 offset == other.offset && | |
10964 length == other.length; | |
10965 } | 6713 } |
10966 return false; | 6714 return false; |
10967 } | 6715 } |
| 6716 |
| 6717 @override |
| 6718 int get hashCode { |
| 6719 int hash = 0; |
| 6720 hash = JenkinsSmiHash.combine(hash, file.hashCode); |
| 6721 return JenkinsSmiHash.finish(hash); |
| 6722 } |
| 6723 } |
| 6724 |
| 6725 /** |
| 6726 * edit.organizeDirectives result |
| 6727 * |
| 6728 * { |
| 6729 * "edit": SourceFileEdit |
| 6730 * } |
| 6731 * |
| 6732 * Clients may not extend, implement or mix-in this class. |
| 6733 */ |
| 6734 class EditOrganizeDirectivesResult implements ResponseResult { |
| 6735 SourceFileEdit _edit; |
| 6736 |
| 6737 /** |
| 6738 * The file edit that is to be applied to the given file to effect the |
| 6739 * organizing. |
| 6740 */ |
| 6741 SourceFileEdit get edit => _edit; |
| 6742 |
| 6743 /** |
| 6744 * The file edit that is to be applied to the given file to effect the |
| 6745 * organizing. |
| 6746 */ |
| 6747 void set edit(SourceFileEdit value) { |
| 6748 assert(value != null); |
| 6749 this._edit = value; |
| 6750 } |
| 6751 |
| 6752 EditOrganizeDirectivesResult(SourceFileEdit edit) { |
| 6753 this.edit = edit; |
| 6754 } |
| 6755 |
| 6756 factory EditOrganizeDirectivesResult.fromJson( |
| 6757 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| 6758 if (json == null) { |
| 6759 json = {}; |
| 6760 } |
| 6761 if (json is Map) { |
| 6762 SourceFileEdit edit; |
| 6763 if (json.containsKey("edit")) { |
| 6764 edit = new SourceFileEdit.fromJson( |
| 6765 jsonDecoder, jsonPath + ".edit", json["edit"]); |
| 6766 } else { |
| 6767 throw jsonDecoder.mismatch(jsonPath, "edit"); |
| 6768 } |
| 6769 return new EditOrganizeDirectivesResult(edit); |
| 6770 } else { |
| 6771 throw jsonDecoder.mismatch( |
| 6772 jsonPath, "edit.organizeDirectives result", json); |
| 6773 } |
| 6774 } |
| 6775 |
| 6776 factory EditOrganizeDirectivesResult.fromResponse(Response response) { |
| 6777 return new EditOrganizeDirectivesResult.fromJson( |
| 6778 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), |
| 6779 "result", |
| 6780 response.result); |
| 6781 } |
| 6782 |
| 6783 @override |
| 6784 Map<String, dynamic> toJson() { |
| 6785 Map<String, dynamic> result = {}; |
| 6786 result["edit"] = edit.toJson(); |
| 6787 return result; |
| 6788 } |
| 6789 |
| 6790 @override |
| 6791 Response toResponse(String id) { |
| 6792 return new Response(id, result: toJson()); |
| 6793 } |
| 6794 |
| 6795 @override |
| 6796 String toString() => JSON.encode(toJson()); |
| 6797 |
| 6798 @override |
| 6799 bool operator ==(other) { |
| 6800 if (other is EditOrganizeDirectivesResult) { |
| 6801 return edit == other.edit; |
| 6802 } |
| 6803 return false; |
| 6804 } |
| 6805 |
| 6806 @override |
| 6807 int get hashCode { |
| 6808 int hash = 0; |
| 6809 hash = JenkinsSmiHash.combine(hash, edit.hashCode); |
| 6810 return JenkinsSmiHash.finish(hash); |
| 6811 } |
| 6812 } |
| 6813 |
| 6814 /** |
| 6815 * edit.sortMembers params |
| 6816 * |
| 6817 * { |
| 6818 * "file": FilePath |
| 6819 * } |
| 6820 * |
| 6821 * Clients may not extend, implement or mix-in this class. |
| 6822 */ |
| 6823 class EditSortMembersParams implements RequestParams { |
| 6824 String _file; |
| 6825 |
| 6826 /** |
| 6827 * The Dart file to sort. |
| 6828 */ |
| 6829 String get file => _file; |
| 6830 |
| 6831 /** |
| 6832 * The Dart file to sort. |
| 6833 */ |
| 6834 void set file(String value) { |
| 6835 assert(value != null); |
| 6836 this._file = value; |
| 6837 } |
| 6838 |
| 6839 EditSortMembersParams(String file) { |
| 6840 this.file = file; |
| 6841 } |
| 6842 |
| 6843 factory EditSortMembersParams.fromJson( |
| 6844 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| 6845 if (json == null) { |
| 6846 json = {}; |
| 6847 } |
| 6848 if (json is Map) { |
| 6849 String file; |
| 6850 if (json.containsKey("file")) { |
| 6851 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); |
| 6852 } else { |
| 6853 throw jsonDecoder.mismatch(jsonPath, "file"); |
| 6854 } |
| 6855 return new EditSortMembersParams(file); |
| 6856 } else { |
| 6857 throw jsonDecoder.mismatch(jsonPath, "edit.sortMembers params", json); |
| 6858 } |
| 6859 } |
| 6860 |
| 6861 factory EditSortMembersParams.fromRequest(Request request) { |
| 6862 return new EditSortMembersParams.fromJson( |
| 6863 new RequestDecoder(request), "params", request.params); |
| 6864 } |
| 6865 |
| 6866 @override |
| 6867 Map<String, dynamic> toJson() { |
| 6868 Map<String, dynamic> result = {}; |
| 6869 result["file"] = file; |
| 6870 return result; |
| 6871 } |
| 6872 |
| 6873 @override |
| 6874 Request toRequest(String id) { |
| 6875 return new Request(id, "edit.sortMembers", toJson()); |
| 6876 } |
| 6877 |
| 6878 @override |
| 6879 String toString() => JSON.encode(toJson()); |
| 6880 |
| 6881 @override |
| 6882 bool operator ==(other) { |
| 6883 if (other is EditSortMembersParams) { |
| 6884 return file == other.file; |
| 6885 } |
| 6886 return false; |
| 6887 } |
10968 | 6888 |
10969 @override | 6889 @override |
10970 int get hashCode { | 6890 int get hashCode { |
10971 int hash = 0; | 6891 int hash = 0; |
10972 hash = JenkinsSmiHash.combine(hash, kind.hashCode); | 6892 hash = JenkinsSmiHash.combine(hash, file.hashCode); |
10973 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
10974 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
10975 return JenkinsSmiHash.finish(hash); | 6893 return JenkinsSmiHash.finish(hash); |
10976 } | 6894 } |
10977 } | 6895 } |
10978 | 6896 |
10979 /** | 6897 /** |
10980 * GeneralAnalysisService | 6898 * edit.sortMembers result |
10981 * | 6899 * |
10982 * enum { | 6900 * { |
10983 * ANALYZED_FILES | 6901 * "edit": SourceFileEdit |
10984 * } | 6902 * } |
10985 * | 6903 * |
10986 * Clients may not extend, implement or mix-in this class. | 6904 * Clients may not extend, implement or mix-in this class. |
10987 */ | 6905 */ |
10988 class GeneralAnalysisService implements Enum { | 6906 class EditSortMembersResult implements ResponseResult { |
10989 static const GeneralAnalysisService ANALYZED_FILES = | 6907 SourceFileEdit _edit; |
10990 const GeneralAnalysisService._("ANALYZED_FILES"); | |
10991 | 6908 |
10992 /** | 6909 /** |
10993 * A list containing all of the enum values that are defined. | 6910 * The file edit that is to be applied to the given file to effect the |
| 6911 * sorting. |
10994 */ | 6912 */ |
10995 static const List<GeneralAnalysisService> VALUES = | 6913 SourceFileEdit get edit => _edit; |
10996 const <GeneralAnalysisService>[ANALYZED_FILES]; | |
10997 | 6914 |
10998 @override | 6915 /** |
10999 final String name; | 6916 * The file edit that is to be applied to the given file to effect the |
11000 | 6917 * sorting. |
11001 const GeneralAnalysisService._(this.name); | 6918 */ |
11002 | 6919 void set edit(SourceFileEdit value) { |
11003 factory GeneralAnalysisService(String name) { | 6920 assert(value != null); |
11004 switch (name) { | 6921 this._edit = value; |
11005 case "ANALYZED_FILES": | |
11006 return ANALYZED_FILES; | |
11007 } | |
11008 throw new Exception('Illegal enum value: $name'); | |
11009 } | 6922 } |
11010 | 6923 |
11011 factory GeneralAnalysisService.fromJson( | 6924 EditSortMembersResult(SourceFileEdit edit) { |
11012 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 6925 this.edit = edit; |
11013 if (json is String) { | |
11014 try { | |
11015 return new GeneralAnalysisService(json); | |
11016 } catch (_) { | |
11017 // Fall through | |
11018 } | |
11019 } | |
11020 throw jsonDecoder.mismatch(jsonPath, "GeneralAnalysisService", json); | |
11021 } | 6926 } |
11022 | 6927 |
11023 @override | 6928 factory EditSortMembersResult.fromJson( |
11024 String toString() => "GeneralAnalysisService.$name"; | |
11025 | |
11026 String toJson() => name; | |
11027 } | |
11028 | |
11029 /** | |
11030 * HighlightRegion | |
11031 * | |
11032 * { | |
11033 * "type": HighlightRegionType | |
11034 * "offset": int | |
11035 * "length": int | |
11036 * } | |
11037 * | |
11038 * Clients may not extend, implement or mix-in this class. | |
11039 */ | |
11040 class HighlightRegion implements HasToJson { | |
11041 HighlightRegionType _type; | |
11042 | |
11043 int _offset; | |
11044 | |
11045 int _length; | |
11046 | |
11047 /** | |
11048 * The type of highlight associated with the region. | |
11049 */ | |
11050 HighlightRegionType get type => _type; | |
11051 | |
11052 /** | |
11053 * The type of highlight associated with the region. | |
11054 */ | |
11055 void set type(HighlightRegionType value) { | |
11056 assert(value != null); | |
11057 this._type = value; | |
11058 } | |
11059 | |
11060 /** | |
11061 * The offset of the region to be highlighted. | |
11062 */ | |
11063 int get offset => _offset; | |
11064 | |
11065 /** | |
11066 * The offset of the region to be highlighted. | |
11067 */ | |
11068 void set offset(int value) { | |
11069 assert(value != null); | |
11070 this._offset = value; | |
11071 } | |
11072 | |
11073 /** | |
11074 * The length of the region to be highlighted. | |
11075 */ | |
11076 int get length => _length; | |
11077 | |
11078 /** | |
11079 * The length of the region to be highlighted. | |
11080 */ | |
11081 void set length(int value) { | |
11082 assert(value != null); | |
11083 this._length = value; | |
11084 } | |
11085 | |
11086 HighlightRegion(HighlightRegionType type, int offset, int length) { | |
11087 this.type = type; | |
11088 this.offset = offset; | |
11089 this.length = length; | |
11090 } | |
11091 | |
11092 factory HighlightRegion.fromJson( | |
11093 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 6929 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
11094 if (json == null) { | 6930 if (json == null) { |
11095 json = {}; | 6931 json = {}; |
11096 } | 6932 } |
11097 if (json is Map) { | 6933 if (json is Map) { |
11098 HighlightRegionType type; | 6934 SourceFileEdit edit; |
11099 if (json.containsKey("type")) { | 6935 if (json.containsKey("edit")) { |
11100 type = new HighlightRegionType.fromJson( | 6936 edit = new SourceFileEdit.fromJson( |
11101 jsonDecoder, jsonPath + ".type", json["type"]); | 6937 jsonDecoder, jsonPath + ".edit", json["edit"]); |
11102 } else { | 6938 } else { |
11103 throw jsonDecoder.mismatch(jsonPath, "type"); | 6939 throw jsonDecoder.mismatch(jsonPath, "edit"); |
11104 } | 6940 } |
11105 int offset; | 6941 return new EditSortMembersResult(edit); |
11106 if (json.containsKey("offset")) { | 6942 } else { |
11107 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | 6943 throw jsonDecoder.mismatch(jsonPath, "edit.sortMembers result", json); |
| 6944 } |
| 6945 } |
| 6946 |
| 6947 factory EditSortMembersResult.fromResponse(Response response) { |
| 6948 return new EditSortMembersResult.fromJson( |
| 6949 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), |
| 6950 "result", |
| 6951 response.result); |
| 6952 } |
| 6953 |
| 6954 @override |
| 6955 Map<String, dynamic> toJson() { |
| 6956 Map<String, dynamic> result = {}; |
| 6957 result["edit"] = edit.toJson(); |
| 6958 return result; |
| 6959 } |
| 6960 |
| 6961 @override |
| 6962 Response toResponse(String id) { |
| 6963 return new Response(id, result: toJson()); |
| 6964 } |
| 6965 |
| 6966 @override |
| 6967 String toString() => JSON.encode(toJson()); |
| 6968 |
| 6969 @override |
| 6970 bool operator ==(other) { |
| 6971 if (other is EditSortMembersResult) { |
| 6972 return edit == other.edit; |
| 6973 } |
| 6974 return false; |
| 6975 } |
| 6976 |
| 6977 @override |
| 6978 int get hashCode { |
| 6979 int hash = 0; |
| 6980 hash = JenkinsSmiHash.combine(hash, edit.hashCode); |
| 6981 return JenkinsSmiHash.finish(hash); |
| 6982 } |
| 6983 } |
| 6984 |
| 6985 /** |
| 6986 * ExecutableFile |
| 6987 * |
| 6988 * { |
| 6989 * "file": FilePath |
| 6990 * "kind": ExecutableKind |
| 6991 * } |
| 6992 * |
| 6993 * Clients may not extend, implement or mix-in this class. |
| 6994 */ |
| 6995 class ExecutableFile implements HasToJson { |
| 6996 String _file; |
| 6997 |
| 6998 ExecutableKind _kind; |
| 6999 |
| 7000 /** |
| 7001 * The path of the executable file. |
| 7002 */ |
| 7003 String get file => _file; |
| 7004 |
| 7005 /** |
| 7006 * The path of the executable file. |
| 7007 */ |
| 7008 void set file(String value) { |
| 7009 assert(value != null); |
| 7010 this._file = value; |
| 7011 } |
| 7012 |
| 7013 /** |
| 7014 * The kind of the executable file. |
| 7015 */ |
| 7016 ExecutableKind get kind => _kind; |
| 7017 |
| 7018 /** |
| 7019 * The kind of the executable file. |
| 7020 */ |
| 7021 void set kind(ExecutableKind value) { |
| 7022 assert(value != null); |
| 7023 this._kind = value; |
| 7024 } |
| 7025 |
| 7026 ExecutableFile(String file, ExecutableKind kind) { |
| 7027 this.file = file; |
| 7028 this.kind = kind; |
| 7029 } |
| 7030 |
| 7031 factory ExecutableFile.fromJson( |
| 7032 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| 7033 if (json == null) { |
| 7034 json = {}; |
| 7035 } |
| 7036 if (json is Map) { |
| 7037 String file; |
| 7038 if (json.containsKey("file")) { |
| 7039 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); |
11108 } else { | 7040 } else { |
11109 throw jsonDecoder.mismatch(jsonPath, "offset"); | 7041 throw jsonDecoder.mismatch(jsonPath, "file"); |
11110 } | 7042 } |
11111 int length; | 7043 ExecutableKind kind; |
11112 if (json.containsKey("length")) { | 7044 if (json.containsKey("kind")) { |
11113 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | 7045 kind = new ExecutableKind.fromJson( |
| 7046 jsonDecoder, jsonPath + ".kind", json["kind"]); |
11114 } else { | 7047 } else { |
11115 throw jsonDecoder.mismatch(jsonPath, "length"); | 7048 throw jsonDecoder.mismatch(jsonPath, "kind"); |
11116 } | 7049 } |
11117 return new HighlightRegion(type, offset, length); | 7050 return new ExecutableFile(file, kind); |
11118 } else { | 7051 } else { |
11119 throw jsonDecoder.mismatch(jsonPath, "HighlightRegion", json); | 7052 throw jsonDecoder.mismatch(jsonPath, "ExecutableFile", json); |
11120 } | 7053 } |
11121 } | 7054 } |
11122 | 7055 |
11123 @override | 7056 @override |
11124 Map<String, dynamic> toJson() { | 7057 Map<String, dynamic> toJson() { |
11125 Map<String, dynamic> result = {}; | 7058 Map<String, dynamic> result = {}; |
11126 result["type"] = type.toJson(); | 7059 result["file"] = file; |
11127 result["offset"] = offset; | 7060 result["kind"] = kind.toJson(); |
11128 result["length"] = length; | |
11129 return result; | 7061 return result; |
11130 } | 7062 } |
11131 | 7063 |
11132 @override | 7064 @override |
11133 String toString() => JSON.encode(toJson()); | 7065 String toString() => JSON.encode(toJson()); |
11134 | 7066 |
11135 @override | 7067 @override |
11136 bool operator ==(other) { | 7068 bool operator ==(other) { |
11137 if (other is HighlightRegion) { | 7069 if (other is ExecutableFile) { |
11138 return type == other.type && | 7070 return file == other.file && kind == other.kind; |
11139 offset == other.offset && | |
11140 length == other.length; | |
11141 } | 7071 } |
11142 return false; | 7072 return false; |
11143 } | 7073 } |
11144 | 7074 |
11145 @override | 7075 @override |
11146 int get hashCode { | 7076 int get hashCode { |
11147 int hash = 0; | 7077 int hash = 0; |
11148 hash = JenkinsSmiHash.combine(hash, type.hashCode); | 7078 hash = JenkinsSmiHash.combine(hash, file.hashCode); |
11149 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | 7079 hash = JenkinsSmiHash.combine(hash, kind.hashCode); |
11150 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
11151 return JenkinsSmiHash.finish(hash); | 7080 return JenkinsSmiHash.finish(hash); |
11152 } | 7081 } |
11153 } | 7082 } |
11154 | 7083 |
11155 /** | 7084 /** |
11156 * HighlightRegionType | 7085 * ExecutableKind |
11157 * | 7086 * |
11158 * enum { | 7087 * enum { |
11159 * ANNOTATION | 7088 * CLIENT |
11160 * BUILT_IN | 7089 * EITHER |
11161 * CLASS | 7090 * NOT_EXECUTABLE |
11162 * COMMENT_BLOCK | 7091 * SERVER |
11163 * COMMENT_DOCUMENTATION | |
11164 * COMMENT_END_OF_LINE | |
11165 * CONSTRUCTOR | |
11166 * DIRECTIVE | |
11167 * DYNAMIC_TYPE | |
11168 * DYNAMIC_LOCAL_VARIABLE_DECLARATION | |
11169 * DYNAMIC_LOCAL_VARIABLE_REFERENCE | |
11170 * DYNAMIC_PARAMETER_DECLARATION | |
11171 * DYNAMIC_PARAMETER_REFERENCE | |
11172 * ENUM | |
11173 * ENUM_CONSTANT | |
11174 * FIELD | |
11175 * FIELD_STATIC | |
11176 * FUNCTION | |
11177 * FUNCTION_DECLARATION | |
11178 * FUNCTION_TYPE_ALIAS | |
11179 * GETTER_DECLARATION | |
11180 * IDENTIFIER_DEFAULT | |
11181 * IMPORT_PREFIX | |
11182 * INSTANCE_FIELD_DECLARATION | |
11183 * INSTANCE_FIELD_REFERENCE | |
11184 * INSTANCE_GETTER_DECLARATION | |
11185 * INSTANCE_GETTER_REFERENCE | |
11186 * INSTANCE_METHOD_DECLARATION | |
11187 * INSTANCE_METHOD_REFERENCE | |
11188 * INSTANCE_SETTER_DECLARATION | |
11189 * INSTANCE_SETTER_REFERENCE | |
11190 * INVALID_STRING_ESCAPE | |
11191 * KEYWORD | |
11192 * LABEL | |
11193 * LIBRARY_NAME | |
11194 * LITERAL_BOOLEAN | |
11195 * LITERAL_DOUBLE | |
11196 * LITERAL_INTEGER | |
11197 * LITERAL_LIST | |
11198 * LITERAL_MAP | |
11199 * LITERAL_STRING | |
11200 * LOCAL_FUNCTION_DECLARATION | |
11201 * LOCAL_FUNCTION_REFERENCE | |
11202 * LOCAL_VARIABLE | |
11203 * LOCAL_VARIABLE_DECLARATION | |
11204 * LOCAL_VARIABLE_REFERENCE | |
11205 * METHOD | |
11206 * METHOD_DECLARATION | |
11207 * METHOD_DECLARATION_STATIC | |
11208 * METHOD_STATIC | |
11209 * PARAMETER | |
11210 * SETTER_DECLARATION | |
11211 * TOP_LEVEL_VARIABLE | |
11212 * PARAMETER_DECLARATION | |
11213 * PARAMETER_REFERENCE | |
11214 * STATIC_FIELD_DECLARATION | |
11215 * STATIC_GETTER_DECLARATION | |
11216 * STATIC_GETTER_REFERENCE | |
11217 * STATIC_METHOD_DECLARATION | |
11218 * STATIC_METHOD_REFERENCE | |
11219 * STATIC_SETTER_DECLARATION | |
11220 * STATIC_SETTER_REFERENCE | |
11221 * TOP_LEVEL_FUNCTION_DECLARATION | |
11222 * TOP_LEVEL_FUNCTION_REFERENCE | |
11223 * TOP_LEVEL_GETTER_DECLARATION | |
11224 * TOP_LEVEL_GETTER_REFERENCE | |
11225 * TOP_LEVEL_SETTER_DECLARATION | |
11226 * TOP_LEVEL_SETTER_REFERENCE | |
11227 * TOP_LEVEL_VARIABLE_DECLARATION | |
11228 * TYPE_NAME_DYNAMIC | |
11229 * TYPE_PARAMETER | |
11230 * UNRESOLVED_INSTANCE_MEMBER_REFERENCE | |
11231 * VALID_STRING_ESCAPE | |
11232 * } | 7092 * } |
11233 * | 7093 * |
11234 * Clients may not extend, implement or mix-in this class. | 7094 * Clients may not extend, implement or mix-in this class. |
11235 */ | 7095 */ |
11236 class HighlightRegionType implements Enum { | 7096 class ExecutableKind implements Enum { |
11237 static const HighlightRegionType ANNOTATION = | 7097 static const ExecutableKind CLIENT = const ExecutableKind._("CLIENT"); |
11238 const HighlightRegionType._("ANNOTATION"); | 7098 |
11239 | 7099 static const ExecutableKind EITHER = const ExecutableKind._("EITHER"); |
11240 static const HighlightRegionType BUILT_IN = | 7100 |
11241 const HighlightRegionType._("BUILT_IN"); | 7101 static const ExecutableKind NOT_EXECUTABLE = |
11242 | 7102 const ExecutableKind._("NOT_EXECUTABLE"); |
11243 static const HighlightRegionType CLASS = const HighlightRegionType._("CLASS"); | 7103 |
11244 | 7104 static const ExecutableKind SERVER = const ExecutableKind._("SERVER"); |
11245 static const HighlightRegionType COMMENT_BLOCK = | |
11246 const HighlightRegionType._("COMMENT_BLOCK"); | |
11247 | |
11248 static const HighlightRegionType COMMENT_DOCUMENTATION = | |
11249 const HighlightRegionType._("COMMENT_DOCUMENTATION"); | |
11250 | |
11251 static const HighlightRegionType COMMENT_END_OF_LINE = | |
11252 const HighlightRegionType._("COMMENT_END_OF_LINE"); | |
11253 | |
11254 static const HighlightRegionType CONSTRUCTOR = | |
11255 const HighlightRegionType._("CONSTRUCTOR"); | |
11256 | |
11257 static const HighlightRegionType DIRECTIVE = | |
11258 const HighlightRegionType._("DIRECTIVE"); | |
11259 | |
11260 /** | |
11261 * Only for version 1 of highlight. | |
11262 */ | |
11263 static const HighlightRegionType DYNAMIC_TYPE = | |
11264 const HighlightRegionType._("DYNAMIC_TYPE"); | |
11265 | |
11266 /** | |
11267 * Only for version 2 of highlight. | |
11268 */ | |
11269 static const HighlightRegionType DYNAMIC_LOCAL_VARIABLE_DECLARATION = | |
11270 const HighlightRegionType._("DYNAMIC_LOCAL_VARIABLE_DECLARATION"); | |
11271 | |
11272 /** | |
11273 * Only for version 2 of highlight. | |
11274 */ | |
11275 static const HighlightRegionType DYNAMIC_LOCAL_VARIABLE_REFERENCE = | |
11276 const HighlightRegionType._("DYNAMIC_LOCAL_VARIABLE_REFERENCE"); | |
11277 | |
11278 /** | |
11279 * Only for version 2 of highlight. | |
11280 */ | |
11281 static const HighlightRegionType DYNAMIC_PARAMETER_DECLARATION = | |
11282 const HighlightRegionType._("DYNAMIC_PARAMETER_DECLARATION"); | |
11283 | |
11284 /** | |
11285 * Only for version 2 of highlight. | |
11286 */ | |
11287 static const HighlightRegionType DYNAMIC_PARAMETER_REFERENCE = | |
11288 const HighlightRegionType._("DYNAMIC_PARAMETER_REFERENCE"); | |
11289 | |
11290 static const HighlightRegionType ENUM = const HighlightRegionType._("ENUM"); | |
11291 | |
11292 static const HighlightRegionType ENUM_CONSTANT = | |
11293 const HighlightRegionType._("ENUM_CONSTANT"); | |
11294 | |
11295 /** | |
11296 * Only for version 1 of highlight. | |
11297 */ | |
11298 static const HighlightRegionType FIELD = const HighlightRegionType._("FIELD"); | |
11299 | |
11300 /** | |
11301 * Only for version 1 of highlight. | |
11302 */ | |
11303 static const HighlightRegionType FIELD_STATIC = | |
11304 const HighlightRegionType._("FIELD_STATIC"); | |
11305 | |
11306 /** | |
11307 * Only for version 1 of highlight. | |
11308 */ | |
11309 static const HighlightRegionType FUNCTION = | |
11310 const HighlightRegionType._("FUNCTION"); | |
11311 | |
11312 /** | |
11313 * Only for version 1 of highlight. | |
11314 */ | |
11315 static const HighlightRegionType FUNCTION_DECLARATION = | |
11316 const HighlightRegionType._("FUNCTION_DECLARATION"); | |
11317 | |
11318 static const HighlightRegionType FUNCTION_TYPE_ALIAS = | |
11319 const HighlightRegionType._("FUNCTION_TYPE_ALIAS"); | |
11320 | |
11321 /** | |
11322 * Only for version 1 of highlight. | |
11323 */ | |
11324 static const HighlightRegionType GETTER_DECLARATION = | |
11325 const HighlightRegionType._("GETTER_DECLARATION"); | |
11326 | |
11327 static const HighlightRegionType IDENTIFIER_DEFAULT = | |
11328 const HighlightRegionType._("IDENTIFIER_DEFAULT"); | |
11329 | |
11330 static const HighlightRegionType IMPORT_PREFIX = | |
11331 const HighlightRegionType._("IMPORT_PREFIX"); | |
11332 | |
11333 /** | |
11334 * Only for version 2 of highlight. | |
11335 */ | |
11336 static const HighlightRegionType INSTANCE_FIELD_DECLARATION = | |
11337 const HighlightRegionType._("INSTANCE_FIELD_DECLARATION"); | |
11338 | |
11339 /** | |
11340 * Only for version 2 of highlight. | |
11341 */ | |
11342 static const HighlightRegionType INSTANCE_FIELD_REFERENCE = | |
11343 const HighlightRegionType._("INSTANCE_FIELD_REFERENCE"); | |
11344 | |
11345 /** | |
11346 * Only for version 2 of highlight. | |
11347 */ | |
11348 static const HighlightRegionType INSTANCE_GETTER_DECLARATION = | |
11349 const HighlightRegionType._("INSTANCE_GETTER_DECLARATION"); | |
11350 | |
11351 /** | |
11352 * Only for version 2 of highlight. | |
11353 */ | |
11354 static const HighlightRegionType INSTANCE_GETTER_REFERENCE = | |
11355 const HighlightRegionType._("INSTANCE_GETTER_REFERENCE"); | |
11356 | |
11357 /** | |
11358 * Only for version 2 of highlight. | |
11359 */ | |
11360 static const HighlightRegionType INSTANCE_METHOD_DECLARATION = | |
11361 const HighlightRegionType._("INSTANCE_METHOD_DECLARATION"); | |
11362 | |
11363 /** | |
11364 * Only for version 2 of highlight. | |
11365 */ | |
11366 static const HighlightRegionType INSTANCE_METHOD_REFERENCE = | |
11367 const HighlightRegionType._("INSTANCE_METHOD_REFERENCE"); | |
11368 | |
11369 /** | |
11370 * Only for version 2 of highlight. | |
11371 */ | |
11372 static const HighlightRegionType INSTANCE_SETTER_DECLARATION = | |
11373 const HighlightRegionType._("INSTANCE_SETTER_DECLARATION"); | |
11374 | |
11375 /** | |
11376 * Only for version 2 of highlight. | |
11377 */ | |
11378 static const HighlightRegionType INSTANCE_SETTER_REFERENCE = | |
11379 const HighlightRegionType._("INSTANCE_SETTER_REFERENCE"); | |
11380 | |
11381 /** | |
11382 * Only for version 2 of highlight. | |
11383 */ | |
11384 static const HighlightRegionType INVALID_STRING_ESCAPE = | |
11385 const HighlightRegionType._("INVALID_STRING_ESCAPE"); | |
11386 | |
11387 static const HighlightRegionType KEYWORD = | |
11388 const HighlightRegionType._("KEYWORD"); | |
11389 | |
11390 static const HighlightRegionType LABEL = const HighlightRegionType._("LABEL"); | |
11391 | |
11392 /** | |
11393 * Only for version 2 of highlight. | |
11394 */ | |
11395 static const HighlightRegionType LIBRARY_NAME = | |
11396 const HighlightRegionType._("LIBRARY_NAME"); | |
11397 | |
11398 static const HighlightRegionType LITERAL_BOOLEAN = | |
11399 const HighlightRegionType._("LITERAL_BOOLEAN"); | |
11400 | |
11401 static const HighlightRegionType LITERAL_DOUBLE = | |
11402 const HighlightRegionType._("LITERAL_DOUBLE"); | |
11403 | |
11404 static const HighlightRegionType LITERAL_INTEGER = | |
11405 const HighlightRegionType._("LITERAL_INTEGER"); | |
11406 | |
11407 static const HighlightRegionType LITERAL_LIST = | |
11408 const HighlightRegionType._("LITERAL_LIST"); | |
11409 | |
11410 static const HighlightRegionType LITERAL_MAP = | |
11411 const HighlightRegionType._("LITERAL_MAP"); | |
11412 | |
11413 static const HighlightRegionType LITERAL_STRING = | |
11414 const HighlightRegionType._("LITERAL_STRING"); | |
11415 | |
11416 /** | |
11417 * Only for version 2 of highlight. | |
11418 */ | |
11419 static const HighlightRegionType LOCAL_FUNCTION_DECLARATION = | |
11420 const HighlightRegionType._("LOCAL_FUNCTION_DECLARATION"); | |
11421 | |
11422 /** | |
11423 * Only for version 2 of highlight. | |
11424 */ | |
11425 static const HighlightRegionType LOCAL_FUNCTION_REFERENCE = | |
11426 const HighlightRegionType._("LOCAL_FUNCTION_REFERENCE"); | |
11427 | |
11428 /** | |
11429 * Only for version 1 of highlight. | |
11430 */ | |
11431 static const HighlightRegionType LOCAL_VARIABLE = | |
11432 const HighlightRegionType._("LOCAL_VARIABLE"); | |
11433 | |
11434 static const HighlightRegionType LOCAL_VARIABLE_DECLARATION = | |
11435 const HighlightRegionType._("LOCAL_VARIABLE_DECLARATION"); | |
11436 | |
11437 /** | |
11438 * Only for version 2 of highlight. | |
11439 */ | |
11440 static const HighlightRegionType LOCAL_VARIABLE_REFERENCE = | |
11441 const HighlightRegionType._("LOCAL_VARIABLE_REFERENCE"); | |
11442 | |
11443 /** | |
11444 * Only for version 1 of highlight. | |
11445 */ | |
11446 static const HighlightRegionType METHOD = | |
11447 const HighlightRegionType._("METHOD"); | |
11448 | |
11449 /** | |
11450 * Only for version 1 of highlight. | |
11451 */ | |
11452 static const HighlightRegionType METHOD_DECLARATION = | |
11453 const HighlightRegionType._("METHOD_DECLARATION"); | |
11454 | |
11455 /** | |
11456 * Only for version 1 of highlight. | |
11457 */ | |
11458 static const HighlightRegionType METHOD_DECLARATION_STATIC = | |
11459 const HighlightRegionType._("METHOD_DECLARATION_STATIC"); | |
11460 | |
11461 /** | |
11462 * Only for version 1 of highlight. | |
11463 */ | |
11464 static const HighlightRegionType METHOD_STATIC = | |
11465 const HighlightRegionType._("METHOD_STATIC"); | |
11466 | |
11467 /** | |
11468 * Only for version 1 of highlight. | |
11469 */ | |
11470 static const HighlightRegionType PARAMETER = | |
11471 const HighlightRegionType._("PARAMETER"); | |
11472 | |
11473 /** | |
11474 * Only for version 1 of highlight. | |
11475 */ | |
11476 static const HighlightRegionType SETTER_DECLARATION = | |
11477 const HighlightRegionType._("SETTER_DECLARATION"); | |
11478 | |
11479 /** | |
11480 * Only for version 1 of highlight. | |
11481 */ | |
11482 static const HighlightRegionType TOP_LEVEL_VARIABLE = | |
11483 const HighlightRegionType._("TOP_LEVEL_VARIABLE"); | |
11484 | |
11485 /** | |
11486 * Only for version 2 of highlight. | |
11487 */ | |
11488 static const HighlightRegionType PARAMETER_DECLARATION = | |
11489 const HighlightRegionType._("PARAMETER_DECLARATION"); | |
11490 | |
11491 /** | |
11492 * Only for version 2 of highlight. | |
11493 */ | |
11494 static const HighlightRegionType PARAMETER_REFERENCE = | |
11495 const HighlightRegionType._("PARAMETER_REFERENCE"); | |
11496 | |
11497 /** | |
11498 * Only for version 2 of highlight. | |
11499 */ | |
11500 static const HighlightRegionType STATIC_FIELD_DECLARATION = | |
11501 const HighlightRegionType._("STATIC_FIELD_DECLARATION"); | |
11502 | |
11503 /** | |
11504 * Only for version 2 of highlight. | |
11505 */ | |
11506 static const HighlightRegionType STATIC_GETTER_DECLARATION = | |
11507 const HighlightRegionType._("STATIC_GETTER_DECLARATION"); | |
11508 | |
11509 /** | |
11510 * Only for version 2 of highlight. | |
11511 */ | |
11512 static const HighlightRegionType STATIC_GETTER_REFERENCE = | |
11513 const HighlightRegionType._("STATIC_GETTER_REFERENCE"); | |
11514 | |
11515 /** | |
11516 * Only for version 2 of highlight. | |
11517 */ | |
11518 static const HighlightRegionType STATIC_METHOD_DECLARATION = | |
11519 const HighlightRegionType._("STATIC_METHOD_DECLARATION"); | |
11520 | |
11521 /** | |
11522 * Only for version 2 of highlight. | |
11523 */ | |
11524 static const HighlightRegionType STATIC_METHOD_REFERENCE = | |
11525 const HighlightRegionType._("STATIC_METHOD_REFERENCE"); | |
11526 | |
11527 /** | |
11528 * Only for version 2 of highlight. | |
11529 */ | |
11530 static const HighlightRegionType STATIC_SETTER_DECLARATION = | |
11531 const HighlightRegionType._("STATIC_SETTER_DECLARATION"); | |
11532 | |
11533 /** | |
11534 * Only for version 2 of highlight. | |
11535 */ | |
11536 static const HighlightRegionType STATIC_SETTER_REFERENCE = | |
11537 const HighlightRegionType._("STATIC_SETTER_REFERENCE"); | |
11538 | |
11539 /** | |
11540 * Only for version 2 of highlight. | |
11541 */ | |
11542 static const HighlightRegionType TOP_LEVEL_FUNCTION_DECLARATION = | |
11543 const HighlightRegionType._("TOP_LEVEL_FUNCTION_DECLARATION"); | |
11544 | |
11545 /** | |
11546 * Only for version 2 of highlight. | |
11547 */ | |
11548 static const HighlightRegionType TOP_LEVEL_FUNCTION_REFERENCE = | |
11549 const HighlightRegionType._("TOP_LEVEL_FUNCTION_REFERENCE"); | |
11550 | |
11551 /** | |
11552 * Only for version 2 of highlight. | |
11553 */ | |
11554 static const HighlightRegionType TOP_LEVEL_GETTER_DECLARATION = | |
11555 const HighlightRegionType._("TOP_LEVEL_GETTER_DECLARATION"); | |
11556 | |
11557 /** | |
11558 * Only for version 2 of highlight. | |
11559 */ | |
11560 static const HighlightRegionType TOP_LEVEL_GETTER_REFERENCE = | |
11561 const HighlightRegionType._("TOP_LEVEL_GETTER_REFERENCE"); | |
11562 | |
11563 /** | |
11564 * Only for version 2 of highlight. | |
11565 */ | |
11566 static const HighlightRegionType TOP_LEVEL_SETTER_DECLARATION = | |
11567 const HighlightRegionType._("TOP_LEVEL_SETTER_DECLARATION"); | |
11568 | |
11569 /** | |
11570 * Only for version 2 of highlight. | |
11571 */ | |
11572 static const HighlightRegionType TOP_LEVEL_SETTER_REFERENCE = | |
11573 const HighlightRegionType._("TOP_LEVEL_SETTER_REFERENCE"); | |
11574 | |
11575 /** | |
11576 * Only for version 2 of highlight. | |
11577 */ | |
11578 static const HighlightRegionType TOP_LEVEL_VARIABLE_DECLARATION = | |
11579 const HighlightRegionType._("TOP_LEVEL_VARIABLE_DECLARATION"); | |
11580 | |
11581 static const HighlightRegionType TYPE_NAME_DYNAMIC = | |
11582 const HighlightRegionType._("TYPE_NAME_DYNAMIC"); | |
11583 | |
11584 static const HighlightRegionType TYPE_PARAMETER = | |
11585 const HighlightRegionType._("TYPE_PARAMETER"); | |
11586 | |
11587 /** | |
11588 * Only for version 2 of highlight. | |
11589 */ | |
11590 static const HighlightRegionType UNRESOLVED_INSTANCE_MEMBER_REFERENCE = | |
11591 const HighlightRegionType._("UNRESOLVED_INSTANCE_MEMBER_REFERENCE"); | |
11592 | |
11593 /** | |
11594 * Only for version 2 of highlight. | |
11595 */ | |
11596 static const HighlightRegionType VALID_STRING_ESCAPE = | |
11597 const HighlightRegionType._("VALID_STRING_ESCAPE"); | |
11598 | 7105 |
11599 /** | 7106 /** |
11600 * A list containing all of the enum values that are defined. | 7107 * A list containing all of the enum values that are defined. |
11601 */ | 7108 */ |
11602 static const List<HighlightRegionType> VALUES = const <HighlightRegionType>[ | 7109 static const List<ExecutableKind> VALUES = const <ExecutableKind>[ |
11603 ANNOTATION, | 7110 CLIENT, |
11604 BUILT_IN, | 7111 EITHER, |
11605 CLASS, | 7112 NOT_EXECUTABLE, |
11606 COMMENT_BLOCK, | 7113 SERVER |
11607 COMMENT_DOCUMENTATION, | |
11608 COMMENT_END_OF_LINE, | |
11609 CONSTRUCTOR, | |
11610 DIRECTIVE, | |
11611 DYNAMIC_TYPE, | |
11612 DYNAMIC_LOCAL_VARIABLE_DECLARATION, | |
11613 DYNAMIC_LOCAL_VARIABLE_REFERENCE, | |
11614 DYNAMIC_PARAMETER_DECLARATION, | |
11615 DYNAMIC_PARAMETER_REFERENCE, | |
11616 ENUM, | |
11617 ENUM_CONSTANT, | |
11618 FIELD, | |
11619 FIELD_STATIC, | |
11620 FUNCTION, | |
11621 FUNCTION_DECLARATION, | |
11622 FUNCTION_TYPE_ALIAS, | |
11623 GETTER_DECLARATION, | |
11624 IDENTIFIER_DEFAULT, | |
11625 IMPORT_PREFIX, | |
11626 INSTANCE_FIELD_DECLARATION, | |
11627 INSTANCE_FIELD_REFERENCE, | |
11628 INSTANCE_GETTER_DECLARATION, | |
11629 INSTANCE_GETTER_REFERENCE, | |
11630 INSTANCE_METHOD_DECLARATION, | |
11631 INSTANCE_METHOD_REFERENCE, | |
11632 INSTANCE_SETTER_DECLARATION, | |
11633 INSTANCE_SETTER_REFERENCE, | |
11634 INVALID_STRING_ESCAPE, | |
11635 KEYWORD, | |
11636 LABEL, | |
11637 LIBRARY_NAME, | |
11638 LITERAL_BOOLEAN, | |
11639 LITERAL_DOUBLE, | |
11640 LITERAL_INTEGER, | |
11641 LITERAL_LIST, | |
11642 LITERAL_MAP, | |
11643 LITERAL_STRING, | |
11644 LOCAL_FUNCTION_DECLARATION, | |
11645 LOCAL_FUNCTION_REFERENCE, | |
11646 LOCAL_VARIABLE, | |
11647 LOCAL_VARIABLE_DECLARATION, | |
11648 LOCAL_VARIABLE_REFERENCE, | |
11649 METHOD, | |
11650 METHOD_DECLARATION, | |
11651 METHOD_DECLARATION_STATIC, | |
11652 METHOD_STATIC, | |
11653 PARAMETER, | |
11654 SETTER_DECLARATION, | |
11655 TOP_LEVEL_VARIABLE, | |
11656 PARAMETER_DECLARATION, | |
11657 PARAMETER_REFERENCE, | |
11658 STATIC_FIELD_DECLARATION, | |
11659 STATIC_GETTER_DECLARATION, | |
11660 STATIC_GETTER_REFERENCE, | |
11661 STATIC_METHOD_DECLARATION, | |
11662 STATIC_METHOD_REFERENCE, | |
11663 STATIC_SETTER_DECLARATION, | |
11664 STATIC_SETTER_REFERENCE, | |
11665 TOP_LEVEL_FUNCTION_DECLARATION, | |
11666 TOP_LEVEL_FUNCTION_REFERENCE, | |
11667 TOP_LEVEL_GETTER_DECLARATION, | |
11668 TOP_LEVEL_GETTER_REFERENCE, | |
11669 TOP_LEVEL_SETTER_DECLARATION, | |
11670 TOP_LEVEL_SETTER_REFERENCE, | |
11671 TOP_LEVEL_VARIABLE_DECLARATION, | |
11672 TYPE_NAME_DYNAMIC, | |
11673 TYPE_PARAMETER, | |
11674 UNRESOLVED_INSTANCE_MEMBER_REFERENCE, | |
11675 VALID_STRING_ESCAPE | |
11676 ]; | 7114 ]; |
11677 | 7115 |
11678 @override | 7116 @override |
11679 final String name; | 7117 final String name; |
11680 | 7118 |
11681 const HighlightRegionType._(this.name); | 7119 const ExecutableKind._(this.name); |
11682 | 7120 |
11683 factory HighlightRegionType(String name) { | 7121 factory ExecutableKind(String name) { |
11684 switch (name) { | 7122 switch (name) { |
11685 case "ANNOTATION": | 7123 case "CLIENT": |
11686 return ANNOTATION; | 7124 return CLIENT; |
11687 case "BUILT_IN": | 7125 case "EITHER": |
11688 return BUILT_IN; | 7126 return EITHER; |
11689 case "CLASS": | 7127 case "NOT_EXECUTABLE": |
11690 return CLASS; | 7128 return NOT_EXECUTABLE; |
11691 case "COMMENT_BLOCK": | 7129 case "SERVER": |
11692 return COMMENT_BLOCK; | 7130 return SERVER; |
11693 case "COMMENT_DOCUMENTATION": | |
11694 return COMMENT_DOCUMENTATION; | |
11695 case "COMMENT_END_OF_LINE": | |
11696 return COMMENT_END_OF_LINE; | |
11697 case "CONSTRUCTOR": | |
11698 return CONSTRUCTOR; | |
11699 case "DIRECTIVE": | |
11700 return DIRECTIVE; | |
11701 case "DYNAMIC_TYPE": | |
11702 return DYNAMIC_TYPE; | |
11703 case "DYNAMIC_LOCAL_VARIABLE_DECLARATION": | |
11704 return DYNAMIC_LOCAL_VARIABLE_DECLARATION; | |
11705 case "DYNAMIC_LOCAL_VARIABLE_REFERENCE": | |
11706 return DYNAMIC_LOCAL_VARIABLE_REFERENCE; | |
11707 case "DYNAMIC_PARAMETER_DECLARATION": | |
11708 return DYNAMIC_PARAMETER_DECLARATION; | |
11709 case "DYNAMIC_PARAMETER_REFERENCE": | |
11710 return DYNAMIC_PARAMETER_REFERENCE; | |
11711 case "ENUM": | |
11712 return ENUM; | |
11713 case "ENUM_CONSTANT": | |
11714 return ENUM_CONSTANT; | |
11715 case "FIELD": | |
11716 return FIELD; | |
11717 case "FIELD_STATIC": | |
11718 return FIELD_STATIC; | |
11719 case "FUNCTION": | |
11720 return FUNCTION; | |
11721 case "FUNCTION_DECLARATION": | |
11722 return FUNCTION_DECLARATION; | |
11723 case "FUNCTION_TYPE_ALIAS": | |
11724 return FUNCTION_TYPE_ALIAS; | |
11725 case "GETTER_DECLARATION": | |
11726 return GETTER_DECLARATION; | |
11727 case "IDENTIFIER_DEFAULT": | |
11728 return IDENTIFIER_DEFAULT; | |
11729 case "IMPORT_PREFIX": | |
11730 return IMPORT_PREFIX; | |
11731 case "INSTANCE_FIELD_DECLARATION": | |
11732 return INSTANCE_FIELD_DECLARATION; | |
11733 case "INSTANCE_FIELD_REFERENCE": | |
11734 return INSTANCE_FIELD_REFERENCE; | |
11735 case "INSTANCE_GETTER_DECLARATION": | |
11736 return INSTANCE_GETTER_DECLARATION; | |
11737 case "INSTANCE_GETTER_REFERENCE": | |
11738 return INSTANCE_GETTER_REFERENCE; | |
11739 case "INSTANCE_METHOD_DECLARATION": | |
11740 return INSTANCE_METHOD_DECLARATION; | |
11741 case "INSTANCE_METHOD_REFERENCE": | |
11742 return INSTANCE_METHOD_REFERENCE; | |
11743 case "INSTANCE_SETTER_DECLARATION": | |
11744 return INSTANCE_SETTER_DECLARATION; | |
11745 case "INSTANCE_SETTER_REFERENCE": | |
11746 return INSTANCE_SETTER_REFERENCE; | |
11747 case "INVALID_STRING_ESCAPE": | |
11748 return INVALID_STRING_ESCAPE; | |
11749 case "KEYWORD": | |
11750 return KEYWORD; | |
11751 case "LABEL": | |
11752 return LABEL; | |
11753 case "LIBRARY_NAME": | |
11754 return LIBRARY_NAME; | |
11755 case "LITERAL_BOOLEAN": | |
11756 return LITERAL_BOOLEAN; | |
11757 case "LITERAL_DOUBLE": | |
11758 return LITERAL_DOUBLE; | |
11759 case "LITERAL_INTEGER": | |
11760 return LITERAL_INTEGER; | |
11761 case "LITERAL_LIST": | |
11762 return LITERAL_LIST; | |
11763 case "LITERAL_MAP": | |
11764 return LITERAL_MAP; | |
11765 case "LITERAL_STRING": | |
11766 return LITERAL_STRING; | |
11767 case "LOCAL_FUNCTION_DECLARATION": | |
11768 return LOCAL_FUNCTION_DECLARATION; | |
11769 case "LOCAL_FUNCTION_REFERENCE": | |
11770 return LOCAL_FUNCTION_REFERENCE; | |
11771 case "LOCAL_VARIABLE": | |
11772 return LOCAL_VARIABLE; | |
11773 case "LOCAL_VARIABLE_DECLARATION": | |
11774 return LOCAL_VARIABLE_DECLARATION; | |
11775 case "LOCAL_VARIABLE_REFERENCE": | |
11776 return LOCAL_VARIABLE_REFERENCE; | |
11777 case "METHOD": | |
11778 return METHOD; | |
11779 case "METHOD_DECLARATION": | |
11780 return METHOD_DECLARATION; | |
11781 case "METHOD_DECLARATION_STATIC": | |
11782 return METHOD_DECLARATION_STATIC; | |
11783 case "METHOD_STATIC": | |
11784 return METHOD_STATIC; | |
11785 case "PARAMETER": | |
11786 return PARAMETER; | |
11787 case "SETTER_DECLARATION": | |
11788 return SETTER_DECLARATION; | |
11789 case "TOP_LEVEL_VARIABLE": | |
11790 return TOP_LEVEL_VARIABLE; | |
11791 case "PARAMETER_DECLARATION": | |
11792 return PARAMETER_DECLARATION; | |
11793 case "PARAMETER_REFERENCE": | |
11794 return PARAMETER_REFERENCE; | |
11795 case "STATIC_FIELD_DECLARATION": | |
11796 return STATIC_FIELD_DECLARATION; | |
11797 case "STATIC_GETTER_DECLARATION": | |
11798 return STATIC_GETTER_DECLARATION; | |
11799 case "STATIC_GETTER_REFERENCE": | |
11800 return STATIC_GETTER_REFERENCE; | |
11801 case "STATIC_METHOD_DECLARATION": | |
11802 return STATIC_METHOD_DECLARATION; | |
11803 case "STATIC_METHOD_REFERENCE": | |
11804 return STATIC_METHOD_REFERENCE; | |
11805 case "STATIC_SETTER_DECLARATION": | |
11806 return STATIC_SETTER_DECLARATION; | |
11807 case "STATIC_SETTER_REFERENCE": | |
11808 return STATIC_SETTER_REFERENCE; | |
11809 case "TOP_LEVEL_FUNCTION_DECLARATION": | |
11810 return TOP_LEVEL_FUNCTION_DECLARATION; | |
11811 case "TOP_LEVEL_FUNCTION_REFERENCE": | |
11812 return TOP_LEVEL_FUNCTION_REFERENCE; | |
11813 case "TOP_LEVEL_GETTER_DECLARATION": | |
11814 return TOP_LEVEL_GETTER_DECLARATION; | |
11815 case "TOP_LEVEL_GETTER_REFERENCE": | |
11816 return TOP_LEVEL_GETTER_REFERENCE; | |
11817 case "TOP_LEVEL_SETTER_DECLARATION": | |
11818 return TOP_LEVEL_SETTER_DECLARATION; | |
11819 case "TOP_LEVEL_SETTER_REFERENCE": | |
11820 return TOP_LEVEL_SETTER_REFERENCE; | |
11821 case "TOP_LEVEL_VARIABLE_DECLARATION": | |
11822 return TOP_LEVEL_VARIABLE_DECLARATION; | |
11823 case "TYPE_NAME_DYNAMIC": | |
11824 return TYPE_NAME_DYNAMIC; | |
11825 case "TYPE_PARAMETER": | |
11826 return TYPE_PARAMETER; | |
11827 case "UNRESOLVED_INSTANCE_MEMBER_REFERENCE": | |
11828 return UNRESOLVED_INSTANCE_MEMBER_REFERENCE; | |
11829 case "VALID_STRING_ESCAPE": | |
11830 return VALID_STRING_ESCAPE; | |
11831 } | 7131 } |
11832 throw new Exception('Illegal enum value: $name'); | 7132 throw new Exception('Illegal enum value: $name'); |
11833 } | 7133 } |
11834 | 7134 |
11835 factory HighlightRegionType.fromJson( | 7135 factory ExecutableKind.fromJson( |
11836 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 7136 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
11837 if (json is String) { | 7137 if (json is String) { |
11838 try { | 7138 try { |
11839 return new HighlightRegionType(json); | 7139 return new ExecutableKind(json); |
11840 } catch (_) { | 7140 } catch (_) { |
11841 // Fall through | 7141 // Fall through |
11842 } | 7142 } |
11843 } | 7143 } |
11844 throw jsonDecoder.mismatch(jsonPath, "HighlightRegionType", json); | 7144 throw jsonDecoder.mismatch(jsonPath, "ExecutableKind", json); |
11845 } | 7145 } |
11846 | 7146 |
11847 @override | 7147 @override |
11848 String toString() => "HighlightRegionType.$name"; | 7148 String toString() => "ExecutableKind.$name"; |
11849 | 7149 |
11850 String toJson() => name; | 7150 String toJson() => name; |
11851 } | 7151 } |
11852 | 7152 |
11853 /** | 7153 /** |
11854 * HoverInformation | 7154 * execution.createContext params |
11855 * | 7155 * |
11856 * { | 7156 * { |
11857 * "offset": int | 7157 * "contextRoot": FilePath |
11858 * "length": int | |
11859 * "containingLibraryPath": optional String | |
11860 * "containingLibraryName": optional String | |
11861 * "containingClassDescription": optional String | |
11862 * "dartdoc": optional String | |
11863 * "elementDescription": optional String | |
11864 * "elementKind": optional String | |
11865 * "isDeprecated": optional bool | |
11866 * "parameter": optional String | |
11867 * "propagatedType": optional String | |
11868 * "staticType": optional String | |
11869 * } | 7158 * } |
11870 * | 7159 * |
11871 * Clients may not extend, implement or mix-in this class. | 7160 * Clients may not extend, implement or mix-in this class. |
11872 */ | 7161 */ |
11873 class HoverInformation implements HasToJson { | 7162 class ExecutionCreateContextParams implements RequestParams { |
11874 int _offset; | 7163 String _contextRoot; |
11875 | 7164 |
11876 int _length; | 7165 /** |
11877 | 7166 * The path of the Dart or HTML file that will be launched, or the path of |
11878 String _containingLibraryPath; | 7167 * the directory containing the file. |
11879 | 7168 */ |
11880 String _containingLibraryName; | 7169 String get contextRoot => _contextRoot; |
11881 | 7170 |
11882 String _containingClassDescription; | 7171 /** |
11883 | 7172 * The path of the Dart or HTML file that will be launched, or the path of |
11884 String _dartdoc; | 7173 * the directory containing the file. |
11885 | 7174 */ |
11886 String _elementDescription; | 7175 void set contextRoot(String value) { |
11887 | |
11888 String _elementKind; | |
11889 | |
11890 bool _isDeprecated; | |
11891 | |
11892 String _parameter; | |
11893 | |
11894 String _propagatedType; | |
11895 | |
11896 String _staticType; | |
11897 | |
11898 /** | |
11899 * The offset of the range of characters that encompasses the cursor position | |
11900 * and has the same hover information as the cursor position. | |
11901 */ | |
11902 int get offset => _offset; | |
11903 | |
11904 /** | |
11905 * The offset of the range of characters that encompasses the cursor position | |
11906 * and has the same hover information as the cursor position. | |
11907 */ | |
11908 void set offset(int value) { | |
11909 assert(value != null); | 7176 assert(value != null); |
11910 this._offset = value; | 7177 this._contextRoot = value; |
11911 } | 7178 } |
11912 | 7179 |
11913 /** | 7180 ExecutionCreateContextParams(String contextRoot) { |
11914 * The length of the range of characters that encompasses the cursor position | 7181 this.contextRoot = contextRoot; |
11915 * and has the same hover information as the cursor position. | 7182 } |
11916 */ | 7183 |
11917 int get length => _length; | 7184 factory ExecutionCreateContextParams.fromJson( |
11918 | |
11919 /** | |
11920 * The length of the range of characters that encompasses the cursor position | |
11921 * and has the same hover information as the cursor position. | |
11922 */ | |
11923 void set length(int value) { | |
11924 assert(value != null); | |
11925 this._length = value; | |
11926 } | |
11927 | |
11928 /** | |
11929 * The path to the defining compilation unit of the library in which the | |
11930 * referenced element is declared. This data is omitted if there is no | |
11931 * referenced element, or if the element is declared inside an HTML file. | |
11932 */ | |
11933 String get containingLibraryPath => _containingLibraryPath; | |
11934 | |
11935 /** | |
11936 * The path to the defining compilation unit of the library in which the | |
11937 * referenced element is declared. This data is omitted if there is no | |
11938 * referenced element, or if the element is declared inside an HTML file. | |
11939 */ | |
11940 void set containingLibraryPath(String value) { | |
11941 this._containingLibraryPath = value; | |
11942 } | |
11943 | |
11944 /** | |
11945 * The name of the library in which the referenced element is declared. This | |
11946 * data is omitted if there is no referenced element, or if the element is | |
11947 * declared inside an HTML file. | |
11948 */ | |
11949 String get containingLibraryName => _containingLibraryName; | |
11950 | |
11951 /** | |
11952 * The name of the library in which the referenced element is declared. This | |
11953 * data is omitted if there is no referenced element, or if the element is | |
11954 * declared inside an HTML file. | |
11955 */ | |
11956 void set containingLibraryName(String value) { | |
11957 this._containingLibraryName = value; | |
11958 } | |
11959 | |
11960 /** | |
11961 * A human-readable description of the class declaring the element being | |
11962 * referenced. This data is omitted if there is no referenced element, or if | |
11963 * the element is not a class member. | |
11964 */ | |
11965 String get containingClassDescription => _containingClassDescription; | |
11966 | |
11967 /** | |
11968 * A human-readable description of the class declaring the element being | |
11969 * referenced. This data is omitted if there is no referenced element, or if | |
11970 * the element is not a class member. | |
11971 */ | |
11972 void set containingClassDescription(String value) { | |
11973 this._containingClassDescription = value; | |
11974 } | |
11975 | |
11976 /** | |
11977 * The dartdoc associated with the referenced element. Other than the removal | |
11978 * of the comment delimiters, including leading asterisks in the case of a | |
11979 * block comment, the dartdoc is unprocessed markdown. This data is omitted | |
11980 * if there is no referenced element, or if the element has no dartdoc. | |
11981 */ | |
11982 String get dartdoc => _dartdoc; | |
11983 | |
11984 /** | |
11985 * The dartdoc associated with the referenced element. Other than the removal | |
11986 * of the comment delimiters, including leading asterisks in the case of a | |
11987 * block comment, the dartdoc is unprocessed markdown. This data is omitted | |
11988 * if there is no referenced element, or if the element has no dartdoc. | |
11989 */ | |
11990 void set dartdoc(String value) { | |
11991 this._dartdoc = value; | |
11992 } | |
11993 | |
11994 /** | |
11995 * A human-readable description of the element being referenced. This data is | |
11996 * omitted if there is no referenced element. | |
11997 */ | |
11998 String get elementDescription => _elementDescription; | |
11999 | |
12000 /** | |
12001 * A human-readable description of the element being referenced. This data is | |
12002 * omitted if there is no referenced element. | |
12003 */ | |
12004 void set elementDescription(String value) { | |
12005 this._elementDescription = value; | |
12006 } | |
12007 | |
12008 /** | |
12009 * A human-readable description of the kind of element being referenced (such | |
12010 * as "class" or "function type alias"). This data is omitted if there is no | |
12011 * referenced element. | |
12012 */ | |
12013 String get elementKind => _elementKind; | |
12014 | |
12015 /** | |
12016 * A human-readable description of the kind of element being referenced (such | |
12017 * as "class" or "function type alias"). This data is omitted if there is no | |
12018 * referenced element. | |
12019 */ | |
12020 void set elementKind(String value) { | |
12021 this._elementKind = value; | |
12022 } | |
12023 | |
12024 /** | |
12025 * True if the referenced element is deprecated. | |
12026 */ | |
12027 bool get isDeprecated => _isDeprecated; | |
12028 | |
12029 /** | |
12030 * True if the referenced element is deprecated. | |
12031 */ | |
12032 void set isDeprecated(bool value) { | |
12033 this._isDeprecated = value; | |
12034 } | |
12035 | |
12036 /** | |
12037 * A human-readable description of the parameter corresponding to the | |
12038 * expression being hovered over. This data is omitted if the location is not | |
12039 * in an argument to a function. | |
12040 */ | |
12041 String get parameter => _parameter; | |
12042 | |
12043 /** | |
12044 * A human-readable description of the parameter corresponding to the | |
12045 * expression being hovered over. This data is omitted if the location is not | |
12046 * in an argument to a function. | |
12047 */ | |
12048 void set parameter(String value) { | |
12049 this._parameter = value; | |
12050 } | |
12051 | |
12052 /** | |
12053 * The name of the propagated type of the expression. This data is omitted if | |
12054 * the location does not correspond to an expression or if there is no | |
12055 * propagated type information. | |
12056 */ | |
12057 String get propagatedType => _propagatedType; | |
12058 | |
12059 /** | |
12060 * The name of the propagated type of the expression. This data is omitted if | |
12061 * the location does not correspond to an expression or if there is no | |
12062 * propagated type information. | |
12063 */ | |
12064 void set propagatedType(String value) { | |
12065 this._propagatedType = value; | |
12066 } | |
12067 | |
12068 /** | |
12069 * The name of the static type of the expression. This data is omitted if the | |
12070 * location does not correspond to an expression. | |
12071 */ | |
12072 String get staticType => _staticType; | |
12073 | |
12074 /** | |
12075 * The name of the static type of the expression. This data is omitted if the | |
12076 * location does not correspond to an expression. | |
12077 */ | |
12078 void set staticType(String value) { | |
12079 this._staticType = value; | |
12080 } | |
12081 | |
12082 HoverInformation(int offset, int length, | |
12083 {String containingLibraryPath, | |
12084 String containingLibraryName, | |
12085 String containingClassDescription, | |
12086 String dartdoc, | |
12087 String elementDescription, | |
12088 String elementKind, | |
12089 bool isDeprecated, | |
12090 String parameter, | |
12091 String propagatedType, | |
12092 String staticType}) { | |
12093 this.offset = offset; | |
12094 this.length = length; | |
12095 this.containingLibraryPath = containingLibraryPath; | |
12096 this.containingLibraryName = containingLibraryName; | |
12097 this.containingClassDescription = containingClassDescription; | |
12098 this.dartdoc = dartdoc; | |
12099 this.elementDescription = elementDescription; | |
12100 this.elementKind = elementKind; | |
12101 this.isDeprecated = isDeprecated; | |
12102 this.parameter = parameter; | |
12103 this.propagatedType = propagatedType; | |
12104 this.staticType = staticType; | |
12105 } | |
12106 | |
12107 factory HoverInformation.fromJson( | |
12108 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 7185 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
12109 if (json == null) { | 7186 if (json == null) { |
12110 json = {}; | 7187 json = {}; |
12111 } | 7188 } |
12112 if (json is Map) { | 7189 if (json is Map) { |
12113 int offset; | 7190 String contextRoot; |
12114 if (json.containsKey("offset")) { | 7191 if (json.containsKey("contextRoot")) { |
12115 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | 7192 contextRoot = jsonDecoder.decodeString( |
| 7193 jsonPath + ".contextRoot", json["contextRoot"]); |
12116 } else { | 7194 } else { |
12117 throw jsonDecoder.mismatch(jsonPath, "offset"); | 7195 throw jsonDecoder.mismatch(jsonPath, "contextRoot"); |
12118 } | 7196 } |
12119 int length; | 7197 return new ExecutionCreateContextParams(contextRoot); |
12120 if (json.containsKey("length")) { | |
12121 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
12122 } else { | |
12123 throw jsonDecoder.mismatch(jsonPath, "length"); | |
12124 } | |
12125 String containingLibraryPath; | |
12126 if (json.containsKey("containingLibraryPath")) { | |
12127 containingLibraryPath = jsonDecoder.decodeString( | |
12128 jsonPath + ".containingLibraryPath", json["containingLibraryPath"]); | |
12129 } | |
12130 String containingLibraryName; | |
12131 if (json.containsKey("containingLibraryName")) { | |
12132 containingLibraryName = jsonDecoder.decodeString( | |
12133 jsonPath + ".containingLibraryName", json["containingLibraryName"]); | |
12134 } | |
12135 String containingClassDescription; | |
12136 if (json.containsKey("containingClassDescription")) { | |
12137 containingClassDescription = jsonDecoder.decodeString( | |
12138 jsonPath + ".containingClassDescription", | |
12139 json["containingClassDescription"]); | |
12140 } | |
12141 String dartdoc; | |
12142 if (json.containsKey("dartdoc")) { | |
12143 dartdoc = | |
12144 jsonDecoder.decodeString(jsonPath + ".dartdoc", json["dartdoc"]); | |
12145 } | |
12146 String elementDescription; | |
12147 if (json.containsKey("elementDescription")) { | |
12148 elementDescription = jsonDecoder.decodeString( | |
12149 jsonPath + ".elementDescription", json["elementDescription"]); | |
12150 } | |
12151 String elementKind; | |
12152 if (json.containsKey("elementKind")) { | |
12153 elementKind = jsonDecoder.decodeString( | |
12154 jsonPath + ".elementKind", json["elementKind"]); | |
12155 } | |
12156 bool isDeprecated; | |
12157 if (json.containsKey("isDeprecated")) { | |
12158 isDeprecated = jsonDecoder.decodeBool( | |
12159 jsonPath + ".isDeprecated", json["isDeprecated"]); | |
12160 } | |
12161 String parameter; | |
12162 if (json.containsKey("parameter")) { | |
12163 parameter = jsonDecoder.decodeString( | |
12164 jsonPath + ".parameter", json["parameter"]); | |
12165 } | |
12166 String propagatedType; | |
12167 if (json.containsKey("propagatedType")) { | |
12168 propagatedType = jsonDecoder.decodeString( | |
12169 jsonPath + ".propagatedType", json["propagatedType"]); | |
12170 } | |
12171 String staticType; | |
12172 if (json.containsKey("staticType")) { | |
12173 staticType = jsonDecoder.decodeString( | |
12174 jsonPath + ".staticType", json["staticType"]); | |
12175 } | |
12176 return new HoverInformation(offset, length, | |
12177 containingLibraryPath: containingLibraryPath, | |
12178 containingLibraryName: containingLibraryName, | |
12179 containingClassDescription: containingClassDescription, | |
12180 dartdoc: dartdoc, | |
12181 elementDescription: elementDescription, | |
12182 elementKind: elementKind, | |
12183 isDeprecated: isDeprecated, | |
12184 parameter: parameter, | |
12185 propagatedType: propagatedType, | |
12186 staticType: staticType); | |
12187 } else { | 7198 } else { |
12188 throw jsonDecoder.mismatch(jsonPath, "HoverInformation", json); | 7199 throw jsonDecoder.mismatch( |
12189 } | 7200 jsonPath, "execution.createContext params", json); |
| 7201 } |
| 7202 } |
| 7203 |
| 7204 factory ExecutionCreateContextParams.fromRequest(Request request) { |
| 7205 return new ExecutionCreateContextParams.fromJson( |
| 7206 new RequestDecoder(request), "params", request.params); |
12190 } | 7207 } |
12191 | 7208 |
12192 @override | 7209 @override |
12193 Map<String, dynamic> toJson() { | 7210 Map<String, dynamic> toJson() { |
12194 Map<String, dynamic> result = {}; | 7211 Map<String, dynamic> result = {}; |
12195 result["offset"] = offset; | 7212 result["contextRoot"] = contextRoot; |
12196 result["length"] = length; | |
12197 if (containingLibraryPath != null) { | |
12198 result["containingLibraryPath"] = containingLibraryPath; | |
12199 } | |
12200 if (containingLibraryName != null) { | |
12201 result["containingLibraryName"] = containingLibraryName; | |
12202 } | |
12203 if (containingClassDescription != null) { | |
12204 result["containingClassDescription"] = containingClassDescription; | |
12205 } | |
12206 if (dartdoc != null) { | |
12207 result["dartdoc"] = dartdoc; | |
12208 } | |
12209 if (elementDescription != null) { | |
12210 result["elementDescription"] = elementDescription; | |
12211 } | |
12212 if (elementKind != null) { | |
12213 result["elementKind"] = elementKind; | |
12214 } | |
12215 if (isDeprecated != null) { | |
12216 result["isDeprecated"] = isDeprecated; | |
12217 } | |
12218 if (parameter != null) { | |
12219 result["parameter"] = parameter; | |
12220 } | |
12221 if (propagatedType != null) { | |
12222 result["propagatedType"] = propagatedType; | |
12223 } | |
12224 if (staticType != null) { | |
12225 result["staticType"] = staticType; | |
12226 } | |
12227 return result; | 7213 return result; |
12228 } | 7214 } |
12229 | 7215 |
12230 @override | 7216 @override |
| 7217 Request toRequest(String id) { |
| 7218 return new Request(id, "execution.createContext", toJson()); |
| 7219 } |
| 7220 |
| 7221 @override |
12231 String toString() => JSON.encode(toJson()); | 7222 String toString() => JSON.encode(toJson()); |
12232 | 7223 |
12233 @override | 7224 @override |
12234 bool operator ==(other) { | 7225 bool operator ==(other) { |
12235 if (other is HoverInformation) { | 7226 if (other is ExecutionCreateContextParams) { |
12236 return offset == other.offset && | 7227 return contextRoot == other.contextRoot; |
12237 length == other.length && | |
12238 containingLibraryPath == other.containingLibraryPath && | |
12239 containingLibraryName == other.containingLibraryName && | |
12240 containingClassDescription == other.containingClassDescription && | |
12241 dartdoc == other.dartdoc && | |
12242 elementDescription == other.elementDescription && | |
12243 elementKind == other.elementKind && | |
12244 isDeprecated == other.isDeprecated && | |
12245 parameter == other.parameter && | |
12246 propagatedType == other.propagatedType && | |
12247 staticType == other.staticType; | |
12248 } | 7228 } |
12249 return false; | 7229 return false; |
12250 } | 7230 } |
| 7231 |
| 7232 @override |
| 7233 int get hashCode { |
| 7234 int hash = 0; |
| 7235 hash = JenkinsSmiHash.combine(hash, contextRoot.hashCode); |
| 7236 return JenkinsSmiHash.finish(hash); |
| 7237 } |
| 7238 } |
| 7239 |
| 7240 /** |
| 7241 * execution.createContext result |
| 7242 * |
| 7243 * { |
| 7244 * "id": ExecutionContextId |
| 7245 * } |
| 7246 * |
| 7247 * Clients may not extend, implement or mix-in this class. |
| 7248 */ |
| 7249 class ExecutionCreateContextResult implements ResponseResult { |
| 7250 String _id; |
| 7251 |
| 7252 /** |
| 7253 * The identifier used to refer to the execution context that was created. |
| 7254 */ |
| 7255 String get id => _id; |
| 7256 |
| 7257 /** |
| 7258 * The identifier used to refer to the execution context that was created. |
| 7259 */ |
| 7260 void set id(String value) { |
| 7261 assert(value != null); |
| 7262 this._id = value; |
| 7263 } |
| 7264 |
| 7265 ExecutionCreateContextResult(String id) { |
| 7266 this.id = id; |
| 7267 } |
| 7268 |
| 7269 factory ExecutionCreateContextResult.fromJson( |
| 7270 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| 7271 if (json == null) { |
| 7272 json = {}; |
| 7273 } |
| 7274 if (json is Map) { |
| 7275 String id; |
| 7276 if (json.containsKey("id")) { |
| 7277 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); |
| 7278 } else { |
| 7279 throw jsonDecoder.mismatch(jsonPath, "id"); |
| 7280 } |
| 7281 return new ExecutionCreateContextResult(id); |
| 7282 } else { |
| 7283 throw jsonDecoder.mismatch( |
| 7284 jsonPath, "execution.createContext result", json); |
| 7285 } |
| 7286 } |
| 7287 |
| 7288 factory ExecutionCreateContextResult.fromResponse(Response response) { |
| 7289 return new ExecutionCreateContextResult.fromJson( |
| 7290 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), |
| 7291 "result", |
| 7292 response.result); |
| 7293 } |
| 7294 |
| 7295 @override |
| 7296 Map<String, dynamic> toJson() { |
| 7297 Map<String, dynamic> result = {}; |
| 7298 result["id"] = id; |
| 7299 return result; |
| 7300 } |
| 7301 |
| 7302 @override |
| 7303 Response toResponse(String id) { |
| 7304 return new Response(id, result: toJson()); |
| 7305 } |
| 7306 |
| 7307 @override |
| 7308 String toString() => JSON.encode(toJson()); |
| 7309 |
| 7310 @override |
| 7311 bool operator ==(other) { |
| 7312 if (other is ExecutionCreateContextResult) { |
| 7313 return id == other.id; |
| 7314 } |
| 7315 return false; |
| 7316 } |
| 7317 |
| 7318 @override |
| 7319 int get hashCode { |
| 7320 int hash = 0; |
| 7321 hash = JenkinsSmiHash.combine(hash, id.hashCode); |
| 7322 return JenkinsSmiHash.finish(hash); |
| 7323 } |
| 7324 } |
| 7325 |
| 7326 /** |
| 7327 * execution.deleteContext params |
| 7328 * |
| 7329 * { |
| 7330 * "id": ExecutionContextId |
| 7331 * } |
| 7332 * |
| 7333 * Clients may not extend, implement or mix-in this class. |
| 7334 */ |
| 7335 class ExecutionDeleteContextParams implements RequestParams { |
| 7336 String _id; |
| 7337 |
| 7338 /** |
| 7339 * The identifier of the execution context that is to be deleted. |
| 7340 */ |
| 7341 String get id => _id; |
| 7342 |
| 7343 /** |
| 7344 * The identifier of the execution context that is to be deleted. |
| 7345 */ |
| 7346 void set id(String value) { |
| 7347 assert(value != null); |
| 7348 this._id = value; |
| 7349 } |
| 7350 |
| 7351 ExecutionDeleteContextParams(String id) { |
| 7352 this.id = id; |
| 7353 } |
| 7354 |
| 7355 factory ExecutionDeleteContextParams.fromJson( |
| 7356 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| 7357 if (json == null) { |
| 7358 json = {}; |
| 7359 } |
| 7360 if (json is Map) { |
| 7361 String id; |
| 7362 if (json.containsKey("id")) { |
| 7363 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); |
| 7364 } else { |
| 7365 throw jsonDecoder.mismatch(jsonPath, "id"); |
| 7366 } |
| 7367 return new ExecutionDeleteContextParams(id); |
| 7368 } else { |
| 7369 throw jsonDecoder.mismatch( |
| 7370 jsonPath, "execution.deleteContext params", json); |
| 7371 } |
| 7372 } |
| 7373 |
| 7374 factory ExecutionDeleteContextParams.fromRequest(Request request) { |
| 7375 return new ExecutionDeleteContextParams.fromJson( |
| 7376 new RequestDecoder(request), "params", request.params); |
| 7377 } |
| 7378 |
| 7379 @override |
| 7380 Map<String, dynamic> toJson() { |
| 7381 Map<String, dynamic> result = {}; |
| 7382 result["id"] = id; |
| 7383 return result; |
| 7384 } |
| 7385 |
| 7386 @override |
| 7387 Request toRequest(String id) { |
| 7388 return new Request(id, "execution.deleteContext", toJson()); |
| 7389 } |
| 7390 |
| 7391 @override |
| 7392 String toString() => JSON.encode(toJson()); |
| 7393 |
| 7394 @override |
| 7395 bool operator ==(other) { |
| 7396 if (other is ExecutionDeleteContextParams) { |
| 7397 return id == other.id; |
| 7398 } |
| 7399 return false; |
| 7400 } |
| 7401 |
| 7402 @override |
| 7403 int get hashCode { |
| 7404 int hash = 0; |
| 7405 hash = JenkinsSmiHash.combine(hash, id.hashCode); |
| 7406 return JenkinsSmiHash.finish(hash); |
| 7407 } |
| 7408 } |
| 7409 |
| 7410 /** |
| 7411 * execution.deleteContext result |
| 7412 * |
| 7413 * Clients may not extend, implement or mix-in this class. |
| 7414 */ |
| 7415 class ExecutionDeleteContextResult implements ResponseResult { |
| 7416 @override |
| 7417 Map<String, dynamic> toJson() => <String, dynamic>{}; |
| 7418 |
| 7419 @override |
| 7420 Response toResponse(String id) { |
| 7421 return new Response(id, result: null); |
| 7422 } |
| 7423 |
| 7424 @override |
| 7425 bool operator ==(other) { |
| 7426 if (other is ExecutionDeleteContextResult) { |
| 7427 return true; |
| 7428 } |
| 7429 return false; |
| 7430 } |
| 7431 |
| 7432 @override |
| 7433 int get hashCode { |
| 7434 return 479954425; |
| 7435 } |
| 7436 } |
| 7437 |
| 7438 /** |
| 7439 * execution.launchData params |
| 7440 * |
| 7441 * { |
| 7442 * "file": FilePath |
| 7443 * "kind": optional ExecutableKind |
| 7444 * "referencedFiles": optional List<FilePath> |
| 7445 * } |
| 7446 * |
| 7447 * Clients may not extend, implement or mix-in this class. |
| 7448 */ |
| 7449 class ExecutionLaunchDataParams implements HasToJson { |
| 7450 String _file; |
| 7451 |
| 7452 ExecutableKind _kind; |
| 7453 |
| 7454 List<String> _referencedFiles; |
| 7455 |
| 7456 /** |
| 7457 * The file for which launch data is being provided. This will either be a |
| 7458 * Dart library or an HTML file. |
| 7459 */ |
| 7460 String get file => _file; |
| 7461 |
| 7462 /** |
| 7463 * The file for which launch data is being provided. This will either be a |
| 7464 * Dart library or an HTML file. |
| 7465 */ |
| 7466 void set file(String value) { |
| 7467 assert(value != null); |
| 7468 this._file = value; |
| 7469 } |
| 7470 |
| 7471 /** |
| 7472 * The kind of the executable file. This field is omitted if the file is not |
| 7473 * a Dart file. |
| 7474 */ |
| 7475 ExecutableKind get kind => _kind; |
| 7476 |
| 7477 /** |
| 7478 * The kind of the executable file. This field is omitted if the file is not |
| 7479 * a Dart file. |
| 7480 */ |
| 7481 void set kind(ExecutableKind value) { |
| 7482 this._kind = value; |
| 7483 } |
| 7484 |
| 7485 /** |
| 7486 * A list of the Dart files that are referenced by the file. This field is |
| 7487 * omitted if the file is not an HTML file. |
| 7488 */ |
| 7489 List<String> get referencedFiles => _referencedFiles; |
| 7490 |
| 7491 /** |
| 7492 * A list of the Dart files that are referenced by the file. This field is |
| 7493 * omitted if the file is not an HTML file. |
| 7494 */ |
| 7495 void set referencedFiles(List<String> value) { |
| 7496 this._referencedFiles = value; |
| 7497 } |
| 7498 |
| 7499 ExecutionLaunchDataParams(String file, |
| 7500 {ExecutableKind kind, List<String> referencedFiles}) { |
| 7501 this.file = file; |
| 7502 this.kind = kind; |
| 7503 this.referencedFiles = referencedFiles; |
| 7504 } |
| 7505 |
| 7506 factory ExecutionLaunchDataParams.fromJson( |
| 7507 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| 7508 if (json == null) { |
| 7509 json = {}; |
| 7510 } |
| 7511 if (json is Map) { |
| 7512 String file; |
| 7513 if (json.containsKey("file")) { |
| 7514 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); |
| 7515 } else { |
| 7516 throw jsonDecoder.mismatch(jsonPath, "file"); |
| 7517 } |
| 7518 ExecutableKind kind; |
| 7519 if (json.containsKey("kind")) { |
| 7520 kind = new ExecutableKind.fromJson( |
| 7521 jsonDecoder, jsonPath + ".kind", json["kind"]); |
| 7522 } |
| 7523 List<String> referencedFiles; |
| 7524 if (json.containsKey("referencedFiles")) { |
| 7525 referencedFiles = jsonDecoder.decodeList(jsonPath + ".referencedFiles", |
| 7526 json["referencedFiles"], jsonDecoder.decodeString); |
| 7527 } |
| 7528 return new ExecutionLaunchDataParams(file, |
| 7529 kind: kind, referencedFiles: referencedFiles); |
| 7530 } else { |
| 7531 throw jsonDecoder.mismatch(jsonPath, "execution.launchData params", json); |
| 7532 } |
| 7533 } |
| 7534 |
| 7535 factory ExecutionLaunchDataParams.fromNotification( |
| 7536 Notification notification) { |
| 7537 return new ExecutionLaunchDataParams.fromJson( |
| 7538 new ResponseDecoder(null), "params", notification.params); |
| 7539 } |
| 7540 |
| 7541 @override |
| 7542 Map<String, dynamic> toJson() { |
| 7543 Map<String, dynamic> result = {}; |
| 7544 result["file"] = file; |
| 7545 if (kind != null) { |
| 7546 result["kind"] = kind.toJson(); |
| 7547 } |
| 7548 if (referencedFiles != null) { |
| 7549 result["referencedFiles"] = referencedFiles; |
| 7550 } |
| 7551 return result; |
| 7552 } |
| 7553 |
| 7554 Notification toNotification() { |
| 7555 return new Notification("execution.launchData", toJson()); |
| 7556 } |
| 7557 |
| 7558 @override |
| 7559 String toString() => JSON.encode(toJson()); |
| 7560 |
| 7561 @override |
| 7562 bool operator ==(other) { |
| 7563 if (other is ExecutionLaunchDataParams) { |
| 7564 return file == other.file && |
| 7565 kind == other.kind && |
| 7566 listEqual(referencedFiles, other.referencedFiles, |
| 7567 (String a, String b) => a == b); |
| 7568 } |
| 7569 return false; |
| 7570 } |
12251 | 7571 |
12252 @override | 7572 @override |
12253 int get hashCode { | 7573 int get hashCode { |
12254 int hash = 0; | 7574 int hash = 0; |
12255 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | 7575 hash = JenkinsSmiHash.combine(hash, file.hashCode); |
12256 hash = JenkinsSmiHash.combine(hash, length.hashCode); | 7576 hash = JenkinsSmiHash.combine(hash, kind.hashCode); |
12257 hash = JenkinsSmiHash.combine(hash, containingLibraryPath.hashCode); | 7577 hash = JenkinsSmiHash.combine(hash, referencedFiles.hashCode); |
12258 hash = JenkinsSmiHash.combine(hash, containingLibraryName.hashCode); | |
12259 hash = JenkinsSmiHash.combine(hash, containingClassDescription.hashCode); | |
12260 hash = JenkinsSmiHash.combine(hash, dartdoc.hashCode); | |
12261 hash = JenkinsSmiHash.combine(hash, elementDescription.hashCode); | |
12262 hash = JenkinsSmiHash.combine(hash, elementKind.hashCode); | |
12263 hash = JenkinsSmiHash.combine(hash, isDeprecated.hashCode); | |
12264 hash = JenkinsSmiHash.combine(hash, parameter.hashCode); | |
12265 hash = JenkinsSmiHash.combine(hash, propagatedType.hashCode); | |
12266 hash = JenkinsSmiHash.combine(hash, staticType.hashCode); | |
12267 return JenkinsSmiHash.finish(hash); | 7578 return JenkinsSmiHash.finish(hash); |
12268 } | 7579 } |
12269 } | 7580 } |
12270 | 7581 |
12271 /** | 7582 /** |
12272 * ImplementedClass | 7583 * execution.mapUri params |
12273 * | 7584 * |
12274 * { | 7585 * { |
12275 * "offset": int | 7586 * "id": ExecutionContextId |
12276 * "length": int | 7587 * "file": optional FilePath |
| 7588 * "uri": optional String |
12277 * } | 7589 * } |
12278 * | 7590 * |
12279 * Clients may not extend, implement or mix-in this class. | 7591 * Clients may not extend, implement or mix-in this class. |
12280 */ | 7592 */ |
12281 class ImplementedClass implements HasToJson { | 7593 class ExecutionMapUriParams implements RequestParams { |
12282 int _offset; | 7594 String _id; |
12283 | 7595 |
12284 int _length; | 7596 String _file; |
| 7597 |
| 7598 String _uri; |
12285 | 7599 |
12286 /** | 7600 /** |
12287 * The offset of the name of the implemented class. | 7601 * The identifier of the execution context in which the URI is to be mapped. |
12288 */ | 7602 */ |
12289 int get offset => _offset; | 7603 String get id => _id; |
12290 | 7604 |
12291 /** | 7605 /** |
12292 * The offset of the name of the implemented class. | 7606 * The identifier of the execution context in which the URI is to be mapped. |
12293 */ | 7607 */ |
12294 void set offset(int value) { | 7608 void set id(String value) { |
12295 assert(value != null); | 7609 assert(value != null); |
12296 this._offset = value; | 7610 this._id = value; |
12297 } | 7611 } |
12298 | 7612 |
12299 /** | 7613 /** |
12300 * The length of the name of the implemented class. | 7614 * The path of the file to be mapped into a URI. |
12301 */ | 7615 */ |
12302 int get length => _length; | 7616 String get file => _file; |
12303 | 7617 |
12304 /** | 7618 /** |
12305 * The length of the name of the implemented class. | 7619 * The path of the file to be mapped into a URI. |
12306 */ | 7620 */ |
12307 void set length(int value) { | 7621 void set file(String value) { |
12308 assert(value != null); | 7622 this._file = value; |
12309 this._length = value; | |
12310 } | 7623 } |
12311 | 7624 |
12312 ImplementedClass(int offset, int length) { | 7625 /** |
12313 this.offset = offset; | 7626 * The URI to be mapped into a file path. |
12314 this.length = length; | 7627 */ |
| 7628 String get uri => _uri; |
| 7629 |
| 7630 /** |
| 7631 * The URI to be mapped into a file path. |
| 7632 */ |
| 7633 void set uri(String value) { |
| 7634 this._uri = value; |
12315 } | 7635 } |
12316 | 7636 |
12317 factory ImplementedClass.fromJson( | 7637 ExecutionMapUriParams(String id, {String file, String uri}) { |
| 7638 this.id = id; |
| 7639 this.file = file; |
| 7640 this.uri = uri; |
| 7641 } |
| 7642 |
| 7643 factory ExecutionMapUriParams.fromJson( |
12318 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 7644 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
12319 if (json == null) { | 7645 if (json == null) { |
12320 json = {}; | 7646 json = {}; |
12321 } | 7647 } |
12322 if (json is Map) { | 7648 if (json is Map) { |
12323 int offset; | 7649 String id; |
12324 if (json.containsKey("offset")) { | 7650 if (json.containsKey("id")) { |
12325 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | 7651 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); |
12326 } else { | 7652 } else { |
12327 throw jsonDecoder.mismatch(jsonPath, "offset"); | 7653 throw jsonDecoder.mismatch(jsonPath, "id"); |
12328 } | 7654 } |
12329 int length; | 7655 String file; |
12330 if (json.containsKey("length")) { | 7656 if (json.containsKey("file")) { |
12331 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | 7657 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); |
12332 } else { | |
12333 throw jsonDecoder.mismatch(jsonPath, "length"); | |
12334 } | 7658 } |
12335 return new ImplementedClass(offset, length); | 7659 String uri; |
| 7660 if (json.containsKey("uri")) { |
| 7661 uri = jsonDecoder.decodeString(jsonPath + ".uri", json["uri"]); |
| 7662 } |
| 7663 return new ExecutionMapUriParams(id, file: file, uri: uri); |
12336 } else { | 7664 } else { |
12337 throw jsonDecoder.mismatch(jsonPath, "ImplementedClass", json); | 7665 throw jsonDecoder.mismatch(jsonPath, "execution.mapUri params", json); |
12338 } | 7666 } |
12339 } | 7667 } |
12340 | 7668 |
| 7669 factory ExecutionMapUriParams.fromRequest(Request request) { |
| 7670 return new ExecutionMapUriParams.fromJson( |
| 7671 new RequestDecoder(request), "params", request.params); |
| 7672 } |
| 7673 |
12341 @override | 7674 @override |
12342 Map<String, dynamic> toJson() { | 7675 Map<String, dynamic> toJson() { |
12343 Map<String, dynamic> result = {}; | 7676 Map<String, dynamic> result = {}; |
12344 result["offset"] = offset; | 7677 result["id"] = id; |
12345 result["length"] = length; | 7678 if (file != null) { |
| 7679 result["file"] = file; |
| 7680 } |
| 7681 if (uri != null) { |
| 7682 result["uri"] = uri; |
| 7683 } |
12346 return result; | 7684 return result; |
12347 } | 7685 } |
12348 | 7686 |
12349 @override | 7687 @override |
| 7688 Request toRequest(String id) { |
| 7689 return new Request(id, "execution.mapUri", toJson()); |
| 7690 } |
| 7691 |
| 7692 @override |
12350 String toString() => JSON.encode(toJson()); | 7693 String toString() => JSON.encode(toJson()); |
12351 | 7694 |
12352 @override | 7695 @override |
12353 bool operator ==(other) { | 7696 bool operator ==(other) { |
12354 if (other is ImplementedClass) { | 7697 if (other is ExecutionMapUriParams) { |
12355 return offset == other.offset && length == other.length; | 7698 return id == other.id && file == other.file && uri == other.uri; |
12356 } | 7699 } |
12357 return false; | 7700 return false; |
12358 } | 7701 } |
12359 | 7702 |
12360 @override | 7703 @override |
12361 int get hashCode { | 7704 int get hashCode { |
12362 int hash = 0; | 7705 int hash = 0; |
12363 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | 7706 hash = JenkinsSmiHash.combine(hash, id.hashCode); |
12364 hash = JenkinsSmiHash.combine(hash, length.hashCode); | 7707 hash = JenkinsSmiHash.combine(hash, file.hashCode); |
| 7708 hash = JenkinsSmiHash.combine(hash, uri.hashCode); |
12365 return JenkinsSmiHash.finish(hash); | 7709 return JenkinsSmiHash.finish(hash); |
12366 } | 7710 } |
12367 } | 7711 } |
12368 | 7712 |
12369 /** | 7713 /** |
12370 * ImplementedMember | 7714 * execution.mapUri result |
12371 * | 7715 * |
12372 * { | 7716 * { |
12373 * "offset": int | 7717 * "file": optional FilePath |
12374 * "length": int | 7718 * "uri": optional String |
12375 * } | 7719 * } |
12376 * | 7720 * |
12377 * Clients may not extend, implement or mix-in this class. | 7721 * Clients may not extend, implement or mix-in this class. |
12378 */ | 7722 */ |
12379 class ImplementedMember implements HasToJson { | 7723 class ExecutionMapUriResult implements ResponseResult { |
12380 int _offset; | 7724 String _file; |
12381 | 7725 |
12382 int _length; | 7726 String _uri; |
12383 | 7727 |
12384 /** | 7728 /** |
12385 * The offset of the name of the implemented member. | 7729 * The file to which the URI was mapped. This field is omitted if the uri |
| 7730 * field was not given in the request. |
12386 */ | 7731 */ |
12387 int get offset => _offset; | 7732 String get file => _file; |
12388 | 7733 |
12389 /** | 7734 /** |
12390 * The offset of the name of the implemented member. | 7735 * The file to which the URI was mapped. This field is omitted if the uri |
| 7736 * field was not given in the request. |
12391 */ | 7737 */ |
12392 void set offset(int value) { | 7738 void set file(String value) { |
12393 assert(value != null); | 7739 this._file = value; |
12394 this._offset = value; | |
12395 } | 7740 } |
12396 | 7741 |
12397 /** | 7742 /** |
12398 * The length of the name of the implemented member. | 7743 * The URI to which the file path was mapped. This field is omitted if the |
| 7744 * file field was not given in the request. |
12399 */ | 7745 */ |
12400 int get length => _length; | 7746 String get uri => _uri; |
12401 | 7747 |
12402 /** | 7748 /** |
12403 * The length of the name of the implemented member. | 7749 * The URI to which the file path was mapped. This field is omitted if the |
| 7750 * file field was not given in the request. |
12404 */ | 7751 */ |
12405 void set length(int value) { | 7752 void set uri(String value) { |
12406 assert(value != null); | 7753 this._uri = value; |
12407 this._length = value; | |
12408 } | 7754 } |
12409 | 7755 |
12410 ImplementedMember(int offset, int length) { | 7756 ExecutionMapUriResult({String file, String uri}) { |
12411 this.offset = offset; | 7757 this.file = file; |
12412 this.length = length; | 7758 this.uri = uri; |
12413 } | 7759 } |
12414 | 7760 |
12415 factory ImplementedMember.fromJson( | 7761 factory ExecutionMapUriResult.fromJson( |
12416 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 7762 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
12417 if (json == null) { | 7763 if (json == null) { |
12418 json = {}; | 7764 json = {}; |
12419 } | 7765 } |
12420 if (json is Map) { | 7766 if (json is Map) { |
12421 int offset; | 7767 String file; |
12422 if (json.containsKey("offset")) { | 7768 if (json.containsKey("file")) { |
12423 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | 7769 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); |
12424 } else { | |
12425 throw jsonDecoder.mismatch(jsonPath, "offset"); | |
12426 } | 7770 } |
12427 int length; | 7771 String uri; |
12428 if (json.containsKey("length")) { | 7772 if (json.containsKey("uri")) { |
12429 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | 7773 uri = jsonDecoder.decodeString(jsonPath + ".uri", json["uri"]); |
12430 } else { | |
12431 throw jsonDecoder.mismatch(jsonPath, "length"); | |
12432 } | 7774 } |
12433 return new ImplementedMember(offset, length); | 7775 return new ExecutionMapUriResult(file: file, uri: uri); |
12434 } else { | 7776 } else { |
12435 throw jsonDecoder.mismatch(jsonPath, "ImplementedMember", json); | 7777 throw jsonDecoder.mismatch(jsonPath, "execution.mapUri result", json); |
12436 } | 7778 } |
12437 } | 7779 } |
12438 | 7780 |
| 7781 factory ExecutionMapUriResult.fromResponse(Response response) { |
| 7782 return new ExecutionMapUriResult.fromJson( |
| 7783 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), |
| 7784 "result", |
| 7785 response.result); |
| 7786 } |
| 7787 |
12439 @override | 7788 @override |
12440 Map<String, dynamic> toJson() { | 7789 Map<String, dynamic> toJson() { |
12441 Map<String, dynamic> result = {}; | 7790 Map<String, dynamic> result = {}; |
12442 result["offset"] = offset; | 7791 if (file != null) { |
12443 result["length"] = length; | 7792 result["file"] = file; |
| 7793 } |
| 7794 if (uri != null) { |
| 7795 result["uri"] = uri; |
| 7796 } |
12444 return result; | 7797 return result; |
12445 } | 7798 } |
12446 | 7799 |
12447 @override | 7800 @override |
| 7801 Response toResponse(String id) { |
| 7802 return new Response(id, result: toJson()); |
| 7803 } |
| 7804 |
| 7805 @override |
12448 String toString() => JSON.encode(toJson()); | 7806 String toString() => JSON.encode(toJson()); |
12449 | 7807 |
12450 @override | 7808 @override |
12451 bool operator ==(other) { | 7809 bool operator ==(other) { |
12452 if (other is ImplementedMember) { | 7810 if (other is ExecutionMapUriResult) { |
12453 return offset == other.offset && length == other.length; | 7811 return file == other.file && uri == other.uri; |
12454 } | 7812 } |
12455 return false; | 7813 return false; |
12456 } | 7814 } |
12457 | 7815 |
12458 @override | 7816 @override |
12459 int get hashCode { | 7817 int get hashCode { |
12460 int hash = 0; | 7818 int hash = 0; |
12461 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | 7819 hash = JenkinsSmiHash.combine(hash, file.hashCode); |
12462 hash = JenkinsSmiHash.combine(hash, length.hashCode); | 7820 hash = JenkinsSmiHash.combine(hash, uri.hashCode); |
12463 return JenkinsSmiHash.finish(hash); | 7821 return JenkinsSmiHash.finish(hash); |
12464 } | 7822 } |
12465 } | 7823 } |
12466 | 7824 |
12467 /** | 7825 /** |
12468 * inlineLocalVariable feedback | 7826 * ExecutionService |
12469 * | 7827 * |
12470 * { | 7828 * enum { |
12471 * "name": String | 7829 * LAUNCH_DATA |
12472 * "occurrences": int | |
12473 * } | 7830 * } |
12474 * | 7831 * |
12475 * Clients may not extend, implement or mix-in this class. | 7832 * Clients may not extend, implement or mix-in this class. |
12476 */ | 7833 */ |
12477 class InlineLocalVariableFeedback extends RefactoringFeedback { | 7834 class ExecutionService implements Enum { |
12478 String _name; | 7835 static const ExecutionService LAUNCH_DATA = |
12479 | 7836 const ExecutionService._("LAUNCH_DATA"); |
12480 int _occurrences; | |
12481 | 7837 |
12482 /** | 7838 /** |
12483 * The name of the variable being inlined. | 7839 * A list containing all of the enum values that are defined. |
12484 */ | 7840 */ |
12485 String get name => _name; | 7841 static const List<ExecutionService> VALUES = const <ExecutionService>[ |
| 7842 LAUNCH_DATA |
| 7843 ]; |
| 7844 |
| 7845 @override |
| 7846 final String name; |
| 7847 |
| 7848 const ExecutionService._(this.name); |
| 7849 |
| 7850 factory ExecutionService(String name) { |
| 7851 switch (name) { |
| 7852 case "LAUNCH_DATA": |
| 7853 return LAUNCH_DATA; |
| 7854 } |
| 7855 throw new Exception('Illegal enum value: $name'); |
| 7856 } |
| 7857 |
| 7858 factory ExecutionService.fromJson( |
| 7859 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| 7860 if (json is String) { |
| 7861 try { |
| 7862 return new ExecutionService(json); |
| 7863 } catch (_) { |
| 7864 // Fall through |
| 7865 } |
| 7866 } |
| 7867 throw jsonDecoder.mismatch(jsonPath, "ExecutionService", json); |
| 7868 } |
| 7869 |
| 7870 @override |
| 7871 String toString() => "ExecutionService.$name"; |
| 7872 |
| 7873 String toJson() => name; |
| 7874 } |
| 7875 |
| 7876 /** |
| 7877 * execution.setSubscriptions params |
| 7878 * |
| 7879 * { |
| 7880 * "subscriptions": List<ExecutionService> |
| 7881 * } |
| 7882 * |
| 7883 * Clients may not extend, implement or mix-in this class. |
| 7884 */ |
| 7885 class ExecutionSetSubscriptionsParams implements RequestParams { |
| 7886 List<ExecutionService> _subscriptions; |
12486 | 7887 |
12487 /** | 7888 /** |
12488 * The name of the variable being inlined. | 7889 * A list of the services being subscribed to. |
12489 */ | 7890 */ |
12490 void set name(String value) { | 7891 List<ExecutionService> get subscriptions => _subscriptions; |
| 7892 |
| 7893 /** |
| 7894 * A list of the services being subscribed to. |
| 7895 */ |
| 7896 void set subscriptions(List<ExecutionService> value) { |
12491 assert(value != null); | 7897 assert(value != null); |
12492 this._name = value; | 7898 this._subscriptions = value; |
12493 } | 7899 } |
12494 | 7900 |
12495 /** | 7901 ExecutionSetSubscriptionsParams(List<ExecutionService> subscriptions) { |
12496 * The number of times the variable occurs. | 7902 this.subscriptions = subscriptions; |
12497 */ | |
12498 int get occurrences => _occurrences; | |
12499 | |
12500 /** | |
12501 * The number of times the variable occurs. | |
12502 */ | |
12503 void set occurrences(int value) { | |
12504 assert(value != null); | |
12505 this._occurrences = value; | |
12506 } | 7903 } |
12507 | 7904 |
12508 InlineLocalVariableFeedback(String name, int occurrences) { | 7905 factory ExecutionSetSubscriptionsParams.fromJson( |
12509 this.name = name; | |
12510 this.occurrences = occurrences; | |
12511 } | |
12512 | |
12513 factory InlineLocalVariableFeedback.fromJson( | |
12514 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 7906 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
12515 if (json == null) { | 7907 if (json == null) { |
12516 json = {}; | 7908 json = {}; |
12517 } | 7909 } |
12518 if (json is Map) { | 7910 if (json is Map) { |
12519 String name; | 7911 List<ExecutionService> subscriptions; |
12520 if (json.containsKey("name")) { | 7912 if (json.containsKey("subscriptions")) { |
12521 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]); | 7913 subscriptions = jsonDecoder.decodeList( |
| 7914 jsonPath + ".subscriptions", |
| 7915 json["subscriptions"], |
| 7916 (String jsonPath, Object json) => |
| 7917 new ExecutionService.fromJson(jsonDecoder, jsonPath, json)); |
12522 } else { | 7918 } else { |
12523 throw jsonDecoder.mismatch(jsonPath, "name"); | 7919 throw jsonDecoder.mismatch(jsonPath, "subscriptions"); |
12524 } | 7920 } |
12525 int occurrences; | 7921 return new ExecutionSetSubscriptionsParams(subscriptions); |
12526 if (json.containsKey("occurrences")) { | |
12527 occurrences = jsonDecoder.decodeInt( | |
12528 jsonPath + ".occurrences", json["occurrences"]); | |
12529 } else { | |
12530 throw jsonDecoder.mismatch(jsonPath, "occurrences"); | |
12531 } | |
12532 return new InlineLocalVariableFeedback(name, occurrences); | |
12533 } else { | 7922 } else { |
12534 throw jsonDecoder.mismatch( | 7923 throw jsonDecoder.mismatch( |
12535 jsonPath, "inlineLocalVariable feedback", json); | 7924 jsonPath, "execution.setSubscriptions params", json); |
12536 } | 7925 } |
12537 } | 7926 } |
12538 | 7927 |
| 7928 factory ExecutionSetSubscriptionsParams.fromRequest(Request request) { |
| 7929 return new ExecutionSetSubscriptionsParams.fromJson( |
| 7930 new RequestDecoder(request), "params", request.params); |
| 7931 } |
| 7932 |
12539 @override | 7933 @override |
12540 Map<String, dynamic> toJson() { | 7934 Map<String, dynamic> toJson() { |
12541 Map<String, dynamic> result = {}; | 7935 Map<String, dynamic> result = {}; |
12542 result["name"] = name; | 7936 result["subscriptions"] = |
12543 result["occurrences"] = occurrences; | 7937 subscriptions.map((ExecutionService value) => value.toJson()).toList(); |
12544 return result; | 7938 return result; |
12545 } | 7939 } |
12546 | 7940 |
12547 @override | 7941 @override |
| 7942 Request toRequest(String id) { |
| 7943 return new Request(id, "execution.setSubscriptions", toJson()); |
| 7944 } |
| 7945 |
| 7946 @override |
12548 String toString() => JSON.encode(toJson()); | 7947 String toString() => JSON.encode(toJson()); |
12549 | 7948 |
12550 @override | 7949 @override |
12551 bool operator ==(other) { | 7950 bool operator ==(other) { |
12552 if (other is InlineLocalVariableFeedback) { | 7951 if (other is ExecutionSetSubscriptionsParams) { |
12553 return name == other.name && occurrences == other.occurrences; | 7952 return listEqual(subscriptions, other.subscriptions, |
| 7953 (ExecutionService a, ExecutionService b) => a == b); |
12554 } | 7954 } |
12555 return false; | 7955 return false; |
12556 } | 7956 } |
12557 | 7957 |
12558 @override | 7958 @override |
12559 int get hashCode { | 7959 int get hashCode { |
12560 int hash = 0; | 7960 int hash = 0; |
12561 hash = JenkinsSmiHash.combine(hash, name.hashCode); | 7961 hash = JenkinsSmiHash.combine(hash, subscriptions.hashCode); |
12562 hash = JenkinsSmiHash.combine(hash, occurrences.hashCode); | |
12563 return JenkinsSmiHash.finish(hash); | 7962 return JenkinsSmiHash.finish(hash); |
12564 } | 7963 } |
12565 } | 7964 } |
12566 | 7965 |
12567 /** | 7966 /** |
12568 * inlineLocalVariable options | 7967 * execution.setSubscriptions result |
12569 * | 7968 * |
12570 * Clients may not extend, implement or mix-in this class. | 7969 * Clients may not extend, implement or mix-in this class. |
12571 */ | 7970 */ |
12572 class InlineLocalVariableOptions extends RefactoringOptions | 7971 class ExecutionSetSubscriptionsResult implements ResponseResult { |
12573 implements HasToJson { | 7972 @override |
| 7973 Map<String, dynamic> toJson() => <String, dynamic>{}; |
| 7974 |
| 7975 @override |
| 7976 Response toResponse(String id) { |
| 7977 return new Response(id, result: null); |
| 7978 } |
| 7979 |
12574 @override | 7980 @override |
12575 bool operator ==(other) { | 7981 bool operator ==(other) { |
12576 if (other is InlineLocalVariableOptions) { | 7982 if (other is ExecutionSetSubscriptionsResult) { |
12577 return true; | 7983 return true; |
12578 } | 7984 } |
12579 return false; | 7985 return false; |
12580 } | 7986 } |
12581 | 7987 |
12582 @override | 7988 @override |
12583 int get hashCode { | 7989 int get hashCode { |
12584 return 540364977; | 7990 return 287678780; |
12585 } | 7991 } |
12586 } | 7992 } |
12587 | 7993 |
12588 /** | 7994 /** |
12589 * inlineMethod feedback | 7995 * extractLocalVariable feedback |
12590 * | 7996 * |
12591 * { | 7997 * { |
12592 * "className": optional String | 7998 * "coveringExpressionOffsets": optional List<int> |
12593 * "methodName": String | 7999 * "coveringExpressionLengths": optional List<int> |
12594 * "isDeclaration": bool | 8000 * "names": List<String> |
| 8001 * "offsets": List<int> |
| 8002 * "lengths": List<int> |
12595 * } | 8003 * } |
12596 * | 8004 * |
12597 * Clients may not extend, implement or mix-in this class. | 8005 * Clients may not extend, implement or mix-in this class. |
12598 */ | 8006 */ |
12599 class InlineMethodFeedback extends RefactoringFeedback { | 8007 class ExtractLocalVariableFeedback extends RefactoringFeedback { |
12600 String _className; | 8008 List<int> _coveringExpressionOffsets; |
12601 | 8009 |
12602 String _methodName; | 8010 List<int> _coveringExpressionLengths; |
12603 | 8011 |
12604 bool _isDeclaration; | 8012 List<String> _names; |
| 8013 |
| 8014 List<int> _offsets; |
| 8015 |
| 8016 List<int> _lengths; |
12605 | 8017 |
12606 /** | 8018 /** |
12607 * The name of the class enclosing the method being inlined. If not a class | 8019 * The offsets of the expressions that cover the specified selection, from |
12608 * member is being inlined, this field will be absent. | 8020 * the down most to the up most. |
12609 */ | 8021 */ |
12610 String get className => _className; | 8022 List<int> get coveringExpressionOffsets => _coveringExpressionOffsets; |
12611 | 8023 |
12612 /** | 8024 /** |
12613 * The name of the class enclosing the method being inlined. If not a class | 8025 * The offsets of the expressions that cover the specified selection, from |
12614 * member is being inlined, this field will be absent. | 8026 * the down most to the up most. |
12615 */ | 8027 */ |
12616 void set className(String value) { | 8028 void set coveringExpressionOffsets(List<int> value) { |
12617 this._className = value; | 8029 this._coveringExpressionOffsets = value; |
12618 } | 8030 } |
12619 | 8031 |
12620 /** | 8032 /** |
12621 * The name of the method (or function) being inlined. | 8033 * The lengths of the expressions that cover the specified selection, from |
| 8034 * the down most to the up most. |
12622 */ | 8035 */ |
12623 String get methodName => _methodName; | 8036 List<int> get coveringExpressionLengths => _coveringExpressionLengths; |
12624 | 8037 |
12625 /** | 8038 /** |
12626 * The name of the method (or function) being inlined. | 8039 * The lengths of the expressions that cover the specified selection, from |
| 8040 * the down most to the up most. |
12627 */ | 8041 */ |
12628 void set methodName(String value) { | 8042 void set coveringExpressionLengths(List<int> value) { |
12629 assert(value != null); | 8043 this._coveringExpressionLengths = value; |
12630 this._methodName = value; | |
12631 } | 8044 } |
12632 | 8045 |
12633 /** | 8046 /** |
12634 * True if the declaration of the method is selected. So all references | 8047 * The proposed names for the local variable. |
12635 * should be inlined. | |
12636 */ | 8048 */ |
12637 bool get isDeclaration => _isDeclaration; | 8049 List<String> get names => _names; |
12638 | 8050 |
12639 /** | 8051 /** |
12640 * True if the declaration of the method is selected. So all references | 8052 * The proposed names for the local variable. |
12641 * should be inlined. | |
12642 */ | 8053 */ |
12643 void set isDeclaration(bool value) { | 8054 void set names(List<String> value) { |
12644 assert(value != null); | 8055 assert(value != null); |
12645 this._isDeclaration = value; | 8056 this._names = value; |
12646 } | 8057 } |
12647 | 8058 |
12648 InlineMethodFeedback(String methodName, bool isDeclaration, | 8059 /** |
12649 {String className}) { | 8060 * The offsets of the expressions that would be replaced by a reference to |
12650 this.className = className; | 8061 * the variable. |
12651 this.methodName = methodName; | 8062 */ |
12652 this.isDeclaration = isDeclaration; | 8063 List<int> get offsets => _offsets; |
| 8064 |
| 8065 /** |
| 8066 * The offsets of the expressions that would be replaced by a reference to |
| 8067 * the variable. |
| 8068 */ |
| 8069 void set offsets(List<int> value) { |
| 8070 assert(value != null); |
| 8071 this._offsets = value; |
12653 } | 8072 } |
12654 | 8073 |
12655 factory InlineMethodFeedback.fromJson( | 8074 /** |
| 8075 * The lengths of the expressions that would be replaced by a reference to |
| 8076 * the variable. The lengths correspond to the offsets. In other words, for a |
| 8077 * given expression, if the offset of that expression is offsets[i], then the |
| 8078 * length of that expression is lengths[i]. |
| 8079 */ |
| 8080 List<int> get lengths => _lengths; |
| 8081 |
| 8082 /** |
| 8083 * The lengths of the expressions that would be replaced by a reference to |
| 8084 * the variable. The lengths correspond to the offsets. In other words, for a |
| 8085 * given expression, if the offset of that expression is offsets[i], then the |
| 8086 * length of that expression is lengths[i]. |
| 8087 */ |
| 8088 void set lengths(List<int> value) { |
| 8089 assert(value != null); |
| 8090 this._lengths = value; |
| 8091 } |
| 8092 |
| 8093 ExtractLocalVariableFeedback( |
| 8094 List<String> names, List<int> offsets, List<int> lengths, |
| 8095 {List<int> coveringExpressionOffsets, |
| 8096 List<int> coveringExpressionLengths}) { |
| 8097 this.coveringExpressionOffsets = coveringExpressionOffsets; |
| 8098 this.coveringExpressionLengths = coveringExpressionLengths; |
| 8099 this.names = names; |
| 8100 this.offsets = offsets; |
| 8101 this.lengths = lengths; |
| 8102 } |
| 8103 |
| 8104 factory ExtractLocalVariableFeedback.fromJson( |
12656 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 8105 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
12657 if (json == null) { | 8106 if (json == null) { |
12658 json = {}; | 8107 json = {}; |
12659 } | 8108 } |
12660 if (json is Map) { | 8109 if (json is Map) { |
12661 String className; | 8110 List<int> coveringExpressionOffsets; |
12662 if (json.containsKey("className")) { | 8111 if (json.containsKey("coveringExpressionOffsets")) { |
12663 className = jsonDecoder.decodeString( | 8112 coveringExpressionOffsets = jsonDecoder.decodeList( |
12664 jsonPath + ".className", json["className"]); | 8113 jsonPath + ".coveringExpressionOffsets", |
| 8114 json["coveringExpressionOffsets"], |
| 8115 jsonDecoder.decodeInt); |
12665 } | 8116 } |
12666 String methodName; | 8117 List<int> coveringExpressionLengths; |
12667 if (json.containsKey("methodName")) { | 8118 if (json.containsKey("coveringExpressionLengths")) { |
12668 methodName = jsonDecoder.decodeString( | 8119 coveringExpressionLengths = jsonDecoder.decodeList( |
12669 jsonPath + ".methodName", json["methodName"]); | 8120 jsonPath + ".coveringExpressionLengths", |
| 8121 json["coveringExpressionLengths"], |
| 8122 jsonDecoder.decodeInt); |
| 8123 } |
| 8124 List<String> names; |
| 8125 if (json.containsKey("names")) { |
| 8126 names = jsonDecoder.decodeList( |
| 8127 jsonPath + ".names", json["names"], jsonDecoder.decodeString); |
12670 } else { | 8128 } else { |
12671 throw jsonDecoder.mismatch(jsonPath, "methodName"); | 8129 throw jsonDecoder.mismatch(jsonPath, "names"); |
12672 } | 8130 } |
12673 bool isDeclaration; | 8131 List<int> offsets; |
12674 if (json.containsKey("isDeclaration")) { | 8132 if (json.containsKey("offsets")) { |
12675 isDeclaration = jsonDecoder.decodeBool( | 8133 offsets = jsonDecoder.decodeList( |
12676 jsonPath + ".isDeclaration", json["isDeclaration"]); | 8134 jsonPath + ".offsets", json["offsets"], jsonDecoder.decodeInt); |
12677 } else { | 8135 } else { |
12678 throw jsonDecoder.mismatch(jsonPath, "isDeclaration"); | 8136 throw jsonDecoder.mismatch(jsonPath, "offsets"); |
12679 } | 8137 } |
12680 return new InlineMethodFeedback(methodName, isDeclaration, | 8138 List<int> lengths; |
12681 className: className); | 8139 if (json.containsKey("lengths")) { |
| 8140 lengths = jsonDecoder.decodeList( |
| 8141 jsonPath + ".lengths", json["lengths"], jsonDecoder.decodeInt); |
| 8142 } else { |
| 8143 throw jsonDecoder.mismatch(jsonPath, "lengths"); |
| 8144 } |
| 8145 return new ExtractLocalVariableFeedback(names, offsets, lengths, |
| 8146 coveringExpressionOffsets: coveringExpressionOffsets, |
| 8147 coveringExpressionLengths: coveringExpressionLengths); |
12682 } else { | 8148 } else { |
12683 throw jsonDecoder.mismatch(jsonPath, "inlineMethod feedback", json); | 8149 throw jsonDecoder.mismatch( |
| 8150 jsonPath, "extractLocalVariable feedback", json); |
12684 } | 8151 } |
12685 } | 8152 } |
12686 | 8153 |
12687 @override | 8154 @override |
12688 Map<String, dynamic> toJson() { | 8155 Map<String, dynamic> toJson() { |
12689 Map<String, dynamic> result = {}; | 8156 Map<String, dynamic> result = {}; |
12690 if (className != null) { | 8157 if (coveringExpressionOffsets != null) { |
12691 result["className"] = className; | 8158 result["coveringExpressionOffsets"] = coveringExpressionOffsets; |
12692 } | 8159 } |
12693 result["methodName"] = methodName; | 8160 if (coveringExpressionLengths != null) { |
12694 result["isDeclaration"] = isDeclaration; | 8161 result["coveringExpressionLengths"] = coveringExpressionLengths; |
| 8162 } |
| 8163 result["names"] = names; |
| 8164 result["offsets"] = offsets; |
| 8165 result["lengths"] = lengths; |
12695 return result; | 8166 return result; |
12696 } | 8167 } |
12697 | 8168 |
12698 @override | 8169 @override |
12699 String toString() => JSON.encode(toJson()); | 8170 String toString() => JSON.encode(toJson()); |
12700 | 8171 |
12701 @override | 8172 @override |
12702 bool operator ==(other) { | 8173 bool operator ==(other) { |
12703 if (other is InlineMethodFeedback) { | 8174 if (other is ExtractLocalVariableFeedback) { |
12704 return className == other.className && | 8175 return listEqual(coveringExpressionOffsets, |
12705 methodName == other.methodName && | 8176 other.coveringExpressionOffsets, (int a, int b) => a == b) && |
12706 isDeclaration == other.isDeclaration; | 8177 listEqual(coveringExpressionLengths, other.coveringExpressionLengths, |
| 8178 (int a, int b) => a == b) && |
| 8179 listEqual(names, other.names, (String a, String b) => a == b) && |
| 8180 listEqual(offsets, other.offsets, (int a, int b) => a == b) && |
| 8181 listEqual(lengths, other.lengths, (int a, int b) => a == b); |
12707 } | 8182 } |
12708 return false; | 8183 return false; |
12709 } | 8184 } |
12710 | 8185 |
12711 @override | 8186 @override |
12712 int get hashCode { | 8187 int get hashCode { |
12713 int hash = 0; | 8188 int hash = 0; |
12714 hash = JenkinsSmiHash.combine(hash, className.hashCode); | 8189 hash = JenkinsSmiHash.combine(hash, coveringExpressionOffsets.hashCode); |
12715 hash = JenkinsSmiHash.combine(hash, methodName.hashCode); | 8190 hash = JenkinsSmiHash.combine(hash, coveringExpressionLengths.hashCode); |
12716 hash = JenkinsSmiHash.combine(hash, isDeclaration.hashCode); | 8191 hash = JenkinsSmiHash.combine(hash, names.hashCode); |
| 8192 hash = JenkinsSmiHash.combine(hash, offsets.hashCode); |
| 8193 hash = JenkinsSmiHash.combine(hash, lengths.hashCode); |
12717 return JenkinsSmiHash.finish(hash); | 8194 return JenkinsSmiHash.finish(hash); |
12718 } | 8195 } |
12719 } | 8196 } |
12720 | 8197 |
12721 /** | 8198 /** |
12722 * inlineMethod options | 8199 * extractLocalVariable options |
12723 * | 8200 * |
12724 * { | 8201 * { |
12725 * "deleteSource": bool | 8202 * "name": String |
12726 * "inlineAll": bool | 8203 * "extractAll": bool |
12727 * } | 8204 * } |
12728 * | 8205 * |
12729 * Clients may not extend, implement or mix-in this class. | 8206 * Clients may not extend, implement or mix-in this class. |
12730 */ | 8207 */ |
12731 class InlineMethodOptions extends RefactoringOptions { | 8208 class ExtractLocalVariableOptions extends RefactoringOptions { |
12732 bool _deleteSource; | 8209 String _name; |
12733 | 8210 |
12734 bool _inlineAll; | 8211 bool _extractAll; |
12735 | 8212 |
12736 /** | 8213 /** |
12737 * True if the method being inlined should be removed. It is an error if this | 8214 * The name that the local variable should be given. |
12738 * field is true and inlineAll is false. | |
12739 */ | 8215 */ |
12740 bool get deleteSource => _deleteSource; | 8216 String get name => _name; |
12741 | 8217 |
12742 /** | 8218 /** |
12743 * True if the method being inlined should be removed. It is an error if this | 8219 * The name that the local variable should be given. |
12744 * field is true and inlineAll is false. | |
12745 */ | 8220 */ |
12746 void set deleteSource(bool value) { | 8221 void set name(String value) { |
12747 assert(value != null); | 8222 assert(value != null); |
12748 this._deleteSource = value; | 8223 this._name = value; |
12749 } | 8224 } |
12750 | 8225 |
12751 /** | 8226 /** |
12752 * True if all invocations of the method should be inlined, or false if only | 8227 * True if all occurrences of the expression within the scope in which the |
12753 * the invocation site used to create this refactoring should be inlined. | 8228 * variable will be defined should be replaced by a reference to the local |
| 8229 * variable. The expression used to initiate the refactoring will always be |
| 8230 * replaced. |
12754 */ | 8231 */ |
12755 bool get inlineAll => _inlineAll; | 8232 bool get extractAll => _extractAll; |
12756 | 8233 |
12757 /** | 8234 /** |
12758 * True if all invocations of the method should be inlined, or false if only | 8235 * True if all occurrences of the expression within the scope in which the |
12759 * the invocation site used to create this refactoring should be inlined. | 8236 * variable will be defined should be replaced by a reference to the local |
| 8237 * variable. The expression used to initiate the refactoring will always be |
| 8238 * replaced. |
12760 */ | 8239 */ |
12761 void set inlineAll(bool value) { | 8240 void set extractAll(bool value) { |
12762 assert(value != null); | 8241 assert(value != null); |
12763 this._inlineAll = value; | 8242 this._extractAll = value; |
12764 } | 8243 } |
12765 | 8244 |
12766 InlineMethodOptions(bool deleteSource, bool inlineAll) { | 8245 ExtractLocalVariableOptions(String name, bool extractAll) { |
12767 this.deleteSource = deleteSource; | 8246 this.name = name; |
12768 this.inlineAll = inlineAll; | 8247 this.extractAll = extractAll; |
12769 } | 8248 } |
12770 | 8249 |
12771 factory InlineMethodOptions.fromJson( | 8250 factory ExtractLocalVariableOptions.fromJson( |
12772 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 8251 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
12773 if (json == null) { | 8252 if (json == null) { |
12774 json = {}; | 8253 json = {}; |
12775 } | 8254 } |
12776 if (json is Map) { | 8255 if (json is Map) { |
12777 bool deleteSource; | 8256 String name; |
12778 if (json.containsKey("deleteSource")) { | 8257 if (json.containsKey("name")) { |
12779 deleteSource = jsonDecoder.decodeBool( | 8258 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]); |
12780 jsonPath + ".deleteSource", json["deleteSource"]); | |
12781 } else { | 8259 } else { |
12782 throw jsonDecoder.mismatch(jsonPath, "deleteSource"); | 8260 throw jsonDecoder.mismatch(jsonPath, "name"); |
12783 } | 8261 } |
12784 bool inlineAll; | 8262 bool extractAll; |
12785 if (json.containsKey("inlineAll")) { | 8263 if (json.containsKey("extractAll")) { |
12786 inlineAll = | 8264 extractAll = jsonDecoder.decodeBool( |
12787 jsonDecoder.decodeBool(jsonPath + ".inlineAll", json["inlineAll"]); | 8265 jsonPath + ".extractAll", json["extractAll"]); |
12788 } else { | 8266 } else { |
12789 throw jsonDecoder.mismatch(jsonPath, "inlineAll"); | 8267 throw jsonDecoder.mismatch(jsonPath, "extractAll"); |
12790 } | 8268 } |
12791 return new InlineMethodOptions(deleteSource, inlineAll); | 8269 return new ExtractLocalVariableOptions(name, extractAll); |
12792 } else { | 8270 } else { |
12793 throw jsonDecoder.mismatch(jsonPath, "inlineMethod options", json); | 8271 throw jsonDecoder.mismatch( |
| 8272 jsonPath, "extractLocalVariable options", json); |
12794 } | 8273 } |
12795 } | 8274 } |
12796 | 8275 |
12797 factory InlineMethodOptions.fromRefactoringParams( | 8276 factory ExtractLocalVariableOptions.fromRefactoringParams( |
12798 EditGetRefactoringParams refactoringParams, Request request) { | 8277 EditGetRefactoringParams refactoringParams, Request request) { |
12799 return new InlineMethodOptions.fromJson( | 8278 return new ExtractLocalVariableOptions.fromJson( |
12800 new RequestDecoder(request), "options", refactoringParams.options); | 8279 new RequestDecoder(request), "options", refactoringParams.options); |
12801 } | 8280 } |
12802 | 8281 |
12803 @override | 8282 @override |
12804 Map<String, dynamic> toJson() { | 8283 Map<String, dynamic> toJson() { |
12805 Map<String, dynamic> result = {}; | 8284 Map<String, dynamic> result = {}; |
12806 result["deleteSource"] = deleteSource; | 8285 result["name"] = name; |
12807 result["inlineAll"] = inlineAll; | 8286 result["extractAll"] = extractAll; |
12808 return result; | 8287 return result; |
12809 } | 8288 } |
12810 | 8289 |
12811 @override | 8290 @override |
12812 String toString() => JSON.encode(toJson()); | 8291 String toString() => JSON.encode(toJson()); |
12813 | 8292 |
12814 @override | 8293 @override |
12815 bool operator ==(other) { | 8294 bool operator ==(other) { |
12816 if (other is InlineMethodOptions) { | 8295 if (other is ExtractLocalVariableOptions) { |
12817 return deleteSource == other.deleteSource && inlineAll == other.inlineAll; | 8296 return name == other.name && extractAll == other.extractAll; |
12818 } | 8297 } |
12819 return false; | 8298 return false; |
12820 } | 8299 } |
12821 | 8300 |
12822 @override | 8301 @override |
12823 int get hashCode { | 8302 int get hashCode { |
12824 int hash = 0; | 8303 int hash = 0; |
12825 hash = JenkinsSmiHash.combine(hash, deleteSource.hashCode); | 8304 hash = JenkinsSmiHash.combine(hash, name.hashCode); |
12826 hash = JenkinsSmiHash.combine(hash, inlineAll.hashCode); | 8305 hash = JenkinsSmiHash.combine(hash, extractAll.hashCode); |
12827 return JenkinsSmiHash.finish(hash); | 8306 return JenkinsSmiHash.finish(hash); |
12828 } | 8307 } |
12829 } | 8308 } |
12830 | 8309 |
12831 /** | 8310 /** |
12832 * LinkedEditGroup | 8311 * extractMethod feedback |
12833 * | 8312 * |
12834 * { | 8313 * { |
12835 * "positions": List<Position> | 8314 * "offset": int |
12836 * "length": int | 8315 * "length": int |
12837 * "suggestions": List<LinkedEditSuggestion> | 8316 * "returnType": String |
| 8317 * "names": List<String> |
| 8318 * "canCreateGetter": bool |
| 8319 * "parameters": List<RefactoringMethodParameter> |
| 8320 * "offsets": List<int> |
| 8321 * "lengths": List<int> |
12838 * } | 8322 * } |
12839 * | 8323 * |
12840 * Clients may not extend, implement or mix-in this class. | 8324 * Clients may not extend, implement or mix-in this class. |
12841 */ | 8325 */ |
12842 class LinkedEditGroup implements HasToJson { | 8326 class ExtractMethodFeedback extends RefactoringFeedback { |
12843 List<Position> _positions; | 8327 int _offset; |
12844 | 8328 |
12845 int _length; | 8329 int _length; |
12846 | 8330 |
12847 List<LinkedEditSuggestion> _suggestions; | 8331 String _returnType; |
| 8332 |
| 8333 List<String> _names; |
| 8334 |
| 8335 bool _canCreateGetter; |
| 8336 |
| 8337 List<RefactoringMethodParameter> _parameters; |
| 8338 |
| 8339 List<int> _offsets; |
| 8340 |
| 8341 List<int> _lengths; |
12848 | 8342 |
12849 /** | 8343 /** |
12850 * The positions of the regions that should be edited simultaneously. | 8344 * The offset to the beginning of the expression or statements that will be |
| 8345 * extracted. |
12851 */ | 8346 */ |
12852 List<Position> get positions => _positions; | 8347 int get offset => _offset; |
12853 | 8348 |
12854 /** | 8349 /** |
12855 * The positions of the regions that should be edited simultaneously. | 8350 * The offset to the beginning of the expression or statements that will be |
| 8351 * extracted. |
12856 */ | 8352 */ |
12857 void set positions(List<Position> value) { | 8353 void set offset(int value) { |
12858 assert(value != null); | 8354 assert(value != null); |
12859 this._positions = value; | 8355 this._offset = value; |
12860 } | 8356 } |
12861 | 8357 |
12862 /** | 8358 /** |
12863 * The length of the regions that should be edited simultaneously. | 8359 * The length of the expression or statements that will be extracted. |
12864 */ | 8360 */ |
12865 int get length => _length; | 8361 int get length => _length; |
12866 | 8362 |
12867 /** | 8363 /** |
12868 * The length of the regions that should be edited simultaneously. | 8364 * The length of the expression or statements that will be extracted. |
12869 */ | 8365 */ |
12870 void set length(int value) { | 8366 void set length(int value) { |
12871 assert(value != null); | 8367 assert(value != null); |
12872 this._length = value; | 8368 this._length = value; |
12873 } | 8369 } |
12874 | 8370 |
12875 /** | 8371 /** |
12876 * Pre-computed suggestions for what every region might want to be changed | 8372 * The proposed return type for the method. If the returned element does not |
12877 * to. | 8373 * have a declared return type, this field will contain an empty string. |
12878 */ | 8374 */ |
12879 List<LinkedEditSuggestion> get suggestions => _suggestions; | 8375 String get returnType => _returnType; |
12880 | 8376 |
12881 /** | 8377 /** |
12882 * Pre-computed suggestions for what every region might want to be changed | 8378 * The proposed return type for the method. If the returned element does not |
12883 * to. | 8379 * have a declared return type, this field will contain an empty string. |
12884 */ | 8380 */ |
12885 void set suggestions(List<LinkedEditSuggestion> value) { | 8381 void set returnType(String value) { |
12886 assert(value != null); | 8382 assert(value != null); |
12887 this._suggestions = value; | 8383 this._returnType = value; |
12888 } | 8384 } |
12889 | 8385 |
12890 LinkedEditGroup(List<Position> positions, int length, | 8386 /** |
12891 List<LinkedEditSuggestion> suggestions) { | 8387 * The proposed names for the method. |
12892 this.positions = positions; | 8388 */ |
12893 this.length = length; | 8389 List<String> get names => _names; |
12894 this.suggestions = suggestions; | 8390 |
| 8391 /** |
| 8392 * The proposed names for the method. |
| 8393 */ |
| 8394 void set names(List<String> value) { |
| 8395 assert(value != null); |
| 8396 this._names = value; |
12895 } | 8397 } |
12896 | 8398 |
12897 factory LinkedEditGroup.fromJson( | 8399 /** |
| 8400 * True if a getter could be created rather than a method. |
| 8401 */ |
| 8402 bool get canCreateGetter => _canCreateGetter; |
| 8403 |
| 8404 /** |
| 8405 * True if a getter could be created rather than a method. |
| 8406 */ |
| 8407 void set canCreateGetter(bool value) { |
| 8408 assert(value != null); |
| 8409 this._canCreateGetter = value; |
| 8410 } |
| 8411 |
| 8412 /** |
| 8413 * The proposed parameters for the method. |
| 8414 */ |
| 8415 List<RefactoringMethodParameter> get parameters => _parameters; |
| 8416 |
| 8417 /** |
| 8418 * The proposed parameters for the method. |
| 8419 */ |
| 8420 void set parameters(List<RefactoringMethodParameter> value) { |
| 8421 assert(value != null); |
| 8422 this._parameters = value; |
| 8423 } |
| 8424 |
| 8425 /** |
| 8426 * The offsets of the expressions or statements that would be replaced by an |
| 8427 * invocation of the method. |
| 8428 */ |
| 8429 List<int> get offsets => _offsets; |
| 8430 |
| 8431 /** |
| 8432 * The offsets of the expressions or statements that would be replaced by an |
| 8433 * invocation of the method. |
| 8434 */ |
| 8435 void set offsets(List<int> value) { |
| 8436 assert(value != null); |
| 8437 this._offsets = value; |
| 8438 } |
| 8439 |
| 8440 /** |
| 8441 * The lengths of the expressions or statements that would be replaced by an |
| 8442 * invocation of the method. The lengths correspond to the offsets. In other |
| 8443 * words, for a given expression (or block of statements), if the offset of |
| 8444 * that expression is offsets[i], then the length of that expression is |
| 8445 * lengths[i]. |
| 8446 */ |
| 8447 List<int> get lengths => _lengths; |
| 8448 |
| 8449 /** |
| 8450 * The lengths of the expressions or statements that would be replaced by an |
| 8451 * invocation of the method. The lengths correspond to the offsets. In other |
| 8452 * words, for a given expression (or block of statements), if the offset of |
| 8453 * that expression is offsets[i], then the length of that expression is |
| 8454 * lengths[i]. |
| 8455 */ |
| 8456 void set lengths(List<int> value) { |
| 8457 assert(value != null); |
| 8458 this._lengths = value; |
| 8459 } |
| 8460 |
| 8461 ExtractMethodFeedback( |
| 8462 int offset, |
| 8463 int length, |
| 8464 String returnType, |
| 8465 List<String> names, |
| 8466 bool canCreateGetter, |
| 8467 List<RefactoringMethodParameter> parameters, |
| 8468 List<int> offsets, |
| 8469 List<int> lengths) { |
| 8470 this.offset = offset; |
| 8471 this.length = length; |
| 8472 this.returnType = returnType; |
| 8473 this.names = names; |
| 8474 this.canCreateGetter = canCreateGetter; |
| 8475 this.parameters = parameters; |
| 8476 this.offsets = offsets; |
| 8477 this.lengths = lengths; |
| 8478 } |
| 8479 |
| 8480 factory ExtractMethodFeedback.fromJson( |
12898 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 8481 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
12899 if (json == null) { | 8482 if (json == null) { |
12900 json = {}; | 8483 json = {}; |
12901 } | 8484 } |
12902 if (json is Map) { | 8485 if (json is Map) { |
12903 List<Position> positions; | 8486 int offset; |
12904 if (json.containsKey("positions")) { | 8487 if (json.containsKey("offset")) { |
12905 positions = jsonDecoder.decodeList( | 8488 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); |
12906 jsonPath + ".positions", | |
12907 json["positions"], | |
12908 (String jsonPath, Object json) => | |
12909 new Position.fromJson(jsonDecoder, jsonPath, json)); | |
12910 } else { | 8489 } else { |
12911 throw jsonDecoder.mismatch(jsonPath, "positions"); | 8490 throw jsonDecoder.mismatch(jsonPath, "offset"); |
12912 } | 8491 } |
12913 int length; | 8492 int length; |
12914 if (json.containsKey("length")) { | 8493 if (json.containsKey("length")) { |
12915 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | 8494 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); |
12916 } else { | 8495 } else { |
12917 throw jsonDecoder.mismatch(jsonPath, "length"); | 8496 throw jsonDecoder.mismatch(jsonPath, "length"); |
12918 } | 8497 } |
12919 List<LinkedEditSuggestion> suggestions; | 8498 String returnType; |
12920 if (json.containsKey("suggestions")) { | 8499 if (json.containsKey("returnType")) { |
12921 suggestions = jsonDecoder.decodeList( | 8500 returnType = jsonDecoder.decodeString( |
12922 jsonPath + ".suggestions", | 8501 jsonPath + ".returnType", json["returnType"]); |
12923 json["suggestions"], | 8502 } else { |
| 8503 throw jsonDecoder.mismatch(jsonPath, "returnType"); |
| 8504 } |
| 8505 List<String> names; |
| 8506 if (json.containsKey("names")) { |
| 8507 names = jsonDecoder.decodeList( |
| 8508 jsonPath + ".names", json["names"], jsonDecoder.decodeString); |
| 8509 } else { |
| 8510 throw jsonDecoder.mismatch(jsonPath, "names"); |
| 8511 } |
| 8512 bool canCreateGetter; |
| 8513 if (json.containsKey("canCreateGetter")) { |
| 8514 canCreateGetter = jsonDecoder.decodeBool( |
| 8515 jsonPath + ".canCreateGetter", json["canCreateGetter"]); |
| 8516 } else { |
| 8517 throw jsonDecoder.mismatch(jsonPath, "canCreateGetter"); |
| 8518 } |
| 8519 List<RefactoringMethodParameter> parameters; |
| 8520 if (json.containsKey("parameters")) { |
| 8521 parameters = jsonDecoder.decodeList( |
| 8522 jsonPath + ".parameters", |
| 8523 json["parameters"], |
12924 (String jsonPath, Object json) => | 8524 (String jsonPath, Object json) => |
12925 new LinkedEditSuggestion.fromJson(jsonDecoder, jsonPath, json)); | 8525 new RefactoringMethodParameter.fromJson( |
| 8526 jsonDecoder, jsonPath, json)); |
12926 } else { | 8527 } else { |
12927 throw jsonDecoder.mismatch(jsonPath, "suggestions"); | 8528 throw jsonDecoder.mismatch(jsonPath, "parameters"); |
12928 } | 8529 } |
12929 return new LinkedEditGroup(positions, length, suggestions); | 8530 List<int> offsets; |
| 8531 if (json.containsKey("offsets")) { |
| 8532 offsets = jsonDecoder.decodeList( |
| 8533 jsonPath + ".offsets", json["offsets"], jsonDecoder.decodeInt); |
| 8534 } else { |
| 8535 throw jsonDecoder.mismatch(jsonPath, "offsets"); |
| 8536 } |
| 8537 List<int> lengths; |
| 8538 if (json.containsKey("lengths")) { |
| 8539 lengths = jsonDecoder.decodeList( |
| 8540 jsonPath + ".lengths", json["lengths"], jsonDecoder.decodeInt); |
| 8541 } else { |
| 8542 throw jsonDecoder.mismatch(jsonPath, "lengths"); |
| 8543 } |
| 8544 return new ExtractMethodFeedback(offset, length, returnType, names, |
| 8545 canCreateGetter, parameters, offsets, lengths); |
12930 } else { | 8546 } else { |
12931 throw jsonDecoder.mismatch(jsonPath, "LinkedEditGroup", json); | 8547 throw jsonDecoder.mismatch(jsonPath, "extractMethod feedback", json); |
12932 } | |
12933 } | |
12934 | |
12935 /** | |
12936 * Construct an empty LinkedEditGroup. | |
12937 */ | |
12938 LinkedEditGroup.empty() : this(<Position>[], 0, <LinkedEditSuggestion>[]); | |
12939 | |
12940 @override | |
12941 Map<String, dynamic> toJson() { | |
12942 Map<String, dynamic> result = {}; | |
12943 result["positions"] = | |
12944 positions.map((Position value) => value.toJson()).toList(); | |
12945 result["length"] = length; | |
12946 result["suggestions"] = suggestions | |
12947 .map((LinkedEditSuggestion value) => value.toJson()) | |
12948 .toList(); | |
12949 return result; | |
12950 } | |
12951 | |
12952 /** | |
12953 * Add a new position and change the length. | |
12954 */ | |
12955 void addPosition(Position position, int length) { | |
12956 positions.add(position); | |
12957 this.length = length; | |
12958 } | |
12959 | |
12960 /** | |
12961 * Add a new suggestion. | |
12962 */ | |
12963 void addSuggestion(LinkedEditSuggestion suggestion) { | |
12964 suggestions.add(suggestion); | |
12965 } | |
12966 | |
12967 @override | |
12968 String toString() => JSON.encode(toJson()); | |
12969 | |
12970 @override | |
12971 bool operator ==(other) { | |
12972 if (other is LinkedEditGroup) { | |
12973 return listEqual( | |
12974 positions, other.positions, (Position a, Position b) => a == b) && | |
12975 length == other.length && | |
12976 listEqual(suggestions, other.suggestions, | |
12977 (LinkedEditSuggestion a, LinkedEditSuggestion b) => a == b); | |
12978 } | |
12979 return false; | |
12980 } | |
12981 | |
12982 @override | |
12983 int get hashCode { | |
12984 int hash = 0; | |
12985 hash = JenkinsSmiHash.combine(hash, positions.hashCode); | |
12986 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
12987 hash = JenkinsSmiHash.combine(hash, suggestions.hashCode); | |
12988 return JenkinsSmiHash.finish(hash); | |
12989 } | |
12990 } | |
12991 | |
12992 /** | |
12993 * LinkedEditSuggestion | |
12994 * | |
12995 * { | |
12996 * "value": String | |
12997 * "kind": LinkedEditSuggestionKind | |
12998 * } | |
12999 * | |
13000 * Clients may not extend, implement or mix-in this class. | |
13001 */ | |
13002 class LinkedEditSuggestion implements HasToJson { | |
13003 String _value; | |
13004 | |
13005 LinkedEditSuggestionKind _kind; | |
13006 | |
13007 /** | |
13008 * The value that could be used to replace all of the linked edit regions. | |
13009 */ | |
13010 String get value => _value; | |
13011 | |
13012 /** | |
13013 * The value that could be used to replace all of the linked edit regions. | |
13014 */ | |
13015 void set value(String value) { | |
13016 assert(value != null); | |
13017 this._value = value; | |
13018 } | |
13019 | |
13020 /** | |
13021 * The kind of value being proposed. | |
13022 */ | |
13023 LinkedEditSuggestionKind get kind => _kind; | |
13024 | |
13025 /** | |
13026 * The kind of value being proposed. | |
13027 */ | |
13028 void set kind(LinkedEditSuggestionKind value) { | |
13029 assert(value != null); | |
13030 this._kind = value; | |
13031 } | |
13032 | |
13033 LinkedEditSuggestion(String value, LinkedEditSuggestionKind kind) { | |
13034 this.value = value; | |
13035 this.kind = kind; | |
13036 } | |
13037 | |
13038 factory LinkedEditSuggestion.fromJson( | |
13039 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
13040 if (json == null) { | |
13041 json = {}; | |
13042 } | |
13043 if (json is Map) { | |
13044 String value; | |
13045 if (json.containsKey("value")) { | |
13046 value = jsonDecoder.decodeString(jsonPath + ".value", json["value"]); | |
13047 } else { | |
13048 throw jsonDecoder.mismatch(jsonPath, "value"); | |
13049 } | |
13050 LinkedEditSuggestionKind kind; | |
13051 if (json.containsKey("kind")) { | |
13052 kind = new LinkedEditSuggestionKind.fromJson( | |
13053 jsonDecoder, jsonPath + ".kind", json["kind"]); | |
13054 } else { | |
13055 throw jsonDecoder.mismatch(jsonPath, "kind"); | |
13056 } | |
13057 return new LinkedEditSuggestion(value, kind); | |
13058 } else { | |
13059 throw jsonDecoder.mismatch(jsonPath, "LinkedEditSuggestion", json); | |
13060 } | 8548 } |
13061 } | 8549 } |
13062 | 8550 |
13063 @override | 8551 @override |
13064 Map<String, dynamic> toJson() { | 8552 Map<String, dynamic> toJson() { |
13065 Map<String, dynamic> result = {}; | 8553 Map<String, dynamic> result = {}; |
13066 result["value"] = value; | 8554 result["offset"] = offset; |
13067 result["kind"] = kind.toJson(); | 8555 result["length"] = length; |
| 8556 result["returnType"] = returnType; |
| 8557 result["names"] = names; |
| 8558 result["canCreateGetter"] = canCreateGetter; |
| 8559 result["parameters"] = parameters |
| 8560 .map((RefactoringMethodParameter value) => value.toJson()) |
| 8561 .toList(); |
| 8562 result["offsets"] = offsets; |
| 8563 result["lengths"] = lengths; |
13068 return result; | 8564 return result; |
13069 } | 8565 } |
13070 | 8566 |
13071 @override | 8567 @override |
13072 String toString() => JSON.encode(toJson()); | 8568 String toString() => JSON.encode(toJson()); |
13073 | 8569 |
13074 @override | 8570 @override |
13075 bool operator ==(other) { | 8571 bool operator ==(other) { |
13076 if (other is LinkedEditSuggestion) { | 8572 if (other is ExtractMethodFeedback) { |
13077 return value == other.value && kind == other.kind; | 8573 return offset == other.offset && |
| 8574 length == other.length && |
| 8575 returnType == other.returnType && |
| 8576 listEqual(names, other.names, (String a, String b) => a == b) && |
| 8577 canCreateGetter == other.canCreateGetter && |
| 8578 listEqual( |
| 8579 parameters, |
| 8580 other.parameters, |
| 8581 (RefactoringMethodParameter a, RefactoringMethodParameter b) => |
| 8582 a == b) && |
| 8583 listEqual(offsets, other.offsets, (int a, int b) => a == b) && |
| 8584 listEqual(lengths, other.lengths, (int a, int b) => a == b); |
13078 } | 8585 } |
13079 return false; | 8586 return false; |
13080 } | 8587 } |
13081 | 8588 |
13082 @override | 8589 @override |
13083 int get hashCode { | 8590 int get hashCode { |
13084 int hash = 0; | 8591 int hash = 0; |
13085 hash = JenkinsSmiHash.combine(hash, value.hashCode); | 8592 hash = JenkinsSmiHash.combine(hash, offset.hashCode); |
13086 hash = JenkinsSmiHash.combine(hash, kind.hashCode); | 8593 hash = JenkinsSmiHash.combine(hash, length.hashCode); |
| 8594 hash = JenkinsSmiHash.combine(hash, returnType.hashCode); |
| 8595 hash = JenkinsSmiHash.combine(hash, names.hashCode); |
| 8596 hash = JenkinsSmiHash.combine(hash, canCreateGetter.hashCode); |
| 8597 hash = JenkinsSmiHash.combine(hash, parameters.hashCode); |
| 8598 hash = JenkinsSmiHash.combine(hash, offsets.hashCode); |
| 8599 hash = JenkinsSmiHash.combine(hash, lengths.hashCode); |
13087 return JenkinsSmiHash.finish(hash); | 8600 return JenkinsSmiHash.finish(hash); |
13088 } | 8601 } |
13089 } | 8602 } |
13090 | 8603 |
13091 /** | 8604 /** |
13092 * LinkedEditSuggestionKind | 8605 * extractMethod options |
13093 * | 8606 * |
13094 * enum { | 8607 * { |
13095 * METHOD | 8608 * "returnType": String |
13096 * PARAMETER | 8609 * "createGetter": bool |
13097 * TYPE | 8610 * "name": String |
13098 * VARIABLE | 8611 * "parameters": List<RefactoringMethodParameter> |
| 8612 * "extractAll": bool |
13099 * } | 8613 * } |
13100 * | 8614 * |
13101 * Clients may not extend, implement or mix-in this class. | 8615 * Clients may not extend, implement or mix-in this class. |
13102 */ | 8616 */ |
13103 class LinkedEditSuggestionKind implements Enum { | 8617 class ExtractMethodOptions extends RefactoringOptions { |
13104 static const LinkedEditSuggestionKind METHOD = | 8618 String _returnType; |
13105 const LinkedEditSuggestionKind._("METHOD"); | 8619 |
13106 | 8620 bool _createGetter; |
13107 static const LinkedEditSuggestionKind PARAMETER = | 8621 |
13108 const LinkedEditSuggestionKind._("PARAMETER"); | 8622 String _name; |
13109 | 8623 |
13110 static const LinkedEditSuggestionKind TYPE = | 8624 List<RefactoringMethodParameter> _parameters; |
13111 const LinkedEditSuggestionKind._("TYPE"); | 8625 |
13112 | 8626 bool _extractAll; |
13113 static const LinkedEditSuggestionKind VARIABLE = | 8627 |
13114 const LinkedEditSuggestionKind._("VARIABLE"); | 8628 /** |
13115 | 8629 * The return type that should be defined for the method. |
13116 /** | 8630 */ |
13117 * A list containing all of the enum values that are defined. | 8631 String get returnType => _returnType; |
13118 */ | 8632 |
13119 static const List<LinkedEditSuggestionKind> VALUES = | 8633 /** |
13120 const <LinkedEditSuggestionKind>[METHOD, PARAMETER, TYPE, VARIABLE]; | 8634 * The return type that should be defined for the method. |
13121 | 8635 */ |
13122 @override | 8636 void set returnType(String value) { |
13123 final String name; | 8637 assert(value != null); |
13124 | 8638 this._returnType = value; |
13125 const LinkedEditSuggestionKind._(this.name); | 8639 } |
13126 | 8640 |
13127 factory LinkedEditSuggestionKind(String name) { | 8641 /** |
13128 switch (name) { | 8642 * True if a getter should be created rather than a method. It is an error if |
13129 case "METHOD": | 8643 * this field is true and the list of parameters is non-empty. |
13130 return METHOD; | 8644 */ |
13131 case "PARAMETER": | 8645 bool get createGetter => _createGetter; |
13132 return PARAMETER; | 8646 |
13133 case "TYPE": | 8647 /** |
13134 return TYPE; | 8648 * True if a getter should be created rather than a method. It is an error if |
13135 case "VARIABLE": | 8649 * this field is true and the list of parameters is non-empty. |
13136 return VARIABLE; | 8650 */ |
13137 } | 8651 void set createGetter(bool value) { |
13138 throw new Exception('Illegal enum value: $name'); | 8652 assert(value != null); |
13139 } | 8653 this._createGetter = value; |
13140 | 8654 } |
13141 factory LinkedEditSuggestionKind.fromJson( | 8655 |
13142 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 8656 /** |
13143 if (json is String) { | 8657 * The name that the method should be given. |
13144 try { | 8658 */ |
13145 return new LinkedEditSuggestionKind(json); | 8659 String get name => _name; |
13146 } catch (_) { | 8660 |
13147 // Fall through | 8661 /** |
13148 } | 8662 * The name that the method should be given. |
13149 } | 8663 */ |
13150 throw jsonDecoder.mismatch(jsonPath, "LinkedEditSuggestionKind", json); | 8664 void set name(String value) { |
13151 } | 8665 assert(value != null); |
13152 | 8666 this._name = value; |
13153 @override | 8667 } |
13154 String toString() => "LinkedEditSuggestionKind.$name"; | 8668 |
13155 | 8669 /** |
13156 String toJson() => name; | 8670 * The parameters that should be defined for the method. |
13157 } | 8671 * |
13158 | 8672 * It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL |
13159 /** | 8673 * parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a |
13160 * Location | 8674 * NAMED parameter. |
13161 * | 8675 * |
13162 * { | 8676 * - To change the order and/or update proposed parameters, add parameters |
13163 * "file": FilePath | 8677 * with the same identifiers as proposed. |
13164 * "offset": int | 8678 * - To add new parameters, omit their identifier. |
13165 * "length": int | 8679 * - To remove some parameters, omit them in this list. |
13166 * "startLine": int | 8680 */ |
13167 * "startColumn": int | 8681 List<RefactoringMethodParameter> get parameters => _parameters; |
13168 * } | 8682 |
13169 * | 8683 /** |
13170 * Clients may not extend, implement or mix-in this class. | 8684 * The parameters that should be defined for the method. |
13171 */ | 8685 * |
13172 class Location implements HasToJson { | 8686 * It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL |
13173 String _file; | 8687 * parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a |
13174 | 8688 * NAMED parameter. |
13175 int _offset; | 8689 * |
13176 | 8690 * - To change the order and/or update proposed parameters, add parameters |
13177 int _length; | 8691 * with the same identifiers as proposed. |
13178 | 8692 * - To add new parameters, omit their identifier. |
13179 int _startLine; | 8693 * - To remove some parameters, omit them in this list. |
13180 | 8694 */ |
13181 int _startColumn; | 8695 void set parameters(List<RefactoringMethodParameter> value) { |
13182 | 8696 assert(value != null); |
13183 /** | 8697 this._parameters = value; |
13184 * The file containing the range. | 8698 } |
13185 */ | 8699 |
13186 String get file => _file; | 8700 /** |
13187 | 8701 * True if all occurrences of the expression or statements should be replaced |
13188 /** | 8702 * by an invocation of the method. The expression or statements used to |
13189 * The file containing the range. | 8703 * initiate the refactoring will always be replaced. |
13190 */ | 8704 */ |
13191 void set file(String value) { | 8705 bool get extractAll => _extractAll; |
13192 assert(value != null); | 8706 |
13193 this._file = value; | 8707 /** |
13194 } | 8708 * True if all occurrences of the expression or statements should be replaced |
13195 | 8709 * by an invocation of the method. The expression or statements used to |
13196 /** | 8710 * initiate the refactoring will always be replaced. |
13197 * The offset of the range. | 8711 */ |
13198 */ | 8712 void set extractAll(bool value) { |
13199 int get offset => _offset; | 8713 assert(value != null); |
13200 | 8714 this._extractAll = value; |
13201 /** | 8715 } |
13202 * The offset of the range. | 8716 |
13203 */ | 8717 ExtractMethodOptions(String returnType, bool createGetter, String name, |
13204 void set offset(int value) { | 8718 List<RefactoringMethodParameter> parameters, bool extractAll) { |
13205 assert(value != null); | 8719 this.returnType = returnType; |
13206 this._offset = value; | 8720 this.createGetter = createGetter; |
13207 } | 8721 this.name = name; |
13208 | 8722 this.parameters = parameters; |
13209 /** | 8723 this.extractAll = extractAll; |
13210 * The length of the range. | 8724 } |
13211 */ | 8725 |
13212 int get length => _length; | 8726 factory ExtractMethodOptions.fromJson( |
13213 | |
13214 /** | |
13215 * The length of the range. | |
13216 */ | |
13217 void set length(int value) { | |
13218 assert(value != null); | |
13219 this._length = value; | |
13220 } | |
13221 | |
13222 /** | |
13223 * The one-based index of the line containing the first character of the | |
13224 * range. | |
13225 */ | |
13226 int get startLine => _startLine; | |
13227 | |
13228 /** | |
13229 * The one-based index of the line containing the first character of the | |
13230 * range. | |
13231 */ | |
13232 void set startLine(int value) { | |
13233 assert(value != null); | |
13234 this._startLine = value; | |
13235 } | |
13236 | |
13237 /** | |
13238 * The one-based index of the column containing the first character of the | |
13239 * range. | |
13240 */ | |
13241 int get startColumn => _startColumn; | |
13242 | |
13243 /** | |
13244 * The one-based index of the column containing the first character of the | |
13245 * range. | |
13246 */ | |
13247 void set startColumn(int value) { | |
13248 assert(value != null); | |
13249 this._startColumn = value; | |
13250 } | |
13251 | |
13252 Location( | |
13253 String file, int offset, int length, int startLine, int startColumn) { | |
13254 this.file = file; | |
13255 this.offset = offset; | |
13256 this.length = length; | |
13257 this.startLine = startLine; | |
13258 this.startColumn = startColumn; | |
13259 } | |
13260 | |
13261 factory Location.fromJson( | |
13262 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 8727 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
13263 if (json == null) { | 8728 if (json == null) { |
13264 json = {}; | 8729 json = {}; |
13265 } | 8730 } |
13266 if (json is Map) { | 8731 if (json is Map) { |
13267 String file; | 8732 String returnType; |
13268 if (json.containsKey("file")) { | 8733 if (json.containsKey("returnType")) { |
13269 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | 8734 returnType = jsonDecoder.decodeString( |
13270 } else { | 8735 jsonPath + ".returnType", json["returnType"]); |
13271 throw jsonDecoder.mismatch(jsonPath, "file"); | 8736 } else { |
13272 } | 8737 throw jsonDecoder.mismatch(jsonPath, "returnType"); |
13273 int offset; | 8738 } |
13274 if (json.containsKey("offset")) { | 8739 bool createGetter; |
13275 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | 8740 if (json.containsKey("createGetter")) { |
13276 } else { | 8741 createGetter = jsonDecoder.decodeBool( |
13277 throw jsonDecoder.mismatch(jsonPath, "offset"); | 8742 jsonPath + ".createGetter", json["createGetter"]); |
13278 } | 8743 } else { |
13279 int length; | 8744 throw jsonDecoder.mismatch(jsonPath, "createGetter"); |
13280 if (json.containsKey("length")) { | 8745 } |
13281 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | 8746 String name; |
13282 } else { | 8747 if (json.containsKey("name")) { |
13283 throw jsonDecoder.mismatch(jsonPath, "length"); | 8748 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]); |
13284 } | 8749 } else { |
13285 int startLine; | 8750 throw jsonDecoder.mismatch(jsonPath, "name"); |
13286 if (json.containsKey("startLine")) { | 8751 } |
13287 startLine = | 8752 List<RefactoringMethodParameter> parameters; |
13288 jsonDecoder.decodeInt(jsonPath + ".startLine", json["startLine"]); | 8753 if (json.containsKey("parameters")) { |
13289 } else { | 8754 parameters = jsonDecoder.decodeList( |
13290 throw jsonDecoder.mismatch(jsonPath, "startLine"); | 8755 jsonPath + ".parameters", |
13291 } | 8756 json["parameters"], |
13292 int startColumn; | 8757 (String jsonPath, Object json) => |
13293 if (json.containsKey("startColumn")) { | 8758 new RefactoringMethodParameter.fromJson( |
13294 startColumn = jsonDecoder.decodeInt( | 8759 jsonDecoder, jsonPath, json)); |
13295 jsonPath + ".startColumn", json["startColumn"]); | 8760 } else { |
13296 } else { | 8761 throw jsonDecoder.mismatch(jsonPath, "parameters"); |
13297 throw jsonDecoder.mismatch(jsonPath, "startColumn"); | 8762 } |
13298 } | 8763 bool extractAll; |
13299 return new Location(file, offset, length, startLine, startColumn); | 8764 if (json.containsKey("extractAll")) { |
| 8765 extractAll = jsonDecoder.decodeBool( |
| 8766 jsonPath + ".extractAll", json["extractAll"]); |
| 8767 } else { |
| 8768 throw jsonDecoder.mismatch(jsonPath, "extractAll"); |
| 8769 } |
| 8770 return new ExtractMethodOptions( |
| 8771 returnType, createGetter, name, parameters, extractAll); |
13300 } else { | 8772 } else { |
13301 throw jsonDecoder.mismatch(jsonPath, "Location", json); | 8773 throw jsonDecoder.mismatch(jsonPath, "extractMethod options", json); |
13302 } | 8774 } |
13303 } | 8775 } |
13304 | 8776 |
| 8777 factory ExtractMethodOptions.fromRefactoringParams( |
| 8778 EditGetRefactoringParams refactoringParams, Request request) { |
| 8779 return new ExtractMethodOptions.fromJson( |
| 8780 new RequestDecoder(request), "options", refactoringParams.options); |
| 8781 } |
| 8782 |
13305 @override | 8783 @override |
13306 Map<String, dynamic> toJson() { | 8784 Map<String, dynamic> toJson() { |
13307 Map<String, dynamic> result = {}; | 8785 Map<String, dynamic> result = {}; |
13308 result["file"] = file; | 8786 result["returnType"] = returnType; |
13309 result["offset"] = offset; | 8787 result["createGetter"] = createGetter; |
13310 result["length"] = length; | 8788 result["name"] = name; |
13311 result["startLine"] = startLine; | 8789 result["parameters"] = parameters |
13312 result["startColumn"] = startColumn; | 8790 .map((RefactoringMethodParameter value) => value.toJson()) |
| 8791 .toList(); |
| 8792 result["extractAll"] = extractAll; |
13313 return result; | 8793 return result; |
13314 } | 8794 } |
13315 | 8795 |
13316 @override | 8796 @override |
13317 String toString() => JSON.encode(toJson()); | 8797 String toString() => JSON.encode(toJson()); |
13318 | 8798 |
13319 @override | 8799 @override |
13320 bool operator ==(other) { | 8800 bool operator ==(other) { |
13321 if (other is Location) { | 8801 if (other is ExtractMethodOptions) { |
13322 return file == other.file && | 8802 return returnType == other.returnType && |
13323 offset == other.offset && | 8803 createGetter == other.createGetter && |
13324 length == other.length && | 8804 name == other.name && |
13325 startLine == other.startLine && | 8805 listEqual( |
13326 startColumn == other.startColumn; | 8806 parameters, |
| 8807 other.parameters, |
| 8808 (RefactoringMethodParameter a, RefactoringMethodParameter b) => |
| 8809 a == b) && |
| 8810 extractAll == other.extractAll; |
13327 } | 8811 } |
13328 return false; | 8812 return false; |
13329 } | 8813 } |
13330 | 8814 |
13331 @override | 8815 @override |
13332 int get hashCode { | 8816 int get hashCode { |
13333 int hash = 0; | 8817 int hash = 0; |
13334 hash = JenkinsSmiHash.combine(hash, file.hashCode); | 8818 hash = JenkinsSmiHash.combine(hash, returnType.hashCode); |
13335 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | 8819 hash = JenkinsSmiHash.combine(hash, createGetter.hashCode); |
13336 hash = JenkinsSmiHash.combine(hash, length.hashCode); | 8820 hash = JenkinsSmiHash.combine(hash, name.hashCode); |
13337 hash = JenkinsSmiHash.combine(hash, startLine.hashCode); | 8821 hash = JenkinsSmiHash.combine(hash, parameters.hashCode); |
13338 hash = JenkinsSmiHash.combine(hash, startColumn.hashCode); | 8822 hash = JenkinsSmiHash.combine(hash, extractAll.hashCode); |
13339 return JenkinsSmiHash.finish(hash); | 8823 return JenkinsSmiHash.finish(hash); |
13340 } | 8824 } |
13341 } | 8825 } |
13342 | 8826 |
13343 /** | 8827 /** |
13344 * moveFile feedback | 8828 * FileKind |
13345 * | 8829 * |
13346 * Clients may not extend, implement or mix-in this class. | 8830 * enum { |
13347 */ | 8831 * LIBRARY |
13348 class MoveFileFeedback extends RefactoringFeedback implements HasToJson { | 8832 * PART |
13349 @override | |
13350 bool operator ==(other) { | |
13351 if (other is MoveFileFeedback) { | |
13352 return true; | |
13353 } | |
13354 return false; | |
13355 } | |
13356 | |
13357 @override | |
13358 int get hashCode { | |
13359 return 438975893; | |
13360 } | |
13361 } | |
13362 | |
13363 /** | |
13364 * moveFile options | |
13365 * | |
13366 * { | |
13367 * "newFile": FilePath | |
13368 * } | 8833 * } |
13369 * | 8834 * |
13370 * Clients may not extend, implement or mix-in this class. | 8835 * Clients may not extend, implement or mix-in this class. |
13371 */ | 8836 */ |
13372 class MoveFileOptions extends RefactoringOptions { | 8837 class FileKind implements Enum { |
13373 String _newFile; | 8838 static const FileKind LIBRARY = const FileKind._("LIBRARY"); |
| 8839 |
| 8840 static const FileKind PART = const FileKind._("PART"); |
13374 | 8841 |
13375 /** | 8842 /** |
13376 * The new file path to which the given file is being moved. | 8843 * A list containing all of the enum values that are defined. |
13377 */ | 8844 */ |
13378 String get newFile => _newFile; | 8845 static const List<FileKind> VALUES = const <FileKind>[LIBRARY, PART]; |
13379 | 8846 |
13380 /** | 8847 @override |
13381 * The new file path to which the given file is being moved. | 8848 final String name; |
13382 */ | 8849 |
13383 void set newFile(String value) { | 8850 const FileKind._(this.name); |
13384 assert(value != null); | 8851 |
13385 this._newFile = value; | 8852 factory FileKind(String name) { |
| 8853 switch (name) { |
| 8854 case "LIBRARY": |
| 8855 return LIBRARY; |
| 8856 case "PART": |
| 8857 return PART; |
| 8858 } |
| 8859 throw new Exception('Illegal enum value: $name'); |
13386 } | 8860 } |
13387 | 8861 |
13388 MoveFileOptions(String newFile) { | 8862 factory FileKind.fromJson( |
13389 this.newFile = newFile; | |
13390 } | |
13391 | |
13392 factory MoveFileOptions.fromJson( | |
13393 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 8863 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
13394 if (json == null) { | 8864 if (json is String) { |
13395 json = {}; | 8865 try { |
| 8866 return new FileKind(json); |
| 8867 } catch (_) { |
| 8868 // Fall through |
| 8869 } |
13396 } | 8870 } |
13397 if (json is Map) { | 8871 throw jsonDecoder.mismatch(jsonPath, "FileKind", json); |
13398 String newFile; | |
13399 if (json.containsKey("newFile")) { | |
13400 newFile = | |
13401 jsonDecoder.decodeString(jsonPath + ".newFile", json["newFile"]); | |
13402 } else { | |
13403 throw jsonDecoder.mismatch(jsonPath, "newFile"); | |
13404 } | |
13405 return new MoveFileOptions(newFile); | |
13406 } else { | |
13407 throw jsonDecoder.mismatch(jsonPath, "moveFile options", json); | |
13408 } | |
13409 } | |
13410 | |
13411 factory MoveFileOptions.fromRefactoringParams( | |
13412 EditGetRefactoringParams refactoringParams, Request request) { | |
13413 return new MoveFileOptions.fromJson( | |
13414 new RequestDecoder(request), "options", refactoringParams.options); | |
13415 } | 8872 } |
13416 | 8873 |
13417 @override | 8874 @override |
13418 Map<String, dynamic> toJson() { | 8875 String toString() => "FileKind.$name"; |
13419 Map<String, dynamic> result = {}; | 8876 |
13420 result["newFile"] = newFile; | 8877 String toJson() => name; |
13421 return result; | 8878 } |
| 8879 |
| 8880 /** |
| 8881 * GeneralAnalysisService |
| 8882 * |
| 8883 * enum { |
| 8884 * ANALYZED_FILES |
| 8885 * } |
| 8886 * |
| 8887 * Clients may not extend, implement or mix-in this class. |
| 8888 */ |
| 8889 class GeneralAnalysisService implements Enum { |
| 8890 static const GeneralAnalysisService ANALYZED_FILES = |
| 8891 const GeneralAnalysisService._("ANALYZED_FILES"); |
| 8892 |
| 8893 /** |
| 8894 * A list containing all of the enum values that are defined. |
| 8895 */ |
| 8896 static const List<GeneralAnalysisService> VALUES = |
| 8897 const <GeneralAnalysisService>[ANALYZED_FILES]; |
| 8898 |
| 8899 @override |
| 8900 final String name; |
| 8901 |
| 8902 const GeneralAnalysisService._(this.name); |
| 8903 |
| 8904 factory GeneralAnalysisService(String name) { |
| 8905 switch (name) { |
| 8906 case "ANALYZED_FILES": |
| 8907 return ANALYZED_FILES; |
| 8908 } |
| 8909 throw new Exception('Illegal enum value: $name'); |
| 8910 } |
| 8911 |
| 8912 factory GeneralAnalysisService.fromJson( |
| 8913 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| 8914 if (json is String) { |
| 8915 try { |
| 8916 return new GeneralAnalysisService(json); |
| 8917 } catch (_) { |
| 8918 // Fall through |
| 8919 } |
| 8920 } |
| 8921 throw jsonDecoder.mismatch(jsonPath, "GeneralAnalysisService", json); |
13422 } | 8922 } |
13423 | 8923 |
13424 @override | 8924 @override |
13425 String toString() => JSON.encode(toJson()); | 8925 String toString() => "GeneralAnalysisService.$name"; |
13426 | 8926 |
13427 @override | 8927 String toJson() => name; |
13428 bool operator ==(other) { | |
13429 if (other is MoveFileOptions) { | |
13430 return newFile == other.newFile; | |
13431 } | |
13432 return false; | |
13433 } | |
13434 | |
13435 @override | |
13436 int get hashCode { | |
13437 int hash = 0; | |
13438 hash = JenkinsSmiHash.combine(hash, newFile.hashCode); | |
13439 return JenkinsSmiHash.finish(hash); | |
13440 } | |
13441 } | 8928 } |
13442 | 8929 |
13443 /** | 8930 /** |
13444 * NavigationRegion | 8931 * HoverInformation |
13445 * | 8932 * |
13446 * { | 8933 * { |
13447 * "offset": int | 8934 * "offset": int |
13448 * "length": int | 8935 * "length": int |
13449 * "targets": List<int> | 8936 * "containingLibraryPath": optional String |
| 8937 * "containingLibraryName": optional String |
| 8938 * "containingClassDescription": optional String |
| 8939 * "dartdoc": optional String |
| 8940 * "elementDescription": optional String |
| 8941 * "elementKind": optional String |
| 8942 * "isDeprecated": optional bool |
| 8943 * "parameter": optional String |
| 8944 * "propagatedType": optional String |
| 8945 * "staticType": optional String |
13450 * } | 8946 * } |
13451 * | 8947 * |
13452 * Clients may not extend, implement or mix-in this class. | 8948 * Clients may not extend, implement or mix-in this class. |
13453 */ | 8949 */ |
13454 class NavigationRegion implements HasToJson { | 8950 class HoverInformation implements HasToJson { |
13455 int _offset; | 8951 int _offset; |
13456 | 8952 |
13457 int _length; | 8953 int _length; |
13458 | 8954 |
13459 List<int> _targets; | 8955 String _containingLibraryPath; |
| 8956 |
| 8957 String _containingLibraryName; |
| 8958 |
| 8959 String _containingClassDescription; |
| 8960 |
| 8961 String _dartdoc; |
| 8962 |
| 8963 String _elementDescription; |
| 8964 |
| 8965 String _elementKind; |
| 8966 |
| 8967 bool _isDeprecated; |
| 8968 |
| 8969 String _parameter; |
| 8970 |
| 8971 String _propagatedType; |
| 8972 |
| 8973 String _staticType; |
13460 | 8974 |
13461 /** | 8975 /** |
13462 * The offset of the region from which the user can navigate. | 8976 * The offset of the range of characters that encompasses the cursor position |
| 8977 * and has the same hover information as the cursor position. |
13463 */ | 8978 */ |
13464 int get offset => _offset; | 8979 int get offset => _offset; |
13465 | 8980 |
13466 /** | 8981 /** |
13467 * The offset of the region from which the user can navigate. | 8982 * The offset of the range of characters that encompasses the cursor position |
| 8983 * and has the same hover information as the cursor position. |
13468 */ | 8984 */ |
13469 void set offset(int value) { | 8985 void set offset(int value) { |
13470 assert(value != null); | 8986 assert(value != null); |
13471 this._offset = value; | 8987 this._offset = value; |
13472 } | 8988 } |
13473 | 8989 |
13474 /** | 8990 /** |
13475 * The length of the region from which the user can navigate. | 8991 * The length of the range of characters that encompasses the cursor position |
| 8992 * and has the same hover information as the cursor position. |
13476 */ | 8993 */ |
13477 int get length => _length; | 8994 int get length => _length; |
13478 | 8995 |
13479 /** | 8996 /** |
13480 * The length of the region from which the user can navigate. | 8997 * The length of the range of characters that encompasses the cursor position |
| 8998 * and has the same hover information as the cursor position. |
13481 */ | 8999 */ |
13482 void set length(int value) { | 9000 void set length(int value) { |
13483 assert(value != null); | 9001 assert(value != null); |
13484 this._length = value; | 9002 this._length = value; |
13485 } | 9003 } |
13486 | 9004 |
13487 /** | 9005 /** |
13488 * The indexes of the targets (in the enclosing navigation response) to which | 9006 * The path to the defining compilation unit of the library in which the |
13489 * the given region is bound. By opening the target, clients can implement | 9007 * referenced element is declared. This data is omitted if there is no |
13490 * one form of navigation. This list cannot be empty. | 9008 * referenced element, or if the element is declared inside an HTML file. |
13491 */ | 9009 */ |
13492 List<int> get targets => _targets; | 9010 String get containingLibraryPath => _containingLibraryPath; |
13493 | 9011 |
13494 /** | 9012 /** |
13495 * The indexes of the targets (in the enclosing navigation response) to which | 9013 * The path to the defining compilation unit of the library in which the |
13496 * the given region is bound. By opening the target, clients can implement | 9014 * referenced element is declared. This data is omitted if there is no |
13497 * one form of navigation. This list cannot be empty. | 9015 * referenced element, or if the element is declared inside an HTML file. |
13498 */ | 9016 */ |
13499 void set targets(List<int> value) { | 9017 void set containingLibraryPath(String value) { |
13500 assert(value != null); | 9018 this._containingLibraryPath = value; |
13501 this._targets = value; | |
13502 } | 9019 } |
13503 | 9020 |
13504 NavigationRegion(int offset, int length, List<int> targets) { | 9021 /** |
| 9022 * The name of the library in which the referenced element is declared. This |
| 9023 * data is omitted if there is no referenced element, or if the element is |
| 9024 * declared inside an HTML file. |
| 9025 */ |
| 9026 String get containingLibraryName => _containingLibraryName; |
| 9027 |
| 9028 /** |
| 9029 * The name of the library in which the referenced element is declared. This |
| 9030 * data is omitted if there is no referenced element, or if the element is |
| 9031 * declared inside an HTML file. |
| 9032 */ |
| 9033 void set containingLibraryName(String value) { |
| 9034 this._containingLibraryName = value; |
| 9035 } |
| 9036 |
| 9037 /** |
| 9038 * A human-readable description of the class declaring the element being |
| 9039 * referenced. This data is omitted if there is no referenced element, or if |
| 9040 * the element is not a class member. |
| 9041 */ |
| 9042 String get containingClassDescription => _containingClassDescription; |
| 9043 |
| 9044 /** |
| 9045 * A human-readable description of the class declaring the element being |
| 9046 * referenced. This data is omitted if there is no referenced element, or if |
| 9047 * the element is not a class member. |
| 9048 */ |
| 9049 void set containingClassDescription(String value) { |
| 9050 this._containingClassDescription = value; |
| 9051 } |
| 9052 |
| 9053 /** |
| 9054 * The dartdoc associated with the referenced element. Other than the removal |
| 9055 * of the comment delimiters, including leading asterisks in the case of a |
| 9056 * block comment, the dartdoc is unprocessed markdown. This data is omitted |
| 9057 * if there is no referenced element, or if the element has no dartdoc. |
| 9058 */ |
| 9059 String get dartdoc => _dartdoc; |
| 9060 |
| 9061 /** |
| 9062 * The dartdoc associated with the referenced element. Other than the removal |
| 9063 * of the comment delimiters, including leading asterisks in the case of a |
| 9064 * block comment, the dartdoc is unprocessed markdown. This data is omitted |
| 9065 * if there is no referenced element, or if the element has no dartdoc. |
| 9066 */ |
| 9067 void set dartdoc(String value) { |
| 9068 this._dartdoc = value; |
| 9069 } |
| 9070 |
| 9071 /** |
| 9072 * A human-readable description of the element being referenced. This data is |
| 9073 * omitted if there is no referenced element. |
| 9074 */ |
| 9075 String get elementDescription => _elementDescription; |
| 9076 |
| 9077 /** |
| 9078 * A human-readable description of the element being referenced. This data is |
| 9079 * omitted if there is no referenced element. |
| 9080 */ |
| 9081 void set elementDescription(String value) { |
| 9082 this._elementDescription = value; |
| 9083 } |
| 9084 |
| 9085 /** |
| 9086 * A human-readable description of the kind of element being referenced (such |
| 9087 * as "class" or "function type alias"). This data is omitted if there is no |
| 9088 * referenced element. |
| 9089 */ |
| 9090 String get elementKind => _elementKind; |
| 9091 |
| 9092 /** |
| 9093 * A human-readable description of the kind of element being referenced (such |
| 9094 * as "class" or "function type alias"). This data is omitted if there is no |
| 9095 * referenced element. |
| 9096 */ |
| 9097 void set elementKind(String value) { |
| 9098 this._elementKind = value; |
| 9099 } |
| 9100 |
| 9101 /** |
| 9102 * True if the referenced element is deprecated. |
| 9103 */ |
| 9104 bool get isDeprecated => _isDeprecated; |
| 9105 |
| 9106 /** |
| 9107 * True if the referenced element is deprecated. |
| 9108 */ |
| 9109 void set isDeprecated(bool value) { |
| 9110 this._isDeprecated = value; |
| 9111 } |
| 9112 |
| 9113 /** |
| 9114 * A human-readable description of the parameter corresponding to the |
| 9115 * expression being hovered over. This data is omitted if the location is not |
| 9116 * in an argument to a function. |
| 9117 */ |
| 9118 String get parameter => _parameter; |
| 9119 |
| 9120 /** |
| 9121 * A human-readable description of the parameter corresponding to the |
| 9122 * expression being hovered over. This data is omitted if the location is not |
| 9123 * in an argument to a function. |
| 9124 */ |
| 9125 void set parameter(String value) { |
| 9126 this._parameter = value; |
| 9127 } |
| 9128 |
| 9129 /** |
| 9130 * The name of the propagated type of the expression. This data is omitted if |
| 9131 * the location does not correspond to an expression or if there is no |
| 9132 * propagated type information. |
| 9133 */ |
| 9134 String get propagatedType => _propagatedType; |
| 9135 |
| 9136 /** |
| 9137 * The name of the propagated type of the expression. This data is omitted if |
| 9138 * the location does not correspond to an expression or if there is no |
| 9139 * propagated type information. |
| 9140 */ |
| 9141 void set propagatedType(String value) { |
| 9142 this._propagatedType = value; |
| 9143 } |
| 9144 |
| 9145 /** |
| 9146 * The name of the static type of the expression. This data is omitted if the |
| 9147 * location does not correspond to an expression. |
| 9148 */ |
| 9149 String get staticType => _staticType; |
| 9150 |
| 9151 /** |
| 9152 * The name of the static type of the expression. This data is omitted if the |
| 9153 * location does not correspond to an expression. |
| 9154 */ |
| 9155 void set staticType(String value) { |
| 9156 this._staticType = value; |
| 9157 } |
| 9158 |
| 9159 HoverInformation(int offset, int length, |
| 9160 {String containingLibraryPath, |
| 9161 String containingLibraryName, |
| 9162 String containingClassDescription, |
| 9163 String dartdoc, |
| 9164 String elementDescription, |
| 9165 String elementKind, |
| 9166 bool isDeprecated, |
| 9167 String parameter, |
| 9168 String propagatedType, |
| 9169 String staticType}) { |
13505 this.offset = offset; | 9170 this.offset = offset; |
13506 this.length = length; | 9171 this.length = length; |
13507 this.targets = targets; | 9172 this.containingLibraryPath = containingLibraryPath; |
| 9173 this.containingLibraryName = containingLibraryName; |
| 9174 this.containingClassDescription = containingClassDescription; |
| 9175 this.dartdoc = dartdoc; |
| 9176 this.elementDescription = elementDescription; |
| 9177 this.elementKind = elementKind; |
| 9178 this.isDeprecated = isDeprecated; |
| 9179 this.parameter = parameter; |
| 9180 this.propagatedType = propagatedType; |
| 9181 this.staticType = staticType; |
13508 } | 9182 } |
13509 | 9183 |
13510 factory NavigationRegion.fromJson( | 9184 factory HoverInformation.fromJson( |
13511 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 9185 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
13512 if (json == null) { | 9186 if (json == null) { |
13513 json = {}; | 9187 json = {}; |
13514 } | 9188 } |
13515 if (json is Map) { | 9189 if (json is Map) { |
13516 int offset; | 9190 int offset; |
13517 if (json.containsKey("offset")) { | 9191 if (json.containsKey("offset")) { |
13518 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | 9192 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); |
13519 } else { | |
13520 throw jsonDecoder.mismatch(jsonPath, "offset"); | |
13521 } | |
13522 int length; | |
13523 if (json.containsKey("length")) { | |
13524 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
13525 } else { | |
13526 throw jsonDecoder.mismatch(jsonPath, "length"); | |
13527 } | |
13528 List<int> targets; | |
13529 if (json.containsKey("targets")) { | |
13530 targets = jsonDecoder.decodeList( | |
13531 jsonPath + ".targets", json["targets"], jsonDecoder.decodeInt); | |
13532 } else { | |
13533 throw jsonDecoder.mismatch(jsonPath, "targets"); | |
13534 } | |
13535 return new NavigationRegion(offset, length, targets); | |
13536 } else { | |
13537 throw jsonDecoder.mismatch(jsonPath, "NavigationRegion", json); | |
13538 } | |
13539 } | |
13540 | |
13541 @override | |
13542 Map<String, dynamic> toJson() { | |
13543 Map<String, dynamic> result = {}; | |
13544 result["offset"] = offset; | |
13545 result["length"] = length; | |
13546 result["targets"] = targets; | |
13547 return result; | |
13548 } | |
13549 | |
13550 @override | |
13551 String toString() => JSON.encode(toJson()); | |
13552 | |
13553 @override | |
13554 bool operator ==(other) { | |
13555 if (other is NavigationRegion) { | |
13556 return offset == other.offset && | |
13557 length == other.length && | |
13558 listEqual(targets, other.targets, (int a, int b) => a == b); | |
13559 } | |
13560 return false; | |
13561 } | |
13562 | |
13563 @override | |
13564 int get hashCode { | |
13565 int hash = 0; | |
13566 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
13567 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
13568 hash = JenkinsSmiHash.combine(hash, targets.hashCode); | |
13569 return JenkinsSmiHash.finish(hash); | |
13570 } | |
13571 } | |
13572 | |
13573 /** | |
13574 * NavigationTarget | |
13575 * | |
13576 * { | |
13577 * "kind": ElementKind | |
13578 * "fileIndex": int | |
13579 * "offset": int | |
13580 * "length": int | |
13581 * "startLine": int | |
13582 * "startColumn": int | |
13583 * } | |
13584 * | |
13585 * Clients may not extend, implement or mix-in this class. | |
13586 */ | |
13587 class NavigationTarget implements HasToJson { | |
13588 ElementKind _kind; | |
13589 | |
13590 int _fileIndex; | |
13591 | |
13592 int _offset; | |
13593 | |
13594 int _length; | |
13595 | |
13596 int _startLine; | |
13597 | |
13598 int _startColumn; | |
13599 | |
13600 /** | |
13601 * The kind of the element. | |
13602 */ | |
13603 ElementKind get kind => _kind; | |
13604 | |
13605 /** | |
13606 * The kind of the element. | |
13607 */ | |
13608 void set kind(ElementKind value) { | |
13609 assert(value != null); | |
13610 this._kind = value; | |
13611 } | |
13612 | |
13613 /** | |
13614 * The index of the file (in the enclosing navigation response) to navigate | |
13615 * to. | |
13616 */ | |
13617 int get fileIndex => _fileIndex; | |
13618 | |
13619 /** | |
13620 * The index of the file (in the enclosing navigation response) to navigate | |
13621 * to. | |
13622 */ | |
13623 void set fileIndex(int value) { | |
13624 assert(value != null); | |
13625 this._fileIndex = value; | |
13626 } | |
13627 | |
13628 /** | |
13629 * The offset of the region to which the user can navigate. | |
13630 */ | |
13631 int get offset => _offset; | |
13632 | |
13633 /** | |
13634 * The offset of the region to which the user can navigate. | |
13635 */ | |
13636 void set offset(int value) { | |
13637 assert(value != null); | |
13638 this._offset = value; | |
13639 } | |
13640 | |
13641 /** | |
13642 * The length of the region to which the user can navigate. | |
13643 */ | |
13644 int get length => _length; | |
13645 | |
13646 /** | |
13647 * The length of the region to which the user can navigate. | |
13648 */ | |
13649 void set length(int value) { | |
13650 assert(value != null); | |
13651 this._length = value; | |
13652 } | |
13653 | |
13654 /** | |
13655 * The one-based index of the line containing the first character of the | |
13656 * region. | |
13657 */ | |
13658 int get startLine => _startLine; | |
13659 | |
13660 /** | |
13661 * The one-based index of the line containing the first character of the | |
13662 * region. | |
13663 */ | |
13664 void set startLine(int value) { | |
13665 assert(value != null); | |
13666 this._startLine = value; | |
13667 } | |
13668 | |
13669 /** | |
13670 * The one-based index of the column containing the first character of the | |
13671 * region. | |
13672 */ | |
13673 int get startColumn => _startColumn; | |
13674 | |
13675 /** | |
13676 * The one-based index of the column containing the first character of the | |
13677 * region. | |
13678 */ | |
13679 void set startColumn(int value) { | |
13680 assert(value != null); | |
13681 this._startColumn = value; | |
13682 } | |
13683 | |
13684 NavigationTarget(ElementKind kind, int fileIndex, int offset, int length, | |
13685 int startLine, int startColumn) { | |
13686 this.kind = kind; | |
13687 this.fileIndex = fileIndex; | |
13688 this.offset = offset; | |
13689 this.length = length; | |
13690 this.startLine = startLine; | |
13691 this.startColumn = startColumn; | |
13692 } | |
13693 | |
13694 factory NavigationTarget.fromJson( | |
13695 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
13696 if (json == null) { | |
13697 json = {}; | |
13698 } | |
13699 if (json is Map) { | |
13700 ElementKind kind; | |
13701 if (json.containsKey("kind")) { | |
13702 kind = new ElementKind.fromJson( | |
13703 jsonDecoder, jsonPath + ".kind", json["kind"]); | |
13704 } else { | |
13705 throw jsonDecoder.mismatch(jsonPath, "kind"); | |
13706 } | |
13707 int fileIndex; | |
13708 if (json.containsKey("fileIndex")) { | |
13709 fileIndex = | |
13710 jsonDecoder.decodeInt(jsonPath + ".fileIndex", json["fileIndex"]); | |
13711 } else { | |
13712 throw jsonDecoder.mismatch(jsonPath, "fileIndex"); | |
13713 } | |
13714 int offset; | |
13715 if (json.containsKey("offset")) { | |
13716 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
13717 } else { | 9193 } else { |
13718 throw jsonDecoder.mismatch(jsonPath, "offset"); | 9194 throw jsonDecoder.mismatch(jsonPath, "offset"); |
13719 } | 9195 } |
13720 int length; | 9196 int length; |
13721 if (json.containsKey("length")) { | 9197 if (json.containsKey("length")) { |
13722 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | 9198 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); |
13723 } else { | 9199 } else { |
13724 throw jsonDecoder.mismatch(jsonPath, "length"); | 9200 throw jsonDecoder.mismatch(jsonPath, "length"); |
13725 } | 9201 } |
13726 int startLine; | 9202 String containingLibraryPath; |
13727 if (json.containsKey("startLine")) { | 9203 if (json.containsKey("containingLibraryPath")) { |
13728 startLine = | 9204 containingLibraryPath = jsonDecoder.decodeString( |
13729 jsonDecoder.decodeInt(jsonPath + ".startLine", json["startLine"]); | 9205 jsonPath + ".containingLibraryPath", json["containingLibraryPath"]); |
13730 } else { | |
13731 throw jsonDecoder.mismatch(jsonPath, "startLine"); | |
13732 } | 9206 } |
13733 int startColumn; | 9207 String containingLibraryName; |
13734 if (json.containsKey("startColumn")) { | 9208 if (json.containsKey("containingLibraryName")) { |
13735 startColumn = jsonDecoder.decodeInt( | 9209 containingLibraryName = jsonDecoder.decodeString( |
13736 jsonPath + ".startColumn", json["startColumn"]); | 9210 jsonPath + ".containingLibraryName", json["containingLibraryName"]); |
13737 } else { | |
13738 throw jsonDecoder.mismatch(jsonPath, "startColumn"); | |
13739 } | 9211 } |
13740 return new NavigationTarget( | 9212 String containingClassDescription; |
13741 kind, fileIndex, offset, length, startLine, startColumn); | 9213 if (json.containsKey("containingClassDescription")) { |
| 9214 containingClassDescription = jsonDecoder.decodeString( |
| 9215 jsonPath + ".containingClassDescription", |
| 9216 json["containingClassDescription"]); |
| 9217 } |
| 9218 String dartdoc; |
| 9219 if (json.containsKey("dartdoc")) { |
| 9220 dartdoc = |
| 9221 jsonDecoder.decodeString(jsonPath + ".dartdoc", json["dartdoc"]); |
| 9222 } |
| 9223 String elementDescription; |
| 9224 if (json.containsKey("elementDescription")) { |
| 9225 elementDescription = jsonDecoder.decodeString( |
| 9226 jsonPath + ".elementDescription", json["elementDescription"]); |
| 9227 } |
| 9228 String elementKind; |
| 9229 if (json.containsKey("elementKind")) { |
| 9230 elementKind = jsonDecoder.decodeString( |
| 9231 jsonPath + ".elementKind", json["elementKind"]); |
| 9232 } |
| 9233 bool isDeprecated; |
| 9234 if (json.containsKey("isDeprecated")) { |
| 9235 isDeprecated = jsonDecoder.decodeBool( |
| 9236 jsonPath + ".isDeprecated", json["isDeprecated"]); |
| 9237 } |
| 9238 String parameter; |
| 9239 if (json.containsKey("parameter")) { |
| 9240 parameter = jsonDecoder.decodeString( |
| 9241 jsonPath + ".parameter", json["parameter"]); |
| 9242 } |
| 9243 String propagatedType; |
| 9244 if (json.containsKey("propagatedType")) { |
| 9245 propagatedType = jsonDecoder.decodeString( |
| 9246 jsonPath + ".propagatedType", json["propagatedType"]); |
| 9247 } |
| 9248 String staticType; |
| 9249 if (json.containsKey("staticType")) { |
| 9250 staticType = jsonDecoder.decodeString( |
| 9251 jsonPath + ".staticType", json["staticType"]); |
| 9252 } |
| 9253 return new HoverInformation(offset, length, |
| 9254 containingLibraryPath: containingLibraryPath, |
| 9255 containingLibraryName: containingLibraryName, |
| 9256 containingClassDescription: containingClassDescription, |
| 9257 dartdoc: dartdoc, |
| 9258 elementDescription: elementDescription, |
| 9259 elementKind: elementKind, |
| 9260 isDeprecated: isDeprecated, |
| 9261 parameter: parameter, |
| 9262 propagatedType: propagatedType, |
| 9263 staticType: staticType); |
13742 } else { | 9264 } else { |
13743 throw jsonDecoder.mismatch(jsonPath, "NavigationTarget", json); | 9265 throw jsonDecoder.mismatch(jsonPath, "HoverInformation", json); |
13744 } | 9266 } |
13745 } | 9267 } |
13746 | 9268 |
13747 @override | 9269 @override |
13748 Map<String, dynamic> toJson() { | 9270 Map<String, dynamic> toJson() { |
13749 Map<String, dynamic> result = {}; | 9271 Map<String, dynamic> result = {}; |
13750 result["kind"] = kind.toJson(); | |
13751 result["fileIndex"] = fileIndex; | |
13752 result["offset"] = offset; | 9272 result["offset"] = offset; |
13753 result["length"] = length; | 9273 result["length"] = length; |
13754 result["startLine"] = startLine; | 9274 if (containingLibraryPath != null) { |
13755 result["startColumn"] = startColumn; | 9275 result["containingLibraryPath"] = containingLibraryPath; |
| 9276 } |
| 9277 if (containingLibraryName != null) { |
| 9278 result["containingLibraryName"] = containingLibraryName; |
| 9279 } |
| 9280 if (containingClassDescription != null) { |
| 9281 result["containingClassDescription"] = containingClassDescription; |
| 9282 } |
| 9283 if (dartdoc != null) { |
| 9284 result["dartdoc"] = dartdoc; |
| 9285 } |
| 9286 if (elementDescription != null) { |
| 9287 result["elementDescription"] = elementDescription; |
| 9288 } |
| 9289 if (elementKind != null) { |
| 9290 result["elementKind"] = elementKind; |
| 9291 } |
| 9292 if (isDeprecated != null) { |
| 9293 result["isDeprecated"] = isDeprecated; |
| 9294 } |
| 9295 if (parameter != null) { |
| 9296 result["parameter"] = parameter; |
| 9297 } |
| 9298 if (propagatedType != null) { |
| 9299 result["propagatedType"] = propagatedType; |
| 9300 } |
| 9301 if (staticType != null) { |
| 9302 result["staticType"] = staticType; |
| 9303 } |
13756 return result; | 9304 return result; |
13757 } | 9305 } |
13758 | 9306 |
13759 @override | |
13760 String toString() => JSON.encode(toJson()); | |
13761 | |
13762 @override | |
13763 bool operator ==(other) { | |
13764 if (other is NavigationTarget) { | |
13765 return kind == other.kind && | |
13766 fileIndex == other.fileIndex && | |
13767 offset == other.offset && | |
13768 length == other.length && | |
13769 startLine == other.startLine && | |
13770 startColumn == other.startColumn; | |
13771 } | |
13772 return false; | |
13773 } | |
13774 | |
13775 @override | |
13776 int get hashCode { | |
13777 int hash = 0; | |
13778 hash = JenkinsSmiHash.combine(hash, kind.hashCode); | |
13779 hash = JenkinsSmiHash.combine(hash, fileIndex.hashCode); | |
13780 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
13781 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
13782 hash = JenkinsSmiHash.combine(hash, startLine.hashCode); | |
13783 hash = JenkinsSmiHash.combine(hash, startColumn.hashCode); | |
13784 return JenkinsSmiHash.finish(hash); | |
13785 } | |
13786 } | |
13787 | |
13788 /** | |
13789 * Occurrences | |
13790 * | |
13791 * { | |
13792 * "element": Element | |
13793 * "offsets": List<int> | |
13794 * "length": int | |
13795 * } | |
13796 * | |
13797 * Clients may not extend, implement or mix-in this class. | |
13798 */ | |
13799 class Occurrences implements HasToJson { | |
13800 Element _element; | |
13801 | |
13802 List<int> _offsets; | |
13803 | |
13804 int _length; | |
13805 | |
13806 /** | |
13807 * The element that was referenced. | |
13808 */ | |
13809 Element get element => _element; | |
13810 | |
13811 /** | |
13812 * The element that was referenced. | |
13813 */ | |
13814 void set element(Element value) { | |
13815 assert(value != null); | |
13816 this._element = value; | |
13817 } | |
13818 | |
13819 /** | |
13820 * The offsets of the name of the referenced element within the file. | |
13821 */ | |
13822 List<int> get offsets => _offsets; | |
13823 | |
13824 /** | |
13825 * The offsets of the name of the referenced element within the file. | |
13826 */ | |
13827 void set offsets(List<int> value) { | |
13828 assert(value != null); | |
13829 this._offsets = value; | |
13830 } | |
13831 | |
13832 /** | |
13833 * The length of the name of the referenced element. | |
13834 */ | |
13835 int get length => _length; | |
13836 | |
13837 /** | |
13838 * The length of the name of the referenced element. | |
13839 */ | |
13840 void set length(int value) { | |
13841 assert(value != null); | |
13842 this._length = value; | |
13843 } | |
13844 | |
13845 Occurrences(Element element, List<int> offsets, int length) { | |
13846 this.element = element; | |
13847 this.offsets = offsets; | |
13848 this.length = length; | |
13849 } | |
13850 | |
13851 factory Occurrences.fromJson( | |
13852 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
13853 if (json == null) { | |
13854 json = {}; | |
13855 } | |
13856 if (json is Map) { | |
13857 Element element; | |
13858 if (json.containsKey("element")) { | |
13859 element = new Element.fromJson( | |
13860 jsonDecoder, jsonPath + ".element", json["element"]); | |
13861 } else { | |
13862 throw jsonDecoder.mismatch(jsonPath, "element"); | |
13863 } | |
13864 List<int> offsets; | |
13865 if (json.containsKey("offsets")) { | |
13866 offsets = jsonDecoder.decodeList( | |
13867 jsonPath + ".offsets", json["offsets"], jsonDecoder.decodeInt); | |
13868 } else { | |
13869 throw jsonDecoder.mismatch(jsonPath, "offsets"); | |
13870 } | |
13871 int length; | |
13872 if (json.containsKey("length")) { | |
13873 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | |
13874 } else { | |
13875 throw jsonDecoder.mismatch(jsonPath, "length"); | |
13876 } | |
13877 return new Occurrences(element, offsets, length); | |
13878 } else { | |
13879 throw jsonDecoder.mismatch(jsonPath, "Occurrences", json); | |
13880 } | |
13881 } | |
13882 | |
13883 @override | |
13884 Map<String, dynamic> toJson() { | |
13885 Map<String, dynamic> result = {}; | |
13886 result["element"] = element.toJson(); | |
13887 result["offsets"] = offsets; | |
13888 result["length"] = length; | |
13889 return result; | |
13890 } | |
13891 | |
13892 @override | 9307 @override |
13893 String toString() => JSON.encode(toJson()); | 9308 String toString() => JSON.encode(toJson()); |
13894 | 9309 |
13895 @override | 9310 @override |
13896 bool operator ==(other) { | 9311 bool operator ==(other) { |
13897 if (other is Occurrences) { | 9312 if (other is HoverInformation) { |
13898 return element == other.element && | 9313 return offset == other.offset && |
13899 listEqual(offsets, other.offsets, (int a, int b) => a == b) && | 9314 length == other.length && |
13900 length == other.length; | 9315 containingLibraryPath == other.containingLibraryPath && |
| 9316 containingLibraryName == other.containingLibraryName && |
| 9317 containingClassDescription == other.containingClassDescription && |
| 9318 dartdoc == other.dartdoc && |
| 9319 elementDescription == other.elementDescription && |
| 9320 elementKind == other.elementKind && |
| 9321 isDeprecated == other.isDeprecated && |
| 9322 parameter == other.parameter && |
| 9323 propagatedType == other.propagatedType && |
| 9324 staticType == other.staticType; |
13901 } | 9325 } |
13902 return false; | 9326 return false; |
13903 } | 9327 } |
13904 | 9328 |
13905 @override | 9329 @override |
13906 int get hashCode { | 9330 int get hashCode { |
13907 int hash = 0; | 9331 int hash = 0; |
13908 hash = JenkinsSmiHash.combine(hash, element.hashCode); | 9332 hash = JenkinsSmiHash.combine(hash, offset.hashCode); |
13909 hash = JenkinsSmiHash.combine(hash, offsets.hashCode); | |
13910 hash = JenkinsSmiHash.combine(hash, length.hashCode); | 9333 hash = JenkinsSmiHash.combine(hash, length.hashCode); |
| 9334 hash = JenkinsSmiHash.combine(hash, containingLibraryPath.hashCode); |
| 9335 hash = JenkinsSmiHash.combine(hash, containingLibraryName.hashCode); |
| 9336 hash = JenkinsSmiHash.combine(hash, containingClassDescription.hashCode); |
| 9337 hash = JenkinsSmiHash.combine(hash, dartdoc.hashCode); |
| 9338 hash = JenkinsSmiHash.combine(hash, elementDescription.hashCode); |
| 9339 hash = JenkinsSmiHash.combine(hash, elementKind.hashCode); |
| 9340 hash = JenkinsSmiHash.combine(hash, isDeprecated.hashCode); |
| 9341 hash = JenkinsSmiHash.combine(hash, parameter.hashCode); |
| 9342 hash = JenkinsSmiHash.combine(hash, propagatedType.hashCode); |
| 9343 hash = JenkinsSmiHash.combine(hash, staticType.hashCode); |
13911 return JenkinsSmiHash.finish(hash); | 9344 return JenkinsSmiHash.finish(hash); |
13912 } | 9345 } |
13913 } | 9346 } |
13914 | 9347 |
13915 /** | 9348 /** |
13916 * Outline | 9349 * ImplementedClass |
13917 * | 9350 * |
13918 * { | 9351 * { |
13919 * "element": Element | |
13920 * "offset": int | 9352 * "offset": int |
13921 * "length": int | 9353 * "length": int |
13922 * "children": optional List<Outline> | |
13923 * } | 9354 * } |
13924 * | 9355 * |
13925 * Clients may not extend, implement or mix-in this class. | 9356 * Clients may not extend, implement or mix-in this class. |
13926 */ | 9357 */ |
13927 class Outline implements HasToJson { | 9358 class ImplementedClass implements HasToJson { |
13928 Element _element; | |
13929 | |
13930 int _offset; | 9359 int _offset; |
13931 | 9360 |
13932 int _length; | 9361 int _length; |
13933 | 9362 |
13934 List<Outline> _children; | |
13935 | |
13936 /** | 9363 /** |
13937 * A description of the element represented by this node. | 9364 * The offset of the name of the implemented class. |
13938 */ | |
13939 Element get element => _element; | |
13940 | |
13941 /** | |
13942 * A description of the element represented by this node. | |
13943 */ | |
13944 void set element(Element value) { | |
13945 assert(value != null); | |
13946 this._element = value; | |
13947 } | |
13948 | |
13949 /** | |
13950 * The offset of the first character of the element. This is different than | |
13951 * the offset in the Element, which if the offset of the name of the element. | |
13952 * It can be used, for example, to map locations in the file back to an | |
13953 * outline. | |
13954 */ | 9365 */ |
13955 int get offset => _offset; | 9366 int get offset => _offset; |
13956 | 9367 |
13957 /** | 9368 /** |
13958 * The offset of the first character of the element. This is different than | 9369 * The offset of the name of the implemented class. |
13959 * the offset in the Element, which if the offset of the name of the element. | |
13960 * It can be used, for example, to map locations in the file back to an | |
13961 * outline. | |
13962 */ | 9370 */ |
13963 void set offset(int value) { | 9371 void set offset(int value) { |
13964 assert(value != null); | 9372 assert(value != null); |
13965 this._offset = value; | 9373 this._offset = value; |
13966 } | 9374 } |
13967 | 9375 |
13968 /** | 9376 /** |
13969 * The length of the element. | 9377 * The length of the name of the implemented class. |
13970 */ | 9378 */ |
13971 int get length => _length; | 9379 int get length => _length; |
13972 | 9380 |
13973 /** | 9381 /** |
13974 * The length of the element. | 9382 * The length of the name of the implemented class. |
13975 */ | 9383 */ |
13976 void set length(int value) { | 9384 void set length(int value) { |
13977 assert(value != null); | 9385 assert(value != null); |
13978 this._length = value; | 9386 this._length = value; |
13979 } | 9387 } |
13980 | 9388 |
13981 /** | 9389 ImplementedClass(int offset, int length) { |
13982 * The children of the node. The field will be omitted if the node has no | 9390 this.offset = offset; |
13983 * children. | 9391 this.length = length; |
13984 */ | |
13985 List<Outline> get children => _children; | |
13986 | |
13987 /** | |
13988 * The children of the node. The field will be omitted if the node has no | |
13989 * children. | |
13990 */ | |
13991 void set children(List<Outline> value) { | |
13992 this._children = value; | |
13993 } | 9392 } |
13994 | 9393 |
13995 Outline(Element element, int offset, int length, {List<Outline> children}) { | 9394 factory ImplementedClass.fromJson( |
13996 this.element = element; | |
13997 this.offset = offset; | |
13998 this.length = length; | |
13999 this.children = children; | |
14000 } | |
14001 | |
14002 factory Outline.fromJson( | |
14003 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 9395 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
14004 if (json == null) { | 9396 if (json == null) { |
14005 json = {}; | 9397 json = {}; |
14006 } | 9398 } |
14007 if (json is Map) { | 9399 if (json is Map) { |
14008 Element element; | |
14009 if (json.containsKey("element")) { | |
14010 element = new Element.fromJson( | |
14011 jsonDecoder, jsonPath + ".element", json["element"]); | |
14012 } else { | |
14013 throw jsonDecoder.mismatch(jsonPath, "element"); | |
14014 } | |
14015 int offset; | 9400 int offset; |
14016 if (json.containsKey("offset")) { | 9401 if (json.containsKey("offset")) { |
14017 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | 9402 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); |
14018 } else { | 9403 } else { |
14019 throw jsonDecoder.mismatch(jsonPath, "offset"); | 9404 throw jsonDecoder.mismatch(jsonPath, "offset"); |
14020 } | 9405 } |
14021 int length; | 9406 int length; |
14022 if (json.containsKey("length")) { | 9407 if (json.containsKey("length")) { |
14023 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | 9408 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); |
14024 } else { | 9409 } else { |
14025 throw jsonDecoder.mismatch(jsonPath, "length"); | 9410 throw jsonDecoder.mismatch(jsonPath, "length"); |
14026 } | 9411 } |
14027 List<Outline> children; | 9412 return new ImplementedClass(offset, length); |
14028 if (json.containsKey("children")) { | |
14029 children = jsonDecoder.decodeList( | |
14030 jsonPath + ".children", | |
14031 json["children"], | |
14032 (String jsonPath, Object json) => | |
14033 new Outline.fromJson(jsonDecoder, jsonPath, json)); | |
14034 } | |
14035 return new Outline(element, offset, length, children: children); | |
14036 } else { | 9413 } else { |
14037 throw jsonDecoder.mismatch(jsonPath, "Outline", json); | 9414 throw jsonDecoder.mismatch(jsonPath, "ImplementedClass", json); |
14038 } | 9415 } |
14039 } | 9416 } |
14040 | 9417 |
14041 @override | 9418 @override |
14042 Map<String, dynamic> toJson() { | 9419 Map<String, dynamic> toJson() { |
14043 Map<String, dynamic> result = {}; | 9420 Map<String, dynamic> result = {}; |
14044 result["element"] = element.toJson(); | |
14045 result["offset"] = offset; | 9421 result["offset"] = offset; |
14046 result["length"] = length; | 9422 result["length"] = length; |
14047 if (children != null) { | |
14048 result["children"] = | |
14049 children.map((Outline value) => value.toJson()).toList(); | |
14050 } | |
14051 return result; | 9423 return result; |
14052 } | 9424 } |
14053 | 9425 |
14054 @override | 9426 @override |
14055 String toString() => JSON.encode(toJson()); | 9427 String toString() => JSON.encode(toJson()); |
14056 | 9428 |
14057 @override | 9429 @override |
14058 bool operator ==(other) { | 9430 bool operator ==(other) { |
14059 if (other is Outline) { | 9431 if (other is ImplementedClass) { |
14060 return element == other.element && | 9432 return offset == other.offset && length == other.length; |
14061 offset == other.offset && | |
14062 length == other.length && | |
14063 listEqual(children, other.children, (Outline a, Outline b) => a == b); | |
14064 } | 9433 } |
14065 return false; | 9434 return false; |
14066 } | 9435 } |
14067 | 9436 |
14068 @override | 9437 @override |
14069 int get hashCode { | 9438 int get hashCode { |
14070 int hash = 0; | 9439 int hash = 0; |
14071 hash = JenkinsSmiHash.combine(hash, element.hashCode); | |
14072 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | 9440 hash = JenkinsSmiHash.combine(hash, offset.hashCode); |
14073 hash = JenkinsSmiHash.combine(hash, length.hashCode); | 9441 hash = JenkinsSmiHash.combine(hash, length.hashCode); |
14074 hash = JenkinsSmiHash.combine(hash, children.hashCode); | |
14075 return JenkinsSmiHash.finish(hash); | 9442 return JenkinsSmiHash.finish(hash); |
14076 } | 9443 } |
14077 } | 9444 } |
14078 | 9445 |
14079 /** | 9446 /** |
14080 * OverriddenMember | 9447 * ImplementedMember |
14081 * | 9448 * |
14082 * { | 9449 * { |
14083 * "element": Element | 9450 * "offset": int |
14084 * "className": String | 9451 * "length": int |
14085 * } | 9452 * } |
14086 * | 9453 * |
14087 * Clients may not extend, implement or mix-in this class. | 9454 * Clients may not extend, implement or mix-in this class. |
14088 */ | 9455 */ |
14089 class OverriddenMember implements HasToJson { | 9456 class ImplementedMember implements HasToJson { |
14090 Element _element; | 9457 int _offset; |
14091 | 9458 |
14092 String _className; | 9459 int _length; |
14093 | 9460 |
14094 /** | 9461 /** |
14095 * The element that is being overridden. | 9462 * The offset of the name of the implemented member. |
14096 */ | 9463 */ |
14097 Element get element => _element; | 9464 int get offset => _offset; |
14098 | 9465 |
14099 /** | 9466 /** |
14100 * The element that is being overridden. | 9467 * The offset of the name of the implemented member. |
14101 */ | 9468 */ |
14102 void set element(Element value) { | 9469 void set offset(int value) { |
14103 assert(value != null); | 9470 assert(value != null); |
14104 this._element = value; | 9471 this._offset = value; |
14105 } | 9472 } |
14106 | 9473 |
14107 /** | 9474 /** |
14108 * The name of the class in which the member is defined. | 9475 * The length of the name of the implemented member. |
14109 */ | 9476 */ |
14110 String get className => _className; | 9477 int get length => _length; |
14111 | 9478 |
14112 /** | 9479 /** |
14113 * The name of the class in which the member is defined. | 9480 * The length of the name of the implemented member. |
14114 */ | 9481 */ |
14115 void set className(String value) { | 9482 void set length(int value) { |
14116 assert(value != null); | 9483 assert(value != null); |
14117 this._className = value; | 9484 this._length = value; |
14118 } | 9485 } |
14119 | 9486 |
14120 OverriddenMember(Element element, String className) { | 9487 ImplementedMember(int offset, int length) { |
14121 this.element = element; | 9488 this.offset = offset; |
14122 this.className = className; | 9489 this.length = length; |
14123 } | 9490 } |
14124 | 9491 |
14125 factory OverriddenMember.fromJson( | 9492 factory ImplementedMember.fromJson( |
14126 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 9493 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
14127 if (json == null) { | 9494 if (json == null) { |
14128 json = {}; | 9495 json = {}; |
14129 } | 9496 } |
14130 if (json is Map) { | 9497 if (json is Map) { |
14131 Element element; | 9498 int offset; |
14132 if (json.containsKey("element")) { | 9499 if (json.containsKey("offset")) { |
14133 element = new Element.fromJson( | 9500 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); |
14134 jsonDecoder, jsonPath + ".element", json["element"]); | |
14135 } else { | 9501 } else { |
14136 throw jsonDecoder.mismatch(jsonPath, "element"); | 9502 throw jsonDecoder.mismatch(jsonPath, "offset"); |
14137 } | 9503 } |
14138 String className; | 9504 int length; |
14139 if (json.containsKey("className")) { | 9505 if (json.containsKey("length")) { |
14140 className = jsonDecoder.decodeString( | 9506 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); |
14141 jsonPath + ".className", json["className"]); | |
14142 } else { | 9507 } else { |
14143 throw jsonDecoder.mismatch(jsonPath, "className"); | 9508 throw jsonDecoder.mismatch(jsonPath, "length"); |
14144 } | 9509 } |
14145 return new OverriddenMember(element, className); | 9510 return new ImplementedMember(offset, length); |
14146 } else { | 9511 } else { |
14147 throw jsonDecoder.mismatch(jsonPath, "OverriddenMember", json); | 9512 throw jsonDecoder.mismatch(jsonPath, "ImplementedMember", json); |
14148 } | 9513 } |
14149 } | 9514 } |
14150 | 9515 |
14151 @override | 9516 @override |
14152 Map<String, dynamic> toJson() { | 9517 Map<String, dynamic> toJson() { |
14153 Map<String, dynamic> result = {}; | 9518 Map<String, dynamic> result = {}; |
14154 result["element"] = element.toJson(); | 9519 result["offset"] = offset; |
14155 result["className"] = className; | 9520 result["length"] = length; |
14156 return result; | 9521 return result; |
14157 } | 9522 } |
14158 | 9523 |
14159 @override | 9524 @override |
14160 String toString() => JSON.encode(toJson()); | 9525 String toString() => JSON.encode(toJson()); |
14161 | 9526 |
14162 @override | 9527 @override |
14163 bool operator ==(other) { | 9528 bool operator ==(other) { |
14164 if (other is OverriddenMember) { | 9529 if (other is ImplementedMember) { |
14165 return element == other.element && className == other.className; | 9530 return offset == other.offset && length == other.length; |
14166 } | 9531 } |
14167 return false; | 9532 return false; |
14168 } | 9533 } |
14169 | 9534 |
14170 @override | 9535 @override |
14171 int get hashCode { | 9536 int get hashCode { |
14172 int hash = 0; | 9537 int hash = 0; |
14173 hash = JenkinsSmiHash.combine(hash, element.hashCode); | 9538 hash = JenkinsSmiHash.combine(hash, offset.hashCode); |
14174 hash = JenkinsSmiHash.combine(hash, className.hashCode); | 9539 hash = JenkinsSmiHash.combine(hash, length.hashCode); |
14175 return JenkinsSmiHash.finish(hash); | 9540 return JenkinsSmiHash.finish(hash); |
14176 } | 9541 } |
14177 } | 9542 } |
14178 | 9543 |
14179 /** | 9544 /** |
14180 * Override | 9545 * inlineLocalVariable feedback |
14181 * | 9546 * |
14182 * { | 9547 * { |
14183 * "offset": int | 9548 * "name": String |
14184 * "length": int | 9549 * "occurrences": int |
14185 * "superclassMember": optional OverriddenMember | |
14186 * "interfaceMembers": optional List<OverriddenMember> | |
14187 * } | 9550 * } |
14188 * | 9551 * |
14189 * Clients may not extend, implement or mix-in this class. | 9552 * Clients may not extend, implement or mix-in this class. |
14190 */ | 9553 */ |
14191 class Override implements HasToJson { | 9554 class InlineLocalVariableFeedback extends RefactoringFeedback { |
14192 int _offset; | 9555 String _name; |
14193 | 9556 |
14194 int _length; | 9557 int _occurrences; |
14195 | |
14196 OverriddenMember _superclassMember; | |
14197 | |
14198 List<OverriddenMember> _interfaceMembers; | |
14199 | 9558 |
14200 /** | 9559 /** |
14201 * The offset of the name of the overriding member. | 9560 * The name of the variable being inlined. |
14202 */ | 9561 */ |
14203 int get offset => _offset; | 9562 String get name => _name; |
14204 | 9563 |
14205 /** | 9564 /** |
14206 * The offset of the name of the overriding member. | 9565 * The name of the variable being inlined. |
14207 */ | 9566 */ |
14208 void set offset(int value) { | 9567 void set name(String value) { |
14209 assert(value != null); | 9568 assert(value != null); |
14210 this._offset = value; | 9569 this._name = value; |
14211 } | 9570 } |
14212 | 9571 |
14213 /** | 9572 /** |
14214 * The length of the name of the overriding member. | 9573 * The number of times the variable occurs. |
14215 */ | 9574 */ |
14216 int get length => _length; | 9575 int get occurrences => _occurrences; |
14217 | 9576 |
14218 /** | 9577 /** |
14219 * The length of the name of the overriding member. | 9578 * The number of times the variable occurs. |
14220 */ | 9579 */ |
14221 void set length(int value) { | 9580 void set occurrences(int value) { |
14222 assert(value != null); | 9581 assert(value != null); |
14223 this._length = value; | 9582 this._occurrences = value; |
14224 } | 9583 } |
14225 | 9584 |
14226 /** | 9585 InlineLocalVariableFeedback(String name, int occurrences) { |
14227 * The member inherited from a superclass that is overridden by the | 9586 this.name = name; |
14228 * overriding member. The field is omitted if there is no superclass member, | 9587 this.occurrences = occurrences; |
14229 * in which case there must be at least one interface member. | |
14230 */ | |
14231 OverriddenMember get superclassMember => _superclassMember; | |
14232 | |
14233 /** | |
14234 * The member inherited from a superclass that is overridden by the | |
14235 * overriding member. The field is omitted if there is no superclass member, | |
14236 * in which case there must be at least one interface member. | |
14237 */ | |
14238 void set superclassMember(OverriddenMember value) { | |
14239 this._superclassMember = value; | |
14240 } | 9588 } |
14241 | 9589 |
14242 /** | 9590 factory InlineLocalVariableFeedback.fromJson( |
14243 * The members inherited from interfaces that are overridden by the | |
14244 * overriding member. The field is omitted if there are no interface members, | |
14245 * in which case there must be a superclass member. | |
14246 */ | |
14247 List<OverriddenMember> get interfaceMembers => _interfaceMembers; | |
14248 | |
14249 /** | |
14250 * The members inherited from interfaces that are overridden by the | |
14251 * overriding member. The field is omitted if there are no interface members, | |
14252 * in which case there must be a superclass member. | |
14253 */ | |
14254 void set interfaceMembers(List<OverriddenMember> value) { | |
14255 this._interfaceMembers = value; | |
14256 } | |
14257 | |
14258 Override(int offset, int length, | |
14259 {OverriddenMember superclassMember, | |
14260 List<OverriddenMember> interfaceMembers}) { | |
14261 this.offset = offset; | |
14262 this.length = length; | |
14263 this.superclassMember = superclassMember; | |
14264 this.interfaceMembers = interfaceMembers; | |
14265 } | |
14266 | |
14267 factory Override.fromJson( | |
14268 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 9591 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
14269 if (json == null) { | 9592 if (json == null) { |
14270 json = {}; | 9593 json = {}; |
14271 } | 9594 } |
14272 if (json is Map) { | 9595 if (json is Map) { |
14273 int offset; | 9596 String name; |
14274 if (json.containsKey("offset")) { | 9597 if (json.containsKey("name")) { |
14275 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | 9598 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]); |
14276 } else { | 9599 } else { |
14277 throw jsonDecoder.mismatch(jsonPath, "offset"); | 9600 throw jsonDecoder.mismatch(jsonPath, "name"); |
14278 } | 9601 } |
14279 int length; | 9602 int occurrences; |
14280 if (json.containsKey("length")) { | 9603 if (json.containsKey("occurrences")) { |
14281 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | 9604 occurrences = jsonDecoder.decodeInt( |
| 9605 jsonPath + ".occurrences", json["occurrences"]); |
14282 } else { | 9606 } else { |
14283 throw jsonDecoder.mismatch(jsonPath, "length"); | 9607 throw jsonDecoder.mismatch(jsonPath, "occurrences"); |
14284 } | 9608 } |
14285 OverriddenMember superclassMember; | 9609 return new InlineLocalVariableFeedback(name, occurrences); |
14286 if (json.containsKey("superclassMember")) { | |
14287 superclassMember = new OverriddenMember.fromJson(jsonDecoder, | |
14288 jsonPath + ".superclassMember", json["superclassMember"]); | |
14289 } | |
14290 List<OverriddenMember> interfaceMembers; | |
14291 if (json.containsKey("interfaceMembers")) { | |
14292 interfaceMembers = jsonDecoder.decodeList( | |
14293 jsonPath + ".interfaceMembers", | |
14294 json["interfaceMembers"], | |
14295 (String jsonPath, Object json) => | |
14296 new OverriddenMember.fromJson(jsonDecoder, jsonPath, json)); | |
14297 } | |
14298 return new Override(offset, length, | |
14299 superclassMember: superclassMember, | |
14300 interfaceMembers: interfaceMembers); | |
14301 } else { | 9610 } else { |
14302 throw jsonDecoder.mismatch(jsonPath, "Override", json); | 9611 throw jsonDecoder.mismatch( |
| 9612 jsonPath, "inlineLocalVariable feedback", json); |
14303 } | 9613 } |
14304 } | 9614 } |
14305 | 9615 |
14306 @override | 9616 @override |
14307 Map<String, dynamic> toJson() { | 9617 Map<String, dynamic> toJson() { |
14308 Map<String, dynamic> result = {}; | 9618 Map<String, dynamic> result = {}; |
14309 result["offset"] = offset; | 9619 result["name"] = name; |
14310 result["length"] = length; | 9620 result["occurrences"] = occurrences; |
14311 if (superclassMember != null) { | |
14312 result["superclassMember"] = superclassMember.toJson(); | |
14313 } | |
14314 if (interfaceMembers != null) { | |
14315 result["interfaceMembers"] = interfaceMembers | |
14316 .map((OverriddenMember value) => value.toJson()) | |
14317 .toList(); | |
14318 } | |
14319 return result; | 9621 return result; |
14320 } | 9622 } |
14321 | 9623 |
14322 @override | 9624 @override |
14323 String toString() => JSON.encode(toJson()); | 9625 String toString() => JSON.encode(toJson()); |
14324 | 9626 |
14325 @override | 9627 @override |
14326 bool operator ==(other) { | 9628 bool operator ==(other) { |
14327 if (other is Override) { | 9629 if (other is InlineLocalVariableFeedback) { |
14328 return offset == other.offset && | 9630 return name == other.name && occurrences == other.occurrences; |
14329 length == other.length && | |
14330 superclassMember == other.superclassMember && | |
14331 listEqual(interfaceMembers, other.interfaceMembers, | |
14332 (OverriddenMember a, OverriddenMember b) => a == b); | |
14333 } | 9631 } |
14334 return false; | 9632 return false; |
14335 } | 9633 } |
14336 | 9634 |
14337 @override | 9635 @override |
14338 int get hashCode { | 9636 int get hashCode { |
14339 int hash = 0; | 9637 int hash = 0; |
14340 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | 9638 hash = JenkinsSmiHash.combine(hash, name.hashCode); |
14341 hash = JenkinsSmiHash.combine(hash, length.hashCode); | 9639 hash = JenkinsSmiHash.combine(hash, occurrences.hashCode); |
14342 hash = JenkinsSmiHash.combine(hash, superclassMember.hashCode); | |
14343 hash = JenkinsSmiHash.combine(hash, interfaceMembers.hashCode); | |
14344 return JenkinsSmiHash.finish(hash); | 9640 return JenkinsSmiHash.finish(hash); |
14345 } | 9641 } |
14346 } | 9642 } |
14347 | 9643 |
14348 /** | 9644 /** |
14349 * Position | 9645 * inlineLocalVariable options |
| 9646 * |
| 9647 * Clients may not extend, implement or mix-in this class. |
| 9648 */ |
| 9649 class InlineLocalVariableOptions extends RefactoringOptions |
| 9650 implements HasToJson { |
| 9651 @override |
| 9652 bool operator ==(other) { |
| 9653 if (other is InlineLocalVariableOptions) { |
| 9654 return true; |
| 9655 } |
| 9656 return false; |
| 9657 } |
| 9658 |
| 9659 @override |
| 9660 int get hashCode { |
| 9661 return 540364977; |
| 9662 } |
| 9663 } |
| 9664 |
| 9665 /** |
| 9666 * inlineMethod feedback |
14350 * | 9667 * |
14351 * { | 9668 * { |
14352 * "file": FilePath | 9669 * "className": optional String |
14353 * "offset": int | 9670 * "methodName": String |
| 9671 * "isDeclaration": bool |
14354 * } | 9672 * } |
14355 * | 9673 * |
14356 * Clients may not extend, implement or mix-in this class. | 9674 * Clients may not extend, implement or mix-in this class. |
14357 */ | 9675 */ |
14358 class Position implements HasToJson { | 9676 class InlineMethodFeedback extends RefactoringFeedback { |
14359 String _file; | 9677 String _className; |
14360 | 9678 |
14361 int _offset; | 9679 String _methodName; |
| 9680 |
| 9681 bool _isDeclaration; |
14362 | 9682 |
14363 /** | 9683 /** |
14364 * The file containing the position. | 9684 * The name of the class enclosing the method being inlined. If not a class |
| 9685 * member is being inlined, this field will be absent. |
14365 */ | 9686 */ |
14366 String get file => _file; | 9687 String get className => _className; |
14367 | 9688 |
14368 /** | 9689 /** |
14369 * The file containing the position. | 9690 * The name of the class enclosing the method being inlined. If not a class |
| 9691 * member is being inlined, this field will be absent. |
14370 */ | 9692 */ |
14371 void set file(String value) { | 9693 void set className(String value) { |
14372 assert(value != null); | 9694 this._className = value; |
14373 this._file = value; | |
14374 } | 9695 } |
14375 | 9696 |
14376 /** | 9697 /** |
14377 * The offset of the position. | 9698 * The name of the method (or function) being inlined. |
14378 */ | 9699 */ |
14379 int get offset => _offset; | 9700 String get methodName => _methodName; |
14380 | 9701 |
14381 /** | 9702 /** |
14382 * The offset of the position. | 9703 * The name of the method (or function) being inlined. |
14383 */ | 9704 */ |
14384 void set offset(int value) { | 9705 void set methodName(String value) { |
14385 assert(value != null); | 9706 assert(value != null); |
14386 this._offset = value; | 9707 this._methodName = value; |
14387 } | 9708 } |
14388 | 9709 |
14389 Position(String file, int offset) { | 9710 /** |
14390 this.file = file; | 9711 * True if the declaration of the method is selected. So all references |
14391 this.offset = offset; | 9712 * should be inlined. |
| 9713 */ |
| 9714 bool get isDeclaration => _isDeclaration; |
| 9715 |
| 9716 /** |
| 9717 * True if the declaration of the method is selected. So all references |
| 9718 * should be inlined. |
| 9719 */ |
| 9720 void set isDeclaration(bool value) { |
| 9721 assert(value != null); |
| 9722 this._isDeclaration = value; |
14392 } | 9723 } |
14393 | 9724 |
14394 factory Position.fromJson( | 9725 InlineMethodFeedback(String methodName, bool isDeclaration, |
| 9726 {String className}) { |
| 9727 this.className = className; |
| 9728 this.methodName = methodName; |
| 9729 this.isDeclaration = isDeclaration; |
| 9730 } |
| 9731 |
| 9732 factory InlineMethodFeedback.fromJson( |
14395 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 9733 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
14396 if (json == null) { | 9734 if (json == null) { |
14397 json = {}; | 9735 json = {}; |
14398 } | 9736 } |
14399 if (json is Map) { | 9737 if (json is Map) { |
14400 String file; | 9738 String className; |
14401 if (json.containsKey("file")) { | 9739 if (json.containsKey("className")) { |
14402 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | 9740 className = jsonDecoder.decodeString( |
| 9741 jsonPath + ".className", json["className"]); |
| 9742 } |
| 9743 String methodName; |
| 9744 if (json.containsKey("methodName")) { |
| 9745 methodName = jsonDecoder.decodeString( |
| 9746 jsonPath + ".methodName", json["methodName"]); |
14403 } else { | 9747 } else { |
14404 throw jsonDecoder.mismatch(jsonPath, "file"); | 9748 throw jsonDecoder.mismatch(jsonPath, "methodName"); |
14405 } | 9749 } |
14406 int offset; | 9750 bool isDeclaration; |
14407 if (json.containsKey("offset")) { | 9751 if (json.containsKey("isDeclaration")) { |
14408 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | 9752 isDeclaration = jsonDecoder.decodeBool( |
| 9753 jsonPath + ".isDeclaration", json["isDeclaration"]); |
14409 } else { | 9754 } else { |
14410 throw jsonDecoder.mismatch(jsonPath, "offset"); | 9755 throw jsonDecoder.mismatch(jsonPath, "isDeclaration"); |
14411 } | 9756 } |
14412 return new Position(file, offset); | 9757 return new InlineMethodFeedback(methodName, isDeclaration, |
| 9758 className: className); |
14413 } else { | 9759 } else { |
14414 throw jsonDecoder.mismatch(jsonPath, "Position", json); | 9760 throw jsonDecoder.mismatch(jsonPath, "inlineMethod feedback", json); |
14415 } | 9761 } |
14416 } | 9762 } |
14417 | 9763 |
14418 @override | 9764 @override |
14419 Map<String, dynamic> toJson() { | 9765 Map<String, dynamic> toJson() { |
14420 Map<String, dynamic> result = {}; | 9766 Map<String, dynamic> result = {}; |
14421 result["file"] = file; | 9767 if (className != null) { |
14422 result["offset"] = offset; | 9768 result["className"] = className; |
| 9769 } |
| 9770 result["methodName"] = methodName; |
| 9771 result["isDeclaration"] = isDeclaration; |
14423 return result; | 9772 return result; |
14424 } | 9773 } |
14425 | 9774 |
14426 @override | 9775 @override |
14427 String toString() => JSON.encode(toJson()); | 9776 String toString() => JSON.encode(toJson()); |
14428 | 9777 |
14429 @override | 9778 @override |
14430 bool operator ==(other) { | 9779 bool operator ==(other) { |
14431 if (other is Position) { | 9780 if (other is InlineMethodFeedback) { |
14432 return file == other.file && offset == other.offset; | 9781 return className == other.className && |
| 9782 methodName == other.methodName && |
| 9783 isDeclaration == other.isDeclaration; |
14433 } | 9784 } |
14434 return false; | 9785 return false; |
14435 } | 9786 } |
14436 | 9787 |
14437 @override | 9788 @override |
14438 int get hashCode { | 9789 int get hashCode { |
14439 int hash = 0; | 9790 int hash = 0; |
14440 hash = JenkinsSmiHash.combine(hash, file.hashCode); | 9791 hash = JenkinsSmiHash.combine(hash, className.hashCode); |
14441 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | 9792 hash = JenkinsSmiHash.combine(hash, methodName.hashCode); |
| 9793 hash = JenkinsSmiHash.combine(hash, isDeclaration.hashCode); |
14442 return JenkinsSmiHash.finish(hash); | 9794 return JenkinsSmiHash.finish(hash); |
14443 } | 9795 } |
14444 } | 9796 } |
14445 | 9797 |
14446 /** | 9798 /** |
14447 * PubStatus | 9799 * inlineMethod options |
14448 * | 9800 * |
14449 * { | 9801 * { |
14450 * "isListingPackageDirs": bool | 9802 * "deleteSource": bool |
| 9803 * "inlineAll": bool |
14451 * } | 9804 * } |
14452 * | 9805 * |
14453 * Clients may not extend, implement or mix-in this class. | 9806 * Clients may not extend, implement or mix-in this class. |
14454 */ | 9807 */ |
14455 class PubStatus implements HasToJson { | 9808 class InlineMethodOptions extends RefactoringOptions { |
14456 bool _isListingPackageDirs; | 9809 bool _deleteSource; |
| 9810 |
| 9811 bool _inlineAll; |
14457 | 9812 |
14458 /** | 9813 /** |
14459 * True if the server is currently running pub to produce a list of package | 9814 * True if the method being inlined should be removed. It is an error if this |
14460 * directories. | 9815 * field is true and inlineAll is false. |
14461 */ | 9816 */ |
14462 bool get isListingPackageDirs => _isListingPackageDirs; | 9817 bool get deleteSource => _deleteSource; |
14463 | 9818 |
14464 /** | 9819 /** |
14465 * True if the server is currently running pub to produce a list of package | 9820 * True if the method being inlined should be removed. It is an error if this |
14466 * directories. | 9821 * field is true and inlineAll is false. |
14467 */ | 9822 */ |
14468 void set isListingPackageDirs(bool value) { | 9823 void set deleteSource(bool value) { |
14469 assert(value != null); | 9824 assert(value != null); |
14470 this._isListingPackageDirs = value; | 9825 this._deleteSource = value; |
14471 } | 9826 } |
14472 | 9827 |
14473 PubStatus(bool isListingPackageDirs) { | 9828 /** |
14474 this.isListingPackageDirs = isListingPackageDirs; | 9829 * True if all invocations of the method should be inlined, or false if only |
| 9830 * the invocation site used to create this refactoring should be inlined. |
| 9831 */ |
| 9832 bool get inlineAll => _inlineAll; |
| 9833 |
| 9834 /** |
| 9835 * True if all invocations of the method should be inlined, or false if only |
| 9836 * the invocation site used to create this refactoring should be inlined. |
| 9837 */ |
| 9838 void set inlineAll(bool value) { |
| 9839 assert(value != null); |
| 9840 this._inlineAll = value; |
14475 } | 9841 } |
14476 | 9842 |
14477 factory PubStatus.fromJson( | 9843 InlineMethodOptions(bool deleteSource, bool inlineAll) { |
| 9844 this.deleteSource = deleteSource; |
| 9845 this.inlineAll = inlineAll; |
| 9846 } |
| 9847 |
| 9848 factory InlineMethodOptions.fromJson( |
14478 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 9849 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
14479 if (json == null) { | 9850 if (json == null) { |
14480 json = {}; | 9851 json = {}; |
14481 } | 9852 } |
14482 if (json is Map) { | 9853 if (json is Map) { |
14483 bool isListingPackageDirs; | 9854 bool deleteSource; |
14484 if (json.containsKey("isListingPackageDirs")) { | 9855 if (json.containsKey("deleteSource")) { |
14485 isListingPackageDirs = jsonDecoder.decodeBool( | 9856 deleteSource = jsonDecoder.decodeBool( |
14486 jsonPath + ".isListingPackageDirs", json["isListingPackageDirs"]); | 9857 jsonPath + ".deleteSource", json["deleteSource"]); |
14487 } else { | 9858 } else { |
14488 throw jsonDecoder.mismatch(jsonPath, "isListingPackageDirs"); | 9859 throw jsonDecoder.mismatch(jsonPath, "deleteSource"); |
14489 } | 9860 } |
14490 return new PubStatus(isListingPackageDirs); | 9861 bool inlineAll; |
| 9862 if (json.containsKey("inlineAll")) { |
| 9863 inlineAll = |
| 9864 jsonDecoder.decodeBool(jsonPath + ".inlineAll", json["inlineAll"]); |
| 9865 } else { |
| 9866 throw jsonDecoder.mismatch(jsonPath, "inlineAll"); |
| 9867 } |
| 9868 return new InlineMethodOptions(deleteSource, inlineAll); |
14491 } else { | 9869 } else { |
14492 throw jsonDecoder.mismatch(jsonPath, "PubStatus", json); | 9870 throw jsonDecoder.mismatch(jsonPath, "inlineMethod options", json); |
14493 } | 9871 } |
14494 } | 9872 } |
14495 | 9873 |
| 9874 factory InlineMethodOptions.fromRefactoringParams( |
| 9875 EditGetRefactoringParams refactoringParams, Request request) { |
| 9876 return new InlineMethodOptions.fromJson( |
| 9877 new RequestDecoder(request), "options", refactoringParams.options); |
| 9878 } |
| 9879 |
14496 @override | 9880 @override |
14497 Map<String, dynamic> toJson() { | 9881 Map<String, dynamic> toJson() { |
14498 Map<String, dynamic> result = {}; | 9882 Map<String, dynamic> result = {}; |
14499 result["isListingPackageDirs"] = isListingPackageDirs; | 9883 result["deleteSource"] = deleteSource; |
| 9884 result["inlineAll"] = inlineAll; |
14500 return result; | 9885 return result; |
14501 } | 9886 } |
14502 | 9887 |
14503 @override | 9888 @override |
14504 String toString() => JSON.encode(toJson()); | 9889 String toString() => JSON.encode(toJson()); |
14505 | 9890 |
14506 @override | 9891 @override |
14507 bool operator ==(other) { | 9892 bool operator ==(other) { |
14508 if (other is PubStatus) { | 9893 if (other is InlineMethodOptions) { |
14509 return isListingPackageDirs == other.isListingPackageDirs; | 9894 return deleteSource == other.deleteSource && inlineAll == other.inlineAll; |
14510 } | 9895 } |
14511 return false; | 9896 return false; |
14512 } | 9897 } |
14513 | 9898 |
14514 @override | 9899 @override |
14515 int get hashCode { | 9900 int get hashCode { |
14516 int hash = 0; | 9901 int hash = 0; |
14517 hash = JenkinsSmiHash.combine(hash, isListingPackageDirs.hashCode); | 9902 hash = JenkinsSmiHash.combine(hash, deleteSource.hashCode); |
| 9903 hash = JenkinsSmiHash.combine(hash, inlineAll.hashCode); |
14518 return JenkinsSmiHash.finish(hash); | 9904 return JenkinsSmiHash.finish(hash); |
14519 } | 9905 } |
14520 } | 9906 } |
14521 | 9907 |
14522 /** | 9908 /** |
14523 * RefactoringFeedback | 9909 * moveFile feedback |
14524 * | |
14525 * { | |
14526 * } | |
14527 * | 9910 * |
14528 * Clients may not extend, implement or mix-in this class. | 9911 * Clients may not extend, implement or mix-in this class. |
14529 */ | 9912 */ |
14530 class RefactoringFeedback implements HasToJson { | 9913 class MoveFileFeedback extends RefactoringFeedback implements HasToJson { |
14531 RefactoringFeedback(); | |
14532 | |
14533 factory RefactoringFeedback.fromJson( | |
14534 JsonDecoder jsonDecoder, String jsonPath, Object json, Map responseJson) { | |
14535 return refactoringFeedbackFromJson( | |
14536 jsonDecoder, jsonPath, json, responseJson); | |
14537 } | |
14538 | |
14539 @override | |
14540 Map<String, dynamic> toJson() { | |
14541 Map<String, dynamic> result = {}; | |
14542 return result; | |
14543 } | |
14544 | |
14545 @override | |
14546 String toString() => JSON.encode(toJson()); | |
14547 | |
14548 @override | 9914 @override |
14549 bool operator ==(other) { | 9915 bool operator ==(other) { |
14550 if (other is RefactoringFeedback) { | 9916 if (other is MoveFileFeedback) { |
14551 return true; | 9917 return true; |
14552 } | 9918 } |
14553 return false; | 9919 return false; |
14554 } | 9920 } |
14555 | 9921 |
14556 @override | 9922 @override |
14557 int get hashCode { | 9923 int get hashCode { |
14558 int hash = 0; | 9924 return 438975893; |
14559 return JenkinsSmiHash.finish(hash); | |
14560 } | 9925 } |
14561 } | 9926 } |
14562 | 9927 |
14563 /** | 9928 /** |
14564 * RefactoringKind | 9929 * moveFile options |
14565 * | 9930 * |
14566 * enum { | 9931 * { |
14567 * CONVERT_GETTER_TO_METHOD | 9932 * "newFile": FilePath |
14568 * CONVERT_METHOD_TO_GETTER | |
14569 * EXTRACT_LOCAL_VARIABLE | |
14570 * EXTRACT_METHOD | |
14571 * INLINE_LOCAL_VARIABLE | |
14572 * INLINE_METHOD | |
14573 * MOVE_FILE | |
14574 * RENAME | |
14575 * SORT_MEMBERS | |
14576 * } | 9933 * } |
14577 * | 9934 * |
14578 * Clients may not extend, implement or mix-in this class. | 9935 * Clients may not extend, implement or mix-in this class. |
14579 */ | 9936 */ |
14580 class RefactoringKind implements Enum { | 9937 class MoveFileOptions extends RefactoringOptions { |
14581 static const RefactoringKind CONVERT_GETTER_TO_METHOD = | 9938 String _newFile; |
14582 const RefactoringKind._("CONVERT_GETTER_TO_METHOD"); | |
14583 | |
14584 static const RefactoringKind CONVERT_METHOD_TO_GETTER = | |
14585 const RefactoringKind._("CONVERT_METHOD_TO_GETTER"); | |
14586 | |
14587 static const RefactoringKind EXTRACT_LOCAL_VARIABLE = | |
14588 const RefactoringKind._("EXTRACT_LOCAL_VARIABLE"); | |
14589 | |
14590 static const RefactoringKind EXTRACT_METHOD = | |
14591 const RefactoringKind._("EXTRACT_METHOD"); | |
14592 | |
14593 static const RefactoringKind INLINE_LOCAL_VARIABLE = | |
14594 const RefactoringKind._("INLINE_LOCAL_VARIABLE"); | |
14595 | |
14596 static const RefactoringKind INLINE_METHOD = | |
14597 const RefactoringKind._("INLINE_METHOD"); | |
14598 | |
14599 static const RefactoringKind MOVE_FILE = const RefactoringKind._("MOVE_FILE"); | |
14600 | |
14601 static const RefactoringKind RENAME = const RefactoringKind._("RENAME"); | |
14602 | |
14603 static const RefactoringKind SORT_MEMBERS = | |
14604 const RefactoringKind._("SORT_MEMBERS"); | |
14605 | 9939 |
14606 /** | 9940 /** |
14607 * A list containing all of the enum values that are defined. | 9941 * The new file path to which the given file is being moved. |
14608 */ | 9942 */ |
14609 static const List<RefactoringKind> VALUES = const <RefactoringKind>[ | 9943 String get newFile => _newFile; |
14610 CONVERT_GETTER_TO_METHOD, | |
14611 CONVERT_METHOD_TO_GETTER, | |
14612 EXTRACT_LOCAL_VARIABLE, | |
14613 EXTRACT_METHOD, | |
14614 INLINE_LOCAL_VARIABLE, | |
14615 INLINE_METHOD, | |
14616 MOVE_FILE, | |
14617 RENAME, | |
14618 SORT_MEMBERS | |
14619 ]; | |
14620 | 9944 |
14621 @override | 9945 /** |
14622 final String name; | 9946 * The new file path to which the given file is being moved. |
14623 | 9947 */ |
14624 const RefactoringKind._(this.name); | 9948 void set newFile(String value) { |
14625 | 9949 assert(value != null); |
14626 factory RefactoringKind(String name) { | 9950 this._newFile = value; |
14627 switch (name) { | |
14628 case "CONVERT_GETTER_TO_METHOD": | |
14629 return CONVERT_GETTER_TO_METHOD; | |
14630 case "CONVERT_METHOD_TO_GETTER": | |
14631 return CONVERT_METHOD_TO_GETTER; | |
14632 case "EXTRACT_LOCAL_VARIABLE": | |
14633 return EXTRACT_LOCAL_VARIABLE; | |
14634 case "EXTRACT_METHOD": | |
14635 return EXTRACT_METHOD; | |
14636 case "INLINE_LOCAL_VARIABLE": | |
14637 return INLINE_LOCAL_VARIABLE; | |
14638 case "INLINE_METHOD": | |
14639 return INLINE_METHOD; | |
14640 case "MOVE_FILE": | |
14641 return MOVE_FILE; | |
14642 case "RENAME": | |
14643 return RENAME; | |
14644 case "SORT_MEMBERS": | |
14645 return SORT_MEMBERS; | |
14646 } | |
14647 throw new Exception('Illegal enum value: $name'); | |
14648 } | 9951 } |
14649 | 9952 |
14650 factory RefactoringKind.fromJson( | 9953 MoveFileOptions(String newFile) { |
14651 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 9954 this.newFile = newFile; |
14652 if (json is String) { | |
14653 try { | |
14654 return new RefactoringKind(json); | |
14655 } catch (_) { | |
14656 // Fall through | |
14657 } | |
14658 } | |
14659 throw jsonDecoder.mismatch(jsonPath, "RefactoringKind", json); | |
14660 } | 9955 } |
14661 | 9956 |
14662 @override | 9957 factory MoveFileOptions.fromJson( |
14663 String toString() => "RefactoringKind.$name"; | |
14664 | |
14665 String toJson() => name; | |
14666 } | |
14667 | |
14668 /** | |
14669 * RefactoringMethodParameter | |
14670 * | |
14671 * { | |
14672 * "id": optional String | |
14673 * "kind": RefactoringMethodParameterKind | |
14674 * "type": String | |
14675 * "name": String | |
14676 * "parameters": optional String | |
14677 * } | |
14678 * | |
14679 * Clients may not extend, implement or mix-in this class. | |
14680 */ | |
14681 class RefactoringMethodParameter implements HasToJson { | |
14682 String _id; | |
14683 | |
14684 RefactoringMethodParameterKind _kind; | |
14685 | |
14686 String _type; | |
14687 | |
14688 String _name; | |
14689 | |
14690 String _parameters; | |
14691 | |
14692 /** | |
14693 * The unique identifier of the parameter. Clients may omit this field for | |
14694 * the parameters they want to add. | |
14695 */ | |
14696 String get id => _id; | |
14697 | |
14698 /** | |
14699 * The unique identifier of the parameter. Clients may omit this field for | |
14700 * the parameters they want to add. | |
14701 */ | |
14702 void set id(String value) { | |
14703 this._id = value; | |
14704 } | |
14705 | |
14706 /** | |
14707 * The kind of the parameter. | |
14708 */ | |
14709 RefactoringMethodParameterKind get kind => _kind; | |
14710 | |
14711 /** | |
14712 * The kind of the parameter. | |
14713 */ | |
14714 void set kind(RefactoringMethodParameterKind value) { | |
14715 assert(value != null); | |
14716 this._kind = value; | |
14717 } | |
14718 | |
14719 /** | |
14720 * The type that should be given to the parameter, or the return type of the | |
14721 * parameter's function type. | |
14722 */ | |
14723 String get type => _type; | |
14724 | |
14725 /** | |
14726 * The type that should be given to the parameter, or the return type of the | |
14727 * parameter's function type. | |
14728 */ | |
14729 void set type(String value) { | |
14730 assert(value != null); | |
14731 this._type = value; | |
14732 } | |
14733 | |
14734 /** | |
14735 * The name that should be given to the parameter. | |
14736 */ | |
14737 String get name => _name; | |
14738 | |
14739 /** | |
14740 * The name that should be given to the parameter. | |
14741 */ | |
14742 void set name(String value) { | |
14743 assert(value != null); | |
14744 this._name = value; | |
14745 } | |
14746 | |
14747 /** | |
14748 * The parameter list of the parameter's function type. If the parameter is | |
14749 * not of a function type, this field will not be defined. If the function | |
14750 * type has zero parameters, this field will have a value of "()". | |
14751 */ | |
14752 String get parameters => _parameters; | |
14753 | |
14754 /** | |
14755 * The parameter list of the parameter's function type. If the parameter is | |
14756 * not of a function type, this field will not be defined. If the function | |
14757 * type has zero parameters, this field will have a value of "()". | |
14758 */ | |
14759 void set parameters(String value) { | |
14760 this._parameters = value; | |
14761 } | |
14762 | |
14763 RefactoringMethodParameter( | |
14764 RefactoringMethodParameterKind kind, String type, String name, | |
14765 {String id, String parameters}) { | |
14766 this.id = id; | |
14767 this.kind = kind; | |
14768 this.type = type; | |
14769 this.name = name; | |
14770 this.parameters = parameters; | |
14771 } | |
14772 | |
14773 factory RefactoringMethodParameter.fromJson( | |
14774 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 9958 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
14775 if (json == null) { | 9959 if (json == null) { |
14776 json = {}; | 9960 json = {}; |
14777 } | 9961 } |
14778 if (json is Map) { | 9962 if (json is Map) { |
14779 String id; | 9963 String newFile; |
14780 if (json.containsKey("id")) { | 9964 if (json.containsKey("newFile")) { |
14781 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); | 9965 newFile = |
| 9966 jsonDecoder.decodeString(jsonPath + ".newFile", json["newFile"]); |
| 9967 } else { |
| 9968 throw jsonDecoder.mismatch(jsonPath, "newFile"); |
14782 } | 9969 } |
14783 RefactoringMethodParameterKind kind; | 9970 return new MoveFileOptions(newFile); |
14784 if (json.containsKey("kind")) { | |
14785 kind = new RefactoringMethodParameterKind.fromJson( | |
14786 jsonDecoder, jsonPath + ".kind", json["kind"]); | |
14787 } else { | |
14788 throw jsonDecoder.mismatch(jsonPath, "kind"); | |
14789 } | |
14790 String type; | |
14791 if (json.containsKey("type")) { | |
14792 type = jsonDecoder.decodeString(jsonPath + ".type", json["type"]); | |
14793 } else { | |
14794 throw jsonDecoder.mismatch(jsonPath, "type"); | |
14795 } | |
14796 String name; | |
14797 if (json.containsKey("name")) { | |
14798 name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]); | |
14799 } else { | |
14800 throw jsonDecoder.mismatch(jsonPath, "name"); | |
14801 } | |
14802 String parameters; | |
14803 if (json.containsKey("parameters")) { | |
14804 parameters = jsonDecoder.decodeString( | |
14805 jsonPath + ".parameters", json["parameters"]); | |
14806 } | |
14807 return new RefactoringMethodParameter(kind, type, name, | |
14808 id: id, parameters: parameters); | |
14809 } else { | 9971 } else { |
14810 throw jsonDecoder.mismatch(jsonPath, "RefactoringMethodParameter", json); | 9972 throw jsonDecoder.mismatch(jsonPath, "moveFile options", json); |
14811 } | 9973 } |
14812 } | 9974 } |
14813 | 9975 |
| 9976 factory MoveFileOptions.fromRefactoringParams( |
| 9977 EditGetRefactoringParams refactoringParams, Request request) { |
| 9978 return new MoveFileOptions.fromJson( |
| 9979 new RequestDecoder(request), "options", refactoringParams.options); |
| 9980 } |
| 9981 |
14814 @override | 9982 @override |
14815 Map<String, dynamic> toJson() { | 9983 Map<String, dynamic> toJson() { |
14816 Map<String, dynamic> result = {}; | 9984 Map<String, dynamic> result = {}; |
14817 if (id != null) { | 9985 result["newFile"] = newFile; |
14818 result["id"] = id; | |
14819 } | |
14820 result["kind"] = kind.toJson(); | |
14821 result["type"] = type; | |
14822 result["name"] = name; | |
14823 if (parameters != null) { | |
14824 result["parameters"] = parameters; | |
14825 } | |
14826 return result; | 9986 return result; |
14827 } | 9987 } |
14828 | 9988 |
14829 @override | 9989 @override |
14830 String toString() => JSON.encode(toJson()); | 9990 String toString() => JSON.encode(toJson()); |
14831 | 9991 |
14832 @override | 9992 @override |
14833 bool operator ==(other) { | 9993 bool operator ==(other) { |
14834 if (other is RefactoringMethodParameter) { | 9994 if (other is MoveFileOptions) { |
14835 return id == other.id && | 9995 return newFile == other.newFile; |
14836 kind == other.kind && | |
14837 type == other.type && | |
14838 name == other.name && | |
14839 parameters == other.parameters; | |
14840 } | 9996 } |
14841 return false; | 9997 return false; |
14842 } | 9998 } |
14843 | 9999 |
14844 @override | 10000 @override |
14845 int get hashCode { | 10001 int get hashCode { |
14846 int hash = 0; | 10002 int hash = 0; |
14847 hash = JenkinsSmiHash.combine(hash, id.hashCode); | 10003 hash = JenkinsSmiHash.combine(hash, newFile.hashCode); |
14848 hash = JenkinsSmiHash.combine(hash, kind.hashCode); | |
14849 hash = JenkinsSmiHash.combine(hash, type.hashCode); | |
14850 hash = JenkinsSmiHash.combine(hash, name.hashCode); | |
14851 hash = JenkinsSmiHash.combine(hash, parameters.hashCode); | |
14852 return JenkinsSmiHash.finish(hash); | 10004 return JenkinsSmiHash.finish(hash); |
14853 } | 10005 } |
14854 } | 10006 } |
14855 | 10007 |
14856 /** | 10008 /** |
14857 * RefactoringMethodParameterKind | 10009 * OverriddenMember |
14858 * | 10010 * |
14859 * enum { | 10011 * { |
14860 * REQUIRED | 10012 * "element": Element |
14861 * POSITIONAL | 10013 * "className": String |
14862 * NAMED | |
14863 * } | 10014 * } |
14864 * | 10015 * |
14865 * Clients may not extend, implement or mix-in this class. | 10016 * Clients may not extend, implement or mix-in this class. |
14866 */ | 10017 */ |
14867 class RefactoringMethodParameterKind implements Enum { | 10018 class OverriddenMember implements HasToJson { |
14868 static const RefactoringMethodParameterKind REQUIRED = | 10019 Element _element; |
14869 const RefactoringMethodParameterKind._("REQUIRED"); | |
14870 | 10020 |
14871 static const RefactoringMethodParameterKind POSITIONAL = | 10021 String _className; |
14872 const RefactoringMethodParameterKind._("POSITIONAL"); | |
14873 | |
14874 static const RefactoringMethodParameterKind NAMED = | |
14875 const RefactoringMethodParameterKind._("NAMED"); | |
14876 | 10022 |
14877 /** | 10023 /** |
14878 * A list containing all of the enum values that are defined. | 10024 * The element that is being overridden. |
14879 */ | 10025 */ |
14880 static const List<RefactoringMethodParameterKind> VALUES = | 10026 Element get element => _element; |
14881 const <RefactoringMethodParameterKind>[REQUIRED, POSITIONAL, NAMED]; | |
14882 | 10027 |
14883 @override | 10028 /** |
14884 final String name; | 10029 * The element that is being overridden. |
14885 | 10030 */ |
14886 const RefactoringMethodParameterKind._(this.name); | 10031 void set element(Element value) { |
14887 | 10032 assert(value != null); |
14888 factory RefactoringMethodParameterKind(String name) { | 10033 this._element = value; |
14889 switch (name) { | |
14890 case "REQUIRED": | |
14891 return REQUIRED; | |
14892 case "POSITIONAL": | |
14893 return POSITIONAL; | |
14894 case "NAMED": | |
14895 return NAMED; | |
14896 } | |
14897 throw new Exception('Illegal enum value: $name'); | |
14898 } | 10034 } |
14899 | 10035 |
14900 factory RefactoringMethodParameterKind.fromJson( | 10036 /** |
14901 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 10037 * The name of the class in which the member is defined. |
14902 if (json is String) { | 10038 */ |
14903 try { | 10039 String get className => _className; |
14904 return new RefactoringMethodParameterKind(json); | 10040 |
14905 } catch (_) { | 10041 /** |
14906 // Fall through | 10042 * The name of the class in which the member is defined. |
14907 } | 10043 */ |
14908 } | 10044 void set className(String value) { |
14909 throw jsonDecoder.mismatch( | 10045 assert(value != null); |
14910 jsonPath, "RefactoringMethodParameterKind", json); | 10046 this._className = value; |
14911 } | 10047 } |
14912 | 10048 |
14913 @override | 10049 OverriddenMember(Element element, String className) { |
14914 String toString() => "RefactoringMethodParameterKind.$name"; | 10050 this.element = element; |
| 10051 this.className = className; |
| 10052 } |
14915 | 10053 |
14916 String toJson() => name; | 10054 factory OverriddenMember.fromJson( |
14917 } | 10055 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
14918 | 10056 if (json == null) { |
14919 /** | 10057 json = {}; |
14920 * RefactoringOptions | 10058 } |
14921 * | 10059 if (json is Map) { |
14922 * { | 10060 Element element; |
14923 * } | 10061 if (json.containsKey("element")) { |
14924 * | 10062 element = new Element.fromJson( |
14925 * Clients may not extend, implement or mix-in this class. | 10063 jsonDecoder, jsonPath + ".element", json["element"]); |
14926 */ | 10064 } else { |
14927 class RefactoringOptions implements HasToJson { | 10065 throw jsonDecoder.mismatch(jsonPath, "element"); |
14928 RefactoringOptions(); | 10066 } |
14929 | 10067 String className; |
14930 factory RefactoringOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, | 10068 if (json.containsKey("className")) { |
14931 Object json, RefactoringKind kind) { | 10069 className = jsonDecoder.decodeString( |
14932 return refactoringOptionsFromJson(jsonDecoder, jsonPath, json, kind); | 10070 jsonPath + ".className", json["className"]); |
| 10071 } else { |
| 10072 throw jsonDecoder.mismatch(jsonPath, "className"); |
| 10073 } |
| 10074 return new OverriddenMember(element, className); |
| 10075 } else { |
| 10076 throw jsonDecoder.mismatch(jsonPath, "OverriddenMember", json); |
| 10077 } |
14933 } | 10078 } |
14934 | 10079 |
14935 @override | 10080 @override |
14936 Map<String, dynamic> toJson() { | 10081 Map<String, dynamic> toJson() { |
14937 Map<String, dynamic> result = {}; | 10082 Map<String, dynamic> result = {}; |
| 10083 result["element"] = element.toJson(); |
| 10084 result["className"] = className; |
14938 return result; | 10085 return result; |
14939 } | 10086 } |
14940 | 10087 |
14941 @override | 10088 @override |
14942 String toString() => JSON.encode(toJson()); | 10089 String toString() => JSON.encode(toJson()); |
14943 | 10090 |
14944 @override | 10091 @override |
14945 bool operator ==(other) { | 10092 bool operator ==(other) { |
14946 if (other is RefactoringOptions) { | 10093 if (other is OverriddenMember) { |
14947 return true; | 10094 return element == other.element && className == other.className; |
14948 } | 10095 } |
14949 return false; | 10096 return false; |
14950 } | 10097 } |
14951 | 10098 |
14952 @override | 10099 @override |
14953 int get hashCode { | 10100 int get hashCode { |
14954 int hash = 0; | 10101 int hash = 0; |
| 10102 hash = JenkinsSmiHash.combine(hash, element.hashCode); |
| 10103 hash = JenkinsSmiHash.combine(hash, className.hashCode); |
14955 return JenkinsSmiHash.finish(hash); | 10104 return JenkinsSmiHash.finish(hash); |
14956 } | 10105 } |
14957 } | 10106 } |
14958 | 10107 |
14959 /** | 10108 /** |
14960 * RefactoringProblem | 10109 * Override |
14961 * | 10110 * |
14962 * { | 10111 * { |
14963 * "severity": RefactoringProblemSeverity | 10112 * "offset": int |
14964 * "message": String | 10113 * "length": int |
14965 * "location": optional Location | 10114 * "superclassMember": optional OverriddenMember |
| 10115 * "interfaceMembers": optional List<OverriddenMember> |
14966 * } | 10116 * } |
14967 * | 10117 * |
14968 * Clients may not extend, implement or mix-in this class. | 10118 * Clients may not extend, implement or mix-in this class. |
14969 */ | 10119 */ |
14970 class RefactoringProblem implements HasToJson { | 10120 class Override implements HasToJson { |
14971 RefactoringProblemSeverity _severity; | 10121 int _offset; |
14972 | 10122 |
14973 String _message; | 10123 int _length; |
14974 | 10124 |
14975 Location _location; | 10125 OverriddenMember _superclassMember; |
| 10126 |
| 10127 List<OverriddenMember> _interfaceMembers; |
14976 | 10128 |
14977 /** | 10129 /** |
14978 * The severity of the problem being represented. | 10130 * The offset of the name of the overriding member. |
14979 */ | 10131 */ |
14980 RefactoringProblemSeverity get severity => _severity; | 10132 int get offset => _offset; |
14981 | 10133 |
14982 /** | 10134 /** |
14983 * The severity of the problem being represented. | 10135 * The offset of the name of the overriding member. |
14984 */ | 10136 */ |
14985 void set severity(RefactoringProblemSeverity value) { | 10137 void set offset(int value) { |
14986 assert(value != null); | 10138 assert(value != null); |
14987 this._severity = value; | 10139 this._offset = value; |
14988 } | 10140 } |
14989 | 10141 |
14990 /** | 10142 /** |
14991 * A human-readable description of the problem being represented. | 10143 * The length of the name of the overriding member. |
14992 */ | 10144 */ |
14993 String get message => _message; | 10145 int get length => _length; |
14994 | 10146 |
14995 /** | 10147 /** |
14996 * A human-readable description of the problem being represented. | 10148 * The length of the name of the overriding member. |
14997 */ | 10149 */ |
14998 void set message(String value) { | 10150 void set length(int value) { |
14999 assert(value != null); | 10151 assert(value != null); |
15000 this._message = value; | 10152 this._length = value; |
15001 } | 10153 } |
15002 | 10154 |
15003 /** | 10155 /** |
15004 * The location of the problem being represented. This field is omitted | 10156 * The member inherited from a superclass that is overridden by the |
15005 * unless there is a specific location associated with the problem (such as a | 10157 * overriding member. The field is omitted if there is no superclass member, |
15006 * location where an element being renamed will be shadowed). | 10158 * in which case there must be at least one interface member. |
15007 */ | 10159 */ |
15008 Location get location => _location; | 10160 OverriddenMember get superclassMember => _superclassMember; |
15009 | 10161 |
15010 /** | 10162 /** |
15011 * The location of the problem being represented. This field is omitted | 10163 * The member inherited from a superclass that is overridden by the |
15012 * unless there is a specific location associated with the problem (such as a | 10164 * overriding member. The field is omitted if there is no superclass member, |
15013 * location where an element being renamed will be shadowed). | 10165 * in which case there must be at least one interface member. |
15014 */ | 10166 */ |
15015 void set location(Location value) { | 10167 void set superclassMember(OverriddenMember value) { |
15016 this._location = value; | 10168 this._superclassMember = value; |
15017 } | 10169 } |
15018 | 10170 |
15019 RefactoringProblem(RefactoringProblemSeverity severity, String message, | 10171 /** |
15020 {Location location}) { | 10172 * The members inherited from interfaces that are overridden by the |
15021 this.severity = severity; | 10173 * overriding member. The field is omitted if there are no interface members, |
15022 this.message = message; | 10174 * in which case there must be a superclass member. |
15023 this.location = location; | 10175 */ |
| 10176 List<OverriddenMember> get interfaceMembers => _interfaceMembers; |
| 10177 |
| 10178 /** |
| 10179 * The members inherited from interfaces that are overridden by the |
| 10180 * overriding member. The field is omitted if there are no interface members, |
| 10181 * in which case there must be a superclass member. |
| 10182 */ |
| 10183 void set interfaceMembers(List<OverriddenMember> value) { |
| 10184 this._interfaceMembers = value; |
15024 } | 10185 } |
15025 | 10186 |
15026 factory RefactoringProblem.fromJson( | 10187 Override(int offset, int length, |
| 10188 {OverriddenMember superclassMember, |
| 10189 List<OverriddenMember> interfaceMembers}) { |
| 10190 this.offset = offset; |
| 10191 this.length = length; |
| 10192 this.superclassMember = superclassMember; |
| 10193 this.interfaceMembers = interfaceMembers; |
| 10194 } |
| 10195 |
| 10196 factory Override.fromJson( |
15027 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 10197 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
15028 if (json == null) { | 10198 if (json == null) { |
15029 json = {}; | 10199 json = {}; |
15030 } | 10200 } |
15031 if (json is Map) { | 10201 if (json is Map) { |
15032 RefactoringProblemSeverity severity; | 10202 int offset; |
15033 if (json.containsKey("severity")) { | 10203 if (json.containsKey("offset")) { |
15034 severity = new RefactoringProblemSeverity.fromJson( | 10204 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); |
15035 jsonDecoder, jsonPath + ".severity", json["severity"]); | |
15036 } else { | 10205 } else { |
15037 throw jsonDecoder.mismatch(jsonPath, "severity"); | 10206 throw jsonDecoder.mismatch(jsonPath, "offset"); |
15038 } | 10207 } |
15039 String message; | 10208 int length; |
15040 if (json.containsKey("message")) { | 10209 if (json.containsKey("length")) { |
15041 message = | 10210 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); |
15042 jsonDecoder.decodeString(jsonPath + ".message", json["message"]); | |
15043 } else { | 10211 } else { |
15044 throw jsonDecoder.mismatch(jsonPath, "message"); | 10212 throw jsonDecoder.mismatch(jsonPath, "length"); |
15045 } | 10213 } |
15046 Location location; | 10214 OverriddenMember superclassMember; |
15047 if (json.containsKey("location")) { | 10215 if (json.containsKey("superclassMember")) { |
15048 location = new Location.fromJson( | 10216 superclassMember = new OverriddenMember.fromJson(jsonDecoder, |
15049 jsonDecoder, jsonPath + ".location", json["location"]); | 10217 jsonPath + ".superclassMember", json["superclassMember"]); |
15050 } | 10218 } |
15051 return new RefactoringProblem(severity, message, location: location); | 10219 List<OverriddenMember> interfaceMembers; |
| 10220 if (json.containsKey("interfaceMembers")) { |
| 10221 interfaceMembers = jsonDecoder.decodeList( |
| 10222 jsonPath + ".interfaceMembers", |
| 10223 json["interfaceMembers"], |
| 10224 (String jsonPath, Object json) => |
| 10225 new OverriddenMember.fromJson(jsonDecoder, jsonPath, json)); |
| 10226 } |
| 10227 return new Override(offset, length, |
| 10228 superclassMember: superclassMember, |
| 10229 interfaceMembers: interfaceMembers); |
15052 } else { | 10230 } else { |
15053 throw jsonDecoder.mismatch(jsonPath, "RefactoringProblem", json); | 10231 throw jsonDecoder.mismatch(jsonPath, "Override", json); |
15054 } | 10232 } |
15055 } | 10233 } |
15056 | 10234 |
15057 @override | 10235 @override |
15058 Map<String, dynamic> toJson() { | 10236 Map<String, dynamic> toJson() { |
15059 Map<String, dynamic> result = {}; | 10237 Map<String, dynamic> result = {}; |
15060 result["severity"] = severity.toJson(); | 10238 result["offset"] = offset; |
15061 result["message"] = message; | 10239 result["length"] = length; |
15062 if (location != null) { | 10240 if (superclassMember != null) { |
15063 result["location"] = location.toJson(); | 10241 result["superclassMember"] = superclassMember.toJson(); |
| 10242 } |
| 10243 if (interfaceMembers != null) { |
| 10244 result["interfaceMembers"] = interfaceMembers |
| 10245 .map((OverriddenMember value) => value.toJson()) |
| 10246 .toList(); |
15064 } | 10247 } |
15065 return result; | 10248 return result; |
15066 } | 10249 } |
15067 | 10250 |
15068 @override | 10251 @override |
15069 String toString() => JSON.encode(toJson()); | 10252 String toString() => JSON.encode(toJson()); |
15070 | 10253 |
15071 @override | 10254 @override |
15072 bool operator ==(other) { | 10255 bool operator ==(other) { |
15073 if (other is RefactoringProblem) { | 10256 if (other is Override) { |
15074 return severity == other.severity && | 10257 return offset == other.offset && |
15075 message == other.message && | 10258 length == other.length && |
15076 location == other.location; | 10259 superclassMember == other.superclassMember && |
| 10260 listEqual(interfaceMembers, other.interfaceMembers, |
| 10261 (OverriddenMember a, OverriddenMember b) => a == b); |
15077 } | 10262 } |
15078 return false; | 10263 return false; |
15079 } | 10264 } |
15080 | 10265 |
15081 @override | 10266 @override |
15082 int get hashCode { | 10267 int get hashCode { |
15083 int hash = 0; | 10268 int hash = 0; |
15084 hash = JenkinsSmiHash.combine(hash, severity.hashCode); | 10269 hash = JenkinsSmiHash.combine(hash, offset.hashCode); |
15085 hash = JenkinsSmiHash.combine(hash, message.hashCode); | 10270 hash = JenkinsSmiHash.combine(hash, length.hashCode); |
15086 hash = JenkinsSmiHash.combine(hash, location.hashCode); | 10271 hash = JenkinsSmiHash.combine(hash, superclassMember.hashCode); |
| 10272 hash = JenkinsSmiHash.combine(hash, interfaceMembers.hashCode); |
15087 return JenkinsSmiHash.finish(hash); | 10273 return JenkinsSmiHash.finish(hash); |
15088 } | 10274 } |
15089 } | 10275 } |
15090 | 10276 |
15091 /** | 10277 /** |
15092 * RefactoringProblemSeverity | 10278 * PubStatus |
15093 * | 10279 * |
15094 * enum { | 10280 * { |
15095 * INFO | 10281 * "isListingPackageDirs": bool |
15096 * WARNING | |
15097 * ERROR | |
15098 * FATAL | |
15099 * } | 10282 * } |
15100 * | 10283 * |
15101 * Clients may not extend, implement or mix-in this class. | 10284 * Clients may not extend, implement or mix-in this class. |
15102 */ | 10285 */ |
15103 class RefactoringProblemSeverity implements Enum { | 10286 class PubStatus implements HasToJson { |
15104 /** | 10287 bool _isListingPackageDirs; |
15105 * A minor code problem. No example, because it is not used yet. | |
15106 */ | |
15107 static const RefactoringProblemSeverity INFO = | |
15108 const RefactoringProblemSeverity._("INFO"); | |
15109 | 10288 |
15110 /** | 10289 /** |
15111 * A minor code problem. For example names of local variables should be camel | 10290 * True if the server is currently running pub to produce a list of package |
15112 * case and start with a lower case letter. Staring the name of a variable | 10291 * directories. |
15113 * with an upper case is OK from the language point of view, but it is nice | |
15114 * to warn the user. | |
15115 */ | 10292 */ |
15116 static const RefactoringProblemSeverity WARNING = | 10293 bool get isListingPackageDirs => _isListingPackageDirs; |
15117 const RefactoringProblemSeverity._("WARNING"); | |
15118 | 10294 |
15119 /** | 10295 /** |
15120 * The refactoring technically can be performed, but there is a logical | 10296 * True if the server is currently running pub to produce a list of package |
15121 * problem. For example the name of a local variable being extracted | 10297 * directories. |
15122 * conflicts with another name in the scope, or duplicate parameter names in | |
15123 * the method being extracted, or a conflict between a parameter name and a | |
15124 * local variable, etc. In some cases the location of the problem is also | |
15125 * provided, so the IDE can show user the location and the problem, and let | |
15126 * the user decide whether she wants to perform the refactoring. For example | |
15127 * the name conflict might be expected, and the user wants to fix it | |
15128 * afterwards. | |
15129 */ | 10298 */ |
15130 static const RefactoringProblemSeverity ERROR = | 10299 void set isListingPackageDirs(bool value) { |
15131 const RefactoringProblemSeverity._("ERROR"); | 10300 assert(value != null); |
15132 | 10301 this._isListingPackageDirs = value; |
15133 /** | |
15134 * A fatal error, which prevents performing the refactoring. For example the | |
15135 * name of a local variable being extracted is not a valid identifier, or | |
15136 * selection is not a valid expression. | |
15137 */ | |
15138 static const RefactoringProblemSeverity FATAL = | |
15139 const RefactoringProblemSeverity._("FATAL"); | |
15140 | |
15141 /** | |
15142 * A list containing all of the enum values that are defined. | |
15143 */ | |
15144 static const List<RefactoringProblemSeverity> VALUES = | |
15145 const <RefactoringProblemSeverity>[INFO, WARNING, ERROR, FATAL]; | |
15146 | |
15147 @override | |
15148 final String name; | |
15149 | |
15150 const RefactoringProblemSeverity._(this.name); | |
15151 | |
15152 factory RefactoringProblemSeverity(String name) { | |
15153 switch (name) { | |
15154 case "INFO": | |
15155 return INFO; | |
15156 case "WARNING": | |
15157 return WARNING; | |
15158 case "ERROR": | |
15159 return ERROR; | |
15160 case "FATAL": | |
15161 return FATAL; | |
15162 } | |
15163 throw new Exception('Illegal enum value: $name'); | |
15164 } | 10302 } |
15165 | 10303 |
15166 factory RefactoringProblemSeverity.fromJson( | 10304 PubStatus(bool isListingPackageDirs) { |
15167 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 10305 this.isListingPackageDirs = isListingPackageDirs; |
15168 if (json is String) { | |
15169 try { | |
15170 return new RefactoringProblemSeverity(json); | |
15171 } catch (_) { | |
15172 // Fall through | |
15173 } | |
15174 } | |
15175 throw jsonDecoder.mismatch(jsonPath, "RefactoringProblemSeverity", json); | |
15176 } | 10306 } |
15177 | 10307 |
15178 /** | 10308 factory PubStatus.fromJson( |
15179 * Returns the [RefactoringProblemSeverity] with the maximal severity. | |
15180 */ | |
15181 static RefactoringProblemSeverity max( | |
15182 RefactoringProblemSeverity a, RefactoringProblemSeverity b) => | |
15183 maxRefactoringProblemSeverity(a, b); | |
15184 | |
15185 @override | |
15186 String toString() => "RefactoringProblemSeverity.$name"; | |
15187 | |
15188 String toJson() => name; | |
15189 } | |
15190 | |
15191 /** | |
15192 * RemoveContentOverlay | |
15193 * | |
15194 * { | |
15195 * "type": "remove" | |
15196 * } | |
15197 * | |
15198 * Clients may not extend, implement or mix-in this class. | |
15199 */ | |
15200 class RemoveContentOverlay implements HasToJson { | |
15201 RemoveContentOverlay(); | |
15202 | |
15203 factory RemoveContentOverlay.fromJson( | |
15204 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 10309 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
15205 if (json == null) { | 10310 if (json == null) { |
15206 json = {}; | 10311 json = {}; |
15207 } | 10312 } |
15208 if (json is Map) { | 10313 if (json is Map) { |
15209 if (json["type"] != "remove") { | 10314 bool isListingPackageDirs; |
15210 throw jsonDecoder.mismatch(jsonPath, "equal " + "remove", json); | 10315 if (json.containsKey("isListingPackageDirs")) { |
| 10316 isListingPackageDirs = jsonDecoder.decodeBool( |
| 10317 jsonPath + ".isListingPackageDirs", json["isListingPackageDirs"]); |
| 10318 } else { |
| 10319 throw jsonDecoder.mismatch(jsonPath, "isListingPackageDirs"); |
15211 } | 10320 } |
15212 return new RemoveContentOverlay(); | 10321 return new PubStatus(isListingPackageDirs); |
15213 } else { | 10322 } else { |
15214 throw jsonDecoder.mismatch(jsonPath, "RemoveContentOverlay", json); | 10323 throw jsonDecoder.mismatch(jsonPath, "PubStatus", json); |
15215 } | 10324 } |
15216 } | 10325 } |
15217 | 10326 |
15218 @override | 10327 @override |
15219 Map<String, dynamic> toJson() { | 10328 Map<String, dynamic> toJson() { |
15220 Map<String, dynamic> result = {}; | 10329 Map<String, dynamic> result = {}; |
15221 result["type"] = "remove"; | 10330 result["isListingPackageDirs"] = isListingPackageDirs; |
15222 return result; | 10331 return result; |
15223 } | 10332 } |
15224 | 10333 |
| 10334 @override |
| 10335 String toString() => JSON.encode(toJson()); |
| 10336 |
| 10337 @override |
| 10338 bool operator ==(other) { |
| 10339 if (other is PubStatus) { |
| 10340 return isListingPackageDirs == other.isListingPackageDirs; |
| 10341 } |
| 10342 return false; |
| 10343 } |
| 10344 |
| 10345 @override |
| 10346 int get hashCode { |
| 10347 int hash = 0; |
| 10348 hash = JenkinsSmiHash.combine(hash, isListingPackageDirs.hashCode); |
| 10349 return JenkinsSmiHash.finish(hash); |
| 10350 } |
| 10351 } |
| 10352 |
| 10353 /** |
| 10354 * RefactoringFeedback |
| 10355 * |
| 10356 * { |
| 10357 * } |
| 10358 * |
| 10359 * Clients may not extend, implement or mix-in this class. |
| 10360 */ |
| 10361 class RefactoringFeedback implements HasToJson { |
| 10362 RefactoringFeedback(); |
| 10363 |
| 10364 factory RefactoringFeedback.fromJson( |
| 10365 JsonDecoder jsonDecoder, String jsonPath, Object json, Map responseJson) { |
| 10366 return refactoringFeedbackFromJson( |
| 10367 jsonDecoder, jsonPath, json, responseJson); |
| 10368 } |
| 10369 |
| 10370 @override |
| 10371 Map<String, dynamic> toJson() { |
| 10372 Map<String, dynamic> result = {}; |
| 10373 return result; |
| 10374 } |
| 10375 |
| 10376 @override |
| 10377 String toString() => JSON.encode(toJson()); |
| 10378 |
| 10379 @override |
| 10380 bool operator ==(other) { |
| 10381 if (other is RefactoringFeedback) { |
| 10382 return true; |
| 10383 } |
| 10384 return false; |
| 10385 } |
| 10386 |
| 10387 @override |
| 10388 int get hashCode { |
| 10389 int hash = 0; |
| 10390 return JenkinsSmiHash.finish(hash); |
| 10391 } |
| 10392 } |
| 10393 |
| 10394 /** |
| 10395 * RefactoringOptions |
| 10396 * |
| 10397 * { |
| 10398 * } |
| 10399 * |
| 10400 * Clients may not extend, implement or mix-in this class. |
| 10401 */ |
| 10402 class RefactoringOptions implements HasToJson { |
| 10403 RefactoringOptions(); |
| 10404 |
| 10405 factory RefactoringOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, |
| 10406 Object json, RefactoringKind kind) { |
| 10407 return refactoringOptionsFromJson(jsonDecoder, jsonPath, json, kind); |
| 10408 } |
| 10409 |
| 10410 @override |
| 10411 Map<String, dynamic> toJson() { |
| 10412 Map<String, dynamic> result = {}; |
| 10413 return result; |
| 10414 } |
| 10415 |
15225 @override | 10416 @override |
15226 String toString() => JSON.encode(toJson()); | 10417 String toString() => JSON.encode(toJson()); |
15227 | 10418 |
15228 @override | 10419 @override |
15229 bool operator ==(other) { | 10420 bool operator ==(other) { |
15230 if (other is RemoveContentOverlay) { | 10421 if (other is RefactoringOptions) { |
15231 return true; | 10422 return true; |
15232 } | 10423 } |
15233 return false; | 10424 return false; |
15234 } | 10425 } |
15235 | 10426 |
15236 @override | 10427 @override |
15237 int get hashCode { | 10428 int get hashCode { |
15238 int hash = 0; | 10429 int hash = 0; |
15239 hash = JenkinsSmiHash.combine(hash, 114870849); | |
15240 return JenkinsSmiHash.finish(hash); | 10430 return JenkinsSmiHash.finish(hash); |
15241 } | 10431 } |
15242 } | 10432 } |
15243 | 10433 |
15244 /** | 10434 /** |
15245 * rename feedback | 10435 * rename feedback |
15246 * | 10436 * |
15247 * { | 10437 * { |
15248 * "offset": int | 10438 * "offset": int |
15249 * "length": int | 10439 * "length": int |
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16587 result["pattern"] = pattern; | 11777 result["pattern"] = pattern; |
16588 return result; | 11778 return result; |
16589 } | 11779 } |
16590 | 11780 |
16591 @override | 11781 @override |
16592 Request toRequest(String id) { | 11782 Request toRequest(String id) { |
16593 return new Request(id, "search.findTopLevelDeclarations", toJson()); | 11783 return new Request(id, "search.findTopLevelDeclarations", toJson()); |
16594 } | 11784 } |
16595 | 11785 |
16596 @override | 11786 @override |
16597 String toString() => JSON.encode(toJson()); | |
16598 | |
16599 @override | |
16600 bool operator ==(other) { | |
16601 if (other is SearchFindTopLevelDeclarationsParams) { | |
16602 return pattern == other.pattern; | |
16603 } | |
16604 return false; | |
16605 } | |
16606 | |
16607 @override | |
16608 int get hashCode { | |
16609 int hash = 0; | |
16610 hash = JenkinsSmiHash.combine(hash, pattern.hashCode); | |
16611 return JenkinsSmiHash.finish(hash); | |
16612 } | |
16613 } | |
16614 | |
16615 /** | |
16616 * search.findTopLevelDeclarations result | |
16617 * | |
16618 * { | |
16619 * "id": SearchId | |
16620 * } | |
16621 * | |
16622 * Clients may not extend, implement or mix-in this class. | |
16623 */ | |
16624 class SearchFindTopLevelDeclarationsResult implements ResponseResult { | |
16625 String _id; | |
16626 | |
16627 /** | |
16628 * The identifier used to associate results with this search request. | |
16629 */ | |
16630 String get id => _id; | |
16631 | |
16632 /** | |
16633 * The identifier used to associate results with this search request. | |
16634 */ | |
16635 void set id(String value) { | |
16636 assert(value != null); | |
16637 this._id = value; | |
16638 } | |
16639 | |
16640 SearchFindTopLevelDeclarationsResult(String id) { | |
16641 this.id = id; | |
16642 } | |
16643 | |
16644 factory SearchFindTopLevelDeclarationsResult.fromJson( | |
16645 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
16646 if (json == null) { | |
16647 json = {}; | |
16648 } | |
16649 if (json is Map) { | |
16650 String id; | |
16651 if (json.containsKey("id")) { | |
16652 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); | |
16653 } else { | |
16654 throw jsonDecoder.mismatch(jsonPath, "id"); | |
16655 } | |
16656 return new SearchFindTopLevelDeclarationsResult(id); | |
16657 } else { | |
16658 throw jsonDecoder.mismatch( | |
16659 jsonPath, "search.findTopLevelDeclarations result", json); | |
16660 } | |
16661 } | |
16662 | |
16663 factory SearchFindTopLevelDeclarationsResult.fromResponse(Response response) { | |
16664 return new SearchFindTopLevelDeclarationsResult.fromJson( | |
16665 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | |
16666 "result", | |
16667 response.result); | |
16668 } | |
16669 | |
16670 @override | |
16671 Map<String, dynamic> toJson() { | |
16672 Map<String, dynamic> result = {}; | |
16673 result["id"] = id; | |
16674 return result; | |
16675 } | |
16676 | |
16677 @override | |
16678 Response toResponse(String id) { | |
16679 return new Response(id, result: toJson()); | |
16680 } | |
16681 | |
16682 @override | |
16683 String toString() => JSON.encode(toJson()); | |
16684 | |
16685 @override | |
16686 bool operator ==(other) { | |
16687 if (other is SearchFindTopLevelDeclarationsResult) { | |
16688 return id == other.id; | |
16689 } | |
16690 return false; | |
16691 } | |
16692 | |
16693 @override | |
16694 int get hashCode { | |
16695 int hash = 0; | |
16696 hash = JenkinsSmiHash.combine(hash, id.hashCode); | |
16697 return JenkinsSmiHash.finish(hash); | |
16698 } | |
16699 } | |
16700 | |
16701 /** | |
16702 * search.getTypeHierarchy params | |
16703 * | |
16704 * { | |
16705 * "file": FilePath | |
16706 * "offset": int | |
16707 * "superOnly": optional bool | |
16708 * } | |
16709 * | |
16710 * Clients may not extend, implement or mix-in this class. | |
16711 */ | |
16712 class SearchGetTypeHierarchyParams implements RequestParams { | |
16713 String _file; | |
16714 | |
16715 int _offset; | |
16716 | |
16717 bool _superOnly; | |
16718 | |
16719 /** | |
16720 * The file containing the declaration or reference to the type for which a | |
16721 * hierarchy is being requested. | |
16722 */ | |
16723 String get file => _file; | |
16724 | |
16725 /** | |
16726 * The file containing the declaration or reference to the type for which a | |
16727 * hierarchy is being requested. | |
16728 */ | |
16729 void set file(String value) { | |
16730 assert(value != null); | |
16731 this._file = value; | |
16732 } | |
16733 | |
16734 /** | |
16735 * The offset of the name of the type within the file. | |
16736 */ | |
16737 int get offset => _offset; | |
16738 | |
16739 /** | |
16740 * The offset of the name of the type within the file. | |
16741 */ | |
16742 void set offset(int value) { | |
16743 assert(value != null); | |
16744 this._offset = value; | |
16745 } | |
16746 | |
16747 /** | |
16748 * True if the client is only requesting superclasses and interfaces | |
16749 * hierarchy. | |
16750 */ | |
16751 bool get superOnly => _superOnly; | |
16752 | |
16753 /** | |
16754 * True if the client is only requesting superclasses and interfaces | |
16755 * hierarchy. | |
16756 */ | |
16757 void set superOnly(bool value) { | |
16758 this._superOnly = value; | |
16759 } | |
16760 | |
16761 SearchGetTypeHierarchyParams(String file, int offset, {bool superOnly}) { | |
16762 this.file = file; | |
16763 this.offset = offset; | |
16764 this.superOnly = superOnly; | |
16765 } | |
16766 | |
16767 factory SearchGetTypeHierarchyParams.fromJson( | |
16768 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
16769 if (json == null) { | |
16770 json = {}; | |
16771 } | |
16772 if (json is Map) { | |
16773 String file; | |
16774 if (json.containsKey("file")) { | |
16775 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
16776 } else { | |
16777 throw jsonDecoder.mismatch(jsonPath, "file"); | |
16778 } | |
16779 int offset; | |
16780 if (json.containsKey("offset")) { | |
16781 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | |
16782 } else { | |
16783 throw jsonDecoder.mismatch(jsonPath, "offset"); | |
16784 } | |
16785 bool superOnly; | |
16786 if (json.containsKey("superOnly")) { | |
16787 superOnly = | |
16788 jsonDecoder.decodeBool(jsonPath + ".superOnly", json["superOnly"]); | |
16789 } | |
16790 return new SearchGetTypeHierarchyParams(file, offset, | |
16791 superOnly: superOnly); | |
16792 } else { | |
16793 throw jsonDecoder.mismatch( | |
16794 jsonPath, "search.getTypeHierarchy params", json); | |
16795 } | |
16796 } | |
16797 | |
16798 factory SearchGetTypeHierarchyParams.fromRequest(Request request) { | |
16799 return new SearchGetTypeHierarchyParams.fromJson( | |
16800 new RequestDecoder(request), "params", request.params); | |
16801 } | |
16802 | |
16803 @override | |
16804 Map<String, dynamic> toJson() { | |
16805 Map<String, dynamic> result = {}; | |
16806 result["file"] = file; | |
16807 result["offset"] = offset; | |
16808 if (superOnly != null) { | |
16809 result["superOnly"] = superOnly; | |
16810 } | |
16811 return result; | |
16812 } | |
16813 | |
16814 @override | |
16815 Request toRequest(String id) { | |
16816 return new Request(id, "search.getTypeHierarchy", toJson()); | |
16817 } | |
16818 | |
16819 @override | |
16820 String toString() => JSON.encode(toJson()); | 11787 String toString() => JSON.encode(toJson()); |
16821 | 11788 |
16822 @override | 11789 @override |
16823 bool operator ==(other) { | 11790 bool operator ==(other) { |
16824 if (other is SearchGetTypeHierarchyParams) { | 11791 if (other is SearchFindTopLevelDeclarationsParams) { |
16825 return file == other.file && | 11792 return pattern == other.pattern; |
16826 offset == other.offset && | |
16827 superOnly == other.superOnly; | |
16828 } | 11793 } |
16829 return false; | 11794 return false; |
16830 } | 11795 } |
16831 | 11796 |
16832 @override | 11797 @override |
16833 int get hashCode { | 11798 int get hashCode { |
16834 int hash = 0; | 11799 int hash = 0; |
16835 hash = JenkinsSmiHash.combine(hash, file.hashCode); | 11800 hash = JenkinsSmiHash.combine(hash, pattern.hashCode); |
16836 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
16837 hash = JenkinsSmiHash.combine(hash, superOnly.hashCode); | |
16838 return JenkinsSmiHash.finish(hash); | 11801 return JenkinsSmiHash.finish(hash); |
16839 } | 11802 } |
16840 } | 11803 } |
16841 | 11804 |
16842 /** | 11805 /** |
16843 * search.getTypeHierarchy result | 11806 * search.findTopLevelDeclarations result |
16844 * | 11807 * |
16845 * { | 11808 * { |
16846 * "hierarchyItems": optional List<TypeHierarchyItem> | 11809 * "id": SearchId |
16847 * } | 11810 * } |
16848 * | 11811 * |
16849 * Clients may not extend, implement or mix-in this class. | 11812 * Clients may not extend, implement or mix-in this class. |
16850 */ | 11813 */ |
16851 class SearchGetTypeHierarchyResult implements ResponseResult { | 11814 class SearchFindTopLevelDeclarationsResult implements ResponseResult { |
16852 List<TypeHierarchyItem> _hierarchyItems; | 11815 String _id; |
16853 | 11816 |
16854 /** | 11817 /** |
16855 * A list of the types in the requested hierarchy. The first element of the | 11818 * The identifier used to associate results with this search request. |
16856 * list is the item representing the type for which the hierarchy was | |
16857 * requested. The index of other elements of the list is unspecified, but | |
16858 * correspond to the integers used to reference supertype and subtype items | |
16859 * within the items. | |
16860 * | |
16861 * This field will be absent if the code at the given file and offset does | |
16862 * not represent a type, or if the file has not been sufficiently analyzed to | |
16863 * allow a type hierarchy to be produced. | |
16864 */ | 11819 */ |
16865 List<TypeHierarchyItem> get hierarchyItems => _hierarchyItems; | 11820 String get id => _id; |
16866 | 11821 |
16867 /** | 11822 /** |
16868 * A list of the types in the requested hierarchy. The first element of the | 11823 * The identifier used to associate results with this search request. |
16869 * list is the item representing the type for which the hierarchy was | |
16870 * requested. The index of other elements of the list is unspecified, but | |
16871 * correspond to the integers used to reference supertype and subtype items | |
16872 * within the items. | |
16873 * | |
16874 * This field will be absent if the code at the given file and offset does | |
16875 * not represent a type, or if the file has not been sufficiently analyzed to | |
16876 * allow a type hierarchy to be produced. | |
16877 */ | 11824 */ |
16878 void set hierarchyItems(List<TypeHierarchyItem> value) { | 11825 void set id(String value) { |
16879 this._hierarchyItems = value; | 11826 assert(value != null); |
| 11827 this._id = value; |
16880 } | 11828 } |
16881 | 11829 |
16882 SearchGetTypeHierarchyResult({List<TypeHierarchyItem> hierarchyItems}) { | 11830 SearchFindTopLevelDeclarationsResult(String id) { |
16883 this.hierarchyItems = hierarchyItems; | 11831 this.id = id; |
16884 } | 11832 } |
16885 | 11833 |
16886 factory SearchGetTypeHierarchyResult.fromJson( | 11834 factory SearchFindTopLevelDeclarationsResult.fromJson( |
16887 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 11835 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
16888 if (json == null) { | 11836 if (json == null) { |
16889 json = {}; | 11837 json = {}; |
16890 } | 11838 } |
16891 if (json is Map) { | 11839 if (json is Map) { |
16892 List<TypeHierarchyItem> hierarchyItems; | 11840 String id; |
16893 if (json.containsKey("hierarchyItems")) { | 11841 if (json.containsKey("id")) { |
16894 hierarchyItems = jsonDecoder.decodeList( | 11842 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); |
16895 jsonPath + ".hierarchyItems", | 11843 } else { |
16896 json["hierarchyItems"], | 11844 throw jsonDecoder.mismatch(jsonPath, "id"); |
16897 (String jsonPath, Object json) => | |
16898 new TypeHierarchyItem.fromJson(jsonDecoder, jsonPath, json)); | |
16899 } | 11845 } |
16900 return new SearchGetTypeHierarchyResult(hierarchyItems: hierarchyItems); | 11846 return new SearchFindTopLevelDeclarationsResult(id); |
16901 } else { | 11847 } else { |
16902 throw jsonDecoder.mismatch( | 11848 throw jsonDecoder.mismatch( |
16903 jsonPath, "search.getTypeHierarchy result", json); | 11849 jsonPath, "search.findTopLevelDeclarations result", json); |
16904 } | 11850 } |
16905 } | 11851 } |
16906 | 11852 |
16907 factory SearchGetTypeHierarchyResult.fromResponse(Response response) { | 11853 factory SearchFindTopLevelDeclarationsResult.fromResponse(Response response) { |
16908 return new SearchGetTypeHierarchyResult.fromJson( | 11854 return new SearchFindTopLevelDeclarationsResult.fromJson( |
16909 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | 11855 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), |
16910 "result", | 11856 "result", |
16911 response.result); | 11857 response.result); |
16912 } | 11858 } |
16913 | 11859 |
16914 @override | 11860 @override |
16915 Map<String, dynamic> toJson() { | 11861 Map<String, dynamic> toJson() { |
16916 Map<String, dynamic> result = {}; | 11862 Map<String, dynamic> result = {}; |
16917 if (hierarchyItems != null) { | 11863 result["id"] = id; |
16918 result["hierarchyItems"] = hierarchyItems | |
16919 .map((TypeHierarchyItem value) => value.toJson()) | |
16920 .toList(); | |
16921 } | |
16922 return result; | 11864 return result; |
16923 } | 11865 } |
16924 | 11866 |
16925 @override | 11867 @override |
16926 Response toResponse(String id) { | 11868 Response toResponse(String id) { |
16927 return new Response(id, result: toJson()); | 11869 return new Response(id, result: toJson()); |
16928 } | 11870 } |
16929 | 11871 |
16930 @override | 11872 @override |
16931 String toString() => JSON.encode(toJson()); | 11873 String toString() => JSON.encode(toJson()); |
16932 | 11874 |
16933 @override | 11875 @override |
16934 bool operator ==(other) { | 11876 bool operator ==(other) { |
16935 if (other is SearchGetTypeHierarchyResult) { | 11877 if (other is SearchFindTopLevelDeclarationsResult) { |
16936 return listEqual(hierarchyItems, other.hierarchyItems, | 11878 return id == other.id; |
16937 (TypeHierarchyItem a, TypeHierarchyItem b) => a == b); | |
16938 } | 11879 } |
16939 return false; | 11880 return false; |
16940 } | 11881 } |
16941 | 11882 |
16942 @override | 11883 @override |
16943 int get hashCode { | 11884 int get hashCode { |
16944 int hash = 0; | 11885 int hash = 0; |
16945 hash = JenkinsSmiHash.combine(hash, hierarchyItems.hashCode); | 11886 hash = JenkinsSmiHash.combine(hash, id.hashCode); |
16946 return JenkinsSmiHash.finish(hash); | 11887 return JenkinsSmiHash.finish(hash); |
16947 } | 11888 } |
16948 } | 11889 } |
16949 | 11890 |
16950 /** | 11891 /** |
16951 * SearchResult | 11892 * search.getTypeHierarchy params |
16952 * | 11893 * |
16953 * { | 11894 * { |
16954 * "location": Location | 11895 * "file": FilePath |
16955 * "kind": SearchResultKind | 11896 * "offset": int |
16956 * "isPotential": bool | 11897 * "superOnly": optional bool |
16957 * "path": List<Element> | |
16958 * } | 11898 * } |
16959 * | 11899 * |
16960 * Clients may not extend, implement or mix-in this class. | 11900 * Clients may not extend, implement or mix-in this class. |
16961 */ | 11901 */ |
16962 class SearchResult implements HasToJson { | 11902 class SearchGetTypeHierarchyParams implements RequestParams { |
16963 Location _location; | 11903 String _file; |
16964 | 11904 |
16965 SearchResultKind _kind; | 11905 int _offset; |
16966 | 11906 |
16967 bool _isPotential; | 11907 bool _superOnly; |
16968 | |
16969 List<Element> _path; | |
16970 | 11908 |
16971 /** | 11909 /** |
16972 * The location of the code that matched the search criteria. | 11910 * The file containing the declaration or reference to the type for which a |
| 11911 * hierarchy is being requested. |
16973 */ | 11912 */ |
16974 Location get location => _location; | 11913 String get file => _file; |
16975 | 11914 |
16976 /** | 11915 /** |
16977 * The location of the code that matched the search criteria. | 11916 * The file containing the declaration or reference to the type for which a |
| 11917 * hierarchy is being requested. |
16978 */ | 11918 */ |
16979 void set location(Location value) { | 11919 void set file(String value) { |
16980 assert(value != null); | 11920 assert(value != null); |
16981 this._location = value; | 11921 this._file = value; |
16982 } | 11922 } |
16983 | 11923 |
16984 /** | 11924 /** |
16985 * The kind of element that was found or the kind of reference that was | 11925 * The offset of the name of the type within the file. |
16986 * found. | |
16987 */ | 11926 */ |
16988 SearchResultKind get kind => _kind; | 11927 int get offset => _offset; |
16989 | 11928 |
16990 /** | 11929 /** |
16991 * The kind of element that was found or the kind of reference that was | 11930 * The offset of the name of the type within the file. |
16992 * found. | |
16993 */ | 11931 */ |
16994 void set kind(SearchResultKind value) { | 11932 void set offset(int value) { |
16995 assert(value != null); | 11933 assert(value != null); |
16996 this._kind = value; | 11934 this._offset = value; |
16997 } | 11935 } |
16998 | 11936 |
16999 /** | 11937 /** |
17000 * True if the result is a potential match but cannot be confirmed to be a | 11938 * True if the client is only requesting superclasses and interfaces |
17001 * match. For example, if all references to a method m defined in some class | 11939 * hierarchy. |
17002 * were requested, and a reference to a method m from an unknown class were | |
17003 * found, it would be marked as being a potential match. | |
17004 */ | 11940 */ |
17005 bool get isPotential => _isPotential; | 11941 bool get superOnly => _superOnly; |
17006 | 11942 |
17007 /** | 11943 /** |
17008 * True if the result is a potential match but cannot be confirmed to be a | 11944 * True if the client is only requesting superclasses and interfaces |
17009 * match. For example, if all references to a method m defined in some class | 11945 * hierarchy. |
17010 * were requested, and a reference to a method m from an unknown class were | |
17011 * found, it would be marked as being a potential match. | |
17012 */ | 11946 */ |
17013 void set isPotential(bool value) { | 11947 void set superOnly(bool value) { |
17014 assert(value != null); | 11948 this._superOnly = value; |
17015 this._isPotential = value; | |
17016 } | 11949 } |
17017 | 11950 |
17018 /** | 11951 SearchGetTypeHierarchyParams(String file, int offset, {bool superOnly}) { |
17019 * The elements that contain the result, starting with the most immediately | 11952 this.file = file; |
17020 * enclosing ancestor and ending with the library. | 11953 this.offset = offset; |
17021 */ | 11954 this.superOnly = superOnly; |
17022 List<Element> get path => _path; | |
17023 | |
17024 /** | |
17025 * The elements that contain the result, starting with the most immediately | |
17026 * enclosing ancestor and ending with the library. | |
17027 */ | |
17028 void set path(List<Element> value) { | |
17029 assert(value != null); | |
17030 this._path = value; | |
17031 } | 11955 } |
17032 | 11956 |
17033 SearchResult(Location location, SearchResultKind kind, bool isPotential, | 11957 factory SearchGetTypeHierarchyParams.fromJson( |
17034 List<Element> path) { | |
17035 this.location = location; | |
17036 this.kind = kind; | |
17037 this.isPotential = isPotential; | |
17038 this.path = path; | |
17039 } | |
17040 | |
17041 factory SearchResult.fromJson( | |
17042 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 11958 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
17043 if (json == null) { | 11959 if (json == null) { |
17044 json = {}; | 11960 json = {}; |
17045 } | 11961 } |
17046 if (json is Map) { | 11962 if (json is Map) { |
17047 Location location; | 11963 String file; |
17048 if (json.containsKey("location")) { | 11964 if (json.containsKey("file")) { |
17049 location = new Location.fromJson( | 11965 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); |
17050 jsonDecoder, jsonPath + ".location", json["location"]); | |
17051 } else { | 11966 } else { |
17052 throw jsonDecoder.mismatch(jsonPath, "location"); | 11967 throw jsonDecoder.mismatch(jsonPath, "file"); |
17053 } | 11968 } |
17054 SearchResultKind kind; | 11969 int offset; |
17055 if (json.containsKey("kind")) { | 11970 if (json.containsKey("offset")) { |
17056 kind = new SearchResultKind.fromJson( | 11971 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); |
17057 jsonDecoder, jsonPath + ".kind", json["kind"]); | |
17058 } else { | 11972 } else { |
17059 throw jsonDecoder.mismatch(jsonPath, "kind"); | 11973 throw jsonDecoder.mismatch(jsonPath, "offset"); |
17060 } | 11974 } |
17061 bool isPotential; | 11975 bool superOnly; |
17062 if (json.containsKey("isPotential")) { | 11976 if (json.containsKey("superOnly")) { |
17063 isPotential = jsonDecoder.decodeBool( | 11977 superOnly = |
17064 jsonPath + ".isPotential", json["isPotential"]); | 11978 jsonDecoder.decodeBool(jsonPath + ".superOnly", json["superOnly"]); |
17065 } else { | |
17066 throw jsonDecoder.mismatch(jsonPath, "isPotential"); | |
17067 } | 11979 } |
17068 List<Element> path; | 11980 return new SearchGetTypeHierarchyParams(file, offset, |
17069 if (json.containsKey("path")) { | 11981 superOnly: superOnly); |
17070 path = jsonDecoder.decodeList( | |
17071 jsonPath + ".path", | |
17072 json["path"], | |
17073 (String jsonPath, Object json) => | |
17074 new Element.fromJson(jsonDecoder, jsonPath, json)); | |
17075 } else { | |
17076 throw jsonDecoder.mismatch(jsonPath, "path"); | |
17077 } | |
17078 return new SearchResult(location, kind, isPotential, path); | |
17079 } else { | 11982 } else { |
17080 throw jsonDecoder.mismatch(jsonPath, "SearchResult", json); | 11983 throw jsonDecoder.mismatch( |
| 11984 jsonPath, "search.getTypeHierarchy params", json); |
17081 } | 11985 } |
17082 } | 11986 } |
17083 | 11987 |
| 11988 factory SearchGetTypeHierarchyParams.fromRequest(Request request) { |
| 11989 return new SearchGetTypeHierarchyParams.fromJson( |
| 11990 new RequestDecoder(request), "params", request.params); |
| 11991 } |
| 11992 |
17084 @override | 11993 @override |
17085 Map<String, dynamic> toJson() { | 11994 Map<String, dynamic> toJson() { |
17086 Map<String, dynamic> result = {}; | 11995 Map<String, dynamic> result = {}; |
17087 result["location"] = location.toJson(); | 11996 result["file"] = file; |
17088 result["kind"] = kind.toJson(); | 11997 result["offset"] = offset; |
17089 result["isPotential"] = isPotential; | 11998 if (superOnly != null) { |
17090 result["path"] = path.map((Element value) => value.toJson()).toList(); | 11999 result["superOnly"] = superOnly; |
| 12000 } |
17091 return result; | 12001 return result; |
17092 } | 12002 } |
17093 | 12003 |
17094 @override | 12004 @override |
| 12005 Request toRequest(String id) { |
| 12006 return new Request(id, "search.getTypeHierarchy", toJson()); |
| 12007 } |
| 12008 |
| 12009 @override |
17095 String toString() => JSON.encode(toJson()); | 12010 String toString() => JSON.encode(toJson()); |
17096 | 12011 |
17097 @override | 12012 @override |
17098 bool operator ==(other) { | 12013 bool operator ==(other) { |
17099 if (other is SearchResult) { | 12014 if (other is SearchGetTypeHierarchyParams) { |
17100 return location == other.location && | 12015 return file == other.file && |
17101 kind == other.kind && | 12016 offset == other.offset && |
17102 isPotential == other.isPotential && | 12017 superOnly == other.superOnly; |
17103 listEqual(path, other.path, (Element a, Element b) => a == b); | |
17104 } | 12018 } |
17105 return false; | 12019 return false; |
17106 } | 12020 } |
17107 | 12021 |
17108 @override | 12022 @override |
17109 int get hashCode { | 12023 int get hashCode { |
17110 int hash = 0; | 12024 int hash = 0; |
17111 hash = JenkinsSmiHash.combine(hash, location.hashCode); | 12025 hash = JenkinsSmiHash.combine(hash, file.hashCode); |
17112 hash = JenkinsSmiHash.combine(hash, kind.hashCode); | 12026 hash = JenkinsSmiHash.combine(hash, offset.hashCode); |
17113 hash = JenkinsSmiHash.combine(hash, isPotential.hashCode); | 12027 hash = JenkinsSmiHash.combine(hash, superOnly.hashCode); |
17114 hash = JenkinsSmiHash.combine(hash, path.hashCode); | |
17115 return JenkinsSmiHash.finish(hash); | 12028 return JenkinsSmiHash.finish(hash); |
17116 } | 12029 } |
17117 } | 12030 } |
17118 | 12031 |
17119 /** | 12032 /** |
17120 * SearchResultKind | 12033 * search.getTypeHierarchy result |
17121 * | 12034 * |
17122 * enum { | 12035 * { |
17123 * DECLARATION | 12036 * "hierarchyItems": optional List<TypeHierarchyItem> |
17124 * INVOCATION | |
17125 * READ | |
17126 * READ_WRITE | |
17127 * REFERENCE | |
17128 * UNKNOWN | |
17129 * WRITE | |
17130 * } | 12037 * } |
17131 * | 12038 * |
17132 * Clients may not extend, implement or mix-in this class. | 12039 * Clients may not extend, implement or mix-in this class. |
17133 */ | 12040 */ |
17134 class SearchResultKind implements Enum { | 12041 class SearchGetTypeHierarchyResult implements ResponseResult { |
17135 /** | 12042 List<TypeHierarchyItem> _hierarchyItems; |
17136 * The declaration of an element. | 12043 |
17137 */ | 12044 /** |
17138 static const SearchResultKind DECLARATION = | 12045 * A list of the types in the requested hierarchy. The first element of the |
17139 const SearchResultKind._("DECLARATION"); | 12046 * list is the item representing the type for which the hierarchy was |
17140 | 12047 * requested. The index of other elements of the list is unspecified, but |
17141 /** | 12048 * correspond to the integers used to reference supertype and subtype items |
17142 * The invocation of a function or method. | 12049 * within the items. |
17143 */ | 12050 * |
17144 static const SearchResultKind INVOCATION = | 12051 * This field will be absent if the code at the given file and offset does |
17145 const SearchResultKind._("INVOCATION"); | 12052 * not represent a type, or if the file has not been sufficiently analyzed to |
17146 | 12053 * allow a type hierarchy to be produced. |
17147 /** | 12054 */ |
17148 * A reference to a field, parameter or variable where it is being read. | 12055 List<TypeHierarchyItem> get hierarchyItems => _hierarchyItems; |
17149 */ | 12056 |
17150 static const SearchResultKind READ = const SearchResultKind._("READ"); | 12057 /** |
17151 | 12058 * A list of the types in the requested hierarchy. The first element of the |
17152 /** | 12059 * list is the item representing the type for which the hierarchy was |
17153 * A reference to a field, parameter or variable where it is being read and | 12060 * requested. The index of other elements of the list is unspecified, but |
17154 * written. | 12061 * correspond to the integers used to reference supertype and subtype items |
17155 */ | 12062 * within the items. |
17156 static const SearchResultKind READ_WRITE = | 12063 * |
17157 const SearchResultKind._("READ_WRITE"); | 12064 * This field will be absent if the code at the given file and offset does |
17158 | 12065 * not represent a type, or if the file has not been sufficiently analyzed to |
17159 /** | 12066 * allow a type hierarchy to be produced. |
17160 * A reference to an element. | 12067 */ |
17161 */ | 12068 void set hierarchyItems(List<TypeHierarchyItem> value) { |
17162 static const SearchResultKind REFERENCE = | 12069 this._hierarchyItems = value; |
17163 const SearchResultKind._("REFERENCE"); | 12070 } |
17164 | 12071 |
17165 /** | 12072 SearchGetTypeHierarchyResult({List<TypeHierarchyItem> hierarchyItems}) { |
17166 * Some other kind of search result. | 12073 this.hierarchyItems = hierarchyItems; |
17167 */ | 12074 } |
17168 static const SearchResultKind UNKNOWN = const SearchResultKind._("UNKNOWN"); | 12075 |
17169 | 12076 factory SearchGetTypeHierarchyResult.fromJson( |
17170 /** | |
17171 * A reference to a field, parameter or variable where it is being written. | |
17172 */ | |
17173 static const SearchResultKind WRITE = const SearchResultKind._("WRITE"); | |
17174 | |
17175 /** | |
17176 * A list containing all of the enum values that are defined. | |
17177 */ | |
17178 static const List<SearchResultKind> VALUES = const <SearchResultKind>[ | |
17179 DECLARATION, | |
17180 INVOCATION, | |
17181 READ, | |
17182 READ_WRITE, | |
17183 REFERENCE, | |
17184 UNKNOWN, | |
17185 WRITE | |
17186 ]; | |
17187 | |
17188 @override | |
17189 final String name; | |
17190 | |
17191 const SearchResultKind._(this.name); | |
17192 | |
17193 factory SearchResultKind(String name) { | |
17194 switch (name) { | |
17195 case "DECLARATION": | |
17196 return DECLARATION; | |
17197 case "INVOCATION": | |
17198 return INVOCATION; | |
17199 case "READ": | |
17200 return READ; | |
17201 case "READ_WRITE": | |
17202 return READ_WRITE; | |
17203 case "REFERENCE": | |
17204 return REFERENCE; | |
17205 case "UNKNOWN": | |
17206 return UNKNOWN; | |
17207 case "WRITE": | |
17208 return WRITE; | |
17209 } | |
17210 throw new Exception('Illegal enum value: $name'); | |
17211 } | |
17212 | |
17213 factory SearchResultKind.fromJson( | |
17214 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
17215 if (json is String) { | |
17216 try { | |
17217 return new SearchResultKind(json); | |
17218 } catch (_) { | |
17219 // Fall through | |
17220 } | |
17221 } | |
17222 throw jsonDecoder.mismatch(jsonPath, "SearchResultKind", json); | |
17223 } | |
17224 | |
17225 @override | |
17226 String toString() => "SearchResultKind.$name"; | |
17227 | |
17228 String toJson() => name; | |
17229 } | |
17230 | |
17231 /** | |
17232 * search.results params | |
17233 * | |
17234 * { | |
17235 * "id": SearchId | |
17236 * "results": List<SearchResult> | |
17237 * "isLast": bool | |
17238 * } | |
17239 * | |
17240 * Clients may not extend, implement or mix-in this class. | |
17241 */ | |
17242 class SearchResultsParams implements HasToJson { | |
17243 String _id; | |
17244 | |
17245 List<SearchResult> _results; | |
17246 | |
17247 bool _isLast; | |
17248 | |
17249 /** | |
17250 * The id associated with the search. | |
17251 */ | |
17252 String get id => _id; | |
17253 | |
17254 /** | |
17255 * The id associated with the search. | |
17256 */ | |
17257 void set id(String value) { | |
17258 assert(value != null); | |
17259 this._id = value; | |
17260 } | |
17261 | |
17262 /** | |
17263 * The search results being reported. | |
17264 */ | |
17265 List<SearchResult> get results => _results; | |
17266 | |
17267 /** | |
17268 * The search results being reported. | |
17269 */ | |
17270 void set results(List<SearchResult> value) { | |
17271 assert(value != null); | |
17272 this._results = value; | |
17273 } | |
17274 | |
17275 /** | |
17276 * True if this is that last set of results that will be returned for the | |
17277 * indicated search. | |
17278 */ | |
17279 bool get isLast => _isLast; | |
17280 | |
17281 /** | |
17282 * True if this is that last set of results that will be returned for the | |
17283 * indicated search. | |
17284 */ | |
17285 void set isLast(bool value) { | |
17286 assert(value != null); | |
17287 this._isLast = value; | |
17288 } | |
17289 | |
17290 SearchResultsParams(String id, List<SearchResult> results, bool isLast) { | |
17291 this.id = id; | |
17292 this.results = results; | |
17293 this.isLast = isLast; | |
17294 } | |
17295 | |
17296 factory SearchResultsParams.fromJson( | |
17297 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 12077 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
17298 if (json == null) { | 12078 if (json == null) { |
17299 json = {}; | 12079 json = {}; |
17300 } | 12080 } |
17301 if (json is Map) { | 12081 if (json is Map) { |
17302 String id; | 12082 List<TypeHierarchyItem> hierarchyItems; |
17303 if (json.containsKey("id")) { | 12083 if (json.containsKey("hierarchyItems")) { |
17304 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); | 12084 hierarchyItems = jsonDecoder.decodeList( |
17305 } else { | 12085 jsonPath + ".hierarchyItems", |
17306 throw jsonDecoder.mismatch(jsonPath, "id"); | 12086 json["hierarchyItems"], |
17307 } | |
17308 List<SearchResult> results; | |
17309 if (json.containsKey("results")) { | |
17310 results = jsonDecoder.decodeList( | |
17311 jsonPath + ".results", | |
17312 json["results"], | |
17313 (String jsonPath, Object json) => | 12087 (String jsonPath, Object json) => |
17314 new SearchResult.fromJson(jsonDecoder, jsonPath, json)); | 12088 new TypeHierarchyItem.fromJson(jsonDecoder, jsonPath, json)); |
17315 } else { | 12089 } |
17316 throw jsonDecoder.mismatch(jsonPath, "results"); | 12090 return new SearchGetTypeHierarchyResult(hierarchyItems: hierarchyItems); |
17317 } | |
17318 bool isLast; | |
17319 if (json.containsKey("isLast")) { | |
17320 isLast = jsonDecoder.decodeBool(jsonPath + ".isLast", json["isLast"]); | |
17321 } else { | |
17322 throw jsonDecoder.mismatch(jsonPath, "isLast"); | |
17323 } | |
17324 return new SearchResultsParams(id, results, isLast); | |
17325 } else { | 12091 } else { |
17326 throw jsonDecoder.mismatch(jsonPath, "search.results params", json); | 12092 throw jsonDecoder.mismatch( |
17327 } | 12093 jsonPath, "search.getTypeHierarchy result", json); |
17328 } | 12094 } |
17329 | 12095 } |
17330 factory SearchResultsParams.fromNotification(Notification notification) { | 12096 |
17331 return new SearchResultsParams.fromJson( | 12097 factory SearchGetTypeHierarchyResult.fromResponse(Response response) { |
17332 new ResponseDecoder(null), "params", notification.params); | 12098 return new SearchGetTypeHierarchyResult.fromJson( |
| 12099 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), |
| 12100 "result", |
| 12101 response.result); |
17333 } | 12102 } |
17334 | 12103 |
17335 @override | 12104 @override |
17336 Map<String, dynamic> toJson() { | 12105 Map<String, dynamic> toJson() { |
17337 Map<String, dynamic> result = {}; | 12106 Map<String, dynamic> result = {}; |
17338 result["id"] = id; | 12107 if (hierarchyItems != null) { |
17339 result["results"] = | 12108 result["hierarchyItems"] = hierarchyItems |
17340 results.map((SearchResult value) => value.toJson()).toList(); | 12109 .map((TypeHierarchyItem value) => value.toJson()) |
17341 result["isLast"] = isLast; | 12110 .toList(); |
| 12111 } |
17342 return result; | 12112 return result; |
17343 } | 12113 } |
17344 | 12114 |
17345 Notification toNotification() { | 12115 @override |
17346 return new Notification("search.results", toJson()); | 12116 Response toResponse(String id) { |
| 12117 return new Response(id, result: toJson()); |
17347 } | 12118 } |
17348 | 12119 |
17349 @override | 12120 @override |
17350 String toString() => JSON.encode(toJson()); | 12121 String toString() => JSON.encode(toJson()); |
17351 | 12122 |
17352 @override | 12123 @override |
17353 bool operator ==(other) { | 12124 bool operator ==(other) { |
17354 if (other is SearchResultsParams) { | 12125 if (other is SearchGetTypeHierarchyResult) { |
17355 return id == other.id && | 12126 return listEqual(hierarchyItems, other.hierarchyItems, |
17356 listEqual(results, other.results, | 12127 (TypeHierarchyItem a, TypeHierarchyItem b) => a == b); |
17357 (SearchResult a, SearchResult b) => a == b) && | |
17358 isLast == other.isLast; | |
17359 } | 12128 } |
17360 return false; | 12129 return false; |
17361 } | 12130 } |
| 12131 |
| 12132 @override |
| 12133 int get hashCode { |
| 12134 int hash = 0; |
| 12135 hash = JenkinsSmiHash.combine(hash, hierarchyItems.hashCode); |
| 12136 return JenkinsSmiHash.finish(hash); |
| 12137 } |
| 12138 } |
| 12139 |
| 12140 /** |
| 12141 * SearchResult |
| 12142 * |
| 12143 * { |
| 12144 * "location": Location |
| 12145 * "kind": SearchResultKind |
| 12146 * "isPotential": bool |
| 12147 * "path": List<Element> |
| 12148 * } |
| 12149 * |
| 12150 * Clients may not extend, implement or mix-in this class. |
| 12151 */ |
| 12152 class SearchResult implements HasToJson { |
| 12153 Location _location; |
| 12154 |
| 12155 SearchResultKind _kind; |
| 12156 |
| 12157 bool _isPotential; |
| 12158 |
| 12159 List<Element> _path; |
| 12160 |
| 12161 /** |
| 12162 * The location of the code that matched the search criteria. |
| 12163 */ |
| 12164 Location get location => _location; |
| 12165 |
| 12166 /** |
| 12167 * The location of the code that matched the search criteria. |
| 12168 */ |
| 12169 void set location(Location value) { |
| 12170 assert(value != null); |
| 12171 this._location = value; |
| 12172 } |
| 12173 |
| 12174 /** |
| 12175 * The kind of element that was found or the kind of reference that was |
| 12176 * found. |
| 12177 */ |
| 12178 SearchResultKind get kind => _kind; |
| 12179 |
| 12180 /** |
| 12181 * The kind of element that was found or the kind of reference that was |
| 12182 * found. |
| 12183 */ |
| 12184 void set kind(SearchResultKind value) { |
| 12185 assert(value != null); |
| 12186 this._kind = value; |
| 12187 } |
| 12188 |
| 12189 /** |
| 12190 * True if the result is a potential match but cannot be confirmed to be a |
| 12191 * match. For example, if all references to a method m defined in some class |
| 12192 * were requested, and a reference to a method m from an unknown class were |
| 12193 * found, it would be marked as being a potential match. |
| 12194 */ |
| 12195 bool get isPotential => _isPotential; |
| 12196 |
| 12197 /** |
| 12198 * True if the result is a potential match but cannot be confirmed to be a |
| 12199 * match. For example, if all references to a method m defined in some class |
| 12200 * were requested, and a reference to a method m from an unknown class were |
| 12201 * found, it would be marked as being a potential match. |
| 12202 */ |
| 12203 void set isPotential(bool value) { |
| 12204 assert(value != null); |
| 12205 this._isPotential = value; |
| 12206 } |
| 12207 |
| 12208 /** |
| 12209 * The elements that contain the result, starting with the most immediately |
| 12210 * enclosing ancestor and ending with the library. |
| 12211 */ |
| 12212 List<Element> get path => _path; |
| 12213 |
| 12214 /** |
| 12215 * The elements that contain the result, starting with the most immediately |
| 12216 * enclosing ancestor and ending with the library. |
| 12217 */ |
| 12218 void set path(List<Element> value) { |
| 12219 assert(value != null); |
| 12220 this._path = value; |
| 12221 } |
| 12222 |
| 12223 SearchResult(Location location, SearchResultKind kind, bool isPotential, |
| 12224 List<Element> path) { |
| 12225 this.location = location; |
| 12226 this.kind = kind; |
| 12227 this.isPotential = isPotential; |
| 12228 this.path = path; |
| 12229 } |
| 12230 |
| 12231 factory SearchResult.fromJson( |
| 12232 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| 12233 if (json == null) { |
| 12234 json = {}; |
| 12235 } |
| 12236 if (json is Map) { |
| 12237 Location location; |
| 12238 if (json.containsKey("location")) { |
| 12239 location = new Location.fromJson( |
| 12240 jsonDecoder, jsonPath + ".location", json["location"]); |
| 12241 } else { |
| 12242 throw jsonDecoder.mismatch(jsonPath, "location"); |
| 12243 } |
| 12244 SearchResultKind kind; |
| 12245 if (json.containsKey("kind")) { |
| 12246 kind = new SearchResultKind.fromJson( |
| 12247 jsonDecoder, jsonPath + ".kind", json["kind"]); |
| 12248 } else { |
| 12249 throw jsonDecoder.mismatch(jsonPath, "kind"); |
| 12250 } |
| 12251 bool isPotential; |
| 12252 if (json.containsKey("isPotential")) { |
| 12253 isPotential = jsonDecoder.decodeBool( |
| 12254 jsonPath + ".isPotential", json["isPotential"]); |
| 12255 } else { |
| 12256 throw jsonDecoder.mismatch(jsonPath, "isPotential"); |
| 12257 } |
| 12258 List<Element> path; |
| 12259 if (json.containsKey("path")) { |
| 12260 path = jsonDecoder.decodeList( |
| 12261 jsonPath + ".path", |
| 12262 json["path"], |
| 12263 (String jsonPath, Object json) => |
| 12264 new Element.fromJson(jsonDecoder, jsonPath, json)); |
| 12265 } else { |
| 12266 throw jsonDecoder.mismatch(jsonPath, "path"); |
| 12267 } |
| 12268 return new SearchResult(location, kind, isPotential, path); |
| 12269 } else { |
| 12270 throw jsonDecoder.mismatch(jsonPath, "SearchResult", json); |
| 12271 } |
| 12272 } |
| 12273 |
| 12274 @override |
| 12275 Map<String, dynamic> toJson() { |
| 12276 Map<String, dynamic> result = {}; |
| 12277 result["location"] = location.toJson(); |
| 12278 result["kind"] = kind.toJson(); |
| 12279 result["isPotential"] = isPotential; |
| 12280 result["path"] = path.map((Element value) => value.toJson()).toList(); |
| 12281 return result; |
| 12282 } |
| 12283 |
| 12284 @override |
| 12285 String toString() => JSON.encode(toJson()); |
| 12286 |
| 12287 @override |
| 12288 bool operator ==(other) { |
| 12289 if (other is SearchResult) { |
| 12290 return location == other.location && |
| 12291 kind == other.kind && |
| 12292 isPotential == other.isPotential && |
| 12293 listEqual(path, other.path, (Element a, Element b) => a == b); |
| 12294 } |
| 12295 return false; |
| 12296 } |
17362 | 12297 |
17363 @override | 12298 @override |
17364 int get hashCode { | 12299 int get hashCode { |
17365 int hash = 0; | 12300 int hash = 0; |
17366 hash = JenkinsSmiHash.combine(hash, id.hashCode); | 12301 hash = JenkinsSmiHash.combine(hash, location.hashCode); |
17367 hash = JenkinsSmiHash.combine(hash, results.hashCode); | 12302 hash = JenkinsSmiHash.combine(hash, kind.hashCode); |
17368 hash = JenkinsSmiHash.combine(hash, isLast.hashCode); | 12303 hash = JenkinsSmiHash.combine(hash, isPotential.hashCode); |
| 12304 hash = JenkinsSmiHash.combine(hash, path.hashCode); |
17369 return JenkinsSmiHash.finish(hash); | 12305 return JenkinsSmiHash.finish(hash); |
17370 } | 12306 } |
17371 } | 12307 } |
17372 | 12308 |
17373 /** | 12309 /** |
17374 * server.connected params | 12310 * SearchResultKind |
17375 * | 12311 * |
17376 * { | 12312 * enum { |
17377 * "version": String | 12313 * DECLARATION |
17378 * "pid": int | 12314 * INVOCATION |
17379 * "sessionId": optional String | 12315 * READ |
| 12316 * READ_WRITE |
| 12317 * REFERENCE |
| 12318 * UNKNOWN |
| 12319 * WRITE |
17380 * } | 12320 * } |
17381 * | 12321 * |
17382 * Clients may not extend, implement or mix-in this class. | 12322 * Clients may not extend, implement or mix-in this class. |
17383 */ | 12323 */ |
17384 class ServerConnectedParams implements HasToJson { | 12324 class SearchResultKind implements Enum { |
17385 String _version; | 12325 /** |
17386 | 12326 * The declaration of an element. |
17387 int _pid; | 12327 */ |
17388 | 12328 static const SearchResultKind DECLARATION = |
17389 String _sessionId; | 12329 const SearchResultKind._("DECLARATION"); |
17390 | 12330 |
17391 /** | 12331 /** |
17392 * The version number of the analysis server. | 12332 * The invocation of a function or method. |
17393 */ | 12333 */ |
17394 String get version => _version; | 12334 static const SearchResultKind INVOCATION = |
17395 | 12335 const SearchResultKind._("INVOCATION"); |
17396 /** | 12336 |
17397 * The version number of the analysis server. | 12337 /** |
17398 */ | 12338 * A reference to a field, parameter or variable where it is being read. |
17399 void set version(String value) { | 12339 */ |
| 12340 static const SearchResultKind READ = const SearchResultKind._("READ"); |
| 12341 |
| 12342 /** |
| 12343 * A reference to a field, parameter or variable where it is being read and |
| 12344 * written. |
| 12345 */ |
| 12346 static const SearchResultKind READ_WRITE = |
| 12347 const SearchResultKind._("READ_WRITE"); |
| 12348 |
| 12349 /** |
| 12350 * A reference to an element. |
| 12351 */ |
| 12352 static const SearchResultKind REFERENCE = |
| 12353 const SearchResultKind._("REFERENCE"); |
| 12354 |
| 12355 /** |
| 12356 * Some other kind of search result. |
| 12357 */ |
| 12358 static const SearchResultKind UNKNOWN = const SearchResultKind._("UNKNOWN"); |
| 12359 |
| 12360 /** |
| 12361 * A reference to a field, parameter or variable where it is being written. |
| 12362 */ |
| 12363 static const SearchResultKind WRITE = const SearchResultKind._("WRITE"); |
| 12364 |
| 12365 /** |
| 12366 * A list containing all of the enum values that are defined. |
| 12367 */ |
| 12368 static const List<SearchResultKind> VALUES = const <SearchResultKind>[ |
| 12369 DECLARATION, |
| 12370 INVOCATION, |
| 12371 READ, |
| 12372 READ_WRITE, |
| 12373 REFERENCE, |
| 12374 UNKNOWN, |
| 12375 WRITE |
| 12376 ]; |
| 12377 |
| 12378 @override |
| 12379 final String name; |
| 12380 |
| 12381 const SearchResultKind._(this.name); |
| 12382 |
| 12383 factory SearchResultKind(String name) { |
| 12384 switch (name) { |
| 12385 case "DECLARATION": |
| 12386 return DECLARATION; |
| 12387 case "INVOCATION": |
| 12388 return INVOCATION; |
| 12389 case "READ": |
| 12390 return READ; |
| 12391 case "READ_WRITE": |
| 12392 return READ_WRITE; |
| 12393 case "REFERENCE": |
| 12394 return REFERENCE; |
| 12395 case "UNKNOWN": |
| 12396 return UNKNOWN; |
| 12397 case "WRITE": |
| 12398 return WRITE; |
| 12399 } |
| 12400 throw new Exception('Illegal enum value: $name'); |
| 12401 } |
| 12402 |
| 12403 factory SearchResultKind.fromJson( |
| 12404 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| 12405 if (json is String) { |
| 12406 try { |
| 12407 return new SearchResultKind(json); |
| 12408 } catch (_) { |
| 12409 // Fall through |
| 12410 } |
| 12411 } |
| 12412 throw jsonDecoder.mismatch(jsonPath, "SearchResultKind", json); |
| 12413 } |
| 12414 |
| 12415 @override |
| 12416 String toString() => "SearchResultKind.$name"; |
| 12417 |
| 12418 String toJson() => name; |
| 12419 } |
| 12420 |
| 12421 /** |
| 12422 * search.results params |
| 12423 * |
| 12424 * { |
| 12425 * "id": SearchId |
| 12426 * "results": List<SearchResult> |
| 12427 * "isLast": bool |
| 12428 * } |
| 12429 * |
| 12430 * Clients may not extend, implement or mix-in this class. |
| 12431 */ |
| 12432 class SearchResultsParams implements HasToJson { |
| 12433 String _id; |
| 12434 |
| 12435 List<SearchResult> _results; |
| 12436 |
| 12437 bool _isLast; |
| 12438 |
| 12439 /** |
| 12440 * The id associated with the search. |
| 12441 */ |
| 12442 String get id => _id; |
| 12443 |
| 12444 /** |
| 12445 * The id associated with the search. |
| 12446 */ |
| 12447 void set id(String value) { |
17400 assert(value != null); | 12448 assert(value != null); |
17401 this._version = value; | 12449 this._id = value; |
17402 } | 12450 } |
17403 | 12451 |
17404 /** | 12452 /** |
17405 * The process id of the analysis server process. | 12453 * The search results being reported. |
17406 */ | 12454 */ |
17407 int get pid => _pid; | 12455 List<SearchResult> get results => _results; |
17408 | 12456 |
17409 /** | 12457 /** |
17410 * The process id of the analysis server process. | 12458 * The search results being reported. |
17411 */ | 12459 */ |
17412 void set pid(int value) { | 12460 void set results(List<SearchResult> value) { |
17413 assert(value != null); | 12461 assert(value != null); |
17414 this._pid = value; | 12462 this._results = value; |
17415 } | 12463 } |
17416 | 12464 |
17417 /** | 12465 /** |
17418 * The session id for this session. | 12466 * True if this is that last set of results that will be returned for the |
17419 */ | 12467 * indicated search. |
17420 String get sessionId => _sessionId; | 12468 */ |
17421 | 12469 bool get isLast => _isLast; |
17422 /** | 12470 |
17423 * The session id for this session. | 12471 /** |
17424 */ | 12472 * True if this is that last set of results that will be returned for the |
17425 void set sessionId(String value) { | 12473 * indicated search. |
17426 this._sessionId = value; | 12474 */ |
17427 } | 12475 void set isLast(bool value) { |
17428 | 12476 assert(value != null); |
17429 ServerConnectedParams(String version, int pid, {String sessionId}) { | 12477 this._isLast = value; |
17430 this.version = version; | 12478 } |
17431 this.pid = pid; | 12479 |
17432 this.sessionId = sessionId; | 12480 SearchResultsParams(String id, List<SearchResult> results, bool isLast) { |
17433 } | 12481 this.id = id; |
17434 | 12482 this.results = results; |
17435 factory ServerConnectedParams.fromJson( | 12483 this.isLast = isLast; |
| 12484 } |
| 12485 |
| 12486 factory SearchResultsParams.fromJson( |
17436 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 12487 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
17437 if (json == null) { | 12488 if (json == null) { |
17438 json = {}; | 12489 json = {}; |
17439 } | 12490 } |
17440 if (json is Map) { | 12491 if (json is Map) { |
17441 String version; | 12492 String id; |
17442 if (json.containsKey("version")) { | 12493 if (json.containsKey("id")) { |
17443 version = | 12494 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); |
17444 jsonDecoder.decodeString(jsonPath + ".version", json["version"]); | |
17445 } else { | 12495 } else { |
17446 throw jsonDecoder.mismatch(jsonPath, "version"); | 12496 throw jsonDecoder.mismatch(jsonPath, "id"); |
17447 } | 12497 } |
17448 int pid; | 12498 List<SearchResult> results; |
17449 if (json.containsKey("pid")) { | 12499 if (json.containsKey("results")) { |
17450 pid = jsonDecoder.decodeInt(jsonPath + ".pid", json["pid"]); | 12500 results = jsonDecoder.decodeList( |
| 12501 jsonPath + ".results", |
| 12502 json["results"], |
| 12503 (String jsonPath, Object json) => |
| 12504 new SearchResult.fromJson(jsonDecoder, jsonPath, json)); |
17451 } else { | 12505 } else { |
17452 throw jsonDecoder.mismatch(jsonPath, "pid"); | 12506 throw jsonDecoder.mismatch(jsonPath, "results"); |
17453 } | 12507 } |
17454 String sessionId; | 12508 bool isLast; |
17455 if (json.containsKey("sessionId")) { | 12509 if (json.containsKey("isLast")) { |
17456 sessionId = jsonDecoder.decodeString( | 12510 isLast = jsonDecoder.decodeBool(jsonPath + ".isLast", json["isLast"]); |
17457 jsonPath + ".sessionId", json["sessionId"]); | 12511 } else { |
17458 } | 12512 throw jsonDecoder.mismatch(jsonPath, "isLast"); |
17459 return new ServerConnectedParams(version, pid, sessionId: sessionId); | 12513 } |
| 12514 return new SearchResultsParams(id, results, isLast); |
17460 } else { | 12515 } else { |
17461 throw jsonDecoder.mismatch(jsonPath, "server.connected params", json); | 12516 throw jsonDecoder.mismatch(jsonPath, "search.results params", json); |
17462 } | 12517 } |
17463 } | 12518 } |
17464 | 12519 |
17465 factory ServerConnectedParams.fromNotification(Notification notification) { | 12520 factory SearchResultsParams.fromNotification(Notification notification) { |
17466 return new ServerConnectedParams.fromJson( | 12521 return new SearchResultsParams.fromJson( |
17467 new ResponseDecoder(null), "params", notification.params); | 12522 new ResponseDecoder(null), "params", notification.params); |
17468 } | 12523 } |
17469 | 12524 |
17470 @override | 12525 @override |
17471 Map<String, dynamic> toJson() { | 12526 Map<String, dynamic> toJson() { |
17472 Map<String, dynamic> result = {}; | 12527 Map<String, dynamic> result = {}; |
17473 result["version"] = version; | 12528 result["id"] = id; |
17474 result["pid"] = pid; | 12529 result["results"] = |
17475 if (sessionId != null) { | 12530 results.map((SearchResult value) => value.toJson()).toList(); |
17476 result["sessionId"] = sessionId; | 12531 result["isLast"] = isLast; |
17477 } | |
17478 return result; | 12532 return result; |
17479 } | 12533 } |
17480 | 12534 |
17481 Notification toNotification() { | 12535 Notification toNotification() { |
17482 return new Notification("server.connected", toJson()); | 12536 return new Notification("search.results", toJson()); |
17483 } | 12537 } |
17484 | 12538 |
17485 @override | 12539 @override |
17486 String toString() => JSON.encode(toJson()); | |
17487 | |
17488 @override | |
17489 bool operator ==(other) { | |
17490 if (other is ServerConnectedParams) { | |
17491 return version == other.version && | |
17492 pid == other.pid && | |
17493 sessionId == other.sessionId; | |
17494 } | |
17495 return false; | |
17496 } | |
17497 | |
17498 @override | |
17499 int get hashCode { | |
17500 int hash = 0; | |
17501 hash = JenkinsSmiHash.combine(hash, version.hashCode); | |
17502 hash = JenkinsSmiHash.combine(hash, pid.hashCode); | |
17503 hash = JenkinsSmiHash.combine(hash, sessionId.hashCode); | |
17504 return JenkinsSmiHash.finish(hash); | |
17505 } | |
17506 } | |
17507 | |
17508 /** | |
17509 * server.error params | |
17510 * | |
17511 * { | |
17512 * "isFatal": bool | |
17513 * "message": String | |
17514 * "stackTrace": String | |
17515 * } | |
17516 * | |
17517 * Clients may not extend, implement or mix-in this class. | |
17518 */ | |
17519 class ServerErrorParams implements HasToJson { | |
17520 bool _isFatal; | |
17521 | |
17522 String _message; | |
17523 | |
17524 String _stackTrace; | |
17525 | |
17526 /** | |
17527 * True if the error is a fatal error, meaning that the server will shutdown | |
17528 * automatically after sending this notification. | |
17529 */ | |
17530 bool get isFatal => _isFatal; | |
17531 | |
17532 /** | |
17533 * True if the error is a fatal error, meaning that the server will shutdown | |
17534 * automatically after sending this notification. | |
17535 */ | |
17536 void set isFatal(bool value) { | |
17537 assert(value != null); | |
17538 this._isFatal = value; | |
17539 } | |
17540 | |
17541 /** | |
17542 * The error message indicating what kind of error was encountered. | |
17543 */ | |
17544 String get message => _message; | |
17545 | |
17546 /** | |
17547 * The error message indicating what kind of error was encountered. | |
17548 */ | |
17549 void set message(String value) { | |
17550 assert(value != null); | |
17551 this._message = value; | |
17552 } | |
17553 | |
17554 /** | |
17555 * The stack trace associated with the generation of the error, used for | |
17556 * debugging the server. | |
17557 */ | |
17558 String get stackTrace => _stackTrace; | |
17559 | |
17560 /** | |
17561 * The stack trace associated with the generation of the error, used for | |
17562 * debugging the server. | |
17563 */ | |
17564 void set stackTrace(String value) { | |
17565 assert(value != null); | |
17566 this._stackTrace = value; | |
17567 } | |
17568 | |
17569 ServerErrorParams(bool isFatal, String message, String stackTrace) { | |
17570 this.isFatal = isFatal; | |
17571 this.message = message; | |
17572 this.stackTrace = stackTrace; | |
17573 } | |
17574 | |
17575 factory ServerErrorParams.fromJson( | |
17576 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
17577 if (json == null) { | |
17578 json = {}; | |
17579 } | |
17580 if (json is Map) { | |
17581 bool isFatal; | |
17582 if (json.containsKey("isFatal")) { | |
17583 isFatal = | |
17584 jsonDecoder.decodeBool(jsonPath + ".isFatal", json["isFatal"]); | |
17585 } else { | |
17586 throw jsonDecoder.mismatch(jsonPath, "isFatal"); | |
17587 } | |
17588 String message; | |
17589 if (json.containsKey("message")) { | |
17590 message = | |
17591 jsonDecoder.decodeString(jsonPath + ".message", json["message"]); | |
17592 } else { | |
17593 throw jsonDecoder.mismatch(jsonPath, "message"); | |
17594 } | |
17595 String stackTrace; | |
17596 if (json.containsKey("stackTrace")) { | |
17597 stackTrace = jsonDecoder.decodeString( | |
17598 jsonPath + ".stackTrace", json["stackTrace"]); | |
17599 } else { | |
17600 throw jsonDecoder.mismatch(jsonPath, "stackTrace"); | |
17601 } | |
17602 return new ServerErrorParams(isFatal, message, stackTrace); | |
17603 } else { | |
17604 throw jsonDecoder.mismatch(jsonPath, "server.error params", json); | |
17605 } | |
17606 } | |
17607 | |
17608 factory ServerErrorParams.fromNotification(Notification notification) { | |
17609 return new ServerErrorParams.fromJson( | |
17610 new ResponseDecoder(null), "params", notification.params); | |
17611 } | |
17612 | |
17613 @override | |
17614 Map<String, dynamic> toJson() { | |
17615 Map<String, dynamic> result = {}; | |
17616 result["isFatal"] = isFatal; | |
17617 result["message"] = message; | |
17618 result["stackTrace"] = stackTrace; | |
17619 return result; | |
17620 } | |
17621 | |
17622 Notification toNotification() { | |
17623 return new Notification("server.error", toJson()); | |
17624 } | |
17625 | |
17626 @override | |
17627 String toString() => JSON.encode(toJson()); | 12540 String toString() => JSON.encode(toJson()); |
17628 | 12541 |
17629 @override | 12542 @override |
17630 bool operator ==(other) { | 12543 bool operator ==(other) { |
17631 if (other is ServerErrorParams) { | 12544 if (other is SearchResultsParams) { |
17632 return isFatal == other.isFatal && | 12545 return id == other.id && |
17633 message == other.message && | 12546 listEqual(results, other.results, |
17634 stackTrace == other.stackTrace; | 12547 (SearchResult a, SearchResult b) => a == b) && |
| 12548 isLast == other.isLast; |
17635 } | 12549 } |
17636 return false; | 12550 return false; |
17637 } | 12551 } |
17638 | 12552 |
17639 @override | 12553 @override |
17640 int get hashCode { | 12554 int get hashCode { |
17641 int hash = 0; | 12555 int hash = 0; |
17642 hash = JenkinsSmiHash.combine(hash, isFatal.hashCode); | 12556 hash = JenkinsSmiHash.combine(hash, id.hashCode); |
17643 hash = JenkinsSmiHash.combine(hash, message.hashCode); | 12557 hash = JenkinsSmiHash.combine(hash, results.hashCode); |
17644 hash = JenkinsSmiHash.combine(hash, stackTrace.hashCode); | 12558 hash = JenkinsSmiHash.combine(hash, isLast.hashCode); |
17645 return JenkinsSmiHash.finish(hash); | 12559 return JenkinsSmiHash.finish(hash); |
17646 } | 12560 } |
17647 } | 12561 } |
17648 | 12562 |
17649 /** | 12563 /** |
17650 * server.getVersion params | 12564 * server.connected params |
17651 * | |
17652 * Clients may not extend, implement or mix-in this class. | |
17653 */ | |
17654 class ServerGetVersionParams implements RequestParams { | |
17655 @override | |
17656 Map<String, dynamic> toJson() => <String, dynamic>{}; | |
17657 | |
17658 @override | |
17659 Request toRequest(String id) { | |
17660 return new Request(id, "server.getVersion", null); | |
17661 } | |
17662 | |
17663 @override | |
17664 bool operator ==(other) { | |
17665 if (other is ServerGetVersionParams) { | |
17666 return true; | |
17667 } | |
17668 return false; | |
17669 } | |
17670 | |
17671 @override | |
17672 int get hashCode { | |
17673 return 55877452; | |
17674 } | |
17675 } | |
17676 | |
17677 /** | |
17678 * server.getVersion result | |
17679 * | 12565 * |
17680 * { | 12566 * { |
17681 * "version": String | 12567 * "version": String |
| 12568 * "pid": int |
| 12569 * "sessionId": optional String |
17682 * } | 12570 * } |
17683 * | 12571 * |
17684 * Clients may not extend, implement or mix-in this class. | 12572 * Clients may not extend, implement or mix-in this class. |
17685 */ | 12573 */ |
17686 class ServerGetVersionResult implements ResponseResult { | 12574 class ServerConnectedParams implements HasToJson { |
17687 String _version; | 12575 String _version; |
17688 | 12576 |
| 12577 int _pid; |
| 12578 |
| 12579 String _sessionId; |
| 12580 |
17689 /** | 12581 /** |
17690 * The version number of the analysis server. | 12582 * The version number of the analysis server. |
17691 */ | 12583 */ |
17692 String get version => _version; | 12584 String get version => _version; |
17693 | 12585 |
17694 /** | 12586 /** |
17695 * The version number of the analysis server. | 12587 * The version number of the analysis server. |
17696 */ | 12588 */ |
17697 void set version(String value) { | 12589 void set version(String value) { |
17698 assert(value != null); | 12590 assert(value != null); |
17699 this._version = value; | 12591 this._version = value; |
17700 } | 12592 } |
17701 | 12593 |
17702 ServerGetVersionResult(String version) { | 12594 /** |
17703 this.version = version; | 12595 * The process id of the analysis server process. |
| 12596 */ |
| 12597 int get pid => _pid; |
| 12598 |
| 12599 /** |
| 12600 * The process id of the analysis server process. |
| 12601 */ |
| 12602 void set pid(int value) { |
| 12603 assert(value != null); |
| 12604 this._pid = value; |
17704 } | 12605 } |
17705 | 12606 |
17706 factory ServerGetVersionResult.fromJson( | 12607 /** |
| 12608 * The session id for this session. |
| 12609 */ |
| 12610 String get sessionId => _sessionId; |
| 12611 |
| 12612 /** |
| 12613 * The session id for this session. |
| 12614 */ |
| 12615 void set sessionId(String value) { |
| 12616 this._sessionId = value; |
| 12617 } |
| 12618 |
| 12619 ServerConnectedParams(String version, int pid, {String sessionId}) { |
| 12620 this.version = version; |
| 12621 this.pid = pid; |
| 12622 this.sessionId = sessionId; |
| 12623 } |
| 12624 |
| 12625 factory ServerConnectedParams.fromJson( |
17707 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 12626 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
17708 if (json == null) { | 12627 if (json == null) { |
17709 json = {}; | 12628 json = {}; |
17710 } | 12629 } |
17711 if (json is Map) { | 12630 if (json is Map) { |
17712 String version; | 12631 String version; |
17713 if (json.containsKey("version")) { | 12632 if (json.containsKey("version")) { |
17714 version = | 12633 version = |
17715 jsonDecoder.decodeString(jsonPath + ".version", json["version"]); | 12634 jsonDecoder.decodeString(jsonPath + ".version", json["version"]); |
17716 } else { | 12635 } else { |
17717 throw jsonDecoder.mismatch(jsonPath, "version"); | 12636 throw jsonDecoder.mismatch(jsonPath, "version"); |
17718 } | 12637 } |
17719 return new ServerGetVersionResult(version); | 12638 int pid; |
| 12639 if (json.containsKey("pid")) { |
| 12640 pid = jsonDecoder.decodeInt(jsonPath + ".pid", json["pid"]); |
| 12641 } else { |
| 12642 throw jsonDecoder.mismatch(jsonPath, "pid"); |
| 12643 } |
| 12644 String sessionId; |
| 12645 if (json.containsKey("sessionId")) { |
| 12646 sessionId = jsonDecoder.decodeString( |
| 12647 jsonPath + ".sessionId", json["sessionId"]); |
| 12648 } |
| 12649 return new ServerConnectedParams(version, pid, sessionId: sessionId); |
17720 } else { | 12650 } else { |
17721 throw jsonDecoder.mismatch(jsonPath, "server.getVersion result", json); | 12651 throw jsonDecoder.mismatch(jsonPath, "server.connected params", json); |
17722 } | 12652 } |
17723 } | 12653 } |
17724 | 12654 |
17725 factory ServerGetVersionResult.fromResponse(Response response) { | 12655 factory ServerConnectedParams.fromNotification(Notification notification) { |
17726 return new ServerGetVersionResult.fromJson( | 12656 return new ServerConnectedParams.fromJson( |
17727 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), | 12657 new ResponseDecoder(null), "params", notification.params); |
17728 "result", | |
17729 response.result); | |
17730 } | 12658 } |
17731 | 12659 |
17732 @override | 12660 @override |
17733 Map<String, dynamic> toJson() { | 12661 Map<String, dynamic> toJson() { |
17734 Map<String, dynamic> result = {}; | 12662 Map<String, dynamic> result = {}; |
17735 result["version"] = version; | 12663 result["version"] = version; |
| 12664 result["pid"] = pid; |
| 12665 if (sessionId != null) { |
| 12666 result["sessionId"] = sessionId; |
| 12667 } |
17736 return result; | 12668 return result; |
17737 } | 12669 } |
17738 | 12670 |
17739 @override | 12671 Notification toNotification() { |
17740 Response toResponse(String id) { | 12672 return new Notification("server.connected", toJson()); |
17741 return new Response(id, result: toJson()); | |
17742 } | 12673 } |
17743 | 12674 |
17744 @override | 12675 @override |
17745 String toString() => JSON.encode(toJson()); | 12676 String toString() => JSON.encode(toJson()); |
17746 | 12677 |
17747 @override | 12678 @override |
17748 bool operator ==(other) { | 12679 bool operator ==(other) { |
17749 if (other is ServerGetVersionResult) { | 12680 if (other is ServerConnectedParams) { |
17750 return version == other.version; | 12681 return version == other.version && |
| 12682 pid == other.pid && |
| 12683 sessionId == other.sessionId; |
17751 } | 12684 } |
17752 return false; | 12685 return false; |
17753 } | 12686 } |
17754 | 12687 |
17755 @override | 12688 @override |
17756 int get hashCode { | 12689 int get hashCode { |
17757 int hash = 0; | 12690 int hash = 0; |
17758 hash = JenkinsSmiHash.combine(hash, version.hashCode); | 12691 hash = JenkinsSmiHash.combine(hash, version.hashCode); |
| 12692 hash = JenkinsSmiHash.combine(hash, pid.hashCode); |
| 12693 hash = JenkinsSmiHash.combine(hash, sessionId.hashCode); |
17759 return JenkinsSmiHash.finish(hash); | 12694 return JenkinsSmiHash.finish(hash); |
17760 } | 12695 } |
17761 } | 12696 } |
17762 | 12697 |
17763 /** | 12698 /** |
17764 * ServerService | 12699 * server.error params |
17765 * | 12700 * |
17766 * enum { | 12701 * { |
17767 * STATUS | 12702 * "isFatal": bool |
| 12703 * "message": String |
| 12704 * "stackTrace": String |
17768 * } | 12705 * } |
17769 * | 12706 * |
17770 * Clients may not extend, implement or mix-in this class. | 12707 * Clients may not extend, implement or mix-in this class. |
17771 */ | 12708 */ |
17772 class ServerService implements Enum { | 12709 class ServerErrorParams implements HasToJson { |
17773 static const ServerService STATUS = const ServerService._("STATUS"); | 12710 bool _isFatal; |
| 12711 |
| 12712 String _message; |
| 12713 |
| 12714 String _stackTrace; |
17774 | 12715 |
17775 /** | 12716 /** |
17776 * A list containing all of the enum values that are defined. | 12717 * True if the error is a fatal error, meaning that the server will shutdown |
| 12718 * automatically after sending this notification. |
17777 */ | 12719 */ |
17778 static const List<ServerService> VALUES = const <ServerService>[STATUS]; | 12720 bool get isFatal => _isFatal; |
17779 | 12721 |
17780 @override | 12722 /** |
17781 final String name; | 12723 * True if the error is a fatal error, meaning that the server will shutdown |
17782 | 12724 * automatically after sending this notification. |
17783 const ServerService._(this.name); | 12725 */ |
17784 | 12726 void set isFatal(bool value) { |
17785 factory ServerService(String name) { | 12727 assert(value != null); |
17786 switch (name) { | 12728 this._isFatal = value; |
17787 case "STATUS": | |
17788 return STATUS; | |
17789 } | |
17790 throw new Exception('Illegal enum value: $name'); | |
17791 } | 12729 } |
17792 | 12730 |
17793 factory ServerService.fromJson( | 12731 /** |
17794 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 12732 * The error message indicating what kind of error was encountered. |
17795 if (json is String) { | 12733 */ |
17796 try { | 12734 String get message => _message; |
17797 return new ServerService(json); | 12735 |
17798 } catch (_) { | 12736 /** |
17799 // Fall through | 12737 * The error message indicating what kind of error was encountered. |
17800 } | 12738 */ |
17801 } | 12739 void set message(String value) { |
17802 throw jsonDecoder.mismatch(jsonPath, "ServerService", json); | 12740 assert(value != null); |
| 12741 this._message = value; |
17803 } | 12742 } |
17804 | 12743 |
17805 @override | 12744 /** |
17806 String toString() => "ServerService.$name"; | 12745 * The stack trace associated with the generation of the error, used for |
17807 | 12746 * debugging the server. |
17808 String toJson() => name; | 12747 */ |
17809 } | 12748 String get stackTrace => _stackTrace; |
17810 | |
17811 /** | |
17812 * server.setSubscriptions params | |
17813 * | |
17814 * { | |
17815 * "subscriptions": List<ServerService> | |
17816 * } | |
17817 * | |
17818 * Clients may not extend, implement or mix-in this class. | |
17819 */ | |
17820 class ServerSetSubscriptionsParams implements RequestParams { | |
17821 List<ServerService> _subscriptions; | |
17822 | 12749 |
17823 /** | 12750 /** |
17824 * A list of the services being subscribed to. | 12751 * The stack trace associated with the generation of the error, used for |
| 12752 * debugging the server. |
17825 */ | 12753 */ |
17826 List<ServerService> get subscriptions => _subscriptions; | 12754 void set stackTrace(String value) { |
17827 | |
17828 /** | |
17829 * A list of the services being subscribed to. | |
17830 */ | |
17831 void set subscriptions(List<ServerService> value) { | |
17832 assert(value != null); | 12755 assert(value != null); |
17833 this._subscriptions = value; | 12756 this._stackTrace = value; |
17834 } | 12757 } |
17835 | 12758 |
17836 ServerSetSubscriptionsParams(List<ServerService> subscriptions) { | 12759 ServerErrorParams(bool isFatal, String message, String stackTrace) { |
17837 this.subscriptions = subscriptions; | 12760 this.isFatal = isFatal; |
| 12761 this.message = message; |
| 12762 this.stackTrace = stackTrace; |
17838 } | 12763 } |
17839 | 12764 |
17840 factory ServerSetSubscriptionsParams.fromJson( | 12765 factory ServerErrorParams.fromJson( |
17841 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 12766 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
17842 if (json == null) { | 12767 if (json == null) { |
17843 json = {}; | 12768 json = {}; |
17844 } | 12769 } |
17845 if (json is Map) { | 12770 if (json is Map) { |
17846 List<ServerService> subscriptions; | 12771 bool isFatal; |
17847 if (json.containsKey("subscriptions")) { | 12772 if (json.containsKey("isFatal")) { |
17848 subscriptions = jsonDecoder.decodeList( | 12773 isFatal = |
17849 jsonPath + ".subscriptions", | 12774 jsonDecoder.decodeBool(jsonPath + ".isFatal", json["isFatal"]); |
17850 json["subscriptions"], | |
17851 (String jsonPath, Object json) => | |
17852 new ServerService.fromJson(jsonDecoder, jsonPath, json)); | |
17853 } else { | 12775 } else { |
17854 throw jsonDecoder.mismatch(jsonPath, "subscriptions"); | 12776 throw jsonDecoder.mismatch(jsonPath, "isFatal"); |
17855 } | 12777 } |
17856 return new ServerSetSubscriptionsParams(subscriptions); | 12778 String message; |
| 12779 if (json.containsKey("message")) { |
| 12780 message = |
| 12781 jsonDecoder.decodeString(jsonPath + ".message", json["message"]); |
| 12782 } else { |
| 12783 throw jsonDecoder.mismatch(jsonPath, "message"); |
| 12784 } |
| 12785 String stackTrace; |
| 12786 if (json.containsKey("stackTrace")) { |
| 12787 stackTrace = jsonDecoder.decodeString( |
| 12788 jsonPath + ".stackTrace", json["stackTrace"]); |
| 12789 } else { |
| 12790 throw jsonDecoder.mismatch(jsonPath, "stackTrace"); |
| 12791 } |
| 12792 return new ServerErrorParams(isFatal, message, stackTrace); |
17857 } else { | 12793 } else { |
17858 throw jsonDecoder.mismatch( | 12794 throw jsonDecoder.mismatch(jsonPath, "server.error params", json); |
17859 jsonPath, "server.setSubscriptions params", json); | |
17860 } | 12795 } |
17861 } | 12796 } |
17862 | 12797 |
17863 factory ServerSetSubscriptionsParams.fromRequest(Request request) { | 12798 factory ServerErrorParams.fromNotification(Notification notification) { |
17864 return new ServerSetSubscriptionsParams.fromJson( | 12799 return new ServerErrorParams.fromJson( |
17865 new RequestDecoder(request), "params", request.params); | 12800 new ResponseDecoder(null), "params", notification.params); |
17866 } | 12801 } |
17867 | 12802 |
17868 @override | 12803 @override |
17869 Map<String, dynamic> toJson() { | 12804 Map<String, dynamic> toJson() { |
17870 Map<String, dynamic> result = {}; | 12805 Map<String, dynamic> result = {}; |
17871 result["subscriptions"] = | 12806 result["isFatal"] = isFatal; |
17872 subscriptions.map((ServerService value) => value.toJson()).toList(); | 12807 result["message"] = message; |
| 12808 result["stackTrace"] = stackTrace; |
17873 return result; | 12809 return result; |
17874 } | 12810 } |
17875 | 12811 |
17876 @override | 12812 Notification toNotification() { |
17877 Request toRequest(String id) { | 12813 return new Notification("server.error", toJson()); |
17878 return new Request(id, "server.setSubscriptions", toJson()); | |
17879 } | 12814 } |
17880 | 12815 |
17881 @override | 12816 @override |
17882 String toString() => JSON.encode(toJson()); | 12817 String toString() => JSON.encode(toJson()); |
17883 | 12818 |
17884 @override | 12819 @override |
17885 bool operator ==(other) { | 12820 bool operator ==(other) { |
17886 if (other is ServerSetSubscriptionsParams) { | 12821 if (other is ServerErrorParams) { |
17887 return listEqual(subscriptions, other.subscriptions, | 12822 return isFatal == other.isFatal && |
17888 (ServerService a, ServerService b) => a == b); | 12823 message == other.message && |
| 12824 stackTrace == other.stackTrace; |
17889 } | 12825 } |
17890 return false; | 12826 return false; |
17891 } | 12827 } |
17892 | 12828 |
17893 @override | 12829 @override |
17894 int get hashCode { | 12830 int get hashCode { |
17895 int hash = 0; | 12831 int hash = 0; |
17896 hash = JenkinsSmiHash.combine(hash, subscriptions.hashCode); | 12832 hash = JenkinsSmiHash.combine(hash, isFatal.hashCode); |
| 12833 hash = JenkinsSmiHash.combine(hash, message.hashCode); |
| 12834 hash = JenkinsSmiHash.combine(hash, stackTrace.hashCode); |
17897 return JenkinsSmiHash.finish(hash); | 12835 return JenkinsSmiHash.finish(hash); |
17898 } | 12836 } |
17899 } | 12837 } |
17900 | 12838 |
17901 /** | 12839 /** |
17902 * server.setSubscriptions result | 12840 * server.getVersion params |
17903 * | 12841 * |
17904 * Clients may not extend, implement or mix-in this class. | 12842 * Clients may not extend, implement or mix-in this class. |
17905 */ | 12843 */ |
17906 class ServerSetSubscriptionsResult implements ResponseResult { | 12844 class ServerGetVersionParams implements RequestParams { |
17907 @override | |
17908 Map<String, dynamic> toJson() => <String, dynamic>{}; | |
17909 | |
17910 @override | |
17911 Response toResponse(String id) { | |
17912 return new Response(id, result: null); | |
17913 } | |
17914 | |
17915 @override | |
17916 bool operator ==(other) { | |
17917 if (other is ServerSetSubscriptionsResult) { | |
17918 return true; | |
17919 } | |
17920 return false; | |
17921 } | |
17922 | |
17923 @override | |
17924 int get hashCode { | |
17925 return 748820900; | |
17926 } | |
17927 } | |
17928 | |
17929 /** | |
17930 * server.shutdown params | |
17931 * | |
17932 * Clients may not extend, implement or mix-in this class. | |
17933 */ | |
17934 class ServerShutdownParams implements RequestParams { | |
17935 @override | 12845 @override |
17936 Map<String, dynamic> toJson() => <String, dynamic>{}; | 12846 Map<String, dynamic> toJson() => <String, dynamic>{}; |
17937 | 12847 |
17938 @override | 12848 @override |
17939 Request toRequest(String id) { | 12849 Request toRequest(String id) { |
17940 return new Request(id, "server.shutdown", null); | 12850 return new Request(id, "server.getVersion", null); |
17941 } | 12851 } |
17942 | 12852 |
17943 @override | 12853 @override |
17944 bool operator ==(other) { | 12854 bool operator ==(other) { |
17945 if (other is ServerShutdownParams) { | 12855 if (other is ServerGetVersionParams) { |
17946 return true; | 12856 return true; |
17947 } | 12857 } |
17948 return false; | 12858 return false; |
17949 } | |
17950 | |
17951 @override | |
17952 int get hashCode { | |
17953 return 366630911; | |
17954 } | |
17955 } | |
17956 | |
17957 /** | |
17958 * server.shutdown result | |
17959 * | |
17960 * Clients may not extend, implement or mix-in this class. | |
17961 */ | |
17962 class ServerShutdownResult implements ResponseResult { | |
17963 @override | |
17964 Map<String, dynamic> toJson() => <String, dynamic>{}; | |
17965 | |
17966 @override | |
17967 Response toResponse(String id) { | |
17968 return new Response(id, result: null); | |
17969 } | |
17970 | |
17971 @override | |
17972 bool operator ==(other) { | |
17973 if (other is ServerShutdownResult) { | |
17974 return true; | |
17975 } | |
17976 return false; | |
17977 } | 12859 } |
17978 | 12860 |
17979 @override | 12861 @override |
17980 int get hashCode { | 12862 int get hashCode { |
17981 return 193626532; | 12863 return 55877452; |
17982 } | 12864 } |
17983 } | 12865 } |
17984 | 12866 |
17985 /** | 12867 /** |
17986 * server.status params | 12868 * server.getVersion result |
17987 * | 12869 * |
17988 * { | 12870 * { |
17989 * "analysis": optional AnalysisStatus | 12871 * "version": String |
17990 * "pub": optional PubStatus | |
17991 * } | 12872 * } |
17992 * | 12873 * |
17993 * Clients may not extend, implement or mix-in this class. | 12874 * Clients may not extend, implement or mix-in this class. |
17994 */ | 12875 */ |
17995 class ServerStatusParams implements HasToJson { | 12876 class ServerGetVersionResult implements ResponseResult { |
17996 AnalysisStatus _analysis; | 12877 String _version; |
17997 | |
17998 PubStatus _pub; | |
17999 | 12878 |
18000 /** | 12879 /** |
18001 * The current status of analysis, including whether analysis is being | 12880 * The version number of the analysis server. |
18002 * performed and if so what is being analyzed. | |
18003 */ | 12881 */ |
18004 AnalysisStatus get analysis => _analysis; | 12882 String get version => _version; |
18005 | 12883 |
18006 /** | 12884 /** |
18007 * The current status of analysis, including whether analysis is being | 12885 * The version number of the analysis server. |
18008 * performed and if so what is being analyzed. | |
18009 */ | 12886 */ |
18010 void set analysis(AnalysisStatus value) { | 12887 void set version(String value) { |
18011 this._analysis = value; | 12888 assert(value != null); |
| 12889 this._version = value; |
18012 } | 12890 } |
18013 | 12891 |
18014 /** | 12892 ServerGetVersionResult(String version) { |
18015 * The current status of pub execution, indicating whether we are currently | 12893 this.version = version; |
18016 * running pub. | |
18017 */ | |
18018 PubStatus get pub => _pub; | |
18019 | |
18020 /** | |
18021 * The current status of pub execution, indicating whether we are currently | |
18022 * running pub. | |
18023 */ | |
18024 void set pub(PubStatus value) { | |
18025 this._pub = value; | |
18026 } | 12894 } |
18027 | 12895 |
18028 ServerStatusParams({AnalysisStatus analysis, PubStatus pub}) { | 12896 factory ServerGetVersionResult.fromJson( |
18029 this.analysis = analysis; | |
18030 this.pub = pub; | |
18031 } | |
18032 | |
18033 factory ServerStatusParams.fromJson( | |
18034 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 12897 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
18035 if (json == null) { | 12898 if (json == null) { |
18036 json = {}; | 12899 json = {}; |
18037 } | 12900 } |
18038 if (json is Map) { | 12901 if (json is Map) { |
18039 AnalysisStatus analysis; | 12902 String version; |
18040 if (json.containsKey("analysis")) { | 12903 if (json.containsKey("version")) { |
18041 analysis = new AnalysisStatus.fromJson( | 12904 version = |
18042 jsonDecoder, jsonPath + ".analysis", json["analysis"]); | 12905 jsonDecoder.decodeString(jsonPath + ".version", json["version"]); |
| 12906 } else { |
| 12907 throw jsonDecoder.mismatch(jsonPath, "version"); |
18043 } | 12908 } |
18044 PubStatus pub; | 12909 return new ServerGetVersionResult(version); |
18045 if (json.containsKey("pub")) { | |
18046 pub = | |
18047 new PubStatus.fromJson(jsonDecoder, jsonPath + ".pub", json["pub"]); | |
18048 } | |
18049 return new ServerStatusParams(analysis: analysis, pub: pub); | |
18050 } else { | 12910 } else { |
18051 throw jsonDecoder.mismatch(jsonPath, "server.status params", json); | 12911 throw jsonDecoder.mismatch(jsonPath, "server.getVersion result", json); |
18052 } | 12912 } |
18053 } | 12913 } |
18054 | 12914 |
18055 factory ServerStatusParams.fromNotification(Notification notification) { | 12915 factory ServerGetVersionResult.fromResponse(Response response) { |
18056 return new ServerStatusParams.fromJson( | 12916 return new ServerGetVersionResult.fromJson( |
18057 new ResponseDecoder(null), "params", notification.params); | 12917 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), |
| 12918 "result", |
| 12919 response.result); |
18058 } | 12920 } |
18059 | 12921 |
18060 @override | 12922 @override |
18061 Map<String, dynamic> toJson() { | 12923 Map<String, dynamic> toJson() { |
18062 Map<String, dynamic> result = {}; | 12924 Map<String, dynamic> result = {}; |
18063 if (analysis != null) { | 12925 result["version"] = version; |
18064 result["analysis"] = analysis.toJson(); | |
18065 } | |
18066 if (pub != null) { | |
18067 result["pub"] = pub.toJson(); | |
18068 } | |
18069 return result; | 12926 return result; |
18070 } | 12927 } |
18071 | 12928 |
18072 Notification toNotification() { | 12929 @override |
18073 return new Notification("server.status", toJson()); | 12930 Response toResponse(String id) { |
| 12931 return new Response(id, result: toJson()); |
18074 } | 12932 } |
18075 | 12933 |
18076 @override | 12934 @override |
18077 String toString() => JSON.encode(toJson()); | 12935 String toString() => JSON.encode(toJson()); |
18078 | 12936 |
18079 @override | 12937 @override |
18080 bool operator ==(other) { | 12938 bool operator ==(other) { |
18081 if (other is ServerStatusParams) { | 12939 if (other is ServerGetVersionResult) { |
18082 return analysis == other.analysis && pub == other.pub; | 12940 return version == other.version; |
18083 } | 12941 } |
18084 return false; | 12942 return false; |
18085 } | 12943 } |
18086 | 12944 |
18087 @override | 12945 @override |
18088 int get hashCode { | 12946 int get hashCode { |
18089 int hash = 0; | 12947 int hash = 0; |
18090 hash = JenkinsSmiHash.combine(hash, analysis.hashCode); | 12948 hash = JenkinsSmiHash.combine(hash, version.hashCode); |
18091 hash = JenkinsSmiHash.combine(hash, pub.hashCode); | |
18092 return JenkinsSmiHash.finish(hash); | 12949 return JenkinsSmiHash.finish(hash); |
18093 } | 12950 } |
18094 } | 12951 } |
18095 | 12952 |
18096 /** | 12953 /** |
18097 * SourceChange | 12954 * ServerService |
18098 * | 12955 * |
18099 * { | 12956 * enum { |
18100 * "message": String | 12957 * STATUS |
18101 * "edits": List<SourceFileEdit> | |
18102 * "linkedEditGroups": List<LinkedEditGroup> | |
18103 * "selection": optional Position | |
18104 * } | 12958 * } |
18105 * | 12959 * |
18106 * Clients may not extend, implement or mix-in this class. | 12960 * Clients may not extend, implement or mix-in this class. |
18107 */ | 12961 */ |
18108 class SourceChange implements HasToJson { | 12962 class ServerService implements Enum { |
18109 String _message; | 12963 static const ServerService STATUS = const ServerService._("STATUS"); |
18110 | |
18111 List<SourceFileEdit> _edits; | |
18112 | |
18113 List<LinkedEditGroup> _linkedEditGroups; | |
18114 | |
18115 Position _selection; | |
18116 | 12964 |
18117 /** | 12965 /** |
18118 * A human-readable description of the change to be applied. | 12966 * A list containing all of the enum values that are defined. |
18119 */ | 12967 */ |
18120 String get message => _message; | 12968 static const List<ServerService> VALUES = const <ServerService>[STATUS]; |
| 12969 |
| 12970 @override |
| 12971 final String name; |
| 12972 |
| 12973 const ServerService._(this.name); |
| 12974 |
| 12975 factory ServerService(String name) { |
| 12976 switch (name) { |
| 12977 case "STATUS": |
| 12978 return STATUS; |
| 12979 } |
| 12980 throw new Exception('Illegal enum value: $name'); |
| 12981 } |
| 12982 |
| 12983 factory ServerService.fromJson( |
| 12984 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
| 12985 if (json is String) { |
| 12986 try { |
| 12987 return new ServerService(json); |
| 12988 } catch (_) { |
| 12989 // Fall through |
| 12990 } |
| 12991 } |
| 12992 throw jsonDecoder.mismatch(jsonPath, "ServerService", json); |
| 12993 } |
| 12994 |
| 12995 @override |
| 12996 String toString() => "ServerService.$name"; |
| 12997 |
| 12998 String toJson() => name; |
| 12999 } |
| 13000 |
| 13001 /** |
| 13002 * server.setSubscriptions params |
| 13003 * |
| 13004 * { |
| 13005 * "subscriptions": List<ServerService> |
| 13006 * } |
| 13007 * |
| 13008 * Clients may not extend, implement or mix-in this class. |
| 13009 */ |
| 13010 class ServerSetSubscriptionsParams implements RequestParams { |
| 13011 List<ServerService> _subscriptions; |
18121 | 13012 |
18122 /** | 13013 /** |
18123 * A human-readable description of the change to be applied. | 13014 * A list of the services being subscribed to. |
18124 */ | 13015 */ |
18125 void set message(String value) { | 13016 List<ServerService> get subscriptions => _subscriptions; |
| 13017 |
| 13018 /** |
| 13019 * A list of the services being subscribed to. |
| 13020 */ |
| 13021 void set subscriptions(List<ServerService> value) { |
18126 assert(value != null); | 13022 assert(value != null); |
18127 this._message = value; | 13023 this._subscriptions = value; |
18128 } | 13024 } |
18129 | 13025 |
18130 /** | 13026 ServerSetSubscriptionsParams(List<ServerService> subscriptions) { |
18131 * A list of the edits used to effect the change, grouped by file. | 13027 this.subscriptions = subscriptions; |
18132 */ | |
18133 List<SourceFileEdit> get edits => _edits; | |
18134 | |
18135 /** | |
18136 * A list of the edits used to effect the change, grouped by file. | |
18137 */ | |
18138 void set edits(List<SourceFileEdit> value) { | |
18139 assert(value != null); | |
18140 this._edits = value; | |
18141 } | 13028 } |
18142 | 13029 |
18143 /** | 13030 factory ServerSetSubscriptionsParams.fromJson( |
18144 * A list of the linked editing groups used to customize the changes that | |
18145 * were made. | |
18146 */ | |
18147 List<LinkedEditGroup> get linkedEditGroups => _linkedEditGroups; | |
18148 | |
18149 /** | |
18150 * A list of the linked editing groups used to customize the changes that | |
18151 * were made. | |
18152 */ | |
18153 void set linkedEditGroups(List<LinkedEditGroup> value) { | |
18154 assert(value != null); | |
18155 this._linkedEditGroups = value; | |
18156 } | |
18157 | |
18158 /** | |
18159 * The position that should be selected after the edits have been applied. | |
18160 */ | |
18161 Position get selection => _selection; | |
18162 | |
18163 /** | |
18164 * The position that should be selected after the edits have been applied. | |
18165 */ | |
18166 void set selection(Position value) { | |
18167 this._selection = value; | |
18168 } | |
18169 | |
18170 SourceChange(String message, | |
18171 {List<SourceFileEdit> edits, | |
18172 List<LinkedEditGroup> linkedEditGroups, | |
18173 Position selection}) { | |
18174 this.message = message; | |
18175 if (edits == null) { | |
18176 this.edits = <SourceFileEdit>[]; | |
18177 } else { | |
18178 this.edits = edits; | |
18179 } | |
18180 if (linkedEditGroups == null) { | |
18181 this.linkedEditGroups = <LinkedEditGroup>[]; | |
18182 } else { | |
18183 this.linkedEditGroups = linkedEditGroups; | |
18184 } | |
18185 this.selection = selection; | |
18186 } | |
18187 | |
18188 factory SourceChange.fromJson( | |
18189 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 13031 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
18190 if (json == null) { | 13032 if (json == null) { |
18191 json = {}; | 13033 json = {}; |
18192 } | 13034 } |
18193 if (json is Map) { | 13035 if (json is Map) { |
18194 String message; | 13036 List<ServerService> subscriptions; |
18195 if (json.containsKey("message")) { | 13037 if (json.containsKey("subscriptions")) { |
18196 message = | 13038 subscriptions = jsonDecoder.decodeList( |
18197 jsonDecoder.decodeString(jsonPath + ".message", json["message"]); | 13039 jsonPath + ".subscriptions", |
| 13040 json["subscriptions"], |
| 13041 (String jsonPath, Object json) => |
| 13042 new ServerService.fromJson(jsonDecoder, jsonPath, json)); |
18198 } else { | 13043 } else { |
18199 throw jsonDecoder.mismatch(jsonPath, "message"); | 13044 throw jsonDecoder.mismatch(jsonPath, "subscriptions"); |
18200 } | 13045 } |
18201 List<SourceFileEdit> edits; | 13046 return new ServerSetSubscriptionsParams(subscriptions); |
18202 if (json.containsKey("edits")) { | |
18203 edits = jsonDecoder.decodeList( | |
18204 jsonPath + ".edits", | |
18205 json["edits"], | |
18206 (String jsonPath, Object json) => | |
18207 new SourceFileEdit.fromJson(jsonDecoder, jsonPath, json)); | |
18208 } else { | |
18209 throw jsonDecoder.mismatch(jsonPath, "edits"); | |
18210 } | |
18211 List<LinkedEditGroup> linkedEditGroups; | |
18212 if (json.containsKey("linkedEditGroups")) { | |
18213 linkedEditGroups = jsonDecoder.decodeList( | |
18214 jsonPath + ".linkedEditGroups", | |
18215 json["linkedEditGroups"], | |
18216 (String jsonPath, Object json) => | |
18217 new LinkedEditGroup.fromJson(jsonDecoder, jsonPath, json)); | |
18218 } else { | |
18219 throw jsonDecoder.mismatch(jsonPath, "linkedEditGroups"); | |
18220 } | |
18221 Position selection; | |
18222 if (json.containsKey("selection")) { | |
18223 selection = new Position.fromJson( | |
18224 jsonDecoder, jsonPath + ".selection", json["selection"]); | |
18225 } | |
18226 return new SourceChange(message, | |
18227 edits: edits, | |
18228 linkedEditGroups: linkedEditGroups, | |
18229 selection: selection); | |
18230 } else { | 13047 } else { |
18231 throw jsonDecoder.mismatch(jsonPath, "SourceChange", json); | 13048 throw jsonDecoder.mismatch( |
| 13049 jsonPath, "server.setSubscriptions params", json); |
18232 } | 13050 } |
18233 } | 13051 } |
18234 | 13052 |
| 13053 factory ServerSetSubscriptionsParams.fromRequest(Request request) { |
| 13054 return new ServerSetSubscriptionsParams.fromJson( |
| 13055 new RequestDecoder(request), "params", request.params); |
| 13056 } |
| 13057 |
18235 @override | 13058 @override |
18236 Map<String, dynamic> toJson() { | 13059 Map<String, dynamic> toJson() { |
18237 Map<String, dynamic> result = {}; | 13060 Map<String, dynamic> result = {}; |
18238 result["message"] = message; | 13061 result["subscriptions"] = |
18239 result["edits"] = | 13062 subscriptions.map((ServerService value) => value.toJson()).toList(); |
18240 edits.map((SourceFileEdit value) => value.toJson()).toList(); | |
18241 result["linkedEditGroups"] = linkedEditGroups | |
18242 .map((LinkedEditGroup value) => value.toJson()) | |
18243 .toList(); | |
18244 if (selection != null) { | |
18245 result["selection"] = selection.toJson(); | |
18246 } | |
18247 return result; | 13063 return result; |
18248 } | 13064 } |
18249 | 13065 |
18250 /** | 13066 @override |
18251 * Adds [edit] to the [FileEdit] for the given [file]. | 13067 Request toRequest(String id) { |
18252 */ | 13068 return new Request(id, "server.setSubscriptions", toJson()); |
18253 void addEdit(String file, int fileStamp, SourceEdit edit) => | |
18254 addEditToSourceChange(this, file, fileStamp, edit); | |
18255 | |
18256 /** | |
18257 * Adds the given [FileEdit]. | |
18258 */ | |
18259 void addFileEdit(SourceFileEdit edit) { | |
18260 edits.add(edit); | |
18261 } | 13069 } |
18262 | 13070 |
18263 /** | |
18264 * Adds the given [LinkedEditGroup]. | |
18265 */ | |
18266 void addLinkedEditGroup(LinkedEditGroup linkedEditGroup) { | |
18267 linkedEditGroups.add(linkedEditGroup); | |
18268 } | |
18269 | |
18270 /** | |
18271 * Returns the [FileEdit] for the given [file], maybe `null`. | |
18272 */ | |
18273 SourceFileEdit getFileEdit(String file) => getChangeFileEdit(this, file); | |
18274 | |
18275 @override | 13071 @override |
18276 String toString() => JSON.encode(toJson()); | 13072 String toString() => JSON.encode(toJson()); |
18277 | 13073 |
18278 @override | 13074 @override |
18279 bool operator ==(other) { | 13075 bool operator ==(other) { |
18280 if (other is SourceChange) { | 13076 if (other is ServerSetSubscriptionsParams) { |
18281 return message == other.message && | 13077 return listEqual(subscriptions, other.subscriptions, |
18282 listEqual(edits, other.edits, | 13078 (ServerService a, ServerService b) => a == b); |
18283 (SourceFileEdit a, SourceFileEdit b) => a == b) && | |
18284 listEqual(linkedEditGroups, other.linkedEditGroups, | |
18285 (LinkedEditGroup a, LinkedEditGroup b) => a == b) && | |
18286 selection == other.selection; | |
18287 } | 13079 } |
18288 return false; | 13080 return false; |
18289 } | 13081 } |
18290 | 13082 |
18291 @override | 13083 @override |
18292 int get hashCode { | 13084 int get hashCode { |
18293 int hash = 0; | 13085 int hash = 0; |
18294 hash = JenkinsSmiHash.combine(hash, message.hashCode); | 13086 hash = JenkinsSmiHash.combine(hash, subscriptions.hashCode); |
18295 hash = JenkinsSmiHash.combine(hash, edits.hashCode); | |
18296 hash = JenkinsSmiHash.combine(hash, linkedEditGroups.hashCode); | |
18297 hash = JenkinsSmiHash.combine(hash, selection.hashCode); | |
18298 return JenkinsSmiHash.finish(hash); | 13087 return JenkinsSmiHash.finish(hash); |
18299 } | 13088 } |
18300 } | 13089 } |
18301 | 13090 |
18302 /** | 13091 /** |
18303 * SourceEdit | 13092 * server.setSubscriptions result |
| 13093 * |
| 13094 * Clients may not extend, implement or mix-in this class. |
| 13095 */ |
| 13096 class ServerSetSubscriptionsResult implements ResponseResult { |
| 13097 @override |
| 13098 Map<String, dynamic> toJson() => <String, dynamic>{}; |
| 13099 |
| 13100 @override |
| 13101 Response toResponse(String id) { |
| 13102 return new Response(id, result: null); |
| 13103 } |
| 13104 |
| 13105 @override |
| 13106 bool operator ==(other) { |
| 13107 if (other is ServerSetSubscriptionsResult) { |
| 13108 return true; |
| 13109 } |
| 13110 return false; |
| 13111 } |
| 13112 |
| 13113 @override |
| 13114 int get hashCode { |
| 13115 return 748820900; |
| 13116 } |
| 13117 } |
| 13118 |
| 13119 /** |
| 13120 * server.shutdown params |
| 13121 * |
| 13122 * Clients may not extend, implement or mix-in this class. |
| 13123 */ |
| 13124 class ServerShutdownParams implements RequestParams { |
| 13125 @override |
| 13126 Map<String, dynamic> toJson() => <String, dynamic>{}; |
| 13127 |
| 13128 @override |
| 13129 Request toRequest(String id) { |
| 13130 return new Request(id, "server.shutdown", null); |
| 13131 } |
| 13132 |
| 13133 @override |
| 13134 bool operator ==(other) { |
| 13135 if (other is ServerShutdownParams) { |
| 13136 return true; |
| 13137 } |
| 13138 return false; |
| 13139 } |
| 13140 |
| 13141 @override |
| 13142 int get hashCode { |
| 13143 return 366630911; |
| 13144 } |
| 13145 } |
| 13146 |
| 13147 /** |
| 13148 * server.shutdown result |
| 13149 * |
| 13150 * Clients may not extend, implement or mix-in this class. |
| 13151 */ |
| 13152 class ServerShutdownResult implements ResponseResult { |
| 13153 @override |
| 13154 Map<String, dynamic> toJson() => <String, dynamic>{}; |
| 13155 |
| 13156 @override |
| 13157 Response toResponse(String id) { |
| 13158 return new Response(id, result: null); |
| 13159 } |
| 13160 |
| 13161 @override |
| 13162 bool operator ==(other) { |
| 13163 if (other is ServerShutdownResult) { |
| 13164 return true; |
| 13165 } |
| 13166 return false; |
| 13167 } |
| 13168 |
| 13169 @override |
| 13170 int get hashCode { |
| 13171 return 193626532; |
| 13172 } |
| 13173 } |
| 13174 |
| 13175 /** |
| 13176 * server.status params |
18304 * | 13177 * |
18305 * { | 13178 * { |
18306 * "offset": int | 13179 * "analysis": optional AnalysisStatus |
18307 * "length": int | 13180 * "pub": optional PubStatus |
18308 * "replacement": String | |
18309 * "id": optional String | |
18310 * } | 13181 * } |
18311 * | 13182 * |
18312 * Clients may not extend, implement or mix-in this class. | 13183 * Clients may not extend, implement or mix-in this class. |
18313 */ | 13184 */ |
18314 class SourceEdit implements HasToJson { | 13185 class ServerStatusParams implements HasToJson { |
18315 /** | 13186 AnalysisStatus _analysis; |
18316 * Get the result of applying a set of [edits] to the given [code]. Edits are | |
18317 * applied in the order they appear in [edits]. | |
18318 */ | |
18319 static String applySequence(String code, Iterable<SourceEdit> edits) => | |
18320 applySequenceOfEdits(code, edits); | |
18321 | 13187 |
18322 int _offset; | 13188 PubStatus _pub; |
18323 | |
18324 int _length; | |
18325 | |
18326 String _replacement; | |
18327 | |
18328 String _id; | |
18329 | 13189 |
18330 /** | 13190 /** |
18331 * The offset of the region to be modified. | 13191 * The current status of analysis, including whether analysis is being |
| 13192 * performed and if so what is being analyzed. |
18332 */ | 13193 */ |
18333 int get offset => _offset; | 13194 AnalysisStatus get analysis => _analysis; |
18334 | 13195 |
18335 /** | 13196 /** |
18336 * The offset of the region to be modified. | 13197 * The current status of analysis, including whether analysis is being |
| 13198 * performed and if so what is being analyzed. |
18337 */ | 13199 */ |
18338 void set offset(int value) { | 13200 void set analysis(AnalysisStatus value) { |
18339 assert(value != null); | 13201 this._analysis = value; |
18340 this._offset = value; | |
18341 } | 13202 } |
18342 | 13203 |
18343 /** | 13204 /** |
18344 * The length of the region to be modified. | 13205 * The current status of pub execution, indicating whether we are currently |
| 13206 * running pub. |
18345 */ | 13207 */ |
18346 int get length => _length; | 13208 PubStatus get pub => _pub; |
18347 | 13209 |
18348 /** | 13210 /** |
18349 * The length of the region to be modified. | 13211 * The current status of pub execution, indicating whether we are currently |
| 13212 * running pub. |
18350 */ | 13213 */ |
18351 void set length(int value) { | 13214 void set pub(PubStatus value) { |
18352 assert(value != null); | 13215 this._pub = value; |
18353 this._length = value; | |
18354 } | 13216 } |
18355 | 13217 |
18356 /** | 13218 ServerStatusParams({AnalysisStatus analysis, PubStatus pub}) { |
18357 * The code that is to replace the specified region in the original code. | 13219 this.analysis = analysis; |
18358 */ | 13220 this.pub = pub; |
18359 String get replacement => _replacement; | |
18360 | |
18361 /** | |
18362 * The code that is to replace the specified region in the original code. | |
18363 */ | |
18364 void set replacement(String value) { | |
18365 assert(value != null); | |
18366 this._replacement = value; | |
18367 } | 13221 } |
18368 | 13222 |
18369 /** | 13223 factory ServerStatusParams.fromJson( |
18370 * An identifier that uniquely identifies this source edit from other edits | |
18371 * in the same response. This field is omitted unless a containing structure | |
18372 * needs to be able to identify the edit for some reason. | |
18373 * | |
18374 * For example, some refactoring operations can produce edits that might not | |
18375 * be appropriate (referred to as potential edits). Such edits will have an | |
18376 * id so that they can be referenced. Edits in the same response that do not | |
18377 * need to be referenced will not have an id. | |
18378 */ | |
18379 String get id => _id; | |
18380 | |
18381 /** | |
18382 * An identifier that uniquely identifies this source edit from other edits | |
18383 * in the same response. This field is omitted unless a containing structure | |
18384 * needs to be able to identify the edit for some reason. | |
18385 * | |
18386 * For example, some refactoring operations can produce edits that might not | |
18387 * be appropriate (referred to as potential edits). Such edits will have an | |
18388 * id so that they can be referenced. Edits in the same response that do not | |
18389 * need to be referenced will not have an id. | |
18390 */ | |
18391 void set id(String value) { | |
18392 this._id = value; | |
18393 } | |
18394 | |
18395 SourceEdit(int offset, int length, String replacement, {String id}) { | |
18396 this.offset = offset; | |
18397 this.length = length; | |
18398 this.replacement = replacement; | |
18399 this.id = id; | |
18400 } | |
18401 | |
18402 factory SourceEdit.fromJson( | |
18403 JsonDecoder jsonDecoder, String jsonPath, Object json) { | 13224 JsonDecoder jsonDecoder, String jsonPath, Object json) { |
18404 if (json == null) { | 13225 if (json == null) { |
18405 json = {}; | 13226 json = {}; |
18406 } | 13227 } |
18407 if (json is Map) { | 13228 if (json is Map) { |
18408 int offset; | 13229 AnalysisStatus analysis; |
18409 if (json.containsKey("offset")) { | 13230 if (json.containsKey("analysis")) { |
18410 offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); | 13231 analysis = new AnalysisStatus.fromJson( |
18411 } else { | 13232 jsonDecoder, jsonPath + ".analysis", json["analysis"]); |
18412 throw jsonDecoder.mismatch(jsonPath, "offset"); | |
18413 } | 13233 } |
18414 int length; | 13234 PubStatus pub; |
18415 if (json.containsKey("length")) { | 13235 if (json.containsKey("pub")) { |
18416 length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]); | 13236 pub = |
18417 } else { | 13237 new PubStatus.fromJson(jsonDecoder, jsonPath + ".pub", json["pub"]); |
18418 throw jsonDecoder.mismatch(jsonPath, "length"); | |
18419 } | 13238 } |
18420 String replacement; | 13239 return new ServerStatusParams(analysis: analysis, pub: pub); |
18421 if (json.containsKey("replacement")) { | |
18422 replacement = jsonDecoder.decodeString( | |
18423 jsonPath + ".replacement", json["replacement"]); | |
18424 } else { | |
18425 throw jsonDecoder.mismatch(jsonPath, "replacement"); | |
18426 } | |
18427 String id; | |
18428 if (json.containsKey("id")) { | |
18429 id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]); | |
18430 } | |
18431 return new SourceEdit(offset, length, replacement, id: id); | |
18432 } else { | 13240 } else { |
18433 throw jsonDecoder.mismatch(jsonPath, "SourceEdit", json); | 13241 throw jsonDecoder.mismatch(jsonPath, "server.status params", json); |
18434 } | 13242 } |
18435 } | 13243 } |
18436 | 13244 |
18437 /** | 13245 factory ServerStatusParams.fromNotification(Notification notification) { |
18438 * The end of the region to be modified. | 13246 return new ServerStatusParams.fromJson( |
18439 */ | 13247 new ResponseDecoder(null), "params", notification.params); |
18440 int get end => offset + length; | 13248 } |
18441 | 13249 |
18442 @override | 13250 @override |
18443 Map<String, dynamic> toJson() { | 13251 Map<String, dynamic> toJson() { |
18444 Map<String, dynamic> result = {}; | 13252 Map<String, dynamic> result = {}; |
18445 result["offset"] = offset; | 13253 if (analysis != null) { |
18446 result["length"] = length; | 13254 result["analysis"] = analysis.toJson(); |
18447 result["replacement"] = replacement; | 13255 } |
18448 if (id != null) { | 13256 if (pub != null) { |
18449 result["id"] = id; | 13257 result["pub"] = pub.toJson(); |
18450 } | 13258 } |
18451 return result; | 13259 return result; |
18452 } | 13260 } |
18453 | 13261 |
18454 /** | 13262 Notification toNotification() { |
18455 * Get the result of applying the edit to the given [code]. | 13263 return new Notification("server.status", toJson()); |
18456 */ | 13264 } |
18457 String apply(String code) => applyEdit(code, this); | |
18458 | 13265 |
18459 @override | 13266 @override |
18460 String toString() => JSON.encode(toJson()); | 13267 String toString() => JSON.encode(toJson()); |
18461 | 13268 |
18462 @override | 13269 @override |
18463 bool operator ==(other) { | 13270 bool operator ==(other) { |
18464 if (other is SourceEdit) { | 13271 if (other is ServerStatusParams) { |
18465 return offset == other.offset && | 13272 return analysis == other.analysis && pub == other.pub; |
18466 length == other.length && | |
18467 replacement == other.replacement && | |
18468 id == other.id; | |
18469 } | 13273 } |
18470 return false; | 13274 return false; |
18471 } | 13275 } |
18472 | |
18473 @override | |
18474 int get hashCode { | |
18475 int hash = 0; | |
18476 hash = JenkinsSmiHash.combine(hash, offset.hashCode); | |
18477 hash = JenkinsSmiHash.combine(hash, length.hashCode); | |
18478 hash = JenkinsSmiHash.combine(hash, replacement.hashCode); | |
18479 hash = JenkinsSmiHash.combine(hash, id.hashCode); | |
18480 return JenkinsSmiHash.finish(hash); | |
18481 } | |
18482 } | |
18483 | |
18484 /** | |
18485 * SourceFileEdit | |
18486 * | |
18487 * { | |
18488 * "file": FilePath | |
18489 * "fileStamp": long | |
18490 * "edits": List<SourceEdit> | |
18491 * } | |
18492 * | |
18493 * Clients may not extend, implement or mix-in this class. | |
18494 */ | |
18495 class SourceFileEdit implements HasToJson { | |
18496 String _file; | |
18497 | |
18498 int _fileStamp; | |
18499 | |
18500 List<SourceEdit> _edits; | |
18501 | |
18502 /** | |
18503 * The file containing the code to be modified. | |
18504 */ | |
18505 String get file => _file; | |
18506 | |
18507 /** | |
18508 * The file containing the code to be modified. | |
18509 */ | |
18510 void set file(String value) { | |
18511 assert(value != null); | |
18512 this._file = value; | |
18513 } | |
18514 | |
18515 /** | |
18516 * The modification stamp of the file at the moment when the change was | |
18517 * created, in milliseconds since the "Unix epoch". Will be -1 if the file | |
18518 * did not exist and should be created. The client may use this field to make | |
18519 * sure that the file was not changed since then, so it is safe to apply the | |
18520 * change. | |
18521 */ | |
18522 int get fileStamp => _fileStamp; | |
18523 | |
18524 /** | |
18525 * The modification stamp of the file at the moment when the change was | |
18526 * created, in milliseconds since the "Unix epoch". Will be -1 if the file | |
18527 * did not exist and should be created. The client may use this field to make | |
18528 * sure that the file was not changed since then, so it is safe to apply the | |
18529 * change. | |
18530 */ | |
18531 void set fileStamp(int value) { | |
18532 assert(value != null); | |
18533 this._fileStamp = value; | |
18534 } | |
18535 | |
18536 /** | |
18537 * A list of the edits used to effect the change. | |
18538 */ | |
18539 List<SourceEdit> get edits => _edits; | |
18540 | |
18541 /** | |
18542 * A list of the edits used to effect the change. | |
18543 */ | |
18544 void set edits(List<SourceEdit> value) { | |
18545 assert(value != null); | |
18546 this._edits = value; | |
18547 } | |
18548 | |
18549 SourceFileEdit(String file, int fileStamp, {List<SourceEdit> edits}) { | |
18550 this.file = file; | |
18551 this.fileStamp = fileStamp; | |
18552 if (edits == null) { | |
18553 this.edits = <SourceEdit>[]; | |
18554 } else { | |
18555 this.edits = edits; | |
18556 } | |
18557 } | |
18558 | |
18559 factory SourceFileEdit.fromJson( | |
18560 JsonDecoder jsonDecoder, String jsonPath, Object json) { | |
18561 if (json == null) { | |
18562 json = {}; | |
18563 } | |
18564 if (json is Map) { | |
18565 String file; | |
18566 if (json.containsKey("file")) { | |
18567 file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]); | |
18568 } else { | |
18569 throw jsonDecoder.mismatch(jsonPath, "file"); | |
18570 } | |
18571 int fileStamp; | |
18572 if (json.containsKey("fileStamp")) { | |
18573 fileStamp = | |
18574 jsonDecoder.decodeInt(jsonPath + ".fileStamp", json["fileStamp"]); | |
18575 } else { | |
18576 throw jsonDecoder.mismatch(jsonPath, "fileStamp"); | |
18577 } | |
18578 List<SourceEdit> edits; | |
18579 if (json.containsKey("edits")) { | |
18580 edits = jsonDecoder.decodeList( | |
18581 jsonPath + ".edits", | |
18582 json["edits"], | |
18583 (String jsonPath, Object json) => | |
18584 new SourceEdit.fromJson(jsonDecoder, jsonPath, json)); | |
18585 } else { | |
18586 throw jsonDecoder.mismatch(jsonPath, "edits"); | |
18587 } | |
18588 return new SourceFileEdit(file, fileStamp, edits: edits); | |
18589 } else { | |
18590 throw jsonDecoder.mismatch(jsonPath, "SourceFileEdit", json); | |
18591 } | |
18592 } | |
18593 | |
18594 @override | |
18595 Map<String, dynamic> toJson() { | |
18596 Map<String, dynamic> result = {}; | |
18597 result["file"] = file; | |
18598 result["fileStamp"] = fileStamp; | |
18599 result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList(); | |
18600 return result; | |
18601 } | |
18602 | |
18603 /** | |
18604 * Adds the given [Edit] to the list. | |
18605 */ | |
18606 void add(SourceEdit edit) => addEditForSource(this, edit); | |
18607 | |
18608 /** | |
18609 * Adds the given [Edit]s. | |
18610 */ | |
18611 void addAll(Iterable<SourceEdit> edits) => addAllEditsForSource(this, edits); | |
18612 | |
18613 @override | |
18614 String toString() => JSON.encode(toJson()); | |
18615 | |
18616 @override | |
18617 bool operator ==(other) { | |
18618 if (other is SourceFileEdit) { | |
18619 return file == other.file && | |
18620 fileStamp == other.fileStamp && | |
18621 listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a == b); | |
18622 } | |
18623 return false; | |
18624 } | |
18625 | 13276 |
18626 @override | 13277 @override |
18627 int get hashCode { | 13278 int get hashCode { |
18628 int hash = 0; | 13279 int hash = 0; |
18629 hash = JenkinsSmiHash.combine(hash, file.hashCode); | 13280 hash = JenkinsSmiHash.combine(hash, analysis.hashCode); |
18630 hash = JenkinsSmiHash.combine(hash, fileStamp.hashCode); | 13281 hash = JenkinsSmiHash.combine(hash, pub.hashCode); |
18631 hash = JenkinsSmiHash.combine(hash, edits.hashCode); | |
18632 return JenkinsSmiHash.finish(hash); | 13282 return JenkinsSmiHash.finish(hash); |
18633 } | 13283 } |
18634 } | 13284 } |
18635 | 13285 |
18636 /** | 13286 /** |
18637 * TypeHierarchyItem | 13287 * TypeHierarchyItem |
18638 * | 13288 * |
18639 * { | 13289 * { |
18640 * "classElement": Element | 13290 * "classElement": Element |
18641 * "displayName": optional String | 13291 * "displayName": optional String |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
18904 hash = JenkinsSmiHash.combine(hash, classElement.hashCode); | 13554 hash = JenkinsSmiHash.combine(hash, classElement.hashCode); |
18905 hash = JenkinsSmiHash.combine(hash, displayName.hashCode); | 13555 hash = JenkinsSmiHash.combine(hash, displayName.hashCode); |
18906 hash = JenkinsSmiHash.combine(hash, memberElement.hashCode); | 13556 hash = JenkinsSmiHash.combine(hash, memberElement.hashCode); |
18907 hash = JenkinsSmiHash.combine(hash, superclass.hashCode); | 13557 hash = JenkinsSmiHash.combine(hash, superclass.hashCode); |
18908 hash = JenkinsSmiHash.combine(hash, interfaces.hashCode); | 13558 hash = JenkinsSmiHash.combine(hash, interfaces.hashCode); |
18909 hash = JenkinsSmiHash.combine(hash, mixins.hashCode); | 13559 hash = JenkinsSmiHash.combine(hash, mixins.hashCode); |
18910 hash = JenkinsSmiHash.combine(hash, subclasses.hashCode); | 13560 hash = JenkinsSmiHash.combine(hash, subclasses.hashCode); |
18911 return JenkinsSmiHash.finish(hash); | 13561 return JenkinsSmiHash.finish(hash); |
18912 } | 13562 } |
18913 } | 13563 } |
OLD | NEW |