Skip to content

LFT-3081 - Resolve RS1010#985

Merged
toddlang merged 4 commits into
mainfrom
littlefoot/rs1010
Jul 20, 2026
Merged

LFT-3081 - Resolve RS1010#985
toddlang merged 4 commits into
mainfrom
littlefoot/rs1010

Conversation

@toddlang

Copy link
Copy Markdown
Contributor

-From https://github.com/dotnet/roslyn/blob/main/docs/analyzers/FixAllProvider.md it seems all fixes registered from the same code fixer should have the same equivalence key

-From https://github.com/dotnet/roslyn/blob/main/docs/analyzers/FixAllProvider.md
it seems all fixes registered from the same code fixer should have the same equivalence key
Comment on lines +64 to +76
ct
)
),
equivalenceKey: nameof( AddAttributeCodeFix )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

https://github.com/dotnet/roslyn/blob/main/docs/analyzers/FixAllProvider.md#selecting-an-equivalence-key-for-code-actions

Adding the different attributes are different actions, so attrName needs to be part of the equivalenceKey

ct
)
),
equivalenceKey: $"{attrName}-{nameof( AddAttributeCodeFix )}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems simpler

Suggested change
equivalenceKey: $"{attrName}-{nameof( AddAttributeCodeFix )}"
equivalenceKey: attrName

createChangedDocument: ct =>
Task.FromResult( Fix( context.Document, root, attr ) )
Task.FromResult( Fix( context.Document, root, attr ) ),
equivalenceKey: $"{attr.Name}-{nameof( RemoveAttributeCodeFix )}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
equivalenceKey: $"{attr.Name}-{nameof( RemoveAttributeCodeFix )}"
equivalenceKey: attr.Name

Comment thread src/D2L.CodeStyle.Analyzers/CommonFixes/AddAttributeCodeFix.cs Outdated
@toddlang toddlang changed the title Resolve RS1010 LFT-3081 - Resolve RS1010 Jul 20, 2026
@toddlang
toddlang marked this pull request as ready for review July 20, 2026 14:31
@toddlang
toddlang requested a review from j3parker as a code owner July 20, 2026 14:31
@toddlang
toddlang merged commit 104562c into main Jul 20, 2026
5 checks passed
@toddlang
toddlang deleted the littlefoot/rs1010 branch July 20, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants