dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.05k stars 4.04k forks source link

Explicit Interface Implementation Completions should change return type #15989

Closed SLaks closed 3 weeks ago

SLaks commented 7 years ago

Version Used: 2017 RC Refresh

class C :IComparable{
    void IComparable.
}

If I select CompareTo from IntelliSense after the ., it should change void to int to match the declared return type of the interface method.

Pilchie commented 7 years ago

I like this suggestion, but it's not something we normally do, since it might be jarring if the cursor shifts around if the type name is long.

OTOH - maybe the right thing to do is make this completion like override completion and just insert the whole signature...

SLaks commented 7 years ago

@Pilchie That doesn't work, because, unlike the override keyword, the trigger here can only appear after the return type.

You could offer completions for explicit implementations after typing IComparable. with no return type, but that wouldn't be very discoverable (since there is no reason to type that).

CyrusNajmabadi commented 3 weeks ago

Unlikely to do anything here given lack of feedback.