logic: reduced overhead in indexed files for indexer commands generated from CDB

* done by removing unrelated .cpp files from the indexed files because they don't get indexed by the respective compilation unit
This commit is contained in:
mlangkabel
2018-06-18 18:11:43 +02:00
parent f11be042a6
commit 009404dd37
2 changed files with 9 additions and 12 deletions
+9 -11
View File
@@ -40,7 +40,11 @@ std::set<FilePath> SourceGroupCxxCdb::filterToContainedFilePaths(const std::set<
{
std::set<FilePath> containedFilePaths;
const std::set<FilePath> indexedPaths = getIndexedPaths();
const std::set<FilePath> indexedPaths = utility::concat(
getAllSourceFilePaths(),
utility::toSet(m_settings->getIndexedHeaderPathsExpandedAndAbsolute())
);
const std::vector<FilePathFilter> excludeFilters = m_settings->getExcludeFiltersExpandedAndAbsolute();
for (const FilePath& filePath : filePaths)
@@ -121,7 +125,7 @@ std::vector<std::shared_ptr<IndexerCommand>> SourceGroupCxxCdb::getIndexerComman
const std::vector<std::wstring> compilerFlags = m_settings->getCompilerFlags();
const std::set<FilePath> indexedPaths = getIndexedPaths();
const std::set<FilePath> indexedHeaderPaths = utility::toSet(m_settings->getIndexedHeaderPathsExpandedAndAbsolute());
const std::set<FilePathFilter> excludeFilters = utility::toSet(m_settings->getExcludeFiltersExpandedAndAbsolute());
std::vector<std::shared_ptr<IndexerCommand>> indexerCommands;
@@ -160,7 +164,7 @@ std::vector<std::shared_ptr<IndexerCommand>> SourceGroupCxxCdb::getIndexerComman
{
indexerCommands.push_back(std::make_shared<IndexerCommandCxxCdb>(
sourcePath,
indexedPaths,
utility::concat(indexedHeaderPaths, { sourcePath }),
excludeFilters,
std::set<FilePathFilter>(),
FilePath(utility::decodeFromUtf8(command.Directory)),
@@ -171,6 +175,8 @@ std::vector<std::shared_ptr<IndexerCommand>> SourceGroupCxxCdb::getIndexerComman
systemHeaderSearchPaths,
frameworkSearchPaths
));
LOG_INFO(std::wstring(L"IndexerCommand: ") + IndexerCommandCxxCdb::serialize(indexerCommands.front()).c_str());
return indexerCommands;
}
}
}
@@ -187,11 +193,3 @@ std::shared_ptr<const SourceGroupSettings> SourceGroupCxxCdb::getSourceGroupSett
{
return m_settings;
}
std::set<FilePath> SourceGroupCxxCdb::getIndexedPaths() const
{
std::set<FilePath> indexedPaths;
utility::append(indexedPaths, getAllSourceFilePaths());
utility::append(indexedPaths, utility::toSet(m_settings->getIndexedHeaderPathsExpandedAndAbsolute()));
return indexedPaths;
}
-1
View File
@@ -22,7 +22,6 @@ public:
private:
std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override;
std::shared_ptr<const SourceGroupSettings> getSourceGroupSettings() const override;
std::set<FilePath> getIndexedPaths() const;
std::shared_ptr<SourceGroupSettingsCxxCdb> m_settings;
};