0
function onEdit(e)
  e... //I want auto completion
  var range = e.range();
  e.... //I want auto completion
}

How to force auto completion on a variable such as in onEdit, is there a way to explicitly specify what type e is for the purposes of auto completion?

  1. how to see what the datatype of e is.
  2. how to explicitly specify e is that datatype for auto completion in the google app script editor.
CodeCamper
  • 5,714
  • 5
  • 39
  • 85
  • 1
    Generally this is only available for already-typed items e.g. the return values of natively defined methods. So the "solution" is to use a tool like `clasp` and work on your code from an editor that supports type deduction – tehhowch Nov 18 '19 at 04:43
  • @tehhowch that's a shame, I seem to be able to glitch it to work sometimes by forcibly declaring known objects with the same name but sometimes it backfires. – CodeCamper Nov 18 '19 at 04:58
  • 1
    Do yourself a favor and use [tag:clasp]. You can use jsdoc or typescript for auto completion with built-in type files. – TheMaster Nov 18 '19 at 05:55
  • 1
    Does this answer your question? [Enabling autocomplete for Google Apps Script in locally-installed IDE](https://stackoverflow.com/questions/49015874/enabling-autocomplete-for-google-apps-script-in-locally-installed-ide) – TheMaster Nov 18 '19 at 05:56

1 Answers1

0

I'm posting this as community wiki for documentation purposes.

As others already said in comments, you cannot use autocomplete for event objects using Apps Script editor.

The workaround, then, also as referenced by other users, would be to use clasp and work with an IDE with which you can enable autocomplete.

Iamblichus
  • 16,112
  • 2
  • 9
  • 25