@Override
  public PsiExpressionList findElementForUpdatingParameterInfo(final @NotNull 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 = null;
        if (highlighted instanceof PsiMethod method) {
          currentMethodInfo = (CandidateWithPresentation)ContainerUtil.find(candidates, c -> getMethodFromCandidate(c).equals(method));
        } else if (highlighted instanceof CandidateWithPresentation cwp) {
          currentMethodInfo = cwp;
        }
        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;
  }
@Override
  public PsiExpressionList findElementForUpdatingParameterInfo(final @NotNull UpdateParameterInfoContext context)