visual-studio

In Visual Studio, can I only show the Class Methods in the Editor Navigation Member List?


I would like to only see the methods in the member list (See screenshot). I don't need to see the class fields. If that is not possible can I group the methods at the top arranged in alphabetical order.

Thank you.

Member List

This would be sufficient. This screenshot is from another post.

enter image description here


Solution

  • This list above the editor window is officially called Navigation bar. Just in case you would need to find it in the Options or google for it.

    As others noted, there's no way to customize it out of the box without any extension.

    Option 1

    You can achieve what you need with the Document Outline window (View - Other Windows - Document Outline). It allows you to change the sort order at the top. The Sort By Type will do the trick:

    enter image description here

    Make sure you have enabled this option. Go to Options > Text Editor > C# > Advanced. Scroll to the very bottom and select Enable document outline. Do this also for other languages you need.

    Option 2

    Even more options for sorting and grouping can be found in the Object Browser (View - Object Browser) with a right-click:

    enter image description here

    Option 3

    And just for your information. There's another place where you can filter the members - Quick Info tooltip. This is the place where you can filter out other members and display just methods — there are buttons at the bottom for this:

    enter image description here