Commit 9c95600d authored by Rolf Eike Beer's avatar Rolf Eike Beer
Browse files

do not insert spaces in function definition after void or type with no argument name


Hint: basically done by Milian to trick me into being able to fix some of my
problems myself later.
parent 8008e382
......@@ -166,7 +166,10 @@ void createArgumentList(const NormalDeclarationCompletionItem& item, QString& re
ret += Cpp::shortenedTypeString(type, ctx, 1000000);
ret += Cpp::shortenedTypeString(type, ctx, desiredArgumentTypeLength, item.stripPrefix());
ret += " " + (*paramNameIt)->identifier().toString();
const QString ident = (*paramNameIt)->identifier().toString();
if (!ident.isEmpty()) {
ret += " " + ident;
ret += arrayAppendix;
} else if (argument)
ret += argument->toString();
......@@ -3101,6 +3101,8 @@ void TestCppCodeCompletion::testArgumentList()
codeToArgList.insert("void foo(int arg[][1]){}", "(int arg[][1])");
codeToArgList.insert("void foo(int arg[1][1]){}", "(int arg[1][1])");
codeToArgList.insert("void foo(int arg[][1][1]){}", "(int arg[][1][1])");
codeToArgList.insert("void foo(void){}", "(void)");
codeToArgList.insert("void foo(int){}", "(int)");
QMap< QByteArray, QString >::const_iterator it = codeToArgList.constBegin();
while (it != codeToArgList.constEnd()){
qDebug() << "input function is:" << it.key();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment