Navigate to text in a solution with Go to Text in ReSharper

Navigating within a solution is easy with ReSharper. Hitting Ctrl+T lets us navigate to types, symbols and files in our solution. In ReSharper Ultimate 2016.2 we added another navigation, Go to Text, which makes navigation to text in source and textual files much easier than using Visual Studio’s Find in Files. And much faster, too!

Now why add another navigation when we already have things like Find Usages, Go to Everything, Go to Implementation and so on? Not everything is code. Very often a solution may contain pure string references, like error messages emitted to the user. Comments may have issue numbers from a bug tracker in them. We may want to find a specific string value throughout our code base. Or search where a regular expression is used. Using Go to Text we can navigate to those very easily, whether the results are in source files, configuration, JSON or elsewhere.

Press Ctrl+T 3 times or use the ReSharper | Navigate | Go to Text menu to bring up the navigation pop-up. After typing (part of) the text to search, we can use the arrow keys to navigate through the list of results.

Using Go to Text to find a connection string throughout codebase

The nice thing is Go to Text searches in both source files and other known file types. In the above example, that makes it really easy to search where a specific setting is being used, whether in code, configuration files or elsewhere.

Just as with other navigation types in ReSharper, we can select an item from the list of results and press Enter (or click the item) to navigate there directly. We can also use the Show in Find results (+ on the numeric keypad) to display the list of results in a separate window.

Go to Text show results in separate window

Go to Text will remember the last 10 searches we navigated to. This makes it easy to repeat searches without having to type them again.

Repeat searches in Go to Text

A nice touch is auto-paste from selection and from clipboard. We can select text in the editor and then press Ctrl+T 3 times to immediately start searching for that selection.

Select text and invoke Go to Text to search for selection

By default, Go to Text searches in all source files and in any .bat, .ps1, .md, .txt, .sql, .rb, .php, .py, .java, .jsp, .kt, .ini or .fx file. Want to exclude files and folders? In ReSharper’s options, find the Environment | Search & Navigation page and add them under Elements to skip.

The Go to Text navigation is bundled with ReSharper Ultimate 2016.2. For earlier versions, head over to the extension manager and install the Go to Word extension with similar functionality.

Do give it a try and let us hear your feedback through the comments below!

This entry was posted in How-To's and tagged , , . Bookmark the permalink.

14 Responses to Navigate to text in a solution with Go to Text in ReSharper

  1. Sean Feldman says:

    Looks lik
    Is Ctrl-T x3 a IDEA or VS keybinding? VisualStudio doesn’t allow shortcuts with more than twice CTRL- used. Could you please clarify? Thank you.

  2. KP says:

    Like shown in the sample I would say that *.dll.config doesn’t have to be searched (by default), because it is less relevant in my opinion.

    • Maarten Balliauw says:

      In this solution, the .dll.config is explicitly included as a project item, so it makes sense to search in there as well.

  3. Pingback: Dew Drop - October 27, 2016 (#2354) - Morning Dew

  4. Roland Schoofs says:

    How do you skip files like *.Designer.cs?

    • Maarten Balliauw says:

      You can configure this in the options. Under Environment | Search and Navigations, you can specify the files and folders to skip.

  5. Aviran Barda says:

    Hi,
    It seems that for some reason the Resharper Ctrl-T x3 is not searching in my whole solution.
    Instead I think it is searching only in opened files.
    I would like it to search the entire solution. How should I define that?

    • Maarten Balliauw says:

      That should not be the case. Can you try flushing caches? ReSharper | Options | General -> Clear Caches

  6. Alex Maris says:

    I’m running into the same issue as Aviran Barda, the Navigate To Text action is only searching the currently opened files.

  7. Lutz Fritsche says:

    Where is the usual “whole word” option?

Leave a Reply

Your email address will not be published. Required fields are marked *