@Nullable
  protected static VirtualFile getContentFile(@NotNull final ConsoleRootType rootType,
                                              @NotNull String fileExtension,
                                              @NotNull String id,
                                              @NotNull ScratchFileService.Option option) {
    final String pathName = PathUtil.makeFileName(rootType.getContentPathName(id), fileExtension);
    try {
      return rootType.findFile(null, pathName, option);
    }
    catch (final IOException e) {
      LOG.warn(e);
      ApplicationManager.getApplication().invokeLater(() -> {
        String message = ExecutionBundle.message("dialog.message.unable.to.open.file", rootType.getId(), pathName, e.getLocalizedMessage());
        Messages.showErrorDialog(message, ExecutionBundle.message("dialog.title.unable.to.open.file"));
      });
      return null;
    }
  }
@Nullable
  protected static VirtualFile getContentFile(@NotNull final ConsoleRootType rootType,
                                              @NotNull String fileExtension,
                                              @NotNull String id,
                                              @NotNull ScratchFileService.Option option)