How to show code outline in Visual Studio?

前端 未结 19 754
情歌与酒
情歌与酒 2020-12-13 12:26

This kind of stuff exists in Eclipse:

\"alt

But I\'ve not found it in Visual Studio yet. Is ther

相关标签:
19条回答
  • 2020-12-13 12:56

    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.

    0 讨论(0)
  • 2020-12-13 12:56

    Ctrl+Shift+O comes closest to what you want

    If you need more, see: discussion of the Outline Feature on github

    0 讨论(0)
  • 2020-12-13 12:57

    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:

    0 讨论(0)
  • 2020-12-13 12:59

    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.

    0 讨论(0)
  • 2020-12-13 13:02

    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.

    VS10x Code Map v2

    Screenshot:

    Screenshot of the code map

    0 讨论(0)
  • 2020-12-13 13:02

    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)

    0 讨论(0)
提交回复
热议问题