class EmbeddedAttributeProvider implements AttributeProvider {

    final public static IndependentAttributeProviderFactory Factory = new IndependentAttributeProviderFactory() {
        @NotNull
        @Override
        public AttributeProvider apply(@NotNull LinkResolverContext context) {
            return new EmbeddedAttributeProvider();
        }
    };

    EmbeddedAttributeProvider() {
    }

    @Override
    public void setAttributes(@NotNull Node node, @NotNull AttributablePart part, @NotNull MutableAttributes attributes) {<FILL_FUNCTION_BODY>}

    // so we can attach attributes to any node in the AST and have a generic attribute provider serve them up
    public static class EmbeddedNodeAttributes extends Node {
        final @NotNull Attributes attributes;

        public EmbeddedNodeAttributes(@NotNull Node parent, @NotNull Attributes attributes) {
            super(parent.getChars().subSequence(0, 0));
            this.attributes = attributes;
        }

        @NotNull
        @Override
        public BasedSequence[] getSegments() {
            return Node.EMPTY_SEGMENTS;
        }

        @Override
        public void astString(@NotNull StringBuilder out, boolean withExtra) {
            out.append(EmbeddedNodeAttributes.class.getSimpleName());
            out.append("[").append(getStartOffset()).append(", ").append(getEndOffset()).append("]");
            out.append(", attributes: ").append(attributes.toString());

            if (withExtra) getAstExtra(out);
        }

        @Override
        public void astExtraChars(@NotNull StringBuilder out) {
        }
    }
}

        if (part == AttributablePart.NODE) {
            Node firstChild = node.getChildOfType(EmbeddedNodeAttributes.class);
            if (firstChild instanceof EmbeddedNodeAttributes) {
                attributes.addValues(((EmbeddedNodeAttributes) firstChild).attributes);
            }
        }
    
<no_super_class>