private static @NotNull HtmlChunk createOptionPreview(@NotNull PsiFile file, ModUpdateSystemOptions.@NotNull ModifiedOption option) {
    OptionController controller = OptionControllerProvider.rootController(file);
    OptionController.OptionControlInfo controlInfo = controller.findControl(option.bindId());
    if (controlInfo == null) return HtmlChunk.empty();
    OptControl control = controlInfo.control();
    Object newValue = option.newValue();
    if (newValue instanceof Boolean value) {
      OptCheckbox optCheckBox = ObjectUtils.tryCast(control, OptCheckbox.class);
      if (optCheckBox == null) return HtmlChunk.empty();
      HtmlChunk label = text(optCheckBox.label().label());
      HtmlChunk.Element checkbox = tag("input").attr("type", "checkbox").attr("readonly", "true");
      if (value) {
        checkbox = checkbox.attr("checked", "true");
      }
      HtmlChunk info = tag("table")
        .child(tag("tr").children(
          tag("td").child(checkbox),
          tag("td").child(label)
        ));
      return new HtmlBuilder().append(value ? AnalysisBundle.message("set.option.description.check")
                                            : AnalysisBundle.message("set.option.description.uncheck"))
        .br().br().append(info).toFragment();
    }
    if (newValue instanceof Integer value) {
      OptNumber optNumber = ObjectUtils.tryCast(control, OptNumber.class);
      if (optNumber == null) return HtmlChunk.empty();
      LocMessage.PrefixSuffix prefixSuffix = optNumber.splitLabel().splitLabel();
      HtmlChunk info = getValueChunk(value, prefixSuffix);
      return new HtmlBuilder().append(AnalysisBundle.message("set.option.description.input"))
        .br().br().append(info).br().toFragment();
    }
    if (newValue instanceof String value) {
      OptString optString = ObjectUtils.tryCast(control, OptString.class);
      if (optString == null) return HtmlChunk.empty();
      LocMessage.PrefixSuffix prefixSuffix = optString.splitLabel().splitLabel();
      HtmlChunk info = getValueChunk(value, prefixSuffix);
      return new HtmlBuilder().append(AnalysisBundle.message("set.option.description.string"))
        .br().br().append(info).br().toFragment();
    }
    if (newValue instanceof List<?> list) {
      OptStringList optList = ObjectUtils.tryCast(control, OptStringList.class);
      if (optList == null) return HtmlChunk.empty();
      List<?> oldList = (List<?>)option.oldValue();
      //noinspection unchecked
      return IntentionPreviewInfo.addListOption((List<String>)list, optList.label().label(), value -> !oldList.contains(value)).content();
    }
    throw new IllegalStateException("Value of type " + newValue.getClass() + " is not supported");
  }
private static @NotNull HtmlChunk createOptionPreview(@NotNull PsiFile file, ModUpdateSystemOptions.@NotNull ModifiedOption option)