-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove IChecksummedObject type. #74829
Conversation
protected override Checksum CreateChecksum(AnalyzerReference reference, CancellationToken cancellationToken) | ||
=> reference is TestGeneratorReference generatorReference | ||
? generatorReference.Checksum | ||
: base.CreateChecksum(reference, cancellationToken); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is new, and replaced the existing hijacking point that was using IChecksummedObject.
@@ -13,10 +13,10 @@ namespace Roslyn.Test.Utilities | |||
/// A simple deriviation of <see cref="AnalyzerReference"/> that returns the source generator | |||
/// passed, for ease in unit tests. | |||
/// </summary> | |||
public class TestGeneratorReference : AnalyzerReference, IChecksummedObject | |||
public class TestGeneratorReference : AnalyzerReference |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the only impl of this interface.
if (value is IChecksummedObject checksummedObject) | ||
{ | ||
return checksummedObject.Checksum; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
existed only to hijack. but we can already do that throuhg normal virtual methods.
@@ -11,9 +11,6 @@ namespace Microsoft.CodeAnalysis.Serialization; | |||
internal interface ISerializerService : IWorkspaceService | |||
{ | |||
void Serialize(object value, ObjectWriter writer, CancellationToken cancellationToken); | |||
|
|||
void SerializeParseOptions(ParseOptions options, ObjectWriter writer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't need to be on the itnerface. was never called externally.
This type existed only for testing purposes. But there's ahn existing pattern we already have to allow customized test behavior here. Having two mechanisms for this was super confusing and led me down a painful debugging hole in one of my branches.