OLD | NEW |
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 analysis_server.plugin.protocol.protocol; | 9 part of analysis_server.plugin.protocol.protocol; |
10 | 10 |
(...skipping 7777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7788 | 7788 |
7789 /** | 7789 /** |
7790 * AnalysisError | 7790 * AnalysisError |
7791 * | 7791 * |
7792 * { | 7792 * { |
7793 * "severity": AnalysisErrorSeverity | 7793 * "severity": AnalysisErrorSeverity |
7794 * "type": AnalysisErrorType | 7794 * "type": AnalysisErrorType |
7795 * "location": Location | 7795 * "location": Location |
7796 * "message": String | 7796 * "message": String |
7797 * "correction": optional String | 7797 * "correction": optional String |
| 7798 * "code": String |
7798 * "hasFix": optional bool | 7799 * "hasFix": optional bool |
7799 * } | 7800 * } |
7800 * | 7801 * |
7801 * Clients may not extend, implement or mix-in this class. | 7802 * Clients may not extend, implement or mix-in this class. |
7802 */ | 7803 */ |
7803 class AnalysisError implements HasToJson { | 7804 class AnalysisError implements HasToJson { |
7804 AnalysisErrorSeverity _severity; | 7805 AnalysisErrorSeverity _severity; |
7805 | 7806 |
7806 AnalysisErrorType _type; | 7807 AnalysisErrorType _type; |
7807 | 7808 |
7808 Location _location; | 7809 Location _location; |
7809 | 7810 |
7810 String _message; | 7811 String _message; |
7811 | 7812 |
7812 String _correction; | 7813 String _correction; |
7813 | 7814 |
| 7815 String _code; |
| 7816 |
7814 bool _hasFix; | 7817 bool _hasFix; |
7815 | 7818 |
7816 /** | 7819 /** |
7817 * The severity of the error. | 7820 * The severity of the error. |
7818 */ | 7821 */ |
7819 AnalysisErrorSeverity get severity => _severity; | 7822 AnalysisErrorSeverity get severity => _severity; |
7820 | 7823 |
7821 /** | 7824 /** |
7822 * The severity of the error. | 7825 * The severity of the error. |
7823 */ | 7826 */ |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7877 /** | 7880 /** |
7878 * The correction message to be displayed for this error. The correction | 7881 * The correction message to be displayed for this error. The correction |
7879 * message should indicate how the user can fix the error. The field is | 7882 * message should indicate how the user can fix the error. The field is |
7880 * omitted if there is no correction message associated with the error code. | 7883 * omitted if there is no correction message associated with the error code. |
7881 */ | 7884 */ |
7882 void set correction(String value) { | 7885 void set correction(String value) { |
7883 this._correction = value; | 7886 this._correction = value; |
7884 } | 7887 } |
7885 | 7888 |
7886 /** | 7889 /** |
| 7890 * The name, as a string, of the error code associated with this error. |
| 7891 */ |
| 7892 String get code => _code; |
| 7893 |
| 7894 /** |
| 7895 * The name, as a string, of the error code associated with this error. |
| 7896 */ |
| 7897 void set code(String value) { |
| 7898 assert(value != null); |
| 7899 this._code = value; |
| 7900 } |
| 7901 |
| 7902 /** |
7887 * A hint to indicate to interested clients that this error has an associated | 7903 * A hint to indicate to interested clients that this error has an associated |
7888 * fix (or fixes). The absence of this field implies there are not known to | 7904 * fix (or fixes). The absence of this field implies there are not known to |
7889 * be fixes. Note that since the operation to calculate whether fixes apply | 7905 * be fixes. Note that since the operation to calculate whether fixes apply |
7890 * needs to be performant it is possible that complicated tests will be | 7906 * needs to be performant it is possible that complicated tests will be |
7891 * skipped and a false negative returned. For this reason, this attribute | 7907 * skipped and a false negative returned. For this reason, this attribute |
7892 * should be treated as a "hint". Despite the possibility of false negatives, | 7908 * should be treated as a "hint". Despite the possibility of false negatives, |
7893 * no false positives should be returned. If a client sees this flag set they | 7909 * no false positives should be returned. If a client sees this flag set they |
7894 * can proceed with the confidence that there are in fact associated fixes. | 7910 * can proceed with the confidence that there are in fact associated fixes. |
7895 */ | 7911 */ |
7896 bool get hasFix => _hasFix; | 7912 bool get hasFix => _hasFix; |
7897 | 7913 |
7898 /** | 7914 /** |
7899 * A hint to indicate to interested clients that this error has an associated | 7915 * A hint to indicate to interested clients that this error has an associated |
7900 * fix (or fixes). The absence of this field implies there are not known to | 7916 * fix (or fixes). The absence of this field implies there are not known to |
7901 * be fixes. Note that since the operation to calculate whether fixes apply | 7917 * be fixes. Note that since the operation to calculate whether fixes apply |
7902 * needs to be performant it is possible that complicated tests will be | 7918 * needs to be performant it is possible that complicated tests will be |
7903 * skipped and a false negative returned. For this reason, this attribute | 7919 * skipped and a false negative returned. For this reason, this attribute |
7904 * should be treated as a "hint". Despite the possibility of false negatives, | 7920 * should be treated as a "hint". Despite the possibility of false negatives, |
7905 * no false positives should be returned. If a client sees this flag set they | 7921 * no false positives should be returned. If a client sees this flag set they |
7906 * can proceed with the confidence that there are in fact associated fixes. | 7922 * can proceed with the confidence that there are in fact associated fixes. |
7907 */ | 7923 */ |
7908 void set hasFix(bool value) { | 7924 void set hasFix(bool value) { |
7909 this._hasFix = value; | 7925 this._hasFix = value; |
7910 } | 7926 } |
7911 | 7927 |
7912 AnalysisError(AnalysisErrorSeverity severity, AnalysisErrorType type, Location
location, String message, {String correction, bool hasFix}) { | 7928 AnalysisError(AnalysisErrorSeverity severity, AnalysisErrorType type, Location
location, String message, String code, {String correction, bool hasFix}) { |
7913 this.severity = severity; | 7929 this.severity = severity; |
7914 this.type = type; | 7930 this.type = type; |
7915 this.location = location; | 7931 this.location = location; |
7916 this.message = message; | 7932 this.message = message; |
7917 this.correction = correction; | 7933 this.correction = correction; |
| 7934 this.code = code; |
7918 this.hasFix = hasFix; | 7935 this.hasFix = hasFix; |
7919 } | 7936 } |
7920 | 7937 |
7921 factory AnalysisError.fromJson(JsonDecoder jsonDecoder, String jsonPath, Objec
t json) { | 7938 factory AnalysisError.fromJson(JsonDecoder jsonDecoder, String jsonPath, Objec
t json) { |
7922 if (json == null) { | 7939 if (json == null) { |
7923 json = {}; | 7940 json = {}; |
7924 } | 7941 } |
7925 if (json is Map) { | 7942 if (json is Map) { |
7926 AnalysisErrorSeverity severity; | 7943 AnalysisErrorSeverity severity; |
7927 if (json.containsKey("severity")) { | 7944 if (json.containsKey("severity")) { |
(...skipping 16 matching lines...) Expand all Loading... |
7944 String message; | 7961 String message; |
7945 if (json.containsKey("message")) { | 7962 if (json.containsKey("message")) { |
7946 message = jsonDecoder.decodeString(jsonPath + ".message", json["message"
]); | 7963 message = jsonDecoder.decodeString(jsonPath + ".message", json["message"
]); |
7947 } else { | 7964 } else { |
7948 throw jsonDecoder.missingKey(jsonPath, "message"); | 7965 throw jsonDecoder.missingKey(jsonPath, "message"); |
7949 } | 7966 } |
7950 String correction; | 7967 String correction; |
7951 if (json.containsKey("correction")) { | 7968 if (json.containsKey("correction")) { |
7952 correction = jsonDecoder.decodeString(jsonPath + ".correction", json["co
rrection"]); | 7969 correction = jsonDecoder.decodeString(jsonPath + ".correction", json["co
rrection"]); |
7953 } | 7970 } |
| 7971 String code; |
| 7972 if (json.containsKey("code")) { |
| 7973 code = jsonDecoder.decodeString(jsonPath + ".code", json["code"]); |
| 7974 } else { |
| 7975 throw jsonDecoder.missingKey(jsonPath, "code"); |
| 7976 } |
7954 bool hasFix; | 7977 bool hasFix; |
7955 if (json.containsKey("hasFix")) { | 7978 if (json.containsKey("hasFix")) { |
7956 hasFix = jsonDecoder.decodeBool(jsonPath + ".hasFix", json["hasFix"]); | 7979 hasFix = jsonDecoder.decodeBool(jsonPath + ".hasFix", json["hasFix"]); |
7957 } | 7980 } |
7958 return new AnalysisError(severity, type, location, message, correction: co
rrection, hasFix: hasFix); | 7981 return new AnalysisError(severity, type, location, message, code, correcti
on: correction, hasFix: hasFix); |
7959 } else { | 7982 } else { |
7960 throw jsonDecoder.mismatch(jsonPath, "AnalysisError", json); | 7983 throw jsonDecoder.mismatch(jsonPath, "AnalysisError", json); |
7961 } | 7984 } |
7962 } | 7985 } |
7963 | 7986 |
7964 Map<String, dynamic> toJson() { | 7987 Map<String, dynamic> toJson() { |
7965 Map<String, dynamic> result = {}; | 7988 Map<String, dynamic> result = {}; |
7966 result["severity"] = severity.toJson(); | 7989 result["severity"] = severity.toJson(); |
7967 result["type"] = type.toJson(); | 7990 result["type"] = type.toJson(); |
7968 result["location"] = location.toJson(); | 7991 result["location"] = location.toJson(); |
7969 result["message"] = message; | 7992 result["message"] = message; |
7970 if (correction != null) { | 7993 if (correction != null) { |
7971 result["correction"] = correction; | 7994 result["correction"] = correction; |
7972 } | 7995 } |
| 7996 result["code"] = code; |
7973 if (hasFix != null) { | 7997 if (hasFix != null) { |
7974 result["hasFix"] = hasFix; | 7998 result["hasFix"] = hasFix; |
7975 } | 7999 } |
7976 return result; | 8000 return result; |
7977 } | 8001 } |
7978 | 8002 |
7979 @override | 8003 @override |
7980 String toString() => JSON.encode(toJson()); | 8004 String toString() => JSON.encode(toJson()); |
7981 | 8005 |
7982 @override | 8006 @override |
7983 bool operator==(other) { | 8007 bool operator==(other) { |
7984 if (other is AnalysisError) { | 8008 if (other is AnalysisError) { |
7985 return severity == other.severity && | 8009 return severity == other.severity && |
7986 type == other.type && | 8010 type == other.type && |
7987 location == other.location && | 8011 location == other.location && |
7988 message == other.message && | 8012 message == other.message && |
7989 correction == other.correction && | 8013 correction == other.correction && |
| 8014 code == other.code && |
7990 hasFix == other.hasFix; | 8015 hasFix == other.hasFix; |
7991 } | 8016 } |
7992 return false; | 8017 return false; |
7993 } | 8018 } |
7994 | 8019 |
7995 @override | 8020 @override |
7996 int get hashCode { | 8021 int get hashCode { |
7997 int hash = 0; | 8022 int hash = 0; |
7998 hash = JenkinsSmiHash.combine(hash, severity.hashCode); | 8023 hash = JenkinsSmiHash.combine(hash, severity.hashCode); |
7999 hash = JenkinsSmiHash.combine(hash, type.hashCode); | 8024 hash = JenkinsSmiHash.combine(hash, type.hashCode); |
8000 hash = JenkinsSmiHash.combine(hash, location.hashCode); | 8025 hash = JenkinsSmiHash.combine(hash, location.hashCode); |
8001 hash = JenkinsSmiHash.combine(hash, message.hashCode); | 8026 hash = JenkinsSmiHash.combine(hash, message.hashCode); |
8002 hash = JenkinsSmiHash.combine(hash, correction.hashCode); | 8027 hash = JenkinsSmiHash.combine(hash, correction.hashCode); |
| 8028 hash = JenkinsSmiHash.combine(hash, code.hashCode); |
8003 hash = JenkinsSmiHash.combine(hash, hasFix.hashCode); | 8029 hash = JenkinsSmiHash.combine(hash, hasFix.hashCode); |
8004 return JenkinsSmiHash.finish(hash); | 8030 return JenkinsSmiHash.finish(hash); |
8005 } | 8031 } |
8006 } | 8032 } |
8007 | 8033 |
8008 /** | 8034 /** |
8009 * AnalysisErrorFixes | 8035 * AnalysisErrorFixes |
8010 * | 8036 * |
8011 * { | 8037 * { |
8012 * "error": AnalysisError | 8038 * "error": AnalysisError |
(...skipping 8895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16908 return false; | 16934 return false; |
16909 } | 16935 } |
16910 | 16936 |
16911 @override | 16937 @override |
16912 int get hashCode { | 16938 int get hashCode { |
16913 int hash = 0; | 16939 int hash = 0; |
16914 hash = JenkinsSmiHash.combine(hash, newName.hashCode); | 16940 hash = JenkinsSmiHash.combine(hash, newName.hashCode); |
16915 return JenkinsSmiHash.finish(hash); | 16941 return JenkinsSmiHash.finish(hash); |
16916 } | 16942 } |
16917 } | 16943 } |
OLD | NEW |