private static PsiElement findElementInFile(@Nullable PsiFile psiFile, @NotNull Editor editor) {
    return psiFile != null ? psiFile.findElementAt(editor.getCaretModel().getOffset()) : null;
  }
private static PsiElement findElementInFile(@Nullable PsiFile psiFile, @NotNull Editor editor)