コード例 #1
0
 @NotNull
 public static String getLineSeparator(@NotNull Document document, @NotNull VirtualFile file) {
   String lineSeparator = LoadTextUtil.getDetectedLineSeparator(file);
   if (lineSeparator == null) {
     lineSeparator = document.getUserData(LINE_SEPARATOR_KEY);
     assert lineSeparator != null : document;
   }
   return lineSeparator;
 }
コード例 #2
0
 @Override
 @NotNull
 public String getLineSeparator(@Nullable VirtualFile file, @Nullable Project project) {
   String lineSeparator = file == null ? null : LoadTextUtil.getDetectedLineSeparator(file);
   if (lineSeparator == null) {
     CodeStyleFacade settingsManager =
         project == null ? CodeStyleFacade.getInstance() : CodeStyleFacade.getInstance(project);
     lineSeparator = settingsManager.getLineSeparator();
   }
   return lineSeparator;
 }