Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix non-existent files resolving as working directory #594

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ervin7mk
Copy link
Collaborator

@ervin7mk ervin7mk commented Mar 6, 2023

Closes #573.

This commit should fix non-existent files and directories
being shown in the infotree
This commit should fix non-existent files and directories
being shown in the infotree
@mcserep mcserep added Kind: Bug ⚠️ Plugin: C++ Issues related to the parsing and presentation of C++ projects. labels Mar 10, 2023
@mcserep mcserep requested review from mcserep and intjftw March 10, 2023 09:02
}
return fileLoc;
return fileLoc;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unnecessary indentation.

}

return fileLoc;
return fileLoc;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unnecessary indentation.

@@ -77,39 +77,48 @@ void PPIncludeCallback::InclusionDirective(

std::string includedPath = searchPath_.str() + '/' + fileName_.str();
model::FilePtr included = _ctx.srcMgr.getFile(includedPath);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of adding extra indentation everywhere, maybe it was simpler to bring the getFile() calls from line 79 and 94 to the beginning before line 76 and make an early return if either of them is null. It would indicate better that no action is needed in that case.

odb::query<model::CppHeaderInclusion>::included == file->id);

for (const auto& inclusion : inclusions)
if (file)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider using the early return technique if the nesting is too deep.

@mcserep mcserep added the Status: At risk 🚨 Issue or PR which got stuck and progress in work is at risk. label Feb 4, 2024
@mcserep mcserep added this to the Release H* milestone Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Kind: Bug ⚠️ Plugin: C++ Issues related to the parsing and presentation of C++ projects. Status: At risk 🚨 Issue or PR which got stuck and progress in work is at risk.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-existent files are resolved as the working directory file
3 participants