-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Fix non-deterministic ordering of quick actions #68547
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dotnet@415d510 expanded tracking pending action sets for all priority buckets. However, it switched from using an ArrayBuilder to a MultiDictionary whose values are sets. This means the original order of pending actions for a specific bucket is lost. This PR switches from a MultiDictionary to a regular Dictionary with ArrayBuilder values. This fixes the non-determinism in the ordering. I have also added an integration test to guard against this regression
dotnet-issue-labeler
bot
added
the
untriaged
Issues and PRs which have not yet been triaged by a lead
label
Jun 12, 2023
mavasani
commented
Jun 12, 2023
|
||
await TestServices.EditorVerifier.CodeActionsAsync(expectedItems, ensureExpectedItemsAreOrdered: true, cancellationToken: HangMitigatingCancellationToken); | ||
|
||
await SetUpEditorAsync(@" |
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.
Added 2 invocations as it seems the first one might succeed often, but for 9 out of 10 times I saw either first or second one has unexpected order of the items prior to the product fix.
CyrusNajmabadi
approved these changes
Jun 12, 2023
ToddGrun
reviewed
Jun 12, 2023
src/VisualStudio/IntegrationTest/New.IntegrationTests/CSharp/CSharpCodeActions.cs
Show resolved
Hide resolved
sharwell
approved these changes
Jun 12, 2023
ghost
added this to the Next milestone
Jun 12, 2023
mavasani
added a commit
to mavasani/roslyn
that referenced
this pull request
Jun 13, 2023
mavasani
added a commit
that referenced
this pull request
Jun 13, 2023
Address remaining feedback from #68547
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: Recommended to review ignoring whitespace changes
415d510 expanded tracking pending action sets to all priority buckets. However, it switched from using an ArrayBuilder to a MultiDictionary whose values are sets. This means the original order of pending actions for a specific bucket is lost.
This PR switches from a MultiDictionary to a regular Dictionary with ArrayBuilder values. This fixes the non-determinism in the ordering.
Testing: I have also added an integration test to guard against this regression. Verified that this integration test fails prior to the product fix.