PsiExpressionList (@NotNull final UpdateParameterInfoContext context) { if (context.isPreservedOnHintHidden() && isOutsideOfCompletedInvocation(context)) { context.setPreservedOnHintHidden(false); return null; } PsiExpressionList expressionList = findArgumentList(context.getFile(), context.getOffset(), context.getParameterListStart(), !context.isSingleParameterInfo()); if (expressionList != null) { Object[] candidates = context.getObjectsToView(); if (candidates != null && candidates.length != 0) { Object highlighted = context.getHighlightedParameter(); CandidateWithPresentation currentMethodInfo; if (highlighted instanceof PsiMethod method) { currentMethodInfo = (CandidateWithPresentation)ContainerUtil.find(candidates, c -> getMethodFromCandidate(c).equals(method)); } else { currentMethodInfo = (CandidateWithPresentation)highlighted; } if (currentMethodInfo == null) currentMethodInfo = (CandidateWithPresentation)candidates[0]; PsiMethod method = currentMethodInfo.getMethod(); PsiElement parent = expressionList.getParent(); String originalMethodName = method.getName(); PsiQualifiedReference currentMethodReference = null; if (parent instanceof PsiMethodCallExpression call && !method.isConstructor()) { currentMethodReference = call.getMethodExpression(); } else if (parent instanceof PsiNewExpression newExpression) { currentMethodReference = newExpression.getClassReference(); } else if (parent instanceof PsiAnonymousClass anonymousClass) { currentMethodReference = anonymousClass.getBaseClassReference(); } if (currentMethodReference == null || originalMethodName.equals(currentMethodReference.getReferenceName())) { return expressionList; } } } return null; }