private Doc getBracketLineBreakDoc() {
        Doc lineDoc;
        if (!children.isEmpty() && open == Formatter.LBRACE) {
            // Make flattened objects have space padding inside the braces
            lineDoc = Doc.lineOrSpace();
        } else if (children.size() > 1) {
            // Multiple children may be separated on to different lines
            lineDoc = Doc.lineOrEmpty();
        } else {
            // Only one child or less doesn't need line separation
            lineDoc = Doc.empty();
        }
        return lineDoc;
    }
Formats various kinds of brackets, dealing with interspersed whitespace and comments.
smithy-syntax/src/main/java/software/amazon/smithy/syntax/BracketFormatter.java