@ApiStatus.Internal
  static @Nullable Path getInitialPath(@NotNull FileChooserDescriptor descriptor, @Nullable Project project, @Nullable VirtualFile toSelect) {
    Path result = NioFiles.toPath(FileUtil.toSystemDependentName(pathToSelect(descriptor, project, toSelect)));
    return result != null && descriptor instanceof FileSaverDescriptor && !Files.isDirectory(result) ? result.getParent() : result;
  }
@ApiStatus.Internal
  static @Nullable Path getInitialPath(@NotNull FileChooserDescriptor descriptor, @Nullable Project project, @Nullable VirtualFile toSelect)