CppEditor/LanguageClient: Reuse MatcherType enum

Change-Id: I95a8c902ddf6d7525543ccbc2acf45fe273a12f4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Jarek Kobus
2023-04-13 10:39:20 +02:00
parent 6f7a56c31c
commit b1e65195ac
6 changed files with 81 additions and 40 deletions

View File

@@ -897,14 +897,18 @@ void CppModelManager::initCppTools()
setSymbolsFindFilter(std::make_unique<SymbolsFindFilter>(this));
setCurrentDocumentFilter(std::make_unique<CppCurrentDocumentFilter>());
// Setup matchers
LocatorMatcher::addMatcherCreator(MatcherType::AllSymbols,
[] { return QList{CppEditor::cppAllSymbolsMatcher()}; });
LocatorMatcher::addMatcherCreator(MatcherType::Classes,
[] { return QList{CppEditor::cppClassMatcher()}; });
LocatorMatcher::addMatcherCreator(MatcherType::Functions,
[] { return QList{CppEditor::cppFunctionMatcher()}; });
LocatorMatcher::addMatcherCreator(MatcherType::CurrentDocumentSymbols,
[] { return QList{CppEditor::cppCurrentDocumentMatcher()}; });
LocatorMatcher::addMatcherCreator(MatcherType::AllSymbols, [] {
return cppMatchers(MatcherType::AllSymbols);
});
LocatorMatcher::addMatcherCreator(MatcherType::Classes, [] {
return cppMatchers(MatcherType::Classes);
});
LocatorMatcher::addMatcherCreator(MatcherType::Functions, [] {
return cppMatchers(MatcherType::Functions);
});
LocatorMatcher::addMatcherCreator(MatcherType::CurrentDocumentSymbols, [] {
return cppMatchers(MatcherType::CurrentDocumentSymbols);
});
}
CppModelManager::CppModelManager()