1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 17:35:35 +02:00

Bug 473578 - Include "..." in the signature of a vararg function in

element selection dialogs

Change-Id: I9d44e3067b07035df3a0c1ad8674bcc6c83e4add
Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
This commit is contained in:
Nathan Ridge 2015-07-25 23:50:06 -04:00 committed by Gerrit Code Review @ Eclipse.org
parent c9a1d984ca
commit 0292fcf135

View file

@ -162,11 +162,16 @@ public class IndexModelUtil {
*/
public static String[] extractParameterTypes(IFunction function) throws DOMException {
IParameter[] params= function.getParameters();
String[] parameterTypes= new String[params.length];
boolean vararg = function.takesVarArgs();
int paramCount = params.length + (vararg ? 1 : 0);
String[] parameterTypes= new String[paramCount];
for (int i = 0; i < params.length; i++) {
IParameter param = params[i];
parameterTypes[i]= ASTTypeUtil.getType(param.getType(), false);
}
if (vararg) {
parameterTypes[paramCount - 1] = "..."; //$NON-NLS-1$
}
if (parameterTypes.length == 1 && parameterTypes[0].equals("void")) { //$NON-NLS-1$
return EMPTY_STRING_ARRAY;
}