private static @Nullable PsiElement findElementForQuickDoc(@NotNull Editor editor, int offset, @NotNull Project project) {
    if (!EditorSettingsExternalizable.getInstance().isShowQuickDocOnMouseOverElement()) {
      return null;
    }
    PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
    if (psiFile == null) {
      return null;
    }
    PsiElement result = findElementForQuickDoc(project, psiFile, offset);
    if (result instanceof PsiWhiteSpace) {
      return null;
    }
    return result;
  }
private static @Nullable PsiElement findElementForQuickDoc(@NotNull Editor editor, int offset, @NotNull Project project)