static @NotNull @Nls String reasonToString(@NotNull FailReason reason, @NotNull VirtualFile file) {
    return switch (reason) {
      case IS_DIRECTORY -> IdeBundle.message("no.charset.set.reason.disabled.for.directory");
      case IS_BINARY -> IdeBundle.message("no.charset.set.reason.disabled.for.binary.file");
      case BY_FILE -> IdeBundle.message("no.charset.set.reason.charset.hard.coded.in.file");
      case BY_BOM -> IdeBundle.message("no.charset.set.reason.charset.auto.detected.by.bom");
      case BY_BYTES -> IdeBundle.message("no.charset.set.reason.charset.auto.detected.from.content");
      case BY_FILETYPE -> IdeBundle.message("no.charset.set.reason.disabled.for.file.type", file.getFileType().getDescription());
    };
  }
static @NotNull @Nls String reasonToString(@NotNull FailReason reason, @NotNull VirtualFile file)