mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-11-13 05:22:49 -05:00
feat: Add log to search tool
This commit is contained in:
@ -145,7 +145,7 @@ QFuture<QString> SearchInProjectTool::executeAsync(const QJsonObject &input)
|
|||||||
return QString("No matches found for '%1'").arg(query);
|
return QString("No matches found for '%1'").arg(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
return formatResults(results, maxResults);
|
return formatResults(results, maxResults, query);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -276,9 +276,12 @@ QList<SearchInProjectTool::SearchResult> SearchInProjectTool::searchInFiles(
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SearchInProjectTool::formatResults(const QList<SearchResult> &results, int maxResults) const
|
QString SearchInProjectTool::formatResults(const QList<SearchResult> &results,
|
||||||
|
int maxResults,
|
||||||
|
const QString &searchQuery) const
|
||||||
{
|
{
|
||||||
QString output = QString("Found %1 matches:\n\n").arg(results.size());
|
QString output = QString("Search query: '%1'\n").arg(searchQuery);
|
||||||
|
output += QString("Found %1 matches:\n\n").arg(results.size());
|
||||||
|
|
||||||
int displayCount = qMin(results.size(), maxResults);
|
int displayCount = qMin(results.size(), maxResults);
|
||||||
for (int i = 0; i < displayCount; ++i) {
|
for (int i = 0; i < displayCount; ++i) {
|
||||||
|
|||||||
@ -54,7 +54,9 @@ private:
|
|||||||
bool wholeWords,
|
bool wholeWords,
|
||||||
const QString &filePattern) const;
|
const QString &filePattern) const;
|
||||||
|
|
||||||
QString formatResults(const QList<SearchResult> &results, int maxResults) const;
|
QString formatResults(const QList<SearchResult> &results,
|
||||||
|
int maxResults,
|
||||||
|
const QString &searchQuery) const;
|
||||||
|
|
||||||
Context::IgnoreManager *m_ignoreManager;
|
Context::IgnoreManager *m_ignoreManager;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user