Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Intellisense: can you hide extension methods?

By default Visual Studio displays all members and its extension methods for a type in intellisense.

Sometimes I would like to hide the extension methods to make it easier to find the member I am actually looking for (especially when using Linq).

Is there a shortcut or another way to display only the members of a type in intellisense?

like image 681
laktak Avatar asked Mar 18 '09 09:03

laktak


2 Answers

Not that I'm aware of - but one thing you might want to do is get rid of the using directive for System.Linq. At that point the extension method won't be accessible, and I believe it won't be offered by Intellisense.

Obviously that's no good if you want to use LINQ from one bit of code in a class, but not in another - but for classes which aren't using LINQ at all, it might help you.

like image 110
Jon Skeet Avatar answered Oct 15 '22 12:10

Jon Skeet


In theory you could do this with the appropriate decorator attribute*, but googling this it seems it's bugged, with the fix awaiting a service pack presumably.

* [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]

like image 37
annakata Avatar answered Oct 15 '22 10:10

annakata