CppTools: Do not offer pointless ")" signature completion

If "Automatically insert matching characters" is activated and '(' is
typed before the semicolon in the declaration

    int f;

we offered the ')' completion, although the ')' was already inserted.

Change-Id: Id5a50fa94c2cb7b5c4056d87028501b0b90afc73
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2014-11-28 15:08:03 +01:00
parent d850485f06
commit 9cd552a165

View File

@@ -1927,7 +1927,9 @@ bool CppCompletionAssistProcessor::completeConstructorOrFunction(const QList<CPl
const FullySpecifiedType localTy = rewriteType(f->type(), &env, control);
// gets: "parameter list) cv-spec",
QString completion = overview.prettyType(localTy).mid(1);
const QString completion = overview.prettyType(localTy).mid(1);
if (completion == QLatin1String(")"))
continue;
addCompletionItem(completion, QIcon(), 0,
QVariant::fromValue(CompleteFunctionDeclaration(f)));