There is a rule in source generator where if the class is nested inside a static class, code will not be generated. Allow code generation when the class is nested inside a partial class, as in that case, code can be generated.