Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davidwengier/SourceGeneratorPlayground
The C# Source Generator Playground
https://github.com/davidwengier/SourceGeneratorPlayground
csharp-sourcegenerator
Last synced: 7 days ago
JSON representation
The C# Source Generator Playground
- Host: GitHub
- URL: https://github.com/davidwengier/SourceGeneratorPlayground
- Owner: davidwengier
- License: mit
- Created: 2020-08-15T12:30:39.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-08-18T06:13:04.000Z (about 3 years ago)
- Last Synced: 2024-08-02T16:51:50.239Z (3 months ago)
- Topics: csharp-sourcegenerator
- Language: C#
- Homepage:
- Size: 39.3 MB
- Stars: 145
- Watchers: 7
- Forks: 16
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# !["bulb by Luca Ska from the Noun Project"](assets/bulb.png) Source Generator Playground
[![License: MIT](https://img.shields.io/github/license/davidwengier/SourceGeneratorPlayground?color=blue "License: MIT")](https://choosealicense.com/licenses/mit/)
[![Main build status](https://github.com/davidwengier/SourceGeneratorPlayground/workflows/DeployToGitHubPages/badge.svg "Build status")](https://github.com/davidwengier/SourceGeneratorPlayground/actions?query=workflow%3ADeployToGitHubPages)
[![Join the Discord](https://img.shields.io/discord/709643112636612658?label=Discord "Join the Discord")](https://discord.gg/Yt5B58b)Source Generator Playground is a simple Blazor app that lets you experiment with a C# 9 source generator. It allows you to write a simple console application, and a source generator, and observe the generated output and the program output.
### Try it live: [https://wengier.com/SourceGeneratorPlayground](https://wengier.com/SourceGeneratorPlayground)
Multiple generators can be supplied, though they all need to live in the same text box, and the generator(s) can add any number of syntax trees to the compilation. All care is taken to capture meaningful errors from compilation of the generator, the program, and the running of the program.
You can browse through the in built samples to try out generators, and start modifying things to see what happens. If you want to run your own, use the Load buttons. At the moment the only references available that can be leveraged is whatever is necessary for the app itself.
Feel free to log issues for feedback, or PRs for new samples etc.
![](assets/sourcegendev.gif)