Skip to content
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

Cache diagnostic info based on project state not project. #77230

Merged
merged 13 commits into from
Feb 14, 2025

Conversation

CyrusNajmabadi
Copy link
Member

No description provided.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Feb 14, 2025
@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review February 14, 2025 17:49
@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner February 14, 2025 17:49
@CyrusNajmabadi
Copy link
Member Author

@ToddGrun ptal

//
// Note: While ForceAnalyzeProjectAsync should always run with a larger set of analyzers than us
// (since it runs all analyzers), we still run a paranoia check that the analyzers we care about are
// a subset of that call so that we don't accidentally reuse results that would not correspond to
// what we are computing ourselves.
if (_projectToForceAnalysisData.TryGetValue(project, out var box) &&
var checksum = await project.GetDependentChecksumAsync(cancellationToken).ConfigureAwait(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var checksum = await project.GetDependentChecksumAsync(cancellationToken).ConfigureAwait(false);

Not sure of the expense of this, but if would it make sense to have this only done if the TryGetValue succeeds?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so, if TryGet fails, we need this data to compute and cache. If it succeed, we need it to compare with the cached value. So we always need it.

Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

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.

None yet

3 participants