private @Nullable VirtualFileWrapper doSave(@Nullable String baseDir, @Nullable String filename) {
    myFileDialog.setDirectory(baseDir);

    if (filename != null && filename.indexOf('.') < 0) {
      var extensions = myDescriptor.getFileExtensions();
      if (extensions.length > 0) {
        filename += '.' + extensions[0];
      }
    }
    myFileDialog.setFile(filename);

    myHelper.showNativeDialog(myFileDialog);

    var file = myFileDialog.getFile();
    return file == null ? null : new VirtualFileWrapper(new File(myFileDialog.getDirectory(), file));
  }
private @Nullable VirtualFileWrapper doSave(@Nullable String baseDir, @Nullable String filename)