Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,10 @@ private IFile getFileForCMakePath(String sourceFileName, IProject project)
pathtolookfor = getIdfToolsPath();
startIndex = sourceFile.indexOf(pathtolookfor);
}
if (startIndex == -1) // source file still not found means it was part of another esp-idf
{
return null;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That meanspathtolookfor = getIdfToolsPath(); was not returning the correct IDF_PATH, I wonder why IDF_PATH is not configured correctly and what are the other issues it might cause!

If user switched to a different esp-idf version then IDF_PATH would have modified accordingly.

Copy link
Collaborator Author

@sigmaaa sigmaaa Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kolipakakondal, the IDF_PATH from getIdfToolsPath() is correct, the issue happens because sourceFile is pointing to the different esp-idf. I think the sourceFile is provided based on the files from the build folder. This issue happens when we build the project with the different esp-idf version, then switch esp-idf and trying to build project again without cleaning build folder

String relativePath = sourceFile.substring(startIndex + pathtolookfor.length() + 1);

IPath projectPath = getComponentsPath().append(relativePath);
Expand Down