diff --git a/src/plugins/clangcodemodel/clangdlocatorfilters.cpp b/src/plugins/clangcodemodel/clangdlocatorfilters.cpp index 92994fe7360..f2f66fa29e3 100644 --- a/src/plugins/clangcodemodel/clangdlocatorfilters.cpp +++ b/src/plugins/clangcodemodel/clangdlocatorfilters.cpp @@ -172,7 +172,7 @@ static void filterCurrentResults(QPromise &promise, const LocatorStorage & [](const Entry &entry) { return entry.entry; })); } -static LocatorMatcherTask currentDocumentMatcher() +static ExecutableItem currentDocumentMatcher() { Storage resultStorage; diff --git a/src/plugins/coreplugin/locator/ilocatorfilter.cpp b/src/plugins/coreplugin/locator/ilocatorfilter.cpp index a40b3a5624e..ee5e88451e7 100644 --- a/src/plugins/coreplugin/locator/ilocatorfilter.cpp +++ b/src/plugins/coreplugin/locator/ilocatorfilter.cpp @@ -1365,7 +1365,7 @@ static void filter(QPromise &promise, const LocatorStor When this cache started a new search in meantime, the cache was invalidated or even deleted, the update of the cache after a successful run of the task is ignored. */ -LocatorMatcherTask LocatorFileCache::matcher() const +ExecutableItem LocatorFileCache::matcher() const { std::weak_ptr weak = d; diff --git a/src/plugins/coreplugin/locator/ilocatorfilter.h b/src/plugins/coreplugin/locator/ilocatorfilter.h index 5a37f6d82dc..399631873c7 100644 --- a/src/plugins/coreplugin/locator/ilocatorfilter.h +++ b/src/plugins/coreplugin/locator/ilocatorfilter.h @@ -136,8 +136,7 @@ private: std::shared_ptr d; }; -using LocatorMatcherTask = Tasking::GroupItem; -using LocatorMatcherTasks = QList; +using LocatorMatcherTasks = QList; using LocatorMatcherTaskCreator = std::function; class LocatorMatcherPrivate; @@ -307,7 +306,7 @@ public: std::optional filePaths() const; static FilePathsGenerator filePathsGenerator(const Utils::FilePaths &filePaths); - LocatorMatcherTask matcher() const; + Tasking::ExecutableItem matcher() const; using MatchedEntries = std::array; static Utils::FilePaths processFilePaths(const QFuture &future, diff --git a/src/plugins/cppeditor/cpplocatorfilter.cpp b/src/plugins/cppeditor/cpplocatorfilter.cpp index 006da4fc92d..b1e7c552e0a 100644 --- a/src/plugins/cppeditor/cpplocatorfilter.cpp +++ b/src/plugins/cppeditor/cpplocatorfilter.cpp @@ -26,7 +26,7 @@ namespace CppEditor { using EntryFromIndex = std::function; -void matchesFor(QPromise &promise, const LocatorStorage &storage, +static void matchesFor(QPromise &promise, const LocatorStorage &storage, IndexItem::ItemType wantedType, const EntryFromIndex &converter) { const QString input = storage.input(); @@ -100,7 +100,7 @@ void matchesFor(QPromise &promise, const LocatorStorage &storage, LocatorFilterEntries())); } -LocatorMatcherTask locatorMatcher(IndexItem::ItemType type, const EntryFromIndex &converter) +static ExecutableItem locatorMatcher(IndexItem::ItemType type, const EntryFromIndex &converter) { const auto onSetup = [type, converter](Async &async) { async.setConcurrentCallData(matchesFor, *LocatorStorage::storage(), type, converter); @@ -108,7 +108,7 @@ LocatorMatcherTask locatorMatcher(IndexItem::ItemType type, const EntryFromIndex return AsyncTask(onSetup); } -LocatorMatcherTask allSymbolsMatcher() +static ExecutableItem allSymbolsMatcher() { const auto converter = [](const IndexItem::Ptr &info) { LocatorFilterEntry filterEntry; @@ -126,7 +126,7 @@ LocatorMatcherTask allSymbolsMatcher() return locatorMatcher(IndexItem::All, converter); } -LocatorMatcherTask classMatcher() +static ExecutableItem classMatcher() { const auto converter = [](const IndexItem::Ptr &info) { LocatorFilterEntry filterEntry; @@ -142,7 +142,7 @@ LocatorMatcherTask classMatcher() return locatorMatcher(IndexItem::Class, converter); } -LocatorMatcherTask functionMatcher() +static ExecutableItem functionMatcher() { const auto converter = [](const IndexItem::Ptr &info) { QString name = info->symbolName(); @@ -163,7 +163,7 @@ LocatorMatcherTask functionMatcher() return locatorMatcher(IndexItem::Function, converter); } -QList itemsOfCurrentDocument(const FilePath ¤tFileName) +static QList itemsOfCurrentDocument(const FilePath ¤tFileName) { if (currentFileName.isEmpty()) return {}; @@ -185,7 +185,7 @@ QList itemsOfCurrentDocument(const FilePath ¤tFileName) return results; } -LocatorFilterEntry::HighlightInfo highlightInfo(const QRegularExpressionMatch &match, +static LocatorFilterEntry::HighlightInfo highlightInfo(const QRegularExpressionMatch &match, LocatorFilterEntry::HighlightInfo::DataType dataType) { const FuzzyMatcher::HighlightingPositions positions = @@ -194,7 +194,7 @@ LocatorFilterEntry::HighlightInfo highlightInfo(const QRegularExpressionMatch &m return LocatorFilterEntry::HighlightInfo(positions.starts, positions.lengths, dataType); } -void matchesForCurrentDocument(QPromise &promise, const LocatorStorage &storage, +static void matchesForCurrentDocument(QPromise &promise, const LocatorStorage &storage, const FilePath ¤tFileName) { const QString input = storage.input(); @@ -287,13 +287,13 @@ void matchesForCurrentDocument(QPromise &promise, const LocatorStorage &st [](const Entry &entry) { return entry.entry; })); } -FilePath currentFileName() +static FilePath currentFileName() { IEditor *currentEditor = EditorManager::currentEditor(); return currentEditor ? currentEditor->document()->filePath() : FilePath(); } -LocatorMatcherTask currentDocumentMatcher() +static ExecutableItem currentDocumentMatcher() { const auto onSetup = [](Async &async) { async.setConcurrentCallData(matchesForCurrentDocument, *LocatorStorage::storage(), currentFileName()); @@ -301,7 +301,7 @@ LocatorMatcherTask currentDocumentMatcher() return AsyncTask(onSetup); } -using MatcherCreator = std::function; +using MatcherCreator = std::function; static MatcherCreator creatorForType(MatcherType type) { diff --git a/src/plugins/cppeditor/cpplocatorfilter_test.cpp b/src/plugins/cppeditor/cpplocatorfilter_test.cpp index a621d1c1103..ffb9eaa24f3 100644 --- a/src/plugins/cppeditor/cpplocatorfilter_test.cpp +++ b/src/plugins/cppeditor/cpplocatorfilter_test.cpp @@ -28,7 +28,7 @@ QTC_DECLARE_MYTESTDATADIR("../../../tests/cpplocators/") class CppLocatorFilterTestCase : public CppEditor::Tests::TestCase { public: - CppLocatorFilterTestCase(const QList &matchers, + CppLocatorFilterTestCase(const LocatorMatcherTasks &matchers, const QString &fileName, const QString &searchText, const ResultDataList &expectedResults) @@ -54,7 +54,7 @@ class CppCurrentDocumentFilterTestCase : public CppEditor::Tests::TestCase { public: CppCurrentDocumentFilterTestCase(const FilePath &filePath, - const QList &matchers, + const LocatorMatcherTasks &matchers, const ResultDataList &expectedResults, const QString &searchText = QString()) { diff --git a/src/plugins/languageclient/locatorfilter.cpp b/src/plugins/languageclient/locatorfilter.cpp index dd33ae45360..5dc90ad5b32 100644 --- a/src/plugins/languageclient/locatorfilter.cpp +++ b/src/plugins/languageclient/locatorfilter.cpp @@ -20,7 +20,7 @@ using namespace Utils; namespace LanguageClient { -void filterResults(QPromise &promise, const LocatorStorage &storage, Client *client, +static void filterResults(QPromise &promise, const LocatorStorage &storage, Client *client, const QList &results, const QList &filter) { const auto doFilter = [&](const SymbolInformation &info) { @@ -42,7 +42,7 @@ void filterResults(QPromise &promise, const LocatorStorage &storage, Clien storage.reportOutput(Utils::transform(filteredResults, generateEntry)); } -LocatorMatcherTask locatorMatcher(Client *client, int maxResultCount, +static ExecutableItem locatorMatcher(Client *client, int maxResultCount, const QList &filter) { Storage> resultStorage; @@ -79,17 +79,17 @@ LocatorMatcherTask locatorMatcher(Client *client, int maxResultCount, return root; } -LocatorMatcherTask allSymbolsMatcher(Client *client, int maxResultCount) +static ExecutableItem allSymbolsMatcher(Client *client, int maxResultCount) { return locatorMatcher(client, maxResultCount, {}); } -LocatorMatcherTask classMatcher(Client *client, int maxResultCount) +static ExecutableItem classMatcher(Client *client, int maxResultCount) { return locatorMatcher(client, maxResultCount, {SymbolKind::Class, SymbolKind::Struct}); } -LocatorMatcherTask functionMatcher(Client *client, int maxResultCount) +static ExecutableItem functionMatcher(Client *client, int maxResultCount) { return locatorMatcher(client, maxResultCount, {SymbolKind::Method, SymbolKind::Function, SymbolKind::Constructor}); @@ -111,7 +111,7 @@ static void filterCurrentResults(QPromise &promise, const LocatorStorage & docSymbolModifier)); } -LocatorMatcherTask currentDocumentMatcher() +static ExecutableItem currentDocumentMatcher() { Storage resultStorage; @@ -132,7 +132,7 @@ LocatorMatcherTask currentDocumentMatcher() return root; } -using MatcherCreator = std::function; +using MatcherCreator = std::function; static MatcherCreator creatorForType(MatcherType type) {