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.
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 will remember the last 10 searches we navigated to. This makes it easy to repeat searches without having to type them again.
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.
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.
Do give it a try and let us hear your feedback through the comments below!