| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 // | |
| 5 // This file has been automatically generated. Please do not edit it manually. | |
| 6 // To regenerate the file, use the script | |
| 7 // "pkg/analysis_server/tool/spec/generate_files". | |
| 8 | |
| 9 part of protocol; | |
| 10 /** | |
| 11 * server.getVersion params | |
| 12 */ | |
| 13 class ServerGetVersionParams { | |
| 14 Request toRequest(String id) { | |
| 15 return new Request(id, "server.getVersion", null); | |
| 16 } | |
| 17 | |
| 18 @override | |
| 19 bool operator==(other) { | |
| 20 if (other is ServerGetVersionParams) { | |
| 21 return true; | |
| 22 } | |
| 23 return false; | |
| 24 } | |
| 25 | |
| 26 @override | |
| 27 int get hashCode { | |
| 28 return 55877452; | |
| 29 } | |
| 30 } | |
| 31 | |
| 32 /** | |
| 33 * server.getVersion result | |
| 34 * | |
| 35 * { | |
| 36 * "version": String | |
| 37 * } | |
| 38 */ | |
| 39 class ServerGetVersionResult implements HasToJson { | |
| 40 String _version; | |
| 41 | |
| 42 /** | |
| 43 * The version number of the analysis server. | |
| 44 */ | |
| 45 String get version => _version; | |
| 46 | |
| 47 /** | |
| 48 * The version number of the analysis server. | |
| 49 */ | |
| 50 void set version(String value) { | |
| 51 assert(value != null); | |
| 52 this._version = value; | |
| 53 } | |
| 54 | |
| 55 ServerGetVersionResult(String version) { | |
| 56 this.version = version; | |
| 57 } | |
| 58 | |
| 59 factory ServerGetVersionResult.fromJson(JsonDecoder jsonDecoder, String jsonPa
th, Object json) { | |
| 60 if (json == null) { | |
| 61 json = {}; | |
| 62 } | |
| 63 if (json is Map) { | |
| 64 String version; | |
| 65 if (json.containsKey("version")) { | |
| 66 version = jsonDecoder._decodeString(jsonPath + ".version", json["version
"]); | |
| 67 } else { | |
| 68 throw jsonDecoder.missingKey(jsonPath, "version"); | |
| 69 } | |
| 70 return new ServerGetVersionResult(version); | |
| 71 } else { | |
| 72 throw jsonDecoder.mismatch(jsonPath, "server.getVersion result", json); | |
| 73 } | |
| 74 } | |
| 75 | |
| 76 factory ServerGetVersionResult.fromResponse(Response response) { | |
| 77 return new ServerGetVersionResult.fromJson( | |
| 78 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); | |
| 79 } | |
| 80 | |
| 81 Map<String, dynamic> toJson() { | |
| 82 Map<String, dynamic> result = {}; | |
| 83 result["version"] = version; | |
| 84 return result; | |
| 85 } | |
| 86 | |
| 87 Response toResponse(String id) { | |
| 88 return new Response(id, result: toJson()); | |
| 89 } | |
| 90 | |
| 91 @override | |
| 92 String toString() => JSON.encode(toJson()); | |
| 93 | |
| 94 @override | |
| 95 bool operator==(other) { | |
| 96 if (other is ServerGetVersionResult) { | |
| 97 return version == other.version; | |
| 98 } | |
| 99 return false; | |
| 100 } | |
| 101 | |
| 102 @override | |
| 103 int get hashCode { | |
| 104 int hash = 0; | |
| 105 hash = _JenkinsSmiHash.combine(hash, version.hashCode); | |
| 106 return _JenkinsSmiHash.finish(hash); | |
| 107 } | |
| 108 } | |
| 109 /** | |
| 110 * server.shutdown params | |
| 111 */ | |
| 112 class ServerShutdownParams { | |
| 113 Request toRequest(String id) { | |
| 114 return new Request(id, "server.shutdown", null); | |
| 115 } | |
| 116 | |
| 117 @override | |
| 118 bool operator==(other) { | |
| 119 if (other is ServerShutdownParams) { | |
| 120 return true; | |
| 121 } | |
| 122 return false; | |
| 123 } | |
| 124 | |
| 125 @override | |
| 126 int get hashCode { | |
| 127 return 366630911; | |
| 128 } | |
| 129 } | |
| 130 /** | |
| 131 * server.shutdown result | |
| 132 */ | |
| 133 class ServerShutdownResult { | |
| 134 Response toResponse(String id) { | |
| 135 return new Response(id, result: null); | |
| 136 } | |
| 137 | |
| 138 @override | |
| 139 bool operator==(other) { | |
| 140 if (other is ServerShutdownResult) { | |
| 141 return true; | |
| 142 } | |
| 143 return false; | |
| 144 } | |
| 145 | |
| 146 @override | |
| 147 int get hashCode { | |
| 148 return 193626532; | |
| 149 } | |
| 150 } | |
| 151 | |
| 152 /** | |
| 153 * server.setSubscriptions params | |
| 154 * | |
| 155 * { | |
| 156 * "subscriptions": List<ServerService> | |
| 157 * } | |
| 158 */ | |
| 159 class ServerSetSubscriptionsParams implements HasToJson { | |
| 160 List<ServerService> _subscriptions; | |
| 161 | |
| 162 /** | |
| 163 * A list of the services being subscribed to. | |
| 164 */ | |
| 165 List<ServerService> get subscriptions => _subscriptions; | |
| 166 | |
| 167 /** | |
| 168 * A list of the services being subscribed to. | |
| 169 */ | |
| 170 void set subscriptions(List<ServerService> value) { | |
| 171 assert(value != null); | |
| 172 this._subscriptions = value; | |
| 173 } | |
| 174 | |
| 175 ServerSetSubscriptionsParams(List<ServerService> subscriptions) { | |
| 176 this.subscriptions = subscriptions; | |
| 177 } | |
| 178 | |
| 179 factory ServerSetSubscriptionsParams.fromJson(JsonDecoder jsonDecoder, String
jsonPath, Object json) { | |
| 180 if (json == null) { | |
| 181 json = {}; | |
| 182 } | |
| 183 if (json is Map) { | |
| 184 List<ServerService> subscriptions; | |
| 185 if (json.containsKey("subscriptions")) { | |
| 186 subscriptions = jsonDecoder._decodeList(jsonPath + ".subscriptions", jso
n["subscriptions"], (String jsonPath, Object json) => new ServerService.fromJson
(jsonDecoder, jsonPath, json)); | |
| 187 } else { | |
| 188 throw jsonDecoder.missingKey(jsonPath, "subscriptions"); | |
| 189 } | |
| 190 return new ServerSetSubscriptionsParams(subscriptions); | |
| 191 } else { | |
| 192 throw jsonDecoder.mismatch(jsonPath, "server.setSubscriptions params", jso
n); | |
| 193 } | |
| 194 } | |
| 195 | |
| 196 factory ServerSetSubscriptionsParams.fromRequest(Request request) { | |
| 197 return new ServerSetSubscriptionsParams.fromJson( | |
| 198 new RequestDecoder(request), "params", request._params); | |
| 199 } | |
| 200 | |
| 201 Map<String, dynamic> toJson() { | |
| 202 Map<String, dynamic> result = {}; | |
| 203 result["subscriptions"] = subscriptions.map((ServerService value) => value.t
oJson()).toList(); | |
| 204 return result; | |
| 205 } | |
| 206 | |
| 207 Request toRequest(String id) { | |
| 208 return new Request(id, "server.setSubscriptions", toJson()); | |
| 209 } | |
| 210 | |
| 211 @override | |
| 212 String toString() => JSON.encode(toJson()); | |
| 213 | |
| 214 @override | |
| 215 bool operator==(other) { | |
| 216 if (other is ServerSetSubscriptionsParams) { | |
| 217 return _listEqual(subscriptions, other.subscriptions, (ServerService a, Se
rverService b) => a == b); | |
| 218 } | |
| 219 return false; | |
| 220 } | |
| 221 | |
| 222 @override | |
| 223 int get hashCode { | |
| 224 int hash = 0; | |
| 225 hash = _JenkinsSmiHash.combine(hash, subscriptions.hashCode); | |
| 226 return _JenkinsSmiHash.finish(hash); | |
| 227 } | |
| 228 } | |
| 229 /** | |
| 230 * server.setSubscriptions result | |
| 231 */ | |
| 232 class ServerSetSubscriptionsResult { | |
| 233 Response toResponse(String id) { | |
| 234 return new Response(id, result: null); | |
| 235 } | |
| 236 | |
| 237 @override | |
| 238 bool operator==(other) { | |
| 239 if (other is ServerSetSubscriptionsResult) { | |
| 240 return true; | |
| 241 } | |
| 242 return false; | |
| 243 } | |
| 244 | |
| 245 @override | |
| 246 int get hashCode { | |
| 247 return 748820900; | |
| 248 } | |
| 249 } | |
| 250 | |
| 251 /** | |
| 252 * server.connected params | |
| 253 * | |
| 254 * { | |
| 255 * "version": String | |
| 256 * } | |
| 257 */ | |
| 258 class ServerConnectedParams implements HasToJson { | |
| 259 String _version; | |
| 260 | |
| 261 /** | |
| 262 * The version number of the analysis server. | |
| 263 */ | |
| 264 String get version => _version; | |
| 265 | |
| 266 /** | |
| 267 * The version number of the analysis server. | |
| 268 */ | |
| 269 void set version(String value) { | |
| 270 assert(value != null); | |
| 271 this._version = value; | |
| 272 } | |
| 273 | |
| 274 ServerConnectedParams(String version) { | |
| 275 this.version = version; | |
| 276 } | |
| 277 | |
| 278 factory ServerConnectedParams.fromJson(JsonDecoder jsonDecoder, String jsonPat
h, Object json) { | |
| 279 if (json == null) { | |
| 280 json = {}; | |
| 281 } | |
| 282 if (json is Map) { | |
| 283 String version; | |
| 284 if (json.containsKey("version")) { | |
| 285 version = jsonDecoder._decodeString(jsonPath + ".version", json["version
"]); | |
| 286 } else { | |
| 287 throw jsonDecoder.missingKey(jsonPath, "version"); | |
| 288 } | |
| 289 return new ServerConnectedParams(version); | |
| 290 } else { | |
| 291 throw jsonDecoder.mismatch(jsonPath, "server.connected params", json); | |
| 292 } | |
| 293 } | |
| 294 | |
| 295 factory ServerConnectedParams.fromNotification(Notification notification) { | |
| 296 return new ServerConnectedParams.fromJson( | |
| 297 new ResponseDecoder(null), "params", notification._params); | |
| 298 } | |
| 299 | |
| 300 Map<String, dynamic> toJson() { | |
| 301 Map<String, dynamic> result = {}; | |
| 302 result["version"] = version; | |
| 303 return result; | |
| 304 } | |
| 305 | |
| 306 Notification toNotification() { | |
| 307 return new Notification("server.connected", toJson()); | |
| 308 } | |
| 309 | |
| 310 @override | |
| 311 String toString() => JSON.encode(toJson()); | |
| 312 | |
| 313 @override | |
| 314 bool operator==(other) { | |
| 315 if (other is ServerConnectedParams) { | |
| 316 return version == other.version; | |
| 317 } | |
| 318 return false; | |
| 319 } | |
| 320 | |
| 321 @override | |
| 322 int get hashCode { | |
| 323 int hash = 0; | |
| 324 hash = _JenkinsSmiHash.combine(hash, version.hashCode); | |
| 325 return _JenkinsSmiHash.finish(hash); | |
| 326 } | |
| 327 } | |
| 328 | |
| 329 /** | |
| 330 * server.error params | |
| 331 * | |
| 332 * { | |
| 333 * "isFatal": bool | |
| 334 * "message": String | |
| 335 * "stackTrace": String | |
| 336 * } | |
| 337 */ | |
| 338 class ServerErrorParams implements HasToJson { | |
| 339 bool _isFatal; | |
| 340 | |
| 341 String _message; | |
| 342 | |
| 343 String _stackTrace; | |
| 344 | |
| 345 /** | |
| 346 * True if the error is a fatal error, meaning that the server will shutdown | |
| 347 * automatically after sending this notification. | |
| 348 */ | |
| 349 bool get isFatal => _isFatal; | |
| 350 | |
| 351 /** | |
| 352 * True if the error is a fatal error, meaning that the server will shutdown | |
| 353 * automatically after sending this notification. | |
| 354 */ | |
| 355 void set isFatal(bool value) { | |
| 356 assert(value != null); | |
| 357 this._isFatal = value; | |
| 358 } | |
| 359 | |
| 360 /** | |
| 361 * The error message indicating what kind of error was encountered. | |
| 362 */ | |
| 363 String get message => _message; | |
| 364 | |
| 365 /** | |
| 366 * The error message indicating what kind of error was encountered. | |
| 367 */ | |
| 368 void set message(String value) { | |
| 369 assert(value != null); | |
| 370 this._message = value; | |
| 371 } | |
| 372 | |
| 373 /** | |
| 374 * The stack trace associated with the generation of the error, used for | |
| 375 * debugging the server. | |
| 376 */ | |
| 377 String get stackTrace => _stackTrace; | |
| 378 | |
| 379 /** | |
| 380 * The stack trace associated with the generation of the error, used for | |
| 381 * debugging the server. | |
| 382 */ | |
| 383 void set stackTrace(String value) { | |
| 384 assert(value != null); | |
| 385 this._stackTrace = value; | |
| 386 } | |
| 387 | |
| 388 ServerErrorParams(bool isFatal, String message, String stackTrace) { | |
| 389 this.isFatal = isFatal; | |
| 390 this.message = message; | |
| 391 this.stackTrace = stackTrace; | |
| 392 } | |
| 393 | |
| 394 factory ServerErrorParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, O
bject json) { | |
| 395 if (json == null) { | |
| 396 json = {}; | |
| 397 } | |
| 398 if (json is Map) { | |
| 399 bool isFatal; | |
| 400 if (json.containsKey("isFatal")) { | |
| 401 isFatal = jsonDecoder._decodeBool(jsonPath + ".isFatal", json["isFatal"]
); | |
| 402 } else { | |
| 403 throw jsonDecoder.missingKey(jsonPath, "isFatal"); | |
| 404 } | |
| 405 String message; | |
| 406 if (json.containsKey("message")) { | |
| 407 message = jsonDecoder._decodeString(jsonPath + ".message", json["message
"]); | |
| 408 } else { | |
| 409 throw jsonDecoder.missingKey(jsonPath, "message"); | |
| 410 } | |
| 411 String stackTrace; | |
| 412 if (json.containsKey("stackTrace")) { | |
| 413 stackTrace = jsonDecoder._decodeString(jsonPath + ".stackTrace", json["s
tackTrace"]); | |
| 414 } else { | |
| 415 throw jsonDecoder.missingKey(jsonPath, "stackTrace"); | |
| 416 } | |
| 417 return new ServerErrorParams(isFatal, message, stackTrace); | |
| 418 } else { | |
| 419 throw jsonDecoder.mismatch(jsonPath, "server.error params", json); | |
| 420 } | |
| 421 } | |
| 422 | |
| 423 factory ServerErrorParams.fromNotification(Notification notification) { | |
| 424 return new ServerErrorParams.fromJson( | |
| 425 new ResponseDecoder(null), "params", notification._params); | |
| 426 } | |
| 427 | |
| 428 Map<String, dynamic> toJson() { | |
| 429 Map<String, dynamic> result = {}; | |
| 430 result["isFatal"] = isFatal; | |
| 431 result["message"] = message; | |
| 432 result["stackTrace"] = stackTrace; | |
| 433 return result; | |
| 434 } | |
| 435 | |
| 436 Notification toNotification() { | |
| 437 return new Notification("server.error", toJson()); | |
| 438 } | |
| 439 | |
| 440 @override | |
| 441 String toString() => JSON.encode(toJson()); | |
| 442 | |
| 443 @override | |
| 444 bool operator==(other) { | |
| 445 if (other is ServerErrorParams) { | |
| 446 return isFatal == other.isFatal && | |
| 447 message == other.message && | |
| 448 stackTrace == other.stackTrace; | |
| 449 } | |
| 450 return false; | |
| 451 } | |
| 452 | |
| 453 @override | |
| 454 int get hashCode { | |
| 455 int hash = 0; | |
| 456 hash = _JenkinsSmiHash.combine(hash, isFatal.hashCode); | |
| 457 hash = _JenkinsSmiHash.combine(hash, message.hashCode); | |
| 458 hash = _JenkinsSmiHash.combine(hash, stackTrace.hashCode); | |
| 459 return _JenkinsSmiHash.finish(hash); | |
| 460 } | |
| 461 } | |
| 462 | |
| 463 /** | |
| 464 * server.status params | |
| 465 * | |
| 466 * { | |
| 467 * "analysis": optional AnalysisStatus | |
| 468 * "pub": optional PubStatus | |
| 469 * } | |
| 470 */ | |
| 471 class ServerStatusParams implements HasToJson { | |
| 472 AnalysisStatus _analysis; | |
| 473 | |
| 474 PubStatus _pub; | |
| 475 | |
| 476 /** | |
| 477 * The current status of analysis, including whether analysis is being | |
| 478 * performed and if so what is being analyzed. | |
| 479 */ | |
| 480 AnalysisStatus get analysis => _analysis; | |
| 481 | |
| 482 /** | |
| 483 * The current status of analysis, including whether analysis is being | |
| 484 * performed and if so what is being analyzed. | |
| 485 */ | |
| 486 void set analysis(AnalysisStatus value) { | |
| 487 this._analysis = value; | |
| 488 } | |
| 489 | |
| 490 /** | |
| 491 * The current status of pub execution, indicating whether we are currently | |
| 492 * running pub. | |
| 493 */ | |
| 494 PubStatus get pub => _pub; | |
| 495 | |
| 496 /** | |
| 497 * The current status of pub execution, indicating whether we are currently | |
| 498 * running pub. | |
| 499 */ | |
| 500 void set pub(PubStatus value) { | |
| 501 this._pub = value; | |
| 502 } | |
| 503 | |
| 504 ServerStatusParams({AnalysisStatus analysis, PubStatus pub}) { | |
| 505 this.analysis = analysis; | |
| 506 this.pub = pub; | |
| 507 } | |
| 508 | |
| 509 factory ServerStatusParams.fromJson(JsonDecoder jsonDecoder, String jsonPath,
Object json) { | |
| 510 if (json == null) { | |
| 511 json = {}; | |
| 512 } | |
| 513 if (json is Map) { | |
| 514 AnalysisStatus analysis; | |
| 515 if (json.containsKey("analysis")) { | |
| 516 analysis = new AnalysisStatus.fromJson(jsonDecoder, jsonPath + ".analysi
s", json["analysis"]); | |
| 517 } | |
| 518 PubStatus pub; | |
| 519 if (json.containsKey("pub")) { | |
| 520 pub = new PubStatus.fromJson(jsonDecoder, jsonPath + ".pub", json["pub"]
); | |
| 521 } | |
| 522 return new ServerStatusParams(analysis: analysis, pub: pub); | |
| 523 } else { | |
| 524 throw jsonDecoder.mismatch(jsonPath, "server.status params", json); | |
| 525 } | |
| 526 } | |
| 527 | |
| 528 factory ServerStatusParams.fromNotification(Notification notification) { | |
| 529 return new ServerStatusParams.fromJson( | |
| 530 new ResponseDecoder(null), "params", notification._params); | |
| 531 } | |
| 532 | |
| 533 Map<String, dynamic> toJson() { | |
| 534 Map<String, dynamic> result = {}; | |
| 535 if (analysis != null) { | |
| 536 result["analysis"] = analysis.toJson(); | |
| 537 } | |
| 538 if (pub != null) { | |
| 539 result["pub"] = pub.toJson(); | |
| 540 } | |
| 541 return result; | |
| 542 } | |
| 543 | |
| 544 Notification toNotification() { | |
| 545 return new Notification("server.status", toJson()); | |
| 546 } | |
| 547 | |
| 548 @override | |
| 549 String toString() => JSON.encode(toJson()); | |
| 550 | |
| 551 @override | |
| 552 bool operator==(other) { | |
| 553 if (other is ServerStatusParams) { | |
| 554 return analysis == other.analysis && | |
| 555 pub == other.pub; | |
| 556 } | |
| 557 return false; | |
| 558 } | |
| 559 | |
| 560 @override | |
| 561 int get hashCode { | |
| 562 int hash = 0; | |
| 563 hash = _JenkinsSmiHash.combine(hash, analysis.hashCode); | |
| 564 hash = _JenkinsSmiHash.combine(hash, pub.hashCode); | |
| 565 return _JenkinsSmiHash.finish(hash); | |
| 566 } | |
| 567 } | |
| 568 | |
| 569 /** | |
| 570 * analysis.getErrors params | |
| 571 * | |
| 572 * { | |
| 573 * "file": FilePath | |
| 574 * } | |
| 575 */ | |
| 576 class AnalysisGetErrorsParams implements HasToJson { | |
| 577 String _file; | |
| 578 | |
| 579 /** | |
| 580 * The file for which errors are being requested. | |
| 581 */ | |
| 582 String get file => _file; | |
| 583 | |
| 584 /** | |
| 585 * The file for which errors are being requested. | |
| 586 */ | |
| 587 void set file(String value) { | |
| 588 assert(value != null); | |
| 589 this._file = value; | |
| 590 } | |
| 591 | |
| 592 AnalysisGetErrorsParams(String file) { | |
| 593 this.file = file; | |
| 594 } | |
| 595 | |
| 596 factory AnalysisGetErrorsParams.fromJson(JsonDecoder jsonDecoder, String jsonP
ath, Object json) { | |
| 597 if (json == null) { | |
| 598 json = {}; | |
| 599 } | |
| 600 if (json is Map) { | |
| 601 String file; | |
| 602 if (json.containsKey("file")) { | |
| 603 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 604 } else { | |
| 605 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 606 } | |
| 607 return new AnalysisGetErrorsParams(file); | |
| 608 } else { | |
| 609 throw jsonDecoder.mismatch(jsonPath, "analysis.getErrors params", json); | |
| 610 } | |
| 611 } | |
| 612 | |
| 613 factory AnalysisGetErrorsParams.fromRequest(Request request) { | |
| 614 return new AnalysisGetErrorsParams.fromJson( | |
| 615 new RequestDecoder(request), "params", request._params); | |
| 616 } | |
| 617 | |
| 618 Map<String, dynamic> toJson() { | |
| 619 Map<String, dynamic> result = {}; | |
| 620 result["file"] = file; | |
| 621 return result; | |
| 622 } | |
| 623 | |
| 624 Request toRequest(String id) { | |
| 625 return new Request(id, "analysis.getErrors", toJson()); | |
| 626 } | |
| 627 | |
| 628 @override | |
| 629 String toString() => JSON.encode(toJson()); | |
| 630 | |
| 631 @override | |
| 632 bool operator==(other) { | |
| 633 if (other is AnalysisGetErrorsParams) { | |
| 634 return file == other.file; | |
| 635 } | |
| 636 return false; | |
| 637 } | |
| 638 | |
| 639 @override | |
| 640 int get hashCode { | |
| 641 int hash = 0; | |
| 642 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 643 return _JenkinsSmiHash.finish(hash); | |
| 644 } | |
| 645 } | |
| 646 | |
| 647 /** | |
| 648 * analysis.getErrors result | |
| 649 * | |
| 650 * { | |
| 651 * "errors": List<AnalysisError> | |
| 652 * } | |
| 653 */ | |
| 654 class AnalysisGetErrorsResult implements HasToJson { | |
| 655 List<AnalysisError> _errors; | |
| 656 | |
| 657 /** | |
| 658 * The errors associated with the file. | |
| 659 */ | |
| 660 List<AnalysisError> get errors => _errors; | |
| 661 | |
| 662 /** | |
| 663 * The errors associated with the file. | |
| 664 */ | |
| 665 void set errors(List<AnalysisError> value) { | |
| 666 assert(value != null); | |
| 667 this._errors = value; | |
| 668 } | |
| 669 | |
| 670 AnalysisGetErrorsResult(List<AnalysisError> errors) { | |
| 671 this.errors = errors; | |
| 672 } | |
| 673 | |
| 674 factory AnalysisGetErrorsResult.fromJson(JsonDecoder jsonDecoder, String jsonP
ath, Object json) { | |
| 675 if (json == null) { | |
| 676 json = {}; | |
| 677 } | |
| 678 if (json is Map) { | |
| 679 List<AnalysisError> errors; | |
| 680 if (json.containsKey("errors")) { | |
| 681 errors = jsonDecoder._decodeList(jsonPath + ".errors", json["errors"], (
String jsonPath, Object json) => new AnalysisError.fromJson(jsonDecoder, jsonPat
h, json)); | |
| 682 } else { | |
| 683 throw jsonDecoder.missingKey(jsonPath, "errors"); | |
| 684 } | |
| 685 return new AnalysisGetErrorsResult(errors); | |
| 686 } else { | |
| 687 throw jsonDecoder.mismatch(jsonPath, "analysis.getErrors result", json); | |
| 688 } | |
| 689 } | |
| 690 | |
| 691 factory AnalysisGetErrorsResult.fromResponse(Response response) { | |
| 692 return new AnalysisGetErrorsResult.fromJson( | |
| 693 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); | |
| 694 } | |
| 695 | |
| 696 Map<String, dynamic> toJson() { | |
| 697 Map<String, dynamic> result = {}; | |
| 698 result["errors"] = errors.map((AnalysisError value) => value.toJson()).toLis
t(); | |
| 699 return result; | |
| 700 } | |
| 701 | |
| 702 Response toResponse(String id) { | |
| 703 return new Response(id, result: toJson()); | |
| 704 } | |
| 705 | |
| 706 @override | |
| 707 String toString() => JSON.encode(toJson()); | |
| 708 | |
| 709 @override | |
| 710 bool operator==(other) { | |
| 711 if (other is AnalysisGetErrorsResult) { | |
| 712 return _listEqual(errors, other.errors, (AnalysisError a, AnalysisError b)
=> a == b); | |
| 713 } | |
| 714 return false; | |
| 715 } | |
| 716 | |
| 717 @override | |
| 718 int get hashCode { | |
| 719 int hash = 0; | |
| 720 hash = _JenkinsSmiHash.combine(hash, errors.hashCode); | |
| 721 return _JenkinsSmiHash.finish(hash); | |
| 722 } | |
| 723 } | |
| 724 | |
| 725 /** | |
| 726 * analysis.getHover params | |
| 727 * | |
| 728 * { | |
| 729 * "file": FilePath | |
| 730 * "offset": int | |
| 731 * } | |
| 732 */ | |
| 733 class AnalysisGetHoverParams implements HasToJson { | |
| 734 String _file; | |
| 735 | |
| 736 int _offset; | |
| 737 | |
| 738 /** | |
| 739 * The file in which hover information is being requested. | |
| 740 */ | |
| 741 String get file => _file; | |
| 742 | |
| 743 /** | |
| 744 * The file in which hover information is being requested. | |
| 745 */ | |
| 746 void set file(String value) { | |
| 747 assert(value != null); | |
| 748 this._file = value; | |
| 749 } | |
| 750 | |
| 751 /** | |
| 752 * The offset for which hover information is being requested. | |
| 753 */ | |
| 754 int get offset => _offset; | |
| 755 | |
| 756 /** | |
| 757 * The offset for which hover information is being requested. | |
| 758 */ | |
| 759 void set offset(int value) { | |
| 760 assert(value != null); | |
| 761 this._offset = value; | |
| 762 } | |
| 763 | |
| 764 AnalysisGetHoverParams(String file, int offset) { | |
| 765 this.file = file; | |
| 766 this.offset = offset; | |
| 767 } | |
| 768 | |
| 769 factory AnalysisGetHoverParams.fromJson(JsonDecoder jsonDecoder, String jsonPa
th, Object json) { | |
| 770 if (json == null) { | |
| 771 json = {}; | |
| 772 } | |
| 773 if (json is Map) { | |
| 774 String file; | |
| 775 if (json.containsKey("file")) { | |
| 776 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 777 } else { | |
| 778 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 779 } | |
| 780 int offset; | |
| 781 if (json.containsKey("offset")) { | |
| 782 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 783 } else { | |
| 784 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 785 } | |
| 786 return new AnalysisGetHoverParams(file, offset); | |
| 787 } else { | |
| 788 throw jsonDecoder.mismatch(jsonPath, "analysis.getHover params", json); | |
| 789 } | |
| 790 } | |
| 791 | |
| 792 factory AnalysisGetHoverParams.fromRequest(Request request) { | |
| 793 return new AnalysisGetHoverParams.fromJson( | |
| 794 new RequestDecoder(request), "params", request._params); | |
| 795 } | |
| 796 | |
| 797 Map<String, dynamic> toJson() { | |
| 798 Map<String, dynamic> result = {}; | |
| 799 result["file"] = file; | |
| 800 result["offset"] = offset; | |
| 801 return result; | |
| 802 } | |
| 803 | |
| 804 Request toRequest(String id) { | |
| 805 return new Request(id, "analysis.getHover", toJson()); | |
| 806 } | |
| 807 | |
| 808 @override | |
| 809 String toString() => JSON.encode(toJson()); | |
| 810 | |
| 811 @override | |
| 812 bool operator==(other) { | |
| 813 if (other is AnalysisGetHoverParams) { | |
| 814 return file == other.file && | |
| 815 offset == other.offset; | |
| 816 } | |
| 817 return false; | |
| 818 } | |
| 819 | |
| 820 @override | |
| 821 int get hashCode { | |
| 822 int hash = 0; | |
| 823 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 824 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 825 return _JenkinsSmiHash.finish(hash); | |
| 826 } | |
| 827 } | |
| 828 | |
| 829 /** | |
| 830 * analysis.getHover result | |
| 831 * | |
| 832 * { | |
| 833 * "hovers": List<HoverInformation> | |
| 834 * } | |
| 835 */ | |
| 836 class AnalysisGetHoverResult implements HasToJson { | |
| 837 List<HoverInformation> _hovers; | |
| 838 | |
| 839 /** | |
| 840 * The hover information associated with the location. The list will be empty | |
| 841 * if no information could be determined for the location. The list can | |
| 842 * contain multiple items if the file is being analyzed in multiple contexts | |
| 843 * in conflicting ways (such as a part that is included in multiple | |
| 844 * libraries). | |
| 845 */ | |
| 846 List<HoverInformation> get hovers => _hovers; | |
| 847 | |
| 848 /** | |
| 849 * The hover information associated with the location. The list will be empty | |
| 850 * if no information could be determined for the location. The list can | |
| 851 * contain multiple items if the file is being analyzed in multiple contexts | |
| 852 * in conflicting ways (such as a part that is included in multiple | |
| 853 * libraries). | |
| 854 */ | |
| 855 void set hovers(List<HoverInformation> value) { | |
| 856 assert(value != null); | |
| 857 this._hovers = value; | |
| 858 } | |
| 859 | |
| 860 AnalysisGetHoverResult(List<HoverInformation> hovers) { | |
| 861 this.hovers = hovers; | |
| 862 } | |
| 863 | |
| 864 factory AnalysisGetHoverResult.fromJson(JsonDecoder jsonDecoder, String jsonPa
th, Object json) { | |
| 865 if (json == null) { | |
| 866 json = {}; | |
| 867 } | |
| 868 if (json is Map) { | |
| 869 List<HoverInformation> hovers; | |
| 870 if (json.containsKey("hovers")) { | |
| 871 hovers = jsonDecoder._decodeList(jsonPath + ".hovers", json["hovers"], (
String jsonPath, Object json) => new HoverInformation.fromJson(jsonDecoder, json
Path, json)); | |
| 872 } else { | |
| 873 throw jsonDecoder.missingKey(jsonPath, "hovers"); | |
| 874 } | |
| 875 return new AnalysisGetHoverResult(hovers); | |
| 876 } else { | |
| 877 throw jsonDecoder.mismatch(jsonPath, "analysis.getHover result", json); | |
| 878 } | |
| 879 } | |
| 880 | |
| 881 factory AnalysisGetHoverResult.fromResponse(Response response) { | |
| 882 return new AnalysisGetHoverResult.fromJson( | |
| 883 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); | |
| 884 } | |
| 885 | |
| 886 Map<String, dynamic> toJson() { | |
| 887 Map<String, dynamic> result = {}; | |
| 888 result["hovers"] = hovers.map((HoverInformation value) => value.toJson()).to
List(); | |
| 889 return result; | |
| 890 } | |
| 891 | |
| 892 Response toResponse(String id) { | |
| 893 return new Response(id, result: toJson()); | |
| 894 } | |
| 895 | |
| 896 @override | |
| 897 String toString() => JSON.encode(toJson()); | |
| 898 | |
| 899 @override | |
| 900 bool operator==(other) { | |
| 901 if (other is AnalysisGetHoverResult) { | |
| 902 return _listEqual(hovers, other.hovers, (HoverInformation a, HoverInformat
ion b) => a == b); | |
| 903 } | |
| 904 return false; | |
| 905 } | |
| 906 | |
| 907 @override | |
| 908 int get hashCode { | |
| 909 int hash = 0; | |
| 910 hash = _JenkinsSmiHash.combine(hash, hovers.hashCode); | |
| 911 return _JenkinsSmiHash.finish(hash); | |
| 912 } | |
| 913 } | |
| 914 /** | |
| 915 * analysis.getLibraryDependencies params | |
| 916 */ | |
| 917 class AnalysisGetLibraryDependenciesParams { | |
| 918 Request toRequest(String id) { | |
| 919 return new Request(id, "analysis.getLibraryDependencies", null); | |
| 920 } | |
| 921 | |
| 922 @override | |
| 923 bool operator==(other) { | |
| 924 if (other is AnalysisGetLibraryDependenciesParams) { | |
| 925 return true; | |
| 926 } | |
| 927 return false; | |
| 928 } | |
| 929 | |
| 930 @override | |
| 931 int get hashCode { | |
| 932 return 246577680; | |
| 933 } | |
| 934 } | |
| 935 | |
| 936 /** | |
| 937 * analysis.getLibraryDependencies result | |
| 938 * | |
| 939 * { | |
| 940 * "libraries": List<FilePath> | |
| 941 * "packageMap": Map<String, Map<String, List<FilePath>>> | |
| 942 * } | |
| 943 */ | |
| 944 class AnalysisGetLibraryDependenciesResult implements HasToJson { | |
| 945 List<String> _libraries; | |
| 946 | |
| 947 Map<String, Map<String, List<String>>> _packageMap; | |
| 948 | |
| 949 /** | |
| 950 * A list of the paths of library elements referenced by files in existing | |
| 951 * analysis roots. | |
| 952 */ | |
| 953 List<String> get libraries => _libraries; | |
| 954 | |
| 955 /** | |
| 956 * A list of the paths of library elements referenced by files in existing | |
| 957 * analysis roots. | |
| 958 */ | |
| 959 void set libraries(List<String> value) { | |
| 960 assert(value != null); | |
| 961 this._libraries = value; | |
| 962 } | |
| 963 | |
| 964 /** | |
| 965 * A mapping from context source roots to package maps which map package | |
| 966 * names to source directories for use in client-side package URI resolution. | |
| 967 */ | |
| 968 Map<String, Map<String, List<String>>> get packageMap => _packageMap; | |
| 969 | |
| 970 /** | |
| 971 * A mapping from context source roots to package maps which map package | |
| 972 * names to source directories for use in client-side package URI resolution. | |
| 973 */ | |
| 974 void set packageMap(Map<String, Map<String, List<String>>> value) { | |
| 975 assert(value != null); | |
| 976 this._packageMap = value; | |
| 977 } | |
| 978 | |
| 979 AnalysisGetLibraryDependenciesResult(List<String> libraries, Map<String, Map<S
tring, List<String>>> packageMap) { | |
| 980 this.libraries = libraries; | |
| 981 this.packageMap = packageMap; | |
| 982 } | |
| 983 | |
| 984 factory AnalysisGetLibraryDependenciesResult.fromJson(JsonDecoder jsonDecoder,
String jsonPath, Object json) { | |
| 985 if (json == null) { | |
| 986 json = {}; | |
| 987 } | |
| 988 if (json is Map) { | |
| 989 List<String> libraries; | |
| 990 if (json.containsKey("libraries")) { | |
| 991 libraries = jsonDecoder._decodeList(jsonPath + ".libraries", json["libra
ries"], jsonDecoder._decodeString); | |
| 992 } else { | |
| 993 throw jsonDecoder.missingKey(jsonPath, "libraries"); | |
| 994 } | |
| 995 Map<String, Map<String, List<String>>> packageMap; | |
| 996 if (json.containsKey("packageMap")) { | |
| 997 packageMap = jsonDecoder._decodeMap(jsonPath + ".packageMap", json["pack
ageMap"], valueDecoder: (String jsonPath, Object json) => jsonDecoder._decodeMap
(jsonPath, json, valueDecoder: (String jsonPath, Object json) => jsonDecoder._de
codeList(jsonPath, json, jsonDecoder._decodeString))); | |
| 998 } else { | |
| 999 throw jsonDecoder.missingKey(jsonPath, "packageMap"); | |
| 1000 } | |
| 1001 return new AnalysisGetLibraryDependenciesResult(libraries, packageMap); | |
| 1002 } else { | |
| 1003 throw jsonDecoder.mismatch(jsonPath, "analysis.getLibraryDependencies resu
lt", json); | |
| 1004 } | |
| 1005 } | |
| 1006 | |
| 1007 factory AnalysisGetLibraryDependenciesResult.fromResponse(Response response) { | |
| 1008 return new AnalysisGetLibraryDependenciesResult.fromJson( | |
| 1009 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); | |
| 1010 } | |
| 1011 | |
| 1012 Map<String, dynamic> toJson() { | |
| 1013 Map<String, dynamic> result = {}; | |
| 1014 result["libraries"] = libraries; | |
| 1015 result["packageMap"] = packageMap; | |
| 1016 return result; | |
| 1017 } | |
| 1018 | |
| 1019 Response toResponse(String id) { | |
| 1020 return new Response(id, result: toJson()); | |
| 1021 } | |
| 1022 | |
| 1023 @override | |
| 1024 String toString() => JSON.encode(toJson()); | |
| 1025 | |
| 1026 @override | |
| 1027 bool operator==(other) { | |
| 1028 if (other is AnalysisGetLibraryDependenciesResult) { | |
| 1029 return _listEqual(libraries, other.libraries, (String a, String b) => a ==
b) && | |
| 1030 _mapEqual(packageMap, other.packageMap, (Map<String, List<String>> a,
Map<String, List<String>> b) => _mapEqual(a, b, (List<String> a, List<String> b)
=> _listEqual(a, b, (String a, String b) => a == b))); | |
| 1031 } | |
| 1032 return false; | |
| 1033 } | |
| 1034 | |
| 1035 @override | |
| 1036 int get hashCode { | |
| 1037 int hash = 0; | |
| 1038 hash = _JenkinsSmiHash.combine(hash, libraries.hashCode); | |
| 1039 hash = _JenkinsSmiHash.combine(hash, packageMap.hashCode); | |
| 1040 return _JenkinsSmiHash.finish(hash); | |
| 1041 } | |
| 1042 } | |
| 1043 | |
| 1044 /** | |
| 1045 * analysis.getNavigation params | |
| 1046 * | |
| 1047 * { | |
| 1048 * "file": FilePath | |
| 1049 * "offset": int | |
| 1050 * "length": int | |
| 1051 * } | |
| 1052 */ | |
| 1053 class AnalysisGetNavigationParams implements HasToJson { | |
| 1054 String _file; | |
| 1055 | |
| 1056 int _offset; | |
| 1057 | |
| 1058 int _length; | |
| 1059 | |
| 1060 /** | |
| 1061 * The file in which navigation information is being requested. | |
| 1062 */ | |
| 1063 String get file => _file; | |
| 1064 | |
| 1065 /** | |
| 1066 * The file in which navigation information is being requested. | |
| 1067 */ | |
| 1068 void set file(String value) { | |
| 1069 assert(value != null); | |
| 1070 this._file = value; | |
| 1071 } | |
| 1072 | |
| 1073 /** | |
| 1074 * The offset of the region for which navigation information is being | |
| 1075 * requested. | |
| 1076 */ | |
| 1077 int get offset => _offset; | |
| 1078 | |
| 1079 /** | |
| 1080 * The offset of the region for which navigation information is being | |
| 1081 * requested. | |
| 1082 */ | |
| 1083 void set offset(int value) { | |
| 1084 assert(value != null); | |
| 1085 this._offset = value; | |
| 1086 } | |
| 1087 | |
| 1088 /** | |
| 1089 * The length of the region for which navigation information is being | |
| 1090 * requested. | |
| 1091 */ | |
| 1092 int get length => _length; | |
| 1093 | |
| 1094 /** | |
| 1095 * The length of the region for which navigation information is being | |
| 1096 * requested. | |
| 1097 */ | |
| 1098 void set length(int value) { | |
| 1099 assert(value != null); | |
| 1100 this._length = value; | |
| 1101 } | |
| 1102 | |
| 1103 AnalysisGetNavigationParams(String file, int offset, int length) { | |
| 1104 this.file = file; | |
| 1105 this.offset = offset; | |
| 1106 this.length = length; | |
| 1107 } | |
| 1108 | |
| 1109 factory AnalysisGetNavigationParams.fromJson(JsonDecoder jsonDecoder, String j
sonPath, Object json) { | |
| 1110 if (json == null) { | |
| 1111 json = {}; | |
| 1112 } | |
| 1113 if (json is Map) { | |
| 1114 String file; | |
| 1115 if (json.containsKey("file")) { | |
| 1116 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 1117 } else { | |
| 1118 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 1119 } | |
| 1120 int offset; | |
| 1121 if (json.containsKey("offset")) { | |
| 1122 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 1123 } else { | |
| 1124 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 1125 } | |
| 1126 int length; | |
| 1127 if (json.containsKey("length")) { | |
| 1128 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | |
| 1129 } else { | |
| 1130 throw jsonDecoder.missingKey(jsonPath, "length"); | |
| 1131 } | |
| 1132 return new AnalysisGetNavigationParams(file, offset, length); | |
| 1133 } else { | |
| 1134 throw jsonDecoder.mismatch(jsonPath, "analysis.getNavigation params", json
); | |
| 1135 } | |
| 1136 } | |
| 1137 | |
| 1138 factory AnalysisGetNavigationParams.fromRequest(Request request) { | |
| 1139 return new AnalysisGetNavigationParams.fromJson( | |
| 1140 new RequestDecoder(request), "params", request._params); | |
| 1141 } | |
| 1142 | |
| 1143 Map<String, dynamic> toJson() { | |
| 1144 Map<String, dynamic> result = {}; | |
| 1145 result["file"] = file; | |
| 1146 result["offset"] = offset; | |
| 1147 result["length"] = length; | |
| 1148 return result; | |
| 1149 } | |
| 1150 | |
| 1151 Request toRequest(String id) { | |
| 1152 return new Request(id, "analysis.getNavigation", toJson()); | |
| 1153 } | |
| 1154 | |
| 1155 @override | |
| 1156 String toString() => JSON.encode(toJson()); | |
| 1157 | |
| 1158 @override | |
| 1159 bool operator==(other) { | |
| 1160 if (other is AnalysisGetNavigationParams) { | |
| 1161 return file == other.file && | |
| 1162 offset == other.offset && | |
| 1163 length == other.length; | |
| 1164 } | |
| 1165 return false; | |
| 1166 } | |
| 1167 | |
| 1168 @override | |
| 1169 int get hashCode { | |
| 1170 int hash = 0; | |
| 1171 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 1172 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 1173 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
| 1174 return _JenkinsSmiHash.finish(hash); | |
| 1175 } | |
| 1176 } | |
| 1177 | |
| 1178 /** | |
| 1179 * analysis.getNavigation result | |
| 1180 * | |
| 1181 * { | |
| 1182 * "files": List<FilePath> | |
| 1183 * "targets": List<NavigationTarget> | |
| 1184 * "regions": List<NavigationRegion> | |
| 1185 * } | |
| 1186 */ | |
| 1187 class AnalysisGetNavigationResult implements HasToJson { | |
| 1188 List<String> _files; | |
| 1189 | |
| 1190 List<NavigationTarget> _targets; | |
| 1191 | |
| 1192 List<NavigationRegion> _regions; | |
| 1193 | |
| 1194 /** | |
| 1195 * A list of the paths of files that are referenced by the navigation | |
| 1196 * targets. | |
| 1197 */ | |
| 1198 List<String> get files => _files; | |
| 1199 | |
| 1200 /** | |
| 1201 * A list of the paths of files that are referenced by the navigation | |
| 1202 * targets. | |
| 1203 */ | |
| 1204 void set files(List<String> value) { | |
| 1205 assert(value != null); | |
| 1206 this._files = value; | |
| 1207 } | |
| 1208 | |
| 1209 /** | |
| 1210 * A list of the navigation targets that are referenced by the navigation | |
| 1211 * regions. | |
| 1212 */ | |
| 1213 List<NavigationTarget> get targets => _targets; | |
| 1214 | |
| 1215 /** | |
| 1216 * A list of the navigation targets that are referenced by the navigation | |
| 1217 * regions. | |
| 1218 */ | |
| 1219 void set targets(List<NavigationTarget> value) { | |
| 1220 assert(value != null); | |
| 1221 this._targets = value; | |
| 1222 } | |
| 1223 | |
| 1224 /** | |
| 1225 * A list of the navigation regions within the requested region of the file. | |
| 1226 */ | |
| 1227 List<NavigationRegion> get regions => _regions; | |
| 1228 | |
| 1229 /** | |
| 1230 * A list of the navigation regions within the requested region of the file. | |
| 1231 */ | |
| 1232 void set regions(List<NavigationRegion> value) { | |
| 1233 assert(value != null); | |
| 1234 this._regions = value; | |
| 1235 } | |
| 1236 | |
| 1237 AnalysisGetNavigationResult(List<String> files, List<NavigationTarget> targets
, List<NavigationRegion> regions) { | |
| 1238 this.files = files; | |
| 1239 this.targets = targets; | |
| 1240 this.regions = regions; | |
| 1241 } | |
| 1242 | |
| 1243 factory AnalysisGetNavigationResult.fromJson(JsonDecoder jsonDecoder, String j
sonPath, Object json) { | |
| 1244 if (json == null) { | |
| 1245 json = {}; | |
| 1246 } | |
| 1247 if (json is Map) { | |
| 1248 List<String> files; | |
| 1249 if (json.containsKey("files")) { | |
| 1250 files = jsonDecoder._decodeList(jsonPath + ".files", json["files"], json
Decoder._decodeString); | |
| 1251 } else { | |
| 1252 throw jsonDecoder.missingKey(jsonPath, "files"); | |
| 1253 } | |
| 1254 List<NavigationTarget> targets; | |
| 1255 if (json.containsKey("targets")) { | |
| 1256 targets = jsonDecoder._decodeList(jsonPath + ".targets", json["targets"]
, (String jsonPath, Object json) => new NavigationTarget.fromJson(jsonDecoder, j
sonPath, json)); | |
| 1257 } else { | |
| 1258 throw jsonDecoder.missingKey(jsonPath, "targets"); | |
| 1259 } | |
| 1260 List<NavigationRegion> regions; | |
| 1261 if (json.containsKey("regions")) { | |
| 1262 regions = jsonDecoder._decodeList(jsonPath + ".regions", json["regions"]
, (String jsonPath, Object json) => new NavigationRegion.fromJson(jsonDecoder, j
sonPath, json)); | |
| 1263 } else { | |
| 1264 throw jsonDecoder.missingKey(jsonPath, "regions"); | |
| 1265 } | |
| 1266 return new AnalysisGetNavigationResult(files, targets, regions); | |
| 1267 } else { | |
| 1268 throw jsonDecoder.mismatch(jsonPath, "analysis.getNavigation result", json
); | |
| 1269 } | |
| 1270 } | |
| 1271 | |
| 1272 factory AnalysisGetNavigationResult.fromResponse(Response response) { | |
| 1273 return new AnalysisGetNavigationResult.fromJson( | |
| 1274 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); | |
| 1275 } | |
| 1276 | |
| 1277 Map<String, dynamic> toJson() { | |
| 1278 Map<String, dynamic> result = {}; | |
| 1279 result["files"] = files; | |
| 1280 result["targets"] = targets.map((NavigationTarget value) => value.toJson()).
toList(); | |
| 1281 result["regions"] = regions.map((NavigationRegion value) => value.toJson()).
toList(); | |
| 1282 return result; | |
| 1283 } | |
| 1284 | |
| 1285 Response toResponse(String id) { | |
| 1286 return new Response(id, result: toJson()); | |
| 1287 } | |
| 1288 | |
| 1289 @override | |
| 1290 String toString() => JSON.encode(toJson()); | |
| 1291 | |
| 1292 @override | |
| 1293 bool operator==(other) { | |
| 1294 if (other is AnalysisGetNavigationResult) { | |
| 1295 return _listEqual(files, other.files, (String a, String b) => a == b) && | |
| 1296 _listEqual(targets, other.targets, (NavigationTarget a, NavigationTarg
et b) => a == b) && | |
| 1297 _listEqual(regions, other.regions, (NavigationRegion a, NavigationRegi
on b) => a == b); | |
| 1298 } | |
| 1299 return false; | |
| 1300 } | |
| 1301 | |
| 1302 @override | |
| 1303 int get hashCode { | |
| 1304 int hash = 0; | |
| 1305 hash = _JenkinsSmiHash.combine(hash, files.hashCode); | |
| 1306 hash = _JenkinsSmiHash.combine(hash, targets.hashCode); | |
| 1307 hash = _JenkinsSmiHash.combine(hash, regions.hashCode); | |
| 1308 return _JenkinsSmiHash.finish(hash); | |
| 1309 } | |
| 1310 } | |
| 1311 | |
| 1312 /** | |
| 1313 * analysis.reanalyze params | |
| 1314 * | |
| 1315 * { | |
| 1316 * "roots": optional List<FilePath> | |
| 1317 * } | |
| 1318 */ | |
| 1319 class AnalysisReanalyzeParams implements HasToJson { | |
| 1320 List<String> _roots; | |
| 1321 | |
| 1322 /** | |
| 1323 * A list of the analysis roots that are to be re-analyzed. | |
| 1324 */ | |
| 1325 List<String> get roots => _roots; | |
| 1326 | |
| 1327 /** | |
| 1328 * A list of the analysis roots that are to be re-analyzed. | |
| 1329 */ | |
| 1330 void set roots(List<String> value) { | |
| 1331 this._roots = value; | |
| 1332 } | |
| 1333 | |
| 1334 AnalysisReanalyzeParams({List<String> roots}) { | |
| 1335 this.roots = roots; | |
| 1336 } | |
| 1337 | |
| 1338 factory AnalysisReanalyzeParams.fromJson(JsonDecoder jsonDecoder, String jsonP
ath, Object json) { | |
| 1339 if (json == null) { | |
| 1340 json = {}; | |
| 1341 } | |
| 1342 if (json is Map) { | |
| 1343 List<String> roots; | |
| 1344 if (json.containsKey("roots")) { | |
| 1345 roots = jsonDecoder._decodeList(jsonPath + ".roots", json["roots"], json
Decoder._decodeString); | |
| 1346 } | |
| 1347 return new AnalysisReanalyzeParams(roots: roots); | |
| 1348 } else { | |
| 1349 throw jsonDecoder.mismatch(jsonPath, "analysis.reanalyze params", json); | |
| 1350 } | |
| 1351 } | |
| 1352 | |
| 1353 factory AnalysisReanalyzeParams.fromRequest(Request request) { | |
| 1354 return new AnalysisReanalyzeParams.fromJson( | |
| 1355 new RequestDecoder(request), "params", request._params); | |
| 1356 } | |
| 1357 | |
| 1358 Map<String, dynamic> toJson() { | |
| 1359 Map<String, dynamic> result = {}; | |
| 1360 if (roots != null) { | |
| 1361 result["roots"] = roots; | |
| 1362 } | |
| 1363 return result; | |
| 1364 } | |
| 1365 | |
| 1366 Request toRequest(String id) { | |
| 1367 return new Request(id, "analysis.reanalyze", toJson()); | |
| 1368 } | |
| 1369 | |
| 1370 @override | |
| 1371 String toString() => JSON.encode(toJson()); | |
| 1372 | |
| 1373 @override | |
| 1374 bool operator==(other) { | |
| 1375 if (other is AnalysisReanalyzeParams) { | |
| 1376 return _listEqual(roots, other.roots, (String a, String b) => a == b); | |
| 1377 } | |
| 1378 return false; | |
| 1379 } | |
| 1380 | |
| 1381 @override | |
| 1382 int get hashCode { | |
| 1383 int hash = 0; | |
| 1384 hash = _JenkinsSmiHash.combine(hash, roots.hashCode); | |
| 1385 return _JenkinsSmiHash.finish(hash); | |
| 1386 } | |
| 1387 } | |
| 1388 /** | |
| 1389 * analysis.reanalyze result | |
| 1390 */ | |
| 1391 class AnalysisReanalyzeResult { | |
| 1392 Response toResponse(String id) { | |
| 1393 return new Response(id, result: null); | |
| 1394 } | |
| 1395 | |
| 1396 @override | |
| 1397 bool operator==(other) { | |
| 1398 if (other is AnalysisReanalyzeResult) { | |
| 1399 return true; | |
| 1400 } | |
| 1401 return false; | |
| 1402 } | |
| 1403 | |
| 1404 @override | |
| 1405 int get hashCode { | |
| 1406 return 846803925; | |
| 1407 } | |
| 1408 } | |
| 1409 | |
| 1410 /** | |
| 1411 * analysis.setAnalysisRoots params | |
| 1412 * | |
| 1413 * { | |
| 1414 * "included": List<FilePath> | |
| 1415 * "excluded": List<FilePath> | |
| 1416 * "packageRoots": optional Map<FilePath, FilePath> | |
| 1417 * } | |
| 1418 */ | |
| 1419 class AnalysisSetAnalysisRootsParams implements HasToJson { | |
| 1420 List<String> _included; | |
| 1421 | |
| 1422 List<String> _excluded; | |
| 1423 | |
| 1424 Map<String, String> _packageRoots; | |
| 1425 | |
| 1426 /** | |
| 1427 * A list of the files and directories that should be analyzed. | |
| 1428 */ | |
| 1429 List<String> get included => _included; | |
| 1430 | |
| 1431 /** | |
| 1432 * A list of the files and directories that should be analyzed. | |
| 1433 */ | |
| 1434 void set included(List<String> value) { | |
| 1435 assert(value != null); | |
| 1436 this._included = value; | |
| 1437 } | |
| 1438 | |
| 1439 /** | |
| 1440 * A list of the files and directories within the included directories that | |
| 1441 * should not be analyzed. | |
| 1442 */ | |
| 1443 List<String> get excluded => _excluded; | |
| 1444 | |
| 1445 /** | |
| 1446 * A list of the files and directories within the included directories that | |
| 1447 * should not be analyzed. | |
| 1448 */ | |
| 1449 void set excluded(List<String> value) { | |
| 1450 assert(value != null); | |
| 1451 this._excluded = value; | |
| 1452 } | |
| 1453 | |
| 1454 /** | |
| 1455 * A mapping from source directories to target directories that should | |
| 1456 * override the normal package: URI resolution mechanism. The analyzer will | |
| 1457 * behave as though each source directory in the map contains a special | |
| 1458 * pubspec.yaml file which resolves any package: URI to the corresponding | |
| 1459 * path within the target directory. The effect is the same as specifying the | |
| 1460 * target directory as a "--package_root" parameter to the Dart VM when | |
| 1461 * executing any Dart file inside the source directory. | |
| 1462 * | |
| 1463 * Files in any directories that are not overridden by this mapping have | |
| 1464 * their package: URI's resolved using the normal pubspec.yaml mechanism. If | |
| 1465 * this field is absent, or the empty map is specified, that indicates that | |
| 1466 * the normal pubspec.yaml mechanism should always be used. | |
| 1467 */ | |
| 1468 Map<String, String> get packageRoots => _packageRoots; | |
| 1469 | |
| 1470 /** | |
| 1471 * A mapping from source directories to target directories that should | |
| 1472 * override the normal package: URI resolution mechanism. The analyzer will | |
| 1473 * behave as though each source directory in the map contains a special | |
| 1474 * pubspec.yaml file which resolves any package: URI to the corresponding | |
| 1475 * path within the target directory. The effect is the same as specifying the | |
| 1476 * target directory as a "--package_root" parameter to the Dart VM when | |
| 1477 * executing any Dart file inside the source directory. | |
| 1478 * | |
| 1479 * Files in any directories that are not overridden by this mapping have | |
| 1480 * their package: URI's resolved using the normal pubspec.yaml mechanism. If | |
| 1481 * this field is absent, or the empty map is specified, that indicates that | |
| 1482 * the normal pubspec.yaml mechanism should always be used. | |
| 1483 */ | |
| 1484 void set packageRoots(Map<String, String> value) { | |
| 1485 this._packageRoots = value; | |
| 1486 } | |
| 1487 | |
| 1488 AnalysisSetAnalysisRootsParams(List<String> included, List<String> excluded, {
Map<String, String> packageRoots}) { | |
| 1489 this.included = included; | |
| 1490 this.excluded = excluded; | |
| 1491 this.packageRoots = packageRoots; | |
| 1492 } | |
| 1493 | |
| 1494 factory AnalysisSetAnalysisRootsParams.fromJson(JsonDecoder jsonDecoder, Strin
g jsonPath, Object json) { | |
| 1495 if (json == null) { | |
| 1496 json = {}; | |
| 1497 } | |
| 1498 if (json is Map) { | |
| 1499 List<String> included; | |
| 1500 if (json.containsKey("included")) { | |
| 1501 included = jsonDecoder._decodeList(jsonPath + ".included", json["include
d"], jsonDecoder._decodeString); | |
| 1502 } else { | |
| 1503 throw jsonDecoder.missingKey(jsonPath, "included"); | |
| 1504 } | |
| 1505 List<String> excluded; | |
| 1506 if (json.containsKey("excluded")) { | |
| 1507 excluded = jsonDecoder._decodeList(jsonPath + ".excluded", json["exclude
d"], jsonDecoder._decodeString); | |
| 1508 } else { | |
| 1509 throw jsonDecoder.missingKey(jsonPath, "excluded"); | |
| 1510 } | |
| 1511 Map<String, String> packageRoots; | |
| 1512 if (json.containsKey("packageRoots")) { | |
| 1513 packageRoots = jsonDecoder._decodeMap(jsonPath + ".packageRoots", json["
packageRoots"], valueDecoder: jsonDecoder._decodeString); | |
| 1514 } | |
| 1515 return new AnalysisSetAnalysisRootsParams(included, excluded, packageRoots
: packageRoots); | |
| 1516 } else { | |
| 1517 throw jsonDecoder.mismatch(jsonPath, "analysis.setAnalysisRoots params", j
son); | |
| 1518 } | |
| 1519 } | |
| 1520 | |
| 1521 factory AnalysisSetAnalysisRootsParams.fromRequest(Request request) { | |
| 1522 return new AnalysisSetAnalysisRootsParams.fromJson( | |
| 1523 new RequestDecoder(request), "params", request._params); | |
| 1524 } | |
| 1525 | |
| 1526 Map<String, dynamic> toJson() { | |
| 1527 Map<String, dynamic> result = {}; | |
| 1528 result["included"] = included; | |
| 1529 result["excluded"] = excluded; | |
| 1530 if (packageRoots != null) { | |
| 1531 result["packageRoots"] = packageRoots; | |
| 1532 } | |
| 1533 return result; | |
| 1534 } | |
| 1535 | |
| 1536 Request toRequest(String id) { | |
| 1537 return new Request(id, "analysis.setAnalysisRoots", toJson()); | |
| 1538 } | |
| 1539 | |
| 1540 @override | |
| 1541 String toString() => JSON.encode(toJson()); | |
| 1542 | |
| 1543 @override | |
| 1544 bool operator==(other) { | |
| 1545 if (other is AnalysisSetAnalysisRootsParams) { | |
| 1546 return _listEqual(included, other.included, (String a, String b) => a == b
) && | |
| 1547 _listEqual(excluded, other.excluded, (String a, String b) => a == b) &
& | |
| 1548 _mapEqual(packageRoots, other.packageRoots, (String a, String b) => a
== b); | |
| 1549 } | |
| 1550 return false; | |
| 1551 } | |
| 1552 | |
| 1553 @override | |
| 1554 int get hashCode { | |
| 1555 int hash = 0; | |
| 1556 hash = _JenkinsSmiHash.combine(hash, included.hashCode); | |
| 1557 hash = _JenkinsSmiHash.combine(hash, excluded.hashCode); | |
| 1558 hash = _JenkinsSmiHash.combine(hash, packageRoots.hashCode); | |
| 1559 return _JenkinsSmiHash.finish(hash); | |
| 1560 } | |
| 1561 } | |
| 1562 /** | |
| 1563 * analysis.setAnalysisRoots result | |
| 1564 */ | |
| 1565 class AnalysisSetAnalysisRootsResult { | |
| 1566 Response toResponse(String id) { | |
| 1567 return new Response(id, result: null); | |
| 1568 } | |
| 1569 | |
| 1570 @override | |
| 1571 bool operator==(other) { | |
| 1572 if (other is AnalysisSetAnalysisRootsResult) { | |
| 1573 return true; | |
| 1574 } | |
| 1575 return false; | |
| 1576 } | |
| 1577 | |
| 1578 @override | |
| 1579 int get hashCode { | |
| 1580 return 866004753; | |
| 1581 } | |
| 1582 } | |
| 1583 | |
| 1584 /** | |
| 1585 * analysis.setGeneralSubscriptions params | |
| 1586 * | |
| 1587 * { | |
| 1588 * "subscriptions": List<GeneralAnalysisService> | |
| 1589 * } | |
| 1590 */ | |
| 1591 class AnalysisSetGeneralSubscriptionsParams implements HasToJson { | |
| 1592 List<GeneralAnalysisService> _subscriptions; | |
| 1593 | |
| 1594 /** | |
| 1595 * A list of the services being subscribed to. | |
| 1596 */ | |
| 1597 List<GeneralAnalysisService> get subscriptions => _subscriptions; | |
| 1598 | |
| 1599 /** | |
| 1600 * A list of the services being subscribed to. | |
| 1601 */ | |
| 1602 void set subscriptions(List<GeneralAnalysisService> value) { | |
| 1603 assert(value != null); | |
| 1604 this._subscriptions = value; | |
| 1605 } | |
| 1606 | |
| 1607 AnalysisSetGeneralSubscriptionsParams(List<GeneralAnalysisService> subscriptio
ns) { | |
| 1608 this.subscriptions = subscriptions; | |
| 1609 } | |
| 1610 | |
| 1611 factory AnalysisSetGeneralSubscriptionsParams.fromJson(JsonDecoder jsonDecoder
, String jsonPath, Object json) { | |
| 1612 if (json == null) { | |
| 1613 json = {}; | |
| 1614 } | |
| 1615 if (json is Map) { | |
| 1616 List<GeneralAnalysisService> subscriptions; | |
| 1617 if (json.containsKey("subscriptions")) { | |
| 1618 subscriptions = jsonDecoder._decodeList(jsonPath + ".subscriptions", jso
n["subscriptions"], (String jsonPath, Object json) => new GeneralAnalysisService
.fromJson(jsonDecoder, jsonPath, json)); | |
| 1619 } else { | |
| 1620 throw jsonDecoder.missingKey(jsonPath, "subscriptions"); | |
| 1621 } | |
| 1622 return new AnalysisSetGeneralSubscriptionsParams(subscriptions); | |
| 1623 } else { | |
| 1624 throw jsonDecoder.mismatch(jsonPath, "analysis.setGeneralSubscriptions par
ams", json); | |
| 1625 } | |
| 1626 } | |
| 1627 | |
| 1628 factory AnalysisSetGeneralSubscriptionsParams.fromRequest(Request request) { | |
| 1629 return new AnalysisSetGeneralSubscriptionsParams.fromJson( | |
| 1630 new RequestDecoder(request), "params", request._params); | |
| 1631 } | |
| 1632 | |
| 1633 Map<String, dynamic> toJson() { | |
| 1634 Map<String, dynamic> result = {}; | |
| 1635 result["subscriptions"] = subscriptions.map((GeneralAnalysisService value) =
> value.toJson()).toList(); | |
| 1636 return result; | |
| 1637 } | |
| 1638 | |
| 1639 Request toRequest(String id) { | |
| 1640 return new Request(id, "analysis.setGeneralSubscriptions", toJson()); | |
| 1641 } | |
| 1642 | |
| 1643 @override | |
| 1644 String toString() => JSON.encode(toJson()); | |
| 1645 | |
| 1646 @override | |
| 1647 bool operator==(other) { | |
| 1648 if (other is AnalysisSetGeneralSubscriptionsParams) { | |
| 1649 return _listEqual(subscriptions, other.subscriptions, (GeneralAnalysisServ
ice a, GeneralAnalysisService b) => a == b); | |
| 1650 } | |
| 1651 return false; | |
| 1652 } | |
| 1653 | |
| 1654 @override | |
| 1655 int get hashCode { | |
| 1656 int hash = 0; | |
| 1657 hash = _JenkinsSmiHash.combine(hash, subscriptions.hashCode); | |
| 1658 return _JenkinsSmiHash.finish(hash); | |
| 1659 } | |
| 1660 } | |
| 1661 /** | |
| 1662 * analysis.setGeneralSubscriptions result | |
| 1663 */ | |
| 1664 class AnalysisSetGeneralSubscriptionsResult { | |
| 1665 Response toResponse(String id) { | |
| 1666 return new Response(id, result: null); | |
| 1667 } | |
| 1668 | |
| 1669 @override | |
| 1670 bool operator==(other) { | |
| 1671 if (other is AnalysisSetGeneralSubscriptionsResult) { | |
| 1672 return true; | |
| 1673 } | |
| 1674 return false; | |
| 1675 } | |
| 1676 | |
| 1677 @override | |
| 1678 int get hashCode { | |
| 1679 return 386759562; | |
| 1680 } | |
| 1681 } | |
| 1682 | |
| 1683 /** | |
| 1684 * analysis.setPriorityFiles params | |
| 1685 * | |
| 1686 * { | |
| 1687 * "files": List<FilePath> | |
| 1688 * } | |
| 1689 */ | |
| 1690 class AnalysisSetPriorityFilesParams implements HasToJson { | |
| 1691 List<String> _files; | |
| 1692 | |
| 1693 /** | |
| 1694 * The files that are to be a priority for analysis. | |
| 1695 */ | |
| 1696 List<String> get files => _files; | |
| 1697 | |
| 1698 /** | |
| 1699 * The files that are to be a priority for analysis. | |
| 1700 */ | |
| 1701 void set files(List<String> value) { | |
| 1702 assert(value != null); | |
| 1703 this._files = value; | |
| 1704 } | |
| 1705 | |
| 1706 AnalysisSetPriorityFilesParams(List<String> files) { | |
| 1707 this.files = files; | |
| 1708 } | |
| 1709 | |
| 1710 factory AnalysisSetPriorityFilesParams.fromJson(JsonDecoder jsonDecoder, Strin
g jsonPath, Object json) { | |
| 1711 if (json == null) { | |
| 1712 json = {}; | |
| 1713 } | |
| 1714 if (json is Map) { | |
| 1715 List<String> files; | |
| 1716 if (json.containsKey("files")) { | |
| 1717 files = jsonDecoder._decodeList(jsonPath + ".files", json["files"], json
Decoder._decodeString); | |
| 1718 } else { | |
| 1719 throw jsonDecoder.missingKey(jsonPath, "files"); | |
| 1720 } | |
| 1721 return new AnalysisSetPriorityFilesParams(files); | |
| 1722 } else { | |
| 1723 throw jsonDecoder.mismatch(jsonPath, "analysis.setPriorityFiles params", j
son); | |
| 1724 } | |
| 1725 } | |
| 1726 | |
| 1727 factory AnalysisSetPriorityFilesParams.fromRequest(Request request) { | |
| 1728 return new AnalysisSetPriorityFilesParams.fromJson( | |
| 1729 new RequestDecoder(request), "params", request._params); | |
| 1730 } | |
| 1731 | |
| 1732 Map<String, dynamic> toJson() { | |
| 1733 Map<String, dynamic> result = {}; | |
| 1734 result["files"] = files; | |
| 1735 return result; | |
| 1736 } | |
| 1737 | |
| 1738 Request toRequest(String id) { | |
| 1739 return new Request(id, "analysis.setPriorityFiles", toJson()); | |
| 1740 } | |
| 1741 | |
| 1742 @override | |
| 1743 String toString() => JSON.encode(toJson()); | |
| 1744 | |
| 1745 @override | |
| 1746 bool operator==(other) { | |
| 1747 if (other is AnalysisSetPriorityFilesParams) { | |
| 1748 return _listEqual(files, other.files, (String a, String b) => a == b); | |
| 1749 } | |
| 1750 return false; | |
| 1751 } | |
| 1752 | |
| 1753 @override | |
| 1754 int get hashCode { | |
| 1755 int hash = 0; | |
| 1756 hash = _JenkinsSmiHash.combine(hash, files.hashCode); | |
| 1757 return _JenkinsSmiHash.finish(hash); | |
| 1758 } | |
| 1759 } | |
| 1760 /** | |
| 1761 * analysis.setPriorityFiles result | |
| 1762 */ | |
| 1763 class AnalysisSetPriorityFilesResult { | |
| 1764 Response toResponse(String id) { | |
| 1765 return new Response(id, result: null); | |
| 1766 } | |
| 1767 | |
| 1768 @override | |
| 1769 bool operator==(other) { | |
| 1770 if (other is AnalysisSetPriorityFilesResult) { | |
| 1771 return true; | |
| 1772 } | |
| 1773 return false; | |
| 1774 } | |
| 1775 | |
| 1776 @override | |
| 1777 int get hashCode { | |
| 1778 return 330050055; | |
| 1779 } | |
| 1780 } | |
| 1781 | |
| 1782 /** | |
| 1783 * analysis.setSubscriptions params | |
| 1784 * | |
| 1785 * { | |
| 1786 * "subscriptions": Map<AnalysisService, List<FilePath>> | |
| 1787 * } | |
| 1788 */ | |
| 1789 class AnalysisSetSubscriptionsParams implements HasToJson { | |
| 1790 Map<AnalysisService, List<String>> _subscriptions; | |
| 1791 | |
| 1792 /** | |
| 1793 * A table mapping services to a list of the files being subscribed to the | |
| 1794 * service. | |
| 1795 */ | |
| 1796 Map<AnalysisService, List<String>> get subscriptions => _subscriptions; | |
| 1797 | |
| 1798 /** | |
| 1799 * A table mapping services to a list of the files being subscribed to the | |
| 1800 * service. | |
| 1801 */ | |
| 1802 void set subscriptions(Map<AnalysisService, List<String>> value) { | |
| 1803 assert(value != null); | |
| 1804 this._subscriptions = value; | |
| 1805 } | |
| 1806 | |
| 1807 AnalysisSetSubscriptionsParams(Map<AnalysisService, List<String>> subscription
s) { | |
| 1808 this.subscriptions = subscriptions; | |
| 1809 } | |
| 1810 | |
| 1811 factory AnalysisSetSubscriptionsParams.fromJson(JsonDecoder jsonDecoder, Strin
g jsonPath, Object json) { | |
| 1812 if (json == null) { | |
| 1813 json = {}; | |
| 1814 } | |
| 1815 if (json is Map) { | |
| 1816 Map<AnalysisService, List<String>> subscriptions; | |
| 1817 if (json.containsKey("subscriptions")) { | |
| 1818 subscriptions = jsonDecoder._decodeMap(jsonPath + ".subscriptions", json
["subscriptions"], keyDecoder: (String jsonPath, Object json) => new AnalysisSer
vice.fromJson(jsonDecoder, jsonPath, json), valueDecoder: (String jsonPath, Obje
ct json) => jsonDecoder._decodeList(jsonPath, json, jsonDecoder._decodeString)); | |
| 1819 } else { | |
| 1820 throw jsonDecoder.missingKey(jsonPath, "subscriptions"); | |
| 1821 } | |
| 1822 return new AnalysisSetSubscriptionsParams(subscriptions); | |
| 1823 } else { | |
| 1824 throw jsonDecoder.mismatch(jsonPath, "analysis.setSubscriptions params", j
son); | |
| 1825 } | |
| 1826 } | |
| 1827 | |
| 1828 factory AnalysisSetSubscriptionsParams.fromRequest(Request request) { | |
| 1829 return new AnalysisSetSubscriptionsParams.fromJson( | |
| 1830 new RequestDecoder(request), "params", request._params); | |
| 1831 } | |
| 1832 | |
| 1833 Map<String, dynamic> toJson() { | |
| 1834 Map<String, dynamic> result = {}; | |
| 1835 result["subscriptions"] = mapMap(subscriptions, keyCallback: (AnalysisServic
e value) => value.toJson()); | |
| 1836 return result; | |
| 1837 } | |
| 1838 | |
| 1839 Request toRequest(String id) { | |
| 1840 return new Request(id, "analysis.setSubscriptions", toJson()); | |
| 1841 } | |
| 1842 | |
| 1843 @override | |
| 1844 String toString() => JSON.encode(toJson()); | |
| 1845 | |
| 1846 @override | |
| 1847 bool operator==(other) { | |
| 1848 if (other is AnalysisSetSubscriptionsParams) { | |
| 1849 return _mapEqual(subscriptions, other.subscriptions, (List<String> a, List
<String> b) => _listEqual(a, b, (String a, String b) => a == b)); | |
| 1850 } | |
| 1851 return false; | |
| 1852 } | |
| 1853 | |
| 1854 @override | |
| 1855 int get hashCode { | |
| 1856 int hash = 0; | |
| 1857 hash = _JenkinsSmiHash.combine(hash, subscriptions.hashCode); | |
| 1858 return _JenkinsSmiHash.finish(hash); | |
| 1859 } | |
| 1860 } | |
| 1861 /** | |
| 1862 * analysis.setSubscriptions result | |
| 1863 */ | |
| 1864 class AnalysisSetSubscriptionsResult { | |
| 1865 Response toResponse(String id) { | |
| 1866 return new Response(id, result: null); | |
| 1867 } | |
| 1868 | |
| 1869 @override | |
| 1870 bool operator==(other) { | |
| 1871 if (other is AnalysisSetSubscriptionsResult) { | |
| 1872 return true; | |
| 1873 } | |
| 1874 return false; | |
| 1875 } | |
| 1876 | |
| 1877 @override | |
| 1878 int get hashCode { | |
| 1879 return 218088493; | |
| 1880 } | |
| 1881 } | |
| 1882 | |
| 1883 /** | |
| 1884 * analysis.updateContent params | |
| 1885 * | |
| 1886 * { | |
| 1887 * "files": Map<FilePath, AddContentOverlay | ChangeContentOverlay | RemoveCon
tentOverlay> | |
| 1888 * } | |
| 1889 */ | |
| 1890 class AnalysisUpdateContentParams implements HasToJson { | |
| 1891 Map<String, dynamic> _files; | |
| 1892 | |
| 1893 /** | |
| 1894 * A table mapping the files whose content has changed to a description of | |
| 1895 * the content change. | |
| 1896 */ | |
| 1897 Map<String, dynamic> get files => _files; | |
| 1898 | |
| 1899 /** | |
| 1900 * A table mapping the files whose content has changed to a description of | |
| 1901 * the content change. | |
| 1902 */ | |
| 1903 void set files(Map<String, dynamic> value) { | |
| 1904 assert(value != null); | |
| 1905 this._files = value; | |
| 1906 } | |
| 1907 | |
| 1908 AnalysisUpdateContentParams(Map<String, dynamic> files) { | |
| 1909 this.files = files; | |
| 1910 } | |
| 1911 | |
| 1912 factory AnalysisUpdateContentParams.fromJson(JsonDecoder jsonDecoder, String j
sonPath, Object json) { | |
| 1913 if (json == null) { | |
| 1914 json = {}; | |
| 1915 } | |
| 1916 if (json is Map) { | |
| 1917 Map<String, dynamic> files; | |
| 1918 if (json.containsKey("files")) { | |
| 1919 files = jsonDecoder._decodeMap(jsonPath + ".files", json["files"], value
Decoder: (String jsonPath, Object json) => jsonDecoder._decodeUnion(jsonPath, js
on, "type", {"add": (String jsonPath, Object json) => new AddContentOverlay.from
Json(jsonDecoder, jsonPath, json), "change": (String jsonPath, Object json) => n
ew ChangeContentOverlay.fromJson(jsonDecoder, jsonPath, json), "remove": (String
jsonPath, Object json) => new RemoveContentOverlay.fromJson(jsonDecoder, jsonPa
th, json)})); | |
| 1920 } else { | |
| 1921 throw jsonDecoder.missingKey(jsonPath, "files"); | |
| 1922 } | |
| 1923 return new AnalysisUpdateContentParams(files); | |
| 1924 } else { | |
| 1925 throw jsonDecoder.mismatch(jsonPath, "analysis.updateContent params", json
); | |
| 1926 } | |
| 1927 } | |
| 1928 | |
| 1929 factory AnalysisUpdateContentParams.fromRequest(Request request) { | |
| 1930 return new AnalysisUpdateContentParams.fromJson( | |
| 1931 new RequestDecoder(request), "params", request._params); | |
| 1932 } | |
| 1933 | |
| 1934 Map<String, dynamic> toJson() { | |
| 1935 Map<String, dynamic> result = {}; | |
| 1936 result["files"] = mapMap(files, valueCallback: (dynamic value) => value.toJs
on()); | |
| 1937 return result; | |
| 1938 } | |
| 1939 | |
| 1940 Request toRequest(String id) { | |
| 1941 return new Request(id, "analysis.updateContent", toJson()); | |
| 1942 } | |
| 1943 | |
| 1944 @override | |
| 1945 String toString() => JSON.encode(toJson()); | |
| 1946 | |
| 1947 @override | |
| 1948 bool operator==(other) { | |
| 1949 if (other is AnalysisUpdateContentParams) { | |
| 1950 return _mapEqual(files, other.files, (dynamic a, dynamic b) => a == b); | |
| 1951 } | |
| 1952 return false; | |
| 1953 } | |
| 1954 | |
| 1955 @override | |
| 1956 int get hashCode { | |
| 1957 int hash = 0; | |
| 1958 hash = _JenkinsSmiHash.combine(hash, files.hashCode); | |
| 1959 return _JenkinsSmiHash.finish(hash); | |
| 1960 } | |
| 1961 } | |
| 1962 | |
| 1963 /** | |
| 1964 * analysis.updateContent result | |
| 1965 * | |
| 1966 * { | |
| 1967 * } | |
| 1968 */ | |
| 1969 class AnalysisUpdateContentResult implements HasToJson { | |
| 1970 AnalysisUpdateContentResult(); | |
| 1971 | |
| 1972 factory AnalysisUpdateContentResult.fromJson(JsonDecoder jsonDecoder, String j
sonPath, Object json) { | |
| 1973 if (json == null) { | |
| 1974 json = {}; | |
| 1975 } | |
| 1976 if (json is Map) { | |
| 1977 return new AnalysisUpdateContentResult(); | |
| 1978 } else { | |
| 1979 throw jsonDecoder.mismatch(jsonPath, "analysis.updateContent result", json
); | |
| 1980 } | |
| 1981 } | |
| 1982 | |
| 1983 factory AnalysisUpdateContentResult.fromResponse(Response response) { | |
| 1984 return new AnalysisUpdateContentResult.fromJson( | |
| 1985 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); | |
| 1986 } | |
| 1987 | |
| 1988 Map<String, dynamic> toJson() { | |
| 1989 Map<String, dynamic> result = {}; | |
| 1990 return result; | |
| 1991 } | |
| 1992 | |
| 1993 Response toResponse(String id) { | |
| 1994 return new Response(id, result: toJson()); | |
| 1995 } | |
| 1996 | |
| 1997 @override | |
| 1998 String toString() => JSON.encode(toJson()); | |
| 1999 | |
| 2000 @override | |
| 2001 bool operator==(other) { | |
| 2002 if (other is AnalysisUpdateContentResult) { | |
| 2003 return true; | |
| 2004 } | |
| 2005 return false; | |
| 2006 } | |
| 2007 | |
| 2008 @override | |
| 2009 int get hashCode { | |
| 2010 int hash = 0; | |
| 2011 return _JenkinsSmiHash.finish(hash); | |
| 2012 } | |
| 2013 } | |
| 2014 | |
| 2015 /** | |
| 2016 * analysis.updateOptions params | |
| 2017 * | |
| 2018 * { | |
| 2019 * "options": AnalysisOptions | |
| 2020 * } | |
| 2021 */ | |
| 2022 class AnalysisUpdateOptionsParams implements HasToJson { | |
| 2023 AnalysisOptions _options; | |
| 2024 | |
| 2025 /** | |
| 2026 * The options that are to be used to control analysis. | |
| 2027 */ | |
| 2028 AnalysisOptions get options => _options; | |
| 2029 | |
| 2030 /** | |
| 2031 * The options that are to be used to control analysis. | |
| 2032 */ | |
| 2033 void set options(AnalysisOptions value) { | |
| 2034 assert(value != null); | |
| 2035 this._options = value; | |
| 2036 } | |
| 2037 | |
| 2038 AnalysisUpdateOptionsParams(AnalysisOptions options) { | |
| 2039 this.options = options; | |
| 2040 } | |
| 2041 | |
| 2042 factory AnalysisUpdateOptionsParams.fromJson(JsonDecoder jsonDecoder, String j
sonPath, Object json) { | |
| 2043 if (json == null) { | |
| 2044 json = {}; | |
| 2045 } | |
| 2046 if (json is Map) { | |
| 2047 AnalysisOptions options; | |
| 2048 if (json.containsKey("options")) { | |
| 2049 options = new AnalysisOptions.fromJson(jsonDecoder, jsonPath + ".options
", json["options"]); | |
| 2050 } else { | |
| 2051 throw jsonDecoder.missingKey(jsonPath, "options"); | |
| 2052 } | |
| 2053 return new AnalysisUpdateOptionsParams(options); | |
| 2054 } else { | |
| 2055 throw jsonDecoder.mismatch(jsonPath, "analysis.updateOptions params", json
); | |
| 2056 } | |
| 2057 } | |
| 2058 | |
| 2059 factory AnalysisUpdateOptionsParams.fromRequest(Request request) { | |
| 2060 return new AnalysisUpdateOptionsParams.fromJson( | |
| 2061 new RequestDecoder(request), "params", request._params); | |
| 2062 } | |
| 2063 | |
| 2064 Map<String, dynamic> toJson() { | |
| 2065 Map<String, dynamic> result = {}; | |
| 2066 result["options"] = options.toJson(); | |
| 2067 return result; | |
| 2068 } | |
| 2069 | |
| 2070 Request toRequest(String id) { | |
| 2071 return new Request(id, "analysis.updateOptions", toJson()); | |
| 2072 } | |
| 2073 | |
| 2074 @override | |
| 2075 String toString() => JSON.encode(toJson()); | |
| 2076 | |
| 2077 @override | |
| 2078 bool operator==(other) { | |
| 2079 if (other is AnalysisUpdateOptionsParams) { | |
| 2080 return options == other.options; | |
| 2081 } | |
| 2082 return false; | |
| 2083 } | |
| 2084 | |
| 2085 @override | |
| 2086 int get hashCode { | |
| 2087 int hash = 0; | |
| 2088 hash = _JenkinsSmiHash.combine(hash, options.hashCode); | |
| 2089 return _JenkinsSmiHash.finish(hash); | |
| 2090 } | |
| 2091 } | |
| 2092 /** | |
| 2093 * analysis.updateOptions result | |
| 2094 */ | |
| 2095 class AnalysisUpdateOptionsResult { | |
| 2096 Response toResponse(String id) { | |
| 2097 return new Response(id, result: null); | |
| 2098 } | |
| 2099 | |
| 2100 @override | |
| 2101 bool operator==(other) { | |
| 2102 if (other is AnalysisUpdateOptionsResult) { | |
| 2103 return true; | |
| 2104 } | |
| 2105 return false; | |
| 2106 } | |
| 2107 | |
| 2108 @override | |
| 2109 int get hashCode { | |
| 2110 return 179689467; | |
| 2111 } | |
| 2112 } | |
| 2113 | |
| 2114 /** | |
| 2115 * analysis.analyzedFiles params | |
| 2116 * | |
| 2117 * { | |
| 2118 * "directories": List<FilePath> | |
| 2119 * } | |
| 2120 */ | |
| 2121 class AnalysisAnalyzedFilesParams implements HasToJson { | |
| 2122 List<String> _directories; | |
| 2123 | |
| 2124 /** | |
| 2125 * A list of the paths of the files that are being analyzed. | |
| 2126 */ | |
| 2127 List<String> get directories => _directories; | |
| 2128 | |
| 2129 /** | |
| 2130 * A list of the paths of the files that are being analyzed. | |
| 2131 */ | |
| 2132 void set directories(List<String> value) { | |
| 2133 assert(value != null); | |
| 2134 this._directories = value; | |
| 2135 } | |
| 2136 | |
| 2137 AnalysisAnalyzedFilesParams(List<String> directories) { | |
| 2138 this.directories = directories; | |
| 2139 } | |
| 2140 | |
| 2141 factory AnalysisAnalyzedFilesParams.fromJson(JsonDecoder jsonDecoder, String j
sonPath, Object json) { | |
| 2142 if (json == null) { | |
| 2143 json = {}; | |
| 2144 } | |
| 2145 if (json is Map) { | |
| 2146 List<String> directories; | |
| 2147 if (json.containsKey("directories")) { | |
| 2148 directories = jsonDecoder._decodeList(jsonPath + ".directories", json["d
irectories"], jsonDecoder._decodeString); | |
| 2149 } else { | |
| 2150 throw jsonDecoder.missingKey(jsonPath, "directories"); | |
| 2151 } | |
| 2152 return new AnalysisAnalyzedFilesParams(directories); | |
| 2153 } else { | |
| 2154 throw jsonDecoder.mismatch(jsonPath, "analysis.analyzedFiles params", json
); | |
| 2155 } | |
| 2156 } | |
| 2157 | |
| 2158 factory AnalysisAnalyzedFilesParams.fromNotification(Notification notification
) { | |
| 2159 return new AnalysisAnalyzedFilesParams.fromJson( | |
| 2160 new ResponseDecoder(null), "params", notification._params); | |
| 2161 } | |
| 2162 | |
| 2163 Map<String, dynamic> toJson() { | |
| 2164 Map<String, dynamic> result = {}; | |
| 2165 result["directories"] = directories; | |
| 2166 return result; | |
| 2167 } | |
| 2168 | |
| 2169 Notification toNotification() { | |
| 2170 return new Notification("analysis.analyzedFiles", toJson()); | |
| 2171 } | |
| 2172 | |
| 2173 @override | |
| 2174 String toString() => JSON.encode(toJson()); | |
| 2175 | |
| 2176 @override | |
| 2177 bool operator==(other) { | |
| 2178 if (other is AnalysisAnalyzedFilesParams) { | |
| 2179 return _listEqual(directories, other.directories, (String a, String b) =>
a == b); | |
| 2180 } | |
| 2181 return false; | |
| 2182 } | |
| 2183 | |
| 2184 @override | |
| 2185 int get hashCode { | |
| 2186 int hash = 0; | |
| 2187 hash = _JenkinsSmiHash.combine(hash, directories.hashCode); | |
| 2188 return _JenkinsSmiHash.finish(hash); | |
| 2189 } | |
| 2190 } | |
| 2191 | |
| 2192 /** | |
| 2193 * analysis.errors params | |
| 2194 * | |
| 2195 * { | |
| 2196 * "file": FilePath | |
| 2197 * "errors": List<AnalysisError> | |
| 2198 * } | |
| 2199 */ | |
| 2200 class AnalysisErrorsParams implements HasToJson { | |
| 2201 String _file; | |
| 2202 | |
| 2203 List<AnalysisError> _errors; | |
| 2204 | |
| 2205 /** | |
| 2206 * The file containing the errors. | |
| 2207 */ | |
| 2208 String get file => _file; | |
| 2209 | |
| 2210 /** | |
| 2211 * The file containing the errors. | |
| 2212 */ | |
| 2213 void set file(String value) { | |
| 2214 assert(value != null); | |
| 2215 this._file = value; | |
| 2216 } | |
| 2217 | |
| 2218 /** | |
| 2219 * The errors contained in the file. | |
| 2220 */ | |
| 2221 List<AnalysisError> get errors => _errors; | |
| 2222 | |
| 2223 /** | |
| 2224 * The errors contained in the file. | |
| 2225 */ | |
| 2226 void set errors(List<AnalysisError> value) { | |
| 2227 assert(value != null); | |
| 2228 this._errors = value; | |
| 2229 } | |
| 2230 | |
| 2231 AnalysisErrorsParams(String file, List<AnalysisError> errors) { | |
| 2232 this.file = file; | |
| 2233 this.errors = errors; | |
| 2234 } | |
| 2235 | |
| 2236 factory AnalysisErrorsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath
, Object json) { | |
| 2237 if (json == null) { | |
| 2238 json = {}; | |
| 2239 } | |
| 2240 if (json is Map) { | |
| 2241 String file; | |
| 2242 if (json.containsKey("file")) { | |
| 2243 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 2244 } else { | |
| 2245 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 2246 } | |
| 2247 List<AnalysisError> errors; | |
| 2248 if (json.containsKey("errors")) { | |
| 2249 errors = jsonDecoder._decodeList(jsonPath + ".errors", json["errors"], (
String jsonPath, Object json) => new AnalysisError.fromJson(jsonDecoder, jsonPat
h, json)); | |
| 2250 } else { | |
| 2251 throw jsonDecoder.missingKey(jsonPath, "errors"); | |
| 2252 } | |
| 2253 return new AnalysisErrorsParams(file, errors); | |
| 2254 } else { | |
| 2255 throw jsonDecoder.mismatch(jsonPath, "analysis.errors params", json); | |
| 2256 } | |
| 2257 } | |
| 2258 | |
| 2259 factory AnalysisErrorsParams.fromNotification(Notification notification) { | |
| 2260 return new AnalysisErrorsParams.fromJson( | |
| 2261 new ResponseDecoder(null), "params", notification._params); | |
| 2262 } | |
| 2263 | |
| 2264 Map<String, dynamic> toJson() { | |
| 2265 Map<String, dynamic> result = {}; | |
| 2266 result["file"] = file; | |
| 2267 result["errors"] = errors.map((AnalysisError value) => value.toJson()).toLis
t(); | |
| 2268 return result; | |
| 2269 } | |
| 2270 | |
| 2271 Notification toNotification() { | |
| 2272 return new Notification("analysis.errors", toJson()); | |
| 2273 } | |
| 2274 | |
| 2275 @override | |
| 2276 String toString() => JSON.encode(toJson()); | |
| 2277 | |
| 2278 @override | |
| 2279 bool operator==(other) { | |
| 2280 if (other is AnalysisErrorsParams) { | |
| 2281 return file == other.file && | |
| 2282 _listEqual(errors, other.errors, (AnalysisError a, AnalysisError b) =>
a == b); | |
| 2283 } | |
| 2284 return false; | |
| 2285 } | |
| 2286 | |
| 2287 @override | |
| 2288 int get hashCode { | |
| 2289 int hash = 0; | |
| 2290 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 2291 hash = _JenkinsSmiHash.combine(hash, errors.hashCode); | |
| 2292 return _JenkinsSmiHash.finish(hash); | |
| 2293 } | |
| 2294 } | |
| 2295 | |
| 2296 /** | |
| 2297 * analysis.flushResults params | |
| 2298 * | |
| 2299 * { | |
| 2300 * "files": List<FilePath> | |
| 2301 * } | |
| 2302 */ | |
| 2303 class AnalysisFlushResultsParams implements HasToJson { | |
| 2304 List<String> _files; | |
| 2305 | |
| 2306 /** | |
| 2307 * The files that are no longer being analyzed. | |
| 2308 */ | |
| 2309 List<String> get files => _files; | |
| 2310 | |
| 2311 /** | |
| 2312 * The files that are no longer being analyzed. | |
| 2313 */ | |
| 2314 void set files(List<String> value) { | |
| 2315 assert(value != null); | |
| 2316 this._files = value; | |
| 2317 } | |
| 2318 | |
| 2319 AnalysisFlushResultsParams(List<String> files) { | |
| 2320 this.files = files; | |
| 2321 } | |
| 2322 | |
| 2323 factory AnalysisFlushResultsParams.fromJson(JsonDecoder jsonDecoder, String js
onPath, Object json) { | |
| 2324 if (json == null) { | |
| 2325 json = {}; | |
| 2326 } | |
| 2327 if (json is Map) { | |
| 2328 List<String> files; | |
| 2329 if (json.containsKey("files")) { | |
| 2330 files = jsonDecoder._decodeList(jsonPath + ".files", json["files"], json
Decoder._decodeString); | |
| 2331 } else { | |
| 2332 throw jsonDecoder.missingKey(jsonPath, "files"); | |
| 2333 } | |
| 2334 return new AnalysisFlushResultsParams(files); | |
| 2335 } else { | |
| 2336 throw jsonDecoder.mismatch(jsonPath, "analysis.flushResults params", json)
; | |
| 2337 } | |
| 2338 } | |
| 2339 | |
| 2340 factory AnalysisFlushResultsParams.fromNotification(Notification notification)
{ | |
| 2341 return new AnalysisFlushResultsParams.fromJson( | |
| 2342 new ResponseDecoder(null), "params", notification._params); | |
| 2343 } | |
| 2344 | |
| 2345 Map<String, dynamic> toJson() { | |
| 2346 Map<String, dynamic> result = {}; | |
| 2347 result["files"] = files; | |
| 2348 return result; | |
| 2349 } | |
| 2350 | |
| 2351 Notification toNotification() { | |
| 2352 return new Notification("analysis.flushResults", toJson()); | |
| 2353 } | |
| 2354 | |
| 2355 @override | |
| 2356 String toString() => JSON.encode(toJson()); | |
| 2357 | |
| 2358 @override | |
| 2359 bool operator==(other) { | |
| 2360 if (other is AnalysisFlushResultsParams) { | |
| 2361 return _listEqual(files, other.files, (String a, String b) => a == b); | |
| 2362 } | |
| 2363 return false; | |
| 2364 } | |
| 2365 | |
| 2366 @override | |
| 2367 int get hashCode { | |
| 2368 int hash = 0; | |
| 2369 hash = _JenkinsSmiHash.combine(hash, files.hashCode); | |
| 2370 return _JenkinsSmiHash.finish(hash); | |
| 2371 } | |
| 2372 } | |
| 2373 | |
| 2374 /** | |
| 2375 * analysis.folding params | |
| 2376 * | |
| 2377 * { | |
| 2378 * "file": FilePath | |
| 2379 * "regions": List<FoldingRegion> | |
| 2380 * } | |
| 2381 */ | |
| 2382 class AnalysisFoldingParams implements HasToJson { | |
| 2383 String _file; | |
| 2384 | |
| 2385 List<FoldingRegion> _regions; | |
| 2386 | |
| 2387 /** | |
| 2388 * The file containing the folding regions. | |
| 2389 */ | |
| 2390 String get file => _file; | |
| 2391 | |
| 2392 /** | |
| 2393 * The file containing the folding regions. | |
| 2394 */ | |
| 2395 void set file(String value) { | |
| 2396 assert(value != null); | |
| 2397 this._file = value; | |
| 2398 } | |
| 2399 | |
| 2400 /** | |
| 2401 * The folding regions contained in the file. | |
| 2402 */ | |
| 2403 List<FoldingRegion> get regions => _regions; | |
| 2404 | |
| 2405 /** | |
| 2406 * The folding regions contained in the file. | |
| 2407 */ | |
| 2408 void set regions(List<FoldingRegion> value) { | |
| 2409 assert(value != null); | |
| 2410 this._regions = value; | |
| 2411 } | |
| 2412 | |
| 2413 AnalysisFoldingParams(String file, List<FoldingRegion> regions) { | |
| 2414 this.file = file; | |
| 2415 this.regions = regions; | |
| 2416 } | |
| 2417 | |
| 2418 factory AnalysisFoldingParams.fromJson(JsonDecoder jsonDecoder, String jsonPat
h, Object json) { | |
| 2419 if (json == null) { | |
| 2420 json = {}; | |
| 2421 } | |
| 2422 if (json is Map) { | |
| 2423 String file; | |
| 2424 if (json.containsKey("file")) { | |
| 2425 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 2426 } else { | |
| 2427 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 2428 } | |
| 2429 List<FoldingRegion> regions; | |
| 2430 if (json.containsKey("regions")) { | |
| 2431 regions = jsonDecoder._decodeList(jsonPath + ".regions", json["regions"]
, (String jsonPath, Object json) => new FoldingRegion.fromJson(jsonDecoder, json
Path, json)); | |
| 2432 } else { | |
| 2433 throw jsonDecoder.missingKey(jsonPath, "regions"); | |
| 2434 } | |
| 2435 return new AnalysisFoldingParams(file, regions); | |
| 2436 } else { | |
| 2437 throw jsonDecoder.mismatch(jsonPath, "analysis.folding params", json); | |
| 2438 } | |
| 2439 } | |
| 2440 | |
| 2441 factory AnalysisFoldingParams.fromNotification(Notification notification) { | |
| 2442 return new AnalysisFoldingParams.fromJson( | |
| 2443 new ResponseDecoder(null), "params", notification._params); | |
| 2444 } | |
| 2445 | |
| 2446 Map<String, dynamic> toJson() { | |
| 2447 Map<String, dynamic> result = {}; | |
| 2448 result["file"] = file; | |
| 2449 result["regions"] = regions.map((FoldingRegion value) => value.toJson()).toL
ist(); | |
| 2450 return result; | |
| 2451 } | |
| 2452 | |
| 2453 Notification toNotification() { | |
| 2454 return new Notification("analysis.folding", toJson()); | |
| 2455 } | |
| 2456 | |
| 2457 @override | |
| 2458 String toString() => JSON.encode(toJson()); | |
| 2459 | |
| 2460 @override | |
| 2461 bool operator==(other) { | |
| 2462 if (other is AnalysisFoldingParams) { | |
| 2463 return file == other.file && | |
| 2464 _listEqual(regions, other.regions, (FoldingRegion a, FoldingRegion b)
=> a == b); | |
| 2465 } | |
| 2466 return false; | |
| 2467 } | |
| 2468 | |
| 2469 @override | |
| 2470 int get hashCode { | |
| 2471 int hash = 0; | |
| 2472 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 2473 hash = _JenkinsSmiHash.combine(hash, regions.hashCode); | |
| 2474 return _JenkinsSmiHash.finish(hash); | |
| 2475 } | |
| 2476 } | |
| 2477 | |
| 2478 /** | |
| 2479 * analysis.highlights params | |
| 2480 * | |
| 2481 * { | |
| 2482 * "file": FilePath | |
| 2483 * "regions": List<HighlightRegion> | |
| 2484 * } | |
| 2485 */ | |
| 2486 class AnalysisHighlightsParams implements HasToJson { | |
| 2487 String _file; | |
| 2488 | |
| 2489 List<HighlightRegion> _regions; | |
| 2490 | |
| 2491 /** | |
| 2492 * The file containing the highlight regions. | |
| 2493 */ | |
| 2494 String get file => _file; | |
| 2495 | |
| 2496 /** | |
| 2497 * The file containing the highlight regions. | |
| 2498 */ | |
| 2499 void set file(String value) { | |
| 2500 assert(value != null); | |
| 2501 this._file = value; | |
| 2502 } | |
| 2503 | |
| 2504 /** | |
| 2505 * The highlight regions contained in the file. Each highlight region | |
| 2506 * represents a particular syntactic or semantic meaning associated with some | |
| 2507 * range. Note that the highlight regions that are returned can overlap other | |
| 2508 * highlight regions if there is more than one meaning associated with a | |
| 2509 * particular region. | |
| 2510 */ | |
| 2511 List<HighlightRegion> get regions => _regions; | |
| 2512 | |
| 2513 /** | |
| 2514 * The highlight regions contained in the file. Each highlight region | |
| 2515 * represents a particular syntactic or semantic meaning associated with some | |
| 2516 * range. Note that the highlight regions that are returned can overlap other | |
| 2517 * highlight regions if there is more than one meaning associated with a | |
| 2518 * particular region. | |
| 2519 */ | |
| 2520 void set regions(List<HighlightRegion> value) { | |
| 2521 assert(value != null); | |
| 2522 this._regions = value; | |
| 2523 } | |
| 2524 | |
| 2525 AnalysisHighlightsParams(String file, List<HighlightRegion> regions) { | |
| 2526 this.file = file; | |
| 2527 this.regions = regions; | |
| 2528 } | |
| 2529 | |
| 2530 factory AnalysisHighlightsParams.fromJson(JsonDecoder jsonDecoder, String json
Path, Object json) { | |
| 2531 if (json == null) { | |
| 2532 json = {}; | |
| 2533 } | |
| 2534 if (json is Map) { | |
| 2535 String file; | |
| 2536 if (json.containsKey("file")) { | |
| 2537 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 2538 } else { | |
| 2539 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 2540 } | |
| 2541 List<HighlightRegion> regions; | |
| 2542 if (json.containsKey("regions")) { | |
| 2543 regions = jsonDecoder._decodeList(jsonPath + ".regions", json["regions"]
, (String jsonPath, Object json) => new HighlightRegion.fromJson(jsonDecoder, js
onPath, json)); | |
| 2544 } else { | |
| 2545 throw jsonDecoder.missingKey(jsonPath, "regions"); | |
| 2546 } | |
| 2547 return new AnalysisHighlightsParams(file, regions); | |
| 2548 } else { | |
| 2549 throw jsonDecoder.mismatch(jsonPath, "analysis.highlights params", json); | |
| 2550 } | |
| 2551 } | |
| 2552 | |
| 2553 factory AnalysisHighlightsParams.fromNotification(Notification notification) { | |
| 2554 return new AnalysisHighlightsParams.fromJson( | |
| 2555 new ResponseDecoder(null), "params", notification._params); | |
| 2556 } | |
| 2557 | |
| 2558 Map<String, dynamic> toJson() { | |
| 2559 Map<String, dynamic> result = {}; | |
| 2560 result["file"] = file; | |
| 2561 result["regions"] = regions.map((HighlightRegion value) => value.toJson()).t
oList(); | |
| 2562 return result; | |
| 2563 } | |
| 2564 | |
| 2565 Notification toNotification() { | |
| 2566 return new Notification("analysis.highlights", toJson()); | |
| 2567 } | |
| 2568 | |
| 2569 @override | |
| 2570 String toString() => JSON.encode(toJson()); | |
| 2571 | |
| 2572 @override | |
| 2573 bool operator==(other) { | |
| 2574 if (other is AnalysisHighlightsParams) { | |
| 2575 return file == other.file && | |
| 2576 _listEqual(regions, other.regions, (HighlightRegion a, HighlightRegion
b) => a == b); | |
| 2577 } | |
| 2578 return false; | |
| 2579 } | |
| 2580 | |
| 2581 @override | |
| 2582 int get hashCode { | |
| 2583 int hash = 0; | |
| 2584 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 2585 hash = _JenkinsSmiHash.combine(hash, regions.hashCode); | |
| 2586 return _JenkinsSmiHash.finish(hash); | |
| 2587 } | |
| 2588 } | |
| 2589 | |
| 2590 /** | |
| 2591 * analysis.implemented params | |
| 2592 * | |
| 2593 * { | |
| 2594 * "file": FilePath | |
| 2595 * "classes": List<ImplementedClass> | |
| 2596 * "members": List<ImplementedMember> | |
| 2597 * } | |
| 2598 */ | |
| 2599 class AnalysisImplementedParams implements HasToJson { | |
| 2600 String _file; | |
| 2601 | |
| 2602 List<ImplementedClass> _classes; | |
| 2603 | |
| 2604 List<ImplementedMember> _members; | |
| 2605 | |
| 2606 /** | |
| 2607 * The file with which the implementations are associated. | |
| 2608 */ | |
| 2609 String get file => _file; | |
| 2610 | |
| 2611 /** | |
| 2612 * The file with which the implementations are associated. | |
| 2613 */ | |
| 2614 void set file(String value) { | |
| 2615 assert(value != null); | |
| 2616 this._file = value; | |
| 2617 } | |
| 2618 | |
| 2619 /** | |
| 2620 * The classes defined in the file that are implemented or extended. | |
| 2621 */ | |
| 2622 List<ImplementedClass> get classes => _classes; | |
| 2623 | |
| 2624 /** | |
| 2625 * The classes defined in the file that are implemented or extended. | |
| 2626 */ | |
| 2627 void set classes(List<ImplementedClass> value) { | |
| 2628 assert(value != null); | |
| 2629 this._classes = value; | |
| 2630 } | |
| 2631 | |
| 2632 /** | |
| 2633 * The member defined in the file that are implemented or overridden. | |
| 2634 */ | |
| 2635 List<ImplementedMember> get members => _members; | |
| 2636 | |
| 2637 /** | |
| 2638 * The member defined in the file that are implemented or overridden. | |
| 2639 */ | |
| 2640 void set members(List<ImplementedMember> value) { | |
| 2641 assert(value != null); | |
| 2642 this._members = value; | |
| 2643 } | |
| 2644 | |
| 2645 AnalysisImplementedParams(String file, List<ImplementedClass> classes, List<Im
plementedMember> members) { | |
| 2646 this.file = file; | |
| 2647 this.classes = classes; | |
| 2648 this.members = members; | |
| 2649 } | |
| 2650 | |
| 2651 factory AnalysisImplementedParams.fromJson(JsonDecoder jsonDecoder, String jso
nPath, Object json) { | |
| 2652 if (json == null) { | |
| 2653 json = {}; | |
| 2654 } | |
| 2655 if (json is Map) { | |
| 2656 String file; | |
| 2657 if (json.containsKey("file")) { | |
| 2658 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 2659 } else { | |
| 2660 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 2661 } | |
| 2662 List<ImplementedClass> classes; | |
| 2663 if (json.containsKey("classes")) { | |
| 2664 classes = jsonDecoder._decodeList(jsonPath + ".classes", json["classes"]
, (String jsonPath, Object json) => new ImplementedClass.fromJson(jsonDecoder, j
sonPath, json)); | |
| 2665 } else { | |
| 2666 throw jsonDecoder.missingKey(jsonPath, "classes"); | |
| 2667 } | |
| 2668 List<ImplementedMember> members; | |
| 2669 if (json.containsKey("members")) { | |
| 2670 members = jsonDecoder._decodeList(jsonPath + ".members", json["members"]
, (String jsonPath, Object json) => new ImplementedMember.fromJson(jsonDecoder,
jsonPath, json)); | |
| 2671 } else { | |
| 2672 throw jsonDecoder.missingKey(jsonPath, "members"); | |
| 2673 } | |
| 2674 return new AnalysisImplementedParams(file, classes, members); | |
| 2675 } else { | |
| 2676 throw jsonDecoder.mismatch(jsonPath, "analysis.implemented params", json); | |
| 2677 } | |
| 2678 } | |
| 2679 | |
| 2680 factory AnalysisImplementedParams.fromNotification(Notification notification)
{ | |
| 2681 return new AnalysisImplementedParams.fromJson( | |
| 2682 new ResponseDecoder(null), "params", notification._params); | |
| 2683 } | |
| 2684 | |
| 2685 Map<String, dynamic> toJson() { | |
| 2686 Map<String, dynamic> result = {}; | |
| 2687 result["file"] = file; | |
| 2688 result["classes"] = classes.map((ImplementedClass value) => value.toJson()).
toList(); | |
| 2689 result["members"] = members.map((ImplementedMember value) => value.toJson())
.toList(); | |
| 2690 return result; | |
| 2691 } | |
| 2692 | |
| 2693 Notification toNotification() { | |
| 2694 return new Notification("analysis.implemented", toJson()); | |
| 2695 } | |
| 2696 | |
| 2697 @override | |
| 2698 String toString() => JSON.encode(toJson()); | |
| 2699 | |
| 2700 @override | |
| 2701 bool operator==(other) { | |
| 2702 if (other is AnalysisImplementedParams) { | |
| 2703 return file == other.file && | |
| 2704 _listEqual(classes, other.classes, (ImplementedClass a, ImplementedCla
ss b) => a == b) && | |
| 2705 _listEqual(members, other.members, (ImplementedMember a, ImplementedMe
mber b) => a == b); | |
| 2706 } | |
| 2707 return false; | |
| 2708 } | |
| 2709 | |
| 2710 @override | |
| 2711 int get hashCode { | |
| 2712 int hash = 0; | |
| 2713 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 2714 hash = _JenkinsSmiHash.combine(hash, classes.hashCode); | |
| 2715 hash = _JenkinsSmiHash.combine(hash, members.hashCode); | |
| 2716 return _JenkinsSmiHash.finish(hash); | |
| 2717 } | |
| 2718 } | |
| 2719 | |
| 2720 /** | |
| 2721 * analysis.invalidate params | |
| 2722 * | |
| 2723 * { | |
| 2724 * "file": FilePath | |
| 2725 * "offset": int | |
| 2726 * "length": int | |
| 2727 * "delta": int | |
| 2728 * } | |
| 2729 */ | |
| 2730 class AnalysisInvalidateParams implements HasToJson { | |
| 2731 String _file; | |
| 2732 | |
| 2733 int _offset; | |
| 2734 | |
| 2735 int _length; | |
| 2736 | |
| 2737 int _delta; | |
| 2738 | |
| 2739 /** | |
| 2740 * The file whose information has been invalidated. | |
| 2741 */ | |
| 2742 String get file => _file; | |
| 2743 | |
| 2744 /** | |
| 2745 * The file whose information has been invalidated. | |
| 2746 */ | |
| 2747 void set file(String value) { | |
| 2748 assert(value != null); | |
| 2749 this._file = value; | |
| 2750 } | |
| 2751 | |
| 2752 /** | |
| 2753 * The offset of the invalidated region. | |
| 2754 */ | |
| 2755 int get offset => _offset; | |
| 2756 | |
| 2757 /** | |
| 2758 * The offset of the invalidated region. | |
| 2759 */ | |
| 2760 void set offset(int value) { | |
| 2761 assert(value != null); | |
| 2762 this._offset = value; | |
| 2763 } | |
| 2764 | |
| 2765 /** | |
| 2766 * The length of the invalidated region. | |
| 2767 */ | |
| 2768 int get length => _length; | |
| 2769 | |
| 2770 /** | |
| 2771 * The length of the invalidated region. | |
| 2772 */ | |
| 2773 void set length(int value) { | |
| 2774 assert(value != null); | |
| 2775 this._length = value; | |
| 2776 } | |
| 2777 | |
| 2778 /** | |
| 2779 * The delta to be applied to the offsets in information that follows the | |
| 2780 * invalidated region in order to update it so that it doesn't need to be | |
| 2781 * re-requested. | |
| 2782 */ | |
| 2783 int get delta => _delta; | |
| 2784 | |
| 2785 /** | |
| 2786 * The delta to be applied to the offsets in information that follows the | |
| 2787 * invalidated region in order to update it so that it doesn't need to be | |
| 2788 * re-requested. | |
| 2789 */ | |
| 2790 void set delta(int value) { | |
| 2791 assert(value != null); | |
| 2792 this._delta = value; | |
| 2793 } | |
| 2794 | |
| 2795 AnalysisInvalidateParams(String file, int offset, int length, int delta) { | |
| 2796 this.file = file; | |
| 2797 this.offset = offset; | |
| 2798 this.length = length; | |
| 2799 this.delta = delta; | |
| 2800 } | |
| 2801 | |
| 2802 factory AnalysisInvalidateParams.fromJson(JsonDecoder jsonDecoder, String json
Path, Object json) { | |
| 2803 if (json == null) { | |
| 2804 json = {}; | |
| 2805 } | |
| 2806 if (json is Map) { | |
| 2807 String file; | |
| 2808 if (json.containsKey("file")) { | |
| 2809 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 2810 } else { | |
| 2811 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 2812 } | |
| 2813 int offset; | |
| 2814 if (json.containsKey("offset")) { | |
| 2815 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 2816 } else { | |
| 2817 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 2818 } | |
| 2819 int length; | |
| 2820 if (json.containsKey("length")) { | |
| 2821 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | |
| 2822 } else { | |
| 2823 throw jsonDecoder.missingKey(jsonPath, "length"); | |
| 2824 } | |
| 2825 int delta; | |
| 2826 if (json.containsKey("delta")) { | |
| 2827 delta = jsonDecoder._decodeInt(jsonPath + ".delta", json["delta"]); | |
| 2828 } else { | |
| 2829 throw jsonDecoder.missingKey(jsonPath, "delta"); | |
| 2830 } | |
| 2831 return new AnalysisInvalidateParams(file, offset, length, delta); | |
| 2832 } else { | |
| 2833 throw jsonDecoder.mismatch(jsonPath, "analysis.invalidate params", json); | |
| 2834 } | |
| 2835 } | |
| 2836 | |
| 2837 factory AnalysisInvalidateParams.fromNotification(Notification notification) { | |
| 2838 return new AnalysisInvalidateParams.fromJson( | |
| 2839 new ResponseDecoder(null), "params", notification._params); | |
| 2840 } | |
| 2841 | |
| 2842 Map<String, dynamic> toJson() { | |
| 2843 Map<String, dynamic> result = {}; | |
| 2844 result["file"] = file; | |
| 2845 result["offset"] = offset; | |
| 2846 result["length"] = length; | |
| 2847 result["delta"] = delta; | |
| 2848 return result; | |
| 2849 } | |
| 2850 | |
| 2851 Notification toNotification() { | |
| 2852 return new Notification("analysis.invalidate", toJson()); | |
| 2853 } | |
| 2854 | |
| 2855 @override | |
| 2856 String toString() => JSON.encode(toJson()); | |
| 2857 | |
| 2858 @override | |
| 2859 bool operator==(other) { | |
| 2860 if (other is AnalysisInvalidateParams) { | |
| 2861 return file == other.file && | |
| 2862 offset == other.offset && | |
| 2863 length == other.length && | |
| 2864 delta == other.delta; | |
| 2865 } | |
| 2866 return false; | |
| 2867 } | |
| 2868 | |
| 2869 @override | |
| 2870 int get hashCode { | |
| 2871 int hash = 0; | |
| 2872 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 2873 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 2874 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
| 2875 hash = _JenkinsSmiHash.combine(hash, delta.hashCode); | |
| 2876 return _JenkinsSmiHash.finish(hash); | |
| 2877 } | |
| 2878 } | |
| 2879 | |
| 2880 /** | |
| 2881 * analysis.navigation params | |
| 2882 * | |
| 2883 * { | |
| 2884 * "file": FilePath | |
| 2885 * "regions": List<NavigationRegion> | |
| 2886 * "targets": List<NavigationTarget> | |
| 2887 * "files": List<FilePath> | |
| 2888 * } | |
| 2889 */ | |
| 2890 class AnalysisNavigationParams implements HasToJson { | |
| 2891 String _file; | |
| 2892 | |
| 2893 List<NavigationRegion> _regions; | |
| 2894 | |
| 2895 List<NavigationTarget> _targets; | |
| 2896 | |
| 2897 List<String> _files; | |
| 2898 | |
| 2899 /** | |
| 2900 * The file containing the navigation regions. | |
| 2901 */ | |
| 2902 String get file => _file; | |
| 2903 | |
| 2904 /** | |
| 2905 * The file containing the navigation regions. | |
| 2906 */ | |
| 2907 void set file(String value) { | |
| 2908 assert(value != null); | |
| 2909 this._file = value; | |
| 2910 } | |
| 2911 | |
| 2912 /** | |
| 2913 * The navigation regions contained in the file. The regions are sorted by | |
| 2914 * their offsets. Each navigation region represents a list of targets | |
| 2915 * associated with some range. The lists will usually contain a single | |
| 2916 * target, but can contain more in the case of a part that is included in | |
| 2917 * multiple libraries or in Dart code that is compiled against multiple | |
| 2918 * versions of a package. Note that the navigation regions that are returned | |
| 2919 * do not overlap other navigation regions. | |
| 2920 */ | |
| 2921 List<NavigationRegion> get regions => _regions; | |
| 2922 | |
| 2923 /** | |
| 2924 * The navigation regions contained in the file. The regions are sorted by | |
| 2925 * their offsets. Each navigation region represents a list of targets | |
| 2926 * associated with some range. The lists will usually contain a single | |
| 2927 * target, but can contain more in the case of a part that is included in | |
| 2928 * multiple libraries or in Dart code that is compiled against multiple | |
| 2929 * versions of a package. Note that the navigation regions that are returned | |
| 2930 * do not overlap other navigation regions. | |
| 2931 */ | |
| 2932 void set regions(List<NavigationRegion> value) { | |
| 2933 assert(value != null); | |
| 2934 this._regions = value; | |
| 2935 } | |
| 2936 | |
| 2937 /** | |
| 2938 * The navigation targets referenced in the file. They are referenced by | |
| 2939 * NavigationRegions by their index in this array. | |
| 2940 */ | |
| 2941 List<NavigationTarget> get targets => _targets; | |
| 2942 | |
| 2943 /** | |
| 2944 * The navigation targets referenced in the file. They are referenced by | |
| 2945 * NavigationRegions by their index in this array. | |
| 2946 */ | |
| 2947 void set targets(List<NavigationTarget> value) { | |
| 2948 assert(value != null); | |
| 2949 this._targets = value; | |
| 2950 } | |
| 2951 | |
| 2952 /** | |
| 2953 * The files containing navigation targets referenced in the file. They are | |
| 2954 * referenced by NavigationTargets by their index in this array. | |
| 2955 */ | |
| 2956 List<String> get files => _files; | |
| 2957 | |
| 2958 /** | |
| 2959 * The files containing navigation targets referenced in the file. They are | |
| 2960 * referenced by NavigationTargets by their index in this array. | |
| 2961 */ | |
| 2962 void set files(List<String> value) { | |
| 2963 assert(value != null); | |
| 2964 this._files = value; | |
| 2965 } | |
| 2966 | |
| 2967 AnalysisNavigationParams(String file, List<NavigationRegion> regions, List<Nav
igationTarget> targets, List<String> files) { | |
| 2968 this.file = file; | |
| 2969 this.regions = regions; | |
| 2970 this.targets = targets; | |
| 2971 this.files = files; | |
| 2972 } | |
| 2973 | |
| 2974 factory AnalysisNavigationParams.fromJson(JsonDecoder jsonDecoder, String json
Path, Object json) { | |
| 2975 if (json == null) { | |
| 2976 json = {}; | |
| 2977 } | |
| 2978 if (json is Map) { | |
| 2979 String file; | |
| 2980 if (json.containsKey("file")) { | |
| 2981 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 2982 } else { | |
| 2983 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 2984 } | |
| 2985 List<NavigationRegion> regions; | |
| 2986 if (json.containsKey("regions")) { | |
| 2987 regions = jsonDecoder._decodeList(jsonPath + ".regions", json["regions"]
, (String jsonPath, Object json) => new NavigationRegion.fromJson(jsonDecoder, j
sonPath, json)); | |
| 2988 } else { | |
| 2989 throw jsonDecoder.missingKey(jsonPath, "regions"); | |
| 2990 } | |
| 2991 List<NavigationTarget> targets; | |
| 2992 if (json.containsKey("targets")) { | |
| 2993 targets = jsonDecoder._decodeList(jsonPath + ".targets", json["targets"]
, (String jsonPath, Object json) => new NavigationTarget.fromJson(jsonDecoder, j
sonPath, json)); | |
| 2994 } else { | |
| 2995 throw jsonDecoder.missingKey(jsonPath, "targets"); | |
| 2996 } | |
| 2997 List<String> files; | |
| 2998 if (json.containsKey("files")) { | |
| 2999 files = jsonDecoder._decodeList(jsonPath + ".files", json["files"], json
Decoder._decodeString); | |
| 3000 } else { | |
| 3001 throw jsonDecoder.missingKey(jsonPath, "files"); | |
| 3002 } | |
| 3003 return new AnalysisNavigationParams(file, regions, targets, files); | |
| 3004 } else { | |
| 3005 throw jsonDecoder.mismatch(jsonPath, "analysis.navigation params", json); | |
| 3006 } | |
| 3007 } | |
| 3008 | |
| 3009 factory AnalysisNavigationParams.fromNotification(Notification notification) { | |
| 3010 return new AnalysisNavigationParams.fromJson( | |
| 3011 new ResponseDecoder(null), "params", notification._params); | |
| 3012 } | |
| 3013 | |
| 3014 Map<String, dynamic> toJson() { | |
| 3015 Map<String, dynamic> result = {}; | |
| 3016 result["file"] = file; | |
| 3017 result["regions"] = regions.map((NavigationRegion value) => value.toJson()).
toList(); | |
| 3018 result["targets"] = targets.map((NavigationTarget value) => value.toJson()).
toList(); | |
| 3019 result["files"] = files; | |
| 3020 return result; | |
| 3021 } | |
| 3022 | |
| 3023 Notification toNotification() { | |
| 3024 return new Notification("analysis.navigation", toJson()); | |
| 3025 } | |
| 3026 | |
| 3027 @override | |
| 3028 String toString() => JSON.encode(toJson()); | |
| 3029 | |
| 3030 @override | |
| 3031 bool operator==(other) { | |
| 3032 if (other is AnalysisNavigationParams) { | |
| 3033 return file == other.file && | |
| 3034 _listEqual(regions, other.regions, (NavigationRegion a, NavigationRegi
on b) => a == b) && | |
| 3035 _listEqual(targets, other.targets, (NavigationTarget a, NavigationTarg
et b) => a == b) && | |
| 3036 _listEqual(files, other.files, (String a, String b) => a == b); | |
| 3037 } | |
| 3038 return false; | |
| 3039 } | |
| 3040 | |
| 3041 @override | |
| 3042 int get hashCode { | |
| 3043 int hash = 0; | |
| 3044 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 3045 hash = _JenkinsSmiHash.combine(hash, regions.hashCode); | |
| 3046 hash = _JenkinsSmiHash.combine(hash, targets.hashCode); | |
| 3047 hash = _JenkinsSmiHash.combine(hash, files.hashCode); | |
| 3048 return _JenkinsSmiHash.finish(hash); | |
| 3049 } | |
| 3050 } | |
| 3051 | |
| 3052 /** | |
| 3053 * analysis.occurrences params | |
| 3054 * | |
| 3055 * { | |
| 3056 * "file": FilePath | |
| 3057 * "occurrences": List<Occurrences> | |
| 3058 * } | |
| 3059 */ | |
| 3060 class AnalysisOccurrencesParams implements HasToJson { | |
| 3061 String _file; | |
| 3062 | |
| 3063 List<Occurrences> _occurrences; | |
| 3064 | |
| 3065 /** | |
| 3066 * The file in which the references occur. | |
| 3067 */ | |
| 3068 String get file => _file; | |
| 3069 | |
| 3070 /** | |
| 3071 * The file in which the references occur. | |
| 3072 */ | |
| 3073 void set file(String value) { | |
| 3074 assert(value != null); | |
| 3075 this._file = value; | |
| 3076 } | |
| 3077 | |
| 3078 /** | |
| 3079 * The occurrences of references to elements within the file. | |
| 3080 */ | |
| 3081 List<Occurrences> get occurrences => _occurrences; | |
| 3082 | |
| 3083 /** | |
| 3084 * The occurrences of references to elements within the file. | |
| 3085 */ | |
| 3086 void set occurrences(List<Occurrences> value) { | |
| 3087 assert(value != null); | |
| 3088 this._occurrences = value; | |
| 3089 } | |
| 3090 | |
| 3091 AnalysisOccurrencesParams(String file, List<Occurrences> occurrences) { | |
| 3092 this.file = file; | |
| 3093 this.occurrences = occurrences; | |
| 3094 } | |
| 3095 | |
| 3096 factory AnalysisOccurrencesParams.fromJson(JsonDecoder jsonDecoder, String jso
nPath, Object json) { | |
| 3097 if (json == null) { | |
| 3098 json = {}; | |
| 3099 } | |
| 3100 if (json is Map) { | |
| 3101 String file; | |
| 3102 if (json.containsKey("file")) { | |
| 3103 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 3104 } else { | |
| 3105 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 3106 } | |
| 3107 List<Occurrences> occurrences; | |
| 3108 if (json.containsKey("occurrences")) { | |
| 3109 occurrences = jsonDecoder._decodeList(jsonPath + ".occurrences", json["o
ccurrences"], (String jsonPath, Object json) => new Occurrences.fromJson(jsonDec
oder, jsonPath, json)); | |
| 3110 } else { | |
| 3111 throw jsonDecoder.missingKey(jsonPath, "occurrences"); | |
| 3112 } | |
| 3113 return new AnalysisOccurrencesParams(file, occurrences); | |
| 3114 } else { | |
| 3115 throw jsonDecoder.mismatch(jsonPath, "analysis.occurrences params", json); | |
| 3116 } | |
| 3117 } | |
| 3118 | |
| 3119 factory AnalysisOccurrencesParams.fromNotification(Notification notification)
{ | |
| 3120 return new AnalysisOccurrencesParams.fromJson( | |
| 3121 new ResponseDecoder(null), "params", notification._params); | |
| 3122 } | |
| 3123 | |
| 3124 Map<String, dynamic> toJson() { | |
| 3125 Map<String, dynamic> result = {}; | |
| 3126 result["file"] = file; | |
| 3127 result["occurrences"] = occurrences.map((Occurrences value) => value.toJson(
)).toList(); | |
| 3128 return result; | |
| 3129 } | |
| 3130 | |
| 3131 Notification toNotification() { | |
| 3132 return new Notification("analysis.occurrences", toJson()); | |
| 3133 } | |
| 3134 | |
| 3135 @override | |
| 3136 String toString() => JSON.encode(toJson()); | |
| 3137 | |
| 3138 @override | |
| 3139 bool operator==(other) { | |
| 3140 if (other is AnalysisOccurrencesParams) { | |
| 3141 return file == other.file && | |
| 3142 _listEqual(occurrences, other.occurrences, (Occurrences a, Occurrences
b) => a == b); | |
| 3143 } | |
| 3144 return false; | |
| 3145 } | |
| 3146 | |
| 3147 @override | |
| 3148 int get hashCode { | |
| 3149 int hash = 0; | |
| 3150 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 3151 hash = _JenkinsSmiHash.combine(hash, occurrences.hashCode); | |
| 3152 return _JenkinsSmiHash.finish(hash); | |
| 3153 } | |
| 3154 } | |
| 3155 | |
| 3156 /** | |
| 3157 * analysis.outline params | |
| 3158 * | |
| 3159 * { | |
| 3160 * "file": FilePath | |
| 3161 * "kind": FileKind | |
| 3162 * "libraryName": optional String | |
| 3163 * "outline": Outline | |
| 3164 * } | |
| 3165 */ | |
| 3166 class AnalysisOutlineParams implements HasToJson { | |
| 3167 String _file; | |
| 3168 | |
| 3169 FileKind _kind; | |
| 3170 | |
| 3171 String _libraryName; | |
| 3172 | |
| 3173 Outline _outline; | |
| 3174 | |
| 3175 /** | |
| 3176 * The file with which the outline is associated. | |
| 3177 */ | |
| 3178 String get file => _file; | |
| 3179 | |
| 3180 /** | |
| 3181 * The file with which the outline is associated. | |
| 3182 */ | |
| 3183 void set file(String value) { | |
| 3184 assert(value != null); | |
| 3185 this._file = value; | |
| 3186 } | |
| 3187 | |
| 3188 /** | |
| 3189 * The kind of the file. | |
| 3190 */ | |
| 3191 FileKind get kind => _kind; | |
| 3192 | |
| 3193 /** | |
| 3194 * The kind of the file. | |
| 3195 */ | |
| 3196 void set kind(FileKind value) { | |
| 3197 assert(value != null); | |
| 3198 this._kind = value; | |
| 3199 } | |
| 3200 | |
| 3201 /** | |
| 3202 * The name of the library defined by the file using a "library" directive, | |
| 3203 * or referenced by a "part of" directive. If both "library" and "part of" | |
| 3204 * directives are present, then the "library" directive takes precedence. | |
| 3205 * This field will be omitted if the file has neither "library" nor "part of" | |
| 3206 * directives. | |
| 3207 */ | |
| 3208 String get libraryName => _libraryName; | |
| 3209 | |
| 3210 /** | |
| 3211 * The name of the library defined by the file using a "library" directive, | |
| 3212 * or referenced by a "part of" directive. If both "library" and "part of" | |
| 3213 * directives are present, then the "library" directive takes precedence. | |
| 3214 * This field will be omitted if the file has neither "library" nor "part of" | |
| 3215 * directives. | |
| 3216 */ | |
| 3217 void set libraryName(String value) { | |
| 3218 this._libraryName = value; | |
| 3219 } | |
| 3220 | |
| 3221 /** | |
| 3222 * The outline associated with the file. | |
| 3223 */ | |
| 3224 Outline get outline => _outline; | |
| 3225 | |
| 3226 /** | |
| 3227 * The outline associated with the file. | |
| 3228 */ | |
| 3229 void set outline(Outline value) { | |
| 3230 assert(value != null); | |
| 3231 this._outline = value; | |
| 3232 } | |
| 3233 | |
| 3234 AnalysisOutlineParams(String file, FileKind kind, Outline outline, {String lib
raryName}) { | |
| 3235 this.file = file; | |
| 3236 this.kind = kind; | |
| 3237 this.libraryName = libraryName; | |
| 3238 this.outline = outline; | |
| 3239 } | |
| 3240 | |
| 3241 factory AnalysisOutlineParams.fromJson(JsonDecoder jsonDecoder, String jsonPat
h, Object json) { | |
| 3242 if (json == null) { | |
| 3243 json = {}; | |
| 3244 } | |
| 3245 if (json is Map) { | |
| 3246 String file; | |
| 3247 if (json.containsKey("file")) { | |
| 3248 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 3249 } else { | |
| 3250 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 3251 } | |
| 3252 FileKind kind; | |
| 3253 if (json.containsKey("kind")) { | |
| 3254 kind = new FileKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind
"]); | |
| 3255 } else { | |
| 3256 throw jsonDecoder.missingKey(jsonPath, "kind"); | |
| 3257 } | |
| 3258 String libraryName; | |
| 3259 if (json.containsKey("libraryName")) { | |
| 3260 libraryName = jsonDecoder._decodeString(jsonPath + ".libraryName", json[
"libraryName"]); | |
| 3261 } | |
| 3262 Outline outline; | |
| 3263 if (json.containsKey("outline")) { | |
| 3264 outline = new Outline.fromJson(jsonDecoder, jsonPath + ".outline", json[
"outline"]); | |
| 3265 } else { | |
| 3266 throw jsonDecoder.missingKey(jsonPath, "outline"); | |
| 3267 } | |
| 3268 return new AnalysisOutlineParams(file, kind, outline, libraryName: library
Name); | |
| 3269 } else { | |
| 3270 throw jsonDecoder.mismatch(jsonPath, "analysis.outline params", json); | |
| 3271 } | |
| 3272 } | |
| 3273 | |
| 3274 factory AnalysisOutlineParams.fromNotification(Notification notification) { | |
| 3275 return new AnalysisOutlineParams.fromJson( | |
| 3276 new ResponseDecoder(null), "params", notification._params); | |
| 3277 } | |
| 3278 | |
| 3279 Map<String, dynamic> toJson() { | |
| 3280 Map<String, dynamic> result = {}; | |
| 3281 result["file"] = file; | |
| 3282 result["kind"] = kind.toJson(); | |
| 3283 if (libraryName != null) { | |
| 3284 result["libraryName"] = libraryName; | |
| 3285 } | |
| 3286 result["outline"] = outline.toJson(); | |
| 3287 return result; | |
| 3288 } | |
| 3289 | |
| 3290 Notification toNotification() { | |
| 3291 return new Notification("analysis.outline", toJson()); | |
| 3292 } | |
| 3293 | |
| 3294 @override | |
| 3295 String toString() => JSON.encode(toJson()); | |
| 3296 | |
| 3297 @override | |
| 3298 bool operator==(other) { | |
| 3299 if (other is AnalysisOutlineParams) { | |
| 3300 return file == other.file && | |
| 3301 kind == other.kind && | |
| 3302 libraryName == other.libraryName && | |
| 3303 outline == other.outline; | |
| 3304 } | |
| 3305 return false; | |
| 3306 } | |
| 3307 | |
| 3308 @override | |
| 3309 int get hashCode { | |
| 3310 int hash = 0; | |
| 3311 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 3312 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); | |
| 3313 hash = _JenkinsSmiHash.combine(hash, libraryName.hashCode); | |
| 3314 hash = _JenkinsSmiHash.combine(hash, outline.hashCode); | |
| 3315 return _JenkinsSmiHash.finish(hash); | |
| 3316 } | |
| 3317 } | |
| 3318 | |
| 3319 /** | |
| 3320 * analysis.overrides params | |
| 3321 * | |
| 3322 * { | |
| 3323 * "file": FilePath | |
| 3324 * "overrides": List<Override> | |
| 3325 * } | |
| 3326 */ | |
| 3327 class AnalysisOverridesParams implements HasToJson { | |
| 3328 String _file; | |
| 3329 | |
| 3330 List<Override> _overrides; | |
| 3331 | |
| 3332 /** | |
| 3333 * The file with which the overrides are associated. | |
| 3334 */ | |
| 3335 String get file => _file; | |
| 3336 | |
| 3337 /** | |
| 3338 * The file with which the overrides are associated. | |
| 3339 */ | |
| 3340 void set file(String value) { | |
| 3341 assert(value != null); | |
| 3342 this._file = value; | |
| 3343 } | |
| 3344 | |
| 3345 /** | |
| 3346 * The overrides associated with the file. | |
| 3347 */ | |
| 3348 List<Override> get overrides => _overrides; | |
| 3349 | |
| 3350 /** | |
| 3351 * The overrides associated with the file. | |
| 3352 */ | |
| 3353 void set overrides(List<Override> value) { | |
| 3354 assert(value != null); | |
| 3355 this._overrides = value; | |
| 3356 } | |
| 3357 | |
| 3358 AnalysisOverridesParams(String file, List<Override> overrides) { | |
| 3359 this.file = file; | |
| 3360 this.overrides = overrides; | |
| 3361 } | |
| 3362 | |
| 3363 factory AnalysisOverridesParams.fromJson(JsonDecoder jsonDecoder, String jsonP
ath, Object json) { | |
| 3364 if (json == null) { | |
| 3365 json = {}; | |
| 3366 } | |
| 3367 if (json is Map) { | |
| 3368 String file; | |
| 3369 if (json.containsKey("file")) { | |
| 3370 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 3371 } else { | |
| 3372 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 3373 } | |
| 3374 List<Override> overrides; | |
| 3375 if (json.containsKey("overrides")) { | |
| 3376 overrides = jsonDecoder._decodeList(jsonPath + ".overrides", json["overr
ides"], (String jsonPath, Object json) => new Override.fromJson(jsonDecoder, jso
nPath, json)); | |
| 3377 } else { | |
| 3378 throw jsonDecoder.missingKey(jsonPath, "overrides"); | |
| 3379 } | |
| 3380 return new AnalysisOverridesParams(file, overrides); | |
| 3381 } else { | |
| 3382 throw jsonDecoder.mismatch(jsonPath, "analysis.overrides params", json); | |
| 3383 } | |
| 3384 } | |
| 3385 | |
| 3386 factory AnalysisOverridesParams.fromNotification(Notification notification) { | |
| 3387 return new AnalysisOverridesParams.fromJson( | |
| 3388 new ResponseDecoder(null), "params", notification._params); | |
| 3389 } | |
| 3390 | |
| 3391 Map<String, dynamic> toJson() { | |
| 3392 Map<String, dynamic> result = {}; | |
| 3393 result["file"] = file; | |
| 3394 result["overrides"] = overrides.map((Override value) => value.toJson()).toLi
st(); | |
| 3395 return result; | |
| 3396 } | |
| 3397 | |
| 3398 Notification toNotification() { | |
| 3399 return new Notification("analysis.overrides", toJson()); | |
| 3400 } | |
| 3401 | |
| 3402 @override | |
| 3403 String toString() => JSON.encode(toJson()); | |
| 3404 | |
| 3405 @override | |
| 3406 bool operator==(other) { | |
| 3407 if (other is AnalysisOverridesParams) { | |
| 3408 return file == other.file && | |
| 3409 _listEqual(overrides, other.overrides, (Override a, Override b) => a =
= b); | |
| 3410 } | |
| 3411 return false; | |
| 3412 } | |
| 3413 | |
| 3414 @override | |
| 3415 int get hashCode { | |
| 3416 int hash = 0; | |
| 3417 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 3418 hash = _JenkinsSmiHash.combine(hash, overrides.hashCode); | |
| 3419 return _JenkinsSmiHash.finish(hash); | |
| 3420 } | |
| 3421 } | |
| 3422 | |
| 3423 /** | |
| 3424 * completion.getSuggestions params | |
| 3425 * | |
| 3426 * { | |
| 3427 * "file": FilePath | |
| 3428 * "offset": int | |
| 3429 * } | |
| 3430 */ | |
| 3431 class CompletionGetSuggestionsParams implements HasToJson { | |
| 3432 String _file; | |
| 3433 | |
| 3434 int _offset; | |
| 3435 | |
| 3436 /** | |
| 3437 * The file containing the point at which suggestions are to be made. | |
| 3438 */ | |
| 3439 String get file => _file; | |
| 3440 | |
| 3441 /** | |
| 3442 * The file containing the point at which suggestions are to be made. | |
| 3443 */ | |
| 3444 void set file(String value) { | |
| 3445 assert(value != null); | |
| 3446 this._file = value; | |
| 3447 } | |
| 3448 | |
| 3449 /** | |
| 3450 * The offset within the file at which suggestions are to be made. | |
| 3451 */ | |
| 3452 int get offset => _offset; | |
| 3453 | |
| 3454 /** | |
| 3455 * The offset within the file at which suggestions are to be made. | |
| 3456 */ | |
| 3457 void set offset(int value) { | |
| 3458 assert(value != null); | |
| 3459 this._offset = value; | |
| 3460 } | |
| 3461 | |
| 3462 CompletionGetSuggestionsParams(String file, int offset) { | |
| 3463 this.file = file; | |
| 3464 this.offset = offset; | |
| 3465 } | |
| 3466 | |
| 3467 factory CompletionGetSuggestionsParams.fromJson(JsonDecoder jsonDecoder, Strin
g jsonPath, Object json) { | |
| 3468 if (json == null) { | |
| 3469 json = {}; | |
| 3470 } | |
| 3471 if (json is Map) { | |
| 3472 String file; | |
| 3473 if (json.containsKey("file")) { | |
| 3474 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 3475 } else { | |
| 3476 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 3477 } | |
| 3478 int offset; | |
| 3479 if (json.containsKey("offset")) { | |
| 3480 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 3481 } else { | |
| 3482 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 3483 } | |
| 3484 return new CompletionGetSuggestionsParams(file, offset); | |
| 3485 } else { | |
| 3486 throw jsonDecoder.mismatch(jsonPath, "completion.getSuggestions params", j
son); | |
| 3487 } | |
| 3488 } | |
| 3489 | |
| 3490 factory CompletionGetSuggestionsParams.fromRequest(Request request) { | |
| 3491 return new CompletionGetSuggestionsParams.fromJson( | |
| 3492 new RequestDecoder(request), "params", request._params); | |
| 3493 } | |
| 3494 | |
| 3495 Map<String, dynamic> toJson() { | |
| 3496 Map<String, dynamic> result = {}; | |
| 3497 result["file"] = file; | |
| 3498 result["offset"] = offset; | |
| 3499 return result; | |
| 3500 } | |
| 3501 | |
| 3502 Request toRequest(String id) { | |
| 3503 return new Request(id, "completion.getSuggestions", toJson()); | |
| 3504 } | |
| 3505 | |
| 3506 @override | |
| 3507 String toString() => JSON.encode(toJson()); | |
| 3508 | |
| 3509 @override | |
| 3510 bool operator==(other) { | |
| 3511 if (other is CompletionGetSuggestionsParams) { | |
| 3512 return file == other.file && | |
| 3513 offset == other.offset; | |
| 3514 } | |
| 3515 return false; | |
| 3516 } | |
| 3517 | |
| 3518 @override | |
| 3519 int get hashCode { | |
| 3520 int hash = 0; | |
| 3521 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 3522 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 3523 return _JenkinsSmiHash.finish(hash); | |
| 3524 } | |
| 3525 } | |
| 3526 | |
| 3527 /** | |
| 3528 * completion.getSuggestions result | |
| 3529 * | |
| 3530 * { | |
| 3531 * "id": CompletionId | |
| 3532 * } | |
| 3533 */ | |
| 3534 class CompletionGetSuggestionsResult implements HasToJson { | |
| 3535 String _id; | |
| 3536 | |
| 3537 /** | |
| 3538 * The identifier used to associate results with this completion request. | |
| 3539 */ | |
| 3540 String get id => _id; | |
| 3541 | |
| 3542 /** | |
| 3543 * The identifier used to associate results with this completion request. | |
| 3544 */ | |
| 3545 void set id(String value) { | |
| 3546 assert(value != null); | |
| 3547 this._id = value; | |
| 3548 } | |
| 3549 | |
| 3550 CompletionGetSuggestionsResult(String id) { | |
| 3551 this.id = id; | |
| 3552 } | |
| 3553 | |
| 3554 factory CompletionGetSuggestionsResult.fromJson(JsonDecoder jsonDecoder, Strin
g jsonPath, Object json) { | |
| 3555 if (json == null) { | |
| 3556 json = {}; | |
| 3557 } | |
| 3558 if (json is Map) { | |
| 3559 String id; | |
| 3560 if (json.containsKey("id")) { | |
| 3561 id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]); | |
| 3562 } else { | |
| 3563 throw jsonDecoder.missingKey(jsonPath, "id"); | |
| 3564 } | |
| 3565 return new CompletionGetSuggestionsResult(id); | |
| 3566 } else { | |
| 3567 throw jsonDecoder.mismatch(jsonPath, "completion.getSuggestions result", j
son); | |
| 3568 } | |
| 3569 } | |
| 3570 | |
| 3571 factory CompletionGetSuggestionsResult.fromResponse(Response response) { | |
| 3572 return new CompletionGetSuggestionsResult.fromJson( | |
| 3573 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); | |
| 3574 } | |
| 3575 | |
| 3576 Map<String, dynamic> toJson() { | |
| 3577 Map<String, dynamic> result = {}; | |
| 3578 result["id"] = id; | |
| 3579 return result; | |
| 3580 } | |
| 3581 | |
| 3582 Response toResponse(String id) { | |
| 3583 return new Response(id, result: toJson()); | |
| 3584 } | |
| 3585 | |
| 3586 @override | |
| 3587 String toString() => JSON.encode(toJson()); | |
| 3588 | |
| 3589 @override | |
| 3590 bool operator==(other) { | |
| 3591 if (other is CompletionGetSuggestionsResult) { | |
| 3592 return id == other.id; | |
| 3593 } | |
| 3594 return false; | |
| 3595 } | |
| 3596 | |
| 3597 @override | |
| 3598 int get hashCode { | |
| 3599 int hash = 0; | |
| 3600 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
| 3601 return _JenkinsSmiHash.finish(hash); | |
| 3602 } | |
| 3603 } | |
| 3604 | |
| 3605 /** | |
| 3606 * completion.results params | |
| 3607 * | |
| 3608 * { | |
| 3609 * "id": CompletionId | |
| 3610 * "replacementOffset": int | |
| 3611 * "replacementLength": int | |
| 3612 * "results": List<CompletionSuggestion> | |
| 3613 * "isLast": bool | |
| 3614 * } | |
| 3615 */ | |
| 3616 class CompletionResultsParams implements HasToJson { | |
| 3617 String _id; | |
| 3618 | |
| 3619 int _replacementOffset; | |
| 3620 | |
| 3621 int _replacementLength; | |
| 3622 | |
| 3623 List<CompletionSuggestion> _results; | |
| 3624 | |
| 3625 bool _isLast; | |
| 3626 | |
| 3627 /** | |
| 3628 * The id associated with the completion. | |
| 3629 */ | |
| 3630 String get id => _id; | |
| 3631 | |
| 3632 /** | |
| 3633 * The id associated with the completion. | |
| 3634 */ | |
| 3635 void set id(String value) { | |
| 3636 assert(value != null); | |
| 3637 this._id = value; | |
| 3638 } | |
| 3639 | |
| 3640 /** | |
| 3641 * The offset of the start of the text to be replaced. This will be different | |
| 3642 * than the offset used to request the completion suggestions if there was a | |
| 3643 * portion of an identifier before the original offset. In particular, the | |
| 3644 * replacementOffset will be the offset of the beginning of said identifier. | |
| 3645 */ | |
| 3646 int get replacementOffset => _replacementOffset; | |
| 3647 | |
| 3648 /** | |
| 3649 * The offset of the start of the text to be replaced. This will be different | |
| 3650 * than the offset used to request the completion suggestions if there was a | |
| 3651 * portion of an identifier before the original offset. In particular, the | |
| 3652 * replacementOffset will be the offset of the beginning of said identifier. | |
| 3653 */ | |
| 3654 void set replacementOffset(int value) { | |
| 3655 assert(value != null); | |
| 3656 this._replacementOffset = value; | |
| 3657 } | |
| 3658 | |
| 3659 /** | |
| 3660 * The length of the text to be replaced if the remainder of the identifier | |
| 3661 * containing the cursor is to be replaced when the suggestion is applied | |
| 3662 * (that is, the number of characters in the existing identifier). | |
| 3663 */ | |
| 3664 int get replacementLength => _replacementLength; | |
| 3665 | |
| 3666 /** | |
| 3667 * The length of the text to be replaced if the remainder of the identifier | |
| 3668 * containing the cursor is to be replaced when the suggestion is applied | |
| 3669 * (that is, the number of characters in the existing identifier). | |
| 3670 */ | |
| 3671 void set replacementLength(int value) { | |
| 3672 assert(value != null); | |
| 3673 this._replacementLength = value; | |
| 3674 } | |
| 3675 | |
| 3676 /** | |
| 3677 * The completion suggestions being reported. The notification contains all | |
| 3678 * possible completions at the requested cursor position, even those that do | |
| 3679 * not match the characters the user has already typed. This allows the | |
| 3680 * client to respond to further keystrokes from the user without having to | |
| 3681 * make additional requests. | |
| 3682 */ | |
| 3683 List<CompletionSuggestion> get results => _results; | |
| 3684 | |
| 3685 /** | |
| 3686 * The completion suggestions being reported. The notification contains all | |
| 3687 * possible completions at the requested cursor position, even those that do | |
| 3688 * not match the characters the user has already typed. This allows the | |
| 3689 * client to respond to further keystrokes from the user without having to | |
| 3690 * make additional requests. | |
| 3691 */ | |
| 3692 void set results(List<CompletionSuggestion> value) { | |
| 3693 assert(value != null); | |
| 3694 this._results = value; | |
| 3695 } | |
| 3696 | |
| 3697 /** | |
| 3698 * True if this is that last set of results that will be returned for the | |
| 3699 * indicated completion. | |
| 3700 */ | |
| 3701 bool get isLast => _isLast; | |
| 3702 | |
| 3703 /** | |
| 3704 * True if this is that last set of results that will be returned for the | |
| 3705 * indicated completion. | |
| 3706 */ | |
| 3707 void set isLast(bool value) { | |
| 3708 assert(value != null); | |
| 3709 this._isLast = value; | |
| 3710 } | |
| 3711 | |
| 3712 CompletionResultsParams(String id, int replacementOffset, int replacementLengt
h, List<CompletionSuggestion> results, bool isLast) { | |
| 3713 this.id = id; | |
| 3714 this.replacementOffset = replacementOffset; | |
| 3715 this.replacementLength = replacementLength; | |
| 3716 this.results = results; | |
| 3717 this.isLast = isLast; | |
| 3718 } | |
| 3719 | |
| 3720 factory CompletionResultsParams.fromJson(JsonDecoder jsonDecoder, String jsonP
ath, Object json) { | |
| 3721 if (json == null) { | |
| 3722 json = {}; | |
| 3723 } | |
| 3724 if (json is Map) { | |
| 3725 String id; | |
| 3726 if (json.containsKey("id")) { | |
| 3727 id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]); | |
| 3728 } else { | |
| 3729 throw jsonDecoder.missingKey(jsonPath, "id"); | |
| 3730 } | |
| 3731 int replacementOffset; | |
| 3732 if (json.containsKey("replacementOffset")) { | |
| 3733 replacementOffset = jsonDecoder._decodeInt(jsonPath + ".replacementOffse
t", json["replacementOffset"]); | |
| 3734 } else { | |
| 3735 throw jsonDecoder.missingKey(jsonPath, "replacementOffset"); | |
| 3736 } | |
| 3737 int replacementLength; | |
| 3738 if (json.containsKey("replacementLength")) { | |
| 3739 replacementLength = jsonDecoder._decodeInt(jsonPath + ".replacementLengt
h", json["replacementLength"]); | |
| 3740 } else { | |
| 3741 throw jsonDecoder.missingKey(jsonPath, "replacementLength"); | |
| 3742 } | |
| 3743 List<CompletionSuggestion> results; | |
| 3744 if (json.containsKey("results")) { | |
| 3745 results = jsonDecoder._decodeList(jsonPath + ".results", json["results"]
, (String jsonPath, Object json) => new CompletionSuggestion.fromJson(jsonDecode
r, jsonPath, json)); | |
| 3746 } else { | |
| 3747 throw jsonDecoder.missingKey(jsonPath, "results"); | |
| 3748 } | |
| 3749 bool isLast; | |
| 3750 if (json.containsKey("isLast")) { | |
| 3751 isLast = jsonDecoder._decodeBool(jsonPath + ".isLast", json["isLast"]); | |
| 3752 } else { | |
| 3753 throw jsonDecoder.missingKey(jsonPath, "isLast"); | |
| 3754 } | |
| 3755 return new CompletionResultsParams(id, replacementOffset, replacementLengt
h, results, isLast); | |
| 3756 } else { | |
| 3757 throw jsonDecoder.mismatch(jsonPath, "completion.results params", json); | |
| 3758 } | |
| 3759 } | |
| 3760 | |
| 3761 factory CompletionResultsParams.fromNotification(Notification notification) { | |
| 3762 return new CompletionResultsParams.fromJson( | |
| 3763 new ResponseDecoder(null), "params", notification._params); | |
| 3764 } | |
| 3765 | |
| 3766 Map<String, dynamic> toJson() { | |
| 3767 Map<String, dynamic> result = {}; | |
| 3768 result["id"] = id; | |
| 3769 result["replacementOffset"] = replacementOffset; | |
| 3770 result["replacementLength"] = replacementLength; | |
| 3771 result["results"] = results.map((CompletionSuggestion value) => value.toJson
()).toList(); | |
| 3772 result["isLast"] = isLast; | |
| 3773 return result; | |
| 3774 } | |
| 3775 | |
| 3776 Notification toNotification() { | |
| 3777 return new Notification("completion.results", toJson()); | |
| 3778 } | |
| 3779 | |
| 3780 @override | |
| 3781 String toString() => JSON.encode(toJson()); | |
| 3782 | |
| 3783 @override | |
| 3784 bool operator==(other) { | |
| 3785 if (other is CompletionResultsParams) { | |
| 3786 return id == other.id && | |
| 3787 replacementOffset == other.replacementOffset && | |
| 3788 replacementLength == other.replacementLength && | |
| 3789 _listEqual(results, other.results, (CompletionSuggestion a, Completion
Suggestion b) => a == b) && | |
| 3790 isLast == other.isLast; | |
| 3791 } | |
| 3792 return false; | |
| 3793 } | |
| 3794 | |
| 3795 @override | |
| 3796 int get hashCode { | |
| 3797 int hash = 0; | |
| 3798 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
| 3799 hash = _JenkinsSmiHash.combine(hash, replacementOffset.hashCode); | |
| 3800 hash = _JenkinsSmiHash.combine(hash, replacementLength.hashCode); | |
| 3801 hash = _JenkinsSmiHash.combine(hash, results.hashCode); | |
| 3802 hash = _JenkinsSmiHash.combine(hash, isLast.hashCode); | |
| 3803 return _JenkinsSmiHash.finish(hash); | |
| 3804 } | |
| 3805 } | |
| 3806 | |
| 3807 /** | |
| 3808 * search.findElementReferences params | |
| 3809 * | |
| 3810 * { | |
| 3811 * "file": FilePath | |
| 3812 * "offset": int | |
| 3813 * "includePotential": bool | |
| 3814 * } | |
| 3815 */ | |
| 3816 class SearchFindElementReferencesParams implements HasToJson { | |
| 3817 String _file; | |
| 3818 | |
| 3819 int _offset; | |
| 3820 | |
| 3821 bool _includePotential; | |
| 3822 | |
| 3823 /** | |
| 3824 * The file containing the declaration of or reference to the element used to | |
| 3825 * define the search. | |
| 3826 */ | |
| 3827 String get file => _file; | |
| 3828 | |
| 3829 /** | |
| 3830 * The file containing the declaration of or reference to the element used to | |
| 3831 * define the search. | |
| 3832 */ | |
| 3833 void set file(String value) { | |
| 3834 assert(value != null); | |
| 3835 this._file = value; | |
| 3836 } | |
| 3837 | |
| 3838 /** | |
| 3839 * The offset within the file of the declaration of or reference to the | |
| 3840 * element. | |
| 3841 */ | |
| 3842 int get offset => _offset; | |
| 3843 | |
| 3844 /** | |
| 3845 * The offset within the file of the declaration of or reference to the | |
| 3846 * element. | |
| 3847 */ | |
| 3848 void set offset(int value) { | |
| 3849 assert(value != null); | |
| 3850 this._offset = value; | |
| 3851 } | |
| 3852 | |
| 3853 /** | |
| 3854 * True if potential matches are to be included in the results. | |
| 3855 */ | |
| 3856 bool get includePotential => _includePotential; | |
| 3857 | |
| 3858 /** | |
| 3859 * True if potential matches are to be included in the results. | |
| 3860 */ | |
| 3861 void set includePotential(bool value) { | |
| 3862 assert(value != null); | |
| 3863 this._includePotential = value; | |
| 3864 } | |
| 3865 | |
| 3866 SearchFindElementReferencesParams(String file, int offset, bool includePotenti
al) { | |
| 3867 this.file = file; | |
| 3868 this.offset = offset; | |
| 3869 this.includePotential = includePotential; | |
| 3870 } | |
| 3871 | |
| 3872 factory SearchFindElementReferencesParams.fromJson(JsonDecoder jsonDecoder, St
ring jsonPath, Object json) { | |
| 3873 if (json == null) { | |
| 3874 json = {}; | |
| 3875 } | |
| 3876 if (json is Map) { | |
| 3877 String file; | |
| 3878 if (json.containsKey("file")) { | |
| 3879 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 3880 } else { | |
| 3881 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 3882 } | |
| 3883 int offset; | |
| 3884 if (json.containsKey("offset")) { | |
| 3885 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 3886 } else { | |
| 3887 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 3888 } | |
| 3889 bool includePotential; | |
| 3890 if (json.containsKey("includePotential")) { | |
| 3891 includePotential = jsonDecoder._decodeBool(jsonPath + ".includePotential
", json["includePotential"]); | |
| 3892 } else { | |
| 3893 throw jsonDecoder.missingKey(jsonPath, "includePotential"); | |
| 3894 } | |
| 3895 return new SearchFindElementReferencesParams(file, offset, includePotentia
l); | |
| 3896 } else { | |
| 3897 throw jsonDecoder.mismatch(jsonPath, "search.findElementReferences params"
, json); | |
| 3898 } | |
| 3899 } | |
| 3900 | |
| 3901 factory SearchFindElementReferencesParams.fromRequest(Request request) { | |
| 3902 return new SearchFindElementReferencesParams.fromJson( | |
| 3903 new RequestDecoder(request), "params", request._params); | |
| 3904 } | |
| 3905 | |
| 3906 Map<String, dynamic> toJson() { | |
| 3907 Map<String, dynamic> result = {}; | |
| 3908 result["file"] = file; | |
| 3909 result["offset"] = offset; | |
| 3910 result["includePotential"] = includePotential; | |
| 3911 return result; | |
| 3912 } | |
| 3913 | |
| 3914 Request toRequest(String id) { | |
| 3915 return new Request(id, "search.findElementReferences", toJson()); | |
| 3916 } | |
| 3917 | |
| 3918 @override | |
| 3919 String toString() => JSON.encode(toJson()); | |
| 3920 | |
| 3921 @override | |
| 3922 bool operator==(other) { | |
| 3923 if (other is SearchFindElementReferencesParams) { | |
| 3924 return file == other.file && | |
| 3925 offset == other.offset && | |
| 3926 includePotential == other.includePotential; | |
| 3927 } | |
| 3928 return false; | |
| 3929 } | |
| 3930 | |
| 3931 @override | |
| 3932 int get hashCode { | |
| 3933 int hash = 0; | |
| 3934 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 3935 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 3936 hash = _JenkinsSmiHash.combine(hash, includePotential.hashCode); | |
| 3937 return _JenkinsSmiHash.finish(hash); | |
| 3938 } | |
| 3939 } | |
| 3940 | |
| 3941 /** | |
| 3942 * search.findElementReferences result | |
| 3943 * | |
| 3944 * { | |
| 3945 * "id": optional SearchId | |
| 3946 * "element": optional Element | |
| 3947 * } | |
| 3948 */ | |
| 3949 class SearchFindElementReferencesResult implements HasToJson { | |
| 3950 String _id; | |
| 3951 | |
| 3952 Element _element; | |
| 3953 | |
| 3954 /** | |
| 3955 * The identifier used to associate results with this search request. | |
| 3956 * | |
| 3957 * If no element was found at the given location, this field will be absent, | |
| 3958 * and no results will be reported via the search.results notification. | |
| 3959 */ | |
| 3960 String get id => _id; | |
| 3961 | |
| 3962 /** | |
| 3963 * The identifier used to associate results with this search request. | |
| 3964 * | |
| 3965 * If no element was found at the given location, this field will be absent, | |
| 3966 * and no results will be reported via the search.results notification. | |
| 3967 */ | |
| 3968 void set id(String value) { | |
| 3969 this._id = value; | |
| 3970 } | |
| 3971 | |
| 3972 /** | |
| 3973 * The element referenced or defined at the given offset and whose references | |
| 3974 * will be returned in the search results. | |
| 3975 * | |
| 3976 * If no element was found at the given location, this field will be absent. | |
| 3977 */ | |
| 3978 Element get element => _element; | |
| 3979 | |
| 3980 /** | |
| 3981 * The element referenced or defined at the given offset and whose references | |
| 3982 * will be returned in the search results. | |
| 3983 * | |
| 3984 * If no element was found at the given location, this field will be absent. | |
| 3985 */ | |
| 3986 void set element(Element value) { | |
| 3987 this._element = value; | |
| 3988 } | |
| 3989 | |
| 3990 SearchFindElementReferencesResult({String id, Element element}) { | |
| 3991 this.id = id; | |
| 3992 this.element = element; | |
| 3993 } | |
| 3994 | |
| 3995 factory SearchFindElementReferencesResult.fromJson(JsonDecoder jsonDecoder, St
ring jsonPath, Object json) { | |
| 3996 if (json == null) { | |
| 3997 json = {}; | |
| 3998 } | |
| 3999 if (json is Map) { | |
| 4000 String id; | |
| 4001 if (json.containsKey("id")) { | |
| 4002 id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]); | |
| 4003 } | |
| 4004 Element element; | |
| 4005 if (json.containsKey("element")) { | |
| 4006 element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json[
"element"]); | |
| 4007 } | |
| 4008 return new SearchFindElementReferencesResult(id: id, element: element); | |
| 4009 } else { | |
| 4010 throw jsonDecoder.mismatch(jsonPath, "search.findElementReferences result"
, json); | |
| 4011 } | |
| 4012 } | |
| 4013 | |
| 4014 factory SearchFindElementReferencesResult.fromResponse(Response response) { | |
| 4015 return new SearchFindElementReferencesResult.fromJson( | |
| 4016 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); | |
| 4017 } | |
| 4018 | |
| 4019 Map<String, dynamic> toJson() { | |
| 4020 Map<String, dynamic> result = {}; | |
| 4021 if (id != null) { | |
| 4022 result["id"] = id; | |
| 4023 } | |
| 4024 if (element != null) { | |
| 4025 result["element"] = element.toJson(); | |
| 4026 } | |
| 4027 return result; | |
| 4028 } | |
| 4029 | |
| 4030 Response toResponse(String id) { | |
| 4031 return new Response(id, result: toJson()); | |
| 4032 } | |
| 4033 | |
| 4034 @override | |
| 4035 String toString() => JSON.encode(toJson()); | |
| 4036 | |
| 4037 @override | |
| 4038 bool operator==(other) { | |
| 4039 if (other is SearchFindElementReferencesResult) { | |
| 4040 return id == other.id && | |
| 4041 element == other.element; | |
| 4042 } | |
| 4043 return false; | |
| 4044 } | |
| 4045 | |
| 4046 @override | |
| 4047 int get hashCode { | |
| 4048 int hash = 0; | |
| 4049 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
| 4050 hash = _JenkinsSmiHash.combine(hash, element.hashCode); | |
| 4051 return _JenkinsSmiHash.finish(hash); | |
| 4052 } | |
| 4053 } | |
| 4054 | |
| 4055 /** | |
| 4056 * search.findMemberDeclarations params | |
| 4057 * | |
| 4058 * { | |
| 4059 * "name": String | |
| 4060 * } | |
| 4061 */ | |
| 4062 class SearchFindMemberDeclarationsParams implements HasToJson { | |
| 4063 String _name; | |
| 4064 | |
| 4065 /** | |
| 4066 * The name of the declarations to be found. | |
| 4067 */ | |
| 4068 String get name => _name; | |
| 4069 | |
| 4070 /** | |
| 4071 * The name of the declarations to be found. | |
| 4072 */ | |
| 4073 void set name(String value) { | |
| 4074 assert(value != null); | |
| 4075 this._name = value; | |
| 4076 } | |
| 4077 | |
| 4078 SearchFindMemberDeclarationsParams(String name) { | |
| 4079 this.name = name; | |
| 4080 } | |
| 4081 | |
| 4082 factory SearchFindMemberDeclarationsParams.fromJson(JsonDecoder jsonDecoder, S
tring jsonPath, Object json) { | |
| 4083 if (json == null) { | |
| 4084 json = {}; | |
| 4085 } | |
| 4086 if (json is Map) { | |
| 4087 String name; | |
| 4088 if (json.containsKey("name")) { | |
| 4089 name = jsonDecoder._decodeString(jsonPath + ".name", json["name"]); | |
| 4090 } else { | |
| 4091 throw jsonDecoder.missingKey(jsonPath, "name"); | |
| 4092 } | |
| 4093 return new SearchFindMemberDeclarationsParams(name); | |
| 4094 } else { | |
| 4095 throw jsonDecoder.mismatch(jsonPath, "search.findMemberDeclarations params
", json); | |
| 4096 } | |
| 4097 } | |
| 4098 | |
| 4099 factory SearchFindMemberDeclarationsParams.fromRequest(Request request) { | |
| 4100 return new SearchFindMemberDeclarationsParams.fromJson( | |
| 4101 new RequestDecoder(request), "params", request._params); | |
| 4102 } | |
| 4103 | |
| 4104 Map<String, dynamic> toJson() { | |
| 4105 Map<String, dynamic> result = {}; | |
| 4106 result["name"] = name; | |
| 4107 return result; | |
| 4108 } | |
| 4109 | |
| 4110 Request toRequest(String id) { | |
| 4111 return new Request(id, "search.findMemberDeclarations", toJson()); | |
| 4112 } | |
| 4113 | |
| 4114 @override | |
| 4115 String toString() => JSON.encode(toJson()); | |
| 4116 | |
| 4117 @override | |
| 4118 bool operator==(other) { | |
| 4119 if (other is SearchFindMemberDeclarationsParams) { | |
| 4120 return name == other.name; | |
| 4121 } | |
| 4122 return false; | |
| 4123 } | |
| 4124 | |
| 4125 @override | |
| 4126 int get hashCode { | |
| 4127 int hash = 0; | |
| 4128 hash = _JenkinsSmiHash.combine(hash, name.hashCode); | |
| 4129 return _JenkinsSmiHash.finish(hash); | |
| 4130 } | |
| 4131 } | |
| 4132 | |
| 4133 /** | |
| 4134 * search.findMemberDeclarations result | |
| 4135 * | |
| 4136 * { | |
| 4137 * "id": SearchId | |
| 4138 * } | |
| 4139 */ | |
| 4140 class SearchFindMemberDeclarationsResult implements HasToJson { | |
| 4141 String _id; | |
| 4142 | |
| 4143 /** | |
| 4144 * The identifier used to associate results with this search request. | |
| 4145 */ | |
| 4146 String get id => _id; | |
| 4147 | |
| 4148 /** | |
| 4149 * The identifier used to associate results with this search request. | |
| 4150 */ | |
| 4151 void set id(String value) { | |
| 4152 assert(value != null); | |
| 4153 this._id = value; | |
| 4154 } | |
| 4155 | |
| 4156 SearchFindMemberDeclarationsResult(String id) { | |
| 4157 this.id = id; | |
| 4158 } | |
| 4159 | |
| 4160 factory SearchFindMemberDeclarationsResult.fromJson(JsonDecoder jsonDecoder, S
tring jsonPath, Object json) { | |
| 4161 if (json == null) { | |
| 4162 json = {}; | |
| 4163 } | |
| 4164 if (json is Map) { | |
| 4165 String id; | |
| 4166 if (json.containsKey("id")) { | |
| 4167 id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]); | |
| 4168 } else { | |
| 4169 throw jsonDecoder.missingKey(jsonPath, "id"); | |
| 4170 } | |
| 4171 return new SearchFindMemberDeclarationsResult(id); | |
| 4172 } else { | |
| 4173 throw jsonDecoder.mismatch(jsonPath, "search.findMemberDeclarations result
", json); | |
| 4174 } | |
| 4175 } | |
| 4176 | |
| 4177 factory SearchFindMemberDeclarationsResult.fromResponse(Response response) { | |
| 4178 return new SearchFindMemberDeclarationsResult.fromJson( | |
| 4179 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); | |
| 4180 } | |
| 4181 | |
| 4182 Map<String, dynamic> toJson() { | |
| 4183 Map<String, dynamic> result = {}; | |
| 4184 result["id"] = id; | |
| 4185 return result; | |
| 4186 } | |
| 4187 | |
| 4188 Response toResponse(String id) { | |
| 4189 return new Response(id, result: toJson()); | |
| 4190 } | |
| 4191 | |
| 4192 @override | |
| 4193 String toString() => JSON.encode(toJson()); | |
| 4194 | |
| 4195 @override | |
| 4196 bool operator==(other) { | |
| 4197 if (other is SearchFindMemberDeclarationsResult) { | |
| 4198 return id == other.id; | |
| 4199 } | |
| 4200 return false; | |
| 4201 } | |
| 4202 | |
| 4203 @override | |
| 4204 int get hashCode { | |
| 4205 int hash = 0; | |
| 4206 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
| 4207 return _JenkinsSmiHash.finish(hash); | |
| 4208 } | |
| 4209 } | |
| 4210 | |
| 4211 /** | |
| 4212 * search.findMemberReferences params | |
| 4213 * | |
| 4214 * { | |
| 4215 * "name": String | |
| 4216 * } | |
| 4217 */ | |
| 4218 class SearchFindMemberReferencesParams implements HasToJson { | |
| 4219 String _name; | |
| 4220 | |
| 4221 /** | |
| 4222 * The name of the references to be found. | |
| 4223 */ | |
| 4224 String get name => _name; | |
| 4225 | |
| 4226 /** | |
| 4227 * The name of the references to be found. | |
| 4228 */ | |
| 4229 void set name(String value) { | |
| 4230 assert(value != null); | |
| 4231 this._name = value; | |
| 4232 } | |
| 4233 | |
| 4234 SearchFindMemberReferencesParams(String name) { | |
| 4235 this.name = name; | |
| 4236 } | |
| 4237 | |
| 4238 factory SearchFindMemberReferencesParams.fromJson(JsonDecoder jsonDecoder, Str
ing jsonPath, Object json) { | |
| 4239 if (json == null) { | |
| 4240 json = {}; | |
| 4241 } | |
| 4242 if (json is Map) { | |
| 4243 String name; | |
| 4244 if (json.containsKey("name")) { | |
| 4245 name = jsonDecoder._decodeString(jsonPath + ".name", json["name"]); | |
| 4246 } else { | |
| 4247 throw jsonDecoder.missingKey(jsonPath, "name"); | |
| 4248 } | |
| 4249 return new SearchFindMemberReferencesParams(name); | |
| 4250 } else { | |
| 4251 throw jsonDecoder.mismatch(jsonPath, "search.findMemberReferences params",
json); | |
| 4252 } | |
| 4253 } | |
| 4254 | |
| 4255 factory SearchFindMemberReferencesParams.fromRequest(Request request) { | |
| 4256 return new SearchFindMemberReferencesParams.fromJson( | |
| 4257 new RequestDecoder(request), "params", request._params); | |
| 4258 } | |
| 4259 | |
| 4260 Map<String, dynamic> toJson() { | |
| 4261 Map<String, dynamic> result = {}; | |
| 4262 result["name"] = name; | |
| 4263 return result; | |
| 4264 } | |
| 4265 | |
| 4266 Request toRequest(String id) { | |
| 4267 return new Request(id, "search.findMemberReferences", toJson()); | |
| 4268 } | |
| 4269 | |
| 4270 @override | |
| 4271 String toString() => JSON.encode(toJson()); | |
| 4272 | |
| 4273 @override | |
| 4274 bool operator==(other) { | |
| 4275 if (other is SearchFindMemberReferencesParams) { | |
| 4276 return name == other.name; | |
| 4277 } | |
| 4278 return false; | |
| 4279 } | |
| 4280 | |
| 4281 @override | |
| 4282 int get hashCode { | |
| 4283 int hash = 0; | |
| 4284 hash = _JenkinsSmiHash.combine(hash, name.hashCode); | |
| 4285 return _JenkinsSmiHash.finish(hash); | |
| 4286 } | |
| 4287 } | |
| 4288 | |
| 4289 /** | |
| 4290 * search.findMemberReferences result | |
| 4291 * | |
| 4292 * { | |
| 4293 * "id": SearchId | |
| 4294 * } | |
| 4295 */ | |
| 4296 class SearchFindMemberReferencesResult implements HasToJson { | |
| 4297 String _id; | |
| 4298 | |
| 4299 /** | |
| 4300 * The identifier used to associate results with this search request. | |
| 4301 */ | |
| 4302 String get id => _id; | |
| 4303 | |
| 4304 /** | |
| 4305 * The identifier used to associate results with this search request. | |
| 4306 */ | |
| 4307 void set id(String value) { | |
| 4308 assert(value != null); | |
| 4309 this._id = value; | |
| 4310 } | |
| 4311 | |
| 4312 SearchFindMemberReferencesResult(String id) { | |
| 4313 this.id = id; | |
| 4314 } | |
| 4315 | |
| 4316 factory SearchFindMemberReferencesResult.fromJson(JsonDecoder jsonDecoder, Str
ing jsonPath, Object json) { | |
| 4317 if (json == null) { | |
| 4318 json = {}; | |
| 4319 } | |
| 4320 if (json is Map) { | |
| 4321 String id; | |
| 4322 if (json.containsKey("id")) { | |
| 4323 id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]); | |
| 4324 } else { | |
| 4325 throw jsonDecoder.missingKey(jsonPath, "id"); | |
| 4326 } | |
| 4327 return new SearchFindMemberReferencesResult(id); | |
| 4328 } else { | |
| 4329 throw jsonDecoder.mismatch(jsonPath, "search.findMemberReferences result",
json); | |
| 4330 } | |
| 4331 } | |
| 4332 | |
| 4333 factory SearchFindMemberReferencesResult.fromResponse(Response response) { | |
| 4334 return new SearchFindMemberReferencesResult.fromJson( | |
| 4335 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); | |
| 4336 } | |
| 4337 | |
| 4338 Map<String, dynamic> toJson() { | |
| 4339 Map<String, dynamic> result = {}; | |
| 4340 result["id"] = id; | |
| 4341 return result; | |
| 4342 } | |
| 4343 | |
| 4344 Response toResponse(String id) { | |
| 4345 return new Response(id, result: toJson()); | |
| 4346 } | |
| 4347 | |
| 4348 @override | |
| 4349 String toString() => JSON.encode(toJson()); | |
| 4350 | |
| 4351 @override | |
| 4352 bool operator==(other) { | |
| 4353 if (other is SearchFindMemberReferencesResult) { | |
| 4354 return id == other.id; | |
| 4355 } | |
| 4356 return false; | |
| 4357 } | |
| 4358 | |
| 4359 @override | |
| 4360 int get hashCode { | |
| 4361 int hash = 0; | |
| 4362 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
| 4363 return _JenkinsSmiHash.finish(hash); | |
| 4364 } | |
| 4365 } | |
| 4366 | |
| 4367 /** | |
| 4368 * search.findTopLevelDeclarations params | |
| 4369 * | |
| 4370 * { | |
| 4371 * "pattern": String | |
| 4372 * } | |
| 4373 */ | |
| 4374 class SearchFindTopLevelDeclarationsParams implements HasToJson { | |
| 4375 String _pattern; | |
| 4376 | |
| 4377 /** | |
| 4378 * The regular expression used to match the names of the declarations to be | |
| 4379 * found. | |
| 4380 */ | |
| 4381 String get pattern => _pattern; | |
| 4382 | |
| 4383 /** | |
| 4384 * The regular expression used to match the names of the declarations to be | |
| 4385 * found. | |
| 4386 */ | |
| 4387 void set pattern(String value) { | |
| 4388 assert(value != null); | |
| 4389 this._pattern = value; | |
| 4390 } | |
| 4391 | |
| 4392 SearchFindTopLevelDeclarationsParams(String pattern) { | |
| 4393 this.pattern = pattern; | |
| 4394 } | |
| 4395 | |
| 4396 factory SearchFindTopLevelDeclarationsParams.fromJson(JsonDecoder jsonDecoder,
String jsonPath, Object json) { | |
| 4397 if (json == null) { | |
| 4398 json = {}; | |
| 4399 } | |
| 4400 if (json is Map) { | |
| 4401 String pattern; | |
| 4402 if (json.containsKey("pattern")) { | |
| 4403 pattern = jsonDecoder._decodeString(jsonPath + ".pattern", json["pattern
"]); | |
| 4404 } else { | |
| 4405 throw jsonDecoder.missingKey(jsonPath, "pattern"); | |
| 4406 } | |
| 4407 return new SearchFindTopLevelDeclarationsParams(pattern); | |
| 4408 } else { | |
| 4409 throw jsonDecoder.mismatch(jsonPath, "search.findTopLevelDeclarations para
ms", json); | |
| 4410 } | |
| 4411 } | |
| 4412 | |
| 4413 factory SearchFindTopLevelDeclarationsParams.fromRequest(Request request) { | |
| 4414 return new SearchFindTopLevelDeclarationsParams.fromJson( | |
| 4415 new RequestDecoder(request), "params", request._params); | |
| 4416 } | |
| 4417 | |
| 4418 Map<String, dynamic> toJson() { | |
| 4419 Map<String, dynamic> result = {}; | |
| 4420 result["pattern"] = pattern; | |
| 4421 return result; | |
| 4422 } | |
| 4423 | |
| 4424 Request toRequest(String id) { | |
| 4425 return new Request(id, "search.findTopLevelDeclarations", toJson()); | |
| 4426 } | |
| 4427 | |
| 4428 @override | |
| 4429 String toString() => JSON.encode(toJson()); | |
| 4430 | |
| 4431 @override | |
| 4432 bool operator==(other) { | |
| 4433 if (other is SearchFindTopLevelDeclarationsParams) { | |
| 4434 return pattern == other.pattern; | |
| 4435 } | |
| 4436 return false; | |
| 4437 } | |
| 4438 | |
| 4439 @override | |
| 4440 int get hashCode { | |
| 4441 int hash = 0; | |
| 4442 hash = _JenkinsSmiHash.combine(hash, pattern.hashCode); | |
| 4443 return _JenkinsSmiHash.finish(hash); | |
| 4444 } | |
| 4445 } | |
| 4446 | |
| 4447 /** | |
| 4448 * search.findTopLevelDeclarations result | |
| 4449 * | |
| 4450 * { | |
| 4451 * "id": SearchId | |
| 4452 * } | |
| 4453 */ | |
| 4454 class SearchFindTopLevelDeclarationsResult implements HasToJson { | |
| 4455 String _id; | |
| 4456 | |
| 4457 /** | |
| 4458 * The identifier used to associate results with this search request. | |
| 4459 */ | |
| 4460 String get id => _id; | |
| 4461 | |
| 4462 /** | |
| 4463 * The identifier used to associate results with this search request. | |
| 4464 */ | |
| 4465 void set id(String value) { | |
| 4466 assert(value != null); | |
| 4467 this._id = value; | |
| 4468 } | |
| 4469 | |
| 4470 SearchFindTopLevelDeclarationsResult(String id) { | |
| 4471 this.id = id; | |
| 4472 } | |
| 4473 | |
| 4474 factory SearchFindTopLevelDeclarationsResult.fromJson(JsonDecoder jsonDecoder,
String jsonPath, Object json) { | |
| 4475 if (json == null) { | |
| 4476 json = {}; | |
| 4477 } | |
| 4478 if (json is Map) { | |
| 4479 String id; | |
| 4480 if (json.containsKey("id")) { | |
| 4481 id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]); | |
| 4482 } else { | |
| 4483 throw jsonDecoder.missingKey(jsonPath, "id"); | |
| 4484 } | |
| 4485 return new SearchFindTopLevelDeclarationsResult(id); | |
| 4486 } else { | |
| 4487 throw jsonDecoder.mismatch(jsonPath, "search.findTopLevelDeclarations resu
lt", json); | |
| 4488 } | |
| 4489 } | |
| 4490 | |
| 4491 factory SearchFindTopLevelDeclarationsResult.fromResponse(Response response) { | |
| 4492 return new SearchFindTopLevelDeclarationsResult.fromJson( | |
| 4493 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); | |
| 4494 } | |
| 4495 | |
| 4496 Map<String, dynamic> toJson() { | |
| 4497 Map<String, dynamic> result = {}; | |
| 4498 result["id"] = id; | |
| 4499 return result; | |
| 4500 } | |
| 4501 | |
| 4502 Response toResponse(String id) { | |
| 4503 return new Response(id, result: toJson()); | |
| 4504 } | |
| 4505 | |
| 4506 @override | |
| 4507 String toString() => JSON.encode(toJson()); | |
| 4508 | |
| 4509 @override | |
| 4510 bool operator==(other) { | |
| 4511 if (other is SearchFindTopLevelDeclarationsResult) { | |
| 4512 return id == other.id; | |
| 4513 } | |
| 4514 return false; | |
| 4515 } | |
| 4516 | |
| 4517 @override | |
| 4518 int get hashCode { | |
| 4519 int hash = 0; | |
| 4520 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
| 4521 return _JenkinsSmiHash.finish(hash); | |
| 4522 } | |
| 4523 } | |
| 4524 | |
| 4525 /** | |
| 4526 * search.getTypeHierarchy params | |
| 4527 * | |
| 4528 * { | |
| 4529 * "file": FilePath | |
| 4530 * "offset": int | |
| 4531 * "superOnly": optional bool | |
| 4532 * } | |
| 4533 */ | |
| 4534 class SearchGetTypeHierarchyParams implements HasToJson { | |
| 4535 String _file; | |
| 4536 | |
| 4537 int _offset; | |
| 4538 | |
| 4539 bool _superOnly; | |
| 4540 | |
| 4541 /** | |
| 4542 * The file containing the declaration or reference to the type for which a | |
| 4543 * hierarchy is being requested. | |
| 4544 */ | |
| 4545 String get file => _file; | |
| 4546 | |
| 4547 /** | |
| 4548 * The file containing the declaration or reference to the type for which a | |
| 4549 * hierarchy is being requested. | |
| 4550 */ | |
| 4551 void set file(String value) { | |
| 4552 assert(value != null); | |
| 4553 this._file = value; | |
| 4554 } | |
| 4555 | |
| 4556 /** | |
| 4557 * The offset of the name of the type within the file. | |
| 4558 */ | |
| 4559 int get offset => _offset; | |
| 4560 | |
| 4561 /** | |
| 4562 * The offset of the name of the type within the file. | |
| 4563 */ | |
| 4564 void set offset(int value) { | |
| 4565 assert(value != null); | |
| 4566 this._offset = value; | |
| 4567 } | |
| 4568 | |
| 4569 /** | |
| 4570 * True if the client is only requesting superclasses and interfaces | |
| 4571 * hierarchy. | |
| 4572 */ | |
| 4573 bool get superOnly => _superOnly; | |
| 4574 | |
| 4575 /** | |
| 4576 * True if the client is only requesting superclasses and interfaces | |
| 4577 * hierarchy. | |
| 4578 */ | |
| 4579 void set superOnly(bool value) { | |
| 4580 this._superOnly = value; | |
| 4581 } | |
| 4582 | |
| 4583 SearchGetTypeHierarchyParams(String file, int offset, {bool superOnly}) { | |
| 4584 this.file = file; | |
| 4585 this.offset = offset; | |
| 4586 this.superOnly = superOnly; | |
| 4587 } | |
| 4588 | |
| 4589 factory SearchGetTypeHierarchyParams.fromJson(JsonDecoder jsonDecoder, String
jsonPath, Object json) { | |
| 4590 if (json == null) { | |
| 4591 json = {}; | |
| 4592 } | |
| 4593 if (json is Map) { | |
| 4594 String file; | |
| 4595 if (json.containsKey("file")) { | |
| 4596 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 4597 } else { | |
| 4598 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 4599 } | |
| 4600 int offset; | |
| 4601 if (json.containsKey("offset")) { | |
| 4602 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 4603 } else { | |
| 4604 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 4605 } | |
| 4606 bool superOnly; | |
| 4607 if (json.containsKey("superOnly")) { | |
| 4608 superOnly = jsonDecoder._decodeBool(jsonPath + ".superOnly", json["super
Only"]); | |
| 4609 } | |
| 4610 return new SearchGetTypeHierarchyParams(file, offset, superOnly: superOnly
); | |
| 4611 } else { | |
| 4612 throw jsonDecoder.mismatch(jsonPath, "search.getTypeHierarchy params", jso
n); | |
| 4613 } | |
| 4614 } | |
| 4615 | |
| 4616 factory SearchGetTypeHierarchyParams.fromRequest(Request request) { | |
| 4617 return new SearchGetTypeHierarchyParams.fromJson( | |
| 4618 new RequestDecoder(request), "params", request._params); | |
| 4619 } | |
| 4620 | |
| 4621 Map<String, dynamic> toJson() { | |
| 4622 Map<String, dynamic> result = {}; | |
| 4623 result["file"] = file; | |
| 4624 result["offset"] = offset; | |
| 4625 if (superOnly != null) { | |
| 4626 result["superOnly"] = superOnly; | |
| 4627 } | |
| 4628 return result; | |
| 4629 } | |
| 4630 | |
| 4631 Request toRequest(String id) { | |
| 4632 return new Request(id, "search.getTypeHierarchy", toJson()); | |
| 4633 } | |
| 4634 | |
| 4635 @override | |
| 4636 String toString() => JSON.encode(toJson()); | |
| 4637 | |
| 4638 @override | |
| 4639 bool operator==(other) { | |
| 4640 if (other is SearchGetTypeHierarchyParams) { | |
| 4641 return file == other.file && | |
| 4642 offset == other.offset && | |
| 4643 superOnly == other.superOnly; | |
| 4644 } | |
| 4645 return false; | |
| 4646 } | |
| 4647 | |
| 4648 @override | |
| 4649 int get hashCode { | |
| 4650 int hash = 0; | |
| 4651 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 4652 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 4653 hash = _JenkinsSmiHash.combine(hash, superOnly.hashCode); | |
| 4654 return _JenkinsSmiHash.finish(hash); | |
| 4655 } | |
| 4656 } | |
| 4657 | |
| 4658 /** | |
| 4659 * search.getTypeHierarchy result | |
| 4660 * | |
| 4661 * { | |
| 4662 * "hierarchyItems": optional List<TypeHierarchyItem> | |
| 4663 * } | |
| 4664 */ | |
| 4665 class SearchGetTypeHierarchyResult implements HasToJson { | |
| 4666 List<TypeHierarchyItem> _hierarchyItems; | |
| 4667 | |
| 4668 /** | |
| 4669 * A list of the types in the requested hierarchy. The first element of the | |
| 4670 * list is the item representing the type for which the hierarchy was | |
| 4671 * requested. The index of other elements of the list is unspecified, but | |
| 4672 * correspond to the integers used to reference supertype and subtype items | |
| 4673 * within the items. | |
| 4674 * | |
| 4675 * This field will be absent if the code at the given file and offset does | |
| 4676 * not represent a type, or if the file has not been sufficiently analyzed to | |
| 4677 * allow a type hierarchy to be produced. | |
| 4678 */ | |
| 4679 List<TypeHierarchyItem> get hierarchyItems => _hierarchyItems; | |
| 4680 | |
| 4681 /** | |
| 4682 * A list of the types in the requested hierarchy. The first element of the | |
| 4683 * list is the item representing the type for which the hierarchy was | |
| 4684 * requested. The index of other elements of the list is unspecified, but | |
| 4685 * correspond to the integers used to reference supertype and subtype items | |
| 4686 * within the items. | |
| 4687 * | |
| 4688 * This field will be absent if the code at the given file and offset does | |
| 4689 * not represent a type, or if the file has not been sufficiently analyzed to | |
| 4690 * allow a type hierarchy to be produced. | |
| 4691 */ | |
| 4692 void set hierarchyItems(List<TypeHierarchyItem> value) { | |
| 4693 this._hierarchyItems = value; | |
| 4694 } | |
| 4695 | |
| 4696 SearchGetTypeHierarchyResult({List<TypeHierarchyItem> hierarchyItems}) { | |
| 4697 this.hierarchyItems = hierarchyItems; | |
| 4698 } | |
| 4699 | |
| 4700 factory SearchGetTypeHierarchyResult.fromJson(JsonDecoder jsonDecoder, String
jsonPath, Object json) { | |
| 4701 if (json == null) { | |
| 4702 json = {}; | |
| 4703 } | |
| 4704 if (json is Map) { | |
| 4705 List<TypeHierarchyItem> hierarchyItems; | |
| 4706 if (json.containsKey("hierarchyItems")) { | |
| 4707 hierarchyItems = jsonDecoder._decodeList(jsonPath + ".hierarchyItems", j
son["hierarchyItems"], (String jsonPath, Object json) => new TypeHierarchyItem.f
romJson(jsonDecoder, jsonPath, json)); | |
| 4708 } | |
| 4709 return new SearchGetTypeHierarchyResult(hierarchyItems: hierarchyItems); | |
| 4710 } else { | |
| 4711 throw jsonDecoder.mismatch(jsonPath, "search.getTypeHierarchy result", jso
n); | |
| 4712 } | |
| 4713 } | |
| 4714 | |
| 4715 factory SearchGetTypeHierarchyResult.fromResponse(Response response) { | |
| 4716 return new SearchGetTypeHierarchyResult.fromJson( | |
| 4717 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); | |
| 4718 } | |
| 4719 | |
| 4720 Map<String, dynamic> toJson() { | |
| 4721 Map<String, dynamic> result = {}; | |
| 4722 if (hierarchyItems != null) { | |
| 4723 result["hierarchyItems"] = hierarchyItems.map((TypeHierarchyItem value) =>
value.toJson()).toList(); | |
| 4724 } | |
| 4725 return result; | |
| 4726 } | |
| 4727 | |
| 4728 Response toResponse(String id) { | |
| 4729 return new Response(id, result: toJson()); | |
| 4730 } | |
| 4731 | |
| 4732 @override | |
| 4733 String toString() => JSON.encode(toJson()); | |
| 4734 | |
| 4735 @override | |
| 4736 bool operator==(other) { | |
| 4737 if (other is SearchGetTypeHierarchyResult) { | |
| 4738 return _listEqual(hierarchyItems, other.hierarchyItems, (TypeHierarchyItem
a, TypeHierarchyItem b) => a == b); | |
| 4739 } | |
| 4740 return false; | |
| 4741 } | |
| 4742 | |
| 4743 @override | |
| 4744 int get hashCode { | |
| 4745 int hash = 0; | |
| 4746 hash = _JenkinsSmiHash.combine(hash, hierarchyItems.hashCode); | |
| 4747 return _JenkinsSmiHash.finish(hash); | |
| 4748 } | |
| 4749 } | |
| 4750 | |
| 4751 /** | |
| 4752 * search.results params | |
| 4753 * | |
| 4754 * { | |
| 4755 * "id": SearchId | |
| 4756 * "results": List<SearchResult> | |
| 4757 * "isLast": bool | |
| 4758 * } | |
| 4759 */ | |
| 4760 class SearchResultsParams implements HasToJson { | |
| 4761 String _id; | |
| 4762 | |
| 4763 List<SearchResult> _results; | |
| 4764 | |
| 4765 bool _isLast; | |
| 4766 | |
| 4767 /** | |
| 4768 * The id associated with the search. | |
| 4769 */ | |
| 4770 String get id => _id; | |
| 4771 | |
| 4772 /** | |
| 4773 * The id associated with the search. | |
| 4774 */ | |
| 4775 void set id(String value) { | |
| 4776 assert(value != null); | |
| 4777 this._id = value; | |
| 4778 } | |
| 4779 | |
| 4780 /** | |
| 4781 * The search results being reported. | |
| 4782 */ | |
| 4783 List<SearchResult> get results => _results; | |
| 4784 | |
| 4785 /** | |
| 4786 * The search results being reported. | |
| 4787 */ | |
| 4788 void set results(List<SearchResult> value) { | |
| 4789 assert(value != null); | |
| 4790 this._results = value; | |
| 4791 } | |
| 4792 | |
| 4793 /** | |
| 4794 * True if this is that last set of results that will be returned for the | |
| 4795 * indicated search. | |
| 4796 */ | |
| 4797 bool get isLast => _isLast; | |
| 4798 | |
| 4799 /** | |
| 4800 * True if this is that last set of results that will be returned for the | |
| 4801 * indicated search. | |
| 4802 */ | |
| 4803 void set isLast(bool value) { | |
| 4804 assert(value != null); | |
| 4805 this._isLast = value; | |
| 4806 } | |
| 4807 | |
| 4808 SearchResultsParams(String id, List<SearchResult> results, bool isLast) { | |
| 4809 this.id = id; | |
| 4810 this.results = results; | |
| 4811 this.isLast = isLast; | |
| 4812 } | |
| 4813 | |
| 4814 factory SearchResultsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath,
Object json) { | |
| 4815 if (json == null) { | |
| 4816 json = {}; | |
| 4817 } | |
| 4818 if (json is Map) { | |
| 4819 String id; | |
| 4820 if (json.containsKey("id")) { | |
| 4821 id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]); | |
| 4822 } else { | |
| 4823 throw jsonDecoder.missingKey(jsonPath, "id"); | |
| 4824 } | |
| 4825 List<SearchResult> results; | |
| 4826 if (json.containsKey("results")) { | |
| 4827 results = jsonDecoder._decodeList(jsonPath + ".results", json["results"]
, (String jsonPath, Object json) => new SearchResult.fromJson(jsonDecoder, jsonP
ath, json)); | |
| 4828 } else { | |
| 4829 throw jsonDecoder.missingKey(jsonPath, "results"); | |
| 4830 } | |
| 4831 bool isLast; | |
| 4832 if (json.containsKey("isLast")) { | |
| 4833 isLast = jsonDecoder._decodeBool(jsonPath + ".isLast", json["isLast"]); | |
| 4834 } else { | |
| 4835 throw jsonDecoder.missingKey(jsonPath, "isLast"); | |
| 4836 } | |
| 4837 return new SearchResultsParams(id, results, isLast); | |
| 4838 } else { | |
| 4839 throw jsonDecoder.mismatch(jsonPath, "search.results params", json); | |
| 4840 } | |
| 4841 } | |
| 4842 | |
| 4843 factory SearchResultsParams.fromNotification(Notification notification) { | |
| 4844 return new SearchResultsParams.fromJson( | |
| 4845 new ResponseDecoder(null), "params", notification._params); | |
| 4846 } | |
| 4847 | |
| 4848 Map<String, dynamic> toJson() { | |
| 4849 Map<String, dynamic> result = {}; | |
| 4850 result["id"] = id; | |
| 4851 result["results"] = results.map((SearchResult value) => value.toJson()).toLi
st(); | |
| 4852 result["isLast"] = isLast; | |
| 4853 return result; | |
| 4854 } | |
| 4855 | |
| 4856 Notification toNotification() { | |
| 4857 return new Notification("search.results", toJson()); | |
| 4858 } | |
| 4859 | |
| 4860 @override | |
| 4861 String toString() => JSON.encode(toJson()); | |
| 4862 | |
| 4863 @override | |
| 4864 bool operator==(other) { | |
| 4865 if (other is SearchResultsParams) { | |
| 4866 return id == other.id && | |
| 4867 _listEqual(results, other.results, (SearchResult a, SearchResult b) =>
a == b) && | |
| 4868 isLast == other.isLast; | |
| 4869 } | |
| 4870 return false; | |
| 4871 } | |
| 4872 | |
| 4873 @override | |
| 4874 int get hashCode { | |
| 4875 int hash = 0; | |
| 4876 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
| 4877 hash = _JenkinsSmiHash.combine(hash, results.hashCode); | |
| 4878 hash = _JenkinsSmiHash.combine(hash, isLast.hashCode); | |
| 4879 return _JenkinsSmiHash.finish(hash); | |
| 4880 } | |
| 4881 } | |
| 4882 | |
| 4883 /** | |
| 4884 * edit.format params | |
| 4885 * | |
| 4886 * { | |
| 4887 * "file": FilePath | |
| 4888 * "selectionOffset": int | |
| 4889 * "selectionLength": int | |
| 4890 * "lineLength": optional int | |
| 4891 * } | |
| 4892 */ | |
| 4893 class EditFormatParams implements HasToJson { | |
| 4894 String _file; | |
| 4895 | |
| 4896 int _selectionOffset; | |
| 4897 | |
| 4898 int _selectionLength; | |
| 4899 | |
| 4900 int _lineLength; | |
| 4901 | |
| 4902 /** | |
| 4903 * The file containing the code to be formatted. | |
| 4904 */ | |
| 4905 String get file => _file; | |
| 4906 | |
| 4907 /** | |
| 4908 * The file containing the code to be formatted. | |
| 4909 */ | |
| 4910 void set file(String value) { | |
| 4911 assert(value != null); | |
| 4912 this._file = value; | |
| 4913 } | |
| 4914 | |
| 4915 /** | |
| 4916 * The offset of the current selection in the file. | |
| 4917 */ | |
| 4918 int get selectionOffset => _selectionOffset; | |
| 4919 | |
| 4920 /** | |
| 4921 * The offset of the current selection in the file. | |
| 4922 */ | |
| 4923 void set selectionOffset(int value) { | |
| 4924 assert(value != null); | |
| 4925 this._selectionOffset = value; | |
| 4926 } | |
| 4927 | |
| 4928 /** | |
| 4929 * The length of the current selection in the file. | |
| 4930 */ | |
| 4931 int get selectionLength => _selectionLength; | |
| 4932 | |
| 4933 /** | |
| 4934 * The length of the current selection in the file. | |
| 4935 */ | |
| 4936 void set selectionLength(int value) { | |
| 4937 assert(value != null); | |
| 4938 this._selectionLength = value; | |
| 4939 } | |
| 4940 | |
| 4941 /** | |
| 4942 * The line length to be used by the formatter. | |
| 4943 */ | |
| 4944 int get lineLength => _lineLength; | |
| 4945 | |
| 4946 /** | |
| 4947 * The line length to be used by the formatter. | |
| 4948 */ | |
| 4949 void set lineLength(int value) { | |
| 4950 this._lineLength = value; | |
| 4951 } | |
| 4952 | |
| 4953 EditFormatParams(String file, int selectionOffset, int selectionLength, {int l
ineLength}) { | |
| 4954 this.file = file; | |
| 4955 this.selectionOffset = selectionOffset; | |
| 4956 this.selectionLength = selectionLength; | |
| 4957 this.lineLength = lineLength; | |
| 4958 } | |
| 4959 | |
| 4960 factory EditFormatParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Ob
ject json) { | |
| 4961 if (json == null) { | |
| 4962 json = {}; | |
| 4963 } | |
| 4964 if (json is Map) { | |
| 4965 String file; | |
| 4966 if (json.containsKey("file")) { | |
| 4967 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 4968 } else { | |
| 4969 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 4970 } | |
| 4971 int selectionOffset; | |
| 4972 if (json.containsKey("selectionOffset")) { | |
| 4973 selectionOffset = jsonDecoder._decodeInt(jsonPath + ".selectionOffset",
json["selectionOffset"]); | |
| 4974 } else { | |
| 4975 throw jsonDecoder.missingKey(jsonPath, "selectionOffset"); | |
| 4976 } | |
| 4977 int selectionLength; | |
| 4978 if (json.containsKey("selectionLength")) { | |
| 4979 selectionLength = jsonDecoder._decodeInt(jsonPath + ".selectionLength",
json["selectionLength"]); | |
| 4980 } else { | |
| 4981 throw jsonDecoder.missingKey(jsonPath, "selectionLength"); | |
| 4982 } | |
| 4983 int lineLength; | |
| 4984 if (json.containsKey("lineLength")) { | |
| 4985 lineLength = jsonDecoder._decodeInt(jsonPath + ".lineLength", json["line
Length"]); | |
| 4986 } | |
| 4987 return new EditFormatParams(file, selectionOffset, selectionLength, lineLe
ngth: lineLength); | |
| 4988 } else { | |
| 4989 throw jsonDecoder.mismatch(jsonPath, "edit.format params", json); | |
| 4990 } | |
| 4991 } | |
| 4992 | |
| 4993 factory EditFormatParams.fromRequest(Request request) { | |
| 4994 return new EditFormatParams.fromJson( | |
| 4995 new RequestDecoder(request), "params", request._params); | |
| 4996 } | |
| 4997 | |
| 4998 Map<String, dynamic> toJson() { | |
| 4999 Map<String, dynamic> result = {}; | |
| 5000 result["file"] = file; | |
| 5001 result["selectionOffset"] = selectionOffset; | |
| 5002 result["selectionLength"] = selectionLength; | |
| 5003 if (lineLength != null) { | |
| 5004 result["lineLength"] = lineLength; | |
| 5005 } | |
| 5006 return result; | |
| 5007 } | |
| 5008 | |
| 5009 Request toRequest(String id) { | |
| 5010 return new Request(id, "edit.format", toJson()); | |
| 5011 } | |
| 5012 | |
| 5013 @override | |
| 5014 String toString() => JSON.encode(toJson()); | |
| 5015 | |
| 5016 @override | |
| 5017 bool operator==(other) { | |
| 5018 if (other is EditFormatParams) { | |
| 5019 return file == other.file && | |
| 5020 selectionOffset == other.selectionOffset && | |
| 5021 selectionLength == other.selectionLength && | |
| 5022 lineLength == other.lineLength; | |
| 5023 } | |
| 5024 return false; | |
| 5025 } | |
| 5026 | |
| 5027 @override | |
| 5028 int get hashCode { | |
| 5029 int hash = 0; | |
| 5030 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 5031 hash = _JenkinsSmiHash.combine(hash, selectionOffset.hashCode); | |
| 5032 hash = _JenkinsSmiHash.combine(hash, selectionLength.hashCode); | |
| 5033 hash = _JenkinsSmiHash.combine(hash, lineLength.hashCode); | |
| 5034 return _JenkinsSmiHash.finish(hash); | |
| 5035 } | |
| 5036 } | |
| 5037 | |
| 5038 /** | |
| 5039 * edit.format result | |
| 5040 * | |
| 5041 * { | |
| 5042 * "edits": List<SourceEdit> | |
| 5043 * "selectionOffset": int | |
| 5044 * "selectionLength": int | |
| 5045 * } | |
| 5046 */ | |
| 5047 class EditFormatResult implements HasToJson { | |
| 5048 List<SourceEdit> _edits; | |
| 5049 | |
| 5050 int _selectionOffset; | |
| 5051 | |
| 5052 int _selectionLength; | |
| 5053 | |
| 5054 /** | |
| 5055 * The edit(s) to be applied in order to format the code. The list will be | |
| 5056 * empty if the code was already formatted (there are no changes). | |
| 5057 */ | |
| 5058 List<SourceEdit> get edits => _edits; | |
| 5059 | |
| 5060 /** | |
| 5061 * The edit(s) to be applied in order to format the code. The list will be | |
| 5062 * empty if the code was already formatted (there are no changes). | |
| 5063 */ | |
| 5064 void set edits(List<SourceEdit> value) { | |
| 5065 assert(value != null); | |
| 5066 this._edits = value; | |
| 5067 } | |
| 5068 | |
| 5069 /** | |
| 5070 * The offset of the selection after formatting the code. | |
| 5071 */ | |
| 5072 int get selectionOffset => _selectionOffset; | |
| 5073 | |
| 5074 /** | |
| 5075 * The offset of the selection after formatting the code. | |
| 5076 */ | |
| 5077 void set selectionOffset(int value) { | |
| 5078 assert(value != null); | |
| 5079 this._selectionOffset = value; | |
| 5080 } | |
| 5081 | |
| 5082 /** | |
| 5083 * The length of the selection after formatting the code. | |
| 5084 */ | |
| 5085 int get selectionLength => _selectionLength; | |
| 5086 | |
| 5087 /** | |
| 5088 * The length of the selection after formatting the code. | |
| 5089 */ | |
| 5090 void set selectionLength(int value) { | |
| 5091 assert(value != null); | |
| 5092 this._selectionLength = value; | |
| 5093 } | |
| 5094 | |
| 5095 EditFormatResult(List<SourceEdit> edits, int selectionOffset, int selectionLen
gth) { | |
| 5096 this.edits = edits; | |
| 5097 this.selectionOffset = selectionOffset; | |
| 5098 this.selectionLength = selectionLength; | |
| 5099 } | |
| 5100 | |
| 5101 factory EditFormatResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Ob
ject json) { | |
| 5102 if (json == null) { | |
| 5103 json = {}; | |
| 5104 } | |
| 5105 if (json is Map) { | |
| 5106 List<SourceEdit> edits; | |
| 5107 if (json.containsKey("edits")) { | |
| 5108 edits = jsonDecoder._decodeList(jsonPath + ".edits", json["edits"], (Str
ing jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, jso
n)); | |
| 5109 } else { | |
| 5110 throw jsonDecoder.missingKey(jsonPath, "edits"); | |
| 5111 } | |
| 5112 int selectionOffset; | |
| 5113 if (json.containsKey("selectionOffset")) { | |
| 5114 selectionOffset = jsonDecoder._decodeInt(jsonPath + ".selectionOffset",
json["selectionOffset"]); | |
| 5115 } else { | |
| 5116 throw jsonDecoder.missingKey(jsonPath, "selectionOffset"); | |
| 5117 } | |
| 5118 int selectionLength; | |
| 5119 if (json.containsKey("selectionLength")) { | |
| 5120 selectionLength = jsonDecoder._decodeInt(jsonPath + ".selectionLength",
json["selectionLength"]); | |
| 5121 } else { | |
| 5122 throw jsonDecoder.missingKey(jsonPath, "selectionLength"); | |
| 5123 } | |
| 5124 return new EditFormatResult(edits, selectionOffset, selectionLength); | |
| 5125 } else { | |
| 5126 throw jsonDecoder.mismatch(jsonPath, "edit.format result", json); | |
| 5127 } | |
| 5128 } | |
| 5129 | |
| 5130 factory EditFormatResult.fromResponse(Response response) { | |
| 5131 return new EditFormatResult.fromJson( | |
| 5132 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); | |
| 5133 } | |
| 5134 | |
| 5135 Map<String, dynamic> toJson() { | |
| 5136 Map<String, dynamic> result = {}; | |
| 5137 result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList(); | |
| 5138 result["selectionOffset"] = selectionOffset; | |
| 5139 result["selectionLength"] = selectionLength; | |
| 5140 return result; | |
| 5141 } | |
| 5142 | |
| 5143 Response toResponse(String id) { | |
| 5144 return new Response(id, result: toJson()); | |
| 5145 } | |
| 5146 | |
| 5147 @override | |
| 5148 String toString() => JSON.encode(toJson()); | |
| 5149 | |
| 5150 @override | |
| 5151 bool operator==(other) { | |
| 5152 if (other is EditFormatResult) { | |
| 5153 return _listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a ==
b) && | |
| 5154 selectionOffset == other.selectionOffset && | |
| 5155 selectionLength == other.selectionLength; | |
| 5156 } | |
| 5157 return false; | |
| 5158 } | |
| 5159 | |
| 5160 @override | |
| 5161 int get hashCode { | |
| 5162 int hash = 0; | |
| 5163 hash = _JenkinsSmiHash.combine(hash, edits.hashCode); | |
| 5164 hash = _JenkinsSmiHash.combine(hash, selectionOffset.hashCode); | |
| 5165 hash = _JenkinsSmiHash.combine(hash, selectionLength.hashCode); | |
| 5166 return _JenkinsSmiHash.finish(hash); | |
| 5167 } | |
| 5168 } | |
| 5169 | |
| 5170 /** | |
| 5171 * edit.getAssists params | |
| 5172 * | |
| 5173 * { | |
| 5174 * "file": FilePath | |
| 5175 * "offset": int | |
| 5176 * "length": int | |
| 5177 * } | |
| 5178 */ | |
| 5179 class EditGetAssistsParams implements HasToJson { | |
| 5180 String _file; | |
| 5181 | |
| 5182 int _offset; | |
| 5183 | |
| 5184 int _length; | |
| 5185 | |
| 5186 /** | |
| 5187 * The file containing the code for which assists are being requested. | |
| 5188 */ | |
| 5189 String get file => _file; | |
| 5190 | |
| 5191 /** | |
| 5192 * The file containing the code for which assists are being requested. | |
| 5193 */ | |
| 5194 void set file(String value) { | |
| 5195 assert(value != null); | |
| 5196 this._file = value; | |
| 5197 } | |
| 5198 | |
| 5199 /** | |
| 5200 * The offset of the code for which assists are being requested. | |
| 5201 */ | |
| 5202 int get offset => _offset; | |
| 5203 | |
| 5204 /** | |
| 5205 * The offset of the code for which assists are being requested. | |
| 5206 */ | |
| 5207 void set offset(int value) { | |
| 5208 assert(value != null); | |
| 5209 this._offset = value; | |
| 5210 } | |
| 5211 | |
| 5212 /** | |
| 5213 * The length of the code for which assists are being requested. | |
| 5214 */ | |
| 5215 int get length => _length; | |
| 5216 | |
| 5217 /** | |
| 5218 * The length of the code for which assists are being requested. | |
| 5219 */ | |
| 5220 void set length(int value) { | |
| 5221 assert(value != null); | |
| 5222 this._length = value; | |
| 5223 } | |
| 5224 | |
| 5225 EditGetAssistsParams(String file, int offset, int length) { | |
| 5226 this.file = file; | |
| 5227 this.offset = offset; | |
| 5228 this.length = length; | |
| 5229 } | |
| 5230 | |
| 5231 factory EditGetAssistsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath
, Object json) { | |
| 5232 if (json == null) { | |
| 5233 json = {}; | |
| 5234 } | |
| 5235 if (json is Map) { | |
| 5236 String file; | |
| 5237 if (json.containsKey("file")) { | |
| 5238 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 5239 } else { | |
| 5240 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 5241 } | |
| 5242 int offset; | |
| 5243 if (json.containsKey("offset")) { | |
| 5244 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 5245 } else { | |
| 5246 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 5247 } | |
| 5248 int length; | |
| 5249 if (json.containsKey("length")) { | |
| 5250 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | |
| 5251 } else { | |
| 5252 throw jsonDecoder.missingKey(jsonPath, "length"); | |
| 5253 } | |
| 5254 return new EditGetAssistsParams(file, offset, length); | |
| 5255 } else { | |
| 5256 throw jsonDecoder.mismatch(jsonPath, "edit.getAssists params", json); | |
| 5257 } | |
| 5258 } | |
| 5259 | |
| 5260 factory EditGetAssistsParams.fromRequest(Request request) { | |
| 5261 return new EditGetAssistsParams.fromJson( | |
| 5262 new RequestDecoder(request), "params", request._params); | |
| 5263 } | |
| 5264 | |
| 5265 Map<String, dynamic> toJson() { | |
| 5266 Map<String, dynamic> result = {}; | |
| 5267 result["file"] = file; | |
| 5268 result["offset"] = offset; | |
| 5269 result["length"] = length; | |
| 5270 return result; | |
| 5271 } | |
| 5272 | |
| 5273 Request toRequest(String id) { | |
| 5274 return new Request(id, "edit.getAssists", toJson()); | |
| 5275 } | |
| 5276 | |
| 5277 @override | |
| 5278 String toString() => JSON.encode(toJson()); | |
| 5279 | |
| 5280 @override | |
| 5281 bool operator==(other) { | |
| 5282 if (other is EditGetAssistsParams) { | |
| 5283 return file == other.file && | |
| 5284 offset == other.offset && | |
| 5285 length == other.length; | |
| 5286 } | |
| 5287 return false; | |
| 5288 } | |
| 5289 | |
| 5290 @override | |
| 5291 int get hashCode { | |
| 5292 int hash = 0; | |
| 5293 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 5294 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 5295 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
| 5296 return _JenkinsSmiHash.finish(hash); | |
| 5297 } | |
| 5298 } | |
| 5299 | |
| 5300 /** | |
| 5301 * edit.getAssists result | |
| 5302 * | |
| 5303 * { | |
| 5304 * "assists": List<SourceChange> | |
| 5305 * } | |
| 5306 */ | |
| 5307 class EditGetAssistsResult implements HasToJson { | |
| 5308 List<SourceChange> _assists; | |
| 5309 | |
| 5310 /** | |
| 5311 * The assists that are available at the given location. | |
| 5312 */ | |
| 5313 List<SourceChange> get assists => _assists; | |
| 5314 | |
| 5315 /** | |
| 5316 * The assists that are available at the given location. | |
| 5317 */ | |
| 5318 void set assists(List<SourceChange> value) { | |
| 5319 assert(value != null); | |
| 5320 this._assists = value; | |
| 5321 } | |
| 5322 | |
| 5323 EditGetAssistsResult(List<SourceChange> assists) { | |
| 5324 this.assists = assists; | |
| 5325 } | |
| 5326 | |
| 5327 factory EditGetAssistsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath
, Object json) { | |
| 5328 if (json == null) { | |
| 5329 json = {}; | |
| 5330 } | |
| 5331 if (json is Map) { | |
| 5332 List<SourceChange> assists; | |
| 5333 if (json.containsKey("assists")) { | |
| 5334 assists = jsonDecoder._decodeList(jsonPath + ".assists", json["assists"]
, (String jsonPath, Object json) => new SourceChange.fromJson(jsonDecoder, jsonP
ath, json)); | |
| 5335 } else { | |
| 5336 throw jsonDecoder.missingKey(jsonPath, "assists"); | |
| 5337 } | |
| 5338 return new EditGetAssistsResult(assists); | |
| 5339 } else { | |
| 5340 throw jsonDecoder.mismatch(jsonPath, "edit.getAssists result", json); | |
| 5341 } | |
| 5342 } | |
| 5343 | |
| 5344 factory EditGetAssistsResult.fromResponse(Response response) { | |
| 5345 return new EditGetAssistsResult.fromJson( | |
| 5346 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); | |
| 5347 } | |
| 5348 | |
| 5349 Map<String, dynamic> toJson() { | |
| 5350 Map<String, dynamic> result = {}; | |
| 5351 result["assists"] = assists.map((SourceChange value) => value.toJson()).toLi
st(); | |
| 5352 return result; | |
| 5353 } | |
| 5354 | |
| 5355 Response toResponse(String id) { | |
| 5356 return new Response(id, result: toJson()); | |
| 5357 } | |
| 5358 | |
| 5359 @override | |
| 5360 String toString() => JSON.encode(toJson()); | |
| 5361 | |
| 5362 @override | |
| 5363 bool operator==(other) { | |
| 5364 if (other is EditGetAssistsResult) { | |
| 5365 return _listEqual(assists, other.assists, (SourceChange a, SourceChange b)
=> a == b); | |
| 5366 } | |
| 5367 return false; | |
| 5368 } | |
| 5369 | |
| 5370 @override | |
| 5371 int get hashCode { | |
| 5372 int hash = 0; | |
| 5373 hash = _JenkinsSmiHash.combine(hash, assists.hashCode); | |
| 5374 return _JenkinsSmiHash.finish(hash); | |
| 5375 } | |
| 5376 } | |
| 5377 | |
| 5378 /** | |
| 5379 * edit.getAvailableRefactorings params | |
| 5380 * | |
| 5381 * { | |
| 5382 * "file": FilePath | |
| 5383 * "offset": int | |
| 5384 * "length": int | |
| 5385 * } | |
| 5386 */ | |
| 5387 class EditGetAvailableRefactoringsParams implements HasToJson { | |
| 5388 String _file; | |
| 5389 | |
| 5390 int _offset; | |
| 5391 | |
| 5392 int _length; | |
| 5393 | |
| 5394 /** | |
| 5395 * The file containing the code on which the refactoring would be based. | |
| 5396 */ | |
| 5397 String get file => _file; | |
| 5398 | |
| 5399 /** | |
| 5400 * The file containing the code on which the refactoring would be based. | |
| 5401 */ | |
| 5402 void set file(String value) { | |
| 5403 assert(value != null); | |
| 5404 this._file = value; | |
| 5405 } | |
| 5406 | |
| 5407 /** | |
| 5408 * The offset of the code on which the refactoring would be based. | |
| 5409 */ | |
| 5410 int get offset => _offset; | |
| 5411 | |
| 5412 /** | |
| 5413 * The offset of the code on which the refactoring would be based. | |
| 5414 */ | |
| 5415 void set offset(int value) { | |
| 5416 assert(value != null); | |
| 5417 this._offset = value; | |
| 5418 } | |
| 5419 | |
| 5420 /** | |
| 5421 * The length of the code on which the refactoring would be based. | |
| 5422 */ | |
| 5423 int get length => _length; | |
| 5424 | |
| 5425 /** | |
| 5426 * The length of the code on which the refactoring would be based. | |
| 5427 */ | |
| 5428 void set length(int value) { | |
| 5429 assert(value != null); | |
| 5430 this._length = value; | |
| 5431 } | |
| 5432 | |
| 5433 EditGetAvailableRefactoringsParams(String file, int offset, int length) { | |
| 5434 this.file = file; | |
| 5435 this.offset = offset; | |
| 5436 this.length = length; | |
| 5437 } | |
| 5438 | |
| 5439 factory EditGetAvailableRefactoringsParams.fromJson(JsonDecoder jsonDecoder, S
tring jsonPath, Object json) { | |
| 5440 if (json == null) { | |
| 5441 json = {}; | |
| 5442 } | |
| 5443 if (json is Map) { | |
| 5444 String file; | |
| 5445 if (json.containsKey("file")) { | |
| 5446 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 5447 } else { | |
| 5448 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 5449 } | |
| 5450 int offset; | |
| 5451 if (json.containsKey("offset")) { | |
| 5452 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 5453 } else { | |
| 5454 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 5455 } | |
| 5456 int length; | |
| 5457 if (json.containsKey("length")) { | |
| 5458 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | |
| 5459 } else { | |
| 5460 throw jsonDecoder.missingKey(jsonPath, "length"); | |
| 5461 } | |
| 5462 return new EditGetAvailableRefactoringsParams(file, offset, length); | |
| 5463 } else { | |
| 5464 throw jsonDecoder.mismatch(jsonPath, "edit.getAvailableRefactorings params
", json); | |
| 5465 } | |
| 5466 } | |
| 5467 | |
| 5468 factory EditGetAvailableRefactoringsParams.fromRequest(Request request) { | |
| 5469 return new EditGetAvailableRefactoringsParams.fromJson( | |
| 5470 new RequestDecoder(request), "params", request._params); | |
| 5471 } | |
| 5472 | |
| 5473 Map<String, dynamic> toJson() { | |
| 5474 Map<String, dynamic> result = {}; | |
| 5475 result["file"] = file; | |
| 5476 result["offset"] = offset; | |
| 5477 result["length"] = length; | |
| 5478 return result; | |
| 5479 } | |
| 5480 | |
| 5481 Request toRequest(String id) { | |
| 5482 return new Request(id, "edit.getAvailableRefactorings", toJson()); | |
| 5483 } | |
| 5484 | |
| 5485 @override | |
| 5486 String toString() => JSON.encode(toJson()); | |
| 5487 | |
| 5488 @override | |
| 5489 bool operator==(other) { | |
| 5490 if (other is EditGetAvailableRefactoringsParams) { | |
| 5491 return file == other.file && | |
| 5492 offset == other.offset && | |
| 5493 length == other.length; | |
| 5494 } | |
| 5495 return false; | |
| 5496 } | |
| 5497 | |
| 5498 @override | |
| 5499 int get hashCode { | |
| 5500 int hash = 0; | |
| 5501 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 5502 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 5503 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
| 5504 return _JenkinsSmiHash.finish(hash); | |
| 5505 } | |
| 5506 } | |
| 5507 | |
| 5508 /** | |
| 5509 * edit.getAvailableRefactorings result | |
| 5510 * | |
| 5511 * { | |
| 5512 * "kinds": List<RefactoringKind> | |
| 5513 * } | |
| 5514 */ | |
| 5515 class EditGetAvailableRefactoringsResult implements HasToJson { | |
| 5516 List<RefactoringKind> _kinds; | |
| 5517 | |
| 5518 /** | |
| 5519 * The kinds of refactorings that are valid for the given selection. | |
| 5520 */ | |
| 5521 List<RefactoringKind> get kinds => _kinds; | |
| 5522 | |
| 5523 /** | |
| 5524 * The kinds of refactorings that are valid for the given selection. | |
| 5525 */ | |
| 5526 void set kinds(List<RefactoringKind> value) { | |
| 5527 assert(value != null); | |
| 5528 this._kinds = value; | |
| 5529 } | |
| 5530 | |
| 5531 EditGetAvailableRefactoringsResult(List<RefactoringKind> kinds) { | |
| 5532 this.kinds = kinds; | |
| 5533 } | |
| 5534 | |
| 5535 factory EditGetAvailableRefactoringsResult.fromJson(JsonDecoder jsonDecoder, S
tring jsonPath, Object json) { | |
| 5536 if (json == null) { | |
| 5537 json = {}; | |
| 5538 } | |
| 5539 if (json is Map) { | |
| 5540 List<RefactoringKind> kinds; | |
| 5541 if (json.containsKey("kinds")) { | |
| 5542 kinds = jsonDecoder._decodeList(jsonPath + ".kinds", json["kinds"], (Str
ing jsonPath, Object json) => new RefactoringKind.fromJson(jsonDecoder, jsonPath
, json)); | |
| 5543 } else { | |
| 5544 throw jsonDecoder.missingKey(jsonPath, "kinds"); | |
| 5545 } | |
| 5546 return new EditGetAvailableRefactoringsResult(kinds); | |
| 5547 } else { | |
| 5548 throw jsonDecoder.mismatch(jsonPath, "edit.getAvailableRefactorings result
", json); | |
| 5549 } | |
| 5550 } | |
| 5551 | |
| 5552 factory EditGetAvailableRefactoringsResult.fromResponse(Response response) { | |
| 5553 return new EditGetAvailableRefactoringsResult.fromJson( | |
| 5554 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); | |
| 5555 } | |
| 5556 | |
| 5557 Map<String, dynamic> toJson() { | |
| 5558 Map<String, dynamic> result = {}; | |
| 5559 result["kinds"] = kinds.map((RefactoringKind value) => value.toJson()).toLis
t(); | |
| 5560 return result; | |
| 5561 } | |
| 5562 | |
| 5563 Response toResponse(String id) { | |
| 5564 return new Response(id, result: toJson()); | |
| 5565 } | |
| 5566 | |
| 5567 @override | |
| 5568 String toString() => JSON.encode(toJson()); | |
| 5569 | |
| 5570 @override | |
| 5571 bool operator==(other) { | |
| 5572 if (other is EditGetAvailableRefactoringsResult) { | |
| 5573 return _listEqual(kinds, other.kinds, (RefactoringKind a, RefactoringKind
b) => a == b); | |
| 5574 } | |
| 5575 return false; | |
| 5576 } | |
| 5577 | |
| 5578 @override | |
| 5579 int get hashCode { | |
| 5580 int hash = 0; | |
| 5581 hash = _JenkinsSmiHash.combine(hash, kinds.hashCode); | |
| 5582 return _JenkinsSmiHash.finish(hash); | |
| 5583 } | |
| 5584 } | |
| 5585 | |
| 5586 /** | |
| 5587 * edit.getFixes params | |
| 5588 * | |
| 5589 * { | |
| 5590 * "file": FilePath | |
| 5591 * "offset": int | |
| 5592 * } | |
| 5593 */ | |
| 5594 class EditGetFixesParams implements HasToJson { | |
| 5595 String _file; | |
| 5596 | |
| 5597 int _offset; | |
| 5598 | |
| 5599 /** | |
| 5600 * The file containing the errors for which fixes are being requested. | |
| 5601 */ | |
| 5602 String get file => _file; | |
| 5603 | |
| 5604 /** | |
| 5605 * The file containing the errors for which fixes are being requested. | |
| 5606 */ | |
| 5607 void set file(String value) { | |
| 5608 assert(value != null); | |
| 5609 this._file = value; | |
| 5610 } | |
| 5611 | |
| 5612 /** | |
| 5613 * The offset used to select the errors for which fixes will be returned. | |
| 5614 */ | |
| 5615 int get offset => _offset; | |
| 5616 | |
| 5617 /** | |
| 5618 * The offset used to select the errors for which fixes will be returned. | |
| 5619 */ | |
| 5620 void set offset(int value) { | |
| 5621 assert(value != null); | |
| 5622 this._offset = value; | |
| 5623 } | |
| 5624 | |
| 5625 EditGetFixesParams(String file, int offset) { | |
| 5626 this.file = file; | |
| 5627 this.offset = offset; | |
| 5628 } | |
| 5629 | |
| 5630 factory EditGetFixesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath,
Object json) { | |
| 5631 if (json == null) { | |
| 5632 json = {}; | |
| 5633 } | |
| 5634 if (json is Map) { | |
| 5635 String file; | |
| 5636 if (json.containsKey("file")) { | |
| 5637 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 5638 } else { | |
| 5639 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 5640 } | |
| 5641 int offset; | |
| 5642 if (json.containsKey("offset")) { | |
| 5643 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 5644 } else { | |
| 5645 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 5646 } | |
| 5647 return new EditGetFixesParams(file, offset); | |
| 5648 } else { | |
| 5649 throw jsonDecoder.mismatch(jsonPath, "edit.getFixes params", json); | |
| 5650 } | |
| 5651 } | |
| 5652 | |
| 5653 factory EditGetFixesParams.fromRequest(Request request) { | |
| 5654 return new EditGetFixesParams.fromJson( | |
| 5655 new RequestDecoder(request), "params", request._params); | |
| 5656 } | |
| 5657 | |
| 5658 Map<String, dynamic> toJson() { | |
| 5659 Map<String, dynamic> result = {}; | |
| 5660 result["file"] = file; | |
| 5661 result["offset"] = offset; | |
| 5662 return result; | |
| 5663 } | |
| 5664 | |
| 5665 Request toRequest(String id) { | |
| 5666 return new Request(id, "edit.getFixes", toJson()); | |
| 5667 } | |
| 5668 | |
| 5669 @override | |
| 5670 String toString() => JSON.encode(toJson()); | |
| 5671 | |
| 5672 @override | |
| 5673 bool operator==(other) { | |
| 5674 if (other is EditGetFixesParams) { | |
| 5675 return file == other.file && | |
| 5676 offset == other.offset; | |
| 5677 } | |
| 5678 return false; | |
| 5679 } | |
| 5680 | |
| 5681 @override | |
| 5682 int get hashCode { | |
| 5683 int hash = 0; | |
| 5684 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 5685 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 5686 return _JenkinsSmiHash.finish(hash); | |
| 5687 } | |
| 5688 } | |
| 5689 | |
| 5690 /** | |
| 5691 * edit.getFixes result | |
| 5692 * | |
| 5693 * { | |
| 5694 * "fixes": List<AnalysisErrorFixes> | |
| 5695 * } | |
| 5696 */ | |
| 5697 class EditGetFixesResult implements HasToJson { | |
| 5698 List<AnalysisErrorFixes> _fixes; | |
| 5699 | |
| 5700 /** | |
| 5701 * The fixes that are available for the errors at the given offset. | |
| 5702 */ | |
| 5703 List<AnalysisErrorFixes> get fixes => _fixes; | |
| 5704 | |
| 5705 /** | |
| 5706 * The fixes that are available for the errors at the given offset. | |
| 5707 */ | |
| 5708 void set fixes(List<AnalysisErrorFixes> value) { | |
| 5709 assert(value != null); | |
| 5710 this._fixes = value; | |
| 5711 } | |
| 5712 | |
| 5713 EditGetFixesResult(List<AnalysisErrorFixes> fixes) { | |
| 5714 this.fixes = fixes; | |
| 5715 } | |
| 5716 | |
| 5717 factory EditGetFixesResult.fromJson(JsonDecoder jsonDecoder, String jsonPath,
Object json) { | |
| 5718 if (json == null) { | |
| 5719 json = {}; | |
| 5720 } | |
| 5721 if (json is Map) { | |
| 5722 List<AnalysisErrorFixes> fixes; | |
| 5723 if (json.containsKey("fixes")) { | |
| 5724 fixes = jsonDecoder._decodeList(jsonPath + ".fixes", json["fixes"], (Str
ing jsonPath, Object json) => new AnalysisErrorFixes.fromJson(jsonDecoder, jsonP
ath, json)); | |
| 5725 } else { | |
| 5726 throw jsonDecoder.missingKey(jsonPath, "fixes"); | |
| 5727 } | |
| 5728 return new EditGetFixesResult(fixes); | |
| 5729 } else { | |
| 5730 throw jsonDecoder.mismatch(jsonPath, "edit.getFixes result", json); | |
| 5731 } | |
| 5732 } | |
| 5733 | |
| 5734 factory EditGetFixesResult.fromResponse(Response response) { | |
| 5735 return new EditGetFixesResult.fromJson( | |
| 5736 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); | |
| 5737 } | |
| 5738 | |
| 5739 Map<String, dynamic> toJson() { | |
| 5740 Map<String, dynamic> result = {}; | |
| 5741 result["fixes"] = fixes.map((AnalysisErrorFixes value) => value.toJson()).to
List(); | |
| 5742 return result; | |
| 5743 } | |
| 5744 | |
| 5745 Response toResponse(String id) { | |
| 5746 return new Response(id, result: toJson()); | |
| 5747 } | |
| 5748 | |
| 5749 @override | |
| 5750 String toString() => JSON.encode(toJson()); | |
| 5751 | |
| 5752 @override | |
| 5753 bool operator==(other) { | |
| 5754 if (other is EditGetFixesResult) { | |
| 5755 return _listEqual(fixes, other.fixes, (AnalysisErrorFixes a, AnalysisError
Fixes b) => a == b); | |
| 5756 } | |
| 5757 return false; | |
| 5758 } | |
| 5759 | |
| 5760 @override | |
| 5761 int get hashCode { | |
| 5762 int hash = 0; | |
| 5763 hash = _JenkinsSmiHash.combine(hash, fixes.hashCode); | |
| 5764 return _JenkinsSmiHash.finish(hash); | |
| 5765 } | |
| 5766 } | |
| 5767 | |
| 5768 /** | |
| 5769 * edit.getRefactoring params | |
| 5770 * | |
| 5771 * { | |
| 5772 * "kind": RefactoringKind | |
| 5773 * "file": FilePath | |
| 5774 * "offset": int | |
| 5775 * "length": int | |
| 5776 * "validateOnly": bool | |
| 5777 * "options": optional RefactoringOptions | |
| 5778 * } | |
| 5779 */ | |
| 5780 class EditGetRefactoringParams implements HasToJson { | |
| 5781 RefactoringKind _kind; | |
| 5782 | |
| 5783 String _file; | |
| 5784 | |
| 5785 int _offset; | |
| 5786 | |
| 5787 int _length; | |
| 5788 | |
| 5789 bool _validateOnly; | |
| 5790 | |
| 5791 RefactoringOptions _options; | |
| 5792 | |
| 5793 /** | |
| 5794 * The kind of refactoring to be performed. | |
| 5795 */ | |
| 5796 RefactoringKind get kind => _kind; | |
| 5797 | |
| 5798 /** | |
| 5799 * The kind of refactoring to be performed. | |
| 5800 */ | |
| 5801 void set kind(RefactoringKind value) { | |
| 5802 assert(value != null); | |
| 5803 this._kind = value; | |
| 5804 } | |
| 5805 | |
| 5806 /** | |
| 5807 * The file containing the code involved in the refactoring. | |
| 5808 */ | |
| 5809 String get file => _file; | |
| 5810 | |
| 5811 /** | |
| 5812 * The file containing the code involved in the refactoring. | |
| 5813 */ | |
| 5814 void set file(String value) { | |
| 5815 assert(value != null); | |
| 5816 this._file = value; | |
| 5817 } | |
| 5818 | |
| 5819 /** | |
| 5820 * The offset of the region involved in the refactoring. | |
| 5821 */ | |
| 5822 int get offset => _offset; | |
| 5823 | |
| 5824 /** | |
| 5825 * The offset of the region involved in the refactoring. | |
| 5826 */ | |
| 5827 void set offset(int value) { | |
| 5828 assert(value != null); | |
| 5829 this._offset = value; | |
| 5830 } | |
| 5831 | |
| 5832 /** | |
| 5833 * The length of the region involved in the refactoring. | |
| 5834 */ | |
| 5835 int get length => _length; | |
| 5836 | |
| 5837 /** | |
| 5838 * The length of the region involved in the refactoring. | |
| 5839 */ | |
| 5840 void set length(int value) { | |
| 5841 assert(value != null); | |
| 5842 this._length = value; | |
| 5843 } | |
| 5844 | |
| 5845 /** | |
| 5846 * True if the client is only requesting that the values of the options be | |
| 5847 * validated and no change be generated. | |
| 5848 */ | |
| 5849 bool get validateOnly => _validateOnly; | |
| 5850 | |
| 5851 /** | |
| 5852 * True if the client is only requesting that the values of the options be | |
| 5853 * validated and no change be generated. | |
| 5854 */ | |
| 5855 void set validateOnly(bool value) { | |
| 5856 assert(value != null); | |
| 5857 this._validateOnly = value; | |
| 5858 } | |
| 5859 | |
| 5860 /** | |
| 5861 * Data used to provide values provided by the user. The structure of the | |
| 5862 * data is dependent on the kind of refactoring being performed. The data | |
| 5863 * that is expected is documented in the section titled Refactorings, labeled | |
| 5864 * as “Options”. This field can be omitted if the refactoring does not | |
| 5865 * require any options or if the values of those options are not known. | |
| 5866 */ | |
| 5867 RefactoringOptions get options => _options; | |
| 5868 | |
| 5869 /** | |
| 5870 * Data used to provide values provided by the user. The structure of the | |
| 5871 * data is dependent on the kind of refactoring being performed. The data | |
| 5872 * that is expected is documented in the section titled Refactorings, labeled | |
| 5873 * as “Options”. This field can be omitted if the refactoring does not | |
| 5874 * require any options or if the values of those options are not known. | |
| 5875 */ | |
| 5876 void set options(RefactoringOptions value) { | |
| 5877 this._options = value; | |
| 5878 } | |
| 5879 | |
| 5880 EditGetRefactoringParams(RefactoringKind kind, String file, int offset, int le
ngth, bool validateOnly, {RefactoringOptions options}) { | |
| 5881 this.kind = kind; | |
| 5882 this.file = file; | |
| 5883 this.offset = offset; | |
| 5884 this.length = length; | |
| 5885 this.validateOnly = validateOnly; | |
| 5886 this.options = options; | |
| 5887 } | |
| 5888 | |
| 5889 factory EditGetRefactoringParams.fromJson(JsonDecoder jsonDecoder, String json
Path, Object json) { | |
| 5890 if (json == null) { | |
| 5891 json = {}; | |
| 5892 } | |
| 5893 if (json is Map) { | |
| 5894 RefactoringKind kind; | |
| 5895 if (json.containsKey("kind")) { | |
| 5896 kind = new RefactoringKind.fromJson(jsonDecoder, jsonPath + ".kind", jso
n["kind"]); | |
| 5897 } else { | |
| 5898 throw jsonDecoder.missingKey(jsonPath, "kind"); | |
| 5899 } | |
| 5900 String file; | |
| 5901 if (json.containsKey("file")) { | |
| 5902 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 5903 } else { | |
| 5904 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 5905 } | |
| 5906 int offset; | |
| 5907 if (json.containsKey("offset")) { | |
| 5908 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 5909 } else { | |
| 5910 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 5911 } | |
| 5912 int length; | |
| 5913 if (json.containsKey("length")) { | |
| 5914 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | |
| 5915 } else { | |
| 5916 throw jsonDecoder.missingKey(jsonPath, "length"); | |
| 5917 } | |
| 5918 bool validateOnly; | |
| 5919 if (json.containsKey("validateOnly")) { | |
| 5920 validateOnly = jsonDecoder._decodeBool(jsonPath + ".validateOnly", json[
"validateOnly"]); | |
| 5921 } else { | |
| 5922 throw jsonDecoder.missingKey(jsonPath, "validateOnly"); | |
| 5923 } | |
| 5924 RefactoringOptions options; | |
| 5925 if (json.containsKey("options")) { | |
| 5926 options = new RefactoringOptions.fromJson(jsonDecoder, jsonPath + ".opti
ons", json["options"], kind); | |
| 5927 } | |
| 5928 return new EditGetRefactoringParams(kind, file, offset, length, validateOn
ly, options: options); | |
| 5929 } else { | |
| 5930 throw jsonDecoder.mismatch(jsonPath, "edit.getRefactoring params", json); | |
| 5931 } | |
| 5932 } | |
| 5933 | |
| 5934 factory EditGetRefactoringParams.fromRequest(Request request) { | |
| 5935 var params = new EditGetRefactoringParams.fromJson( | |
| 5936 new RequestDecoder(request), "params", request._params); | |
| 5937 REQUEST_ID_REFACTORING_KINDS[request.id] = params.kind; | |
| 5938 return params; | |
| 5939 } | |
| 5940 | |
| 5941 Map<String, dynamic> toJson() { | |
| 5942 Map<String, dynamic> result = {}; | |
| 5943 result["kind"] = kind.toJson(); | |
| 5944 result["file"] = file; | |
| 5945 result["offset"] = offset; | |
| 5946 result["length"] = length; | |
| 5947 result["validateOnly"] = validateOnly; | |
| 5948 if (options != null) { | |
| 5949 result["options"] = options.toJson(); | |
| 5950 } | |
| 5951 return result; | |
| 5952 } | |
| 5953 | |
| 5954 Request toRequest(String id) { | |
| 5955 return new Request(id, "edit.getRefactoring", toJson()); | |
| 5956 } | |
| 5957 | |
| 5958 @override | |
| 5959 String toString() => JSON.encode(toJson()); | |
| 5960 | |
| 5961 @override | |
| 5962 bool operator==(other) { | |
| 5963 if (other is EditGetRefactoringParams) { | |
| 5964 return kind == other.kind && | |
| 5965 file == other.file && | |
| 5966 offset == other.offset && | |
| 5967 length == other.length && | |
| 5968 validateOnly == other.validateOnly && | |
| 5969 options == other.options; | |
| 5970 } | |
| 5971 return false; | |
| 5972 } | |
| 5973 | |
| 5974 @override | |
| 5975 int get hashCode { | |
| 5976 int hash = 0; | |
| 5977 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); | |
| 5978 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 5979 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 5980 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
| 5981 hash = _JenkinsSmiHash.combine(hash, validateOnly.hashCode); | |
| 5982 hash = _JenkinsSmiHash.combine(hash, options.hashCode); | |
| 5983 return _JenkinsSmiHash.finish(hash); | |
| 5984 } | |
| 5985 } | |
| 5986 | |
| 5987 /** | |
| 5988 * edit.getRefactoring result | |
| 5989 * | |
| 5990 * { | |
| 5991 * "initialProblems": List<RefactoringProblem> | |
| 5992 * "optionsProblems": List<RefactoringProblem> | |
| 5993 * "finalProblems": List<RefactoringProblem> | |
| 5994 * "feedback": optional RefactoringFeedback | |
| 5995 * "change": optional SourceChange | |
| 5996 * "potentialEdits": optional List<String> | |
| 5997 * } | |
| 5998 */ | |
| 5999 class EditGetRefactoringResult implements HasToJson { | |
| 6000 List<RefactoringProblem> _initialProblems; | |
| 6001 | |
| 6002 List<RefactoringProblem> _optionsProblems; | |
| 6003 | |
| 6004 List<RefactoringProblem> _finalProblems; | |
| 6005 | |
| 6006 RefactoringFeedback _feedback; | |
| 6007 | |
| 6008 SourceChange _change; | |
| 6009 | |
| 6010 List<String> _potentialEdits; | |
| 6011 | |
| 6012 /** | |
| 6013 * The initial status of the refactoring, i.e. problems related to the | |
| 6014 * context in which the refactoring is requested. The array will be empty if | |
| 6015 * there are no known problems. | |
| 6016 */ | |
| 6017 List<RefactoringProblem> get initialProblems => _initialProblems; | |
| 6018 | |
| 6019 /** | |
| 6020 * The initial status of the refactoring, i.e. problems related to the | |
| 6021 * context in which the refactoring is requested. The array will be empty if | |
| 6022 * there are no known problems. | |
| 6023 */ | |
| 6024 void set initialProblems(List<RefactoringProblem> value) { | |
| 6025 assert(value != null); | |
| 6026 this._initialProblems = value; | |
| 6027 } | |
| 6028 | |
| 6029 /** | |
| 6030 * The options validation status, i.e. problems in the given options, such as | |
| 6031 * light-weight validation of a new name, flags compatibility, etc. The array | |
| 6032 * will be empty if there are no known problems. | |
| 6033 */ | |
| 6034 List<RefactoringProblem> get optionsProblems => _optionsProblems; | |
| 6035 | |
| 6036 /** | |
| 6037 * The options validation status, i.e. problems in the given options, such as | |
| 6038 * light-weight validation of a new name, flags compatibility, etc. The array | |
| 6039 * will be empty if there are no known problems. | |
| 6040 */ | |
| 6041 void set optionsProblems(List<RefactoringProblem> value) { | |
| 6042 assert(value != null); | |
| 6043 this._optionsProblems = value; | |
| 6044 } | |
| 6045 | |
| 6046 /** | |
| 6047 * The final status of the refactoring, i.e. problems identified in the | |
| 6048 * result of a full, potentially expensive validation and / or change | |
| 6049 * creation. The array will be empty if there are no known problems. | |
| 6050 */ | |
| 6051 List<RefactoringProblem> get finalProblems => _finalProblems; | |
| 6052 | |
| 6053 /** | |
| 6054 * The final status of the refactoring, i.e. problems identified in the | |
| 6055 * result of a full, potentially expensive validation and / or change | |
| 6056 * creation. The array will be empty if there are no known problems. | |
| 6057 */ | |
| 6058 void set finalProblems(List<RefactoringProblem> value) { | |
| 6059 assert(value != null); | |
| 6060 this._finalProblems = value; | |
| 6061 } | |
| 6062 | |
| 6063 /** | |
| 6064 * Data used to provide feedback to the user. The structure of the data is | |
| 6065 * dependent on the kind of refactoring being created. The data that is | |
| 6066 * returned is documented in the section titled Refactorings, labeled as | |
| 6067 * “Feedback”. | |
| 6068 */ | |
| 6069 RefactoringFeedback get feedback => _feedback; | |
| 6070 | |
| 6071 /** | |
| 6072 * Data used to provide feedback to the user. The structure of the data is | |
| 6073 * dependent on the kind of refactoring being created. The data that is | |
| 6074 * returned is documented in the section titled Refactorings, labeled as | |
| 6075 * “Feedback”. | |
| 6076 */ | |
| 6077 void set feedback(RefactoringFeedback value) { | |
| 6078 this._feedback = value; | |
| 6079 } | |
| 6080 | |
| 6081 /** | |
| 6082 * The changes that are to be applied to affect the refactoring. This field | |
| 6083 * will be omitted if there are problems that prevent a set of changes from | |
| 6084 * being computed, such as having no options specified for a refactoring that | |
| 6085 * requires them, or if only validation was requested. | |
| 6086 */ | |
| 6087 SourceChange get change => _change; | |
| 6088 | |
| 6089 /** | |
| 6090 * The changes that are to be applied to affect the refactoring. This field | |
| 6091 * will be omitted if there are problems that prevent a set of changes from | |
| 6092 * being computed, such as having no options specified for a refactoring that | |
| 6093 * requires them, or if only validation was requested. | |
| 6094 */ | |
| 6095 void set change(SourceChange value) { | |
| 6096 this._change = value; | |
| 6097 } | |
| 6098 | |
| 6099 /** | |
| 6100 * The ids of source edits that are not known to be valid. An edit is not | |
| 6101 * known to be valid if there was insufficient type information for the | |
| 6102 * server to be able to determine whether or not the code needs to be | |
| 6103 * modified, such as when a member is being renamed and there is a reference | |
| 6104 * to a member from an unknown type. This field will be omitted if the change | |
| 6105 * field is omitted or if there are no potential edits for the refactoring. | |
| 6106 */ | |
| 6107 List<String> get potentialEdits => _potentialEdits; | |
| 6108 | |
| 6109 /** | |
| 6110 * The ids of source edits that are not known to be valid. An edit is not | |
| 6111 * known to be valid if there was insufficient type information for the | |
| 6112 * server to be able to determine whether or not the code needs to be | |
| 6113 * modified, such as when a member is being renamed and there is a reference | |
| 6114 * to a member from an unknown type. This field will be omitted if the change | |
| 6115 * field is omitted or if there are no potential edits for the refactoring. | |
| 6116 */ | |
| 6117 void set potentialEdits(List<String> value) { | |
| 6118 this._potentialEdits = value; | |
| 6119 } | |
| 6120 | |
| 6121 EditGetRefactoringResult(List<RefactoringProblem> initialProblems, List<Refact
oringProblem> optionsProblems, List<RefactoringProblem> finalProblems, {Refactor
ingFeedback feedback, SourceChange change, List<String> potentialEdits}) { | |
| 6122 this.initialProblems = initialProblems; | |
| 6123 this.optionsProblems = optionsProblems; | |
| 6124 this.finalProblems = finalProblems; | |
| 6125 this.feedback = feedback; | |
| 6126 this.change = change; | |
| 6127 this.potentialEdits = potentialEdits; | |
| 6128 } | |
| 6129 | |
| 6130 factory EditGetRefactoringResult.fromJson(JsonDecoder jsonDecoder, String json
Path, Object json) { | |
| 6131 if (json == null) { | |
| 6132 json = {}; | |
| 6133 } | |
| 6134 if (json is Map) { | |
| 6135 List<RefactoringProblem> initialProblems; | |
| 6136 if (json.containsKey("initialProblems")) { | |
| 6137 initialProblems = jsonDecoder._decodeList(jsonPath + ".initialProblems",
json["initialProblems"], (String jsonPath, Object json) => new RefactoringProbl
em.fromJson(jsonDecoder, jsonPath, json)); | |
| 6138 } else { | |
| 6139 throw jsonDecoder.missingKey(jsonPath, "initialProblems"); | |
| 6140 } | |
| 6141 List<RefactoringProblem> optionsProblems; | |
| 6142 if (json.containsKey("optionsProblems")) { | |
| 6143 optionsProblems = jsonDecoder._decodeList(jsonPath + ".optionsProblems",
json["optionsProblems"], (String jsonPath, Object json) => new RefactoringProbl
em.fromJson(jsonDecoder, jsonPath, json)); | |
| 6144 } else { | |
| 6145 throw jsonDecoder.missingKey(jsonPath, "optionsProblems"); | |
| 6146 } | |
| 6147 List<RefactoringProblem> finalProblems; | |
| 6148 if (json.containsKey("finalProblems")) { | |
| 6149 finalProblems = jsonDecoder._decodeList(jsonPath + ".finalProblems", jso
n["finalProblems"], (String jsonPath, Object json) => new RefactoringProblem.fro
mJson(jsonDecoder, jsonPath, json)); | |
| 6150 } else { | |
| 6151 throw jsonDecoder.missingKey(jsonPath, "finalProblems"); | |
| 6152 } | |
| 6153 RefactoringFeedback feedback; | |
| 6154 if (json.containsKey("feedback")) { | |
| 6155 feedback = new RefactoringFeedback.fromJson(jsonDecoder, jsonPath + ".fe
edback", json["feedback"], json); | |
| 6156 } | |
| 6157 SourceChange change; | |
| 6158 if (json.containsKey("change")) { | |
| 6159 change = new SourceChange.fromJson(jsonDecoder, jsonPath + ".change", js
on["change"]); | |
| 6160 } | |
| 6161 List<String> potentialEdits; | |
| 6162 if (json.containsKey("potentialEdits")) { | |
| 6163 potentialEdits = jsonDecoder._decodeList(jsonPath + ".potentialEdits", j
son["potentialEdits"], jsonDecoder._decodeString); | |
| 6164 } | |
| 6165 return new EditGetRefactoringResult(initialProblems, optionsProblems, fina
lProblems, feedback: feedback, change: change, potentialEdits: potentialEdits); | |
| 6166 } else { | |
| 6167 throw jsonDecoder.mismatch(jsonPath, "edit.getRefactoring result", json); | |
| 6168 } | |
| 6169 } | |
| 6170 | |
| 6171 factory EditGetRefactoringResult.fromResponse(Response response) { | |
| 6172 return new EditGetRefactoringResult.fromJson( | |
| 6173 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); | |
| 6174 } | |
| 6175 | |
| 6176 Map<String, dynamic> toJson() { | |
| 6177 Map<String, dynamic> result = {}; | |
| 6178 result["initialProblems"] = initialProblems.map((RefactoringProblem value) =
> value.toJson()).toList(); | |
| 6179 result["optionsProblems"] = optionsProblems.map((RefactoringProblem value) =
> value.toJson()).toList(); | |
| 6180 result["finalProblems"] = finalProblems.map((RefactoringProblem value) => va
lue.toJson()).toList(); | |
| 6181 if (feedback != null) { | |
| 6182 result["feedback"] = feedback.toJson(); | |
| 6183 } | |
| 6184 if (change != null) { | |
| 6185 result["change"] = change.toJson(); | |
| 6186 } | |
| 6187 if (potentialEdits != null) { | |
| 6188 result["potentialEdits"] = potentialEdits; | |
| 6189 } | |
| 6190 return result; | |
| 6191 } | |
| 6192 | |
| 6193 Response toResponse(String id) { | |
| 6194 return new Response(id, result: toJson()); | |
| 6195 } | |
| 6196 | |
| 6197 @override | |
| 6198 String toString() => JSON.encode(toJson()); | |
| 6199 | |
| 6200 @override | |
| 6201 bool operator==(other) { | |
| 6202 if (other is EditGetRefactoringResult) { | |
| 6203 return _listEqual(initialProblems, other.initialProblems, (RefactoringProb
lem a, RefactoringProblem b) => a == b) && | |
| 6204 _listEqual(optionsProblems, other.optionsProblems, (RefactoringProblem
a, RefactoringProblem b) => a == b) && | |
| 6205 _listEqual(finalProblems, other.finalProblems, (RefactoringProblem a,
RefactoringProblem b) => a == b) && | |
| 6206 feedback == other.feedback && | |
| 6207 change == other.change && | |
| 6208 _listEqual(potentialEdits, other.potentialEdits, (String a, String b)
=> a == b); | |
| 6209 } | |
| 6210 return false; | |
| 6211 } | |
| 6212 | |
| 6213 @override | |
| 6214 int get hashCode { | |
| 6215 int hash = 0; | |
| 6216 hash = _JenkinsSmiHash.combine(hash, initialProblems.hashCode); | |
| 6217 hash = _JenkinsSmiHash.combine(hash, optionsProblems.hashCode); | |
| 6218 hash = _JenkinsSmiHash.combine(hash, finalProblems.hashCode); | |
| 6219 hash = _JenkinsSmiHash.combine(hash, feedback.hashCode); | |
| 6220 hash = _JenkinsSmiHash.combine(hash, change.hashCode); | |
| 6221 hash = _JenkinsSmiHash.combine(hash, potentialEdits.hashCode); | |
| 6222 return _JenkinsSmiHash.finish(hash); | |
| 6223 } | |
| 6224 } | |
| 6225 | |
| 6226 /** | |
| 6227 * edit.sortMembers params | |
| 6228 * | |
| 6229 * { | |
| 6230 * "file": FilePath | |
| 6231 * } | |
| 6232 */ | |
| 6233 class EditSortMembersParams implements HasToJson { | |
| 6234 String _file; | |
| 6235 | |
| 6236 /** | |
| 6237 * The Dart file to sort. | |
| 6238 */ | |
| 6239 String get file => _file; | |
| 6240 | |
| 6241 /** | |
| 6242 * The Dart file to sort. | |
| 6243 */ | |
| 6244 void set file(String value) { | |
| 6245 assert(value != null); | |
| 6246 this._file = value; | |
| 6247 } | |
| 6248 | |
| 6249 EditSortMembersParams(String file) { | |
| 6250 this.file = file; | |
| 6251 } | |
| 6252 | |
| 6253 factory EditSortMembersParams.fromJson(JsonDecoder jsonDecoder, String jsonPat
h, Object json) { | |
| 6254 if (json == null) { | |
| 6255 json = {}; | |
| 6256 } | |
| 6257 if (json is Map) { | |
| 6258 String file; | |
| 6259 if (json.containsKey("file")) { | |
| 6260 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 6261 } else { | |
| 6262 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 6263 } | |
| 6264 return new EditSortMembersParams(file); | |
| 6265 } else { | |
| 6266 throw jsonDecoder.mismatch(jsonPath, "edit.sortMembers params", json); | |
| 6267 } | |
| 6268 } | |
| 6269 | |
| 6270 factory EditSortMembersParams.fromRequest(Request request) { | |
| 6271 return new EditSortMembersParams.fromJson( | |
| 6272 new RequestDecoder(request), "params", request._params); | |
| 6273 } | |
| 6274 | |
| 6275 Map<String, dynamic> toJson() { | |
| 6276 Map<String, dynamic> result = {}; | |
| 6277 result["file"] = file; | |
| 6278 return result; | |
| 6279 } | |
| 6280 | |
| 6281 Request toRequest(String id) { | |
| 6282 return new Request(id, "edit.sortMembers", toJson()); | |
| 6283 } | |
| 6284 | |
| 6285 @override | |
| 6286 String toString() => JSON.encode(toJson()); | |
| 6287 | |
| 6288 @override | |
| 6289 bool operator==(other) { | |
| 6290 if (other is EditSortMembersParams) { | |
| 6291 return file == other.file; | |
| 6292 } | |
| 6293 return false; | |
| 6294 } | |
| 6295 | |
| 6296 @override | |
| 6297 int get hashCode { | |
| 6298 int hash = 0; | |
| 6299 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 6300 return _JenkinsSmiHash.finish(hash); | |
| 6301 } | |
| 6302 } | |
| 6303 | |
| 6304 /** | |
| 6305 * edit.sortMembers result | |
| 6306 * | |
| 6307 * { | |
| 6308 * "edit": SourceFileEdit | |
| 6309 * } | |
| 6310 */ | |
| 6311 class EditSortMembersResult implements HasToJson { | |
| 6312 SourceFileEdit _edit; | |
| 6313 | |
| 6314 /** | |
| 6315 * The file edit that is to be applied to the given file to effect the | |
| 6316 * sorting. | |
| 6317 */ | |
| 6318 SourceFileEdit get edit => _edit; | |
| 6319 | |
| 6320 /** | |
| 6321 * The file edit that is to be applied to the given file to effect the | |
| 6322 * sorting. | |
| 6323 */ | |
| 6324 void set edit(SourceFileEdit value) { | |
| 6325 assert(value != null); | |
| 6326 this._edit = value; | |
| 6327 } | |
| 6328 | |
| 6329 EditSortMembersResult(SourceFileEdit edit) { | |
| 6330 this.edit = edit; | |
| 6331 } | |
| 6332 | |
| 6333 factory EditSortMembersResult.fromJson(JsonDecoder jsonDecoder, String jsonPat
h, Object json) { | |
| 6334 if (json == null) { | |
| 6335 json = {}; | |
| 6336 } | |
| 6337 if (json is Map) { | |
| 6338 SourceFileEdit edit; | |
| 6339 if (json.containsKey("edit")) { | |
| 6340 edit = new SourceFileEdit.fromJson(jsonDecoder, jsonPath + ".edit", json
["edit"]); | |
| 6341 } else { | |
| 6342 throw jsonDecoder.missingKey(jsonPath, "edit"); | |
| 6343 } | |
| 6344 return new EditSortMembersResult(edit); | |
| 6345 } else { | |
| 6346 throw jsonDecoder.mismatch(jsonPath, "edit.sortMembers result", json); | |
| 6347 } | |
| 6348 } | |
| 6349 | |
| 6350 factory EditSortMembersResult.fromResponse(Response response) { | |
| 6351 return new EditSortMembersResult.fromJson( | |
| 6352 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); | |
| 6353 } | |
| 6354 | |
| 6355 Map<String, dynamic> toJson() { | |
| 6356 Map<String, dynamic> result = {}; | |
| 6357 result["edit"] = edit.toJson(); | |
| 6358 return result; | |
| 6359 } | |
| 6360 | |
| 6361 Response toResponse(String id) { | |
| 6362 return new Response(id, result: toJson()); | |
| 6363 } | |
| 6364 | |
| 6365 @override | |
| 6366 String toString() => JSON.encode(toJson()); | |
| 6367 | |
| 6368 @override | |
| 6369 bool operator==(other) { | |
| 6370 if (other is EditSortMembersResult) { | |
| 6371 return edit == other.edit; | |
| 6372 } | |
| 6373 return false; | |
| 6374 } | |
| 6375 | |
| 6376 @override | |
| 6377 int get hashCode { | |
| 6378 int hash = 0; | |
| 6379 hash = _JenkinsSmiHash.combine(hash, edit.hashCode); | |
| 6380 return _JenkinsSmiHash.finish(hash); | |
| 6381 } | |
| 6382 } | |
| 6383 | |
| 6384 /** | |
| 6385 * edit.organizeDirectives params | |
| 6386 * | |
| 6387 * { | |
| 6388 * "file": FilePath | |
| 6389 * } | |
| 6390 */ | |
| 6391 class EditOrganizeDirectivesParams implements HasToJson { | |
| 6392 String _file; | |
| 6393 | |
| 6394 /** | |
| 6395 * The Dart file to organize directives in. | |
| 6396 */ | |
| 6397 String get file => _file; | |
| 6398 | |
| 6399 /** | |
| 6400 * The Dart file to organize directives in. | |
| 6401 */ | |
| 6402 void set file(String value) { | |
| 6403 assert(value != null); | |
| 6404 this._file = value; | |
| 6405 } | |
| 6406 | |
| 6407 EditOrganizeDirectivesParams(String file) { | |
| 6408 this.file = file; | |
| 6409 } | |
| 6410 | |
| 6411 factory EditOrganizeDirectivesParams.fromJson(JsonDecoder jsonDecoder, String
jsonPath, Object json) { | |
| 6412 if (json == null) { | |
| 6413 json = {}; | |
| 6414 } | |
| 6415 if (json is Map) { | |
| 6416 String file; | |
| 6417 if (json.containsKey("file")) { | |
| 6418 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 6419 } else { | |
| 6420 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 6421 } | |
| 6422 return new EditOrganizeDirectivesParams(file); | |
| 6423 } else { | |
| 6424 throw jsonDecoder.mismatch(jsonPath, "edit.organizeDirectives params", jso
n); | |
| 6425 } | |
| 6426 } | |
| 6427 | |
| 6428 factory EditOrganizeDirectivesParams.fromRequest(Request request) { | |
| 6429 return new EditOrganizeDirectivesParams.fromJson( | |
| 6430 new RequestDecoder(request), "params", request._params); | |
| 6431 } | |
| 6432 | |
| 6433 Map<String, dynamic> toJson() { | |
| 6434 Map<String, dynamic> result = {}; | |
| 6435 result["file"] = file; | |
| 6436 return result; | |
| 6437 } | |
| 6438 | |
| 6439 Request toRequest(String id) { | |
| 6440 return new Request(id, "edit.organizeDirectives", toJson()); | |
| 6441 } | |
| 6442 | |
| 6443 @override | |
| 6444 String toString() => JSON.encode(toJson()); | |
| 6445 | |
| 6446 @override | |
| 6447 bool operator==(other) { | |
| 6448 if (other is EditOrganizeDirectivesParams) { | |
| 6449 return file == other.file; | |
| 6450 } | |
| 6451 return false; | |
| 6452 } | |
| 6453 | |
| 6454 @override | |
| 6455 int get hashCode { | |
| 6456 int hash = 0; | |
| 6457 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 6458 return _JenkinsSmiHash.finish(hash); | |
| 6459 } | |
| 6460 } | |
| 6461 | |
| 6462 /** | |
| 6463 * edit.organizeDirectives result | |
| 6464 * | |
| 6465 * { | |
| 6466 * "edit": SourceFileEdit | |
| 6467 * } | |
| 6468 */ | |
| 6469 class EditOrganizeDirectivesResult implements HasToJson { | |
| 6470 SourceFileEdit _edit; | |
| 6471 | |
| 6472 /** | |
| 6473 * The file edit that is to be applied to the given file to effect the | |
| 6474 * organizing. | |
| 6475 */ | |
| 6476 SourceFileEdit get edit => _edit; | |
| 6477 | |
| 6478 /** | |
| 6479 * The file edit that is to be applied to the given file to effect the | |
| 6480 * organizing. | |
| 6481 */ | |
| 6482 void set edit(SourceFileEdit value) { | |
| 6483 assert(value != null); | |
| 6484 this._edit = value; | |
| 6485 } | |
| 6486 | |
| 6487 EditOrganizeDirectivesResult(SourceFileEdit edit) { | |
| 6488 this.edit = edit; | |
| 6489 } | |
| 6490 | |
| 6491 factory EditOrganizeDirectivesResult.fromJson(JsonDecoder jsonDecoder, String
jsonPath, Object json) { | |
| 6492 if (json == null) { | |
| 6493 json = {}; | |
| 6494 } | |
| 6495 if (json is Map) { | |
| 6496 SourceFileEdit edit; | |
| 6497 if (json.containsKey("edit")) { | |
| 6498 edit = new SourceFileEdit.fromJson(jsonDecoder, jsonPath + ".edit", json
["edit"]); | |
| 6499 } else { | |
| 6500 throw jsonDecoder.missingKey(jsonPath, "edit"); | |
| 6501 } | |
| 6502 return new EditOrganizeDirectivesResult(edit); | |
| 6503 } else { | |
| 6504 throw jsonDecoder.mismatch(jsonPath, "edit.organizeDirectives result", jso
n); | |
| 6505 } | |
| 6506 } | |
| 6507 | |
| 6508 factory EditOrganizeDirectivesResult.fromResponse(Response response) { | |
| 6509 return new EditOrganizeDirectivesResult.fromJson( | |
| 6510 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); | |
| 6511 } | |
| 6512 | |
| 6513 Map<String, dynamic> toJson() { | |
| 6514 Map<String, dynamic> result = {}; | |
| 6515 result["edit"] = edit.toJson(); | |
| 6516 return result; | |
| 6517 } | |
| 6518 | |
| 6519 Response toResponse(String id) { | |
| 6520 return new Response(id, result: toJson()); | |
| 6521 } | |
| 6522 | |
| 6523 @override | |
| 6524 String toString() => JSON.encode(toJson()); | |
| 6525 | |
| 6526 @override | |
| 6527 bool operator==(other) { | |
| 6528 if (other is EditOrganizeDirectivesResult) { | |
| 6529 return edit == other.edit; | |
| 6530 } | |
| 6531 return false; | |
| 6532 } | |
| 6533 | |
| 6534 @override | |
| 6535 int get hashCode { | |
| 6536 int hash = 0; | |
| 6537 hash = _JenkinsSmiHash.combine(hash, edit.hashCode); | |
| 6538 return _JenkinsSmiHash.finish(hash); | |
| 6539 } | |
| 6540 } | |
| 6541 | |
| 6542 /** | |
| 6543 * execution.createContext params | |
| 6544 * | |
| 6545 * { | |
| 6546 * "contextRoot": FilePath | |
| 6547 * } | |
| 6548 */ | |
| 6549 class ExecutionCreateContextParams implements HasToJson { | |
| 6550 String _contextRoot; | |
| 6551 | |
| 6552 /** | |
| 6553 * The path of the Dart or HTML file that will be launched, or the path of | |
| 6554 * the directory containing the file. | |
| 6555 */ | |
| 6556 String get contextRoot => _contextRoot; | |
| 6557 | |
| 6558 /** | |
| 6559 * The path of the Dart or HTML file that will be launched, or the path of | |
| 6560 * the directory containing the file. | |
| 6561 */ | |
| 6562 void set contextRoot(String value) { | |
| 6563 assert(value != null); | |
| 6564 this._contextRoot = value; | |
| 6565 } | |
| 6566 | |
| 6567 ExecutionCreateContextParams(String contextRoot) { | |
| 6568 this.contextRoot = contextRoot; | |
| 6569 } | |
| 6570 | |
| 6571 factory ExecutionCreateContextParams.fromJson(JsonDecoder jsonDecoder, String
jsonPath, Object json) { | |
| 6572 if (json == null) { | |
| 6573 json = {}; | |
| 6574 } | |
| 6575 if (json is Map) { | |
| 6576 String contextRoot; | |
| 6577 if (json.containsKey("contextRoot")) { | |
| 6578 contextRoot = jsonDecoder._decodeString(jsonPath + ".contextRoot", json[
"contextRoot"]); | |
| 6579 } else { | |
| 6580 throw jsonDecoder.missingKey(jsonPath, "contextRoot"); | |
| 6581 } | |
| 6582 return new ExecutionCreateContextParams(contextRoot); | |
| 6583 } else { | |
| 6584 throw jsonDecoder.mismatch(jsonPath, "execution.createContext params", jso
n); | |
| 6585 } | |
| 6586 } | |
| 6587 | |
| 6588 factory ExecutionCreateContextParams.fromRequest(Request request) { | |
| 6589 return new ExecutionCreateContextParams.fromJson( | |
| 6590 new RequestDecoder(request), "params", request._params); | |
| 6591 } | |
| 6592 | |
| 6593 Map<String, dynamic> toJson() { | |
| 6594 Map<String, dynamic> result = {}; | |
| 6595 result["contextRoot"] = contextRoot; | |
| 6596 return result; | |
| 6597 } | |
| 6598 | |
| 6599 Request toRequest(String id) { | |
| 6600 return new Request(id, "execution.createContext", toJson()); | |
| 6601 } | |
| 6602 | |
| 6603 @override | |
| 6604 String toString() => JSON.encode(toJson()); | |
| 6605 | |
| 6606 @override | |
| 6607 bool operator==(other) { | |
| 6608 if (other is ExecutionCreateContextParams) { | |
| 6609 return contextRoot == other.contextRoot; | |
| 6610 } | |
| 6611 return false; | |
| 6612 } | |
| 6613 | |
| 6614 @override | |
| 6615 int get hashCode { | |
| 6616 int hash = 0; | |
| 6617 hash = _JenkinsSmiHash.combine(hash, contextRoot.hashCode); | |
| 6618 return _JenkinsSmiHash.finish(hash); | |
| 6619 } | |
| 6620 } | |
| 6621 | |
| 6622 /** | |
| 6623 * execution.createContext result | |
| 6624 * | |
| 6625 * { | |
| 6626 * "id": ExecutionContextId | |
| 6627 * } | |
| 6628 */ | |
| 6629 class ExecutionCreateContextResult implements HasToJson { | |
| 6630 String _id; | |
| 6631 | |
| 6632 /** | |
| 6633 * The identifier used to refer to the execution context that was created. | |
| 6634 */ | |
| 6635 String get id => _id; | |
| 6636 | |
| 6637 /** | |
| 6638 * The identifier used to refer to the execution context that was created. | |
| 6639 */ | |
| 6640 void set id(String value) { | |
| 6641 assert(value != null); | |
| 6642 this._id = value; | |
| 6643 } | |
| 6644 | |
| 6645 ExecutionCreateContextResult(String id) { | |
| 6646 this.id = id; | |
| 6647 } | |
| 6648 | |
| 6649 factory ExecutionCreateContextResult.fromJson(JsonDecoder jsonDecoder, String
jsonPath, Object json) { | |
| 6650 if (json == null) { | |
| 6651 json = {}; | |
| 6652 } | |
| 6653 if (json is Map) { | |
| 6654 String id; | |
| 6655 if (json.containsKey("id")) { | |
| 6656 id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]); | |
| 6657 } else { | |
| 6658 throw jsonDecoder.missingKey(jsonPath, "id"); | |
| 6659 } | |
| 6660 return new ExecutionCreateContextResult(id); | |
| 6661 } else { | |
| 6662 throw jsonDecoder.mismatch(jsonPath, "execution.createContext result", jso
n); | |
| 6663 } | |
| 6664 } | |
| 6665 | |
| 6666 factory ExecutionCreateContextResult.fromResponse(Response response) { | |
| 6667 return new ExecutionCreateContextResult.fromJson( | |
| 6668 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); | |
| 6669 } | |
| 6670 | |
| 6671 Map<String, dynamic> toJson() { | |
| 6672 Map<String, dynamic> result = {}; | |
| 6673 result["id"] = id; | |
| 6674 return result; | |
| 6675 } | |
| 6676 | |
| 6677 Response toResponse(String id) { | |
| 6678 return new Response(id, result: toJson()); | |
| 6679 } | |
| 6680 | |
| 6681 @override | |
| 6682 String toString() => JSON.encode(toJson()); | |
| 6683 | |
| 6684 @override | |
| 6685 bool operator==(other) { | |
| 6686 if (other is ExecutionCreateContextResult) { | |
| 6687 return id == other.id; | |
| 6688 } | |
| 6689 return false; | |
| 6690 } | |
| 6691 | |
| 6692 @override | |
| 6693 int get hashCode { | |
| 6694 int hash = 0; | |
| 6695 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
| 6696 return _JenkinsSmiHash.finish(hash); | |
| 6697 } | |
| 6698 } | |
| 6699 | |
| 6700 /** | |
| 6701 * execution.deleteContext params | |
| 6702 * | |
| 6703 * { | |
| 6704 * "id": ExecutionContextId | |
| 6705 * } | |
| 6706 */ | |
| 6707 class ExecutionDeleteContextParams implements HasToJson { | |
| 6708 String _id; | |
| 6709 | |
| 6710 /** | |
| 6711 * The identifier of the execution context that is to be deleted. | |
| 6712 */ | |
| 6713 String get id => _id; | |
| 6714 | |
| 6715 /** | |
| 6716 * The identifier of the execution context that is to be deleted. | |
| 6717 */ | |
| 6718 void set id(String value) { | |
| 6719 assert(value != null); | |
| 6720 this._id = value; | |
| 6721 } | |
| 6722 | |
| 6723 ExecutionDeleteContextParams(String id) { | |
| 6724 this.id = id; | |
| 6725 } | |
| 6726 | |
| 6727 factory ExecutionDeleteContextParams.fromJson(JsonDecoder jsonDecoder, String
jsonPath, Object json) { | |
| 6728 if (json == null) { | |
| 6729 json = {}; | |
| 6730 } | |
| 6731 if (json is Map) { | |
| 6732 String id; | |
| 6733 if (json.containsKey("id")) { | |
| 6734 id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]); | |
| 6735 } else { | |
| 6736 throw jsonDecoder.missingKey(jsonPath, "id"); | |
| 6737 } | |
| 6738 return new ExecutionDeleteContextParams(id); | |
| 6739 } else { | |
| 6740 throw jsonDecoder.mismatch(jsonPath, "execution.deleteContext params", jso
n); | |
| 6741 } | |
| 6742 } | |
| 6743 | |
| 6744 factory ExecutionDeleteContextParams.fromRequest(Request request) { | |
| 6745 return new ExecutionDeleteContextParams.fromJson( | |
| 6746 new RequestDecoder(request), "params", request._params); | |
| 6747 } | |
| 6748 | |
| 6749 Map<String, dynamic> toJson() { | |
| 6750 Map<String, dynamic> result = {}; | |
| 6751 result["id"] = id; | |
| 6752 return result; | |
| 6753 } | |
| 6754 | |
| 6755 Request toRequest(String id) { | |
| 6756 return new Request(id, "execution.deleteContext", toJson()); | |
| 6757 } | |
| 6758 | |
| 6759 @override | |
| 6760 String toString() => JSON.encode(toJson()); | |
| 6761 | |
| 6762 @override | |
| 6763 bool operator==(other) { | |
| 6764 if (other is ExecutionDeleteContextParams) { | |
| 6765 return id == other.id; | |
| 6766 } | |
| 6767 return false; | |
| 6768 } | |
| 6769 | |
| 6770 @override | |
| 6771 int get hashCode { | |
| 6772 int hash = 0; | |
| 6773 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
| 6774 return _JenkinsSmiHash.finish(hash); | |
| 6775 } | |
| 6776 } | |
| 6777 /** | |
| 6778 * execution.deleteContext result | |
| 6779 */ | |
| 6780 class ExecutionDeleteContextResult { | |
| 6781 Response toResponse(String id) { | |
| 6782 return new Response(id, result: null); | |
| 6783 } | |
| 6784 | |
| 6785 @override | |
| 6786 bool operator==(other) { | |
| 6787 if (other is ExecutionDeleteContextResult) { | |
| 6788 return true; | |
| 6789 } | |
| 6790 return false; | |
| 6791 } | |
| 6792 | |
| 6793 @override | |
| 6794 int get hashCode { | |
| 6795 return 479954425; | |
| 6796 } | |
| 6797 } | |
| 6798 | |
| 6799 /** | |
| 6800 * execution.mapUri params | |
| 6801 * | |
| 6802 * { | |
| 6803 * "id": ExecutionContextId | |
| 6804 * "file": optional FilePath | |
| 6805 * "uri": optional String | |
| 6806 * } | |
| 6807 */ | |
| 6808 class ExecutionMapUriParams implements HasToJson { | |
| 6809 String _id; | |
| 6810 | |
| 6811 String _file; | |
| 6812 | |
| 6813 String _uri; | |
| 6814 | |
| 6815 /** | |
| 6816 * The identifier of the execution context in which the URI is to be mapped. | |
| 6817 */ | |
| 6818 String get id => _id; | |
| 6819 | |
| 6820 /** | |
| 6821 * The identifier of the execution context in which the URI is to be mapped. | |
| 6822 */ | |
| 6823 void set id(String value) { | |
| 6824 assert(value != null); | |
| 6825 this._id = value; | |
| 6826 } | |
| 6827 | |
| 6828 /** | |
| 6829 * The path of the file to be mapped into a URI. | |
| 6830 */ | |
| 6831 String get file => _file; | |
| 6832 | |
| 6833 /** | |
| 6834 * The path of the file to be mapped into a URI. | |
| 6835 */ | |
| 6836 void set file(String value) { | |
| 6837 this._file = value; | |
| 6838 } | |
| 6839 | |
| 6840 /** | |
| 6841 * The URI to be mapped into a file path. | |
| 6842 */ | |
| 6843 String get uri => _uri; | |
| 6844 | |
| 6845 /** | |
| 6846 * The URI to be mapped into a file path. | |
| 6847 */ | |
| 6848 void set uri(String value) { | |
| 6849 this._uri = value; | |
| 6850 } | |
| 6851 | |
| 6852 ExecutionMapUriParams(String id, {String file, String uri}) { | |
| 6853 this.id = id; | |
| 6854 this.file = file; | |
| 6855 this.uri = uri; | |
| 6856 } | |
| 6857 | |
| 6858 factory ExecutionMapUriParams.fromJson(JsonDecoder jsonDecoder, String jsonPat
h, Object json) { | |
| 6859 if (json == null) { | |
| 6860 json = {}; | |
| 6861 } | |
| 6862 if (json is Map) { | |
| 6863 String id; | |
| 6864 if (json.containsKey("id")) { | |
| 6865 id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]); | |
| 6866 } else { | |
| 6867 throw jsonDecoder.missingKey(jsonPath, "id"); | |
| 6868 } | |
| 6869 String file; | |
| 6870 if (json.containsKey("file")) { | |
| 6871 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 6872 } | |
| 6873 String uri; | |
| 6874 if (json.containsKey("uri")) { | |
| 6875 uri = jsonDecoder._decodeString(jsonPath + ".uri", json["uri"]); | |
| 6876 } | |
| 6877 return new ExecutionMapUriParams(id, file: file, uri: uri); | |
| 6878 } else { | |
| 6879 throw jsonDecoder.mismatch(jsonPath, "execution.mapUri params", json); | |
| 6880 } | |
| 6881 } | |
| 6882 | |
| 6883 factory ExecutionMapUriParams.fromRequest(Request request) { | |
| 6884 return new ExecutionMapUriParams.fromJson( | |
| 6885 new RequestDecoder(request), "params", request._params); | |
| 6886 } | |
| 6887 | |
| 6888 Map<String, dynamic> toJson() { | |
| 6889 Map<String, dynamic> result = {}; | |
| 6890 result["id"] = id; | |
| 6891 if (file != null) { | |
| 6892 result["file"] = file; | |
| 6893 } | |
| 6894 if (uri != null) { | |
| 6895 result["uri"] = uri; | |
| 6896 } | |
| 6897 return result; | |
| 6898 } | |
| 6899 | |
| 6900 Request toRequest(String id) { | |
| 6901 return new Request(id, "execution.mapUri", toJson()); | |
| 6902 } | |
| 6903 | |
| 6904 @override | |
| 6905 String toString() => JSON.encode(toJson()); | |
| 6906 | |
| 6907 @override | |
| 6908 bool operator==(other) { | |
| 6909 if (other is ExecutionMapUriParams) { | |
| 6910 return id == other.id && | |
| 6911 file == other.file && | |
| 6912 uri == other.uri; | |
| 6913 } | |
| 6914 return false; | |
| 6915 } | |
| 6916 | |
| 6917 @override | |
| 6918 int get hashCode { | |
| 6919 int hash = 0; | |
| 6920 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
| 6921 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 6922 hash = _JenkinsSmiHash.combine(hash, uri.hashCode); | |
| 6923 return _JenkinsSmiHash.finish(hash); | |
| 6924 } | |
| 6925 } | |
| 6926 | |
| 6927 /** | |
| 6928 * execution.mapUri result | |
| 6929 * | |
| 6930 * { | |
| 6931 * "file": optional FilePath | |
| 6932 * "uri": optional String | |
| 6933 * } | |
| 6934 */ | |
| 6935 class ExecutionMapUriResult implements HasToJson { | |
| 6936 String _file; | |
| 6937 | |
| 6938 String _uri; | |
| 6939 | |
| 6940 /** | |
| 6941 * The file to which the URI was mapped. This field is omitted if the uri | |
| 6942 * field was not given in the request. | |
| 6943 */ | |
| 6944 String get file => _file; | |
| 6945 | |
| 6946 /** | |
| 6947 * The file to which the URI was mapped. This field is omitted if the uri | |
| 6948 * field was not given in the request. | |
| 6949 */ | |
| 6950 void set file(String value) { | |
| 6951 this._file = value; | |
| 6952 } | |
| 6953 | |
| 6954 /** | |
| 6955 * The URI to which the file path was mapped. This field is omitted if the | |
| 6956 * file field was not given in the request. | |
| 6957 */ | |
| 6958 String get uri => _uri; | |
| 6959 | |
| 6960 /** | |
| 6961 * The URI to which the file path was mapped. This field is omitted if the | |
| 6962 * file field was not given in the request. | |
| 6963 */ | |
| 6964 void set uri(String value) { | |
| 6965 this._uri = value; | |
| 6966 } | |
| 6967 | |
| 6968 ExecutionMapUriResult({String file, String uri}) { | |
| 6969 this.file = file; | |
| 6970 this.uri = uri; | |
| 6971 } | |
| 6972 | |
| 6973 factory ExecutionMapUriResult.fromJson(JsonDecoder jsonDecoder, String jsonPat
h, Object json) { | |
| 6974 if (json == null) { | |
| 6975 json = {}; | |
| 6976 } | |
| 6977 if (json is Map) { | |
| 6978 String file; | |
| 6979 if (json.containsKey("file")) { | |
| 6980 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 6981 } | |
| 6982 String uri; | |
| 6983 if (json.containsKey("uri")) { | |
| 6984 uri = jsonDecoder._decodeString(jsonPath + ".uri", json["uri"]); | |
| 6985 } | |
| 6986 return new ExecutionMapUriResult(file: file, uri: uri); | |
| 6987 } else { | |
| 6988 throw jsonDecoder.mismatch(jsonPath, "execution.mapUri result", json); | |
| 6989 } | |
| 6990 } | |
| 6991 | |
| 6992 factory ExecutionMapUriResult.fromResponse(Response response) { | |
| 6993 return new ExecutionMapUriResult.fromJson( | |
| 6994 new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "
result", response._result); | |
| 6995 } | |
| 6996 | |
| 6997 Map<String, dynamic> toJson() { | |
| 6998 Map<String, dynamic> result = {}; | |
| 6999 if (file != null) { | |
| 7000 result["file"] = file; | |
| 7001 } | |
| 7002 if (uri != null) { | |
| 7003 result["uri"] = uri; | |
| 7004 } | |
| 7005 return result; | |
| 7006 } | |
| 7007 | |
| 7008 Response toResponse(String id) { | |
| 7009 return new Response(id, result: toJson()); | |
| 7010 } | |
| 7011 | |
| 7012 @override | |
| 7013 String toString() => JSON.encode(toJson()); | |
| 7014 | |
| 7015 @override | |
| 7016 bool operator==(other) { | |
| 7017 if (other is ExecutionMapUriResult) { | |
| 7018 return file == other.file && | |
| 7019 uri == other.uri; | |
| 7020 } | |
| 7021 return false; | |
| 7022 } | |
| 7023 | |
| 7024 @override | |
| 7025 int get hashCode { | |
| 7026 int hash = 0; | |
| 7027 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 7028 hash = _JenkinsSmiHash.combine(hash, uri.hashCode); | |
| 7029 return _JenkinsSmiHash.finish(hash); | |
| 7030 } | |
| 7031 } | |
| 7032 | |
| 7033 /** | |
| 7034 * execution.setSubscriptions params | |
| 7035 * | |
| 7036 * { | |
| 7037 * "subscriptions": List<ExecutionService> | |
| 7038 * } | |
| 7039 */ | |
| 7040 class ExecutionSetSubscriptionsParams implements HasToJson { | |
| 7041 List<ExecutionService> _subscriptions; | |
| 7042 | |
| 7043 /** | |
| 7044 * A list of the services being subscribed to. | |
| 7045 */ | |
| 7046 List<ExecutionService> get subscriptions => _subscriptions; | |
| 7047 | |
| 7048 /** | |
| 7049 * A list of the services being subscribed to. | |
| 7050 */ | |
| 7051 void set subscriptions(List<ExecutionService> value) { | |
| 7052 assert(value != null); | |
| 7053 this._subscriptions = value; | |
| 7054 } | |
| 7055 | |
| 7056 ExecutionSetSubscriptionsParams(List<ExecutionService> subscriptions) { | |
| 7057 this.subscriptions = subscriptions; | |
| 7058 } | |
| 7059 | |
| 7060 factory ExecutionSetSubscriptionsParams.fromJson(JsonDecoder jsonDecoder, Stri
ng jsonPath, Object json) { | |
| 7061 if (json == null) { | |
| 7062 json = {}; | |
| 7063 } | |
| 7064 if (json is Map) { | |
| 7065 List<ExecutionService> subscriptions; | |
| 7066 if (json.containsKey("subscriptions")) { | |
| 7067 subscriptions = jsonDecoder._decodeList(jsonPath + ".subscriptions", jso
n["subscriptions"], (String jsonPath, Object json) => new ExecutionService.fromJ
son(jsonDecoder, jsonPath, json)); | |
| 7068 } else { | |
| 7069 throw jsonDecoder.missingKey(jsonPath, "subscriptions"); | |
| 7070 } | |
| 7071 return new ExecutionSetSubscriptionsParams(subscriptions); | |
| 7072 } else { | |
| 7073 throw jsonDecoder.mismatch(jsonPath, "execution.setSubscriptions params",
json); | |
| 7074 } | |
| 7075 } | |
| 7076 | |
| 7077 factory ExecutionSetSubscriptionsParams.fromRequest(Request request) { | |
| 7078 return new ExecutionSetSubscriptionsParams.fromJson( | |
| 7079 new RequestDecoder(request), "params", request._params); | |
| 7080 } | |
| 7081 | |
| 7082 Map<String, dynamic> toJson() { | |
| 7083 Map<String, dynamic> result = {}; | |
| 7084 result["subscriptions"] = subscriptions.map((ExecutionService value) => valu
e.toJson()).toList(); | |
| 7085 return result; | |
| 7086 } | |
| 7087 | |
| 7088 Request toRequest(String id) { | |
| 7089 return new Request(id, "execution.setSubscriptions", toJson()); | |
| 7090 } | |
| 7091 | |
| 7092 @override | |
| 7093 String toString() => JSON.encode(toJson()); | |
| 7094 | |
| 7095 @override | |
| 7096 bool operator==(other) { | |
| 7097 if (other is ExecutionSetSubscriptionsParams) { | |
| 7098 return _listEqual(subscriptions, other.subscriptions, (ExecutionService a,
ExecutionService b) => a == b); | |
| 7099 } | |
| 7100 return false; | |
| 7101 } | |
| 7102 | |
| 7103 @override | |
| 7104 int get hashCode { | |
| 7105 int hash = 0; | |
| 7106 hash = _JenkinsSmiHash.combine(hash, subscriptions.hashCode); | |
| 7107 return _JenkinsSmiHash.finish(hash); | |
| 7108 } | |
| 7109 } | |
| 7110 /** | |
| 7111 * execution.setSubscriptions result | |
| 7112 */ | |
| 7113 class ExecutionSetSubscriptionsResult { | |
| 7114 Response toResponse(String id) { | |
| 7115 return new Response(id, result: null); | |
| 7116 } | |
| 7117 | |
| 7118 @override | |
| 7119 bool operator==(other) { | |
| 7120 if (other is ExecutionSetSubscriptionsResult) { | |
| 7121 return true; | |
| 7122 } | |
| 7123 return false; | |
| 7124 } | |
| 7125 | |
| 7126 @override | |
| 7127 int get hashCode { | |
| 7128 return 287678780; | |
| 7129 } | |
| 7130 } | |
| 7131 | |
| 7132 /** | |
| 7133 * execution.launchData params | |
| 7134 * | |
| 7135 * { | |
| 7136 * "file": FilePath | |
| 7137 * "kind": optional ExecutableKind | |
| 7138 * "referencedFiles": optional List<FilePath> | |
| 7139 * } | |
| 7140 */ | |
| 7141 class ExecutionLaunchDataParams implements HasToJson { | |
| 7142 String _file; | |
| 7143 | |
| 7144 ExecutableKind _kind; | |
| 7145 | |
| 7146 List<String> _referencedFiles; | |
| 7147 | |
| 7148 /** | |
| 7149 * The file for which launch data is being provided. This will either be a | |
| 7150 * Dart library or an HTML file. | |
| 7151 */ | |
| 7152 String get file => _file; | |
| 7153 | |
| 7154 /** | |
| 7155 * The file for which launch data is being provided. This will either be a | |
| 7156 * Dart library or an HTML file. | |
| 7157 */ | |
| 7158 void set file(String value) { | |
| 7159 assert(value != null); | |
| 7160 this._file = value; | |
| 7161 } | |
| 7162 | |
| 7163 /** | |
| 7164 * The kind of the executable file. This field is omitted if the file is not | |
| 7165 * a Dart file. | |
| 7166 */ | |
| 7167 ExecutableKind get kind => _kind; | |
| 7168 | |
| 7169 /** | |
| 7170 * The kind of the executable file. This field is omitted if the file is not | |
| 7171 * a Dart file. | |
| 7172 */ | |
| 7173 void set kind(ExecutableKind value) { | |
| 7174 this._kind = value; | |
| 7175 } | |
| 7176 | |
| 7177 /** | |
| 7178 * A list of the Dart files that are referenced by the file. This field is | |
| 7179 * omitted if the file is not an HTML file. | |
| 7180 */ | |
| 7181 List<String> get referencedFiles => _referencedFiles; | |
| 7182 | |
| 7183 /** | |
| 7184 * A list of the Dart files that are referenced by the file. This field is | |
| 7185 * omitted if the file is not an HTML file. | |
| 7186 */ | |
| 7187 void set referencedFiles(List<String> value) { | |
| 7188 this._referencedFiles = value; | |
| 7189 } | |
| 7190 | |
| 7191 ExecutionLaunchDataParams(String file, {ExecutableKind kind, List<String> refe
rencedFiles}) { | |
| 7192 this.file = file; | |
| 7193 this.kind = kind; | |
| 7194 this.referencedFiles = referencedFiles; | |
| 7195 } | |
| 7196 | |
| 7197 factory ExecutionLaunchDataParams.fromJson(JsonDecoder jsonDecoder, String jso
nPath, Object json) { | |
| 7198 if (json == null) { | |
| 7199 json = {}; | |
| 7200 } | |
| 7201 if (json is Map) { | |
| 7202 String file; | |
| 7203 if (json.containsKey("file")) { | |
| 7204 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 7205 } else { | |
| 7206 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 7207 } | |
| 7208 ExecutableKind kind; | |
| 7209 if (json.containsKey("kind")) { | |
| 7210 kind = new ExecutableKind.fromJson(jsonDecoder, jsonPath + ".kind", json
["kind"]); | |
| 7211 } | |
| 7212 List<String> referencedFiles; | |
| 7213 if (json.containsKey("referencedFiles")) { | |
| 7214 referencedFiles = jsonDecoder._decodeList(jsonPath + ".referencedFiles",
json["referencedFiles"], jsonDecoder._decodeString); | |
| 7215 } | |
| 7216 return new ExecutionLaunchDataParams(file, kind: kind, referencedFiles: re
ferencedFiles); | |
| 7217 } else { | |
| 7218 throw jsonDecoder.mismatch(jsonPath, "execution.launchData params", json); | |
| 7219 } | |
| 7220 } | |
| 7221 | |
| 7222 factory ExecutionLaunchDataParams.fromNotification(Notification notification)
{ | |
| 7223 return new ExecutionLaunchDataParams.fromJson( | |
| 7224 new ResponseDecoder(null), "params", notification._params); | |
| 7225 } | |
| 7226 | |
| 7227 Map<String, dynamic> toJson() { | |
| 7228 Map<String, dynamic> result = {}; | |
| 7229 result["file"] = file; | |
| 7230 if (kind != null) { | |
| 7231 result["kind"] = kind.toJson(); | |
| 7232 } | |
| 7233 if (referencedFiles != null) { | |
| 7234 result["referencedFiles"] = referencedFiles; | |
| 7235 } | |
| 7236 return result; | |
| 7237 } | |
| 7238 | |
| 7239 Notification toNotification() { | |
| 7240 return new Notification("execution.launchData", toJson()); | |
| 7241 } | |
| 7242 | |
| 7243 @override | |
| 7244 String toString() => JSON.encode(toJson()); | |
| 7245 | |
| 7246 @override | |
| 7247 bool operator==(other) { | |
| 7248 if (other is ExecutionLaunchDataParams) { | |
| 7249 return file == other.file && | |
| 7250 kind == other.kind && | |
| 7251 _listEqual(referencedFiles, other.referencedFiles, (String a, String b
) => a == b); | |
| 7252 } | |
| 7253 return false; | |
| 7254 } | |
| 7255 | |
| 7256 @override | |
| 7257 int get hashCode { | |
| 7258 int hash = 0; | |
| 7259 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 7260 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); | |
| 7261 hash = _JenkinsSmiHash.combine(hash, referencedFiles.hashCode); | |
| 7262 return _JenkinsSmiHash.finish(hash); | |
| 7263 } | |
| 7264 } | |
| 7265 | |
| 7266 /** | |
| 7267 * AddContentOverlay | |
| 7268 * | |
| 7269 * { | |
| 7270 * "type": "add" | |
| 7271 * "content": String | |
| 7272 * } | |
| 7273 */ | |
| 7274 class AddContentOverlay implements HasToJson { | |
| 7275 String _content; | |
| 7276 | |
| 7277 /** | |
| 7278 * The new content of the file. | |
| 7279 */ | |
| 7280 String get content => _content; | |
| 7281 | |
| 7282 /** | |
| 7283 * The new content of the file. | |
| 7284 */ | |
| 7285 void set content(String value) { | |
| 7286 assert(value != null); | |
| 7287 this._content = value; | |
| 7288 } | |
| 7289 | |
| 7290 AddContentOverlay(String content) { | |
| 7291 this.content = content; | |
| 7292 } | |
| 7293 | |
| 7294 factory AddContentOverlay.fromJson(JsonDecoder jsonDecoder, String jsonPath, O
bject json) { | |
| 7295 if (json == null) { | |
| 7296 json = {}; | |
| 7297 } | |
| 7298 if (json is Map) { | |
| 7299 if (json["type"] != "add") { | |
| 7300 throw jsonDecoder.mismatch(jsonPath, "equal " + "add", json); | |
| 7301 } | |
| 7302 String content; | |
| 7303 if (json.containsKey("content")) { | |
| 7304 content = jsonDecoder._decodeString(jsonPath + ".content", json["content
"]); | |
| 7305 } else { | |
| 7306 throw jsonDecoder.missingKey(jsonPath, "content"); | |
| 7307 } | |
| 7308 return new AddContentOverlay(content); | |
| 7309 } else { | |
| 7310 throw jsonDecoder.mismatch(jsonPath, "AddContentOverlay", json); | |
| 7311 } | |
| 7312 } | |
| 7313 | |
| 7314 Map<String, dynamic> toJson() { | |
| 7315 Map<String, dynamic> result = {}; | |
| 7316 result["type"] = "add"; | |
| 7317 result["content"] = content; | |
| 7318 return result; | |
| 7319 } | |
| 7320 | |
| 7321 @override | |
| 7322 String toString() => JSON.encode(toJson()); | |
| 7323 | |
| 7324 @override | |
| 7325 bool operator==(other) { | |
| 7326 if (other is AddContentOverlay) { | |
| 7327 return content == other.content; | |
| 7328 } | |
| 7329 return false; | |
| 7330 } | |
| 7331 | |
| 7332 @override | |
| 7333 int get hashCode { | |
| 7334 int hash = 0; | |
| 7335 hash = _JenkinsSmiHash.combine(hash, 704418402); | |
| 7336 hash = _JenkinsSmiHash.combine(hash, content.hashCode); | |
| 7337 return _JenkinsSmiHash.finish(hash); | |
| 7338 } | |
| 7339 } | |
| 7340 | |
| 7341 /** | |
| 7342 * AnalysisError | |
| 7343 * | |
| 7344 * { | |
| 7345 * "severity": AnalysisErrorSeverity | |
| 7346 * "type": AnalysisErrorType | |
| 7347 * "location": Location | |
| 7348 * "message": String | |
| 7349 * "correction": optional String | |
| 7350 * "hasFix": optional bool | |
| 7351 * } | |
| 7352 */ | |
| 7353 class AnalysisError implements HasToJson { | |
| 7354 AnalysisErrorSeverity _severity; | |
| 7355 | |
| 7356 AnalysisErrorType _type; | |
| 7357 | |
| 7358 Location _location; | |
| 7359 | |
| 7360 String _message; | |
| 7361 | |
| 7362 String _correction; | |
| 7363 | |
| 7364 bool _hasFix; | |
| 7365 | |
| 7366 /** | |
| 7367 * The severity of the error. | |
| 7368 */ | |
| 7369 AnalysisErrorSeverity get severity => _severity; | |
| 7370 | |
| 7371 /** | |
| 7372 * The severity of the error. | |
| 7373 */ | |
| 7374 void set severity(AnalysisErrorSeverity value) { | |
| 7375 assert(value != null); | |
| 7376 this._severity = value; | |
| 7377 } | |
| 7378 | |
| 7379 /** | |
| 7380 * The type of the error. | |
| 7381 */ | |
| 7382 AnalysisErrorType get type => _type; | |
| 7383 | |
| 7384 /** | |
| 7385 * The type of the error. | |
| 7386 */ | |
| 7387 void set type(AnalysisErrorType value) { | |
| 7388 assert(value != null); | |
| 7389 this._type = value; | |
| 7390 } | |
| 7391 | |
| 7392 /** | |
| 7393 * The location associated with the error. | |
| 7394 */ | |
| 7395 Location get location => _location; | |
| 7396 | |
| 7397 /** | |
| 7398 * The location associated with the error. | |
| 7399 */ | |
| 7400 void set location(Location value) { | |
| 7401 assert(value != null); | |
| 7402 this._location = value; | |
| 7403 } | |
| 7404 | |
| 7405 /** | |
| 7406 * The message to be displayed for this error. The message should indicate | |
| 7407 * what is wrong with the code and why it is wrong. | |
| 7408 */ | |
| 7409 String get message => _message; | |
| 7410 | |
| 7411 /** | |
| 7412 * The message to be displayed for this error. The message should indicate | |
| 7413 * what is wrong with the code and why it is wrong. | |
| 7414 */ | |
| 7415 void set message(String value) { | |
| 7416 assert(value != null); | |
| 7417 this._message = value; | |
| 7418 } | |
| 7419 | |
| 7420 /** | |
| 7421 * The correction message to be displayed for this error. The correction | |
| 7422 * message should indicate how the user can fix the error. The field is | |
| 7423 * omitted if there is no correction message associated with the error code. | |
| 7424 */ | |
| 7425 String get correction => _correction; | |
| 7426 | |
| 7427 /** | |
| 7428 * The correction message to be displayed for this error. The correction | |
| 7429 * message should indicate how the user can fix the error. The field is | |
| 7430 * omitted if there is no correction message associated with the error code. | |
| 7431 */ | |
| 7432 void set correction(String value) { | |
| 7433 this._correction = value; | |
| 7434 } | |
| 7435 | |
| 7436 /** | |
| 7437 * A hint to indicate to interested clients that this error has an associated | |
| 7438 * fix (or fixes). The absence of this field implies there are not known to | |
| 7439 * be fixes. Note that since the operation to calculate whether fixes apply | |
| 7440 * needs to be performant it is possible that complicated tests will be | |
| 7441 * skipped and a false negative returned. For this reason, this attribute | |
| 7442 * should be treated as a "hint". Despite the possibility of false negatives, | |
| 7443 * no false positives should be returned. If a client sees this flag set they | |
| 7444 * can proceed with the confidence that there are in fact associated fixes. | |
| 7445 */ | |
| 7446 bool get hasFix => _hasFix; | |
| 7447 | |
| 7448 /** | |
| 7449 * A hint to indicate to interested clients that this error has an associated | |
| 7450 * fix (or fixes). The absence of this field implies there are not known to | |
| 7451 * be fixes. Note that since the operation to calculate whether fixes apply | |
| 7452 * needs to be performant it is possible that complicated tests will be | |
| 7453 * skipped and a false negative returned. For this reason, this attribute | |
| 7454 * should be treated as a "hint". Despite the possibility of false negatives, | |
| 7455 * no false positives should be returned. If a client sees this flag set they | |
| 7456 * can proceed with the confidence that there are in fact associated fixes. | |
| 7457 */ | |
| 7458 void set hasFix(bool value) { | |
| 7459 this._hasFix = value; | |
| 7460 } | |
| 7461 | |
| 7462 AnalysisError(AnalysisErrorSeverity severity, AnalysisErrorType type, Location
location, String message, {String correction, bool hasFix}) { | |
| 7463 this.severity = severity; | |
| 7464 this.type = type; | |
| 7465 this.location = location; | |
| 7466 this.message = message; | |
| 7467 this.correction = correction; | |
| 7468 this.hasFix = hasFix; | |
| 7469 } | |
| 7470 | |
| 7471 factory AnalysisError.fromJson(JsonDecoder jsonDecoder, String jsonPath, Objec
t json) { | |
| 7472 if (json == null) { | |
| 7473 json = {}; | |
| 7474 } | |
| 7475 if (json is Map) { | |
| 7476 AnalysisErrorSeverity severity; | |
| 7477 if (json.containsKey("severity")) { | |
| 7478 severity = new AnalysisErrorSeverity.fromJson(jsonDecoder, jsonPath + ".
severity", json["severity"]); | |
| 7479 } else { | |
| 7480 throw jsonDecoder.missingKey(jsonPath, "severity"); | |
| 7481 } | |
| 7482 AnalysisErrorType type; | |
| 7483 if (json.containsKey("type")) { | |
| 7484 type = new AnalysisErrorType.fromJson(jsonDecoder, jsonPath + ".type", j
son["type"]); | |
| 7485 } else { | |
| 7486 throw jsonDecoder.missingKey(jsonPath, "type"); | |
| 7487 } | |
| 7488 Location location; | |
| 7489 if (json.containsKey("location")) { | |
| 7490 location = new Location.fromJson(jsonDecoder, jsonPath + ".location", js
on["location"]); | |
| 7491 } else { | |
| 7492 throw jsonDecoder.missingKey(jsonPath, "location"); | |
| 7493 } | |
| 7494 String message; | |
| 7495 if (json.containsKey("message")) { | |
| 7496 message = jsonDecoder._decodeString(jsonPath + ".message", json["message
"]); | |
| 7497 } else { | |
| 7498 throw jsonDecoder.missingKey(jsonPath, "message"); | |
| 7499 } | |
| 7500 String correction; | |
| 7501 if (json.containsKey("correction")) { | |
| 7502 correction = jsonDecoder._decodeString(jsonPath + ".correction", json["c
orrection"]); | |
| 7503 } | |
| 7504 bool hasFix; | |
| 7505 if (json.containsKey("hasFix")) { | |
| 7506 hasFix = jsonDecoder._decodeBool(jsonPath + ".hasFix", json["hasFix"]); | |
| 7507 } | |
| 7508 return new AnalysisError(severity, type, location, message, correction: co
rrection, hasFix: hasFix); | |
| 7509 } else { | |
| 7510 throw jsonDecoder.mismatch(jsonPath, "AnalysisError", json); | |
| 7511 } | |
| 7512 } | |
| 7513 | |
| 7514 Map<String, dynamic> toJson() { | |
| 7515 Map<String, dynamic> result = {}; | |
| 7516 result["severity"] = severity.toJson(); | |
| 7517 result["type"] = type.toJson(); | |
| 7518 result["location"] = location.toJson(); | |
| 7519 result["message"] = message; | |
| 7520 if (correction != null) { | |
| 7521 result["correction"] = correction; | |
| 7522 } | |
| 7523 if (hasFix != null) { | |
| 7524 result["hasFix"] = hasFix; | |
| 7525 } | |
| 7526 return result; | |
| 7527 } | |
| 7528 | |
| 7529 @override | |
| 7530 String toString() => JSON.encode(toJson()); | |
| 7531 | |
| 7532 @override | |
| 7533 bool operator==(other) { | |
| 7534 if (other is AnalysisError) { | |
| 7535 return severity == other.severity && | |
| 7536 type == other.type && | |
| 7537 location == other.location && | |
| 7538 message == other.message && | |
| 7539 correction == other.correction && | |
| 7540 hasFix == other.hasFix; | |
| 7541 } | |
| 7542 return false; | |
| 7543 } | |
| 7544 | |
| 7545 @override | |
| 7546 int get hashCode { | |
| 7547 int hash = 0; | |
| 7548 hash = _JenkinsSmiHash.combine(hash, severity.hashCode); | |
| 7549 hash = _JenkinsSmiHash.combine(hash, type.hashCode); | |
| 7550 hash = _JenkinsSmiHash.combine(hash, location.hashCode); | |
| 7551 hash = _JenkinsSmiHash.combine(hash, message.hashCode); | |
| 7552 hash = _JenkinsSmiHash.combine(hash, correction.hashCode); | |
| 7553 hash = _JenkinsSmiHash.combine(hash, hasFix.hashCode); | |
| 7554 return _JenkinsSmiHash.finish(hash); | |
| 7555 } | |
| 7556 } | |
| 7557 | |
| 7558 /** | |
| 7559 * AnalysisErrorFixes | |
| 7560 * | |
| 7561 * { | |
| 7562 * "error": AnalysisError | |
| 7563 * "fixes": List<SourceChange> | |
| 7564 * } | |
| 7565 */ | |
| 7566 class AnalysisErrorFixes implements HasToJson { | |
| 7567 AnalysisError _error; | |
| 7568 | |
| 7569 List<SourceChange> _fixes; | |
| 7570 | |
| 7571 /** | |
| 7572 * The error with which the fixes are associated. | |
| 7573 */ | |
| 7574 AnalysisError get error => _error; | |
| 7575 | |
| 7576 /** | |
| 7577 * The error with which the fixes are associated. | |
| 7578 */ | |
| 7579 void set error(AnalysisError value) { | |
| 7580 assert(value != null); | |
| 7581 this._error = value; | |
| 7582 } | |
| 7583 | |
| 7584 /** | |
| 7585 * The fixes associated with the error. | |
| 7586 */ | |
| 7587 List<SourceChange> get fixes => _fixes; | |
| 7588 | |
| 7589 /** | |
| 7590 * The fixes associated with the error. | |
| 7591 */ | |
| 7592 void set fixes(List<SourceChange> value) { | |
| 7593 assert(value != null); | |
| 7594 this._fixes = value; | |
| 7595 } | |
| 7596 | |
| 7597 AnalysisErrorFixes(AnalysisError error, {List<SourceChange> fixes}) { | |
| 7598 this.error = error; | |
| 7599 if (fixes == null) { | |
| 7600 this.fixes = <SourceChange>[]; | |
| 7601 } else { | |
| 7602 this.fixes = fixes; | |
| 7603 } | |
| 7604 } | |
| 7605 | |
| 7606 factory AnalysisErrorFixes.fromJson(JsonDecoder jsonDecoder, String jsonPath,
Object json) { | |
| 7607 if (json == null) { | |
| 7608 json = {}; | |
| 7609 } | |
| 7610 if (json is Map) { | |
| 7611 AnalysisError error; | |
| 7612 if (json.containsKey("error")) { | |
| 7613 error = new AnalysisError.fromJson(jsonDecoder, jsonPath + ".error", jso
n["error"]); | |
| 7614 } else { | |
| 7615 throw jsonDecoder.missingKey(jsonPath, "error"); | |
| 7616 } | |
| 7617 List<SourceChange> fixes; | |
| 7618 if (json.containsKey("fixes")) { | |
| 7619 fixes = jsonDecoder._decodeList(jsonPath + ".fixes", json["fixes"], (Str
ing jsonPath, Object json) => new SourceChange.fromJson(jsonDecoder, jsonPath, j
son)); | |
| 7620 } else { | |
| 7621 throw jsonDecoder.missingKey(jsonPath, "fixes"); | |
| 7622 } | |
| 7623 return new AnalysisErrorFixes(error, fixes: fixes); | |
| 7624 } else { | |
| 7625 throw jsonDecoder.mismatch(jsonPath, "AnalysisErrorFixes", json); | |
| 7626 } | |
| 7627 } | |
| 7628 | |
| 7629 Map<String, dynamic> toJson() { | |
| 7630 Map<String, dynamic> result = {}; | |
| 7631 result["error"] = error.toJson(); | |
| 7632 result["fixes"] = fixes.map((SourceChange value) => value.toJson()).toList()
; | |
| 7633 return result; | |
| 7634 } | |
| 7635 | |
| 7636 @override | |
| 7637 String toString() => JSON.encode(toJson()); | |
| 7638 | |
| 7639 @override | |
| 7640 bool operator==(other) { | |
| 7641 if (other is AnalysisErrorFixes) { | |
| 7642 return error == other.error && | |
| 7643 _listEqual(fixes, other.fixes, (SourceChange a, SourceChange b) => a =
= b); | |
| 7644 } | |
| 7645 return false; | |
| 7646 } | |
| 7647 | |
| 7648 @override | |
| 7649 int get hashCode { | |
| 7650 int hash = 0; | |
| 7651 hash = _JenkinsSmiHash.combine(hash, error.hashCode); | |
| 7652 hash = _JenkinsSmiHash.combine(hash, fixes.hashCode); | |
| 7653 return _JenkinsSmiHash.finish(hash); | |
| 7654 } | |
| 7655 } | |
| 7656 | |
| 7657 /** | |
| 7658 * AnalysisErrorSeverity | |
| 7659 * | |
| 7660 * enum { | |
| 7661 * INFO | |
| 7662 * WARNING | |
| 7663 * ERROR | |
| 7664 * } | |
| 7665 */ | |
| 7666 class AnalysisErrorSeverity implements Enum { | |
| 7667 static const INFO = const AnalysisErrorSeverity._("INFO"); | |
| 7668 | |
| 7669 static const WARNING = const AnalysisErrorSeverity._("WARNING"); | |
| 7670 | |
| 7671 static const ERROR = const AnalysisErrorSeverity._("ERROR"); | |
| 7672 | |
| 7673 /** | |
| 7674 * A list containing all of the enum values that are defined. | |
| 7675 */ | |
| 7676 static const List<AnalysisErrorSeverity> VALUES = const <AnalysisErrorSeverity
>[INFO, WARNING, ERROR]; | |
| 7677 | |
| 7678 final String name; | |
| 7679 | |
| 7680 const AnalysisErrorSeverity._(this.name); | |
| 7681 | |
| 7682 factory AnalysisErrorSeverity(String name) { | |
| 7683 switch (name) { | |
| 7684 case "INFO": | |
| 7685 return INFO; | |
| 7686 case "WARNING": | |
| 7687 return WARNING; | |
| 7688 case "ERROR": | |
| 7689 return ERROR; | |
| 7690 } | |
| 7691 throw new Exception('Illegal enum value: $name'); | |
| 7692 } | |
| 7693 | |
| 7694 factory AnalysisErrorSeverity.fromJson(JsonDecoder jsonDecoder, String jsonPat
h, Object json) { | |
| 7695 if (json is String) { | |
| 7696 try { | |
| 7697 return new AnalysisErrorSeverity(json); | |
| 7698 } catch(_) { | |
| 7699 // Fall through | |
| 7700 } | |
| 7701 } | |
| 7702 throw jsonDecoder.mismatch(jsonPath, "AnalysisErrorSeverity", json); | |
| 7703 } | |
| 7704 | |
| 7705 @override | |
| 7706 String toString() => "AnalysisErrorSeverity.$name"; | |
| 7707 | |
| 7708 String toJson() => name; | |
| 7709 } | |
| 7710 | |
| 7711 /** | |
| 7712 * AnalysisErrorType | |
| 7713 * | |
| 7714 * enum { | |
| 7715 * CHECKED_MODE_COMPILE_TIME_ERROR | |
| 7716 * COMPILE_TIME_ERROR | |
| 7717 * HINT | |
| 7718 * LINT | |
| 7719 * STATIC_TYPE_WARNING | |
| 7720 * STATIC_WARNING | |
| 7721 * SYNTACTIC_ERROR | |
| 7722 * TODO | |
| 7723 * } | |
| 7724 */ | |
| 7725 class AnalysisErrorType implements Enum { | |
| 7726 static const CHECKED_MODE_COMPILE_TIME_ERROR = const AnalysisErrorType._("CHEC
KED_MODE_COMPILE_TIME_ERROR"); | |
| 7727 | |
| 7728 static const COMPILE_TIME_ERROR = const AnalysisErrorType._("COMPILE_TIME_ERRO
R"); | |
| 7729 | |
| 7730 static const HINT = const AnalysisErrorType._("HINT"); | |
| 7731 | |
| 7732 static const LINT = const AnalysisErrorType._("LINT"); | |
| 7733 | |
| 7734 static const STATIC_TYPE_WARNING = const AnalysisErrorType._("STATIC_TYPE_WARN
ING"); | |
| 7735 | |
| 7736 static const STATIC_WARNING = const AnalysisErrorType._("STATIC_WARNING"); | |
| 7737 | |
| 7738 static const SYNTACTIC_ERROR = const AnalysisErrorType._("SYNTACTIC_ERROR"); | |
| 7739 | |
| 7740 static const TODO = const AnalysisErrorType._("TODO"); | |
| 7741 | |
| 7742 /** | |
| 7743 * A list containing all of the enum values that are defined. | |
| 7744 */ | |
| 7745 static const List<AnalysisErrorType> VALUES = const <AnalysisErrorType>[CHECKE
D_MODE_COMPILE_TIME_ERROR, COMPILE_TIME_ERROR, HINT, LINT, STATIC_TYPE_WARNING,
STATIC_WARNING, SYNTACTIC_ERROR, TODO]; | |
| 7746 | |
| 7747 final String name; | |
| 7748 | |
| 7749 const AnalysisErrorType._(this.name); | |
| 7750 | |
| 7751 factory AnalysisErrorType(String name) { | |
| 7752 switch (name) { | |
| 7753 case "CHECKED_MODE_COMPILE_TIME_ERROR": | |
| 7754 return CHECKED_MODE_COMPILE_TIME_ERROR; | |
| 7755 case "COMPILE_TIME_ERROR": | |
| 7756 return COMPILE_TIME_ERROR; | |
| 7757 case "HINT": | |
| 7758 return HINT; | |
| 7759 case "LINT": | |
| 7760 return LINT; | |
| 7761 case "STATIC_TYPE_WARNING": | |
| 7762 return STATIC_TYPE_WARNING; | |
| 7763 case "STATIC_WARNING": | |
| 7764 return STATIC_WARNING; | |
| 7765 case "SYNTACTIC_ERROR": | |
| 7766 return SYNTACTIC_ERROR; | |
| 7767 case "TODO": | |
| 7768 return TODO; | |
| 7769 } | |
| 7770 throw new Exception('Illegal enum value: $name'); | |
| 7771 } | |
| 7772 | |
| 7773 factory AnalysisErrorType.fromJson(JsonDecoder jsonDecoder, String jsonPath, O
bject json) { | |
| 7774 if (json is String) { | |
| 7775 try { | |
| 7776 return new AnalysisErrorType(json); | |
| 7777 } catch(_) { | |
| 7778 // Fall through | |
| 7779 } | |
| 7780 } | |
| 7781 throw jsonDecoder.mismatch(jsonPath, "AnalysisErrorType", json); | |
| 7782 } | |
| 7783 | |
| 7784 @override | |
| 7785 String toString() => "AnalysisErrorType.$name"; | |
| 7786 | |
| 7787 String toJson() => name; | |
| 7788 } | |
| 7789 | |
| 7790 /** | |
| 7791 * AnalysisOptions | |
| 7792 * | |
| 7793 * { | |
| 7794 * "enableAsync": optional bool | |
| 7795 * "enableDeferredLoading": optional bool | |
| 7796 * "enableEnums": optional bool | |
| 7797 * "enableNullAwareOperators": optional bool | |
| 7798 * "enableSuperMixins": optional bool | |
| 7799 * "generateDart2jsHints": optional bool | |
| 7800 * "generateHints": optional bool | |
| 7801 * "generateLints": optional bool | |
| 7802 * } | |
| 7803 */ | |
| 7804 class AnalysisOptions implements HasToJson { | |
| 7805 bool _enableAsync; | |
| 7806 | |
| 7807 bool _enableDeferredLoading; | |
| 7808 | |
| 7809 bool _enableEnums; | |
| 7810 | |
| 7811 bool _enableNullAwareOperators; | |
| 7812 | |
| 7813 bool _enableSuperMixins; | |
| 7814 | |
| 7815 bool _generateDart2jsHints; | |
| 7816 | |
| 7817 bool _generateHints; | |
| 7818 | |
| 7819 bool _generateLints; | |
| 7820 | |
| 7821 /** | |
| 7822 * Deprecated: this feature is always enabled. | |
| 7823 * | |
| 7824 * True if the client wants to enable support for the proposed async feature. | |
| 7825 */ | |
| 7826 bool get enableAsync => _enableAsync; | |
| 7827 | |
| 7828 /** | |
| 7829 * Deprecated: this feature is always enabled. | |
| 7830 * | |
| 7831 * True if the client wants to enable support for the proposed async feature. | |
| 7832 */ | |
| 7833 void set enableAsync(bool value) { | |
| 7834 this._enableAsync = value; | |
| 7835 } | |
| 7836 | |
| 7837 /** | |
| 7838 * Deprecated: this feature is always enabled. | |
| 7839 * | |
| 7840 * True if the client wants to enable support for the proposed deferred | |
| 7841 * loading feature. | |
| 7842 */ | |
| 7843 bool get enableDeferredLoading => _enableDeferredLoading; | |
| 7844 | |
| 7845 /** | |
| 7846 * Deprecated: this feature is always enabled. | |
| 7847 * | |
| 7848 * True if the client wants to enable support for the proposed deferred | |
| 7849 * loading feature. | |
| 7850 */ | |
| 7851 void set enableDeferredLoading(bool value) { | |
| 7852 this._enableDeferredLoading = value; | |
| 7853 } | |
| 7854 | |
| 7855 /** | |
| 7856 * Deprecated: this feature is always enabled. | |
| 7857 * | |
| 7858 * True if the client wants to enable support for the proposed enum feature. | |
| 7859 */ | |
| 7860 bool get enableEnums => _enableEnums; | |
| 7861 | |
| 7862 /** | |
| 7863 * Deprecated: this feature is always enabled. | |
| 7864 * | |
| 7865 * True if the client wants to enable support for the proposed enum feature. | |
| 7866 */ | |
| 7867 void set enableEnums(bool value) { | |
| 7868 this._enableEnums = value; | |
| 7869 } | |
| 7870 | |
| 7871 /** | |
| 7872 * Deprecated: this feature is always enabled. | |
| 7873 * | |
| 7874 * True if the client wants to enable support for the proposed "null aware | |
| 7875 * operators" feature. | |
| 7876 */ | |
| 7877 bool get enableNullAwareOperators => _enableNullAwareOperators; | |
| 7878 | |
| 7879 /** | |
| 7880 * Deprecated: this feature is always enabled. | |
| 7881 * | |
| 7882 * True if the client wants to enable support for the proposed "null aware | |
| 7883 * operators" feature. | |
| 7884 */ | |
| 7885 void set enableNullAwareOperators(bool value) { | |
| 7886 this._enableNullAwareOperators = value; | |
| 7887 } | |
| 7888 | |
| 7889 /** | |
| 7890 * True if the client wants to enable spport for the proposed "less | |
| 7891 * restricted mixins" proposal (DEP 34). | |
| 7892 */ | |
| 7893 bool get enableSuperMixins => _enableSuperMixins; | |
| 7894 | |
| 7895 /** | |
| 7896 * True if the client wants to enable spport for the proposed "less | |
| 7897 * restricted mixins" proposal (DEP 34). | |
| 7898 */ | |
| 7899 void set enableSuperMixins(bool value) { | |
| 7900 this._enableSuperMixins = value; | |
| 7901 } | |
| 7902 | |
| 7903 /** | |
| 7904 * True if hints that are specific to dart2js should be generated. This | |
| 7905 * option is ignored if generateHints is false. | |
| 7906 */ | |
| 7907 bool get generateDart2jsHints => _generateDart2jsHints; | |
| 7908 | |
| 7909 /** | |
| 7910 * True if hints that are specific to dart2js should be generated. This | |
| 7911 * option is ignored if generateHints is false. | |
| 7912 */ | |
| 7913 void set generateDart2jsHints(bool value) { | |
| 7914 this._generateDart2jsHints = value; | |
| 7915 } | |
| 7916 | |
| 7917 /** | |
| 7918 * True if hints should be generated as part of generating errors and | |
| 7919 * warnings. | |
| 7920 */ | |
| 7921 bool get generateHints => _generateHints; | |
| 7922 | |
| 7923 /** | |
| 7924 * True if hints should be generated as part of generating errors and | |
| 7925 * warnings. | |
| 7926 */ | |
| 7927 void set generateHints(bool value) { | |
| 7928 this._generateHints = value; | |
| 7929 } | |
| 7930 | |
| 7931 /** | |
| 7932 * True if lints should be generated as part of generating errors and | |
| 7933 * warnings. | |
| 7934 */ | |
| 7935 bool get generateLints => _generateLints; | |
| 7936 | |
| 7937 /** | |
| 7938 * True if lints should be generated as part of generating errors and | |
| 7939 * warnings. | |
| 7940 */ | |
| 7941 void set generateLints(bool value) { | |
| 7942 this._generateLints = value; | |
| 7943 } | |
| 7944 | |
| 7945 AnalysisOptions({bool enableAsync, bool enableDeferredLoading, bool enableEnum
s, bool enableNullAwareOperators, bool enableSuperMixins, bool generateDart2jsHi
nts, bool generateHints, bool generateLints}) { | |
| 7946 this.enableAsync = enableAsync; | |
| 7947 this.enableDeferredLoading = enableDeferredLoading; | |
| 7948 this.enableEnums = enableEnums; | |
| 7949 this.enableNullAwareOperators = enableNullAwareOperators; | |
| 7950 this.enableSuperMixins = enableSuperMixins; | |
| 7951 this.generateDart2jsHints = generateDart2jsHints; | |
| 7952 this.generateHints = generateHints; | |
| 7953 this.generateLints = generateLints; | |
| 7954 } | |
| 7955 | |
| 7956 factory AnalysisOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obj
ect json) { | |
| 7957 if (json == null) { | |
| 7958 json = {}; | |
| 7959 } | |
| 7960 if (json is Map) { | |
| 7961 bool enableAsync; | |
| 7962 if (json.containsKey("enableAsync")) { | |
| 7963 enableAsync = jsonDecoder._decodeBool(jsonPath + ".enableAsync", json["e
nableAsync"]); | |
| 7964 } | |
| 7965 bool enableDeferredLoading; | |
| 7966 if (json.containsKey("enableDeferredLoading")) { | |
| 7967 enableDeferredLoading = jsonDecoder._decodeBool(jsonPath + ".enableDefer
redLoading", json["enableDeferredLoading"]); | |
| 7968 } | |
| 7969 bool enableEnums; | |
| 7970 if (json.containsKey("enableEnums")) { | |
| 7971 enableEnums = jsonDecoder._decodeBool(jsonPath + ".enableEnums", json["e
nableEnums"]); | |
| 7972 } | |
| 7973 bool enableNullAwareOperators; | |
| 7974 if (json.containsKey("enableNullAwareOperators")) { | |
| 7975 enableNullAwareOperators = jsonDecoder._decodeBool(jsonPath + ".enableNu
llAwareOperators", json["enableNullAwareOperators"]); | |
| 7976 } | |
| 7977 bool enableSuperMixins; | |
| 7978 if (json.containsKey("enableSuperMixins")) { | |
| 7979 enableSuperMixins = jsonDecoder._decodeBool(jsonPath + ".enableSuperMixi
ns", json["enableSuperMixins"]); | |
| 7980 } | |
| 7981 bool generateDart2jsHints; | |
| 7982 if (json.containsKey("generateDart2jsHints")) { | |
| 7983 generateDart2jsHints = jsonDecoder._decodeBool(jsonPath + ".generateDart
2jsHints", json["generateDart2jsHints"]); | |
| 7984 } | |
| 7985 bool generateHints; | |
| 7986 if (json.containsKey("generateHints")) { | |
| 7987 generateHints = jsonDecoder._decodeBool(jsonPath + ".generateHints", jso
n["generateHints"]); | |
| 7988 } | |
| 7989 bool generateLints; | |
| 7990 if (json.containsKey("generateLints")) { | |
| 7991 generateLints = jsonDecoder._decodeBool(jsonPath + ".generateLints", jso
n["generateLints"]); | |
| 7992 } | |
| 7993 return new AnalysisOptions(enableAsync: enableAsync, enableDeferredLoading
: enableDeferredLoading, enableEnums: enableEnums, enableNullAwareOperators: ena
bleNullAwareOperators, enableSuperMixins: enableSuperMixins, generateDart2jsHint
s: generateDart2jsHints, generateHints: generateHints, generateLints: generateLi
nts); | |
| 7994 } else { | |
| 7995 throw jsonDecoder.mismatch(jsonPath, "AnalysisOptions", json); | |
| 7996 } | |
| 7997 } | |
| 7998 | |
| 7999 Map<String, dynamic> toJson() { | |
| 8000 Map<String, dynamic> result = {}; | |
| 8001 if (enableAsync != null) { | |
| 8002 result["enableAsync"] = enableAsync; | |
| 8003 } | |
| 8004 if (enableDeferredLoading != null) { | |
| 8005 result["enableDeferredLoading"] = enableDeferredLoading; | |
| 8006 } | |
| 8007 if (enableEnums != null) { | |
| 8008 result["enableEnums"] = enableEnums; | |
| 8009 } | |
| 8010 if (enableNullAwareOperators != null) { | |
| 8011 result["enableNullAwareOperators"] = enableNullAwareOperators; | |
| 8012 } | |
| 8013 if (enableSuperMixins != null) { | |
| 8014 result["enableSuperMixins"] = enableSuperMixins; | |
| 8015 } | |
| 8016 if (generateDart2jsHints != null) { | |
| 8017 result["generateDart2jsHints"] = generateDart2jsHints; | |
| 8018 } | |
| 8019 if (generateHints != null) { | |
| 8020 result["generateHints"] = generateHints; | |
| 8021 } | |
| 8022 if (generateLints != null) { | |
| 8023 result["generateLints"] = generateLints; | |
| 8024 } | |
| 8025 return result; | |
| 8026 } | |
| 8027 | |
| 8028 @override | |
| 8029 String toString() => JSON.encode(toJson()); | |
| 8030 | |
| 8031 @override | |
| 8032 bool operator==(other) { | |
| 8033 if (other is AnalysisOptions) { | |
| 8034 return enableAsync == other.enableAsync && | |
| 8035 enableDeferredLoading == other.enableDeferredLoading && | |
| 8036 enableEnums == other.enableEnums && | |
| 8037 enableNullAwareOperators == other.enableNullAwareOperators && | |
| 8038 enableSuperMixins == other.enableSuperMixins && | |
| 8039 generateDart2jsHints == other.generateDart2jsHints && | |
| 8040 generateHints == other.generateHints && | |
| 8041 generateLints == other.generateLints; | |
| 8042 } | |
| 8043 return false; | |
| 8044 } | |
| 8045 | |
| 8046 @override | |
| 8047 int get hashCode { | |
| 8048 int hash = 0; | |
| 8049 hash = _JenkinsSmiHash.combine(hash, enableAsync.hashCode); | |
| 8050 hash = _JenkinsSmiHash.combine(hash, enableDeferredLoading.hashCode); | |
| 8051 hash = _JenkinsSmiHash.combine(hash, enableEnums.hashCode); | |
| 8052 hash = _JenkinsSmiHash.combine(hash, enableNullAwareOperators.hashCode); | |
| 8053 hash = _JenkinsSmiHash.combine(hash, enableSuperMixins.hashCode); | |
| 8054 hash = _JenkinsSmiHash.combine(hash, generateDart2jsHints.hashCode); | |
| 8055 hash = _JenkinsSmiHash.combine(hash, generateHints.hashCode); | |
| 8056 hash = _JenkinsSmiHash.combine(hash, generateLints.hashCode); | |
| 8057 return _JenkinsSmiHash.finish(hash); | |
| 8058 } | |
| 8059 } | |
| 8060 | |
| 8061 /** | |
| 8062 * AnalysisService | |
| 8063 * | |
| 8064 * enum { | |
| 8065 * FOLDING | |
| 8066 * HIGHLIGHTS | |
| 8067 * IMPLEMENTED | |
| 8068 * INVALIDATE | |
| 8069 * NAVIGATION | |
| 8070 * OCCURRENCES | |
| 8071 * OUTLINE | |
| 8072 * OVERRIDES | |
| 8073 * } | |
| 8074 */ | |
| 8075 class AnalysisService implements Enum { | |
| 8076 static const FOLDING = const AnalysisService._("FOLDING"); | |
| 8077 | |
| 8078 static const HIGHLIGHTS = const AnalysisService._("HIGHLIGHTS"); | |
| 8079 | |
| 8080 static const IMPLEMENTED = const AnalysisService._("IMPLEMENTED"); | |
| 8081 | |
| 8082 /** | |
| 8083 * This service is not currently implemented and will become a | |
| 8084 * GeneralAnalysisService in a future release. | |
| 8085 */ | |
| 8086 static const INVALIDATE = const AnalysisService._("INVALIDATE"); | |
| 8087 | |
| 8088 static const NAVIGATION = const AnalysisService._("NAVIGATION"); | |
| 8089 | |
| 8090 static const OCCURRENCES = const AnalysisService._("OCCURRENCES"); | |
| 8091 | |
| 8092 static const OUTLINE = const AnalysisService._("OUTLINE"); | |
| 8093 | |
| 8094 static const OVERRIDES = const AnalysisService._("OVERRIDES"); | |
| 8095 | |
| 8096 /** | |
| 8097 * A list containing all of the enum values that are defined. | |
| 8098 */ | |
| 8099 static const List<AnalysisService> VALUES = const <AnalysisService>[FOLDING, H
IGHLIGHTS, IMPLEMENTED, INVALIDATE, NAVIGATION, OCCURRENCES, OUTLINE, OVERRIDES]
; | |
| 8100 | |
| 8101 final String name; | |
| 8102 | |
| 8103 const AnalysisService._(this.name); | |
| 8104 | |
| 8105 factory AnalysisService(String name) { | |
| 8106 switch (name) { | |
| 8107 case "FOLDING": | |
| 8108 return FOLDING; | |
| 8109 case "HIGHLIGHTS": | |
| 8110 return HIGHLIGHTS; | |
| 8111 case "IMPLEMENTED": | |
| 8112 return IMPLEMENTED; | |
| 8113 case "INVALIDATE": | |
| 8114 return INVALIDATE; | |
| 8115 case "NAVIGATION": | |
| 8116 return NAVIGATION; | |
| 8117 case "OCCURRENCES": | |
| 8118 return OCCURRENCES; | |
| 8119 case "OUTLINE": | |
| 8120 return OUTLINE; | |
| 8121 case "OVERRIDES": | |
| 8122 return OVERRIDES; | |
| 8123 } | |
| 8124 throw new Exception('Illegal enum value: $name'); | |
| 8125 } | |
| 8126 | |
| 8127 factory AnalysisService.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obj
ect json) { | |
| 8128 if (json is String) { | |
| 8129 try { | |
| 8130 return new AnalysisService(json); | |
| 8131 } catch(_) { | |
| 8132 // Fall through | |
| 8133 } | |
| 8134 } | |
| 8135 throw jsonDecoder.mismatch(jsonPath, "AnalysisService", json); | |
| 8136 } | |
| 8137 | |
| 8138 @override | |
| 8139 String toString() => "AnalysisService.$name"; | |
| 8140 | |
| 8141 String toJson() => name; | |
| 8142 } | |
| 8143 | |
| 8144 /** | |
| 8145 * AnalysisStatus | |
| 8146 * | |
| 8147 * { | |
| 8148 * "isAnalyzing": bool | |
| 8149 * "analysisTarget": optional String | |
| 8150 * } | |
| 8151 */ | |
| 8152 class AnalysisStatus implements HasToJson { | |
| 8153 bool _isAnalyzing; | |
| 8154 | |
| 8155 String _analysisTarget; | |
| 8156 | |
| 8157 /** | |
| 8158 * True if analysis is currently being performed. | |
| 8159 */ | |
| 8160 bool get isAnalyzing => _isAnalyzing; | |
| 8161 | |
| 8162 /** | |
| 8163 * True if analysis is currently being performed. | |
| 8164 */ | |
| 8165 void set isAnalyzing(bool value) { | |
| 8166 assert(value != null); | |
| 8167 this._isAnalyzing = value; | |
| 8168 } | |
| 8169 | |
| 8170 /** | |
| 8171 * The name of the current target of analysis. This field is omitted if | |
| 8172 * analyzing is false. | |
| 8173 */ | |
| 8174 String get analysisTarget => _analysisTarget; | |
| 8175 | |
| 8176 /** | |
| 8177 * The name of the current target of analysis. This field is omitted if | |
| 8178 * analyzing is false. | |
| 8179 */ | |
| 8180 void set analysisTarget(String value) { | |
| 8181 this._analysisTarget = value; | |
| 8182 } | |
| 8183 | |
| 8184 AnalysisStatus(bool isAnalyzing, {String analysisTarget}) { | |
| 8185 this.isAnalyzing = isAnalyzing; | |
| 8186 this.analysisTarget = analysisTarget; | |
| 8187 } | |
| 8188 | |
| 8189 factory AnalysisStatus.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obje
ct json) { | |
| 8190 if (json == null) { | |
| 8191 json = {}; | |
| 8192 } | |
| 8193 if (json is Map) { | |
| 8194 bool isAnalyzing; | |
| 8195 if (json.containsKey("isAnalyzing")) { | |
| 8196 isAnalyzing = jsonDecoder._decodeBool(jsonPath + ".isAnalyzing", json["i
sAnalyzing"]); | |
| 8197 } else { | |
| 8198 throw jsonDecoder.missingKey(jsonPath, "isAnalyzing"); | |
| 8199 } | |
| 8200 String analysisTarget; | |
| 8201 if (json.containsKey("analysisTarget")) { | |
| 8202 analysisTarget = jsonDecoder._decodeString(jsonPath + ".analysisTarget",
json["analysisTarget"]); | |
| 8203 } | |
| 8204 return new AnalysisStatus(isAnalyzing, analysisTarget: analysisTarget); | |
| 8205 } else { | |
| 8206 throw jsonDecoder.mismatch(jsonPath, "AnalysisStatus", json); | |
| 8207 } | |
| 8208 } | |
| 8209 | |
| 8210 Map<String, dynamic> toJson() { | |
| 8211 Map<String, dynamic> result = {}; | |
| 8212 result["isAnalyzing"] = isAnalyzing; | |
| 8213 if (analysisTarget != null) { | |
| 8214 result["analysisTarget"] = analysisTarget; | |
| 8215 } | |
| 8216 return result; | |
| 8217 } | |
| 8218 | |
| 8219 @override | |
| 8220 String toString() => JSON.encode(toJson()); | |
| 8221 | |
| 8222 @override | |
| 8223 bool operator==(other) { | |
| 8224 if (other is AnalysisStatus) { | |
| 8225 return isAnalyzing == other.isAnalyzing && | |
| 8226 analysisTarget == other.analysisTarget; | |
| 8227 } | |
| 8228 return false; | |
| 8229 } | |
| 8230 | |
| 8231 @override | |
| 8232 int get hashCode { | |
| 8233 int hash = 0; | |
| 8234 hash = _JenkinsSmiHash.combine(hash, isAnalyzing.hashCode); | |
| 8235 hash = _JenkinsSmiHash.combine(hash, analysisTarget.hashCode); | |
| 8236 return _JenkinsSmiHash.finish(hash); | |
| 8237 } | |
| 8238 } | |
| 8239 | |
| 8240 /** | |
| 8241 * ChangeContentOverlay | |
| 8242 * | |
| 8243 * { | |
| 8244 * "type": "change" | |
| 8245 * "edits": List<SourceEdit> | |
| 8246 * } | |
| 8247 */ | |
| 8248 class ChangeContentOverlay implements HasToJson { | |
| 8249 List<SourceEdit> _edits; | |
| 8250 | |
| 8251 /** | |
| 8252 * The edits to be applied to the file. | |
| 8253 */ | |
| 8254 List<SourceEdit> get edits => _edits; | |
| 8255 | |
| 8256 /** | |
| 8257 * The edits to be applied to the file. | |
| 8258 */ | |
| 8259 void set edits(List<SourceEdit> value) { | |
| 8260 assert(value != null); | |
| 8261 this._edits = value; | |
| 8262 } | |
| 8263 | |
| 8264 ChangeContentOverlay(List<SourceEdit> edits) { | |
| 8265 this.edits = edits; | |
| 8266 } | |
| 8267 | |
| 8268 factory ChangeContentOverlay.fromJson(JsonDecoder jsonDecoder, String jsonPath
, Object json) { | |
| 8269 if (json == null) { | |
| 8270 json = {}; | |
| 8271 } | |
| 8272 if (json is Map) { | |
| 8273 if (json["type"] != "change") { | |
| 8274 throw jsonDecoder.mismatch(jsonPath, "equal " + "change", json); | |
| 8275 } | |
| 8276 List<SourceEdit> edits; | |
| 8277 if (json.containsKey("edits")) { | |
| 8278 edits = jsonDecoder._decodeList(jsonPath + ".edits", json["edits"], (Str
ing jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, jso
n)); | |
| 8279 } else { | |
| 8280 throw jsonDecoder.missingKey(jsonPath, "edits"); | |
| 8281 } | |
| 8282 return new ChangeContentOverlay(edits); | |
| 8283 } else { | |
| 8284 throw jsonDecoder.mismatch(jsonPath, "ChangeContentOverlay", json); | |
| 8285 } | |
| 8286 } | |
| 8287 | |
| 8288 Map<String, dynamic> toJson() { | |
| 8289 Map<String, dynamic> result = {}; | |
| 8290 result["type"] = "change"; | |
| 8291 result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList(); | |
| 8292 return result; | |
| 8293 } | |
| 8294 | |
| 8295 @override | |
| 8296 String toString() => JSON.encode(toJson()); | |
| 8297 | |
| 8298 @override | |
| 8299 bool operator==(other) { | |
| 8300 if (other is ChangeContentOverlay) { | |
| 8301 return _listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a ==
b); | |
| 8302 } | |
| 8303 return false; | |
| 8304 } | |
| 8305 | |
| 8306 @override | |
| 8307 int get hashCode { | |
| 8308 int hash = 0; | |
| 8309 hash = _JenkinsSmiHash.combine(hash, 873118866); | |
| 8310 hash = _JenkinsSmiHash.combine(hash, edits.hashCode); | |
| 8311 return _JenkinsSmiHash.finish(hash); | |
| 8312 } | |
| 8313 } | |
| 8314 | |
| 8315 /** | |
| 8316 * CompletionSuggestion | |
| 8317 * | |
| 8318 * { | |
| 8319 * "kind": CompletionSuggestionKind | |
| 8320 * "relevance": int | |
| 8321 * "completion": String | |
| 8322 * "selectionOffset": int | |
| 8323 * "selectionLength": int | |
| 8324 * "isDeprecated": bool | |
| 8325 * "isPotential": bool | |
| 8326 * "docSummary": optional String | |
| 8327 * "docComplete": optional String | |
| 8328 * "declaringType": optional String | |
| 8329 * "element": optional Element | |
| 8330 * "returnType": optional String | |
| 8331 * "parameterNames": optional List<String> | |
| 8332 * "parameterTypes": optional List<String> | |
| 8333 * "requiredParameterCount": optional int | |
| 8334 * "hasNamedParameters": optional bool | |
| 8335 * "parameterName": optional String | |
| 8336 * "parameterType": optional String | |
| 8337 * "importUri": optional String | |
| 8338 * } | |
| 8339 */ | |
| 8340 class CompletionSuggestion implements HasToJson { | |
| 8341 CompletionSuggestionKind _kind; | |
| 8342 | |
| 8343 int _relevance; | |
| 8344 | |
| 8345 String _completion; | |
| 8346 | |
| 8347 int _selectionOffset; | |
| 8348 | |
| 8349 int _selectionLength; | |
| 8350 | |
| 8351 bool _isDeprecated; | |
| 8352 | |
| 8353 bool _isPotential; | |
| 8354 | |
| 8355 String _docSummary; | |
| 8356 | |
| 8357 String _docComplete; | |
| 8358 | |
| 8359 String _declaringType; | |
| 8360 | |
| 8361 Element _element; | |
| 8362 | |
| 8363 String _returnType; | |
| 8364 | |
| 8365 List<String> _parameterNames; | |
| 8366 | |
| 8367 List<String> _parameterTypes; | |
| 8368 | |
| 8369 int _requiredParameterCount; | |
| 8370 | |
| 8371 bool _hasNamedParameters; | |
| 8372 | |
| 8373 String _parameterName; | |
| 8374 | |
| 8375 String _parameterType; | |
| 8376 | |
| 8377 String _importUri; | |
| 8378 | |
| 8379 /** | |
| 8380 * The kind of element being suggested. | |
| 8381 */ | |
| 8382 CompletionSuggestionKind get kind => _kind; | |
| 8383 | |
| 8384 /** | |
| 8385 * The kind of element being suggested. | |
| 8386 */ | |
| 8387 void set kind(CompletionSuggestionKind value) { | |
| 8388 assert(value != null); | |
| 8389 this._kind = value; | |
| 8390 } | |
| 8391 | |
| 8392 /** | |
| 8393 * The relevance of this completion suggestion where a higher number | |
| 8394 * indicates a higher relevance. | |
| 8395 */ | |
| 8396 int get relevance => _relevance; | |
| 8397 | |
| 8398 /** | |
| 8399 * The relevance of this completion suggestion where a higher number | |
| 8400 * indicates a higher relevance. | |
| 8401 */ | |
| 8402 void set relevance(int value) { | |
| 8403 assert(value != null); | |
| 8404 this._relevance = value; | |
| 8405 } | |
| 8406 | |
| 8407 /** | |
| 8408 * The identifier to be inserted if the suggestion is selected. If the | |
| 8409 * suggestion is for a method or function, the client might want to | |
| 8410 * additionally insert a template for the parameters. The information | |
| 8411 * required in order to do so is contained in other fields. | |
| 8412 */ | |
| 8413 String get completion => _completion; | |
| 8414 | |
| 8415 /** | |
| 8416 * The identifier to be inserted if the suggestion is selected. If the | |
| 8417 * suggestion is for a method or function, the client might want to | |
| 8418 * additionally insert a template for the parameters. The information | |
| 8419 * required in order to do so is contained in other fields. | |
| 8420 */ | |
| 8421 void set completion(String value) { | |
| 8422 assert(value != null); | |
| 8423 this._completion = value; | |
| 8424 } | |
| 8425 | |
| 8426 /** | |
| 8427 * The offset, relative to the beginning of the completion, of where the | |
| 8428 * selection should be placed after insertion. | |
| 8429 */ | |
| 8430 int get selectionOffset => _selectionOffset; | |
| 8431 | |
| 8432 /** | |
| 8433 * The offset, relative to the beginning of the completion, of where the | |
| 8434 * selection should be placed after insertion. | |
| 8435 */ | |
| 8436 void set selectionOffset(int value) { | |
| 8437 assert(value != null); | |
| 8438 this._selectionOffset = value; | |
| 8439 } | |
| 8440 | |
| 8441 /** | |
| 8442 * The number of characters that should be selected after insertion. | |
| 8443 */ | |
| 8444 int get selectionLength => _selectionLength; | |
| 8445 | |
| 8446 /** | |
| 8447 * The number of characters that should be selected after insertion. | |
| 8448 */ | |
| 8449 void set selectionLength(int value) { | |
| 8450 assert(value != null); | |
| 8451 this._selectionLength = value; | |
| 8452 } | |
| 8453 | |
| 8454 /** | |
| 8455 * True if the suggested element is deprecated. | |
| 8456 */ | |
| 8457 bool get isDeprecated => _isDeprecated; | |
| 8458 | |
| 8459 /** | |
| 8460 * True if the suggested element is deprecated. | |
| 8461 */ | |
| 8462 void set isDeprecated(bool value) { | |
| 8463 assert(value != null); | |
| 8464 this._isDeprecated = value; | |
| 8465 } | |
| 8466 | |
| 8467 /** | |
| 8468 * True if the element is not known to be valid for the target. This happens | |
| 8469 * if the type of the target is dynamic. | |
| 8470 */ | |
| 8471 bool get isPotential => _isPotential; | |
| 8472 | |
| 8473 /** | |
| 8474 * True if the element is not known to be valid for the target. This happens | |
| 8475 * if the type of the target is dynamic. | |
| 8476 */ | |
| 8477 void set isPotential(bool value) { | |
| 8478 assert(value != null); | |
| 8479 this._isPotential = value; | |
| 8480 } | |
| 8481 | |
| 8482 /** | |
| 8483 * An abbreviated version of the Dartdoc associated with the element being | |
| 8484 * suggested, This field is omitted if there is no Dartdoc associated with | |
| 8485 * the element. | |
| 8486 */ | |
| 8487 String get docSummary => _docSummary; | |
| 8488 | |
| 8489 /** | |
| 8490 * An abbreviated version of the Dartdoc associated with the element being | |
| 8491 * suggested, This field is omitted if there is no Dartdoc associated with | |
| 8492 * the element. | |
| 8493 */ | |
| 8494 void set docSummary(String value) { | |
| 8495 this._docSummary = value; | |
| 8496 } | |
| 8497 | |
| 8498 /** | |
| 8499 * The Dartdoc associated with the element being suggested, This field is | |
| 8500 * omitted if there is no Dartdoc associated with the element. | |
| 8501 */ | |
| 8502 String get docComplete => _docComplete; | |
| 8503 | |
| 8504 /** | |
| 8505 * The Dartdoc associated with the element being suggested, This field is | |
| 8506 * omitted if there is no Dartdoc associated with the element. | |
| 8507 */ | |
| 8508 void set docComplete(String value) { | |
| 8509 this._docComplete = value; | |
| 8510 } | |
| 8511 | |
| 8512 /** | |
| 8513 * The class that declares the element being suggested. This field is omitted | |
| 8514 * if the suggested element is not a member of a class. | |
| 8515 */ | |
| 8516 String get declaringType => _declaringType; | |
| 8517 | |
| 8518 /** | |
| 8519 * The class that declares the element being suggested. This field is omitted | |
| 8520 * if the suggested element is not a member of a class. | |
| 8521 */ | |
| 8522 void set declaringType(String value) { | |
| 8523 this._declaringType = value; | |
| 8524 } | |
| 8525 | |
| 8526 /** | |
| 8527 * Information about the element reference being suggested. | |
| 8528 */ | |
| 8529 Element get element => _element; | |
| 8530 | |
| 8531 /** | |
| 8532 * Information about the element reference being suggested. | |
| 8533 */ | |
| 8534 void set element(Element value) { | |
| 8535 this._element = value; | |
| 8536 } | |
| 8537 | |
| 8538 /** | |
| 8539 * The return type of the getter, function or method or the type of the field | |
| 8540 * being suggested. This field is omitted if the suggested element is not a | |
| 8541 * getter, function or method. | |
| 8542 */ | |
| 8543 String get returnType => _returnType; | |
| 8544 | |
| 8545 /** | |
| 8546 * The return type of the getter, function or method or the type of the field | |
| 8547 * being suggested. This field is omitted if the suggested element is not a | |
| 8548 * getter, function or method. | |
| 8549 */ | |
| 8550 void set returnType(String value) { | |
| 8551 this._returnType = value; | |
| 8552 } | |
| 8553 | |
| 8554 /** | |
| 8555 * The names of the parameters of the function or method being suggested. | |
| 8556 * This field is omitted if the suggested element is not a setter, function | |
| 8557 * or method. | |
| 8558 */ | |
| 8559 List<String> get parameterNames => _parameterNames; | |
| 8560 | |
| 8561 /** | |
| 8562 * The names of the parameters of the function or method being suggested. | |
| 8563 * This field is omitted if the suggested element is not a setter, function | |
| 8564 * or method. | |
| 8565 */ | |
| 8566 void set parameterNames(List<String> value) { | |
| 8567 this._parameterNames = value; | |
| 8568 } | |
| 8569 | |
| 8570 /** | |
| 8571 * The types of the parameters of the function or method being suggested. | |
| 8572 * This field is omitted if the parameterNames field is omitted. | |
| 8573 */ | |
| 8574 List<String> get parameterTypes => _parameterTypes; | |
| 8575 | |
| 8576 /** | |
| 8577 * The types of the parameters of the function or method being suggested. | |
| 8578 * This field is omitted if the parameterNames field is omitted. | |
| 8579 */ | |
| 8580 void set parameterTypes(List<String> value) { | |
| 8581 this._parameterTypes = value; | |
| 8582 } | |
| 8583 | |
| 8584 /** | |
| 8585 * The number of required parameters for the function or method being | |
| 8586 * suggested. This field is omitted if the parameterNames field is omitted. | |
| 8587 */ | |
| 8588 int get requiredParameterCount => _requiredParameterCount; | |
| 8589 | |
| 8590 /** | |
| 8591 * The number of required parameters for the function or method being | |
| 8592 * suggested. This field is omitted if the parameterNames field is omitted. | |
| 8593 */ | |
| 8594 void set requiredParameterCount(int value) { | |
| 8595 this._requiredParameterCount = value; | |
| 8596 } | |
| 8597 | |
| 8598 /** | |
| 8599 * True if the function or method being suggested has at least one named | |
| 8600 * parameter. This field is omitted if the parameterNames field is omitted. | |
| 8601 */ | |
| 8602 bool get hasNamedParameters => _hasNamedParameters; | |
| 8603 | |
| 8604 /** | |
| 8605 * True if the function or method being suggested has at least one named | |
| 8606 * parameter. This field is omitted if the parameterNames field is omitted. | |
| 8607 */ | |
| 8608 void set hasNamedParameters(bool value) { | |
| 8609 this._hasNamedParameters = value; | |
| 8610 } | |
| 8611 | |
| 8612 /** | |
| 8613 * The name of the optional parameter being suggested. This field is omitted | |
| 8614 * if the suggestion is not the addition of an optional argument within an | |
| 8615 * argument list. | |
| 8616 */ | |
| 8617 String get parameterName => _parameterName; | |
| 8618 | |
| 8619 /** | |
| 8620 * The name of the optional parameter being suggested. This field is omitted | |
| 8621 * if the suggestion is not the addition of an optional argument within an | |
| 8622 * argument list. | |
| 8623 */ | |
| 8624 void set parameterName(String value) { | |
| 8625 this._parameterName = value; | |
| 8626 } | |
| 8627 | |
| 8628 /** | |
| 8629 * The type of the options parameter being suggested. This field is omitted | |
| 8630 * if the parameterName field is omitted. | |
| 8631 */ | |
| 8632 String get parameterType => _parameterType; | |
| 8633 | |
| 8634 /** | |
| 8635 * The type of the options parameter being suggested. This field is omitted | |
| 8636 * if the parameterName field is omitted. | |
| 8637 */ | |
| 8638 void set parameterType(String value) { | |
| 8639 this._parameterType = value; | |
| 8640 } | |
| 8641 | |
| 8642 /** | |
| 8643 * The import to be added if the suggestion is out of scope and needs an | |
| 8644 * import to be added to be in scope. | |
| 8645 */ | |
| 8646 String get importUri => _importUri; | |
| 8647 | |
| 8648 /** | |
| 8649 * The import to be added if the suggestion is out of scope and needs an | |
| 8650 * import to be added to be in scope. | |
| 8651 */ | |
| 8652 void set importUri(String value) { | |
| 8653 this._importUri = value; | |
| 8654 } | |
| 8655 | |
| 8656 CompletionSuggestion(CompletionSuggestionKind kind, int relevance, String comp
letion, int selectionOffset, int selectionLength, bool isDeprecated, bool isPote
ntial, {String docSummary, String docComplete, String declaringType, Element ele
ment, String returnType, List<String> parameterNames, List<String> parameterType
s, int requiredParameterCount, bool hasNamedParameters, String parameterName, St
ring parameterType, String importUri}) { | |
| 8657 this.kind = kind; | |
| 8658 this.relevance = relevance; | |
| 8659 this.completion = completion; | |
| 8660 this.selectionOffset = selectionOffset; | |
| 8661 this.selectionLength = selectionLength; | |
| 8662 this.isDeprecated = isDeprecated; | |
| 8663 this.isPotential = isPotential; | |
| 8664 this.docSummary = docSummary; | |
| 8665 this.docComplete = docComplete; | |
| 8666 this.declaringType = declaringType; | |
| 8667 this.element = element; | |
| 8668 this.returnType = returnType; | |
| 8669 this.parameterNames = parameterNames; | |
| 8670 this.parameterTypes = parameterTypes; | |
| 8671 this.requiredParameterCount = requiredParameterCount; | |
| 8672 this.hasNamedParameters = hasNamedParameters; | |
| 8673 this.parameterName = parameterName; | |
| 8674 this.parameterType = parameterType; | |
| 8675 this.importUri = importUri; | |
| 8676 } | |
| 8677 | |
| 8678 factory CompletionSuggestion.fromJson(JsonDecoder jsonDecoder, String jsonPath
, Object json) { | |
| 8679 if (json == null) { | |
| 8680 json = {}; | |
| 8681 } | |
| 8682 if (json is Map) { | |
| 8683 CompletionSuggestionKind kind; | |
| 8684 if (json.containsKey("kind")) { | |
| 8685 kind = new CompletionSuggestionKind.fromJson(jsonDecoder, jsonPath + ".k
ind", json["kind"]); | |
| 8686 } else { | |
| 8687 throw jsonDecoder.missingKey(jsonPath, "kind"); | |
| 8688 } | |
| 8689 int relevance; | |
| 8690 if (json.containsKey("relevance")) { | |
| 8691 relevance = jsonDecoder._decodeInt(jsonPath + ".relevance", json["releva
nce"]); | |
| 8692 } else { | |
| 8693 throw jsonDecoder.missingKey(jsonPath, "relevance"); | |
| 8694 } | |
| 8695 String completion; | |
| 8696 if (json.containsKey("completion")) { | |
| 8697 completion = jsonDecoder._decodeString(jsonPath + ".completion", json["c
ompletion"]); | |
| 8698 } else { | |
| 8699 throw jsonDecoder.missingKey(jsonPath, "completion"); | |
| 8700 } | |
| 8701 int selectionOffset; | |
| 8702 if (json.containsKey("selectionOffset")) { | |
| 8703 selectionOffset = jsonDecoder._decodeInt(jsonPath + ".selectionOffset",
json["selectionOffset"]); | |
| 8704 } else { | |
| 8705 throw jsonDecoder.missingKey(jsonPath, "selectionOffset"); | |
| 8706 } | |
| 8707 int selectionLength; | |
| 8708 if (json.containsKey("selectionLength")) { | |
| 8709 selectionLength = jsonDecoder._decodeInt(jsonPath + ".selectionLength",
json["selectionLength"]); | |
| 8710 } else { | |
| 8711 throw jsonDecoder.missingKey(jsonPath, "selectionLength"); | |
| 8712 } | |
| 8713 bool isDeprecated; | |
| 8714 if (json.containsKey("isDeprecated")) { | |
| 8715 isDeprecated = jsonDecoder._decodeBool(jsonPath + ".isDeprecated", json[
"isDeprecated"]); | |
| 8716 } else { | |
| 8717 throw jsonDecoder.missingKey(jsonPath, "isDeprecated"); | |
| 8718 } | |
| 8719 bool isPotential; | |
| 8720 if (json.containsKey("isPotential")) { | |
| 8721 isPotential = jsonDecoder._decodeBool(jsonPath + ".isPotential", json["i
sPotential"]); | |
| 8722 } else { | |
| 8723 throw jsonDecoder.missingKey(jsonPath, "isPotential"); | |
| 8724 } | |
| 8725 String docSummary; | |
| 8726 if (json.containsKey("docSummary")) { | |
| 8727 docSummary = jsonDecoder._decodeString(jsonPath + ".docSummary", json["d
ocSummary"]); | |
| 8728 } | |
| 8729 String docComplete; | |
| 8730 if (json.containsKey("docComplete")) { | |
| 8731 docComplete = jsonDecoder._decodeString(jsonPath + ".docComplete", json[
"docComplete"]); | |
| 8732 } | |
| 8733 String declaringType; | |
| 8734 if (json.containsKey("declaringType")) { | |
| 8735 declaringType = jsonDecoder._decodeString(jsonPath + ".declaringType", j
son["declaringType"]); | |
| 8736 } | |
| 8737 Element element; | |
| 8738 if (json.containsKey("element")) { | |
| 8739 element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json[
"element"]); | |
| 8740 } | |
| 8741 String returnType; | |
| 8742 if (json.containsKey("returnType")) { | |
| 8743 returnType = jsonDecoder._decodeString(jsonPath + ".returnType", json["r
eturnType"]); | |
| 8744 } | |
| 8745 List<String> parameterNames; | |
| 8746 if (json.containsKey("parameterNames")) { | |
| 8747 parameterNames = jsonDecoder._decodeList(jsonPath + ".parameterNames", j
son["parameterNames"], jsonDecoder._decodeString); | |
| 8748 } | |
| 8749 List<String> parameterTypes; | |
| 8750 if (json.containsKey("parameterTypes")) { | |
| 8751 parameterTypes = jsonDecoder._decodeList(jsonPath + ".parameterTypes", j
son["parameterTypes"], jsonDecoder._decodeString); | |
| 8752 } | |
| 8753 int requiredParameterCount; | |
| 8754 if (json.containsKey("requiredParameterCount")) { | |
| 8755 requiredParameterCount = jsonDecoder._decodeInt(jsonPath + ".requiredPar
ameterCount", json["requiredParameterCount"]); | |
| 8756 } | |
| 8757 bool hasNamedParameters; | |
| 8758 if (json.containsKey("hasNamedParameters")) { | |
| 8759 hasNamedParameters = jsonDecoder._decodeBool(jsonPath + ".hasNamedParame
ters", json["hasNamedParameters"]); | |
| 8760 } | |
| 8761 String parameterName; | |
| 8762 if (json.containsKey("parameterName")) { | |
| 8763 parameterName = jsonDecoder._decodeString(jsonPath + ".parameterName", j
son["parameterName"]); | |
| 8764 } | |
| 8765 String parameterType; | |
| 8766 if (json.containsKey("parameterType")) { | |
| 8767 parameterType = jsonDecoder._decodeString(jsonPath + ".parameterType", j
son["parameterType"]); | |
| 8768 } | |
| 8769 String importUri; | |
| 8770 if (json.containsKey("importUri")) { | |
| 8771 importUri = jsonDecoder._decodeString(jsonPath + ".importUri", json["imp
ortUri"]); | |
| 8772 } | |
| 8773 return new CompletionSuggestion(kind, relevance, completion, selectionOffs
et, selectionLength, isDeprecated, isPotential, docSummary: docSummary, docCompl
ete: docComplete, declaringType: declaringType, element: element, returnType: re
turnType, parameterNames: parameterNames, parameterTypes: parameterTypes, requir
edParameterCount: requiredParameterCount, hasNamedParameters: hasNamedParameters
, parameterName: parameterName, parameterType: parameterType, importUri: importU
ri); | |
| 8774 } else { | |
| 8775 throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestion", json); | |
| 8776 } | |
| 8777 } | |
| 8778 | |
| 8779 Map<String, dynamic> toJson() { | |
| 8780 Map<String, dynamic> result = {}; | |
| 8781 result["kind"] = kind.toJson(); | |
| 8782 result["relevance"] = relevance; | |
| 8783 result["completion"] = completion; | |
| 8784 result["selectionOffset"] = selectionOffset; | |
| 8785 result["selectionLength"] = selectionLength; | |
| 8786 result["isDeprecated"] = isDeprecated; | |
| 8787 result["isPotential"] = isPotential; | |
| 8788 if (docSummary != null) { | |
| 8789 result["docSummary"] = docSummary; | |
| 8790 } | |
| 8791 if (docComplete != null) { | |
| 8792 result["docComplete"] = docComplete; | |
| 8793 } | |
| 8794 if (declaringType != null) { | |
| 8795 result["declaringType"] = declaringType; | |
| 8796 } | |
| 8797 if (element != null) { | |
| 8798 result["element"] = element.toJson(); | |
| 8799 } | |
| 8800 if (returnType != null) { | |
| 8801 result["returnType"] = returnType; | |
| 8802 } | |
| 8803 if (parameterNames != null) { | |
| 8804 result["parameterNames"] = parameterNames; | |
| 8805 } | |
| 8806 if (parameterTypes != null) { | |
| 8807 result["parameterTypes"] = parameterTypes; | |
| 8808 } | |
| 8809 if (requiredParameterCount != null) { | |
| 8810 result["requiredParameterCount"] = requiredParameterCount; | |
| 8811 } | |
| 8812 if (hasNamedParameters != null) { | |
| 8813 result["hasNamedParameters"] = hasNamedParameters; | |
| 8814 } | |
| 8815 if (parameterName != null) { | |
| 8816 result["parameterName"] = parameterName; | |
| 8817 } | |
| 8818 if (parameterType != null) { | |
| 8819 result["parameterType"] = parameterType; | |
| 8820 } | |
| 8821 if (importUri != null) { | |
| 8822 result["importUri"] = importUri; | |
| 8823 } | |
| 8824 return result; | |
| 8825 } | |
| 8826 | |
| 8827 @override | |
| 8828 String toString() => JSON.encode(toJson()); | |
| 8829 | |
| 8830 @override | |
| 8831 bool operator==(other) { | |
| 8832 if (other is CompletionSuggestion) { | |
| 8833 return kind == other.kind && | |
| 8834 relevance == other.relevance && | |
| 8835 completion == other.completion && | |
| 8836 selectionOffset == other.selectionOffset && | |
| 8837 selectionLength == other.selectionLength && | |
| 8838 isDeprecated == other.isDeprecated && | |
| 8839 isPotential == other.isPotential && | |
| 8840 docSummary == other.docSummary && | |
| 8841 docComplete == other.docComplete && | |
| 8842 declaringType == other.declaringType && | |
| 8843 element == other.element && | |
| 8844 returnType == other.returnType && | |
| 8845 _listEqual(parameterNames, other.parameterNames, (String a, String b)
=> a == b) && | |
| 8846 _listEqual(parameterTypes, other.parameterTypes, (String a, String b)
=> a == b) && | |
| 8847 requiredParameterCount == other.requiredParameterCount && | |
| 8848 hasNamedParameters == other.hasNamedParameters && | |
| 8849 parameterName == other.parameterName && | |
| 8850 parameterType == other.parameterType && | |
| 8851 importUri == other.importUri; | |
| 8852 } | |
| 8853 return false; | |
| 8854 } | |
| 8855 | |
| 8856 @override | |
| 8857 int get hashCode { | |
| 8858 int hash = 0; | |
| 8859 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); | |
| 8860 hash = _JenkinsSmiHash.combine(hash, relevance.hashCode); | |
| 8861 hash = _JenkinsSmiHash.combine(hash, completion.hashCode); | |
| 8862 hash = _JenkinsSmiHash.combine(hash, selectionOffset.hashCode); | |
| 8863 hash = _JenkinsSmiHash.combine(hash, selectionLength.hashCode); | |
| 8864 hash = _JenkinsSmiHash.combine(hash, isDeprecated.hashCode); | |
| 8865 hash = _JenkinsSmiHash.combine(hash, isPotential.hashCode); | |
| 8866 hash = _JenkinsSmiHash.combine(hash, docSummary.hashCode); | |
| 8867 hash = _JenkinsSmiHash.combine(hash, docComplete.hashCode); | |
| 8868 hash = _JenkinsSmiHash.combine(hash, declaringType.hashCode); | |
| 8869 hash = _JenkinsSmiHash.combine(hash, element.hashCode); | |
| 8870 hash = _JenkinsSmiHash.combine(hash, returnType.hashCode); | |
| 8871 hash = _JenkinsSmiHash.combine(hash, parameterNames.hashCode); | |
| 8872 hash = _JenkinsSmiHash.combine(hash, parameterTypes.hashCode); | |
| 8873 hash = _JenkinsSmiHash.combine(hash, requiredParameterCount.hashCode); | |
| 8874 hash = _JenkinsSmiHash.combine(hash, hasNamedParameters.hashCode); | |
| 8875 hash = _JenkinsSmiHash.combine(hash, parameterName.hashCode); | |
| 8876 hash = _JenkinsSmiHash.combine(hash, parameterType.hashCode); | |
| 8877 hash = _JenkinsSmiHash.combine(hash, importUri.hashCode); | |
| 8878 return _JenkinsSmiHash.finish(hash); | |
| 8879 } | |
| 8880 } | |
| 8881 | |
| 8882 /** | |
| 8883 * CompletionSuggestionKind | |
| 8884 * | |
| 8885 * enum { | |
| 8886 * ARGUMENT_LIST | |
| 8887 * IMPORT | |
| 8888 * IDENTIFIER | |
| 8889 * INVOCATION | |
| 8890 * KEYWORD | |
| 8891 * NAMED_ARGUMENT | |
| 8892 * OPTIONAL_ARGUMENT | |
| 8893 * PARAMETER | |
| 8894 * } | |
| 8895 */ | |
| 8896 class CompletionSuggestionKind implements Enum { | |
| 8897 /** | |
| 8898 * A list of arguments for the method or function that is being invoked. For | |
| 8899 * this suggestion kind, the completion field is a textual representation of | |
| 8900 * the invocation and the parameterNames, parameterTypes, and | |
| 8901 * requiredParameterCount attributes are defined. | |
| 8902 */ | |
| 8903 static const ARGUMENT_LIST = const CompletionSuggestionKind._("ARGUMENT_LIST")
; | |
| 8904 | |
| 8905 static const IMPORT = const CompletionSuggestionKind._("IMPORT"); | |
| 8906 | |
| 8907 /** | |
| 8908 * The element identifier should be inserted at the completion location. For | |
| 8909 * example "someMethod" in import 'myLib.dart' show someMethod; . For | |
| 8910 * suggestions of this kind, the element attribute is defined and the | |
| 8911 * completion field is the element's identifier. | |
| 8912 */ | |
| 8913 static const IDENTIFIER = const CompletionSuggestionKind._("IDENTIFIER"); | |
| 8914 | |
| 8915 /** | |
| 8916 * The element is being invoked at the completion location. For example, | |
| 8917 * "someMethod" in x.someMethod(); . For suggestions of this kind, the | |
| 8918 * element attribute is defined and the completion field is the element's | |
| 8919 * identifier. | |
| 8920 */ | |
| 8921 static const INVOCATION = const CompletionSuggestionKind._("INVOCATION"); | |
| 8922 | |
| 8923 /** | |
| 8924 * A keyword is being suggested. For suggestions of this kind, the completion | |
| 8925 * is the keyword. | |
| 8926 */ | |
| 8927 static const KEYWORD = const CompletionSuggestionKind._("KEYWORD"); | |
| 8928 | |
| 8929 /** | |
| 8930 * A named argument for the current callsite is being suggested. For | |
| 8931 * suggestions of this kind, the completion is the named argument identifier | |
| 8932 * including a trailing ':' and space. | |
| 8933 */ | |
| 8934 static const NAMED_ARGUMENT = const CompletionSuggestionKind._("NAMED_ARGUMENT
"); | |
| 8935 | |
| 8936 static const OPTIONAL_ARGUMENT = const CompletionSuggestionKind._("OPTIONAL_AR
GUMENT"); | |
| 8937 | |
| 8938 static const PARAMETER = const CompletionSuggestionKind._("PARAMETER"); | |
| 8939 | |
| 8940 /** | |
| 8941 * A list containing all of the enum values that are defined. | |
| 8942 */ | |
| 8943 static const List<CompletionSuggestionKind> VALUES = const <CompletionSuggesti
onKind>[ARGUMENT_LIST, IMPORT, IDENTIFIER, INVOCATION, KEYWORD, NAMED_ARGUMENT,
OPTIONAL_ARGUMENT, PARAMETER]; | |
| 8944 | |
| 8945 final String name; | |
| 8946 | |
| 8947 const CompletionSuggestionKind._(this.name); | |
| 8948 | |
| 8949 factory CompletionSuggestionKind(String name) { | |
| 8950 switch (name) { | |
| 8951 case "ARGUMENT_LIST": | |
| 8952 return ARGUMENT_LIST; | |
| 8953 case "IMPORT": | |
| 8954 return IMPORT; | |
| 8955 case "IDENTIFIER": | |
| 8956 return IDENTIFIER; | |
| 8957 case "INVOCATION": | |
| 8958 return INVOCATION; | |
| 8959 case "KEYWORD": | |
| 8960 return KEYWORD; | |
| 8961 case "NAMED_ARGUMENT": | |
| 8962 return NAMED_ARGUMENT; | |
| 8963 case "OPTIONAL_ARGUMENT": | |
| 8964 return OPTIONAL_ARGUMENT; | |
| 8965 case "PARAMETER": | |
| 8966 return PARAMETER; | |
| 8967 } | |
| 8968 throw new Exception('Illegal enum value: $name'); | |
| 8969 } | |
| 8970 | |
| 8971 factory CompletionSuggestionKind.fromJson(JsonDecoder jsonDecoder, String json
Path, Object json) { | |
| 8972 if (json is String) { | |
| 8973 try { | |
| 8974 return new CompletionSuggestionKind(json); | |
| 8975 } catch(_) { | |
| 8976 // Fall through | |
| 8977 } | |
| 8978 } | |
| 8979 throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestionKind", json); | |
| 8980 } | |
| 8981 | |
| 8982 @override | |
| 8983 String toString() => "CompletionSuggestionKind.$name"; | |
| 8984 | |
| 8985 String toJson() => name; | |
| 8986 } | |
| 8987 | |
| 8988 /** | |
| 8989 * Element | |
| 8990 * | |
| 8991 * { | |
| 8992 * "kind": ElementKind | |
| 8993 * "name": String | |
| 8994 * "location": optional Location | |
| 8995 * "flags": int | |
| 8996 * "parameters": optional String | |
| 8997 * "returnType": optional String | |
| 8998 * "typeParameters": optional String | |
| 8999 * } | |
| 9000 */ | |
| 9001 class Element implements HasToJson { | |
| 9002 static const int FLAG_ABSTRACT = 0x01; | |
| 9003 static const int FLAG_CONST = 0x02; | |
| 9004 static const int FLAG_FINAL = 0x04; | |
| 9005 static const int FLAG_STATIC = 0x08; | |
| 9006 static const int FLAG_PRIVATE = 0x10; | |
| 9007 static const int FLAG_DEPRECATED = 0x20; | |
| 9008 | |
| 9009 static int makeFlags({isAbstract: false, isConst: false, isFinal: false, isSta
tic: false, isPrivate: false, isDeprecated: false}) { | |
| 9010 int flags = 0; | |
| 9011 if (isAbstract) flags |= FLAG_ABSTRACT; | |
| 9012 if (isConst) flags |= FLAG_CONST; | |
| 9013 if (isFinal) flags |= FLAG_FINAL; | |
| 9014 if (isStatic) flags |= FLAG_STATIC; | |
| 9015 if (isPrivate) flags |= FLAG_PRIVATE; | |
| 9016 if (isDeprecated) flags |= FLAG_DEPRECATED; | |
| 9017 return flags; | |
| 9018 } | |
| 9019 | |
| 9020 ElementKind _kind; | |
| 9021 | |
| 9022 String _name; | |
| 9023 | |
| 9024 Location _location; | |
| 9025 | |
| 9026 int _flags; | |
| 9027 | |
| 9028 String _parameters; | |
| 9029 | |
| 9030 String _returnType; | |
| 9031 | |
| 9032 String _typeParameters; | |
| 9033 | |
| 9034 /** | |
| 9035 * The kind of the element. | |
| 9036 */ | |
| 9037 ElementKind get kind => _kind; | |
| 9038 | |
| 9039 /** | |
| 9040 * The kind of the element. | |
| 9041 */ | |
| 9042 void set kind(ElementKind value) { | |
| 9043 assert(value != null); | |
| 9044 this._kind = value; | |
| 9045 } | |
| 9046 | |
| 9047 /** | |
| 9048 * The name of the element. This is typically used as the label in the | |
| 9049 * outline. | |
| 9050 */ | |
| 9051 String get name => _name; | |
| 9052 | |
| 9053 /** | |
| 9054 * The name of the element. This is typically used as the label in the | |
| 9055 * outline. | |
| 9056 */ | |
| 9057 void set name(String value) { | |
| 9058 assert(value != null); | |
| 9059 this._name = value; | |
| 9060 } | |
| 9061 | |
| 9062 /** | |
| 9063 * The location of the name in the declaration of the element. | |
| 9064 */ | |
| 9065 Location get location => _location; | |
| 9066 | |
| 9067 /** | |
| 9068 * The location of the name in the declaration of the element. | |
| 9069 */ | |
| 9070 void set location(Location value) { | |
| 9071 this._location = value; | |
| 9072 } | |
| 9073 | |
| 9074 /** | |
| 9075 * A bit-map containing the following flags: | |
| 9076 * | |
| 9077 * - 0x01 - set if the element is explicitly or implicitly abstract | |
| 9078 * - 0x02 - set if the element was declared to be ‘const’ | |
| 9079 * - 0x04 - set if the element was declared to be ‘final’ | |
| 9080 * - 0x08 - set if the element is a static member of a class or is a | |
| 9081 * top-level function or field | |
| 9082 * - 0x10 - set if the element is private | |
| 9083 * - 0x20 - set if the element is deprecated | |
| 9084 */ | |
| 9085 int get flags => _flags; | |
| 9086 | |
| 9087 /** | |
| 9088 * A bit-map containing the following flags: | |
| 9089 * | |
| 9090 * - 0x01 - set if the element is explicitly or implicitly abstract | |
| 9091 * - 0x02 - set if the element was declared to be ‘const’ | |
| 9092 * - 0x04 - set if the element was declared to be ‘final’ | |
| 9093 * - 0x08 - set if the element is a static member of a class or is a | |
| 9094 * top-level function or field | |
| 9095 * - 0x10 - set if the element is private | |
| 9096 * - 0x20 - set if the element is deprecated | |
| 9097 */ | |
| 9098 void set flags(int value) { | |
| 9099 assert(value != null); | |
| 9100 this._flags = value; | |
| 9101 } | |
| 9102 | |
| 9103 /** | |
| 9104 * The parameter list for the element. If the element is not a method or | |
| 9105 * function this field will not be defined. If the element doesn't have | |
| 9106 * parameters (e.g. getter), this field will not be defined. If the element | |
| 9107 * has zero parameters, this field will have a value of "()". | |
| 9108 */ | |
| 9109 String get parameters => _parameters; | |
| 9110 | |
| 9111 /** | |
| 9112 * The parameter list for the element. If the element is not a method or | |
| 9113 * function this field will not be defined. If the element doesn't have | |
| 9114 * parameters (e.g. getter), this field will not be defined. If the element | |
| 9115 * has zero parameters, this field will have a value of "()". | |
| 9116 */ | |
| 9117 void set parameters(String value) { | |
| 9118 this._parameters = value; | |
| 9119 } | |
| 9120 | |
| 9121 /** | |
| 9122 * The return type of the element. If the element is not a method or function | |
| 9123 * this field will not be defined. If the element does not have a declared | |
| 9124 * return type, this field will contain an empty string. | |
| 9125 */ | |
| 9126 String get returnType => _returnType; | |
| 9127 | |
| 9128 /** | |
| 9129 * The return type of the element. If the element is not a method or function | |
| 9130 * this field will not be defined. If the element does not have a declared | |
| 9131 * return type, this field will contain an empty string. | |
| 9132 */ | |
| 9133 void set returnType(String value) { | |
| 9134 this._returnType = value; | |
| 9135 } | |
| 9136 | |
| 9137 /** | |
| 9138 * The type parameter list for the element. If the element doesn't have type | |
| 9139 * parameters, this field will not be defined. | |
| 9140 */ | |
| 9141 String get typeParameters => _typeParameters; | |
| 9142 | |
| 9143 /** | |
| 9144 * The type parameter list for the element. If the element doesn't have type | |
| 9145 * parameters, this field will not be defined. | |
| 9146 */ | |
| 9147 void set typeParameters(String value) { | |
| 9148 this._typeParameters = value; | |
| 9149 } | |
| 9150 | |
| 9151 Element(ElementKind kind, String name, int flags, {Location location, String p
arameters, String returnType, String typeParameters}) { | |
| 9152 this.kind = kind; | |
| 9153 this.name = name; | |
| 9154 this.location = location; | |
| 9155 this.flags = flags; | |
| 9156 this.parameters = parameters; | |
| 9157 this.returnType = returnType; | |
| 9158 this.typeParameters = typeParameters; | |
| 9159 } | |
| 9160 | |
| 9161 factory Element.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json
) { | |
| 9162 if (json == null) { | |
| 9163 json = {}; | |
| 9164 } | |
| 9165 if (json is Map) { | |
| 9166 ElementKind kind; | |
| 9167 if (json.containsKey("kind")) { | |
| 9168 kind = new ElementKind.fromJson(jsonDecoder, jsonPath + ".kind", json["k
ind"]); | |
| 9169 } else { | |
| 9170 throw jsonDecoder.missingKey(jsonPath, "kind"); | |
| 9171 } | |
| 9172 String name; | |
| 9173 if (json.containsKey("name")) { | |
| 9174 name = jsonDecoder._decodeString(jsonPath + ".name", json["name"]); | |
| 9175 } else { | |
| 9176 throw jsonDecoder.missingKey(jsonPath, "name"); | |
| 9177 } | |
| 9178 Location location; | |
| 9179 if (json.containsKey("location")) { | |
| 9180 location = new Location.fromJson(jsonDecoder, jsonPath + ".location", js
on["location"]); | |
| 9181 } | |
| 9182 int flags; | |
| 9183 if (json.containsKey("flags")) { | |
| 9184 flags = jsonDecoder._decodeInt(jsonPath + ".flags", json["flags"]); | |
| 9185 } else { | |
| 9186 throw jsonDecoder.missingKey(jsonPath, "flags"); | |
| 9187 } | |
| 9188 String parameters; | |
| 9189 if (json.containsKey("parameters")) { | |
| 9190 parameters = jsonDecoder._decodeString(jsonPath + ".parameters", json["p
arameters"]); | |
| 9191 } | |
| 9192 String returnType; | |
| 9193 if (json.containsKey("returnType")) { | |
| 9194 returnType = jsonDecoder._decodeString(jsonPath + ".returnType", json["r
eturnType"]); | |
| 9195 } | |
| 9196 String typeParameters; | |
| 9197 if (json.containsKey("typeParameters")) { | |
| 9198 typeParameters = jsonDecoder._decodeString(jsonPath + ".typeParameters",
json["typeParameters"]); | |
| 9199 } | |
| 9200 return new Element(kind, name, flags, location: location, parameters: para
meters, returnType: returnType, typeParameters: typeParameters); | |
| 9201 } else { | |
| 9202 throw jsonDecoder.mismatch(jsonPath, "Element", json); | |
| 9203 } | |
| 9204 } | |
| 9205 | |
| 9206 bool get isAbstract => (flags & FLAG_ABSTRACT) != 0; | |
| 9207 bool get isConst => (flags & FLAG_CONST) != 0; | |
| 9208 bool get isFinal => (flags & FLAG_FINAL) != 0; | |
| 9209 bool get isStatic => (flags & FLAG_STATIC) != 0; | |
| 9210 bool get isPrivate => (flags & FLAG_PRIVATE) != 0; | |
| 9211 bool get isDeprecated => (flags & FLAG_DEPRECATED) != 0; | |
| 9212 | |
| 9213 Map<String, dynamic> toJson() { | |
| 9214 Map<String, dynamic> result = {}; | |
| 9215 result["kind"] = kind.toJson(); | |
| 9216 result["name"] = name; | |
| 9217 if (location != null) { | |
| 9218 result["location"] = location.toJson(); | |
| 9219 } | |
| 9220 result["flags"] = flags; | |
| 9221 if (parameters != null) { | |
| 9222 result["parameters"] = parameters; | |
| 9223 } | |
| 9224 if (returnType != null) { | |
| 9225 result["returnType"] = returnType; | |
| 9226 } | |
| 9227 if (typeParameters != null) { | |
| 9228 result["typeParameters"] = typeParameters; | |
| 9229 } | |
| 9230 return result; | |
| 9231 } | |
| 9232 | |
| 9233 @override | |
| 9234 String toString() => JSON.encode(toJson()); | |
| 9235 | |
| 9236 @override | |
| 9237 bool operator==(other) { | |
| 9238 if (other is Element) { | |
| 9239 return kind == other.kind && | |
| 9240 name == other.name && | |
| 9241 location == other.location && | |
| 9242 flags == other.flags && | |
| 9243 parameters == other.parameters && | |
| 9244 returnType == other.returnType && | |
| 9245 typeParameters == other.typeParameters; | |
| 9246 } | |
| 9247 return false; | |
| 9248 } | |
| 9249 | |
| 9250 @override | |
| 9251 int get hashCode { | |
| 9252 int hash = 0; | |
| 9253 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); | |
| 9254 hash = _JenkinsSmiHash.combine(hash, name.hashCode); | |
| 9255 hash = _JenkinsSmiHash.combine(hash, location.hashCode); | |
| 9256 hash = _JenkinsSmiHash.combine(hash, flags.hashCode); | |
| 9257 hash = _JenkinsSmiHash.combine(hash, parameters.hashCode); | |
| 9258 hash = _JenkinsSmiHash.combine(hash, returnType.hashCode); | |
| 9259 hash = _JenkinsSmiHash.combine(hash, typeParameters.hashCode); | |
| 9260 return _JenkinsSmiHash.finish(hash); | |
| 9261 } | |
| 9262 } | |
| 9263 | |
| 9264 /** | |
| 9265 * ElementKind | |
| 9266 * | |
| 9267 * enum { | |
| 9268 * CLASS | |
| 9269 * CLASS_TYPE_ALIAS | |
| 9270 * COMPILATION_UNIT | |
| 9271 * CONSTRUCTOR | |
| 9272 * ENUM | |
| 9273 * ENUM_CONSTANT | |
| 9274 * FIELD | |
| 9275 * FUNCTION | |
| 9276 * FUNCTION_TYPE_ALIAS | |
| 9277 * GETTER | |
| 9278 * LABEL | |
| 9279 * LIBRARY | |
| 9280 * LOCAL_VARIABLE | |
| 9281 * METHOD | |
| 9282 * PARAMETER | |
| 9283 * PREFIX | |
| 9284 * SETTER | |
| 9285 * TOP_LEVEL_VARIABLE | |
| 9286 * TYPE_PARAMETER | |
| 9287 * UNIT_TEST_GROUP | |
| 9288 * UNIT_TEST_TEST | |
| 9289 * UNKNOWN | |
| 9290 * } | |
| 9291 */ | |
| 9292 class ElementKind implements Enum { | |
| 9293 static const CLASS = const ElementKind._("CLASS"); | |
| 9294 | |
| 9295 static const CLASS_TYPE_ALIAS = const ElementKind._("CLASS_TYPE_ALIAS"); | |
| 9296 | |
| 9297 static const COMPILATION_UNIT = const ElementKind._("COMPILATION_UNIT"); | |
| 9298 | |
| 9299 static const CONSTRUCTOR = const ElementKind._("CONSTRUCTOR"); | |
| 9300 | |
| 9301 static const ENUM = const ElementKind._("ENUM"); | |
| 9302 | |
| 9303 static const ENUM_CONSTANT = const ElementKind._("ENUM_CONSTANT"); | |
| 9304 | |
| 9305 static const FIELD = const ElementKind._("FIELD"); | |
| 9306 | |
| 9307 static const FUNCTION = const ElementKind._("FUNCTION"); | |
| 9308 | |
| 9309 static const FUNCTION_TYPE_ALIAS = const ElementKind._("FUNCTION_TYPE_ALIAS"); | |
| 9310 | |
| 9311 static const GETTER = const ElementKind._("GETTER"); | |
| 9312 | |
| 9313 static const LABEL = const ElementKind._("LABEL"); | |
| 9314 | |
| 9315 static const LIBRARY = const ElementKind._("LIBRARY"); | |
| 9316 | |
| 9317 static const LOCAL_VARIABLE = const ElementKind._("LOCAL_VARIABLE"); | |
| 9318 | |
| 9319 static const METHOD = const ElementKind._("METHOD"); | |
| 9320 | |
| 9321 static const PARAMETER = const ElementKind._("PARAMETER"); | |
| 9322 | |
| 9323 static const PREFIX = const ElementKind._("PREFIX"); | |
| 9324 | |
| 9325 static const SETTER = const ElementKind._("SETTER"); | |
| 9326 | |
| 9327 static const TOP_LEVEL_VARIABLE = const ElementKind._("TOP_LEVEL_VARIABLE"); | |
| 9328 | |
| 9329 static const TYPE_PARAMETER = const ElementKind._("TYPE_PARAMETER"); | |
| 9330 | |
| 9331 static const UNIT_TEST_GROUP = const ElementKind._("UNIT_TEST_GROUP"); | |
| 9332 | |
| 9333 static const UNIT_TEST_TEST = const ElementKind._("UNIT_TEST_TEST"); | |
| 9334 | |
| 9335 static const UNKNOWN = const ElementKind._("UNKNOWN"); | |
| 9336 | |
| 9337 /** | |
| 9338 * A list containing all of the enum values that are defined. | |
| 9339 */ | |
| 9340 static const List<ElementKind> VALUES = const <ElementKind>[CLASS, CLASS_TYPE_
ALIAS, COMPILATION_UNIT, CONSTRUCTOR, ENUM, ENUM_CONSTANT, FIELD, FUNCTION, FUNC
TION_TYPE_ALIAS, GETTER, LABEL, LIBRARY, LOCAL_VARIABLE, METHOD, PARAMETER, PREF
IX, SETTER, TOP_LEVEL_VARIABLE, TYPE_PARAMETER, UNIT_TEST_GROUP, UNIT_TEST_TEST,
UNKNOWN]; | |
| 9341 | |
| 9342 final String name; | |
| 9343 | |
| 9344 const ElementKind._(this.name); | |
| 9345 | |
| 9346 factory ElementKind(String name) { | |
| 9347 switch (name) { | |
| 9348 case "CLASS": | |
| 9349 return CLASS; | |
| 9350 case "CLASS_TYPE_ALIAS": | |
| 9351 return CLASS_TYPE_ALIAS; | |
| 9352 case "COMPILATION_UNIT": | |
| 9353 return COMPILATION_UNIT; | |
| 9354 case "CONSTRUCTOR": | |
| 9355 return CONSTRUCTOR; | |
| 9356 case "ENUM": | |
| 9357 return ENUM; | |
| 9358 case "ENUM_CONSTANT": | |
| 9359 return ENUM_CONSTANT; | |
| 9360 case "FIELD": | |
| 9361 return FIELD; | |
| 9362 case "FUNCTION": | |
| 9363 return FUNCTION; | |
| 9364 case "FUNCTION_TYPE_ALIAS": | |
| 9365 return FUNCTION_TYPE_ALIAS; | |
| 9366 case "GETTER": | |
| 9367 return GETTER; | |
| 9368 case "LABEL": | |
| 9369 return LABEL; | |
| 9370 case "LIBRARY": | |
| 9371 return LIBRARY; | |
| 9372 case "LOCAL_VARIABLE": | |
| 9373 return LOCAL_VARIABLE; | |
| 9374 case "METHOD": | |
| 9375 return METHOD; | |
| 9376 case "PARAMETER": | |
| 9377 return PARAMETER; | |
| 9378 case "PREFIX": | |
| 9379 return PREFIX; | |
| 9380 case "SETTER": | |
| 9381 return SETTER; | |
| 9382 case "TOP_LEVEL_VARIABLE": | |
| 9383 return TOP_LEVEL_VARIABLE; | |
| 9384 case "TYPE_PARAMETER": | |
| 9385 return TYPE_PARAMETER; | |
| 9386 case "UNIT_TEST_GROUP": | |
| 9387 return UNIT_TEST_GROUP; | |
| 9388 case "UNIT_TEST_TEST": | |
| 9389 return UNIT_TEST_TEST; | |
| 9390 case "UNKNOWN": | |
| 9391 return UNKNOWN; | |
| 9392 } | |
| 9393 throw new Exception('Illegal enum value: $name'); | |
| 9394 } | |
| 9395 | |
| 9396 factory ElementKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object
json) { | |
| 9397 if (json is String) { | |
| 9398 try { | |
| 9399 return new ElementKind(json); | |
| 9400 } catch(_) { | |
| 9401 // Fall through | |
| 9402 } | |
| 9403 } | |
| 9404 throw jsonDecoder.mismatch(jsonPath, "ElementKind", json); | |
| 9405 } | |
| 9406 | |
| 9407 @override | |
| 9408 String toString() => "ElementKind.$name"; | |
| 9409 | |
| 9410 String toJson() => name; | |
| 9411 } | |
| 9412 | |
| 9413 /** | |
| 9414 * ExecutableFile | |
| 9415 * | |
| 9416 * { | |
| 9417 * "file": FilePath | |
| 9418 * "kind": ExecutableKind | |
| 9419 * } | |
| 9420 */ | |
| 9421 class ExecutableFile implements HasToJson { | |
| 9422 String _file; | |
| 9423 | |
| 9424 ExecutableKind _kind; | |
| 9425 | |
| 9426 /** | |
| 9427 * The path of the executable file. | |
| 9428 */ | |
| 9429 String get file => _file; | |
| 9430 | |
| 9431 /** | |
| 9432 * The path of the executable file. | |
| 9433 */ | |
| 9434 void set file(String value) { | |
| 9435 assert(value != null); | |
| 9436 this._file = value; | |
| 9437 } | |
| 9438 | |
| 9439 /** | |
| 9440 * The kind of the executable file. | |
| 9441 */ | |
| 9442 ExecutableKind get kind => _kind; | |
| 9443 | |
| 9444 /** | |
| 9445 * The kind of the executable file. | |
| 9446 */ | |
| 9447 void set kind(ExecutableKind value) { | |
| 9448 assert(value != null); | |
| 9449 this._kind = value; | |
| 9450 } | |
| 9451 | |
| 9452 ExecutableFile(String file, ExecutableKind kind) { | |
| 9453 this.file = file; | |
| 9454 this.kind = kind; | |
| 9455 } | |
| 9456 | |
| 9457 factory ExecutableFile.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obje
ct json) { | |
| 9458 if (json == null) { | |
| 9459 json = {}; | |
| 9460 } | |
| 9461 if (json is Map) { | |
| 9462 String file; | |
| 9463 if (json.containsKey("file")) { | |
| 9464 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 9465 } else { | |
| 9466 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 9467 } | |
| 9468 ExecutableKind kind; | |
| 9469 if (json.containsKey("kind")) { | |
| 9470 kind = new ExecutableKind.fromJson(jsonDecoder, jsonPath + ".kind", json
["kind"]); | |
| 9471 } else { | |
| 9472 throw jsonDecoder.missingKey(jsonPath, "kind"); | |
| 9473 } | |
| 9474 return new ExecutableFile(file, kind); | |
| 9475 } else { | |
| 9476 throw jsonDecoder.mismatch(jsonPath, "ExecutableFile", json); | |
| 9477 } | |
| 9478 } | |
| 9479 | |
| 9480 Map<String, dynamic> toJson() { | |
| 9481 Map<String, dynamic> result = {}; | |
| 9482 result["file"] = file; | |
| 9483 result["kind"] = kind.toJson(); | |
| 9484 return result; | |
| 9485 } | |
| 9486 | |
| 9487 @override | |
| 9488 String toString() => JSON.encode(toJson()); | |
| 9489 | |
| 9490 @override | |
| 9491 bool operator==(other) { | |
| 9492 if (other is ExecutableFile) { | |
| 9493 return file == other.file && | |
| 9494 kind == other.kind; | |
| 9495 } | |
| 9496 return false; | |
| 9497 } | |
| 9498 | |
| 9499 @override | |
| 9500 int get hashCode { | |
| 9501 int hash = 0; | |
| 9502 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 9503 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); | |
| 9504 return _JenkinsSmiHash.finish(hash); | |
| 9505 } | |
| 9506 } | |
| 9507 | |
| 9508 /** | |
| 9509 * ExecutableKind | |
| 9510 * | |
| 9511 * enum { | |
| 9512 * CLIENT | |
| 9513 * EITHER | |
| 9514 * NOT_EXECUTABLE | |
| 9515 * SERVER | |
| 9516 * } | |
| 9517 */ | |
| 9518 class ExecutableKind implements Enum { | |
| 9519 static const CLIENT = const ExecutableKind._("CLIENT"); | |
| 9520 | |
| 9521 static const EITHER = const ExecutableKind._("EITHER"); | |
| 9522 | |
| 9523 static const NOT_EXECUTABLE = const ExecutableKind._("NOT_EXECUTABLE"); | |
| 9524 | |
| 9525 static const SERVER = const ExecutableKind._("SERVER"); | |
| 9526 | |
| 9527 /** | |
| 9528 * A list containing all of the enum values that are defined. | |
| 9529 */ | |
| 9530 static const List<ExecutableKind> VALUES = const <ExecutableKind>[CLIENT, EITH
ER, NOT_EXECUTABLE, SERVER]; | |
| 9531 | |
| 9532 final String name; | |
| 9533 | |
| 9534 const ExecutableKind._(this.name); | |
| 9535 | |
| 9536 factory ExecutableKind(String name) { | |
| 9537 switch (name) { | |
| 9538 case "CLIENT": | |
| 9539 return CLIENT; | |
| 9540 case "EITHER": | |
| 9541 return EITHER; | |
| 9542 case "NOT_EXECUTABLE": | |
| 9543 return NOT_EXECUTABLE; | |
| 9544 case "SERVER": | |
| 9545 return SERVER; | |
| 9546 } | |
| 9547 throw new Exception('Illegal enum value: $name'); | |
| 9548 } | |
| 9549 | |
| 9550 factory ExecutableKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obje
ct json) { | |
| 9551 if (json is String) { | |
| 9552 try { | |
| 9553 return new ExecutableKind(json); | |
| 9554 } catch(_) { | |
| 9555 // Fall through | |
| 9556 } | |
| 9557 } | |
| 9558 throw jsonDecoder.mismatch(jsonPath, "ExecutableKind", json); | |
| 9559 } | |
| 9560 | |
| 9561 @override | |
| 9562 String toString() => "ExecutableKind.$name"; | |
| 9563 | |
| 9564 String toJson() => name; | |
| 9565 } | |
| 9566 | |
| 9567 /** | |
| 9568 * ExecutionService | |
| 9569 * | |
| 9570 * enum { | |
| 9571 * LAUNCH_DATA | |
| 9572 * } | |
| 9573 */ | |
| 9574 class ExecutionService implements Enum { | |
| 9575 static const LAUNCH_DATA = const ExecutionService._("LAUNCH_DATA"); | |
| 9576 | |
| 9577 /** | |
| 9578 * A list containing all of the enum values that are defined. | |
| 9579 */ | |
| 9580 static const List<ExecutionService> VALUES = const <ExecutionService>[LAUNCH_D
ATA]; | |
| 9581 | |
| 9582 final String name; | |
| 9583 | |
| 9584 const ExecutionService._(this.name); | |
| 9585 | |
| 9586 factory ExecutionService(String name) { | |
| 9587 switch (name) { | |
| 9588 case "LAUNCH_DATA": | |
| 9589 return LAUNCH_DATA; | |
| 9590 } | |
| 9591 throw new Exception('Illegal enum value: $name'); | |
| 9592 } | |
| 9593 | |
| 9594 factory ExecutionService.fromJson(JsonDecoder jsonDecoder, String jsonPath, Ob
ject json) { | |
| 9595 if (json is String) { | |
| 9596 try { | |
| 9597 return new ExecutionService(json); | |
| 9598 } catch(_) { | |
| 9599 // Fall through | |
| 9600 } | |
| 9601 } | |
| 9602 throw jsonDecoder.mismatch(jsonPath, "ExecutionService", json); | |
| 9603 } | |
| 9604 | |
| 9605 @override | |
| 9606 String toString() => "ExecutionService.$name"; | |
| 9607 | |
| 9608 String toJson() => name; | |
| 9609 } | |
| 9610 | |
| 9611 /** | |
| 9612 * FileKind | |
| 9613 * | |
| 9614 * enum { | |
| 9615 * LIBRARY | |
| 9616 * PART | |
| 9617 * } | |
| 9618 */ | |
| 9619 class FileKind implements Enum { | |
| 9620 static const LIBRARY = const FileKind._("LIBRARY"); | |
| 9621 | |
| 9622 static const PART = const FileKind._("PART"); | |
| 9623 | |
| 9624 /** | |
| 9625 * A list containing all of the enum values that are defined. | |
| 9626 */ | |
| 9627 static const List<FileKind> VALUES = const <FileKind>[LIBRARY, PART]; | |
| 9628 | |
| 9629 final String name; | |
| 9630 | |
| 9631 const FileKind._(this.name); | |
| 9632 | |
| 9633 factory FileKind(String name) { | |
| 9634 switch (name) { | |
| 9635 case "LIBRARY": | |
| 9636 return LIBRARY; | |
| 9637 case "PART": | |
| 9638 return PART; | |
| 9639 } | |
| 9640 throw new Exception('Illegal enum value: $name'); | |
| 9641 } | |
| 9642 | |
| 9643 factory FileKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object jso
n) { | |
| 9644 if (json is String) { | |
| 9645 try { | |
| 9646 return new FileKind(json); | |
| 9647 } catch(_) { | |
| 9648 // Fall through | |
| 9649 } | |
| 9650 } | |
| 9651 throw jsonDecoder.mismatch(jsonPath, "FileKind", json); | |
| 9652 } | |
| 9653 | |
| 9654 @override | |
| 9655 String toString() => "FileKind.$name"; | |
| 9656 | |
| 9657 String toJson() => name; | |
| 9658 } | |
| 9659 | |
| 9660 /** | |
| 9661 * FoldingKind | |
| 9662 * | |
| 9663 * enum { | |
| 9664 * COMMENT | |
| 9665 * CLASS_MEMBER | |
| 9666 * DIRECTIVES | |
| 9667 * DOCUMENTATION_COMMENT | |
| 9668 * TOP_LEVEL_DECLARATION | |
| 9669 * } | |
| 9670 */ | |
| 9671 class FoldingKind implements Enum { | |
| 9672 static const COMMENT = const FoldingKind._("COMMENT"); | |
| 9673 | |
| 9674 static const CLASS_MEMBER = const FoldingKind._("CLASS_MEMBER"); | |
| 9675 | |
| 9676 static const DIRECTIVES = const FoldingKind._("DIRECTIVES"); | |
| 9677 | |
| 9678 static const DOCUMENTATION_COMMENT = const FoldingKind._("DOCUMENTATION_COMMEN
T"); | |
| 9679 | |
| 9680 static const TOP_LEVEL_DECLARATION = const FoldingKind._("TOP_LEVEL_DECLARATIO
N"); | |
| 9681 | |
| 9682 /** | |
| 9683 * A list containing all of the enum values that are defined. | |
| 9684 */ | |
| 9685 static const List<FoldingKind> VALUES = const <FoldingKind>[COMMENT, CLASS_MEM
BER, DIRECTIVES, DOCUMENTATION_COMMENT, TOP_LEVEL_DECLARATION]; | |
| 9686 | |
| 9687 final String name; | |
| 9688 | |
| 9689 const FoldingKind._(this.name); | |
| 9690 | |
| 9691 factory FoldingKind(String name) { | |
| 9692 switch (name) { | |
| 9693 case "COMMENT": | |
| 9694 return COMMENT; | |
| 9695 case "CLASS_MEMBER": | |
| 9696 return CLASS_MEMBER; | |
| 9697 case "DIRECTIVES": | |
| 9698 return DIRECTIVES; | |
| 9699 case "DOCUMENTATION_COMMENT": | |
| 9700 return DOCUMENTATION_COMMENT; | |
| 9701 case "TOP_LEVEL_DECLARATION": | |
| 9702 return TOP_LEVEL_DECLARATION; | |
| 9703 } | |
| 9704 throw new Exception('Illegal enum value: $name'); | |
| 9705 } | |
| 9706 | |
| 9707 factory FoldingKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object
json) { | |
| 9708 if (json is String) { | |
| 9709 try { | |
| 9710 return new FoldingKind(json); | |
| 9711 } catch(_) { | |
| 9712 // Fall through | |
| 9713 } | |
| 9714 } | |
| 9715 throw jsonDecoder.mismatch(jsonPath, "FoldingKind", json); | |
| 9716 } | |
| 9717 | |
| 9718 @override | |
| 9719 String toString() => "FoldingKind.$name"; | |
| 9720 | |
| 9721 String toJson() => name; | |
| 9722 } | |
| 9723 | |
| 9724 /** | |
| 9725 * FoldingRegion | |
| 9726 * | |
| 9727 * { | |
| 9728 * "kind": FoldingKind | |
| 9729 * "offset": int | |
| 9730 * "length": int | |
| 9731 * } | |
| 9732 */ | |
| 9733 class FoldingRegion implements HasToJson { | |
| 9734 FoldingKind _kind; | |
| 9735 | |
| 9736 int _offset; | |
| 9737 | |
| 9738 int _length; | |
| 9739 | |
| 9740 /** | |
| 9741 * The kind of the region. | |
| 9742 */ | |
| 9743 FoldingKind get kind => _kind; | |
| 9744 | |
| 9745 /** | |
| 9746 * The kind of the region. | |
| 9747 */ | |
| 9748 void set kind(FoldingKind value) { | |
| 9749 assert(value != null); | |
| 9750 this._kind = value; | |
| 9751 } | |
| 9752 | |
| 9753 /** | |
| 9754 * The offset of the region to be folded. | |
| 9755 */ | |
| 9756 int get offset => _offset; | |
| 9757 | |
| 9758 /** | |
| 9759 * The offset of the region to be folded. | |
| 9760 */ | |
| 9761 void set offset(int value) { | |
| 9762 assert(value != null); | |
| 9763 this._offset = value; | |
| 9764 } | |
| 9765 | |
| 9766 /** | |
| 9767 * The length of the region to be folded. | |
| 9768 */ | |
| 9769 int get length => _length; | |
| 9770 | |
| 9771 /** | |
| 9772 * The length of the region to be folded. | |
| 9773 */ | |
| 9774 void set length(int value) { | |
| 9775 assert(value != null); | |
| 9776 this._length = value; | |
| 9777 } | |
| 9778 | |
| 9779 FoldingRegion(FoldingKind kind, int offset, int length) { | |
| 9780 this.kind = kind; | |
| 9781 this.offset = offset; | |
| 9782 this.length = length; | |
| 9783 } | |
| 9784 | |
| 9785 factory FoldingRegion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Objec
t json) { | |
| 9786 if (json == null) { | |
| 9787 json = {}; | |
| 9788 } | |
| 9789 if (json is Map) { | |
| 9790 FoldingKind kind; | |
| 9791 if (json.containsKey("kind")) { | |
| 9792 kind = new FoldingKind.fromJson(jsonDecoder, jsonPath + ".kind", json["k
ind"]); | |
| 9793 } else { | |
| 9794 throw jsonDecoder.missingKey(jsonPath, "kind"); | |
| 9795 } | |
| 9796 int offset; | |
| 9797 if (json.containsKey("offset")) { | |
| 9798 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 9799 } else { | |
| 9800 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 9801 } | |
| 9802 int length; | |
| 9803 if (json.containsKey("length")) { | |
| 9804 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | |
| 9805 } else { | |
| 9806 throw jsonDecoder.missingKey(jsonPath, "length"); | |
| 9807 } | |
| 9808 return new FoldingRegion(kind, offset, length); | |
| 9809 } else { | |
| 9810 throw jsonDecoder.mismatch(jsonPath, "FoldingRegion", json); | |
| 9811 } | |
| 9812 } | |
| 9813 | |
| 9814 Map<String, dynamic> toJson() { | |
| 9815 Map<String, dynamic> result = {}; | |
| 9816 result["kind"] = kind.toJson(); | |
| 9817 result["offset"] = offset; | |
| 9818 result["length"] = length; | |
| 9819 return result; | |
| 9820 } | |
| 9821 | |
| 9822 @override | |
| 9823 String toString() => JSON.encode(toJson()); | |
| 9824 | |
| 9825 @override | |
| 9826 bool operator==(other) { | |
| 9827 if (other is FoldingRegion) { | |
| 9828 return kind == other.kind && | |
| 9829 offset == other.offset && | |
| 9830 length == other.length; | |
| 9831 } | |
| 9832 return false; | |
| 9833 } | |
| 9834 | |
| 9835 @override | |
| 9836 int get hashCode { | |
| 9837 int hash = 0; | |
| 9838 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); | |
| 9839 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 9840 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
| 9841 return _JenkinsSmiHash.finish(hash); | |
| 9842 } | |
| 9843 } | |
| 9844 | |
| 9845 /** | |
| 9846 * GeneralAnalysisService | |
| 9847 * | |
| 9848 * enum { | |
| 9849 * ANALYZED_FILES | |
| 9850 * } | |
| 9851 */ | |
| 9852 class GeneralAnalysisService implements Enum { | |
| 9853 static const ANALYZED_FILES = const GeneralAnalysisService._("ANALYZED_FILES")
; | |
| 9854 | |
| 9855 /** | |
| 9856 * A list containing all of the enum values that are defined. | |
| 9857 */ | |
| 9858 static const List<GeneralAnalysisService> VALUES = const <GeneralAnalysisServi
ce>[ANALYZED_FILES]; | |
| 9859 | |
| 9860 final String name; | |
| 9861 | |
| 9862 const GeneralAnalysisService._(this.name); | |
| 9863 | |
| 9864 factory GeneralAnalysisService(String name) { | |
| 9865 switch (name) { | |
| 9866 case "ANALYZED_FILES": | |
| 9867 return ANALYZED_FILES; | |
| 9868 } | |
| 9869 throw new Exception('Illegal enum value: $name'); | |
| 9870 } | |
| 9871 | |
| 9872 factory GeneralAnalysisService.fromJson(JsonDecoder jsonDecoder, String jsonPa
th, Object json) { | |
| 9873 if (json is String) { | |
| 9874 try { | |
| 9875 return new GeneralAnalysisService(json); | |
| 9876 } catch(_) { | |
| 9877 // Fall through | |
| 9878 } | |
| 9879 } | |
| 9880 throw jsonDecoder.mismatch(jsonPath, "GeneralAnalysisService", json); | |
| 9881 } | |
| 9882 | |
| 9883 @override | |
| 9884 String toString() => "GeneralAnalysisService.$name"; | |
| 9885 | |
| 9886 String toJson() => name; | |
| 9887 } | |
| 9888 | |
| 9889 /** | |
| 9890 * HighlightRegion | |
| 9891 * | |
| 9892 * { | |
| 9893 * "type": HighlightRegionType | |
| 9894 * "offset": int | |
| 9895 * "length": int | |
| 9896 * } | |
| 9897 */ | |
| 9898 class HighlightRegion implements HasToJson { | |
| 9899 HighlightRegionType _type; | |
| 9900 | |
| 9901 int _offset; | |
| 9902 | |
| 9903 int _length; | |
| 9904 | |
| 9905 /** | |
| 9906 * The type of highlight associated with the region. | |
| 9907 */ | |
| 9908 HighlightRegionType get type => _type; | |
| 9909 | |
| 9910 /** | |
| 9911 * The type of highlight associated with the region. | |
| 9912 */ | |
| 9913 void set type(HighlightRegionType value) { | |
| 9914 assert(value != null); | |
| 9915 this._type = value; | |
| 9916 } | |
| 9917 | |
| 9918 /** | |
| 9919 * The offset of the region to be highlighted. | |
| 9920 */ | |
| 9921 int get offset => _offset; | |
| 9922 | |
| 9923 /** | |
| 9924 * The offset of the region to be highlighted. | |
| 9925 */ | |
| 9926 void set offset(int value) { | |
| 9927 assert(value != null); | |
| 9928 this._offset = value; | |
| 9929 } | |
| 9930 | |
| 9931 /** | |
| 9932 * The length of the region to be highlighted. | |
| 9933 */ | |
| 9934 int get length => _length; | |
| 9935 | |
| 9936 /** | |
| 9937 * The length of the region to be highlighted. | |
| 9938 */ | |
| 9939 void set length(int value) { | |
| 9940 assert(value != null); | |
| 9941 this._length = value; | |
| 9942 } | |
| 9943 | |
| 9944 HighlightRegion(HighlightRegionType type, int offset, int length) { | |
| 9945 this.type = type; | |
| 9946 this.offset = offset; | |
| 9947 this.length = length; | |
| 9948 } | |
| 9949 | |
| 9950 factory HighlightRegion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obj
ect json) { | |
| 9951 if (json == null) { | |
| 9952 json = {}; | |
| 9953 } | |
| 9954 if (json is Map) { | |
| 9955 HighlightRegionType type; | |
| 9956 if (json.containsKey("type")) { | |
| 9957 type = new HighlightRegionType.fromJson(jsonDecoder, jsonPath + ".type",
json["type"]); | |
| 9958 } else { | |
| 9959 throw jsonDecoder.missingKey(jsonPath, "type"); | |
| 9960 } | |
| 9961 int offset; | |
| 9962 if (json.containsKey("offset")) { | |
| 9963 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 9964 } else { | |
| 9965 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 9966 } | |
| 9967 int length; | |
| 9968 if (json.containsKey("length")) { | |
| 9969 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | |
| 9970 } else { | |
| 9971 throw jsonDecoder.missingKey(jsonPath, "length"); | |
| 9972 } | |
| 9973 return new HighlightRegion(type, offset, length); | |
| 9974 } else { | |
| 9975 throw jsonDecoder.mismatch(jsonPath, "HighlightRegion", json); | |
| 9976 } | |
| 9977 } | |
| 9978 | |
| 9979 Map<String, dynamic> toJson() { | |
| 9980 Map<String, dynamic> result = {}; | |
| 9981 result["type"] = type.toJson(); | |
| 9982 result["offset"] = offset; | |
| 9983 result["length"] = length; | |
| 9984 return result; | |
| 9985 } | |
| 9986 | |
| 9987 @override | |
| 9988 String toString() => JSON.encode(toJson()); | |
| 9989 | |
| 9990 @override | |
| 9991 bool operator==(other) { | |
| 9992 if (other is HighlightRegion) { | |
| 9993 return type == other.type && | |
| 9994 offset == other.offset && | |
| 9995 length == other.length; | |
| 9996 } | |
| 9997 return false; | |
| 9998 } | |
| 9999 | |
| 10000 @override | |
| 10001 int get hashCode { | |
| 10002 int hash = 0; | |
| 10003 hash = _JenkinsSmiHash.combine(hash, type.hashCode); | |
| 10004 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 10005 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
| 10006 return _JenkinsSmiHash.finish(hash); | |
| 10007 } | |
| 10008 } | |
| 10009 | |
| 10010 /** | |
| 10011 * HighlightRegionType | |
| 10012 * | |
| 10013 * enum { | |
| 10014 * ANNOTATION | |
| 10015 * BUILT_IN | |
| 10016 * CLASS | |
| 10017 * COMMENT_BLOCK | |
| 10018 * COMMENT_DOCUMENTATION | |
| 10019 * COMMENT_END_OF_LINE | |
| 10020 * CONSTRUCTOR | |
| 10021 * DIRECTIVE | |
| 10022 * DYNAMIC_TYPE | |
| 10023 * DYNAMIC_LOCAL_VARIABLE_DECLARATION | |
| 10024 * DYNAMIC_LOCAL_VARIABLE_REFERENCE | |
| 10025 * DYNAMIC_PARAMETER_DECLARATION | |
| 10026 * DYNAMIC_PARAMETER_REFERENCE | |
| 10027 * ENUM | |
| 10028 * ENUM_CONSTANT | |
| 10029 * FIELD | |
| 10030 * FIELD_STATIC | |
| 10031 * FUNCTION | |
| 10032 * FUNCTION_DECLARATION | |
| 10033 * FUNCTION_TYPE_ALIAS | |
| 10034 * GETTER_DECLARATION | |
| 10035 * IDENTIFIER_DEFAULT | |
| 10036 * IMPORT_PREFIX | |
| 10037 * INSTANCE_FIELD_DECLARATION | |
| 10038 * INSTANCE_FIELD_REFERENCE | |
| 10039 * INSTANCE_GETTER_DECLARATION | |
| 10040 * INSTANCE_GETTER_REFERENCE | |
| 10041 * INSTANCE_METHOD_DECLARATION | |
| 10042 * INSTANCE_METHOD_REFERENCE | |
| 10043 * INSTANCE_SETTER_DECLARATION | |
| 10044 * INSTANCE_SETTER_REFERENCE | |
| 10045 * INVALID_STRING_ESCAPE | |
| 10046 * KEYWORD | |
| 10047 * LABEL | |
| 10048 * LIBRARY_NAME | |
| 10049 * LITERAL_BOOLEAN | |
| 10050 * LITERAL_DOUBLE | |
| 10051 * LITERAL_INTEGER | |
| 10052 * LITERAL_LIST | |
| 10053 * LITERAL_MAP | |
| 10054 * LITERAL_STRING | |
| 10055 * LOCAL_FUNCTION_DECLARATION | |
| 10056 * LOCAL_FUNCTION_REFERENCE | |
| 10057 * LOCAL_VARIABLE | |
| 10058 * LOCAL_VARIABLE_DECLARATION | |
| 10059 * LOCAL_VARIABLE_REFERENCE | |
| 10060 * METHOD | |
| 10061 * METHOD_DECLARATION | |
| 10062 * METHOD_DECLARATION_STATIC | |
| 10063 * METHOD_STATIC | |
| 10064 * PARAMETER | |
| 10065 * SETTER_DECLARATION | |
| 10066 * TOP_LEVEL_VARIABLE | |
| 10067 * PARAMETER_DECLARATION | |
| 10068 * PARAMETER_REFERENCE | |
| 10069 * STATIC_FIELD_DECLARATION | |
| 10070 * STATIC_GETTER_DECLARATION | |
| 10071 * STATIC_GETTER_REFERENCE | |
| 10072 * STATIC_METHOD_DECLARATION | |
| 10073 * STATIC_METHOD_REFERENCE | |
| 10074 * STATIC_SETTER_DECLARATION | |
| 10075 * STATIC_SETTER_REFERENCE | |
| 10076 * TOP_LEVEL_FUNCTION_DECLARATION | |
| 10077 * TOP_LEVEL_FUNCTION_REFERENCE | |
| 10078 * TOP_LEVEL_GETTER_DECLARATION | |
| 10079 * TOP_LEVEL_GETTER_REFERENCE | |
| 10080 * TOP_LEVEL_SETTER_DECLARATION | |
| 10081 * TOP_LEVEL_SETTER_REFERENCE | |
| 10082 * TOP_LEVEL_VARIABLE_DECLARATION | |
| 10083 * TYPE_NAME_DYNAMIC | |
| 10084 * TYPE_PARAMETER | |
| 10085 * UNRESOLVED_INSTANCE_MEMBER_REFERENCE | |
| 10086 * VALID_STRING_ESCAPE | |
| 10087 * } | |
| 10088 */ | |
| 10089 class HighlightRegionType implements Enum { | |
| 10090 static const ANNOTATION = const HighlightRegionType._("ANNOTATION"); | |
| 10091 | |
| 10092 static const BUILT_IN = const HighlightRegionType._("BUILT_IN"); | |
| 10093 | |
| 10094 static const CLASS = const HighlightRegionType._("CLASS"); | |
| 10095 | |
| 10096 static const COMMENT_BLOCK = const HighlightRegionType._("COMMENT_BLOCK"); | |
| 10097 | |
| 10098 static const COMMENT_DOCUMENTATION = const HighlightRegionType._("COMMENT_DOCU
MENTATION"); | |
| 10099 | |
| 10100 static const COMMENT_END_OF_LINE = const HighlightRegionType._("COMMENT_END_OF
_LINE"); | |
| 10101 | |
| 10102 static const CONSTRUCTOR = const HighlightRegionType._("CONSTRUCTOR"); | |
| 10103 | |
| 10104 static const DIRECTIVE = const HighlightRegionType._("DIRECTIVE"); | |
| 10105 | |
| 10106 /** | |
| 10107 * Only for version 1 of highlight. | |
| 10108 */ | |
| 10109 static const DYNAMIC_TYPE = const HighlightRegionType._("DYNAMIC_TYPE"); | |
| 10110 | |
| 10111 /** | |
| 10112 * Only for version 2 of highlight. | |
| 10113 */ | |
| 10114 static const DYNAMIC_LOCAL_VARIABLE_DECLARATION = const HighlightRegionType._(
"DYNAMIC_LOCAL_VARIABLE_DECLARATION"); | |
| 10115 | |
| 10116 /** | |
| 10117 * Only for version 2 of highlight. | |
| 10118 */ | |
| 10119 static const DYNAMIC_LOCAL_VARIABLE_REFERENCE = const HighlightRegionType._("D
YNAMIC_LOCAL_VARIABLE_REFERENCE"); | |
| 10120 | |
| 10121 /** | |
| 10122 * Only for version 2 of highlight. | |
| 10123 */ | |
| 10124 static const DYNAMIC_PARAMETER_DECLARATION = const HighlightRegionType._("DYNA
MIC_PARAMETER_DECLARATION"); | |
| 10125 | |
| 10126 /** | |
| 10127 * Only for version 2 of highlight. | |
| 10128 */ | |
| 10129 static const DYNAMIC_PARAMETER_REFERENCE = const HighlightRegionType._("DYNAMI
C_PARAMETER_REFERENCE"); | |
| 10130 | |
| 10131 static const ENUM = const HighlightRegionType._("ENUM"); | |
| 10132 | |
| 10133 static const ENUM_CONSTANT = const HighlightRegionType._("ENUM_CONSTANT"); | |
| 10134 | |
| 10135 /** | |
| 10136 * Only for version 1 of highlight. | |
| 10137 */ | |
| 10138 static const FIELD = const HighlightRegionType._("FIELD"); | |
| 10139 | |
| 10140 /** | |
| 10141 * Only for version 1 of highlight. | |
| 10142 */ | |
| 10143 static const FIELD_STATIC = const HighlightRegionType._("FIELD_STATIC"); | |
| 10144 | |
| 10145 /** | |
| 10146 * Only for version 1 of highlight. | |
| 10147 */ | |
| 10148 static const FUNCTION = const HighlightRegionType._("FUNCTION"); | |
| 10149 | |
| 10150 /** | |
| 10151 * Only for version 1 of highlight. | |
| 10152 */ | |
| 10153 static const FUNCTION_DECLARATION = const HighlightRegionType._("FUNCTION_DECL
ARATION"); | |
| 10154 | |
| 10155 static const FUNCTION_TYPE_ALIAS = const HighlightRegionType._("FUNCTION_TYPE_
ALIAS"); | |
| 10156 | |
| 10157 /** | |
| 10158 * Only for version 1 of highlight. | |
| 10159 */ | |
| 10160 static const GETTER_DECLARATION = const HighlightRegionType._("GETTER_DECLARAT
ION"); | |
| 10161 | |
| 10162 static const IDENTIFIER_DEFAULT = const HighlightRegionType._("IDENTIFIER_DEFA
ULT"); | |
| 10163 | |
| 10164 static const IMPORT_PREFIX = const HighlightRegionType._("IMPORT_PREFIX"); | |
| 10165 | |
| 10166 /** | |
| 10167 * Only for version 2 of highlight. | |
| 10168 */ | |
| 10169 static const INSTANCE_FIELD_DECLARATION = const HighlightRegionType._("INSTANC
E_FIELD_DECLARATION"); | |
| 10170 | |
| 10171 /** | |
| 10172 * Only for version 2 of highlight. | |
| 10173 */ | |
| 10174 static const INSTANCE_FIELD_REFERENCE = const HighlightRegionType._("INSTANCE_
FIELD_REFERENCE"); | |
| 10175 | |
| 10176 /** | |
| 10177 * Only for version 2 of highlight. | |
| 10178 */ | |
| 10179 static const INSTANCE_GETTER_DECLARATION = const HighlightRegionType._("INSTAN
CE_GETTER_DECLARATION"); | |
| 10180 | |
| 10181 /** | |
| 10182 * Only for version 2 of highlight. | |
| 10183 */ | |
| 10184 static const INSTANCE_GETTER_REFERENCE = const HighlightRegionType._("INSTANCE
_GETTER_REFERENCE"); | |
| 10185 | |
| 10186 /** | |
| 10187 * Only for version 2 of highlight. | |
| 10188 */ | |
| 10189 static const INSTANCE_METHOD_DECLARATION = const HighlightRegionType._("INSTAN
CE_METHOD_DECLARATION"); | |
| 10190 | |
| 10191 /** | |
| 10192 * Only for version 2 of highlight. | |
| 10193 */ | |
| 10194 static const INSTANCE_METHOD_REFERENCE = const HighlightRegionType._("INSTANCE
_METHOD_REFERENCE"); | |
| 10195 | |
| 10196 /** | |
| 10197 * Only for version 2 of highlight. | |
| 10198 */ | |
| 10199 static const INSTANCE_SETTER_DECLARATION = const HighlightRegionType._("INSTAN
CE_SETTER_DECLARATION"); | |
| 10200 | |
| 10201 /** | |
| 10202 * Only for version 2 of highlight. | |
| 10203 */ | |
| 10204 static const INSTANCE_SETTER_REFERENCE = const HighlightRegionType._("INSTANCE
_SETTER_REFERENCE"); | |
| 10205 | |
| 10206 /** | |
| 10207 * Only for version 2 of highlight. | |
| 10208 */ | |
| 10209 static const INVALID_STRING_ESCAPE = const HighlightRegionType._("INVALID_STRI
NG_ESCAPE"); | |
| 10210 | |
| 10211 static const KEYWORD = const HighlightRegionType._("KEYWORD"); | |
| 10212 | |
| 10213 static const LABEL = const HighlightRegionType._("LABEL"); | |
| 10214 | |
| 10215 /** | |
| 10216 * Only for version 2 of highlight. | |
| 10217 */ | |
| 10218 static const LIBRARY_NAME = const HighlightRegionType._("LIBRARY_NAME"); | |
| 10219 | |
| 10220 static const LITERAL_BOOLEAN = const HighlightRegionType._("LITERAL_BOOLEAN"); | |
| 10221 | |
| 10222 static const LITERAL_DOUBLE = const HighlightRegionType._("LITERAL_DOUBLE"); | |
| 10223 | |
| 10224 static const LITERAL_INTEGER = const HighlightRegionType._("LITERAL_INTEGER"); | |
| 10225 | |
| 10226 static const LITERAL_LIST = const HighlightRegionType._("LITERAL_LIST"); | |
| 10227 | |
| 10228 static const LITERAL_MAP = const HighlightRegionType._("LITERAL_MAP"); | |
| 10229 | |
| 10230 static const LITERAL_STRING = const HighlightRegionType._("LITERAL_STRING"); | |
| 10231 | |
| 10232 /** | |
| 10233 * Only for version 2 of highlight. | |
| 10234 */ | |
| 10235 static const LOCAL_FUNCTION_DECLARATION = const HighlightRegionType._("LOCAL_F
UNCTION_DECLARATION"); | |
| 10236 | |
| 10237 /** | |
| 10238 * Only for version 2 of highlight. | |
| 10239 */ | |
| 10240 static const LOCAL_FUNCTION_REFERENCE = const HighlightRegionType._("LOCAL_FUN
CTION_REFERENCE"); | |
| 10241 | |
| 10242 /** | |
| 10243 * Only for version 1 of highlight. | |
| 10244 */ | |
| 10245 static const LOCAL_VARIABLE = const HighlightRegionType._("LOCAL_VARIABLE"); | |
| 10246 | |
| 10247 static const LOCAL_VARIABLE_DECLARATION = const HighlightRegionType._("LOCAL_V
ARIABLE_DECLARATION"); | |
| 10248 | |
| 10249 /** | |
| 10250 * Only for version 2 of highlight. | |
| 10251 */ | |
| 10252 static const LOCAL_VARIABLE_REFERENCE = const HighlightRegionType._("LOCAL_VAR
IABLE_REFERENCE"); | |
| 10253 | |
| 10254 /** | |
| 10255 * Only for version 1 of highlight. | |
| 10256 */ | |
| 10257 static const METHOD = const HighlightRegionType._("METHOD"); | |
| 10258 | |
| 10259 /** | |
| 10260 * Only for version 1 of highlight. | |
| 10261 */ | |
| 10262 static const METHOD_DECLARATION = const HighlightRegionType._("METHOD_DECLARAT
ION"); | |
| 10263 | |
| 10264 /** | |
| 10265 * Only for version 1 of highlight. | |
| 10266 */ | |
| 10267 static const METHOD_DECLARATION_STATIC = const HighlightRegionType._("METHOD_D
ECLARATION_STATIC"); | |
| 10268 | |
| 10269 /** | |
| 10270 * Only for version 1 of highlight. | |
| 10271 */ | |
| 10272 static const METHOD_STATIC = const HighlightRegionType._("METHOD_STATIC"); | |
| 10273 | |
| 10274 /** | |
| 10275 * Only for version 1 of highlight. | |
| 10276 */ | |
| 10277 static const PARAMETER = const HighlightRegionType._("PARAMETER"); | |
| 10278 | |
| 10279 /** | |
| 10280 * Only for version 1 of highlight. | |
| 10281 */ | |
| 10282 static const SETTER_DECLARATION = const HighlightRegionType._("SETTER_DECLARAT
ION"); | |
| 10283 | |
| 10284 /** | |
| 10285 * Only for version 1 of highlight. | |
| 10286 */ | |
| 10287 static const TOP_LEVEL_VARIABLE = const HighlightRegionType._("TOP_LEVEL_VARIA
BLE"); | |
| 10288 | |
| 10289 /** | |
| 10290 * Only for version 2 of highlight. | |
| 10291 */ | |
| 10292 static const PARAMETER_DECLARATION = const HighlightRegionType._("PARAMETER_DE
CLARATION"); | |
| 10293 | |
| 10294 /** | |
| 10295 * Only for version 2 of highlight. | |
| 10296 */ | |
| 10297 static const PARAMETER_REFERENCE = const HighlightRegionType._("PARAMETER_REFE
RENCE"); | |
| 10298 | |
| 10299 /** | |
| 10300 * Only for version 2 of highlight. | |
| 10301 */ | |
| 10302 static const STATIC_FIELD_DECLARATION = const HighlightRegionType._("STATIC_FI
ELD_DECLARATION"); | |
| 10303 | |
| 10304 /** | |
| 10305 * Only for version 2 of highlight. | |
| 10306 */ | |
| 10307 static const STATIC_GETTER_DECLARATION = const HighlightRegionType._("STATIC_G
ETTER_DECLARATION"); | |
| 10308 | |
| 10309 /** | |
| 10310 * Only for version 2 of highlight. | |
| 10311 */ | |
| 10312 static const STATIC_GETTER_REFERENCE = const HighlightRegionType._("STATIC_GET
TER_REFERENCE"); | |
| 10313 | |
| 10314 /** | |
| 10315 * Only for version 2 of highlight. | |
| 10316 */ | |
| 10317 static const STATIC_METHOD_DECLARATION = const HighlightRegionType._("STATIC_M
ETHOD_DECLARATION"); | |
| 10318 | |
| 10319 /** | |
| 10320 * Only for version 2 of highlight. | |
| 10321 */ | |
| 10322 static const STATIC_METHOD_REFERENCE = const HighlightRegionType._("STATIC_MET
HOD_REFERENCE"); | |
| 10323 | |
| 10324 /** | |
| 10325 * Only for version 2 of highlight. | |
| 10326 */ | |
| 10327 static const STATIC_SETTER_DECLARATION = const HighlightRegionType._("STATIC_S
ETTER_DECLARATION"); | |
| 10328 | |
| 10329 /** | |
| 10330 * Only for version 2 of highlight. | |
| 10331 */ | |
| 10332 static const STATIC_SETTER_REFERENCE = const HighlightRegionType._("STATIC_SET
TER_REFERENCE"); | |
| 10333 | |
| 10334 /** | |
| 10335 * Only for version 2 of highlight. | |
| 10336 */ | |
| 10337 static const TOP_LEVEL_FUNCTION_DECLARATION = const HighlightRegionType._("TOP
_LEVEL_FUNCTION_DECLARATION"); | |
| 10338 | |
| 10339 /** | |
| 10340 * Only for version 2 of highlight. | |
| 10341 */ | |
| 10342 static const TOP_LEVEL_FUNCTION_REFERENCE = const HighlightRegionType._("TOP_L
EVEL_FUNCTION_REFERENCE"); | |
| 10343 | |
| 10344 /** | |
| 10345 * Only for version 2 of highlight. | |
| 10346 */ | |
| 10347 static const TOP_LEVEL_GETTER_DECLARATION = const HighlightRegionType._("TOP_L
EVEL_GETTER_DECLARATION"); | |
| 10348 | |
| 10349 /** | |
| 10350 * Only for version 2 of highlight. | |
| 10351 */ | |
| 10352 static const TOP_LEVEL_GETTER_REFERENCE = const HighlightRegionType._("TOP_LEV
EL_GETTER_REFERENCE"); | |
| 10353 | |
| 10354 /** | |
| 10355 * Only for version 2 of highlight. | |
| 10356 */ | |
| 10357 static const TOP_LEVEL_SETTER_DECLARATION = const HighlightRegionType._("TOP_L
EVEL_SETTER_DECLARATION"); | |
| 10358 | |
| 10359 /** | |
| 10360 * Only for version 2 of highlight. | |
| 10361 */ | |
| 10362 static const TOP_LEVEL_SETTER_REFERENCE = const HighlightRegionType._("TOP_LEV
EL_SETTER_REFERENCE"); | |
| 10363 | |
| 10364 /** | |
| 10365 * Only for version 2 of highlight. | |
| 10366 */ | |
| 10367 static const TOP_LEVEL_VARIABLE_DECLARATION = const HighlightRegionType._("TOP
_LEVEL_VARIABLE_DECLARATION"); | |
| 10368 | |
| 10369 static const TYPE_NAME_DYNAMIC = const HighlightRegionType._("TYPE_NAME_DYNAMI
C"); | |
| 10370 | |
| 10371 static const TYPE_PARAMETER = const HighlightRegionType._("TYPE_PARAMETER"); | |
| 10372 | |
| 10373 /** | |
| 10374 * Only for version 2 of highlight. | |
| 10375 */ | |
| 10376 static const UNRESOLVED_INSTANCE_MEMBER_REFERENCE = const HighlightRegionType.
_("UNRESOLVED_INSTANCE_MEMBER_REFERENCE"); | |
| 10377 | |
| 10378 /** | |
| 10379 * Only for version 2 of highlight. | |
| 10380 */ | |
| 10381 static const VALID_STRING_ESCAPE = const HighlightRegionType._("VALID_STRING_E
SCAPE"); | |
| 10382 | |
| 10383 /** | |
| 10384 * A list containing all of the enum values that are defined. | |
| 10385 */ | |
| 10386 static const List<HighlightRegionType> VALUES = const <HighlightRegionType>[AN
NOTATION, BUILT_IN, CLASS, COMMENT_BLOCK, COMMENT_DOCUMENTATION, COMMENT_END_OF_
LINE, CONSTRUCTOR, DIRECTIVE, DYNAMIC_TYPE, DYNAMIC_LOCAL_VARIABLE_DECLARATION,
DYNAMIC_LOCAL_VARIABLE_REFERENCE, DYNAMIC_PARAMETER_DECLARATION, DYNAMIC_PARAMET
ER_REFERENCE, ENUM, ENUM_CONSTANT, FIELD, FIELD_STATIC, FUNCTION, FUNCTION_DECLA
RATION, FUNCTION_TYPE_ALIAS, GETTER_DECLARATION, IDENTIFIER_DEFAULT, IMPORT_PREF
IX, INSTANCE_FIELD_DECLARATION, INSTANCE_FIELD_REFERENCE, INSTANCE_GETTER_DECLAR
ATION, INSTANCE_GETTER_REFERENCE, INSTANCE_METHOD_DECLARATION, INSTANCE_METHOD_R
EFERENCE, INSTANCE_SETTER_DECLARATION, INSTANCE_SETTER_REFERENCE, INVALID_STRING
_ESCAPE, KEYWORD, LABEL, LIBRARY_NAME, LITERAL_BOOLEAN, LITERAL_DOUBLE, LITERAL_
INTEGER, LITERAL_LIST, LITERAL_MAP, LITERAL_STRING, LOCAL_FUNCTION_DECLARATION,
LOCAL_FUNCTION_REFERENCE, LOCAL_VARIABLE, LOCAL_VARIABLE_DECLARATION, LOCAL_VARI
ABLE_REFERENCE, METHOD, METHOD_DECLARATION, METHOD_DECLARATION_STATIC, METHOD_ST
ATIC, PARAMETER, SETTER_DECLARATION, TOP_LEVEL_VARIABLE, PARAMETER_DECLARATION,
PARAMETER_REFERENCE, STATIC_FIELD_DECLARATION, STATIC_GETTER_DECLARATION, STATIC
_GETTER_REFERENCE, STATIC_METHOD_DECLARATION, STATIC_METHOD_REFERENCE, STATIC_SE
TTER_DECLARATION, STATIC_SETTER_REFERENCE, TOP_LEVEL_FUNCTION_DECLARATION, TOP_L
EVEL_FUNCTION_REFERENCE, TOP_LEVEL_GETTER_DECLARATION, TOP_LEVEL_GETTER_REFERENC
E, TOP_LEVEL_SETTER_DECLARATION, TOP_LEVEL_SETTER_REFERENCE, TOP_LEVEL_VARIABLE_
DECLARATION, TYPE_NAME_DYNAMIC, TYPE_PARAMETER, UNRESOLVED_INSTANCE_MEMBER_REFER
ENCE, VALID_STRING_ESCAPE]; | |
| 10387 | |
| 10388 final String name; | |
| 10389 | |
| 10390 const HighlightRegionType._(this.name); | |
| 10391 | |
| 10392 factory HighlightRegionType(String name) { | |
| 10393 switch (name) { | |
| 10394 case "ANNOTATION": | |
| 10395 return ANNOTATION; | |
| 10396 case "BUILT_IN": | |
| 10397 return BUILT_IN; | |
| 10398 case "CLASS": | |
| 10399 return CLASS; | |
| 10400 case "COMMENT_BLOCK": | |
| 10401 return COMMENT_BLOCK; | |
| 10402 case "COMMENT_DOCUMENTATION": | |
| 10403 return COMMENT_DOCUMENTATION; | |
| 10404 case "COMMENT_END_OF_LINE": | |
| 10405 return COMMENT_END_OF_LINE; | |
| 10406 case "CONSTRUCTOR": | |
| 10407 return CONSTRUCTOR; | |
| 10408 case "DIRECTIVE": | |
| 10409 return DIRECTIVE; | |
| 10410 case "DYNAMIC_TYPE": | |
| 10411 return DYNAMIC_TYPE; | |
| 10412 case "DYNAMIC_LOCAL_VARIABLE_DECLARATION": | |
| 10413 return DYNAMIC_LOCAL_VARIABLE_DECLARATION; | |
| 10414 case "DYNAMIC_LOCAL_VARIABLE_REFERENCE": | |
| 10415 return DYNAMIC_LOCAL_VARIABLE_REFERENCE; | |
| 10416 case "DYNAMIC_PARAMETER_DECLARATION": | |
| 10417 return DYNAMIC_PARAMETER_DECLARATION; | |
| 10418 case "DYNAMIC_PARAMETER_REFERENCE": | |
| 10419 return DYNAMIC_PARAMETER_REFERENCE; | |
| 10420 case "ENUM": | |
| 10421 return ENUM; | |
| 10422 case "ENUM_CONSTANT": | |
| 10423 return ENUM_CONSTANT; | |
| 10424 case "FIELD": | |
| 10425 return FIELD; | |
| 10426 case "FIELD_STATIC": | |
| 10427 return FIELD_STATIC; | |
| 10428 case "FUNCTION": | |
| 10429 return FUNCTION; | |
| 10430 case "FUNCTION_DECLARATION": | |
| 10431 return FUNCTION_DECLARATION; | |
| 10432 case "FUNCTION_TYPE_ALIAS": | |
| 10433 return FUNCTION_TYPE_ALIAS; | |
| 10434 case "GETTER_DECLARATION": | |
| 10435 return GETTER_DECLARATION; | |
| 10436 case "IDENTIFIER_DEFAULT": | |
| 10437 return IDENTIFIER_DEFAULT; | |
| 10438 case "IMPORT_PREFIX": | |
| 10439 return IMPORT_PREFIX; | |
| 10440 case "INSTANCE_FIELD_DECLARATION": | |
| 10441 return INSTANCE_FIELD_DECLARATION; | |
| 10442 case "INSTANCE_FIELD_REFERENCE": | |
| 10443 return INSTANCE_FIELD_REFERENCE; | |
| 10444 case "INSTANCE_GETTER_DECLARATION": | |
| 10445 return INSTANCE_GETTER_DECLARATION; | |
| 10446 case "INSTANCE_GETTER_REFERENCE": | |
| 10447 return INSTANCE_GETTER_REFERENCE; | |
| 10448 case "INSTANCE_METHOD_DECLARATION": | |
| 10449 return INSTANCE_METHOD_DECLARATION; | |
| 10450 case "INSTANCE_METHOD_REFERENCE": | |
| 10451 return INSTANCE_METHOD_REFERENCE; | |
| 10452 case "INSTANCE_SETTER_DECLARATION": | |
| 10453 return INSTANCE_SETTER_DECLARATION; | |
| 10454 case "INSTANCE_SETTER_REFERENCE": | |
| 10455 return INSTANCE_SETTER_REFERENCE; | |
| 10456 case "INVALID_STRING_ESCAPE": | |
| 10457 return INVALID_STRING_ESCAPE; | |
| 10458 case "KEYWORD": | |
| 10459 return KEYWORD; | |
| 10460 case "LABEL": | |
| 10461 return LABEL; | |
| 10462 case "LIBRARY_NAME": | |
| 10463 return LIBRARY_NAME; | |
| 10464 case "LITERAL_BOOLEAN": | |
| 10465 return LITERAL_BOOLEAN; | |
| 10466 case "LITERAL_DOUBLE": | |
| 10467 return LITERAL_DOUBLE; | |
| 10468 case "LITERAL_INTEGER": | |
| 10469 return LITERAL_INTEGER; | |
| 10470 case "LITERAL_LIST": | |
| 10471 return LITERAL_LIST; | |
| 10472 case "LITERAL_MAP": | |
| 10473 return LITERAL_MAP; | |
| 10474 case "LITERAL_STRING": | |
| 10475 return LITERAL_STRING; | |
| 10476 case "LOCAL_FUNCTION_DECLARATION": | |
| 10477 return LOCAL_FUNCTION_DECLARATION; | |
| 10478 case "LOCAL_FUNCTION_REFERENCE": | |
| 10479 return LOCAL_FUNCTION_REFERENCE; | |
| 10480 case "LOCAL_VARIABLE": | |
| 10481 return LOCAL_VARIABLE; | |
| 10482 case "LOCAL_VARIABLE_DECLARATION": | |
| 10483 return LOCAL_VARIABLE_DECLARATION; | |
| 10484 case "LOCAL_VARIABLE_REFERENCE": | |
| 10485 return LOCAL_VARIABLE_REFERENCE; | |
| 10486 case "METHOD": | |
| 10487 return METHOD; | |
| 10488 case "METHOD_DECLARATION": | |
| 10489 return METHOD_DECLARATION; | |
| 10490 case "METHOD_DECLARATION_STATIC": | |
| 10491 return METHOD_DECLARATION_STATIC; | |
| 10492 case "METHOD_STATIC": | |
| 10493 return METHOD_STATIC; | |
| 10494 case "PARAMETER": | |
| 10495 return PARAMETER; | |
| 10496 case "SETTER_DECLARATION": | |
| 10497 return SETTER_DECLARATION; | |
| 10498 case "TOP_LEVEL_VARIABLE": | |
| 10499 return TOP_LEVEL_VARIABLE; | |
| 10500 case "PARAMETER_DECLARATION": | |
| 10501 return PARAMETER_DECLARATION; | |
| 10502 case "PARAMETER_REFERENCE": | |
| 10503 return PARAMETER_REFERENCE; | |
| 10504 case "STATIC_FIELD_DECLARATION": | |
| 10505 return STATIC_FIELD_DECLARATION; | |
| 10506 case "STATIC_GETTER_DECLARATION": | |
| 10507 return STATIC_GETTER_DECLARATION; | |
| 10508 case "STATIC_GETTER_REFERENCE": | |
| 10509 return STATIC_GETTER_REFERENCE; | |
| 10510 case "STATIC_METHOD_DECLARATION": | |
| 10511 return STATIC_METHOD_DECLARATION; | |
| 10512 case "STATIC_METHOD_REFERENCE": | |
| 10513 return STATIC_METHOD_REFERENCE; | |
| 10514 case "STATIC_SETTER_DECLARATION": | |
| 10515 return STATIC_SETTER_DECLARATION; | |
| 10516 case "STATIC_SETTER_REFERENCE": | |
| 10517 return STATIC_SETTER_REFERENCE; | |
| 10518 case "TOP_LEVEL_FUNCTION_DECLARATION": | |
| 10519 return TOP_LEVEL_FUNCTION_DECLARATION; | |
| 10520 case "TOP_LEVEL_FUNCTION_REFERENCE": | |
| 10521 return TOP_LEVEL_FUNCTION_REFERENCE; | |
| 10522 case "TOP_LEVEL_GETTER_DECLARATION": | |
| 10523 return TOP_LEVEL_GETTER_DECLARATION; | |
| 10524 case "TOP_LEVEL_GETTER_REFERENCE": | |
| 10525 return TOP_LEVEL_GETTER_REFERENCE; | |
| 10526 case "TOP_LEVEL_SETTER_DECLARATION": | |
| 10527 return TOP_LEVEL_SETTER_DECLARATION; | |
| 10528 case "TOP_LEVEL_SETTER_REFERENCE": | |
| 10529 return TOP_LEVEL_SETTER_REFERENCE; | |
| 10530 case "TOP_LEVEL_VARIABLE_DECLARATION": | |
| 10531 return TOP_LEVEL_VARIABLE_DECLARATION; | |
| 10532 case "TYPE_NAME_DYNAMIC": | |
| 10533 return TYPE_NAME_DYNAMIC; | |
| 10534 case "TYPE_PARAMETER": | |
| 10535 return TYPE_PARAMETER; | |
| 10536 case "UNRESOLVED_INSTANCE_MEMBER_REFERENCE": | |
| 10537 return UNRESOLVED_INSTANCE_MEMBER_REFERENCE; | |
| 10538 case "VALID_STRING_ESCAPE": | |
| 10539 return VALID_STRING_ESCAPE; | |
| 10540 } | |
| 10541 throw new Exception('Illegal enum value: $name'); | |
| 10542 } | |
| 10543 | |
| 10544 factory HighlightRegionType.fromJson(JsonDecoder jsonDecoder, String jsonPath,
Object json) { | |
| 10545 if (json is String) { | |
| 10546 try { | |
| 10547 return new HighlightRegionType(json); | |
| 10548 } catch(_) { | |
| 10549 // Fall through | |
| 10550 } | |
| 10551 } | |
| 10552 throw jsonDecoder.mismatch(jsonPath, "HighlightRegionType", json); | |
| 10553 } | |
| 10554 | |
| 10555 @override | |
| 10556 String toString() => "HighlightRegionType.$name"; | |
| 10557 | |
| 10558 String toJson() => name; | |
| 10559 } | |
| 10560 | |
| 10561 /** | |
| 10562 * HoverInformation | |
| 10563 * | |
| 10564 * { | |
| 10565 * "offset": int | |
| 10566 * "length": int | |
| 10567 * "containingLibraryPath": optional String | |
| 10568 * "containingLibraryName": optional String | |
| 10569 * "containingClassDescription": optional String | |
| 10570 * "dartdoc": optional String | |
| 10571 * "elementDescription": optional String | |
| 10572 * "elementKind": optional String | |
| 10573 * "parameter": optional String | |
| 10574 * "propagatedType": optional String | |
| 10575 * "staticType": optional String | |
| 10576 * } | |
| 10577 */ | |
| 10578 class HoverInformation implements HasToJson { | |
| 10579 int _offset; | |
| 10580 | |
| 10581 int _length; | |
| 10582 | |
| 10583 String _containingLibraryPath; | |
| 10584 | |
| 10585 String _containingLibraryName; | |
| 10586 | |
| 10587 String _containingClassDescription; | |
| 10588 | |
| 10589 String _dartdoc; | |
| 10590 | |
| 10591 String _elementDescription; | |
| 10592 | |
| 10593 String _elementKind; | |
| 10594 | |
| 10595 String _parameter; | |
| 10596 | |
| 10597 String _propagatedType; | |
| 10598 | |
| 10599 String _staticType; | |
| 10600 | |
| 10601 /** | |
| 10602 * The offset of the range of characters that encompases the cursor position | |
| 10603 * and has the same hover information as the cursor position. | |
| 10604 */ | |
| 10605 int get offset => _offset; | |
| 10606 | |
| 10607 /** | |
| 10608 * The offset of the range of characters that encompases the cursor position | |
| 10609 * and has the same hover information as the cursor position. | |
| 10610 */ | |
| 10611 void set offset(int value) { | |
| 10612 assert(value != null); | |
| 10613 this._offset = value; | |
| 10614 } | |
| 10615 | |
| 10616 /** | |
| 10617 * The length of the range of characters that encompases the cursor position | |
| 10618 * and has the same hover information as the cursor position. | |
| 10619 */ | |
| 10620 int get length => _length; | |
| 10621 | |
| 10622 /** | |
| 10623 * The length of the range of characters that encompases the cursor position | |
| 10624 * and has the same hover information as the cursor position. | |
| 10625 */ | |
| 10626 void set length(int value) { | |
| 10627 assert(value != null); | |
| 10628 this._length = value; | |
| 10629 } | |
| 10630 | |
| 10631 /** | |
| 10632 * The path to the defining compilation unit of the library in which the | |
| 10633 * referenced element is declared. This data is omitted if there is no | |
| 10634 * referenced element, or if the element is declared inside an HTML file. | |
| 10635 */ | |
| 10636 String get containingLibraryPath => _containingLibraryPath; | |
| 10637 | |
| 10638 /** | |
| 10639 * The path to the defining compilation unit of the library in which the | |
| 10640 * referenced element is declared. This data is omitted if there is no | |
| 10641 * referenced element, or if the element is declared inside an HTML file. | |
| 10642 */ | |
| 10643 void set containingLibraryPath(String value) { | |
| 10644 this._containingLibraryPath = value; | |
| 10645 } | |
| 10646 | |
| 10647 /** | |
| 10648 * The name of the library in which the referenced element is declared. This | |
| 10649 * data is omitted if there is no referenced element, or if the element is | |
| 10650 * declared inside an HTML file. | |
| 10651 */ | |
| 10652 String get containingLibraryName => _containingLibraryName; | |
| 10653 | |
| 10654 /** | |
| 10655 * The name of the library in which the referenced element is declared. This | |
| 10656 * data is omitted if there is no referenced element, or if the element is | |
| 10657 * declared inside an HTML file. | |
| 10658 */ | |
| 10659 void set containingLibraryName(String value) { | |
| 10660 this._containingLibraryName = value; | |
| 10661 } | |
| 10662 | |
| 10663 /** | |
| 10664 * A human-readable description of the class declaring the element being | |
| 10665 * referenced. This data is omitted if there is no referenced element, or if | |
| 10666 * the element is not a class member. | |
| 10667 */ | |
| 10668 String get containingClassDescription => _containingClassDescription; | |
| 10669 | |
| 10670 /** | |
| 10671 * A human-readable description of the class declaring the element being | |
| 10672 * referenced. This data is omitted if there is no referenced element, or if | |
| 10673 * the element is not a class member. | |
| 10674 */ | |
| 10675 void set containingClassDescription(String value) { | |
| 10676 this._containingClassDescription = value; | |
| 10677 } | |
| 10678 | |
| 10679 /** | |
| 10680 * The dartdoc associated with the referenced element. Other than the removal | |
| 10681 * of the comment delimiters, including leading asterisks in the case of a | |
| 10682 * block comment, the dartdoc is unprocessed markdown. This data is omitted | |
| 10683 * if there is no referenced element, or if the element has no dartdoc. | |
| 10684 */ | |
| 10685 String get dartdoc => _dartdoc; | |
| 10686 | |
| 10687 /** | |
| 10688 * The dartdoc associated with the referenced element. Other than the removal | |
| 10689 * of the comment delimiters, including leading asterisks in the case of a | |
| 10690 * block comment, the dartdoc is unprocessed markdown. This data is omitted | |
| 10691 * if there is no referenced element, or if the element has no dartdoc. | |
| 10692 */ | |
| 10693 void set dartdoc(String value) { | |
| 10694 this._dartdoc = value; | |
| 10695 } | |
| 10696 | |
| 10697 /** | |
| 10698 * A human-readable description of the element being referenced. This data is | |
| 10699 * omitted if there is no referenced element. | |
| 10700 */ | |
| 10701 String get elementDescription => _elementDescription; | |
| 10702 | |
| 10703 /** | |
| 10704 * A human-readable description of the element being referenced. This data is | |
| 10705 * omitted if there is no referenced element. | |
| 10706 */ | |
| 10707 void set elementDescription(String value) { | |
| 10708 this._elementDescription = value; | |
| 10709 } | |
| 10710 | |
| 10711 /** | |
| 10712 * A human-readable description of the kind of element being referenced (such | |
| 10713 * as “class” or “function type alias”). This data is omitted if there is no | |
| 10714 * referenced element. | |
| 10715 */ | |
| 10716 String get elementKind => _elementKind; | |
| 10717 | |
| 10718 /** | |
| 10719 * A human-readable description of the kind of element being referenced (such | |
| 10720 * as “class” or “function type alias”). This data is omitted if there is no | |
| 10721 * referenced element. | |
| 10722 */ | |
| 10723 void set elementKind(String value) { | |
| 10724 this._elementKind = value; | |
| 10725 } | |
| 10726 | |
| 10727 /** | |
| 10728 * A human-readable description of the parameter corresponding to the | |
| 10729 * expression being hovered over. This data is omitted if the location is not | |
| 10730 * in an argument to a function. | |
| 10731 */ | |
| 10732 String get parameter => _parameter; | |
| 10733 | |
| 10734 /** | |
| 10735 * A human-readable description of the parameter corresponding to the | |
| 10736 * expression being hovered over. This data is omitted if the location is not | |
| 10737 * in an argument to a function. | |
| 10738 */ | |
| 10739 void set parameter(String value) { | |
| 10740 this._parameter = value; | |
| 10741 } | |
| 10742 | |
| 10743 /** | |
| 10744 * The name of the propagated type of the expression. This data is omitted if | |
| 10745 * the location does not correspond to an expression or if there is no | |
| 10746 * propagated type information. | |
| 10747 */ | |
| 10748 String get propagatedType => _propagatedType; | |
| 10749 | |
| 10750 /** | |
| 10751 * The name of the propagated type of the expression. This data is omitted if | |
| 10752 * the location does not correspond to an expression or if there is no | |
| 10753 * propagated type information. | |
| 10754 */ | |
| 10755 void set propagatedType(String value) { | |
| 10756 this._propagatedType = value; | |
| 10757 } | |
| 10758 | |
| 10759 /** | |
| 10760 * The name of the static type of the expression. This data is omitted if the | |
| 10761 * location does not correspond to an expression. | |
| 10762 */ | |
| 10763 String get staticType => _staticType; | |
| 10764 | |
| 10765 /** | |
| 10766 * The name of the static type of the expression. This data is omitted if the | |
| 10767 * location does not correspond to an expression. | |
| 10768 */ | |
| 10769 void set staticType(String value) { | |
| 10770 this._staticType = value; | |
| 10771 } | |
| 10772 | |
| 10773 HoverInformation(int offset, int length, {String containingLibraryPath, String
containingLibraryName, String containingClassDescription, String dartdoc, Strin
g elementDescription, String elementKind, String parameter, String propagatedTyp
e, String staticType}) { | |
| 10774 this.offset = offset; | |
| 10775 this.length = length; | |
| 10776 this.containingLibraryPath = containingLibraryPath; | |
| 10777 this.containingLibraryName = containingLibraryName; | |
| 10778 this.containingClassDescription = containingClassDescription; | |
| 10779 this.dartdoc = dartdoc; | |
| 10780 this.elementDescription = elementDescription; | |
| 10781 this.elementKind = elementKind; | |
| 10782 this.parameter = parameter; | |
| 10783 this.propagatedType = propagatedType; | |
| 10784 this.staticType = staticType; | |
| 10785 } | |
| 10786 | |
| 10787 factory HoverInformation.fromJson(JsonDecoder jsonDecoder, String jsonPath, Ob
ject json) { | |
| 10788 if (json == null) { | |
| 10789 json = {}; | |
| 10790 } | |
| 10791 if (json is Map) { | |
| 10792 int offset; | |
| 10793 if (json.containsKey("offset")) { | |
| 10794 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 10795 } else { | |
| 10796 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 10797 } | |
| 10798 int length; | |
| 10799 if (json.containsKey("length")) { | |
| 10800 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | |
| 10801 } else { | |
| 10802 throw jsonDecoder.missingKey(jsonPath, "length"); | |
| 10803 } | |
| 10804 String containingLibraryPath; | |
| 10805 if (json.containsKey("containingLibraryPath")) { | |
| 10806 containingLibraryPath = jsonDecoder._decodeString(jsonPath + ".containin
gLibraryPath", json["containingLibraryPath"]); | |
| 10807 } | |
| 10808 String containingLibraryName; | |
| 10809 if (json.containsKey("containingLibraryName")) { | |
| 10810 containingLibraryName = jsonDecoder._decodeString(jsonPath + ".containin
gLibraryName", json["containingLibraryName"]); | |
| 10811 } | |
| 10812 String containingClassDescription; | |
| 10813 if (json.containsKey("containingClassDescription")) { | |
| 10814 containingClassDescription = jsonDecoder._decodeString(jsonPath + ".cont
ainingClassDescription", json["containingClassDescription"]); | |
| 10815 } | |
| 10816 String dartdoc; | |
| 10817 if (json.containsKey("dartdoc")) { | |
| 10818 dartdoc = jsonDecoder._decodeString(jsonPath + ".dartdoc", json["dartdoc
"]); | |
| 10819 } | |
| 10820 String elementDescription; | |
| 10821 if (json.containsKey("elementDescription")) { | |
| 10822 elementDescription = jsonDecoder._decodeString(jsonPath + ".elementDescr
iption", json["elementDescription"]); | |
| 10823 } | |
| 10824 String elementKind; | |
| 10825 if (json.containsKey("elementKind")) { | |
| 10826 elementKind = jsonDecoder._decodeString(jsonPath + ".elementKind", json[
"elementKind"]); | |
| 10827 } | |
| 10828 String parameter; | |
| 10829 if (json.containsKey("parameter")) { | |
| 10830 parameter = jsonDecoder._decodeString(jsonPath + ".parameter", json["par
ameter"]); | |
| 10831 } | |
| 10832 String propagatedType; | |
| 10833 if (json.containsKey("propagatedType")) { | |
| 10834 propagatedType = jsonDecoder._decodeString(jsonPath + ".propagatedType",
json["propagatedType"]); | |
| 10835 } | |
| 10836 String staticType; | |
| 10837 if (json.containsKey("staticType")) { | |
| 10838 staticType = jsonDecoder._decodeString(jsonPath + ".staticType", json["s
taticType"]); | |
| 10839 } | |
| 10840 return new HoverInformation(offset, length, containingLibraryPath: contain
ingLibraryPath, containingLibraryName: containingLibraryName, containingClassDes
cription: containingClassDescription, dartdoc: dartdoc, elementDescription: elem
entDescription, elementKind: elementKind, parameter: parameter, propagatedType:
propagatedType, staticType: staticType); | |
| 10841 } else { | |
| 10842 throw jsonDecoder.mismatch(jsonPath, "HoverInformation", json); | |
| 10843 } | |
| 10844 } | |
| 10845 | |
| 10846 Map<String, dynamic> toJson() { | |
| 10847 Map<String, dynamic> result = {}; | |
| 10848 result["offset"] = offset; | |
| 10849 result["length"] = length; | |
| 10850 if (containingLibraryPath != null) { | |
| 10851 result["containingLibraryPath"] = containingLibraryPath; | |
| 10852 } | |
| 10853 if (containingLibraryName != null) { | |
| 10854 result["containingLibraryName"] = containingLibraryName; | |
| 10855 } | |
| 10856 if (containingClassDescription != null) { | |
| 10857 result["containingClassDescription"] = containingClassDescription; | |
| 10858 } | |
| 10859 if (dartdoc != null) { | |
| 10860 result["dartdoc"] = dartdoc; | |
| 10861 } | |
| 10862 if (elementDescription != null) { | |
| 10863 result["elementDescription"] = elementDescription; | |
| 10864 } | |
| 10865 if (elementKind != null) { | |
| 10866 result["elementKind"] = elementKind; | |
| 10867 } | |
| 10868 if (parameter != null) { | |
| 10869 result["parameter"] = parameter; | |
| 10870 } | |
| 10871 if (propagatedType != null) { | |
| 10872 result["propagatedType"] = propagatedType; | |
| 10873 } | |
| 10874 if (staticType != null) { | |
| 10875 result["staticType"] = staticType; | |
| 10876 } | |
| 10877 return result; | |
| 10878 } | |
| 10879 | |
| 10880 @override | |
| 10881 String toString() => JSON.encode(toJson()); | |
| 10882 | |
| 10883 @override | |
| 10884 bool operator==(other) { | |
| 10885 if (other is HoverInformation) { | |
| 10886 return offset == other.offset && | |
| 10887 length == other.length && | |
| 10888 containingLibraryPath == other.containingLibraryPath && | |
| 10889 containingLibraryName == other.containingLibraryName && | |
| 10890 containingClassDescription == other.containingClassDescription && | |
| 10891 dartdoc == other.dartdoc && | |
| 10892 elementDescription == other.elementDescription && | |
| 10893 elementKind == other.elementKind && | |
| 10894 parameter == other.parameter && | |
| 10895 propagatedType == other.propagatedType && | |
| 10896 staticType == other.staticType; | |
| 10897 } | |
| 10898 return false; | |
| 10899 } | |
| 10900 | |
| 10901 @override | |
| 10902 int get hashCode { | |
| 10903 int hash = 0; | |
| 10904 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 10905 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
| 10906 hash = _JenkinsSmiHash.combine(hash, containingLibraryPath.hashCode); | |
| 10907 hash = _JenkinsSmiHash.combine(hash, containingLibraryName.hashCode); | |
| 10908 hash = _JenkinsSmiHash.combine(hash, containingClassDescription.hashCode); | |
| 10909 hash = _JenkinsSmiHash.combine(hash, dartdoc.hashCode); | |
| 10910 hash = _JenkinsSmiHash.combine(hash, elementDescription.hashCode); | |
| 10911 hash = _JenkinsSmiHash.combine(hash, elementKind.hashCode); | |
| 10912 hash = _JenkinsSmiHash.combine(hash, parameter.hashCode); | |
| 10913 hash = _JenkinsSmiHash.combine(hash, propagatedType.hashCode); | |
| 10914 hash = _JenkinsSmiHash.combine(hash, staticType.hashCode); | |
| 10915 return _JenkinsSmiHash.finish(hash); | |
| 10916 } | |
| 10917 } | |
| 10918 | |
| 10919 /** | |
| 10920 * ImplementedClass | |
| 10921 * | |
| 10922 * { | |
| 10923 * "offset": int | |
| 10924 * "length": int | |
| 10925 * } | |
| 10926 */ | |
| 10927 class ImplementedClass implements HasToJson { | |
| 10928 int _offset; | |
| 10929 | |
| 10930 int _length; | |
| 10931 | |
| 10932 /** | |
| 10933 * The offset of the name of the implemented class. | |
| 10934 */ | |
| 10935 int get offset => _offset; | |
| 10936 | |
| 10937 /** | |
| 10938 * The offset of the name of the implemented class. | |
| 10939 */ | |
| 10940 void set offset(int value) { | |
| 10941 assert(value != null); | |
| 10942 this._offset = value; | |
| 10943 } | |
| 10944 | |
| 10945 /** | |
| 10946 * The length of the name of the implemented class. | |
| 10947 */ | |
| 10948 int get length => _length; | |
| 10949 | |
| 10950 /** | |
| 10951 * The length of the name of the implemented class. | |
| 10952 */ | |
| 10953 void set length(int value) { | |
| 10954 assert(value != null); | |
| 10955 this._length = value; | |
| 10956 } | |
| 10957 | |
| 10958 ImplementedClass(int offset, int length) { | |
| 10959 this.offset = offset; | |
| 10960 this.length = length; | |
| 10961 } | |
| 10962 | |
| 10963 factory ImplementedClass.fromJson(JsonDecoder jsonDecoder, String jsonPath, Ob
ject json) { | |
| 10964 if (json == null) { | |
| 10965 json = {}; | |
| 10966 } | |
| 10967 if (json is Map) { | |
| 10968 int offset; | |
| 10969 if (json.containsKey("offset")) { | |
| 10970 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 10971 } else { | |
| 10972 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 10973 } | |
| 10974 int length; | |
| 10975 if (json.containsKey("length")) { | |
| 10976 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | |
| 10977 } else { | |
| 10978 throw jsonDecoder.missingKey(jsonPath, "length"); | |
| 10979 } | |
| 10980 return new ImplementedClass(offset, length); | |
| 10981 } else { | |
| 10982 throw jsonDecoder.mismatch(jsonPath, "ImplementedClass", json); | |
| 10983 } | |
| 10984 } | |
| 10985 | |
| 10986 Map<String, dynamic> toJson() { | |
| 10987 Map<String, dynamic> result = {}; | |
| 10988 result["offset"] = offset; | |
| 10989 result["length"] = length; | |
| 10990 return result; | |
| 10991 } | |
| 10992 | |
| 10993 @override | |
| 10994 String toString() => JSON.encode(toJson()); | |
| 10995 | |
| 10996 @override | |
| 10997 bool operator==(other) { | |
| 10998 if (other is ImplementedClass) { | |
| 10999 return offset == other.offset && | |
| 11000 length == other.length; | |
| 11001 } | |
| 11002 return false; | |
| 11003 } | |
| 11004 | |
| 11005 @override | |
| 11006 int get hashCode { | |
| 11007 int hash = 0; | |
| 11008 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 11009 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
| 11010 return _JenkinsSmiHash.finish(hash); | |
| 11011 } | |
| 11012 } | |
| 11013 | |
| 11014 /** | |
| 11015 * ImplementedMember | |
| 11016 * | |
| 11017 * { | |
| 11018 * "offset": int | |
| 11019 * "length": int | |
| 11020 * } | |
| 11021 */ | |
| 11022 class ImplementedMember implements HasToJson { | |
| 11023 int _offset; | |
| 11024 | |
| 11025 int _length; | |
| 11026 | |
| 11027 /** | |
| 11028 * The offset of the name of the implemented member. | |
| 11029 */ | |
| 11030 int get offset => _offset; | |
| 11031 | |
| 11032 /** | |
| 11033 * The offset of the name of the implemented member. | |
| 11034 */ | |
| 11035 void set offset(int value) { | |
| 11036 assert(value != null); | |
| 11037 this._offset = value; | |
| 11038 } | |
| 11039 | |
| 11040 /** | |
| 11041 * The length of the name of the implemented member. | |
| 11042 */ | |
| 11043 int get length => _length; | |
| 11044 | |
| 11045 /** | |
| 11046 * The length of the name of the implemented member. | |
| 11047 */ | |
| 11048 void set length(int value) { | |
| 11049 assert(value != null); | |
| 11050 this._length = value; | |
| 11051 } | |
| 11052 | |
| 11053 ImplementedMember(int offset, int length) { | |
| 11054 this.offset = offset; | |
| 11055 this.length = length; | |
| 11056 } | |
| 11057 | |
| 11058 factory ImplementedMember.fromJson(JsonDecoder jsonDecoder, String jsonPath, O
bject json) { | |
| 11059 if (json == null) { | |
| 11060 json = {}; | |
| 11061 } | |
| 11062 if (json is Map) { | |
| 11063 int offset; | |
| 11064 if (json.containsKey("offset")) { | |
| 11065 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 11066 } else { | |
| 11067 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 11068 } | |
| 11069 int length; | |
| 11070 if (json.containsKey("length")) { | |
| 11071 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | |
| 11072 } else { | |
| 11073 throw jsonDecoder.missingKey(jsonPath, "length"); | |
| 11074 } | |
| 11075 return new ImplementedMember(offset, length); | |
| 11076 } else { | |
| 11077 throw jsonDecoder.mismatch(jsonPath, "ImplementedMember", json); | |
| 11078 } | |
| 11079 } | |
| 11080 | |
| 11081 Map<String, dynamic> toJson() { | |
| 11082 Map<String, dynamic> result = {}; | |
| 11083 result["offset"] = offset; | |
| 11084 result["length"] = length; | |
| 11085 return result; | |
| 11086 } | |
| 11087 | |
| 11088 @override | |
| 11089 String toString() => JSON.encode(toJson()); | |
| 11090 | |
| 11091 @override | |
| 11092 bool operator==(other) { | |
| 11093 if (other is ImplementedMember) { | |
| 11094 return offset == other.offset && | |
| 11095 length == other.length; | |
| 11096 } | |
| 11097 return false; | |
| 11098 } | |
| 11099 | |
| 11100 @override | |
| 11101 int get hashCode { | |
| 11102 int hash = 0; | |
| 11103 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 11104 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
| 11105 return _JenkinsSmiHash.finish(hash); | |
| 11106 } | |
| 11107 } | |
| 11108 | |
| 11109 /** | |
| 11110 * LinkedEditGroup | |
| 11111 * | |
| 11112 * { | |
| 11113 * "positions": List<Position> | |
| 11114 * "length": int | |
| 11115 * "suggestions": List<LinkedEditSuggestion> | |
| 11116 * } | |
| 11117 */ | |
| 11118 class LinkedEditGroup implements HasToJson { | |
| 11119 List<Position> _positions; | |
| 11120 | |
| 11121 int _length; | |
| 11122 | |
| 11123 List<LinkedEditSuggestion> _suggestions; | |
| 11124 | |
| 11125 /** | |
| 11126 * The positions of the regions that should be edited simultaneously. | |
| 11127 */ | |
| 11128 List<Position> get positions => _positions; | |
| 11129 | |
| 11130 /** | |
| 11131 * The positions of the regions that should be edited simultaneously. | |
| 11132 */ | |
| 11133 void set positions(List<Position> value) { | |
| 11134 assert(value != null); | |
| 11135 this._positions = value; | |
| 11136 } | |
| 11137 | |
| 11138 /** | |
| 11139 * The length of the regions that should be edited simultaneously. | |
| 11140 */ | |
| 11141 int get length => _length; | |
| 11142 | |
| 11143 /** | |
| 11144 * The length of the regions that should be edited simultaneously. | |
| 11145 */ | |
| 11146 void set length(int value) { | |
| 11147 assert(value != null); | |
| 11148 this._length = value; | |
| 11149 } | |
| 11150 | |
| 11151 /** | |
| 11152 * Pre-computed suggestions for what every region might want to be changed | |
| 11153 * to. | |
| 11154 */ | |
| 11155 List<LinkedEditSuggestion> get suggestions => _suggestions; | |
| 11156 | |
| 11157 /** | |
| 11158 * Pre-computed suggestions for what every region might want to be changed | |
| 11159 * to. | |
| 11160 */ | |
| 11161 void set suggestions(List<LinkedEditSuggestion> value) { | |
| 11162 assert(value != null); | |
| 11163 this._suggestions = value; | |
| 11164 } | |
| 11165 | |
| 11166 LinkedEditGroup(List<Position> positions, int length, List<LinkedEditSuggestio
n> suggestions) { | |
| 11167 this.positions = positions; | |
| 11168 this.length = length; | |
| 11169 this.suggestions = suggestions; | |
| 11170 } | |
| 11171 | |
| 11172 factory LinkedEditGroup.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obj
ect json) { | |
| 11173 if (json == null) { | |
| 11174 json = {}; | |
| 11175 } | |
| 11176 if (json is Map) { | |
| 11177 List<Position> positions; | |
| 11178 if (json.containsKey("positions")) { | |
| 11179 positions = jsonDecoder._decodeList(jsonPath + ".positions", json["posit
ions"], (String jsonPath, Object json) => new Position.fromJson(jsonDecoder, jso
nPath, json)); | |
| 11180 } else { | |
| 11181 throw jsonDecoder.missingKey(jsonPath, "positions"); | |
| 11182 } | |
| 11183 int length; | |
| 11184 if (json.containsKey("length")) { | |
| 11185 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | |
| 11186 } else { | |
| 11187 throw jsonDecoder.missingKey(jsonPath, "length"); | |
| 11188 } | |
| 11189 List<LinkedEditSuggestion> suggestions; | |
| 11190 if (json.containsKey("suggestions")) { | |
| 11191 suggestions = jsonDecoder._decodeList(jsonPath + ".suggestions", json["s
uggestions"], (String jsonPath, Object json) => new LinkedEditSuggestion.fromJso
n(jsonDecoder, jsonPath, json)); | |
| 11192 } else { | |
| 11193 throw jsonDecoder.missingKey(jsonPath, "suggestions"); | |
| 11194 } | |
| 11195 return new LinkedEditGroup(positions, length, suggestions); | |
| 11196 } else { | |
| 11197 throw jsonDecoder.mismatch(jsonPath, "LinkedEditGroup", json); | |
| 11198 } | |
| 11199 } | |
| 11200 | |
| 11201 /** | |
| 11202 * Construct an empty LinkedEditGroup. | |
| 11203 */ | |
| 11204 LinkedEditGroup.empty() : this(<Position>[], 0, <LinkedEditSuggestion>[]); | |
| 11205 | |
| 11206 Map<String, dynamic> toJson() { | |
| 11207 Map<String, dynamic> result = {}; | |
| 11208 result["positions"] = positions.map((Position value) => value.toJson()).toLi
st(); | |
| 11209 result["length"] = length; | |
| 11210 result["suggestions"] = suggestions.map((LinkedEditSuggestion value) => valu
e.toJson()).toList(); | |
| 11211 return result; | |
| 11212 } | |
| 11213 | |
| 11214 /** | |
| 11215 * Add a new position and change the length. | |
| 11216 */ | |
| 11217 void addPosition(Position position, int length) { | |
| 11218 positions.add(position); | |
| 11219 this.length = length; | |
| 11220 } | |
| 11221 | |
| 11222 /** | |
| 11223 * Add a new suggestion. | |
| 11224 */ | |
| 11225 void addSuggestion(LinkedEditSuggestion suggestion) { | |
| 11226 suggestions.add(suggestion); | |
| 11227 } | |
| 11228 | |
| 11229 @override | |
| 11230 String toString() => JSON.encode(toJson()); | |
| 11231 | |
| 11232 @override | |
| 11233 bool operator==(other) { | |
| 11234 if (other is LinkedEditGroup) { | |
| 11235 return _listEqual(positions, other.positions, (Position a, Position b) =>
a == b) && | |
| 11236 length == other.length && | |
| 11237 _listEqual(suggestions, other.suggestions, (LinkedEditSuggestion a, Li
nkedEditSuggestion b) => a == b); | |
| 11238 } | |
| 11239 return false; | |
| 11240 } | |
| 11241 | |
| 11242 @override | |
| 11243 int get hashCode { | |
| 11244 int hash = 0; | |
| 11245 hash = _JenkinsSmiHash.combine(hash, positions.hashCode); | |
| 11246 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
| 11247 hash = _JenkinsSmiHash.combine(hash, suggestions.hashCode); | |
| 11248 return _JenkinsSmiHash.finish(hash); | |
| 11249 } | |
| 11250 } | |
| 11251 | |
| 11252 /** | |
| 11253 * LinkedEditSuggestion | |
| 11254 * | |
| 11255 * { | |
| 11256 * "value": String | |
| 11257 * "kind": LinkedEditSuggestionKind | |
| 11258 * } | |
| 11259 */ | |
| 11260 class LinkedEditSuggestion implements HasToJson { | |
| 11261 String _value; | |
| 11262 | |
| 11263 LinkedEditSuggestionKind _kind; | |
| 11264 | |
| 11265 /** | |
| 11266 * The value that could be used to replace all of the linked edit regions. | |
| 11267 */ | |
| 11268 String get value => _value; | |
| 11269 | |
| 11270 /** | |
| 11271 * The value that could be used to replace all of the linked edit regions. | |
| 11272 */ | |
| 11273 void set value(String value) { | |
| 11274 assert(value != null); | |
| 11275 this._value = value; | |
| 11276 } | |
| 11277 | |
| 11278 /** | |
| 11279 * The kind of value being proposed. | |
| 11280 */ | |
| 11281 LinkedEditSuggestionKind get kind => _kind; | |
| 11282 | |
| 11283 /** | |
| 11284 * The kind of value being proposed. | |
| 11285 */ | |
| 11286 void set kind(LinkedEditSuggestionKind value) { | |
| 11287 assert(value != null); | |
| 11288 this._kind = value; | |
| 11289 } | |
| 11290 | |
| 11291 LinkedEditSuggestion(String value, LinkedEditSuggestionKind kind) { | |
| 11292 this.value = value; | |
| 11293 this.kind = kind; | |
| 11294 } | |
| 11295 | |
| 11296 factory LinkedEditSuggestion.fromJson(JsonDecoder jsonDecoder, String jsonPath
, Object json) { | |
| 11297 if (json == null) { | |
| 11298 json = {}; | |
| 11299 } | |
| 11300 if (json is Map) { | |
| 11301 String value; | |
| 11302 if (json.containsKey("value")) { | |
| 11303 value = jsonDecoder._decodeString(jsonPath + ".value", json["value"]); | |
| 11304 } else { | |
| 11305 throw jsonDecoder.missingKey(jsonPath, "value"); | |
| 11306 } | |
| 11307 LinkedEditSuggestionKind kind; | |
| 11308 if (json.containsKey("kind")) { | |
| 11309 kind = new LinkedEditSuggestionKind.fromJson(jsonDecoder, jsonPath + ".k
ind", json["kind"]); | |
| 11310 } else { | |
| 11311 throw jsonDecoder.missingKey(jsonPath, "kind"); | |
| 11312 } | |
| 11313 return new LinkedEditSuggestion(value, kind); | |
| 11314 } else { | |
| 11315 throw jsonDecoder.mismatch(jsonPath, "LinkedEditSuggestion", json); | |
| 11316 } | |
| 11317 } | |
| 11318 | |
| 11319 Map<String, dynamic> toJson() { | |
| 11320 Map<String, dynamic> result = {}; | |
| 11321 result["value"] = value; | |
| 11322 result["kind"] = kind.toJson(); | |
| 11323 return result; | |
| 11324 } | |
| 11325 | |
| 11326 @override | |
| 11327 String toString() => JSON.encode(toJson()); | |
| 11328 | |
| 11329 @override | |
| 11330 bool operator==(other) { | |
| 11331 if (other is LinkedEditSuggestion) { | |
| 11332 return value == other.value && | |
| 11333 kind == other.kind; | |
| 11334 } | |
| 11335 return false; | |
| 11336 } | |
| 11337 | |
| 11338 @override | |
| 11339 int get hashCode { | |
| 11340 int hash = 0; | |
| 11341 hash = _JenkinsSmiHash.combine(hash, value.hashCode); | |
| 11342 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); | |
| 11343 return _JenkinsSmiHash.finish(hash); | |
| 11344 } | |
| 11345 } | |
| 11346 | |
| 11347 /** | |
| 11348 * LinkedEditSuggestionKind | |
| 11349 * | |
| 11350 * enum { | |
| 11351 * METHOD | |
| 11352 * PARAMETER | |
| 11353 * TYPE | |
| 11354 * VARIABLE | |
| 11355 * } | |
| 11356 */ | |
| 11357 class LinkedEditSuggestionKind implements Enum { | |
| 11358 static const METHOD = const LinkedEditSuggestionKind._("METHOD"); | |
| 11359 | |
| 11360 static const PARAMETER = const LinkedEditSuggestionKind._("PARAMETER"); | |
| 11361 | |
| 11362 static const TYPE = const LinkedEditSuggestionKind._("TYPE"); | |
| 11363 | |
| 11364 static const VARIABLE = const LinkedEditSuggestionKind._("VARIABLE"); | |
| 11365 | |
| 11366 /** | |
| 11367 * A list containing all of the enum values that are defined. | |
| 11368 */ | |
| 11369 static const List<LinkedEditSuggestionKind> VALUES = const <LinkedEditSuggesti
onKind>[METHOD, PARAMETER, TYPE, VARIABLE]; | |
| 11370 | |
| 11371 final String name; | |
| 11372 | |
| 11373 const LinkedEditSuggestionKind._(this.name); | |
| 11374 | |
| 11375 factory LinkedEditSuggestionKind(String name) { | |
| 11376 switch (name) { | |
| 11377 case "METHOD": | |
| 11378 return METHOD; | |
| 11379 case "PARAMETER": | |
| 11380 return PARAMETER; | |
| 11381 case "TYPE": | |
| 11382 return TYPE; | |
| 11383 case "VARIABLE": | |
| 11384 return VARIABLE; | |
| 11385 } | |
| 11386 throw new Exception('Illegal enum value: $name'); | |
| 11387 } | |
| 11388 | |
| 11389 factory LinkedEditSuggestionKind.fromJson(JsonDecoder jsonDecoder, String json
Path, Object json) { | |
| 11390 if (json is String) { | |
| 11391 try { | |
| 11392 return new LinkedEditSuggestionKind(json); | |
| 11393 } catch(_) { | |
| 11394 // Fall through | |
| 11395 } | |
| 11396 } | |
| 11397 throw jsonDecoder.mismatch(jsonPath, "LinkedEditSuggestionKind", json); | |
| 11398 } | |
| 11399 | |
| 11400 @override | |
| 11401 String toString() => "LinkedEditSuggestionKind.$name"; | |
| 11402 | |
| 11403 String toJson() => name; | |
| 11404 } | |
| 11405 | |
| 11406 /** | |
| 11407 * Location | |
| 11408 * | |
| 11409 * { | |
| 11410 * "file": FilePath | |
| 11411 * "offset": int | |
| 11412 * "length": int | |
| 11413 * "startLine": int | |
| 11414 * "startColumn": int | |
| 11415 * } | |
| 11416 */ | |
| 11417 class Location implements HasToJson { | |
| 11418 String _file; | |
| 11419 | |
| 11420 int _offset; | |
| 11421 | |
| 11422 int _length; | |
| 11423 | |
| 11424 int _startLine; | |
| 11425 | |
| 11426 int _startColumn; | |
| 11427 | |
| 11428 /** | |
| 11429 * The file containing the range. | |
| 11430 */ | |
| 11431 String get file => _file; | |
| 11432 | |
| 11433 /** | |
| 11434 * The file containing the range. | |
| 11435 */ | |
| 11436 void set file(String value) { | |
| 11437 assert(value != null); | |
| 11438 this._file = value; | |
| 11439 } | |
| 11440 | |
| 11441 /** | |
| 11442 * The offset of the range. | |
| 11443 */ | |
| 11444 int get offset => _offset; | |
| 11445 | |
| 11446 /** | |
| 11447 * The offset of the range. | |
| 11448 */ | |
| 11449 void set offset(int value) { | |
| 11450 assert(value != null); | |
| 11451 this._offset = value; | |
| 11452 } | |
| 11453 | |
| 11454 /** | |
| 11455 * The length of the range. | |
| 11456 */ | |
| 11457 int get length => _length; | |
| 11458 | |
| 11459 /** | |
| 11460 * The length of the range. | |
| 11461 */ | |
| 11462 void set length(int value) { | |
| 11463 assert(value != null); | |
| 11464 this._length = value; | |
| 11465 } | |
| 11466 | |
| 11467 /** | |
| 11468 * The one-based index of the line containing the first character of the | |
| 11469 * range. | |
| 11470 */ | |
| 11471 int get startLine => _startLine; | |
| 11472 | |
| 11473 /** | |
| 11474 * The one-based index of the line containing the first character of the | |
| 11475 * range. | |
| 11476 */ | |
| 11477 void set startLine(int value) { | |
| 11478 assert(value != null); | |
| 11479 this._startLine = value; | |
| 11480 } | |
| 11481 | |
| 11482 /** | |
| 11483 * The one-based index of the column containing the first character of the | |
| 11484 * range. | |
| 11485 */ | |
| 11486 int get startColumn => _startColumn; | |
| 11487 | |
| 11488 /** | |
| 11489 * The one-based index of the column containing the first character of the | |
| 11490 * range. | |
| 11491 */ | |
| 11492 void set startColumn(int value) { | |
| 11493 assert(value != null); | |
| 11494 this._startColumn = value; | |
| 11495 } | |
| 11496 | |
| 11497 Location(String file, int offset, int length, int startLine, int startColumn)
{ | |
| 11498 this.file = file; | |
| 11499 this.offset = offset; | |
| 11500 this.length = length; | |
| 11501 this.startLine = startLine; | |
| 11502 this.startColumn = startColumn; | |
| 11503 } | |
| 11504 | |
| 11505 factory Location.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object jso
n) { | |
| 11506 if (json == null) { | |
| 11507 json = {}; | |
| 11508 } | |
| 11509 if (json is Map) { | |
| 11510 String file; | |
| 11511 if (json.containsKey("file")) { | |
| 11512 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 11513 } else { | |
| 11514 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 11515 } | |
| 11516 int offset; | |
| 11517 if (json.containsKey("offset")) { | |
| 11518 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 11519 } else { | |
| 11520 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 11521 } | |
| 11522 int length; | |
| 11523 if (json.containsKey("length")) { | |
| 11524 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | |
| 11525 } else { | |
| 11526 throw jsonDecoder.missingKey(jsonPath, "length"); | |
| 11527 } | |
| 11528 int startLine; | |
| 11529 if (json.containsKey("startLine")) { | |
| 11530 startLine = jsonDecoder._decodeInt(jsonPath + ".startLine", json["startL
ine"]); | |
| 11531 } else { | |
| 11532 throw jsonDecoder.missingKey(jsonPath, "startLine"); | |
| 11533 } | |
| 11534 int startColumn; | |
| 11535 if (json.containsKey("startColumn")) { | |
| 11536 startColumn = jsonDecoder._decodeInt(jsonPath + ".startColumn", json["st
artColumn"]); | |
| 11537 } else { | |
| 11538 throw jsonDecoder.missingKey(jsonPath, "startColumn"); | |
| 11539 } | |
| 11540 return new Location(file, offset, length, startLine, startColumn); | |
| 11541 } else { | |
| 11542 throw jsonDecoder.mismatch(jsonPath, "Location", json); | |
| 11543 } | |
| 11544 } | |
| 11545 | |
| 11546 Map<String, dynamic> toJson() { | |
| 11547 Map<String, dynamic> result = {}; | |
| 11548 result["file"] = file; | |
| 11549 result["offset"] = offset; | |
| 11550 result["length"] = length; | |
| 11551 result["startLine"] = startLine; | |
| 11552 result["startColumn"] = startColumn; | |
| 11553 return result; | |
| 11554 } | |
| 11555 | |
| 11556 @override | |
| 11557 String toString() => JSON.encode(toJson()); | |
| 11558 | |
| 11559 @override | |
| 11560 bool operator==(other) { | |
| 11561 if (other is Location) { | |
| 11562 return file == other.file && | |
| 11563 offset == other.offset && | |
| 11564 length == other.length && | |
| 11565 startLine == other.startLine && | |
| 11566 startColumn == other.startColumn; | |
| 11567 } | |
| 11568 return false; | |
| 11569 } | |
| 11570 | |
| 11571 @override | |
| 11572 int get hashCode { | |
| 11573 int hash = 0; | |
| 11574 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 11575 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 11576 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
| 11577 hash = _JenkinsSmiHash.combine(hash, startLine.hashCode); | |
| 11578 hash = _JenkinsSmiHash.combine(hash, startColumn.hashCode); | |
| 11579 return _JenkinsSmiHash.finish(hash); | |
| 11580 } | |
| 11581 } | |
| 11582 | |
| 11583 /** | |
| 11584 * NavigationRegion | |
| 11585 * | |
| 11586 * { | |
| 11587 * "offset": int | |
| 11588 * "length": int | |
| 11589 * "targets": List<int> | |
| 11590 * } | |
| 11591 */ | |
| 11592 class NavigationRegion implements HasToJson { | |
| 11593 int _offset; | |
| 11594 | |
| 11595 int _length; | |
| 11596 | |
| 11597 List<int> _targets; | |
| 11598 | |
| 11599 /** | |
| 11600 * The offset of the region from which the user can navigate. | |
| 11601 */ | |
| 11602 int get offset => _offset; | |
| 11603 | |
| 11604 /** | |
| 11605 * The offset of the region from which the user can navigate. | |
| 11606 */ | |
| 11607 void set offset(int value) { | |
| 11608 assert(value != null); | |
| 11609 this._offset = value; | |
| 11610 } | |
| 11611 | |
| 11612 /** | |
| 11613 * The length of the region from which the user can navigate. | |
| 11614 */ | |
| 11615 int get length => _length; | |
| 11616 | |
| 11617 /** | |
| 11618 * The length of the region from which the user can navigate. | |
| 11619 */ | |
| 11620 void set length(int value) { | |
| 11621 assert(value != null); | |
| 11622 this._length = value; | |
| 11623 } | |
| 11624 | |
| 11625 /** | |
| 11626 * The indexes of the targets (in the enclosing navigation response) to which | |
| 11627 * the given region is bound. By opening the target, clients can implement | |
| 11628 * one form of navigation. This list cannot be empty. | |
| 11629 */ | |
| 11630 List<int> get targets => _targets; | |
| 11631 | |
| 11632 /** | |
| 11633 * The indexes of the targets (in the enclosing navigation response) to which | |
| 11634 * the given region is bound. By opening the target, clients can implement | |
| 11635 * one form of navigation. This list cannot be empty. | |
| 11636 */ | |
| 11637 void set targets(List<int> value) { | |
| 11638 assert(value != null); | |
| 11639 this._targets = value; | |
| 11640 } | |
| 11641 | |
| 11642 NavigationRegion(int offset, int length, List<int> targets) { | |
| 11643 this.offset = offset; | |
| 11644 this.length = length; | |
| 11645 this.targets = targets; | |
| 11646 } | |
| 11647 | |
| 11648 factory NavigationRegion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Ob
ject json) { | |
| 11649 if (json == null) { | |
| 11650 json = {}; | |
| 11651 } | |
| 11652 if (json is Map) { | |
| 11653 int offset; | |
| 11654 if (json.containsKey("offset")) { | |
| 11655 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 11656 } else { | |
| 11657 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 11658 } | |
| 11659 int length; | |
| 11660 if (json.containsKey("length")) { | |
| 11661 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | |
| 11662 } else { | |
| 11663 throw jsonDecoder.missingKey(jsonPath, "length"); | |
| 11664 } | |
| 11665 List<int> targets; | |
| 11666 if (json.containsKey("targets")) { | |
| 11667 targets = jsonDecoder._decodeList(jsonPath + ".targets", json["targets"]
, jsonDecoder._decodeInt); | |
| 11668 } else { | |
| 11669 throw jsonDecoder.missingKey(jsonPath, "targets"); | |
| 11670 } | |
| 11671 return new NavigationRegion(offset, length, targets); | |
| 11672 } else { | |
| 11673 throw jsonDecoder.mismatch(jsonPath, "NavigationRegion", json); | |
| 11674 } | |
| 11675 } | |
| 11676 | |
| 11677 Map<String, dynamic> toJson() { | |
| 11678 Map<String, dynamic> result = {}; | |
| 11679 result["offset"] = offset; | |
| 11680 result["length"] = length; | |
| 11681 result["targets"] = targets; | |
| 11682 return result; | |
| 11683 } | |
| 11684 | |
| 11685 @override | |
| 11686 String toString() => JSON.encode(toJson()); | |
| 11687 | |
| 11688 @override | |
| 11689 bool operator==(other) { | |
| 11690 if (other is NavigationRegion) { | |
| 11691 return offset == other.offset && | |
| 11692 length == other.length && | |
| 11693 _listEqual(targets, other.targets, (int a, int b) => a == b); | |
| 11694 } | |
| 11695 return false; | |
| 11696 } | |
| 11697 | |
| 11698 @override | |
| 11699 int get hashCode { | |
| 11700 int hash = 0; | |
| 11701 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 11702 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
| 11703 hash = _JenkinsSmiHash.combine(hash, targets.hashCode); | |
| 11704 return _JenkinsSmiHash.finish(hash); | |
| 11705 } | |
| 11706 } | |
| 11707 | |
| 11708 /** | |
| 11709 * NavigationTarget | |
| 11710 * | |
| 11711 * { | |
| 11712 * "kind": ElementKind | |
| 11713 * "fileIndex": int | |
| 11714 * "offset": int | |
| 11715 * "length": int | |
| 11716 * "startLine": int | |
| 11717 * "startColumn": int | |
| 11718 * } | |
| 11719 */ | |
| 11720 class NavigationTarget implements HasToJson { | |
| 11721 ElementKind _kind; | |
| 11722 | |
| 11723 int _fileIndex; | |
| 11724 | |
| 11725 int _offset; | |
| 11726 | |
| 11727 int _length; | |
| 11728 | |
| 11729 int _startLine; | |
| 11730 | |
| 11731 int _startColumn; | |
| 11732 | |
| 11733 /** | |
| 11734 * The kind of the element. | |
| 11735 */ | |
| 11736 ElementKind get kind => _kind; | |
| 11737 | |
| 11738 /** | |
| 11739 * The kind of the element. | |
| 11740 */ | |
| 11741 void set kind(ElementKind value) { | |
| 11742 assert(value != null); | |
| 11743 this._kind = value; | |
| 11744 } | |
| 11745 | |
| 11746 /** | |
| 11747 * The index of the file (in the enclosing navigation response) to navigate | |
| 11748 * to. | |
| 11749 */ | |
| 11750 int get fileIndex => _fileIndex; | |
| 11751 | |
| 11752 /** | |
| 11753 * The index of the file (in the enclosing navigation response) to navigate | |
| 11754 * to. | |
| 11755 */ | |
| 11756 void set fileIndex(int value) { | |
| 11757 assert(value != null); | |
| 11758 this._fileIndex = value; | |
| 11759 } | |
| 11760 | |
| 11761 /** | |
| 11762 * The offset of the region from which the user can navigate. | |
| 11763 */ | |
| 11764 int get offset => _offset; | |
| 11765 | |
| 11766 /** | |
| 11767 * The offset of the region from which the user can navigate. | |
| 11768 */ | |
| 11769 void set offset(int value) { | |
| 11770 assert(value != null); | |
| 11771 this._offset = value; | |
| 11772 } | |
| 11773 | |
| 11774 /** | |
| 11775 * The length of the region from which the user can navigate. | |
| 11776 */ | |
| 11777 int get length => _length; | |
| 11778 | |
| 11779 /** | |
| 11780 * The length of the region from which the user can navigate. | |
| 11781 */ | |
| 11782 void set length(int value) { | |
| 11783 assert(value != null); | |
| 11784 this._length = value; | |
| 11785 } | |
| 11786 | |
| 11787 /** | |
| 11788 * The one-based index of the line containing the first character of the | |
| 11789 * region. | |
| 11790 */ | |
| 11791 int get startLine => _startLine; | |
| 11792 | |
| 11793 /** | |
| 11794 * The one-based index of the line containing the first character of the | |
| 11795 * region. | |
| 11796 */ | |
| 11797 void set startLine(int value) { | |
| 11798 assert(value != null); | |
| 11799 this._startLine = value; | |
| 11800 } | |
| 11801 | |
| 11802 /** | |
| 11803 * The one-based index of the column containing the first character of the | |
| 11804 * region. | |
| 11805 */ | |
| 11806 int get startColumn => _startColumn; | |
| 11807 | |
| 11808 /** | |
| 11809 * The one-based index of the column containing the first character of the | |
| 11810 * region. | |
| 11811 */ | |
| 11812 void set startColumn(int value) { | |
| 11813 assert(value != null); | |
| 11814 this._startColumn = value; | |
| 11815 } | |
| 11816 | |
| 11817 NavigationTarget(ElementKind kind, int fileIndex, int offset, int length, int
startLine, int startColumn) { | |
| 11818 this.kind = kind; | |
| 11819 this.fileIndex = fileIndex; | |
| 11820 this.offset = offset; | |
| 11821 this.length = length; | |
| 11822 this.startLine = startLine; | |
| 11823 this.startColumn = startColumn; | |
| 11824 } | |
| 11825 | |
| 11826 factory NavigationTarget.fromJson(JsonDecoder jsonDecoder, String jsonPath, Ob
ject json) { | |
| 11827 if (json == null) { | |
| 11828 json = {}; | |
| 11829 } | |
| 11830 if (json is Map) { | |
| 11831 ElementKind kind; | |
| 11832 if (json.containsKey("kind")) { | |
| 11833 kind = new ElementKind.fromJson(jsonDecoder, jsonPath + ".kind", json["k
ind"]); | |
| 11834 } else { | |
| 11835 throw jsonDecoder.missingKey(jsonPath, "kind"); | |
| 11836 } | |
| 11837 int fileIndex; | |
| 11838 if (json.containsKey("fileIndex")) { | |
| 11839 fileIndex = jsonDecoder._decodeInt(jsonPath + ".fileIndex", json["fileIn
dex"]); | |
| 11840 } else { | |
| 11841 throw jsonDecoder.missingKey(jsonPath, "fileIndex"); | |
| 11842 } | |
| 11843 int offset; | |
| 11844 if (json.containsKey("offset")) { | |
| 11845 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 11846 } else { | |
| 11847 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 11848 } | |
| 11849 int length; | |
| 11850 if (json.containsKey("length")) { | |
| 11851 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | |
| 11852 } else { | |
| 11853 throw jsonDecoder.missingKey(jsonPath, "length"); | |
| 11854 } | |
| 11855 int startLine; | |
| 11856 if (json.containsKey("startLine")) { | |
| 11857 startLine = jsonDecoder._decodeInt(jsonPath + ".startLine", json["startL
ine"]); | |
| 11858 } else { | |
| 11859 throw jsonDecoder.missingKey(jsonPath, "startLine"); | |
| 11860 } | |
| 11861 int startColumn; | |
| 11862 if (json.containsKey("startColumn")) { | |
| 11863 startColumn = jsonDecoder._decodeInt(jsonPath + ".startColumn", json["st
artColumn"]); | |
| 11864 } else { | |
| 11865 throw jsonDecoder.missingKey(jsonPath, "startColumn"); | |
| 11866 } | |
| 11867 return new NavigationTarget(kind, fileIndex, offset, length, startLine, st
artColumn); | |
| 11868 } else { | |
| 11869 throw jsonDecoder.mismatch(jsonPath, "NavigationTarget", json); | |
| 11870 } | |
| 11871 } | |
| 11872 | |
| 11873 Map<String, dynamic> toJson() { | |
| 11874 Map<String, dynamic> result = {}; | |
| 11875 result["kind"] = kind.toJson(); | |
| 11876 result["fileIndex"] = fileIndex; | |
| 11877 result["offset"] = offset; | |
| 11878 result["length"] = length; | |
| 11879 result["startLine"] = startLine; | |
| 11880 result["startColumn"] = startColumn; | |
| 11881 return result; | |
| 11882 } | |
| 11883 | |
| 11884 @override | |
| 11885 String toString() => JSON.encode(toJson()); | |
| 11886 | |
| 11887 @override | |
| 11888 bool operator==(other) { | |
| 11889 if (other is NavigationTarget) { | |
| 11890 return kind == other.kind && | |
| 11891 fileIndex == other.fileIndex && | |
| 11892 offset == other.offset && | |
| 11893 length == other.length && | |
| 11894 startLine == other.startLine && | |
| 11895 startColumn == other.startColumn; | |
| 11896 } | |
| 11897 return false; | |
| 11898 } | |
| 11899 | |
| 11900 @override | |
| 11901 int get hashCode { | |
| 11902 int hash = 0; | |
| 11903 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); | |
| 11904 hash = _JenkinsSmiHash.combine(hash, fileIndex.hashCode); | |
| 11905 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 11906 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
| 11907 hash = _JenkinsSmiHash.combine(hash, startLine.hashCode); | |
| 11908 hash = _JenkinsSmiHash.combine(hash, startColumn.hashCode); | |
| 11909 return _JenkinsSmiHash.finish(hash); | |
| 11910 } | |
| 11911 } | |
| 11912 | |
| 11913 /** | |
| 11914 * Occurrences | |
| 11915 * | |
| 11916 * { | |
| 11917 * "element": Element | |
| 11918 * "offsets": List<int> | |
| 11919 * "length": int | |
| 11920 * } | |
| 11921 */ | |
| 11922 class Occurrences implements HasToJson { | |
| 11923 Element _element; | |
| 11924 | |
| 11925 List<int> _offsets; | |
| 11926 | |
| 11927 int _length; | |
| 11928 | |
| 11929 /** | |
| 11930 * The element that was referenced. | |
| 11931 */ | |
| 11932 Element get element => _element; | |
| 11933 | |
| 11934 /** | |
| 11935 * The element that was referenced. | |
| 11936 */ | |
| 11937 void set element(Element value) { | |
| 11938 assert(value != null); | |
| 11939 this._element = value; | |
| 11940 } | |
| 11941 | |
| 11942 /** | |
| 11943 * The offsets of the name of the referenced element within the file. | |
| 11944 */ | |
| 11945 List<int> get offsets => _offsets; | |
| 11946 | |
| 11947 /** | |
| 11948 * The offsets of the name of the referenced element within the file. | |
| 11949 */ | |
| 11950 void set offsets(List<int> value) { | |
| 11951 assert(value != null); | |
| 11952 this._offsets = value; | |
| 11953 } | |
| 11954 | |
| 11955 /** | |
| 11956 * The length of the name of the referenced element. | |
| 11957 */ | |
| 11958 int get length => _length; | |
| 11959 | |
| 11960 /** | |
| 11961 * The length of the name of the referenced element. | |
| 11962 */ | |
| 11963 void set length(int value) { | |
| 11964 assert(value != null); | |
| 11965 this._length = value; | |
| 11966 } | |
| 11967 | |
| 11968 Occurrences(Element element, List<int> offsets, int length) { | |
| 11969 this.element = element; | |
| 11970 this.offsets = offsets; | |
| 11971 this.length = length; | |
| 11972 } | |
| 11973 | |
| 11974 factory Occurrences.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object
json) { | |
| 11975 if (json == null) { | |
| 11976 json = {}; | |
| 11977 } | |
| 11978 if (json is Map) { | |
| 11979 Element element; | |
| 11980 if (json.containsKey("element")) { | |
| 11981 element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json[
"element"]); | |
| 11982 } else { | |
| 11983 throw jsonDecoder.missingKey(jsonPath, "element"); | |
| 11984 } | |
| 11985 List<int> offsets; | |
| 11986 if (json.containsKey("offsets")) { | |
| 11987 offsets = jsonDecoder._decodeList(jsonPath + ".offsets", json["offsets"]
, jsonDecoder._decodeInt); | |
| 11988 } else { | |
| 11989 throw jsonDecoder.missingKey(jsonPath, "offsets"); | |
| 11990 } | |
| 11991 int length; | |
| 11992 if (json.containsKey("length")) { | |
| 11993 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | |
| 11994 } else { | |
| 11995 throw jsonDecoder.missingKey(jsonPath, "length"); | |
| 11996 } | |
| 11997 return new Occurrences(element, offsets, length); | |
| 11998 } else { | |
| 11999 throw jsonDecoder.mismatch(jsonPath, "Occurrences", json); | |
| 12000 } | |
| 12001 } | |
| 12002 | |
| 12003 Map<String, dynamic> toJson() { | |
| 12004 Map<String, dynamic> result = {}; | |
| 12005 result["element"] = element.toJson(); | |
| 12006 result["offsets"] = offsets; | |
| 12007 result["length"] = length; | |
| 12008 return result; | |
| 12009 } | |
| 12010 | |
| 12011 @override | |
| 12012 String toString() => JSON.encode(toJson()); | |
| 12013 | |
| 12014 @override | |
| 12015 bool operator==(other) { | |
| 12016 if (other is Occurrences) { | |
| 12017 return element == other.element && | |
| 12018 _listEqual(offsets, other.offsets, (int a, int b) => a == b) && | |
| 12019 length == other.length; | |
| 12020 } | |
| 12021 return false; | |
| 12022 } | |
| 12023 | |
| 12024 @override | |
| 12025 int get hashCode { | |
| 12026 int hash = 0; | |
| 12027 hash = _JenkinsSmiHash.combine(hash, element.hashCode); | |
| 12028 hash = _JenkinsSmiHash.combine(hash, offsets.hashCode); | |
| 12029 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
| 12030 return _JenkinsSmiHash.finish(hash); | |
| 12031 } | |
| 12032 } | |
| 12033 | |
| 12034 /** | |
| 12035 * Outline | |
| 12036 * | |
| 12037 * { | |
| 12038 * "element": Element | |
| 12039 * "offset": int | |
| 12040 * "length": int | |
| 12041 * "children": optional List<Outline> | |
| 12042 * } | |
| 12043 */ | |
| 12044 class Outline implements HasToJson { | |
| 12045 Element _element; | |
| 12046 | |
| 12047 int _offset; | |
| 12048 | |
| 12049 int _length; | |
| 12050 | |
| 12051 List<Outline> _children; | |
| 12052 | |
| 12053 /** | |
| 12054 * A description of the element represented by this node. | |
| 12055 */ | |
| 12056 Element get element => _element; | |
| 12057 | |
| 12058 /** | |
| 12059 * A description of the element represented by this node. | |
| 12060 */ | |
| 12061 void set element(Element value) { | |
| 12062 assert(value != null); | |
| 12063 this._element = value; | |
| 12064 } | |
| 12065 | |
| 12066 /** | |
| 12067 * The offset of the first character of the element. This is different than | |
| 12068 * the offset in the Element, which if the offset of the name of the element. | |
| 12069 * It can be used, for example, to map locations in the file back to an | |
| 12070 * outline. | |
| 12071 */ | |
| 12072 int get offset => _offset; | |
| 12073 | |
| 12074 /** | |
| 12075 * The offset of the first character of the element. This is different than | |
| 12076 * the offset in the Element, which if the offset of the name of the element. | |
| 12077 * It can be used, for example, to map locations in the file back to an | |
| 12078 * outline. | |
| 12079 */ | |
| 12080 void set offset(int value) { | |
| 12081 assert(value != null); | |
| 12082 this._offset = value; | |
| 12083 } | |
| 12084 | |
| 12085 /** | |
| 12086 * The length of the element. | |
| 12087 */ | |
| 12088 int get length => _length; | |
| 12089 | |
| 12090 /** | |
| 12091 * The length of the element. | |
| 12092 */ | |
| 12093 void set length(int value) { | |
| 12094 assert(value != null); | |
| 12095 this._length = value; | |
| 12096 } | |
| 12097 | |
| 12098 /** | |
| 12099 * The children of the node. The field will be omitted if the node has no | |
| 12100 * children. | |
| 12101 */ | |
| 12102 List<Outline> get children => _children; | |
| 12103 | |
| 12104 /** | |
| 12105 * The children of the node. The field will be omitted if the node has no | |
| 12106 * children. | |
| 12107 */ | |
| 12108 void set children(List<Outline> value) { | |
| 12109 this._children = value; | |
| 12110 } | |
| 12111 | |
| 12112 Outline(Element element, int offset, int length, {List<Outline> children}) { | |
| 12113 this.element = element; | |
| 12114 this.offset = offset; | |
| 12115 this.length = length; | |
| 12116 this.children = children; | |
| 12117 } | |
| 12118 | |
| 12119 factory Outline.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json
) { | |
| 12120 if (json == null) { | |
| 12121 json = {}; | |
| 12122 } | |
| 12123 if (json is Map) { | |
| 12124 Element element; | |
| 12125 if (json.containsKey("element")) { | |
| 12126 element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json[
"element"]); | |
| 12127 } else { | |
| 12128 throw jsonDecoder.missingKey(jsonPath, "element"); | |
| 12129 } | |
| 12130 int offset; | |
| 12131 if (json.containsKey("offset")) { | |
| 12132 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 12133 } else { | |
| 12134 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 12135 } | |
| 12136 int length; | |
| 12137 if (json.containsKey("length")) { | |
| 12138 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | |
| 12139 } else { | |
| 12140 throw jsonDecoder.missingKey(jsonPath, "length"); | |
| 12141 } | |
| 12142 List<Outline> children; | |
| 12143 if (json.containsKey("children")) { | |
| 12144 children = jsonDecoder._decodeList(jsonPath + ".children", json["childre
n"], (String jsonPath, Object json) => new Outline.fromJson(jsonDecoder, jsonPat
h, json)); | |
| 12145 } | |
| 12146 return new Outline(element, offset, length, children: children); | |
| 12147 } else { | |
| 12148 throw jsonDecoder.mismatch(jsonPath, "Outline", json); | |
| 12149 } | |
| 12150 } | |
| 12151 | |
| 12152 Map<String, dynamic> toJson() { | |
| 12153 Map<String, dynamic> result = {}; | |
| 12154 result["element"] = element.toJson(); | |
| 12155 result["offset"] = offset; | |
| 12156 result["length"] = length; | |
| 12157 if (children != null) { | |
| 12158 result["children"] = children.map((Outline value) => value.toJson()).toLis
t(); | |
| 12159 } | |
| 12160 return result; | |
| 12161 } | |
| 12162 | |
| 12163 @override | |
| 12164 String toString() => JSON.encode(toJson()); | |
| 12165 | |
| 12166 @override | |
| 12167 bool operator==(other) { | |
| 12168 if (other is Outline) { | |
| 12169 return element == other.element && | |
| 12170 offset == other.offset && | |
| 12171 length == other.length && | |
| 12172 _listEqual(children, other.children, (Outline a, Outline b) => a == b)
; | |
| 12173 } | |
| 12174 return false; | |
| 12175 } | |
| 12176 | |
| 12177 @override | |
| 12178 int get hashCode { | |
| 12179 int hash = 0; | |
| 12180 hash = _JenkinsSmiHash.combine(hash, element.hashCode); | |
| 12181 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 12182 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
| 12183 hash = _JenkinsSmiHash.combine(hash, children.hashCode); | |
| 12184 return _JenkinsSmiHash.finish(hash); | |
| 12185 } | |
| 12186 } | |
| 12187 | |
| 12188 /** | |
| 12189 * Override | |
| 12190 * | |
| 12191 * { | |
| 12192 * "offset": int | |
| 12193 * "length": int | |
| 12194 * "superclassMember": optional OverriddenMember | |
| 12195 * "interfaceMembers": optional List<OverriddenMember> | |
| 12196 * } | |
| 12197 */ | |
| 12198 class Override implements HasToJson { | |
| 12199 int _offset; | |
| 12200 | |
| 12201 int _length; | |
| 12202 | |
| 12203 OverriddenMember _superclassMember; | |
| 12204 | |
| 12205 List<OverriddenMember> _interfaceMembers; | |
| 12206 | |
| 12207 /** | |
| 12208 * The offset of the name of the overriding member. | |
| 12209 */ | |
| 12210 int get offset => _offset; | |
| 12211 | |
| 12212 /** | |
| 12213 * The offset of the name of the overriding member. | |
| 12214 */ | |
| 12215 void set offset(int value) { | |
| 12216 assert(value != null); | |
| 12217 this._offset = value; | |
| 12218 } | |
| 12219 | |
| 12220 /** | |
| 12221 * The length of the name of the overriding member. | |
| 12222 */ | |
| 12223 int get length => _length; | |
| 12224 | |
| 12225 /** | |
| 12226 * The length of the name of the overriding member. | |
| 12227 */ | |
| 12228 void set length(int value) { | |
| 12229 assert(value != null); | |
| 12230 this._length = value; | |
| 12231 } | |
| 12232 | |
| 12233 /** | |
| 12234 * The member inherited from a superclass that is overridden by the | |
| 12235 * overriding member. The field is omitted if there is no superclass member, | |
| 12236 * in which case there must be at least one interface member. | |
| 12237 */ | |
| 12238 OverriddenMember get superclassMember => _superclassMember; | |
| 12239 | |
| 12240 /** | |
| 12241 * The member inherited from a superclass that is overridden by the | |
| 12242 * overriding member. The field is omitted if there is no superclass member, | |
| 12243 * in which case there must be at least one interface member. | |
| 12244 */ | |
| 12245 void set superclassMember(OverriddenMember value) { | |
| 12246 this._superclassMember = value; | |
| 12247 } | |
| 12248 | |
| 12249 /** | |
| 12250 * The members inherited from interfaces that are overridden by the | |
| 12251 * overriding member. The field is omitted if there are no interface members, | |
| 12252 * in which case there must be a superclass member. | |
| 12253 */ | |
| 12254 List<OverriddenMember> get interfaceMembers => _interfaceMembers; | |
| 12255 | |
| 12256 /** | |
| 12257 * The members inherited from interfaces that are overridden by the | |
| 12258 * overriding member. The field is omitted if there are no interface members, | |
| 12259 * in which case there must be a superclass member. | |
| 12260 */ | |
| 12261 void set interfaceMembers(List<OverriddenMember> value) { | |
| 12262 this._interfaceMembers = value; | |
| 12263 } | |
| 12264 | |
| 12265 Override(int offset, int length, {OverriddenMember superclassMember, List<Over
riddenMember> interfaceMembers}) { | |
| 12266 this.offset = offset; | |
| 12267 this.length = length; | |
| 12268 this.superclassMember = superclassMember; | |
| 12269 this.interfaceMembers = interfaceMembers; | |
| 12270 } | |
| 12271 | |
| 12272 factory Override.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object jso
n) { | |
| 12273 if (json == null) { | |
| 12274 json = {}; | |
| 12275 } | |
| 12276 if (json is Map) { | |
| 12277 int offset; | |
| 12278 if (json.containsKey("offset")) { | |
| 12279 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 12280 } else { | |
| 12281 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 12282 } | |
| 12283 int length; | |
| 12284 if (json.containsKey("length")) { | |
| 12285 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | |
| 12286 } else { | |
| 12287 throw jsonDecoder.missingKey(jsonPath, "length"); | |
| 12288 } | |
| 12289 OverriddenMember superclassMember; | |
| 12290 if (json.containsKey("superclassMember")) { | |
| 12291 superclassMember = new OverriddenMember.fromJson(jsonDecoder, jsonPath +
".superclassMember", json["superclassMember"]); | |
| 12292 } | |
| 12293 List<OverriddenMember> interfaceMembers; | |
| 12294 if (json.containsKey("interfaceMembers")) { | |
| 12295 interfaceMembers = jsonDecoder._decodeList(jsonPath + ".interfaceMembers
", json["interfaceMembers"], (String jsonPath, Object json) => new OverriddenMem
ber.fromJson(jsonDecoder, jsonPath, json)); | |
| 12296 } | |
| 12297 return new Override(offset, length, superclassMember: superclassMember, in
terfaceMembers: interfaceMembers); | |
| 12298 } else { | |
| 12299 throw jsonDecoder.mismatch(jsonPath, "Override", json); | |
| 12300 } | |
| 12301 } | |
| 12302 | |
| 12303 Map<String, dynamic> toJson() { | |
| 12304 Map<String, dynamic> result = {}; | |
| 12305 result["offset"] = offset; | |
| 12306 result["length"] = length; | |
| 12307 if (superclassMember != null) { | |
| 12308 result["superclassMember"] = superclassMember.toJson(); | |
| 12309 } | |
| 12310 if (interfaceMembers != null) { | |
| 12311 result["interfaceMembers"] = interfaceMembers.map((OverriddenMember value)
=> value.toJson()).toList(); | |
| 12312 } | |
| 12313 return result; | |
| 12314 } | |
| 12315 | |
| 12316 @override | |
| 12317 String toString() => JSON.encode(toJson()); | |
| 12318 | |
| 12319 @override | |
| 12320 bool operator==(other) { | |
| 12321 if (other is Override) { | |
| 12322 return offset == other.offset && | |
| 12323 length == other.length && | |
| 12324 superclassMember == other.superclassMember && | |
| 12325 _listEqual(interfaceMembers, other.interfaceMembers, (OverriddenMember
a, OverriddenMember b) => a == b); | |
| 12326 } | |
| 12327 return false; | |
| 12328 } | |
| 12329 | |
| 12330 @override | |
| 12331 int get hashCode { | |
| 12332 int hash = 0; | |
| 12333 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 12334 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
| 12335 hash = _JenkinsSmiHash.combine(hash, superclassMember.hashCode); | |
| 12336 hash = _JenkinsSmiHash.combine(hash, interfaceMembers.hashCode); | |
| 12337 return _JenkinsSmiHash.finish(hash); | |
| 12338 } | |
| 12339 } | |
| 12340 | |
| 12341 /** | |
| 12342 * OverriddenMember | |
| 12343 * | |
| 12344 * { | |
| 12345 * "element": Element | |
| 12346 * "className": String | |
| 12347 * } | |
| 12348 */ | |
| 12349 class OverriddenMember implements HasToJson { | |
| 12350 Element _element; | |
| 12351 | |
| 12352 String _className; | |
| 12353 | |
| 12354 /** | |
| 12355 * The element that is being overridden. | |
| 12356 */ | |
| 12357 Element get element => _element; | |
| 12358 | |
| 12359 /** | |
| 12360 * The element that is being overridden. | |
| 12361 */ | |
| 12362 void set element(Element value) { | |
| 12363 assert(value != null); | |
| 12364 this._element = value; | |
| 12365 } | |
| 12366 | |
| 12367 /** | |
| 12368 * The name of the class in which the member is defined. | |
| 12369 */ | |
| 12370 String get className => _className; | |
| 12371 | |
| 12372 /** | |
| 12373 * The name of the class in which the member is defined. | |
| 12374 */ | |
| 12375 void set className(String value) { | |
| 12376 assert(value != null); | |
| 12377 this._className = value; | |
| 12378 } | |
| 12379 | |
| 12380 OverriddenMember(Element element, String className) { | |
| 12381 this.element = element; | |
| 12382 this.className = className; | |
| 12383 } | |
| 12384 | |
| 12385 factory OverriddenMember.fromJson(JsonDecoder jsonDecoder, String jsonPath, Ob
ject json) { | |
| 12386 if (json == null) { | |
| 12387 json = {}; | |
| 12388 } | |
| 12389 if (json is Map) { | |
| 12390 Element element; | |
| 12391 if (json.containsKey("element")) { | |
| 12392 element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json[
"element"]); | |
| 12393 } else { | |
| 12394 throw jsonDecoder.missingKey(jsonPath, "element"); | |
| 12395 } | |
| 12396 String className; | |
| 12397 if (json.containsKey("className")) { | |
| 12398 className = jsonDecoder._decodeString(jsonPath + ".className", json["cla
ssName"]); | |
| 12399 } else { | |
| 12400 throw jsonDecoder.missingKey(jsonPath, "className"); | |
| 12401 } | |
| 12402 return new OverriddenMember(element, className); | |
| 12403 } else { | |
| 12404 throw jsonDecoder.mismatch(jsonPath, "OverriddenMember", json); | |
| 12405 } | |
| 12406 } | |
| 12407 | |
| 12408 Map<String, dynamic> toJson() { | |
| 12409 Map<String, dynamic> result = {}; | |
| 12410 result["element"] = element.toJson(); | |
| 12411 result["className"] = className; | |
| 12412 return result; | |
| 12413 } | |
| 12414 | |
| 12415 @override | |
| 12416 String toString() => JSON.encode(toJson()); | |
| 12417 | |
| 12418 @override | |
| 12419 bool operator==(other) { | |
| 12420 if (other is OverriddenMember) { | |
| 12421 return element == other.element && | |
| 12422 className == other.className; | |
| 12423 } | |
| 12424 return false; | |
| 12425 } | |
| 12426 | |
| 12427 @override | |
| 12428 int get hashCode { | |
| 12429 int hash = 0; | |
| 12430 hash = _JenkinsSmiHash.combine(hash, element.hashCode); | |
| 12431 hash = _JenkinsSmiHash.combine(hash, className.hashCode); | |
| 12432 return _JenkinsSmiHash.finish(hash); | |
| 12433 } | |
| 12434 } | |
| 12435 | |
| 12436 /** | |
| 12437 * Position | |
| 12438 * | |
| 12439 * { | |
| 12440 * "file": FilePath | |
| 12441 * "offset": int | |
| 12442 * } | |
| 12443 */ | |
| 12444 class Position implements HasToJson { | |
| 12445 String _file; | |
| 12446 | |
| 12447 int _offset; | |
| 12448 | |
| 12449 /** | |
| 12450 * The file containing the position. | |
| 12451 */ | |
| 12452 String get file => _file; | |
| 12453 | |
| 12454 /** | |
| 12455 * The file containing the position. | |
| 12456 */ | |
| 12457 void set file(String value) { | |
| 12458 assert(value != null); | |
| 12459 this._file = value; | |
| 12460 } | |
| 12461 | |
| 12462 /** | |
| 12463 * The offset of the position. | |
| 12464 */ | |
| 12465 int get offset => _offset; | |
| 12466 | |
| 12467 /** | |
| 12468 * The offset of the position. | |
| 12469 */ | |
| 12470 void set offset(int value) { | |
| 12471 assert(value != null); | |
| 12472 this._offset = value; | |
| 12473 } | |
| 12474 | |
| 12475 Position(String file, int offset) { | |
| 12476 this.file = file; | |
| 12477 this.offset = offset; | |
| 12478 } | |
| 12479 | |
| 12480 factory Position.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object jso
n) { | |
| 12481 if (json == null) { | |
| 12482 json = {}; | |
| 12483 } | |
| 12484 if (json is Map) { | |
| 12485 String file; | |
| 12486 if (json.containsKey("file")) { | |
| 12487 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 12488 } else { | |
| 12489 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 12490 } | |
| 12491 int offset; | |
| 12492 if (json.containsKey("offset")) { | |
| 12493 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 12494 } else { | |
| 12495 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 12496 } | |
| 12497 return new Position(file, offset); | |
| 12498 } else { | |
| 12499 throw jsonDecoder.mismatch(jsonPath, "Position", json); | |
| 12500 } | |
| 12501 } | |
| 12502 | |
| 12503 Map<String, dynamic> toJson() { | |
| 12504 Map<String, dynamic> result = {}; | |
| 12505 result["file"] = file; | |
| 12506 result["offset"] = offset; | |
| 12507 return result; | |
| 12508 } | |
| 12509 | |
| 12510 @override | |
| 12511 String toString() => JSON.encode(toJson()); | |
| 12512 | |
| 12513 @override | |
| 12514 bool operator==(other) { | |
| 12515 if (other is Position) { | |
| 12516 return file == other.file && | |
| 12517 offset == other.offset; | |
| 12518 } | |
| 12519 return false; | |
| 12520 } | |
| 12521 | |
| 12522 @override | |
| 12523 int get hashCode { | |
| 12524 int hash = 0; | |
| 12525 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 12526 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 12527 return _JenkinsSmiHash.finish(hash); | |
| 12528 } | |
| 12529 } | |
| 12530 | |
| 12531 /** | |
| 12532 * PubStatus | |
| 12533 * | |
| 12534 * { | |
| 12535 * "isListingPackageDirs": bool | |
| 12536 * } | |
| 12537 */ | |
| 12538 class PubStatus implements HasToJson { | |
| 12539 bool _isListingPackageDirs; | |
| 12540 | |
| 12541 /** | |
| 12542 * True if the server is currently running pub to produce a list of package | |
| 12543 * directories. | |
| 12544 */ | |
| 12545 bool get isListingPackageDirs => _isListingPackageDirs; | |
| 12546 | |
| 12547 /** | |
| 12548 * True if the server is currently running pub to produce a list of package | |
| 12549 * directories. | |
| 12550 */ | |
| 12551 void set isListingPackageDirs(bool value) { | |
| 12552 assert(value != null); | |
| 12553 this._isListingPackageDirs = value; | |
| 12554 } | |
| 12555 | |
| 12556 PubStatus(bool isListingPackageDirs) { | |
| 12557 this.isListingPackageDirs = isListingPackageDirs; | |
| 12558 } | |
| 12559 | |
| 12560 factory PubStatus.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object js
on) { | |
| 12561 if (json == null) { | |
| 12562 json = {}; | |
| 12563 } | |
| 12564 if (json is Map) { | |
| 12565 bool isListingPackageDirs; | |
| 12566 if (json.containsKey("isListingPackageDirs")) { | |
| 12567 isListingPackageDirs = jsonDecoder._decodeBool(jsonPath + ".isListingPac
kageDirs", json["isListingPackageDirs"]); | |
| 12568 } else { | |
| 12569 throw jsonDecoder.missingKey(jsonPath, "isListingPackageDirs"); | |
| 12570 } | |
| 12571 return new PubStatus(isListingPackageDirs); | |
| 12572 } else { | |
| 12573 throw jsonDecoder.mismatch(jsonPath, "PubStatus", json); | |
| 12574 } | |
| 12575 } | |
| 12576 | |
| 12577 Map<String, dynamic> toJson() { | |
| 12578 Map<String, dynamic> result = {}; | |
| 12579 result["isListingPackageDirs"] = isListingPackageDirs; | |
| 12580 return result; | |
| 12581 } | |
| 12582 | |
| 12583 @override | |
| 12584 String toString() => JSON.encode(toJson()); | |
| 12585 | |
| 12586 @override | |
| 12587 bool operator==(other) { | |
| 12588 if (other is PubStatus) { | |
| 12589 return isListingPackageDirs == other.isListingPackageDirs; | |
| 12590 } | |
| 12591 return false; | |
| 12592 } | |
| 12593 | |
| 12594 @override | |
| 12595 int get hashCode { | |
| 12596 int hash = 0; | |
| 12597 hash = _JenkinsSmiHash.combine(hash, isListingPackageDirs.hashCode); | |
| 12598 return _JenkinsSmiHash.finish(hash); | |
| 12599 } | |
| 12600 } | |
| 12601 | |
| 12602 /** | |
| 12603 * RefactoringKind | |
| 12604 * | |
| 12605 * enum { | |
| 12606 * CONVERT_GETTER_TO_METHOD | |
| 12607 * CONVERT_METHOD_TO_GETTER | |
| 12608 * EXTRACT_LOCAL_VARIABLE | |
| 12609 * EXTRACT_METHOD | |
| 12610 * INLINE_LOCAL_VARIABLE | |
| 12611 * INLINE_METHOD | |
| 12612 * MOVE_FILE | |
| 12613 * RENAME | |
| 12614 * SORT_MEMBERS | |
| 12615 * } | |
| 12616 */ | |
| 12617 class RefactoringKind implements Enum { | |
| 12618 static const CONVERT_GETTER_TO_METHOD = const RefactoringKind._("CONVERT_GETTE
R_TO_METHOD"); | |
| 12619 | |
| 12620 static const CONVERT_METHOD_TO_GETTER = const RefactoringKind._("CONVERT_METHO
D_TO_GETTER"); | |
| 12621 | |
| 12622 static const EXTRACT_LOCAL_VARIABLE = const RefactoringKind._("EXTRACT_LOCAL_V
ARIABLE"); | |
| 12623 | |
| 12624 static const EXTRACT_METHOD = const RefactoringKind._("EXTRACT_METHOD"); | |
| 12625 | |
| 12626 static const INLINE_LOCAL_VARIABLE = const RefactoringKind._("INLINE_LOCAL_VAR
IABLE"); | |
| 12627 | |
| 12628 static const INLINE_METHOD = const RefactoringKind._("INLINE_METHOD"); | |
| 12629 | |
| 12630 static const MOVE_FILE = const RefactoringKind._("MOVE_FILE"); | |
| 12631 | |
| 12632 static const RENAME = const RefactoringKind._("RENAME"); | |
| 12633 | |
| 12634 static const SORT_MEMBERS = const RefactoringKind._("SORT_MEMBERS"); | |
| 12635 | |
| 12636 /** | |
| 12637 * A list containing all of the enum values that are defined. | |
| 12638 */ | |
| 12639 static const List<RefactoringKind> VALUES = const <RefactoringKind>[CONVERT_GE
TTER_TO_METHOD, CONVERT_METHOD_TO_GETTER, EXTRACT_LOCAL_VARIABLE, EXTRACT_METHOD
, INLINE_LOCAL_VARIABLE, INLINE_METHOD, MOVE_FILE, RENAME, SORT_MEMBERS]; | |
| 12640 | |
| 12641 final String name; | |
| 12642 | |
| 12643 const RefactoringKind._(this.name); | |
| 12644 | |
| 12645 factory RefactoringKind(String name) { | |
| 12646 switch (name) { | |
| 12647 case "CONVERT_GETTER_TO_METHOD": | |
| 12648 return CONVERT_GETTER_TO_METHOD; | |
| 12649 case "CONVERT_METHOD_TO_GETTER": | |
| 12650 return CONVERT_METHOD_TO_GETTER; | |
| 12651 case "EXTRACT_LOCAL_VARIABLE": | |
| 12652 return EXTRACT_LOCAL_VARIABLE; | |
| 12653 case "EXTRACT_METHOD": | |
| 12654 return EXTRACT_METHOD; | |
| 12655 case "INLINE_LOCAL_VARIABLE": | |
| 12656 return INLINE_LOCAL_VARIABLE; | |
| 12657 case "INLINE_METHOD": | |
| 12658 return INLINE_METHOD; | |
| 12659 case "MOVE_FILE": | |
| 12660 return MOVE_FILE; | |
| 12661 case "RENAME": | |
| 12662 return RENAME; | |
| 12663 case "SORT_MEMBERS": | |
| 12664 return SORT_MEMBERS; | |
| 12665 } | |
| 12666 throw new Exception('Illegal enum value: $name'); | |
| 12667 } | |
| 12668 | |
| 12669 factory RefactoringKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obj
ect json) { | |
| 12670 if (json is String) { | |
| 12671 try { | |
| 12672 return new RefactoringKind(json); | |
| 12673 } catch(_) { | |
| 12674 // Fall through | |
| 12675 } | |
| 12676 } | |
| 12677 throw jsonDecoder.mismatch(jsonPath, "RefactoringKind", json); | |
| 12678 } | |
| 12679 | |
| 12680 @override | |
| 12681 String toString() => "RefactoringKind.$name"; | |
| 12682 | |
| 12683 String toJson() => name; | |
| 12684 } | |
| 12685 | |
| 12686 /** | |
| 12687 * RefactoringMethodParameter | |
| 12688 * | |
| 12689 * { | |
| 12690 * "id": optional String | |
| 12691 * "kind": RefactoringMethodParameterKind | |
| 12692 * "type": String | |
| 12693 * "name": String | |
| 12694 * "parameters": optional String | |
| 12695 * } | |
| 12696 */ | |
| 12697 class RefactoringMethodParameter implements HasToJson { | |
| 12698 String _id; | |
| 12699 | |
| 12700 RefactoringMethodParameterKind _kind; | |
| 12701 | |
| 12702 String _type; | |
| 12703 | |
| 12704 String _name; | |
| 12705 | |
| 12706 String _parameters; | |
| 12707 | |
| 12708 /** | |
| 12709 * The unique identifier of the parameter. Clients may omit this field for | |
| 12710 * the parameters they want to add. | |
| 12711 */ | |
| 12712 String get id => _id; | |
| 12713 | |
| 12714 /** | |
| 12715 * The unique identifier of the parameter. Clients may omit this field for | |
| 12716 * the parameters they want to add. | |
| 12717 */ | |
| 12718 void set id(String value) { | |
| 12719 this._id = value; | |
| 12720 } | |
| 12721 | |
| 12722 /** | |
| 12723 * The kind of the parameter. | |
| 12724 */ | |
| 12725 RefactoringMethodParameterKind get kind => _kind; | |
| 12726 | |
| 12727 /** | |
| 12728 * The kind of the parameter. | |
| 12729 */ | |
| 12730 void set kind(RefactoringMethodParameterKind value) { | |
| 12731 assert(value != null); | |
| 12732 this._kind = value; | |
| 12733 } | |
| 12734 | |
| 12735 /** | |
| 12736 * The type that should be given to the parameter, or the return type of the | |
| 12737 * parameter's function type. | |
| 12738 */ | |
| 12739 String get type => _type; | |
| 12740 | |
| 12741 /** | |
| 12742 * The type that should be given to the parameter, or the return type of the | |
| 12743 * parameter's function type. | |
| 12744 */ | |
| 12745 void set type(String value) { | |
| 12746 assert(value != null); | |
| 12747 this._type = value; | |
| 12748 } | |
| 12749 | |
| 12750 /** | |
| 12751 * The name that should be given to the parameter. | |
| 12752 */ | |
| 12753 String get name => _name; | |
| 12754 | |
| 12755 /** | |
| 12756 * The name that should be given to the parameter. | |
| 12757 */ | |
| 12758 void set name(String value) { | |
| 12759 assert(value != null); | |
| 12760 this._name = value; | |
| 12761 } | |
| 12762 | |
| 12763 /** | |
| 12764 * The parameter list of the parameter's function type. If the parameter is | |
| 12765 * not of a function type, this field will not be defined. If the function | |
| 12766 * type has zero parameters, this field will have a value of "()". | |
| 12767 */ | |
| 12768 String get parameters => _parameters; | |
| 12769 | |
| 12770 /** | |
| 12771 * The parameter list of the parameter's function type. If the parameter is | |
| 12772 * not of a function type, this field will not be defined. If the function | |
| 12773 * type has zero parameters, this field will have a value of "()". | |
| 12774 */ | |
| 12775 void set parameters(String value) { | |
| 12776 this._parameters = value; | |
| 12777 } | |
| 12778 | |
| 12779 RefactoringMethodParameter(RefactoringMethodParameterKind kind, String type, S
tring name, {String id, String parameters}) { | |
| 12780 this.id = id; | |
| 12781 this.kind = kind; | |
| 12782 this.type = type; | |
| 12783 this.name = name; | |
| 12784 this.parameters = parameters; | |
| 12785 } | |
| 12786 | |
| 12787 factory RefactoringMethodParameter.fromJson(JsonDecoder jsonDecoder, String js
onPath, Object json) { | |
| 12788 if (json == null) { | |
| 12789 json = {}; | |
| 12790 } | |
| 12791 if (json is Map) { | |
| 12792 String id; | |
| 12793 if (json.containsKey("id")) { | |
| 12794 id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]); | |
| 12795 } | |
| 12796 RefactoringMethodParameterKind kind; | |
| 12797 if (json.containsKey("kind")) { | |
| 12798 kind = new RefactoringMethodParameterKind.fromJson(jsonDecoder, jsonPath
+ ".kind", json["kind"]); | |
| 12799 } else { | |
| 12800 throw jsonDecoder.missingKey(jsonPath, "kind"); | |
| 12801 } | |
| 12802 String type; | |
| 12803 if (json.containsKey("type")) { | |
| 12804 type = jsonDecoder._decodeString(jsonPath + ".type", json["type"]); | |
| 12805 } else { | |
| 12806 throw jsonDecoder.missingKey(jsonPath, "type"); | |
| 12807 } | |
| 12808 String name; | |
| 12809 if (json.containsKey("name")) { | |
| 12810 name = jsonDecoder._decodeString(jsonPath + ".name", json["name"]); | |
| 12811 } else { | |
| 12812 throw jsonDecoder.missingKey(jsonPath, "name"); | |
| 12813 } | |
| 12814 String parameters; | |
| 12815 if (json.containsKey("parameters")) { | |
| 12816 parameters = jsonDecoder._decodeString(jsonPath + ".parameters", json["p
arameters"]); | |
| 12817 } | |
| 12818 return new RefactoringMethodParameter(kind, type, name, id: id, parameters
: parameters); | |
| 12819 } else { | |
| 12820 throw jsonDecoder.mismatch(jsonPath, "RefactoringMethodParameter", json); | |
| 12821 } | |
| 12822 } | |
| 12823 | |
| 12824 Map<String, dynamic> toJson() { | |
| 12825 Map<String, dynamic> result = {}; | |
| 12826 if (id != null) { | |
| 12827 result["id"] = id; | |
| 12828 } | |
| 12829 result["kind"] = kind.toJson(); | |
| 12830 result["type"] = type; | |
| 12831 result["name"] = name; | |
| 12832 if (parameters != null) { | |
| 12833 result["parameters"] = parameters; | |
| 12834 } | |
| 12835 return result; | |
| 12836 } | |
| 12837 | |
| 12838 @override | |
| 12839 String toString() => JSON.encode(toJson()); | |
| 12840 | |
| 12841 @override | |
| 12842 bool operator==(other) { | |
| 12843 if (other is RefactoringMethodParameter) { | |
| 12844 return id == other.id && | |
| 12845 kind == other.kind && | |
| 12846 type == other.type && | |
| 12847 name == other.name && | |
| 12848 parameters == other.parameters; | |
| 12849 } | |
| 12850 return false; | |
| 12851 } | |
| 12852 | |
| 12853 @override | |
| 12854 int get hashCode { | |
| 12855 int hash = 0; | |
| 12856 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
| 12857 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); | |
| 12858 hash = _JenkinsSmiHash.combine(hash, type.hashCode); | |
| 12859 hash = _JenkinsSmiHash.combine(hash, name.hashCode); | |
| 12860 hash = _JenkinsSmiHash.combine(hash, parameters.hashCode); | |
| 12861 return _JenkinsSmiHash.finish(hash); | |
| 12862 } | |
| 12863 } | |
| 12864 | |
| 12865 /** | |
| 12866 * RefactoringFeedback | |
| 12867 * | |
| 12868 * { | |
| 12869 * } | |
| 12870 */ | |
| 12871 class RefactoringFeedback implements HasToJson { | |
| 12872 RefactoringFeedback(); | |
| 12873 | |
| 12874 factory RefactoringFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath,
Object json, Map responseJson) { | |
| 12875 return _refactoringFeedbackFromJson(jsonDecoder, jsonPath, json, responseJso
n); | |
| 12876 } | |
| 12877 | |
| 12878 Map<String, dynamic> toJson() { | |
| 12879 Map<String, dynamic> result = {}; | |
| 12880 return result; | |
| 12881 } | |
| 12882 | |
| 12883 @override | |
| 12884 String toString() => JSON.encode(toJson()); | |
| 12885 | |
| 12886 @override | |
| 12887 bool operator==(other) { | |
| 12888 if (other is RefactoringFeedback) { | |
| 12889 return true; | |
| 12890 } | |
| 12891 return false; | |
| 12892 } | |
| 12893 | |
| 12894 @override | |
| 12895 int get hashCode { | |
| 12896 int hash = 0; | |
| 12897 return _JenkinsSmiHash.finish(hash); | |
| 12898 } | |
| 12899 } | |
| 12900 | |
| 12901 /** | |
| 12902 * RefactoringOptions | |
| 12903 * | |
| 12904 * { | |
| 12905 * } | |
| 12906 */ | |
| 12907 class RefactoringOptions implements HasToJson { | |
| 12908 RefactoringOptions(); | |
| 12909 | |
| 12910 factory RefactoringOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath,
Object json, RefactoringKind kind) { | |
| 12911 return _refactoringOptionsFromJson(jsonDecoder, jsonPath, json, kind); | |
| 12912 } | |
| 12913 | |
| 12914 Map<String, dynamic> toJson() { | |
| 12915 Map<String, dynamic> result = {}; | |
| 12916 return result; | |
| 12917 } | |
| 12918 | |
| 12919 @override | |
| 12920 String toString() => JSON.encode(toJson()); | |
| 12921 | |
| 12922 @override | |
| 12923 bool operator==(other) { | |
| 12924 if (other is RefactoringOptions) { | |
| 12925 return true; | |
| 12926 } | |
| 12927 return false; | |
| 12928 } | |
| 12929 | |
| 12930 @override | |
| 12931 int get hashCode { | |
| 12932 int hash = 0; | |
| 12933 return _JenkinsSmiHash.finish(hash); | |
| 12934 } | |
| 12935 } | |
| 12936 | |
| 12937 /** | |
| 12938 * RefactoringMethodParameterKind | |
| 12939 * | |
| 12940 * enum { | |
| 12941 * REQUIRED | |
| 12942 * POSITIONAL | |
| 12943 * NAMED | |
| 12944 * } | |
| 12945 */ | |
| 12946 class RefactoringMethodParameterKind implements Enum { | |
| 12947 static const REQUIRED = const RefactoringMethodParameterKind._("REQUIRED"); | |
| 12948 | |
| 12949 static const POSITIONAL = const RefactoringMethodParameterKind._("POSITIONAL")
; | |
| 12950 | |
| 12951 static const NAMED = const RefactoringMethodParameterKind._("NAMED"); | |
| 12952 | |
| 12953 /** | |
| 12954 * A list containing all of the enum values that are defined. | |
| 12955 */ | |
| 12956 static const List<RefactoringMethodParameterKind> VALUES = const <RefactoringM
ethodParameterKind>[REQUIRED, POSITIONAL, NAMED]; | |
| 12957 | |
| 12958 final String name; | |
| 12959 | |
| 12960 const RefactoringMethodParameterKind._(this.name); | |
| 12961 | |
| 12962 factory RefactoringMethodParameterKind(String name) { | |
| 12963 switch (name) { | |
| 12964 case "REQUIRED": | |
| 12965 return REQUIRED; | |
| 12966 case "POSITIONAL": | |
| 12967 return POSITIONAL; | |
| 12968 case "NAMED": | |
| 12969 return NAMED; | |
| 12970 } | |
| 12971 throw new Exception('Illegal enum value: $name'); | |
| 12972 } | |
| 12973 | |
| 12974 factory RefactoringMethodParameterKind.fromJson(JsonDecoder jsonDecoder, Strin
g jsonPath, Object json) { | |
| 12975 if (json is String) { | |
| 12976 try { | |
| 12977 return new RefactoringMethodParameterKind(json); | |
| 12978 } catch(_) { | |
| 12979 // Fall through | |
| 12980 } | |
| 12981 } | |
| 12982 throw jsonDecoder.mismatch(jsonPath, "RefactoringMethodParameterKind", json)
; | |
| 12983 } | |
| 12984 | |
| 12985 @override | |
| 12986 String toString() => "RefactoringMethodParameterKind.$name"; | |
| 12987 | |
| 12988 String toJson() => name; | |
| 12989 } | |
| 12990 | |
| 12991 /** | |
| 12992 * RefactoringProblem | |
| 12993 * | |
| 12994 * { | |
| 12995 * "severity": RefactoringProblemSeverity | |
| 12996 * "message": String | |
| 12997 * "location": optional Location | |
| 12998 * } | |
| 12999 */ | |
| 13000 class RefactoringProblem implements HasToJson { | |
| 13001 RefactoringProblemSeverity _severity; | |
| 13002 | |
| 13003 String _message; | |
| 13004 | |
| 13005 Location _location; | |
| 13006 | |
| 13007 /** | |
| 13008 * The severity of the problem being represented. | |
| 13009 */ | |
| 13010 RefactoringProblemSeverity get severity => _severity; | |
| 13011 | |
| 13012 /** | |
| 13013 * The severity of the problem being represented. | |
| 13014 */ | |
| 13015 void set severity(RefactoringProblemSeverity value) { | |
| 13016 assert(value != null); | |
| 13017 this._severity = value; | |
| 13018 } | |
| 13019 | |
| 13020 /** | |
| 13021 * A human-readable description of the problem being represented. | |
| 13022 */ | |
| 13023 String get message => _message; | |
| 13024 | |
| 13025 /** | |
| 13026 * A human-readable description of the problem being represented. | |
| 13027 */ | |
| 13028 void set message(String value) { | |
| 13029 assert(value != null); | |
| 13030 this._message = value; | |
| 13031 } | |
| 13032 | |
| 13033 /** | |
| 13034 * The location of the problem being represented. This field is omitted | |
| 13035 * unless there is a specific location associated with the problem (such as a | |
| 13036 * location where an element being renamed will be shadowed). | |
| 13037 */ | |
| 13038 Location get location => _location; | |
| 13039 | |
| 13040 /** | |
| 13041 * The location of the problem being represented. This field is omitted | |
| 13042 * unless there is a specific location associated with the problem (such as a | |
| 13043 * location where an element being renamed will be shadowed). | |
| 13044 */ | |
| 13045 void set location(Location value) { | |
| 13046 this._location = value; | |
| 13047 } | |
| 13048 | |
| 13049 RefactoringProblem(RefactoringProblemSeverity severity, String message, {Locat
ion location}) { | |
| 13050 this.severity = severity; | |
| 13051 this.message = message; | |
| 13052 this.location = location; | |
| 13053 } | |
| 13054 | |
| 13055 factory RefactoringProblem.fromJson(JsonDecoder jsonDecoder, String jsonPath,
Object json) { | |
| 13056 if (json == null) { | |
| 13057 json = {}; | |
| 13058 } | |
| 13059 if (json is Map) { | |
| 13060 RefactoringProblemSeverity severity; | |
| 13061 if (json.containsKey("severity")) { | |
| 13062 severity = new RefactoringProblemSeverity.fromJson(jsonDecoder, jsonPath
+ ".severity", json["severity"]); | |
| 13063 } else { | |
| 13064 throw jsonDecoder.missingKey(jsonPath, "severity"); | |
| 13065 } | |
| 13066 String message; | |
| 13067 if (json.containsKey("message")) { | |
| 13068 message = jsonDecoder._decodeString(jsonPath + ".message", json["message
"]); | |
| 13069 } else { | |
| 13070 throw jsonDecoder.missingKey(jsonPath, "message"); | |
| 13071 } | |
| 13072 Location location; | |
| 13073 if (json.containsKey("location")) { | |
| 13074 location = new Location.fromJson(jsonDecoder, jsonPath + ".location", js
on["location"]); | |
| 13075 } | |
| 13076 return new RefactoringProblem(severity, message, location: location); | |
| 13077 } else { | |
| 13078 throw jsonDecoder.mismatch(jsonPath, "RefactoringProblem", json); | |
| 13079 } | |
| 13080 } | |
| 13081 | |
| 13082 Map<String, dynamic> toJson() { | |
| 13083 Map<String, dynamic> result = {}; | |
| 13084 result["severity"] = severity.toJson(); | |
| 13085 result["message"] = message; | |
| 13086 if (location != null) { | |
| 13087 result["location"] = location.toJson(); | |
| 13088 } | |
| 13089 return result; | |
| 13090 } | |
| 13091 | |
| 13092 @override | |
| 13093 String toString() => JSON.encode(toJson()); | |
| 13094 | |
| 13095 @override | |
| 13096 bool operator==(other) { | |
| 13097 if (other is RefactoringProblem) { | |
| 13098 return severity == other.severity && | |
| 13099 message == other.message && | |
| 13100 location == other.location; | |
| 13101 } | |
| 13102 return false; | |
| 13103 } | |
| 13104 | |
| 13105 @override | |
| 13106 int get hashCode { | |
| 13107 int hash = 0; | |
| 13108 hash = _JenkinsSmiHash.combine(hash, severity.hashCode); | |
| 13109 hash = _JenkinsSmiHash.combine(hash, message.hashCode); | |
| 13110 hash = _JenkinsSmiHash.combine(hash, location.hashCode); | |
| 13111 return _JenkinsSmiHash.finish(hash); | |
| 13112 } | |
| 13113 } | |
| 13114 | |
| 13115 /** | |
| 13116 * RefactoringProblemSeverity | |
| 13117 * | |
| 13118 * enum { | |
| 13119 * INFO | |
| 13120 * WARNING | |
| 13121 * ERROR | |
| 13122 * FATAL | |
| 13123 * } | |
| 13124 */ | |
| 13125 class RefactoringProblemSeverity implements Enum { | |
| 13126 static const INFO = const RefactoringProblemSeverity._("INFO"); | |
| 13127 | |
| 13128 static const WARNING = const RefactoringProblemSeverity._("WARNING"); | |
| 13129 | |
| 13130 static const ERROR = const RefactoringProblemSeverity._("ERROR"); | |
| 13131 | |
| 13132 static const FATAL = const RefactoringProblemSeverity._("FATAL"); | |
| 13133 | |
| 13134 /** | |
| 13135 * A list containing all of the enum values that are defined. | |
| 13136 */ | |
| 13137 static const List<RefactoringProblemSeverity> VALUES = const <RefactoringProbl
emSeverity>[INFO, WARNING, ERROR, FATAL]; | |
| 13138 | |
| 13139 final String name; | |
| 13140 | |
| 13141 const RefactoringProblemSeverity._(this.name); | |
| 13142 | |
| 13143 factory RefactoringProblemSeverity(String name) { | |
| 13144 switch (name) { | |
| 13145 case "INFO": | |
| 13146 return INFO; | |
| 13147 case "WARNING": | |
| 13148 return WARNING; | |
| 13149 case "ERROR": | |
| 13150 return ERROR; | |
| 13151 case "FATAL": | |
| 13152 return FATAL; | |
| 13153 } | |
| 13154 throw new Exception('Illegal enum value: $name'); | |
| 13155 } | |
| 13156 | |
| 13157 factory RefactoringProblemSeverity.fromJson(JsonDecoder jsonDecoder, String js
onPath, Object json) { | |
| 13158 if (json is String) { | |
| 13159 try { | |
| 13160 return new RefactoringProblemSeverity(json); | |
| 13161 } catch(_) { | |
| 13162 // Fall through | |
| 13163 } | |
| 13164 } | |
| 13165 throw jsonDecoder.mismatch(jsonPath, "RefactoringProblemSeverity", json); | |
| 13166 } | |
| 13167 | |
| 13168 /** | |
| 13169 * Returns the [RefactoringProblemSeverity] with the maximal severity. | |
| 13170 */ | |
| 13171 static RefactoringProblemSeverity max(RefactoringProblemSeverity a, Refactorin
gProblemSeverity b) => | |
| 13172 _maxRefactoringProblemSeverity(a, b); | |
| 13173 | |
| 13174 @override | |
| 13175 String toString() => "RefactoringProblemSeverity.$name"; | |
| 13176 | |
| 13177 String toJson() => name; | |
| 13178 } | |
| 13179 | |
| 13180 /** | |
| 13181 * RemoveContentOverlay | |
| 13182 * | |
| 13183 * { | |
| 13184 * "type": "remove" | |
| 13185 * } | |
| 13186 */ | |
| 13187 class RemoveContentOverlay implements HasToJson { | |
| 13188 RemoveContentOverlay(); | |
| 13189 | |
| 13190 factory RemoveContentOverlay.fromJson(JsonDecoder jsonDecoder, String jsonPath
, Object json) { | |
| 13191 if (json == null) { | |
| 13192 json = {}; | |
| 13193 } | |
| 13194 if (json is Map) { | |
| 13195 if (json["type"] != "remove") { | |
| 13196 throw jsonDecoder.mismatch(jsonPath, "equal " + "remove", json); | |
| 13197 } | |
| 13198 return new RemoveContentOverlay(); | |
| 13199 } else { | |
| 13200 throw jsonDecoder.mismatch(jsonPath, "RemoveContentOverlay", json); | |
| 13201 } | |
| 13202 } | |
| 13203 | |
| 13204 Map<String, dynamic> toJson() { | |
| 13205 Map<String, dynamic> result = {}; | |
| 13206 result["type"] = "remove"; | |
| 13207 return result; | |
| 13208 } | |
| 13209 | |
| 13210 @override | |
| 13211 String toString() => JSON.encode(toJson()); | |
| 13212 | |
| 13213 @override | |
| 13214 bool operator==(other) { | |
| 13215 if (other is RemoveContentOverlay) { | |
| 13216 return true; | |
| 13217 } | |
| 13218 return false; | |
| 13219 } | |
| 13220 | |
| 13221 @override | |
| 13222 int get hashCode { | |
| 13223 int hash = 0; | |
| 13224 hash = _JenkinsSmiHash.combine(hash, 114870849); | |
| 13225 return _JenkinsSmiHash.finish(hash); | |
| 13226 } | |
| 13227 } | |
| 13228 | |
| 13229 /** | |
| 13230 * RequestError | |
| 13231 * | |
| 13232 * { | |
| 13233 * "code": RequestErrorCode | |
| 13234 * "message": String | |
| 13235 * "stackTrace": optional String | |
| 13236 * } | |
| 13237 */ | |
| 13238 class RequestError implements HasToJson { | |
| 13239 RequestErrorCode _code; | |
| 13240 | |
| 13241 String _message; | |
| 13242 | |
| 13243 String _stackTrace; | |
| 13244 | |
| 13245 /** | |
| 13246 * A code that uniquely identifies the error that occurred. | |
| 13247 */ | |
| 13248 RequestErrorCode get code => _code; | |
| 13249 | |
| 13250 /** | |
| 13251 * A code that uniquely identifies the error that occurred. | |
| 13252 */ | |
| 13253 void set code(RequestErrorCode value) { | |
| 13254 assert(value != null); | |
| 13255 this._code = value; | |
| 13256 } | |
| 13257 | |
| 13258 /** | |
| 13259 * A short description of the error. | |
| 13260 */ | |
| 13261 String get message => _message; | |
| 13262 | |
| 13263 /** | |
| 13264 * A short description of the error. | |
| 13265 */ | |
| 13266 void set message(String value) { | |
| 13267 assert(value != null); | |
| 13268 this._message = value; | |
| 13269 } | |
| 13270 | |
| 13271 /** | |
| 13272 * The stack trace associated with processing the request, used for debugging | |
| 13273 * the server. | |
| 13274 */ | |
| 13275 String get stackTrace => _stackTrace; | |
| 13276 | |
| 13277 /** | |
| 13278 * The stack trace associated with processing the request, used for debugging | |
| 13279 * the server. | |
| 13280 */ | |
| 13281 void set stackTrace(String value) { | |
| 13282 this._stackTrace = value; | |
| 13283 } | |
| 13284 | |
| 13285 RequestError(RequestErrorCode code, String message, {String stackTrace}) { | |
| 13286 this.code = code; | |
| 13287 this.message = message; | |
| 13288 this.stackTrace = stackTrace; | |
| 13289 } | |
| 13290 | |
| 13291 factory RequestError.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object
json) { | |
| 13292 if (json == null) { | |
| 13293 json = {}; | |
| 13294 } | |
| 13295 if (json is Map) { | |
| 13296 RequestErrorCode code; | |
| 13297 if (json.containsKey("code")) { | |
| 13298 code = new RequestErrorCode.fromJson(jsonDecoder, jsonPath + ".code", js
on["code"]); | |
| 13299 } else { | |
| 13300 throw jsonDecoder.missingKey(jsonPath, "code"); | |
| 13301 } | |
| 13302 String message; | |
| 13303 if (json.containsKey("message")) { | |
| 13304 message = jsonDecoder._decodeString(jsonPath + ".message", json["message
"]); | |
| 13305 } else { | |
| 13306 throw jsonDecoder.missingKey(jsonPath, "message"); | |
| 13307 } | |
| 13308 String stackTrace; | |
| 13309 if (json.containsKey("stackTrace")) { | |
| 13310 stackTrace = jsonDecoder._decodeString(jsonPath + ".stackTrace", json["s
tackTrace"]); | |
| 13311 } | |
| 13312 return new RequestError(code, message, stackTrace: stackTrace); | |
| 13313 } else { | |
| 13314 throw jsonDecoder.mismatch(jsonPath, "RequestError", json); | |
| 13315 } | |
| 13316 } | |
| 13317 | |
| 13318 Map<String, dynamic> toJson() { | |
| 13319 Map<String, dynamic> result = {}; | |
| 13320 result["code"] = code.toJson(); | |
| 13321 result["message"] = message; | |
| 13322 if (stackTrace != null) { | |
| 13323 result["stackTrace"] = stackTrace; | |
| 13324 } | |
| 13325 return result; | |
| 13326 } | |
| 13327 | |
| 13328 @override | |
| 13329 String toString() => JSON.encode(toJson()); | |
| 13330 | |
| 13331 @override | |
| 13332 bool operator==(other) { | |
| 13333 if (other is RequestError) { | |
| 13334 return code == other.code && | |
| 13335 message == other.message && | |
| 13336 stackTrace == other.stackTrace; | |
| 13337 } | |
| 13338 return false; | |
| 13339 } | |
| 13340 | |
| 13341 @override | |
| 13342 int get hashCode { | |
| 13343 int hash = 0; | |
| 13344 hash = _JenkinsSmiHash.combine(hash, code.hashCode); | |
| 13345 hash = _JenkinsSmiHash.combine(hash, message.hashCode); | |
| 13346 hash = _JenkinsSmiHash.combine(hash, stackTrace.hashCode); | |
| 13347 return _JenkinsSmiHash.finish(hash); | |
| 13348 } | |
| 13349 } | |
| 13350 | |
| 13351 /** | |
| 13352 * RequestErrorCode | |
| 13353 * | |
| 13354 * enum { | |
| 13355 * CONTENT_MODIFIED | |
| 13356 * FILE_NOT_ANALYZED | |
| 13357 * FORMAT_INVALID_FILE | |
| 13358 * FORMAT_WITH_ERRORS | |
| 13359 * GET_ERRORS_INVALID_FILE | |
| 13360 * GET_NAVIGATION_INVALID_FILE | |
| 13361 * INVALID_ANALYSIS_ROOT | |
| 13362 * INVALID_EXECUTION_CONTEXT | |
| 13363 * INVALID_OVERLAY_CHANGE | |
| 13364 * INVALID_PARAMETER | |
| 13365 * INVALID_REQUEST | |
| 13366 * NO_INDEX_GENERATED | |
| 13367 * ORGANIZE_DIRECTIVES_ERROR | |
| 13368 * REFACTORING_REQUEST_CANCELLED | |
| 13369 * SERVER_ALREADY_STARTED | |
| 13370 * SERVER_ERROR | |
| 13371 * SORT_MEMBERS_INVALID_FILE | |
| 13372 * SORT_MEMBERS_PARSE_ERRORS | |
| 13373 * UNANALYZED_PRIORITY_FILES | |
| 13374 * UNKNOWN_REQUEST | |
| 13375 * UNKNOWN_SOURCE | |
| 13376 * UNSUPPORTED_FEATURE | |
| 13377 * } | |
| 13378 */ | |
| 13379 class RequestErrorCode implements Enum { | |
| 13380 /** | |
| 13381 * An "analysis.getErrors" or "analysis.getNavigation" request could not be | |
| 13382 * satisfied because the content of the file changed before the requested | |
| 13383 * results could be computed. | |
| 13384 */ | |
| 13385 static const CONTENT_MODIFIED = const RequestErrorCode._("CONTENT_MODIFIED"); | |
| 13386 | |
| 13387 /** | |
| 13388 * A request specified a FilePath which does not match a file in an analysis | |
| 13389 * root, or the requested operation is not available for the file. | |
| 13390 */ | |
| 13391 static const FILE_NOT_ANALYZED = const RequestErrorCode._("FILE_NOT_ANALYZED")
; | |
| 13392 | |
| 13393 /** | |
| 13394 * An "edit.format" request specified a FilePath which does not match a Dart | |
| 13395 * file in an analysis root. | |
| 13396 */ | |
| 13397 static const FORMAT_INVALID_FILE = const RequestErrorCode._("FORMAT_INVALID_FI
LE"); | |
| 13398 | |
| 13399 /** | |
| 13400 * An "edit.format" request specified a file that contains syntax errors. | |
| 13401 */ | |
| 13402 static const FORMAT_WITH_ERRORS = const RequestErrorCode._("FORMAT_WITH_ERRORS
"); | |
| 13403 | |
| 13404 /** | |
| 13405 * An "analysis.getErrors" request specified a FilePath which does not match | |
| 13406 * a file currently subject to analysis. | |
| 13407 */ | |
| 13408 static const GET_ERRORS_INVALID_FILE = const RequestErrorCode._("GET_ERRORS_IN
VALID_FILE"); | |
| 13409 | |
| 13410 /** | |
| 13411 * An "analysis.getNavigation" request specified a FilePath which does not | |
| 13412 * match a file currently subject to analysis. | |
| 13413 */ | |
| 13414 static const GET_NAVIGATION_INVALID_FILE = const RequestErrorCode._("GET_NAVIG
ATION_INVALID_FILE"); | |
| 13415 | |
| 13416 /** | |
| 13417 * A path passed as an argument to a request (such as analysis.reanalyze) is | |
| 13418 * required to be an analysis root, but isn't. | |
| 13419 */ | |
| 13420 static const INVALID_ANALYSIS_ROOT = const RequestErrorCode._("INVALID_ANALYSI
S_ROOT"); | |
| 13421 | |
| 13422 /** | |
| 13423 * The context root used to create an execution context does not exist. | |
| 13424 */ | |
| 13425 static const INVALID_EXECUTION_CONTEXT = const RequestErrorCode._("INVALID_EXE
CUTION_CONTEXT"); | |
| 13426 | |
| 13427 /** | |
| 13428 * An "analysis.updateContent" request contained a ChangeContentOverlay | |
| 13429 * object which can't be applied, due to an edit having an offset or length | |
| 13430 * that is out of range. | |
| 13431 */ | |
| 13432 static const INVALID_OVERLAY_CHANGE = const RequestErrorCode._("INVALID_OVERLA
Y_CHANGE"); | |
| 13433 | |
| 13434 /** | |
| 13435 * One of the method parameters was invalid. | |
| 13436 */ | |
| 13437 static const INVALID_PARAMETER = const RequestErrorCode._("INVALID_PARAMETER")
; | |
| 13438 | |
| 13439 /** | |
| 13440 * A malformed request was received. | |
| 13441 */ | |
| 13442 static const INVALID_REQUEST = const RequestErrorCode._("INVALID_REQUEST"); | |
| 13443 | |
| 13444 /** | |
| 13445 * The "--no-index" flag was passed when the analysis server created, but | |
| 13446 * this API call requires an index to have been generated. | |
| 13447 */ | |
| 13448 static const NO_INDEX_GENERATED = const RequestErrorCode._("NO_INDEX_GENERATED
"); | |
| 13449 | |
| 13450 /** | |
| 13451 * An "edit.organizeDirectives" request specified a Dart file that cannot be | |
| 13452 * analyzed. The reason is described in the message. | |
| 13453 */ | |
| 13454 static const ORGANIZE_DIRECTIVES_ERROR = const RequestErrorCode._("ORGANIZE_DI
RECTIVES_ERROR"); | |
| 13455 | |
| 13456 /** | |
| 13457 * Another refactoring request was received during processing of this one. | |
| 13458 */ | |
| 13459 static const REFACTORING_REQUEST_CANCELLED = const RequestErrorCode._("REFACTO
RING_REQUEST_CANCELLED"); | |
| 13460 | |
| 13461 /** | |
| 13462 * The analysis server has already been started (and hence won't accept new | |
| 13463 * connections). | |
| 13464 * | |
| 13465 * This error is included for future expansion; at present the analysis | |
| 13466 * server can only speak to one client at a time so this error will never | |
| 13467 * occur. | |
| 13468 */ | |
| 13469 static const SERVER_ALREADY_STARTED = const RequestErrorCode._("SERVER_ALREADY
_STARTED"); | |
| 13470 | |
| 13471 /** | |
| 13472 * An internal error occurred in the analysis server. Also see the | |
| 13473 * server.error notification. | |
| 13474 */ | |
| 13475 static const SERVER_ERROR = const RequestErrorCode._("SERVER_ERROR"); | |
| 13476 | |
| 13477 /** | |
| 13478 * An "edit.sortMembers" request specified a FilePath which does not match a | |
| 13479 * Dart file in an analysis root. | |
| 13480 */ | |
| 13481 static const SORT_MEMBERS_INVALID_FILE = const RequestErrorCode._("SORT_MEMBER
S_INVALID_FILE"); | |
| 13482 | |
| 13483 /** | |
| 13484 * An "edit.sortMembers" request specified a Dart file that has scan or parse | |
| 13485 * errors. | |
| 13486 */ | |
| 13487 static const SORT_MEMBERS_PARSE_ERRORS = const RequestErrorCode._("SORT_MEMBER
S_PARSE_ERRORS"); | |
| 13488 | |
| 13489 /** | |
| 13490 * An "analysis.setPriorityFiles" request includes one or more files that are | |
| 13491 * not being analyzed. | |
| 13492 * | |
| 13493 * This is a legacy error; it will be removed before the API reaches version | |
| 13494 * 1.0. | |
| 13495 */ | |
| 13496 static const UNANALYZED_PRIORITY_FILES = const RequestErrorCode._("UNANALYZED_
PRIORITY_FILES"); | |
| 13497 | |
| 13498 /** | |
| 13499 * A request was received which the analysis server does not recognize, or | |
| 13500 * cannot handle in its current configuation. | |
| 13501 */ | |
| 13502 static const UNKNOWN_REQUEST = const RequestErrorCode._("UNKNOWN_REQUEST"); | |
| 13503 | |
| 13504 /** | |
| 13505 * The analysis server was requested to perform an action on a source that | |
| 13506 * does not exist. | |
| 13507 */ | |
| 13508 static const UNKNOWN_SOURCE = const RequestErrorCode._("UNKNOWN_SOURCE"); | |
| 13509 | |
| 13510 /** | |
| 13511 * The analysis server was requested to perform an action which is not | |
| 13512 * supported. | |
| 13513 * | |
| 13514 * This is a legacy error; it will be removed before the API reaches version | |
| 13515 * 1.0. | |
| 13516 */ | |
| 13517 static const UNSUPPORTED_FEATURE = const RequestErrorCode._("UNSUPPORTED_FEATU
RE"); | |
| 13518 | |
| 13519 /** | |
| 13520 * A list containing all of the enum values that are defined. | |
| 13521 */ | |
| 13522 static const List<RequestErrorCode> VALUES = const <RequestErrorCode>[CONTENT_
MODIFIED, FILE_NOT_ANALYZED, FORMAT_INVALID_FILE, FORMAT_WITH_ERRORS, GET_ERRORS
_INVALID_FILE, GET_NAVIGATION_INVALID_FILE, INVALID_ANALYSIS_ROOT, INVALID_EXECU
TION_CONTEXT, INVALID_OVERLAY_CHANGE, INVALID_PARAMETER, INVALID_REQUEST, NO_IND
EX_GENERATED, ORGANIZE_DIRECTIVES_ERROR, REFACTORING_REQUEST_CANCELLED, SERVER_A
LREADY_STARTED, SERVER_ERROR, SORT_MEMBERS_INVALID_FILE, SORT_MEMBERS_PARSE_ERRO
RS, UNANALYZED_PRIORITY_FILES, UNKNOWN_REQUEST, UNKNOWN_SOURCE, UNSUPPORTED_FEAT
URE]; | |
| 13523 | |
| 13524 final String name; | |
| 13525 | |
| 13526 const RequestErrorCode._(this.name); | |
| 13527 | |
| 13528 factory RequestErrorCode(String name) { | |
| 13529 switch (name) { | |
| 13530 case "CONTENT_MODIFIED": | |
| 13531 return CONTENT_MODIFIED; | |
| 13532 case "FILE_NOT_ANALYZED": | |
| 13533 return FILE_NOT_ANALYZED; | |
| 13534 case "FORMAT_INVALID_FILE": | |
| 13535 return FORMAT_INVALID_FILE; | |
| 13536 case "FORMAT_WITH_ERRORS": | |
| 13537 return FORMAT_WITH_ERRORS; | |
| 13538 case "GET_ERRORS_INVALID_FILE": | |
| 13539 return GET_ERRORS_INVALID_FILE; | |
| 13540 case "GET_NAVIGATION_INVALID_FILE": | |
| 13541 return GET_NAVIGATION_INVALID_FILE; | |
| 13542 case "INVALID_ANALYSIS_ROOT": | |
| 13543 return INVALID_ANALYSIS_ROOT; | |
| 13544 case "INVALID_EXECUTION_CONTEXT": | |
| 13545 return INVALID_EXECUTION_CONTEXT; | |
| 13546 case "INVALID_OVERLAY_CHANGE": | |
| 13547 return INVALID_OVERLAY_CHANGE; | |
| 13548 case "INVALID_PARAMETER": | |
| 13549 return INVALID_PARAMETER; | |
| 13550 case "INVALID_REQUEST": | |
| 13551 return INVALID_REQUEST; | |
| 13552 case "NO_INDEX_GENERATED": | |
| 13553 return NO_INDEX_GENERATED; | |
| 13554 case "ORGANIZE_DIRECTIVES_ERROR": | |
| 13555 return ORGANIZE_DIRECTIVES_ERROR; | |
| 13556 case "REFACTORING_REQUEST_CANCELLED": | |
| 13557 return REFACTORING_REQUEST_CANCELLED; | |
| 13558 case "SERVER_ALREADY_STARTED": | |
| 13559 return SERVER_ALREADY_STARTED; | |
| 13560 case "SERVER_ERROR": | |
| 13561 return SERVER_ERROR; | |
| 13562 case "SORT_MEMBERS_INVALID_FILE": | |
| 13563 return SORT_MEMBERS_INVALID_FILE; | |
| 13564 case "SORT_MEMBERS_PARSE_ERRORS": | |
| 13565 return SORT_MEMBERS_PARSE_ERRORS; | |
| 13566 case "UNANALYZED_PRIORITY_FILES": | |
| 13567 return UNANALYZED_PRIORITY_FILES; | |
| 13568 case "UNKNOWN_REQUEST": | |
| 13569 return UNKNOWN_REQUEST; | |
| 13570 case "UNKNOWN_SOURCE": | |
| 13571 return UNKNOWN_SOURCE; | |
| 13572 case "UNSUPPORTED_FEATURE": | |
| 13573 return UNSUPPORTED_FEATURE; | |
| 13574 } | |
| 13575 throw new Exception('Illegal enum value: $name'); | |
| 13576 } | |
| 13577 | |
| 13578 factory RequestErrorCode.fromJson(JsonDecoder jsonDecoder, String jsonPath, Ob
ject json) { | |
| 13579 if (json is String) { | |
| 13580 try { | |
| 13581 return new RequestErrorCode(json); | |
| 13582 } catch(_) { | |
| 13583 // Fall through | |
| 13584 } | |
| 13585 } | |
| 13586 throw jsonDecoder.mismatch(jsonPath, "RequestErrorCode", json); | |
| 13587 } | |
| 13588 | |
| 13589 @override | |
| 13590 String toString() => "RequestErrorCode.$name"; | |
| 13591 | |
| 13592 String toJson() => name; | |
| 13593 } | |
| 13594 | |
| 13595 /** | |
| 13596 * SearchResult | |
| 13597 * | |
| 13598 * { | |
| 13599 * "location": Location | |
| 13600 * "kind": SearchResultKind | |
| 13601 * "isPotential": bool | |
| 13602 * "path": List<Element> | |
| 13603 * } | |
| 13604 */ | |
| 13605 class SearchResult implements HasToJson { | |
| 13606 Location _location; | |
| 13607 | |
| 13608 SearchResultKind _kind; | |
| 13609 | |
| 13610 bool _isPotential; | |
| 13611 | |
| 13612 List<Element> _path; | |
| 13613 | |
| 13614 /** | |
| 13615 * The location of the code that matched the search criteria. | |
| 13616 */ | |
| 13617 Location get location => _location; | |
| 13618 | |
| 13619 /** | |
| 13620 * The location of the code that matched the search criteria. | |
| 13621 */ | |
| 13622 void set location(Location value) { | |
| 13623 assert(value != null); | |
| 13624 this._location = value; | |
| 13625 } | |
| 13626 | |
| 13627 /** | |
| 13628 * The kind of element that was found or the kind of reference that was | |
| 13629 * found. | |
| 13630 */ | |
| 13631 SearchResultKind get kind => _kind; | |
| 13632 | |
| 13633 /** | |
| 13634 * The kind of element that was found or the kind of reference that was | |
| 13635 * found. | |
| 13636 */ | |
| 13637 void set kind(SearchResultKind value) { | |
| 13638 assert(value != null); | |
| 13639 this._kind = value; | |
| 13640 } | |
| 13641 | |
| 13642 /** | |
| 13643 * True if the result is a potential match but cannot be confirmed to be a | |
| 13644 * match. For example, if all references to a method m defined in some class | |
| 13645 * were requested, and a reference to a method m from an unknown class were | |
| 13646 * found, it would be marked as being a potential match. | |
| 13647 */ | |
| 13648 bool get isPotential => _isPotential; | |
| 13649 | |
| 13650 /** | |
| 13651 * True if the result is a potential match but cannot be confirmed to be a | |
| 13652 * match. For example, if all references to a method m defined in some class | |
| 13653 * were requested, and a reference to a method m from an unknown class were | |
| 13654 * found, it would be marked as being a potential match. | |
| 13655 */ | |
| 13656 void set isPotential(bool value) { | |
| 13657 assert(value != null); | |
| 13658 this._isPotential = value; | |
| 13659 } | |
| 13660 | |
| 13661 /** | |
| 13662 * The elements that contain the result, starting with the most immediately | |
| 13663 * enclosing ancestor and ending with the library. | |
| 13664 */ | |
| 13665 List<Element> get path => _path; | |
| 13666 | |
| 13667 /** | |
| 13668 * The elements that contain the result, starting with the most immediately | |
| 13669 * enclosing ancestor and ending with the library. | |
| 13670 */ | |
| 13671 void set path(List<Element> value) { | |
| 13672 assert(value != null); | |
| 13673 this._path = value; | |
| 13674 } | |
| 13675 | |
| 13676 SearchResult(Location location, SearchResultKind kind, bool isPotential, List<
Element> path) { | |
| 13677 this.location = location; | |
| 13678 this.kind = kind; | |
| 13679 this.isPotential = isPotential; | |
| 13680 this.path = path; | |
| 13681 } | |
| 13682 | |
| 13683 factory SearchResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object
json) { | |
| 13684 if (json == null) { | |
| 13685 json = {}; | |
| 13686 } | |
| 13687 if (json is Map) { | |
| 13688 Location location; | |
| 13689 if (json.containsKey("location")) { | |
| 13690 location = new Location.fromJson(jsonDecoder, jsonPath + ".location", js
on["location"]); | |
| 13691 } else { | |
| 13692 throw jsonDecoder.missingKey(jsonPath, "location"); | |
| 13693 } | |
| 13694 SearchResultKind kind; | |
| 13695 if (json.containsKey("kind")) { | |
| 13696 kind = new SearchResultKind.fromJson(jsonDecoder, jsonPath + ".kind", js
on["kind"]); | |
| 13697 } else { | |
| 13698 throw jsonDecoder.missingKey(jsonPath, "kind"); | |
| 13699 } | |
| 13700 bool isPotential; | |
| 13701 if (json.containsKey("isPotential")) { | |
| 13702 isPotential = jsonDecoder._decodeBool(jsonPath + ".isPotential", json["i
sPotential"]); | |
| 13703 } else { | |
| 13704 throw jsonDecoder.missingKey(jsonPath, "isPotential"); | |
| 13705 } | |
| 13706 List<Element> path; | |
| 13707 if (json.containsKey("path")) { | |
| 13708 path = jsonDecoder._decodeList(jsonPath + ".path", json["path"], (String
jsonPath, Object json) => new Element.fromJson(jsonDecoder, jsonPath, json)); | |
| 13709 } else { | |
| 13710 throw jsonDecoder.missingKey(jsonPath, "path"); | |
| 13711 } | |
| 13712 return new SearchResult(location, kind, isPotential, path); | |
| 13713 } else { | |
| 13714 throw jsonDecoder.mismatch(jsonPath, "SearchResult", json); | |
| 13715 } | |
| 13716 } | |
| 13717 | |
| 13718 Map<String, dynamic> toJson() { | |
| 13719 Map<String, dynamic> result = {}; | |
| 13720 result["location"] = location.toJson(); | |
| 13721 result["kind"] = kind.toJson(); | |
| 13722 result["isPotential"] = isPotential; | |
| 13723 result["path"] = path.map((Element value) => value.toJson()).toList(); | |
| 13724 return result; | |
| 13725 } | |
| 13726 | |
| 13727 @override | |
| 13728 String toString() => JSON.encode(toJson()); | |
| 13729 | |
| 13730 @override | |
| 13731 bool operator==(other) { | |
| 13732 if (other is SearchResult) { | |
| 13733 return location == other.location && | |
| 13734 kind == other.kind && | |
| 13735 isPotential == other.isPotential && | |
| 13736 _listEqual(path, other.path, (Element a, Element b) => a == b); | |
| 13737 } | |
| 13738 return false; | |
| 13739 } | |
| 13740 | |
| 13741 @override | |
| 13742 int get hashCode { | |
| 13743 int hash = 0; | |
| 13744 hash = _JenkinsSmiHash.combine(hash, location.hashCode); | |
| 13745 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); | |
| 13746 hash = _JenkinsSmiHash.combine(hash, isPotential.hashCode); | |
| 13747 hash = _JenkinsSmiHash.combine(hash, path.hashCode); | |
| 13748 return _JenkinsSmiHash.finish(hash); | |
| 13749 } | |
| 13750 } | |
| 13751 | |
| 13752 /** | |
| 13753 * SearchResultKind | |
| 13754 * | |
| 13755 * enum { | |
| 13756 * DECLARATION | |
| 13757 * INVOCATION | |
| 13758 * READ | |
| 13759 * READ_WRITE | |
| 13760 * REFERENCE | |
| 13761 * UNKNOWN | |
| 13762 * WRITE | |
| 13763 * } | |
| 13764 */ | |
| 13765 class SearchResultKind implements Enum { | |
| 13766 /** | |
| 13767 * The declaration of an element. | |
| 13768 */ | |
| 13769 static const DECLARATION = const SearchResultKind._("DECLARATION"); | |
| 13770 | |
| 13771 /** | |
| 13772 * The invocation of a function or method. | |
| 13773 */ | |
| 13774 static const INVOCATION = const SearchResultKind._("INVOCATION"); | |
| 13775 | |
| 13776 /** | |
| 13777 * A reference to a field, parameter or variable where it is being read. | |
| 13778 */ | |
| 13779 static const READ = const SearchResultKind._("READ"); | |
| 13780 | |
| 13781 /** | |
| 13782 * A reference to a field, parameter or variable where it is being read and | |
| 13783 * written. | |
| 13784 */ | |
| 13785 static const READ_WRITE = const SearchResultKind._("READ_WRITE"); | |
| 13786 | |
| 13787 /** | |
| 13788 * A reference to an element. | |
| 13789 */ | |
| 13790 static const REFERENCE = const SearchResultKind._("REFERENCE"); | |
| 13791 | |
| 13792 /** | |
| 13793 * Some other kind of search result. | |
| 13794 */ | |
| 13795 static const UNKNOWN = const SearchResultKind._("UNKNOWN"); | |
| 13796 | |
| 13797 /** | |
| 13798 * A reference to a field, parameter or variable where it is being written. | |
| 13799 */ | |
| 13800 static const WRITE = const SearchResultKind._("WRITE"); | |
| 13801 | |
| 13802 /** | |
| 13803 * A list containing all of the enum values that are defined. | |
| 13804 */ | |
| 13805 static const List<SearchResultKind> VALUES = const <SearchResultKind>[DECLARAT
ION, INVOCATION, READ, READ_WRITE, REFERENCE, UNKNOWN, WRITE]; | |
| 13806 | |
| 13807 final String name; | |
| 13808 | |
| 13809 const SearchResultKind._(this.name); | |
| 13810 | |
| 13811 factory SearchResultKind(String name) { | |
| 13812 switch (name) { | |
| 13813 case "DECLARATION": | |
| 13814 return DECLARATION; | |
| 13815 case "INVOCATION": | |
| 13816 return INVOCATION; | |
| 13817 case "READ": | |
| 13818 return READ; | |
| 13819 case "READ_WRITE": | |
| 13820 return READ_WRITE; | |
| 13821 case "REFERENCE": | |
| 13822 return REFERENCE; | |
| 13823 case "UNKNOWN": | |
| 13824 return UNKNOWN; | |
| 13825 case "WRITE": | |
| 13826 return WRITE; | |
| 13827 } | |
| 13828 throw new Exception('Illegal enum value: $name'); | |
| 13829 } | |
| 13830 | |
| 13831 factory SearchResultKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Ob
ject json) { | |
| 13832 if (json is String) { | |
| 13833 try { | |
| 13834 return new SearchResultKind(json); | |
| 13835 } catch(_) { | |
| 13836 // Fall through | |
| 13837 } | |
| 13838 } | |
| 13839 throw jsonDecoder.mismatch(jsonPath, "SearchResultKind", json); | |
| 13840 } | |
| 13841 | |
| 13842 @override | |
| 13843 String toString() => "SearchResultKind.$name"; | |
| 13844 | |
| 13845 String toJson() => name; | |
| 13846 } | |
| 13847 | |
| 13848 /** | |
| 13849 * ServerService | |
| 13850 * | |
| 13851 * enum { | |
| 13852 * STATUS | |
| 13853 * } | |
| 13854 */ | |
| 13855 class ServerService implements Enum { | |
| 13856 static const STATUS = const ServerService._("STATUS"); | |
| 13857 | |
| 13858 /** | |
| 13859 * A list containing all of the enum values that are defined. | |
| 13860 */ | |
| 13861 static const List<ServerService> VALUES = const <ServerService>[STATUS]; | |
| 13862 | |
| 13863 final String name; | |
| 13864 | |
| 13865 const ServerService._(this.name); | |
| 13866 | |
| 13867 factory ServerService(String name) { | |
| 13868 switch (name) { | |
| 13869 case "STATUS": | |
| 13870 return STATUS; | |
| 13871 } | |
| 13872 throw new Exception('Illegal enum value: $name'); | |
| 13873 } | |
| 13874 | |
| 13875 factory ServerService.fromJson(JsonDecoder jsonDecoder, String jsonPath, Objec
t json) { | |
| 13876 if (json is String) { | |
| 13877 try { | |
| 13878 return new ServerService(json); | |
| 13879 } catch(_) { | |
| 13880 // Fall through | |
| 13881 } | |
| 13882 } | |
| 13883 throw jsonDecoder.mismatch(jsonPath, "ServerService", json); | |
| 13884 } | |
| 13885 | |
| 13886 @override | |
| 13887 String toString() => "ServerService.$name"; | |
| 13888 | |
| 13889 String toJson() => name; | |
| 13890 } | |
| 13891 | |
| 13892 /** | |
| 13893 * SourceChange | |
| 13894 * | |
| 13895 * { | |
| 13896 * "message": String | |
| 13897 * "edits": List<SourceFileEdit> | |
| 13898 * "linkedEditGroups": List<LinkedEditGroup> | |
| 13899 * "selection": optional Position | |
| 13900 * } | |
| 13901 */ | |
| 13902 class SourceChange implements HasToJson { | |
| 13903 String _message; | |
| 13904 | |
| 13905 List<SourceFileEdit> _edits; | |
| 13906 | |
| 13907 List<LinkedEditGroup> _linkedEditGroups; | |
| 13908 | |
| 13909 Position _selection; | |
| 13910 | |
| 13911 /** | |
| 13912 * A human-readable description of the change to be applied. | |
| 13913 */ | |
| 13914 String get message => _message; | |
| 13915 | |
| 13916 /** | |
| 13917 * A human-readable description of the change to be applied. | |
| 13918 */ | |
| 13919 void set message(String value) { | |
| 13920 assert(value != null); | |
| 13921 this._message = value; | |
| 13922 } | |
| 13923 | |
| 13924 /** | |
| 13925 * A list of the edits used to effect the change, grouped by file. | |
| 13926 */ | |
| 13927 List<SourceFileEdit> get edits => _edits; | |
| 13928 | |
| 13929 /** | |
| 13930 * A list of the edits used to effect the change, grouped by file. | |
| 13931 */ | |
| 13932 void set edits(List<SourceFileEdit> value) { | |
| 13933 assert(value != null); | |
| 13934 this._edits = value; | |
| 13935 } | |
| 13936 | |
| 13937 /** | |
| 13938 * A list of the linked editing groups used to customize the changes that | |
| 13939 * were made. | |
| 13940 */ | |
| 13941 List<LinkedEditGroup> get linkedEditGroups => _linkedEditGroups; | |
| 13942 | |
| 13943 /** | |
| 13944 * A list of the linked editing groups used to customize the changes that | |
| 13945 * were made. | |
| 13946 */ | |
| 13947 void set linkedEditGroups(List<LinkedEditGroup> value) { | |
| 13948 assert(value != null); | |
| 13949 this._linkedEditGroups = value; | |
| 13950 } | |
| 13951 | |
| 13952 /** | |
| 13953 * The position that should be selected after the edits have been applied. | |
| 13954 */ | |
| 13955 Position get selection => _selection; | |
| 13956 | |
| 13957 /** | |
| 13958 * The position that should be selected after the edits have been applied. | |
| 13959 */ | |
| 13960 void set selection(Position value) { | |
| 13961 this._selection = value; | |
| 13962 } | |
| 13963 | |
| 13964 SourceChange(String message, {List<SourceFileEdit> edits, List<LinkedEditGroup
> linkedEditGroups, Position selection}) { | |
| 13965 this.message = message; | |
| 13966 if (edits == null) { | |
| 13967 this.edits = <SourceFileEdit>[]; | |
| 13968 } else { | |
| 13969 this.edits = edits; | |
| 13970 } | |
| 13971 if (linkedEditGroups == null) { | |
| 13972 this.linkedEditGroups = <LinkedEditGroup>[]; | |
| 13973 } else { | |
| 13974 this.linkedEditGroups = linkedEditGroups; | |
| 13975 } | |
| 13976 this.selection = selection; | |
| 13977 } | |
| 13978 | |
| 13979 factory SourceChange.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object
json) { | |
| 13980 if (json == null) { | |
| 13981 json = {}; | |
| 13982 } | |
| 13983 if (json is Map) { | |
| 13984 String message; | |
| 13985 if (json.containsKey("message")) { | |
| 13986 message = jsonDecoder._decodeString(jsonPath + ".message", json["message
"]); | |
| 13987 } else { | |
| 13988 throw jsonDecoder.missingKey(jsonPath, "message"); | |
| 13989 } | |
| 13990 List<SourceFileEdit> edits; | |
| 13991 if (json.containsKey("edits")) { | |
| 13992 edits = jsonDecoder._decodeList(jsonPath + ".edits", json["edits"], (Str
ing jsonPath, Object json) => new SourceFileEdit.fromJson(jsonDecoder, jsonPath,
json)); | |
| 13993 } else { | |
| 13994 throw jsonDecoder.missingKey(jsonPath, "edits"); | |
| 13995 } | |
| 13996 List<LinkedEditGroup> linkedEditGroups; | |
| 13997 if (json.containsKey("linkedEditGroups")) { | |
| 13998 linkedEditGroups = jsonDecoder._decodeList(jsonPath + ".linkedEditGroups
", json["linkedEditGroups"], (String jsonPath, Object json) => new LinkedEditGro
up.fromJson(jsonDecoder, jsonPath, json)); | |
| 13999 } else { | |
| 14000 throw jsonDecoder.missingKey(jsonPath, "linkedEditGroups"); | |
| 14001 } | |
| 14002 Position selection; | |
| 14003 if (json.containsKey("selection")) { | |
| 14004 selection = new Position.fromJson(jsonDecoder, jsonPath + ".selection",
json["selection"]); | |
| 14005 } | |
| 14006 return new SourceChange(message, edits: edits, linkedEditGroups: linkedEdi
tGroups, selection: selection); | |
| 14007 } else { | |
| 14008 throw jsonDecoder.mismatch(jsonPath, "SourceChange", json); | |
| 14009 } | |
| 14010 } | |
| 14011 | |
| 14012 Map<String, dynamic> toJson() { | |
| 14013 Map<String, dynamic> result = {}; | |
| 14014 result["message"] = message; | |
| 14015 result["edits"] = edits.map((SourceFileEdit value) => value.toJson()).toList
(); | |
| 14016 result["linkedEditGroups"] = linkedEditGroups.map((LinkedEditGroup value) =>
value.toJson()).toList(); | |
| 14017 if (selection != null) { | |
| 14018 result["selection"] = selection.toJson(); | |
| 14019 } | |
| 14020 return result; | |
| 14021 } | |
| 14022 | |
| 14023 /** | |
| 14024 * Adds [edit] to the [FileEdit] for the given [file]. | |
| 14025 */ | |
| 14026 void addEdit(String file, int fileStamp, SourceEdit edit) => | |
| 14027 _addEditToSourceChange(this, file, fileStamp, edit); | |
| 14028 | |
| 14029 /** | |
| 14030 * Adds the given [FileEdit]. | |
| 14031 */ | |
| 14032 void addFileEdit(SourceFileEdit edit) { | |
| 14033 edits.add(edit); | |
| 14034 } | |
| 14035 | |
| 14036 /** | |
| 14037 * Adds the given [LinkedEditGroup]. | |
| 14038 */ | |
| 14039 void addLinkedEditGroup(LinkedEditGroup linkedEditGroup) { | |
| 14040 linkedEditGroups.add(linkedEditGroup); | |
| 14041 } | |
| 14042 | |
| 14043 /** | |
| 14044 * Returns the [FileEdit] for the given [file], maybe `null`. | |
| 14045 */ | |
| 14046 SourceFileEdit getFileEdit(String file) => | |
| 14047 _getChangeFileEdit(this, file); | |
| 14048 | |
| 14049 @override | |
| 14050 String toString() => JSON.encode(toJson()); | |
| 14051 | |
| 14052 @override | |
| 14053 bool operator==(other) { | |
| 14054 if (other is SourceChange) { | |
| 14055 return message == other.message && | |
| 14056 _listEqual(edits, other.edits, (SourceFileEdit a, SourceFileEdit b) =>
a == b) && | |
| 14057 _listEqual(linkedEditGroups, other.linkedEditGroups, (LinkedEditGroup
a, LinkedEditGroup b) => a == b) && | |
| 14058 selection == other.selection; | |
| 14059 } | |
| 14060 return false; | |
| 14061 } | |
| 14062 | |
| 14063 @override | |
| 14064 int get hashCode { | |
| 14065 int hash = 0; | |
| 14066 hash = _JenkinsSmiHash.combine(hash, message.hashCode); | |
| 14067 hash = _JenkinsSmiHash.combine(hash, edits.hashCode); | |
| 14068 hash = _JenkinsSmiHash.combine(hash, linkedEditGroups.hashCode); | |
| 14069 hash = _JenkinsSmiHash.combine(hash, selection.hashCode); | |
| 14070 return _JenkinsSmiHash.finish(hash); | |
| 14071 } | |
| 14072 } | |
| 14073 | |
| 14074 /** | |
| 14075 * SourceEdit | |
| 14076 * | |
| 14077 * { | |
| 14078 * "offset": int | |
| 14079 * "length": int | |
| 14080 * "replacement": String | |
| 14081 * "id": optional String | |
| 14082 * } | |
| 14083 */ | |
| 14084 class SourceEdit implements HasToJson { | |
| 14085 /** | |
| 14086 * Get the result of applying a set of [edits] to the given [code]. Edits are | |
| 14087 * applied in the order they appear in [edits]. | |
| 14088 */ | |
| 14089 static String applySequence(String code, Iterable<SourceEdit> edits) => | |
| 14090 _applySequence(code, edits); | |
| 14091 | |
| 14092 int _offset; | |
| 14093 | |
| 14094 int _length; | |
| 14095 | |
| 14096 String _replacement; | |
| 14097 | |
| 14098 String _id; | |
| 14099 | |
| 14100 /** | |
| 14101 * The offset of the region to be modified. | |
| 14102 */ | |
| 14103 int get offset => _offset; | |
| 14104 | |
| 14105 /** | |
| 14106 * The offset of the region to be modified. | |
| 14107 */ | |
| 14108 void set offset(int value) { | |
| 14109 assert(value != null); | |
| 14110 this._offset = value; | |
| 14111 } | |
| 14112 | |
| 14113 /** | |
| 14114 * The length of the region to be modified. | |
| 14115 */ | |
| 14116 int get length => _length; | |
| 14117 | |
| 14118 /** | |
| 14119 * The length of the region to be modified. | |
| 14120 */ | |
| 14121 void set length(int value) { | |
| 14122 assert(value != null); | |
| 14123 this._length = value; | |
| 14124 } | |
| 14125 | |
| 14126 /** | |
| 14127 * The code that is to replace the specified region in the original code. | |
| 14128 */ | |
| 14129 String get replacement => _replacement; | |
| 14130 | |
| 14131 /** | |
| 14132 * The code that is to replace the specified region in the original code. | |
| 14133 */ | |
| 14134 void set replacement(String value) { | |
| 14135 assert(value != null); | |
| 14136 this._replacement = value; | |
| 14137 } | |
| 14138 | |
| 14139 /** | |
| 14140 * An identifier that uniquely identifies this source edit from other edits | |
| 14141 * in the same response. This field is omitted unless a containing structure | |
| 14142 * needs to be able to identify the edit for some reason. | |
| 14143 * | |
| 14144 * For example, some refactoring operations can produce edits that might not | |
| 14145 * be appropriate (referred to as potential edits). Such edits will have an | |
| 14146 * id so that they can be referenced. Edits in the same response that do not | |
| 14147 * need to be referenced will not have an id. | |
| 14148 */ | |
| 14149 String get id => _id; | |
| 14150 | |
| 14151 /** | |
| 14152 * An identifier that uniquely identifies this source edit from other edits | |
| 14153 * in the same response. This field is omitted unless a containing structure | |
| 14154 * needs to be able to identify the edit for some reason. | |
| 14155 * | |
| 14156 * For example, some refactoring operations can produce edits that might not | |
| 14157 * be appropriate (referred to as potential edits). Such edits will have an | |
| 14158 * id so that they can be referenced. Edits in the same response that do not | |
| 14159 * need to be referenced will not have an id. | |
| 14160 */ | |
| 14161 void set id(String value) { | |
| 14162 this._id = value; | |
| 14163 } | |
| 14164 | |
| 14165 SourceEdit(int offset, int length, String replacement, {String id}) { | |
| 14166 this.offset = offset; | |
| 14167 this.length = length; | |
| 14168 this.replacement = replacement; | |
| 14169 this.id = id; | |
| 14170 } | |
| 14171 | |
| 14172 factory SourceEdit.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object j
son) { | |
| 14173 if (json == null) { | |
| 14174 json = {}; | |
| 14175 } | |
| 14176 if (json is Map) { | |
| 14177 int offset; | |
| 14178 if (json.containsKey("offset")) { | |
| 14179 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 14180 } else { | |
| 14181 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 14182 } | |
| 14183 int length; | |
| 14184 if (json.containsKey("length")) { | |
| 14185 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | |
| 14186 } else { | |
| 14187 throw jsonDecoder.missingKey(jsonPath, "length"); | |
| 14188 } | |
| 14189 String replacement; | |
| 14190 if (json.containsKey("replacement")) { | |
| 14191 replacement = jsonDecoder._decodeString(jsonPath + ".replacement", json[
"replacement"]); | |
| 14192 } else { | |
| 14193 throw jsonDecoder.missingKey(jsonPath, "replacement"); | |
| 14194 } | |
| 14195 String id; | |
| 14196 if (json.containsKey("id")) { | |
| 14197 id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]); | |
| 14198 } | |
| 14199 return new SourceEdit(offset, length, replacement, id: id); | |
| 14200 } else { | |
| 14201 throw jsonDecoder.mismatch(jsonPath, "SourceEdit", json); | |
| 14202 } | |
| 14203 } | |
| 14204 | |
| 14205 /** | |
| 14206 * The end of the region to be modified. | |
| 14207 */ | |
| 14208 int get end => offset + length; | |
| 14209 | |
| 14210 Map<String, dynamic> toJson() { | |
| 14211 Map<String, dynamic> result = {}; | |
| 14212 result["offset"] = offset; | |
| 14213 result["length"] = length; | |
| 14214 result["replacement"] = replacement; | |
| 14215 if (id != null) { | |
| 14216 result["id"] = id; | |
| 14217 } | |
| 14218 return result; | |
| 14219 } | |
| 14220 | |
| 14221 /** | |
| 14222 * Get the result of applying the edit to the given [code]. | |
| 14223 */ | |
| 14224 String apply(String code) => _applyEdit(code, this); | |
| 14225 | |
| 14226 @override | |
| 14227 String toString() => JSON.encode(toJson()); | |
| 14228 | |
| 14229 @override | |
| 14230 bool operator==(other) { | |
| 14231 if (other is SourceEdit) { | |
| 14232 return offset == other.offset && | |
| 14233 length == other.length && | |
| 14234 replacement == other.replacement && | |
| 14235 id == other.id; | |
| 14236 } | |
| 14237 return false; | |
| 14238 } | |
| 14239 | |
| 14240 @override | |
| 14241 int get hashCode { | |
| 14242 int hash = 0; | |
| 14243 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 14244 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
| 14245 hash = _JenkinsSmiHash.combine(hash, replacement.hashCode); | |
| 14246 hash = _JenkinsSmiHash.combine(hash, id.hashCode); | |
| 14247 return _JenkinsSmiHash.finish(hash); | |
| 14248 } | |
| 14249 } | |
| 14250 | |
| 14251 /** | |
| 14252 * SourceFileEdit | |
| 14253 * | |
| 14254 * { | |
| 14255 * "file": FilePath | |
| 14256 * "fileStamp": long | |
| 14257 * "edits": List<SourceEdit> | |
| 14258 * } | |
| 14259 */ | |
| 14260 class SourceFileEdit implements HasToJson { | |
| 14261 String _file; | |
| 14262 | |
| 14263 int _fileStamp; | |
| 14264 | |
| 14265 List<SourceEdit> _edits; | |
| 14266 | |
| 14267 /** | |
| 14268 * The file containing the code to be modified. | |
| 14269 */ | |
| 14270 String get file => _file; | |
| 14271 | |
| 14272 /** | |
| 14273 * The file containing the code to be modified. | |
| 14274 */ | |
| 14275 void set file(String value) { | |
| 14276 assert(value != null); | |
| 14277 this._file = value; | |
| 14278 } | |
| 14279 | |
| 14280 /** | |
| 14281 * The modification stamp of the file at the moment when the change was | |
| 14282 * created, in milliseconds since the "Unix epoch". Will be -1 if the file | |
| 14283 * did not exist and should be created. The client may use this field to make | |
| 14284 * sure that the file was not changed since then, so it is safe to apply the | |
| 14285 * change. | |
| 14286 */ | |
| 14287 int get fileStamp => _fileStamp; | |
| 14288 | |
| 14289 /** | |
| 14290 * The modification stamp of the file at the moment when the change was | |
| 14291 * created, in milliseconds since the "Unix epoch". Will be -1 if the file | |
| 14292 * did not exist and should be created. The client may use this field to make | |
| 14293 * sure that the file was not changed since then, so it is safe to apply the | |
| 14294 * change. | |
| 14295 */ | |
| 14296 void set fileStamp(int value) { | |
| 14297 assert(value != null); | |
| 14298 this._fileStamp = value; | |
| 14299 } | |
| 14300 | |
| 14301 /** | |
| 14302 * A list of the edits used to effect the change. | |
| 14303 */ | |
| 14304 List<SourceEdit> get edits => _edits; | |
| 14305 | |
| 14306 /** | |
| 14307 * A list of the edits used to effect the change. | |
| 14308 */ | |
| 14309 void set edits(List<SourceEdit> value) { | |
| 14310 assert(value != null); | |
| 14311 this._edits = value; | |
| 14312 } | |
| 14313 | |
| 14314 SourceFileEdit(String file, int fileStamp, {List<SourceEdit> edits}) { | |
| 14315 this.file = file; | |
| 14316 this.fileStamp = fileStamp; | |
| 14317 if (edits == null) { | |
| 14318 this.edits = <SourceEdit>[]; | |
| 14319 } else { | |
| 14320 this.edits = edits; | |
| 14321 } | |
| 14322 } | |
| 14323 | |
| 14324 factory SourceFileEdit.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obje
ct json) { | |
| 14325 if (json == null) { | |
| 14326 json = {}; | |
| 14327 } | |
| 14328 if (json is Map) { | |
| 14329 String file; | |
| 14330 if (json.containsKey("file")) { | |
| 14331 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | |
| 14332 } else { | |
| 14333 throw jsonDecoder.missingKey(jsonPath, "file"); | |
| 14334 } | |
| 14335 int fileStamp; | |
| 14336 if (json.containsKey("fileStamp")) { | |
| 14337 fileStamp = jsonDecoder._decodeInt(jsonPath + ".fileStamp", json["fileSt
amp"]); | |
| 14338 } else { | |
| 14339 throw jsonDecoder.missingKey(jsonPath, "fileStamp"); | |
| 14340 } | |
| 14341 List<SourceEdit> edits; | |
| 14342 if (json.containsKey("edits")) { | |
| 14343 edits = jsonDecoder._decodeList(jsonPath + ".edits", json["edits"], (Str
ing jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, jso
n)); | |
| 14344 } else { | |
| 14345 throw jsonDecoder.missingKey(jsonPath, "edits"); | |
| 14346 } | |
| 14347 return new SourceFileEdit(file, fileStamp, edits: edits); | |
| 14348 } else { | |
| 14349 throw jsonDecoder.mismatch(jsonPath, "SourceFileEdit", json); | |
| 14350 } | |
| 14351 } | |
| 14352 | |
| 14353 Map<String, dynamic> toJson() { | |
| 14354 Map<String, dynamic> result = {}; | |
| 14355 result["file"] = file; | |
| 14356 result["fileStamp"] = fileStamp; | |
| 14357 result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList(); | |
| 14358 return result; | |
| 14359 } | |
| 14360 | |
| 14361 /** | |
| 14362 * Adds the given [Edit] to the list. | |
| 14363 */ | |
| 14364 void add(SourceEdit edit) => _addEditForSource(this, edit); | |
| 14365 | |
| 14366 /** | |
| 14367 * Adds the given [Edit]s. | |
| 14368 */ | |
| 14369 void addAll(Iterable<SourceEdit> edits) => | |
| 14370 _addAllEditsForSource(this, edits); | |
| 14371 | |
| 14372 @override | |
| 14373 String toString() => JSON.encode(toJson()); | |
| 14374 | |
| 14375 @override | |
| 14376 bool operator==(other) { | |
| 14377 if (other is SourceFileEdit) { | |
| 14378 return file == other.file && | |
| 14379 fileStamp == other.fileStamp && | |
| 14380 _listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a == b)
; | |
| 14381 } | |
| 14382 return false; | |
| 14383 } | |
| 14384 | |
| 14385 @override | |
| 14386 int get hashCode { | |
| 14387 int hash = 0; | |
| 14388 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | |
| 14389 hash = _JenkinsSmiHash.combine(hash, fileStamp.hashCode); | |
| 14390 hash = _JenkinsSmiHash.combine(hash, edits.hashCode); | |
| 14391 return _JenkinsSmiHash.finish(hash); | |
| 14392 } | |
| 14393 } | |
| 14394 | |
| 14395 /** | |
| 14396 * TypeHierarchyItem | |
| 14397 * | |
| 14398 * { | |
| 14399 * "classElement": Element | |
| 14400 * "displayName": optional String | |
| 14401 * "memberElement": optional Element | |
| 14402 * "superclass": optional int | |
| 14403 * "interfaces": List<int> | |
| 14404 * "mixins": List<int> | |
| 14405 * "subclasses": List<int> | |
| 14406 * } | |
| 14407 */ | |
| 14408 class TypeHierarchyItem implements HasToJson { | |
| 14409 Element _classElement; | |
| 14410 | |
| 14411 String _displayName; | |
| 14412 | |
| 14413 Element _memberElement; | |
| 14414 | |
| 14415 int _superclass; | |
| 14416 | |
| 14417 List<int> _interfaces; | |
| 14418 | |
| 14419 List<int> _mixins; | |
| 14420 | |
| 14421 List<int> _subclasses; | |
| 14422 | |
| 14423 /** | |
| 14424 * The class element represented by this item. | |
| 14425 */ | |
| 14426 Element get classElement => _classElement; | |
| 14427 | |
| 14428 /** | |
| 14429 * The class element represented by this item. | |
| 14430 */ | |
| 14431 void set classElement(Element value) { | |
| 14432 assert(value != null); | |
| 14433 this._classElement = value; | |
| 14434 } | |
| 14435 | |
| 14436 /** | |
| 14437 * The name to be displayed for the class. This field will be omitted if the | |
| 14438 * display name is the same as the name of the element. The display name is | |
| 14439 * different if there is additional type information to be displayed, such as | |
| 14440 * type arguments. | |
| 14441 */ | |
| 14442 String get displayName => _displayName; | |
| 14443 | |
| 14444 /** | |
| 14445 * The name to be displayed for the class. This field will be omitted if the | |
| 14446 * display name is the same as the name of the element. The display name is | |
| 14447 * different if there is additional type information to be displayed, such as | |
| 14448 * type arguments. | |
| 14449 */ | |
| 14450 void set displayName(String value) { | |
| 14451 this._displayName = value; | |
| 14452 } | |
| 14453 | |
| 14454 /** | |
| 14455 * The member in the class corresponding to the member on which the hierarchy | |
| 14456 * was requested. This field will be omitted if the hierarchy was not | |
| 14457 * requested for a member or if the class does not have a corresponding | |
| 14458 * member. | |
| 14459 */ | |
| 14460 Element get memberElement => _memberElement; | |
| 14461 | |
| 14462 /** | |
| 14463 * The member in the class corresponding to the member on which the hierarchy | |
| 14464 * was requested. This field will be omitted if the hierarchy was not | |
| 14465 * requested for a member or if the class does not have a corresponding | |
| 14466 * member. | |
| 14467 */ | |
| 14468 void set memberElement(Element value) { | |
| 14469 this._memberElement = value; | |
| 14470 } | |
| 14471 | |
| 14472 /** | |
| 14473 * The index of the item representing the superclass of this class. This | |
| 14474 * field will be omitted if this item represents the class Object. | |
| 14475 */ | |
| 14476 int get superclass => _superclass; | |
| 14477 | |
| 14478 /** | |
| 14479 * The index of the item representing the superclass of this class. This | |
| 14480 * field will be omitted if this item represents the class Object. | |
| 14481 */ | |
| 14482 void set superclass(int value) { | |
| 14483 this._superclass = value; | |
| 14484 } | |
| 14485 | |
| 14486 /** | |
| 14487 * The indexes of the items representing the interfaces implemented by this | |
| 14488 * class. The list will be empty if there are no implemented interfaces. | |
| 14489 */ | |
| 14490 List<int> get interfaces => _interfaces; | |
| 14491 | |
| 14492 /** | |
| 14493 * The indexes of the items representing the interfaces implemented by this | |
| 14494 * class. The list will be empty if there are no implemented interfaces. | |
| 14495 */ | |
| 14496 void set interfaces(List<int> value) { | |
| 14497 assert(value != null); | |
| 14498 this._interfaces = value; | |
| 14499 } | |
| 14500 | |
| 14501 /** | |
| 14502 * The indexes of the items representing the mixins referenced by this class. | |
| 14503 * The list will be empty if there are no classes mixed in to this class. | |
| 14504 */ | |
| 14505 List<int> get mixins => _mixins; | |
| 14506 | |
| 14507 /** | |
| 14508 * The indexes of the items representing the mixins referenced by this class. | |
| 14509 * The list will be empty if there are no classes mixed in to this class. | |
| 14510 */ | |
| 14511 void set mixins(List<int> value) { | |
| 14512 assert(value != null); | |
| 14513 this._mixins = value; | |
| 14514 } | |
| 14515 | |
| 14516 /** | |
| 14517 * The indexes of the items representing the subtypes of this class. The list | |
| 14518 * will be empty if there are no subtypes or if this item represents a | |
| 14519 * supertype of the pivot type. | |
| 14520 */ | |
| 14521 List<int> get subclasses => _subclasses; | |
| 14522 | |
| 14523 /** | |
| 14524 * The indexes of the items representing the subtypes of this class. The list | |
| 14525 * will be empty if there are no subtypes or if this item represents a | |
| 14526 * supertype of the pivot type. | |
| 14527 */ | |
| 14528 void set subclasses(List<int> value) { | |
| 14529 assert(value != null); | |
| 14530 this._subclasses = value; | |
| 14531 } | |
| 14532 | |
| 14533 TypeHierarchyItem(Element classElement, {String displayName, Element memberEle
ment, int superclass, List<int> interfaces, List<int> mixins, List<int> subclass
es}) { | |
| 14534 this.classElement = classElement; | |
| 14535 this.displayName = displayName; | |
| 14536 this.memberElement = memberElement; | |
| 14537 this.superclass = superclass; | |
| 14538 if (interfaces == null) { | |
| 14539 this.interfaces = <int>[]; | |
| 14540 } else { | |
| 14541 this.interfaces = interfaces; | |
| 14542 } | |
| 14543 if (mixins == null) { | |
| 14544 this.mixins = <int>[]; | |
| 14545 } else { | |
| 14546 this.mixins = mixins; | |
| 14547 } | |
| 14548 if (subclasses == null) { | |
| 14549 this.subclasses = <int>[]; | |
| 14550 } else { | |
| 14551 this.subclasses = subclasses; | |
| 14552 } | |
| 14553 } | |
| 14554 | |
| 14555 factory TypeHierarchyItem.fromJson(JsonDecoder jsonDecoder, String jsonPath, O
bject json) { | |
| 14556 if (json == null) { | |
| 14557 json = {}; | |
| 14558 } | |
| 14559 if (json is Map) { | |
| 14560 Element classElement; | |
| 14561 if (json.containsKey("classElement")) { | |
| 14562 classElement = new Element.fromJson(jsonDecoder, jsonPath + ".classEleme
nt", json["classElement"]); | |
| 14563 } else { | |
| 14564 throw jsonDecoder.missingKey(jsonPath, "classElement"); | |
| 14565 } | |
| 14566 String displayName; | |
| 14567 if (json.containsKey("displayName")) { | |
| 14568 displayName = jsonDecoder._decodeString(jsonPath + ".displayName", json[
"displayName"]); | |
| 14569 } | |
| 14570 Element memberElement; | |
| 14571 if (json.containsKey("memberElement")) { | |
| 14572 memberElement = new Element.fromJson(jsonDecoder, jsonPath + ".memberEle
ment", json["memberElement"]); | |
| 14573 } | |
| 14574 int superclass; | |
| 14575 if (json.containsKey("superclass")) { | |
| 14576 superclass = jsonDecoder._decodeInt(jsonPath + ".superclass", json["supe
rclass"]); | |
| 14577 } | |
| 14578 List<int> interfaces; | |
| 14579 if (json.containsKey("interfaces")) { | |
| 14580 interfaces = jsonDecoder._decodeList(jsonPath + ".interfaces", json["int
erfaces"], jsonDecoder._decodeInt); | |
| 14581 } else { | |
| 14582 throw jsonDecoder.missingKey(jsonPath, "interfaces"); | |
| 14583 } | |
| 14584 List<int> mixins; | |
| 14585 if (json.containsKey("mixins")) { | |
| 14586 mixins = jsonDecoder._decodeList(jsonPath + ".mixins", json["mixins"], j
sonDecoder._decodeInt); | |
| 14587 } else { | |
| 14588 throw jsonDecoder.missingKey(jsonPath, "mixins"); | |
| 14589 } | |
| 14590 List<int> subclasses; | |
| 14591 if (json.containsKey("subclasses")) { | |
| 14592 subclasses = jsonDecoder._decodeList(jsonPath + ".subclasses", json["sub
classes"], jsonDecoder._decodeInt); | |
| 14593 } else { | |
| 14594 throw jsonDecoder.missingKey(jsonPath, "subclasses"); | |
| 14595 } | |
| 14596 return new TypeHierarchyItem(classElement, displayName: displayName, membe
rElement: memberElement, superclass: superclass, interfaces: interfaces, mixins:
mixins, subclasses: subclasses); | |
| 14597 } else { | |
| 14598 throw jsonDecoder.mismatch(jsonPath, "TypeHierarchyItem", json); | |
| 14599 } | |
| 14600 } | |
| 14601 | |
| 14602 Map<String, dynamic> toJson() { | |
| 14603 Map<String, dynamic> result = {}; | |
| 14604 result["classElement"] = classElement.toJson(); | |
| 14605 if (displayName != null) { | |
| 14606 result["displayName"] = displayName; | |
| 14607 } | |
| 14608 if (memberElement != null) { | |
| 14609 result["memberElement"] = memberElement.toJson(); | |
| 14610 } | |
| 14611 if (superclass != null) { | |
| 14612 result["superclass"] = superclass; | |
| 14613 } | |
| 14614 result["interfaces"] = interfaces; | |
| 14615 result["mixins"] = mixins; | |
| 14616 result["subclasses"] = subclasses; | |
| 14617 return result; | |
| 14618 } | |
| 14619 | |
| 14620 @override | |
| 14621 String toString() => JSON.encode(toJson()); | |
| 14622 | |
| 14623 @override | |
| 14624 bool operator==(other) { | |
| 14625 if (other is TypeHierarchyItem) { | |
| 14626 return classElement == other.classElement && | |
| 14627 displayName == other.displayName && | |
| 14628 memberElement == other.memberElement && | |
| 14629 superclass == other.superclass && | |
| 14630 _listEqual(interfaces, other.interfaces, (int a, int b) => a == b) && | |
| 14631 _listEqual(mixins, other.mixins, (int a, int b) => a == b) && | |
| 14632 _listEqual(subclasses, other.subclasses, (int a, int b) => a == b); | |
| 14633 } | |
| 14634 return false; | |
| 14635 } | |
| 14636 | |
| 14637 @override | |
| 14638 int get hashCode { | |
| 14639 int hash = 0; | |
| 14640 hash = _JenkinsSmiHash.combine(hash, classElement.hashCode); | |
| 14641 hash = _JenkinsSmiHash.combine(hash, displayName.hashCode); | |
| 14642 hash = _JenkinsSmiHash.combine(hash, memberElement.hashCode); | |
| 14643 hash = _JenkinsSmiHash.combine(hash, superclass.hashCode); | |
| 14644 hash = _JenkinsSmiHash.combine(hash, interfaces.hashCode); | |
| 14645 hash = _JenkinsSmiHash.combine(hash, mixins.hashCode); | |
| 14646 hash = _JenkinsSmiHash.combine(hash, subclasses.hashCode); | |
| 14647 return _JenkinsSmiHash.finish(hash); | |
| 14648 } | |
| 14649 } | |
| 14650 /** | |
| 14651 * convertGetterToMethod feedback | |
| 14652 */ | |
| 14653 class ConvertGetterToMethodFeedback { | |
| 14654 @override | |
| 14655 bool operator==(other) { | |
| 14656 if (other is ConvertGetterToMethodFeedback) { | |
| 14657 return true; | |
| 14658 } | |
| 14659 return false; | |
| 14660 } | |
| 14661 | |
| 14662 @override | |
| 14663 int get hashCode { | |
| 14664 return 616032599; | |
| 14665 } | |
| 14666 } | |
| 14667 /** | |
| 14668 * convertGetterToMethod options | |
| 14669 */ | |
| 14670 class ConvertGetterToMethodOptions { | |
| 14671 @override | |
| 14672 bool operator==(other) { | |
| 14673 if (other is ConvertGetterToMethodOptions) { | |
| 14674 return true; | |
| 14675 } | |
| 14676 return false; | |
| 14677 } | |
| 14678 | |
| 14679 @override | |
| 14680 int get hashCode { | |
| 14681 return 488848400; | |
| 14682 } | |
| 14683 } | |
| 14684 /** | |
| 14685 * convertMethodToGetter feedback | |
| 14686 */ | |
| 14687 class ConvertMethodToGetterFeedback { | |
| 14688 @override | |
| 14689 bool operator==(other) { | |
| 14690 if (other is ConvertMethodToGetterFeedback) { | |
| 14691 return true; | |
| 14692 } | |
| 14693 return false; | |
| 14694 } | |
| 14695 | |
| 14696 @override | |
| 14697 int get hashCode { | |
| 14698 return 165291526; | |
| 14699 } | |
| 14700 } | |
| 14701 /** | |
| 14702 * convertMethodToGetter options | |
| 14703 */ | |
| 14704 class ConvertMethodToGetterOptions { | |
| 14705 @override | |
| 14706 bool operator==(other) { | |
| 14707 if (other is ConvertMethodToGetterOptions) { | |
| 14708 return true; | |
| 14709 } | |
| 14710 return false; | |
| 14711 } | |
| 14712 | |
| 14713 @override | |
| 14714 int get hashCode { | |
| 14715 return 27952290; | |
| 14716 } | |
| 14717 } | |
| 14718 | |
| 14719 /** | |
| 14720 * extractLocalVariable feedback | |
| 14721 * | |
| 14722 * { | |
| 14723 * "coveringExpressionOffsets": List<int> | |
| 14724 * "coveringExpressionLengths": List<int> | |
| 14725 * "names": List<String> | |
| 14726 * "offsets": List<int> | |
| 14727 * "lengths": List<int> | |
| 14728 * } | |
| 14729 */ | |
| 14730 class ExtractLocalVariableFeedback extends RefactoringFeedback implements HasToJ
son { | |
| 14731 List<int> _coveringExpressionOffsets; | |
| 14732 | |
| 14733 List<int> _coveringExpressionLengths; | |
| 14734 | |
| 14735 List<String> _names; | |
| 14736 | |
| 14737 List<int> _offsets; | |
| 14738 | |
| 14739 List<int> _lengths; | |
| 14740 | |
| 14741 /** | |
| 14742 * The offsets of the expressions that cover the specified selection, from | |
| 14743 * the down most to the up most. | |
| 14744 */ | |
| 14745 List<int> get coveringExpressionOffsets => _coveringExpressionOffsets; | |
| 14746 | |
| 14747 /** | |
| 14748 * The offsets of the expressions that cover the specified selection, from | |
| 14749 * the down most to the up most. | |
| 14750 */ | |
| 14751 void set coveringExpressionOffsets(List<int> value) { | |
| 14752 assert(value != null); | |
| 14753 this._coveringExpressionOffsets = value; | |
| 14754 } | |
| 14755 | |
| 14756 /** | |
| 14757 * The lengths of the expressions that cover the specified selection, from | |
| 14758 * the down most to the up most. | |
| 14759 */ | |
| 14760 List<int> get coveringExpressionLengths => _coveringExpressionLengths; | |
| 14761 | |
| 14762 /** | |
| 14763 * The lengths of the expressions that cover the specified selection, from | |
| 14764 * the down most to the up most. | |
| 14765 */ | |
| 14766 void set coveringExpressionLengths(List<int> value) { | |
| 14767 assert(value != null); | |
| 14768 this._coveringExpressionLengths = value; | |
| 14769 } | |
| 14770 | |
| 14771 /** | |
| 14772 * The proposed names for the local variable. | |
| 14773 */ | |
| 14774 List<String> get names => _names; | |
| 14775 | |
| 14776 /** | |
| 14777 * The proposed names for the local variable. | |
| 14778 */ | |
| 14779 void set names(List<String> value) { | |
| 14780 assert(value != null); | |
| 14781 this._names = value; | |
| 14782 } | |
| 14783 | |
| 14784 /** | |
| 14785 * The offsets of the expressions that would be replaced by a reference to | |
| 14786 * the variable. | |
| 14787 */ | |
| 14788 List<int> get offsets => _offsets; | |
| 14789 | |
| 14790 /** | |
| 14791 * The offsets of the expressions that would be replaced by a reference to | |
| 14792 * the variable. | |
| 14793 */ | |
| 14794 void set offsets(List<int> value) { | |
| 14795 assert(value != null); | |
| 14796 this._offsets = value; | |
| 14797 } | |
| 14798 | |
| 14799 /** | |
| 14800 * The lengths of the expressions that would be replaced by a reference to | |
| 14801 * the variable. The lengths correspond to the offsets. In other words, for a | |
| 14802 * given expression, if the offset of that expression is offsets[i], then the | |
| 14803 * length of that expression is lengths[i]. | |
| 14804 */ | |
| 14805 List<int> get lengths => _lengths; | |
| 14806 | |
| 14807 /** | |
| 14808 * The lengths of the expressions that would be replaced by a reference to | |
| 14809 * the variable. The lengths correspond to the offsets. In other words, for a | |
| 14810 * given expression, if the offset of that expression is offsets[i], then the | |
| 14811 * length of that expression is lengths[i]. | |
| 14812 */ | |
| 14813 void set lengths(List<int> value) { | |
| 14814 assert(value != null); | |
| 14815 this._lengths = value; | |
| 14816 } | |
| 14817 | |
| 14818 ExtractLocalVariableFeedback(List<int> coveringExpressionOffsets, List<int> co
veringExpressionLengths, List<String> names, List<int> offsets, List<int> length
s) { | |
| 14819 this.coveringExpressionOffsets = coveringExpressionOffsets; | |
| 14820 this.coveringExpressionLengths = coveringExpressionLengths; | |
| 14821 this.names = names; | |
| 14822 this.offsets = offsets; | |
| 14823 this.lengths = lengths; | |
| 14824 } | |
| 14825 | |
| 14826 factory ExtractLocalVariableFeedback.fromJson(JsonDecoder jsonDecoder, String
jsonPath, Object json) { | |
| 14827 if (json == null) { | |
| 14828 json = {}; | |
| 14829 } | |
| 14830 if (json is Map) { | |
| 14831 List<int> coveringExpressionOffsets; | |
| 14832 if (json.containsKey("coveringExpressionOffsets")) { | |
| 14833 coveringExpressionOffsets = jsonDecoder._decodeList(jsonPath + ".coverin
gExpressionOffsets", json["coveringExpressionOffsets"], jsonDecoder._decodeInt); | |
| 14834 } else { | |
| 14835 throw jsonDecoder.missingKey(jsonPath, "coveringExpressionOffsets"); | |
| 14836 } | |
| 14837 List<int> coveringExpressionLengths; | |
| 14838 if (json.containsKey("coveringExpressionLengths")) { | |
| 14839 coveringExpressionLengths = jsonDecoder._decodeList(jsonPath + ".coverin
gExpressionLengths", json["coveringExpressionLengths"], jsonDecoder._decodeInt); | |
| 14840 } else { | |
| 14841 throw jsonDecoder.missingKey(jsonPath, "coveringExpressionLengths"); | |
| 14842 } | |
| 14843 List<String> names; | |
| 14844 if (json.containsKey("names")) { | |
| 14845 names = jsonDecoder._decodeList(jsonPath + ".names", json["names"], json
Decoder._decodeString); | |
| 14846 } else { | |
| 14847 throw jsonDecoder.missingKey(jsonPath, "names"); | |
| 14848 } | |
| 14849 List<int> offsets; | |
| 14850 if (json.containsKey("offsets")) { | |
| 14851 offsets = jsonDecoder._decodeList(jsonPath + ".offsets", json["offsets"]
, jsonDecoder._decodeInt); | |
| 14852 } else { | |
| 14853 throw jsonDecoder.missingKey(jsonPath, "offsets"); | |
| 14854 } | |
| 14855 List<int> lengths; | |
| 14856 if (json.containsKey("lengths")) { | |
| 14857 lengths = jsonDecoder._decodeList(jsonPath + ".lengths", json["lengths"]
, jsonDecoder._decodeInt); | |
| 14858 } else { | |
| 14859 throw jsonDecoder.missingKey(jsonPath, "lengths"); | |
| 14860 } | |
| 14861 return new ExtractLocalVariableFeedback(coveringExpressionOffsets, coverin
gExpressionLengths, names, offsets, lengths); | |
| 14862 } else { | |
| 14863 throw jsonDecoder.mismatch(jsonPath, "extractLocalVariable feedback", json
); | |
| 14864 } | |
| 14865 } | |
| 14866 | |
| 14867 Map<String, dynamic> toJson() { | |
| 14868 Map<String, dynamic> result = {}; | |
| 14869 result["coveringExpressionOffsets"] = coveringExpressionOffsets; | |
| 14870 result["coveringExpressionLengths"] = coveringExpressionLengths; | |
| 14871 result["names"] = names; | |
| 14872 result["offsets"] = offsets; | |
| 14873 result["lengths"] = lengths; | |
| 14874 return result; | |
| 14875 } | |
| 14876 | |
| 14877 @override | |
| 14878 String toString() => JSON.encode(toJson()); | |
| 14879 | |
| 14880 @override | |
| 14881 bool operator==(other) { | |
| 14882 if (other is ExtractLocalVariableFeedback) { | |
| 14883 return _listEqual(coveringExpressionOffsets, other.coveringExpressionOffse
ts, (int a, int b) => a == b) && | |
| 14884 _listEqual(coveringExpressionLengths, other.coveringExpressionLengths,
(int a, int b) => a == b) && | |
| 14885 _listEqual(names, other.names, (String a, String b) => a == b) && | |
| 14886 _listEqual(offsets, other.offsets, (int a, int b) => a == b) && | |
| 14887 _listEqual(lengths, other.lengths, (int a, int b) => a == b); | |
| 14888 } | |
| 14889 return false; | |
| 14890 } | |
| 14891 | |
| 14892 @override | |
| 14893 int get hashCode { | |
| 14894 int hash = 0; | |
| 14895 hash = _JenkinsSmiHash.combine(hash, coveringExpressionOffsets.hashCode); | |
| 14896 hash = _JenkinsSmiHash.combine(hash, coveringExpressionLengths.hashCode); | |
| 14897 hash = _JenkinsSmiHash.combine(hash, names.hashCode); | |
| 14898 hash = _JenkinsSmiHash.combine(hash, offsets.hashCode); | |
| 14899 hash = _JenkinsSmiHash.combine(hash, lengths.hashCode); | |
| 14900 return _JenkinsSmiHash.finish(hash); | |
| 14901 } | |
| 14902 } | |
| 14903 | |
| 14904 /** | |
| 14905 * extractLocalVariable options | |
| 14906 * | |
| 14907 * { | |
| 14908 * "name": String | |
| 14909 * "extractAll": bool | |
| 14910 * } | |
| 14911 */ | |
| 14912 class ExtractLocalVariableOptions extends RefactoringOptions implements HasToJso
n { | |
| 14913 String _name; | |
| 14914 | |
| 14915 bool _extractAll; | |
| 14916 | |
| 14917 /** | |
| 14918 * The name that the local variable should be given. | |
| 14919 */ | |
| 14920 String get name => _name; | |
| 14921 | |
| 14922 /** | |
| 14923 * The name that the local variable should be given. | |
| 14924 */ | |
| 14925 void set name(String value) { | |
| 14926 assert(value != null); | |
| 14927 this._name = value; | |
| 14928 } | |
| 14929 | |
| 14930 /** | |
| 14931 * True if all occurrences of the expression within the scope in which the | |
| 14932 * variable will be defined should be replaced by a reference to the local | |
| 14933 * variable. The expression used to initiate the refactoring will always be | |
| 14934 * replaced. | |
| 14935 */ | |
| 14936 bool get extractAll => _extractAll; | |
| 14937 | |
| 14938 /** | |
| 14939 * True if all occurrences of the expression within the scope in which the | |
| 14940 * variable will be defined should be replaced by a reference to the local | |
| 14941 * variable. The expression used to initiate the refactoring will always be | |
| 14942 * replaced. | |
| 14943 */ | |
| 14944 void set extractAll(bool value) { | |
| 14945 assert(value != null); | |
| 14946 this._extractAll = value; | |
| 14947 } | |
| 14948 | |
| 14949 ExtractLocalVariableOptions(String name, bool extractAll) { | |
| 14950 this.name = name; | |
| 14951 this.extractAll = extractAll; | |
| 14952 } | |
| 14953 | |
| 14954 factory ExtractLocalVariableOptions.fromJson(JsonDecoder jsonDecoder, String j
sonPath, Object json) { | |
| 14955 if (json == null) { | |
| 14956 json = {}; | |
| 14957 } | |
| 14958 if (json is Map) { | |
| 14959 String name; | |
| 14960 if (json.containsKey("name")) { | |
| 14961 name = jsonDecoder._decodeString(jsonPath + ".name", json["name"]); | |
| 14962 } else { | |
| 14963 throw jsonDecoder.missingKey(jsonPath, "name"); | |
| 14964 } | |
| 14965 bool extractAll; | |
| 14966 if (json.containsKey("extractAll")) { | |
| 14967 extractAll = jsonDecoder._decodeBool(jsonPath + ".extractAll", json["ext
ractAll"]); | |
| 14968 } else { | |
| 14969 throw jsonDecoder.missingKey(jsonPath, "extractAll"); | |
| 14970 } | |
| 14971 return new ExtractLocalVariableOptions(name, extractAll); | |
| 14972 } else { | |
| 14973 throw jsonDecoder.mismatch(jsonPath, "extractLocalVariable options", json)
; | |
| 14974 } | |
| 14975 } | |
| 14976 | |
| 14977 factory ExtractLocalVariableOptions.fromRefactoringParams(EditGetRefactoringPa
rams refactoringParams, Request request) { | |
| 14978 return new ExtractLocalVariableOptions.fromJson( | |
| 14979 new RequestDecoder(request), "options", refactoringParams.options); | |
| 14980 } | |
| 14981 | |
| 14982 Map<String, dynamic> toJson() { | |
| 14983 Map<String, dynamic> result = {}; | |
| 14984 result["name"] = name; | |
| 14985 result["extractAll"] = extractAll; | |
| 14986 return result; | |
| 14987 } | |
| 14988 | |
| 14989 @override | |
| 14990 String toString() => JSON.encode(toJson()); | |
| 14991 | |
| 14992 @override | |
| 14993 bool operator==(other) { | |
| 14994 if (other is ExtractLocalVariableOptions) { | |
| 14995 return name == other.name && | |
| 14996 extractAll == other.extractAll; | |
| 14997 } | |
| 14998 return false; | |
| 14999 } | |
| 15000 | |
| 15001 @override | |
| 15002 int get hashCode { | |
| 15003 int hash = 0; | |
| 15004 hash = _JenkinsSmiHash.combine(hash, name.hashCode); | |
| 15005 hash = _JenkinsSmiHash.combine(hash, extractAll.hashCode); | |
| 15006 return _JenkinsSmiHash.finish(hash); | |
| 15007 } | |
| 15008 } | |
| 15009 | |
| 15010 /** | |
| 15011 * extractMethod feedback | |
| 15012 * | |
| 15013 * { | |
| 15014 * "offset": int | |
| 15015 * "length": int | |
| 15016 * "returnType": String | |
| 15017 * "names": List<String> | |
| 15018 * "canCreateGetter": bool | |
| 15019 * "parameters": List<RefactoringMethodParameter> | |
| 15020 * "offsets": List<int> | |
| 15021 * "lengths": List<int> | |
| 15022 * } | |
| 15023 */ | |
| 15024 class ExtractMethodFeedback extends RefactoringFeedback implements HasToJson { | |
| 15025 int _offset; | |
| 15026 | |
| 15027 int _length; | |
| 15028 | |
| 15029 String _returnType; | |
| 15030 | |
| 15031 List<String> _names; | |
| 15032 | |
| 15033 bool _canCreateGetter; | |
| 15034 | |
| 15035 List<RefactoringMethodParameter> _parameters; | |
| 15036 | |
| 15037 List<int> _offsets; | |
| 15038 | |
| 15039 List<int> _lengths; | |
| 15040 | |
| 15041 /** | |
| 15042 * The offset to the beginning of the expression or statements that will be | |
| 15043 * extracted. | |
| 15044 */ | |
| 15045 int get offset => _offset; | |
| 15046 | |
| 15047 /** | |
| 15048 * The offset to the beginning of the expression or statements that will be | |
| 15049 * extracted. | |
| 15050 */ | |
| 15051 void set offset(int value) { | |
| 15052 assert(value != null); | |
| 15053 this._offset = value; | |
| 15054 } | |
| 15055 | |
| 15056 /** | |
| 15057 * The length of the expression or statements that will be extracted. | |
| 15058 */ | |
| 15059 int get length => _length; | |
| 15060 | |
| 15061 /** | |
| 15062 * The length of the expression or statements that will be extracted. | |
| 15063 */ | |
| 15064 void set length(int value) { | |
| 15065 assert(value != null); | |
| 15066 this._length = value; | |
| 15067 } | |
| 15068 | |
| 15069 /** | |
| 15070 * The proposed return type for the method. If the returned element does not | |
| 15071 * have a declared return type, this field will contain an empty string. | |
| 15072 */ | |
| 15073 String get returnType => _returnType; | |
| 15074 | |
| 15075 /** | |
| 15076 * The proposed return type for the method. If the returned element does not | |
| 15077 * have a declared return type, this field will contain an empty string. | |
| 15078 */ | |
| 15079 void set returnType(String value) { | |
| 15080 assert(value != null); | |
| 15081 this._returnType = value; | |
| 15082 } | |
| 15083 | |
| 15084 /** | |
| 15085 * The proposed names for the method. | |
| 15086 */ | |
| 15087 List<String> get names => _names; | |
| 15088 | |
| 15089 /** | |
| 15090 * The proposed names for the method. | |
| 15091 */ | |
| 15092 void set names(List<String> value) { | |
| 15093 assert(value != null); | |
| 15094 this._names = value; | |
| 15095 } | |
| 15096 | |
| 15097 /** | |
| 15098 * True if a getter could be created rather than a method. | |
| 15099 */ | |
| 15100 bool get canCreateGetter => _canCreateGetter; | |
| 15101 | |
| 15102 /** | |
| 15103 * True if a getter could be created rather than a method. | |
| 15104 */ | |
| 15105 void set canCreateGetter(bool value) { | |
| 15106 assert(value != null); | |
| 15107 this._canCreateGetter = value; | |
| 15108 } | |
| 15109 | |
| 15110 /** | |
| 15111 * The proposed parameters for the method. | |
| 15112 */ | |
| 15113 List<RefactoringMethodParameter> get parameters => _parameters; | |
| 15114 | |
| 15115 /** | |
| 15116 * The proposed parameters for the method. | |
| 15117 */ | |
| 15118 void set parameters(List<RefactoringMethodParameter> value) { | |
| 15119 assert(value != null); | |
| 15120 this._parameters = value; | |
| 15121 } | |
| 15122 | |
| 15123 /** | |
| 15124 * The offsets of the expressions or statements that would be replaced by an | |
| 15125 * invocation of the method. | |
| 15126 */ | |
| 15127 List<int> get offsets => _offsets; | |
| 15128 | |
| 15129 /** | |
| 15130 * The offsets of the expressions or statements that would be replaced by an | |
| 15131 * invocation of the method. | |
| 15132 */ | |
| 15133 void set offsets(List<int> value) { | |
| 15134 assert(value != null); | |
| 15135 this._offsets = value; | |
| 15136 } | |
| 15137 | |
| 15138 /** | |
| 15139 * The lengths of the expressions or statements that would be replaced by an | |
| 15140 * invocation of the method. The lengths correspond to the offsets. In other | |
| 15141 * words, for a given expression (or block of statements), if the offset of | |
| 15142 * that expression is offsets[i], then the length of that expression is | |
| 15143 * lengths[i]. | |
| 15144 */ | |
| 15145 List<int> get lengths => _lengths; | |
| 15146 | |
| 15147 /** | |
| 15148 * The lengths of the expressions or statements that would be replaced by an | |
| 15149 * invocation of the method. The lengths correspond to the offsets. In other | |
| 15150 * words, for a given expression (or block of statements), if the offset of | |
| 15151 * that expression is offsets[i], then the length of that expression is | |
| 15152 * lengths[i]. | |
| 15153 */ | |
| 15154 void set lengths(List<int> value) { | |
| 15155 assert(value != null); | |
| 15156 this._lengths = value; | |
| 15157 } | |
| 15158 | |
| 15159 ExtractMethodFeedback(int offset, int length, String returnType, List<String>
names, bool canCreateGetter, List<RefactoringMethodParameter> parameters, List<i
nt> offsets, List<int> lengths) { | |
| 15160 this.offset = offset; | |
| 15161 this.length = length; | |
| 15162 this.returnType = returnType; | |
| 15163 this.names = names; | |
| 15164 this.canCreateGetter = canCreateGetter; | |
| 15165 this.parameters = parameters; | |
| 15166 this.offsets = offsets; | |
| 15167 this.lengths = lengths; | |
| 15168 } | |
| 15169 | |
| 15170 factory ExtractMethodFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPat
h, Object json) { | |
| 15171 if (json == null) { | |
| 15172 json = {}; | |
| 15173 } | |
| 15174 if (json is Map) { | |
| 15175 int offset; | |
| 15176 if (json.containsKey("offset")) { | |
| 15177 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 15178 } else { | |
| 15179 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 15180 } | |
| 15181 int length; | |
| 15182 if (json.containsKey("length")) { | |
| 15183 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | |
| 15184 } else { | |
| 15185 throw jsonDecoder.missingKey(jsonPath, "length"); | |
| 15186 } | |
| 15187 String returnType; | |
| 15188 if (json.containsKey("returnType")) { | |
| 15189 returnType = jsonDecoder._decodeString(jsonPath + ".returnType", json["r
eturnType"]); | |
| 15190 } else { | |
| 15191 throw jsonDecoder.missingKey(jsonPath, "returnType"); | |
| 15192 } | |
| 15193 List<String> names; | |
| 15194 if (json.containsKey("names")) { | |
| 15195 names = jsonDecoder._decodeList(jsonPath + ".names", json["names"], json
Decoder._decodeString); | |
| 15196 } else { | |
| 15197 throw jsonDecoder.missingKey(jsonPath, "names"); | |
| 15198 } | |
| 15199 bool canCreateGetter; | |
| 15200 if (json.containsKey("canCreateGetter")) { | |
| 15201 canCreateGetter = jsonDecoder._decodeBool(jsonPath + ".canCreateGetter",
json["canCreateGetter"]); | |
| 15202 } else { | |
| 15203 throw jsonDecoder.missingKey(jsonPath, "canCreateGetter"); | |
| 15204 } | |
| 15205 List<RefactoringMethodParameter> parameters; | |
| 15206 if (json.containsKey("parameters")) { | |
| 15207 parameters = jsonDecoder._decodeList(jsonPath + ".parameters", json["par
ameters"], (String jsonPath, Object json) => new RefactoringMethodParameter.from
Json(jsonDecoder, jsonPath, json)); | |
| 15208 } else { | |
| 15209 throw jsonDecoder.missingKey(jsonPath, "parameters"); | |
| 15210 } | |
| 15211 List<int> offsets; | |
| 15212 if (json.containsKey("offsets")) { | |
| 15213 offsets = jsonDecoder._decodeList(jsonPath + ".offsets", json["offsets"]
, jsonDecoder._decodeInt); | |
| 15214 } else { | |
| 15215 throw jsonDecoder.missingKey(jsonPath, "offsets"); | |
| 15216 } | |
| 15217 List<int> lengths; | |
| 15218 if (json.containsKey("lengths")) { | |
| 15219 lengths = jsonDecoder._decodeList(jsonPath + ".lengths", json["lengths"]
, jsonDecoder._decodeInt); | |
| 15220 } else { | |
| 15221 throw jsonDecoder.missingKey(jsonPath, "lengths"); | |
| 15222 } | |
| 15223 return new ExtractMethodFeedback(offset, length, returnType, names, canCre
ateGetter, parameters, offsets, lengths); | |
| 15224 } else { | |
| 15225 throw jsonDecoder.mismatch(jsonPath, "extractMethod feedback", json); | |
| 15226 } | |
| 15227 } | |
| 15228 | |
| 15229 Map<String, dynamic> toJson() { | |
| 15230 Map<String, dynamic> result = {}; | |
| 15231 result["offset"] = offset; | |
| 15232 result["length"] = length; | |
| 15233 result["returnType"] = returnType; | |
| 15234 result["names"] = names; | |
| 15235 result["canCreateGetter"] = canCreateGetter; | |
| 15236 result["parameters"] = parameters.map((RefactoringMethodParameter value) =>
value.toJson()).toList(); | |
| 15237 result["offsets"] = offsets; | |
| 15238 result["lengths"] = lengths; | |
| 15239 return result; | |
| 15240 } | |
| 15241 | |
| 15242 @override | |
| 15243 String toString() => JSON.encode(toJson()); | |
| 15244 | |
| 15245 @override | |
| 15246 bool operator==(other) { | |
| 15247 if (other is ExtractMethodFeedback) { | |
| 15248 return offset == other.offset && | |
| 15249 length == other.length && | |
| 15250 returnType == other.returnType && | |
| 15251 _listEqual(names, other.names, (String a, String b) => a == b) && | |
| 15252 canCreateGetter == other.canCreateGetter && | |
| 15253 _listEqual(parameters, other.parameters, (RefactoringMethodParameter a
, RefactoringMethodParameter b) => a == b) && | |
| 15254 _listEqual(offsets, other.offsets, (int a, int b) => a == b) && | |
| 15255 _listEqual(lengths, other.lengths, (int a, int b) => a == b); | |
| 15256 } | |
| 15257 return false; | |
| 15258 } | |
| 15259 | |
| 15260 @override | |
| 15261 int get hashCode { | |
| 15262 int hash = 0; | |
| 15263 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 15264 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
| 15265 hash = _JenkinsSmiHash.combine(hash, returnType.hashCode); | |
| 15266 hash = _JenkinsSmiHash.combine(hash, names.hashCode); | |
| 15267 hash = _JenkinsSmiHash.combine(hash, canCreateGetter.hashCode); | |
| 15268 hash = _JenkinsSmiHash.combine(hash, parameters.hashCode); | |
| 15269 hash = _JenkinsSmiHash.combine(hash, offsets.hashCode); | |
| 15270 hash = _JenkinsSmiHash.combine(hash, lengths.hashCode); | |
| 15271 return _JenkinsSmiHash.finish(hash); | |
| 15272 } | |
| 15273 } | |
| 15274 | |
| 15275 /** | |
| 15276 * extractMethod options | |
| 15277 * | |
| 15278 * { | |
| 15279 * "returnType": String | |
| 15280 * "createGetter": bool | |
| 15281 * "name": String | |
| 15282 * "parameters": List<RefactoringMethodParameter> | |
| 15283 * "extractAll": bool | |
| 15284 * } | |
| 15285 */ | |
| 15286 class ExtractMethodOptions extends RefactoringOptions implements HasToJson { | |
| 15287 String _returnType; | |
| 15288 | |
| 15289 bool _createGetter; | |
| 15290 | |
| 15291 String _name; | |
| 15292 | |
| 15293 List<RefactoringMethodParameter> _parameters; | |
| 15294 | |
| 15295 bool _extractAll; | |
| 15296 | |
| 15297 /** | |
| 15298 * The return type that should be defined for the method. | |
| 15299 */ | |
| 15300 String get returnType => _returnType; | |
| 15301 | |
| 15302 /** | |
| 15303 * The return type that should be defined for the method. | |
| 15304 */ | |
| 15305 void set returnType(String value) { | |
| 15306 assert(value != null); | |
| 15307 this._returnType = value; | |
| 15308 } | |
| 15309 | |
| 15310 /** | |
| 15311 * True if a getter should be created rather than a method. It is an error if | |
| 15312 * this field is true and the list of parameters is non-empty. | |
| 15313 */ | |
| 15314 bool get createGetter => _createGetter; | |
| 15315 | |
| 15316 /** | |
| 15317 * True if a getter should be created rather than a method. It is an error if | |
| 15318 * this field is true and the list of parameters is non-empty. | |
| 15319 */ | |
| 15320 void set createGetter(bool value) { | |
| 15321 assert(value != null); | |
| 15322 this._createGetter = value; | |
| 15323 } | |
| 15324 | |
| 15325 /** | |
| 15326 * The name that the method should be given. | |
| 15327 */ | |
| 15328 String get name => _name; | |
| 15329 | |
| 15330 /** | |
| 15331 * The name that the method should be given. | |
| 15332 */ | |
| 15333 void set name(String value) { | |
| 15334 assert(value != null); | |
| 15335 this._name = value; | |
| 15336 } | |
| 15337 | |
| 15338 /** | |
| 15339 * The parameters that should be defined for the method. | |
| 15340 * | |
| 15341 * It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL | |
| 15342 * parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a | |
| 15343 * NAMED parameter. | |
| 15344 * | |
| 15345 * - To change the order and/or update proposed parameters, add parameters | |
| 15346 * with the same identifiers as proposed. | |
| 15347 * - To add new parameters, omit their identifier. | |
| 15348 * - To remove some parameters, omit them in this list. | |
| 15349 */ | |
| 15350 List<RefactoringMethodParameter> get parameters => _parameters; | |
| 15351 | |
| 15352 /** | |
| 15353 * The parameters that should be defined for the method. | |
| 15354 * | |
| 15355 * It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL | |
| 15356 * parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a | |
| 15357 * NAMED parameter. | |
| 15358 * | |
| 15359 * - To change the order and/or update proposed parameters, add parameters | |
| 15360 * with the same identifiers as proposed. | |
| 15361 * - To add new parameters, omit their identifier. | |
| 15362 * - To remove some parameters, omit them in this list. | |
| 15363 */ | |
| 15364 void set parameters(List<RefactoringMethodParameter> value) { | |
| 15365 assert(value != null); | |
| 15366 this._parameters = value; | |
| 15367 } | |
| 15368 | |
| 15369 /** | |
| 15370 * True if all occurrences of the expression or statements should be replaced | |
| 15371 * by an invocation of the method. The expression or statements used to | |
| 15372 * initiate the refactoring will always be replaced. | |
| 15373 */ | |
| 15374 bool get extractAll => _extractAll; | |
| 15375 | |
| 15376 /** | |
| 15377 * True if all occurrences of the expression or statements should be replaced | |
| 15378 * by an invocation of the method. The expression or statements used to | |
| 15379 * initiate the refactoring will always be replaced. | |
| 15380 */ | |
| 15381 void set extractAll(bool value) { | |
| 15382 assert(value != null); | |
| 15383 this._extractAll = value; | |
| 15384 } | |
| 15385 | |
| 15386 ExtractMethodOptions(String returnType, bool createGetter, String name, List<R
efactoringMethodParameter> parameters, bool extractAll) { | |
| 15387 this.returnType = returnType; | |
| 15388 this.createGetter = createGetter; | |
| 15389 this.name = name; | |
| 15390 this.parameters = parameters; | |
| 15391 this.extractAll = extractAll; | |
| 15392 } | |
| 15393 | |
| 15394 factory ExtractMethodOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath
, Object json) { | |
| 15395 if (json == null) { | |
| 15396 json = {}; | |
| 15397 } | |
| 15398 if (json is Map) { | |
| 15399 String returnType; | |
| 15400 if (json.containsKey("returnType")) { | |
| 15401 returnType = jsonDecoder._decodeString(jsonPath + ".returnType", json["r
eturnType"]); | |
| 15402 } else { | |
| 15403 throw jsonDecoder.missingKey(jsonPath, "returnType"); | |
| 15404 } | |
| 15405 bool createGetter; | |
| 15406 if (json.containsKey("createGetter")) { | |
| 15407 createGetter = jsonDecoder._decodeBool(jsonPath + ".createGetter", json[
"createGetter"]); | |
| 15408 } else { | |
| 15409 throw jsonDecoder.missingKey(jsonPath, "createGetter"); | |
| 15410 } | |
| 15411 String name; | |
| 15412 if (json.containsKey("name")) { | |
| 15413 name = jsonDecoder._decodeString(jsonPath + ".name", json["name"]); | |
| 15414 } else { | |
| 15415 throw jsonDecoder.missingKey(jsonPath, "name"); | |
| 15416 } | |
| 15417 List<RefactoringMethodParameter> parameters; | |
| 15418 if (json.containsKey("parameters")) { | |
| 15419 parameters = jsonDecoder._decodeList(jsonPath + ".parameters", json["par
ameters"], (String jsonPath, Object json) => new RefactoringMethodParameter.from
Json(jsonDecoder, jsonPath, json)); | |
| 15420 } else { | |
| 15421 throw jsonDecoder.missingKey(jsonPath, "parameters"); | |
| 15422 } | |
| 15423 bool extractAll; | |
| 15424 if (json.containsKey("extractAll")) { | |
| 15425 extractAll = jsonDecoder._decodeBool(jsonPath + ".extractAll", json["ext
ractAll"]); | |
| 15426 } else { | |
| 15427 throw jsonDecoder.missingKey(jsonPath, "extractAll"); | |
| 15428 } | |
| 15429 return new ExtractMethodOptions(returnType, createGetter, name, parameters
, extractAll); | |
| 15430 } else { | |
| 15431 throw jsonDecoder.mismatch(jsonPath, "extractMethod options", json); | |
| 15432 } | |
| 15433 } | |
| 15434 | |
| 15435 factory ExtractMethodOptions.fromRefactoringParams(EditGetRefactoringParams re
factoringParams, Request request) { | |
| 15436 return new ExtractMethodOptions.fromJson( | |
| 15437 new RequestDecoder(request), "options", refactoringParams.options); | |
| 15438 } | |
| 15439 | |
| 15440 Map<String, dynamic> toJson() { | |
| 15441 Map<String, dynamic> result = {}; | |
| 15442 result["returnType"] = returnType; | |
| 15443 result["createGetter"] = createGetter; | |
| 15444 result["name"] = name; | |
| 15445 result["parameters"] = parameters.map((RefactoringMethodParameter value) =>
value.toJson()).toList(); | |
| 15446 result["extractAll"] = extractAll; | |
| 15447 return result; | |
| 15448 } | |
| 15449 | |
| 15450 @override | |
| 15451 String toString() => JSON.encode(toJson()); | |
| 15452 | |
| 15453 @override | |
| 15454 bool operator==(other) { | |
| 15455 if (other is ExtractMethodOptions) { | |
| 15456 return returnType == other.returnType && | |
| 15457 createGetter == other.createGetter && | |
| 15458 name == other.name && | |
| 15459 _listEqual(parameters, other.parameters, (RefactoringMethodParameter a
, RefactoringMethodParameter b) => a == b) && | |
| 15460 extractAll == other.extractAll; | |
| 15461 } | |
| 15462 return false; | |
| 15463 } | |
| 15464 | |
| 15465 @override | |
| 15466 int get hashCode { | |
| 15467 int hash = 0; | |
| 15468 hash = _JenkinsSmiHash.combine(hash, returnType.hashCode); | |
| 15469 hash = _JenkinsSmiHash.combine(hash, createGetter.hashCode); | |
| 15470 hash = _JenkinsSmiHash.combine(hash, name.hashCode); | |
| 15471 hash = _JenkinsSmiHash.combine(hash, parameters.hashCode); | |
| 15472 hash = _JenkinsSmiHash.combine(hash, extractAll.hashCode); | |
| 15473 return _JenkinsSmiHash.finish(hash); | |
| 15474 } | |
| 15475 } | |
| 15476 | |
| 15477 /** | |
| 15478 * inlineLocalVariable feedback | |
| 15479 * | |
| 15480 * { | |
| 15481 * "name": String | |
| 15482 * "occurrences": int | |
| 15483 * } | |
| 15484 */ | |
| 15485 class InlineLocalVariableFeedback extends RefactoringFeedback implements HasToJs
on { | |
| 15486 String _name; | |
| 15487 | |
| 15488 int _occurrences; | |
| 15489 | |
| 15490 /** | |
| 15491 * The name of the variable being inlined. | |
| 15492 */ | |
| 15493 String get name => _name; | |
| 15494 | |
| 15495 /** | |
| 15496 * The name of the variable being inlined. | |
| 15497 */ | |
| 15498 void set name(String value) { | |
| 15499 assert(value != null); | |
| 15500 this._name = value; | |
| 15501 } | |
| 15502 | |
| 15503 /** | |
| 15504 * The number of times the variable occurs. | |
| 15505 */ | |
| 15506 int get occurrences => _occurrences; | |
| 15507 | |
| 15508 /** | |
| 15509 * The number of times the variable occurs. | |
| 15510 */ | |
| 15511 void set occurrences(int value) { | |
| 15512 assert(value != null); | |
| 15513 this._occurrences = value; | |
| 15514 } | |
| 15515 | |
| 15516 InlineLocalVariableFeedback(String name, int occurrences) { | |
| 15517 this.name = name; | |
| 15518 this.occurrences = occurrences; | |
| 15519 } | |
| 15520 | |
| 15521 factory InlineLocalVariableFeedback.fromJson(JsonDecoder jsonDecoder, String j
sonPath, Object json) { | |
| 15522 if (json == null) { | |
| 15523 json = {}; | |
| 15524 } | |
| 15525 if (json is Map) { | |
| 15526 String name; | |
| 15527 if (json.containsKey("name")) { | |
| 15528 name = jsonDecoder._decodeString(jsonPath + ".name", json["name"]); | |
| 15529 } else { | |
| 15530 throw jsonDecoder.missingKey(jsonPath, "name"); | |
| 15531 } | |
| 15532 int occurrences; | |
| 15533 if (json.containsKey("occurrences")) { | |
| 15534 occurrences = jsonDecoder._decodeInt(jsonPath + ".occurrences", json["oc
currences"]); | |
| 15535 } else { | |
| 15536 throw jsonDecoder.missingKey(jsonPath, "occurrences"); | |
| 15537 } | |
| 15538 return new InlineLocalVariableFeedback(name, occurrences); | |
| 15539 } else { | |
| 15540 throw jsonDecoder.mismatch(jsonPath, "inlineLocalVariable feedback", json)
; | |
| 15541 } | |
| 15542 } | |
| 15543 | |
| 15544 Map<String, dynamic> toJson() { | |
| 15545 Map<String, dynamic> result = {}; | |
| 15546 result["name"] = name; | |
| 15547 result["occurrences"] = occurrences; | |
| 15548 return result; | |
| 15549 } | |
| 15550 | |
| 15551 @override | |
| 15552 String toString() => JSON.encode(toJson()); | |
| 15553 | |
| 15554 @override | |
| 15555 bool operator==(other) { | |
| 15556 if (other is InlineLocalVariableFeedback) { | |
| 15557 return name == other.name && | |
| 15558 occurrences == other.occurrences; | |
| 15559 } | |
| 15560 return false; | |
| 15561 } | |
| 15562 | |
| 15563 @override | |
| 15564 int get hashCode { | |
| 15565 int hash = 0; | |
| 15566 hash = _JenkinsSmiHash.combine(hash, name.hashCode); | |
| 15567 hash = _JenkinsSmiHash.combine(hash, occurrences.hashCode); | |
| 15568 return _JenkinsSmiHash.finish(hash); | |
| 15569 } | |
| 15570 } | |
| 15571 /** | |
| 15572 * inlineLocalVariable options | |
| 15573 */ | |
| 15574 class InlineLocalVariableOptions { | |
| 15575 @override | |
| 15576 bool operator==(other) { | |
| 15577 if (other is InlineLocalVariableOptions) { | |
| 15578 return true; | |
| 15579 } | |
| 15580 return false; | |
| 15581 } | |
| 15582 | |
| 15583 @override | |
| 15584 int get hashCode { | |
| 15585 return 540364977; | |
| 15586 } | |
| 15587 } | |
| 15588 | |
| 15589 /** | |
| 15590 * inlineMethod feedback | |
| 15591 * | |
| 15592 * { | |
| 15593 * "className": optional String | |
| 15594 * "methodName": String | |
| 15595 * "isDeclaration": bool | |
| 15596 * } | |
| 15597 */ | |
| 15598 class InlineMethodFeedback extends RefactoringFeedback implements HasToJson { | |
| 15599 String _className; | |
| 15600 | |
| 15601 String _methodName; | |
| 15602 | |
| 15603 bool _isDeclaration; | |
| 15604 | |
| 15605 /** | |
| 15606 * The name of the class enclosing the method being inlined. If not a class | |
| 15607 * member is being inlined, this field will be absent. | |
| 15608 */ | |
| 15609 String get className => _className; | |
| 15610 | |
| 15611 /** | |
| 15612 * The name of the class enclosing the method being inlined. If not a class | |
| 15613 * member is being inlined, this field will be absent. | |
| 15614 */ | |
| 15615 void set className(String value) { | |
| 15616 this._className = value; | |
| 15617 } | |
| 15618 | |
| 15619 /** | |
| 15620 * The name of the method (or function) being inlined. | |
| 15621 */ | |
| 15622 String get methodName => _methodName; | |
| 15623 | |
| 15624 /** | |
| 15625 * The name of the method (or function) being inlined. | |
| 15626 */ | |
| 15627 void set methodName(String value) { | |
| 15628 assert(value != null); | |
| 15629 this._methodName = value; | |
| 15630 } | |
| 15631 | |
| 15632 /** | |
| 15633 * True if the declaration of the method is selected. So all references | |
| 15634 * should be inlined. | |
| 15635 */ | |
| 15636 bool get isDeclaration => _isDeclaration; | |
| 15637 | |
| 15638 /** | |
| 15639 * True if the declaration of the method is selected. So all references | |
| 15640 * should be inlined. | |
| 15641 */ | |
| 15642 void set isDeclaration(bool value) { | |
| 15643 assert(value != null); | |
| 15644 this._isDeclaration = value; | |
| 15645 } | |
| 15646 | |
| 15647 InlineMethodFeedback(String methodName, bool isDeclaration, {String className}
) { | |
| 15648 this.className = className; | |
| 15649 this.methodName = methodName; | |
| 15650 this.isDeclaration = isDeclaration; | |
| 15651 } | |
| 15652 | |
| 15653 factory InlineMethodFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath
, Object json) { | |
| 15654 if (json == null) { | |
| 15655 json = {}; | |
| 15656 } | |
| 15657 if (json is Map) { | |
| 15658 String className; | |
| 15659 if (json.containsKey("className")) { | |
| 15660 className = jsonDecoder._decodeString(jsonPath + ".className", json["cla
ssName"]); | |
| 15661 } | |
| 15662 String methodName; | |
| 15663 if (json.containsKey("methodName")) { | |
| 15664 methodName = jsonDecoder._decodeString(jsonPath + ".methodName", json["m
ethodName"]); | |
| 15665 } else { | |
| 15666 throw jsonDecoder.missingKey(jsonPath, "methodName"); | |
| 15667 } | |
| 15668 bool isDeclaration; | |
| 15669 if (json.containsKey("isDeclaration")) { | |
| 15670 isDeclaration = jsonDecoder._decodeBool(jsonPath + ".isDeclaration", jso
n["isDeclaration"]); | |
| 15671 } else { | |
| 15672 throw jsonDecoder.missingKey(jsonPath, "isDeclaration"); | |
| 15673 } | |
| 15674 return new InlineMethodFeedback(methodName, isDeclaration, className: clas
sName); | |
| 15675 } else { | |
| 15676 throw jsonDecoder.mismatch(jsonPath, "inlineMethod feedback", json); | |
| 15677 } | |
| 15678 } | |
| 15679 | |
| 15680 Map<String, dynamic> toJson() { | |
| 15681 Map<String, dynamic> result = {}; | |
| 15682 if (className != null) { | |
| 15683 result["className"] = className; | |
| 15684 } | |
| 15685 result["methodName"] = methodName; | |
| 15686 result["isDeclaration"] = isDeclaration; | |
| 15687 return result; | |
| 15688 } | |
| 15689 | |
| 15690 @override | |
| 15691 String toString() => JSON.encode(toJson()); | |
| 15692 | |
| 15693 @override | |
| 15694 bool operator==(other) { | |
| 15695 if (other is InlineMethodFeedback) { | |
| 15696 return className == other.className && | |
| 15697 methodName == other.methodName && | |
| 15698 isDeclaration == other.isDeclaration; | |
| 15699 } | |
| 15700 return false; | |
| 15701 } | |
| 15702 | |
| 15703 @override | |
| 15704 int get hashCode { | |
| 15705 int hash = 0; | |
| 15706 hash = _JenkinsSmiHash.combine(hash, className.hashCode); | |
| 15707 hash = _JenkinsSmiHash.combine(hash, methodName.hashCode); | |
| 15708 hash = _JenkinsSmiHash.combine(hash, isDeclaration.hashCode); | |
| 15709 return _JenkinsSmiHash.finish(hash); | |
| 15710 } | |
| 15711 } | |
| 15712 | |
| 15713 /** | |
| 15714 * inlineMethod options | |
| 15715 * | |
| 15716 * { | |
| 15717 * "deleteSource": bool | |
| 15718 * "inlineAll": bool | |
| 15719 * } | |
| 15720 */ | |
| 15721 class InlineMethodOptions extends RefactoringOptions implements HasToJson { | |
| 15722 bool _deleteSource; | |
| 15723 | |
| 15724 bool _inlineAll; | |
| 15725 | |
| 15726 /** | |
| 15727 * True if the method being inlined should be removed. It is an error if this | |
| 15728 * field is true and inlineAll is false. | |
| 15729 */ | |
| 15730 bool get deleteSource => _deleteSource; | |
| 15731 | |
| 15732 /** | |
| 15733 * True if the method being inlined should be removed. It is an error if this | |
| 15734 * field is true and inlineAll is false. | |
| 15735 */ | |
| 15736 void set deleteSource(bool value) { | |
| 15737 assert(value != null); | |
| 15738 this._deleteSource = value; | |
| 15739 } | |
| 15740 | |
| 15741 /** | |
| 15742 * True if all invocations of the method should be inlined, or false if only | |
| 15743 * the invocation site used to create this refactoring should be inlined. | |
| 15744 */ | |
| 15745 bool get inlineAll => _inlineAll; | |
| 15746 | |
| 15747 /** | |
| 15748 * True if all invocations of the method should be inlined, or false if only | |
| 15749 * the invocation site used to create this refactoring should be inlined. | |
| 15750 */ | |
| 15751 void set inlineAll(bool value) { | |
| 15752 assert(value != null); | |
| 15753 this._inlineAll = value; | |
| 15754 } | |
| 15755 | |
| 15756 InlineMethodOptions(bool deleteSource, bool inlineAll) { | |
| 15757 this.deleteSource = deleteSource; | |
| 15758 this.inlineAll = inlineAll; | |
| 15759 } | |
| 15760 | |
| 15761 factory InlineMethodOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath,
Object json) { | |
| 15762 if (json == null) { | |
| 15763 json = {}; | |
| 15764 } | |
| 15765 if (json is Map) { | |
| 15766 bool deleteSource; | |
| 15767 if (json.containsKey("deleteSource")) { | |
| 15768 deleteSource = jsonDecoder._decodeBool(jsonPath + ".deleteSource", json[
"deleteSource"]); | |
| 15769 } else { | |
| 15770 throw jsonDecoder.missingKey(jsonPath, "deleteSource"); | |
| 15771 } | |
| 15772 bool inlineAll; | |
| 15773 if (json.containsKey("inlineAll")) { | |
| 15774 inlineAll = jsonDecoder._decodeBool(jsonPath + ".inlineAll", json["inlin
eAll"]); | |
| 15775 } else { | |
| 15776 throw jsonDecoder.missingKey(jsonPath, "inlineAll"); | |
| 15777 } | |
| 15778 return new InlineMethodOptions(deleteSource, inlineAll); | |
| 15779 } else { | |
| 15780 throw jsonDecoder.mismatch(jsonPath, "inlineMethod options", json); | |
| 15781 } | |
| 15782 } | |
| 15783 | |
| 15784 factory InlineMethodOptions.fromRefactoringParams(EditGetRefactoringParams ref
actoringParams, Request request) { | |
| 15785 return new InlineMethodOptions.fromJson( | |
| 15786 new RequestDecoder(request), "options", refactoringParams.options); | |
| 15787 } | |
| 15788 | |
| 15789 Map<String, dynamic> toJson() { | |
| 15790 Map<String, dynamic> result = {}; | |
| 15791 result["deleteSource"] = deleteSource; | |
| 15792 result["inlineAll"] = inlineAll; | |
| 15793 return result; | |
| 15794 } | |
| 15795 | |
| 15796 @override | |
| 15797 String toString() => JSON.encode(toJson()); | |
| 15798 | |
| 15799 @override | |
| 15800 bool operator==(other) { | |
| 15801 if (other is InlineMethodOptions) { | |
| 15802 return deleteSource == other.deleteSource && | |
| 15803 inlineAll == other.inlineAll; | |
| 15804 } | |
| 15805 return false; | |
| 15806 } | |
| 15807 | |
| 15808 @override | |
| 15809 int get hashCode { | |
| 15810 int hash = 0; | |
| 15811 hash = _JenkinsSmiHash.combine(hash, deleteSource.hashCode); | |
| 15812 hash = _JenkinsSmiHash.combine(hash, inlineAll.hashCode); | |
| 15813 return _JenkinsSmiHash.finish(hash); | |
| 15814 } | |
| 15815 } | |
| 15816 /** | |
| 15817 * moveFile feedback | |
| 15818 */ | |
| 15819 class MoveFileFeedback { | |
| 15820 @override | |
| 15821 bool operator==(other) { | |
| 15822 if (other is MoveFileFeedback) { | |
| 15823 return true; | |
| 15824 } | |
| 15825 return false; | |
| 15826 } | |
| 15827 | |
| 15828 @override | |
| 15829 int get hashCode { | |
| 15830 return 438975893; | |
| 15831 } | |
| 15832 } | |
| 15833 | |
| 15834 /** | |
| 15835 * moveFile options | |
| 15836 * | |
| 15837 * { | |
| 15838 * "newFile": FilePath | |
| 15839 * } | |
| 15840 */ | |
| 15841 class MoveFileOptions extends RefactoringOptions implements HasToJson { | |
| 15842 String _newFile; | |
| 15843 | |
| 15844 /** | |
| 15845 * The new file path to which the given file is being moved. | |
| 15846 */ | |
| 15847 String get newFile => _newFile; | |
| 15848 | |
| 15849 /** | |
| 15850 * The new file path to which the given file is being moved. | |
| 15851 */ | |
| 15852 void set newFile(String value) { | |
| 15853 assert(value != null); | |
| 15854 this._newFile = value; | |
| 15855 } | |
| 15856 | |
| 15857 MoveFileOptions(String newFile) { | |
| 15858 this.newFile = newFile; | |
| 15859 } | |
| 15860 | |
| 15861 factory MoveFileOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obj
ect json) { | |
| 15862 if (json == null) { | |
| 15863 json = {}; | |
| 15864 } | |
| 15865 if (json is Map) { | |
| 15866 String newFile; | |
| 15867 if (json.containsKey("newFile")) { | |
| 15868 newFile = jsonDecoder._decodeString(jsonPath + ".newFile", json["newFile
"]); | |
| 15869 } else { | |
| 15870 throw jsonDecoder.missingKey(jsonPath, "newFile"); | |
| 15871 } | |
| 15872 return new MoveFileOptions(newFile); | |
| 15873 } else { | |
| 15874 throw jsonDecoder.mismatch(jsonPath, "moveFile options", json); | |
| 15875 } | |
| 15876 } | |
| 15877 | |
| 15878 factory MoveFileOptions.fromRefactoringParams(EditGetRefactoringParams refacto
ringParams, Request request) { | |
| 15879 return new MoveFileOptions.fromJson( | |
| 15880 new RequestDecoder(request), "options", refactoringParams.options); | |
| 15881 } | |
| 15882 | |
| 15883 Map<String, dynamic> toJson() { | |
| 15884 Map<String, dynamic> result = {}; | |
| 15885 result["newFile"] = newFile; | |
| 15886 return result; | |
| 15887 } | |
| 15888 | |
| 15889 @override | |
| 15890 String toString() => JSON.encode(toJson()); | |
| 15891 | |
| 15892 @override | |
| 15893 bool operator==(other) { | |
| 15894 if (other is MoveFileOptions) { | |
| 15895 return newFile == other.newFile; | |
| 15896 } | |
| 15897 return false; | |
| 15898 } | |
| 15899 | |
| 15900 @override | |
| 15901 int get hashCode { | |
| 15902 int hash = 0; | |
| 15903 hash = _JenkinsSmiHash.combine(hash, newFile.hashCode); | |
| 15904 return _JenkinsSmiHash.finish(hash); | |
| 15905 } | |
| 15906 } | |
| 15907 | |
| 15908 /** | |
| 15909 * rename feedback | |
| 15910 * | |
| 15911 * { | |
| 15912 * "offset": int | |
| 15913 * "length": int | |
| 15914 * "elementKindName": String | |
| 15915 * "oldName": String | |
| 15916 * } | |
| 15917 */ | |
| 15918 class RenameFeedback extends RefactoringFeedback implements HasToJson { | |
| 15919 int _offset; | |
| 15920 | |
| 15921 int _length; | |
| 15922 | |
| 15923 String _elementKindName; | |
| 15924 | |
| 15925 String _oldName; | |
| 15926 | |
| 15927 /** | |
| 15928 * The offset to the beginning of the name selected to be renamed. | |
| 15929 */ | |
| 15930 int get offset => _offset; | |
| 15931 | |
| 15932 /** | |
| 15933 * The offset to the beginning of the name selected to be renamed. | |
| 15934 */ | |
| 15935 void set offset(int value) { | |
| 15936 assert(value != null); | |
| 15937 this._offset = value; | |
| 15938 } | |
| 15939 | |
| 15940 /** | |
| 15941 * The length of the name selected to be renamed. | |
| 15942 */ | |
| 15943 int get length => _length; | |
| 15944 | |
| 15945 /** | |
| 15946 * The length of the name selected to be renamed. | |
| 15947 */ | |
| 15948 void set length(int value) { | |
| 15949 assert(value != null); | |
| 15950 this._length = value; | |
| 15951 } | |
| 15952 | |
| 15953 /** | |
| 15954 * The human-readable description of the kind of element being renamed (such | |
| 15955 * as “class” or “function type alias”). | |
| 15956 */ | |
| 15957 String get elementKindName => _elementKindName; | |
| 15958 | |
| 15959 /** | |
| 15960 * The human-readable description of the kind of element being renamed (such | |
| 15961 * as “class” or “function type alias”). | |
| 15962 */ | |
| 15963 void set elementKindName(String value) { | |
| 15964 assert(value != null); | |
| 15965 this._elementKindName = value; | |
| 15966 } | |
| 15967 | |
| 15968 /** | |
| 15969 * The old name of the element before the refactoring. | |
| 15970 */ | |
| 15971 String get oldName => _oldName; | |
| 15972 | |
| 15973 /** | |
| 15974 * The old name of the element before the refactoring. | |
| 15975 */ | |
| 15976 void set oldName(String value) { | |
| 15977 assert(value != null); | |
| 15978 this._oldName = value; | |
| 15979 } | |
| 15980 | |
| 15981 RenameFeedback(int offset, int length, String elementKindName, String oldName)
{ | |
| 15982 this.offset = offset; | |
| 15983 this.length = length; | |
| 15984 this.elementKindName = elementKindName; | |
| 15985 this.oldName = oldName; | |
| 15986 } | |
| 15987 | |
| 15988 factory RenameFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Obje
ct json) { | |
| 15989 if (json == null) { | |
| 15990 json = {}; | |
| 15991 } | |
| 15992 if (json is Map) { | |
| 15993 int offset; | |
| 15994 if (json.containsKey("offset")) { | |
| 15995 offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]); | |
| 15996 } else { | |
| 15997 throw jsonDecoder.missingKey(jsonPath, "offset"); | |
| 15998 } | |
| 15999 int length; | |
| 16000 if (json.containsKey("length")) { | |
| 16001 length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]); | |
| 16002 } else { | |
| 16003 throw jsonDecoder.missingKey(jsonPath, "length"); | |
| 16004 } | |
| 16005 String elementKindName; | |
| 16006 if (json.containsKey("elementKindName")) { | |
| 16007 elementKindName = jsonDecoder._decodeString(jsonPath + ".elementKindName
", json["elementKindName"]); | |
| 16008 } else { | |
| 16009 throw jsonDecoder.missingKey(jsonPath, "elementKindName"); | |
| 16010 } | |
| 16011 String oldName; | |
| 16012 if (json.containsKey("oldName")) { | |
| 16013 oldName = jsonDecoder._decodeString(jsonPath + ".oldName", json["oldName
"]); | |
| 16014 } else { | |
| 16015 throw jsonDecoder.missingKey(jsonPath, "oldName"); | |
| 16016 } | |
| 16017 return new RenameFeedback(offset, length, elementKindName, oldName); | |
| 16018 } else { | |
| 16019 throw jsonDecoder.mismatch(jsonPath, "rename feedback", json); | |
| 16020 } | |
| 16021 } | |
| 16022 | |
| 16023 Map<String, dynamic> toJson() { | |
| 16024 Map<String, dynamic> result = {}; | |
| 16025 result["offset"] = offset; | |
| 16026 result["length"] = length; | |
| 16027 result["elementKindName"] = elementKindName; | |
| 16028 result["oldName"] = oldName; | |
| 16029 return result; | |
| 16030 } | |
| 16031 | |
| 16032 @override | |
| 16033 String toString() => JSON.encode(toJson()); | |
| 16034 | |
| 16035 @override | |
| 16036 bool operator==(other) { | |
| 16037 if (other is RenameFeedback) { | |
| 16038 return offset == other.offset && | |
| 16039 length == other.length && | |
| 16040 elementKindName == other.elementKindName && | |
| 16041 oldName == other.oldName; | |
| 16042 } | |
| 16043 return false; | |
| 16044 } | |
| 16045 | |
| 16046 @override | |
| 16047 int get hashCode { | |
| 16048 int hash = 0; | |
| 16049 hash = _JenkinsSmiHash.combine(hash, offset.hashCode); | |
| 16050 hash = _JenkinsSmiHash.combine(hash, length.hashCode); | |
| 16051 hash = _JenkinsSmiHash.combine(hash, elementKindName.hashCode); | |
| 16052 hash = _JenkinsSmiHash.combine(hash, oldName.hashCode); | |
| 16053 return _JenkinsSmiHash.finish(hash); | |
| 16054 } | |
| 16055 } | |
| 16056 | |
| 16057 /** | |
| 16058 * rename options | |
| 16059 * | |
| 16060 * { | |
| 16061 * "newName": String | |
| 16062 * } | |
| 16063 */ | |
| 16064 class RenameOptions extends RefactoringOptions implements HasToJson { | |
| 16065 String _newName; | |
| 16066 | |
| 16067 /** | |
| 16068 * The name that the element should have after the refactoring. | |
| 16069 */ | |
| 16070 String get newName => _newName; | |
| 16071 | |
| 16072 /** | |
| 16073 * The name that the element should have after the refactoring. | |
| 16074 */ | |
| 16075 void set newName(String value) { | |
| 16076 assert(value != null); | |
| 16077 this._newName = value; | |
| 16078 } | |
| 16079 | |
| 16080 RenameOptions(String newName) { | |
| 16081 this.newName = newName; | |
| 16082 } | |
| 16083 | |
| 16084 factory RenameOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Objec
t json) { | |
| 16085 if (json == null) { | |
| 16086 json = {}; | |
| 16087 } | |
| 16088 if (json is Map) { | |
| 16089 String newName; | |
| 16090 if (json.containsKey("newName")) { | |
| 16091 newName = jsonDecoder._decodeString(jsonPath + ".newName", json["newName
"]); | |
| 16092 } else { | |
| 16093 throw jsonDecoder.missingKey(jsonPath, "newName"); | |
| 16094 } | |
| 16095 return new RenameOptions(newName); | |
| 16096 } else { | |
| 16097 throw jsonDecoder.mismatch(jsonPath, "rename options", json); | |
| 16098 } | |
| 16099 } | |
| 16100 | |
| 16101 factory RenameOptions.fromRefactoringParams(EditGetRefactoringParams refactori
ngParams, Request request) { | |
| 16102 return new RenameOptions.fromJson( | |
| 16103 new RequestDecoder(request), "options", refactoringParams.options); | |
| 16104 } | |
| 16105 | |
| 16106 Map<String, dynamic> toJson() { | |
| 16107 Map<String, dynamic> result = {}; | |
| 16108 result["newName"] = newName; | |
| 16109 return result; | |
| 16110 } | |
| 16111 | |
| 16112 @override | |
| 16113 String toString() => JSON.encode(toJson()); | |
| 16114 | |
| 16115 @override | |
| 16116 bool operator==(other) { | |
| 16117 if (other is RenameOptions) { | |
| 16118 return newName == other.newName; | |
| 16119 } | |
| 16120 return false; | |
| 16121 } | |
| 16122 | |
| 16123 @override | |
| 16124 int get hashCode { | |
| 16125 int hash = 0; | |
| 16126 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); | |
| 16127 return _JenkinsSmiHash.finish(hash); | |
| 16128 } | |
| 16129 } | |
| OLD | NEW |