diff --git a/src/lib/component/controller/StatusBarController.cpp b/src/lib/component/controller/StatusBarController.cpp index 15c32bc9..49d126e2 100644 --- a/src/lib/component/controller/StatusBarController.cpp +++ b/src/lib/component/controller/StatusBarController.cpp @@ -21,7 +21,6 @@ StatusBarView* StatusBarController::getView() void StatusBarController::clear() { getView()->setErrorCount(ErrorCountInfo()); - getView()->showMessage("", false, false); } void StatusBarController::handleMessage(MessageClearErrorCount* message) diff --git a/src/lib/data/PersistentStorage.cpp b/src/lib/data/PersistentStorage.cpp index edd9df41..0da1ffd6 100644 --- a/src/lib/data/PersistentStorage.cpp +++ b/src/lib/data/PersistentStorage.cpp @@ -7,6 +7,7 @@ #include "utility/logging/logging.h" #include "utility/messaging/type/MessageClearErrorCount.h" #include "utility/messaging/type/MessageShowErrors.h" +#include "utility/messaging/type/MessageStatus.h" #include "utility/text/TextAccess.h" #include "utility/TimePoint.h" #include "utility/utility.h" @@ -102,7 +103,8 @@ Id PersistentStorage::addLocalSymbol(const std::string& name) return localSymbolId; } -void PersistentStorage::addSourceLocation(Id elementId, Id fileNodeId, uint startLine, uint startCol, uint endLine, uint endCol, int type) +void PersistentStorage::addSourceLocation( + Id elementId, Id fileNodeId, uint startLine, uint startCol, uint endLine, uint endCol, int type) { m_sqliteStorage.addSourceLocation( elementId, @@ -131,7 +133,8 @@ void PersistentStorage::addCommentLocation(Id fileNodeId, uint startLine, uint s ); } -void PersistentStorage::addError(const std::string& message, bool fatal, const std::string& filePath, uint startLine, uint startCol) +void PersistentStorage::addError( + const std::string& message, bool fatal, const std::string& filePath, uint startLine, uint startCol) { m_sqliteStorage.addError( message, @@ -166,7 +169,8 @@ void PersistentStorage::forEachEdge(std::function callback) const +void PersistentStorage::forEachLocalSymbol(std::function callback) const { for (StorageLocalSymbol& localSymbol: m_sqliteStorage.getAllLocalSymbols()) { @@ -217,10 +221,11 @@ void PersistentStorage::finishInjection() { m_sqliteStorage.commitTransaction(); + ErrorCountInfo errorCount = getErrorCount(); if (m_preInjectionErrorCount != -1 && - m_preInjectionErrorCount != getErrorCount().total) + m_preInjectionErrorCount != errorCount.total) { - MessageShowErrors msg(getErrorCount()); + MessageShowErrors msg(errorCount); msg.setSendAsTask(false); msg.dispatch(); } @@ -396,9 +401,15 @@ std::shared_ptr PersistentStorage::getFullTextSearchLoc { if (m_fullTextSearchIndex.fileCount() == 0) { + MessageStatus("Building fulltext search index", false, true).dispatch(); buildFullTextSearchIndex(); } + MessageStatus( + std::string("Searching fulltext (case-") + (caseSensitive ? "sensitive" : "insensitive") + "): " + searchTerm, + false, true + ).dispatch(); + std::shared_ptr collection = std::make_shared(); std::vector hits = m_fullTextSearchIndex.searchForTerm(searchTerm); @@ -462,6 +473,13 @@ std::shared_ptr PersistentStorage::getFullTextSearchLoc } } + MessageStatus( + std::to_string(collection->getTokenLocationCount()) + " results in " + + std::to_string(collection->getTokenLocationFileCount()) + " files for fulltext search (case-" + + (caseSensitive ? "sensitive" : "insensitive") + "): " + searchTerm, + false, false + ).dispatch(); + return collection; } @@ -847,7 +865,8 @@ Id PersistentStorage::getTokenIdForFileNode(const FilePath& filePath) const return m_sqliteStorage.getFileByPath(filePath.str()).id; } -std::shared_ptr PersistentStorage::getTokenLocationsForTokenIds(const std::vector& tokenIds) const +std::shared_ptr PersistentStorage::getTokenLocationsForTokenIds( + const std::vector& tokenIds) const { std::shared_ptr collection = std::make_shared();