Clang: Add path notifier to symbol indexer

Change-Id: I2a605a5a5ac2511566edd9c069e84b5ec9d95279
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Marco Bubke
2017-12-27 13:20:24 +01:00
parent e94d88c172
commit 2c08ddcd5a
3 changed files with 20 additions and 1 deletions

View File

@@ -34,6 +34,7 @@ SymbolIndexer::SymbolIndexer(SymbolsCollectorInterface &symbolsCollector,
m_symbolStorage(symbolStorage), m_symbolStorage(symbolStorage),
m_pathWatcher(pathWatcher) m_pathWatcher(pathWatcher)
{ {
pathWatcher.setNotifier(this);
} }
void SymbolIndexer::updateProjectParts(V2::ProjectPartContainers &&projectParts, void SymbolIndexer::updateProjectParts(V2::ProjectPartContainers &&projectParts,
@@ -52,4 +53,13 @@ void SymbolIndexer::updateProjectParts(V2::ProjectPartContainers &&projectParts,
m_symbolsCollector.sourceLocations()); m_symbolsCollector.sourceLocations());
} }
void SymbolIndexer::pathsWithIdsChanged(const Utils::SmallStringVector &)
{
}
void SymbolIndexer::pathsChanged(const FilePathIds &filePathIds)
{
}
} // namespace ClangBackEnd } // namespace ClangBackEnd

View File

@@ -34,7 +34,7 @@
namespace ClangBackEnd { namespace ClangBackEnd {
class SymbolIndexer class SymbolIndexer : public ClangPathWatcherNotifier
{ {
public: public:
SymbolIndexer(SymbolsCollectorInterface &symbolsCollector, SymbolIndexer(SymbolsCollectorInterface &symbolsCollector,
@@ -44,6 +44,9 @@ public:
void updateProjectParts(V2::ProjectPartContainers &&projectParts, void updateProjectParts(V2::ProjectPartContainers &&projectParts,
V2::FileContainers &&generatedFiles); V2::FileContainers &&generatedFiles);
void pathsWithIdsChanged(const Utils::SmallStringVector &ids) override;
void pathsChanged(const FilePathIds &filePathIds) override;
private: private:
SymbolsCollectorInterface &m_symbolsCollector; SymbolsCollectorInterface &m_symbolsCollector;
SymbolStorageInterface &m_symbolStorage; SymbolStorageInterface &m_symbolStorage;

View File

@@ -167,5 +167,11 @@ TEST_F(SymbolIndexer, UpdateProjectPartsCallsInOrder)
indexer.updateProjectParts({projectPart1}, Utils::clone(unsaved)); indexer.updateProjectParts({projectPart1}, Utils::clone(unsaved));
} }
TEST_F(SymbolIndexer, CallSetNotifier)
{
EXPECT_CALL(mockPathWatcher, setNotifier(_));
ClangBackEnd::SymbolIndexer indexer{mockCollector, mockStorage, mockPathWatcher};
}
} }