data: Fixed file complete flag not set when retrieving single source locations in SourceLocationCollection
This commit is contained in:
@@ -486,6 +486,7 @@ void PersistentStorage::clearCaches()
|
|||||||
m_fileIndex.clear();
|
m_fileIndex.clear();
|
||||||
m_fileNodeIds.clear();
|
m_fileNodeIds.clear();
|
||||||
m_fileNodePaths.clear();
|
m_fileNodePaths.clear();
|
||||||
|
m_fileNodeComplete.clear();
|
||||||
m_hierarchyCache.clear();
|
m_hierarchyCache.clear();
|
||||||
m_fullTextSearchIndex.clear();
|
m_fullTextSearchIndex.clear();
|
||||||
}
|
}
|
||||||
@@ -729,6 +730,8 @@ std::shared_ptr<SourceLocationCollection> PersistentStorage::getFullTextSearchLo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addCompleteFlagsToSourceLocationCollection(collection.get());
|
||||||
|
|
||||||
MessageStatus(
|
MessageStatus(
|
||||||
std::to_string(collection->getSourceLocationCount()) + " results in " +
|
std::to_string(collection->getSourceLocationCount()) + " results in " +
|
||||||
std::to_string(collection->getSourceLocationFileCount()) + " files for fulltext search (case-" +
|
std::to_string(collection->getSourceLocationFileCount()) + " files for fulltext search (case-" +
|
||||||
@@ -1320,6 +1323,8 @@ std::shared_ptr<SourceLocationCollection> PersistentStorage::getSourceLocationsF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addCompleteFlagsToSourceLocationCollection(collection.get());
|
||||||
|
|
||||||
return collection;
|
return collection;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1351,6 +1356,8 @@ std::shared_ptr<SourceLocationCollection> PersistentStorage::getSourceLocationsF
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addCompleteFlagsToSourceLocationCollection(collection.get());
|
||||||
|
|
||||||
return collection;
|
return collection;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1470,7 +1477,7 @@ std::shared_ptr<SourceLocationCollection> PersistentStorage::getErrorSourceLocat
|
|||||||
{
|
{
|
||||||
TRACE();
|
TRACE();
|
||||||
|
|
||||||
std::shared_ptr<SourceLocationCollection> errorCollection = std::make_shared<SourceLocationCollection>();
|
std::shared_ptr<SourceLocationCollection> collection = std::make_shared<SourceLocationCollection>();
|
||||||
for (const ErrorInfo& error : m_sqliteIndexStorage.getAll<StorageError>())
|
for (const ErrorInfo& error : m_sqliteIndexStorage.getAll<StorageError>())
|
||||||
{
|
{
|
||||||
if (m_errorFilter.filter(error))
|
if (m_errorFilter.filter(error))
|
||||||
@@ -1480,7 +1487,7 @@ std::shared_ptr<SourceLocationCollection> PersistentStorage::getErrorSourceLocat
|
|||||||
// Set first bit to 1 to avoid collisions
|
// Set first bit to 1 to avoid collisions
|
||||||
Id locationId = ~(~size_t(0) >> 1) + error.id;
|
Id locationId = ~(~size_t(0) >> 1) + error.id;
|
||||||
|
|
||||||
errorCollection->addSourceLocation(
|
collection->addSourceLocation(
|
||||||
LOCATION_ERROR,
|
LOCATION_ERROR,
|
||||||
locationId,
|
locationId,
|
||||||
std::vector<Id>(1, error.id),
|
std::vector<Id>(1, error.id),
|
||||||
@@ -1493,7 +1500,9 @@ std::shared_ptr<SourceLocationCollection> PersistentStorage::getErrorSourceLocat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return errorCollection;
|
addCompleteFlagsToSourceLocationCollection(collection.get());
|
||||||
|
|
||||||
|
return collection;
|
||||||
}
|
}
|
||||||
|
|
||||||
Id PersistentStorage::getFileNodeId(const FilePath& filePath) const
|
Id PersistentStorage::getFileNodeId(const FilePath& filePath) const
|
||||||
@@ -1552,6 +1561,18 @@ FilePath PersistentStorage::getFileNodePath(Id fileId) const
|
|||||||
return FilePath();
|
return FilePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PersistentStorage::getFileNodeComplete(const FilePath& filePath) const
|
||||||
|
{
|
||||||
|
std::map<FilePath, bool>::const_iterator it = m_fileNodeComplete.find(filePath);
|
||||||
|
|
||||||
|
if (it != m_fileNodeComplete.end())
|
||||||
|
{
|
||||||
|
return it->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
std::unordered_map<Id, std::set<Id>> PersistentStorage::getFileIdToIncludingFileIdMap() const
|
std::unordered_map<Id, std::set<Id>> PersistentStorage::getFileIdToIncludingFileIdMap() const
|
||||||
{
|
{
|
||||||
std::unordered_map<Id, std::set<Id>> fileIdToIncludingFileIdMap;
|
std::unordered_map<Id, std::set<Id>> fileIdToIncludingFileIdMap;
|
||||||
@@ -2003,6 +2024,16 @@ void PersistentStorage::addComponentAccessToGraph(Graph* graph) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PersistentStorage::addCompleteFlagsToSourceLocationCollection(SourceLocationCollection* collection) const
|
||||||
|
{
|
||||||
|
collection->forEachSourceLocationFile(
|
||||||
|
[this](std::shared_ptr<SourceLocationFile> file)
|
||||||
|
{
|
||||||
|
file->setIsComplete(getFileNodeComplete(file->getFilePath()));
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
void PersistentStorage::buildSearchIndex()
|
void PersistentStorage::buildSearchIndex()
|
||||||
{
|
{
|
||||||
TRACE();
|
TRACE();
|
||||||
@@ -2061,6 +2092,7 @@ void PersistentStorage::buildFilePathMaps()
|
|||||||
{
|
{
|
||||||
m_fileNodeIds.emplace(file.filePath, file.id);
|
m_fileNodeIds.emplace(file.filePath, file.id);
|
||||||
m_fileNodePaths.emplace(file.id, file.filePath);
|
m_fileNodePaths.emplace(file.id, file.filePath);
|
||||||
|
m_fileNodeComplete.emplace(file.filePath, file.complete);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -149,6 +149,7 @@ private:
|
|||||||
std::vector<Id> getFileNodeIds(const std::vector<FilePath>& filePaths) const;
|
std::vector<Id> getFileNodeIds(const std::vector<FilePath>& filePaths) const;
|
||||||
std::set<Id> getFileNodeIds(const std::set<FilePath>& filePaths) const;
|
std::set<Id> getFileNodeIds(const std::set<FilePath>& filePaths) const;
|
||||||
FilePath getFileNodePath(Id fileId) const;
|
FilePath getFileNodePath(Id fileId) const;
|
||||||
|
bool getFileNodeComplete(const FilePath& filePath) const;
|
||||||
|
|
||||||
std::unordered_map<Id, std::set<Id>> getFileIdToIncludingFileIdMap() const;
|
std::unordered_map<Id, std::set<Id>> getFileIdToIncludingFileIdMap() const;
|
||||||
std::unordered_map<Id, std::set<Id>> getFileIdToImportingFileIdMap() const;
|
std::unordered_map<Id, std::set<Id>> getFileIdToImportingFileIdMap() const;
|
||||||
@@ -172,6 +173,8 @@ private:
|
|||||||
void addAggregationEdgesToGraph(const Id nodeId, const std::vector<StorageEdge>& edgesToAggregate, Graph* graph) const;
|
void addAggregationEdgesToGraph(const Id nodeId, const std::vector<StorageEdge>& edgesToAggregate, Graph* graph) const;
|
||||||
void addComponentAccessToGraph(Graph* graph) const;
|
void addComponentAccessToGraph(Graph* graph) const;
|
||||||
|
|
||||||
|
void addCompleteFlagsToSourceLocationCollection(SourceLocationCollection* collection) const;
|
||||||
|
|
||||||
void buildSearchIndex();
|
void buildSearchIndex();
|
||||||
void buildFilePathMaps();
|
void buildFilePathMaps();
|
||||||
void buildFullTextSearchIndex() const;
|
void buildFullTextSearchIndex() const;
|
||||||
@@ -190,6 +193,7 @@ private:
|
|||||||
|
|
||||||
std::map <FilePath, Id> m_fileNodeIds;
|
std::map <FilePath, Id> m_fileNodeIds;
|
||||||
std::map <Id, FilePath> m_fileNodePaths;
|
std::map <Id, FilePath> m_fileNodePaths;
|
||||||
|
std::map <FilePath, bool> m_fileNodeComplete;
|
||||||
|
|
||||||
HierarchyCache m_hierarchyCache;
|
HierarchyCache m_hierarchyCache;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user