Is there a stable hash code available for a SyntaxTree instance #69202
Replies: 2 comments 2 replies
-
@SeanFarrow-RSK What do you need it for? If you just need a GetHashCode implementation to be approximately correct, something as simple as the length of the tree might suffice. Usually IsEquivalentTo we don't use for comparing different trees of unknown origins, but rather to understand if certain changes or edits had other impacts. |
Beta Was this translation helpful? Give feedback.
-
@jasonmalinowski Is there any better way of doing this. This is for testing using FluentAssertions within a source generator. |
Beta Was this translation helpful? Give feedback.
-
Good morning,
I am trying to determine the equality of two SyntaxTree instances within an IEqualityComparer implementation.
I am aware I can use the IsEquivalentTo method to determine whether the two SyntaxTrees are equivalent, but can not find a way to compute the hashcode for a SyntaxTree.
Is there a stable GetHashCode implementation exposed for SyntaxTrees?
Any help apreciated.
Kind regards
Sean.
Beta Was this translation helpful? Give feedback.
All reactions