Replies: 2 comments 12 replies
-
take a look at AutoNotifyGenerator from generator examples https://github.com/dotnet/roslyn-sdk/blob/0abb5881b483493b198315c83b4679b6a13a4545/samples/CSharp/SourceGenerators/SourceGeneratorSamples/AutoNotifyGenerator.cs |
Beta Was this translation helpful? Give feedback.
7 replies
-
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm writing a C# source generator, and I'm marking those classes that it should augment using a custom attribute. I'd like to pass some options on that attribute as well, but I can't find an example of doing anything like that. I know how I would do this via reflection, but an AttributeSyntax is not an Attribute, so none of my previous knowledge applies. I've been poking around at it for a while this morning, but I'm just not seeing it. For this example, let's assume something simple like a simple string that will be appended to the name of the generated class, or a simple switch that controls whether to generate a "full" or a "light" version of the output. How would I read that value from the attribute from within my source generator?
Beta Was this translation helpful? Give feedback.
All reactions