function populateGridOptions(gridFolder, options, saveOptions, onChange) {
  setTooltip(
    gridFolder.add(options.gridOptions, 'spacing', 0, 50).onChange((value) =>
      onChange('grid', {
        ...saveOptions.grid,
        spacing: value,
      }),
    ),
    `The distance between the grid's points.`,
  );
  setTooltip(
    gridFolder.add(options.gridOptions, 'length', 0, 30).onChange((value) =>
      onChange('grid', {
        ...saveOptions.grid,
        length: value,
      }),
    ),
    'The shape of the grid points. A length of 0 results in an invisible' +
      ' grid (but still one that may be snapped to), a length of 1 (the' +
      ' default value) results in dots, a longer length results in crosses, ' +
      'and a length equal or greater than the spacing results in graph paper.',
  );
  setTooltip(
    gridFolder.addColor(options.gridOptions, 'colour').onChange((value) =>
      onChange('grid', {
        ...saveOptions.grid,
        colour: value,
      }),
    ),
    'The colour of the grid points.',
  );
  setTooltip(
    gridFolder.add(options.gridOptions, 'snap').onChange((value) =>
      onChange('grid', {
        ...saveOptions.grid,
        snap: value,
      }),
    ),
    'Whether blocks should snap to the nearest grid point when placed on' +
      ' the workspace.',
  );
}
Populate grid options.
@param {dat.GUI} gridFolder The dat.GUI grid options folder.
@param {Blockly.Options} options Blockly options.
@param {Blockly.BlocklyOptions} saveOptions Saved Blockly options.
@param {function(string, *):void} onChange On Change method.