ide: fix goto line from find in files not working because results (code) mistaken...
[sdk] / ide / src / project / Project.ec
index 988cbfe..013772f 100644 (file)
@@ -1349,6 +1349,42 @@ private:
    }
 
 #ifndef MAKEFILE_GENERATOR
+   ProjectNode GetObjectFileNode(const char * filePath)
+   {
+      ProjectNode node = null;
+      char ext[MAX_EXTENSION];
+      GetExtension(filePath, ext);
+      if(ext[0])
+      {
+         IntermediateFileType type = IntermediateFileType::FromExtension(ext);
+         if(type)
+         {
+            char fileName[MAX_FILENAME];
+            GetLastDirectory(filePath, fileName);
+            if(fileName[0])
+            {
+               DotMain dotMain = DotMain::FromFileName(fileName);
+               node = FindNodeByObjectFileName(fileName, type, dotMain, null);
+            }
+         }
+      }
+      return node;
+   }
+
+   bool GetAbsoluteFromRelativePath(const char * relativePath, char * absolutePath)
+   {
+      ProjectNode node = topNode.FindWithPath(relativePath, false);
+      if(!node)
+         node = GetObjectFileNode(relativePath);
+      if(node)
+      {
+         strcpy(absolutePath, node.project.topNode.path);
+         PathCat(absolutePath, relativePath);
+         MakeSlashPath(absolutePath);
+      }
+      return node != null;
+   }
+
    void MarkChanges(ProjectNode node)
    {
       for(cfg : topNode.configurations)
@@ -1564,11 +1600,12 @@ private:
                      ; // ignore this new gnu make error but what is it about?
                   else if(strstr(line, compiler.makeCommand) == line && line[lenMakeCommand] == ':')
                   {
-                     const char * module = strstr(line, "No rule to make target `");
+                     const char * moduleBackTick = strstr(line, "No rule to make target `");
+                     const char * module = moduleBackTick ? moduleBackTick : strstr(line, "No rule to make target '");
                      if(module)
                      {
                         char * end;
-                        module = strchr(module, '`') + 1;
+                        module = strchr(module, moduleBackTick ? '`' : '\'') + 1;
                         end = strchr(module, '\'');
                         if(end)
                         {
@@ -1744,6 +1781,11 @@ private:
                                  message = $"Linker Message: ";
                                  colon = line;
                               }
+                              else if(SearchString(colon, 0, "warning:", false, false))
+                              {
+                                 message = $"Linker Warning: ";
+                                 colon = line;
+                              }
                               else
                               {
                                  numErrors++;