From 3c0c26f7b35b967ae21375ca00c25bc520d736b4 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 3 Apr 2023 12:26:01 +0200 Subject: [PATCH] ClangCodeModel: Adapt to updated clangd tooltip format The header file path is not the last line anymore; see https://reviews.llvm.org/D146244. Change-Id: Ifbc2b55c0a82c661454d487c287fe4fb5a950d38 Reviewed-by: Qt CI Bot Reviewed-by: Reviewed-by: David Schulz --- src/plugins/clangcodemodel/clangdclient.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp index 7b2fc5353e2..392a6a1ffe8 100644 --- a/src/plugins/clangcodemodel/clangdclient.cpp +++ b/src/plugins/clangcodemodel/clangdclient.cpp @@ -1069,9 +1069,8 @@ void ClangdClient::gatherHelpItemForTooltip(const HoverRequest::Response &hoverR QString cleanString = markupString; cleanString.remove('`'); const QStringList lines = cleanString.trimmed().split('\n'); - if (!lines.isEmpty()) { - const auto markupFilePath = Utils::FilePath::fromUserInput( - lines.last().simplified()); + for (const QString &line : lines) { + const auto markupFilePath = Utils::FilePath::fromUserInput(line.simplified()); if (markupFilePath.exists()) { d->setHelpItemForTooltip(hoverResponse.id(), filePath,