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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/generated_protocol.dart
diff --git a/pkg/analysis_server/lib/src/generated_protocol.dart b/pkg/analysis_server/lib/src/generated_protocol.dart
index 7cd663785f5ff950c6a010770253133deb3732e0..6797b8ec820bbc3ebff78d53dd6e570899e5dcf3 100644
--- a/pkg/analysis_server/lib/src/generated_protocol.dart
+++ b/pkg/analysis_server/lib/src/generated_protocol.dart
@@ -7347,6 +7347,7 @@ class AddContentOverlay implements HasToJson {
* "location": Location
* "message": String
* "correction": optional String
+ * "hasFix": optional bool
* }
*/
class AnalysisError implements HasToJson {
@@ -7360,6 +7361,8 @@ class AnalysisError implements HasToJson {
String _correction;
+ bool _hasFix;
+
/**
* The severity of the error.
*/
@@ -7430,12 +7433,39 @@ class AnalysisError implements HasToJson {
this._correction = value;
}
- AnalysisError(AnalysisErrorSeverity severity, AnalysisErrorType type, Location location, String message, {String correction}) {
+ /**
+ * A hint to indicate to interested clients that this error has an associated
+ * fix (or fixes). The absence of this field implies there are not known to
+ * be fixes. Note that since the operation to calculate whether fixes apply
+ * needs to be performant it is possible that complicated tests will be
+ * skipped and a false negative returned. For this reason, this attribute
+ * should be treated as a "hint". Despite the possibility of false negatives,
+ * no false positives should be returned. If a client sees this flag set they
+ * can proceed with the confidence that there are in fact associated fixes.
+ */
+ bool get hasFix => _hasFix;
+
+ /**
+ * A hint to indicate to interested clients that this error has an associated
+ * fix (or fixes). The absence of this field implies there are not known to
+ * be fixes. Note that since the operation to calculate whether fixes apply
+ * needs to be performant it is possible that complicated tests will be
+ * skipped and a false negative returned. For this reason, this attribute
+ * should be treated as a "hint". Despite the possibility of false negatives,
+ * no false positives should be returned. If a client sees this flag set they
+ * can proceed with the confidence that there are in fact associated fixes.
+ */
+ void set hasFix(bool value) {
+ this._hasFix = value;
+ }
+
+ AnalysisError(AnalysisErrorSeverity severity, AnalysisErrorType type, Location location, String message, {String correction, bool hasFix}) {
this.severity = severity;
this.type = type;
this.location = location;
this.message = message;
this.correction = correction;
+ this.hasFix = hasFix;
}
factory AnalysisError.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
@@ -7471,7 +7501,11 @@ class AnalysisError implements HasToJson {
if (json.containsKey("correction")) {
correction = jsonDecoder._decodeString(jsonPath + ".correction", json["correction"]);
}
- return new AnalysisError(severity, type, location, message, correction: correction);
+ bool hasFix;
+ if (json.containsKey("hasFix")) {
+ hasFix = jsonDecoder._decodeBool(jsonPath + ".hasFix", json["hasFix"]);
+ }
+ return new AnalysisError(severity, type, location, message, correction: correction, hasFix: hasFix);
} else {
throw jsonDecoder.mismatch(jsonPath, "AnalysisError", json);
}
@@ -7486,6 +7520,9 @@ class AnalysisError implements HasToJson {
if (correction != null) {
result["correction"] = correction;
}
+ if (hasFix != null) {
+ result["hasFix"] = hasFix;
+ }
return result;
}
@@ -7499,7 +7536,8 @@ class AnalysisError implements HasToJson {
type == other.type &&
location == other.location &&
message == other.message &&
- correction == other.correction;
+ correction == other.correction &&
+ hasFix == other.hasFix;
}
return false;
}
@@ -7512,6 +7550,7 @@ class AnalysisError implements HasToJson {
hash = _JenkinsSmiHash.combine(hash, location.hashCode);
hash = _JenkinsSmiHash.combine(hash, message.hashCode);
hash = _JenkinsSmiHash.combine(hash, correction.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, hasFix.hashCode);
return _JenkinsSmiHash.finish(hash);
}
}
« 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