Joh*_*ohn 2 ide autocomplete google-apps-script
我开始使用 Google Apps 脚本,发现自动完成功能非常有用。但是,一旦您进入一个新函数,自动完成功能似乎无法知道参数的类型。我已经看到一些关于 python 想法的答案,说使用 javadoc 会起作用。但我无法弄清楚。有什么建议?
function myfunc1(){
var activeSheet=SpreadsheetApp.getActiveSheet();
activeSheet//.autocomplete works here
myfunc2(activeSheet)
}
function myfunc2(myActiveSheet){
myActiveSheet//.autocomplete doesn't work here
}
Run Code Online (Sandbox Code Playgroud)
用户界面在自动完成方面可以做什么是有限制的。
通常我只是在另一个选项卡中打开参考文档并引用它,但您也可以使用注释欺骗 UI 自动完成:
function myfunc2(myActiveSheet){
/*
var myActiveSheet = SpreadsheetApp.getActiveSheet()
*/
myActiveSheet //.autocomplete now works here
}
Run Code Online (Sandbox Code Playgroud)