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

Side by Side Diff: pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart

Issue 2088663004: Adds PID to `server.connected` notification (#26744). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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) 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 analysis_server.plugin.protocol.protocol; 9 part of analysis_server.plugin.protocol.protocol;
10 10
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 int get hashCode { 259 int get hashCode {
260 return 748820900; 260 return 748820900;
261 } 261 }
262 } 262 }
263 263
264 /** 264 /**
265 * server.connected params 265 * server.connected params
266 * 266 *
267 * { 267 * {
268 * "version": String 268 * "version": String
269 * "pid": String
269 * } 270 * }
270 * 271 *
271 * Clients may not extend, implement or mix-in this class. 272 * Clients may not extend, implement or mix-in this class.
272 */ 273 */
273 class ServerConnectedParams implements HasToJson { 274 class ServerConnectedParams implements HasToJson {
274 String _version; 275 String _version;
275 276
277 String _pid;
278
276 /** 279 /**
277 * The version number of the analysis server. 280 * The version number of the analysis server.
278 */ 281 */
279 String get version => _version; 282 String get version => _version;
280 283
281 /** 284 /**
282 * The version number of the analysis server. 285 * The version number of the analysis server.
283 */ 286 */
284 void set version(String value) { 287 void set version(String value) {
285 assert(value != null); 288 assert(value != null);
286 this._version = value; 289 this._version = value;
287 } 290 }
288 291
289 ServerConnectedParams(String version) { 292 /**
293 * The process id of the analysis server process.
294 */
295 String get pid => _pid;
296
297 /**
298 * The process id of the analysis server process.
299 */
300 void set pid(String value) {
301 assert(value != null);
302 this._pid = value;
303 }
304
305 ServerConnectedParams(String version, String pid) {
290 this.version = version; 306 this.version = version;
307 this.pid = pid;
291 } 308 }
292 309
293 factory ServerConnectedParams.fromJson(JsonDecoder jsonDecoder, String jsonPat h, Object json) { 310 factory ServerConnectedParams.fromJson(JsonDecoder jsonDecoder, String jsonPat h, Object json) {
294 if (json == null) { 311 if (json == null) {
295 json = {}; 312 json = {};
296 } 313 }
297 if (json is Map) { 314 if (json is Map) {
298 String version; 315 String version;
299 if (json.containsKey("version")) { 316 if (json.containsKey("version")) {
300 version = jsonDecoder.decodeString(jsonPath + ".version", json["version" ]); 317 version = jsonDecoder.decodeString(jsonPath + ".version", json["version" ]);
301 } else { 318 } else {
302 throw jsonDecoder.missingKey(jsonPath, "version"); 319 throw jsonDecoder.missingKey(jsonPath, "version");
303 } 320 }
304 return new ServerConnectedParams(version); 321 String pid;
322 if (json.containsKey("pid")) {
323 pid = jsonDecoder.decodeString(jsonPath + ".pid", json["pid"]);
324 } else {
325 throw jsonDecoder.missingKey(jsonPath, "pid");
326 }
327 return new ServerConnectedParams(version, pid);
305 } else { 328 } else {
306 throw jsonDecoder.mismatch(jsonPath, "server.connected params", json); 329 throw jsonDecoder.mismatch(jsonPath, "server.connected params", json);
307 } 330 }
308 } 331 }
309 332
310 factory ServerConnectedParams.fromNotification(Notification notification) { 333 factory ServerConnectedParams.fromNotification(Notification notification) {
311 return new ServerConnectedParams.fromJson( 334 return new ServerConnectedParams.fromJson(
312 new ResponseDecoder(null), "params", notification._params); 335 new ResponseDecoder(null), "params", notification._params);
313 } 336 }
314 337
315 Map<String, dynamic> toJson() { 338 Map<String, dynamic> toJson() {
316 Map<String, dynamic> result = {}; 339 Map<String, dynamic> result = {};
317 result["version"] = version; 340 result["version"] = version;
341 result["pid"] = pid;
318 return result; 342 return result;
319 } 343 }
320 344
321 Notification toNotification() { 345 Notification toNotification() {
322 return new Notification("server.connected", toJson()); 346 return new Notification("server.connected", toJson());
323 } 347 }
324 348
325 @override 349 @override
326 String toString() => JSON.encode(toJson()); 350 String toString() => JSON.encode(toJson());
327 351
328 @override 352 @override
329 bool operator==(other) { 353 bool operator==(other) {
330 if (other is ServerConnectedParams) { 354 if (other is ServerConnectedParams) {
331 return version == other.version; 355 return version == other.version &&
356 pid == other.pid;
332 } 357 }
333 return false; 358 return false;
334 } 359 }
335 360
336 @override 361 @override
337 int get hashCode { 362 int get hashCode {
338 int hash = 0; 363 int hash = 0;
339 hash = JenkinsSmiHash.combine(hash, version.hashCode); 364 hash = JenkinsSmiHash.combine(hash, version.hashCode);
365 hash = JenkinsSmiHash.combine(hash, pid.hashCode);
340 return JenkinsSmiHash.finish(hash); 366 return JenkinsSmiHash.finish(hash);
341 } 367 }
342 } 368 }
343 369
344 /** 370 /**
345 * server.error params 371 * server.error params
346 * 372 *
347 * { 373 * {
348 * "isFatal": bool 374 * "isFatal": bool
349 * "message": String 375 * "message": String
(...skipping 16584 matching lines...) Expand 10 before | Expand all | Expand 10 after
16934 return false; 16960 return false;
16935 } 16961 }
16936 16962
16937 @override 16963 @override
16938 int get hashCode { 16964 int get hashCode {
16939 int hash = 0; 16965 int hash = 0;
16940 hash = JenkinsSmiHash.combine(hash, newName.hashCode); 16966 hash = JenkinsSmiHash.combine(hash, newName.hashCode);
16941 return JenkinsSmiHash.finish(hash); 16967 return JenkinsSmiHash.finish(hash);
16942 } 16968 }
16943 } 16969 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698