public static @Nullable PsiFile getPsiFileInEditor(final @NotNull Editor editor, final @NotNull Project project) {
    return getPsiFileInEditor(editor.getCaretModel().getCurrentCaret(), project);
  }
public static @Nullable PsiFile getPsiFileInEditor(final @NotNull Editor editor, final @NotNull Project project)