Avoid automatically inserting unwanted closing parentheses

This is for the case of function overloads where one overload takes no
parameters. Solved by keeping track of the duplicate count.

Done with Roberto Raggi.
This commit is contained in:
Thorbjørn Lindeijer
2009-03-26 15:40:53 +01:00
parent ece7c9afd7
commit 0a99fef5a3
3 changed files with 7 additions and 2 deletions

View File

@@ -1224,8 +1224,9 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item)
extraChars += QLatin1Char('(');
// If the function takes no arguments, automatically place the closing parenthesis
if (function->argumentCount() == 0 || (function->argumentCount() == 1 &&
function->argumentAt(0)->type()->isVoidType())) {
if (item.m_duplicateCount == 0 && (function->argumentCount() == 0 ||
(function->argumentCount() == 1 &&
function->argumentAt(0)->type()->isVoidType()))) {
extraChars += QLatin1Char(')');
// If the function doesn't return anything, automatically place the semicolon,