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 3140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3151 hash = _JenkinsSmiHash.combine(hash, occurrences.hashCode); | 3151 hash = _JenkinsSmiHash.combine(hash, occurrences.hashCode); |
3152 return _JenkinsSmiHash.finish(hash); | 3152 return _JenkinsSmiHash.finish(hash); |
3153 } | 3153 } |
3154 } | 3154 } |
3155 | 3155 |
3156 /** | 3156 /** |
3157 * analysis.outline params | 3157 * analysis.outline params |
3158 * | 3158 * |
3159 * { | 3159 * { |
3160 * "file": FilePath | 3160 * "file": FilePath |
| 3161 * "kind": FileKind |
| 3162 * "libraryName": optional String |
3161 * "outline": Outline | 3163 * "outline": Outline |
3162 * } | 3164 * } |
3163 */ | 3165 */ |
3164 class AnalysisOutlineParams implements HasToJson { | 3166 class AnalysisOutlineParams implements HasToJson { |
3165 String _file; | 3167 String _file; |
3166 | 3168 |
| 3169 FileKind _kind; |
| 3170 |
| 3171 String _libraryName; |
| 3172 |
3167 Outline _outline; | 3173 Outline _outline; |
3168 | 3174 |
3169 /** | 3175 /** |
3170 * The file with which the outline is associated. | 3176 * The file with which the outline is associated. |
3171 */ | 3177 */ |
3172 String get file => _file; | 3178 String get file => _file; |
3173 | 3179 |
3174 /** | 3180 /** |
3175 * The file with which the outline is associated. | 3181 * The file with which the outline is associated. |
3176 */ | 3182 */ |
3177 void set file(String value) { | 3183 void set file(String value) { |
3178 assert(value != null); | 3184 assert(value != null); |
3179 this._file = value; | 3185 this._file = value; |
3180 } | 3186 } |
3181 | 3187 |
3182 /** | 3188 /** |
| 3189 * The kind of the file. |
| 3190 */ |
| 3191 FileKind get kind => _kind; |
| 3192 |
| 3193 /** |
| 3194 * The kind of the file. |
| 3195 */ |
| 3196 void set kind(FileKind value) { |
| 3197 assert(value != null); |
| 3198 this._kind = value; |
| 3199 } |
| 3200 |
| 3201 /** |
| 3202 * The name of the library defined by the file using a 'library' directive, |
| 3203 * or referenced by a 'part of' directive. This field will be omitted if the |
| 3204 * file has neither 'library' nor 'part of' directives. |
| 3205 */ |
| 3206 String get libraryName => _libraryName; |
| 3207 |
| 3208 /** |
| 3209 * The name of the library defined by the file using a 'library' directive, |
| 3210 * or referenced by a 'part of' directive. This field will be omitted if the |
| 3211 * file has neither 'library' nor 'part of' directives. |
| 3212 */ |
| 3213 void set libraryName(String value) { |
| 3214 this._libraryName = value; |
| 3215 } |
| 3216 |
| 3217 /** |
3183 * The outline associated with the file. | 3218 * The outline associated with the file. |
3184 */ | 3219 */ |
3185 Outline get outline => _outline; | 3220 Outline get outline => _outline; |
3186 | 3221 |
3187 /** | 3222 /** |
3188 * The outline associated with the file. | 3223 * The outline associated with the file. |
3189 */ | 3224 */ |
3190 void set outline(Outline value) { | 3225 void set outline(Outline value) { |
3191 assert(value != null); | 3226 assert(value != null); |
3192 this._outline = value; | 3227 this._outline = value; |
3193 } | 3228 } |
3194 | 3229 |
3195 AnalysisOutlineParams(String file, Outline outline) { | 3230 AnalysisOutlineParams(String file, FileKind kind, Outline outline, {String lib
raryName}) { |
3196 this.file = file; | 3231 this.file = file; |
| 3232 this.kind = kind; |
| 3233 this.libraryName = libraryName; |
3197 this.outline = outline; | 3234 this.outline = outline; |
3198 } | 3235 } |
3199 | 3236 |
3200 factory AnalysisOutlineParams.fromJson(JsonDecoder jsonDecoder, String jsonPat
h, Object json) { | 3237 factory AnalysisOutlineParams.fromJson(JsonDecoder jsonDecoder, String jsonPat
h, Object json) { |
3201 if (json == null) { | 3238 if (json == null) { |
3202 json = {}; | 3239 json = {}; |
3203 } | 3240 } |
3204 if (json is Map) { | 3241 if (json is Map) { |
3205 String file; | 3242 String file; |
3206 if (json.containsKey("file")) { | 3243 if (json.containsKey("file")) { |
3207 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); | 3244 file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]); |
3208 } else { | 3245 } else { |
3209 throw jsonDecoder.missingKey(jsonPath, "file"); | 3246 throw jsonDecoder.missingKey(jsonPath, "file"); |
3210 } | 3247 } |
| 3248 FileKind kind; |
| 3249 if (json.containsKey("kind")) { |
| 3250 kind = new FileKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind
"]); |
| 3251 } else { |
| 3252 throw jsonDecoder.missingKey(jsonPath, "kind"); |
| 3253 } |
| 3254 String libraryName; |
| 3255 if (json.containsKey("libraryName")) { |
| 3256 libraryName = jsonDecoder._decodeString(jsonPath + ".libraryName", json[
"libraryName"]); |
| 3257 } |
3211 Outline outline; | 3258 Outline outline; |
3212 if (json.containsKey("outline")) { | 3259 if (json.containsKey("outline")) { |
3213 outline = new Outline.fromJson(jsonDecoder, jsonPath + ".outline", json[
"outline"]); | 3260 outline = new Outline.fromJson(jsonDecoder, jsonPath + ".outline", json[
"outline"]); |
3214 } else { | 3261 } else { |
3215 throw jsonDecoder.missingKey(jsonPath, "outline"); | 3262 throw jsonDecoder.missingKey(jsonPath, "outline"); |
3216 } | 3263 } |
3217 return new AnalysisOutlineParams(file, outline); | 3264 return new AnalysisOutlineParams(file, kind, outline, libraryName: library
Name); |
3218 } else { | 3265 } else { |
3219 throw jsonDecoder.mismatch(jsonPath, "analysis.outline params", json); | 3266 throw jsonDecoder.mismatch(jsonPath, "analysis.outline params", json); |
3220 } | 3267 } |
3221 } | 3268 } |
3222 | 3269 |
3223 factory AnalysisOutlineParams.fromNotification(Notification notification) { | 3270 factory AnalysisOutlineParams.fromNotification(Notification notification) { |
3224 return new AnalysisOutlineParams.fromJson( | 3271 return new AnalysisOutlineParams.fromJson( |
3225 new ResponseDecoder(null), "params", notification._params); | 3272 new ResponseDecoder(null), "params", notification._params); |
3226 } | 3273 } |
3227 | 3274 |
3228 Map<String, dynamic> toJson() { | 3275 Map<String, dynamic> toJson() { |
3229 Map<String, dynamic> result = {}; | 3276 Map<String, dynamic> result = {}; |
3230 result["file"] = file; | 3277 result["file"] = file; |
| 3278 result["kind"] = kind.toJson(); |
| 3279 if (libraryName != null) { |
| 3280 result["libraryName"] = libraryName; |
| 3281 } |
3231 result["outline"] = outline.toJson(); | 3282 result["outline"] = outline.toJson(); |
3232 return result; | 3283 return result; |
3233 } | 3284 } |
3234 | 3285 |
3235 Notification toNotification() { | 3286 Notification toNotification() { |
3236 return new Notification("analysis.outline", toJson()); | 3287 return new Notification("analysis.outline", toJson()); |
3237 } | 3288 } |
3238 | 3289 |
3239 @override | 3290 @override |
3240 String toString() => JSON.encode(toJson()); | 3291 String toString() => JSON.encode(toJson()); |
3241 | 3292 |
3242 @override | 3293 @override |
3243 bool operator==(other) { | 3294 bool operator==(other) { |
3244 if (other is AnalysisOutlineParams) { | 3295 if (other is AnalysisOutlineParams) { |
3245 return file == other.file && | 3296 return file == other.file && |
| 3297 kind == other.kind && |
| 3298 libraryName == other.libraryName && |
3246 outline == other.outline; | 3299 outline == other.outline; |
3247 } | 3300 } |
3248 return false; | 3301 return false; |
3249 } | 3302 } |
3250 | 3303 |
3251 @override | 3304 @override |
3252 int get hashCode { | 3305 int get hashCode { |
3253 int hash = 0; | 3306 int hash = 0; |
3254 hash = _JenkinsSmiHash.combine(hash, file.hashCode); | 3307 hash = _JenkinsSmiHash.combine(hash, file.hashCode); |
| 3308 hash = _JenkinsSmiHash.combine(hash, kind.hashCode); |
| 3309 hash = _JenkinsSmiHash.combine(hash, libraryName.hashCode); |
3255 hash = _JenkinsSmiHash.combine(hash, outline.hashCode); | 3310 hash = _JenkinsSmiHash.combine(hash, outline.hashCode); |
3256 return _JenkinsSmiHash.finish(hash); | 3311 return _JenkinsSmiHash.finish(hash); |
3257 } | 3312 } |
3258 } | 3313 } |
3259 | 3314 |
3260 /** | 3315 /** |
3261 * analysis.overrides params | 3316 * analysis.overrides params |
3262 * | 3317 * |
3263 * { | 3318 * { |
3264 * "file": FilePath | 3319 * "file": FilePath |
(...skipping 6239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9504 throw jsonDecoder.mismatch(jsonPath, "ExecutionService", json); | 9559 throw jsonDecoder.mismatch(jsonPath, "ExecutionService", json); |
9505 } | 9560 } |
9506 | 9561 |
9507 @override | 9562 @override |
9508 String toString() => "ExecutionService.$name"; | 9563 String toString() => "ExecutionService.$name"; |
9509 | 9564 |
9510 String toJson() => name; | 9565 String toJson() => name; |
9511 } | 9566 } |
9512 | 9567 |
9513 /** | 9568 /** |
| 9569 * FileKind |
| 9570 * |
| 9571 * enum { |
| 9572 * LIBRARY |
| 9573 * PART |
| 9574 * } |
| 9575 */ |
| 9576 class FileKind implements Enum { |
| 9577 static const LIBRARY = const FileKind._("LIBRARY"); |
| 9578 |
| 9579 static const PART = const FileKind._("PART"); |
| 9580 |
| 9581 /** |
| 9582 * A list containing all of the enum values that are defined. |
| 9583 */ |
| 9584 static const List<FileKind> VALUES = const <FileKind>[LIBRARY, PART]; |
| 9585 |
| 9586 final String name; |
| 9587 |
| 9588 const FileKind._(this.name); |
| 9589 |
| 9590 factory FileKind(String name) { |
| 9591 switch (name) { |
| 9592 case "LIBRARY": |
| 9593 return LIBRARY; |
| 9594 case "PART": |
| 9595 return PART; |
| 9596 } |
| 9597 throw new Exception('Illegal enum value: $name'); |
| 9598 } |
| 9599 |
| 9600 factory FileKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object jso
n) { |
| 9601 if (json is String) { |
| 9602 try { |
| 9603 return new FileKind(json); |
| 9604 } catch(_) { |
| 9605 // Fall through |
| 9606 } |
| 9607 } |
| 9608 throw jsonDecoder.mismatch(jsonPath, "FileKind", json); |
| 9609 } |
| 9610 |
| 9611 @override |
| 9612 String toString() => "FileKind.$name"; |
| 9613 |
| 9614 String toJson() => name; |
| 9615 } |
| 9616 |
| 9617 /** |
9514 * FoldingKind | 9618 * FoldingKind |
9515 * | 9619 * |
9516 * enum { | 9620 * enum { |
9517 * COMMENT | 9621 * COMMENT |
9518 * CLASS_MEMBER | 9622 * CLASS_MEMBER |
9519 * DIRECTIVES | 9623 * DIRECTIVES |
9520 * DOCUMENTATION_COMMENT | 9624 * DOCUMENTATION_COMMENT |
9521 * TOP_LEVEL_DECLARATION | 9625 * TOP_LEVEL_DECLARATION |
9522 * } | 9626 * } |
9523 */ | 9627 */ |
(...skipping 6393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15917 return false; | 16021 return false; |
15918 } | 16022 } |
15919 | 16023 |
15920 @override | 16024 @override |
15921 int get hashCode { | 16025 int get hashCode { |
15922 int hash = 0; | 16026 int hash = 0; |
15923 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); | 16027 hash = _JenkinsSmiHash.combine(hash, newName.hashCode); |
15924 return _JenkinsSmiHash.finish(hash); | 16028 return _JenkinsSmiHash.finish(hash); |
15925 } | 16029 } |
15926 } | 16030 } |
OLD | NEW |