Function: renameVariable()
function renameVariable(
workspace,
variable,
opt_callback?
): void;
Defined in: packages/blockly/core/variables.ts:428
Opens a prompt that allows the user to enter a new name for a variable. Triggers a rename if the new name is valid. Or re-prompts if there is a collision.
Parameters
| Parameter | Type | Description |
|---|---|---|
workspace | Workspace | The workspace on which to rename the variable. |
variable | IVariableModel<IVariableState> | Variable to rename. |
opt_callback? | (p1?) => void | A callback. It will be passed an acceptable new variable name, or null if change is to be aborted (cancel button), or undefined if an existing variable was chosen. |
Returns
void