otac0n / Weave

Weave is a text templating engine for .NET that is all about attention to detail. Weave handles the tricky work of making your rendered text beautiful.
MIT License
22 stars 4 forks source link

Target any partial method. #16

Open otac0n opened 10 months ago

otac0n commented 10 months ago

In order to support attribute-based additive source generation, it would be helpful to be able to express any combination of namespace, class, nested class, and partial method with a simple declaration.

@namespace A.B.C
@className ExposedClass+X+Y
@methodName Method

could imply

namespace A.B.C
{
    partial class ExposedClass
    {
        partial class X
        {
                partial class Y
                {
                    Method() {}
                }
        }
    }
}

Better yet,

@memberName A.B.C.ExposedClass+X+Y.Method

Would imply the same.

otac0n commented 10 months ago

Can we target every generic class?

otac0n commented 10 months ago

I think it's too complicated to deal with inheriting values (especially recursively) if we add a @memberName option. Best is to just enable the @className to contain nested class names.