So made a source generator - ended up rather complex.
But I find unit testing it very tedious when verifying the generated output via Verify.
Is it not possible to load a class/instance as source in the testing, and use it as foundation for the generator. Instead of having to manually writing (and maintaining) the source as a string to then parse into a syntax tree to verify output? I mean it can generate on compile time, so why not at test? :D
This library is a C# source generator designed to automatically generate string length constants from Entity Framework configurations and data annotations.
Added a simple dependency injection example into my source generators package: https://github.com/RikudouSage/SourceGenerators/tree/master/examples/dependency-injection
I've just created a PHP source generators package. It's still work-in-progress.
What do you think, yay or nay?
Creating a #SourceGenerator is not worth it (I think).
Manually converting #JavaScript modules to #CSharp.
https://gist.github.com/AliveDevil/264cc53132d064c4561f5fbf84bfabc4
Earlier this year, around //build — some NuGet packages shipped. One of which is named AutoClient. It relies on a source-generator, emitting interface implementations and DI hooks for REST API HTTP clients, check it out:
#dotnet
#csharp
🤓 #sourcegenerator
https://www.nuget.org/packages/Microsoft.Extensions.Http.AutoClient