String expandSection(CodeSection section, String previousContent, Consumer<String> consumer) {
        StringBuilder buffer = new StringBuilder();
        pushState(section);
        currentState.makeSectionInline(buffer);
        consumer.accept(previousContent);
        popState();
        return buffer.toString();
    }
Enable or disable writing stack trace comments before each call to
{@link #write}, {@link #writeWithNoFormatting}, {@link #writeInline},
and {@link #writeInlineWithNoFormatting}.

<p>It's sometimes useful to know where in a code generator a line of code
generated text came from. Enabling stack trace comments will output
the last relevant stack trace information caused text to appear in the
code writer's output.

@param enableStackTraceComments Set to true to enable stack trace comments.
@return Returns self.
smithy-utils/src/main/java/software/amazon/smithy/utils/AbstractCodeWriter.java