logic: improved python post processing speed and show progress dialog
This commit is contained in:
@@ -69,7 +69,7 @@ void TaskExecuteCustomCommands::doEnter(std::shared_ptr<Blackboard> blackboard)
|
||||
}
|
||||
}
|
||||
// reverse because we pull elements from the back of these vectors
|
||||
std::reverse(m_parallelCommands.begin(), m_parallelCommands.end());
|
||||
std::reverse(m_parallelCommands.begin(), m_parallelCommands.end());
|
||||
std::reverse(m_serialCommands.begin(), m_serialCommands.end());
|
||||
}
|
||||
}
|
||||
@@ -255,6 +255,7 @@ void TaskExecuteCustomCommands::runIndexerCommand(std::shared_ptr<IndexerCommand
|
||||
void TaskExecuteCustomCommands::runPythonPostProcessing(PersistentStorage& storage)
|
||||
{
|
||||
LOG_INFO("Starting Python post processing.");
|
||||
m_dialogView->showUnknownProgressDialog(L"Finish Indexing", L"Run Python Post Processing");
|
||||
|
||||
std::vector<Id> unsolvedLocationIds;
|
||||
for (const StorageSourceLocation location : storage.getStorageSourceLocations())
|
||||
|
||||
@@ -37,7 +37,7 @@ private:
|
||||
|
||||
void executeParallelIndexerCommands(int threadId, std::shared_ptr<Blackboard> blackboard);
|
||||
void runIndexerCommand(std::shared_ptr<IndexerCommandCustom> indexerCommand, std::shared_ptr<Blackboard> blackboard);
|
||||
static void runPythonPostProcessing(PersistentStorage& storage);
|
||||
void runPythonPostProcessing(PersistentStorage& storage);
|
||||
|
||||
private:
|
||||
std::unique_ptr<IndexerCommandProvider> m_indexerCommandProvider;
|
||||
|
||||
@@ -1473,14 +1473,14 @@ std::shared_ptr<SourceLocationCollection> PersistentStorage::getSourceLocationsF
|
||||
|
||||
std::shared_ptr<SourceLocationCollection> collection = std::make_shared<SourceLocationCollection>();
|
||||
|
||||
std::map<Id, std::vector<Id>> m_locationIdToElementIds;
|
||||
for (const StorageOccurrence& occurrence: m_sqliteIndexStorage.getOccurrencesForLocationIds(locationIds))
|
||||
{
|
||||
m_locationIdToElementIds[occurrence.sourceLocationId].push_back(occurrence.elementId);
|
||||
}
|
||||
|
||||
for (StorageSourceLocation location: m_sqliteIndexStorage.getAllByIds<StorageSourceLocation>(locationIds))
|
||||
{
|
||||
std::vector<Id> elementIds;
|
||||
for (const StorageOccurrence& occurrence: m_sqliteIndexStorage.getOccurrencesForLocationId(location.id))
|
||||
{
|
||||
elementIds.push_back(occurrence.elementId);
|
||||
}
|
||||
|
||||
const LocationType type = intToLocationType(location.type);
|
||||
if (type != LOCATION_TOKEN && type != LOCATION_SCOPE && type != LOCATION_LOCAL_SYMBOL && type != LOCATION_UNSOLVED)
|
||||
{
|
||||
@@ -1490,7 +1490,7 @@ std::shared_ptr<SourceLocationCollection> PersistentStorage::getSourceLocationsF
|
||||
collection->addSourceLocation(
|
||||
intToLocationType(location.type),
|
||||
location.id,
|
||||
elementIds,
|
||||
m_locationIdToElementIds[location.id],
|
||||
getFileNodePath(location.fileNodeId),
|
||||
location.startLine,
|
||||
location.startCol,
|
||||
|
||||
Reference in New Issue
Block a user