private static @NotNull Path doPaint(@NotNull Path outDir,
                                       @NotNull HTMLTextPainter textPainter,
                                       @Nullable Int2ObjectMap<? extends PsiReference> refMap) throws IOException {
    Path htmlFile = outDir.resolve(getHTMLFileName(textPainter.getPsiFile()));
    try (BufferedWriter writer = Files.newBufferedWriter(htmlFile)) {
      textPainter.paint(refMap, writer, true);
    }
    return htmlFile;
  }
private static @NotNull Path doPaint(@NotNull Path outDir,
                                       @NotNull HTMLTextPainter textPainter,
                                       @Nullable Int2ObjectMap<? extends PsiReference> refMap)