diff --git a/src/plugins/clangcodemodel/clangdfollowsymbol.cpp b/src/plugins/clangcodemodel/clangdfollowsymbol.cpp index a975c787368..ed74dac0d9d 100644 --- a/src/plugins/clangcodemodel/clangdfollowsymbol.cpp +++ b/src/plugins/clangcodemodel/clangdfollowsymbol.cpp @@ -464,7 +464,7 @@ void ClangdFollowSymbol::Private::handleGotoImplementationResult( // Also get the AST for the base declaration, so we can find out whether it's // pure virtual and mark it accordingly. // In addition, we need to follow all override links, because for these, clangd - // gives us the declaration instead of the definition. + // gives us the declaration instead of the definition (until clangd 16). for (const Link &link : std::as_const(allLinks)) { if (!client->documentForFilePath(link.targetFilePath) && addOpenFile(link.targetFilePath)) client->openExtraFile(link.targetFilePath); @@ -492,6 +492,9 @@ void ClangdFollowSymbol::Private::handleGotoImplementationResult( if (link == defLink) continue; + if (client->versionNumber().majorVersion() >= 17) + continue; + const TextDocumentIdentifier doc(client->hostPathToServerUri(link.targetFilePath)); const TextDocumentPositionParams params(doc, pos); GotoDefinitionRequest defReq(params);