11

In Visual Studio (2013/2015/2017), the Document Outline window for C# files is always empty ("There are no items to show for the selected document."). It seems that this functionality is not (not yet / no more) implemented.

But then, how do I view the structure of the file? Is there any extension which implements this functionality?

  • showing only the selected/opened file
  • show regions
  • move/rename members
  • show documentation

Using the Solution Explorer and Class View are NOT the solution. In the old Visual Studio 2003, I did use a self written Add-In, because it was easy to read the structure. (There were also other tools but I cannot find them anymore). So I ask here which solution you know. :-)

EDIT: Similar question also found: How to show code outline in Visual Studio?

Pang
  • 8,605
  • 144
  • 77
  • 113
kux
  • 817
  • 1
  • 10
  • 21
  • 1
    I never understood the purpose of features like this. There's a *huge* code viewer window designed to let you "view the structure of the file". Why would you need some small, auxiliary view? If you can't figure out the outline of the code at a glance, it is poorly formatted. – Cody Gray Jul 17 '14 at 12:08
  • 3
    Microsoft has developed the outline window to get a fast overview and fast navigation. So we don't need to discus about the purpose. I don't need an extra tool I would use the existing one, but it is not implemented for C# (and also for other files) – kux Jul 18 '14 at 05:11

4 Answers4

10

The best solution I found at present is:

JetBrains ReSharper (v8.0+) has a File Structure window which shows the structure of the current file as tree (types/members) and regions are also supported.

*.cs

App.xaml

App.config

Pang
  • 8,605
  • 144
  • 77
  • 113
kux
  • 817
  • 1
  • 10
  • 21
  • 3
    If you're going to mention a 3rd party product, you should mention it has a price tag. – mason Jul 16 '14 at 17:00
  • I dit not ask for free solution, but you are right, ReSharper is a non-free solution _for users which not already have ReSharper :-)_ – kux Jul 17 '14 at 09:41
10

There is also CodeMaid which provides the same functionality as JetBrains Resharper, but is free.

enter image description here

enter image description here

ChrisB
  • 2,407
  • 2
  • 22
  • 42
  • 1
    +1 for a matching alternative. (compared with ReSharper, it seems to work only for code files) – kux Aug 30 '16 at 08:59
5

If you don´t have ReSharper, you can´t miss the Productivity Power Tools, made by Microsoft itself.

There's a specific version for each of Visual Studio versions. More info on these links:

They have a feature called Solution Navigator Solution Navigator

Also, there's this one that seems very interesting for bring alot of cool customizations to Visual Studio IDE, called VSCommands. It's worth to checkout their website => http://vscommands.squaredinfinity.com/features

Fernando Vieira
  • 2,302
  • 22
  • 23
  • +100! Sadly, it is VERY easy to miss this addon. Why is it not included with the IDE? Some of these featues are a must-have for any simple IDE. – Zanval Apr 02 '15 at 23:29
  • VSCommands.squaredinfinity.com site is offline. Look hear for existing codebase/comments on status of project but as of today, project appears dead as well: https://github.com/squaredinfinity/VSCommands – Doug Knudsen Apr 05 '17 at 14:21
3

It helps you look at the nested structure of certain types of files, e.g. windows forms designer file, open a form designer you should see all controls on the form shown in nested structure in the document outline window.

Xeon
  • 136
  • 8