Replies: 1 comment
-
Source Generators do not affect each other at all: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When will source generator with
RegisterImplementationSourceOutput
get executed? Can I get it executed after other source generator(s)? Came across with #57963 and #54723, I still can't get a clear picture.For simplicity, let's say I have two incremental source generators:
KeyGenerator
andTypeDescriptorGenerator
. Given the following input source code:The
KeyGenerator
will take the[GenerateKey]
marker attribute to generate the following code, based on the field name(s) provided:The
TypeDescriptorGenerator
, on the other hand, will take all types which implementsIEntityType
, taking all the fields of the type, to generate a type descriptor class. The generated type descriptor class is invisible to developer, so it's registered withRegisterImplementationSourceOutput
. The generation should take the outputCompilation
ofKeyGenerator
, because it should take the generatedKey.Id
property into account; this code generation is expensive, for performance consideration, ideally it should only run once.So back to the question: can I have
TypeDescriptorGenerator
only run at the end of compile pipeline? If yes, how? If no, what's the workaround?Beta Was this translation helpful? Give feedback.
All reactions