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 protocol; | 9 part of protocol; |
10 /** | 10 /** |
(...skipping 7661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7672 * "docComplete": optional String | 7672 * "docComplete": optional String |
7673 * "declaringType": optional String | 7673 * "declaringType": optional String |
7674 * "element": optional Element | 7674 * "element": optional Element |
7675 * "returnType": optional String | 7675 * "returnType": optional String |
7676 * "parameterNames": optional List<String> | 7676 * "parameterNames": optional List<String> |
7677 * "parameterTypes": optional List<String> | 7677 * "parameterTypes": optional List<String> |
7678 * "requiredParameterCount": optional int | 7678 * "requiredParameterCount": optional int |
7679 * "hasNamedParameters": optional bool | 7679 * "hasNamedParameters": optional bool |
7680 * "parameterName": optional String | 7680 * "parameterName": optional String |
7681 * "parameterType": optional String | 7681 * "parameterType": optional String |
| 7682 * "importUri": optional String |
7682 * } | 7683 * } |
7683 */ | 7684 */ |
7684 class CompletionSuggestion implements HasToJson { | 7685 class CompletionSuggestion implements HasToJson { |
7685 CompletionSuggestionKind _kind; | 7686 CompletionSuggestionKind _kind; |
7686 | 7687 |
7687 int _relevance; | 7688 int _relevance; |
7688 | 7689 |
7689 String _completion; | 7690 String _completion; |
7690 | 7691 |
7691 int _selectionOffset; | 7692 int _selectionOffset; |
(...skipping 19 matching lines...) Expand all Loading... |
7711 List<String> _parameterTypes; | 7712 List<String> _parameterTypes; |
7712 | 7713 |
7713 int _requiredParameterCount; | 7714 int _requiredParameterCount; |
7714 | 7715 |
7715 bool _hasNamedParameters; | 7716 bool _hasNamedParameters; |
7716 | 7717 |
7717 String _parameterName; | 7718 String _parameterName; |
7718 | 7719 |
7719 String _parameterType; | 7720 String _parameterType; |
7720 | 7721 |
| 7722 String _importUri; |
| 7723 |
7721 /** | 7724 /** |
7722 * The kind of element being suggested. | 7725 * The kind of element being suggested. |
7723 */ | 7726 */ |
7724 CompletionSuggestionKind get kind => _kind; | 7727 CompletionSuggestionKind get kind => _kind; |
7725 | 7728 |
7726 /** | 7729 /** |
7727 * The kind of element being suggested. | 7730 * The kind of element being suggested. |
7728 */ | 7731 */ |
7729 void set kind(CompletionSuggestionKind value) { | 7732 void set kind(CompletionSuggestionKind value) { |
7730 assert(value != null); | 7733 assert(value != null); |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7974 String get parameterType => _parameterType; | 7977 String get parameterType => _parameterType; |
7975 | 7978 |
7976 /** | 7979 /** |
7977 * The type of the options parameter being suggested. This field is omitted | 7980 * The type of the options parameter being suggested. This field is omitted |
7978 * if the parameterName field is omitted. | 7981 * if the parameterName field is omitted. |
7979 */ | 7982 */ |
7980 void set parameterType(String value) { | 7983 void set parameterType(String value) { |
7981 this._parameterType = value; | 7984 this._parameterType = value; |
7982 } | 7985 } |
7983 | 7986 |
7984 CompletionSuggestion(CompletionSuggestionKind kind, int relevance, String comp
letion, int selectionOffset, int selectionLength, bool isDeprecated, bool isPote
ntial, {String docSummary, String docComplete, String declaringType, Element ele
ment, String returnType, List<String> parameterNames, List<String> parameterType
s, int requiredParameterCount, bool hasNamedParameters, String parameterName, St
ring parameterType}) { | 7987 /** |
| 7988 * The import to be added if the suggestion is out of scope and needs an |
| 7989 * import to be added to be in scope. |
| 7990 */ |
| 7991 String get importUri => _importUri; |
| 7992 |
| 7993 /** |
| 7994 * The import to be added if the suggestion is out of scope and needs an |
| 7995 * import to be added to be in scope. |
| 7996 */ |
| 7997 void set importUri(String value) { |
| 7998 this._importUri = value; |
| 7999 } |
| 8000 |
| 8001 CompletionSuggestion(CompletionSuggestionKind kind, int relevance, String comp
letion, int selectionOffset, int selectionLength, bool isDeprecated, bool isPote
ntial, {String docSummary, String docComplete, String declaringType, Element ele
ment, String returnType, List<String> parameterNames, List<String> parameterType
s, int requiredParameterCount, bool hasNamedParameters, String parameterName, St
ring parameterType, String importUri}) { |
7985 this.kind = kind; | 8002 this.kind = kind; |
7986 this.relevance = relevance; | 8003 this.relevance = relevance; |
7987 this.completion = completion; | 8004 this.completion = completion; |
7988 this.selectionOffset = selectionOffset; | 8005 this.selectionOffset = selectionOffset; |
7989 this.selectionLength = selectionLength; | 8006 this.selectionLength = selectionLength; |
7990 this.isDeprecated = isDeprecated; | 8007 this.isDeprecated = isDeprecated; |
7991 this.isPotential = isPotential; | 8008 this.isPotential = isPotential; |
7992 this.docSummary = docSummary; | 8009 this.docSummary = docSummary; |
7993 this.docComplete = docComplete; | 8010 this.docComplete = docComplete; |
7994 this.declaringType = declaringType; | 8011 this.declaringType = declaringType; |
7995 this.element = element; | 8012 this.element = element; |
7996 this.returnType = returnType; | 8013 this.returnType = returnType; |
7997 this.parameterNames = parameterNames; | 8014 this.parameterNames = parameterNames; |
7998 this.parameterTypes = parameterTypes; | 8015 this.parameterTypes = parameterTypes; |
7999 this.requiredParameterCount = requiredParameterCount; | 8016 this.requiredParameterCount = requiredParameterCount; |
8000 this.hasNamedParameters = hasNamedParameters; | 8017 this.hasNamedParameters = hasNamedParameters; |
8001 this.parameterName = parameterName; | 8018 this.parameterName = parameterName; |
8002 this.parameterType = parameterType; | 8019 this.parameterType = parameterType; |
| 8020 this.importUri = importUri; |
8003 } | 8021 } |
8004 | 8022 |
8005 factory CompletionSuggestion.fromJson(JsonDecoder jsonDecoder, String jsonPath
, Object json) { | 8023 factory CompletionSuggestion.fromJson(JsonDecoder jsonDecoder, String jsonPath
, Object json) { |
8006 if (json == null) { | 8024 if (json == null) { |
8007 json = {}; | 8025 json = {}; |
8008 } | 8026 } |
8009 if (json is Map) { | 8027 if (json is Map) { |
8010 CompletionSuggestionKind kind; | 8028 CompletionSuggestionKind kind; |
8011 if (json.containsKey("kind")) { | 8029 if (json.containsKey("kind")) { |
8012 kind = new CompletionSuggestionKind.fromJson(jsonDecoder, jsonPath + ".k
ind", json["kind"]); | 8030 kind = new CompletionSuggestionKind.fromJson(jsonDecoder, jsonPath + ".k
ind", json["kind"]); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8086 hasNamedParameters = jsonDecoder._decodeBool(jsonPath + ".hasNamedParame
ters", json["hasNamedParameters"]); | 8104 hasNamedParameters = jsonDecoder._decodeBool(jsonPath + ".hasNamedParame
ters", json["hasNamedParameters"]); |
8087 } | 8105 } |
8088 String parameterName; | 8106 String parameterName; |
8089 if (json.containsKey("parameterName")) { | 8107 if (json.containsKey("parameterName")) { |
8090 parameterName = jsonDecoder._decodeString(jsonPath + ".parameterName", j
son["parameterName"]); | 8108 parameterName = jsonDecoder._decodeString(jsonPath + ".parameterName", j
son["parameterName"]); |
8091 } | 8109 } |
8092 String parameterType; | 8110 String parameterType; |
8093 if (json.containsKey("parameterType")) { | 8111 if (json.containsKey("parameterType")) { |
8094 parameterType = jsonDecoder._decodeString(jsonPath + ".parameterType", j
son["parameterType"]); | 8112 parameterType = jsonDecoder._decodeString(jsonPath + ".parameterType", j
son["parameterType"]); |
8095 } | 8113 } |
8096 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); | 8114 String importUri; |
| 8115 if (json.containsKey("importUri")) { |
| 8116 importUri = jsonDecoder._decodeString(jsonPath + ".importUri", json["imp
ortUri"]); |
| 8117 } |
| 8118 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, importUri: importU
ri); |
8097 } else { | 8119 } else { |
8098 throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestion"); | 8120 throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestion"); |
8099 } | 8121 } |
8100 } | 8122 } |
8101 | 8123 |
8102 Map<String, dynamic> toJson() { | 8124 Map<String, dynamic> toJson() { |
8103 Map<String, dynamic> result = {}; | 8125 Map<String, dynamic> result = {}; |
8104 result["kind"] = kind.toJson(); | 8126 result["kind"] = kind.toJson(); |
8105 result["relevance"] = relevance; | 8127 result["relevance"] = relevance; |
8106 result["completion"] = completion; | 8128 result["completion"] = completion; |
(...skipping 27 matching lines...) Expand all Loading... |
8134 } | 8156 } |
8135 if (hasNamedParameters != null) { | 8157 if (hasNamedParameters != null) { |
8136 result["hasNamedParameters"] = hasNamedParameters; | 8158 result["hasNamedParameters"] = hasNamedParameters; |
8137 } | 8159 } |
8138 if (parameterName != null) { | 8160 if (parameterName != null) { |
8139 result["parameterName"] = parameterName; | 8161 result["parameterName"] = parameterName; |
8140 } | 8162 } |
8141 if (parameterType != null) { | 8163 if (parameterType != null) { |
8142 result["parameterType"] = parameterType; | 8164 result["parameterType"] = parameterType; |
8143 } | 8165 } |
| 8166 if (importUri != null) { |
| 8167 result["importUri"] = importUri; |
| 8168 } |
8144 return result; | 8169 return result; |
8145 } | 8170 } |
8146 | 8171 |
8147 @override | 8172 @override |
8148 String toString() => JSON.encode(toJson()); | 8173 String toString() => JSON.encode(toJson()); |
8149 | 8174 |
8150 @override | 8175 @override |
8151 bool operator==(other) { | 8176 bool operator==(other) { |
8152 if (other is CompletionSuggestion) { | 8177 if (other is CompletionSuggestion) { |
8153 return kind == other.kind && | 8178 return kind == other.kind && |
8154 relevance == other.relevance && | 8179 relevance == other.relevance && |
8155 completion == other.completion && | 8180 completion == other.completion && |
8156 selectionOffset == other.selectionOffset && | 8181 selectionOffset == other.selectionOffset && |
8157 selectionLength == other.selectionLength && | 8182 selectionLength == other.selectionLength && |
8158 isDeprecated == other.isDeprecated && | 8183 isDeprecated == other.isDeprecated && |
8159 isPotential == other.isPotential && | 8184 isPotential == other.isPotential && |
8160 docSummary == other.docSummary && | 8185 docSummary == other.docSummary && |
8161 docComplete == other.docComplete && | 8186 docComplete == other.docComplete && |
8162 declaringType == other.declaringType && | 8187 declaringType == other.declaringType && |
8163 element == other.element && | 8188 element == other.element && |
8164 returnType == other.returnType && | 8189 returnType == other.returnType && |
8165 _listEqual(parameterNames, other.parameterNames, (String a, String b)
=> a == b) && | 8190 _listEqual(parameterNames, other.parameterNames, (String a, String b)
=> a == b) && |
8166 _listEqual(parameterTypes, other.parameterTypes, (String a, String b)
=> a == b) && | 8191 _listEqual(parameterTypes, other.parameterTypes, (String a, String b)
=> a == b) && |
8167 requiredParameterCount == other.requiredParameterCount && | 8192 requiredParameterCount == other.requiredParameterCount && |
8168 hasNamedParameters == other.hasNamedParameters && | 8193 hasNamedParameters == other.hasNamedParameters && |
8169 parameterName == other.parameterName && | 8194 parameterName == other.parameterName && |
8170 parameterType == other.parameterType; | 8195 parameterType == other.parameterType && |
| 8196 importUri == other.importUri; |
8171 } | 8197 } |
8172 return false; | 8198 return false; |
8173 } | 8199 } |
8174 | 8200 |
8175 @override | 8201 @override |
8176 int get hashCode { | 8202 int get hashCode { |
8177 int hash = 0; | 8203 int hash = 0; |
8178 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); | 8204 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); |
8179 hash = _JenkinsSmiHash.combine(hash, relevance.hashCode); | 8205 hash = _JenkinsSmiHash.combine(hash, relevance.hashCode); |
8180 hash = _JenkinsSmiHash.combine(hash, completion.hashCode); | 8206 hash = _JenkinsSmiHash.combine(hash, completion.hashCode); |
8181 hash = _JenkinsSmiHash.combine(hash, selectionOffset.hashCode); | 8207 hash = _JenkinsSmiHash.combine(hash, selectionOffset.hashCode); |
8182 hash = _JenkinsSmiHash.combine(hash, selectionLength.hashCode); | 8208 hash = _JenkinsSmiHash.combine(hash, selectionLength.hashCode); |
8183 hash = _JenkinsSmiHash.combine(hash, isDeprecated.hashCode); | 8209 hash = _JenkinsSmiHash.combine(hash, isDeprecated.hashCode); |
8184 hash = _JenkinsSmiHash.combine(hash, isPotential.hashCode); | 8210 hash = _JenkinsSmiHash.combine(hash, isPotential.hashCode); |
8185 hash = _JenkinsSmiHash.combine(hash, docSummary.hashCode); | 8211 hash = _JenkinsSmiHash.combine(hash, docSummary.hashCode); |
8186 hash = _JenkinsSmiHash.combine(hash, docComplete.hashCode); | 8212 hash = _JenkinsSmiHash.combine(hash, docComplete.hashCode); |
8187 hash = _JenkinsSmiHash.combine(hash, declaringType.hashCode); | 8213 hash = _JenkinsSmiHash.combine(hash, declaringType.hashCode); |
8188 hash = _JenkinsSmiHash.combine(hash, element.hashCode); | 8214 hash = _JenkinsSmiHash.combine(hash, element.hashCode); |
8189 hash = _JenkinsSmiHash.combine(hash, returnType.hashCode); | 8215 hash = _JenkinsSmiHash.combine(hash, returnType.hashCode); |
8190 hash = _JenkinsSmiHash.combine(hash, parameterNames.hashCode); | 8216 hash = _JenkinsSmiHash.combine(hash, parameterNames.hashCode); |
8191 hash = _JenkinsSmiHash.combine(hash, parameterTypes.hashCode); | 8217 hash = _JenkinsSmiHash.combine(hash, parameterTypes.hashCode); |
8192 hash = _JenkinsSmiHash.combine(hash, requiredParameterCount.hashCode); | 8218 hash = _JenkinsSmiHash.combine(hash, requiredParameterCount.hashCode); |
8193 hash = _JenkinsSmiHash.combine(hash, hasNamedParameters.hashCode); | 8219 hash = _JenkinsSmiHash.combine(hash, hasNamedParameters.hashCode); |
8194 hash = _JenkinsSmiHash.combine(hash, parameterName.hashCode); | 8220 hash = _JenkinsSmiHash.combine(hash, parameterName.hashCode); |
8195 hash = _JenkinsSmiHash.combine(hash, parameterType.hashCode); | 8221 hash = _JenkinsSmiHash.combine(hash, parameterType.hashCode); |
| 8222 hash = _JenkinsSmiHash.combine(hash, importUri.hashCode); |
8196 return _JenkinsSmiHash.finish(hash); | 8223 return _JenkinsSmiHash.finish(hash); |
8197 } | 8224 } |
8198 } | 8225 } |
8199 | 8226 |
8200 /** | 8227 /** |
8201 * CompletionSuggestionKind | 8228 * CompletionSuggestionKind |
8202 * | 8229 * |
8203 * enum { | 8230 * enum { |
8204 * ARGUMENT_LIST | 8231 * ARGUMENT_LIST |
8205 * IMPORT | 8232 * IMPORT |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8237 * identifier. | 8264 * identifier. |
8238 */ | 8265 */ |
8239 static const INVOCATION = const CompletionSuggestionKind._("INVOCATION"); | 8266 static const INVOCATION = const CompletionSuggestionKind._("INVOCATION"); |
8240 | 8267 |
8241 /** | 8268 /** |
8242 * A keyword is being suggested. For suggestions of this kind, the completion | 8269 * A keyword is being suggested. For suggestions of this kind, the completion |
8243 * is the keyword. | 8270 * is the keyword. |
8244 */ | 8271 */ |
8245 static const KEYWORD = const CompletionSuggestionKind._("KEYWORD"); | 8272 static const KEYWORD = const CompletionSuggestionKind._("KEYWORD"); |
8246 | 8273 |
| 8274 /** |
| 8275 * A named argument for the current callsite is being suggested. For |
| 8276 * suggestions of this kind, the completion is the named argument identifier |
| 8277 * including a trailing ':' and space. |
| 8278 */ |
8247 static const NAMED_ARGUMENT = const CompletionSuggestionKind._("NAMED_ARGUMENT
"); | 8279 static const NAMED_ARGUMENT = const CompletionSuggestionKind._("NAMED_ARGUMENT
"); |
8248 | 8280 |
8249 static const OPTIONAL_ARGUMENT = const CompletionSuggestionKind._("OPTIONAL_AR
GUMENT"); | 8281 static const OPTIONAL_ARGUMENT = const CompletionSuggestionKind._("OPTIONAL_AR
GUMENT"); |
8250 | 8282 |
8251 static const PARAMETER = const CompletionSuggestionKind._("PARAMETER"); | 8283 static const PARAMETER = const CompletionSuggestionKind._("PARAMETER"); |
8252 | 8284 |
8253 /** | 8285 /** |
8254 * A list containing all of the enum values that are defined. | 8286 * A list containing all of the enum values that are defined. |
8255 */ | 8287 */ |
8256 static const List<CompletionSuggestionKind> VALUES = const <CompletionSuggesti
onKind>[ARGUMENT_LIST, IMPORT, IDENTIFIER, INVOCATION, KEYWORD, NAMED_ARGUMENT,
OPTIONAL_ARGUMENT, PARAMETER]; | 8288 static const List<CompletionSuggestionKind> VALUES = const <CompletionSuggesti
onKind>[ARGUMENT_LIST, IMPORT, IDENTIFIER, INVOCATION, KEYWORD, NAMED_ARGUMENT,
OPTIONAL_ARGUMENT, PARAMETER]; |
(...skipping 6480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14737 return false; | 14769 return false; |
14738 } | 14770 } |
14739 | 14771 |
14740 @override | 14772 @override |
14741 int get hashCode { | 14773 int get hashCode { |
14742 int hash = 0; | 14774 int hash = 0; |
14743 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); | 14775 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); |
14744 return _JenkinsSmiHash.finish(hash); | 14776 return _JenkinsSmiHash.finish(hash); |
14745 } | 14777 } |
14746 } | 14778 } |
OLD | NEW |