function registerDebugRendererFromName(name) {
  if (!Blockly.registry.hasItem(Blockly.registry.Type.RENDERER, name)) {
    throw Error(
      'No renderer with the name ' +
        name +
        ' is registered. ' +
        'Please register your renderer using Blockly.registry.register.',
    );
  }
  const RendererClass = Blockly.registry.getClass(
    Blockly.registry.Type.RENDERER,
    name,
  );

  const DebugRenderer = createNewRenderer(RendererClass);

  Blockly.registry.register(
    Blockly.registry.Type.RENDERER,
    debugRendererName,
    DebugRenderer,
    true,
  );
}
Creates and registers a renderer that draws debug rectangles on top of the
blocks. This renderer extends the renderer with the given name.
@param {string} name The name of the renderer we want to debug.