@Override
  public boolean showHint(@NotNull Editor editor) {
    PsiElement callExpression = getElement();
    if (callExpression == null || getQualifierExpression() != null) {
      return false;
    }
    if (!CodeInsightSettings.getInstance().ADD_MEMBER_IMPORTS_ON_THE_FLY) {
      return false;
    }
    if (candidates.isEmpty()) {
      return false;
    }

    T firstCandidate = candidates.get(0);
    PsiFile containingFile = callExpression.getContainingFile();
    if (containingFile == null || isPsiModificationStampChanged(containingFile.getProject())) {
      return false;
    }

    if ((!toAddStaticImports() ||
         candidates.size() != 1 ||
         !PsiTreeUtil.isAncestor(containingFile, firstCandidate, true))
        && !ApplicationManager.getApplication().isHeadlessEnvironment()
        && !HintManager.getInstance().hasShownHintsThatWillHideByOtherHint(true)) {
      TextRange textRange = callExpression.getTextRange();
      QuestionAction action = createQuestionAction(candidates, containingFile.getProject(), editor);
      String hintText =
        ShowAutoImportPass.getMessage(candidates.size() > 1, getMemberKindPresentableText(), getMemberPresentableText(firstCandidate));
      HintManager.getInstance().showQuestionHint(editor, hintText,
                                                 textRange.getStartOffset(),
                                                 textRange.getEndOffset(), action);
      return true;
    }

    return false;
  }
@Override
  public boolean showHint(@NotNull Editor editor)