You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A set of three projects that illustrates Roslyn source generators. Enjoy this template to learn from and modify source generators for your own needs.
4
-
5
-
## Content
6
-
### CommandForgeGenerator
7
-
A .NET Standard project with implementations of sample source generators.
8
-
**You must build this project to see the result (generated code) in the IDE.**
9
-
10
-
-[SampleSourceGenerator.cs](SampleSourceGenerator.cs): A source generator that creates C# classes based on a text file (in this case, Domain Driven Design ubiquitous language registry).
11
-
-[SampleIncrementalSourceGenerator.cs](SampleIncrementalSourceGenerator.cs): A source generator that creates a custom report based on class properties. The target class should be annotated with the `Generators.ReportAttribute` attribute.
12
-
13
-
### CommandForgeGenerator.Sample
14
-
A project that references source generators. Note the parameters of `ProjectReference` in [CommandForgeGenerator.Sample.csproj](../CommandForgeGenerator.Sample/CommandForgeGenerator.Sample.csproj), they make sure that the project is referenced as a set of source generators.
15
-
16
-
### CommandForgeGenerator.Tests
17
-
Unit tests for source generators. The easiest way to develop language-related features is to start with unit tests.
18
-
19
-
## How To?
20
-
### How to debug?
21
-
- Use the [launchSettings.json](Properties/launchSettings.json) profile.
22
-
- Debug tests.
23
-
24
-
### How can I determine which syntax nodes I should expect?
25
-
Consider installing the Roslyn syntax tree viewer plugin [Rossynt](https://plugins.jetbrains.com/plugin/16902-rossynt/).
26
-
27
-
### How to learn more about wiring source generators?
28
-
Watch the walkthrough video: [Let’s Build an Incremental Source Generator With Roslyn, by Stefan Pölz](https://youtu.be/azJm_Y2nbAI)
29
-
The complete set of information is available in [Source Generators Cookbook](https://github.com/dotnet/roslyn/blob/main/docs/features/source-generators.cookbook.md).
0 commit comments