public static @Nullable String detectLineSeparator(@NotNull VirtualFile file, boolean checkFile) {
    String lineSeparator = file.getDetectedLineSeparator();
    if (lineSeparator == null && checkFile) {
      try {
        getTextByBinaryPresentation(file.contentsToByteArray(), file);
        lineSeparator = file.getDetectedLineSeparator();
      }
      catch (IOException ignored) { }
    }
    return lineSeparator;
  }
public static @Nullable String detectLineSeparator(@NotNull VirtualFile file, boolean checkFile)