summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2014-11-28 15:08:03 +0100
committerNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2014-12-03 10:37:24 +0100
commit9cd552a1656c04c1f3ccc92fefc62e2bd36fad37 (patch)
treefe1c70e87cae5a1eeac61bd8ff0d4bfcb9d25a79
parentd850485f0624eaf6ea756e0c941d2722df8b3e02 (diff)
downloadqt-creator-9cd552a1656c04c1f3ccc92fefc62e2bd36fad37.tar.gz
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>
-rw-r--r--src/plugins/cpptools/cppcompletionassist.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/cpptools/cppcompletionassist.cpp b/src/plugins/cpptools/cppcompletionassist.cpp
index 44743977d4..e5da88c322 100644
--- a/src/plugins/cpptools/cppcompletionassist.cpp
+++ b/src/plugins/cpptools/cppcompletionassist.cpp
@@ -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)));