-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Offer 'implement interface' when inside a type's body #79382
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
Offer 'implement interface' when inside a type's body #79382
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.
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); |
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 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.
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( |
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.
all the code here and below is a move.
AbhitejJohn
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.
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