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
And it gets worse if multiple generators use the same library but in different versions as roslyn does not currently load them into different domains.
Instead I would suggest shipping V2 as a generator in its own right that simply adds these files post initialization so they are compiled into the source generator directly without people needing to copy things manually.
The text was updated successfully, but these errors were encountered:
Nice idea, but AFAIK stacking source gens on top of each other should not be done, as execution order can vary. Or did this change somehow and can now be done safely?
Stacking source generators is a difficult topic and by default not even supported unless you take a direct dependency on the other source generator and then call it manually as source generators cannot see the output of other source generators.
That is however not relevant here, as I am not proposing packaging this project as an additional source generator to be applied to the final target but instead to use this project as a source generator for a source generator. Meaning the generated source will be compiled into the generator and just be part of it as if you copied the files in.
Adding libraries to source generators as dependencies is notoriously hard:
https://github.com/dotnet/roslyn/blob/main/docs/features/source-generators.cookbook.md#use-functionality-from-nuget-packages
And it gets worse if multiple generators use the same library but in different versions as roslyn does not currently load them into different domains.
Instead I would suggest shipping V2 as a generator in its own right that simply adds these files post initialization so they are compiled into the source generator directly without people needing to copy things manually.
The text was updated successfully, but these errors were encountered: