I don't know if there is a thread for this extremely cool feature showcased at Build.
Basically, the new syntax for partial classes which replace original properties is:
replace public string FirstName
{
get { return original; }
set { original = value; }
}
I have a couple of questions here
replace and original final or will you change them?See #5561 and #5292.
Edit: The branch is features/generators.
They should really make feature branch docs/summaries. Going thru commits are tedious.
@leppie Isn't Language Feature Status what you want? (Though it doesn't have issue link for Source Generation and says that its branch is future.)
3, How does code generation actually work? I guess you have a branch or doc somewhere?
I found this live document really valuable:
https://github.com/dotnet/roslyn/blob/features/generators/docs/features/generators.md
Guess that kind of answer [2] from the OP too.
I'd structure the interface more functionally:
public abstract class SourceGeneratorContext
{
public abstract GeneratorResult Process(Compilation compilation);
}
sealed class GeneratorResult { IEnumerable<Diagnostic>, IEnumerable<AddedCompilationUnit> }
Input goes in, nothing is modified/written/stored, output comes out. This might seems like a small difference but given that this initial release is the only shot we have at defining this class it seems worth the change.
Most helpful comment
They should really make feature branch docs/summaries. Going thru commits are tedious.