diff --git a/README.md b/README.md index 94cc9dead348..fa0d86fc34a4 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,13 @@ -# code-server [!["Open Issues"](https://img.shields.io/github/issues-raw/cdr/code-server.svg)](https://github.com/cdr/code-server/issues) [!["Latest Release"](https://img.shields.io/github/release/cdr/code-server.svg)](https://github.com/cdr/code-server/releases/latest) [![MIT license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/cdr/code-server/blob/master/LICENSE) [![Discord](https://img.shields.io/discord/463752820026376202.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/zxSwN8Z) +# code-server -**code-server v2 is almost out!** -[Get the preview here](https://github.com/cdr/code-server/releases). -(Linux builds only at the moment.) + +修复语言包支持 (Fix language support) +需要安装于vscode相匹配的语言包版本,如果通过左侧扩展栏安装出现错误,请下载对应的 MS-CEINTL.vscode-language-pack-zh-hans-1.xx.x.vsix 文件 通过 shift+command (ctrl)+P 安装vsix文件 + +[!["Open Issues"](https://img.shields.io/github/issues-raw/cdr/code-server.svg)](https://github.com/cdr/code-server/issues) +[!["Latest Release"](https://img.shields.io/github/release/cdr/code-server.svg)](https://github.com/cdr/code-server/releases/latest) +[![MIT license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/cdr/code-server/blob/master/LICENSE) +[![Discord](https://img.shields.io/discord/463752820026376202.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/zxSwN8Z) `code-server` is [VS Code](https://github.com/Microsoft/vscode) running on a remote server, accessible through the browser. diff --git a/doc/assets/ide.png b/doc/assets/ide.png index a0d0d25a8b52..eb2f1cc692e6 100644 Binary files a/doc/assets/ide.png and b/doc/assets/ide.png differ diff --git a/packages/protocol/src/browser/client.ts b/packages/protocol/src/browser/client.ts index cdbe9937bfcc..962a48139e55 100644 --- a/packages/protocol/src/browser/client.ts +++ b/packages/protocol/src/browser/client.ts @@ -281,6 +281,7 @@ export class Client { extraExtensionDirectories: init.getExtraExtensionDirectoriesList(), extraBuiltinExtensionDirectories: init.getExtraBuiltinExtensionDirectoriesList(), env: init.getEnvMap(), + languageTranslateData: init.getLanguageTranslateData(), // @www.ps.dev }; this.initDataEmitter.emit(this._initData); break; diff --git a/packages/protocol/src/common/connection.ts b/packages/protocol/src/common/connection.ts index 395b9a4d0c02..bf8c4f8a2c83 100644 --- a/packages/protocol/src/common/connection.ts +++ b/packages/protocol/src/common/connection.ts @@ -30,6 +30,8 @@ export interface InitData { readonly extraExtensionDirectories: string[]; readonly extraBuiltinExtensionDirectories: string[]; readonly env: jspb.Map; + // @www.ps.dev + readonly languageTranslateData: string; } export interface SharedProcessData { diff --git a/packages/protocol/src/node/server.ts b/packages/protocol/src/node/server.ts index 0ebaacb35221..c9b8be80f5f9 100644 --- a/packages/protocol/src/node/server.ts +++ b/packages/protocol/src/node/server.ts @@ -9,6 +9,11 @@ import { ChildProcessModuleProxy, ForkProvider, FsModuleProxy, NetModuleProxy, N // tslint:disable no-any +// @www.ps.dev +export interface LanguageConfiguration { + locale: string; +} + export interface ServerOptions { readonly workingDirectory: string; readonly dataDirectory: string; @@ -18,6 +23,7 @@ export interface ServerOptions { readonly extraExtensionDirectories?: string[]; readonly extraBuiltinExtensionDirectories?: string[]; readonly fork?: ForkProvider; + readonly getLanguageTranslateData?: () => Promise; // @www.ps.dev } interface ProxyData { @@ -104,13 +110,35 @@ export class Server { initMsg.setExtraExtensionDirectoriesList(this.options.extraExtensionDirectories || []); initMsg.setExtraBuiltinExtensionDirectoriesList(this.options.extraBuiltinExtensionDirectories || []); + // @www.ps.dev + const getLanguageTranslateData = this.options.getLanguageTranslateData + || ((): Promise => Promise.resolve({ + locale: "en", + })); + + getLanguageTranslateData().then((languageData) => { + try { + initMsg.setLanguageTranslateData(JSON.stringify(languageData)); + } catch (error) { + logger.error("Unable to send language config", field("error", error)); + } + + const srvMsg = new ServerMessage(); + srvMsg.setInit(initMsg); + connection.send(srvMsg.serializeBinary()); + }).catch((error) => { + logger.error(error.message, field("error", error)); + }); + // end @www.ps.dev + for (let key in process.env) { initMsg.getEnvMap().set(key, process.env[key] as string); } - const srvMsg = new ServerMessage(); - srvMsg.setInit(initMsg); - connection.send(srvMsg.serializeBinary()); + // @www.ps.dev move in getLanguageTranslateData 👆 + // const srvMsg = new ServerMessage(); + // srvMsg.setInit(initMsg); + // connection.send(srvMsg.serializeBinary()); } /** diff --git a/packages/protocol/src/proto/client.proto b/packages/protocol/src/proto/client.proto index 994d6ac38b40..1b97a2189b9e 100644 --- a/packages/protocol/src/proto/client.proto +++ b/packages/protocol/src/proto/client.proto @@ -46,4 +46,7 @@ message WorkingInit { repeated string extra_builtin_extension_directories = 10; map env = 11; + + // @www.ps.dev + string language_translate_data = 12; } diff --git a/packages/protocol/src/proto/client_pb.d.ts b/packages/protocol/src/proto/client_pb.d.ts index 60bbdddf57f4..6e5bc6e443c1 100644 --- a/packages/protocol/src/proto/client_pb.d.ts +++ b/packages/protocol/src/proto/client_pb.d.ts @@ -147,6 +147,9 @@ export class WorkingInit extends jspb.Message { getEnvMap(): jspb.Map; clearEnvMap(): void; + getLanguageTranslateData(): string; + setLanguageTranslateData(value: string): void; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): WorkingInit.AsObject; static toObject(includeInstance: boolean, msg: WorkingInit): WorkingInit.AsObject; @@ -170,6 +173,7 @@ export namespace WorkingInit { extraExtensionDirectoriesList: Array, extraBuiltinExtensionDirectoriesList: Array, envMap: Array<[string, string]>, + languageTranslateData: string, } export enum OperatingSystem { diff --git a/packages/protocol/src/proto/client_pb.js b/packages/protocol/src/proto/client_pb.js index 3a1673e3ab27..29687829798e 100644 --- a/packages/protocol/src/proto/client_pb.js +++ b/packages/protocol/src/proto/client_pb.js @@ -1,8 +1,6 @@ /** * @fileoverview * @enhanceable - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. * @public */ // GENERATED CODE -- DO NOT EDIT! @@ -12,13 +10,12 @@ var goog = jspb; var global = Function('return this')(); var node_pb = require('./node_pb.js'); -goog.object.extend(proto, node_pb); var vscode_pb = require('./vscode_pb.js'); -goog.object.extend(proto, vscode_pb); goog.exportSymbol('proto.ClientMessage', null, global); goog.exportSymbol('proto.ServerMessage', null, global); goog.exportSymbol('proto.WorkingInit', null, global); goog.exportSymbol('proto.WorkingInit.OperatingSystem', null, global); + /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -34,55 +31,8 @@ proto.ClientMessage = function(opt_data) { }; goog.inherits(proto.ClientMessage, jspb.Message); if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ proto.ClientMessage.displayName = 'proto.ClientMessage'; } -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.ServerMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.ServerMessage.oneofGroups_); -}; -goog.inherits(proto.ServerMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.ServerMessage.displayName = 'proto.ServerMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.WorkingInit = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.WorkingInit.repeatedFields_, null); -}; -goog.inherits(proto.WorkingInit, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.WorkingInit.displayName = 'proto.WorkingInit'; -} - /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all @@ -134,7 +84,6 @@ proto.ClientMessage.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.ClientMessage} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.ClientMessage.toObject = function(includeInstance, msg) { var f, obj = { @@ -211,7 +160,6 @@ proto.ClientMessage.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.ClientMessage} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.ClientMessage.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -250,9 +198,6 @@ proto.ClientMessage.prototype.setMethod = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.ClientMessage.prototype.clearMethod = function() { this.setMethod(undefined); }; @@ -260,7 +205,7 @@ proto.ClientMessage.prototype.clearMethod = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.ClientMessage.prototype.hasMethod = function() { return jspb.Message.getField(this, 20) != null; @@ -283,9 +228,6 @@ proto.ClientMessage.prototype.setPing = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.ClientMessage.prototype.clearPing = function() { this.setPing(undefined); }; @@ -293,7 +235,7 @@ proto.ClientMessage.prototype.clearPing = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.ClientMessage.prototype.hasPing = function() { return jspb.Message.getField(this, 21) != null; @@ -301,6 +243,23 @@ proto.ClientMessage.prototype.hasPing = function() { +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.ServerMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.ServerMessage.oneofGroups_); +}; +goog.inherits(proto.ServerMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.ServerMessage.displayName = 'proto.ServerMessage'; +} /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all @@ -357,7 +316,6 @@ proto.ServerMessage.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.ServerMessage} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.ServerMessage.toObject = function(includeInstance, msg) { var f, obj = { @@ -464,7 +422,6 @@ proto.ServerMessage.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.ServerMessage} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.ServerMessage.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -543,9 +500,6 @@ proto.ServerMessage.prototype.setFail = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.ServerMessage.prototype.clearFail = function() { this.setFail(undefined); }; @@ -553,7 +507,7 @@ proto.ServerMessage.prototype.clearFail = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.ServerMessage.prototype.hasFail = function() { return jspb.Message.getField(this, 13) != null; @@ -576,9 +530,6 @@ proto.ServerMessage.prototype.setSuccess = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.ServerMessage.prototype.clearSuccess = function() { this.setSuccess(undefined); }; @@ -586,7 +537,7 @@ proto.ServerMessage.prototype.clearSuccess = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.ServerMessage.prototype.hasSuccess = function() { return jspb.Message.getField(this, 14) != null; @@ -609,9 +560,6 @@ proto.ServerMessage.prototype.setEvent = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.ServerMessage.prototype.clearEvent = function() { this.setEvent(undefined); }; @@ -619,7 +567,7 @@ proto.ServerMessage.prototype.clearEvent = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.ServerMessage.prototype.hasEvent = function() { return jspb.Message.getField(this, 19) != null; @@ -642,9 +590,6 @@ proto.ServerMessage.prototype.setCallback = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.ServerMessage.prototype.clearCallback = function() { this.setCallback(undefined); }; @@ -652,7 +597,7 @@ proto.ServerMessage.prototype.clearCallback = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.ServerMessage.prototype.hasCallback = function() { return jspb.Message.getField(this, 22) != null; @@ -675,9 +620,6 @@ proto.ServerMessage.prototype.setPong = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.ServerMessage.prototype.clearPong = function() { this.setPong(undefined); }; @@ -685,7 +627,7 @@ proto.ServerMessage.prototype.clearPong = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.ServerMessage.prototype.hasPong = function() { return jspb.Message.getField(this, 18) != null; @@ -708,9 +650,6 @@ proto.ServerMessage.prototype.setInit = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.ServerMessage.prototype.clearInit = function() { this.setInit(undefined); }; @@ -718,7 +657,7 @@ proto.ServerMessage.prototype.clearInit = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.ServerMessage.prototype.hasInit = function() { return jspb.Message.getField(this, 16) != null; @@ -741,9 +680,6 @@ proto.ServerMessage.prototype.setSharedProcessActive = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.ServerMessage.prototype.clearSharedProcessActive = function() { this.setSharedProcessActive(undefined); }; @@ -751,7 +687,7 @@ proto.ServerMessage.prototype.clearSharedProcessActive = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.ServerMessage.prototype.hasSharedProcessActive = function() { return jspb.Message.getField(this, 17) != null; @@ -759,6 +695,23 @@ proto.ServerMessage.prototype.hasSharedProcessActive = function() { +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.WorkingInit = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.WorkingInit.repeatedFields_, null); +}; +goog.inherits(proto.WorkingInit, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.WorkingInit.displayName = 'proto.WorkingInit'; +} /** * List of repeated fields within this message type. * @private {!Array} @@ -791,7 +744,6 @@ proto.WorkingInit.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.WorkingInit} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.WorkingInit.toObject = function(includeInstance, msg) { var f, obj = { @@ -803,9 +755,10 @@ proto.WorkingInit.toObject = function(includeInstance, msg) { shell: jspb.Message.getFieldWithDefault(msg, 6, ""), builtinExtensionsDir: jspb.Message.getFieldWithDefault(msg, 7, ""), extensionsDirectory: jspb.Message.getFieldWithDefault(msg, 8, ""), - extraExtensionDirectoriesList: jspb.Message.getRepeatedField(msg, 9), - extraBuiltinExtensionDirectoriesList: jspb.Message.getRepeatedField(msg, 10), - envMap: (f = msg.getEnvMap()) ? f.toObject(includeInstance, undefined) : [] + extraExtensionDirectoriesList: jspb.Message.getField(msg, 9), + extraBuiltinExtensionDirectoriesList: jspb.Message.getField(msg, 10), + envMap: (f = msg.getEnvMap()) ? f.toObject(includeInstance, undefined) : [], + languageTranslateData: jspb.Message.getFieldWithDefault(msg, 12, "") }; if (includeInstance) { @@ -885,9 +838,13 @@ proto.WorkingInit.deserializeBinaryFromReader = function(msg, reader) { case 11: var value = msg.getEnvMap(); reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, ""); + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString); }); break; + case 12: + var value = /** @type {string} */ (reader.readString()); + msg.setLanguageTranslateData(value); + break; default: reader.skipField(); break; @@ -913,7 +870,6 @@ proto.WorkingInit.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.WorkingInit} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.WorkingInit.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -991,6 +947,13 @@ proto.WorkingInit.serializeBinaryToWriter = function(message, writer) { if (f && f.getLength() > 0) { f.serializeBinary(11, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); } + f = message.getLanguageTranslateData(); + if (f.length > 0) { + writer.writeString( + 12, + f + ); + } }; @@ -1014,7 +977,7 @@ proto.WorkingInit.prototype.getHomeDirectory = function() { /** @param {string} value */ proto.WorkingInit.prototype.setHomeDirectory = function(value) { - jspb.Message.setProto3StringField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -1029,7 +992,7 @@ proto.WorkingInit.prototype.getTmpDirectory = function() { /** @param {string} value */ proto.WorkingInit.prototype.setTmpDirectory = function(value) { - jspb.Message.setProto3StringField(this, 2, value); + jspb.Message.setField(this, 2, value); }; @@ -1044,7 +1007,7 @@ proto.WorkingInit.prototype.getDataDirectory = function() { /** @param {string} value */ proto.WorkingInit.prototype.setDataDirectory = function(value) { - jspb.Message.setProto3StringField(this, 3, value); + jspb.Message.setField(this, 3, value); }; @@ -1059,7 +1022,7 @@ proto.WorkingInit.prototype.getWorkingDirectory = function() { /** @param {string} value */ proto.WorkingInit.prototype.setWorkingDirectory = function(value) { - jspb.Message.setProto3StringField(this, 4, value); + jspb.Message.setField(this, 4, value); }; @@ -1074,7 +1037,7 @@ proto.WorkingInit.prototype.getOperatingSystem = function() { /** @param {!proto.WorkingInit.OperatingSystem} value */ proto.WorkingInit.prototype.setOperatingSystem = function(value) { - jspb.Message.setProto3EnumField(this, 5, value); + jspb.Message.setField(this, 5, value); }; @@ -1089,7 +1052,7 @@ proto.WorkingInit.prototype.getShell = function() { /** @param {string} value */ proto.WorkingInit.prototype.setShell = function(value) { - jspb.Message.setProto3StringField(this, 6, value); + jspb.Message.setField(this, 6, value); }; @@ -1104,7 +1067,7 @@ proto.WorkingInit.prototype.getBuiltinExtensionsDir = function() { /** @param {string} value */ proto.WorkingInit.prototype.setBuiltinExtensionsDir = function(value) { - jspb.Message.setProto3StringField(this, 7, value); + jspb.Message.setField(this, 7, value); }; @@ -1119,27 +1082,29 @@ proto.WorkingInit.prototype.getExtensionsDirectory = function() { /** @param {string} value */ proto.WorkingInit.prototype.setExtensionsDirectory = function(value) { - jspb.Message.setProto3StringField(this, 8, value); + jspb.Message.setField(this, 8, value); }; /** * repeated string extra_extension_directories = 9; - * @return {!Array} + * If you change this array by adding, removing or replacing elements, or if you + * replace the array itself, then you must call the setter to update it. + * @return {!Array.} */ proto.WorkingInit.prototype.getExtraExtensionDirectoriesList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 9)); + return /** @type {!Array.} */ (jspb.Message.getField(this, 9)); }; -/** @param {!Array} value */ +/** @param {!Array.} value */ proto.WorkingInit.prototype.setExtraExtensionDirectoriesList = function(value) { jspb.Message.setField(this, 9, value || []); }; /** - * @param {string} value + * @param {!string} value * @param {number=} opt_index */ proto.WorkingInit.prototype.addExtraExtensionDirectories = function(value, opt_index) { @@ -1147,9 +1112,6 @@ proto.WorkingInit.prototype.addExtraExtensionDirectories = function(value, opt_i }; -/** - * Clears the list making it empty but non-null. - */ proto.WorkingInit.prototype.clearExtraExtensionDirectoriesList = function() { this.setExtraExtensionDirectoriesList([]); }; @@ -1157,21 +1119,23 @@ proto.WorkingInit.prototype.clearExtraExtensionDirectoriesList = function() { /** * repeated string extra_builtin_extension_directories = 10; - * @return {!Array} + * If you change this array by adding, removing or replacing elements, or if you + * replace the array itself, then you must call the setter to update it. + * @return {!Array.} */ proto.WorkingInit.prototype.getExtraBuiltinExtensionDirectoriesList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 10)); + return /** @type {!Array.} */ (jspb.Message.getField(this, 10)); }; -/** @param {!Array} value */ +/** @param {!Array.} value */ proto.WorkingInit.prototype.setExtraBuiltinExtensionDirectoriesList = function(value) { jspb.Message.setField(this, 10, value || []); }; /** - * @param {string} value + * @param {!string} value * @param {number=} opt_index */ proto.WorkingInit.prototype.addExtraBuiltinExtensionDirectories = function(value, opt_index) { @@ -1179,9 +1143,6 @@ proto.WorkingInit.prototype.addExtraBuiltinExtensionDirectories = function(value }; -/** - * Clears the list making it empty but non-null. - */ proto.WorkingInit.prototype.clearExtraBuiltinExtensionDirectoriesList = function() { this.setExtraBuiltinExtensionDirectoriesList([]); }; @@ -1200,12 +1161,24 @@ proto.WorkingInit.prototype.getEnvMap = function(opt_noLazyCreate) { }; -/** - * Clears values from the map. The map will be non-null. - */ proto.WorkingInit.prototype.clearEnvMap = function() { this.getEnvMap().clear(); }; +/** + * optional string language_translate_data = 12; + * @return {string} + */ +proto.WorkingInit.prototype.getLanguageTranslateData = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 12, "")); +}; + + +/** @param {string} value */ +proto.WorkingInit.prototype.setLanguageTranslateData = function(value) { + jspb.Message.setField(this, 12, value); +}; + + goog.object.extend(exports, proto); diff --git a/packages/protocol/src/proto/node_pb.js b/packages/protocol/src/proto/node_pb.js index c7a90b5a8867..268e157f5649 100644 --- a/packages/protocol/src/proto/node_pb.js +++ b/packages/protocol/src/proto/node_pb.js @@ -1,8 +1,6 @@ /** * @fileoverview * @enhanceable - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. * @public */ // GENERATED CODE -- DO NOT EDIT! @@ -35,6 +33,7 @@ goog.exportSymbol('proto.Method.Success', null, global); goog.exportSymbol('proto.Module', null, global); goog.exportSymbol('proto.Ping', null, global); goog.exportSymbol('proto.Pong', null, global); + /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -45,480 +44,13 @@ goog.exportSymbol('proto.Pong', null, global); * @extends {jspb.Message} * @constructor */ -proto.Argument = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.Argument.oneofGroups_); -}; -goog.inherits(proto.Argument, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Argument.displayName = 'proto.Argument'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Argument.ErrorValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Argument.ErrorValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Argument.ErrorValue.displayName = 'proto.Argument.ErrorValue'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Argument.BufferValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Argument.BufferValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Argument.BufferValue.displayName = 'proto.Argument.BufferValue'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Argument.ObjectValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Argument.ObjectValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Argument.ObjectValue.displayName = 'proto.Argument.ObjectValue'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Argument.ArrayValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.Argument.ArrayValue.repeatedFields_, null); -}; -goog.inherits(proto.Argument.ArrayValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Argument.ArrayValue.displayName = 'proto.Argument.ArrayValue'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Argument.ProxyValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Argument.ProxyValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Argument.ProxyValue.displayName = 'proto.Argument.ProxyValue'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Argument.FunctionValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Argument.FunctionValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Argument.FunctionValue.displayName = 'proto.Argument.FunctionValue'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Argument.NullValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Argument.NullValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Argument.NullValue.displayName = 'proto.Argument.NullValue'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Argument.UndefinedValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Argument.UndefinedValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Argument.UndefinedValue.displayName = 'proto.Argument.UndefinedValue'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Argument.DateValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Argument.DateValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Argument.DateValue.displayName = 'proto.Argument.DateValue'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Method = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.Method.oneofGroups_); -}; -goog.inherits(proto.Method, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Method.displayName = 'proto.Method'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Method.Named = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.Method.Named.repeatedFields_, null); -}; -goog.inherits(proto.Method.Named, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Method.Named.displayName = 'proto.Method.Named'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Method.Numbered = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.Method.Numbered.repeatedFields_, null); -}; -goog.inherits(proto.Method.Numbered, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Method.Numbered.displayName = 'proto.Method.Numbered'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Method.Fail = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Method.Fail, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Method.Fail.displayName = 'proto.Method.Fail'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Method.Success = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Method.Success, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Method.Success.displayName = 'proto.Method.Success'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Callback = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.Callback.oneofGroups_); -}; -goog.inherits(proto.Callback, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Callback.displayName = 'proto.Callback'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Callback.Named = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.Callback.Named.repeatedFields_, null); -}; -goog.inherits(proto.Callback.Named, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Callback.Named.displayName = 'proto.Callback.Named'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Callback.Numbered = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.Callback.Numbered.repeatedFields_, null); -}; -goog.inherits(proto.Callback.Numbered, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Callback.Numbered.displayName = 'proto.Callback.Numbered'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Event = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.Event.oneofGroups_); -}; -goog.inherits(proto.Event, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Event.displayName = 'proto.Event'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Event.Named = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.Event.Named.repeatedFields_, null); -}; -goog.inherits(proto.Event.Named, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Event.Named.displayName = 'proto.Event.Named'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Event.Numbered = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.Event.Numbered.repeatedFields_, null); -}; -goog.inherits(proto.Event.Numbered, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Event.Numbered.displayName = 'proto.Event.Numbered'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Ping = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.Ping, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Ping.displayName = 'proto.Ping'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.Pong = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.Argument = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.Argument.oneofGroups_); }; -goog.inherits(proto.Pong, jspb.Message); +goog.inherits(proto.Argument, jspb.Message); if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.Pong.displayName = 'proto.Pong'; + proto.Argument.displayName = 'proto.Argument'; } - /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all @@ -580,7 +112,6 @@ proto.Argument.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.Argument} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Argument.toObject = function(includeInstance, msg) { var f, obj = { @@ -714,7 +245,6 @@ proto.Argument.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Argument} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Argument.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -815,6 +345,23 @@ proto.Argument.serializeBinaryToWriter = function(message, writer) { +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.Argument.ErrorValue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.Argument.ErrorValue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Argument.ErrorValue.displayName = 'proto.Argument.ErrorValue'; +} if (jspb.Message.GENERATE_TO_OBJECT) { @@ -840,7 +387,6 @@ proto.Argument.ErrorValue.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.Argument.ErrorValue} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Argument.ErrorValue.toObject = function(includeInstance, msg) { var f, obj = { @@ -920,7 +466,6 @@ proto.Argument.ErrorValue.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Argument.ErrorValue} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Argument.ErrorValue.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -959,7 +504,7 @@ proto.Argument.ErrorValue.prototype.getMessage = function() { /** @param {string} value */ proto.Argument.ErrorValue.prototype.setMessage = function(value) { - jspb.Message.setProto3StringField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -974,7 +519,7 @@ proto.Argument.ErrorValue.prototype.getStack = function() { /** @param {string} value */ proto.Argument.ErrorValue.prototype.setStack = function(value) { - jspb.Message.setProto3StringField(this, 2, value); + jspb.Message.setField(this, 2, value); }; @@ -989,11 +534,28 @@ proto.Argument.ErrorValue.prototype.getCode = function() { /** @param {string} value */ proto.Argument.ErrorValue.prototype.setCode = function(value) { - jspb.Message.setProto3StringField(this, 3, value); + jspb.Message.setField(this, 3, value); }; +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.Argument.BufferValue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.Argument.BufferValue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Argument.BufferValue.displayName = 'proto.Argument.BufferValue'; +} if (jspb.Message.GENERATE_TO_OBJECT) { @@ -1019,7 +581,6 @@ proto.Argument.BufferValue.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.Argument.BufferValue} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Argument.BufferValue.toObject = function(includeInstance, msg) { var f, obj = { @@ -1089,7 +650,6 @@ proto.Argument.BufferValue.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Argument.BufferValue} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Argument.BufferValue.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -1138,11 +698,28 @@ proto.Argument.BufferValue.prototype.getData_asU8 = function() { /** @param {!(string|Uint8Array)} value */ proto.Argument.BufferValue.prototype.setData = function(value) { - jspb.Message.setProto3BytesField(this, 1, value); + jspb.Message.setField(this, 1, value); }; +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.Argument.ObjectValue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.Argument.ObjectValue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Argument.ObjectValue.displayName = 'proto.Argument.ObjectValue'; +} if (jspb.Message.GENERATE_TO_OBJECT) { @@ -1168,7 +745,6 @@ proto.Argument.ObjectValue.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.Argument.ObjectValue} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Argument.ObjectValue.toObject = function(includeInstance, msg) { var f, obj = { @@ -1212,7 +788,7 @@ proto.Argument.ObjectValue.deserializeBinaryFromReader = function(msg, reader) { case 1: var value = msg.getDataMap(); reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.Argument.deserializeBinaryFromReader, ""); + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.Argument.deserializeBinaryFromReader); }); break; default: @@ -1240,7 +816,6 @@ proto.Argument.ObjectValue.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Argument.ObjectValue} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Argument.ObjectValue.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -1264,15 +839,29 @@ proto.Argument.ObjectValue.prototype.getDataMap = function(opt_noLazyCreate) { }; -/** - * Clears values from the map. The map will be non-null. - */ proto.Argument.ObjectValue.prototype.clearDataMap = function() { this.getDataMap().clear(); }; +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.Argument.ArrayValue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.Argument.ArrayValue.repeatedFields_, null); +}; +goog.inherits(proto.Argument.ArrayValue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Argument.ArrayValue.displayName = 'proto.Argument.ArrayValue'; +} /** * List of repeated fields within this message type. * @private {!Array} @@ -1305,7 +894,6 @@ proto.Argument.ArrayValue.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.Argument.ArrayValue} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Argument.ArrayValue.toObject = function(includeInstance, msg) { var f, obj = { @@ -1377,7 +965,6 @@ proto.Argument.ArrayValue.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Argument.ArrayValue} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Argument.ArrayValue.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -1394,15 +981,17 @@ proto.Argument.ArrayValue.serializeBinaryToWriter = function(message, writer) { /** * repeated Argument data = 1; - * @return {!Array} + * If you change this array by adding, removing or replacing elements, or if you + * replace the array itself, then you must call the setter to update it. + * @return {!Array.} */ proto.Argument.ArrayValue.prototype.getDataList = function() { - return /** @type{!Array} */ ( + return /** @type{!Array.} */ ( jspb.Message.getRepeatedWrapperField(this, proto.Argument, 1)); }; -/** @param {!Array} value */ +/** @param {!Array.} value */ proto.Argument.ArrayValue.prototype.setDataList = function(value) { jspb.Message.setRepeatedWrapperField(this, 1, value); }; @@ -1418,15 +1007,29 @@ proto.Argument.ArrayValue.prototype.addData = function(opt_value, opt_index) { }; -/** - * Clears the list making it empty but non-null. - */ proto.Argument.ArrayValue.prototype.clearDataList = function() { this.setDataList([]); }; +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.Argument.ProxyValue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.Argument.ProxyValue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Argument.ProxyValue.displayName = 'proto.Argument.ProxyValue'; +} if (jspb.Message.GENERATE_TO_OBJECT) { @@ -1452,7 +1055,6 @@ proto.Argument.ProxyValue.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.Argument.ProxyValue} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Argument.ProxyValue.toObject = function(includeInstance, msg) { var f, obj = { @@ -1522,7 +1124,6 @@ proto.Argument.ProxyValue.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Argument.ProxyValue} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Argument.ProxyValue.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -1547,11 +1148,28 @@ proto.Argument.ProxyValue.prototype.getId = function() { /** @param {number} value */ proto.Argument.ProxyValue.prototype.setId = function(value) { - jspb.Message.setProto3IntField(this, 1, value); + jspb.Message.setField(this, 1, value); }; +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.Argument.FunctionValue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.Argument.FunctionValue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Argument.FunctionValue.displayName = 'proto.Argument.FunctionValue'; +} if (jspb.Message.GENERATE_TO_OBJECT) { @@ -1577,7 +1195,6 @@ proto.Argument.FunctionValue.prototype.toObject = function(opt_includeInstance) * http://goto/soy-param-migration * @param {!proto.Argument.FunctionValue} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Argument.FunctionValue.toObject = function(includeInstance, msg) { var f, obj = { @@ -1647,7 +1264,6 @@ proto.Argument.FunctionValue.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Argument.FunctionValue} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Argument.FunctionValue.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -1672,11 +1288,28 @@ proto.Argument.FunctionValue.prototype.getId = function() { /** @param {number} value */ proto.Argument.FunctionValue.prototype.setId = function(value) { - jspb.Message.setProto3IntField(this, 1, value); + jspb.Message.setField(this, 1, value); }; +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.Argument.NullValue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.Argument.NullValue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Argument.NullValue.displayName = 'proto.Argument.NullValue'; +} if (jspb.Message.GENERATE_TO_OBJECT) { @@ -1702,7 +1335,6 @@ proto.Argument.NullValue.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.Argument.NullValue} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Argument.NullValue.toObject = function(includeInstance, msg) { var f, obj = { @@ -1768,7 +1400,6 @@ proto.Argument.NullValue.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Argument.NullValue} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Argument.NullValue.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -1776,6 +1407,23 @@ proto.Argument.NullValue.serializeBinaryToWriter = function(message, writer) { +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.Argument.UndefinedValue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.Argument.UndefinedValue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Argument.UndefinedValue.displayName = 'proto.Argument.UndefinedValue'; +} if (jspb.Message.GENERATE_TO_OBJECT) { @@ -1801,7 +1449,6 @@ proto.Argument.UndefinedValue.prototype.toObject = function(opt_includeInstance) * http://goto/soy-param-migration * @param {!proto.Argument.UndefinedValue} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Argument.UndefinedValue.toObject = function(includeInstance, msg) { var f, obj = { @@ -1867,7 +1514,6 @@ proto.Argument.UndefinedValue.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Argument.UndefinedValue} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Argument.UndefinedValue.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -1875,6 +1521,23 @@ proto.Argument.UndefinedValue.serializeBinaryToWriter = function(message, writer +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.Argument.DateValue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.Argument.DateValue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Argument.DateValue.displayName = 'proto.Argument.DateValue'; +} if (jspb.Message.GENERATE_TO_OBJECT) { @@ -1900,7 +1563,6 @@ proto.Argument.DateValue.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.Argument.DateValue} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Argument.DateValue.toObject = function(includeInstance, msg) { var f, obj = { @@ -1970,7 +1632,6 @@ proto.Argument.DateValue.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Argument.DateValue} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Argument.DateValue.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -1995,7 +1656,7 @@ proto.Argument.DateValue.prototype.getDate = function() { /** @param {string} value */ proto.Argument.DateValue.prototype.setDate = function(value) { - jspb.Message.setProto3StringField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -2015,9 +1676,6 @@ proto.Argument.prototype.setError = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.Argument.prototype.clearError = function() { this.setError(undefined); }; @@ -2025,7 +1683,7 @@ proto.Argument.prototype.clearError = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.Argument.prototype.hasError = function() { return jspb.Message.getField(this, 1) != null; @@ -2048,9 +1706,6 @@ proto.Argument.prototype.setBuffer = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.Argument.prototype.clearBuffer = function() { this.setBuffer(undefined); }; @@ -2058,7 +1713,7 @@ proto.Argument.prototype.clearBuffer = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.Argument.prototype.hasBuffer = function() { return jspb.Message.getField(this, 2) != null; @@ -2081,9 +1736,6 @@ proto.Argument.prototype.setObject = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.Argument.prototype.clearObject = function() { this.setObject(undefined); }; @@ -2091,7 +1743,7 @@ proto.Argument.prototype.clearObject = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.Argument.prototype.hasObject = function() { return jspb.Message.getField(this, 3) != null; @@ -2114,9 +1766,6 @@ proto.Argument.prototype.setArray = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.Argument.prototype.clearArray = function() { this.setArray(undefined); }; @@ -2124,7 +1773,7 @@ proto.Argument.prototype.clearArray = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.Argument.prototype.hasArray = function() { return jspb.Message.getField(this, 4) != null; @@ -2147,9 +1796,6 @@ proto.Argument.prototype.setProxy = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.Argument.prototype.clearProxy = function() { this.setProxy(undefined); }; @@ -2157,7 +1803,7 @@ proto.Argument.prototype.clearProxy = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.Argument.prototype.hasProxy = function() { return jspb.Message.getField(this, 5) != null; @@ -2180,9 +1826,6 @@ proto.Argument.prototype.setFunction = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.Argument.prototype.clearFunction = function() { this.setFunction(undefined); }; @@ -2190,7 +1833,7 @@ proto.Argument.prototype.clearFunction = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.Argument.prototype.hasFunction = function() { return jspb.Message.getField(this, 6) != null; @@ -2213,9 +1856,6 @@ proto.Argument.prototype.setNull = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.Argument.prototype.clearNull = function() { this.setNull(undefined); }; @@ -2223,7 +1863,7 @@ proto.Argument.prototype.clearNull = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.Argument.prototype.hasNull = function() { return jspb.Message.getField(this, 7) != null; @@ -2246,9 +1886,6 @@ proto.Argument.prototype.setUndefined = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.Argument.prototype.clearUndefined = function() { this.setUndefined(undefined); }; @@ -2256,7 +1893,7 @@ proto.Argument.prototype.clearUndefined = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.Argument.prototype.hasUndefined = function() { return jspb.Message.getField(this, 8) != null; @@ -2278,9 +1915,6 @@ proto.Argument.prototype.setNumber = function(value) { }; -/** - * Clears the field making it undefined. - */ proto.Argument.prototype.clearNumber = function() { jspb.Message.setOneofField(this, 9, proto.Argument.oneofGroups_[0], undefined); }; @@ -2288,7 +1922,7 @@ proto.Argument.prototype.clearNumber = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.Argument.prototype.hasNumber = function() { return jspb.Message.getField(this, 9) != null; @@ -2310,9 +1944,6 @@ proto.Argument.prototype.setString = function(value) { }; -/** - * Clears the field making it undefined. - */ proto.Argument.prototype.clearString = function() { jspb.Message.setOneofField(this, 10, proto.Argument.oneofGroups_[0], undefined); }; @@ -2320,7 +1951,7 @@ proto.Argument.prototype.clearString = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.Argument.prototype.hasString = function() { return jspb.Message.getField(this, 10) != null; @@ -2344,9 +1975,6 @@ proto.Argument.prototype.setBoolean = function(value) { }; -/** - * Clears the field making it undefined. - */ proto.Argument.prototype.clearBoolean = function() { jspb.Message.setOneofField(this, 11, proto.Argument.oneofGroups_[0], undefined); }; @@ -2354,7 +1982,7 @@ proto.Argument.prototype.clearBoolean = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.Argument.prototype.hasBoolean = function() { return jspb.Message.getField(this, 11) != null; @@ -2377,9 +2005,6 @@ proto.Argument.prototype.setDate = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.Argument.prototype.clearDate = function() { this.setDate(undefined); }; @@ -2387,14 +2012,31 @@ proto.Argument.prototype.clearDate = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} + */ +proto.Argument.prototype.hasDate = function() { + return jspb.Message.getField(this, 12) != null; +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.Argument.prototype.hasDate = function() { - return jspb.Message.getField(this, 12) != null; +proto.Method = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.Method.oneofGroups_); }; - - - +goog.inherits(proto.Method, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Method.displayName = 'proto.Method'; +} /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all @@ -2446,7 +2088,6 @@ proto.Method.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.Method} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Method.toObject = function(includeInstance, msg) { var f, obj = { @@ -2523,7 +2164,6 @@ proto.Method.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Method} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Method.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -2547,6 +2187,23 @@ proto.Method.serializeBinaryToWriter = function(message, writer) { +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.Method.Named = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.Method.Named.repeatedFields_, null); +}; +goog.inherits(proto.Method.Named, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Method.Named.displayName = 'proto.Method.Named'; +} /** * List of repeated fields within this message type. * @private {!Array} @@ -2579,7 +2236,6 @@ proto.Method.Named.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.Method.Named} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Method.Named.toObject = function(includeInstance, msg) { var f, obj = { @@ -2666,7 +2322,6 @@ proto.Method.Named.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Method.Named} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Method.Named.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -2713,7 +2368,7 @@ proto.Method.Named.prototype.getId = function() { /** @param {number} value */ proto.Method.Named.prototype.setId = function(value) { - jspb.Message.setProto3IntField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -2728,7 +2383,7 @@ proto.Method.Named.prototype.getModule = function() { /** @param {!proto.Module} value */ proto.Method.Named.prototype.setModule = function(value) { - jspb.Message.setProto3EnumField(this, 2, value); + jspb.Message.setField(this, 2, value); }; @@ -2743,21 +2398,23 @@ proto.Method.Named.prototype.getMethod = function() { /** @param {string} value */ proto.Method.Named.prototype.setMethod = function(value) { - jspb.Message.setProto3StringField(this, 3, value); + jspb.Message.setField(this, 3, value); }; /** * repeated Argument args = 4; - * @return {!Array} + * If you change this array by adding, removing or replacing elements, or if you + * replace the array itself, then you must call the setter to update it. + * @return {!Array.} */ proto.Method.Named.prototype.getArgsList = function() { - return /** @type{!Array} */ ( + return /** @type{!Array.} */ ( jspb.Message.getRepeatedWrapperField(this, proto.Argument, 4)); }; -/** @param {!Array} value */ +/** @param {!Array.} value */ proto.Method.Named.prototype.setArgsList = function(value) { jspb.Message.setRepeatedWrapperField(this, 4, value); }; @@ -2773,15 +2430,29 @@ proto.Method.Named.prototype.addArgs = function(opt_value, opt_index) { }; -/** - * Clears the list making it empty but non-null. - */ proto.Method.Named.prototype.clearArgsList = function() { this.setArgsList([]); }; +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.Method.Numbered = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.Method.Numbered.repeatedFields_, null); +}; +goog.inherits(proto.Method.Numbered, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Method.Numbered.displayName = 'proto.Method.Numbered'; +} /** * List of repeated fields within this message type. * @private {!Array} @@ -2814,7 +2485,6 @@ proto.Method.Numbered.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.Method.Numbered} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Method.Numbered.toObject = function(includeInstance, msg) { var f, obj = { @@ -2901,7 +2571,6 @@ proto.Method.Numbered.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Method.Numbered} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Method.Numbered.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -2948,7 +2617,7 @@ proto.Method.Numbered.prototype.getId = function() { /** @param {number} value */ proto.Method.Numbered.prototype.setId = function(value) { - jspb.Message.setProto3IntField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -2963,7 +2632,7 @@ proto.Method.Numbered.prototype.getProxyId = function() { /** @param {number} value */ proto.Method.Numbered.prototype.setProxyId = function(value) { - jspb.Message.setProto3IntField(this, 2, value); + jspb.Message.setField(this, 2, value); }; @@ -2978,21 +2647,23 @@ proto.Method.Numbered.prototype.getMethod = function() { /** @param {string} value */ proto.Method.Numbered.prototype.setMethod = function(value) { - jspb.Message.setProto3StringField(this, 3, value); + jspb.Message.setField(this, 3, value); }; /** * repeated Argument args = 4; - * @return {!Array} + * If you change this array by adding, removing or replacing elements, or if you + * replace the array itself, then you must call the setter to update it. + * @return {!Array.} */ proto.Method.Numbered.prototype.getArgsList = function() { - return /** @type{!Array} */ ( + return /** @type{!Array.} */ ( jspb.Message.getRepeatedWrapperField(this, proto.Argument, 4)); }; -/** @param {!Array} value */ +/** @param {!Array.} value */ proto.Method.Numbered.prototype.setArgsList = function(value) { jspb.Message.setRepeatedWrapperField(this, 4, value); }; @@ -3008,15 +2679,29 @@ proto.Method.Numbered.prototype.addArgs = function(opt_value, opt_index) { }; -/** - * Clears the list making it empty but non-null. - */ proto.Method.Numbered.prototype.clearArgsList = function() { this.setArgsList([]); }; +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.Method.Fail = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.Method.Fail, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Method.Fail.displayName = 'proto.Method.Fail'; +} if (jspb.Message.GENERATE_TO_OBJECT) { @@ -3042,7 +2727,6 @@ proto.Method.Fail.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.Method.Fail} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Method.Fail.toObject = function(includeInstance, msg) { var f, obj = { @@ -3118,7 +2802,6 @@ proto.Method.Fail.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Method.Fail} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Method.Fail.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -3151,7 +2834,7 @@ proto.Method.Fail.prototype.getId = function() { /** @param {number} value */ proto.Method.Fail.prototype.setId = function(value) { - jspb.Message.setProto3IntField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -3171,9 +2854,6 @@ proto.Method.Fail.prototype.setResponse = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.Method.Fail.prototype.clearResponse = function() { this.setResponse(undefined); }; @@ -3181,7 +2861,7 @@ proto.Method.Fail.prototype.clearResponse = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.Method.Fail.prototype.hasResponse = function() { return jspb.Message.getField(this, 2) != null; @@ -3189,6 +2869,23 @@ proto.Method.Fail.prototype.hasResponse = function() { +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.Method.Success = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.Method.Success, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Method.Success.displayName = 'proto.Method.Success'; +} if (jspb.Message.GENERATE_TO_OBJECT) { @@ -3214,7 +2911,6 @@ proto.Method.Success.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.Method.Success} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Method.Success.toObject = function(includeInstance, msg) { var f, obj = { @@ -3290,7 +2986,6 @@ proto.Method.Success.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Method.Success} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Method.Success.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -3323,7 +3018,7 @@ proto.Method.Success.prototype.getId = function() { /** @param {number} value */ proto.Method.Success.prototype.setId = function(value) { - jspb.Message.setProto3IntField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -3343,9 +3038,6 @@ proto.Method.Success.prototype.setResponse = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.Method.Success.prototype.clearResponse = function() { this.setResponse(undefined); }; @@ -3353,7 +3045,7 @@ proto.Method.Success.prototype.clearResponse = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.Method.Success.prototype.hasResponse = function() { return jspb.Message.getField(this, 2) != null; @@ -3376,9 +3068,6 @@ proto.Method.prototype.setNamedProxy = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.Method.prototype.clearNamedProxy = function() { this.setNamedProxy(undefined); }; @@ -3386,7 +3075,7 @@ proto.Method.prototype.clearNamedProxy = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.Method.prototype.hasNamedProxy = function() { return jspb.Message.getField(this, 1) != null; @@ -3409,9 +3098,6 @@ proto.Method.prototype.setNumberedProxy = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.Method.prototype.clearNumberedProxy = function() { this.setNumberedProxy(undefined); }; @@ -3419,7 +3105,7 @@ proto.Method.prototype.clearNumberedProxy = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.Method.prototype.hasNumberedProxy = function() { return jspb.Message.getField(this, 2) != null; @@ -3427,6 +3113,23 @@ proto.Method.prototype.hasNumberedProxy = function() { +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.Callback = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.Callback.oneofGroups_); +}; +goog.inherits(proto.Callback, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Callback.displayName = 'proto.Callback'; +} /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all @@ -3478,7 +3181,6 @@ proto.Callback.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.Callback} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Callback.toObject = function(includeInstance, msg) { var f, obj = { @@ -3555,7 +3257,6 @@ proto.Callback.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Callback} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Callback.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -3579,6 +3280,23 @@ proto.Callback.serializeBinaryToWriter = function(message, writer) { +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.Callback.Named = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.Callback.Named.repeatedFields_, null); +}; +goog.inherits(proto.Callback.Named, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Callback.Named.displayName = 'proto.Callback.Named'; +} /** * List of repeated fields within this message type. * @private {!Array} @@ -3611,7 +3329,6 @@ proto.Callback.Named.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.Callback.Named} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Callback.Named.toObject = function(includeInstance, msg) { var f, obj = { @@ -3693,7 +3410,6 @@ proto.Callback.Named.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Callback.Named} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Callback.Named.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -3733,7 +3449,7 @@ proto.Callback.Named.prototype.getModule = function() { /** @param {!proto.Module} value */ proto.Callback.Named.prototype.setModule = function(value) { - jspb.Message.setProto3EnumField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -3748,21 +3464,23 @@ proto.Callback.Named.prototype.getCallbackId = function() { /** @param {number} value */ proto.Callback.Named.prototype.setCallbackId = function(value) { - jspb.Message.setProto3IntField(this, 2, value); + jspb.Message.setField(this, 2, value); }; /** * repeated Argument args = 3; - * @return {!Array} + * If you change this array by adding, removing or replacing elements, or if you + * replace the array itself, then you must call the setter to update it. + * @return {!Array.} */ proto.Callback.Named.prototype.getArgsList = function() { - return /** @type{!Array} */ ( + return /** @type{!Array.} */ ( jspb.Message.getRepeatedWrapperField(this, proto.Argument, 3)); }; -/** @param {!Array} value */ +/** @param {!Array.} value */ proto.Callback.Named.prototype.setArgsList = function(value) { jspb.Message.setRepeatedWrapperField(this, 3, value); }; @@ -3778,15 +3496,29 @@ proto.Callback.Named.prototype.addArgs = function(opt_value, opt_index) { }; -/** - * Clears the list making it empty but non-null. - */ proto.Callback.Named.prototype.clearArgsList = function() { this.setArgsList([]); }; +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.Callback.Numbered = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.Callback.Numbered.repeatedFields_, null); +}; +goog.inherits(proto.Callback.Numbered, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Callback.Numbered.displayName = 'proto.Callback.Numbered'; +} /** * List of repeated fields within this message type. * @private {!Array} @@ -3819,7 +3551,6 @@ proto.Callback.Numbered.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.Callback.Numbered} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Callback.Numbered.toObject = function(includeInstance, msg) { var f, obj = { @@ -3901,7 +3632,6 @@ proto.Callback.Numbered.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Callback.Numbered} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Callback.Numbered.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -3941,7 +3671,7 @@ proto.Callback.Numbered.prototype.getProxyId = function() { /** @param {number} value */ proto.Callback.Numbered.prototype.setProxyId = function(value) { - jspb.Message.setProto3IntField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -3956,21 +3686,23 @@ proto.Callback.Numbered.prototype.getCallbackId = function() { /** @param {number} value */ proto.Callback.Numbered.prototype.setCallbackId = function(value) { - jspb.Message.setProto3IntField(this, 2, value); + jspb.Message.setField(this, 2, value); }; /** * repeated Argument args = 3; - * @return {!Array} + * If you change this array by adding, removing or replacing elements, or if you + * replace the array itself, then you must call the setter to update it. + * @return {!Array.} */ proto.Callback.Numbered.prototype.getArgsList = function() { - return /** @type{!Array} */ ( + return /** @type{!Array.} */ ( jspb.Message.getRepeatedWrapperField(this, proto.Argument, 3)); }; -/** @param {!Array} value */ +/** @param {!Array.} value */ proto.Callback.Numbered.prototype.setArgsList = function(value) { jspb.Message.setRepeatedWrapperField(this, 3, value); }; @@ -3986,9 +3718,6 @@ proto.Callback.Numbered.prototype.addArgs = function(opt_value, opt_index) { }; -/** - * Clears the list making it empty but non-null. - */ proto.Callback.Numbered.prototype.clearArgsList = function() { this.setArgsList([]); }; @@ -4010,9 +3739,6 @@ proto.Callback.prototype.setNamedCallback = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.Callback.prototype.clearNamedCallback = function() { this.setNamedCallback(undefined); }; @@ -4020,7 +3746,7 @@ proto.Callback.prototype.clearNamedCallback = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.Callback.prototype.hasNamedCallback = function() { return jspb.Message.getField(this, 1) != null; @@ -4043,9 +3769,6 @@ proto.Callback.prototype.setNumberedCallback = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.Callback.prototype.clearNumberedCallback = function() { this.setNumberedCallback(undefined); }; @@ -4053,7 +3776,7 @@ proto.Callback.prototype.clearNumberedCallback = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.Callback.prototype.hasNumberedCallback = function() { return jspb.Message.getField(this, 2) != null; @@ -4061,6 +3784,23 @@ proto.Callback.prototype.hasNumberedCallback = function() { +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.Event = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.Event.oneofGroups_); +}; +goog.inherits(proto.Event, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Event.displayName = 'proto.Event'; +} /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all @@ -4112,7 +3852,6 @@ proto.Event.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.Event} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Event.toObject = function(includeInstance, msg) { var f, obj = { @@ -4189,7 +3928,6 @@ proto.Event.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Event} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Event.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -4213,6 +3951,23 @@ proto.Event.serializeBinaryToWriter = function(message, writer) { +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.Event.Named = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.Event.Named.repeatedFields_, null); +}; +goog.inherits(proto.Event.Named, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Event.Named.displayName = 'proto.Event.Named'; +} /** * List of repeated fields within this message type. * @private {!Array} @@ -4245,7 +4000,6 @@ proto.Event.Named.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.Event.Named} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Event.Named.toObject = function(includeInstance, msg) { var f, obj = { @@ -4327,7 +4081,6 @@ proto.Event.Named.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Event.Named} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Event.Named.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -4367,7 +4120,7 @@ proto.Event.Named.prototype.getModule = function() { /** @param {!proto.Module} value */ proto.Event.Named.prototype.setModule = function(value) { - jspb.Message.setProto3EnumField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -4382,21 +4135,23 @@ proto.Event.Named.prototype.getEvent = function() { /** @param {string} value */ proto.Event.Named.prototype.setEvent = function(value) { - jspb.Message.setProto3StringField(this, 2, value); + jspb.Message.setField(this, 2, value); }; /** * repeated Argument args = 3; - * @return {!Array} + * If you change this array by adding, removing or replacing elements, or if you + * replace the array itself, then you must call the setter to update it. + * @return {!Array.} */ proto.Event.Named.prototype.getArgsList = function() { - return /** @type{!Array} */ ( + return /** @type{!Array.} */ ( jspb.Message.getRepeatedWrapperField(this, proto.Argument, 3)); }; -/** @param {!Array} value */ +/** @param {!Array.} value */ proto.Event.Named.prototype.setArgsList = function(value) { jspb.Message.setRepeatedWrapperField(this, 3, value); }; @@ -4412,15 +4167,29 @@ proto.Event.Named.prototype.addArgs = function(opt_value, opt_index) { }; -/** - * Clears the list making it empty but non-null. - */ proto.Event.Named.prototype.clearArgsList = function() { this.setArgsList([]); }; +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.Event.Numbered = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.Event.Numbered.repeatedFields_, null); +}; +goog.inherits(proto.Event.Numbered, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Event.Numbered.displayName = 'proto.Event.Numbered'; +} /** * List of repeated fields within this message type. * @private {!Array} @@ -4453,7 +4222,6 @@ proto.Event.Numbered.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.Event.Numbered} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Event.Numbered.toObject = function(includeInstance, msg) { var f, obj = { @@ -4535,7 +4303,6 @@ proto.Event.Numbered.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Event.Numbered} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Event.Numbered.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -4575,7 +4342,7 @@ proto.Event.Numbered.prototype.getProxyId = function() { /** @param {number} value */ proto.Event.Numbered.prototype.setProxyId = function(value) { - jspb.Message.setProto3IntField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -4590,21 +4357,23 @@ proto.Event.Numbered.prototype.getEvent = function() { /** @param {string} value */ proto.Event.Numbered.prototype.setEvent = function(value) { - jspb.Message.setProto3StringField(this, 2, value); + jspb.Message.setField(this, 2, value); }; /** * repeated Argument args = 3; - * @return {!Array} + * If you change this array by adding, removing or replacing elements, or if you + * replace the array itself, then you must call the setter to update it. + * @return {!Array.} */ proto.Event.Numbered.prototype.getArgsList = function() { - return /** @type{!Array} */ ( + return /** @type{!Array.} */ ( jspb.Message.getRepeatedWrapperField(this, proto.Argument, 3)); }; -/** @param {!Array} value */ +/** @param {!Array.} value */ proto.Event.Numbered.prototype.setArgsList = function(value) { jspb.Message.setRepeatedWrapperField(this, 3, value); }; @@ -4620,9 +4389,6 @@ proto.Event.Numbered.prototype.addArgs = function(opt_value, opt_index) { }; -/** - * Clears the list making it empty but non-null. - */ proto.Event.Numbered.prototype.clearArgsList = function() { this.setArgsList([]); }; @@ -4644,9 +4410,6 @@ proto.Event.prototype.setNamedEvent = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.Event.prototype.clearNamedEvent = function() { this.setNamedEvent(undefined); }; @@ -4654,7 +4417,7 @@ proto.Event.prototype.clearNamedEvent = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.Event.prototype.hasNamedEvent = function() { return jspb.Message.getField(this, 1) != null; @@ -4677,9 +4440,6 @@ proto.Event.prototype.setNumberedEvent = function(value) { }; -/** - * Clears the message field making it undefined. - */ proto.Event.prototype.clearNumberedEvent = function() { this.setNumberedEvent(undefined); }; @@ -4687,7 +4447,7 @@ proto.Event.prototype.clearNumberedEvent = function() { /** * Returns whether this field is set. - * @return {boolean} + * @return {!boolean} */ proto.Event.prototype.hasNumberedEvent = function() { return jspb.Message.getField(this, 2) != null; @@ -4695,6 +4455,23 @@ proto.Event.prototype.hasNumberedEvent = function() { +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.Ping = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.Ping, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Ping.displayName = 'proto.Ping'; +} if (jspb.Message.GENERATE_TO_OBJECT) { @@ -4720,7 +4497,6 @@ proto.Ping.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.Ping} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Ping.toObject = function(includeInstance, msg) { var f, obj = { @@ -4786,7 +4562,6 @@ proto.Ping.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Ping} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Ping.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -4794,6 +4569,23 @@ proto.Ping.serializeBinaryToWriter = function(message, writer) { +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.Pong = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.Pong, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.Pong.displayName = 'proto.Pong'; +} if (jspb.Message.GENERATE_TO_OBJECT) { @@ -4819,7 +4611,6 @@ proto.Pong.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.Pong} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Pong.toObject = function(includeInstance, msg) { var f, obj = { @@ -4885,7 +4676,6 @@ proto.Pong.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.Pong} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Pong.serializeBinaryToWriter = function(message, writer) { var f = undefined; diff --git a/packages/protocol/src/proto/vscode_pb.js b/packages/protocol/src/proto/vscode_pb.js index 982bcf34a902..b5b37bfe7590 100644 --- a/packages/protocol/src/proto/vscode_pb.js +++ b/packages/protocol/src/proto/vscode_pb.js @@ -1,8 +1,6 @@ /** * @fileoverview * @enhanceable - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. * @public */ // GENERATED CODE -- DO NOT EDIT! @@ -12,6 +10,7 @@ var goog = jspb; var global = Function('return this')(); goog.exportSymbol('proto.SharedProcessActive', null, global); + /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -27,15 +26,10 @@ proto.SharedProcessActive = function(opt_data) { }; goog.inherits(proto.SharedProcessActive, jspb.Message); if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ proto.SharedProcessActive.displayName = 'proto.SharedProcessActive'; } - if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. @@ -59,7 +53,6 @@ proto.SharedProcessActive.prototype.toObject = function(opt_includeInstance) { * http://goto/soy-param-migration * @param {!proto.SharedProcessActive} msg The msg instance to transform. * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.SharedProcessActive.toObject = function(includeInstance, msg) { var f, obj = { @@ -134,7 +127,6 @@ proto.SharedProcessActive.prototype.serializeBinary = function() { * format), writing to the given BinaryWriter. * @param {!proto.SharedProcessActive} message * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.SharedProcessActive.serializeBinaryToWriter = function(message, writer) { var f = undefined; @@ -166,7 +158,7 @@ proto.SharedProcessActive.prototype.getSocketPath = function() { /** @param {string} value */ proto.SharedProcessActive.prototype.setSocketPath = function(value) { - jspb.Message.setProto3StringField(this, 1, value); + jspb.Message.setField(this, 1, value); }; @@ -181,7 +173,7 @@ proto.SharedProcessActive.prototype.getLogPath = function() { /** @param {string} value */ proto.SharedProcessActive.prototype.setLogPath = function(value) { - jspb.Message.setProto3StringField(this, 2, value); + jspb.Message.setField(this, 2, value); }; diff --git a/packages/server/src/cli.ts b/packages/server/src/cli.ts index 3f7db3e8e09f..171c0b89345b 100644 --- a/packages/server/src/cli.ts +++ b/packages/server/src/cli.ts @@ -11,6 +11,8 @@ import * as WebSocket from "ws"; import { buildDir, cacheHome, dataHome, isCli, serveStatic } from "./constants"; import { createApp } from "./server"; import { forkModule, requireModule } from "./vscode/bootstrapFork"; +import { LanguageConfiguration } from "@coder/protocol/src/node/server"; +import * as language from "./vscode/language"; import { SharedProcess, SharedProcessState } from "./vscode/sharedProcess"; import opn = require("opn"); @@ -273,6 +275,7 @@ const bold = (text: string | number): string | number => { return fork(modulePath, args, options); }, + getLanguageTranslateData: (): Promise => language.getNlsConfiguration(dataDir, builtInExtensionsDir), // @www.ps.dev }, password, trustProxy: options.trustProxy, diff --git a/packages/server/src/vscode/language.ts b/packages/server/src/vscode/language.ts new file mode 100644 index 000000000000..caafb6e4f338 --- /dev/null +++ b/packages/server/src/vscode/language.ts @@ -0,0 +1,101 @@ +import * as fs from "fs"; +import * as path from "path"; +import * as util from "util"; +import { logger } from "@coder/logger"; +import * as lp from "vs/base/node/languagePacks"; + +// @www.ps.dev +// NOTE: This code was pulled from lib/vscode/src/main.js. + +const stripComments = (content: string): string => { + const regexp = /("(?:[^\\"]*(?:\\.)?)*")|('(?:[^\\']*(?:\\.)?)*')|(\/\*(?:\r?\n|.)*?\*\/)|(\/{2,}.*?(?:(?:\r?\n)|$))/g; + + return content.replace(regexp, (match, _m1, _m2, m3, m4) => { + if (m3) { // Only one of m1, m2, m3, m4 matches. + return ""; // A block comment. Replace with nothing. + } else if (m4) { // A line comment. If it ends in \r?\n then keep it. + const length_1 = m4.length; + if (length_1 > 2 && m4[length_1 - 1] === "\n") { + return m4[length_1 - 2] === "\r" ? "\r\n" : "\n"; + } else { + return ""; + } + } else { + return match; // We match a string. + } + }); +}; + +/** + * Get the locale from the locale file. + */ +const getUserDefinedLocale = async (userDataPath: string): Promise => { + const localeConfig = path.join(userDataPath, "User/locale.json"); + + try { + const content = stripComments(await util.promisify(fs.readFile)(localeConfig, "utf8")); + const value = JSON.parse(content).locale; + + return value && typeof value === "string" ? value.toLowerCase() : undefined; + } catch (e) { + return undefined; + } +}; + +// @www.ps.dev +export interface NewInternalNLSConfiguration extends lp.InternalNLSConfiguration { + languageTranslateData?: object; +} + +export const getNlsConfiguration = (userDataPath: string, builtInDirectory: string): Promise => { + const defaultConfig = { locale: "en", availableLanguages: {} }; + + return new Promise(async (resolve): Promise => { + try { + const metaDataFile = require("path").join(builtInDirectory, "nls.metadata.json"); + const locale = await getUserDefinedLocale(userDataPath); + if (!locale) { + logger.debug("No locale, using default"); + + return resolve(defaultConfig); + } + + const config = (await lp.getNLSConfiguration( + process.env.VERSION || "development", userDataPath, + metaDataFile, locale, + )) || defaultConfig; + + (config as NewInternalNLSConfiguration)._languagePackSupport = true; + + // @www.ps.dev + if (locale !== 'en') { + let languageTranslateData: any = {}; + let languagepacksPath = userDataPath + "/languagepacks.json"; + let languagepacks = fs.readFileSync(languagepacksPath, "utf-8"); + let languageTranslations = JSON.parse(languagepacks); + + if(languageTranslations.hasOwnProperty(locale)) { + for (const fileKey in languageTranslations[locale].translations) { + let translateContent = fs.readFileSync(languageTranslations[locale].translations[fileKey], "utf-8"); + + let ls: any = {}; + let translateData = JSON.parse(translateContent); + for (let tr in translateData.contents) { + for(const key in translateData.contents[tr]) { + ls[key] = translateData.contents[tr][key]; + } + } + languageTranslateData[fileKey] = ls; + } + } + (config as NewInternalNLSConfiguration).languageTranslateData = languageTranslateData; + } + // end + // logger.debug(`Locale is ${locale}`, config); + resolve(config); + } catch (error) { + logger.error(error.message); + resolve(defaultConfig); + } + }); +}; diff --git a/packages/server/webpack.config.js b/packages/server/webpack.config.js index bd2768e51c56..dcbd11f4f161 100644 --- a/packages/server/webpack.config.js +++ b/packages/server/webpack.config.js @@ -31,5 +31,10 @@ module.exports = merge( "process.env.CLI": `"${process.env.CLI ? "true" : "false"}"`, }), ], + resolve: { + alias: { + "vs": path.resolve(root, "lib/vscode/src/vs"), // @www.ps.dev + } + } }, ); diff --git a/packages/vscode/src/client.ts b/packages/vscode/src/client.ts index f783a36c7582..138d17d4fe5f 100644 --- a/packages/vscode/src/client.ts +++ b/packages/vscode/src/client.ts @@ -26,6 +26,7 @@ class VSClient extends IdeClient { paths._paths.initialize(data, sharedData); product.initialize(data); process.env.SHELL = data.shell; + process.env.VSCODE_NLS_CONFIG = data.languageTranslateData; // @www.ps.dev // At this point everything should be filled, including `os`. `os` also // relies on `initData` but it listens first so it initialize before this // callback, meaning we are safe to include everything from VS Code now. diff --git a/packages/vscode/src/fill/platform.ts b/packages/vscode/src/fill/platform.ts index efe98c757626..7d7bc4465994 100644 --- a/packages/vscode/src/fill/platform.ts +++ b/packages/vscode/src/fill/platform.ts @@ -1,7 +1,8 @@ import * as os from "os"; import * as platform from "vs/base/common/platform"; import * as browser from "vs/base/browser/browser"; - +import * as nls from "vs/nls"; +import * as lp from "vs/base/node/languagePacks"; // tslint:disable no-any to override const // Use en instead of en-US since that's vscode default and it uses @@ -13,6 +14,81 @@ if (platform.language === "en-US") { (platform as any).language = "en"; } +// tslint:disable no-any to override const + +// @www.ps.dev +interface NewInternalNLSConfiguration extends lp.InternalNLSConfiguration { + languageTranslateData?: any; +} + +const rawNlsConfig = process.env.VSCODE_NLS_CONFIG; +if (rawNlsConfig) { + const nlsConfig = JSON.parse(rawNlsConfig) as NewInternalNLSConfiguration; + const resolved = nlsConfig.availableLanguages["*"]; + (platform as any).locale = nlsConfig.locale; + (platform as any).language = resolved ? resolved : "en"; + (platform as any).translationsConfigFile = nlsConfig._translationsConfigFile; + + // TODO: Each time this is imported, VS Code's loader creates a different + // module with an array of all the translations for that file. We don't use + // their loader (we're using Webpack) so we need to figure out a good way to + // handle that. + if (nlsConfig._resolvedLanguagePackCoreLocation) { + let localize = (env: any, data: any, message: any): string => { + let args = []; + for (let _i = 3; _i < arguments.length; _i++) { + args[_i - 3] = arguments[_i]; + } + + return _format(message, args, env); + }; + + let _format = (message: any, args: any, env: any): string => { + let result; + if (args.length === 0) { + result = message; + } else { + result = message.replace(/\{(\d+)\}/g, (match: any, rest: any) => { + let index = rest[0]; + let arg = args[index]; + let result = match; + if (typeof arg === "string") { + result = arg; + } else if (typeof arg === "number" || typeof arg === "boolean" || arg === undefined || arg === null) { + result = String(arg); + } + return result; + }); + } + if (env.isPseudo) { + // FF3B and FF3D is the Unicode zenkaku representation for [ and ] + result = "\uFF3B" + result.replace(/[aouei]/g, "$&$&") + "\uFF3D"; + } + + return result; + } + + (nls as any).localize = (data: any, message: any): any => { + let args = []; + for (let _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + + // 匹配翻译字符串 + if (nlsConfig.languageTranslateData) { + if (data.key && nlsConfig.languageTranslateData.vscode[data.key]) { + message = nlsConfig.languageTranslateData.vscode[data.key]; + } else if (typeof data === "string") { + message = nlsConfig.languageTranslateData.vscode[data]; + } + } + + return localize.apply(undefined, [(nls as any)._env, data, message].concat(args)); + }; + } +} +// @www.ps.dev end + // Use the server's platform instead of the client's. For example, this affects // how VS Code handles paths (and more) because different platforms give // different results. We'll have to counter for things that shouldn't change, diff --git a/packages/vscode/src/fill/windowsService.ts b/packages/vscode/src/fill/windowsService.ts index d89c8420dc6d..aad19d974588 100644 --- a/packages/vscode/src/fill/windowsService.ts +++ b/packages/vscode/src/fill/windowsService.ts @@ -256,6 +256,9 @@ export class WindowsService implements IWindowsService { } public relaunch(_options: { addArgs?: string[], removeArgs?: string[] }): Promise { + // @www.ps.dev + // Reproduce the loading window to make the language configuration take effect + window.location.reload(); throw new Error("not implemented"); } diff --git a/packages/vscode/src/vscode.scss b/packages/vscode/src/vscode.scss index 9b40371a9884..e3faa36507c6 100644 --- a/packages/vscode/src/vscode.scss +++ b/packages/vscode/src/vscode.scss @@ -48,8 +48,8 @@ } .window-appicon { - background-image: url(./vscode-coder.svg) !important; - background-size: 56px !important; + background-image: url(https://www.programschool.com/assets/images/vscode-icon.svg) !important; + background-size: 28px !important; width: 56px !important; margin-right: 4px; }