Chapter 3. Finding What You Need Quickly

It is always important to find proper things quickly. ReSharper comes with many features to find files, code references, or navigate through your code quickly. Now let us find out how to use these features.

In this chapter, we will cover the following topics:

  • Finding a proper file
  • Searching for code references
  • Navigating to library code
  • Displaying the code structure

Finding files

In every project, code is divided into files. Depending on the size of your application, there can be hundreds or even thousands of files. More files make it harder to find the right one. ReSharper provides you with a few features that can help you find the file you need, quicker.

Every time you search for something in ReSharper, you can use the following wildcards:

  • * (asterisk) as zero or more characters
  • ? (question mark) as one character or zero characters
  • + (plus) as one or more characters

CamelHumps are also supported by ReSharper and you can specify the line to which you would like to go.

Going to a proper file

The easiest way to find a file is to search it by its name. With ReSharper, it is very easy—just press Ctrl + Shift + T (Go to File) and write the name of the file that you would like to open.

Another useful way to open the proper file is to find a type contained in it. The type can be class, enum, and so on. Let's press Ctrl + T, T (Go to Type) and type the name of your class or any other type that you need.

Even if your project contains thousands of files, you are usually working on only a couple of them. In this case, it can be helpful for you to display a list of Recent Files. Just press Ctrl + , and you will see a list similar to the following screenshot:

Going to a proper file

Tip

You can easily filter a list of these files. Just start typing what you need!

Another often-used shortcut is Shift + Alt + L. It selects the currently opened file in Solution Explorer. It is useful when you need to open the current file properties or just open a file in the same folder.

Bookmarks

Bookmarks allow you to mark the most important places in your code and quickly navigate to them.

You can add up to 10 numbered bookmarks and unlimited non-numbered bookmarks. To create a numbered bookmark, just press Ctrl + Shift + any number from the keypad. With the same shortcut, you can remove the bookmark—just press it a second time on the same line. To go to a numbered bookmark, press Ctrl + that number.

You can also display a list of all bookmarks using the Ctrl + ` shortcut. The same shortcut allows you to manage non-numbered bookmarks.

The following screenshot presents a list of created bookmarks and markers with numbered bookmarks:

Bookmarks

The last edited location

Additionally, to move between bookmarks, you can easily jump to the latest place at which you edited the code. To do this, press Ctrl + Shift + Backspace.

Go to Everything

As you can see, ReSharper allows you to find the proper file by searching for it using the name or type contained in it. To do this, you need to use different shortcuts, but not if you are using ReSharper v8.

ReSharper v8 comes with a new way to find files—Go to Everything. This is a merged version to search by name or type and really allows you to search everything! You can search almost everything you have in your code by your class name, method, and properties.

Tip

In every Go to … option, you can open search results in a separate Find Results window by pressing + on the numerical pad or by clicking on the Show in Find Results icon as shown in the following screenshot:

Go to Everything

To use the Go to Everything feature, just press Ctrl + T.

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

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