From 0292fcf13598fd5900faa4222cec9baf5cdee5da Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Sat, 25 Jul 2015 23:50:06 -0400 Subject: [PATCH] Bug 473578 - Include "..." in the signature of a vararg function in element selection dialogs Change-Id: I9d44e3067b07035df3a0c1ad8674bcc6c83e4add Signed-off-by: Nathan Ridge --- .../org/eclipse/cdt/internal/core/browser/IndexModelUtil.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/IndexModelUtil.java b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/IndexModelUtil.java index 1df5c1a..c2eb04f 100644 --- a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/IndexModelUtil.java +++ b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/IndexModelUtil.java @@ -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; } -- 2.7.4