google-apps-script – 自动填充不起作用 – Google App脚本

我在使用Google App Script中的自动填充功能时遇到问题.

内置方法,如SpreadsheetApp.将提供一个自动完成菜单,其中包含可供选择的方法.

但是,如果我创建自己的子对象,自动完成会工作一段时间,然后它就会停止工作.

例如:

var skywardRoster = SpreadsheetApp.getActiveSheet();

skywardRoster.会产生一段时间的方法选项,然后停止.

但是,代码仍然起作用,如果我手动输入代码,方法也可以工作,所以我知道声明必须正确.菜单根本不会出现,并且在我去的时候必须单独查找每个方法非常不方便.

我试过:打破变量并重新输入该行;将代码复制并粘贴回编辑器;使用不同浏览器;复制gs文件本身并在副本中工作;并完全退出并重新登录.似乎没有什么可以恢复工作.

我对编码很新,我不确定是什么导致这种情况.

有谁知道如何解决这个问题?

最佳答案 您可能想要检查
Built-in Google Services:Using autocomplete

The script editor provides a “content assist” feature, more commonly called “autocomplete,” which reveals the global objects as well as methods and enums that are valid in the script’s current context. To show autocomplete suggestions, select the menu item Edit > Content assist or press Ctrl+Space. Autocomplete suggestions also appear automatically whenever you type a period after a global object, enum, or method call that returns an Apps Script class. For example:

  • If you click on a blank line in the script editor and activate autocomplete, you will see a list of the global objects.
  • If you type the full name of a global object or select one from autocomplete, then type . (a period), you will see all methods and enums for that class.
  • If you type a few characters and activate autocomplete, you will see all valid suggestions that begin with those characters.
点赞