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

[IntelliSense] Suggest names of remaining explicitly implementable members after dotting an implemented interface without typing the return type #75435

Open
Rekkonnect opened this issue Oct 8, 2024 · 0 comments
Labels
Area-IDE Feature Request help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Milestone

Comments

@Rekkonnect
Copy link
Contributor

Rekkonnect commented Oct 8, 2024

Currently, after dotting an interface name without having specified the type of the explicitly implemented member, the name of the member is not suggested. Instead, the appearing suggestions would expect a nested type to suggest, considering the case of typing out a name of the type of the member that is being declared.

Example:

public interface IThing
{
    public void Method(int a, int b);
}

public sealed class C : IThing
{
    IThing.$$
}

Placing the caret at $$ will trigger suggestions for nested types that IThing contains, in which case is none. It will not suggest auto-completing and filling in the return type of the auto-implemented member after the dot. This behavior would be similar to overriding methods, where typing override is sufficient to begin suggesting overridable members and automatically filling in the return type and the parameters/accessors of the overridden member after selecting the suggestion.

The way to actually show the explicitly implementable members right now is by having already typed the member's type and then typing the interface name. This requires knowing the return type, and typing that first before implementing the member, which is prone to errors like typing the wrong return type. The suggestion still appears even with the wrong return type, but then the compiler will show an error about the explicit implementation's return type.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Oct 8, 2024
@CyrusNajmabadi CyrusNajmabadi added help wanted The issue is "up for grabs" - add a comment if you are interested in working on it and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 8, 2024
@CyrusNajmabadi CyrusNajmabadi added this to the Backlog milestone Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Feature Request help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Projects
Status: InQueue
Development

No branches or pull requests

2 participants