@Override
    public Symbol toSymbol(Shape shape) {
        Symbol symbol = symbolProvider.toSymbol(shape);
        ShapeId shapeId = shape.getId();
        if (visitedShapes.add(shapeId)) {
            List<ShapeLink> shapeLinks = shapeLinkCreator.apply(shape, symbol);
            if (shapeLinks.size() > 0) {
                traceFileBuilder.addShapeLinks(shapeId, shapeLinks);
            }
        }
        return symbol;
    }
Converts a shape into a symbol by calling the toSymbol method of the
SymbolProvider used to construct this TracingSymbolProvider. Adds a
list of ShapeLinks to the TracingSymbolProvider's TraceFile.Builder.

@param shape Shape to convert to Symbol.
@return Symbol created from Shape.
smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/trace/TracingSymbolProvider.java