protected void writeOutput(CommonProblemDescriptor @NotNull [] descriptions, @NotNull RefEntity refElement) throws IOException {
    InspectionEP inspectionEP = myToolWrapper.getExtension();
    synchronized (inspectionEP != null ? inspectionEP : WRITER_LOCK) {
      Path file = InspectionsResultUtil.getInspectionResultPath(myContext.getOutputPath(), myToolWrapper.getShortName());
      boolean exists = Files.exists(file);
      if (!exists && !Files.isDirectory(file.getParent())) {
        Files.createDirectories(file.getParent());
      }
      try (Writer writer = Files.newBufferedWriter(file, StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.APPEND)) {
        if (!exists) {
          writer.write('<');
          writer.write(GlobalInspectionContextBase.PROBLEMS_TAG_NAME);
          writer.write(' ');
          writer.write(GlobalInspectionContextBase.LOCAL_TOOL_ATTRIBUTE);
          writer.write('=');
          writer.write('"');
          writer.write(Boolean.toString(myToolWrapper instanceof LocalInspectionToolWrapper));
          writer.write('"');
          writer.write('>');
          writer.write('\n');
        }

        exportResults(descriptions, refElement, element -> {
          try {
            JbXmlOutputter.Companion.collapseMacrosAndWrite(element, getContext().getProject(), writer);
          }
          catch (IOException e) {
            LOG.error(e);
          }
        }, __ -> false);

        writer.write('\n');
      }
    }
  }
protected void writeOutput(CommonProblemDescriptor @NotNull [] descriptions, @NotNull RefEntity refElement)