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

Simplify combined use of CodeActionEquivalenceKey and CodeActionIndex #874

Closed
sharwell opened this issue Jun 23, 2021 · 0 comments · Fixed by #875
Closed

Simplify combined use of CodeActionEquivalenceKey and CodeActionIndex #874

sharwell opened this issue Jun 23, 2021 · 0 comments · Fixed by #875
Labels
Area-MS.CA.Testing Microsoft.CodeAnalysis.Testing enhancement

Comments

@sharwell
Copy link
Member

sharwell commented Jun 23, 2021

For a code action test with (potentially) multiple passes that specifies both CodeActionEquivalenceKey and CodeActionIndex:

  • For the first pass
    • Verify that CodeActionIndex is present, and verify the code action equivalence key at that position matches CodeActionEquivalenceKey (matches current behavior)
  • For subsequent passes
    • If no code action matches CodeActionEquivalenceKey, silently stop applying code fixes (differs from current behavior)
    • Otherwise, verify that the code action matching CodeActionEquivalenceKey is located at index CodeActionIndex

This change will remove the need to specify FixOne in cases where a specific code action appears once but a different code action appears in the next pass. This occurred several times in dotnet/roslyn#54310 (comment).

@sharwell sharwell added Area-MS.CA.Testing Microsoft.CodeAnalysis.Testing enhancement labels Jun 23, 2021
sharwell added a commit to sharwell/roslyn-sdk that referenced this issue Jun 23, 2021
sharwell added a commit to sharwell/roslyn-sdk that referenced this issue Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-MS.CA.Testing Microsoft.CodeAnalysis.Testing enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant