refactor!: Finish refactor of `WorkspaceSvg` `VariableMap` methods by cpcallen · Pull Request #8946 · RaspberryPiFoundation/blockly
Delete the following methods from WorkspaceSvg: - renameVariableById - deleteVariableById - createVariable Modify the following methods on VariableMap to call this.workspace.refreshToolboxSelection() if this.workspace is a WorkspaceSvg, replicating the behaviour of the aforementioned deleted methods and additionally ensuring that that method is called following any change to the variable map: - renameVariable - changeVariableType - renameVariableAndUses - createVariable - addVariable - deleteVariable BREAKING CHANGE: This change ensures that the toolbox will be refreshed regardless of what route the VaribleMap was updated, rather than only being refreshed when it is updated via calls to methods on WorkspaceSvg. Overall this is much more likely to fix a bug (where the toolbox wasn't being refreshed when it should have been) than cause one (by refreshing the toolbox when it shouldn't be), but this is still a behaviour change which could _conceivably_ result an unexpected regression.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters