void writeCode(int cursorLine, int cursorColumn, Collection<SourceContextLoader.Line> lines) {
        if (lines.isEmpty()) {
            return;
        }

        // Determine the string length of the biggest number to pad the line gutter correctly.
        int numberLength = findLongestNumber(lines);

        Iterator<SourceContextLoader.Line> lineIterator = lines.iterator();
        int lastLine = -1;

        while (lineIterator.hasNext()) {
            SourceContextLoader.Line line = lineIterator.next();

            if (line.getLineNumber() != lastLine + 1 && lastLine != -1) {
                writeColumnAndContent(numberLength, -1, "");
            }

            writeColumnAndContent(numberLength, line.getLineNumber(), line.getContent());

            if (line.getLineNumber() == cursorLine) {
                writePointer(numberLength, cursorColumn);
            }

            lastLine = line.getLineNumber();
        }

        writer.append(System.lineSeparator());
    }
Formats source {@link SourceContextLoader.Line} values and writes them to an {@link Appendable}.
smithy-cli/src/main/java/software/amazon/smithy/cli/commands/CodeFormatter.java