ClangCodeModel: Use clangd for all "follow symbol" actions

Change-Id: I4e33342d9683c24ad6ea5fbb578a1b460790aa4d
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-05-19 14:22:10 +02:00
parent aabb6d3539
commit 6ffe16d90b

View File

@@ -23,9 +23,12 @@
** **
****************************************************************************/ ****************************************************************************/
#include "clangeditordocumentprocessor.h"
#include "clangfollowsymbol.h" #include "clangfollowsymbol.h"
#include "clangdclient.h"
#include "clangeditordocumentprocessor.h"
#include "clangmodelmanagersupport.h"
#include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/editormanager.h>
#include <cpptools/cppmodelmanager.h> #include <cpptools/cppmodelmanager.h>
#include <cpptools/cppfollowsymbolundercursor.h> #include <cpptools/cppfollowsymbolundercursor.h>
@@ -173,6 +176,16 @@ void ClangFollowSymbol::findLink(const CppTools::CursorInEditor &data,
CppTools::SymbolFinder *symbolFinder, CppTools::SymbolFinder *symbolFinder,
bool inNextSplit) bool inNextSplit)
{ {
ClangdClient * const client
= ClangModelManagerSupport::instance()->clientForFile(data.filePath());
if (client && client->isFullyIndexed()) {
QTC_ASSERT(client->documentOpen(data.textDocument()),
client->openDocument(data.textDocument()));
client->symbolSupport().findLinkAt(data.textDocument(), data.cursor(),
std::move(processLinkCallback), resolveTarget);
return;
}
int line = 0; int line = 0;
int column = 0; int column = 0;
QTextCursor cursor = Utils::Text::wordStartCursor(data.cursor()); QTextCursor cursor = Utils::Text::wordStartCursor(data.cursor());