compiler/ide: Various tweaks to buffer sizes for holding command arguments (Buffer...
[sdk] / ide / src / project / Workspace.ec
index a4c794f..49d08aa 100644 (file)
@@ -250,7 +250,11 @@ public:
          
          file.Printf("\n   Execution Data\n");
          if(commandLineArgs && commandLineArgs[0])
-            file.Printf("\n      Command Line Arguments = %s\n", commandLineArgs);
+         {
+            file.Printf("\n      Command Line Arguments = ");
+            file.Puts(commandLineArgs);
+            file.Printf("\n");
+         }
 
          if(environmentVars.count)
          {
@@ -601,6 +605,19 @@ public:
                   project = p;
                   break;
                }
+               // Handle symbol loader modules:
+               {
+                  char moduleName[MAX_FILENAME];
+                  char * sl;
+                  GetLastDirectory(bp.absoluteFilePath, moduleName);
+                  // Tweak for automatically resolving symbol loader modules
+                  sl = strstr(moduleName, ".main.ec");
+                  if(sl && (*sl = 0, !strcmpi(moduleName, p.name)))
+                  {
+                     project = p;
+                     break;
+                  }
+               }
             }
             if(!project)
             {
@@ -886,7 +903,10 @@ Workspace LoadWorkspace(char * filePath, char * fromProjectFile)
                   PathCatSlash(projectFilePath, equal);
                   newProject = LoadProject(projectFilePath);
                   if(newProject)
+                  {
                      workspace.projects.Add(newProject);
+                     newProject.StartMonitoring();
+                  }
                   else if(workspace.projects.count == 0)
                   {
                      delete workspace;
@@ -1093,12 +1113,13 @@ Workspace LoadWorkspace(char * filePath, char * fromProjectFile)
             }
             if(project)
             {
+               project.StartMonitoring();
                workspace.projects.Add(project);
                workspace.name = CopyString(project.name);
             }
             else
             {
-               MessageBox { type = ok, master = ide, contents = "Workspace load file failed", text = "Workspace Load File Error" }.Modal();
+               MessageBox { type = ok, master = ide, contents = $"Workspace load file failed", text = $"Workspace Load File Error" }.Modal();
                delete workspace;
                return null;
             }
@@ -1130,8 +1151,8 @@ Workspace LoadWorkspace(char * filePath, char * fromProjectFile)
                strcat(files, item.name);
             }
 
-            sprintf(title, "File%s not found", s);
-            sprintf(msg, "The following file%s could not be re-opened.%s", s, files);
+            sprintf(title, $"File%s not found", s);
+            sprintf(msg, $"The following file%s could not be re-opened.%s", s, files);
             
             MessageBox { type = ok, master = ide, contents = msg, text = title }.Modal();
 
@@ -1156,6 +1177,7 @@ Workspace LoadWorkspace(char * filePath, char * fromProjectFile)
 
       if(newProject)
       {
+         newProject.StartMonitoring();
          workspace = Workspace { workspaceFile = filePath };
 
          workspace.projects.Add(newProject);