logic: Allow duplicate indexing of source files if the indexer command is different

This commit is contained in:
Eberhard Graether
2017-11-09 17:24:28 +01:00
parent ae37145d22
commit ead9f9a634
10 changed files with 24 additions and 19 deletions
+2 -4
View File
@@ -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);
}
}
}
+1 -1
View File
@@ -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();
+2 -4
View File
@@ -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);
}
}
+1 -1
View File
@@ -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();