{"id":258654,"date":"2022-07-25T15:38:54","date_gmt":"2022-07-25T14:38:54","guid":{"rendered":"https:\/\/blog.jetbrains.com\/?post_type=dotnet&#038;p=258654"},"modified":"2025-09-18T12:56:11","modified_gmt":"2025-09-18T11:56:11","slug":"ways-to-navigate-and-explore-codebases","status":"publish","type":"dotnet","link":"https:\/\/blog.jetbrains.com\/zh-hans\/dotnet\/2022\/07\/25\/ways-to-navigate-and-explore-codebases","title":{"rendered":"Ways to navigate and explore codebases"},"content":{"rendered":"\n<p>Working on new, large codebases can be quite daunting. You aren\u2019t familiar with the structure, naming conventions, or a teammate\u2019s quirky style that made it past code reviews. Fortunately, Rider contains many navigational features that you can use to help you get up to speed in new codebases quickly or move about familiar codebases more smoothly. In this post, we\u2019ll look at common ways to navigate codebases using Rider\u2019s navigational features.<\/p>\n\n\n\n<p>Folks familiar with a codebase can tell you that getting around it as efficiently as possible is important for productivity. <strong>Good navigational tools help you understand code better<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Search Everywhere<\/h2>\n\n\n\n<p>Perhaps you&#8217;re unsure of where in the code you really need to go, because you&#8217;re thinking about all the possible outcomes of a particular decision in a conditional statement. Or maybe you just want to see what&#8217;s going on in new parts of a program. Search everywhere can help. Press <kbd>Shift+Shift<\/kbd> (or <kbd>Ctrl+T<\/kbd>) and start typing. Rider finds just about anything possible. Classes, files, symbols, actions, and more.  <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/07\/10907-search-everywhere.png\" data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/07\/10907-search-everywhere.gif\" alt=\"The Search Everywhere dialog\" width=\"800\" class=\"wp-image-260980\"><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Navigate based on the current context&nbsp;<\/h2>\n\n\n\n<p>Press <kbd>Alt+`<\/kbd> on any token and you\u2019ll get a context menu full of navigational choices. You can move about the code in a number of ways:<\/p>\n\n\n\n<ul>\n<li>Declarations and Implementations<\/li>\n\n\n\n<li>Usages<\/li>\n\n\n\n<li>Related Files<\/li>\n\n\n\n<li>Derived Symbols<\/li>\n\n\n\n<li>Consuming and Exposing APIs<\/li>\n\n\n\n<li>Decompiled Sources and IL<\/li>\n\n\n\n<li>Metadata<\/li>\n\n\n\n<li>Locate in Assembly Explorer<\/li>\n\n\n\n<li><a href=\"https:\/\/www.jetbrains.com\/help\/rider\/Navigation_and_Search__Navigate_from_Here.html\" target=\"_blank\" rel=\"noopener\">More, depending on the context<\/a><\/li>\n<\/ul>\n\n\n\n<p>It\u2019s a good idea to try <kbd>Alt+`<\/kbd> (<strong>Navigate To<\/strong>) in various locations in code (even on the same line) and see what navigational options are available, since <strong>Navigate To<\/strong> is context specific. <strong>Navigate To<\/strong> enables exploratory browsing as well as purposeful navigation to gain a better understanding of the code. Additionally, shortcuts such as <kbd>F12<\/kbd> \/ <kbd>Shift+F12<\/kbd>, <kbd>Alt+`<\/kbd>, and others are alternative shortcuts for specific <strong>Navigate To<\/strong> actions.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2025\/09\/Xr5Gt0b_ml1QUReh4pFPNlIT4UxJ-xZ_KoWh4IP6xTL6emh5tPROeQz0uH8cf7rvWHF5gEMq0rweHfk3GAczVXpXpc2KG6_2iSdWIdH1vVNrAiSnUWMKJu5Vdxu6rRbNzDSH-eBH9zDO3jd1bw.png\" alt=\"The context menu with navigational options listed. Use Alt+` to access.\" style=\"width:200px;height:368px\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">A Bird\u2019s eye view of a codebase<\/h2>\n\n\n\n<p>It\u2019s a huge productivity boost to look at a block of code and see metadata about that code. Helpful information ranges from version control system (VCS) metadata to how frequently objects are used, as well as type information and other data. This is why Rider contains <strong>Code Vision<\/strong>, which presents <strong>a well-rounded view of any part of the codebase<\/strong>. Simply looking at a block of code that\u2019s been annotated with <strong>Code Vision<\/strong> (denoted with red arrows below) reveals so much handy information.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" width=\"1160\" height=\"430\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/06\/10907-code-vision-arrows.png\" alt=\"\" class=\"wp-image-259208\" style=\"width:580px;height:215px\"\/><\/figure>\n\n\n\n<p>Clicking on a <strong>Code Vision<\/strong> UI element displays related navigational paths where you can further investigate what\u2019s going on by using a mouse or keyboard.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/06\/10907-code-vision.png\" data-gif-src=\"https:\/\/web.archive.org\/web\/20220806091730im_\/https:\/\/lh5.googleusercontent.com\/CkGHFrbOGfO1NiJagJk8ITZUFW75oCg7TXigfMXeu3ipXb0GIEm0uByP35fJO39eCCZ55upvhGs7f-OcPcqoF7a-1Vvet_eu8E1fkVhPotwvDL1PqRgZAUKK7W8_10QOqOJkrYpHF-THeYvIzw\" alt=\"Animated gif that shows navigating using code vision\" width=\"800\" height=\"560\">\n<\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">&nbsp;Show and Find usages<\/h2>\n\n\n\n<p>While reading code you\u2019ll inevitably come across a new variable or object that you\u2019re unfamiliar with. You then want to see where and how it\u2019s used throughout the project to <strong>get both an overview and some detail about what\u2019s happening in the code<\/strong>. Fortunately, Rider has several features to help find objects and navigate them to further understand the code.<\/p>\n\n\n\n<p><strong>Find Usages<\/strong> (<kbd>Shift+F12<\/kbd>) shows anywhere a token is used in a scope (and displays the results in a tool window. <strong>Show Usages<\/strong> (<kbd>Shift+Alt+F12<\/kbd>) displays information about usages in a popup window that includes a highlight of the code and its line number, and the folder and file it\u2019s in. With all this information you can simply choose the line you want and navigate to the target. Want to return? Press <kbd>F12<\/kbd> (<strong>Go to Declaration<\/strong>). The <strong>Find Usages<\/strong> and <strong>Show Usages<\/strong> features are also available from the <kbd>Alt+`<\/kbd> menu.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/06\/10907-show-find-usages-1.png\" data-gif-src=\"https:\/\/web.archive.org\/web\/20220806091730im_\/https:\/\/lh3.googleusercontent.com\/2O4TnwUZCsuOARhAc3Rb2gVcOffz5OxtqlRUkeK15Gm1OYBcb1iNIkNu6QmNbUo5V7CzIHO71wg7qluPM-ITIfPo9zdKQq6DAW7AH2C-xks8GBCJpEhBl4ckIIdLBnmG3DqQtEtKN8hopcrZ1Q\" alt=\"Animated gif that shows navigating using Find Usages and Show Usages options (Shift+F12)\" width=\"800\"><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Discover and navigate to API endpoints&nbsp;<\/h2>\n\n\n\n<p>APIs can feel like black holes in outer space when there is sparse documentation, or the project doesn\u2019t use something like <a href=\"https:\/\/swagger.io\/\" target=\"_blank\" rel=\"noopener\">Swagger<\/a>. Even with docs and Swagger, some APIs are large and complex. So you want to get around as efficiently as possible. Using Rider, we can <strong>browse and run API endpoints using the <\/strong><a href=\"https:\/\/blog.jetbrains.com\/zh-hans\/dotnet\/2021\/07\/12\/a-better-way-to-discover-apis-with-the-new-endpoints-window\"><strong>Endpoints Window<\/strong><\/a>. The <strong>Endpoints Window<\/strong> is a really great tool for browsing endpoints and their metadata. Additionally, you can submit HTTP requests to these endpoints and work with any sort of HTTP verb or MIME type. From version 2022.1 and on, you can navigate through ASP.NET Core Minimal API endpoints.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/06\/10907-endpoints.png\" data-gif-src=\"https:\/\/lh6.googleusercontent.com\/N9F2XicGfxPXeKbiuaw0TFUh0piqARF893wx2V897n-cH6Kapwvszlcn7Km67D0rInygK2q00fMTGRZIANtLrOcddQeymTIdy2-l-y15XAwcObAARn3GUYInhb8VLAJ9__PhtFui7SGoIp6Y4g\" alt=\"Animated gif that shows navigating using the endpoints window\" width=\"800\"><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Explore objects and models&nbsp;<\/h2>\n\n\n\n<p>In order to really understand what\u2019s going on in code with complex <a href=\"https:\/\/blog.jetbrains.com\/zh-hans\/dotnet\/2019\/08\/28\/create-robust-oo-model-net-rider\">object models<\/a> and hierarchies, good navigation is vital. When investigating a new code base, it really helps to be able to move one level up or down an inheritance chain, or to a specific node in an object model with the lowest effort possible. <strong>Many developers find a tool that displays a visual model to navigate necessary<\/strong>. That\u2019s why Rider provides a hierarchy viewer.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/06\/10907-class-hierarchy.png\" data-gif-src=\"https:\/\/web.archive.org\/web\/20220806091730im_\/https:\/\/lh3.googleusercontent.com\/V-dekicInaIPpGllaAa8BSg_FF5CKAU7EIU8AkLeWJPHDe4-y__kyDiosiXtQ3TCb4LFuR6M7M6ISDwjZ1cQALd_hKwUyPrnngItSKZ5rGeNVJfcRwblkyHheUFYZy-RfIwQc0o5X0EK667KEw\" alt=\"The class hierarchy tool\" width=\"800\"><\/figure>\n\n\n\n<p>Rider provides gutter indicators that jump between base and derived classes when you click on them. This is a super quick way to check what\u2019s in each class in the inheritance chain.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">HTML and CSS<\/h2>\n\n\n\n<p>The best way to navigate HTML (even in Razor and Blazor), as well as many kinds of markup languages, is with breadcrumbs. Many are familiar with the Grimm fairy tales from childhood, where Hansel and Gretel used breadcrumbs to leave a trail in the woods to follow home later. Similarly, breadcrumbs in an editor reveal a path and nested structure of markup so that you can navigate where you want, not just home. In the story, birds ate the breadcrumbs (oops!) and thus the kids became lost in the woods. With Rider, no need to worry about losing your way. Your code may look like a thick forest, but you can always navigate where you want.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/06\/10907-breadcrumb-nav-1.png\" data-gif-src=\"https:\/\/web.archive.org\/web\/20220806091730im_\/https:\/\/lh3.googleusercontent.com\/clCpishxiOIcFe_vIbHoxhq97jET5NSm3urbF80dHC2cmq5_69HDh7PbRL1tm6DPHj3qABsiFE6JrOVlUlx1PYuwxqgTKKMWnkeq4Ap_BxFKBY1-aGY_apN-5agACxdHforzpDpiPBKny1LUCw\" alt=\"Breadcrumb navigation in an HTML page\" width=\"800\"><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Micro-Navigation with Structural Navigation<\/h2>\n\n\n\n<p>While reading through a block of code, a developer\u2019s brain is considering multiple things that are going on at once &#8211; maybe the values of variables changing, the output of a function, or if a certain segment of code works correctly. At this point, the developer could move their hand away from the keyboard to click on the exact location to edit, then back to the keyboard, and to the mouse, and so on&#8230; But the problem is that the time it takes to do this can disrupt workflow, even when the time is less than a second. It all adds up. With this in mind, the Rider team has provided <strong>Structural Navigation<\/strong>.<strong> Structural Navigation is when you need to cycle quickly through discrete parts of blocks of code<\/strong>, generally to make some changes. Place the caret at the beginning of an element of a construct or a function\u2019s signature (for this example, the static keyword) and press Tab to start structural navigation. Rider highlights where you\u2019re at as you continue to press Tab to navigate precisely through the code.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/06\/10907-structural-nav.png\" data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/06\/10907-structural-nav.gif\" alt=\"Structural navigation\" width=\"800\"><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Navigation by value tracking and call chains<\/h2>\n\n\n\n<p>Value origin and value destination inspections in Rider allow you to trace the origin and destination of a token. This is good for tracing while debugging to see and navigate to any and all points where you can change some value. Call tracking works similarly to value tracking in that you can see and navigate to the locations where any and all calls to a particular value have been made. So whether it\u2019s seeing when something has changed or where it has, this code inspection gives you a great investigational tool.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/06\/10907-value-tracking.png\" data-gif-src=\"https:\/\/web.archive.org\/web\/20220806091730im_\/https:\/\/lh3.googleusercontent.com\/NMabovCXzG-iooqwvMZSJMrPJrZ0tPFDJ1a6qtcwQ9Jt9BG8AD9C_R1UGDSExmKDlT2F1IxXYtzo9Reojx6QuWTtXFuDEsQFAnIbg_nH-AiuTHn3JmGHXVNox4Mabv6mtihcrskbfQ81UMboeg\" alt=\"Value tracking and origin tracking navigation\" width=\"800\"><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Navigate to bookmarks and TODO comments<\/h2>\n\n\n\n<p>Let\u2019s not forget about those features that are really helpful but aren\u2019t necessarily intertwined directly with code: Todo\u2019s and bookmarks.<\/p>\n\n\n\n<p>There are a few ways to create a todo list with Rider. You can create a \/\/ TODO &lt;message&gt; to any line of code to make a todo there. Additionally, tools that generate code can only generate the code stubs, so you\u2019ll see the body of methods containing a NotImplementedException. Rider adds these to the todo list. Use <kbd>Ctrl+, T<\/kbd> to display the todo window to view and navigate the Todos in your project.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/06\/10907-todo-navigation.png\" data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/06\/10907-todo-navigation.gif\" alt=\"\" class=\"wp-image-259189\" width=\"800\"><\/figure>\n\n\n\n<p>Bookmarks (<kbd>Alt+2<\/kbd> to show Bookmarks window and <kbd>Ctrl+K,K<\/kbd> to toggle bookmark) are a great way to mark and track code. Sometimes you don\u2019t want to navigate using the relationships in code but rather by some location that is chosen by you for any reason because it applies to the task at hand. Additionally you can navigate through breakpoints in the tool window just the same as bookmarks.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2022\/06\/10907-bookmark-nav.png\" data-gif-src=\"https:\/\/web.archive.org\/web\/20220806091730im_\/https:\/\/lh3.googleusercontent.com\/9ZrNHq2GnVnuzqcA2yaD_xzPnY9jLGsqxLJ2FwzU4v7_Nb-Zz6SglQPfNgRMRKU4uzhXPLtVnhTOAMXXcTrhaKBHSLnDuUuQXd-qiKuf1LObDOJoBvtyoMwxMTRZAY2wJkuupzAZXAHSNRHgRA\" alt=\"Bookmarks and endpoints can be used for navigation too\" width=\"800\"><\/figure>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\"><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<p>In order to understand what a codebase is doing one must be able to see where and how objects are related. Additionally, code exposes metadata through attributes, comments, and other constructs. <strong>Being able to navigate with little to no friction helps you get up to speed quickly and to be able to deeply read and understand the code. The best way to do this is with excellent navigational tools<\/strong>. And Rider provides so many excellent navigational features &#8211; even more than has been shown in this article.<\/p>\n\n\n\n<p><a href=\"https:\/\/jetbrains.com\/rider\" target=\"_blank\" rel=\"noopener\">Download Rider<\/a> today and let us know your favorite ways to navigate your code!<\/p>\n","protected":false},"author":901,"featured_media":259223,"comment_status":"closed","ping_status":"closed","template":"","categories":[4992,1401],"tags":[915,211,604,2060,198,763,1914,2863],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/dotnet\/258654"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/dotnet"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/types\/dotnet"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/users\/901"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/comments?post=258654"}],"version-history":[{"count":9,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/dotnet\/258654\/revisions"}],"predecessor-version":[{"id":630996,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/dotnet\/258654\/revisions\/630996"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media\/259223"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media?parent=258654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/categories?post=258654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/tags?post=258654"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/cross-post-tag?post=258654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}