Moved to: https://github.com/MarvinDrude/Beskar.Memory
Beskar.CodeGeneration is a suite of tools designed to streamline the development of C# Source Generators for .NET 10 and beyond. Leveraging the latest C# language features, it provides a robust infrastructure for symbol analysis, metadata extraction, and type-safe code generation.
Note: I use these mainly just for me and my private projects, but feel free to use them as well. Since I already build my generators with .NET 10, it will only work if your IDE supports it.
Developing Source Generators often involves repetitive tasks like manual attribute parsing, navigating complex symbol trees, and managing diagnostic reporting. This project simplifies that process by:
- Archetype-Based Modeling: Decouples heavy Roslyn
ISymbolobjects into lightweight, comparable "Archetypes" that are safe for use within the incremental generator pipeline. - Fluent Metadata Access: Provides high-level extension methods to easily extract values from attributes, handle positional/named arguments, and resolve type information.
- Modern .NET Standards: Built from the ground up for .NET 10, utilizing features
like
INumber<T>, advanced spans, and the latest C# preview features.
| Package | NuGet | Documentation | Description |
|---|---|---|---|
| Beskar.CodeGeneration.Extensions | README | Core utilities, symbol transformers, and attribute helpers. | |
| Beskar.CodeGeneration.TypeIdGenerator | README | A ready-to-use generator for creating type-safe identifiers (e.g., UserId). |
|
| Beskar.CodeGeneration.LanguageGenerator | README | A ready-to-use generator that transforms simple enumerations into a robust, type-safe translation infrastructure. | |
| Beskar.CodeGeneration.ObserveGenerator | README | A ready-to-use generator that generates meters and activity sources - also simplifies registration. | |
| Beskar.CodeGeneration.PacketGenerator | README | A ready-to-use generator that generates fast packet routing with support of any serialization. | |
| Beskar.CodeGeneration.ProcessorGenerator | README | A ready-to-use generator that generates efficient, type-safe processing pipelines. | |
| Beskar.CodeGeneration.EnumGenerator | README | A ready-to-use generator that generates nice-to-have performance extensions to enums. |