Too Lazy for Generators

Are you too lazy to write good and efficient source generators? Do you want a simple and lightweight way to generate C# source code? This library might™ be for you!

Too Lazy for Generators is a library meant to provide a simple and lightweight way to generate C# source code. The library acts as a thin layer on top of the Roslyn APIs which abstracts the process of initiating and applying syntax additions, but which stills allows for full access to all the available compiler APIs. As the library does not attempt to hide the actual Roslyn APIs, it is heavily recommended that you are either already familiar with said APIs, or that you read up on them.

It is important to note that this library follows the design principles of source generators and is purely additive, meaning you cannot modify existing source code, only add new C# source files. Unlike source generators, however, Too Lazy for Generators gives you access to APIs which are unavailable to or not recommended for source generators.

A major difference to source generators is that Too Lazy for Generators generators are meant to run as either an on-command action or as a pre-compile step. For this reason, they do not have to conform to the high-efficieny standards of source generators, and you can freely use APIs which are deemed slower, less performant, or more existent than their recommended source generator counterparts. Obviously it's still up to you to decide how many of these APIs you choose to use depending on how fast you want the generation to be. If running as a pre-compile step, for instance, you may want to avoid slower APIs such as NormalizeWhitespace or ILazyGeneratorBuilder.TargetingProjectWithName.