-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Merged
CyrusNajmabadi
merged 64 commits into
dotnet:main
from
Rekkonnect:feature/75435-explicit-interface-impl-suggestions
Nov 26, 2024
Merged
Enhance explicit interface implementation completion provider #75568
CyrusNajmabadi
merged 64 commits into
dotnet:main
from
Rekkonnect:feature/75435-explicit-interface-impl-suggestions
Nov 26, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
bot
added
Community
The pull request was submitted by a contributor who is not a Microsoft employee.
VSCode
labels
Oct 21, 2024
3 tasks
CyrusNajmabadi
approved these changes
Nov 26, 2024
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #75435
Fixes #72224
Fixes #70458
Implementation details
The
ExplicitInterfaceMemberCompletionProvider
is now up to par with theOverrideCompletionProvider
, with some abstractions to share between the two like theItemGetter
. 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 theExplicitInterfaceMemberCompletionProvider
to be anAbstractMemberInsertingCompletionProvider
.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