Code Map and Code Map Debugger for Visual Studio 2013

Paul Nieuwelaar, 02 July 2013

Code Map allows you to map out the structure of your application by connecting your methods to see what methods link to each other, so you visually see how your application flows. This new feature is also great for easily understanding other people’s code by following the hierarchy without getting lost along the way.

To start a code map, right click any method and select the Code Map option. This will start a new map containing just the selected method. You can then right click the method node to find references of other methods that call the selected method. This will add a node for each of the referencing methods, and connect them on the code map.

You can also drill into related methods to add these to the code map, or even right click additional methods to add these to the code map, showing how they link to other existing methods in the code map.

At any point you can click on a node in the code map to instantly jump to that method. This provides a quick way of navigating between methods without forgetting where you are, or having to try and find where you came from again.

If you’re trying to debug code, or you’re going through someone else’s code, you will also have the ability to flag a node for follow-up, which highlights the node in red so you can easily find it in future. You can also add a note/comment to the node if you need to remind yourself to fix this method for example.

Once you’ve created your code map, you can optionally save a copy to your local drive. This will generate a file which anyone can open in Visual Studio 2013 allowing them to view the layout of the methods you’ve added.

Another new feature is the Code Map Debugger, which is similar to the code map, but allows you to map out the structure and hierarchy of methods while debugging. This means you can start from say the ‘Execute’ method, and as you step into different methods it will start to generate your code map automatically, and show all the different branches your application takes. Only methods that actually get called will be displayed, so depending on user selection or input the code map may not display all possible code paths, only those that have directly been called.

To start the code map, just click the ‘Code Map’ button on the toolbar while debugging.

Once you’ve finished debugging, your code maps are not wiped, so you can adjust your code and start debugging again to kick off again using the same code map.