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:
Christian Kandeler
2022-04-25 13:37:58 +02:00
parent 8e586dfa02
commit f2c267f328
23 changed files with 117 additions and 523 deletions

View File

@@ -50,7 +50,6 @@
#include "cpptoolssettings.h"
#include "cppuseselectionsupdater.h"
#include "cppworkingcopy.h"
#include "followsymbolinterface.h"
#include "refactoringengineinterface.h"
#include "symbolfinder.h"
@@ -1045,9 +1044,7 @@ void CppEditorWidget::switchDeclarationDefinition(bool inNextSplit)
if (self && link.hasValidTarget())
self->openLink(link, split);
};
followSymbolInterface().switchDeclDef(cursor, std::move(callback),
d->m_modelManager->snapshot(), d->m_lastSemanticInfo.doc,
d->m_modelManager->symbolFinder());
CppModelManager::instance()->switchDeclDef(cursor, std::move(callback));
}
void CppEditorWidget::findLinkAt(const QTextCursor &cursor,
@@ -1087,13 +1084,10 @@ void CppEditorWidget::findLinkAt(const QTextCursor &cursor,
}
callback(link);
};
followSymbolInterface().findLink(
CppModelManager::instance()->followSymbol(
CursorInEditor{cursor, filePath, this, textDocument()},
std::move(callbackWrapper),
resolveTarget,
d->m_modelManager->snapshot(),
d->m_lastSemanticInfo.doc,
d->m_modelManager->symbolFinder(),
inNextSplit);
}
@@ -1102,11 +1096,6 @@ unsigned CppEditorWidget::documentRevision() const
return document()->revision();
}
FollowSymbolInterface &CppEditorWidget::followSymbolInterface() const
{
return d->m_modelManager->followSymbolInterface();
}
bool CppEditorWidget::isSemanticInfoValidExceptLocalUses() const
{
return d->m_lastSemanticInfo.doc && d->m_lastSemanticInfo.revision == documentRevision()