Skip to content

Conversation

@CyrusNajmabadi
Copy link
Member

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.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner August 20, 2024 22:03
@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 20, 2024
protected override Checksum CreateChecksum(AnalyzerReference reference, CancellationToken cancellationToken)
=> reference is TestGeneratorReference generatorReference
? generatorReference.Checksum
: base.CreateChecksum(reference, cancellationToken);
Copy link
Member Author

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.

@CyrusNajmabadi
Copy link
Member Author

@ToddGrun @dibarbet ptal.

/// passed, for ease in unit tests.
/// </summary>
public class TestGeneratorReference : AnalyzerReference, IChecksummedObject
public class TestGeneratorReference : AnalyzerReference
Copy link
Member Author

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;
}
Copy link
Member Author

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.

{
void Serialize(object value, ObjectWriter writer, CancellationToken cancellationToken);

void SerializeParseOptions(ParseOptions options, ObjectWriter writer);
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants