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

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: Doc typo fix. 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). 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}) {
7434 this.severity = severity; 7463 this.severity = severity;
7435 this.type = type; 7464 this.type = type;
7436 this.location = location; 7465 this.location = location;
7437 this.message = message; 7466 this.message = message;
7438 this.correction = correction; 7467 this.correction = correction;
7468 this.hasFix = hasFix;
7439 } 7469 }
7440 7470
7441 factory AnalysisError.fromJson(JsonDecoder jsonDecoder, String jsonPath, Objec t json) { 7471 factory AnalysisError.fromJson(JsonDecoder jsonDecoder, String jsonPath, Objec t json) {
7442 if (json == null) { 7472 if (json == null) {
7443 json = {}; 7473 json = {};
7444 } 7474 }
7445 if (json is Map) { 7475 if (json is Map) {
7446 AnalysisErrorSeverity severity; 7476 AnalysisErrorSeverity severity;
7447 if (json.containsKey("severity")) { 7477 if (json.containsKey("severity")) {
7448 severity = new AnalysisErrorSeverity.fromJson(jsonDecoder, jsonPath + ". severity", json["severity"]); 7478 severity = new AnalysisErrorSeverity.fromJson(jsonDecoder, jsonPath + ". severity", json["severity"]);
(...skipping 15 matching lines...) Expand all
7464 String message; 7494 String message;
7465 if (json.containsKey("message")) { 7495 if (json.containsKey("message")) {
7466 message = jsonDecoder._decodeString(jsonPath + ".message", json["message "]); 7496 message = jsonDecoder._decodeString(jsonPath + ".message", json["message "]);
7467 } else { 7497 } else {
7468 throw jsonDecoder.missingKey(jsonPath, "message"); 7498 throw jsonDecoder.missingKey(jsonPath, "message");
7469 } 7499 }
7470 String correction; 7500 String correction;
7471 if (json.containsKey("correction")) { 7501 if (json.containsKey("correction")) {
7472 correction = jsonDecoder._decodeString(jsonPath + ".correction", json["c orrection"]); 7502 correction = jsonDecoder._decodeString(jsonPath + ".correction", json["c orrection"]);
7473 } 7503 }
7474 return new AnalysisError(severity, type, location, message, correction: co rrection); 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);
7475 } else { 7509 } else {
7476 throw jsonDecoder.mismatch(jsonPath, "AnalysisError", json); 7510 throw jsonDecoder.mismatch(jsonPath, "AnalysisError", json);
7477 } 7511 }
7478 } 7512 }
7479 7513
7480 Map<String, dynamic> toJson() { 7514 Map<String, dynamic> toJson() {
7481 Map<String, dynamic> result = {}; 7515 Map<String, dynamic> result = {};
7482 result["severity"] = severity.toJson(); 7516 result["severity"] = severity.toJson();
7483 result["type"] = type.toJson(); 7517 result["type"] = type.toJson();
7484 result["location"] = location.toJson(); 7518 result["location"] = location.toJson();
7485 result["message"] = message; 7519 result["message"] = message;
7486 if (correction != null) { 7520 if (correction != null) {
7487 result["correction"] = correction; 7521 result["correction"] = correction;
7488 } 7522 }
7523 if (hasFix != null) {
7524 result["hasFix"] = hasFix;
7525 }
7489 return result; 7526 return result;
7490 } 7527 }
7491 7528
7492 @override 7529 @override
7493 String toString() => JSON.encode(toJson()); 7530 String toString() => JSON.encode(toJson());
7494 7531
7495 @override 7532 @override
7496 bool operator==(other) { 7533 bool operator==(other) {
7497 if (other is AnalysisError) { 7534 if (other is AnalysisError) {
7498 return severity == other.severity && 7535 return severity == other.severity &&
7499 type == other.type && 7536 type == other.type &&
7500 location == other.location && 7537 location == other.location &&
7501 message == other.message && 7538 message == other.message &&
7502 correction == other.correction; 7539 correction == other.correction &&
7540 hasFix == other.hasFix;
7503 } 7541 }
7504 return false; 7542 return false;
7505 } 7543 }
7506 7544
7507 @override 7545 @override
7508 int get hashCode { 7546 int get hashCode {
7509 int hash = 0; 7547 int hash = 0;
7510 hash = _JenkinsSmiHash.combine(hash, severity.hashCode); 7548 hash = _JenkinsSmiHash.combine(hash, severity.hashCode);
7511 hash = _JenkinsSmiHash.combine(hash, type.hashCode); 7549 hash = _JenkinsSmiHash.combine(hash, type.hashCode);
7512 hash = _JenkinsSmiHash.combine(hash, location.hashCode); 7550 hash = _JenkinsSmiHash.combine(hash, location.hashCode);
7513 hash = _JenkinsSmiHash.combine(hash, message.hashCode); 7551 hash = _JenkinsSmiHash.combine(hash, message.hashCode);
7514 hash = _JenkinsSmiHash.combine(hash, correction.hashCode); 7552 hash = _JenkinsSmiHash.combine(hash, correction.hashCode);
7553 hash = _JenkinsSmiHash.combine(hash, hasFix.hashCode);
7515 return _JenkinsSmiHash.finish(hash); 7554 return _JenkinsSmiHash.finish(hash);
7516 } 7555 }
7517 } 7556 }
7518 7557
7519 /** 7558 /**
7520 * AnalysisErrorFixes 7559 * AnalysisErrorFixes
7521 * 7560 *
7522 * { 7561 * {
7523 * "error": AnalysisError 7562 * "error": AnalysisError
7524 * "fixes": List<SourceChange> 7563 * "fixes": List<SourceChange>
(...skipping 8500 matching lines...) Expand 10 before | Expand all | Expand 10 after
16025 return false; 16064 return false;
16026 } 16065 }
16027 16066
16028 @override 16067 @override
16029 int get hashCode { 16068 int get hashCode {
16030 int hash = 0; 16069 int hash = 0;
16031 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); 16070 hash = _JenkinsSmiHash.combine(hash, newName.hashCode);
16032 return _JenkinsSmiHash.finish(hash); 16071 return _JenkinsSmiHash.finish(hash);
16033 } 16072 }
16034 } 16073 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/constants.dart ('k') | pkg/analysis_server/lib/src/protocol_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698