← All projects
Project record1 mention
Originally shared on Hacker News

HamsterWheel.FluentCodeGenerators

This C# library provides a fluent API for writing Roslyn source code generators. It automatically emits using statements, formats generated code, helps import types, handles indentation and balancing parentheses, supports parameters and async method generation, offers nicer wrappers around Roslyn's IncrementalValueProvider, and allows sharing pieces of code between files/classes (e.g. interface implementations).

Last shared
01 / The problem

What it addresses

Native Roslyn APIs are complicated to get started with when writing source code generators.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. HamsterWheel.FluentCodeGenerators

    This C# library provides a fluent API for writing Roslyn source code generators. It automatically emits using statements, formats generated code, helps import types, handles indentation and balancing parentheses, supports parameters and async method generation, offers nicer wrappers around Roslyn's IncrementalValueProvider, and allows sharing pieces of code between files/classes (e.g. interface implementations).

    Problem: Native Roslyn APIs are complicated to get started with when writing source code generators.

    Posted by @npodbielski · Original source ↗

    Source text · @npodbielski · · Source ↗

    It is small helpful library that helps to write Roslyn source code generators using fluent API. Might be a bit niche use, but native Roslyn APIs are a bit complicated to get started writing source code generator. Fluent API helps with that greatly.