private static void doOpen(@NotNull Path _dir, @Nullable Path _toSelect) {
    var dir = _dir.toAbsolutePath().normalize().toString();
    var toSelect = _toSelect != null ? _toSelect.toAbsolutePath().normalize().toString() : null;
    String fmApp;

    if (SystemInfo.isWindows) {
      if (JnaLoader.isLoaded()) {
        openViaShellApi(dir, toSelect);
      }
      else {
        openViaExplorerCall(dir, toSelect);
      }
    }
    else if (SystemInfo.isMac) {
      if (toSelect != null) {
        spawn("open", "-R", toSelect);
      }
      else {
        spawn("open", dir);
      }
    }
    else if ((fmApp = Holder.fileManagerApp) != null) {
      if (toSelect != null && fmApp.endsWith("dolphin")) {
        spawn(fmApp, "--select", toSelect);
      }
      else if (toSelect != null && fmApp.endsWith("dde-file-manager")) {
        spawn(fmApp, "--show-item", toSelect);
      }
      else {
        spawn(fmApp, toSelect != null ? toSelect : dir);
      }
    }
    else if (toSelect == null && SystemInfo.hasXdgOpen()) {
      spawn("xdg-open", dir);
    }
    else {
      var message = IdeBundle.message("reveal.unsupported.message", requireNonNullElse(toSelect, dir));
      new Notification("System Messages", message, NotificationType.WARNING)
        .notify(null);
    }
  }
private static void doOpen(@NotNull Path _dir, @Nullable Path _toSelect)