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

Do not report unchanged files in workspace-pull diagnostics #72529

Merged
merged 7 commits into from
Mar 15, 2024

Conversation

CyrusNajmabadi
Copy link
Member

Small tweak that should ideally save a lot of unnecessary reports being created on the roslyn side and then parsed on the client side.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner March 13, 2024 18:29
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 13, 2024
//
// Note: if this is a workspace request, we can do nothing, as that will be interpreted by the
// client as nothing having been changed for that document.
if (!this.IsWorkspacePullDiagnosticsHandler)
Copy link
Member

Choose a reason for hiding this comment

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

Alternative approach - allow CreateUnchangedReport to return a nullable value, and in workspace diagnostics return a null value always.

Copy link
Member Author

Choose a reason for hiding this comment

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

fair. it seemed about the same... i'll noodle on it.

@dibarbet
Copy link
Member

I think some tests will need updating as well, e.g. TestWorkspaceDiagnosticsWithChangeInNotReferencedProject

@CyrusNajmabadi
Copy link
Member Author

Will set to merge once we confirm that VSCode is ok.

@CyrusNajmabadi
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 4 pipeline(s).

if (!this.IsWorkspacePullDiagnosticsHandler)
{
var previousParams = documentToPreviousDiagnosticParams[diagnosticSource.GetId()];
progress.Report(CreateUnchangedReport(previousParams.TextDocument, previousParams.PreviousResultId));
Copy link

Choose a reason for hiding this comment

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

Do you have the before/after previousParams.TextDocument int versions to compare too? If the version is different, we need to be careful about skipping.

Copy link
Member Author

Choose a reason for hiding this comment

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

We do not.

@CyrusNajmabadi CyrusNajmabadi merged commit 9538771 into dotnet:main Mar 15, 2024
27 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Mar 15, 2024
@CyrusNajmabadi CyrusNajmabadi deleted the workspacePull branch March 15, 2024 04:48
@RikkiGibson RikkiGibson modified the milestones: Next, 17.10 P3 Mar 25, 2024
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants