@@ -36,9 +36,9 @@ export class Editor {
3636 private blocklyWorkspace : Blockly . WorkspaceSvg ;
3737 private currentModule : commonStorage . Module | null = null ;
3838 private modulePath : string = '' ;
39- private workspacePath : string = '' ;
39+ private projectPath : string = '' ;
4040 private moduleContent : string = '' ;
41- private workspaceContent : string = '' ;
41+ private projectContent : string = '' ;
4242 private bindedOnChange : any = null ;
4343 private toolbox : Blockly . utils . toolbox . ToolboxDefinition = EMPTY_TOOLBOX ;
4444
@@ -59,11 +59,11 @@ export class Editor {
5959
6060 // TODO(lizlooney): As blocks are loaded, determine whether any blocks
6161 // are accessing variable or calling functions thar are defined in another
62- // blocks file (like a Workspace ) and check whether the variable or function
62+ // blocks file (like a Project ) and check whether the variable or function
6363 // definition has changed. This might happen if the user defines a variable
64- // or function in the Workspace , uses the variable or function in the
64+ // or function in the Project , uses the variable or function in the
6565 // OpMode, and then removes or changes the variable or function in the
66- // Workspace .
66+ // Project .
6767
6868 // TODO(lizlooney): We will need a way to identify which variable or
6969 // function, other than by the variable name or function name, because the
@@ -74,15 +74,15 @@ export class Editor {
7474 // TODO(lizlooney): Look at blocks with type 'mrc_get_python_variable' or
7575 // 'mrc_set_python_variable', and where block.mrcExportedVariable === true.
7676 // Look at block.mrcImportModule and get the exported blocks for that module.
77- // (It should be the workspace and we already have the workspace content.)
77+ // (It should be the project and we already have the project content.)
7878 // Check whether block.mrcActualVariableName matches any exportedBlock's
7979 // extraState.actualVariableName. If there is no match, put a warning on the
8080 // block.
8181
8282 // TODO(lizlooney): Look at blocks with type 'mrc_call_python_function' and
8383 // where block.mrcExportedFunction === true.
8484 // Look at block.mrcImportModule and get the exported blocks for that module.
85- // (It should be the workspace and we already have the workspace content.)
85+ // (It should be the project and we already have the project content.)
8686 // Check whether block.mrcActualFunctionName matches any exportedBlock's
8787 // extraState.actualFunctionName. If there is no match, put a warning on the block.
8888 // If there is a match, check whether
@@ -106,13 +106,13 @@ export class Editor {
106106 this . currentModule = currentModule ;
107107 if ( currentModule ) {
108108 this . modulePath = currentModule . modulePath ;
109- this . workspacePath = commonStorage . makeWorkspacePath ( currentModule . workspaceName ) ;
109+ this . projectPath = commonStorage . makeProjectPath ( currentModule . projectName ) ;
110110 } else {
111111 this . modulePath = '' ;
112- this . workspacePath = '' ;
112+ this . projectPath = '' ;
113113 }
114114 this . moduleContent = '' ;
115- this . workspaceContent = '' ;
115+ this . projectContent = '' ;
116116 this . clearBlocklyWorkspace ( ) ;
117117
118118 if ( currentModule ) {
@@ -125,30 +125,30 @@ export class Editor {
125125 }
126126 if ( moduleContent ) {
127127 this . moduleContent = moduleContent ;
128- if ( this . workspacePath === this . modulePath ) {
129- this . workspaceContent = moduleContent
128+ if ( this . projectPath === this . modulePath ) {
129+ this . projectContent = moduleContent
130130 }
131131
132- // If both the workspace content and the module content have been
132+ // If both the project content and the module content have been
133133 // loaded, load the blocks into the blockly workspace.
134- if ( this . workspaceContent ) {
134+ if ( this . projectContent ) {
135135 this . loadBlocksIntoBlocklyWorkspace ( ) ;
136136 }
137137 }
138138 }
139139 ) ;
140- if ( this . workspacePath !== this . modulePath ) {
140+ if ( this . projectPath !== this . modulePath ) {
141141 storage . fetchModuleContent (
142- this . workspacePath ,
143- ( workspaceContent : string | null , errorMessage : string ) => {
142+ this . projectPath ,
143+ ( projectContent : string | null , errorMessage : string ) => {
144144 if ( errorMessage ) {
145145 alert ( errorMessage ) ;
146146 return ;
147147 }
148- if ( workspaceContent ) {
149- this . workspaceContent = workspaceContent ;
148+ if ( projectContent ) {
149+ this . projectContent = projectContent ;
150150
151- // If both the workspace and the module have been loaded, load the
151+ // If both the project and the module have been loaded, load the
152152 // blocks into the blockly workspace.
153153 if ( this . moduleContent ) {
154154 this . loadBlocksIntoBlocklyWorkspace ( ) ;
@@ -189,22 +189,22 @@ export class Editor {
189189
190190 public updateToolbox ( shownPythonToolboxCategories : Set < string > ) : void {
191191 if ( this . currentModule ) {
192- if ( this . currentModule . moduleType === commonStorage . MODULE_TYPE_WORKSPACE ) {
193- // If we are editing a Workspace , we don't add any additional blocks to
192+ if ( this . currentModule . moduleType === commonStorage . MODULE_TYPE_PROJECT ) {
193+ // If we are editing a Project , we don't add any additional blocks to
194194 // the toolbox.
195195 this . setToolbox ( getToolboxJSON ( [ ] , shownPythonToolboxCategories ) ) ;
196196 return ;
197197 }
198- // Otherwise, we add the exported blocks from the Workspace .
199- if ( ! this . workspaceContent ) {
200- // The workspace content hasn't been fetched yet. Try again in a bit.
198+ // Otherwise, we add the exported blocks from the Project .
199+ if ( ! this . projectContent ) {
200+ // The Project content hasn't been fetched yet. Try again in a bit.
201201 setTimeout ( ( ) => {
202202 this . updateToolbox ( shownPythonToolboxCategories )
203203 } , 50 ) ;
204204 return ;
205205 }
206206 const exportedBlocks = commonStorage . extractExportedBlocks (
207- this . currentModule . workspaceName , this . workspaceContent ) ;
207+ this . currentModule . projectName , this . projectContent ) ;
208208 this . setToolbox ( getToolboxJSON ( exportedBlocks , shownPythonToolboxCategories ) ) ;
209209 }
210210 }
0 commit comments