clang: fix tooltip missing closing bracket with default argument calls

parent 5472bac7
......@@ -187,7 +187,11 @@ QVector<QString> ClangUtils::getDefaultArguments(CXCursor cursor, DefaultArgumen
info.stringParts.removeFirst();
}
//Clang seems to include the , or ) at the end of the param, so delete that
if (!info.stringParts.isEmpty() && (info.stringParts.last() == QLatin1String(",") || info.stringParts.last() == QLatin1String(")"))) {
if (!info.stringParts.isEmpty() &&
((info.stringParts.last() == QLatin1String(",")) ||
(info.stringParts.last() == QLatin1String(")") &&
// assuming otherwise matching "(" & ")" tokens
info.stringParts.count(QStringLiteral("(")) != info.stringParts.count(QStringLiteral(")"))))) {
info.stringParts.removeLast();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment