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

Unified Diff: pkg/analysis_server/lib/src/generated_protocol.dart

Issue 542333002: Add feedback for 'Inline Local' refactoring. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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/doc/api.html ('k') | pkg/analysis_server/lib/src/protocol.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 af539db2d5bfa51b4c2ba42d6ab964ad35117f27..c55441301a9e2d0310b6173aa6f3d38f8c53d95d 100644
--- a/pkg/analysis_server/lib/src/generated_protocol.dart
+++ b/pkg/analysis_server/lib/src/generated_protocol.dart
@@ -9586,21 +9586,76 @@ class ExtractMethodOptions extends RefactoringOptions implements HasToJson {
return _JenkinsSmiHash.finish(hash);
}
}
+
/**
* inlineLocalVariable feedback
+ *
+ * {
+ * "name": String
+ * "occurrences": int
+ * }
*/
-class InlineLocalVariableFeedback {
+class InlineLocalVariableFeedback extends RefactoringFeedback implements HasToJson {
+ /**
+ * The name of the variable being inlined.
+ */
+ String name;
+
+ /**
+ * The number of times the variable occurs.
+ */
+ int occurrences;
+
+ InlineLocalVariableFeedback(this.name, this.occurrences);
+
+ factory InlineLocalVariableFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+ if (json == null) {
+ json = {};
+ }
+ if (json is Map) {
+ String name;
+ if (json.containsKey("name")) {
+ name = jsonDecoder._decodeString(jsonPath + ".name", json["name"]);
+ } else {
+ throw jsonDecoder.missingKey(jsonPath, "name");
+ }
+ int occurrences;
+ if (json.containsKey("occurrences")) {
+ occurrences = jsonDecoder._decodeInt(jsonPath + ".occurrences", json["occurrences"]);
+ } else {
+ throw jsonDecoder.missingKey(jsonPath, "occurrences");
+ }
+ return new InlineLocalVariableFeedback(name, occurrences);
+ } else {
+ throw jsonDecoder.mismatch(jsonPath, "inlineLocalVariable feedback");
+ }
+ }
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["name"] = name;
+ result["occurrences"] = occurrences;
+ return result;
+ }
+
+ @override
+ String toString() => JSON.encode(toJson());
+
@override
bool operator==(other) {
if (other is InlineLocalVariableFeedback) {
- return true;
+ return name == other.name &&
+ occurrences == other.occurrences;
}
return false;
}
@override
int get hashCode {
- return 247971243;
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, name.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, occurrences.hashCode);
+ return _JenkinsSmiHash.finish(hash);
}
}
/**
« no previous file with comments | « pkg/analysis_server/doc/api.html ('k') | pkg/analysis_server/lib/src/protocol.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698