@Override
  public PsiElement @NotNull [] getPrimaryElements() {
    final PsiElement element = getPsiElement();
    if (element instanceof PsiParameter parameter) {
      if (parameter.getDeclarationScope() instanceof PsiMethod method && PsiUtil.canBeOverridden(method)) {
        final PsiClass aClass = method.getContainingClass();
        LOG.assertTrue(aClass != null); //Otherwise can not be overridden

        ProgressManager pm = ProgressManager.getInstance();
        boolean hasOverriden = pm.runProcessWithProgressSynchronously(() ->
                                                                        OverridingMethodsSearch.search(method).findFirst() != null ||
                                                                        FunctionalExpressionSearch.search(method).findFirst() != null,
                                                                      JavaBundle.message("progress.title.detect.overridden.methods"), true,
                                                                      getProject()) == Boolean.TRUE;

        if (hasOverriden && myFactory.getFindVariableOptions().isSearchInOverridingMethods) {
          return pm.runProcessWithProgressSynchronously(() -> getParameterElementsToSearch(parameter, method),
                                                        JavaBundle.message("progress.title.detect.overridden.methods"), true, getProject());
        }
      }
    }
    else if (element instanceof PsiMethod && myFactory.getFindMethodOptions().isSearchForBaseMethod &&
             //temporary workaround
             !DumbService.isDumb(element.getProject())) {
      return SuperMethodWarningUtil.getTargetMethodCandidates((PsiMethod)element, Collections.emptyList());
    }
    return myElementsToSearch.length == 0 ? new PsiElement[]{element} : myElementsToSearch;
  }
@Override
  public PsiElement @NotNull [] getPrimaryElements()