aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangcodemodel
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2023-12-06 16:50:15 +0100
committerEike Ziller <eike.ziller@qt.io>2023-12-06 16:50:15 +0100
commit2e280e1c50d6fb1ac76d84703a060955f0b0a9fa (patch)
tree12b0260951cf3bf83ebbfcca1a21d4b22793f3ab /src/plugins/clangcodemodel
parent6a97b66592ff0bf76d236f6120cd94e2604283a4 (diff)
parentd1ac2fe45a9a7986bfb9217f14bfc1ca22a9cdd9 (diff)
Merge remote-tracking branch 'origin/12.0'
Conflicts: src/plugins/clangcodemodel/clangdfollowsymbol.cpp src/plugins/debugger/debuggerruncontrol.cpp src/plugins/projectexplorer/miniprojecttargetselector.cpp Change-Id: I45b7fee1a1d784c44f2139fb1ede69190d23d6fd
Diffstat (limited to 'src/plugins/clangcodemodel')
-rw-r--r--src/plugins/clangcodemodel/clangdclient.cpp7
-rw-r--r--src/plugins/clangcodemodel/clangdfollowsymbol.cpp5
2 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp
index 3d14d1687e0..5fdebdcf9f4 100644
--- a/src/plugins/clangcodemodel/clangdclient.cpp
+++ b/src/plugins/clangcodemodel/clangdclient.cpp
@@ -1137,14 +1137,15 @@ void ClangdClient::gatherHelpItemForTooltip(const HoverRequest::Response &hoverR
for (const QString &line : lines) {
const QString possibleFilePath = line.simplified();
const auto looksLikeFilePath = [&] {
- if (possibleFilePath.length() < 3)
+ if (possibleFilePath.length() < 4)
return false;
if (osType() == OsTypeWindows) {
- if (possibleFilePath.startsWith(R"(\\)"))
+ if (possibleFilePath.startsWith(R"(\\\\)"))
return true;
return possibleFilePath.front().isLetter()
&& possibleFilePath.at(1) == ':'
- && possibleFilePath.at(2) == '\\';
+ && possibleFilePath.at(2) == '\\'
+ && possibleFilePath.at(3) == '\\';
}
return possibleFilePath.front() == '/'
&& possibleFilePath.at(1).isLetterOrNumber();
diff --git a/src/plugins/clangcodemodel/clangdfollowsymbol.cpp b/src/plugins/clangcodemodel/clangdfollowsymbol.cpp
index 701b72d58bc..0da02cba330 100644
--- a/src/plugins/clangcodemodel/clangdfollowsymbol.cpp
+++ b/src/plugins/clangcodemodel/clangdfollowsymbol.cpp
@@ -460,7 +460,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);
@@ -488,6 +488,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);