Create a specialized type to return from the Transform method.
Expose just the properties needed for the generator
Implement IEquatable
Implement GetHashCode
Accept the syntax node as a constructor parameter.
Fill the properties and pre-compute the hash code based on their visibility, name, and type.
The idea is to speed up the time needed to find and verify items in the generator cache. Caching based on the entire semantic node would potentially re-trigger generation when items like comments, private fields, or methods are modified, but the generator's output would only be affected by changes made to the public (and possibly internal) properties. By accepting the syntax node in the constructor, it should be possible to extract only what's needed, and pre-compute the instance hash just once, so that subsequent comparisons won't have any work to do.
Create a specialized type to return from the Transform method.
The idea is to speed up the time needed to find and verify items in the generator cache. Caching based on the entire semantic node would potentially re-trigger generation when items like comments, private fields, or methods are modified, but the generator's output would only be affected by changes made to the public (and possibly internal) properties. By accepting the syntax node in the constructor, it should be possible to extract only what's needed, and pre-compute the instance hash just once, so that subsequent comparisons won't have any work to do.