Skip to content

Conversation

@CyrusNajmabadi
Copy link
Member

Fixes #78294

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner July 14, 2025 21:30
= [CS0535, CS0737, CS0738];

protected override bool IsTypeInInterfaceBaseList(TypeSyntax type)
=> type.Parent is BaseTypeSyntax { Parent: BaseListSyntax } baseTypeParent && baseTypeParent.Type == type;
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 was moved from the codefixprovider to the service. so it can be used by teh refactoring as well.

internal abstract class AbstractImplementInterfaceCodeFixProvider<TTypeSyntax> : CodeFixProvider
where TTypeSyntax : SyntaxNode
{
protected abstract bool IsTypeInInterfaceBaseList(TTypeSyntax type);
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 was moved from the codefixprovider to the service. so it can be used by teh refactoring as well.

}
}

private static string GetTitle(ImplementInterfaceConfiguration options)
Copy link
Member Author

Choose a reason for hiding this comment

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

all teh below was moved from the codefixprovider to the service. so it can be used by teh refactoring as well.

return codeActions.ToImmutableAndClear();
}

private static async IAsyncEnumerable<ImplementInterfaceConfiguration> GetImplementOptionsAsync(
Copy link
Member Author

Choose a reason for hiding this comment

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

all the code here and below is a move.

Copy link
Contributor

@AbhitejJohn AbhitejJohn left a comment

Choose a reason for hiding this comment

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

Do the tests cover the updated behavior - " // We offer the refactoring when the user is between any members of a class/struct and are on a blank line". Also do we have telemetry that would suggest perf and usage implications of this. Dont imagine those would block this PR - just curious.

@CyrusNajmabadi
Copy link
Member Author

Do the tests cover the updated behavior - " // We offer the refactoring when the user is between any members of a class/struct and are on a blank line"

Technically no. But this just uses the core helper we have that does exactly that for many other features.

Also do we have telemetry that would suggest perf and usage implications of this.

Yes. We def track perf and usage. We won't necessarily have a specifically down this path vs others though.

@CyrusNajmabadi CyrusNajmabadi enabled auto-merge July 15, 2025 00:18
@dibarbet
Copy link
Member

/azp run roslyn-CI

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@CyrusNajmabadi CyrusNajmabadi merged commit 462275d into dotnet:main Jul 16, 2025
24 of 25 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the implementInterfaceInType branch July 16, 2025 22:44
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Jul 16, 2025
@RikkiGibson RikkiGibson modified the milestones: Next, 18.0 P1 Aug 19, 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.

Offer "Implement interface" in type declaration body block too when empty

4 participants