Autocomplete for my functions in google-apps-script editor

Can I get my functions in editor autocomplete using JSDoc?

I am creating a large google spreadsheet with a lot of code in the appropriate script editor.

I get help with autocomplete when I write a period in LINE 1 (see code below) but not when writing a period in LINE 2. Is it possible to use JSDoc syntax to get autocomplete help when writing a period in LINE 2 also

I have not been able to get this to work for regular javascript objects or table related objects. I am interested in both.

/** Failed attempt on getting autocomplete help using JSDoc on a google Range object
* @returns {Range}
*/
function getMyRange() {
  return SpreadsheetApp.getActiveSpreadsheet().getRangeByName('myRange');
};

/** Failed attempt on getting autocomplete help using JSDoc on standard JS-object
* @returns {Array}
*/
function getMyArray() {
  return SpreadsheetApp.getActiveSpreadsheet().getRangeByName('myRange');
};

function test() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();

  // Please think of the code below as 4 separate examples, nothing
  // of the below is meant to compile as it is. It is just 4 separate
  // demonstrations of when I'd like to get autocompletion help and notes
  // on when I do and don't
  ss.getRangeByName('myRange'). // **** LINE 1 **** I get autocomplete
  getMyRange().                 // **** LINE 2 **** No autocomplete

  [].                           // **** LINE 3 **** I get autocomplete
  getMyArray().                 // **** LINE 4 **** No autocomplete...
};

      

+3


source to share


1 answer


Autocomplete using JSDoc functions for non-GAS works for code added as a library not embedded in the same script. In this respect, it is a limited development environment.



https://developers.google.com/apps-script/guide_libraries#guidelines

+5


source







All Articles