From 4d55f8d2df3c521225ee7dab750db7c31f0744cc Mon Sep 17 00:00:00 2001 From: Liz Looney Date: Sat, 28 Jun 2025 14:20:29 -0700 Subject: [PATCH] Revert PR 131 because workspace.getVariableMap() doesn't return an object that has getAllVariables or getVariableUsesById functions. --- src/editor/extended_python_generator.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/editor/extended_python_generator.ts b/src/editor/extended_python_generator.ts index cd2ddcef..24013b7b 100644 --- a/src/editor/extended_python_generator.ts +++ b/src/editor/extended_python_generator.ts @@ -248,12 +248,12 @@ export class ExtendedPythonGenerator extends PythonGenerator { exportedBlocks.push(callFunctionBlock); } - const allVariables = workspace.getVariableMap().getAllVariables(); + const allVariables = workspace.getAllVariables(); for (const variableModel of allVariables) { // Only variables that are used outside of functions are exported. (I'm not sure if this is // the right choice, since all blockly variables are global variables.) let exported = false; - const variableUsesById = workspace.getVariableMap().getVariableUsesById(variableModel.getId()) + const variableUsesById = workspace.getVariableUsesById(variableModel.getId()) if (variableUsesById.length === 0) { continue; }