Skip to content

Conversation

CyrusNajmabadi
Copy link
Member

No description provided.

namespace Microsoft.CodeAnalysis.Editor.Implementation.Suggestions;

internal partial class SuggestedActionWithNestedFlavors
internal sealed partial class SuggestedActionWithNestedFlavors
Copy link
Member Author

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(
Copy link
Member Author

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(
Copy link
Member Author

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)
}),
Copy link
Member Author

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(
Copy link
Member Author

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)
Copy link
Member Author

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.

@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review September 11, 2025 17:15
@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner September 11, 2025 17:15
@CyrusNajmabadi
Copy link
Member Author

@JoeRobich ptal. :)

@CyrusNajmabadi CyrusNajmabadi merged commit fb31739 into dotnet:main Sep 11, 2025
25 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the codeCleanup5 branch September 11, 2025 18:59
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Sep 11, 2025
@akhera99 akhera99 modified the milestones: Next, 18.0 P1, 18.0 P2 Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants