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

Side by Side Diff: pkg/analyzer_plugin/lib/protocol/protocol_common.dart

Issue 2994103002: Add kythe support to plugins and format the spec files (Closed)
Patch Set: Created 3 years, 4 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
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 import 'dart:convert' hide JsonDecoder; 9 import 'dart:convert' hide JsonDecoder;
10 10
(...skipping 2918 matching lines...) Expand 10 before | Expand all | Expand 10 after
2929 throw jsonDecoder.mismatch(jsonPath, "HighlightRegionType", json); 2929 throw jsonDecoder.mismatch(jsonPath, "HighlightRegionType", json);
2930 } 2930 }
2931 2931
2932 @override 2932 @override
2933 String toString() => "HighlightRegionType.$name"; 2933 String toString() => "HighlightRegionType.$name";
2934 2934
2935 String toJson() => name; 2935 String toJson() => name;
2936 } 2936 }
2937 2937
2938 /** 2938 /**
2939 * KytheEntry
2940 *
2941 * {
2942 * "source": KytheVName
2943 * "kind": String
2944 * "target": KytheVName
2945 * "fact": String
2946 * "value": List<int>
2947 * }
2948 *
2949 * Clients may not extend, implement or mix-in this class.
2950 */
2951 class KytheEntry implements HasToJson {
2952 KytheVName _source;
2953
2954 String _kind;
2955
2956 KytheVName _target;
2957
2958 String _fact;
2959
2960 List<int> _value;
2961
2962 /**
2963 * The ticket of the source node (must not be empty).
2964 */
2965 KytheVName get source => _source;
2966
2967 /**
2968 * The ticket of the source node (must not be empty).
2969 */
2970 void set source(KytheVName value) {
2971 assert(value != null);
2972 this._source = value;
2973 }
2974
2975 /**
2976 * An edge label (may be empty). The schema defines which labels are
2977 * meaningful.
2978 */
2979 String get kind => _kind;
2980
2981 /**
2982 * An edge label (may be empty). The schema defines which labels are
2983 * meaningful.
2984 */
2985 void set kind(String value) {
2986 assert(value != null);
2987 this._kind = value;
2988 }
2989
2990 /**
2991 * The ticket of the target node (may be empty).
2992 */
2993 KytheVName get target => _target;
2994
2995 /**
2996 * The ticket of the target node (may be empty).
2997 */
2998 void set target(KytheVName value) {
2999 assert(value != null);
3000 this._target = value;
3001 }
3002
3003 /**
3004 * A fact label (must not be empty). The schema defines which fact labels are
3005 * meaningful.
3006 */
3007 String get fact => _fact;
3008
3009 /**
3010 * A fact label (must not be empty). The schema defines which fact labels are
3011 * meaningful.
3012 */
3013 void set fact(String value) {
3014 assert(value != null);
3015 this._fact = value;
3016 }
3017
3018 /**
3019 * The String value of the fact (may be empty).
3020 */
3021 List<int> get value => _value;
3022
3023 /**
3024 * The String value of the fact (may be empty).
3025 */
3026 void set value(List<int> value) {
3027 assert(value != null);
3028 this._value = value;
3029 }
3030
3031 KytheEntry(KytheVName source, String kind, KytheVName target, String fact,
3032 List<int> value) {
3033 this.source = source;
3034 this.kind = kind;
3035 this.target = target;
3036 this.fact = fact;
3037 this.value = value;
3038 }
3039
3040 factory KytheEntry.fromJson(
3041 JsonDecoder jsonDecoder, String jsonPath, Object json) {
3042 if (json == null) {
3043 json = {};
3044 }
3045 if (json is Map) {
3046 KytheVName source;
3047 if (json.containsKey("source")) {
3048 source = new KytheVName.fromJson(
3049 jsonDecoder, jsonPath + ".source", json["source"]);
3050 } else {
3051 throw jsonDecoder.mismatch(jsonPath, "source");
3052 }
3053 String kind;
3054 if (json.containsKey("kind")) {
3055 kind = jsonDecoder.decodeString(jsonPath + ".kind", json["kind"]);
3056 } else {
3057 throw jsonDecoder.mismatch(jsonPath, "kind");
3058 }
3059 KytheVName target;
3060 if (json.containsKey("target")) {
3061 target = new KytheVName.fromJson(
3062 jsonDecoder, jsonPath + ".target", json["target"]);
3063 } else {
3064 throw jsonDecoder.mismatch(jsonPath, "target");
3065 }
3066 String fact;
3067 if (json.containsKey("fact")) {
3068 fact = jsonDecoder.decodeString(jsonPath + ".fact", json["fact"]);
3069 } else {
3070 throw jsonDecoder.mismatch(jsonPath, "fact");
3071 }
3072 List<int> value;
3073 if (json.containsKey("value")) {
3074 value = jsonDecoder.decodeList(
3075 jsonPath + ".value", json["value"], jsonDecoder.decodeInt);
3076 } else {
3077 throw jsonDecoder.mismatch(jsonPath, "value");
3078 }
3079 return new KytheEntry(source, kind, target, fact, value);
3080 } else {
3081 throw jsonDecoder.mismatch(jsonPath, "KytheEntry", json);
3082 }
3083 }
3084
3085 @override
3086 Map<String, dynamic> toJson() {
3087 Map<String, dynamic> result = {};
3088 result["source"] = source.toJson();
3089 result["kind"] = kind;
3090 result["target"] = target.toJson();
3091 result["fact"] = fact;
3092 result["value"] = value;
3093 return result;
3094 }
3095
3096 @override
3097 String toString() => JSON.encode(toJson());
3098
3099 @override
3100 bool operator ==(other) {
3101 if (other is KytheEntry) {
3102 return source == other.source &&
3103 kind == other.kind &&
3104 target == other.target &&
3105 fact == other.fact &&
3106 listEqual(value, other.value, (int a, int b) => a == b);
3107 }
3108 return false;
3109 }
3110
3111 @override
3112 int get hashCode {
3113 int hash = 0;
3114 hash = JenkinsSmiHash.combine(hash, source.hashCode);
3115 hash = JenkinsSmiHash.combine(hash, kind.hashCode);
3116 hash = JenkinsSmiHash.combine(hash, target.hashCode);
3117 hash = JenkinsSmiHash.combine(hash, fact.hashCode);
3118 hash = JenkinsSmiHash.combine(hash, value.hashCode);
3119 return JenkinsSmiHash.finish(hash);
3120 }
3121 }
3122
3123 /**
3124 * KytheVName
3125 *
3126 * {
3127 * "signature": String
3128 * "corpus": String
3129 * "root": String
3130 * "path": String
3131 * "language": String
3132 * }
3133 *
3134 * Clients may not extend, implement or mix-in this class.
3135 */
3136 class KytheVName implements HasToJson {
3137 String _signature;
3138
3139 String _corpus;
3140
3141 String _root;
3142
3143 String _path;
3144
3145 String _language;
3146
3147 /**
3148 * An opaque signature generated by the analyzer.
3149 */
3150 String get signature => _signature;
3151
3152 /**
3153 * An opaque signature generated by the analyzer.
3154 */
3155 void set signature(String value) {
3156 assert(value != null);
3157 this._signature = value;
3158 }
3159
3160 /**
3161 * The corpus of source code this KytheVName belongs to. Loosely, a corpus is
3162 * a collection of related files, such as the contents of a given source
3163 * repository.
3164 */
3165 String get corpus => _corpus;
3166
3167 /**
3168 * The corpus of source code this KytheVName belongs to. Loosely, a corpus is
3169 * a collection of related files, such as the contents of a given source
3170 * repository.
3171 */
3172 void set corpus(String value) {
3173 assert(value != null);
3174 this._corpus = value;
3175 }
3176
3177 /**
3178 * A corpus-specific root label, typically a directory path or project
3179 * identifier, denoting a distinct subset of the corpus. This may also be
3180 * used to designate virtual collections like generated files.
3181 */
3182 String get root => _root;
3183
3184 /**
3185 * A corpus-specific root label, typically a directory path or project
3186 * identifier, denoting a distinct subset of the corpus. This may also be
3187 * used to designate virtual collections like generated files.
3188 */
3189 void set root(String value) {
3190 assert(value != null);
3191 this._root = value;
3192 }
3193
3194 /**
3195 * A path-structured label describing the “location” of the named object
3196 * relative to the corpus and the root.
3197 */
3198 String get path => _path;
3199
3200 /**
3201 * A path-structured label describing the “location” of the named object
3202 * relative to the corpus and the root.
3203 */
3204 void set path(String value) {
3205 assert(value != null);
3206 this._path = value;
3207 }
3208
3209 /**
3210 * The language this name belongs to.
3211 */
3212 String get language => _language;
3213
3214 /**
3215 * The language this name belongs to.
3216 */
3217 void set language(String value) {
3218 assert(value != null);
3219 this._language = value;
3220 }
3221
3222 KytheVName(String signature, String corpus, String root, String path,
3223 String language) {
3224 this.signature = signature;
3225 this.corpus = corpus;
3226 this.root = root;
3227 this.path = path;
3228 this.language = language;
3229 }
3230
3231 factory KytheVName.fromJson(
3232 JsonDecoder jsonDecoder, String jsonPath, Object json) {
3233 if (json == null) {
3234 json = {};
3235 }
3236 if (json is Map) {
3237 String signature;
3238 if (json.containsKey("signature")) {
3239 signature = jsonDecoder.decodeString(
3240 jsonPath + ".signature", json["signature"]);
3241 } else {
3242 throw jsonDecoder.mismatch(jsonPath, "signature");
3243 }
3244 String corpus;
3245 if (json.containsKey("corpus")) {
3246 corpus = jsonDecoder.decodeString(jsonPath + ".corpus", json["corpus"]);
3247 } else {
3248 throw jsonDecoder.mismatch(jsonPath, "corpus");
3249 }
3250 String root;
3251 if (json.containsKey("root")) {
3252 root = jsonDecoder.decodeString(jsonPath + ".root", json["root"]);
3253 } else {
3254 throw jsonDecoder.mismatch(jsonPath, "root");
3255 }
3256 String path;
3257 if (json.containsKey("path")) {
3258 path = jsonDecoder.decodeString(jsonPath + ".path", json["path"]);
3259 } else {
3260 throw jsonDecoder.mismatch(jsonPath, "path");
3261 }
3262 String language;
3263 if (json.containsKey("language")) {
3264 language =
3265 jsonDecoder.decodeString(jsonPath + ".language", json["language"]);
3266 } else {
3267 throw jsonDecoder.mismatch(jsonPath, "language");
3268 }
3269 return new KytheVName(signature, corpus, root, path, language);
3270 } else {
3271 throw jsonDecoder.mismatch(jsonPath, "KytheVName", json);
3272 }
3273 }
3274
3275 @override
3276 Map<String, dynamic> toJson() {
3277 Map<String, dynamic> result = {};
3278 result["signature"] = signature;
3279 result["corpus"] = corpus;
3280 result["root"] = root;
3281 result["path"] = path;
3282 result["language"] = language;
3283 return result;
3284 }
3285
3286 @override
3287 String toString() => JSON.encode(toJson());
3288
3289 @override
3290 bool operator ==(other) {
3291 if (other is KytheVName) {
3292 return signature == other.signature &&
3293 corpus == other.corpus &&
3294 root == other.root &&
3295 path == other.path &&
3296 language == other.language;
3297 }
3298 return false;
3299 }
3300
3301 @override
3302 int get hashCode {
3303 int hash = 0;
3304 hash = JenkinsSmiHash.combine(hash, signature.hashCode);
3305 hash = JenkinsSmiHash.combine(hash, corpus.hashCode);
3306 hash = JenkinsSmiHash.combine(hash, root.hashCode);
3307 hash = JenkinsSmiHash.combine(hash, path.hashCode);
3308 hash = JenkinsSmiHash.combine(hash, language.hashCode);
3309 return JenkinsSmiHash.finish(hash);
3310 }
3311 }
3312
3313 /**
2939 * LinkedEditGroup 3314 * LinkedEditGroup
2940 * 3315 *
2941 * { 3316 * {
2942 * "positions": List<Position> 3317 * "positions": List<Position>
2943 * "length": int 3318 * "length": int
2944 * "suggestions": List<LinkedEditSuggestion> 3319 * "suggestions": List<LinkedEditSuggestion>
2945 * } 3320 * }
2946 * 3321 *
2947 * Clients may not extend, implement or mix-in this class. 3322 * Clients may not extend, implement or mix-in this class.
2948 */ 3323 */
(...skipping 2405 matching lines...) Expand 10 before | Expand all | Expand 10 after
5354 5729
5355 @override 5730 @override
5356 int get hashCode { 5731 int get hashCode {
5357 int hash = 0; 5732 int hash = 0;
5358 hash = JenkinsSmiHash.combine(hash, file.hashCode); 5733 hash = JenkinsSmiHash.combine(hash, file.hashCode);
5359 hash = JenkinsSmiHash.combine(hash, fileStamp.hashCode); 5734 hash = JenkinsSmiHash.combine(hash, fileStamp.hashCode);
5360 hash = JenkinsSmiHash.combine(hash, edits.hashCode); 5735 hash = JenkinsSmiHash.combine(hash, edits.hashCode);
5361 return JenkinsSmiHash.finish(hash); 5736 return JenkinsSmiHash.finish(hash);
5362 } 5737 }
5363 } 5738 }
OLDNEW
« no previous file with comments | « pkg/analyzer_plugin/doc/api.html ('k') | pkg/analyzer_plugin/lib/protocol/protocol_constants.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698