Pass in workspace object to workspaceToCode to be consistent with the
related methods.