JSDoc for showing optional arguments in Google Sheets autocomplete dropdown

╄→尐↘猪︶ㄣ 提交于 2019-12-20 02:54:06

问题


I'd like to document (in the Google Sheet autocomplete) a custom function with optional arguments, similar to the WEEKDAY function (autocomplete below).

The JSDoc spec on optional arguments does not work. Google does not seem to document this anywhere. How can I create a function with the same visual treatment (both in the argument description and the Example) that Google has?

/**
 * Summary of function
 * @param {"example"} arg Argument description
 * @param {"optional"} opt_arg This argument is optional
 * @return {String} Return value description
 * @customfunction
 */
function JSDOC(arg, opt_arg) {
  return
}

Generates this autocomplete:

This is not a duplicate. I'm specifically asking about optional arguments, as you can see, I've successfully gotten the autocomplete's other features working.


回答1:


Google Apps Script doesn't support optional params in their JSDoc at this moment.



来源:https://stackoverflow.com/questions/54383589/jsdoc-for-showing-optional-arguments-in-google-sheets-autocomplete-dropdown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!