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
This commit is contained in:
Eike Ziller
2023-12-06 16:50:15 +01:00
31 changed files with 330 additions and 120 deletions

View File

@@ -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();

View File

@@ -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);