I am creating a library for use in google apps script and am having some trouble with the JSDoc Style Documentation so that the IDE autocomplete will work for the end user.
All of the methods entered as User.prototype.METHODNAME should show up in the autocomplete for this library. Currently only the .getEmail() method appears in the autocomplete for a User object. The .getName() .getPassword() .hasPaid() etc. methods should also appear but do not. What's particularly strange is that when I swap the method names (and only the method names) of .getEmail() and .getId() the IDE still shows .getEmail() as the only option, and runs the original .getId() method.
Here is the library key to a mock library without sensitive information for testing purposes: M1TqnX8hyIa1H8ikAojXirsqqTKXVxxXC
/**
*@param {Number} id
*@param {String} email
*@param {String} name
*@param {String} password
*@return {User} User
*/
function User(id, email, name, password){
var ss = SpreadsheetApp.openById("INSERT SPREADSHEET HERE").getSheetByName("Users");
var data = ss.getRange(1, 1, ss.getLastRow(), ss.getLastColumn()).getValues();
for (var i = 1; i < data.length; i++){
if (data[i][0] == id){
this.id = id;
this.email = data[i][1];
this.name = data[i][2];
this.password = data[i][3];
this.picks = data[i][4];
this.paid = data[i][5];
}
}
return this;
}
/**
* @param {Number} id ID of the user
* @return {User} User
*/
function getUserById(id){
var user = new User(id, null, null, null);
return user;
}
/**
* @param {String} email email of the user
* @param {String} name name of the user
* @return {User} User
*/
function getUserByEmailAndName(email, name){
return new User(null, email, name, null);
}
/**
*@return {Boolean} isCorrect
*/
User.prototype.checkPassword = function (password){ return this.password == Utilities.base64Encode(password); }
User.prototype.getEmail = function (){return this.email;}
/**
*@return {Number} id
*/
User.prototype.getId = function (){return this.id;}
/**
*@return {String} name
*/
User.prototype.getName = function (){return this.name;}
/**
*@return {String} encodedPassword
*/
User.prototype.getPassword = function (){return this.password;}
/**
*@return {String} jsonPicks
*/
User.prototype.getPicksAsString = function (){return this.picks;}
/**
*@return {JSON} jsonPicks
*/
User.prototype.getPicksAsJson = function (){return Utilities.jsonParse(this.picks);}
/**
*@return {Boolean} hasPaid
*/
User.prototype.hasPaid = function (){return this.paid;}