forked from qt-creator/qt-creator
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:
@@ -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)));
|
||||
|
||||
Reference in New Issue
Block a user