private static FileEditorProvider getFileEditorProvider(@NotNull Project project, @NotNull VirtualFile file) {
    FileEditorManager manager = FileEditorManager.getInstance(project);
    return manager == null ? null : () -> getFirstElement(manager.openFile(file, false));
  }
private static FileEditorProvider getFileEditorProvider(@NotNull Project project, @NotNull VirtualFile file)