The source generators currently automatically generate empty ctors for views, markup extensions and converters.
Source generator
A new source generator feature should be added using attributes. When this attribute GenerateEmptyConstructor is used on a class, the class should generate the static GetService<> method similar to the other source generators.
An empty ctor should be created for runtime construction, similar to the other source generators.
Code analyzer
Create a separate code analyzer that checks for the used attribute. If the attribute is used, but the class is not partial, a compilation warning should be created.
The source generators currently automatically generate empty ctors for views, markup extensions and converters.
Source generator
A new source generator feature should be added using attributes. When this attribute
GenerateEmptyConstructoris used on a class, the class should generate the static GetService<> method similar to the other source generators.An empty ctor should be created for runtime construction, similar to the other source generators.
Code analyzer
Create a separate code analyzer that checks for the used attribute. If the attribute is used, but the class is not partial, a compilation warning should be created.