2

If I construct a class in AppScript and add a method, is it possible to get the autocomplete feature to work when I type a period after an instance of that class?

Google's documentation says "If you want your library users to make use of Script Editor autocomplete and the automatically generated documentation, you must have JSDoc style documentation for all your functions."

I'm not sure if it's possible, or if I'm implementing the JSDoc style documentation incorrectly.

/*
* @constructor
*/
function MyConstructor(){
  this.sayHello = function(){
    return "Hello World!"
  }
}

function run(){
  var foo = new MyConstructor();
  //Is it possible to see autocomplete with "sayHello()" 
  //after typing this period
  var hello = foo.
}
Rubén
  • 34,714
  • 9
  • 70
  • 166
Jared_C
  • 649
  • 1
  • 7
  • 16
  • 1
    When you use the RESOURCES menu, choose LIBRARIES, and add your project key, what happens? When you type the "identifier" and a dot, the function names you've created should show up in a list. You might not get the documentation, but there should be a list of functions. – Alan Wells Mar 07 '15 at 18:28
  • Yes, I get the function list, but I want to get autocomplete at the method level. Am I just misunderstanding something? I'm fairly noob. I.e. I want to create my own class with multiple methods and have those pop up with autocomplete. – Jared_C Mar 07 '15 at 20:03

1 Answers1

3

Unfortunately jsdoc only works at the top function level in apps script, so methods declared with this.method = function() {} neither show up in the generated docs nor in autocomplete. It sucks, but there it is.

You could join others in starring this this apps script issue

But it's been open for almost 2 years now, and I don't see any movement on it.

bruce
  • 1,408
  • 11
  • 33