-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Further cleanup of the code action api (5) #80215
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
namespace Microsoft.CodeAnalysis.Editor.Implementation.Suggestions; | ||
|
||
internal partial class SuggestedActionWithNestedFlavors | ||
internal sealed partial class SuggestedActionWithNestedFlavors |
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.
Folded CodeRefactoring suggested actions and CodeFix suggested actions into this common type.
/// <summary> | ||
/// Represents light bulb menu item for code fixes. | ||
/// </summary> | ||
internal sealed class CodeFixSuggestedAction( |
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.
Folded into the base type.
/// <summary> | ||
/// Represents light bulb menu item for code refactorings. | ||
/// </summary> | ||
internal sealed class CodeRefactoringSuggestedAction( |
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.
Folded into the base type.
FixAllState state => new FixAllCodeAction(state), | ||
RefactorAllState state => new RefactorAllCodeAction(state), | ||
_ => throw ExceptionUtilities.UnexpectedValue(fixAllState) | ||
}), |
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.
note: this typeswitching goes away and gets nice in a later PR in this series.
diagnosticTelemetryId: null, | ||
new RefactorAllCodeRefactoringCodeAction(fixAllCodeRefactoringAction.FixAllState)), | ||
refactorOrFixAllAction.FixAllState, refactorOrFixAllAction.OriginalCodeAction, refactorOrFixAllAction.TelemetryId), | ||
UnifiedSuggestedActionWithNestedActions nestedAction => new SuggestedActionWithNestedActions( |
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.
this code will collapse even further in following PRs.
/// Fix all code action for a code action registered by a <see cref="CodeRefactoringProvider"/>. | ||
/// </summary> | ||
internal sealed class RefactorAllCodeRefactoringCodeAction(IRefactorOrFixAllState fixAllState) | ||
internal sealed class RefactorAllCodeAction(IRefactorOrFixAllState fixAllState) |
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.
named this akin to FixAllCodeAction.
NOte: a following PR merges those into one RefactorOrFixAllCodeAction.
@JoeRobich ptal. :) |
No description provided.