Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle Apps Script Library Autocomplete
    primarykey
    data
    text
    <p>I am creating a library for use in google apps script and am having some trouble with the <a href="https://developers.google.com/closure/compiler/docs/js-for-compiler" rel="nofollow">JSDoc Style Documentation</a> so that the IDE autocomplete will work for the end user. </p> <p>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. </p> <p>Here is the library key to a mock library without sensitive information for testing purposes: M1TqnX8hyIa1H8ikAojXirsqqTKXVxxXC</p> <pre><code>/** *@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 &lt; 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;} </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload