From 9cd552a1656c04c1f3ccc92fefc62e2bd36fad37 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Fri, 28 Nov 2014 15:08:03 +0100 Subject: [PATCH] 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 --- src/plugins/cpptools/cppcompletionassist.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/cpptools/cppcompletionassist.cpp b/src/plugins/cpptools/cppcompletionassist.cpp index 44743977d49..e5da88c3229 100644 --- a/src/plugins/cpptools/cppcompletionassist.cpp +++ b/src/plugins/cpptools/cppcompletionassist.cpp @@ -1927,7 +1927,9 @@ bool CppCompletionAssistProcessor::completeConstructorOrFunction(const QListtype(), &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)));