Skip to content

Google Apps Script editor extension

Find Apps Script errors before you run your code.

A Chrome extension for people who write Apps Script at script.google.com. It underlines slow spreadsheet loops, malformed email recipients, broken cross-file calls, and type errors while you type, and offers a quick fix you can preview before you apply it. Diagnostics are free without an account.

Example Problems list: three diagnostics myFunction reports in an Apps Script project, with the quick fix available for each.
linecodeproblemquick fix
4MF90001getValue() inside a loop reads one cell at a time. Read a rectangular range once with getValues() when the cells can be batched. preview
9MF91003Invalid comma-separated list of email addresses guidance
14TS2552Cannot find name 'notifyTeam'. Did you mean 'notifyTeams'? preview

Side by side

The same code, with myFunction off and on.

Each pair shows the same example in the native editor and with myFunction turned on. The extension-off captures are from September 17. The myFunction captures were refreshed on October 19 using extension 0.14.2. No script was run.

Spot a cell-by-cell read loop

The same range is read one cell at a time inside a loop.

range.getCell(row, 1).getValue()
Native Apps Script Same code · Extension off
Native Apps Script editor showing a getValue loop with no warning
No loop warning The native editor shows this loop with no performance warning.
With myFunction Performance check · MF90001
myFunction warns about repeated getValue calls and offers a batched getValues read
A warning and a batching suggestion myFunction underlines the repeated reads and offers a batching fix that reads the range once with getValues(). The fix needs your review: check that the loop does not change the values being read before you apply it.

Quick fix preview

Review a quick fix before applying it.

A misspelled method stops a script at runtime. myFunction underlines it while you edit and offers the correction as a quick fix. Nothing changes until you apply it.

Captured in Apps Script Quick-fix preview
myFunction quick-fix preview comparing a misspelled service method with its proposed correction
Review the change, then apply it The preview shows the proposed change. Apply the fix, or close the preview to keep editing.

Inside the editor

Checks the native editor does not run.

The native Apps Script editor offers basic autocomplete and tooltips. It does not warn about a loop that can hit the 6-minute execution limit, a malformed literal value, or a call to a function that no longer exists in another file. myFunction adds those checks.

Loop batching for slow spreadsheet reads

Underlines getValue, setValue, flush, and UrlFetchApp calls repeated inside a loop. For a supported read loop, a quick fix reads the range once with getValues(), which helps keep the script under the 6-minute execution limit. Review it before applying: the loop must not change the values being read.

Checks on literal values

Underlines a malformed email address in a recipient list, an invalid regular expression, or an unknown enum value while you type the string, before the script runs.

Diagnostics across every file

Apps Script files share one global scope. myFunction indexes every .gs file in the open project, so a call to a function renamed in another file is marked where you make it, and a function defined in two files is marked in both.

JSDoc types inferred from calls

A function without JSDoc leaves its parameters as any. myFunction reads how the function is called across the project and offers a quick fix that writes the JSDoc parameter types for you.

Types generated from the Apps Script runtime

Declarations for SpreadsheetApp, GmailApp, DriveApp, and the other built-in services are generated from the live Apps Script runtime. Declarations for the 31 advanced services come from Google API Discovery documents.

Errors marked as you type

A misspelled method, a missing argument, or an argument of the wrong type is underlined while you type. Where the correction is known, a rule-based quick fix offers it.

Loop batching

Read the range once, then loop over the values.

Reading cells one at a time makes one service call per cell. For a loop like this one, myFunction offers a batching fix that reads the range once with getValues() and loops over the returned array.

The comparison below matches the fix offered for the captured loop (MF90001). The fix needs your review before you apply it: check that the loop does not change the values being read.

Read the diagnostic: service call inside a loop

Repeated remote call · MF90001 1 changed line
function readStatuses() {
  const sheet = SpreadsheetApp.getActiveSheet();
  const rows = 20;
  const range = sheet.getRange(2, 3, rows, 1);
  const statuses = [];

  for (let row = 1; row <= rows; row++) {
    statuses.push(range.getCell(row, 1).getValue());
  }

  return statuses;
}
Proposed batching fix 2 changed lines
function readStatuses() {
  const sheet = SpreadsheetApp.getActiveSheet();
  const rows = 20;
  const range = sheet.getRange(2, 3, rows, 1);
  const statuses = [];

  const myFunctionValues = range.getValues();
  for (let row = 1; row <= rows; row++) {
    statuses.push(myFunctionValues[row - 1][0]);
  }

  return statuses;
}

Value validation

Check literal values such as email recipients.

Apps Script declares mail recipients, folder paths, and URLs as plain strings. myFunction checks a literal value against the format the parameter expects (MF91003) and underlines a malformed email address, including one inside a comma-separated CC list.

Captured in Apps Script Value validation · MF91003
myFunction Problems panel warning about an invalid comma-separated list of email addresses
Validate MailApp recipients The Problems panel flags the malformed recipient list before the code runs.

Types inferred from calls

Add JSDoc types from how a function is called.

A function without JSDoc leaves its parameters as any. myFunction follows the calls to that function across your project and offers a quick fix (TS7006) that infers each parameter type and writes the JSDoc annotation.

Captured in Apps Script Quick fix · TS7006
myFunction preview adding a SpreadsheetApp.Range JSDoc type inferred from a function call
Infer parameter types from usage Review the inferred parameter type, then apply the JSDoc annotation.

Limits

What myFunction cannot do.

NO Run your functions
myFunction never runs your script. You run it from the Apps Script editor.
NO Run tests for you
It can propose test code, but you run the tests yourself.
NO Create versions or deployments
Versions and deployments change only when you change them.
NO Change code on its own
A quick fix changes text in your open editor only when you apply it. There is no auto-save or auto-apply mode.

Questions

Frequently asked questions.

Does myFunction run my Apps Script functions?
No. myFunction reports diagnostics and offers quick fixes. You run the script yourself from the Apps Script editor.
Does myFunction change or save my project automatically?
No. A quick fix changes the text in your open editor only when you apply it. If you turn on Format on Save, which is off by default, myFunction formats the file in the editor when you save. It never saves, deploys, or runs your code.
Do I need an account to use myFunction?
No. Diagnostics, autocomplete, hover documentation, navigation, and rule-based quick fixes work without an account. Sign in with Google only for AI quick fixes, JSDoc generation, and explanations, or to subscribe to myFunction Pro.
What does myFunction add to the Apps Script editor?
Checks for service calls repeated inside loops, checks on literal values such as email recipients, diagnostics across every file in the project, hover documentation, signature help, and quick fixes, all based on declarations generated from the Apps Script runtime.

Install for Chrome

Add the checks to your Apps Script editor.

Diagnostics, autocomplete, hover documentation, navigation, and rule-based quick fixes are free without an account. Sign in with Google for 5 AI quick fixes, JSDoc generations, or explanations a month, or subscribe to myFunction Pro at $5.99/month to remove the monthly limit.