public static @NotNull String getLineSeparator(@NotNull Document document, @NotNull VirtualFile file) {
    String lineSeparator = file.getDetectedLineSeparator();
    if (lineSeparator == null) {
      lineSeparator = document.getUserData(LINE_SEPARATOR_KEY);
      assert lineSeparator != null : document;
    }
    return lineSeparator;
  }
public static @NotNull String getLineSeparator(@NotNull Document document, @NotNull VirtualFile file)