-
Notifications
You must be signed in to change notification settings - Fork 102
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
base: master
Are you sure you want to change the base?
Conversation
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
} | ||
return fileLoc; | ||
return fileLoc; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
Closes #573.