@Contract(pure = true)
  private static @NotNull List<@NotNull TextRange> getRanges(@NotNull TextRange snippetBodyTextRangeRelativeToSnippet, String@NotNull [] lines) {
    final int firstLine = getFirstNonEmptyLine(lines);
    final int lastLine = getLastNonEmptyLine(lines);

    int totalMinIndent = getIndent(lines, firstLine, lastLine);

    int startOffset = getStartOffsetOfFirstNonEmptyLine(snippetBodyTextRangeRelativeToSnippet, lines, firstLine);

    final List<TextRange> ranges = new ArrayList<>();
    for (int i = firstLine; i < Math.min(lastLine, lines.length); i++) {
      final String line = lines[i];
      final int size = line.length() + 1;
      final int indentSize = getIndentSize(line, totalMinIndent);

      ranges.add(TextRange.create(0, size - indentSize).shiftRight(startOffset + indentSize));
      startOffset += size;
    }

    final String line = lines[lastLine];
    final int indentSize = getIndentSize(line, totalMinIndent);

    final int endOffset = snippetBodyTextRangeRelativeToSnippet.getEndOffset();
    final int lastLineStartOffset = Math.min(endOffset, startOffset + indentSize);
    final int lastLineEndOffset = startOffset + line.length();

    ranges.add(TextRange.create(lastLineStartOffset, Math.min(endOffset, lastLineEndOffset)));
    return ranges;
  }
@Contract(pure = true)
  private static @NotNull List<@NotNull TextRange> getRanges(@NotNull TextRange snippetBodyTextRangeRelativeToSnippet, String@NotNull [] lines)