forked from qt-creator/qt-creator
ClangCodeModel: Remove libclang fallback for "follow symbol"
... and "switch between declaration/definition". It's either clangd or built-in code model now. Use the opportunity to dissolve the pointless FollowSymbolInterface class hierarchy, which introduced a confusing parallel inheritance chain. Change-Id: I792ad55656c5dd9f10c6b4db7c5c36cf7be45125 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -48,7 +48,6 @@
|
||||
#include "stringtable.h"
|
||||
#include "symbolfinder.h"
|
||||
#include "symbolsfindfilter.h"
|
||||
#include "followsymbolinterface.h"
|
||||
|
||||
#include <coreplugin/documentmanager.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
@@ -348,20 +347,6 @@ void CppModelManager::findUsages(const CursorInEditor &data,
|
||||
engine->findUsages(data, std::move(showUsagesCallback));
|
||||
}
|
||||
|
||||
void CppModelManager::globalFollowSymbol(
|
||||
const CursorInEditor &data,
|
||||
Utils::ProcessLinkCallback &&processLinkCallback,
|
||||
const CPlusPlus::Snapshot &snapshot,
|
||||
const CPlusPlus::Document::Ptr &documentFromSemanticInfo,
|
||||
SymbolFinder *symbolFinder,
|
||||
bool inNextSplit) const
|
||||
{
|
||||
RefactoringEngineInterface *engine = getRefactoringEngine(d->m_refactoringEngines);
|
||||
QTC_ASSERT(engine, return;);
|
||||
engine->globalFollowSymbol(data, std::move(processLinkCallback), snapshot, documentFromSemanticInfo,
|
||||
symbolFinder, inNextSplit);
|
||||
}
|
||||
|
||||
bool CppModelManager::positionRequiresSignal(const QString &filePath, const QByteArray &content,
|
||||
int position) const
|
||||
{
|
||||
@@ -487,9 +472,10 @@ RefactoringEngineInterface *CppModelManager::builtinRefactoringEngine()
|
||||
return instance()->d->m_refactoringEngines.value(RefactoringEngineType::BuiltIn);
|
||||
}
|
||||
|
||||
FollowSymbolInterface &CppModelManager::builtinFollowSymbol()
|
||||
FollowSymbolUnderCursor &CppModelManager::builtinFollowSymbol()
|
||||
{
|
||||
return instance()->d->m_builtinModelManagerSupport->followSymbolInterface();
|
||||
return instance()->d->m_builtinModelManagerSupport.staticCast<BuiltinModelManagerSupport>()
|
||||
->followSymbolInterface();
|
||||
}
|
||||
|
||||
template<class FilterClass>
|
||||
@@ -560,11 +546,6 @@ Core::ILocatorFilter *CppModelManager::currentDocumentFilter() const
|
||||
return d->m_currentDocumentFilter.get();
|
||||
}
|
||||
|
||||
FollowSymbolInterface &CppModelManager::followSymbolInterface() const
|
||||
{
|
||||
return d->m_activeModelManagerSupport->followSymbolInterface();
|
||||
}
|
||||
|
||||
std::unique_ptr<AbstractOverviewModel> CppModelManager::createOverviewModel() const
|
||||
{
|
||||
return d->m_activeModelManagerSupport->createOverviewModel();
|
||||
@@ -1680,6 +1661,20 @@ TextEditor::BaseHoverHandler *CppModelManager::createHoverHandler() const
|
||||
return d->m_activeModelManagerSupport->createHoverHandler();
|
||||
}
|
||||
|
||||
void CppModelManager::followSymbol(const CursorInEditor &data,
|
||||
Utils::ProcessLinkCallback &&processLinkCallback,
|
||||
bool resolveTarget, bool inNextSplit)
|
||||
{
|
||||
d->m_activeModelManagerSupport->followSymbol(data, std::move(processLinkCallback),
|
||||
resolveTarget, inNextSplit);
|
||||
}
|
||||
|
||||
void CppModelManager::switchDeclDef(const CursorInEditor &data,
|
||||
Utils::ProcessLinkCallback &&processLinkCallback)
|
||||
{
|
||||
d->m_activeModelManagerSupport->switchDeclDef(data, std::move(processLinkCallback));
|
||||
}
|
||||
|
||||
BaseEditorDocumentProcessor *CppModelManager::createEditorDocumentProcessor(
|
||||
TextEditor::TextDocument *baseTextDocument) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user