Dotnet logo

.NET Tools

Essential productivity kit for .NET and game developers

How-To's

ReSharper 2017.2 – what’s new in navigation?

ReSharper has always had a rich search and navigation system for finding files, classes, methods and even text. With the release of ReSharper Ultimate 2017.2, we’ve made a number of improvements to navigation: better search and matching, exact search, integrated Go to Text and a new way to navigate to files nearby.

All of these additions make it even easier to find what we’re looking for in our solution. Let’s dive in!

Navigation and search recap

ReSharper’s navigation features help us navigate to types, type members, files, text, contextual actions, … These navigations are all powered by a search engine that supports simple searches (including misspellings), as well as:

  • Partial search terms
    e.g. a search for per will match Person
  • CamelHumps
    e.g. a search for ive will match IViewEngine
  • Navigation combos
    e.g. a search for AccountService Create or AS C will match the Create method in AccountService, a search for AccountService 25 or AS 25 will match AccountService line 25
  • Filters
    e.g. a search with /t will search for types, /m will search for members, /mm will search for methods, /ff will search for a project folder, … (hint: type / in Go to Everything (Ctrl+T) to get a list of all filters)Note that Go to Text (Ctrl+T,T,T), has a few more – e.g. using /cp will search in the current project, /ext will search in files with a specific extension, /fm will search in files with a specific file mask

Navigation and search improvements

ReSharper 2017.2 includes some updates to how search results are matched. When using navigations such as Go to Everything (Ctrl+T)Go to File Member (Alt+\) or Go to Action (Alt+Enter), ReSharper will now match elements containing words in the target query in any order. For example, a search for ValidUser will also match UserValid:

Search Everywhere - Searches in different word order

Too free-format? Want to be more specific in searching within a codebase? No problem. We also introduced exact search. Much like with an Internet search engine, we can add quotes around a search query. Something like "Person" will return Person but never PersonRepository, AddPerson(), etc.

Search Everywhere - Exact Search

It’s possible to combine exact search with wildcard characters like * and ?, so we can search for "Person*" to find Person and PersonRepository, but not AddPerson():

Search Everywhere - Exact search with wildcards

Another addition to search is finding extension methods. Using the TypeName.ExtensionMethod syntax (with a . separator), we can find extension methods on a given type:

Search Extension Method using dot separator

Exploring search results

A number of changes went into exploring search results. One such change is that Go to Text is now integrated in Go to Everything (Ctrl+T). If there’s no type, file or symbol that corresponds to our search term, ReSharper will search for text. This means that we can search for any text in our solution and navigate to, for example, a Markdown file or an application setting based on a simple text search.

Go to Text is now integrated in Search Everywhere and can find text in the solution

When search yields a large number of results, it may be useful to explore them in the Find Results window. For any search, we can now hit a laptop-friendly Shift+Enter shortcut to open search results in a separate tool window where we can explore and filter items more easily. (The older + shortcut to flush search results is still available as well.)

Open search results in Find Results tool window

Navigate to File Nearby

We can perform contextual navigation using the Navigate To menu (Alt+Backquote). For example from a derived type, we can navigate up to the base class. Or from an interface, we can navigate to implementation. We now added a new option: Navigate to File Nearby.

Navigate to File Nearby displays project structure around our current file: the solution and project is shown, we can see folders and files that are in the same directory as our current file, and easily jump to these or create a new element at a certain location:

Navigate to File Nearby

Download ReSharper Ultimate 2017.2! We’d love to hear your feedback on these navigation improvements.

image description