logic: Fixed source files within CDB not indexed unless within Indexed Header Paths
This commit is contained in:
@@ -2,20 +2,35 @@
|
||||
|
||||
#include "utility/file/FilePath.h"
|
||||
|
||||
FileRegister::FileRegister(const FileRegisterStateData& stateData, const std::set<FilePath>& indexedPaths, const std::set<FilePath>& excludedPaths)
|
||||
FileRegister::FileRegister(
|
||||
const FileRegisterStateData& stateData,
|
||||
const FilePath& currentPath,
|
||||
const std::set<FilePath>& indexedPaths,
|
||||
const std::set<FilePath>& excludedPaths
|
||||
)
|
||||
: m_stateData(stateData)
|
||||
, m_currentPath(currentPath)
|
||||
, m_indexedPaths(indexedPaths)
|
||||
, m_excludedPaths(excludedPaths)
|
||||
, m_hasFilePathCache(
|
||||
[&](std::string f){
|
||||
const FilePath filePath(f);
|
||||
bool ret = false;
|
||||
for (const FilePath& indexedPath: m_indexedPaths)
|
||||
|
||||
if (filePath == m_currentPath)
|
||||
{
|
||||
if (indexedPath.contains(filePath))
|
||||
ret = true;
|
||||
}
|
||||
|
||||
if (!ret)
|
||||
{
|
||||
for (const FilePath& indexedPath: m_indexedPaths)
|
||||
{
|
||||
ret = true;
|
||||
break;
|
||||
if (indexedPath.contains(filePath))
|
||||
{
|
||||
ret = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,12 @@
|
||||
class FileRegister
|
||||
{
|
||||
public:
|
||||
FileRegister(const FileRegisterStateData& stateData, const std::set<FilePath>& indexedPaths, const std::set<FilePath>& excludedPaths);
|
||||
FileRegister(
|
||||
const FileRegisterStateData& stateData,
|
||||
const FilePath& currentPath,
|
||||
const std::set<FilePath>& indexedPaths,
|
||||
const std::set<FilePath>& excludedPaths
|
||||
);
|
||||
virtual ~FileRegister();
|
||||
|
||||
const FileRegisterStateData& getStateData() const;
|
||||
@@ -21,6 +26,7 @@ public:
|
||||
|
||||
private:
|
||||
FileRegisterStateData m_stateData;
|
||||
const FilePath& m_currentPath;
|
||||
const std::set<FilePath> m_indexedPaths;
|
||||
const std::set<FilePath> m_excludedPaths;
|
||||
mutable Cache<std::string, bool> m_hasFilePathCache;
|
||||
|
||||
Reference in New Issue
Block a user