EA-109538 - CCE: MethodParameterInfoHandler.updateParameterInfo

This commit is contained in:
Dmitry Batrak
2017-10-18 13:04:17 +03:00
parent 6625c4e024
commit 7014f5b23d
@@ -327,9 +327,10 @@ public class MethodParameterInfoHandler implements ParameterInfoHandlerWithTabAc
context.setHighlightedParameter(completeMatch);
}
CandidateInfo resultingCandidate = (CandidateInfo)(candidates.length == 1 ? candidates[0] : context.getHighlightedParameter());
if (resultingCandidate != null) {
PsiMethod method = (PsiMethod)resultingCandidate.getElement();
Object highlightedCandidate = candidates.length == 1 ? candidates[0] : context.getHighlightedParameter();
if (highlightedCandidate != null) {
PsiMethod method = (PsiMethod)(highlightedCandidate instanceof CandidateInfo
? ((CandidateInfo)highlightedCandidate).getElement() : highlightedCandidate);
if (!method.isVarArgs() && index >= method.getParameterList().getParametersCount()) context.setCurrentParameter(-1);
}
}