I am creating a big google spreadsheet with a lot of code in the associated script editor.
I get autocompletion help when I write the period on LINE 1 (see code below), but not when writing the period on LINE 2. Is it possible to use JSDoc syntax to get autocomplete help when writing the period on LINE 2 also?
I have not succeeded getting this to work for normal javascript objects nor Spreadsheet related objects. I'm 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...
};
Auto complete using JSDoc for non GAS functions works for code added as a Library not inline to the same script. It is a limited IDE in that respect.
https://developers.google.com/apps-script/guide_libraries#guidelines
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With