Displaying code structure

So far, we have learned how to search for files and relations in your project. Now, let's see how ReSharper can help you view your code structure.

File members

When you are working with a file, ReSharper makes it very easy to navigate between different members in the file.

Simply press Alt + (File members) and ReSharper will display a list of all the available members, and will allow you to quickly jump to the selected member by pressing Enter.

The File Structure window

Additionally, you can display the file structure in a separate window. You can open the File Structure window by navigating to RESHARPER | Windows | File Structure from the Visual Studio toolbar or by using the Ctrl + Alt + F shortcut.

A sample view of the File Structure window is shown in the following screenshot:

The File Structure window

Value Origin and Destination

With ReSharper, you can easily check how values are passed around in your code. By pressing Ctrl + Shift + Alt + A (Value Origin and Destination), you can open a menu with the following two options:

  • Value Origin: This shows you where the analyzed variable comes from
  • Value Destination: This shows you where the analyzed variable will be passed to

Results are displayed in the Inspection Results window. A sample view of this window is shown in the following screenshot:

Value Origin and Destination

In the previous screenshot, we analyzed the blogToCreate variable inside the CreateBlog method from the BlogRepository class. As you can see, this value can be passed from the BlogService or BlogRepositoryTests class. You can check how this value is passed to these classes or how it is created inside them. ReSharper displays the code preview, which shows you exactly how this variable has been used. You can easily navigate between these places, which makes the process of analyzing your code much easier.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.172.132