TailType (@NotNull final PsiExpression argument, final int index, @NotNull final PsiMethod method, @NotNull final PsiSubstitutor substitutor, final PsiParameter @NotNull [] params) { if (index >= params.length || index == params.length - 2 && params[index + 1].isVarArgs()) { return TailTypes.noneType(); } if (index == params.length - 1) { final PsiElement call = argument.getParent().getParent(); // ignore JspMethodCall if (call instanceof SyntheticElement) return TailTypes.noneType(); PsiType returnType = method.getReturnType(); if (returnType != null) returnType = substitutor.substitute(returnType); return getFinalCallParameterTailType(call, returnType, method); } if (CodeInsightSettings.getInstance().SHOW_PARAMETER_NAME_HINTS_ON_COMPLETION) { PsiCall completedOuterCall = getCompletedOuterCall(argument); if (completedOuterCall != null) return new CommaTailTypeWithSyncHintUpdate(completedOuterCall); } return CommaTailType.INSTANCE; }