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