logic: Allow duplicate indexing of source files if the indexer command is different
This commit is contained in:
@@ -48,7 +48,7 @@ bool SourceGroupCxxCdb::prepareRefresh()
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<IndexerCommand>> SourceGroupCxxCdb::getIndexerCommands(
|
||||
std::set<FilePath>* filesToIndex, bool fullRefresh)
|
||||
const std::set<FilePath>& filesToIndex, bool fullRefresh)
|
||||
{
|
||||
std::shared_ptr<ApplicationSettings> appSettings = ApplicationSettings::getInstance();
|
||||
|
||||
@@ -100,7 +100,7 @@ std::vector<std::shared_ptr<IndexerCommand>> SourceGroupCxxCdb::getIndexerComman
|
||||
sourcePath = FilePath(command.Directory + '/' + command.Filename).canonical();
|
||||
}
|
||||
|
||||
if (filesToIndex->find(sourcePath) != filesToIndex->end() &&
|
||||
if (filesToIndex.find(sourcePath) != filesToIndex.end() &&
|
||||
sourceFilePathsToIndex.find(sourcePath) != sourceFilePathsToIndex.end())
|
||||
{
|
||||
std::vector<std::string> currentCompilerFlags = compilerFlags;
|
||||
@@ -116,8 +116,6 @@ std::vector<std::shared_ptr<IndexerCommand>> SourceGroupCxxCdb::getIndexerComman
|
||||
frameworkSearchPaths,
|
||||
m_settings->getShouldApplyAnonymousTypedefTransformation()
|
||||
));
|
||||
|
||||
filesToIndex->erase(sourcePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
virtual bool prepareRefresh();
|
||||
|
||||
virtual std::vector<std::shared_ptr<IndexerCommand>> getIndexerCommands(
|
||||
std::set<FilePath>* filesToIndex, bool fullRefresh);
|
||||
const std::set<FilePath>& filesToIndex, bool fullRefresh);
|
||||
|
||||
private:
|
||||
virtual std::shared_ptr<SourceGroupSettingsCxx> getSourceGroupSettingsCxx();
|
||||
|
||||
@@ -19,7 +19,7 @@ SourceGroupType SourceGroupCxxEmpty::getType() const
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<IndexerCommand>> SourceGroupCxxEmpty::getIndexerCommands(
|
||||
std::set<FilePath>* filesToIndex, bool fullRefresh)
|
||||
const std::set<FilePath>& filesToIndex, bool fullRefresh)
|
||||
{
|
||||
std::shared_ptr<ApplicationSettings> appSettings = ApplicationSettings::getInstance();
|
||||
|
||||
@@ -59,7 +59,7 @@ std::vector<std::shared_ptr<IndexerCommand>> SourceGroupCxxEmpty::getIndexerComm
|
||||
std::vector<std::shared_ptr<IndexerCommand>> indexerCommands;
|
||||
for (const FilePath& sourcePath: sourceFilePathsToIndex)
|
||||
{
|
||||
if (filesToIndex->find(sourcePath) != filesToIndex->end())
|
||||
if (filesToIndex.find(sourcePath) != filesToIndex.end())
|
||||
{
|
||||
indexerCommands.push_back(std::make_shared<IndexerCommandCxxManual>(
|
||||
sourcePath,
|
||||
@@ -71,8 +71,6 @@ std::vector<std::shared_ptr<IndexerCommand>> SourceGroupCxxEmpty::getIndexerComm
|
||||
compilerFlags,
|
||||
m_settings->getShouldApplyAnonymousTypedefTransformation()
|
||||
));
|
||||
|
||||
filesToIndex->erase(sourcePath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public:
|
||||
virtual SourceGroupType getType() const;
|
||||
|
||||
virtual std::vector<std::shared_ptr<IndexerCommand>> getIndexerCommands(
|
||||
std::set<FilePath>* filesToIndex, bool fullRefresh);
|
||||
const std::set<FilePath>& filesToIndex, bool fullRefresh);
|
||||
|
||||
private:
|
||||
virtual std::shared_ptr<SourceGroupSettingsCxx> getSourceGroupSettingsCxx();
|
||||
|
||||
Reference in New Issue
Block a user