Skip to content
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

Enhance explicit interface implementation completion provider #75568

Conversation

Rekkonnect
Copy link
Contributor

@Rekkonnect Rekkonnect commented Oct 21, 2024

Fixes #75435
Fixes #72224
Fixes #70458

Implementation details

The ExplicitInterfaceMemberCompletionProvider is now up to par with the OverrideCompletionProvider, with some abstractions to share between the two like the ItemGetter. The characters [ and < no longer commit the selected completion item since the completion provider now fills the implementation body and the signature completely.

The AbstractMemberInsertingCompletionProvider itself also became faster by doing less work when replacing the completed text in the original document via annotations. This behavioral adjustment was also necessary because of problems that arose while changing the ExplicitInterfaceMemberCompletionProvider to be an AbstractMemberInsertingCompletionProvider.

Another fixed bug is the explicit interface implementation generator for abstract conversion operators, which were not handled in the "Implement interface explicitly" code fixes. This was resolved for both the fixes and the completion provider.

When the user is typing out an explicit interface declaration member, the provider ignores the potential difference in the return type. This is justified as the user could easily mistake the return type, and so we do not want to filter out the actual candidates that can be offered. Besides, in most cases the recommended members are too few to need this filtering. If the user types out a return type and then we complete a member that has a different return type, the result includes the actual signature of the implemented member, discarding the old return type.

The spell fix suggestions for explicit interface implementation members were removed because of the complexity of handling the generated code. The justification is that it's easier for the user to manually type the member out because of the improvements to the completion provider.

The symbol generators still ignore the attributes on the parameters or the symbols themselves of explicit interface implementations, despite being legal to use in that context.

Tests

@Rekkonnect Rekkonnect requested a review from a team as a code owner October 21, 2024 09:25
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 21, 2024
@dotnet-policy-service dotnet-policy-service bot added Community The pull request was submitted by a contributor who is not a Microsoft employee. VSCode labels Oct 21, 2024
@CyrusNajmabadi CyrusNajmabadi merged commit ad5ea4e into dotnet:main Nov 26, 2024
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Nov 26, 2024
@CyrusNajmabadi
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Community The pull request was submitted by a contributor who is not a Microsoft employee. untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
2 participants