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

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

Issue 845553005: Change code completion relevance from CompletionRelevance.LOW/DEFAULT/HIGH to int (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 | Annotate | Revision Log
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 5715 matching lines...) Expand 10 before | Expand all | Expand 10 after
5726 @override 5726 @override
5727 int get hashCode { 5727 int get hashCode {
5728 int hash = 0; 5728 int hash = 0;
5729 hash = _JenkinsSmiHash.combine(hash, 873118866); 5729 hash = _JenkinsSmiHash.combine(hash, 873118866);
5730 hash = _JenkinsSmiHash.combine(hash, edits.hashCode); 5730 hash = _JenkinsSmiHash.combine(hash, edits.hashCode);
5731 return _JenkinsSmiHash.finish(hash); 5731 return _JenkinsSmiHash.finish(hash);
5732 } 5732 }
5733 } 5733 }
5734 5734
5735 /** 5735 /**
5736 * CompletionRelevance
5737 *
5738 * enum {
5739 * LOW
5740 * DEFAULT
5741 * HIGH
5742 * }
5743 */
5744 class CompletionRelevance implements Enum {
5745 static const LOW = const CompletionRelevance._("LOW");
5746
5747 static const DEFAULT = const CompletionRelevance._("DEFAULT");
5748
5749 static const HIGH = const CompletionRelevance._("HIGH");
5750
5751 final String name;
5752
5753 const CompletionRelevance._(this.name);
5754
5755 factory CompletionRelevance(String name) {
5756 switch (name) {
5757 case "LOW":
5758 return LOW;
5759 case "DEFAULT":
5760 return DEFAULT;
5761 case "HIGH":
5762 return HIGH;
5763 }
5764 throw new Exception('Illegal enum value: $name');
5765 }
5766
5767 factory CompletionRelevance.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
5768 if (json is String) {
5769 try {
5770 return new CompletionRelevance(json);
5771 } catch(_) {
5772 // Fall through
5773 }
5774 }
5775 throw jsonDecoder.mismatch(jsonPath, "CompletionRelevance");
5776 }
5777
5778 @override
5779 String toString() => "CompletionRelevance.$name";
5780
5781 String toJson() => name;
5782 }
5783
5784 /**
5785 * CompletionSuggestion 5736 * CompletionSuggestion
5786 * 5737 *
5787 * { 5738 * {
5788 * "kind": CompletionSuggestionKind 5739 * "kind": CompletionSuggestionKind
5789 * "relevance": CompletionRelevance 5740 * "relevance": int
5790 * "completion": String 5741 * "completion": String
5791 * "selectionOffset": int 5742 * "selectionOffset": int
5792 * "selectionLength": int 5743 * "selectionLength": int
5793 * "isDeprecated": bool 5744 * "isDeprecated": bool
5794 * "isPotential": bool 5745 * "isPotential": bool
5795 * "docSummary": optional String 5746 * "docSummary": optional String
5796 * "docComplete": optional String 5747 * "docComplete": optional String
5797 * "declaringType": optional String 5748 * "declaringType": optional String
5798 * "element": optional Element 5749 * "element": optional Element
5799 * "returnType": optional String 5750 * "returnType": optional String
5800 * "parameterNames": optional List<String> 5751 * "parameterNames": optional List<String>
5801 * "parameterTypes": optional List<String> 5752 * "parameterTypes": optional List<String>
5802 * "requiredParameterCount": optional int 5753 * "requiredParameterCount": optional int
5803 * "hasNamedParameters": optional bool 5754 * "hasNamedParameters": optional bool
5804 * "parameterName": optional String 5755 * "parameterName": optional String
5805 * "parameterType": optional String 5756 * "parameterType": optional String
5806 * } 5757 * }
5807 */ 5758 */
5808 class CompletionSuggestion implements HasToJson { 5759 class CompletionSuggestion implements HasToJson {
5809 /** 5760 /**
5810 * The kind of element being suggested. 5761 * The kind of element being suggested.
5811 */ 5762 */
5812 CompletionSuggestionKind kind; 5763 CompletionSuggestionKind kind;
5813 5764
5814 /** 5765 /**
5815 * The relevance of this completion suggestion. 5766 * The relevance of this completion suggestion where a higher number
5767 * indicates a higher relevance.
5816 */ 5768 */
5817 CompletionRelevance relevance; 5769 int relevance;
5818 5770
5819 /** 5771 /**
5820 * The identifier to be inserted if the suggestion is selected. If the 5772 * The identifier to be inserted if the suggestion is selected. If the
5821 * suggestion is for a method or function, the client might want to 5773 * suggestion is for a method or function, the client might want to
5822 * additionally insert a template for the parameters. The information 5774 * additionally insert a template for the parameters. The information
5823 * required in order to do so is contained in other fields. 5775 * required in order to do so is contained in other fields.
5824 */ 5776 */
5825 String completion; 5777 String completion;
5826 5778
5827 /** 5779 /**
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
5921 if (json == null) { 5873 if (json == null) {
5922 json = {}; 5874 json = {};
5923 } 5875 }
5924 if (json is Map) { 5876 if (json is Map) {
5925 CompletionSuggestionKind kind; 5877 CompletionSuggestionKind kind;
5926 if (json.containsKey("kind")) { 5878 if (json.containsKey("kind")) {
5927 kind = new CompletionSuggestionKind.fromJson(jsonDecoder, jsonPath + ".k ind", json["kind"]); 5879 kind = new CompletionSuggestionKind.fromJson(jsonDecoder, jsonPath + ".k ind", json["kind"]);
5928 } else { 5880 } else {
5929 throw jsonDecoder.missingKey(jsonPath, "kind"); 5881 throw jsonDecoder.missingKey(jsonPath, "kind");
5930 } 5882 }
5931 CompletionRelevance relevance; 5883 int relevance;
5932 if (json.containsKey("relevance")) { 5884 if (json.containsKey("relevance")) {
5933 relevance = new CompletionRelevance.fromJson(jsonDecoder, jsonPath + ".r elevance", json["relevance"]); 5885 relevance = jsonDecoder._decodeInt(jsonPath + ".relevance", json["releva nce"]);
5934 } else { 5886 } else {
5935 throw jsonDecoder.missingKey(jsonPath, "relevance"); 5887 throw jsonDecoder.missingKey(jsonPath, "relevance");
5936 } 5888 }
5937 String completion; 5889 String completion;
5938 if (json.containsKey("completion")) { 5890 if (json.containsKey("completion")) {
5939 completion = jsonDecoder._decodeString(jsonPath + ".completion", json["c ompletion"]); 5891 completion = jsonDecoder._decodeString(jsonPath + ".completion", json["c ompletion"]);
5940 } else { 5892 } else {
5941 throw jsonDecoder.missingKey(jsonPath, "completion"); 5893 throw jsonDecoder.missingKey(jsonPath, "completion");
5942 } 5894 }
5943 int selectionOffset; 5895 int selectionOffset;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
6010 } 5962 }
6011 return new CompletionSuggestion(kind, relevance, completion, selectionOffs et, selectionLength, isDeprecated, isPotential, docSummary: docSummary, docCompl ete: docComplete, declaringType: declaringType, element: element, returnType: re turnType, parameterNames: parameterNames, parameterTypes: parameterTypes, requir edParameterCount: requiredParameterCount, hasNamedParameters: hasNamedParameters , parameterName: parameterName, parameterType: parameterType); 5963 return new CompletionSuggestion(kind, relevance, completion, selectionOffs et, selectionLength, isDeprecated, isPotential, docSummary: docSummary, docCompl ete: docComplete, declaringType: declaringType, element: element, returnType: re turnType, parameterNames: parameterNames, parameterTypes: parameterTypes, requir edParameterCount: requiredParameterCount, hasNamedParameters: hasNamedParameters , parameterName: parameterName, parameterType: parameterType);
6012 } else { 5964 } else {
6013 throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestion"); 5965 throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestion");
6014 } 5966 }
6015 } 5967 }
6016 5968
6017 Map<String, dynamic> toJson() { 5969 Map<String, dynamic> toJson() {
6018 Map<String, dynamic> result = {}; 5970 Map<String, dynamic> result = {};
6019 result["kind"] = kind.toJson(); 5971 result["kind"] = kind.toJson();
6020 result["relevance"] = relevance.toJson(); 5972 result["relevance"] = relevance;
6021 result["completion"] = completion; 5973 result["completion"] = completion;
6022 result["selectionOffset"] = selectionOffset; 5974 result["selectionOffset"] = selectionOffset;
6023 result["selectionLength"] = selectionLength; 5975 result["selectionLength"] = selectionLength;
6024 result["isDeprecated"] = isDeprecated; 5976 result["isDeprecated"] = isDeprecated;
6025 result["isPotential"] = isPotential; 5977 result["isPotential"] = isPotential;
6026 if (docSummary != null) { 5978 if (docSummary != null) {
6027 result["docSummary"] = docSummary; 5979 result["docSummary"] = docSummary;
6028 } 5980 }
6029 if (docComplete != null) { 5981 if (docComplete != null) {
6030 result["docComplete"] = docComplete; 5982 result["docComplete"] = docComplete;
(...skipping 4957 matching lines...) Expand 10 before | Expand all | Expand 10 after
10988 return false; 10940 return false;
10989 } 10941 }
10990 10942
10991 @override 10943 @override
10992 int get hashCode { 10944 int get hashCode {
10993 int hash = 0; 10945 int hash = 0;
10994 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); 10946 hash = _JenkinsSmiHash.combine(hash, newName.hashCode);
10995 return _JenkinsSmiHash.finish(hash); 10947 return _JenkinsSmiHash.finish(hash);
10996 } 10948 }
10997 } 10949 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698