Remove all remaining MyCodeAction types in the repo#61079
Conversation
|
@Youssef1313 for review |
| { | ||
| // always offer to convert from verbatim string to normal string. | ||
| context.RegisterRefactoring(new MyCodeAction( | ||
| context.RegisterRefactoring(CodeAction.CreateWithPriority( |
There was a problem hiding this comment.
I added a new internal helper CodeAction.CreateWithPriority for creating code actions with non-default priority. We no longer need to create special code action sub-types just to override the priority.
Youssef1313
left a comment
There was a problem hiding this comment.
Few missing code actions that were not named "MyCodeAction"
PreferFrameworkTypeCodeFixProvider(PreferFrameworkTypeCodeAction)AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider(ConvertAutoPropertyToFullPropertyCodeAction)AbstractConvertForEachToLinqQueryProvider(ForEachToLinqQueryCodeAction)AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider(ConvertToInterpolatedStringCodeAction)AbstractConvertForEachToForCodeRefactoringProvider(ForEachToForCodeAction)
Other than that, LGTM 🎉
Youssef1313
left a comment
There was a problem hiding this comment.
I'm confused regarding the RegisterCodeFix(context, ... introduced in #60665 vs context.RegisterCodeFix(...).
Which should be used?
I believe Tomas just introduced a helper in that PR, so if the fund you were passing to RegisterCodeFix only invokes the base type’s FixAsync method, then you should use the new helper to reduce verbosity. |
|
Thanks @Youssef1313, that helped! I actually found a few more redundant sub-types, all of them should be removed with the latest commit. |
jmarolf
left a comment
There was a problem hiding this comment.
Thanks for all the work here! Do we have tests for code action priority that ensure we are laying things out in the right order?
I think we have for some, not for all. Let me create an issue to track adding the tests. |
|
Filed #61081 |
Follow up to #60480 and #60557