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

Unify code paths that update ordinary/additional/analyzerconfig documents #74441

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

tmat
Copy link
Member

@tmat tmat commented Jul 18, 2024

Refactoring of ProjectState and SolutionCompilationState.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 18, 2024
}
}

internal sealed class TouchAnalyzerConfigDocumentsAction(
Copy link
Member Author

Choose a reason for hiding this comment

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

Separate this action from ProjectCompilationOptionsAction.

}

return null;
}
}

internal sealed class TouchAdditionalDocumentAction(
internal sealed class TouchAdditionalDocumentsAction(
Copy link
Member Author

Choose a reason for hiding this comment

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

Allow multiple documents to be changed at the same time, like TouchDocumentsAction.

@@ -856,34 +869,36 @@ public ProjectState UpdateDocuments(ImmutableArray<DocumentState> newDocuments,
}

public ProjectState UpdateAdditionalDocument(AdditionalDocumentState newDocument, bool contentChanged)
=> UpdateAdditionalDocuments([AdditionalDocumentStates.GetRequiredState(newDocument.Id)], [newDocument], contentChanged);

public ProjectState UpdateAdditionalDocuments(ImmutableArray<AdditionalDocumentState> oldDocuments, ImmutableArray<AdditionalDocumentState> newDocuments, bool contentChanged)
Copy link
Member Author

Choose a reason for hiding this comment

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

Follow the same pattern as UpdateDocuments

@tmat
Copy link
Member Author

tmat commented Jul 19, 2024

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@tmat tmat marked this pull request as ready for review July 22, 2024 16:28
@tmat tmat requested a review from a team as a code owner July 22, 2024 16:28
@tmat tmat marked this pull request as draft July 22, 2024 16:28
@tmat tmat changed the title Document state updating Unify code paths that update ordinary/additional/analyzerconfig documents Jul 22, 2024
@tmat tmat marked this pull request as ready for review July 23, 2024 04:15
@tmat
Copy link
Member Author

tmat commented Jul 23, 2024

@ToddGrun ptal


// Must not be empty as we would have otherwise bailed out in the check above.
Contract.ThrowIfTrue(newDocuments.IsEmpty);
Contract.ThrowIfTrue(oldDocuments.IsEmpty);
Copy link
Contributor

Choose a reason for hiding this comment

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

Contract.ThrowIfTrue(oldDocuments.IsEmpty);

Just wanted to make sure this is a new requirement of the callers

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure I follow. The contract has been there before.

Copy link
Contributor

Choose a reason for hiding this comment

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

But it would have returned before hitting the contract failure previously, right?

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:

@tmat tmat merged commit 3b27bdd into dotnet:main Jul 23, 2024
25 checks passed
@tmat tmat deleted the DocumentStateUpdating branch July 23, 2024 22:39
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Jul 23, 2024
@RikkiGibson RikkiGibson modified the milestones: Next, 17.12 P1 Jul 29, 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.

3 participants