Skip to content

Source Generator instance lifetime in IDE #50586

Answered by PathogenDavid
VolodymyrBS asked this question in Q&A
Discussion options

You must be logged in to vote

From the ISourceGenerator documentation:

State should not be stored directly on the generator, as there is no guarantee that the same instance will be used on a subsequent generation pass.

The compiler makes no guarantee one way or another. It would be inadvisable to rely on the current behavior regardless of what it is.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@VolodymyrBS
Comment options

Answer selected by VolodymyrBS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants