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
18.96k stars 4.02k forks source link

Show generic collections in IntelliSense #59920

Open vsfeedback opened 2 years ago

vsfeedback commented 2 years ago

This issue has been moved from a ticket on Developer Community.


When assigning a value to something like IList<int>, after typing new, show suggestion for List<int>, etc.


Original Comments

Feedback Bot on 2/13/2022, 10:13 PM:

Thank you for taking the time to provide your suggestion. We will do some preliminary checks to make sure we can proceed further. You will hear from us in about a week on our next steps.

Jan Seriš on 2/27/2022, 11:18 AM:

This feature is already present. What do you mean? It is even present without the clever code suggestions as default upon Enter key press (or similar) - I use it all the time.

image.png

TahirAhmadov commented 1 year ago

@jinujoseph Hi, any chance this can be added for the next major VS? It'd really be a huge time saver for most C# (and VB.NET etc.) devs out there.

CyrusNajmabadi commented 1 year ago

@TahirAhmadov we'd likely take contribution if you were interested. That said, collection literals will likely make this moot.

TahirAhmadov commented 1 year ago

@CyrusNajmabadi Good point about collection literals. Still, I envision an all-encompassing solution, where when doing new after an interface, possible implementers are suggested. I could potentially look into it, which repo would it be?

CyrusNajmabadi commented 1 year ago

It's this repo :-)

TahirAhmadov commented 1 year ago

@CyrusNajmabadi Yes I know that :) I meant, can you provide some pointers which folder it's in? I looked around https://github.com/dotnet/roslyn/blob/main/src/EditorFeatures/Core/IntelliSense/ and can't find it. Mind you, this is the first time I'm looking :)

CyrusNajmabadi commented 1 year ago

I meant, can you provide some pointers which folder it's in?

This would likely be: https://github.com/dotnet/roslyn/blob/main/src/Features/Core/Portable/Completion/Providers/AbstractObjectCreationCompletionProvider.cs