我如何获得建议? [英] How do I get a suggestions?
问题描述
在输入由用户创建的功能的google脚本时,是否可能获得弹出式建议?与内置函数类似:SpreadsheetApp. -> getActiveSheet(),但让我的functionName()看到参数和返回值的类型?
Is it possible to get pop-up suggestion while typing in google script for functions created by user? Similar to built-in functions: SpreadsheetApp. -->getActiveSheet() but for my functionName() to see arguments and type of return value?
推荐答案
是.
If you mean custom functions in the Google Script environment, then yes, you just need to create a library with your functions. Here is the link with instructions to create your own library. From the Libraries documentation:
您可以使用包含的库,就像使用默认服务一样.例如,如果您选择Test作为您的库的标识符,只需立即键入Test,然后输入一个句点,以查看自动完成信息,其中列出了库的方法.
You can use your included library just as you would use a default service. For instance, if you have chosen Test as an identifier for your library, just type Test immediately followed by a period to see autocomplete information listing the methods of the library.
顺便说一句,查看自动完成的快捷方式是Ctrl +空格键.
By the way, the shortcut to see autocomplete is Ctrl+Space.
如果您是指Google表格中的自定义功能,则可以.您只需要按照以下准则添加评论即可.从自动填充文档:
If you mean custom functions in Google Sheets, then yes you can. You just need to add a comment by following guidelines below. From the Autocomplete documentation:
Google表格支持自定义功能的自动完成功能,就像内置功能一样.在单元格中键入函数名称时,您将看到与您输入内容匹配的内置和自定义函数的列表.
Google Sheets supports autocomplete for custom functions much like for built-in functions. As you type a function name in a cell, you will see a list of built-in and custom functions that matches what you enter.
如果自定义函数的脚本包含JsDoc @customfunction标记,则它将显示在此列表中,如下面的DOUBLE()示例所示.
Custom functions will appear in this list if their script includes a JsDoc @customfunction tag, as in the DOUBLE() example below.
这篇关于我如何获得建议?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!