refactor: make VariableMap implement IVariableMap. (#8395)

* refactor: make VariableMap implement IVariableMap.

* chore: remove unused arrayUtils import.

* chore: fix comment on variable map backing store.

* chore: Added JSDoc to new VariableMap methods.

* chore: Improve test descriptions.
This commit is contained in:
Aaron Dodson
2024-07-19 10:53:16 -07:00
committed by GitHub
parent 107403bc0f
commit 02e64bebbe
4 changed files with 164 additions and 71 deletions

View File

@@ -610,7 +610,11 @@ function createVariable(
// Create a potential variable if in the flyout.
let variable = null;
if (potentialVariableMap) {
variable = potentialVariableMap.createVariable(opt_name, opt_type, id);
variable = potentialVariableMap.createVariable(
opt_name,
opt_type,
id ?? undefined,
);
} else {
// In the main workspace, create a real variable.
variable = workspace.createVariable(opt_name, opt_type, id);