CodeMap extension for Visual Studio 2017-2022
It is preferred that you install the extension via Visual Studio Marketplace. This extension is built for VS2022. Though you can download the VS2019 version from the Releases page. For older (pre-VS2017) releases please visit https://github.com/oleg-shilo/Retired-VSIX.
This simple extension visualizes the code DOM objects defined in the active document. This extension is a partial port of the popular plugin that is available for:
Code Tree viewer for Python and C# source code.
Historically, this extension was created to address the absence of the code tree/map view functionality for "Python Tools for Visual Studio" (PTVS). Thus some users can remember this tool by the name of PyMap. Starting from v2.0 it has been extended with the support for C# and has been renamed into CodeMap.
The usage is straightforward and dead simple. Open any C#, .razor or Python file and PyMap will automatically build a code tree. This tree will be automatically updated when the active VS document is saved or another document tab is activated.
Clicking the item in the code tree will navigate to the location of the code element in the document.
Well, it is different. While there are some very solid tools of this sort available they are focusing on the different aspects of the user experience compared to CodeMap.
CodeMap alternatives (e.g. CodeMaid, VS10x CodeMAP) are usually all about the accuracy and completeness of the information being visualized. They are investing heavily in rendering as much information as possible and even providing some refactoring functionality. Basically "let's give the user as much information as he/she can possibly need.".
CodeMap on the other hand has only one objective - navigation. Usability of code navigation, if to be more precise. CodeMap is trying not to stay on your way and to do only a single job but to do it well and most ergonomically.
As a developer, when I want to jump to the code where a certain algorithm is implemented. I am interested in the location of the code in the file and I want to get there in a single step. I am not interested so many things that are important in general but irrelevant right now:
When I use a code map to navigate to the code:
One may ask "Why then not just allow the extra flexibility in some of the existing products, instead of maintaining 'yet another one'?". This is where it becomes more complicated.
I have contacted the owner of CodeMaid and tried to contribute some of this flexibility to the excellent CodeMaid. I did it twice. But my PRs were not accepted. I am not complaining as every OpenSource product author is entitled to have his/her vision of the product evolution. Even if the proposed changes are not about changing the product but only about extra customization. Thus I have taken my older extension and improved it to meet my own and hopefully other people's expectations. And of course, I am fully open to suggestions regarding the extension functionality.
You can filter code tree content by the class or member name. You can control inclusion of the members by their visibility (private/public) for methods, properties and fields. You can choose to sort members of the class.
You can filter code tree content by the class member name.
Tips
CodeMap supports map tree "bookmarks". This feature is rather a pseudo bookmark as it implements only one aspect of a bookmark - visually indicating an item tag.
It simply allows the user to mark some code tree nodes with a distinctive colour so these items stand out from others, somewhat less significant code map elements. Limitations: changing the name of the code element (e.g. class, method) will trigger the loss of the associated bookmark (if any) thus you may need to reassign it again.