blockly > WorkspaceSvg > renameVariableById

WorkspaceSvg.renameVariableById() method

Rename a variable by updating its name in the variable map. Update the flyout to show the renamed variable immediately.

Signature:

renameVariableById(id: string, newName: string): void;

Parameters

Parameter Type Description
id string ID of the variable to rename.
newName string New variable name.

Returns:

void