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

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

Issue 1385523002: AnalysisError `hasFix` attr (Implements #23874). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 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 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // This file has been automatically generated. Please do not edit it manually. 5 // This file has been automatically generated. Please do not edit it manually.
6 // To regenerate the file, use the script 6 // To regenerate the file, use the script
7 // "pkg/analysis_server/tool/spec/generate_files". 7 // "pkg/analysis_server/tool/spec/generate_files".
8 8
9 part of protocol; 9 part of protocol;
10 /** 10 /**
(...skipping 7329 matching lines...) Expand 10 before | Expand all | Expand 10 after
7340 7340
7341 /** 7341 /**
7342 * AnalysisError 7342 * AnalysisError
7343 * 7343 *
7344 * { 7344 * {
7345 * "severity": AnalysisErrorSeverity 7345 * "severity": AnalysisErrorSeverity
7346 * "type": AnalysisErrorType 7346 * "type": AnalysisErrorType
7347 * "location": Location 7347 * "location": Location
7348 * "message": String 7348 * "message": String
7349 * "correction": optional String 7349 * "correction": optional String
7350 * "hasFix": optional bool
7350 * } 7351 * }
7351 */ 7352 */
7352 class AnalysisError implements HasToJson { 7353 class AnalysisError implements HasToJson {
7353 AnalysisErrorSeverity _severity; 7354 AnalysisErrorSeverity _severity;
7354 7355
7355 AnalysisErrorType _type; 7356 AnalysisErrorType _type;
7356 7357
7357 Location _location; 7358 Location _location;
7358 7359
7359 String _message; 7360 String _message;
7360 7361
7361 String _correction; 7362 String _correction;
7362 7363
7364 bool _hasFix;
7365
7363 /** 7366 /**
7364 * The severity of the error. 7367 * The severity of the error.
7365 */ 7368 */
7366 AnalysisErrorSeverity get severity => _severity; 7369 AnalysisErrorSeverity get severity => _severity;
7367 7370
7368 /** 7371 /**
7369 * The severity of the error. 7372 * The severity of the error.
7370 */ 7373 */
7371 void set severity(AnalysisErrorSeverity value) { 7374 void set severity(AnalysisErrorSeverity value) {
7372 assert(value != null); 7375 assert(value != null);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
7423 7426
7424 /** 7427 /**
7425 * The correction message to be displayed for this error. The correction 7428 * The correction message to be displayed for this error. The correction
7426 * message should indicate how the user can fix the error. The field is 7429 * message should indicate how the user can fix the error. The field is
7427 * omitted if there is no correction message associated with the error code. 7430 * omitted if there is no correction message associated with the error code.
7428 */ 7431 */
7429 void set correction(String value) { 7432 void set correction(String value) {
7430 this._correction = value; 7433 this._correction = value;
7431 } 7434 }
7432 7435
7433 AnalysisError(AnalysisErrorSeverity severity, AnalysisErrorType type, Location location, String message, {String correction}) { 7436 /**
7437 * A hint to indicate to interested clients that this error has an associated
7438 * fix (or fixes).
7439 */
7440 bool get hasFix => _hasFix;
7441
7442 /**
7443 * A hint to indicate to interested clients that this error has an associated
7444 * fix (or fixes).
7445 */
7446 void set hasFix(bool value) {
7447 this._hasFix = value;
7448 }
7449
7450 AnalysisError(AnalysisErrorSeverity severity, AnalysisErrorType type, Location location, String message, {String correction, bool hasFix}) {
7434 this.severity = severity; 7451 this.severity = severity;
7435 this.type = type; 7452 this.type = type;
7436 this.location = location; 7453 this.location = location;
7437 this.message = message; 7454 this.message = message;
7438 this.correction = correction; 7455 this.correction = correction;
7456 this.hasFix = hasFix;
7439 } 7457 }
7440 7458
7441 factory AnalysisError.fromJson(JsonDecoder jsonDecoder, String jsonPath, Objec t json) { 7459 factory AnalysisError.fromJson(JsonDecoder jsonDecoder, String jsonPath, Objec t json) {
7442 if (json == null) { 7460 if (json == null) {
7443 json = {}; 7461 json = {};
7444 } 7462 }
7445 if (json is Map) { 7463 if (json is Map) {
7446 AnalysisErrorSeverity severity; 7464 AnalysisErrorSeverity severity;
7447 if (json.containsKey("severity")) { 7465 if (json.containsKey("severity")) {
7448 severity = new AnalysisErrorSeverity.fromJson(jsonDecoder, jsonPath + ". severity", json["severity"]); 7466 severity = new AnalysisErrorSeverity.fromJson(jsonDecoder, jsonPath + ". severity", json["severity"]);
(...skipping 15 matching lines...) Expand all
7464 String message; 7482 String message;
7465 if (json.containsKey("message")) { 7483 if (json.containsKey("message")) {
7466 message = jsonDecoder._decodeString(jsonPath + ".message", json["message "]); 7484 message = jsonDecoder._decodeString(jsonPath + ".message", json["message "]);
7467 } else { 7485 } else {
7468 throw jsonDecoder.missingKey(jsonPath, "message"); 7486 throw jsonDecoder.missingKey(jsonPath, "message");
7469 } 7487 }
7470 String correction; 7488 String correction;
7471 if (json.containsKey("correction")) { 7489 if (json.containsKey("correction")) {
7472 correction = jsonDecoder._decodeString(jsonPath + ".correction", json["c orrection"]); 7490 correction = jsonDecoder._decodeString(jsonPath + ".correction", json["c orrection"]);
7473 } 7491 }
7474 return new AnalysisError(severity, type, location, message, correction: co rrection); 7492 bool hasFix;
7493 if (json.containsKey("hasFix")) {
7494 hasFix = jsonDecoder._decodeBool(jsonPath + ".hasFix", json["hasFix"]);
7495 }
7496 return new AnalysisError(severity, type, location, message, correction: co rrection, hasFix: hasFix);
7475 } else { 7497 } else {
7476 throw jsonDecoder.mismatch(jsonPath, "AnalysisError", json); 7498 throw jsonDecoder.mismatch(jsonPath, "AnalysisError", json);
7477 } 7499 }
7478 } 7500 }
7479 7501
7480 Map<String, dynamic> toJson() { 7502 Map<String, dynamic> toJson() {
7481 Map<String, dynamic> result = {}; 7503 Map<String, dynamic> result = {};
7482 result["severity"] = severity.toJson(); 7504 result["severity"] = severity.toJson();
7483 result["type"] = type.toJson(); 7505 result["type"] = type.toJson();
7484 result["location"] = location.toJson(); 7506 result["location"] = location.toJson();
7485 result["message"] = message; 7507 result["message"] = message;
7486 if (correction != null) { 7508 if (correction != null) {
7487 result["correction"] = correction; 7509 result["correction"] = correction;
7488 } 7510 }
7511 if (hasFix != null) {
7512 result["hasFix"] = hasFix;
7513 }
7489 return result; 7514 return result;
7490 } 7515 }
7491 7516
7492 @override 7517 @override
7493 String toString() => JSON.encode(toJson()); 7518 String toString() => JSON.encode(toJson());
7494 7519
7495 @override 7520 @override
7496 bool operator==(other) { 7521 bool operator==(other) {
7497 if (other is AnalysisError) { 7522 if (other is AnalysisError) {
7498 return severity == other.severity && 7523 return severity == other.severity &&
7499 type == other.type && 7524 type == other.type &&
7500 location == other.location && 7525 location == other.location &&
7501 message == other.message && 7526 message == other.message &&
7502 correction == other.correction; 7527 correction == other.correction &&
7528 hasFix == other.hasFix;
7503 } 7529 }
7504 return false; 7530 return false;
7505 } 7531 }
7506 7532
7507 @override 7533 @override
7508 int get hashCode { 7534 int get hashCode {
7509 int hash = 0; 7535 int hash = 0;
7510 hash = _JenkinsSmiHash.combine(hash, severity.hashCode); 7536 hash = _JenkinsSmiHash.combine(hash, severity.hashCode);
7511 hash = _JenkinsSmiHash.combine(hash, type.hashCode); 7537 hash = _JenkinsSmiHash.combine(hash, type.hashCode);
7512 hash = _JenkinsSmiHash.combine(hash, location.hashCode); 7538 hash = _JenkinsSmiHash.combine(hash, location.hashCode);
7513 hash = _JenkinsSmiHash.combine(hash, message.hashCode); 7539 hash = _JenkinsSmiHash.combine(hash, message.hashCode);
7514 hash = _JenkinsSmiHash.combine(hash, correction.hashCode); 7540 hash = _JenkinsSmiHash.combine(hash, correction.hashCode);
7541 hash = _JenkinsSmiHash.combine(hash, hasFix.hashCode);
7515 return _JenkinsSmiHash.finish(hash); 7542 return _JenkinsSmiHash.finish(hash);
7516 } 7543 }
7517 } 7544 }
7518 7545
7519 /** 7546 /**
7520 * AnalysisErrorFixes 7547 * AnalysisErrorFixes
7521 * 7548 *
7522 * { 7549 * {
7523 * "error": AnalysisError 7550 * "error": AnalysisError
7524 * "fixes": List<SourceChange> 7551 * "fixes": List<SourceChange>
(...skipping 8500 matching lines...) Expand 10 before | Expand all | Expand 10 after
16025 return false; 16052 return false;
16026 } 16053 }
16027 16054
16028 @override 16055 @override
16029 int get hashCode { 16056 int get hashCode {
16030 int hash = 0; 16057 int hash = 0;
16031 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); 16058 hash = _JenkinsSmiHash.combine(hash, newName.hashCode);
16032 return _JenkinsSmiHash.finish(hash); 16059 return _JenkinsSmiHash.finish(hash);
16033 } 16060 }
16034 } 16061 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698