Skip to content

Repository files navigation

Beskar.CodeGeneration

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.

Introduction

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 ISymbol objects 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.

Project Modules

Package NuGet Documentation Description
Beskar.CodeGeneration.Extensions NuGet README Core utilities, symbol transformers, and attribute helpers.
Beskar.CodeGeneration.TypeIdGenerator NuGet README A ready-to-use generator for creating type-safe identifiers (e.g., UserId).
Beskar.CodeGeneration.LanguageGenerator NuGet README A ready-to-use generator that transforms simple enumerations into a robust, type-safe translation infrastructure.
Beskar.CodeGeneration.ObserveGenerator NuGet README A ready-to-use generator that generates meters and activity sources - also simplifies registration.
Beskar.CodeGeneration.PacketGenerator NuGet README A ready-to-use generator that generates fast packet routing with support of any serialization.
Beskar.CodeGeneration.ProcessorGenerator NuGet README A ready-to-use generator that generates efficient, type-safe processing pipelines.
Beskar.CodeGeneration.EnumGenerator NuGet README A ready-to-use generator that generates nice-to-have performance extensions to enums.

About

Lightweight, performance-oriented C# library designed to simplify the creation of Source Generators. Also home of some generators that I use for my private projects. No AI slop invovled.

Topics

Resources

Contributing

Security policy

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages