-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Remove all remaining MyCodeAction types in the repo #61079
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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