LanguageClient: Reorder arguments in workspaceMatchers

Provide a default empty list for clients. It's going to
be used for MatcherType::CurrentDocumentSymbols.

Change-Id: Ib3ba2ec8fa08b9a55eb097ac3cce8bcd513eb5ae
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Jarek Kobus
2023-04-21 18:00:40 +02:00
parent afcbe845ce
commit 4a3495c8b9
3 changed files with 6 additions and 7 deletions

View File

@@ -207,15 +207,15 @@ ClangModelManagerSupport::ClangModelManagerSupport()
cppModelManager()->setFunctionsFilter(std::make_unique<ClangFunctionsFilter>()); cppModelManager()->setFunctionsFilter(std::make_unique<ClangFunctionsFilter>());
// Setup matchers // Setup matchers
LocatorMatcher::addMatcherCreator(MatcherType::AllSymbols, [] { LocatorMatcher::addMatcherCreator(MatcherType::AllSymbols, [] {
return LanguageClient::workspaceMatchers(clientsForOpenProjects(), MatcherType::AllSymbols, return LanguageClient::workspaceMatchers(MatcherType::AllSymbols, clientsForOpenProjects(),
10000); 10000);
}); });
LocatorMatcher::addMatcherCreator(MatcherType::Classes, [] { LocatorMatcher::addMatcherCreator(MatcherType::Classes, [] {
return LanguageClient::workspaceMatchers(clientsForOpenProjects(), MatcherType::Classes, return LanguageClient::workspaceMatchers(MatcherType::Classes, clientsForOpenProjects(),
10000); 10000);
}); });
LocatorMatcher::addMatcherCreator(MatcherType::Functions, [] { LocatorMatcher::addMatcherCreator(MatcherType::Functions, [] {
return LanguageClient::workspaceMatchers(clientsForOpenProjects(), MatcherType::Functions, return LanguageClient::workspaceMatchers(MatcherType::Functions, clientsForOpenProjects(),
10000); 10000);
}); });

View File

@@ -119,7 +119,7 @@ static MatcherCreator creatorForType(MatcherType type)
return {}; return {};
} }
LocatorMatcherTasks workspaceMatchers(const QList<Client *> &clients, MatcherType type, LocatorMatcherTasks workspaceMatchers(MatcherType type, const QList<Client *> &clients,
int maxResultCount) int maxResultCount)
{ {
const MatcherCreator creator = creatorForType(type); const MatcherCreator creator = creatorForType(type);

View File

@@ -22,9 +22,8 @@ namespace LanguageClient {
using DocSymbolModifier = std::function<void(Core::LocatorFilterEntry &, using DocSymbolModifier = std::function<void(Core::LocatorFilterEntry &,
const LanguageServerProtocol::DocumentSymbol &, const Core::LocatorFilterEntry &)>; const LanguageServerProtocol::DocumentSymbol &, const Core::LocatorFilterEntry &)>;
Core::LocatorMatcherTasks LANGUAGECLIENT_EXPORT workspaceMatchers(const QList<Client *> &clients, Core::LocatorMatcherTasks LANGUAGECLIENT_EXPORT workspaceMatchers(Core::MatcherType type,
Core::MatcherType type, const QList<Client *> &clients = {}, int maxResultCount = 0);
int maxResultCount = 0);
class LanguageClientManager; class LanguageClientManager;