Offer 'implement interface' when inside a type's body#79382
Offer 'implement interface' when inside a type's body#79382CyrusNajmabadi merged 7 commits intodotnet:mainfrom
Conversation
| = [CS0535, CS0737, CS0738]; | ||
|
|
||
| protected override bool IsTypeInInterfaceBaseList(TypeSyntax type) | ||
| => type.Parent is BaseTypeSyntax { Parent: BaseListSyntax } baseTypeParent && baseTypeParent.Type == type; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
all the code here and below is a move.
AbhitejJohn
left a comment
There was a problem hiding this comment.
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.
Technically no. But this just uses the core helper we have that does exactly that for many other features.
Yes. We def track perf and usage. We won't necessarily have a specifically down this path vs others though. |
|
/azp run roslyn-CI |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Fixes #78294