TextContent (@NotNull String text, boolean respectLineSeparators) { // TODO: detect invalid (different across the file) separators ? String correctedContent = StringUtil.convertLineSeparators(text); TextContent textContent = new TextContent(correctedContent); if (respectLineSeparators) { textContent.separators = StringUtil.detectSeparators(text); } return textContent; }