davidwengier / sourcegeneratortemplate Goto Github PK
View Code? Open in Web Editor NEWA basic template for writing a C# source generator
A basic template for writing a C# source generator
Great little project, but I had to spend some time with some Regex-ing in Visual Studio Code to get this to a "template" stage, (my project name and namespaces etc.).
It would be cool to make this a proper template that is distributed through nuget so its command-line installable
I am working on some templates and I might just do some copypasting and send a PR in your direction if you are interested? (No promises, this would be a side-project to my side-project that's sprung out of my not-work-project #scopecreep ๐ )
Hi,
I've included your repository in my personal C# Source Generators list to help gather these kind of projects in one place and hopefully under single umbrella, thus I propose to add the csharp-sourcegenerator
topic to this repository to help with visibility.
I hope you're okay with this. If you happen to know other generator projects, I'll be happy to enlist those in my list as well.
Thanks!
Can you please update the code to show how do if the generator is dependent on a NuGet package. I think it is a common scenario.
I have try to use you template to write a generator that is generating code based on a json file using System.Text.Json, but I cannot make it to work.
And how do I add the json file to the tests that you have in the template?
Hi Thanks for this simple tutorial.
The moment I add a new type to Program.cs, the IncrementalGenerator stopped working. The other generator is working fine.
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Types in this assembly:");
foreach (Type t in typeof(Program).Assembly.GetTypes())
{
Console.WriteLine(t.FullName);
}
}
}
public class HereWeGo { }
If I then comment out that HereWeGo class, restart visual studio, then things restore back.
Adding a template for an Incremental Source Generator project
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.