How to show code outline in Visual Studio?
Visual StudioOutline ViewVisual Studio Problem Overview
This kind of stuff exists in Eclipse:
But I've not found it in Visual Studio yet. Is there such a window to show code outline at all?
I tried both Document Outline and Class View windows. The Class View is close, but it only shows class information, can it come up with function info also?
Visual Studio Solutions
Solution 1 - Visual Studio
One great plugin for VS is CodeMaid. It is powerful and it is open source! You can also sort your methods within the CodeMaid Spade view.
Here is a screenshot.
Solution 2 - Visual Studio
Also non-free, but Jetbrains Resharper provides a File Structure Window, what perhaps is what you are searching for.
To display this dockable window, select from the menu: ReSharper → Windows → File Structure (default shortcut Ctrl+Alt+F
Solution 3 - Visual Studio
This question was asked quite a while ago and before Visual Studio Code existed but I found it when searching for how to do this with Visual Studio Code so I thought others might stumble on this question too so I thought I'd share my solution. Here's how to do it in Visual Studio Code. I'm using TypeScript but it works for JavaScript, too.
- View -> Open View
- select (or type) Outline
- You'll now get an Outline palette that shows full information on the class including properties and functions.
Solution 4 - Visual Studio
In newer Visual Studio versions (e.g. 2015) you can see this directly in the solution explorer. Simply expand the .cs file and you will get the list of the methods in the order they are listed in the file. This is exactly the same as the Outline in Eclipse.
If you want to see the stuff alphabetically, open the file and between the tab pane and the editor, there is a row showing the project name, the class name with namespace, and a drop down with the available methods and properties.
Solution 5 - Visual Studio
-
not free, but if you install Visual AssistX, each document gets a dropdown box listing all methods in a file (alphabetically or in the order they occur)
-
check Class View again, it does show functions (but not per document). Also check out the Code Definition Window, extremely nice when combined with Class View.
Solution 6 - Visual Studio
You can use the Class View Window, or you can use outlining to collapse the code window to definitions (Ctrl-M-O and Ctrl M-L in the standard keyboard set up)
Solution 7 - Visual Studio
Trick is to call Ctrl+F2, then Tab, then Tab, then Down arrow. I've done it with this simple AutoHotkey script when I hit Ctrl+o:
#IfWinActive ahk_exe devenv.exe
^o::
Send ^{F2}
Send {Tab}
Send {Tab}
Send {Down}
return
#IfWinActive
It will show dropdown that is closest to Quick Outline in Eclipse or others.
Solution 8 - Visual Studio
There is now a free add-in available through the add-in manager in VS2010 that works quite well. It also has a dark theme.
Screenshot:
Solution 9 - Visual Studio
Go To "Solution Explorer" and select your project; then select a class file you want to outline, then expand the little triangle just below that class (as shown in the figure below)
Solution 10 - Visual Studio
In VS2017 you can navigate between items in the file directly from the upper right corner of the Editor.
Solution 11 - Visual Studio
you can have document outline window by going to view-> Other Window -> Document Outline or you can have it using Ctrl+W, U I am using VS-2008. You can have a look at the following links also:
- http://wildermuth.com/2008/06/06/The_Document_Outline_in_Visual_Studio_2008
- http://dotnetkicks.com/tipsandtricks/Visual_Studio_2008_Document_Outline_Split_View
Hope this answers your question.
Solution 12 - Visual Studio
I've started using VSCommands 10.
This has support for the most common languages used when developing in Visual Studio 2010, including JavaScript.
Solution 13 - Visual Studio
There's an extension provided Free, by Microsoft, that enables this and many other features into Visual Studio. The extension is Productivity Power Tools.
Solution 14 - Visual Studio
Ctrl+Shift+O
comes closest to what you want
If you need more, see: discussion of the Outline Feature on github
Solution 15 - Visual Studio
Had same need to see Code Outline: it's easier to understand someone's code organisation. Tried Ctrl+Shift+O and didn't like it. Found 2 free plugins in the marketplace. Tried this one by Patryk Zawadzki and found if handy and handsome.
After installation and reload of VSC look in Explorer pane new separator "Code Outline" at the bottom.
Solution 16 - Visual Studio
// 2019 answer
There is an free extension for Visual Studio that provide code outline: https://marketplace.visualstudio.com/items?itemName=SamirBoulema.CodeNav
Solution 17 - Visual Studio
If you use PHP, make sure you install full version as mentioned in the docs
Solution 18 - Visual Studio
Resharper has a feature of inspection. You can see incoming and outgoing calls from there.
shortcut: CTRL+ Shift + ALT +
Solution 19 - Visual Studio
Here's how to add a command to one of the toolbars in Visual Studio (or how I know how to do it, anyway):
1.) Click the little down arrow at the end of the toolbar, select "Add or Remove Buttons", then select "Customize..."
2.) Now click the "Add Command..." button on the right.
3.) Click "Edit" in the left scroll list and then scroll down on the right until you see the two "Outline Toggle" commands:
4.) Choose one (I'll choose "Outline Toggle All" to toggle outlining in the entire open document) and click "OK."
5.) Now that command will be apart of the toolbar who you first clicked "Add/Remove Buttons" to. You can re-order the command to put it in different positions in the toolbar. Here's an example where I've added it to the main toolbar that has your typical Save/Undo/Debug commands:
Solution 20 - Visual Studio
A list of things you can use:
1.Visual Studio default's ClassView
2.Visual Assist's VA OUTLINE Feature
3.CodeMaid's Spade Feature