@Override
    public @Nullable File getIOFile() {
      VirtualFile originalFile = myContext.getVirtualFile();
      String ext;
      Charset charset;
      if (originalFile != null) {
        if (originalFile.isInLocalFileSystem()) {
          Path localPath = originalFile.getFileSystem().getNioPath(originalFile);
          if (localPath != null) {
            return localPath.toFile();
          }
        }
        ext = originalFile.getExtension();
        charset = originalFile.getCharset();
      }
      else {
        ext = myContext.getContainingFile().getFileType().getDefaultExtension();
        charset = EncodingManager.getInstance().getDefaultCharset();
      }
      try {
        File tempFile = FileUtilRt.createTempFile(TEMP_FILE_PREFIX, "." + ext, true);
        try (FileWriter writer = new FileWriter(tempFile, charset)) {
          writer.write(getDocumentText());
        }
        return tempFile;
      }
      catch (IOException e) {
        LOG.warn(e);
        return null;
      }
    }
@Override
    public @Nullable File getIOFile()