@Override
        public String apply(Object type, String indent) {
            if (type instanceof Symbol) {
                Symbol typeSymbol = (Symbol) type;
                addUseImports(typeSymbol);
                String relativizeSymbols = getContext(RELATIVIZE_SYMBOLS, String.class);
                if (relativizeSymbols != null) {
                    return typeSymbol.relativize(relativizeSymbols);
                } else {
                    return typeSymbol.toString();
                }
            } else if (type instanceof SymbolReference) {
                SymbolReference typeSymbol = (SymbolReference) type;
                addImport(typeSymbol.getSymbol(), typeSymbol.getAlias(), SymbolReference.ContextOption.USE);
                return typeSymbol.getAlias();
            } else {
                throw new CodegenException("Invalid type provided to $T. Expected a Symbol or SymbolReference, "
                        + "but found `" + type + "`");
            }
        }
The default implementation for formatting Symbols in SymbolWriter.
smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/SymbolWriter.java